import type { RoutingControls, SettingsUi } from "../routing/types.js"; import type { ConfigFile } from "../config/types.js"; export interface SettingsDeps { ui: SettingsUi; agentDir: string; cwd: string; projectTrusted: boolean; /** Routed command names — what the operator may attach an override to. */ commands: readonly string[]; /** `provider/modelId` references from the live registry, when one is reachable. */ models?: readonly string[]; readFile(path: string): string | null; writeFile(path: string, text: string): void; /** * The router's live state, when the console was opened from a session that owns * one. A routed turn that never settled — Pi starts it inside an action that * swallows failures — leaves the latch held with no `agent_settled` coming, and * every later command refuses. The operator needs a way out that is not * "restart Pi", and the console is the only surface with room to explain it. */ routing?: RoutingControls; } export type ConsoleOutcome = { status: "saved"; scope: "global" | "project"; path: string; file: ConfigFile; } | { status: "cancelled"; edited: boolean; }; /** The console's questions. `test/settings-console.test.mjs` drives the flow * through these strings, so renaming one fails the tests that use it rather than * silently re-sequencing them. */ export declare const prompts: { readonly scope: "Which file should the console edit?"; readonly menu: "What do you want to change?"; readonly inFlight: (command: string) => string; readonly undoInFlight: "Undo a routing that never started"; readonly undone: "The routing was undone and the session put back."; readonly command: "Which command?"; readonly policyChoice: "What should happen when a configured model is unavailable?"; readonly settleChoice: "What should happen after a routed command settles?"; readonly saveTo: (path: string) => string; readonly discard: "Discard the draft?"; readonly setDefaultRoute: "Set the default route"; readonly setOverride: "Set a command override"; readonly clearOverride: "Clear a command override"; readonly bulkApply: "Apply one route to several commands"; readonly bulkClear: "Clear several overrides"; readonly switchProfile: "Switch the profile being edited"; readonly rotateProfile: "Rotate the active profile"; readonly toggleRecommended: "Toggle recommended models"; readonly profile: "Which profile?"; readonly newProfile: "Name the new profile"; readonly profileBuiltIn: (name: string) => string; readonly profileNamed: (name: string) => string; readonly addAnother: "Add another?"; readonly policy: "Set the unavailable-route policy"; readonly settle: "Set the post-command model keep/restore policy"; readonly save: "Save"; readonly cancel: "Cancel"; readonly model: (target: string) => string; readonly modelPicked: (target: string) => string; readonly modelProvider: (target: string) => string; readonly thinking: (target: string) => string; readonly fields: "Which fields should change?"; readonly fieldsBoth: "model and thinking"; readonly fieldsModel: "model only"; readonly fieldsThinking: "thinking only"; readonly chainAction: (target: string) => string; readonly chainAppend: "Add a fallback"; readonly chainRemoveLast: "Remove the last"; readonly chainDone: "Done"; }; export declare function runSettingsConsole(deps: SettingsDeps): Promise;