/** * Get the per-thread PlanMode flag. * * Returns: * - true → thread is explicitly in PlanMode * - false → thread is explicitly out of PlanMode (overrides env=on) * - null → no per-thread setting; caller should check env * * Three-state return matters because `setPlanMode(key, false)` is a * meaningful explicit "no, don't apply env default here" not a clear. * `clearPlanMode` is the way to wipe a row entirely. */ export declare function getPlanModeForThread(threadKey: string): boolean | null; /** Upsert the per-thread PlanMode flag. */ export declare function setPlanModeForThread(threadKey: string, enabled: boolean): boolean; /** Remove the per-thread row entirely so the env default applies again. */ export declare function clearPlanModeForThread(threadKey: string): boolean; /** List all threads currently with PlanMode explicitly enabled. Useful * for the web admin view + audit. Returns ordered most-recent-first. */ export declare function listPlanModeEnabledThreads(): Array<{ threadKey: string; updatedAt: string; }>; /** Test-only: close the underlying handle so a temp DB can be unlinked. */ export declare function closePlanModeStateDb(): void; /** Process-level plan-mode policy. * - `on` — default on for threads without a per-thread override * - `off` — default off (per-thread /plan on still works) * - `disabled` — emergency kill: every consumer must treat plan as off */ export type PlanModeEnvPolicy = 'on' | 'off' | 'disabled'; /** * Resolve the process-level plan-mode policy. * * Canonical: `AGIM_PLAN_MODE=on|off|disabled`. * Legacy aliases (still honored): * - `AGIM_DISABLE_PLAN_MODE=1` → disabled * - `AGIM_NATIVE_PLAN_MODE` truthy (`1`/`on`/`true`/`yes`) → on * Canonical wins when set. */ export declare function resolvePlanModeEnvPolicy(): PlanModeEnvPolicy; export declare function readEnvPlanModeDefault(): boolean; /** * Resolve effective PlanMode for a thread, layering per-thread → env. * * policy disabled → off always * per-thread = true → on * per-thread = false → off * per-thread = null → env default (`AGIM_PLAN_MODE` / legacy) * * When `threadKey` is omitted or empty (no thread context, e.g. CLI * boot banner), we return the env default — matches v1.2.119 behaviour. */ export declare function effectivePlanModeOn(threadKey?: string): boolean; //# sourceMappingURL=plan-mode-state.d.ts.map