/** * The 5-state machine for the pi-context-optimizer plan→review→execute→walkthrough loop. * * INERT --/plan--> RESEARCHING --model.write_plan--> PLAN_DRAFTING --writes plan.md--> REVIEW_PENDING * REVIEW_PENDING <--/reject-- (PLAN_DRAFTING) | <--approval=approved--> EXECUTING --all done + write_walkthrough--> INERT * * State lives in-memory in the extension; it is persisted into the session * JSONL via `pi.appendEntry("context-optimizer", …)` so `/resume` rebuilds it in * `session_start`. The single source of truth at runtime is the `AgState` * object here; the `status.json` file is the *human-readable* mirror that the * file-watch and the VS Code approve/reject commands both write to. */ export type AgPhase = "INERT" | "RESEARCHING" | "PLAN_DRAFTING" | "REVIEW_PENDING" | "EXECUTING"; export type Approval = "none" | "pending" | "approved" | "rejected"; export interface AgState { phase: AgPhase; artifactDir: string | null; interview: boolean; dispatcherActive?: boolean; } export interface AgPersisted { phase: AgPhase; artifactDir: string | null; interview: boolean; dispatcherActive?: boolean; } export declare function defaultState(): AgState; export declare function toPersisted(s: AgState): AgPersisted; export declare function fromPersisted(p: AgPersisted | undefined): AgState; /** status.json shape — the human/VS-Code-facing mirror. */ export interface StatusFile { phase: AgPhase; approval: Approval; reason?: string; done: number; total: number; updatedAt: string; } export declare function initialStatusFile(phase: AgPhase, total?: number, done?: number): StatusFile; //# sourceMappingURL=state.d.ts.map