import { type PlanFile } from '@wrongstack/core/storage'; import type { Tool } from '@wrongstack/core/types'; /** * `planTool` — the LLM-callable counterpart to the `/plan` slash command. * * Plans capture strategic, multi-step approaches that survive across * session resumes (unlike todos, which are tactical and per-turn). * Storage path comes from `ctx.meta['plan.path']` — the CLI seeds this * during startup so the tool always knows where to read/write. * * One tool, multiple actions, JSON in/out. The action discriminates the * operation so the LLM can do show / add / start / done / remove / promote / * derive / template_use / clear via a single tool registration instead of * bloating the surface with nine near-identical tools. */ export type PlanAction = 'show' | 'add' | 'status' | 'start' | 'done' | 'remove' | 'promote' | 'template_use' | 'clear' | 'taskify'; export interface PlanInput { action: PlanAction; /** Required for add. */ title?: string | undefined; /** Optional detail line for add. */ details?: string | undefined; /** Required for start/done/remove/promote — accepts plan item id OR 1-based index OR title substring. */ target?: string | undefined; /** Exact status for action=status. */ status?: PlanFile['items'][number]['status'] | undefined; /** Optional subtasks for promote. If omitted, a single todo is created from the plan item title. */ subtasks?: string[] | undefined; /** Required for template_use — the template name (e.g. "new-feature", "bug-fix"). */ template?: string | undefined; /** * Storage scope. Default (unset): uses the session-scoped path — isolated to this * session, survives resume within the same session. * `scope: 'project'`: uses a shared project-level path, visible to all sessions * for this project. Useful for a shared roadmap that outlasts any single session. */ scope?: 'session' | 'project'; } export interface PlanOutput { /** Always true: refused operations and persistence failures are thrown. */ ok: true; message: string; /** Formatted plan after the operation. Same string the user sees from `/plan show`. */ plan: string; /** Total item count after the operation. */ count: number; /** Number of items not in 'done' status. */ open: number; /** When promote/derive succeed, the generated todo items so the caller can inspect them. */ todos?: Array<{ id: string; content: string; status: string; activeForm?: string | undefined; promotedFromPlan?: string | undefined; }>; } export declare const planTool: Tool; //# sourceMappingURL=plan.d.ts.map