import { StringEnum } from "@bastani/atomic"; import { Type } from "typebox"; export const MAX_PARALLEL_TASKS = 50; const TaskItem = Type.Object({ agent: Type.String({ description: "Name of the agent to invoke" }), task: Type.String({ description: "Task to delegate to the agent" }), cwd: Type.Optional(Type.String({ description: "Working directory for the agent process" })), }); const AgentScopeSchema = StringEnum(["user", "project", "both"] as const, { description: 'Which agent directories to use. Default: "user". Use "both" to include project-local agents.', default: "user", }); export const SubagentParams = Type.Object({ agent: Type.Optional( Type.String({ description: "Name of the agent to invoke (for single mode)", }), ), task: Type.Optional(Type.String({ description: "Task to delegate (for single mode)" })), tasks: Type.Optional( Type.Array(TaskItem, { description: `Array of {agent, task} for parallel execution (max ${MAX_PARALLEL_TASKS})`, maxItems: MAX_PARALLEL_TASKS, }), ), agentScope: Type.Optional(AgentScopeSchema), confirmProjectAgents: Type.Optional( Type.Boolean({ description: "Prompt before running project-local agents. Default: true.", default: true, }), ), cwd: Type.Optional( Type.String({ description: "Working directory for the agent process (single mode)", }), ), });