/** * Build / Plan agent modes (OpenCode's Tab agent cycle). * * Build: the normal tool set. * Plan: a guardrail, not a sandbox. edit/write are deactivated, bash is limited to read-only * commands (readonly-command.ts), and the model is told it is planning. Tools from other extensions * (MCP, custom tools) are not restricted. The mode is kept per session branch in a custom entry, so * /resume and /tree restore it. * * The bash allowlist started from pi's plan-mode example (MIT, pi-coding-agent). */ import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent"; import type { AgentMode, UiState } from "./state.ts"; /** The custom session entry written at each mode switch: { mode: "build" | "plan" }. */ export declare const MODE_ENTRY = "chassis-mode"; export interface ModeController { set(mode: AgentMode, ctx: ExtensionContext, persist?: boolean): void; cycle(ctx: ExtensionContext): void; restore(ctx: ExtensionContext): void; } export declare function installModes(pi: ExtensionAPI, state: UiState, onChange: () => void): ModeController;