@agimon-ai/po-config 0.0.0-alpha.64 → 0.0.0-alpha.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/{config-CLnCOtWI.d.mts → config-4EfFyCde.d.mts} +29 -1
  2. package/dist/config-4EfFyCde.d.mts.map +1 -0
  3. package/dist/{config-BoGdygUh.mjs → config-cVSd0PCK.mjs} +2 -2
  4. package/dist/{config-BoGdygUh.mjs.map → config-cVSd0PCK.mjs.map} +1 -1
  5. package/dist/{config-CfxXkPFL.cjs → config-f7hELkaA.cjs} +2 -2
  6. package/dist/{config-CfxXkPFL.cjs.map → config-f7hELkaA.cjs.map} +1 -1
  7. package/dist/config.cjs +3 -3
  8. package/dist/config.d.mts +2 -2
  9. package/dist/config.mjs +3 -3
  10. package/dist/{configPolicy-Bfjs9rNu.mjs → configPolicy-CSKpgMK1.mjs} +67 -2
  11. package/dist/configPolicy-CSKpgMK1.mjs.map +1 -0
  12. package/dist/{configPolicy-BnXFfsYP.cjs → configPolicy-JEZLeqfu.cjs} +67 -2
  13. package/dist/configPolicy-JEZLeqfu.cjs.map +1 -0
  14. package/dist/{configWriter-CGmvn7Ym.mjs → configWriter-CWFj6MRP.mjs} +2 -2
  15. package/dist/{configWriter-CGmvn7Ym.mjs.map → configWriter-CWFj6MRP.mjs.map} +1 -1
  16. package/dist/{configWriter-NyrfYxzt.cjs → configWriter-DFEUrltZ.cjs} +2 -2
  17. package/dist/{configWriter-NyrfYxzt.cjs.map → configWriter-DFEUrltZ.cjs.map} +1 -1
  18. package/dist/configWriter.cjs +1 -1
  19. package/dist/configWriter.mjs +1 -1
  20. package/dist/{core-BCsaHnW4.cjs → core-Bo9CagYF.cjs} +2 -2
  21. package/dist/{core-BCsaHnW4.cjs.map → core-Bo9CagYF.cjs.map} +1 -1
  22. package/dist/{core-kjAKxQjN.mjs → core-De1LhBLp.mjs} +2 -2
  23. package/dist/{core-kjAKxQjN.mjs.map → core-De1LhBLp.mjs.map} +1 -1
  24. package/dist/{domains-YSZO-ypk.cjs → domains-BpJgQOo7.cjs} +4 -4
  25. package/dist/{domains-YSZO-ypk.cjs.map → domains-BpJgQOo7.cjs.map} +1 -1
  26. package/dist/{domains-2qegiWHu.mjs → domains-CbbPPp-O.mjs} +4 -4
  27. package/dist/{domains-2qegiWHu.mjs.map → domains-CbbPPp-O.mjs.map} +1 -1
  28. package/dist/domains.cjs +2 -2
  29. package/dist/domains.mjs +2 -2
  30. package/dist/extensions/server.cjs +2 -2
  31. package/dist/extensions/server.mjs +2 -2
  32. package/dist/harnessState.d.mts +1 -1
  33. package/dist/harnessStore.d.mts +1 -1
  34. package/dist/{index-CYMPMY_p.d.mts → index-3ZYP880Y.d.mts} +2 -2
  35. package/dist/{index-CYMPMY_p.d.mts.map → index-3ZYP880Y.d.mts.map} +1 -1
  36. package/dist/{index-D5HdpyZX.d.mts → index-5oQ9f5p-.d.mts} +2 -2
  37. package/dist/{index-D5HdpyZX.d.mts.map → index-5oQ9f5p-.d.mts.map} +1 -1
  38. package/dist/{index-BlpbplkB.d.mts → index-Bv84AyB4.d.mts} +2 -2
  39. package/dist/{index-BlpbplkB.d.mts.map → index-Bv84AyB4.d.mts.map} +1 -1
  40. package/dist/{index-CvsscY7Q.d.mts → index-CblgdPUi.d.mts} +2 -2
  41. package/dist/{index-CvsscY7Q.d.mts.map → index-CblgdPUi.d.mts.map} +1 -1
  42. package/dist/{index-CM-h6rJ1.d.mts → index-DBFRYOGD.d.mts} +3 -3
  43. package/dist/{index-CM-h6rJ1.d.mts.map → index-DBFRYOGD.d.mts.map} +1 -1
  44. package/dist/index.cjs +11 -11
  45. package/dist/index.d.mts +6 -6
  46. package/dist/index.mjs +11 -11
  47. package/dist/{init-BoPgLiM4.mjs → init-3_18AUbs.mjs} +3 -3
  48. package/dist/{init-BoPgLiM4.mjs.map → init-3_18AUbs.mjs.map} +1 -1
  49. package/dist/{init-CKqxAxeF.cjs → init-C4nc5_VA.cjs} +3 -3
  50. package/dist/{init-CKqxAxeF.cjs.map → init-C4nc5_VA.cjs.map} +1 -1
  51. package/dist/init.cjs +1 -1
  52. package/dist/init.mjs +1 -1
  53. package/dist/{layeredConfig-DdpSNDfd.mjs → layeredConfig-CupiznO2.mjs} +2 -2
  54. package/dist/{layeredConfig-DdpSNDfd.mjs.map → layeredConfig-CupiznO2.mjs.map} +1 -1
  55. package/dist/{layeredConfig-oUS7I39q.cjs → layeredConfig-y8JLxMav.cjs} +2 -2
  56. package/dist/{layeredConfig-oUS7I39q.cjs.map → layeredConfig-y8JLxMav.cjs.map} +1 -1
  57. package/dist/layeredConfig.cjs +1 -1
  58. package/dist/layeredConfig.mjs +1 -1
  59. package/dist/{majorModes-53cpMeH4.mjs → majorModes-B42Mubnl.mjs} +2 -2
  60. package/dist/{majorModes-53cpMeH4.mjs.map → majorModes-B42Mubnl.mjs.map} +1 -1
  61. package/dist/{majorModes-dXWXQoQq.cjs → majorModes-D_lFX4e9.cjs} +2 -2
  62. package/dist/{majorModes-dXWXQoQq.cjs.map → majorModes-D_lFX4e9.cjs.map} +1 -1
  63. package/dist/majorModes.cjs +1 -1
  64. package/dist/majorModes.d.mts +1 -1
  65. package/dist/majorModes.mjs +1 -1
  66. package/dist/piContext.cjs +1 -1
  67. package/dist/piContext.d.mts +2 -2
  68. package/dist/piContext.mjs +1 -1
  69. package/dist/{profiles-DJRBVFwg.cjs → profiles-BvnOTO9O.cjs} +2 -2
  70. package/dist/{profiles-DJRBVFwg.cjs.map → profiles-BvnOTO9O.cjs.map} +1 -1
  71. package/dist/{profiles-BiiDknM0.mjs → profiles-Caiiic52.mjs} +2 -2
  72. package/dist/{profiles-BiiDknM0.mjs.map → profiles-Caiiic52.mjs.map} +1 -1
  73. package/dist/profiles.cjs +1 -1
  74. package/dist/profiles.mjs +1 -1
  75. package/dist/selectionSwitch.cjs +2 -2
  76. package/dist/selectionSwitch.d.mts +2 -2
  77. package/dist/selectionSwitch.mjs +2 -2
  78. package/dist/{sessionConfig-CSm5ZYYd.cjs → sessionConfig-DFMAABdO.cjs} +2 -2
  79. package/dist/{sessionConfig-CSm5ZYYd.cjs.map → sessionConfig-DFMAABdO.cjs.map} +1 -1
  80. package/dist/{sessionConfig-B4G6T_tL.mjs → sessionConfig-DrB9rlW2.mjs} +2 -2
  81. package/dist/{sessionConfig-B4G6T_tL.mjs.map → sessionConfig-DrB9rlW2.mjs.map} +1 -1
  82. package/dist/{settingsApi-DSZBvHu1.cjs → settingsApi-B_pmXLn5.cjs} +8 -8
  83. package/dist/{settingsApi-DSZBvHu1.cjs.map → settingsApi-B_pmXLn5.cjs.map} +1 -1
  84. package/dist/{settingsApi-f_Fuc4cT.mjs → settingsApi-DY1FY2_C.mjs} +8 -8
  85. package/dist/{settingsApi-f_Fuc4cT.mjs.map → settingsApi-DY1FY2_C.mjs.map} +1 -1
  86. package/dist/types.d.mts +1 -1
  87. package/package.json +4 -4
  88. package/dist/config-CLnCOtWI.d.mts.map +0 -1
  89. package/dist/configPolicy-Bfjs9rNu.mjs.map +0 -1
  90. package/dist/configPolicy-BnXFfsYP.cjs.map +0 -1
@@ -101,6 +101,33 @@ interface BrowseConfig {
101
101
  /** What to do when CloakBrowser cannot start. Unset means stop with the error. */
102
102
  fallback?: 'none' | 'chrome-for-testing';
103
103
  }
104
+ /** iOS simulator pool settings. Global-only: one pool serves every repository. */
105
+ interface IosPoolConfig {
106
+ /** Simulators kept booted while idle. Unset leaves the consumer default. */
107
+ minBooted?: number;
108
+ /** Most simulators booted at once. */
109
+ maxBooted?: number;
110
+ /** Most simulators the pool creates in total. */
111
+ maxDevices?: number;
112
+ /** Minutes a booted simulator may sit idle before it shuts down. */
113
+ idleShutdownMinutes?: number;
114
+ /** Seconds a lease request waits for a free simulator. */
115
+ waitTimeoutSeconds?: number;
116
+ /** Simulator device type identifier for new devices. */
117
+ deviceType?: string;
118
+ /** Simulator runtime identifier for new devices. */
119
+ runtime?: string;
120
+ }
121
+ /** How Po drives iOS simulators and devices. Global-only: one pool serves every repository. */
122
+ interface IosConfig {
123
+ pool?: IosPoolConfig;
124
+ /** Path to the iOS helper binary. Unset keeps the bundled helper. */
125
+ helperPath?: string;
126
+ device?: {
127
+ /** Apple development team used to sign builds for physical devices. */
128
+ developmentTeam?: string;
129
+ };
130
+ }
104
131
  interface VoiceModelConfig {
105
132
  path?: string;
106
133
  id?: string;
@@ -227,6 +254,7 @@ interface PoConfig {
227
254
  projectTrust: ProjectTrust;
228
255
  editor?: EditorConfig;
229
256
  browse?: BrowseConfig;
257
+ ios?: IosConfig;
230
258
  voice?: VoiceConfig;
231
259
  selection?: PoSelectionConfig;
232
260
  /** Default layout identifier, resolved against the available web template packages. */
@@ -360,4 +388,4 @@ interface LenientParseResult {
360
388
  }
361
389
  //#endregion
362
390
  export { PoSelectionConfig as A, VoiceTtsConfig as B, PoConfigLayers as C, PoConfigTransitionRecord as D, PoConfigTransitionPhase as E, VoiceAutoCaptureConfig as F, WorkspaceDeclaration as H, VoiceConfig as I, VoiceEngine as L, ResolvedVoiceAutoCaptureConfig as M, ResolvedVoiceConfig as N, PoConfigTransitionStrategy as O, VoiceAdapterConfig as P, VoiceMode as R, PoConfigLayer as S, PoConfigSelection as T, VoiceTtsEngine as V, 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 };
363
- //# sourceMappingURL=config-CLnCOtWI.d.mts.map
391
+ //# sourceMappingURL=config-4EfFyCde.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-4EfFyCde.d.mts","names":["IPoConfigService","PoConfigServiceContract"],"sources":["../src/types/config.ts"],"mappings":";;;;;KAOY;KACA;KACA;KACA;KACA;UAEK;EACf;EACA,WAAW;;UAEI;EACf,OAAO;EACP,YAAY;EACZ;;;;;;;;;UASe;EACf;EACA;EACA;;;;;;;;;UASe;EACf;EACA;EACA;;;;;;;;;UASe;EACf;EACA,QAAQ;;UAEO;EACf;EACA;EACA,WAAW;EACX,aAAa;EACb,YAAY;;;UAGG;EACf;;;;;;UAMe;EACf;EACA,WAAW;EACX;EACA;;UAEe;EACf;;;;;;;UAOe;;EAEf;;EAEA;;EAEA;;EAEA,MAAM;;UAGS;EACf;;;UAGe;;EAEf;;EAEA;;;UAGe;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;UAGe;EACf,OAAO;;EAEP;EACA;;IAEE;;;UAGa;EACf;EACA;;UAEe;EACf;EACA,OAAO;;UAEQ;EACf,QAAQ;EACR;EACA;;UAEe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,KAAK;;UAEU;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,KAAK;;UAEU;EACf,OAAO;EACP,SAAS;EACT;EACA;IAAa;IAAiB;;EAC9B;IACE,gBAAgB;IAChB,mBAAmB;IACnB,gBAAgB;;EAElB,cAAc;;EAEd;IACE;IACA;;IAEA,eAAe;;;UAGF;EACf,MAAM;EACN,QAAQ;EACR;EACA;IAAY;IAAiB;;EAC7B,UAAU,YAAY;EACtB,cAAc;;;;;;;;;UASC;EACf;EACA;EACA;;;UAIe;WACN;WACA;WACA;WACA;;WAEA;;KAGC;KACA;UAEK;WACN;WACA;WACA,QAAQ;WACR,QAAQ;WACR,UAAU;WACV,OAAO;;;KAIN,2BAA2B;WAAsC;;;UAG5D;EACf;EACA;;UAGe;;EAEf,aAAa;EACb;IAAU,WAAW;IAAoB,cAAc;;EACvD,cAAc;EACd,qBAAqB;EACrB,gBAAgB;EAChB,YAAY;EACZ,cAAc;EACd,SAAS;EACT,SAAS;EACT,MAAM;EACN,QAAQ;EACR,YAAY;;EAEZ;IAAQ;;;EAER;IAAW;;;UAMI;EACf;;EAEA;EACA;EACA;;EAEA;;;;;;;;;;;EAWA,qBAAqB,eAAe;;EAEpC;EACA;EACA,oBAAoB;EACpB;EACA;EACA;EACA;EACA;;EAEA,gBAAgB;EAChB;EACA;;;;;;EAMA,kBAAkB;;EAElB,eAAe;EACf;EACA;EACA;;KAGU,aAAa,UAAU,oBAAmB,6BAClD,SACA,+BAA+B,oBACpB,aAAa,WACtB,oCACc,cAAc,SAAS,aAAa,OAAO,YACvD;KAEI,mBAAmB,aAAa;UAE3B;WACN,UAAU,aAAa;WACvB,SAAS;;WAET,mBAAmB,aAAa;;WAEhC;;;UAIM;EACf,KAAK,kBAAkB,yBAAyB;;;UAIjCA,2BAAyBC,iBAAwB,iBAAiB;;YAGvE;IACR,aAAaD;;;;KAQL;;UAGK;EACf;EACA;;;;;;EAMA;;EAEA;;;;;;;;;;UAWe;;EAEf,YAAY;EACZ,gBAAgB;EAChB,WAAW;;EAEX,SAAS,6BAA6B;;EAEtC,QAAQ;;;;;;;;;UAUO;EACf;;EAEA;EACA;;;UAIe;EACf;;;UAIe;EACf,QAAQ;EACR,aAAa"}
@@ -1,4 +1,4 @@
1
- import { c as layerFromText, d as mergeLenientLayers, f as repositoryConfigFor, i as defaultPoConfig, l as lenientConfigFromText, n as composeConfigLayers, o as globalPoConfigPath, r as configFromText, t as absentRepositoryLayer, u as mergeConfigLayers } from "./core-kjAKxQjN.mjs";
1
+ import { c as layerFromText, d as mergeLenientLayers, f as repositoryConfigFor, i as defaultPoConfig, l as lenientConfigFromText, n as composeConfigLayers, o as globalPoConfigPath, r as configFromText, t as absentRepositoryLayer, u as mergeConfigLayers } from "./core-De1LhBLp.mjs";
2
2
  import { nodeHost, readTextIfExists } from "@agimon-ai/po-core/platform";
3
3
  import fs from "node:fs";
4
4
  //#region src/services/config/sync.ts
@@ -109,4 +109,4 @@ async function readPoConfigLayers(fs, repoRoot, context, options = {}) {
109
109
  //#endregion
110
110
  export { loadPoConfigAsync as a, loadPoConfig as i, readPoConfigLayers as n, loadPoConfigLayers as o, readPoConfigLenient as r, loadPoConfigLenient as s, readPoConfig as t };
111
111
 
112
- //# sourceMappingURL=config-BoGdygUh.mjs.map
112
+ //# sourceMappingURL=config-cVSd0PCK.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-BoGdygUh.mjs","names":["readText"],"sources":["../src/services/config/sync.ts","../src/services/config/index.ts"],"sourcesContent":["// sync: readTextSync supports exported Node-only synchronous config readers retained for phase 2.\nimport fs from 'node:fs';\n\nimport { nodeHost } from '@agimon-ai/po-core/platform';\n\nimport type { PoConfig, PoConfigLayers, LenientParseResult } from '../../types/config';\nimport {\n absentRepositoryLayer,\n composeConfigLayers,\n configFromText,\n defaultPoConfig,\n globalPoConfigPath,\n layerFromText,\n lenientConfigFromText,\n mergeConfigLayers,\n mergeLenientLayers,\n repositoryConfigFor,\n} from './core';\n\nfunction readTextSync(filePath: string | undefined): string | undefined {\n if (filePath === undefined) return undefined;\n try {\n return fs.readFileSync(filePath, 'utf8');\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return undefined;\n throw error;\n }\n}\n\nasync function readText(filePath: string): Promise<string | undefined> {\n try {\n return await fs.promises.readFile(filePath, 'utf8');\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return undefined;\n throw error;\n }\n}\n\n/** @deprecated Node-only sync shim; use readPoConfig. Removed in M2. */\nexport function loadPoConfig(\n repoRoot: string,\n homeDirectory = nodeHost.homeDirectory(),\n environment: NodeJS.ProcessEnv = process.env,\n): PoConfig {\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);\n return mergeConfigLayers(\n configFromText(readTextSync(globalPath), globalPath),\n repositoryPath === undefined ? defaultPoConfig() : configFromText(readTextSync(repositoryPath), repositoryPath),\n environment,\n );\n}\n\n/**\n * Loads the merged config, tolerating unknown keys in either file.\n *\n * Only `po sync` uses this. Everything that runs during a session keeps\n * `loadPoConfig`, because a key a running extension cannot understand is\n * better reported than silently ignored; a build that refuses to start over\n * the same key is not.\n *\n * @deprecated Node-only sync shim; use readPoConfigLenient. Removed in M2.\n */\nexport function loadPoConfigLenient(\n repoRoot: string,\n homeDirectory = nodeHost.homeDirectory(),\n environment: NodeJS.ProcessEnv = process.env,\n): LenientParseResult {\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);\n return mergeLenientLayers(\n lenientConfigFromText(readTextSync(globalPath), globalPath),\n lenientConfigFromText(readTextSync(repositoryPath), repositoryPath ?? ''),\n environment,\n );\n}\n\n/** @deprecated Node-only shim over node:fs; use readPoConfig. Removed in M2. */\nexport async function loadPoConfigAsync(\n repoRoot: string,\n homeDirectory = nodeHost.homeDirectory(),\n environment: NodeJS.ProcessEnv = process.env,\n): Promise<PoConfig> {\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);\n const globalConfig = configFromText(await readText(globalPath), globalPath);\n const repositoryConfig =\n repositoryPath === undefined ? defaultPoConfig() : configFromText(await readText(repositoryPath), repositoryPath);\n return mergeConfigLayers(globalConfig, repositoryConfig, environment);\n}\n\n/** @deprecated Node-only sync shim; use readPoConfigLayers. Removed in M2. */\nexport function loadPoConfigLayers(\n repoRoot: string | undefined,\n homeDirectory = nodeHost.homeDirectory(),\n environment: NodeJS.ProcessEnv = process.env,\n): PoConfigLayers {\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repoRoot === undefined ? undefined : repositoryConfigFor(repoRoot, homeDirectory);\n const globalText = readTextSync(globalPath);\n const repositoryText = readTextSync(repositoryPath);\n const repositoryConfig =\n repositoryPath === undefined ? defaultPoConfig() : configFromText(repositoryText, repositoryPath);\n return composeConfigLayers(\n layerFromText(globalPath, globalText),\n repositoryPath === undefined ? absentRepositoryLayer() : layerFromText(repositoryPath, repositoryText),\n mergeConfigLayers(configFromText(globalText, globalPath), repositoryConfig, environment),\n );\n}\n","import { nodeHost, readTextIfExists, type FileSystem } from '@agimon-ai/po-core/platform';\n\nimport type { PoConfig, PoConfigLayers, LenientParseResult } from '../../types/config';\nimport {\n absentRepositoryLayer,\n composeConfigLayers,\n configFromText,\n defaultPoConfig,\n globalPoConfigPath,\n layerFromText,\n lenientConfigFromText,\n mergeConfigLayers,\n mergeLenientLayers,\n repositoryConfigFor,\n type ConfigEnvironment,\n} from './core';\n\ntype IoContext = Parameters<FileSystem['readTextFile']>[1];\n\nexport interface ReadPoConfigOptions {\n /** Defaults to the host's home directory. */\n readonly homeDirectory?: string;\n /** Defaults to `process.env`. */\n readonly environment?: ConfigEnvironment;\n}\n\nfunction resolved(options: ReadPoConfigOptions): { homeDirectory: string; environment: ConfigEnvironment } {\n return {\n homeDirectory: options.homeDirectory ?? nodeHost.homeDirectory(),\n environment: options.environment ?? process.env,\n };\n}\n\nconst readText = (fs: FileSystem, filePath: string | undefined, context: IoContext) =>\n filePath === undefined ? Promise.resolve(undefined) : readTextIfExists(fs, filePath, context);\n\n/**\n * Loads the merged global and repository config over a FileSystem. A missing\n * file contributes the defaults, so a host with neither file, such as a fresh\n * Durable Object filesystem, reads the same config as an empty Node home.\n */\nexport async function readPoConfig(\n fs: FileSystem,\n repoRoot: string,\n context: IoContext,\n options: ReadPoConfigOptions = {},\n): Promise<PoConfig> {\n const { homeDirectory, environment } = resolved(options);\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);\n const globalConfig = configFromText(await readText(fs, globalPath, context), globalPath);\n const repositoryConfig =\n repositoryPath === undefined\n ? defaultPoConfig()\n : configFromText(await readText(fs, repositoryPath, context), repositoryPath);\n return mergeConfigLayers(globalConfig, repositoryConfig, environment);\n}\n\n/** As `readPoConfig`, tolerating unknown keys in either file and reporting them. */\nexport async function readPoConfigLenient(\n fs: FileSystem,\n repoRoot: string,\n context: IoContext,\n options: ReadPoConfigOptions = {},\n): Promise<LenientParseResult> {\n const { homeDirectory, environment } = resolved(options);\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);\n const globalConfig = lenientConfigFromText(await readText(fs, globalPath, context), globalPath);\n const repositoryConfig =\n repositoryPath === undefined\n ? lenientConfigFromText(undefined, '')\n : lenientConfigFromText(await readText(fs, repositoryPath, context), repositoryPath);\n return mergeLenientLayers(globalConfig, repositoryConfig, environment);\n}\n\n/**\n * The two config files kept apart, with the merge alongside them.\n *\n * `repoRoot` is optional because the global file is complete on its own: a\n * settings surface with no repository in view still has settings to show.\n */\nexport async function readPoConfigLayers(\n fs: FileSystem,\n repoRoot: string | undefined,\n context: IoContext,\n options: ReadPoConfigOptions = {},\n): Promise<PoConfigLayers> {\n const { homeDirectory, environment } = resolved(options);\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repoRoot === undefined ? undefined : repositoryConfigFor(repoRoot, homeDirectory);\n const globalText = await readText(fs, globalPath, context);\n const repositoryText = await readText(fs, repositoryPath, context);\n const globalLayer = layerFromText(globalPath, globalText);\n const repositoryLayer =\n repositoryPath === undefined ? absentRepositoryLayer() : layerFromText(repositoryPath, repositoryText);\n const repositoryConfig =\n repositoryPath === undefined ? defaultPoConfig() : configFromText(repositoryText, repositoryPath);\n const effective = mergeConfigLayers(configFromText(globalText, globalPath), repositoryConfig, environment);\n return composeConfigLayers(globalLayer, repositoryLayer, effective);\n}\n\nexport {\n globalPoConfigDirectory,\n globalPoConfigPath,\n isGlobalPoConfigRoot,\n repositoryPoConfigPath,\n resolvePlanningPlansDirectory,\n} from './core';\nexport type { ConfigEnvironment } from './core';\nexport { loadPoConfig, loadPoConfigAsync, loadPoConfigLayers, loadPoConfigLenient } from './sync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,gBAAgB,SAAS,OAAO;CACvD,MAAM,aAAa,mBAAmB,aAAa;CACnD,MAAM,iBAAiB,oBAAoB,UAAU,aAAa;CAClE,MAAM,eAAe,sBAAsB,MAAM,SAAS,IAAI,YAAY,OAAO,GAAG,UAAU;CAC9F,MAAM,mBACJ,mBAAmB,KAAA,IACf,sBAAsB,KAAA,GAAW,EAAE,IACnC,sBAAsB,MAAM,SAAS,IAAI,gBAAgB,OAAO,GAAG,cAAc;CACvF,OAAO,mBAAmB,cAAc,kBAAkB,WAAW;AACvE;;;;;;;AAQA,eAAsB,mBACpB,IACA,UACA,SACA,UAA+B,CAAC,GACP;CACzB,MAAM,EAAE,eAAe,gBAAgB,SAAS,OAAO;CACvD,MAAM,aAAa,mBAAmB,aAAa;CACnD,MAAM,iBAAiB,aAAa,KAAA,IAAY,KAAA,IAAY,oBAAoB,UAAU,aAAa;CACvG,MAAM,aAAa,MAAM,SAAS,IAAI,YAAY,OAAO;CACzD,MAAM,iBAAiB,MAAM,SAAS,IAAI,gBAAgB,OAAO;CACjE,MAAM,cAAc,cAAc,YAAY,UAAU;CACxD,MAAM,kBACJ,mBAAmB,KAAA,IAAY,sBAAsB,IAAI,cAAc,gBAAgB,cAAc;CACvG,MAAM,mBACJ,mBAAmB,KAAA,IAAY,gBAAgB,IAAI,eAAe,gBAAgB,cAAc;CAClG,MAAM,YAAY,kBAAkB,eAAe,YAAY,UAAU,GAAG,kBAAkB,WAAW;CACzG,OAAO,oBAAoB,aAAa,iBAAiB,SAAS;AACpE"}
1
+ {"version":3,"file":"config-cVSd0PCK.mjs","names":["readText"],"sources":["../src/services/config/sync.ts","../src/services/config/index.ts"],"sourcesContent":["// sync: readTextSync supports exported Node-only synchronous config readers retained for phase 2.\nimport fs from 'node:fs';\n\nimport { nodeHost } from '@agimon-ai/po-core/platform';\n\nimport type { PoConfig, PoConfigLayers, LenientParseResult } from '../../types/config';\nimport {\n absentRepositoryLayer,\n composeConfigLayers,\n configFromText,\n defaultPoConfig,\n globalPoConfigPath,\n layerFromText,\n lenientConfigFromText,\n mergeConfigLayers,\n mergeLenientLayers,\n repositoryConfigFor,\n} from './core';\n\nfunction readTextSync(filePath: string | undefined): string | undefined {\n if (filePath === undefined) return undefined;\n try {\n return fs.readFileSync(filePath, 'utf8');\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return undefined;\n throw error;\n }\n}\n\nasync function readText(filePath: string): Promise<string | undefined> {\n try {\n return await fs.promises.readFile(filePath, 'utf8');\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return undefined;\n throw error;\n }\n}\n\n/** @deprecated Node-only sync shim; use readPoConfig. Removed in M2. */\nexport function loadPoConfig(\n repoRoot: string,\n homeDirectory = nodeHost.homeDirectory(),\n environment: NodeJS.ProcessEnv = process.env,\n): PoConfig {\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);\n return mergeConfigLayers(\n configFromText(readTextSync(globalPath), globalPath),\n repositoryPath === undefined ? defaultPoConfig() : configFromText(readTextSync(repositoryPath), repositoryPath),\n environment,\n );\n}\n\n/**\n * Loads the merged config, tolerating unknown keys in either file.\n *\n * Only `po sync` uses this. Everything that runs during a session keeps\n * `loadPoConfig`, because a key a running extension cannot understand is\n * better reported than silently ignored; a build that refuses to start over\n * the same key is not.\n *\n * @deprecated Node-only sync shim; use readPoConfigLenient. Removed in M2.\n */\nexport function loadPoConfigLenient(\n repoRoot: string,\n homeDirectory = nodeHost.homeDirectory(),\n environment: NodeJS.ProcessEnv = process.env,\n): LenientParseResult {\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);\n return mergeLenientLayers(\n lenientConfigFromText(readTextSync(globalPath), globalPath),\n lenientConfigFromText(readTextSync(repositoryPath), repositoryPath ?? ''),\n environment,\n );\n}\n\n/** @deprecated Node-only shim over node:fs; use readPoConfig. Removed in M2. */\nexport async function loadPoConfigAsync(\n repoRoot: string,\n homeDirectory = nodeHost.homeDirectory(),\n environment: NodeJS.ProcessEnv = process.env,\n): Promise<PoConfig> {\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);\n const globalConfig = configFromText(await readText(globalPath), globalPath);\n const repositoryConfig =\n repositoryPath === undefined ? defaultPoConfig() : configFromText(await readText(repositoryPath), repositoryPath);\n return mergeConfigLayers(globalConfig, repositoryConfig, environment);\n}\n\n/** @deprecated Node-only sync shim; use readPoConfigLayers. Removed in M2. */\nexport function loadPoConfigLayers(\n repoRoot: string | undefined,\n homeDirectory = nodeHost.homeDirectory(),\n environment: NodeJS.ProcessEnv = process.env,\n): PoConfigLayers {\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repoRoot === undefined ? undefined : repositoryConfigFor(repoRoot, homeDirectory);\n const globalText = readTextSync(globalPath);\n const repositoryText = readTextSync(repositoryPath);\n const repositoryConfig =\n repositoryPath === undefined ? defaultPoConfig() : configFromText(repositoryText, repositoryPath);\n return composeConfigLayers(\n layerFromText(globalPath, globalText),\n repositoryPath === undefined ? absentRepositoryLayer() : layerFromText(repositoryPath, repositoryText),\n mergeConfigLayers(configFromText(globalText, globalPath), repositoryConfig, environment),\n );\n}\n","import { nodeHost, readTextIfExists, type FileSystem } from '@agimon-ai/po-core/platform';\n\nimport type { PoConfig, PoConfigLayers, LenientParseResult } from '../../types/config';\nimport {\n absentRepositoryLayer,\n composeConfigLayers,\n configFromText,\n defaultPoConfig,\n globalPoConfigPath,\n layerFromText,\n lenientConfigFromText,\n mergeConfigLayers,\n mergeLenientLayers,\n repositoryConfigFor,\n type ConfigEnvironment,\n} from './core';\n\ntype IoContext = Parameters<FileSystem['readTextFile']>[1];\n\nexport interface ReadPoConfigOptions {\n /** Defaults to the host's home directory. */\n readonly homeDirectory?: string;\n /** Defaults to `process.env`. */\n readonly environment?: ConfigEnvironment;\n}\n\nfunction resolved(options: ReadPoConfigOptions): { homeDirectory: string; environment: ConfigEnvironment } {\n return {\n homeDirectory: options.homeDirectory ?? nodeHost.homeDirectory(),\n environment: options.environment ?? process.env,\n };\n}\n\nconst readText = (fs: FileSystem, filePath: string | undefined, context: IoContext) =>\n filePath === undefined ? Promise.resolve(undefined) : readTextIfExists(fs, filePath, context);\n\n/**\n * Loads the merged global and repository config over a FileSystem. A missing\n * file contributes the defaults, so a host with neither file, such as a fresh\n * Durable Object filesystem, reads the same config as an empty Node home.\n */\nexport async function readPoConfig(\n fs: FileSystem,\n repoRoot: string,\n context: IoContext,\n options: ReadPoConfigOptions = {},\n): Promise<PoConfig> {\n const { homeDirectory, environment } = resolved(options);\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);\n const globalConfig = configFromText(await readText(fs, globalPath, context), globalPath);\n const repositoryConfig =\n repositoryPath === undefined\n ? defaultPoConfig()\n : configFromText(await readText(fs, repositoryPath, context), repositoryPath);\n return mergeConfigLayers(globalConfig, repositoryConfig, environment);\n}\n\n/** As `readPoConfig`, tolerating unknown keys in either file and reporting them. */\nexport async function readPoConfigLenient(\n fs: FileSystem,\n repoRoot: string,\n context: IoContext,\n options: ReadPoConfigOptions = {},\n): Promise<LenientParseResult> {\n const { homeDirectory, environment } = resolved(options);\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);\n const globalConfig = lenientConfigFromText(await readText(fs, globalPath, context), globalPath);\n const repositoryConfig =\n repositoryPath === undefined\n ? lenientConfigFromText(undefined, '')\n : lenientConfigFromText(await readText(fs, repositoryPath, context), repositoryPath);\n return mergeLenientLayers(globalConfig, repositoryConfig, environment);\n}\n\n/**\n * The two config files kept apart, with the merge alongside them.\n *\n * `repoRoot` is optional because the global file is complete on its own: a\n * settings surface with no repository in view still has settings to show.\n */\nexport async function readPoConfigLayers(\n fs: FileSystem,\n repoRoot: string | undefined,\n context: IoContext,\n options: ReadPoConfigOptions = {},\n): Promise<PoConfigLayers> {\n const { homeDirectory, environment } = resolved(options);\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repoRoot === undefined ? undefined : repositoryConfigFor(repoRoot, homeDirectory);\n const globalText = await readText(fs, globalPath, context);\n const repositoryText = await readText(fs, repositoryPath, context);\n const globalLayer = layerFromText(globalPath, globalText);\n const repositoryLayer =\n repositoryPath === undefined ? absentRepositoryLayer() : layerFromText(repositoryPath, repositoryText);\n const repositoryConfig =\n repositoryPath === undefined ? defaultPoConfig() : configFromText(repositoryText, repositoryPath);\n const effective = mergeConfigLayers(configFromText(globalText, globalPath), repositoryConfig, environment);\n return composeConfigLayers(globalLayer, repositoryLayer, effective);\n}\n\nexport {\n globalPoConfigDirectory,\n globalPoConfigPath,\n isGlobalPoConfigRoot,\n repositoryPoConfigPath,\n resolvePlanningPlansDirectory,\n} from './core';\nexport type { ConfigEnvironment } from './core';\nexport { loadPoConfig, loadPoConfigAsync, loadPoConfigLayers, loadPoConfigLenient } from './sync';\n"],"mappings":";;;;AAmBA,SAAS,aAAa,UAAkD;CACtE,IAAI,aAAa,KAAA,GAAW,OAAO,KAAA;CACnC,IAAI;EACF,OAAO,GAAG,aAAa,UAAU,MAAM;CACzC,SAAS,OAAO;EACd,IAAK,MAAgC,SAAS,UAAU,OAAO,KAAA;EAC/D,MAAM;CACR;AACF;AAEA,eAAeA,WAAS,UAA+C;CACrE,IAAI;EACF,OAAO,MAAM,GAAG,SAAS,SAAS,UAAU,MAAM;CACpD,SAAS,OAAO;EACd,IAAK,MAAgC,SAAS,UAAU,OAAO,KAAA;EAC/D,MAAM;CACR;AACF;;AAGA,SAAgB,aACd,UACA,gBAAgB,SAAS,cAAc,GACvC,cAAiC,QAAQ,KAC/B;CACV,MAAM,aAAa,mBAAmB,aAAa;CACnD,MAAM,iBAAiB,oBAAoB,UAAU,aAAa;CAClE,OAAO,kBACL,eAAe,aAAa,UAAU,GAAG,UAAU,GACnD,mBAAmB,KAAA,IAAY,gBAA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AiB,MAAM,SAAS,IAAI,gBAAgB,OAAO;CACjE,MAAM,cAAc,cAAc,YAAY,UAAU;CACxD,MAAM,kBACJ,mBAAmB,KAAA,IAAY,sBAAsB,IAAI,cAAc,gBAAgB,cAAc;CACvG,MAAM,mBACJ,mBAAmB,KAAA,IAAY,gBAAgB,IAAI,eAAe,gBAAgB,cAAc;CAClG,MAAM,YAAY,kBAAkB,eAAe,YAAY,UAAU,GAAG,kBAAkB,WAAW;CACzG,OAAO,oBAAoB,aAAa,iBAAiB,SAAS;AACpE"}
@@ -1,5 +1,5 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
2
- const require_core = require("./core-BCsaHnW4.cjs");
2
+ const require_core = require("./core-Bo9CagYF.cjs");
3
3
  let _agimon_ai_po_core_platform = require("@agimon-ai/po-core/platform");
4
4
  let node_fs = require("node:fs");
5
5
  node_fs = require_rolldown_runtime.__toESM(node_fs, 1);
@@ -152,4 +152,4 @@ Object.defineProperty(exports, "readPoConfigLenient", {
152
152
  }
153
153
  });
154
154
 
155
- //# sourceMappingURL=config-CfxXkPFL.cjs.map
155
+ //# sourceMappingURL=config-f7hELkaA.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-CfxXkPFL.cjs","names":["fs","readText","nodeHost","globalPoConfigPath","repositoryConfigFor","mergeConfigLayers","configFromText","defaultPoConfig","mergeLenientLayers","lenientConfigFromText","composeConfigLayers","layerFromText","absentRepositoryLayer","nodeHost","readTextIfExists","globalPoConfigPath","repositoryConfigFor","configFromText","defaultPoConfig","mergeConfigLayers","lenientConfigFromText","mergeLenientLayers","layerFromText","absentRepositoryLayer","composeConfigLayers"],"sources":["../src/services/config/sync.ts","../src/services/config/index.ts"],"sourcesContent":["// sync: readTextSync supports exported Node-only synchronous config readers retained for phase 2.\nimport fs from 'node:fs';\n\nimport { nodeHost } from '@agimon-ai/po-core/platform';\n\nimport type { PoConfig, PoConfigLayers, LenientParseResult } from '../../types/config';\nimport {\n absentRepositoryLayer,\n composeConfigLayers,\n configFromText,\n defaultPoConfig,\n globalPoConfigPath,\n layerFromText,\n lenientConfigFromText,\n mergeConfigLayers,\n mergeLenientLayers,\n repositoryConfigFor,\n} from './core';\n\nfunction readTextSync(filePath: string | undefined): string | undefined {\n if (filePath === undefined) return undefined;\n try {\n return fs.readFileSync(filePath, 'utf8');\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return undefined;\n throw error;\n }\n}\n\nasync function readText(filePath: string): Promise<string | undefined> {\n try {\n return await fs.promises.readFile(filePath, 'utf8');\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return undefined;\n throw error;\n }\n}\n\n/** @deprecated Node-only sync shim; use readPoConfig. Removed in M2. */\nexport function loadPoConfig(\n repoRoot: string,\n homeDirectory = nodeHost.homeDirectory(),\n environment: NodeJS.ProcessEnv = process.env,\n): PoConfig {\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);\n return mergeConfigLayers(\n configFromText(readTextSync(globalPath), globalPath),\n repositoryPath === undefined ? defaultPoConfig() : configFromText(readTextSync(repositoryPath), repositoryPath),\n environment,\n );\n}\n\n/**\n * Loads the merged config, tolerating unknown keys in either file.\n *\n * Only `po sync` uses this. Everything that runs during a session keeps\n * `loadPoConfig`, because a key a running extension cannot understand is\n * better reported than silently ignored; a build that refuses to start over\n * the same key is not.\n *\n * @deprecated Node-only sync shim; use readPoConfigLenient. Removed in M2.\n */\nexport function loadPoConfigLenient(\n repoRoot: string,\n homeDirectory = nodeHost.homeDirectory(),\n environment: NodeJS.ProcessEnv = process.env,\n): LenientParseResult {\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);\n return mergeLenientLayers(\n lenientConfigFromText(readTextSync(globalPath), globalPath),\n lenientConfigFromText(readTextSync(repositoryPath), repositoryPath ?? ''),\n environment,\n );\n}\n\n/** @deprecated Node-only shim over node:fs; use readPoConfig. Removed in M2. */\nexport async function loadPoConfigAsync(\n repoRoot: string,\n homeDirectory = nodeHost.homeDirectory(),\n environment: NodeJS.ProcessEnv = process.env,\n): Promise<PoConfig> {\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);\n const globalConfig = configFromText(await readText(globalPath), globalPath);\n const repositoryConfig =\n repositoryPath === undefined ? defaultPoConfig() : configFromText(await readText(repositoryPath), repositoryPath);\n return mergeConfigLayers(globalConfig, repositoryConfig, environment);\n}\n\n/** @deprecated Node-only sync shim; use readPoConfigLayers. Removed in M2. */\nexport function loadPoConfigLayers(\n repoRoot: string | undefined,\n homeDirectory = nodeHost.homeDirectory(),\n environment: NodeJS.ProcessEnv = process.env,\n): PoConfigLayers {\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repoRoot === undefined ? undefined : repositoryConfigFor(repoRoot, homeDirectory);\n const globalText = readTextSync(globalPath);\n const repositoryText = readTextSync(repositoryPath);\n const repositoryConfig =\n repositoryPath === undefined ? defaultPoConfig() : configFromText(repositoryText, repositoryPath);\n return composeConfigLayers(\n layerFromText(globalPath, globalText),\n repositoryPath === undefined ? absentRepositoryLayer() : layerFromText(repositoryPath, repositoryText),\n mergeConfigLayers(configFromText(globalText, globalPath), repositoryConfig, environment),\n );\n}\n","import { nodeHost, readTextIfExists, type FileSystem } from '@agimon-ai/po-core/platform';\n\nimport type { PoConfig, PoConfigLayers, LenientParseResult } from '../../types/config';\nimport {\n absentRepositoryLayer,\n composeConfigLayers,\n configFromText,\n defaultPoConfig,\n globalPoConfigPath,\n layerFromText,\n lenientConfigFromText,\n mergeConfigLayers,\n mergeLenientLayers,\n repositoryConfigFor,\n type ConfigEnvironment,\n} from './core';\n\ntype IoContext = Parameters<FileSystem['readTextFile']>[1];\n\nexport interface ReadPoConfigOptions {\n /** Defaults to the host's home directory. */\n readonly homeDirectory?: string;\n /** Defaults to `process.env`. */\n readonly environment?: ConfigEnvironment;\n}\n\nfunction resolved(options: ReadPoConfigOptions): { homeDirectory: string; environment: ConfigEnvironment } {\n return {\n homeDirectory: options.homeDirectory ?? nodeHost.homeDirectory(),\n environment: options.environment ?? process.env,\n };\n}\n\nconst readText = (fs: FileSystem, filePath: string | undefined, context: IoContext) =>\n filePath === undefined ? Promise.resolve(undefined) : readTextIfExists(fs, filePath, context);\n\n/**\n * Loads the merged global and repository config over a FileSystem. A missing\n * file contributes the defaults, so a host with neither file, such as a fresh\n * Durable Object filesystem, reads the same config as an empty Node home.\n */\nexport async function readPoConfig(\n fs: FileSystem,\n repoRoot: string,\n context: IoContext,\n options: ReadPoConfigOptions = {},\n): Promise<PoConfig> {\n const { homeDirectory, environment } = resolved(options);\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);\n const globalConfig = configFromText(await readText(fs, globalPath, context), globalPath);\n const repositoryConfig =\n repositoryPath === undefined\n ? defaultPoConfig()\n : configFromText(await readText(fs, repositoryPath, context), repositoryPath);\n return mergeConfigLayers(globalConfig, repositoryConfig, environment);\n}\n\n/** As `readPoConfig`, tolerating unknown keys in either file and reporting them. */\nexport async function readPoConfigLenient(\n fs: FileSystem,\n repoRoot: string,\n context: IoContext,\n options: ReadPoConfigOptions = {},\n): Promise<LenientParseResult> {\n const { homeDirectory, environment } = resolved(options);\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);\n const globalConfig = lenientConfigFromText(await readText(fs, globalPath, context), globalPath);\n const repositoryConfig =\n repositoryPath === undefined\n ? lenientConfigFromText(undefined, '')\n : lenientConfigFromText(await readText(fs, repositoryPath, context), repositoryPath);\n return mergeLenientLayers(globalConfig, repositoryConfig, environment);\n}\n\n/**\n * The two config files kept apart, with the merge alongside them.\n *\n * `repoRoot` is optional because the global file is complete on its own: a\n * settings surface with no repository in view still has settings to show.\n */\nexport async function readPoConfigLayers(\n fs: FileSystem,\n repoRoot: string | undefined,\n context: IoContext,\n options: ReadPoConfigOptions = {},\n): Promise<PoConfigLayers> {\n const { homeDirectory, environment } = resolved(options);\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repoRoot === undefined ? undefined : repositoryConfigFor(repoRoot, homeDirectory);\n const globalText = await readText(fs, globalPath, context);\n const repositoryText = await readText(fs, repositoryPath, context);\n const globalLayer = layerFromText(globalPath, globalText);\n const repositoryLayer =\n repositoryPath === undefined ? absentRepositoryLayer() : layerFromText(repositoryPath, repositoryText);\n const repositoryConfig =\n repositoryPath === undefined ? defaultPoConfig() : configFromText(repositoryText, repositoryPath);\n const effective = mergeConfigLayers(configFromText(globalText, globalPath), repositoryConfig, environment);\n return composeConfigLayers(globalLayer, repositoryLayer, effective);\n}\n\nexport {\n globalPoConfigDirectory,\n globalPoConfigPath,\n isGlobalPoConfigRoot,\n repositoryPoConfigPath,\n resolvePlanningPlansDirectory,\n} from './core';\nexport type { ConfigEnvironment } from './core';\nexport { loadPoConfig, loadPoConfigAsync, loadPoConfigLayers, loadPoConfigLenient } from './sync';\n"],"mappings":";;;;;;AAmBA,SAAS,aAAa,UAAkD;CACtE,IAAI,aAAa,KAAA,GAAW,OAAO,KAAA;CACnC,IAAI;EACF,OAAOA,QAAAA,QAAG,aAAa,UAAU,MAAM;CACzC,SAAS,OAAO;EACd,IAAK,MAAgC,SAAS,UAAU,OAAO,KAAA;EAC/D,MAAM;CACR;AACF;AAEA,eAAeC,WAAS,UAA+C;CACrE,IAAI;EACF,OAAO,MAAMD,QAAAA,QAAG,SAAS,SAAS,UAAU,MAAM;CACpD,SAAS,OAAO;EACd,IAAK,MAAgC,SAAS,UAAU,OAAO,KAAA;EAC/D,MAAM;CACR;AACF;;AAGA,SAAgB,aACd,UACA,gBAAgBE,4BAAAA,SAAS,cAAc,GACvC,cAAiC,QAAQ,KAC/B;CACV,MAAM,aAAaC,aAAAA,mBAAmB,aAAa;CACnD,MAAM,iBAAiBC,aAAAA,oBAAoB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AAM,mBACJ,mBAAmB,KAAA,IACfA,aAAAA,sBAAsB,KAAA,GAAW,EAAE,IACnCA,aAAAA,sBAAsB,MAAM,SAAS,IAAI,gBAAgB,OAAO,GAAG,cAAc;CACvF,OAAOC,aAAAA,mBAAmB,cAAc,kBAAkB,WAAW;AACvE;;;;;;;AAQA,eAAsB,mBACpB,IACA,UACA,SACA,UAA+B,CAAC,GACP;CACzB,MAAM,EAAE,eAAe,gBAAgB,SAAS,OAAO;CACvD,MAAM,aAAaN,aAAAA,mBAAmB,aAAa;CACnD,MAAM,iBAAiB,aAAa,KAAA,IAAY,KAAA,IAAYC,aAAAA,oBAAoB,UAAU,aAAa;CACvG,MAAM,aAAa,MAAM,SAAS,IAAI,YAAY,OAAO;CACzD,MAAM,iBAAiB,MAAM,SAAS,IAAI,gBAAgB,OAAO;CACjE,MAAM,cAAcM,aAAAA,cAAc,YAAY,UAAU;CACxD,MAAM,kBACJ,mBAAmB,KAAA,IAAYC,aAAAA,sBAAsB,IAAID,aAAAA,cAAc,gBAAgB,cAAc;CACvG,MAAM,mBACJ,mBAAmB,KAAA,IAAYJ,aAAAA,gBAAgB,IAAID,aAAAA,eAAe,gBAAgB,cAAc;CAClG,MAAM,YAAYE,aAAAA,kBAAkBF,aAAAA,eAAe,YAAY,UAAU,GAAG,kBAAkB,WAAW;CACzG,OAAOO,aAAAA,oBAAoB,aAAa,iBAAiB,SAAS;AACpE"}
1
+ {"version":3,"file":"config-f7hELkaA.cjs","names":["fs","readText","nodeHost","globalPoConfigPath","repositoryConfigFor","mergeConfigLayers","configFromText","defaultPoConfig","mergeLenientLayers","lenientConfigFromText","composeConfigLayers","layerFromText","absentRepositoryLayer","nodeHost","readTextIfExists","globalPoConfigPath","repositoryConfigFor","configFromText","defaultPoConfig","mergeConfigLayers","lenientConfigFromText","mergeLenientLayers","layerFromText","absentRepositoryLayer","composeConfigLayers"],"sources":["../src/services/config/sync.ts","../src/services/config/index.ts"],"sourcesContent":["// sync: readTextSync supports exported Node-only synchronous config readers retained for phase 2.\nimport fs from 'node:fs';\n\nimport { nodeHost } from '@agimon-ai/po-core/platform';\n\nimport type { PoConfig, PoConfigLayers, LenientParseResult } from '../../types/config';\nimport {\n absentRepositoryLayer,\n composeConfigLayers,\n configFromText,\n defaultPoConfig,\n globalPoConfigPath,\n layerFromText,\n lenientConfigFromText,\n mergeConfigLayers,\n mergeLenientLayers,\n repositoryConfigFor,\n} from './core';\n\nfunction readTextSync(filePath: string | undefined): string | undefined {\n if (filePath === undefined) return undefined;\n try {\n return fs.readFileSync(filePath, 'utf8');\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return undefined;\n throw error;\n }\n}\n\nasync function readText(filePath: string): Promise<string | undefined> {\n try {\n return await fs.promises.readFile(filePath, 'utf8');\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return undefined;\n throw error;\n }\n}\n\n/** @deprecated Node-only sync shim; use readPoConfig. Removed in M2. */\nexport function loadPoConfig(\n repoRoot: string,\n homeDirectory = nodeHost.homeDirectory(),\n environment: NodeJS.ProcessEnv = process.env,\n): PoConfig {\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);\n return mergeConfigLayers(\n configFromText(readTextSync(globalPath), globalPath),\n repositoryPath === undefined ? defaultPoConfig() : configFromText(readTextSync(repositoryPath), repositoryPath),\n environment,\n );\n}\n\n/**\n * Loads the merged config, tolerating unknown keys in either file.\n *\n * Only `po sync` uses this. Everything that runs during a session keeps\n * `loadPoConfig`, because a key a running extension cannot understand is\n * better reported than silently ignored; a build that refuses to start over\n * the same key is not.\n *\n * @deprecated Node-only sync shim; use readPoConfigLenient. Removed in M2.\n */\nexport function loadPoConfigLenient(\n repoRoot: string,\n homeDirectory = nodeHost.homeDirectory(),\n environment: NodeJS.ProcessEnv = process.env,\n): LenientParseResult {\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);\n return mergeLenientLayers(\n lenientConfigFromText(readTextSync(globalPath), globalPath),\n lenientConfigFromText(readTextSync(repositoryPath), repositoryPath ?? ''),\n environment,\n );\n}\n\n/** @deprecated Node-only shim over node:fs; use readPoConfig. Removed in M2. */\nexport async function loadPoConfigAsync(\n repoRoot: string,\n homeDirectory = nodeHost.homeDirectory(),\n environment: NodeJS.ProcessEnv = process.env,\n): Promise<PoConfig> {\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);\n const globalConfig = configFromText(await readText(globalPath), globalPath);\n const repositoryConfig =\n repositoryPath === undefined ? defaultPoConfig() : configFromText(await readText(repositoryPath), repositoryPath);\n return mergeConfigLayers(globalConfig, repositoryConfig, environment);\n}\n\n/** @deprecated Node-only sync shim; use readPoConfigLayers. Removed in M2. */\nexport function loadPoConfigLayers(\n repoRoot: string | undefined,\n homeDirectory = nodeHost.homeDirectory(),\n environment: NodeJS.ProcessEnv = process.env,\n): PoConfigLayers {\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repoRoot === undefined ? undefined : repositoryConfigFor(repoRoot, homeDirectory);\n const globalText = readTextSync(globalPath);\n const repositoryText = readTextSync(repositoryPath);\n const repositoryConfig =\n repositoryPath === undefined ? defaultPoConfig() : configFromText(repositoryText, repositoryPath);\n return composeConfigLayers(\n layerFromText(globalPath, globalText),\n repositoryPath === undefined ? absentRepositoryLayer() : layerFromText(repositoryPath, repositoryText),\n mergeConfigLayers(configFromText(globalText, globalPath), repositoryConfig, environment),\n );\n}\n","import { nodeHost, readTextIfExists, type FileSystem } from '@agimon-ai/po-core/platform';\n\nimport type { PoConfig, PoConfigLayers, LenientParseResult } from '../../types/config';\nimport {\n absentRepositoryLayer,\n composeConfigLayers,\n configFromText,\n defaultPoConfig,\n globalPoConfigPath,\n layerFromText,\n lenientConfigFromText,\n mergeConfigLayers,\n mergeLenientLayers,\n repositoryConfigFor,\n type ConfigEnvironment,\n} from './core';\n\ntype IoContext = Parameters<FileSystem['readTextFile']>[1];\n\nexport interface ReadPoConfigOptions {\n /** Defaults to the host's home directory. */\n readonly homeDirectory?: string;\n /** Defaults to `process.env`. */\n readonly environment?: ConfigEnvironment;\n}\n\nfunction resolved(options: ReadPoConfigOptions): { homeDirectory: string; environment: ConfigEnvironment } {\n return {\n homeDirectory: options.homeDirectory ?? nodeHost.homeDirectory(),\n environment: options.environment ?? process.env,\n };\n}\n\nconst readText = (fs: FileSystem, filePath: string | undefined, context: IoContext) =>\n filePath === undefined ? Promise.resolve(undefined) : readTextIfExists(fs, filePath, context);\n\n/**\n * Loads the merged global and repository config over a FileSystem. A missing\n * file contributes the defaults, so a host with neither file, such as a fresh\n * Durable Object filesystem, reads the same config as an empty Node home.\n */\nexport async function readPoConfig(\n fs: FileSystem,\n repoRoot: string,\n context: IoContext,\n options: ReadPoConfigOptions = {},\n): Promise<PoConfig> {\n const { homeDirectory, environment } = resolved(options);\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);\n const globalConfig = configFromText(await readText(fs, globalPath, context), globalPath);\n const repositoryConfig =\n repositoryPath === undefined\n ? defaultPoConfig()\n : configFromText(await readText(fs, repositoryPath, context), repositoryPath);\n return mergeConfigLayers(globalConfig, repositoryConfig, environment);\n}\n\n/** As `readPoConfig`, tolerating unknown keys in either file and reporting them. */\nexport async function readPoConfigLenient(\n fs: FileSystem,\n repoRoot: string,\n context: IoContext,\n options: ReadPoConfigOptions = {},\n): Promise<LenientParseResult> {\n const { homeDirectory, environment } = resolved(options);\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);\n const globalConfig = lenientConfigFromText(await readText(fs, globalPath, context), globalPath);\n const repositoryConfig =\n repositoryPath === undefined\n ? lenientConfigFromText(undefined, '')\n : lenientConfigFromText(await readText(fs, repositoryPath, context), repositoryPath);\n return mergeLenientLayers(globalConfig, repositoryConfig, environment);\n}\n\n/**\n * The two config files kept apart, with the merge alongside them.\n *\n * `repoRoot` is optional because the global file is complete on its own: a\n * settings surface with no repository in view still has settings to show.\n */\nexport async function readPoConfigLayers(\n fs: FileSystem,\n repoRoot: string | undefined,\n context: IoContext,\n options: ReadPoConfigOptions = {},\n): Promise<PoConfigLayers> {\n const { homeDirectory, environment } = resolved(options);\n const globalPath = globalPoConfigPath(homeDirectory);\n const repositoryPath = repoRoot === undefined ? undefined : repositoryConfigFor(repoRoot, homeDirectory);\n const globalText = await readText(fs, globalPath, context);\n const repositoryText = await readText(fs, repositoryPath, context);\n const globalLayer = layerFromText(globalPath, globalText);\n const repositoryLayer =\n repositoryPath === undefined ? absentRepositoryLayer() : layerFromText(repositoryPath, repositoryText);\n const repositoryConfig =\n repositoryPath === undefined ? defaultPoConfig() : configFromText(repositoryText, repositoryPath);\n const effective = mergeConfigLayers(configFromText(globalText, globalPath), repositoryConfig, environment);\n return composeConfigLayers(globalLayer, repositoryLayer, effective);\n}\n\nexport {\n globalPoConfigDirectory,\n globalPoConfigPath,\n isGlobalPoConfigRoot,\n repositoryPoConfigPath,\n resolvePlanningPlansDirectory,\n} from './core';\nexport type { ConfigEnvironment } from './core';\nexport { loadPoConfig, loadPoConfigAsync, loadPoConfigLayers, loadPoConfigLenient } from './sync';\n"],"mappings":";;;;;;AAmBA,SAAS,aAAa,UAAkD;CACtE,IAAI,aAAa,KAAA,GAAW,OAAO,KAAA;CACnC,IAAI;EACF,OAAOA,QAAAA,QAAG,aAAa,UAAU,MAAM;CACzC,SAAS,OAAO;EACd,IAAK,MAAgC,SAAS,UAAU,OAAO,KAAA;EAC/D,MAAM;CACR;AACF;AAEA,eAAeC,WAAS,UAA+C;CACrE,IAAI;EACF,OAAO,MAAMD,QAAAA,QAAG,SAAS,SAAS,UAAU,MAAM;CACpD,SAAS,OAAO;EACd,IAAK,MAAgC,SAAS,UAAU,OAAO,KAAA;EAC/D,MAAM;CACR;AACF;;AAGA,SAAgB,aACd,UACA,g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nD,MAAM,iBAAiBC,aAAAA,oBAAoB,UAAU,aAAa;CAClE,MAAM,eAAeI,aAAAA,sBAAsB,MAAM,SAAS,IAAI,YAAY,OAAO,GAAG,UAAU;CAC9F,MAAM,mBACJ,mBAAmB,KAAA,IACfA,aAAAA,sBAAsB,KAAA,GAAW,EAAE,IACnCA,aAAAA,sBAAsB,MAAM,SAAS,IAAI,gBAAgB,OAAO,GAAG,cAAc;CACvF,OAAOC,aAAAA,mBAAmB,cAAc,kBAAkB,WAAW;AACvE;;;;;;;AAQA,eAAsB,mBACpB,IACA,UACA,SACA,UAA+B,CAAC,GACP;CACzB,MAAM,EAAE,eAAe,gBAAgB,SAAS,OAAO;CACvD,MAAM,aAAaN,aAAAA,mBAAmB,aAAa;CACnD,MAAM,iBAAiB,aAAa,KAAA,IAAY,KAAA,IAAYC,aAAAA,oBAAoB,UAAU,aAAa;CACvG,MAAM,aAAa,MAAM,SAAS,IAAI,YAAY,OAAO;CACzD,MAAM,iBAAiB,MAAM,SAAS,IAAI,gBAAgB,OAAO;CACjE,MAAM,cAAcM,aAAAA,cAAc,YAAY,UAAU;CACxD,MAAM,kBACJ,mBAAmB,KAAA,IAAYC,aAAAA,sBAAsB,IAAID,aAAAA,cAAc,gBAAgB,cAAc;CACvG,MAAM,mBACJ,mBAAmB,KAAA,IAAYJ,aAAAA,gBAAgB,IAAID,aAAAA,eAAe,gBAAgB,cAAc;CAClG,MAAM,YAAYE,aAAAA,kBAAkBF,aAAAA,eAAe,YAAY,UAAU,GAAG,kBAAkB,WAAW;CACzG,OAAOO,aAAAA,oBAAoB,aAAa,iBAAiB,SAAS;AACpE"}
package/dist/config.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_configPolicy = require("./configPolicy-BnXFfsYP.cjs");
3
- const require_core = require("./core-BCsaHnW4.cjs");
4
- const require_config = require("./config-CfxXkPFL.cjs");
2
+ const require_configPolicy = require("./configPolicy-JEZLeqfu.cjs");
3
+ const require_core = require("./core-Bo9CagYF.cjs");
4
+ const require_config = require("./config-f7hELkaA.cjs");
5
5
  exports.PO_PLANNING_THINKING_LEVELS = require_configPolicy.PO_PLANNING_THINKING_LEVELS;
6
6
  exports.PO_VOICE_ENGINES = require_configPolicy.PO_VOICE_ENGINES;
7
7
  exports.PO_VOICE_LIVE_VOICES = require_configPolicy.PO_VOICE_LIVE_VOICES;
package/dist/config.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { C as PoConfigLayers, S as PoConfigLayer, a as ConfigDiagnostic, m as LenientParseResult, o as ConfigValueOrigin, p as LenientParseOptions } from "./config-CLnCOtWI.mjs";
2
- import { C as loadPoConfigLenient, D as resolvePlanningPlansDirectory, E as repositoryPoConfigPath, S as loadPoConfigLayers, T as globalPoConfigPath, _ as readPoConfig, a as PO_VOICE_MODES, b as loadPoConfig, c as configRootKeys, d as parseAutocompactModeConfig, f as parsePlanningModeConfig, g as ReadPoConfigOptions, h as valueAtKeyPath, i as PO_VOICE_LIVE_VOICES, l as configScopeOf, m as resolveVoiceConfig, n as PO_PLANNING_THINKING_LEVELS, o as PO_VOICE_TTS_ENGINES, p as parsePoConfig, r as PO_VOICE_ENGINES, s as configLeafKeys, t as ConfigKeyScope, u as mergePoConfigs, v as readPoConfigLayers, w as globalPoConfigDirectory, x as loadPoConfigAsync, y as readPoConfigLenient } from "./index-CYMPMY_p.mjs";
1
+ import { C as PoConfigLayers, S as PoConfigLayer, a as ConfigDiagnostic, m as LenientParseResult, o as ConfigValueOrigin, p as LenientParseOptions } from "./config-4EfFyCde.mjs";
2
+ import { C as loadPoConfigLenient, D as resolvePlanningPlansDirectory, E as repositoryPoConfigPath, S as loadPoConfigLayers, T as globalPoConfigPath, _ as readPoConfig, a as PO_VOICE_MODES, b as loadPoConfig, c as configRootKeys, d as parseAutocompactModeConfig, f as parsePlanningModeConfig, g as ReadPoConfigOptions, h as valueAtKeyPath, i as PO_VOICE_LIVE_VOICES, l as configScopeOf, m as resolveVoiceConfig, n as PO_PLANNING_THINKING_LEVELS, o as PO_VOICE_TTS_ENGINES, p as parsePoConfig, r as PO_VOICE_ENGINES, s as configLeafKeys, t as ConfigKeyScope, u as mergePoConfigs, v as readPoConfigLayers, w as globalPoConfigDirectory, x as loadPoConfigAsync, y as readPoConfigLenient } from "./index-3ZYP880Y.mjs";
3
3
  export { type ConfigDiagnostic, type ConfigKeyScope, type ConfigValueOrigin, type LenientParseOptions, type LenientParseResult, PO_PLANNING_THINKING_LEVELS, PO_VOICE_ENGINES, PO_VOICE_LIVE_VOICES, PO_VOICE_MODES, PO_VOICE_TTS_ENGINES, type PoConfigLayer, type PoConfigLayers, type ReadPoConfigOptions, configLeafKeys, configRootKeys, configScopeOf, globalPoConfigDirectory, globalPoConfigPath, loadPoConfig, loadPoConfigAsync, loadPoConfigLayers, loadPoConfigLenient, mergePoConfigs, parseAutocompactModeConfig, parsePlanningModeConfig, parsePoConfig, readPoConfig, readPoConfigLayers, readPoConfigLenient, repositoryPoConfigPath, resolvePlanningPlansDirectory, resolveVoiceConfig, valueAtKeyPath };
package/dist/config.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as PO_VOICE_TTS_ENGINES, c as configScopeOf, d as parsePlanningModeConfig, f as parsePoConfig, i as PO_VOICE_MODES, l as mergePoConfigs, m as valueAtKeyPath, n as PO_VOICE_ENGINES, o as configLeafKeys, p as resolveVoiceConfig, r as PO_VOICE_LIVE_VOICES, s as configRootKeys, t as PO_PLANNING_THINKING_LEVELS, u as parseAutocompactModeConfig } from "./configPolicy-Bfjs9rNu.mjs";
2
- import { a as globalPoConfigDirectory, m as resolvePlanningPlansDirectory, o as globalPoConfigPath, p as repositoryPoConfigPath } from "./core-kjAKxQjN.mjs";
3
- import { a as loadPoConfigAsync, i as loadPoConfig, n as readPoConfigLayers, o as loadPoConfigLayers, r as readPoConfigLenient, s as loadPoConfigLenient, t as readPoConfig } from "./config-BoGdygUh.mjs";
1
+ import { a as PO_VOICE_TTS_ENGINES, c as configScopeOf, d as parsePlanningModeConfig, f as parsePoConfig, i as PO_VOICE_MODES, l as mergePoConfigs, m as valueAtKeyPath, n as PO_VOICE_ENGINES, o as configLeafKeys, p as resolveVoiceConfig, r as PO_VOICE_LIVE_VOICES, s as configRootKeys, t as PO_PLANNING_THINKING_LEVELS, u as parseAutocompactModeConfig } from "./configPolicy-CSKpgMK1.mjs";
2
+ import { a as globalPoConfigDirectory, m as resolvePlanningPlansDirectory, o as globalPoConfigPath, p as repositoryPoConfigPath } from "./core-De1LhBLp.mjs";
3
+ import { a as loadPoConfigAsync, i as loadPoConfig, n as readPoConfigLayers, o as loadPoConfigLayers, r as readPoConfigLenient, s as loadPoConfigLenient, t as readPoConfig } from "./config-cVSd0PCK.mjs";
4
4
  export { PO_PLANNING_THINKING_LEVELS, PO_VOICE_ENGINES, PO_VOICE_LIVE_VOICES, PO_VOICE_MODES, PO_VOICE_TTS_ENGINES, configLeafKeys, configRootKeys, configScopeOf, globalPoConfigDirectory, globalPoConfigPath, loadPoConfig, loadPoConfigAsync, loadPoConfigLayers, loadPoConfigLenient, mergePoConfigs, parseAutocompactModeConfig, parsePlanningModeConfig, parsePoConfig, readPoConfig, readPoConfigLayers, readPoConfigLenient, repositoryPoConfigPath, resolvePlanningPlansDirectory, resolveVoiceConfig, valueAtKeyPath };
@@ -15,6 +15,7 @@ const ROOT_KEYS = [
15
15
  "workspaces",
16
16
  "editor",
17
17
  "browse",
18
+ "ios",
18
19
  "voice",
19
20
  "selection",
20
21
  "web",
@@ -24,6 +25,21 @@ const WORKSPACE_KEYS = ["name", "instructions"];
24
25
  const BROWSE_KEYS = ["engine", "fallback"];
25
26
  const PO_BROWSE_ENGINES = ["cloak", "chrome-for-testing"];
26
27
  const PO_BROWSE_FALLBACKS = ["none", "chrome-for-testing"];
28
+ const IOS_KEYS = [
29
+ "pool",
30
+ "helperPath",
31
+ "device"
32
+ ];
33
+ const IOS_POOL_KEYS = [
34
+ "minBooted",
35
+ "maxBooted",
36
+ "maxDevices",
37
+ "idleShutdownMinutes",
38
+ "waitTimeoutSeconds",
39
+ "deviceType",
40
+ "runtime"
41
+ ];
42
+ const IOS_DEVICE_KEYS = ["developmentTeam"];
27
43
  const SELECTION_KEYS = [
28
44
  "majorMode",
29
45
  "domains",
@@ -576,6 +592,51 @@ function parseBrowse(value, filePath) {
576
592
  ...fallback ? { fallback } : {}
577
593
  };
578
594
  }
595
+ function parseMinimumInteger(value, location, filePath, minimum) {
596
+ if (value === void 0) return void 0;
597
+ if (typeof value !== "number" || !Number.isSafeInteger(value) || value < minimum) throw new Error(`Po config at ${filePath} requires ${location} to be an integer of at least ${minimum}`);
598
+ return value;
599
+ }
600
+ function parseIosPool(value, filePath) {
601
+ if (value === void 0) return void 0;
602
+ if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ios.pool to be an object`);
603
+ assertKeys(value, IOS_POOL_KEYS, "ios.pool", filePath);
604
+ const pool = {};
605
+ const integer = (key, minimum) => {
606
+ const parsed = parseMinimumInteger(value[key], `ios.pool.${key}`, filePath, minimum);
607
+ if (parsed !== void 0) pool[key] = parsed;
608
+ };
609
+ integer("minBooted", 0);
610
+ integer("maxBooted", 1);
611
+ integer("maxDevices", 1);
612
+ integer("idleShutdownMinutes", 1);
613
+ integer("waitTimeoutSeconds", 0);
614
+ const deviceType = optionalString(value.deviceType, "ios.pool.deviceType", filePath);
615
+ if (deviceType !== void 0) pool.deviceType = deviceType;
616
+ const runtime = optionalString(value.runtime, "ios.pool.runtime", filePath);
617
+ if (runtime !== void 0) pool.runtime = runtime;
618
+ if (pool.minBooted !== void 0 && pool.maxBooted !== void 0 && pool.minBooted > pool.maxBooted) throw new Error(`Po config at ${filePath} requires ios.pool.minBooted to be at most ios.pool.maxBooted`);
619
+ if (pool.maxBooted !== void 0 && pool.maxDevices !== void 0 && pool.maxBooted > pool.maxDevices) throw new Error(`Po config at ${filePath} requires ios.pool.maxBooted to be at most ios.pool.maxDevices`);
620
+ if (pool.minBooted !== void 0 && pool.maxDevices !== void 0 && pool.minBooted > pool.maxDevices) throw new Error(`Po config at ${filePath} requires ios.pool.minBooted to be at most ios.pool.maxDevices`);
621
+ return pool;
622
+ }
623
+ function parseIos(value, filePath) {
624
+ if (value === void 0) return void 0;
625
+ if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ios to be an object`);
626
+ assertKeys(value, IOS_KEYS, "ios", filePath);
627
+ const result = {};
628
+ const pool = parseIosPool(value.pool, filePath);
629
+ if (pool) result.pool = pool;
630
+ const helperPath = optionalString(value.helperPath, "ios.helperPath", filePath);
631
+ if (helperPath !== void 0) result.helperPath = helperPath;
632
+ if (value.device !== void 0) {
633
+ if (!isObject(value.device)) throw new Error(`Po config at ${filePath} requires ios.device to be an object`);
634
+ assertKeys(value.device, IOS_DEVICE_KEYS, "ios.device", filePath);
635
+ const developmentTeam = optionalString(value.device.developmentTeam, "ios.device.developmentTeam", filePath);
636
+ result.device = developmentTeam === void 0 ? {} : { developmentTeam };
637
+ }
638
+ return result;
639
+ }
579
640
  /** `web` and `native` each choose a template, so both read the same `{ template }` shape. */
580
641
  function parseTemplateChoice(value, root, filePath) {
581
642
  if (value === void 0) return void 0;
@@ -701,6 +762,7 @@ function parseStrict(content, filePath) {
701
762
  workspaces: parseWorkspaces(parsed.workspaces, filePath),
702
763
  editor: parseEditor(parsed.editor, filePath),
703
764
  browse: parseBrowse(parsed.browse, filePath),
765
+ ios: parseIos(parsed.ios, filePath),
704
766
  voice: parseVoice(parsed.voice, filePath),
705
767
  selection: parseSelection(parsed.selection, filePath),
706
768
  web: parseTemplateChoice(parsed.web, "web", filePath),
@@ -720,6 +782,7 @@ function mergePoConfigs(globalConfig, repositoryConfig) {
720
782
  if (repositoryConfig.computerUse) throw new Error("Repository Po config computerUse is global-only; configure it in ~/.po/config.yaml");
721
783
  if (repositoryConfig.desktopEnvironment) throw new Error("Repository Po config desktopEnvironment is global-only; configure it in ~/.po/config.yaml");
722
784
  if (repositoryConfig.browse) throw new Error("Repository Po config browse is global-only; configure it in ~/.po/config.yaml");
785
+ if (repositoryConfig.ios) throw new Error("Repository Po config ios is global-only; configure it in ~/.po/config.yaml");
723
786
  if (repositoryConfig.profileMemory) throw new Error("Repository Po config profileMemory is global-only; configure it in ~/.po/config.yaml");
724
787
  const globalPlanning = globalConfig.modes?.planning;
725
788
  const repositoryPlanning = repositoryConfig.modes?.planning;
@@ -755,6 +818,7 @@ function mergePoConfigs(globalConfig, repositoryConfig) {
755
818
  workspaces: repositoryConfig.workspaces,
756
819
  editor: globalConfig.editor,
757
820
  browse: globalConfig.browse,
821
+ ios: globalConfig.ios,
758
822
  voice,
759
823
  web: globalConfig.web || repositoryConfig.web ? { template: repositoryConfig.web?.template ?? globalConfig.web?.template } : void 0,
760
824
  native: globalConfig.native || repositoryConfig.native ? { template: repositoryConfig.native?.template ?? globalConfig.native?.template } : void 0,
@@ -838,7 +902,8 @@ const GLOBAL_ONLY_ROOTS = [
838
902
  "desktopEnvironment",
839
903
  "profileMemory",
840
904
  "editor",
841
- "browse"
905
+ "browse",
906
+ "ios"
842
907
  ];
843
908
  const REPOSITORY_ONLY_ROOTS = ["projectTrust", "workspaces"];
844
909
  /** Nested exceptions; a repository declaration of any of them throws in the merge. */
@@ -901,4 +966,4 @@ function valueAtKeyPath(value, keyPath) {
901
966
  //#endregion
902
967
  export { PO_VOICE_TTS_ENGINES as a, configScopeOf as c, parsePlanningModeConfig as d, parsePoConfig as f, PO_VOICE_MODES as i, mergePoConfigs as l, valueAtKeyPath as m, PO_VOICE_ENGINES as n, configLeafKeys as o, resolveVoiceConfig as p, PO_VOICE_LIVE_VOICES as r, configRootKeys as s, PO_PLANNING_THINKING_LEVELS as t, parseAutocompactModeConfig as u };
903
968
 
904
- //# sourceMappingURL=configPolicy-Bfjs9rNu.mjs.map
969
+ //# sourceMappingURL=configPolicy-CSKpgMK1.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configPolicy-CSKpgMK1.mjs","names":["parseYaml"],"sources":["../src/services/configPolicy/index.ts"],"sourcesContent":["import { parse as parseYaml } from 'yaml';\n\nimport type {\n AutocompactModeConfig,\n AutocompactOverrideConfig,\n AutocompactThresholdConfig,\n BrowseConfig,\n ComputerUseConfig,\n IosConfig,\n DesktopEnvironmentConfig,\n ProfileMemoryConfig,\n SubagentsConfig,\n ConfigDiagnostic,\n PoConfig,\n PoSelectionConfig,\n EditorConfig,\n LenientParseOptions,\n LenientParseResult,\n PlanningAgentConfig,\n PlanningModeConfig,\n PlanningThinkingLevel,\n ProjectTrust,\n ResolvedVoiceConfig,\n VoiceAdapterConfig,\n VoiceAutoCaptureConfig,\n VoiceConfig,\n VoiceEngine,\n VoiceMode,\n VoiceModelConfig,\n VoiceTtsConfig,\n VoiceTtsEngine,\n WorkspaceDeclaration,\n} from '../../types/config';\nimport type { PersonaVoiceOverride } from '../../types/profiles';\n\nconst DEFAULT_PROJECT_TRUST: ProjectTrust = 'ask';\nconst DEFAULT_VOICE_MODE: VoiceMode = 'legacy';\nconst DEFAULT_VOICE_ENGINE: VoiceEngine = 'auto';\nconst DEFAULT_VOICE_LANGUAGE = 'auto';\nconst DEFAULT_RECORDER_DEVICE = 'none:default';\nconst ROOT_KEYS = [\n 'modes',\n 'computerUse',\n 'desktopEnvironment',\n 'profileMemory',\n 'subagents',\n 'projectTrust',\n 'workspaces',\n 'editor',\n 'browse',\n 'ios',\n 'voice',\n 'selection',\n 'web',\n 'native',\n] as const;\nconst WORKSPACE_KEYS = ['name', 'instructions'] as const;\nconst BROWSE_KEYS = ['engine', 'fallback'] as const;\nexport const PO_BROWSE_ENGINES = ['cloak', 'chrome-for-testing'] as const;\nexport const PO_BROWSE_FALLBACKS = ['none', 'chrome-for-testing'] as const;\nconst IOS_KEYS = ['pool', 'helperPath', 'device'] as const;\nconst IOS_POOL_KEYS = [\n 'minBooted',\n 'maxBooted',\n 'maxDevices',\n 'idleShutdownMinutes',\n 'waitTimeoutSeconds',\n 'deviceType',\n 'runtime',\n] as const;\nconst IOS_DEVICE_KEYS = ['developmentTeam'] as const;\nconst SELECTION_KEYS = ['majorMode', 'domains', 'profile'] as const;\nconst MODE_KEYS = ['planning', 'autocompact'] as const;\nconst PLANNING_KEYS = ['main', 'subagents', 'plansDirectory'] as const;\nconst AGENT_KEYS = ['model', 'thinking'] as const;\nconst AUTOCOMPACT_KEYS = ['enabled', 'model', 'thinking', 'thresholds', 'overrides'] as const;\nconst AUTOCOMPACT_THRESHOLD_KEYS = ['pass1', 'pass2', 'pass3'] as const;\nconst AUTOCOMPACT_OVERRIDE_KEYS = ['model', 'tokens'] as const;\nconst COMPUTER_USE_KEYS = ['enabled'] as const;\nconst DESKTOP_ENVIRONMENT_KEYS = ['inherit', 'exclude', 'includeOnly', 'set'] as const;\nconst ENVIRONMENT_VARIABLE_NAME = /^[A-Za-z_][A-Za-z0-9_]*$/u;\nconst PROFILE_MEMORY_KEYS = ['automatic'] as const;\nconst SUBAGENTS_KEYS = ['model', 'thinking', 'fallbackModels', 'excludeTools'] as const;\n/** A pass that fires below this is noise; one above it never fires before Pi compacts natively. */\nconst MIN_AUTOCOMPACT_RATIO = 0.05;\nconst MAX_AUTOCOMPACT_RATIO = 0.99;\n/**\n * A checkpoint at zero tokens fires before the session has said anything. There is\n * deliberately no ceiling: the package takes the lower of the ratio and the token\n * value, so one larger than the window is inert rather than dangerous.\n */\nconst MIN_AUTOCOMPACT_TOKENS = 1;\nconst EDITOR_KEYS = ['command'] as const;\nconst VOICE_KEYS = ['mode', 'engine', 'language', 'recorder', 'adapters', 'autoCapture', 'live'] as const;\nconst VOICE_LIVE_KEYS = ['voice', 'model', 'orchestrator'] as const;\nconst LIVE_MODEL_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._:-]*$/u;\nconst MAX_LIVE_MODEL_LENGTH = 64;\nconst RECORDER_KEYS = ['binary', 'device'] as const;\nconst WHISPER_CPP_ENGINE = 'whisper-cpp' as const;\nconst OPENAI_WHISPER_ENGINE = 'openai-whisper' as const;\nconst MLX_WHISPER_ENGINE = 'mlx-whisper' as const;\nconst MACOS_SAY_TTS_ENGINE = 'macos-say' as const;\nconst ADAPTERS_KEYS = [WHISPER_CPP_ENGINE, OPENAI_WHISPER_ENGINE, MLX_WHISPER_ENGINE] as const;\nconst ADAPTER_KEYS = ['binary', 'model'] as const;\nconst MODEL_KEYS = ['path', 'id'] as const;\nconst AUTO_CAPTURE_KEYS = [\n 'model',\n 'startPhrases',\n 'stopPhrases',\n 'composeOpenPhrases',\n 'composeSendPhrases',\n 'composeCancelPhrases',\n 'utteranceIdleMs',\n 'composeUtteranceIdleMs',\n 'composeNudgeMs',\n 'transcriptionTimeoutMs',\n 'tts',\n] as const;\nconst TTS_KEYS = ['engine', 'voice', 'rate'] as const;\nconst DEFAULT_UTTERANCE_IDLE_MS = 3_000;\nconst MIN_UTTERANCE_IDLE_MS = 1_500;\nconst MAX_UTTERANCE_IDLE_MS = 10_000;\n/**\n * The endpoint window used while a composition draft is collecting.\n *\n * Shorter than `utteranceIdleMs` on purpose. A turn produces exactly one transcript, so\n * with the ordinary ~3 s window a short command spoken after a brief pause arrives glued\n * to the end of the preceding sentence and can never be read as a command. Roughly twice\n * the VAD's own 600 ms trailing-silence window: long enough that ordinary speech rhythm\n * does not split a sentence, short enough that a deliberate pause does. Over-splitting is\n * harmless here and only here, because draft segments are joined back together with a\n * space.\n */\nconst DEFAULT_COMPOSE_UTTERANCE_IDLE_MS = 1_200;\nconst MIN_COMPOSE_UTTERANCE_IDLE_MS = 800;\nconst MAX_COMPOSE_UTTERANCE_IDLE_MS = 3_000;\n/** Silence before Voice reminds the user a draft is still open. `0` disables it. */\nconst DEFAULT_COMPOSE_NUDGE_MS = 10_000;\nconst MIN_COMPOSE_NUDGE_MS = 5_000;\nconst MAX_COMPOSE_NUDGE_MS = 60_000;\n/**\n * Defaults kept as lists so the phrases that shipped first keep working.\n *\n * `hey po` and `that's it` read as speech; `po prompt` and `po send` are what\n * existing users have in their fingers. Dropping the originals would break them for no\n * gain, and the cost of carrying both is two extra comparisons per command candidate.\n */\nconst DEFAULT_COMPOSE_OPEN_PHRASES = ['hey po', 'po prompt'] as const;\nconst DEFAULT_COMPOSE_SEND_PHRASES = [\"that's it\", 'po send'] as const;\nconst DEFAULT_COMPOSE_CANCEL_PHRASES = ['po cancel', 'scratch that'] as const;\nconst DEFAULT_TRANSCRIPTION_TIMEOUT_MS = 120_000;\nconst MIN_TRANSCRIPTION_TIMEOUT_MS = 1_000;\nconst MAX_TRANSCRIPTION_TIMEOUT_MS = 120_000;\nconst MAX_CONTROL_PHRASES = 16;\nconst MAX_CONTROL_PHRASE_LENGTH = 64;\nconst MAX_TTS_VOICE_LENGTH = 64;\nconst MIN_TTS_RATE = 80;\nconst MAX_TTS_RATE = 500;\nconst MODEL_REFERENCE_PATTERN = /^[^/\\s]+\\/[^/\\s]+(?:\\/[^/\\s]+)*$/u;\nconst PHRASE_PUNCTUATION_PATTERN = /[\\p{P}\\p{S}]+/gu;\n/**\n * The accepted values, in the order a picker should offer them.\n *\n * Exported because the config UI has to offer exactly what the parser accepts,\n * and a second hand-written list in the contributing package would drift. The\n * validating Sets below are built from these for the same reason.\n */\nexport const PO_PLANNING_THINKING_LEVELS = ['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'] as const;\nexport const PO_VOICE_MODES = [DEFAULT_VOICE_MODE, 'live'] as const;\nexport const PO_VOICE_ENGINES = [\n DEFAULT_VOICE_ENGINE,\n WHISPER_CPP_ENGINE,\n OPENAI_WHISPER_ENGINE,\n MLX_WHISPER_ENGINE,\n] as const;\nexport const PO_VOICE_TTS_ENGINES = [MACOS_SAY_TTS_ENGINE] as const;\n/** Codex realtime V3 voices, from `codex-rs/protocol/src/protocol.rs` `RealtimeVoicesList::builtin()`. */\nexport const PO_VOICE_LIVE_VOICES = [\n 'juniper',\n 'maple',\n 'spruce',\n 'ember',\n 'vale',\n 'breeze',\n 'arbor',\n 'sol',\n 'cove',\n 'aube',\n 'bubbie',\n 'haetsal',\n 'hanul',\n 'himari',\n 'leher',\n 'miko',\n 'neer',\n 'porto',\n 'rindo',\n 'rio',\n 'rivage',\n 'selva',\n 'sonna',\n 'tinta',\n 'viola',\n] as const;\n\nconst THINKING_VALUES = new Set<PlanningThinkingLevel>(PO_PLANNING_THINKING_LEVELS);\nconst TRUST_VALUES = new Set<ProjectTrust>(['ask', 'always', 'never']);\nconst VOICE_MODE_VALUES = new Set<VoiceMode>(PO_VOICE_MODES);\nconst ENGINE_VALUES = new Set<VoiceEngine>(PO_VOICE_ENGINES);\nconst TTS_ENGINE_VALUES = new Set<VoiceTtsEngine>(PO_VOICE_TTS_ENGINES);\ntype ConfigObject = Record<string, unknown>;\n\nfunction isObject(value: unknown): value is ConfigObject {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n/**\n * Where a lenient parse collects unknown keys instead of throwing.\n *\n * Module scope rather than a parameter threaded through the twelve nested\n * parsers: `assertKeys` is the only reader, parsing is synchronous end to end,\n * and `parsePoConfig` owns the whole window in a try/finally. Threading would\n * touch every parser to change behaviour in one of them.\n */\nlet unknownKeySink: ConfigDiagnostic[] | undefined;\n\nfunction assertKeys(value: ConfigObject, allowed: readonly string[], location: string, filePath: string): void {\n const unknown = Object.keys(value).filter((key) => !allowed.includes(key));\n if (unknown.length === 0) return;\n if (unknownKeySink !== undefined) {\n // Left on the object rather than deleted: every parser reads the fields it\n // knows by name, so an unknown sibling is already inert.\n for (const key of unknown) {\n unknownKeySink.push({\n filePath,\n path: location === 'root' ? key : `${location}.${key}`,\n message: `unsupported ${location} field`,\n });\n }\n return;\n }\n throw new Error(`Po config at ${filePath} has unsupported ${location} field(s): ${unknown.join(', ')}`);\n}\nfunction optionalString(value: unknown, location: string, filePath: string): string | undefined {\n if (value === undefined) return undefined;\n if (typeof value !== 'string' || value.trim().length === 0)\n throw new Error(`Po config at ${filePath} requires ${location} to be a non-empty string`);\n return value.trim();\n}\nfunction hasControlCharacters(value: string): boolean {\n for (const character of value) {\n const codePoint = character.codePointAt(0);\n if (codePoint !== undefined && (codePoint <= 0x1f || codePoint === 0x7f)) return true;\n }\n return false;\n}\nfunction boundedOptionalString(\n value: unknown,\n location: string,\n filePath: string,\n maximumLength: number,\n): string | undefined {\n const text = optionalString(value, location, filePath);\n if (!text) return undefined;\n if (text.length > maximumLength)\n throw new Error(`Po config at ${filePath} requires ${location} to be at most ${maximumLength} characters`);\n if (hasControlCharacters(text))\n throw new Error(`Po config at ${filePath} does not allow control characters in ${location}`);\n return text;\n}\nfunction parseModelReference(value: unknown, filePath: string): string {\n const location = 'voice.autoCapture.model';\n const model = optionalString(value, location, filePath);\n if (!model || !MODEL_REFERENCE_PATTERN.test(model))\n throw new Error(`Po config at ${filePath} requires ${location} in provider/model-id form`);\n return model;\n}\nfunction normalizeControlPhrase(value: string): string {\n return value\n .normalize('NFKC')\n .toLocaleLowerCase('en-US')\n .replace(PHRASE_PUNCTUATION_PATTERN, ' ')\n .replace(/\\s+/gu, ' ')\n .trim();\n}\nfunction parseControlPhrases(value: unknown, location: string, filePath: string): string[] | undefined {\n if (value === undefined) return undefined;\n if (!Array.isArray(value) || value.some((phrase) => typeof phrase !== 'string'))\n throw new Error(`Po config at ${filePath} requires ${location} to be an array of strings`);\n if (value.length > MAX_CONTROL_PHRASES)\n throw new Error(`Po config at ${filePath} requires ${location} to contain at most ${MAX_CONTROL_PHRASES} phrases`);\n const phrases = value.map((phrase) => phrase.trim());\n const normalized = new Set<string>();\n for (const phrase of phrases) {\n if (phrase.length === 0)\n throw new Error(`Po config at ${filePath} requires ${location} to contain non-empty strings`);\n if (phrase.length > MAX_CONTROL_PHRASE_LENGTH)\n throw new Error(\n `Po config at ${filePath} requires ${location} phrases to be at most ${MAX_CONTROL_PHRASE_LENGTH} characters`,\n );\n if (hasControlCharacters(phrase))\n throw new Error(`Po config at ${filePath} does not allow control characters in ${location}`);\n const key = normalizeControlPhrase(phrase);\n if (!key) throw new Error(`Po config at ${filePath} requires ${location} to contain words`);\n if (normalized.has(key))\n throw new Error(`Po config at ${filePath} does not allow normalized duplicates in ${location}`);\n normalized.add(key);\n }\n return phrases;\n}\nfunction parseBoundedInteger(\n value: unknown,\n location: string,\n filePath: string,\n minimum: number,\n maximum: number,\n): number | undefined {\n if (value === undefined) return undefined;\n if (typeof value !== 'number' || !Number.isInteger(value) || value < minimum || value > maximum)\n throw new Error(`Po config at ${filePath} requires ${location} to be an integer from ${minimum} to ${maximum}`);\n return value;\n}\n/**\n * Rejects a phrase claimed by two control roles at once.\n *\n * Composition commands are adjudicated before stop phrases and before leading\n * start-phrase removal, so a phrase shared with a later role is not ambiguous, it is\n * silently unreachable. Without a screen there is nothing to show which role won.\n */\nfunction assertDisjointPhrases(\n left: readonly string[] | undefined,\n right: readonly string[] | undefined,\n leftName: string,\n rightName: string,\n filePath: string,\n): void {\n const keys = new Set((left ?? []).map(normalizeControlPhrase));\n if ((right ?? []).some((phrase) => keys.has(normalizeControlPhrase(phrase))))\n throw new Error(`Po config at ${filePath} does not allow a phrase in both ${leftName} and ${rightName}`);\n}\nfunction parseTtsConfig(value: unknown, filePath: string): VoiceTtsConfig {\n const location = 'voice.autoCapture.tts';\n if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ${location} to be an object`);\n assertKeys(value, TTS_KEYS, location, filePath);\n if (typeof value.engine !== 'string' || !TTS_ENGINE_VALUES.has(value.engine as VoiceTtsEngine))\n throw new Error(\n `Po config at ${filePath} requires ${location}.engine to be one of: ${[...TTS_ENGINE_VALUES].join(', ')}`,\n );\n const voice = boundedOptionalString(value.voice, `${location}.voice`, filePath, MAX_TTS_VOICE_LENGTH);\n const rate = value.rate;\n if (\n rate !== undefined &&\n (typeof rate !== 'number' || !Number.isInteger(rate) || rate < MIN_TTS_RATE || rate > MAX_TTS_RATE)\n ) {\n throw new Error(\n `Po config at ${filePath} requires ${location}.rate to be an integer from ${MIN_TTS_RATE} to ${MAX_TTS_RATE}`,\n );\n }\n return {\n engine: value.engine as VoiceTtsEngine,\n ...(voice ? { voice } : {}),\n ...(rate === undefined ? {} : { rate }),\n };\n}\nfunction parseAutoCapture(value: unknown, filePath: string): VoiceAutoCaptureConfig | undefined {\n if (value === undefined) return undefined;\n const location = 'voice.autoCapture';\n if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ${location} to be an object`);\n assertKeys(value, AUTO_CAPTURE_KEYS, location, filePath);\n const startPhrases = parseControlPhrases(value.startPhrases, `${location}.startPhrases`, filePath);\n const stopPhrases = parseControlPhrases(value.stopPhrases, `${location}.stopPhrases`, filePath);\n const composeOpenPhrases = parseControlPhrases(value.composeOpenPhrases, `${location}.composeOpenPhrases`, filePath);\n const composeSendPhrases = parseControlPhrases(value.composeSendPhrases, `${location}.composeSendPhrases`, filePath);\n const composeCancelPhrases = parseControlPhrases(\n value.composeCancelPhrases,\n `${location}.composeCancelPhrases`,\n filePath,\n );\n const utteranceIdleMs = parseBoundedInteger(\n value.utteranceIdleMs,\n `${location}.utteranceIdleMs`,\n filePath,\n MIN_UTTERANCE_IDLE_MS,\n MAX_UTTERANCE_IDLE_MS,\n );\n const composeUtteranceIdleMs = parseBoundedInteger(\n value.composeUtteranceIdleMs,\n `${location}.composeUtteranceIdleMs`,\n filePath,\n MIN_COMPOSE_UTTERANCE_IDLE_MS,\n MAX_COMPOSE_UTTERANCE_IDLE_MS,\n );\n // Zero is the documented off switch, so it is accepted outside the range rather than\n // forcing a separate boolean that could disagree with the interval.\n const composeNudgeMs =\n value.composeNudgeMs === 0\n ? 0\n : parseBoundedInteger(\n value.composeNudgeMs,\n `${location}.composeNudgeMs`,\n filePath,\n MIN_COMPOSE_NUDGE_MS,\n MAX_COMPOSE_NUDGE_MS,\n );\n const transcriptionTimeoutMs = parseBoundedInteger(\n value.transcriptionTimeoutMs,\n `${location}.transcriptionTimeoutMs`,\n filePath,\n MIN_TRANSCRIPTION_TIMEOUT_MS,\n MAX_TRANSCRIPTION_TIMEOUT_MS,\n );\n assertDisjointPhrases(startPhrases, stopPhrases, 'startPhrases', 'stopPhrases', filePath);\n // `composeOpenPhrases` may overlap `startPhrases`: addressing the agent and opening a\n // draft are the same gesture, composition is adjudicated first, and the shipped\n // defaults deliberately share `hey po`.\n assertDisjointPhrases(\n composeSendPhrases,\n composeCancelPhrases,\n 'composeSendPhrases',\n 'composeCancelPhrases',\n filePath,\n );\n assertDisjointPhrases(composeOpenPhrases, composeSendPhrases, 'composeOpenPhrases', 'composeSendPhrases', filePath);\n assertDisjointPhrases(\n composeOpenPhrases,\n composeCancelPhrases,\n 'composeOpenPhrases',\n 'composeCancelPhrases',\n filePath,\n );\n assertDisjointPhrases(stopPhrases, composeSendPhrases, 'stopPhrases', 'composeSendPhrases', filePath);\n assertDisjointPhrases(stopPhrases, composeCancelPhrases, 'stopPhrases', 'composeCancelPhrases', filePath);\n return {\n model: parseModelReference(value.model, filePath),\n ...(startPhrases ? { startPhrases } : {}),\n ...(stopPhrases ? { stopPhrases } : {}),\n ...(composeOpenPhrases ? { composeOpenPhrases } : {}),\n ...(composeSendPhrases ? { composeSendPhrases } : {}),\n ...(composeCancelPhrases ? { composeCancelPhrases } : {}),\n ...(utteranceIdleMs === undefined ? {} : { utteranceIdleMs }),\n ...(composeUtteranceIdleMs === undefined ? {} : { composeUtteranceIdleMs }),\n ...(composeNudgeMs === undefined ? {} : { composeNudgeMs }),\n ...(transcriptionTimeoutMs === undefined ? {} : { transcriptionTimeoutMs }),\n tts: parseTtsConfig(value.tts, filePath),\n };\n}\nfunction parseThinking(value: unknown, location: string, filePath: string): PlanningThinkingLevel | undefined {\n if (value === undefined) return undefined;\n if (typeof value !== 'string' || !THINKING_VALUES.has(value as PlanningThinkingLevel)) {\n throw new Error(\n `Po config at ${filePath} requires ${location}.thinking to be one of: ${[...THINKING_VALUES].join(', ')}`,\n );\n }\n return value as PlanningThinkingLevel;\n}\nfunction parseAgent(value: unknown, location: string, filePath: string): PlanningAgentConfig | undefined {\n if (value === undefined) return undefined;\n if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ${location} to be an object`);\n assertKeys(value, AGENT_KEYS, location, filePath);\n const thinking = parseThinking(value.thinking, location, filePath);\n const model = optionalString(value.model, `${location}.model`, filePath);\n return { ...(model ? { model } : {}), ...(thinking ? { thinking } : {}) };\n}\n/**\n * A flag the cockpit can write.\n *\n * The settings page writes strings and nothing else, so `'true'` has to mean\n * what a hand-edited `true` means. Anything else is rejected rather than\n * treated as false, because a typo that silently disables a feature is the\n * worst reading of it.\n */\nfunction parseFlexibleBoolean(value: unknown, location: string, filePath: string): boolean | undefined {\n if (value === undefined) return undefined;\n if (typeof value === 'boolean') return value;\n if (value === 'true') return true;\n if (value === 'false') return false;\n throw new Error(`Po config at ${filePath} requires ${location} to be true or false`);\n}\n/** Same story as the flag: a number, or the string form the settings page writes. */\nfunction parseFlexibleRatio(value: unknown, location: string, filePath: string): number | undefined {\n if (value === undefined) return undefined;\n const ratio = typeof value === 'string' ? Number(value.trim()) : value;\n if (\n typeof ratio !== 'number' ||\n !Number.isFinite(ratio) ||\n ratio < MIN_AUTOCOMPACT_RATIO ||\n ratio > MAX_AUTOCOMPACT_RATIO\n ) {\n throw new Error(\n `Po config at ${filePath} requires ${location} to be a number from ${MIN_AUTOCOMPACT_RATIO} to ${MAX_AUTOCOMPACT_RATIO}`,\n );\n }\n return ratio;\n}\nfunction parseAutocompactThresholds(\n value: unknown,\n location: string,\n filePath: string,\n): AutocompactThresholdConfig | undefined {\n if (value === undefined) return undefined;\n if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ${location} to be an object`);\n assertKeys(value, AUTOCOMPACT_THRESHOLD_KEYS, location, filePath);\n const pass1 = parseFlexibleRatio(value.pass1, `${location}.pass1`, filePath);\n const pass2 = parseFlexibleRatio(value.pass2, `${location}.pass2`, filePath);\n const pass3 = parseFlexibleRatio(value.pass3, `${location}.pass3`, filePath);\n return {\n ...(pass1 === undefined ? {} : { pass1 }),\n ...(pass2 === undefined ? {} : { pass2 }),\n ...(pass3 === undefined ? {} : { pass3 }),\n };\n}\n/** Absolute token counts, unlike the ratios, are only ever written by hand, so no string form is accepted. */\nfunction parseAutocompactTokenCount(value: unknown, location: string, filePath: string): number | undefined {\n if (value === undefined) return undefined;\n if (typeof value !== 'number' || !Number.isSafeInteger(value) || value < MIN_AUTOCOMPACT_TOKENS)\n throw new Error(\n `Po config at ${filePath} requires ${location} to be an integer of at least ${MIN_AUTOCOMPACT_TOKENS}`,\n );\n return value;\n}\nfunction parseAutocompactOverrideEntry(value: unknown, location: string, filePath: string): AutocompactOverrideConfig {\n if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ${location} to be an object`);\n assertKeys(value, AUTOCOMPACT_OVERRIDE_KEYS, location, filePath);\n const model = optionalString(value.model, `${location}.model`, filePath);\n if (!model) throw new Error(`Po config at ${filePath} requires ${location}.model`);\n if (!isObject(value.tokens)) throw new Error(`Po config at ${filePath} requires ${location}.tokens to be an object`);\n assertKeys(value.tokens, AUTOCOMPACT_THRESHOLD_KEYS, `${location}.tokens`, filePath);\n const pass1 = parseAutocompactTokenCount(value.tokens.pass1, `${location}.tokens.pass1`, filePath);\n const pass2 = parseAutocompactTokenCount(value.tokens.pass2, `${location}.tokens.pass2`, filePath);\n const pass3 = parseAutocompactTokenCount(value.tokens.pass3, `${location}.tokens.pass3`, filePath);\n // An entry that pins nothing is a typo rather than a way to say \"leave this model alone\":\n // omitting the entry already does that, and a silent no-op reads like the override worked.\n if (pass1 === undefined && pass2 === undefined && pass3 === undefined)\n throw new Error(`Po config at ${filePath} requires one of ${location}.tokens.pass1, pass2, or pass3`);\n return {\n model,\n tokens: {\n ...(pass1 === undefined ? {} : { pass1 }),\n ...(pass2 === undefined ? {} : { pass2 }),\n ...(pass3 === undefined ? {} : { pass3 }),\n },\n };\n}\nfunction parseAutocompactOverrides(\n value: unknown,\n location: string,\n filePath: string,\n): AutocompactOverrideConfig[] | undefined {\n if (value === undefined) return undefined;\n if (!Array.isArray(value)) throw new Error(`Po config at ${filePath} requires ${location} to be a list`);\n return value.map((entry, index) => parseAutocompactOverrideEntry(entry, `${location}[${index}]`, filePath));\n}\nexport function parseAutocompactModeConfig(\n value: unknown,\n filePath: string,\n location = 'modes.autocompact',\n): AutocompactModeConfig {\n if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ${location} to be an object`);\n assertKeys(value, AUTOCOMPACT_KEYS, location, filePath);\n const enabled = parseFlexibleBoolean(value.enabled, `${location}.enabled`, filePath);\n const model = optionalString(value.model, `${location}.model`, filePath);\n const thinking = parseThinking(value.thinking, location, filePath);\n const thresholds = parseAutocompactThresholds(value.thresholds, `${location}.thresholds`, filePath);\n const overrides = parseAutocompactOverrides(value.overrides, `${location}.overrides`, filePath);\n return {\n ...(enabled === undefined ? {} : { enabled }),\n ...(model ? { model } : {}),\n ...(thinking ? { thinking } : {}),\n ...(thresholds ? { thresholds } : {}),\n ...(overrides ? { overrides } : {}),\n };\n}\nexport function parsePlanningModeConfig(\n value: unknown,\n filePath: string,\n location = 'modes.planning',\n): PlanningModeConfig {\n if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ${location} to be an object`);\n assertKeys(value, PLANNING_KEYS, location, filePath);\n return {\n main: parseAgent(value.main, `${location}.main`, filePath),\n subagents: parseAgent(value.subagents, `${location}.subagents`, filePath),\n plansDirectory: optionalString(value.plansDirectory, `${location}.plansDirectory`, filePath),\n };\n}\nfunction parseModel(value: unknown, location: string, filePath: string, allowId: boolean): VoiceModelConfig {\n if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ${location} to be an object`);\n assertKeys(value, MODEL_KEYS, location, filePath);\n const modelPath = optionalString(value.path, `${location}.path`, filePath);\n const id = optionalString(value.id, `${location}.id`, filePath);\n if (Boolean(modelPath) === Boolean(id))\n throw new Error(`Po config at ${filePath} requires exactly one of ${location}.path or ${location}.id`);\n if (id && !allowId) throw new Error(`Po config at ${filePath} does not support ${location}.id for whisper-cpp`);\n return { ...(modelPath ? { path: modelPath } : {}), ...(id ? { id } : {}) };\n}\nfunction parseAdapter(\n value: unknown,\n location: string,\n filePath: string,\n allowId: boolean,\n): VoiceAdapterConfig | undefined {\n if (value === undefined) return undefined;\n if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ${location} to be an object`);\n assertKeys(value, ADAPTER_KEYS, location, filePath);\n const binary = optionalString(value.binary, `${location}.binary`, filePath);\n return { ...(binary ? { binary } : {}), model: parseModel(value.model, `${location}.model`, filePath, allowId) };\n}\nfunction parseVoice(value: unknown, filePath: string): VoiceConfig | undefined {\n if (value === undefined) return undefined;\n if (!isObject(value)) throw new Error(`Po config at ${filePath} requires voice to be an object`);\n assertKeys(value, VOICE_KEYS, 'voice', filePath);\n const result: VoiceConfig = {};\n if (value.mode !== undefined) {\n if (typeof value.mode !== 'string' || !VOICE_MODE_VALUES.has(value.mode as VoiceMode))\n throw new Error(\n `Po config at ${filePath} requires voice.mode to be one of: ${[...VOICE_MODE_VALUES].join(', ')}`,\n );\n result.mode = value.mode as VoiceMode;\n }\n if (value.engine !== undefined) {\n if (typeof value.engine !== 'string' || !ENGINE_VALUES.has(value.engine as VoiceEngine))\n throw new Error(`Po config at ${filePath} requires voice.engine to be one of: ${[...ENGINE_VALUES].join(', ')}`);\n result.engine = value.engine as VoiceEngine;\n }\n const language = optionalString(value.language, 'voice.language', filePath);\n if (language) result.language = language;\n if (value.recorder !== undefined) {\n if (!isObject(value.recorder)) throw new Error(`Po config at ${filePath} requires voice.recorder to be an object`);\n assertKeys(value.recorder, RECORDER_KEYS, 'voice.recorder', filePath);\n result.recorder = {};\n const binary = optionalString(value.recorder.binary, 'voice.recorder.binary', filePath);\n const device = optionalString(value.recorder.device, 'voice.recorder.device', filePath);\n if (binary) result.recorder.binary = binary;\n if (device) result.recorder.device = device;\n }\n if (value.adapters !== undefined) {\n if (!isObject(value.adapters)) throw new Error(`Po config at ${filePath} requires voice.adapters to be an object`);\n assertKeys(value.adapters, ADAPTERS_KEYS, 'voice.adapters', filePath);\n result.adapters = {\n [WHISPER_CPP_ENGINE]: parseAdapter(\n value.adapters[WHISPER_CPP_ENGINE],\n `voice.adapters.${WHISPER_CPP_ENGINE}`,\n filePath,\n false,\n ),\n [OPENAI_WHISPER_ENGINE]: parseAdapter(\n value.adapters[OPENAI_WHISPER_ENGINE],\n `voice.adapters.${OPENAI_WHISPER_ENGINE}`,\n filePath,\n true,\n ),\n [MLX_WHISPER_ENGINE]: parseAdapter(\n value.adapters[MLX_WHISPER_ENGINE],\n `voice.adapters.${MLX_WHISPER_ENGINE}`,\n filePath,\n true,\n ),\n };\n }\n const autoCapture = parseAutoCapture(value.autoCapture, filePath);\n if (autoCapture) result.autoCapture = autoCapture;\n const live = parseVoiceLive(value.live, filePath);\n if (live) result.live = live;\n return result;\n}\nfunction parseVoiceLive(value: unknown, filePath: string): VoiceConfig['live'] {\n if (value === undefined) return undefined;\n if (!isObject(value)) throw new Error(`Po config at ${filePath} requires voice.live to be an object`);\n assertKeys(value, VOICE_LIVE_KEYS, 'voice.live', filePath);\n const result: NonNullable<VoiceConfig['live']> = {};\n if (value.voice !== undefined) {\n if (typeof value.voice !== 'string' || !(PO_VOICE_LIVE_VOICES as readonly string[]).includes(value.voice))\n throw new Error(\n `Po config at ${filePath} requires voice.live.voice to be one of: ${PO_VOICE_LIVE_VOICES.join(', ')}`,\n );\n result.voice = value.voice;\n }\n if (value.model !== undefined) {\n if (\n typeof value.model !== 'string' ||\n value.model.length > MAX_LIVE_MODEL_LENGTH ||\n !LIVE_MODEL_PATTERN.test(value.model)\n )\n throw new Error(\n `Po config at ${filePath} requires voice.live.model to be a model id of at most ${MAX_LIVE_MODEL_LENGTH} letters, digits, dots, colons, underscores or dashes`,\n );\n result.model = value.model;\n }\n const orchestrator = parseAgent(value.orchestrator, 'voice.live.orchestrator', filePath);\n if (orchestrator) result.orchestrator = orchestrator;\n return result;\n}\nfunction parseSelection(value: unknown, filePath: string): PoSelectionConfig | undefined {\n if (value === undefined) return undefined;\n if (!isObject(value)) throw new Error(`Po config at ${filePath} requires selection to be an object`);\n assertKeys(value, SELECTION_KEYS, 'selection', filePath);\n const domains = value.domains;\n if (domains !== undefined && (!Array.isArray(domains) || domains.some((name) => typeof name !== 'string'))) {\n throw new Error(`Po config at ${filePath} requires selection.domains to be an array of strings`);\n }\n return {\n majorMode: optionalString(value.majorMode, 'selection.majorMode', filePath),\n // An empty list is meaningful: it selects no content domains at all.\n domains: domains as string[] | undefined,\n profile: optionalString(value.profile, 'selection.profile', filePath),\n };\n}\nfunction parseEditor(value: unknown, filePath: string): EditorConfig | undefined {\n if (value === undefined) return undefined;\n if (!isObject(value)) throw new Error(`Po config at ${filePath} requires editor to be an object`);\n assertKeys(value, EDITOR_KEYS, 'editor', filePath);\n return { command: optionalString(value.command, 'editor.command', filePath) };\n}\nfunction parseBrowse(value: unknown, filePath: string): BrowseConfig | undefined {\n if (value === undefined) return undefined;\n if (!isObject(value)) throw new Error(`Po config at ${filePath} requires browse to be an object`);\n assertKeys(value, BROWSE_KEYS, 'browse', filePath);\n const pick = <T extends string>(key: string, allowed: readonly T[]): T | undefined => {\n const raw = value[key];\n if (raw === undefined) return undefined;\n if (typeof raw !== 'string' || !allowed.includes(raw as T))\n throw new Error(`Po config at ${filePath} requires browse.${key} to be one of: ${allowed.join(', ')}`);\n return raw as T;\n };\n const engine = pick('engine', PO_BROWSE_ENGINES);\n const fallback = pick('fallback', PO_BROWSE_FALLBACKS);\n return { ...(engine ? { engine } : {}), ...(fallback ? { fallback } : {}) };\n}\nfunction parseMinimumInteger(value: unknown, location: string, filePath: string, minimum: number): number | undefined {\n if (value === undefined) return undefined;\n if (typeof value !== 'number' || !Number.isSafeInteger(value) || value < minimum)\n throw new Error(`Po config at ${filePath} requires ${location} to be an integer of at least ${minimum}`);\n return value;\n}\nfunction parseIosPool(value: unknown, filePath: string): IosConfig['pool'] {\n if (value === undefined) return undefined;\n if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ios.pool to be an object`);\n assertKeys(value, IOS_POOL_KEYS, 'ios.pool', filePath);\n const pool: NonNullable<IosConfig['pool']> = {};\n const integer = (\n key: 'minBooted' | 'maxBooted' | 'maxDevices' | 'idleShutdownMinutes' | 'waitTimeoutSeconds',\n minimum: number,\n ) => {\n const parsed = parseMinimumInteger(value[key], `ios.pool.${key}`, filePath, minimum);\n if (parsed !== undefined) pool[key] = parsed;\n };\n integer('minBooted', 0);\n integer('maxBooted', 1);\n integer('maxDevices', 1);\n integer('idleShutdownMinutes', 1);\n integer('waitTimeoutSeconds', 0);\n const deviceType = optionalString(value.deviceType, 'ios.pool.deviceType', filePath);\n if (deviceType !== undefined) pool.deviceType = deviceType;\n const runtime = optionalString(value.runtime, 'ios.pool.runtime', filePath);\n if (runtime !== undefined) pool.runtime = runtime;\n if (pool.minBooted !== undefined && pool.maxBooted !== undefined && pool.minBooted > pool.maxBooted)\n throw new Error(`Po config at ${filePath} requires ios.pool.minBooted to be at most ios.pool.maxBooted`);\n if (pool.maxBooted !== undefined && pool.maxDevices !== undefined && pool.maxBooted > pool.maxDevices)\n throw new Error(`Po config at ${filePath} requires ios.pool.maxBooted to be at most ios.pool.maxDevices`);\n if (pool.minBooted !== undefined && pool.maxDevices !== undefined && pool.minBooted > pool.maxDevices)\n throw new Error(`Po config at ${filePath} requires ios.pool.minBooted to be at most ios.pool.maxDevices`);\n return pool;\n}\nfunction parseIos(value: unknown, filePath: string): IosConfig | undefined {\n if (value === undefined) return undefined;\n if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ios to be an object`);\n assertKeys(value, IOS_KEYS, 'ios', filePath);\n const result: IosConfig = {};\n const pool = parseIosPool(value.pool, filePath);\n if (pool) result.pool = pool;\n const helperPath = optionalString(value.helperPath, 'ios.helperPath', filePath);\n if (helperPath !== undefined) result.helperPath = helperPath;\n if (value.device !== undefined) {\n if (!isObject(value.device)) throw new Error(`Po config at ${filePath} requires ios.device to be an object`);\n assertKeys(value.device, IOS_DEVICE_KEYS, 'ios.device', filePath);\n const developmentTeam = optionalString(value.device.developmentTeam, 'ios.device.developmentTeam', filePath);\n result.device = developmentTeam === undefined ? {} : { developmentTeam };\n }\n return result;\n}\n\n/** `web` and `native` each choose a template, so both read the same `{ template }` shape. */\nfunction parseTemplateChoice(\n value: unknown,\n root: 'web' | 'native',\n filePath: string,\n): PoConfig['web'] | PoConfig['native'] {\n if (value === undefined) return undefined;\n if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ${root} to be an object`);\n assertKeys(value, ['template'], root, filePath);\n if (value.template === undefined) return {};\n const template = optionalString(value.template, `${root}.template`, filePath);\n if (!template || template.length > 160 || !/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(template)) {\n throw new Error(`Po config at ${filePath} requires ${root}.template to be a kebab-case template identifier`);\n }\n return { template };\n}\nfunction parseComputerUse(value: unknown, filePath: string): ComputerUseConfig | undefined {\n if (value === undefined) return undefined;\n if (!isObject(value)) throw new Error(`Po config at ${filePath} requires computerUse to be an object`);\n assertKeys(value, COMPUTER_USE_KEYS, 'computerUse', filePath);\n const enabled = parseFlexibleBoolean(value.enabled, 'computerUse.enabled', filePath);\n return enabled === undefined ? {} : { enabled };\n}\nfunction parseProfileMemory(value: unknown, filePath: string): ProfileMemoryConfig | undefined {\n if (value === undefined) return undefined;\n if (!isObject(value)) throw new Error(`Po config at ${filePath} requires profileMemory to be an object`);\n assertKeys(value, PROFILE_MEMORY_KEYS, 'profileMemory', filePath);\n const automatic = parseFlexibleBoolean(value.automatic, 'profileMemory.automatic', filePath);\n return automatic === undefined ? {} : { automatic };\n}\n/** A list, or the comma-separated text the settings page writes for one. */\nfunction parseFlexibleList(value: unknown, location: string, filePath: string): string[] | undefined {\n if (value === undefined) return undefined;\n const entries = typeof value === 'string' ? value.split(',') : value;\n if (!Array.isArray(entries) || entries.some((entry) => typeof entry !== 'string'))\n throw new Error(`Po config at ${filePath} requires ${location} to be a list of strings`);\n const list = [...new Set((entries as string[]).map((entry) => entry.trim()).filter(Boolean))];\n return list;\n}\nfunction parseSubagents(value: unknown, filePath: string): SubagentsConfig | undefined {\n if (value === undefined) return undefined;\n if (!isObject(value)) throw new Error(`Po config at ${filePath} requires subagents to be an object`);\n assertKeys(value, SUBAGENTS_KEYS, 'subagents', filePath);\n const model = optionalString(value.model, 'subagents.model', filePath);\n const thinking = parseThinking(value.thinking, 'subagents', filePath);\n const fallbackModels = parseFlexibleList(value.fallbackModels, 'subagents.fallbackModels', filePath);\n const excludeTools = parseFlexibleList(value.excludeTools, 'subagents.excludeTools', filePath);\n return {\n ...(model ? { model } : {}),\n ...(thinking ? { thinking } : {}),\n ...(fallbackModels ? { fallbackModels } : {}),\n ...(excludeTools ? { excludeTools } : {}),\n };\n}\nfunction parseDesktopEnvironment(value: unknown, filePath: string): DesktopEnvironmentConfig | undefined {\n if (value === undefined) return undefined;\n if (!isObject(value)) throw new Error(`Po config at ${filePath} requires desktopEnvironment to be an object`);\n assertKeys(value, DESKTOP_ENVIRONMENT_KEYS, 'desktopEnvironment', filePath);\n if (value.inherit !== undefined && value.inherit !== 'all' && value.inherit !== 'core')\n throw new Error(`Po config at ${filePath} desktopEnvironment.inherit must be all or core`);\n const exclude = parseFlexibleList(value.exclude, 'desktopEnvironment.exclude', filePath);\n const includeOnly = parseFlexibleList(value.includeOnly, 'desktopEnvironment.includeOnly', filePath);\n if (\n value.set !== undefined &&\n (!isObject(value.set) ||\n Object.entries(value.set).some(\n ([name, entry]) => !ENVIRONMENT_VARIABLE_NAME.test(name) || typeof entry !== 'string',\n ))\n )\n throw new Error(`Po config at ${filePath} requires desktopEnvironment.set to map variable names to strings`);\n return {\n ...(value.inherit === undefined ? {} : { inherit: value.inherit }),\n ...(exclude ? { exclude } : {}),\n ...(includeOnly ? { includeOnly } : {}),\n ...(value.set === undefined ? {} : { set: { ...(value.set as Record<string, string>) } }),\n };\n}\n/**\n * Reads one Po config file.\n *\n * The two-argument form is the strict contract every harness-launch consumer\n * relies on: an unknown key is a hard error. `po sync` opts into the\n * lenient form so a config written for a different version cannot break a\n * build; `po doctor` is the strict check that still reports those keys.\n * Invalid values for known keys throw in both modes.\n */\nexport function parsePoConfig(content: string, filePath: string): PoConfig;\nexport function parsePoConfig(content: string, filePath: string, options: LenientParseOptions): LenientParseResult;\nexport function parsePoConfig(\n content: string,\n filePath: string,\n options?: LenientParseOptions,\n): PoConfig | LenientParseResult {\n if (options?.lenient !== true) return parseStrict(content, filePath);\n const diagnostics: ConfigDiagnostic[] = [];\n const previous = unknownKeySink;\n unknownKeySink = diagnostics;\n try {\n return { config: parseStrict(content, filePath), diagnostics };\n } finally {\n unknownKeySink = previous;\n }\n}\n\nfunction parseWorkspaces(value: unknown, filePath: string): WorkspaceDeclaration[] | undefined {\n if (value === undefined) return undefined;\n if (!Array.isArray(value)) throw new Error(`Po config at ${filePath} requires workspaces to be a list`);\n const names = new Set<string>();\n return value.map((entry: unknown, index) => {\n const location = `workspaces[${index}]`;\n if (!isObject(entry)) throw new Error(`Po config at ${filePath} requires ${location} to be an object`);\n assertKeys(entry, WORKSPACE_KEYS, location, filePath);\n const name = optionalString(entry.name, `${location}.name`, filePath);\n if (!name) throw new Error(`Po config at ${filePath} requires ${location}.name to be a non-empty string`);\n if (entry.instructions !== undefined && typeof entry.instructions !== 'string')\n throw new Error(`Po config at ${filePath} requires ${location}.instructions to be a string`);\n const key = name.toLowerCase();\n if (names.has(key)) throw new Error(`Po config at ${filePath} has duplicate ${location}.name: ${name}`);\n names.add(key);\n return { name, ...(entry.instructions === undefined ? {} : { instructions: entry.instructions }) };\n });\n}\n\nfunction parseStrict(content: string, filePath: string): PoConfig {\n let parsed: unknown;\n try {\n parsed = parseYaml(content) ?? {};\n } catch (error) {\n throw new Error(`Could not parse Po config at ${filePath}`, { cause: error });\n }\n if (!isObject(parsed)) throw new Error(`Po config at ${filePath} must be a YAML object`);\n assertKeys(parsed, ROOT_KEYS, 'root', filePath);\n let modes: PoConfig['modes'];\n if (parsed.modes !== undefined) {\n if (!isObject(parsed.modes)) throw new Error(`Po config at ${filePath} requires modes to be an object`);\n assertKeys(parsed.modes, MODE_KEYS, 'modes', filePath);\n modes = {\n ...(parsed.modes.planning === undefined\n ? {}\n : { planning: parsePlanningModeConfig(parsed.modes.planning, filePath) }),\n ...(parsed.modes.autocompact === undefined\n ? {}\n : { autocompact: parseAutocompactModeConfig(parsed.modes.autocompact, filePath) }),\n };\n }\n const trust = parsed.projectTrust === undefined ? DEFAULT_PROJECT_TRUST : parsed.projectTrust;\n if (typeof trust !== 'string' || !TRUST_VALUES.has(trust as ProjectTrust))\n throw new Error(`Po config at ${filePath} projectTrust must be ask, always, or never`);\n return {\n modes,\n computerUse: parseComputerUse(parsed.computerUse, filePath),\n desktopEnvironment: parseDesktopEnvironment(parsed.desktopEnvironment, filePath),\n profileMemory: parseProfileMemory(parsed.profileMemory, filePath),\n subagents: parseSubagents(parsed.subagents, filePath),\n projectTrust: trust as ProjectTrust,\n workspaces: parseWorkspaces(parsed.workspaces, filePath),\n editor: parseEditor(parsed.editor, filePath),\n browse: parseBrowse(parsed.browse, filePath),\n ios: parseIos(parsed.ios, filePath),\n voice: parseVoice(parsed.voice, filePath),\n selection: parseSelection(parsed.selection, filePath),\n web: parseTemplateChoice(parsed.web, 'web', filePath),\n native: parseTemplateChoice(parsed.native, 'native', filePath),\n };\n}\nfunction mergeAgent(\n globalValue?: PlanningAgentConfig,\n repositoryValue?: PlanningAgentConfig,\n): PlanningAgentConfig | undefined {\n return globalValue || repositoryValue ? { ...globalValue, ...repositoryValue } : undefined;\n}\nexport function mergePoConfigs(globalConfig: PoConfig, repositoryConfig: PoConfig): PoConfig {\n if (repositoryConfig.voice?.mode)\n throw new Error('Repository Po config voice.mode is global-only; configure it in ~/.po/config.yaml');\n if (repositoryConfig.voice?.autoCapture)\n throw new Error('Repository Po config voice.autoCapture is global-only; configure it in ~/.po/config.yaml');\n if (repositoryConfig.voice?.live)\n throw new Error('Repository Po config voice.live is global-only; configure it in ~/.po/config.yaml');\n if (repositoryConfig.computerUse)\n throw new Error('Repository Po config computerUse is global-only; configure it in ~/.po/config.yaml');\n if (repositoryConfig.desktopEnvironment)\n throw new Error('Repository Po config desktopEnvironment is global-only; configure it in ~/.po/config.yaml');\n if (repositoryConfig.browse)\n throw new Error('Repository Po config browse is global-only; configure it in ~/.po/config.yaml');\n if (repositoryConfig.ios)\n throw new Error('Repository Po config ios is global-only; configure it in ~/.po/config.yaml');\n if (repositoryConfig.profileMemory)\n throw new Error('Repository Po config profileMemory is global-only; configure it in ~/.po/config.yaml');\n const globalPlanning = globalConfig.modes?.planning;\n const repositoryPlanning = repositoryConfig.modes?.planning;\n const planning =\n globalPlanning || repositoryPlanning\n ? {\n main: mergeAgent(globalPlanning?.main, repositoryPlanning?.main),\n subagents: mergeAgent(globalPlanning?.subagents, repositoryPlanning?.subagents),\n plansDirectory: repositoryPlanning?.plansDirectory ?? globalPlanning?.plansDirectory,\n }\n : undefined;\n const globalAutocompact = globalConfig.modes?.autocompact;\n const repositoryAutocompact = repositoryConfig.modes?.autocompact;\n // Per key, so a repository can pin the model and inherit the ladder, or the\n // other way round. `overrides` is deliberately not merged that way: the spread\n // below lets a repository list replace the global one whole, because the rules\n // are first-match-wins and interleaving two files a reader cannot see together\n // would decide precedence somewhere neither of them says.\n const autocompact =\n globalAutocompact || repositoryAutocompact\n ? {\n ...globalAutocompact,\n ...repositoryAutocompact,\n ...(globalAutocompact?.thresholds || repositoryAutocompact?.thresholds\n ? { thresholds: { ...globalAutocompact?.thresholds, ...repositoryAutocompact?.thresholds } }\n : {}),\n }\n : undefined;\n const voice = mergeVoice(globalConfig.voice, repositoryConfig.voice);\n return {\n modes:\n planning || autocompact\n ? { ...(planning ? { planning } : {}), ...(autocompact ? { autocompact } : {}) }\n : undefined,\n computerUse: globalConfig.computerUse,\n desktopEnvironment: globalConfig.desktopEnvironment,\n profileMemory: globalConfig.profileMemory,\n // Per key, so a repository can pin the model and keep the global fallbacks.\n subagents:\n globalConfig.subagents || repositoryConfig.subagents\n ? { ...globalConfig.subagents, ...repositoryConfig.subagents }\n : undefined,\n projectTrust: repositoryConfig.projectTrust,\n workspaces: repositoryConfig.workspaces,\n editor: globalConfig.editor,\n browse: globalConfig.browse,\n ios: globalConfig.ios,\n voice,\n web:\n globalConfig.web || repositoryConfig.web\n ? { template: repositoryConfig.web?.template ?? globalConfig.web?.template }\n : undefined,\n native:\n globalConfig.native || repositoryConfig.native\n ? { template: repositoryConfig.native?.template ?? globalConfig.native?.template }\n : undefined,\n // Per key, so a repository can pin one axis and inherit the rest.\n selection:\n globalConfig.selection || repositoryConfig.selection\n ? { ...globalConfig.selection, ...repositoryConfig.selection }\n : undefined,\n };\n}\nfunction mergeAdapter(\n globalValue?: VoiceAdapterConfig,\n repositoryValue?: VoiceAdapterConfig,\n): VoiceAdapterConfig | undefined {\n if (!globalValue && !repositoryValue) return undefined;\n return { ...globalValue, ...repositoryValue, model: repositoryValue?.model ?? globalValue!.model };\n}\nfunction mergeVoice(globalValue?: VoiceConfig, repositoryValue?: VoiceConfig): VoiceConfig | undefined {\n if (!globalValue && !repositoryValue) return undefined;\n return {\n ...globalValue,\n ...repositoryValue,\n ...(globalValue?.mode ? { mode: globalValue.mode } : {}),\n recorder:\n globalValue?.recorder || repositoryValue?.recorder\n ? { ...globalValue?.recorder, ...repositoryValue?.recorder }\n : undefined,\n adapters:\n globalValue?.adapters || repositoryValue?.adapters\n ? {\n [WHISPER_CPP_ENGINE]: mergeAdapter(\n globalValue?.adapters?.[WHISPER_CPP_ENGINE],\n repositoryValue?.adapters?.[WHISPER_CPP_ENGINE],\n ),\n [OPENAI_WHISPER_ENGINE]: mergeAdapter(\n globalValue?.adapters?.[OPENAI_WHISPER_ENGINE],\n repositoryValue?.adapters?.[OPENAI_WHISPER_ENGINE],\n ),\n [MLX_WHISPER_ENGINE]: mergeAdapter(\n globalValue?.adapters?.[MLX_WHISPER_ENGINE],\n repositoryValue?.adapters?.[MLX_WHISPER_ENGINE],\n ),\n }\n : undefined,\n ...(globalValue?.autoCapture ? { autoCapture: globalValue.autoCapture } : {}),\n };\n}\n/**\n * Resolves voice settings, optionally shadowed by the active profile's override.\n *\n * The override is per field, so a persona that sets only `rate` keeps the voice\n * from config.yaml. `engine` is deliberately not overridable: it selects the\n * synthesiser binary, which is a machine-level fact rather than a persona's.\n *\n * The result is read once when autonomous voice activates, because\n * `VoiceNarrationPlayback.config` is assigned in `activate()` and has no setter.\n * That is sufficient today only because every profile switch reloads the\n * session, which deactivates and reactivates voice. A future in-place profile\n * switch would leave the spoken voice stale until the next activation.\n */\nexport function resolveVoiceConfig(config: VoiceConfig, ttsOverride?: PersonaVoiceOverride): ResolvedVoiceConfig {\n return {\n mode: config.mode ?? DEFAULT_VOICE_MODE,\n engine: config.engine ?? DEFAULT_VOICE_ENGINE,\n language: config.language ?? DEFAULT_VOICE_LANGUAGE,\n recorder: { ...config.recorder, device: config.recorder?.device ?? DEFAULT_RECORDER_DEVICE },\n adapters: config.adapters ?? {},\n ...(config.autoCapture\n ? {\n autoCapture: {\n ...config.autoCapture,\n startPhrases: [...(config.autoCapture.startPhrases ?? [])],\n stopPhrases: [...(config.autoCapture.stopPhrases ?? [])],\n // Unlike start and stop phrases, these default to a non-empty list: without\n // a send phrase a draft could be opened and never submitted.\n composeOpenPhrases: [...(config.autoCapture.composeOpenPhrases ?? DEFAULT_COMPOSE_OPEN_PHRASES)],\n composeSendPhrases: [...(config.autoCapture.composeSendPhrases ?? DEFAULT_COMPOSE_SEND_PHRASES)],\n composeCancelPhrases: [...(config.autoCapture.composeCancelPhrases ?? DEFAULT_COMPOSE_CANCEL_PHRASES)],\n utteranceIdleMs: config.autoCapture.utteranceIdleMs ?? DEFAULT_UTTERANCE_IDLE_MS,\n composeUtteranceIdleMs: config.autoCapture.composeUtteranceIdleMs ?? DEFAULT_COMPOSE_UTTERANCE_IDLE_MS,\n composeNudgeMs: config.autoCapture.composeNudgeMs ?? DEFAULT_COMPOSE_NUDGE_MS,\n transcriptionTimeoutMs: config.autoCapture.transcriptionTimeoutMs ?? DEFAULT_TRANSCRIPTION_TIMEOUT_MS,\n tts: {\n ...config.autoCapture.tts,\n ...(ttsOverride?.voice === undefined ? {} : { voice: ttsOverride.voice }),\n ...(ttsOverride?.rate === undefined ? {} : { rate: ttsOverride.rate }),\n },\n },\n }\n : {}),\n };\n}\n\n/**\n * Which files a key may be written to.\n *\n * `mergePoConfigs` above already decides this per field, but it decides it by\n * doing it: `editor` reads only from the global side, `projectTrust` only from\n * the repository side, and repository `voice.mode`, `voice.autoCapture` or\n * `voice.live` declarations throw outright. A caller holding a key path has no way to ask.\n * surface offers writes that throw, or worse, writes that land in a file the\n * merge will ignore, so the change appears to do nothing.\n *\n * Declared here rather than beside the writer because the rule is a property of\n * the merge, not of the filesystem, and a test asserts the two agree.\n */\nexport type ConfigKeyScope = 'global' | 'repository' | 'both';\n\n/** Root keys the merge reads from one side only. */\nconst GLOBAL_ONLY_ROOTS: readonly string[] = [\n 'computerUse',\n 'desktopEnvironment',\n 'profileMemory',\n 'editor',\n 'browse',\n 'ios',\n];\nconst REPOSITORY_ONLY_ROOTS: readonly string[] = ['projectTrust', 'workspaces'];\n/** Nested exceptions; a repository declaration of any of them throws in the merge. */\nconst GLOBAL_ONLY_PATHS: readonly (readonly string[])[] = [\n ['voice', 'mode'],\n ['voice', 'autoCapture'],\n ['voice', 'live'],\n];\n\nfunction startsWith(keyPath: readonly string[], prefix: readonly string[]): boolean {\n return prefix.length <= keyPath.length && prefix.every((segment, index) => keyPath[index] === segment);\n}\n\n/**\n * The scopes a key path accepts. An unknown root answers `both` rather than\n * throwing: the parser is what rejects unsupported keys, and it reports them\n * far better than a scope lookup could.\n */\nexport function configScopeOf(keyPath: readonly string[]): ConfigKeyScope {\n if (keyPath.length === 0) return 'both';\n if (GLOBAL_ONLY_PATHS.some((prefix) => startsWith(keyPath, prefix))) return 'global';\n const root = keyPath[0]!;\n if (GLOBAL_ONLY_ROOTS.includes(root)) return 'global';\n if (REPOSITORY_ONLY_ROOTS.includes(root)) return 'repository';\n return 'both';\n}\n\n/** Every root key the config accepts, so a caller can enumerate without importing the parser's internals. */\nexport function configRootKeys(): readonly string[] {\n return ROOT_KEYS;\n}\n\nconst KEY_SEPARATOR = '.';\n\nfunction isPlainRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * Every key path a parsed document actually sets, as dotted strings.\n *\n * A settings surface needs to tell \"this file set this key\" from \"this file is\n * silent about it\", and the parsed `PoConfig` cannot answer: an absent file\n * reads as `{ projectTrust: 'ask' }` and `parsePoConfig` always returns all\n * known root keys, some undefined. So the question is asked of the raw document\n * instead, before any defaulting has happened.\n *\n * Leaves only. A list is a leaf because it is replaced whole, and an empty\n * record sets nothing.\n */\nexport function configLeafKeys(value: unknown, prefix: readonly string[] = []): string[] {\n if (!isPlainRecord(value)) return prefix.length > 0 ? [prefix.join(KEY_SEPARATOR)] : [];\n const keys = Object.keys(value);\n if (keys.length === 0) return prefix.length > 0 ? [prefix.join(KEY_SEPARATOR)] : [];\n return keys.flatMap((key) => configLeafKeys(value[key], [...prefix, key]));\n}\n\n/** The value a key path points at, or undefined when any step is missing. */\nexport function valueAtKeyPath(value: unknown, keyPath: readonly string[]): unknown {\n let current: unknown = value;\n for (const segment of keyPath) {\n if (!isPlainRecord(current)) return undefined;\n current = current[segment];\n }\n return current;\n}\n"],"mappings":";;AAmCA,MAAM,wBAAsC;AAC5C,MAAM,qBAAgC;AACtC,MAAM,uBAAoC;AAC1C,MAAM,yBAAyB;AAC/B,MAAM,0BAA0B;AAChC,MAAM,YAAY;CAChB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AACA,MAAM,iBAAiB,CAAC,QAAQ,cAAc;AAC9C,MAAM,cAAc,CAAC,UAAU,UAAU;AACzC,MAAa,oBAAoB,CAAC,SAAS,oBAAoB;AAC/D,MAAa,sBAAsB,CAAC,QAAQ,oBAAoB;AAChE,MAAM,WAAW;CAAC;CAAQ;CAAc;AAAQ;AAChD,MAAM,gBAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;AACF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