/** * Session todo/plan list. * * The model replaces the whole list with `todo_write`. Every write is persisted as a * `selesai.todo` custom entry, so the list resumes with the transcript and follows the active * branch. The TUI shows a compact widget above the editor. RPC mode reads the same entries for * `get_state` and its `todo_update` event. * * The tool is inactive by default so existing sessions keep their tool set. Activate it with * `--tools +todo_write`, the `defaultTools` setting, or `setActiveTools()`. */ import type { ExtensionAPI } from "../../core/extensions/types.ts"; import type { SessionEntry } from "../../core/session-manager.ts"; export declare const TODO_TOOL_NAME = "todo_write"; export declare const TODO_ENTRY_TYPE = "selesai.todo"; export declare const TODO_WIDGET_KEY = "todo"; export declare const MAX_TODO_ITEMS = 20; export declare const MAX_TODO_CONTENT_LENGTH = 200; export declare const TODO_STATUSES: readonly ["pending", "in_progress", "completed"]; export declare const TODO_PRIORITIES: readonly ["high", "medium", "low"]; export type TodoStatus = (typeof TODO_STATUSES)[number]; export type TodoPriority = (typeof TODO_PRIORITIES)[number]; /** One plan item, matching the ACP `PlanEntry` fields with `priority` optional. */ export interface TodoItem { content: string; status: TodoStatus; priority?: TodoPriority; } /** Shape stored in a `selesai.todo` custom session entry. */ export interface TodoEntryData { todos: TodoItem[]; } export interface TodoToolDetails { todos: TodoItem[]; error?: string; } export type TodoListValidation = { ok: true; todos: TodoItem[]; } | { ok: false; error: string; }; /** Validate and normalize a complete list, rejecting rather than truncating out-of-bound input. */ export declare function validateTodoList(value: unknown): TodoListValidation; /** * The current list is the latest valid `selesai.todo` entry on the active branch. * Returns undefined when the branch has no todo entry. */ export declare function readTodoListFromBranch(branch: readonly SessionEntry[]): TodoItem[] | undefined; /** Compact widget lines; undefined hides the widget for an empty list. */ export declare function renderTodoWidget(todos: readonly TodoItem[]): string[] | undefined; export default function todoExtension(pi: ExtensionAPI): void;