import type { ExtensionContext } from "@earendil-works/pi-coding-agent"; import { type GoalState } from "./goal-contract.ts"; export declare const LEGACY_MIGRATION_ENTRY = "pi-goal-todo-migration-v1"; export declare const LEGACY_MIGRATION_EVENT = "pi-goal-todo:migrated"; export declare const TODO_STATE_ENTRY = "pi-todo-state-v1"; interface LegacyTask { id: string; title: string; status: "pending" | "complete" | "skipped"; verificationContract?: string; subtasks?: LegacyTask[]; } export interface LegacyGoalCandidate { id: string; objective: string; status: "active" | "paused" | "complete"; autoContinue: boolean; createdAt: string; updatedAt: string; pauseReason?: string; pauseSuggestedAction?: string; tasks: LegacyTask[]; source: "session" | "file"; } export interface LegacyTodoState { schemaVersion: 1; revision: number; tasks: Array<{ key: string; subject: string; description?: string; status: "pending" | "completed"; dependsOn?: string[]; }>; } export type LegacyMigrationPlan = { kind: "none"; } | { kind: "ambiguous"; candidates: LegacyGoalCandidate[]; } | { kind: "migrate"; candidate: LegacyGoalCandidate; goal: GoalState; todo: LegacyTodoState | null; }; export declare function findLegacyGoalCandidates(ctx: ExtensionContext): { focusedId: string | null; candidates: LegacyGoalCandidate[]; }; export declare function migrateLegacyTasks(tasks: readonly LegacyTask[]): LegacyTodoState | null; export declare function planLegacyMigration(ctx: ExtensionContext, selectedGoalId?: string): LegacyMigrationPlan; export declare function writeLegacyMigration(pi: { appendEntry: (type: string, data: unknown) => void; events: { emit: (channel: string, data: unknown) => void; }; }, plan: Extract): void; export {};