mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-19 20:00:48 +00:00
factory: rename project and handoff actors
This commit is contained in:
parent
3022bce2ad
commit
ea7c36a8e7
147 changed files with 6313 additions and 14364 deletions
|
|
@ -1,7 +1,7 @@
|
|||
export type FactoryBillingPlanId = "free" | "team" | "enterprise";
|
||||
export type FactoryBillingPlanId = "free" | "team";
|
||||
export type FactoryBillingStatus = "active" | "trialing" | "past_due" | "scheduled_cancel";
|
||||
export type FactoryRepoImportStatus = "ready" | "not_started" | "importing";
|
||||
export type FactoryGithubInstallationStatus = "connected" | "install_required" | "reconnect_required";
|
||||
export type FactoryGithubSyncStatus = "pending" | "syncing" | "synced" | "error";
|
||||
export type FactoryOrganizationKind = "personal" | "organization";
|
||||
|
||||
export interface FactoryUser {
|
||||
|
|
@ -43,8 +43,10 @@ export interface FactoryBillingState {
|
|||
export interface FactoryGithubState {
|
||||
connectedAccount: string;
|
||||
installationStatus: FactoryGithubInstallationStatus;
|
||||
syncStatus: FactoryGithubSyncStatus;
|
||||
importedRepoCount: number;
|
||||
lastSyncLabel: string;
|
||||
lastSyncAt: number | null;
|
||||
}
|
||||
|
||||
export interface FactoryOrganizationSettings {
|
||||
|
|
@ -65,7 +67,6 @@ export interface FactoryOrganization {
|
|||
billing: FactoryBillingState;
|
||||
members: FactoryOrganizationMember[];
|
||||
seatAssignments: string[];
|
||||
repoImportStatus: FactoryRepoImportStatus;
|
||||
repoCatalog: string[];
|
||||
}
|
||||
|
||||
|
|
@ -85,4 +86,3 @@ export interface UpdateFactoryOrganizationProfileInput {
|
|||
slug: string;
|
||||
primaryDomain: string;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ export const ConfigSchema = z.object({
|
|||
backend: z.object({
|
||||
host: z.string().default("127.0.0.1"),
|
||||
port: z.number().int().min(1).max(65535).default(7741),
|
||||
dbPath: z.string().default("~/.local/share/sandbox-agent-factory/handoff.db"),
|
||||
dbPath: z.string().default("~/.local/share/sandbox-agent-factory/task.db"),
|
||||
opencode_poll_interval: z.number().default(2),
|
||||
github_poll_interval: z.number().default(30),
|
||||
backup_interval_secs: z.number().default(3600),
|
||||
|
|
@ -32,7 +32,7 @@ export const ConfigSchema = z.object({
|
|||
}).default({
|
||||
host: "127.0.0.1",
|
||||
port: 7741,
|
||||
dbPath: "~/.local/share/sandbox-agent-factory/handoff.db",
|
||||
dbPath: "~/.local/share/sandbox-agent-factory/task.db",
|
||||
opencode_poll_interval: 2,
|
||||
github_poll_interval: 30,
|
||||
backup_interval_secs: 3600,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ export type RepoId = z.infer<typeof RepoIdSchema>;
|
|||
export const RepoRemoteSchema = z.string().min(1).max(2048);
|
||||
export type RepoRemote = z.infer<typeof RepoRemoteSchema>;
|
||||
|
||||
export const HandoffStatusSchema = z.enum([
|
||||
export const TaskStatusSchema = z.enum([
|
||||
"init_bootstrap_db",
|
||||
"init_enqueue_provision",
|
||||
"init_ensure_name",
|
||||
|
|
@ -36,9 +36,9 @@ export const HandoffStatusSchema = z.enum([
|
|||
"kill_destroy_sandbox",
|
||||
"kill_finalize",
|
||||
"killed",
|
||||
"error"
|
||||
"error",
|
||||
]);
|
||||
export type HandoffStatus = z.infer<typeof HandoffStatusSchema>;
|
||||
export type TaskStatus = z.infer<typeof TaskStatusSchema>;
|
||||
|
||||
export const RepoRecordSchema = z.object({
|
||||
workspaceId: WorkspaceIdSchema,
|
||||
|
|
@ -55,28 +55,30 @@ export const AddRepoInputSchema = z.object({
|
|||
});
|
||||
export type AddRepoInput = z.infer<typeof AddRepoInputSchema>;
|
||||
|
||||
export const CreateHandoffInputSchema = z.object({
|
||||
export const CreateTaskInputSchema = z.object({
|
||||
workspaceId: WorkspaceIdSchema,
|
||||
repoId: RepoIdSchema,
|
||||
repoIds: z.array(RepoIdSchema).min(1).optional(),
|
||||
task: z.string().min(1),
|
||||
explicitTitle: z.string().trim().min(1).optional(),
|
||||
explicitBranchName: z.string().trim().min(1).optional(),
|
||||
providerId: ProviderIdSchema.optional(),
|
||||
agentType: AgentTypeSchema.optional(),
|
||||
onBranch: z.string().trim().min(1).optional()
|
||||
onBranch: z.string().trim().min(1).optional(),
|
||||
});
|
||||
export type CreateHandoffInput = z.infer<typeof CreateHandoffInputSchema>;
|
||||
export type CreateTaskInput = z.infer<typeof CreateTaskInputSchema>;
|
||||
|
||||
export const HandoffRecordSchema = z.object({
|
||||
export const TaskRecordSchema = z.object({
|
||||
workspaceId: WorkspaceIdSchema,
|
||||
repoId: z.string().min(1),
|
||||
repoId: RepoIdSchema,
|
||||
repoIds: z.array(RepoIdSchema).min(1).optional(),
|
||||
repoRemote: RepoRemoteSchema,
|
||||
handoffId: z.string().min(1),
|
||||
taskId: z.string().min(1),
|
||||
branchName: z.string().min(1).nullable(),
|
||||
title: z.string().min(1).nullable(),
|
||||
task: z.string().min(1),
|
||||
providerId: ProviderIdSchema,
|
||||
status: HandoffStatusSchema,
|
||||
status: TaskStatusSchema,
|
||||
statusMessage: z.string().nullable(),
|
||||
activeSandboxId: z.string().nullable(),
|
||||
activeSessionId: z.string().nullable(),
|
||||
|
|
@ -89,7 +91,7 @@ export const HandoffRecordSchema = z.object({
|
|||
cwd: z.string().nullable(),
|
||||
createdAt: z.number().int(),
|
||||
updatedAt: z.number().int(),
|
||||
})
|
||||
}),
|
||||
),
|
||||
agentType: z.string().nullable(),
|
||||
prSubmitted: z.boolean(),
|
||||
|
|
@ -103,40 +105,41 @@ export const HandoffRecordSchema = z.object({
|
|||
hasUnpushed: z.string().nullable(),
|
||||
parentBranch: z.string().nullable(),
|
||||
createdAt: z.number().int(),
|
||||
updatedAt: z.number().int()
|
||||
updatedAt: z.number().int(),
|
||||
});
|
||||
export type HandoffRecord = z.infer<typeof HandoffRecordSchema>;
|
||||
export type TaskRecord = z.infer<typeof TaskRecordSchema>;
|
||||
|
||||
export const HandoffSummarySchema = z.object({
|
||||
export const TaskSummarySchema = z.object({
|
||||
workspaceId: WorkspaceIdSchema,
|
||||
repoId: z.string().min(1),
|
||||
handoffId: z.string().min(1),
|
||||
repoId: RepoIdSchema,
|
||||
repoIds: z.array(RepoIdSchema).min(1).optional(),
|
||||
taskId: z.string().min(1),
|
||||
branchName: z.string().min(1).nullable(),
|
||||
title: z.string().min(1).nullable(),
|
||||
status: HandoffStatusSchema,
|
||||
updatedAt: z.number().int()
|
||||
status: TaskStatusSchema,
|
||||
updatedAt: z.number().int(),
|
||||
});
|
||||
export type HandoffSummary = z.infer<typeof HandoffSummarySchema>;
|
||||
export type TaskSummary = z.infer<typeof TaskSummarySchema>;
|
||||
|
||||
export const HandoffActionInputSchema = z.object({
|
||||
export const TaskActionInputSchema = z.object({
|
||||
workspaceId: WorkspaceIdSchema,
|
||||
handoffId: z.string().min(1)
|
||||
taskId: z.string().min(1),
|
||||
});
|
||||
export type HandoffActionInput = z.infer<typeof HandoffActionInputSchema>;
|
||||
export type TaskActionInput = z.infer<typeof TaskActionInputSchema>;
|
||||
|
||||
export const SwitchResultSchema = z.object({
|
||||
workspaceId: WorkspaceIdSchema,
|
||||
handoffId: z.string().min(1),
|
||||
taskId: z.string().min(1),
|
||||
providerId: ProviderIdSchema,
|
||||
switchTarget: z.string().min(1)
|
||||
switchTarget: z.string().min(1),
|
||||
});
|
||||
export type SwitchResult = z.infer<typeof SwitchResultSchema>;
|
||||
|
||||
export const ListHandoffsInputSchema = z.object({
|
||||
export const ListTasksInputSchema = z.object({
|
||||
workspaceId: WorkspaceIdSchema,
|
||||
repoId: RepoIdSchema.optional()
|
||||
repoId: RepoIdSchema.optional(),
|
||||
});
|
||||
export type ListHandoffsInput = z.infer<typeof ListHandoffsInputSchema>;
|
||||
export type ListTasksInput = z.infer<typeof ListTasksInputSchema>;
|
||||
|
||||
export const RepoBranchRecordSchema = z.object({
|
||||
branchName: z.string().min(1),
|
||||
|
|
@ -146,9 +149,9 @@ export const RepoBranchRecordSchema = z.object({
|
|||
diffStat: z.string().nullable(),
|
||||
hasUnpushed: z.boolean(),
|
||||
conflictsWithMain: z.boolean(),
|
||||
handoffId: z.string().nullable(),
|
||||
handoffTitle: z.string().nullable(),
|
||||
handoffStatus: HandoffStatusSchema.nullable(),
|
||||
taskId: z.string().nullable(),
|
||||
taskTitle: z.string().nullable(),
|
||||
taskStatus: TaskStatusSchema.nullable(),
|
||||
prNumber: z.number().int().nullable(),
|
||||
prState: z.string().nullable(),
|
||||
prUrl: z.string().nullable(),
|
||||
|
|
@ -157,7 +160,7 @@ export const RepoBranchRecordSchema = z.object({
|
|||
reviewer: z.string().nullable(),
|
||||
firstSeenAt: z.number().int().nullable(),
|
||||
lastSeenAt: z.number().int().nullable(),
|
||||
updatedAt: z.number().int()
|
||||
updatedAt: z.number().int(),
|
||||
});
|
||||
export type RepoBranchRecord = z.infer<typeof RepoBranchRecordSchema>;
|
||||
|
||||
|
|
@ -168,7 +171,7 @@ export const RepoOverviewSchema = z.object({
|
|||
baseRef: z.string().nullable(),
|
||||
stackAvailable: z.boolean(),
|
||||
fetchedAt: z.number().int(),
|
||||
branches: z.array(RepoBranchRecordSchema)
|
||||
branches: z.array(RepoBranchRecordSchema),
|
||||
});
|
||||
export type RepoOverview = z.infer<typeof RepoOverviewSchema>;
|
||||
|
||||
|
|
@ -177,7 +180,7 @@ export const RepoStackActionSchema = z.enum([
|
|||
"restack_repo",
|
||||
"restack_subtree",
|
||||
"rebase_branch",
|
||||
"reparent_branch"
|
||||
"reparent_branch",
|
||||
]);
|
||||
export type RepoStackAction = z.infer<typeof RepoStackActionSchema>;
|
||||
|
||||
|
|
@ -186,7 +189,7 @@ export const RepoStackActionInputSchema = z.object({
|
|||
repoId: RepoIdSchema,
|
||||
action: RepoStackActionSchema,
|
||||
branchName: z.string().trim().min(1).optional(),
|
||||
parentBranch: z.string().trim().min(1).optional()
|
||||
parentBranch: z.string().trim().min(1).optional(),
|
||||
});
|
||||
export type RepoStackActionInput = z.infer<typeof RepoStackActionInputSchema>;
|
||||
|
||||
|
|
@ -194,12 +197,12 @@ export const RepoStackActionResultSchema = z.object({
|
|||
action: RepoStackActionSchema,
|
||||
executed: z.boolean(),
|
||||
message: z.string().min(1),
|
||||
at: z.number().int()
|
||||
at: z.number().int(),
|
||||
});
|
||||
export type RepoStackActionResult = z.infer<typeof RepoStackActionResultSchema>;
|
||||
|
||||
export const WorkspaceUseInputSchema = z.object({
|
||||
workspaceId: WorkspaceIdSchema
|
||||
workspaceId: WorkspaceIdSchema,
|
||||
});
|
||||
export type WorkspaceUseInput = z.infer<typeof WorkspaceUseInputSchema>;
|
||||
|
||||
|
|
@ -207,7 +210,7 @@ export const HistoryQueryInputSchema = z.object({
|
|||
workspaceId: WorkspaceIdSchema,
|
||||
limit: z.number().int().positive().max(500).optional(),
|
||||
branch: z.string().min(1).optional(),
|
||||
handoffId: z.string().min(1).optional()
|
||||
taskId: z.string().min(1).optional(),
|
||||
});
|
||||
export type HistoryQueryInput = z.infer<typeof HistoryQueryInputSchema>;
|
||||
|
||||
|
|
@ -215,38 +218,38 @@ export const HistoryEventSchema = z.object({
|
|||
id: z.number().int(),
|
||||
workspaceId: WorkspaceIdSchema,
|
||||
repoId: z.string().nullable(),
|
||||
handoffId: z.string().nullable(),
|
||||
taskId: z.string().nullable(),
|
||||
branchName: z.string().nullable(),
|
||||
kind: z.string().min(1),
|
||||
payloadJson: z.string().min(1),
|
||||
createdAt: z.number().int()
|
||||
createdAt: z.number().int(),
|
||||
});
|
||||
export type HistoryEvent = z.infer<typeof HistoryEventSchema>;
|
||||
|
||||
export const PruneInputSchema = z.object({
|
||||
workspaceId: WorkspaceIdSchema,
|
||||
dryRun: z.boolean(),
|
||||
yes: z.boolean()
|
||||
yes: z.boolean(),
|
||||
});
|
||||
export type PruneInput = z.infer<typeof PruneInputSchema>;
|
||||
|
||||
export const KillInputSchema = z.object({
|
||||
workspaceId: WorkspaceIdSchema,
|
||||
handoffId: z.string().min(1),
|
||||
taskId: z.string().min(1),
|
||||
deleteBranch: z.boolean(),
|
||||
abandon: z.boolean()
|
||||
abandon: z.boolean(),
|
||||
});
|
||||
export type KillInput = z.infer<typeof KillInputSchema>;
|
||||
|
||||
export const StatuslineInputSchema = z.object({
|
||||
workspaceId: WorkspaceIdSchema,
|
||||
format: z.enum(["table", "claude-code"])
|
||||
format: z.enum(["table", "claude-code"]),
|
||||
});
|
||||
export type StatuslineInput = z.infer<typeof StatuslineInputSchema>;
|
||||
|
||||
export const ListInputSchema = z.object({
|
||||
workspaceId: WorkspaceIdSchema,
|
||||
format: z.enum(["table", "json"]),
|
||||
full: z.boolean()
|
||||
full: z.boolean(),
|
||||
});
|
||||
export type ListInput = z.infer<typeof ListInputSchema>;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
export type WorkbenchHandoffStatus = "running" | "idle" | "new" | "archived";
|
||||
export type WorkbenchTaskStatus = "running" | "idle" | "new" | "archived";
|
||||
export type WorkbenchAgentKind = "Claude" | "Codex" | "Cursor";
|
||||
export type WorkbenchModelId = "claude-sonnet-4" | "claude-opus-4" | "gpt-4o" | "o3";
|
||||
|
||||
|
|
@ -76,11 +76,12 @@ export interface WorkbenchPullRequestSummary {
|
|||
status: "draft" | "ready";
|
||||
}
|
||||
|
||||
export interface WorkbenchHandoff {
|
||||
export interface WorkbenchTask {
|
||||
id: string;
|
||||
repoId: string;
|
||||
repoIds?: string[];
|
||||
title: string;
|
||||
status: WorkbenchHandoffStatus;
|
||||
status: WorkbenchTaskStatus;
|
||||
repoName: string;
|
||||
updatedAtMs: number;
|
||||
branch: string | null;
|
||||
|
|
@ -96,18 +97,18 @@ export interface WorkbenchRepo {
|
|||
label: string;
|
||||
}
|
||||
|
||||
export interface WorkbenchProjectSection {
|
||||
export interface WorkbenchRepoSection {
|
||||
id: string;
|
||||
label: string;
|
||||
updatedAtMs: number;
|
||||
handoffs: WorkbenchHandoff[];
|
||||
tasks: WorkbenchTask[];
|
||||
}
|
||||
|
||||
export interface HandoffWorkbenchSnapshot {
|
||||
export interface TaskWorkbenchSnapshot {
|
||||
workspaceId: string;
|
||||
repos: WorkbenchRepo[];
|
||||
projects: WorkbenchProjectSection[];
|
||||
handoffs: WorkbenchHandoff[];
|
||||
repoSections: WorkbenchRepoSection[];
|
||||
tasks: WorkbenchTask[];
|
||||
}
|
||||
|
||||
export interface WorkbenchModelOption {
|
||||
|
|
@ -120,62 +121,67 @@ export interface WorkbenchModelGroup {
|
|||
models: WorkbenchModelOption[];
|
||||
}
|
||||
|
||||
export interface HandoffWorkbenchSelectInput {
|
||||
handoffId: string;
|
||||
export interface TaskWorkbenchSelectInput {
|
||||
taskId: string;
|
||||
}
|
||||
|
||||
export interface HandoffWorkbenchCreateHandoffInput {
|
||||
export interface TaskWorkbenchCreateTaskInput {
|
||||
repoId: string;
|
||||
repoIds?: string[];
|
||||
task: string;
|
||||
title?: string;
|
||||
branch?: string;
|
||||
model?: WorkbenchModelId;
|
||||
}
|
||||
|
||||
export interface HandoffWorkbenchRenameInput {
|
||||
handoffId: string;
|
||||
export type TaskWorkbenchCreateInput = TaskWorkbenchCreateTaskInput;
|
||||
|
||||
export interface TaskWorkbenchRenameInput {
|
||||
taskId: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface HandoffWorkbenchSendMessageInput {
|
||||
handoffId: string;
|
||||
export interface TaskWorkbenchSendMessageInput {
|
||||
taskId: string;
|
||||
tabId: string;
|
||||
text: string;
|
||||
attachments: WorkbenchLineAttachment[];
|
||||
}
|
||||
|
||||
export interface HandoffWorkbenchTabInput {
|
||||
handoffId: string;
|
||||
export interface TaskWorkbenchTabInput {
|
||||
taskId: string;
|
||||
tabId: string;
|
||||
}
|
||||
|
||||
export interface HandoffWorkbenchRenameSessionInput extends HandoffWorkbenchTabInput {
|
||||
export interface TaskWorkbenchRenameSessionInput extends TaskWorkbenchTabInput {
|
||||
title: string;
|
||||
}
|
||||
|
||||
export interface HandoffWorkbenchChangeModelInput extends HandoffWorkbenchTabInput {
|
||||
export interface TaskWorkbenchChangeModelInput extends TaskWorkbenchTabInput {
|
||||
model: WorkbenchModelId;
|
||||
}
|
||||
|
||||
export interface HandoffWorkbenchUpdateDraftInput extends HandoffWorkbenchTabInput {
|
||||
export interface TaskWorkbenchUpdateDraftInput extends TaskWorkbenchTabInput {
|
||||
text: string;
|
||||
attachments: WorkbenchLineAttachment[];
|
||||
}
|
||||
|
||||
export interface HandoffWorkbenchSetSessionUnreadInput extends HandoffWorkbenchTabInput {
|
||||
export interface TaskWorkbenchSetSessionUnreadInput extends TaskWorkbenchTabInput {
|
||||
unread: boolean;
|
||||
}
|
||||
|
||||
export interface HandoffWorkbenchDiffInput {
|
||||
handoffId: string;
|
||||
export interface TaskWorkbenchDiffInput {
|
||||
taskId: string;
|
||||
path: string;
|
||||
}
|
||||
|
||||
export interface HandoffWorkbenchCreateHandoffResponse {
|
||||
handoffId: string;
|
||||
export interface TaskWorkbenchCreateTaskResponse {
|
||||
taskId: string;
|
||||
tabId?: string;
|
||||
}
|
||||
|
||||
export interface HandoffWorkbenchAddTabResponse {
|
||||
export type TaskWorkbenchCreateResponse = TaskWorkbenchCreateTaskResponse;
|
||||
|
||||
export interface TaskWorkbenchAddTabResponse {
|
||||
tabId: string;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue