import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core"; import type { Component } from "@oh-my-pi/pi-tui"; import * as z from "zod/v4"; import type { RenderResultOptions } from "../extensibility/custom-tools/types"; import type { Theme } from "../modes/theme/theme"; import type { ToolSession } from "../sdk"; import type { SessionEntry } from "../session/session-manager"; export type TodoStatus = "pending" | "in_progress" | "completed" | "abandoned"; export interface TodoItem { content: string; status: TodoStatus; /** * Append-only list of freeform notes attached by `op: "note"`. * Each element is one note and may itself be multi-line. * Rendered as text only when the task is in_progress; otherwise shown as a * dim marker indicating the task has notes. */ notes?: string[]; } export interface TodoPhase { name: string; tasks: TodoItem[]; } export interface TodoWriteToolDetails { phases: TodoPhase[]; storage: "session" | "memory"; } declare const todoWriteSchema: z.ZodObject<{ ops: z.ZodArray; list: z.ZodOptional; }, z.core.$strip>>>; task: z.ZodOptional; phase: z.ZodOptional; items: z.ZodOptional>; text: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; type TodoWriteParams = z.infer; export declare const USER_TODO_EDIT_CUSTOM_TYPE = "user_todo_edit"; export declare function getLatestTodoPhasesFromEntries(entries: SessionEntry[]): TodoPhase[]; /** Apply an array of `todo_write`-style ops to existing phases. Used by /todo slash command. */ export declare function applyOpsToPhases(currentPhases: TodoPhase[], ops: TodoWriteParams["ops"]): { phases: TodoPhase[]; errors: string[]; }; /** Render todo phases as a Markdown checklist suitable for editing/copying. */ export declare function phasesToMarkdown(phases: TodoPhase[]): string; /** Parse a Markdown checklist back into todo phases. */ export declare function markdownToPhases(md: string): { phases: TodoPhase[]; errors: string[]; }; export declare class TodoWriteTool implements AgentTool { private readonly session; readonly name = "todo_write"; readonly label = "Todo Write"; readonly summary = "Write a structured todo list to track progress within a session"; readonly description: string; readonly parameters: z.ZodObject<{ ops: z.ZodArray; list: z.ZodOptional; }, z.core.$strip>>>; task: z.ZodOptional; phase: z.ZodOptional; items: z.ZodOptional>; text: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; readonly concurrency = "exclusive"; readonly strict = true; readonly loadMode = "discoverable"; constructor(session: ToolSession); execute(_toolCallId: string, params: TodoWriteParams, _signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback, _context?: AgentToolContext): Promise>; } type TodoWriteRenderArgs = { ops?: Array<{ op?: string; task?: string; phase?: string; items?: string[]; }>; }; /** One-based ASCII roman numeral for display (I, II, III, IV, …). */ export declare function phaseRomanNumeral(oneBasedIndex: number): string; /** Display-only phase header: `I. Foundation`. State and prompts never see this. */ export declare function formatPhaseDisplayName(name: string, oneBasedIndex: number): string; export declare const todoWriteToolRenderer: { renderCall(args: TodoWriteRenderArgs, _options: RenderResultOptions, uiTheme: Theme): Component; renderResult(result: { content: Array<{ type: string; text?: string; }>; details?: TodoWriteToolDetails; }, options: RenderResultOptions, uiTheme: Theme, _args?: TodoWriteRenderArgs): Component; mergeCallAndResult: boolean; }; export {};