/** * Agent self-management tools — TodoWrite, plan mode, ask-user, worktrees. * * These mirror the equivalents in claude-code's `src/tools/`. They're the * "ceremony reducers" that turn a generic LLM into a coding agent: the * model uses `todo_write` to track its own task list, `enter_plan_mode` to * propose changes before touching files, and `enter_worktree` to isolate a * speculative refactor on its own branch. * * None of these touch the file system beyond `git worktree`, so they're * safe to add to any harness regardless of `SandboxPolicy.allowShell`. */ import { type HarnessTool } from "./types.js"; export type TodoStatus = "pending" | "in_progress" | "completed"; export interface TodoItem { content: string; activeForm: string; status: TodoStatus; } /** * In-memory todo list. The model owns the list; the harness only persists * it across tool calls. Mirrors Claude Code's `TodoWriteTool` semantics: * one task in_progress at a time, completed tasks stay visible until the * model overwrites the list. */ export declare class TodoStore { private items; list(): readonly TodoItem[]; /** Replace the entire list. The model always sends the full snapshot. */ replace(items: TodoItem[]): void; clear(): void; tools(): HarnessTool[]; } export { PlanMode, MUTATING_TOOLS, planModeTools, PlanModePolicy, planModeBeforeToolHook, } from "./plan-mode.js"; export type { PlanState, PlanObserver, PlanModeHookResult } from "./plan-mode.js"; /** @deprecated use `PlanState` from ./plan-mode.js */ export type PlanModeState = "off" | "planning" | "executing"; export type AskUserHandler = (question: string, options?: string[]) => Promise; /** * Ask-user tool. The handler is supplied by the embedding application: * a CLI harness might prompt on stdin, a web UI might post a question to * a websocket. The default handler throws so SDK consumers don't silently * hang on a missing UI. */ export declare function askUserTool(handler?: AskUserHandler): HarnessTool; /** * Git worktree manager. Spawns isolated worktrees of the workspace so the * agent can experiment on a branch without polluting the main checkout. * Each worktree gets its own filesystem path; the harness creates a * matching `SandboxPolicy` and `workspaceTools` for it before handing back * to the model. */ export declare class WorktreeManager { readonly workspace: string; private readonly created; constructor(workspace: string); /** Create a new worktree on `branch`, rooted at `path`. */ enter(opts: { branch: string; path: string; baseRef?: string; }): string; exit(branch: string, opts?: { force?: boolean; }): void; list(): string[]; tools(): HarnessTool[]; } //# sourceMappingURL=agent-tools.d.ts.map