/** * Load flow model strategy configuration from Pi settings files. * * Reads global (~/.pi/agent/settings.json) and project (.pi/settings.json) * settings, with project overriding global for flowModelConfigs. */ import { type Complexity } from "../flow/complexity.js"; import { type FlowTier } from "../flow/agents.js"; interface FlowModelTierConfig { primary?: string; failover?: string[]; } export type FlowModelStrategy = Partial>; export type FlowModelConfigs = Record; export interface LoadedFlowModelConfigs { selectedName: string; configs: FlowModelConfigs; strategy: FlowModelStrategy; } export interface FlowSettings { toolOptimize?: boolean; /** Whether to inject structured JSON output instructions into flow prompts. Default: true. */ structuredOutput?: boolean; /** Maximum number of flows to execute concurrently. Default: 4. */ maxConcurrency?: number; /** Whether to write the full child flow activation prompt to a temp file on every spawn. Default: false. */ debugMode?: boolean; tools?: { /** Enable the trace tool. Default: true. */ trace?: boolean; /** Enable the batch_read tool. Default: follows toolOptimize. */ batchRead?: boolean; }; /** Default child-flow complexity. Default: "moderate" (600s, 1x audit). */ complexity?: Complexity; /** Context compression mode for forked child agents. Default: "auto". */ contextCompression?: "auto" | "light" | "medium" | "aggressive"; steering?: { /** Skip entire steering system message when false. Default: true. */ enabled?: boolean; /** Replace built-in STEERING_HINT body. Default: undefined. */ customPrompt?: string; }; animation?: { /** Master switch — false = instant render. Default: true. */ enabled?: boolean; /** false = disable glitch/scramble effect. Default: true. */ glitch?: boolean; }; askUser?: { /** Enable visual countdown timer and auto-dismiss. Default: false. */ enabled?: boolean; /** Auto-dismiss timeout in seconds. Default: 300 (5 min). */ timeout?: number; }; bodyVerbosity?: "lite" | "full"; loop?: { /** Enable endless loop behavior. Default: false. */ enabled?: boolean; }; /** Connection-error retries after model failover exhaustion. Default: 3. */ subAgentMaxRetries?: number; /** Base delay (ms) for exponential backoff between connection retries. Default: 1000. */ subAgentBaseDelayMs?: number; } /** Synchronous flush of all cached settings entries. For tests or graceful shutdown. */ export declare function flushAllSettingsCachesSync(): void; /** Invalidate settings cache. For session_start or tests. */ export declare function invalidateSettingsCache(filePath?: string): void; /** Clear the in-memory settings cache. For tests. */ export declare function _clearSettingsCache(): void; export declare function getGlobalSettingsPath(): string; export declare function normalizeFlowModeName(value: unknown): string | undefined; export declare function loadProjectFlowModelConfigName(cwd: string): string | undefined; export declare function writeGlobalFlowMode(mode: string): { path: string; previous?: string; }; /** * Load flowSettings from global and project settings.json. * Project overrides global (shallow merge per key). */ export declare function loadFlowSettings(cwd: string): FlowSettings; /** * Atomically write a single flow setting to the project .pi/settings.json. * Supports dot-notation keyPath like "steering.enabled" or "animation.glitch". */ export declare function writeFlowSetting(cwd: string, keyPath: string, value: unknown): { path: string; previous: unknown; }; export declare function selectFlowModelStrategy(configs: FlowModelConfigs, requestedName?: string): LoadedFlowModelConfigs; /** * Load flow model configs from global and project settings.json. * Project overrides global (shallow merge per strategy/tier). */ export declare function loadFlowModelConfigs(cwd: string): LoadedFlowModelConfigs; export declare function resolveFlowModelCandidates(opts: { tier: FlowTier; flowModel?: string; cliTierOverride?: string; strategy: FlowModelStrategy; fallbackModel?: string; }): { primary: string | undefined; candidates: string[]; }; export declare function formatFlowModelStrategy(modeName: string, strategy: FlowModelStrategy): string; export declare function resolveModelContextWindow(model?: string): number | undefined; export declare function writeFlowModelConfig(cwd: string, strategyName: string, tier: FlowTier, updates: { primary?: string | null; failover?: string[] | null; }): void; export {}; //# sourceMappingURL=config.d.ts.map