/** * Shared parse / extract helpers for Agim todo checklists. * * Used by the todo dispatcher (persist path), Agim Agent activity emit * (structured `todoItems` on tool steps), and the SPA (fallback parse * from preview text when history lacks the structured field). */ export type TodoStatus = 'pending' | 'in_progress' | 'completed'; export interface TodoItem { content: string; status: TodoStatus; } export declare function isTodoActivityLabel(label: string | undefined | null): boolean; /** Normalize a JSON `items` array (tool args / details). */ export declare function normalizeTodoItems(raw: unknown): TodoItem[] | null; /** Pull items from a tool-call argument object (`{ items: [...] }`). */ export declare function extractTodoItemsFromInput(input: unknown): TodoItem[] | null; /** * Parse the markdown checklist the todo tool returns: * `1. ☑ content` / `2. ▶ content` / `3. ☐ content` */ export declare function parseTodoItemsFromMarkdown(text: string | undefined | null): TodoItem[] | null; /** Prefer structured input; fall back to markdown tool result text. */ export declare function resolveTodoItems(opts: { input?: unknown; resultText?: string | null; }): TodoItem[] | null; /** Markdown checklist (☐ / ▶ / ☑). Empty → cleared sentinel. */ export declare function renderMarkdownChecklist(items: TodoItem[]): string; /** * Turn-end reconcile: models often leave the last item `in_progress` * (prompt says "mark done → set next in_progress") and never write a * final all-completed checklist. When every item is completed except * exactly one `in_progress` and there are no `pending` items, flip the * trailing in-progress row to completed. * * Returns a new array, or null when the pattern does not match (so * intentional multi-turn leftovers are left alone). */ export declare function completeStickyInProgressItems(items: readonly TodoItem[]): TodoItem[] | null; //# sourceMappingURL=todo-items.d.ts.map