/** * Approval reconciliation — the human review gate. * * pi-vscode's bridge is one-directional (pi → VS Code over HTTP fetch; there * is NO VS-Code → running-pi push channel), and in the Chat Participant path * (`--mode rpc`, `src/chat.ts:120-125`) pi's `ctx.ui.select`/`confirm` prompts * are auto-**cancelled**. So the approval gate must NOT block on a TUI modal. * * The single source of truth is `status.json` next to the plan. BOTH the * `/approve` and `/reject` slash commands in pi AND the `Pi: Approve Plan` / * `Pi: Reject Plan` commands in VS Code write the same `approval` field; a * debounced `fs.watch` on that file reconciles either path into the live * state machine in `index.ts`. */ import type { StatusFile } from "./state.ts"; type WatchCallback = (status: StatusFile) => void; export interface ApprovalWatcher { stop(): void; } /** * Watch `/status.json` for changes and call `cb` with the parsed * status. Debounced (worst case a single atomic write may fire multiple events). * No-op (returns a stub) if the file does not exist yet; calling `start` again * after the plan file appears is handled by `index.ts`. */ export declare function startStatusWatch(artifactDir: string, cb: WatchCallback): ApprovalWatcher; export declare function readStatus(statusPath: string): Promise; /** Write the `approval` field directly from a pi slash-command. Re-exported so * `index.ts` keeps a single write path shared with VS Code. */ export { writeFile } from "node:fs/promises"; //# sourceMappingURL=approval.d.ts.map