/** * hoo-config.json — types, I/O, and merge rules shared by the hoo-core extensions. * * Config merge order (lowest → highest priority): * 1. ~/.hoocode/hoo-config.json (global defaults) * 2. ./.hoocode/hoo-config.json (project overrides — scalars win; arrays union) */ import type { ThinkingLevel } from "@kolisachint/hoocode-agent-core"; interface ModeConfig { /** Tool names that bypass the permission gate in this mode */ auto_allow?: string[]; /** Tool names available in this mode (if set, only these tools are active) */ enabled_tools?: string[]; /** Tool names explicitly blocked in this mode regardless of enabled_tools */ denied_tools?: string[]; /** Allowed write paths in this mode (glob patterns, only applies if write/edit is enabled) */ allowed_write_paths?: string[]; /** Regex patterns for allowed bash commands. If set, a command must match at least one to execute. */ allowed_bash_commands?: string[]; /** Regex patterns for denied bash commands. A command matching any pattern is blocked. */ denied_bash_commands?: string[]; } /** * Tool-outcome-driven thinking escalation (on by default). * * The default (fast) path keeps thinking low so mechanical tool turns — reads, * greps, successful edits — don't pay the extended-thinking prefill tax. When a * tool *fails*, the next turn(s) escalate to a higher thinking level so the model * reasons through the failure, then the level is restored. This buys low latency * on the happy path while preserving deep reasoning exactly when something breaks. * * Enabled by default; set `thinking_escalation.enabled` to `false` to turn it off. * * Note: escalation uses the same setter as manual thinking control, so the * escalated level is briefly written to settings and restored when the window * ends. If a run is interrupted mid-window, the escalated level may persist until * the next change. */ interface ThinkingEscalationConfig { /** Master switch. Default: true (set to false to disable). */ enabled?: boolean; /** Level to escalate to after a tool error. Default: "high". */ on_error?: ThinkingLevel; /** Restrict escalation to errors from these tool names. Default: any tool. */ tools?: string[]; /** Number of subsequent turns to stay escalated after an error. Default: 1. */ cooldown_turns?: number; } /** LLM defaults seeded in hoo-config.json and honoured during model selection. */ interface HooLlmConfig { /** Preferred provider when the hoocode-layer settings.json has no saved default. */ default_provider?: string; /** Preferred model id for `default_provider` (otherwise the provider's built-in default). */ default_model?: string; /** Informational map of provider → env var holding its API key. */ providers?: Record; } export interface HooConfig { /** LLM default provider/model preferences. */ llm?: HooLlmConfig; /** Manually-pinned active mode (overrides default "build") */ active_mode?: string; /** Per-mode configuration keyed by mode name */ modes?: Record; /** Extra directories to search for `{name}/system.md` mode files (after project + user). */ mode_paths?: string[]; /** Raise thinking after tool failures, restore on success. On by default; set `enabled: false` to disable. */ thinking_escalation?: ThinkingEscalationConfig; } export declare function readConfig(): HooConfig; export declare function writeConfig(config: HooConfig): void; /** * Deep-merges a project-local config on top of the global config. * * Merge rules: * - active_mode: project wins if set * - modes[x].auto_allow: union of global + project arrays * - modes[x].allowed_write_paths: union of global + project arrays * - modes[x].enabled_tools: project wins if set, else falls back to global * - mode_paths: project list is prepended so project paths are searched first * - thinking_escalation: project wins as a whole if set, else inherit global */ export declare function mergeConfigs(global: HooConfig, project: HooConfig): HooConfig; export declare function mergeSearchPaths(...sources: (string[] | undefined)[]): string[]; /** * Reads the global config and optionally overlays the project-local config at * `./.hoocode/hoo-config.json`. Project values win on all scalar fields; arrays are * unioned (see mergeConfigs for full rules). */ export declare function readMergedConfig(cwd: string): HooConfig; export {}; //# sourceMappingURL=config.d.ts.map