import { i as PersonaVoiceOverride, r as PersonaIdentity } from "./profiles-CTrUCmIh.mjs"; import { DoomMcpProjection } from "@agimon-ai/doompi-core/mcpProjection"; import { DOOM_CONFIG_SERVICE, IDoomConfigService } from "@agimon-ai/doompi-core/config"; import { PackageAttribution, PackageAttribution as PackageAttribution$1 } from "@agimon-ai/doompi-core/contextProjection"; //#region src/types/config.d.ts type ProjectTrust = 'ask' | 'always' | 'never'; type PlanningThinkingLevel = 'off' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'; type VoiceEngine = 'auto' | 'whisper-cpp' | 'openai-whisper' | 'mlx-whisper'; type VoiceMode = 'legacy' | 'live'; type VoiceTtsEngine = 'macos-say'; interface PlanningAgentConfig { model?: string; thinking?: PlanningThinkingLevel; } interface PlanningModeConfig { main?: PlanningAgentConfig; subagents?: PlanningAgentConfig; plansDirectory?: string; } /** * Ratios of the context window at which each autocompact pass fires. * * Held as plain numbers so a reader can see the ladder in one place. The * package owns the defaults and the ordering rule; this only carries what the * file said. */ interface AutocompactThresholdConfig { pass1?: number; pass2?: number; pass3?: number; } /** * Absolute token checkpoints one matching model pins, replacing the ratio for * that pass when it would fire earlier. * * A pass left unset keeps its ratio value, so an entry may pin one rung of the * ladder without restating the rest. */ interface AutocompactTokenConfig { pass1?: number; pass2?: number; pass3?: number; } /** * One per-model override rule. * * `model` is a glob. A pattern containing `/` is matched against `provider/id`, * anything else against the bare model id, because the wildcard does not cross * the separator. Entries are tried in file order and the first match wins. */ interface AutocompactOverrideConfig { model: string; tokens: AutocompactTokenConfig; } interface AutocompactModeConfig { enabled?: boolean; model?: string; thinking?: PlanningThinkingLevel; thresholds?: AutocompactThresholdConfig; overrides?: AutocompactOverrideConfig[]; } interface ComputerUseConfig { enabled?: boolean; } interface EditorConfig { command?: string; } interface VoiceModelConfig { path?: string; id?: string; } interface VoiceAdapterConfig { binary?: string; model: VoiceModelConfig; } interface VoiceTtsConfig { engine: VoiceTtsEngine; voice?: string; rate?: number; } interface VoiceAutoCaptureConfig { model: string; startPhrases?: string[]; stopPhrases?: string[]; composeOpenPhrases?: string[]; composeSendPhrases?: string[]; composeCancelPhrases?: string[]; utteranceIdleMs?: number; composeUtteranceIdleMs?: number; composeNudgeMs?: number; transcriptionTimeoutMs?: number; tts: VoiceTtsConfig; } interface ResolvedVoiceAutoCaptureConfig { model: string; startPhrases: string[]; stopPhrases: string[]; composeOpenPhrases: string[]; composeSendPhrases: string[]; composeCancelPhrases: string[]; utteranceIdleMs: number; composeUtteranceIdleMs: number; composeNudgeMs: number; transcriptionTimeoutMs?: number; tts: VoiceTtsConfig; } interface VoiceConfig { mode?: VoiceMode; engine?: VoiceEngine; language?: string; recorder?: { binary?: string; device?: string; }; adapters?: { 'whisper-cpp'?: VoiceAdapterConfig; 'openai-whisper'?: VoiceAdapterConfig; 'mlx-whisper'?: VoiceAdapterConfig; }; autoCapture?: VoiceAutoCaptureConfig; } interface ResolvedVoiceConfig { mode: VoiceMode; engine: VoiceEngine; language: string; recorder: { binary?: string; device: string; }; adapters: NonNullable; autoCapture?: ResolvedVoiceAutoCaptureConfig; } /** * The matrix a repository selects by default. * * Read by `doom-pi sync`, which pins it into the generated Pi config so a plain * `pi` session starts on the same matrix the repository declares. The launcher * keeps taking its selection from flags and the environment. */ interface DoomSelectionConfig { majorMode?: string; domains?: string[]; profile?: string; } /** The selection persisted in a Pi session entry. */ interface DoomConfigSelection { readonly version: 1; readonly majorMode: string; readonly domains: readonly string[]; readonly profile?: string; /** Canonical identity of the parent/child extension composition. */ readonly compositionFingerprint?: string; } type DoomConfigTransitionStrategy = 'pi-reload' | 'process-relaunch'; type DoomConfigTransitionPhase = 'pending' | 'applied' | 'aborted' | 'superseded'; interface DoomConfigTransitionRecord { readonly version: 1; readonly operationId: string; readonly active: DoomConfigSelection; readonly target: DoomConfigSelection; readonly strategy: DoomConfigTransitionStrategy; readonly phase: DoomConfigTransitionPhase; } /** A transition journal target that has not yet received an explicit fresh-session acknowledgement. */ type DoomConfigPendingSelection = DoomConfigTransitionRecord & { readonly phase: 'pending'; }; interface DoomConfig { modes?: { planning?: PlanningModeConfig; autocompact?: AutocompactModeConfig; }; computerUse?: ComputerUseConfig; projectTrust: ProjectTrust; editor?: EditorConfig; voice?: VoiceConfig; selection?: DoomSelectionConfig; /** Default layout identifier, resolved against the available web template packages. */ web?: { template?: string; }; } interface PluginHookSource { pluginRoot: string; configPath: string; } interface HarnessState { root?: string; /** The one named major mode this session runs under. */ majorMode: string; temporaryDirectory?: string; domains: string[]; /** The layer components the major mode resolved to. */ layers: string[]; /** * Which mode, layer, or domain admitted each package, keyed by the package * name exactly as its manifest spells it. * * The composition resolves this on its way to a flat list of entry paths and * has no further use for it, so without somewhere to put it the causal link * between a mode and the tools it brought is lost the moment the session * starts. A surface that reports what the session is carrying has to be able * to say what asked for it. */ packageAttribution?: Record; /** Canonical identity shared by launch, sync, children, and reload. */ compositionFingerprint?: string; profile?: string; profileEnvironment: Record; hookGroups?: string[]; skillDirectories: string[]; agentDirectories: string[]; additionalDirectories: string[]; childExtensions: string[]; pluginDirectories: string[]; pluginHooks: PluginHookSource[]; /** File-only authority that the Config core publishes to the session registry. */ mcpProjection?: DoomMcpProjection; mcpConfigPath?: string; personaFile?: string; /** * The active persona's presentation, carried here because the three surfaces * that need it share no transport: the cockpit reads journalled entries, the * voice worker reads config from disk, and the TUI reads the Cordis snapshot. */ profileIdentity?: PersonaIdentity; /** The active profile's TTS override, applied over `voice.autoCapture.tts`. */ profileVoice?: PersonaVoiceOverride; allowProtectedWrites: boolean; hooks: boolean; agents: boolean; mcp: boolean; } type DeepReadonly = TValue extends ((...args: never[]) => unknown) ? TValue : TValue extends readonly (infer TItem)[] ? readonly DeepReadonly[] : TValue extends object ? { readonly [TKey in keyof TValue]: DeepReadonly; } : TValue; type DoomHarnessContext = DeepReadonly; interface DoomConfigContext { readonly settings: DeepReadonly; readonly harness: DoomHarnessContext; /** A journal target awaiting explicit acknowledgement; the active harness remains above. */ readonly pendingSelection?: DeepReadonly; /** Whether the active harness does not yet match the pending target. */ readonly requiresRelaunch: boolean; } /** A file-only loader; unlike the Cordis service it owns no live session snapshot. */ interface IDoomConfigLoader { load(repoRoot: string, homeDirectory?: string): DoomConfig; } /** The config package's concrete specialization of the cross-package service contract. */ interface IDoomConfigService$1 extends IDoomConfigService {} declare module '@deepseek-ai/cordis' { interface Context { 'doom/config': IDoomConfigService$1; } } /** Which file the effective value for a key came from, or that no file set it. */ type ConfigValueOrigin = 'global' | 'repository' | 'default'; /** One of the two config files, as a settings surface needs to see it. */ interface DoomConfigLayer { filePath: string; exists: boolean; /** * sha256 of the file's bytes, empty when absent. The token a write proves * itself with: the writer is torn-read safe but not lost-update safe, so a * caller that read a file and then writes it should say which bytes it read. */ hash: string; /** Dotted key paths this file actually sets, leaves only. */ keys: readonly string[]; } /** * The two config files kept apart, alongside the merge every consumer sees. * * `loadDoomConfig` flattens global and repository into one object, which is all * the runtime needs and not enough for a settings surface: a value that is set * in both files looks identical to one set in neither, so an editor cannot say * where a value came from, and offers a write that the merge may then ignore. */ interface DoomConfigLayers { /** Named with the suffix because a bare `global` reads as the process global. */ globalFile: DoomConfigLayer; repositoryFile: DoomConfigLayer; effective: DoomConfig; /** Where the effective value at this key path came from. */ originOf(keyPath: readonly string[]): ConfigValueOrigin; /** The effective value at this key path, or undefined when nothing set it. */ valueAt(keyPath: readonly string[]): unknown; } /** * One tolerated problem found while reading a config file. * * Carries the file it came from because a lenient load merges the global and * repository files, and "unsupported field: voice.engine" is unactionable * without saying which of the two declared it. */ interface ConfigDiagnostic { filePath: string; /** Dotted path to the offending key, for example `voice.recorder.typo`. */ path: string; message: string; } /** Opts a parse into collecting unknown keys instead of throwing on them. */ interface LenientParseOptions { lenient: true; } /** What a lenient parse returns in place of a bare config. */ interface LenientParseResult { config: DoomConfig; diagnostics: ConfigDiagnostic[]; } //#endregion export { PluginHookSource as A, VoiceTtsConfig as B, IDoomConfigService$1 as C, PlanningAgentConfig as D, PackageAttribution$1 as E, VoiceAutoCaptureConfig as F, VoiceConfig as I, VoiceEngine as L, ResolvedVoiceAutoCaptureConfig as M, ResolvedVoiceConfig as N, PlanningModeConfig as O, VoiceAdapterConfig as P, VoiceMode as R, IDoomConfigLoader as S, LenientParseResult as T, VoiceTtsEngine as V, DoomConfigTransitionStrategy as _, ConfigDiagnostic as a, EditorConfig as b, DeepReadonly as c, DoomConfigLayer as d, DoomConfigLayers as f, DoomConfigTransitionRecord as g, DoomConfigTransitionPhase as h, AutocompactTokenConfig as i, ProjectTrust as j, PlanningThinkingLevel as k, DoomConfig as l, DoomConfigSelection as m, AutocompactOverrideConfig as n, ConfigValueOrigin as o, DoomConfigPendingSelection as p, AutocompactThresholdConfig as r, DOOM_CONFIG_SERVICE as s, AutocompactModeConfig as t, DoomConfigContext as u, DoomHarnessContext as v, LenientParseOptions as w, HarnessState as x, DoomSelectionConfig as y, VoiceModelConfig as z }; //# sourceMappingURL=config-XC40aztM.d.mts.map