import type { PermissionMode } from './permissions.js'; export type AgentInput = { description: string; prompt: string; subagent_type?: string; model?: string; mode?: PermissionMode; run_in_background?: boolean; name?: string; /** @deprecated Ignored. Named teammates use the session's implicit team. */ team_name?: string; /** `default` disables definition-level worktree isolation for this invocation. */ isolation?: 'default' | 'worktree'; }; export type AgentToolCompletionResult = { kind: 'agent-result'; agentId?: string; agentType: string; content: string; state: 'running' | 'completed' | 'error' | 'cancelled'; apiError?: string; terminateReason?: 'ERROR' | 'TIMEOUT' | 'GOAL' | 'MAX_TURNS' | 'ABORTED' | 'ERROR_NO_COMPLETE_TASK_CALL'; terminationDetails?: { maxTurns?: number; }; outputPath?: string; transcriptPath?: string; worktreePath?: string; remoteContextId?: string; remoteTaskId?: string; }; export type AgentToolBackgroundLaunchResult = { isAsync: true; status: 'async_launched'; agentId: string; description: string; resolvedModel?: string; prompt: string; outputFile: string; canReadOutputFile?: boolean; }; export type AgentToolTeammateSpawnedResult = { status: 'teammate_spawned'; prompt: string; teammate_id: string; agent_id: string; agent_type?: string; model?: string; name: string; color?: string; tmux_session_name: 'in-process'; tmux_window_name: 'in-process'; tmux_pane_id: 'in-process'; team_name: string; is_splitpane: false; plan_mode_required: boolean; }; export type AgentOutput = AgentToolCompletionResult | AgentToolBackgroundLaunchResult | AgentToolTeammateSpawnedResult; export type BashInput = { command: string; timeout?: number; description?: string; run_in_background?: boolean; }; export type BashToolBackgroundLaunchResult = { kind: 'backgrounded'; pid: number; taskId: string; outputFile?: string; command: string; stdout?: string; initialOutput: string; backgroundReason?: 'user' | 'model' | 'timeout' | 'auto'; telemetryExecutionId?: string; totalLines?: number; totalBytes?: number; }; export declare function isBashToolBackgroundLaunchResult(value: unknown): value is BashToolBackgroundLaunchResult; export type BashOutput = { stdout: string; stderr: string; exitCode: number; interrupted?: boolean; }; export type FileReadInput = { file_path: string; offset?: number; limit?: number; pages?: string; }; export type FileReadOutputText = { type: 'text'; text: string; file_path: string; totalLines?: number; }; export type FileReadOutputImage = { type: 'image'; source: { type: 'base64'; media_type: string; data: string; }; file_path: string; }; export type FileReadOutputNotebook = { type: 'notebook'; cells: Array<{ cell_number: number; cell_type: 'code' | 'markdown' | 'raw'; source: string; outputs?: string[]; }>; file_path: string; }; export type FileReadOutputPdf = { type: 'pdf'; pages: Array<{ page_number: number; content: string; }>; file_path: string; totalPages: number; }; export type FileReadOutputParts = { type: 'parts'; parts: Array<{ type: 'text'; text: string; } | { type: 'image'; source: { type: 'base64'; media_type: string; data: string; }; }>; file_path: string; }; export type FileReadOutputUnchanged = { type: 'file_unchanged'; file_path: string; message: string; }; export type FileReadOutput = FileReadOutputText | FileReadOutputImage | FileReadOutputNotebook | FileReadOutputPdf | FileReadOutputParts | FileReadOutputUnchanged; export type FileEditInput = { file_path: string; old_string: string; new_string: string; replace_all?: boolean; }; export type FileEditOutput = { success: boolean; file_path: string; diff?: string; error?: string; }; export type FileWriteInput = { file_path: string; content: string; }; export type FileWriteOutput = { success: boolean; file_path: string; bytesWritten?: number; error?: string; }; export type GlobInput = { pattern: string; path?: string; }; export type GlobOutput = { files: string[]; totalMatches: number; truncated?: boolean; }; export type GrepInput = { pattern: string; path?: string; glob?: string; type?: string; output_mode?: 'content' | 'files_with_matches' | 'count'; head_limit?: number; offset?: number; context?: number; '-A'?: number; '-B'?: number; '-C'?: number; '-i'?: boolean; '-n'?: boolean; multiline?: boolean; }; export type GrepOutput = { results: string; matchCount: number; truncated?: boolean; }; export type WebFetchInput = { url: string; prompt: string; }; export type WebFetchOutput = { content: string; url: string; statusCode?: number; error?: string; redirectUrl?: string; }; export type WebSearchInput = { query: string; allowed_domains?: string[]; blocked_domains?: string[]; }; export type WebSearchOutput = { results: Array<{ title: string; url: string; snippet: string; }>; query: string; }; export type AskUserQuestionInput = { question: string; options?: string[]; default?: string; }; export type AskUserQuestionOutput = { answer: string; }; export type NotebookEditInput = { notebook_path: string; cell_id?: string; cell_type?: 'code' | 'markdown'; new_source: string; edit_mode?: 'replace' | 'insert' | 'delete'; }; export type NotebookEditOutput = { success: boolean; notebook_path: string; error?: string; }; export type TaskStopInput = { task_id: string; }; export type TaskStopOutput = { message: string; task_id: string; task_type: string; command?: string; }; export type TaskCreateInput = { subject: string; description: string; activeForm?: string; metadata?: Record; }; export type TaskCreateOutput = { task: { id: string; subject: string; }; }; export type TaskGetInput = { taskId: string; }; export type TaskGetOutput = { task: { id: string; subject: string; description: string; status: 'pending' | 'in_progress' | 'completed'; blocks: string[]; blockedBy: string[]; } | null; }; export type TaskUpdateInput = { taskId: string; subject?: string; description?: string; activeForm?: string; status?: 'pending' | 'in_progress' | 'completed' | 'deleted'; addBlocks?: string[]; addBlockedBy?: string[]; owner?: string; metadata?: Record; }; export type TaskUpdateOutput = { success: boolean; taskId: string; updatedFields: string[]; error?: string; statusChange?: { from: string; to: string; }; }; export type TaskListInput = Record; export type TaskListOutput = { tasks: Array<{ id: string; subject: string; status: 'pending' | 'in_progress' | 'completed'; owner?: string; blockedBy: string[]; }>; }; export type ExitPlanModeInput = { confirm?: boolean; }; export type ExitPlanModeOutput = { success: boolean; error?: string; }; export type ConfigInput = { action: 'get' | 'set' | 'list'; key?: string; value?: unknown; scope?: 'user' | 'project' | 'local'; }; export type ConfigOutput = { success: boolean; value?: unknown; values?: Record; error?: string; }; export type EnterWorktreeInput = { name?: string; }; export type EnterWorktreeOutput = { worktree_path: string; branch_name: string; success: boolean; error?: string; }; export type ExitWorktreeInput = { action: 'keep' | 'remove'; discard_changes?: boolean; }; export type ExitWorktreeOutput = { success: boolean; error?: string; uncommitted_files?: string[]; unmerged_commits?: string[]; }; export type TodoWriteInput = { todos: Array<{ id?: string; content: string; status: 'pending' | 'in_progress' | 'completed'; priority?: 'low' | 'medium' | 'high'; }>; }; export type TodoWriteOutput = { success: boolean; todos: Array<{ id: string; content: string; status: 'pending' | 'in_progress' | 'completed'; priority?: 'low' | 'medium' | 'high'; }>; error?: string; }; export type ListMcpResourcesInput = { server_name: string; }; export type ListMcpResourcesOutput = { resources: Array<{ uri: string; name: string; description?: string; mimeType?: string; }>; server_name: string; }; export type ReadMcpResourceInput = { server_name: string; uri: string; }; export type McpInput = { server_name: string; tool_name: string; arguments?: Record; }; export type McpOutput = { content: unknown; isError?: boolean; }; export type ToolInputSchemas = AgentInput | BashInput | FileReadInput | FileEditInput | FileWriteInput | GlobInput | GrepInput | WebFetchInput | WebSearchInput | AskUserQuestionInput | NotebookEditInput | TaskStopInput | TaskCreateInput | TaskGetInput | TaskUpdateInput | TaskListInput | ExitPlanModeInput | ConfigInput | EnterWorktreeInput | ExitWorktreeInput | TodoWriteInput | ListMcpResourcesInput | ReadMcpResourceInput | McpInput; export type ToolOutputSchemas = AgentOutput | BashToolBackgroundLaunchResult | BashOutput | FileReadOutput | FileEditOutput | FileWriteOutput | GlobOutput | GrepOutput | WebFetchOutput | WebSearchOutput | AskUserQuestionOutput | NotebookEditOutput | TaskStopOutput | TaskCreateOutput | TaskGetOutput | TaskUpdateOutput | TaskListOutput | ExitPlanModeOutput | ConfigOutput | EnterWorktreeOutput | ExitWorktreeOutput | TodoWriteOutput | ListMcpResourcesOutput | McpOutput;