Create agents in worktrees with auto-archive (#1120)
* Add daemon worktree auto-archive spawning * Refactor create agent lifecycle dispatch * Stabilize Claude autonomous turn test
This commit is contained in:
@@ -1058,6 +1058,24 @@ const GitSetupOptionsSchema = z.object({
|
||||
|
||||
export type GitSetupOptions = z.infer<typeof GitSetupOptionsSchema>;
|
||||
|
||||
export const CreateAgentWorktreeTargetSchema = z.discriminatedUnion("mode", [
|
||||
z.object({
|
||||
mode: z.literal("branch-off"),
|
||||
newBranch: z.string().min(1),
|
||||
base: z.string().min(1).optional(),
|
||||
}),
|
||||
z.object({
|
||||
mode: z.literal("checkout-branch"),
|
||||
branch: z.string().min(1),
|
||||
}),
|
||||
z.object({
|
||||
mode: z.literal("checkout-pr"),
|
||||
prNumber: z.number().int().positive(),
|
||||
}),
|
||||
]);
|
||||
|
||||
export type CreateAgentWorktreeTarget = z.infer<typeof CreateAgentWorktreeTargetSchema>;
|
||||
|
||||
export const CreateAgentRequestMessageSchema = z.object({
|
||||
type: z.literal("create_agent_request"),
|
||||
config: AgentSessionConfigSchema,
|
||||
@@ -1070,6 +1088,8 @@ export const CreateAgentRequestMessageSchema = z.object({
|
||||
images: z.array(ImageAttachmentSchema).optional(),
|
||||
attachments: AgentAttachmentsSchema,
|
||||
git: GitSetupOptionsSchema.optional(),
|
||||
worktree: CreateAgentWorktreeTargetSchema.optional(),
|
||||
autoArchive: z.boolean().optional(),
|
||||
labels: z.record(z.string()).default({}),
|
||||
requestId: z.string(),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user