import { PoMcpProjection } from "@agimon-ai/po-core/mcpProjection"; import { PackageAttribution, PackageAttribution as PackageAttribution$1 } from "@agimon-ai/po-core/contextProjection"; import { IPoConfigService, PO_CONFIG_SERVICE } from "@agimon-ai/po-core/config"; //#region src/types/profiles.d.ts interface PersonaIdentity { name?: string; icon?: string; /** What the persona does, shown under its name in pickers. */ role?: string; /** Display-only address a profile source supplies, such as a mailbox. Never a secret. */ contact?: string; } interface PersonaVoiceOverride { /** Engine voice id, e.g. a macOS `say` voice name. */ voice?: string; /** Words per minute. */ rate?: number; } interface PersonaFrontMatter { /** Display name shown instead of the profile's directory name. */ name?: string; /** Icon path, relative to the persona directory. */ icon?: string; /** One line on what the persona does, shown under its name in pickers. */ role?: string; /** Narrowly scoped TTS override; the engine itself stays global. */ voice?: PersonaVoiceOverride; } interface PersonaDocument { frontMatter?: PersonaFrontMatter; /** The persona text with a recognised block removed, otherwise the input unchanged. */ body: string; } //#endregion //#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[]; } /** Global-only. Automatic extraction is opt-in: it sends session text to the auxiliary model. */ interface ProfileMemoryConfig { automatic?: boolean; } /** * Defaults for every Team subagent. Wins over the Team package entry in * presets.yaml for the model list; excluded tools are added to the layers' own. */ interface ArtifactsConfig { /** Workspace-relative parent folder for new sessions' artifact folders. Repository-only; existing sessions keep their folder. */ parent?: string; } interface CanvasConfig { /** Where New canvas saves boards: a workspace-relative folder or `artifact:`. Unset saves to `artifact:canvas`. */ directory?: string; } interface SubagentsConfig { model?: string; thinking?: PlanningThinkingLevel; fallbackModels?: string[]; excludeTools?: string[]; /** One named agent's model and thinking. They win over its file's frontmatter and the defaults above. */ agents?: Record; } interface ComputerUseConfig { enabled?: boolean; } /** * What Po Desktop hands its server and agents from your login shell. Global-only and read at * launch. The core variables (HOME, PATH, SHELL, USER, LOGNAME, USERNAME, TMPDIR, TEMP, TMP) * always pass, because Po itself cannot start without them. */ interface DesktopEnvironmentConfig { /** Start from every login-shell variable (the default) or from the core variables only. */ inherit?: 'all' | 'core'; /** Name patterns, `*` matching anything and case ignored, removed after inheriting. */ exclude?: string[]; /** When non-empty, only names matching one of these patterns pass, besides the core variables. */ includeOnly?: string[]; /** Fixed values added last, so they win over anything inherited. */ set?: Record; } interface EditorConfig { command?: string; } /** How browse-tool launches Chromium. Global-only: one daemon serves every repository. */ interface BrowseConfig { /** Unset keeps browse-tool's built-in choice. */ engine?: 'cloak' | 'chrome-for-testing'; /** What to do when CloakBrowser cannot start. Unset means stop with the error. */ fallback?: 'none' | 'chrome-for-testing'; } /** iOS simulator pool settings. Global-only: one pool serves every repository. */ interface IosPoolConfig { /** Simulators kept booted while idle. Unset leaves the consumer default. */ minBooted?: number; /** Most simulators booted at once. */ maxBooted?: number; /** Most simulators the pool creates in total. */ maxDevices?: number; /** Minutes a booted simulator may sit idle before it shuts down. */ idleShutdownMinutes?: number; /** Seconds a lease request waits for a free simulator. */ waitTimeoutSeconds?: number; /** Simulator device type identifier for new devices. */ deviceType?: string; /** Simulator runtime identifier for new devices. */ runtime?: string; } /** How Po drives iOS simulators and devices. Global-only: one pool serves every repository. */ interface IosConfig { pool?: IosPoolConfig; /** Path to the iOS helper binary. Unset keeps the bundled helper. */ helperPath?: string; device?: { /** Apple development team used to sign builds for physical devices. */ developmentTeam?: string; /** Per hardware UDID. Unlisted phones remain available; does not grant acquisition approval. */ availability?: Record; }; } 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; /** Live conversation settings. Global-only; unset fields use the realtime defaults. */ live?: { voice?: string; model?: string; }; } 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 `po 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 PoSelectionConfig { preset?: string; domains?: string[]; profile?: string; } /** The selection persisted in a Pi session entry. */ interface PoConfigSelection { readonly version: 1; readonly preset: string; readonly domains: readonly string[]; readonly profile?: string; /** Canonical identity of the parent/child extension composition. */ readonly compositionFingerprint?: string; } type PoConfigTransitionStrategy = 'pi-reload' | 'process-relaunch'; type PoConfigTransitionPhase = 'pending' | 'applied' | 'aborted' | 'superseded'; interface PoConfigTransitionRecord { readonly version: 1; readonly operationId: string; readonly active: PoConfigSelection; readonly target: PoConfigSelection; readonly strategy: PoConfigTransitionStrategy; readonly phase: PoConfigTransitionPhase; } /** A transition journal target that has not yet received an explicit fresh-session acknowledgement. */ type PoConfigPendingSelection = PoConfigTransitionRecord & { readonly phase: 'pending'; }; /** A named repository workspace, declared in `.po/workspaces.yaml`. */ interface WorkspaceDeclaration { name: string; /** Repository-root-relative workspace path, defaulting to `.`. */ path?: string; alias?: string; instructions?: string; /** Free-form JSON data. Each plugin validates and interprets its own values. */ metadata?: Record; } interface PoConfig { /** Host-only marketplace authority. Repository and member settings cannot redirect package installs. */ marketplace?: { url: string; }; /** Repository-only workspace declarations, never inherited from personal config. */ workspaces?: WorkspaceDeclaration[]; modes?: { planning?: PlanningModeConfig; autocompact?: AutocompactModeConfig; }; computerUse?: ComputerUseConfig; desktopEnvironment?: DesktopEnvironmentConfig; profileMemory?: ProfileMemoryConfig; subagents?: SubagentsConfig; /** Repository-only, never inherited from personal config. */ artifacts?: ArtifactsConfig; /** Repository value wins over personal. */ canvas?: CanvasConfig; projectTrust: ProjectTrust; editor?: EditorConfig; browse?: BrowseConfig; ios?: IosConfig; voice?: VoiceConfig; selection?: PoSelectionConfig; /** * Default layout identifier, resolved against the available web template packages, and the chosen * background: `/` of an installed `backdrop` fill, or `none`. Unset shows Po's bamboo. */ web?: { template?: string; backdrop?: string; }; /** Phone app layout identifier, resolved against the native templates the admitted packages offer. */ native?: { template?: string; }; } interface HarnessState { root?: string; /** The one named preset this session runs under. */ preset: string; temporaryDirectory?: string; domains: string[]; /** The layer components the preset 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; skillDirectories: string[]; agentDirectories: string[]; additionalDirectories: string[]; childExtensions: string[]; pluginDirectories: string[]; /** File-only authority that the Config core publishes to the session registry. */ mcpProjection?: PoMcpProjection; 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; 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 PoHarnessContext = DeepReadonly; interface PoConfigContext { readonly settings: DeepReadonly; readonly harness: PoHarnessContext; /** 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 IPoConfigLoader { load(repoRoot: string, homeDirectory?: string): PoConfig; } /** The config package's concrete specialization of the cross-package service contract. */ interface IPoConfigService$1 extends IPoConfigService {} declare module '@deepseek-ai/cordis' { interface Context { 'po/config': IPoConfigService$1; } } /** Which file the effective value for a key came from, or that no file set it. */ type ConfigValueOrigin = 'host' | 'repository' | 'default'; /** One of the two config files, as a settings surface needs to see it. */ interface PoConfigLayer { 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. * * `loadPoConfig` 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 PoConfigLayers { /** Named with the suffix because a bare `global` reads as the process global. */ globalFile: PoConfigLayer; repositoryFile: PoConfigLayer; effective: PoConfig; /** 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: PoConfig; diagnostics: ConfigDiagnostic[]; } //#endregion export { PoSelectionConfig as A, VoiceTtsConfig as B, PoConfigLayers as C, PoConfigTransitionRecord as D, PoConfigTransitionPhase as E, VoiceAutoCaptureConfig as F, PersonaIdentity as G, WorkspaceDeclaration as H, VoiceConfig as I, PersonaVoiceOverride as K, VoiceEngine as L, ResolvedVoiceAutoCaptureConfig as M, ResolvedVoiceConfig as N, PoConfigTransitionStrategy as O, VoiceAdapterConfig as P, VoiceMode as R, PoConfigLayer as S, PoConfigSelection as T, PersonaDocument as U, VoiceTtsEngine as V, PersonaFrontMatter as W, PlanningAgentConfig as _, ConfigDiagnostic as a, PoConfig as b, DesktopEnvironmentConfig as c, IPoConfigLoader as d, IPoConfigService$1 as f, PackageAttribution$1 as g, PO_CONFIG_SERVICE as h, AutocompactTokenConfig as i, ProjectTrust as j, PoHarnessContext as k, EditorConfig as l, LenientParseResult as m, AutocompactOverrideConfig as n, ConfigValueOrigin as o, LenientParseOptions as p, AutocompactThresholdConfig as r, DeepReadonly as s, AutocompactModeConfig as t, HarnessState as u, PlanningModeConfig as v, PoConfigPendingSelection as w, PoConfigContext as x, PlanningThinkingLevel as y, VoiceModelConfig as z }; //# sourceMappingURL=config-DS0HTIUU.d.mts.map