@agimon-ai/po-config 0.0.0-alpha.0

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 (170) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +170 -0
  3. package/dist/agentPluginMcp.cjs +322 -0
  4. package/dist/agentPluginMcp.cjs.map +1 -0
  5. package/dist/agentPluginMcp.d.mts +38 -0
  6. package/dist/agentPluginMcp.d.mts.map +1 -0
  7. package/dist/agentPluginMcp.mjs +318 -0
  8. package/dist/agentPluginMcp.mjs.map +1 -0
  9. package/dist/apiContracts.cjs +203 -0
  10. package/dist/apiContracts.cjs.map +1 -0
  11. package/dist/apiContracts.d.mts +53 -0
  12. package/dist/apiContracts.d.mts.map +1 -0
  13. package/dist/apiContracts.mjs +198 -0
  14. package/dist/apiContracts.mjs.map +1 -0
  15. package/dist/atomicJson-1W0WhuFF.mjs +44 -0
  16. package/dist/atomicJson-1W0WhuFF.mjs.map +1 -0
  17. package/dist/atomicJson-Dt2z_DXl.cjs +52 -0
  18. package/dist/atomicJson-Dt2z_DXl.cjs.map +1 -0
  19. package/dist/atomicJson.cjs +3 -0
  20. package/dist/atomicJson.d.mts +2 -0
  21. package/dist/atomicJson.mjs +2 -0
  22. package/dist/config-BUw5kHsx.cjs +219 -0
  23. package/dist/config-BUw5kHsx.cjs.map +1 -0
  24. package/dist/config-CKA07FxG.mjs +162 -0
  25. package/dist/config-CKA07FxG.mjs.map +1 -0
  26. package/dist/config-Cm3EV1jp.d.mts +320 -0
  27. package/dist/config-Cm3EV1jp.d.mts.map +1 -0
  28. package/dist/config-NSHRd6na.mjs +2 -0
  29. package/dist/config-zZz80Mh5.cjs +1 -0
  30. package/dist/config.cjs +24 -0
  31. package/dist/config.d.mts +3 -0
  32. package/dist/config.mjs +3 -0
  33. package/dist/configPolicy--TNX7feH.mjs +718 -0
  34. package/dist/configPolicy--TNX7feH.mjs.map +1 -0
  35. package/dist/configPolicy-DmsZEp0t.cjs +795 -0
  36. package/dist/configPolicy-DmsZEp0t.cjs.map +1 -0
  37. package/dist/configSchema.cjs +0 -0
  38. package/dist/configSchema.d.mts +2 -0
  39. package/dist/configSchema.mjs +1 -0
  40. package/dist/configWriter-BTuinLjs.cjs +150 -0
  41. package/dist/configWriter-BTuinLjs.cjs.map +1 -0
  42. package/dist/configWriter-BgkGaLrf.mjs +130 -0
  43. package/dist/configWriter-BgkGaLrf.mjs.map +1 -0
  44. package/dist/configWriter.cjs +5 -0
  45. package/dist/configWriter.d.mts +2 -0
  46. package/dist/configWriter.mjs +2 -0
  47. package/dist/domains-CBYkuxs5.cjs +727 -0
  48. package/dist/domains-CBYkuxs5.cjs.map +1 -0
  49. package/dist/domains-DZOu9vYM.mjs +633 -0
  50. package/dist/domains-DZOu9vYM.mjs.map +1 -0
  51. package/dist/domains.cjs +19 -0
  52. package/dist/domains.d.mts +3 -0
  53. package/dist/domains.mjs +3 -0
  54. package/dist/extensions/mcp-ui.mjs +101 -0
  55. package/dist/extensions/mcp-ui.mjs.map +1 -0
  56. package/dist/extensions/mcp.cjs +171 -0
  57. package/dist/extensions/mcp.cjs.map +1 -0
  58. package/dist/extensions/mcp.d.mts +5 -0
  59. package/dist/extensions/mcp.d.mts.map +1 -0
  60. package/dist/extensions/mcp.mjs +166 -0
  61. package/dist/extensions/mcp.mjs.map +1 -0
  62. package/dist/extensions/server.cjs +504 -0
  63. package/dist/extensions/server.cjs.map +1 -0
  64. package/dist/extensions/server.d.mts +5 -0
  65. package/dist/extensions/server.d.mts.map +1 -0
  66. package/dist/extensions/server.mjs +499 -0
  67. package/dist/extensions/server.mjs.map +1 -0
  68. package/dist/harnessState-CCyBeutB.cjs +188 -0
  69. package/dist/harnessState-CCyBeutB.cjs.map +1 -0
  70. package/dist/harnessState-Dn_S7fB9.mjs +163 -0
  71. package/dist/harnessState-Dn_S7fB9.mjs.map +1 -0
  72. package/dist/harnessState.cjs +6 -0
  73. package/dist/harnessState.d.mts +2 -0
  74. package/dist/harnessState.mjs +2 -0
  75. package/dist/harnessStore-CJSxdSkV.cjs +343 -0
  76. package/dist/harnessStore-CJSxdSkV.cjs.map +1 -0
  77. package/dist/harnessStore-CltwLB7M.mjs +262 -0
  78. package/dist/harnessStore-CltwLB7M.mjs.map +1 -0
  79. package/dist/harnessStore.cjs +15 -0
  80. package/dist/harnessStore.d.mts +2 -0
  81. package/dist/harnessStore.mjs +2 -0
  82. package/dist/index-BAaTySaM.d.mts +35 -0
  83. package/dist/index-BAaTySaM.d.mts.map +1 -0
  84. package/dist/index-BT29GZx5.d.mts +142 -0
  85. package/dist/index-BT29GZx5.d.mts.map +1 -0
  86. package/dist/index-B_lp0W3U.d.mts +114 -0
  87. package/dist/index-B_lp0W3U.d.mts.map +1 -0
  88. package/dist/index-C6GaYjq-.d.mts +6 -0
  89. package/dist/index-C6GaYjq-.d.mts.map +1 -0
  90. package/dist/index-CIQrKS1A.d.mts +50 -0
  91. package/dist/index-CIQrKS1A.d.mts.map +1 -0
  92. package/dist/index-CRcoVYXz.d.mts +39 -0
  93. package/dist/index-CRcoVYXz.d.mts.map +1 -0
  94. package/dist/index-CVlciCJF.d.mts +40 -0
  95. package/dist/index-CVlciCJF.d.mts.map +1 -0
  96. package/dist/index-CeOk2kqs.d.mts +118 -0
  97. package/dist/index-CeOk2kqs.d.mts.map +1 -0
  98. package/dist/index-Ch7ptOkW.d.mts +54 -0
  99. package/dist/index-Ch7ptOkW.d.mts.map +1 -0
  100. package/dist/index-Cvdt-Y-i.d.mts +66 -0
  101. package/dist/index-Cvdt-Y-i.d.mts.map +1 -0
  102. package/dist/index-DJpG-I9K.d.mts +122 -0
  103. package/dist/index-DJpG-I9K.d.mts.map +1 -0
  104. package/dist/index-DNk4q0Qm.d.mts +81 -0
  105. package/dist/index-DNk4q0Qm.d.mts.map +1 -0
  106. package/dist/index.cjs +121 -0
  107. package/dist/index.d.mts +15 -0
  108. package/dist/index.mjs +15 -0
  109. package/dist/init-C_9nyp3-.cjs +448 -0
  110. package/dist/init-C_9nyp3-.cjs.map +1 -0
  111. package/dist/init-DJ6wm-dr.mjs +415 -0
  112. package/dist/init-DJ6wm-dr.mjs.map +1 -0
  113. package/dist/init.cjs +7 -0
  114. package/dist/init.d.mts +2 -0
  115. package/dist/init.mjs +2 -0
  116. package/dist/layeredConfig-B922ibgn.mjs +67 -0
  117. package/dist/layeredConfig-B922ibgn.mjs.map +1 -0
  118. package/dist/layeredConfig-DdI5ysUf.cjs +94 -0
  119. package/dist/layeredConfig-DdI5ysUf.cjs.map +1 -0
  120. package/dist/layeredConfig.cjs +6 -0
  121. package/dist/layeredConfig.d.mts +2 -0
  122. package/dist/layeredConfig.mjs +2 -0
  123. package/dist/majorModes-CmPLEpMT.mjs +333 -0
  124. package/dist/majorModes-CmPLEpMT.mjs.map +1 -0
  125. package/dist/majorModes-DPhVMuhT.cjs +383 -0
  126. package/dist/majorModes-DPhVMuhT.cjs.map +1 -0
  127. package/dist/majorModes.cjs +10 -0
  128. package/dist/majorModes.d.mts +2 -0
  129. package/dist/majorModes.mjs +2 -0
  130. package/dist/piConfig-Bx26HMb_.d.mts +33 -0
  131. package/dist/piConfig-Bx26HMb_.d.mts.map +1 -0
  132. package/dist/piConfig-CCBdZXQr.cjs +260 -0
  133. package/dist/piConfig-CCBdZXQr.cjs.map +1 -0
  134. package/dist/piConfig-qGyCbcVj.mjs +197 -0
  135. package/dist/piConfig-qGyCbcVj.mjs.map +1 -0
  136. package/dist/piConfig.cjs +12 -0
  137. package/dist/piConfig.d.mts +2 -0
  138. package/dist/piConfig.mjs +2 -0
  139. package/dist/piContext.cjs +18 -0
  140. package/dist/piContext.d.mts +3 -0
  141. package/dist/piContext.mjs +2 -0
  142. package/dist/profiles-CTrUCmIh.d.mts +27 -0
  143. package/dist/profiles-CTrUCmIh.d.mts.map +1 -0
  144. package/dist/profiles-DnF9DBpd.cjs +552 -0
  145. package/dist/profiles-DnF9DBpd.cjs.map +1 -0
  146. package/dist/profiles-fujQKrS0.mjs +483 -0
  147. package/dist/profiles-fujQKrS0.mjs.map +1 -0
  148. package/dist/profiles.cjs +13 -0
  149. package/dist/profiles.d.mts +25 -0
  150. package/dist/profiles.d.mts.map +1 -0
  151. package/dist/profiles.mjs +2 -0
  152. package/dist/rolldown-runtime-VH7oDXx4.cjs +28 -0
  153. package/dist/selectionSwitch.cjs +70 -0
  154. package/dist/selectionSwitch.cjs.map +1 -0
  155. package/dist/selectionSwitch.d.mts +30 -0
  156. package/dist/selectionSwitch.d.mts.map +1 -0
  157. package/dist/selectionSwitch.mjs +64 -0
  158. package/dist/selectionSwitch.mjs.map +1 -0
  159. package/dist/sessionConfig-Boh4Fdje.cjs +342 -0
  160. package/dist/sessionConfig-Boh4Fdje.cjs.map +1 -0
  161. package/dist/sessionConfig-CtLoc-lO.mjs +240 -0
  162. package/dist/sessionConfig-CtLoc-lO.mjs.map +1 -0
  163. package/dist/types.cjs +9 -0
  164. package/dist/types.d.mts +2 -0
  165. package/dist/types.mjs +2 -0
  166. package/llms.txt +12 -0
  167. package/package.json +206 -0
  168. package/src/prompts/po-author-config/SKILL.md +26 -0
  169. package/src/prompts/po-author-config/agents/openai.yaml +4 -0
  170. package/src/prompts/po-author-config/references/config-contract.md +201 -0
@@ -0,0 +1,162 @@
1
+ import { a as configLeafKeys, c as mergeDoomConfigs, p as valueAtKeyPath, s as configScopeOf, u as parseDoomConfig } from "./configPolicy--TNX7feH.mjs";
2
+ import { createHash } from "node:crypto";
3
+ import fs from "node:fs";
4
+ import path from "node:path";
5
+ import os from "node:os";
6
+ import { poHomeDirectory } from "@agimon-ai/po-core/piSettings";
7
+ import { parse } from "yaml";
8
+ //#region src/services/config/index.ts
9
+ const DOOM_DIR = ".po";
10
+ const CONFIG_FILE = "config.yaml";
11
+ const PLANS_DIR = "plans";
12
+ function readConfig(filePath) {
13
+ return fs.existsSync(filePath) ? parseDoomConfig(fs.readFileSync(filePath, "utf8"), filePath) : { projectTrust: "ask" };
14
+ }
15
+ async function readConfigAsync(filePath) {
16
+ try {
17
+ return parseDoomConfig(await fs.promises.readFile(filePath, "utf8"), filePath);
18
+ } catch (error) {
19
+ if (error.code === "ENOENT") return { projectTrust: "ask" };
20
+ throw error;
21
+ }
22
+ }
23
+ function globalDoomConfigDirectory(homeDirectory = os.homedir()) {
24
+ return poHomeDirectory(homeDirectory);
25
+ }
26
+ function globalDoomConfigPath(homeDirectory = os.homedir()) {
27
+ return path.join(globalDoomConfigDirectory(homeDirectory), CONFIG_FILE);
28
+ }
29
+ function resolvePlanningPlansDirectory(configured, repoRoot, homeDirectory = os.homedir()) {
30
+ if (!configured) return path.join(globalDoomConfigDirectory(homeDirectory), PLANS_DIR);
31
+ if (configured === "~") return homeDirectory;
32
+ if (configured.startsWith("~/")) return path.resolve(homeDirectory, configured.slice(2));
33
+ if (configured.startsWith("~")) throw new Error("Doom planning plansDirectory supports only '~' or '~/' home aliases");
34
+ return path.isAbsolute(configured) ? path.normalize(configured) : path.resolve(repoRoot, configured);
35
+ }
36
+ function repositoryDoomConfigPath(repoRoot) {
37
+ return path.join(repoRoot, DOOM_DIR, CONFIG_FILE);
38
+ }
39
+ /**
40
+ * True when a repository's `.po` folder is Po's home itself, as it is for a
41
+ * session rooted at home. That folder is already the global layer; reading it
42
+ * again as the repository layer would apply global-only keys at repository scope.
43
+ */
44
+ function isGlobalDoomConfigRoot(repoRoot, homeDirectory = os.homedir()) {
45
+ return path.resolve(repoRoot, DOOM_DIR) === path.resolve(globalDoomConfigDirectory(homeDirectory));
46
+ }
47
+ function repositoryConfigFor(repoRoot, homeDirectory) {
48
+ return isGlobalDoomConfigRoot(repoRoot, homeDirectory) ? void 0 : repositoryDoomConfigPath(repoRoot);
49
+ }
50
+ /** Process-local distribution defaults never grant native authority or modify user files. */
51
+ function distributionDefaults(config, environment) {
52
+ if (environment.PO_DISTRIBUTION !== "desktop") return config;
53
+ return {
54
+ ...config,
55
+ computerUse: {
56
+ ...config.computerUse,
57
+ enabled: config.computerUse?.enabled ?? true
58
+ }
59
+ };
60
+ }
61
+ function loadDoomConfig(repoRoot, homeDirectory = os.homedir(), environment = process.env) {
62
+ const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);
63
+ return distributionDefaults(mergeDoomConfigs(readConfig(globalDoomConfigPath(homeDirectory)), repositoryPath === void 0 ? { projectTrust: "ask" } : readConfig(repositoryPath)), environment);
64
+ }
65
+ /**
66
+ * Loads the merged config, tolerating unknown keys in either file.
67
+ *
68
+ * Only `po sync` uses this. Everything that runs during a session keeps
69
+ * `loadDoomConfig`, because a key a running extension cannot understand is
70
+ * better reported than silently ignored; a build that refuses to start over
71
+ * the same key is not.
72
+ */
73
+ function loadDoomConfigLenient(repoRoot, homeDirectory = os.homedir(), environment = process.env) {
74
+ const read = (filePath) => filePath !== void 0 && fs.existsSync(filePath) ? parseDoomConfig(fs.readFileSync(filePath, "utf8"), filePath, { lenient: true }) : {
75
+ config: { projectTrust: "ask" },
76
+ diagnostics: []
77
+ };
78
+ const globalConfig = read(globalDoomConfigPath(homeDirectory));
79
+ const repositoryConfig = read(repositoryConfigFor(repoRoot, homeDirectory));
80
+ const diagnostics = [...globalConfig.diagnostics, ...repositoryConfig.diagnostics];
81
+ return {
82
+ config: distributionDefaults(mergeDoomConfigs(globalConfig.config, repositoryConfig.config), environment),
83
+ diagnostics
84
+ };
85
+ }
86
+ async function loadDoomConfigAsync(repoRoot, homeDirectory = os.homedir(), environment = process.env) {
87
+ const globalConfig = await readConfigAsync(globalDoomConfigPath(homeDirectory));
88
+ const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);
89
+ const repositoryConfig = repositoryPath === void 0 ? { projectTrust: "ask" } : await readConfigAsync(repositoryPath);
90
+ return distributionDefaults(mergeDoomConfigs(globalConfig, repositoryConfig), environment);
91
+ }
92
+ /**
93
+ * Reads one config file as a layer: what it is, what it sets, and the bytes it
94
+ * held. A file that does not exist is a layer that sets nothing, which is a
95
+ * normal state rather than an error.
96
+ */
97
+ function readLayer(filePath) {
98
+ let text;
99
+ try {
100
+ text = fs.readFileSync(filePath, "utf8");
101
+ } catch (error) {
102
+ if (error.code === "ENOENT") return {
103
+ filePath,
104
+ exists: false,
105
+ hash: "",
106
+ keys: []
107
+ };
108
+ throw error;
109
+ }
110
+ const document = parse(text) ?? {};
111
+ return {
112
+ filePath,
113
+ exists: true,
114
+ hash: createHash("sha256").update(text, "utf8").digest("hex"),
115
+ keys: configLeafKeys(document)
116
+ };
117
+ }
118
+ /**
119
+ * The two config files kept apart, with the merge alongside them.
120
+ *
121
+ * `repoRoot` is optional because the global file is complete on its own: a
122
+ * settings surface with no repository in view still has settings to show, and
123
+ * demanding one would leave it with nothing to render rather than with the
124
+ * global half.
125
+ *
126
+ * The origin answer respects the merge's own per-field rules rather than simply
127
+ * preferring the repository: `editor` is read from the global side whatever the
128
+ * repository says, and `projectTrust` from the repository side whatever the
129
+ * global one says. Reporting a file as the source of a value the merge discards
130
+ * is the exact confusion this exists to remove.
131
+ */
132
+ function loadDoomConfigLayers(repoRoot, homeDirectory = os.homedir(), environment = process.env) {
133
+ const globalLayer = readLayer(globalDoomConfigPath(homeDirectory));
134
+ const repositoryPath = repoRoot === void 0 ? void 0 : repositoryConfigFor(repoRoot, homeDirectory);
135
+ const repositoryLayer = repositoryPath === void 0 ? {
136
+ filePath: "",
137
+ exists: false,
138
+ hash: "",
139
+ keys: []
140
+ } : readLayer(repositoryPath);
141
+ const effective = repoRoot === void 0 ? distributionDefaults(mergeDoomConfigs(readConfig(globalDoomConfigPath(homeDirectory)), { projectTrust: "ask" }), environment) : loadDoomConfig(repoRoot, homeDirectory, environment);
142
+ const sets = (layer, keyPath) => {
143
+ const dotted = keyPath.join(".");
144
+ return layer.keys.some((key) => key === dotted || key.startsWith(`${dotted}.`));
145
+ };
146
+ return {
147
+ globalFile: globalLayer,
148
+ repositoryFile: repositoryLayer,
149
+ effective,
150
+ originOf(keyPath) {
151
+ const scope = configScopeOf(keyPath);
152
+ if (scope !== "global" && sets(repositoryLayer, keyPath)) return "repository";
153
+ if (scope !== "repository" && sets(globalLayer, keyPath)) return "global";
154
+ return "default";
155
+ },
156
+ valueAt: (keyPath) => valueAtKeyPath(effective, keyPath)
157
+ };
158
+ }
159
+ //#endregion
160
+ export { loadDoomConfigAsync as a, repositoryDoomConfigPath as c, loadDoomConfig as i, resolvePlanningPlansDirectory as l, globalDoomConfigPath as n, loadDoomConfigLayers as o, isGlobalDoomConfigRoot as r, loadDoomConfigLenient as s, globalDoomConfigDirectory as t };
161
+
162
+ //# sourceMappingURL=config-CKA07FxG.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-CKA07FxG.mjs","names":["parseYaml"],"sources":["../src/services/config/index.ts"],"sourcesContent":["import { createHash } from 'node:crypto';\nimport fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\n\nimport { poHomeDirectory } from '@agimon-ai/po-core/piSettings';\nimport { parse as parseYaml } from 'yaml';\n\nimport type {\n ConfigDiagnostic,\n ConfigValueOrigin,\n DoomConfig,\n DoomConfigLayer,\n DoomConfigLayers,\n LenientParseResult,\n} from '../../types/config';\nimport { configLeafKeys, configScopeOf, mergeDoomConfigs, parseDoomConfig, valueAtKeyPath } from '../configPolicy';\n\nconst DOOM_DIR = '.po';\nconst CONFIG_FILE = 'config.yaml';\nconst PLANS_DIR = 'plans';\n\nfunction readConfig(filePath: string): DoomConfig {\n return fs.existsSync(filePath)\n ? parseDoomConfig(fs.readFileSync(filePath, 'utf8'), filePath)\n : { projectTrust: 'ask' };\n}\n\nasync function readConfigAsync(filePath: string): Promise<DoomConfig> {\n try {\n return parseDoomConfig(await fs.promises.readFile(filePath, 'utf8'), filePath);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return { projectTrust: 'ask' };\n throw error;\n }\n}\n\nexport function globalDoomConfigDirectory(homeDirectory = os.homedir()): string {\n return poHomeDirectory(homeDirectory);\n}\n\nexport function globalDoomConfigPath(homeDirectory = os.homedir()): string {\n return path.join(globalDoomConfigDirectory(homeDirectory), CONFIG_FILE);\n}\n\nexport function resolvePlanningPlansDirectory(\n configured: string | undefined,\n repoRoot: string,\n homeDirectory = os.homedir(),\n): string {\n // Under Po's home, so Po writes nothing into ~/.pi.\n if (!configured) return path.join(globalDoomConfigDirectory(homeDirectory), PLANS_DIR);\n if (configured === '~') return homeDirectory;\n if (configured.startsWith('~/')) return path.resolve(homeDirectory, configured.slice(2));\n if (configured.startsWith('~')) {\n throw new Error(\"Doom planning plansDirectory supports only '~' or '~/' home aliases\");\n }\n return path.isAbsolute(configured) ? path.normalize(configured) : path.resolve(repoRoot, configured);\n}\n\nexport function repositoryDoomConfigPath(repoRoot: string): string {\n return path.join(repoRoot, DOOM_DIR, CONFIG_FILE);\n}\n\n/**\n * True when a repository's `.po` folder is Po's home itself, as it is for a\n * session rooted at home. That folder is already the global layer; reading it\n * again as the repository layer would apply global-only keys at repository scope.\n */\nexport function isGlobalDoomConfigRoot(repoRoot: string, homeDirectory = os.homedir()): boolean {\n return path.resolve(repoRoot, DOOM_DIR) === path.resolve(globalDoomConfigDirectory(homeDirectory));\n}\n\nfunction repositoryConfigFor(repoRoot: string, homeDirectory: string): string | undefined {\n return isGlobalDoomConfigRoot(repoRoot, homeDirectory) ? undefined : repositoryDoomConfigPath(repoRoot);\n}\n\n/** Process-local distribution defaults never grant native authority or modify user files. */\nfunction distributionDefaults(config: DoomConfig, environment: NodeJS.ProcessEnv): DoomConfig {\n if (environment.PO_DISTRIBUTION !== 'desktop') return config;\n return { ...config, computerUse: { ...config.computerUse, enabled: config.computerUse?.enabled ?? true } };\n}\n\nexport function loadDoomConfig(\n repoRoot: string,\n homeDirectory = os.homedir(),\n environment: NodeJS.ProcessEnv = process.env,\n): DoomConfig {\n const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);\n return distributionDefaults(\n mergeDoomConfigs(\n readConfig(globalDoomConfigPath(homeDirectory)),\n repositoryPath === undefined ? { projectTrust: 'ask' } : readConfig(repositoryPath),\n ),\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 * `loadDoomConfig`, 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 */\nexport function loadDoomConfigLenient(\n repoRoot: string,\n homeDirectory = os.homedir(),\n environment: NodeJS.ProcessEnv = process.env,\n): LenientParseResult {\n const read = (filePath: string | undefined): LenientParseResult =>\n filePath !== undefined && fs.existsSync(filePath)\n ? parseDoomConfig(fs.readFileSync(filePath, 'utf8'), filePath, { lenient: true })\n : { config: { projectTrust: 'ask' }, diagnostics: [] };\n const globalConfig = read(globalDoomConfigPath(homeDirectory));\n const repositoryConfig = read(repositoryConfigFor(repoRoot, homeDirectory));\n const diagnostics: ConfigDiagnostic[] = [...globalConfig.diagnostics, ...repositoryConfig.diagnostics];\n // mergeDoomConfigs stays strict on purpose: its errors are cross-file scope\n // violations on known keys, which is a different fault from an unknown key.\n return {\n config: distributionDefaults(mergeDoomConfigs(globalConfig.config, repositoryConfig.config), environment),\n diagnostics,\n };\n}\n\nexport async function loadDoomConfigAsync(\n repoRoot: string,\n homeDirectory = os.homedir(),\n environment: NodeJS.ProcessEnv = process.env,\n): Promise<DoomConfig> {\n const globalConfig = await readConfigAsync(globalDoomConfigPath(homeDirectory));\n const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);\n const repositoryConfig: DoomConfig =\n repositoryPath === undefined ? { projectTrust: 'ask' } : await readConfigAsync(repositoryPath);\n return distributionDefaults(mergeDoomConfigs(globalConfig, repositoryConfig), environment);\n}\n\n/**\n * Reads one config file as a layer: what it is, what it sets, and the bytes it\n * held. A file that does not exist is a layer that sets nothing, which is a\n * normal state rather than an error.\n */\nfunction readLayer(filePath: string): DoomConfigLayer {\n let text: string;\n try {\n text = fs.readFileSync(filePath, 'utf8');\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') {\n return { filePath, exists: false, hash: '', keys: [] };\n }\n throw error;\n }\n // The raw document, not the parsed config: this is the one read that has to\n // distinguish a key the file set from a key the parser defaulted.\n const document = (parseYaml(text) ?? {}) as unknown;\n return {\n filePath,\n exists: true,\n hash: createHash('sha256').update(text, 'utf8').digest('hex'),\n keys: configLeafKeys(document),\n };\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, and\n * demanding one would leave it with nothing to render rather than with the\n * global half.\n *\n * The origin answer respects the merge's own per-field rules rather than simply\n * preferring the repository: `editor` is read from the global side whatever the\n * repository says, and `projectTrust` from the repository side whatever the\n * global one says. Reporting a file as the source of a value the merge discards\n * is the exact confusion this exists to remove.\n */\nexport function loadDoomConfigLayers(\n repoRoot: string | undefined,\n homeDirectory = os.homedir(),\n environment: NodeJS.ProcessEnv = process.env,\n): DoomConfigLayers {\n const globalLayer = readLayer(globalDoomConfigPath(homeDirectory));\n const repositoryPath = repoRoot === undefined ? undefined : repositoryConfigFor(repoRoot, homeDirectory);\n const repositoryLayer =\n repositoryPath === undefined ? { filePath: '', exists: false, hash: '', keys: [] } : readLayer(repositoryPath);\n // With no repository there is nothing to merge, so the global file stands as\n // the effective config on its own.\n const effective =\n repoRoot === undefined\n ? distributionDefaults(\n mergeDoomConfigs(readConfig(globalDoomConfigPath(homeDirectory)), { projectTrust: 'ask' }),\n environment,\n )\n : loadDoomConfig(repoRoot, homeDirectory, environment);\n const sets = (layer: DoomConfigLayer, keyPath: readonly string[]): boolean => {\n const dotted = keyPath.join('.');\n return layer.keys.some((key) => key === dotted || key.startsWith(`${dotted}.`));\n };\n return {\n globalFile: globalLayer,\n repositoryFile: repositoryLayer,\n effective,\n originOf(keyPath: readonly string[]): ConfigValueOrigin {\n const scope = configScopeOf(keyPath);\n if (scope !== 'global' && sets(repositoryLayer, keyPath)) return 'repository';\n if (scope !== 'repository' && sets(globalLayer, keyPath)) return 'global';\n return 'default';\n },\n valueAt: (keyPath: readonly string[]) => valueAtKeyPath(effective, keyP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;EACL,YAAY;EACZ,gBAAgB;EAChB;EACA,SAAS,SAA+C;GACtD,MAAM,QAAQ,cAAc,OAAO;GACnC,IAAI,UAAU,YAAY,KAAK,iBAAiB,OAAO,GAAG,OAAO;GACjE,IAAI,UAAU,gBAAgB,KAAK,aAAa,OAAO,GAAG,OAAO;GACjE,OAAO;EACT;EACA,UAAU,YAA+B,eAAe,WAAW,OAAO;CAC5E;AACF"}
@@ -0,0 +1,320 @@
1
+ import { i as PersonaVoiceOverride, r as PersonaIdentity } from "./profiles-CTrUCmIh.mjs";
2
+ import { DoomMcpProjection } from "@agimon-ai/po-core/mcpProjection";
3
+ import { DOOM_CONFIG_SERVICE, IDoomConfigService } from "@agimon-ai/po-core/config";
4
+ import { PackageAttribution, PackageAttribution as PackageAttribution$1 } from "@agimon-ai/po-core/contextProjection";
5
+ //#region src/types/config.d.ts
6
+ type ProjectTrust = 'ask' | 'always' | 'never';
7
+ type PlanningThinkingLevel = 'off' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
8
+ type VoiceEngine = 'auto' | 'whisper-cpp' | 'openai-whisper' | 'mlx-whisper';
9
+ type VoiceMode = 'legacy' | 'live';
10
+ type VoiceTtsEngine = 'macos-say';
11
+ interface PlanningAgentConfig {
12
+ model?: string;
13
+ thinking?: PlanningThinkingLevel;
14
+ }
15
+ interface PlanningModeConfig {
16
+ main?: PlanningAgentConfig;
17
+ subagents?: PlanningAgentConfig;
18
+ plansDirectory?: string;
19
+ }
20
+ /**
21
+ * Ratios of the context window at which each autocompact pass fires.
22
+ *
23
+ * Held as plain numbers so a reader can see the ladder in one place. The
24
+ * package owns the defaults and the ordering rule; this only carries what the
25
+ * file said.
26
+ */
27
+ interface AutocompactThresholdConfig {
28
+ pass1?: number;
29
+ pass2?: number;
30
+ pass3?: number;
31
+ }
32
+ /**
33
+ * Absolute token checkpoints one matching model pins, replacing the ratio for
34
+ * that pass when it would fire earlier.
35
+ *
36
+ * A pass left unset keeps its ratio value, so an entry may pin one rung of the
37
+ * ladder without restating the rest.
38
+ */
39
+ interface AutocompactTokenConfig {
40
+ pass1?: number;
41
+ pass2?: number;
42
+ pass3?: number;
43
+ }
44
+ /**
45
+ * One per-model override rule.
46
+ *
47
+ * `model` is a glob. A pattern containing `/` is matched against `provider/id`,
48
+ * anything else against the bare model id, because the wildcard does not cross
49
+ * the separator. Entries are tried in file order and the first match wins.
50
+ */
51
+ interface AutocompactOverrideConfig {
52
+ model: string;
53
+ tokens: AutocompactTokenConfig;
54
+ }
55
+ interface AutocompactModeConfig {
56
+ enabled?: boolean;
57
+ model?: string;
58
+ thinking?: PlanningThinkingLevel;
59
+ thresholds?: AutocompactThresholdConfig;
60
+ overrides?: AutocompactOverrideConfig[];
61
+ }
62
+ interface ComputerUseConfig {
63
+ enabled?: boolean;
64
+ }
65
+ interface EditorConfig {
66
+ command?: string;
67
+ }
68
+ interface VoiceModelConfig {
69
+ path?: string;
70
+ id?: string;
71
+ }
72
+ interface VoiceAdapterConfig {
73
+ binary?: string;
74
+ model: VoiceModelConfig;
75
+ }
76
+ interface VoiceTtsConfig {
77
+ engine: VoiceTtsEngine;
78
+ voice?: string;
79
+ rate?: number;
80
+ }
81
+ interface VoiceAutoCaptureConfig {
82
+ model: string;
83
+ startPhrases?: string[];
84
+ stopPhrases?: string[];
85
+ composeOpenPhrases?: string[];
86
+ composeSendPhrases?: string[];
87
+ composeCancelPhrases?: string[];
88
+ utteranceIdleMs?: number;
89
+ composeUtteranceIdleMs?: number;
90
+ composeNudgeMs?: number;
91
+ transcriptionTimeoutMs?: number;
92
+ tts: VoiceTtsConfig;
93
+ }
94
+ interface ResolvedVoiceAutoCaptureConfig {
95
+ model: string;
96
+ startPhrases: string[];
97
+ stopPhrases: string[];
98
+ composeOpenPhrases: string[];
99
+ composeSendPhrases: string[];
100
+ composeCancelPhrases: string[];
101
+ utteranceIdleMs: number;
102
+ composeUtteranceIdleMs: number;
103
+ composeNudgeMs: number;
104
+ transcriptionTimeoutMs?: number;
105
+ tts: VoiceTtsConfig;
106
+ }
107
+ interface VoiceConfig {
108
+ mode?: VoiceMode;
109
+ engine?: VoiceEngine;
110
+ language?: string;
111
+ recorder?: {
112
+ binary?: string;
113
+ device?: string;
114
+ };
115
+ adapters?: {
116
+ 'whisper-cpp'?: VoiceAdapterConfig;
117
+ 'openai-whisper'?: VoiceAdapterConfig;
118
+ 'mlx-whisper'?: VoiceAdapterConfig;
119
+ };
120
+ autoCapture?: VoiceAutoCaptureConfig;
121
+ }
122
+ interface ResolvedVoiceConfig {
123
+ mode: VoiceMode;
124
+ engine: VoiceEngine;
125
+ language: string;
126
+ recorder: {
127
+ binary?: string;
128
+ device: string;
129
+ };
130
+ adapters: NonNullable<VoiceConfig['adapters']>;
131
+ autoCapture?: ResolvedVoiceAutoCaptureConfig;
132
+ }
133
+ /**
134
+ * The matrix a repository selects by default.
135
+ *
136
+ * Read by `po sync`, which pins it into the generated Pi config so a plain
137
+ * `pi` session starts on the same matrix the repository declares. The launcher
138
+ * keeps taking its selection from flags and the environment.
139
+ */
140
+ interface DoomSelectionConfig {
141
+ majorMode?: string;
142
+ domains?: string[];
143
+ profile?: string;
144
+ }
145
+ /** The selection persisted in a Pi session entry. */
146
+ interface DoomConfigSelection {
147
+ readonly version: 1;
148
+ readonly majorMode: string;
149
+ readonly domains: readonly string[];
150
+ readonly profile?: string;
151
+ /** Canonical identity of the parent/child extension composition. */
152
+ readonly compositionFingerprint?: string;
153
+ }
154
+ type DoomConfigTransitionStrategy = 'pi-reload' | 'process-relaunch';
155
+ type DoomConfigTransitionPhase = 'pending' | 'applied' | 'aborted' | 'superseded';
156
+ interface DoomConfigTransitionRecord {
157
+ readonly version: 1;
158
+ readonly operationId: string;
159
+ readonly active: DoomConfigSelection;
160
+ readonly target: DoomConfigSelection;
161
+ readonly strategy: DoomConfigTransitionStrategy;
162
+ readonly phase: DoomConfigTransitionPhase;
163
+ }
164
+ /** A transition journal target that has not yet received an explicit fresh-session acknowledgement. */
165
+ type DoomConfigPendingSelection = DoomConfigTransitionRecord & {
166
+ readonly phase: 'pending';
167
+ };
168
+ interface DoomConfig {
169
+ modes?: {
170
+ planning?: PlanningModeConfig;
171
+ autocompact?: AutocompactModeConfig;
172
+ };
173
+ computerUse?: ComputerUseConfig;
174
+ projectTrust: ProjectTrust;
175
+ editor?: EditorConfig;
176
+ voice?: VoiceConfig;
177
+ selection?: DoomSelectionConfig;
178
+ /** Default layout identifier, resolved against the available web template packages. */
179
+ web?: {
180
+ template?: string;
181
+ };
182
+ /** Phone app layout identifier, resolved against the native templates the admitted packages offer. */
183
+ native?: {
184
+ template?: string;
185
+ };
186
+ }
187
+ interface PluginHookSource {
188
+ pluginRoot: string;
189
+ configPath: string;
190
+ }
191
+ interface HarnessState {
192
+ root?: string;
193
+ /** The one named major mode this session runs under. */
194
+ majorMode: string;
195
+ temporaryDirectory?: string;
196
+ domains: string[];
197
+ /** The layer components the major mode resolved to. */
198
+ layers: string[];
199
+ /**
200
+ * Which mode, layer, or domain admitted each package, keyed by the package
201
+ * name exactly as its manifest spells it.
202
+ *
203
+ * The composition resolves this on its way to a flat list of entry paths and
204
+ * has no further use for it, so without somewhere to put it the causal link
205
+ * between a mode and the tools it brought is lost the moment the session
206
+ * starts. A surface that reports what the session is carrying has to be able
207
+ * to say what asked for it.
208
+ */
209
+ packageAttribution?: Record<string, PackageAttribution>;
210
+ /** Canonical identity shared by launch, sync, children, and reload. */
211
+ compositionFingerprint?: string;
212
+ profile?: string;
213
+ profileEnvironment: Record<string, string>;
214
+ hookGroups?: string[];
215
+ skillDirectories: string[];
216
+ agentDirectories: string[];
217
+ additionalDirectories: string[];
218
+ childExtensions: string[];
219
+ pluginDirectories: string[];
220
+ pluginHooks: PluginHookSource[];
221
+ /** File-only authority that the Config core publishes to the session registry. */
222
+ mcpProjection?: DoomMcpProjection;
223
+ /** Generation-pinned hook descriptor, transported only through the state file. */
224
+ hookModules?: {
225
+ file: string;
226
+ };
227
+ mcpConfigPath?: string;
228
+ personaFile?: string;
229
+ /**
230
+ * The active persona's presentation, carried here because the three surfaces
231
+ * that need it share no transport: the cockpit reads journalled entries, the
232
+ * voice worker reads config from disk, and the TUI reads the Cordis snapshot.
233
+ */
234
+ profileIdentity?: PersonaIdentity;
235
+ /** The active profile's TTS override, applied over `voice.autoCapture.tts`. */
236
+ profileVoice?: PersonaVoiceOverride;
237
+ allowProtectedWrites: boolean;
238
+ hooks: boolean;
239
+ agents: boolean;
240
+ mcp: boolean;
241
+ }
242
+ type DeepReadonly<TValue> = TValue extends ((...args: never[]) => unknown) ? TValue : TValue extends readonly (infer TItem)[] ? readonly DeepReadonly<TItem>[] : TValue extends object ? { readonly [TKey in keyof TValue]: DeepReadonly<TValue[TKey]>; } : TValue;
243
+ type DoomHarnessContext = DeepReadonly<HarnessState>;
244
+ interface DoomConfigContext {
245
+ readonly settings: DeepReadonly<DoomConfig>;
246
+ readonly harness: DoomHarnessContext;
247
+ /** A journal target awaiting explicit acknowledgement; the active harness remains above. */
248
+ readonly pendingSelection?: DeepReadonly<DoomConfigPendingSelection>;
249
+ /** Whether the active harness does not yet match the pending target. */
250
+ readonly requiresRelaunch: boolean;
251
+ }
252
+ /** A file-only loader; unlike the Cordis service it owns no live session snapshot. */
253
+ interface IDoomConfigLoader {
254
+ load(repoRoot: string, homeDirectory?: string): DoomConfig;
255
+ }
256
+ /** The config package's concrete specialization of the cross-package service contract. */
257
+ interface IDoomConfigService$1 extends IDoomConfigService<DoomConfigContext, DoomConfig> {}
258
+ declare module '@deepseek-ai/cordis' {
259
+ interface Context {
260
+ 'doom/config': IDoomConfigService$1;
261
+ }
262
+ }
263
+ /** Which file the effective value for a key came from, or that no file set it. */
264
+ type ConfigValueOrigin = 'global' | 'repository' | 'default';
265
+ /** One of the two config files, as a settings surface needs to see it. */
266
+ interface DoomConfigLayer {
267
+ filePath: string;
268
+ exists: boolean;
269
+ /**
270
+ * sha256 of the file's bytes, empty when absent. The token a write proves
271
+ * itself with: the writer is torn-read safe but not lost-update safe, so a
272
+ * caller that read a file and then writes it should say which bytes it read.
273
+ */
274
+ hash: string;
275
+ /** Dotted key paths this file actually sets, leaves only. */
276
+ keys: readonly string[];
277
+ }
278
+ /**
279
+ * The two config files kept apart, alongside the merge every consumer sees.
280
+ *
281
+ * `loadDoomConfig` flattens global and repository into one object, which is all
282
+ * the runtime needs and not enough for a settings surface: a value that is set
283
+ * in both files looks identical to one set in neither, so an editor cannot say
284
+ * where a value came from, and offers a write that the merge may then ignore.
285
+ */
286
+ interface DoomConfigLayers {
287
+ /** Named with the suffix because a bare `global` reads as the process global. */
288
+ globalFile: DoomConfigLayer;
289
+ repositoryFile: DoomConfigLayer;
290
+ effective: DoomConfig;
291
+ /** Where the effective value at this key path came from. */
292
+ originOf(keyPath: readonly string[]): ConfigValueOrigin;
293
+ /** The effective value at this key path, or undefined when nothing set it. */
294
+ valueAt(keyPath: readonly string[]): unknown;
295
+ }
296
+ /**
297
+ * One tolerated problem found while reading a config file.
298
+ *
299
+ * Carries the file it came from because a lenient load merges the global and
300
+ * repository files, and "unsupported field: voice.engine" is unactionable
301
+ * without saying which of the two declared it.
302
+ */
303
+ interface ConfigDiagnostic {
304
+ filePath: string;
305
+ /** Dotted path to the offending key, for example `voice.recorder.typo`. */
306
+ path: string;
307
+ message: string;
308
+ }
309
+ /** Opts a parse into collecting unknown keys instead of throwing on them. */
310
+ interface LenientParseOptions {
311
+ lenient: true;
312
+ }
313
+ /** What a lenient parse returns in place of a bare config. */
314
+ interface LenientParseResult {
315
+ config: DoomConfig;
316
+ diagnostics: ConfigDiagnostic[];
317
+ }
318
+ //#endregion
319
+ export { PluginHookSource as A, VoiceTtsConfig as B, IDoomConfigService$1 as C, PlanningAgentConfig as D, PackageAttribution$1 as E, VoiceAutoCaptureConfig as F, VoiceConfig as I, VoiceEngine as L, ResolvedVoiceAutoCaptureConfig as M, ResolvedVoiceConfig as N, PlanningModeConfig as O, VoiceAdapterConfig as P, VoiceMode as R, IDoomConfigLoader as S, LenientParseResult as T, VoiceTtsEngine as V, DoomConfigTransitionStrategy as _, ConfigDiagnostic as a, EditorConfig as b, DeepReadonly as c, DoomConfigLayer as d, DoomConfigLayers as f, DoomConfigTransitionRecord as g, DoomConfigTransitionPhase as h, AutocompactTokenConfig as i, ProjectTrust as j, PlanningThinkingLevel as k, DoomConfig as l, DoomConfigSelection as m, AutocompactOverrideConfig as n, ConfigValueOrigin as o, DoomConfigPendingSelection as p, AutocompactThresholdConfig as r, DOOM_CONFIG_SERVICE as s, AutocompactModeConfig as t, DoomConfigContext as u, DoomHarnessContext as v, LenientParseOptions as w, HarnessState as x, DoomSelectionConfig as y, VoiceModelConfig as z };
320
+ //# sourceMappingURL=config-Cm3EV1jp.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-Cm3EV1jp.d.mts","names":["IDoomConfigService","DoomConfigServiceContract"],"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;;UAEG;EACf;;UAGe;EACf;;UAEe;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;;UAEC;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,6BAA6B;WAAwC;;UAEhE;EACf;IAAU,WAAW;IAAoB,cAAc;;EACvD,cAAc;EACd,cAAc;EACd,SAAS;EACT,QAAQ;EACR,YAAY;;EAEZ;IAAQ;;;EAER;IAAW;;;UAGI;EACf;EACA;;UAMe;EACf;;EAEA;EACA;EACA;;EAEA;;;;;;;;;;;EAWA,qBAAqB,eAAe;;EAEpC;EACA;EACA,oBAAoB;EACpB;EACA;EACA;EACA;EACA;EACA;EACA,aAAa;;EAEb,gBAAgB;;EAEhB;IAAgB;;EAChB;EACA;;;;;;EAMA,kBAAkB;;EAElB,eAAe;EACf;EACA;EACA;EACA;;KAGU,aAAa,UAAU,oBAAmB,6BAClD,SACA,+BAA+B,oBACpB,aAAa,WACtB,oCACc,cAAc,SAAS,aAAa,OAAO,YACvD;KAEI,qBAAqB,aAAa;UAE7B;WACN,UAAU,aAAa;WACvB,SAAS;;WAET,mBAAmB,aAAa;;WAEhC;;;UAIM;EACf,KAAK,kBAAkB,yBAAyB;;;UAIjCA,6BAA2BC,mBAA0B,mBAAmB;;YAG7E;IACR,eAAeD;;;;KAQP;;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"}
@@ -0,0 +1,2 @@
1
+ import { DOOM_CONFIG_SERVICE } from "@agimon-ai/po-core/config";
2
+ export { DOOM_CONFIG_SERVICE as t };
@@ -0,0 +1 @@
1
+ require("@agimon-ai/po-core/config");
@@ -0,0 +1,24 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_configPolicy = require("./configPolicy-DmsZEp0t.cjs");
3
+ const require_config = require("./config-BUw5kHsx.cjs");
4
+ exports.DOOM_PLANNING_THINKING_LEVELS = require_configPolicy.DOOM_PLANNING_THINKING_LEVELS;
5
+ exports.DOOM_VOICE_ENGINES = require_configPolicy.DOOM_VOICE_ENGINES;
6
+ exports.DOOM_VOICE_MODES = require_configPolicy.DOOM_VOICE_MODES;
7
+ exports.DOOM_VOICE_TTS_ENGINES = require_configPolicy.DOOM_VOICE_TTS_ENGINES;
8
+ exports.configLeafKeys = require_configPolicy.configLeafKeys;
9
+ exports.configRootKeys = require_configPolicy.configRootKeys;
10
+ exports.configScopeOf = require_configPolicy.configScopeOf;
11
+ exports.globalDoomConfigDirectory = require_config.globalDoomConfigDirectory;
12
+ exports.globalDoomConfigPath = require_config.globalDoomConfigPath;
13
+ exports.loadDoomConfig = require_config.loadDoomConfig;
14
+ exports.loadDoomConfigAsync = require_config.loadDoomConfigAsync;
15
+ exports.loadDoomConfigLayers = require_config.loadDoomConfigLayers;
16
+ exports.loadDoomConfigLenient = require_config.loadDoomConfigLenient;
17
+ exports.mergeDoomConfigs = require_configPolicy.mergeDoomConfigs;
18
+ exports.parseAutocompactModeConfig = require_configPolicy.parseAutocompactModeConfig;
19
+ exports.parseDoomConfig = require_configPolicy.parseDoomConfig;
20
+ exports.parsePlanningModeConfig = require_configPolicy.parsePlanningModeConfig;
21
+ exports.repositoryDoomConfigPath = require_config.repositoryDoomConfigPath;
22
+ exports.resolvePlanningPlansDirectory = require_config.resolvePlanningPlansDirectory;
23
+ exports.resolveVoiceConfig = require_configPolicy.resolveVoiceConfig;
24
+ exports.valueAtKeyPath = require_configPolicy.valueAtKeyPath;
@@ -0,0 +1,3 @@
1
+ import { T as LenientParseResult, a as ConfigDiagnostic, d as DoomConfigLayer, f as DoomConfigLayers, o as ConfigValueOrigin, w as LenientParseOptions } from "./config-Cm3EV1jp.mjs";
2
+ import { S as resolvePlanningPlansDirectory, _ as loadDoomConfig, a as DOOM_VOICE_TTS_ENGINES, b as loadDoomConfigLenient, c as configScopeOf, d as parseDoomConfig, f as parsePlanningModeConfig, g as globalDoomConfigPath, h as globalDoomConfigDirectory, i as DOOM_VOICE_MODES, l as mergeDoomConfigs, m as valueAtKeyPath, n as DOOM_PLANNING_THINKING_LEVELS, o as configLeafKeys, p as resolveVoiceConfig, r as DOOM_VOICE_ENGINES, s as configRootKeys, t as ConfigKeyScope, u as parseAutocompactModeConfig, v as loadDoomConfigAsync, x as repositoryDoomConfigPath, y as loadDoomConfigLayers } from "./index-B_lp0W3U.mjs";
3
+ export { type ConfigDiagnostic, type ConfigKeyScope, type ConfigValueOrigin, DOOM_PLANNING_THINKING_LEVELS, DOOM_VOICE_ENGINES, DOOM_VOICE_MODES, DOOM_VOICE_TTS_ENGINES, type DoomConfigLayer, type DoomConfigLayers, type LenientParseOptions, type LenientParseResult, configLeafKeys, configRootKeys, configScopeOf, globalDoomConfigDirectory, globalDoomConfigPath, loadDoomConfig, loadDoomConfigAsync, loadDoomConfigLayers, loadDoomConfigLenient, mergeDoomConfigs, parseAutocompactModeConfig, parseDoomConfig, parsePlanningModeConfig, repositoryDoomConfigPath, resolvePlanningPlansDirectory, resolveVoiceConfig, valueAtKeyPath };
@@ -0,0 +1,3 @@
1
+ import { a as configLeafKeys, c as mergeDoomConfigs, d as parsePlanningModeConfig, f as resolveVoiceConfig, i as DOOM_VOICE_TTS_ENGINES, l as parseAutocompactModeConfig, n as DOOM_VOICE_ENGINES, o as configRootKeys, p as valueAtKeyPath, r as DOOM_VOICE_MODES, s as configScopeOf, t as DOOM_PLANNING_THINKING_LEVELS, u as parseDoomConfig } from "./configPolicy--TNX7feH.mjs";
2
+ import { a as loadDoomConfigAsync, c as repositoryDoomConfigPath, i as loadDoomConfig, l as resolvePlanningPlansDirectory, n as globalDoomConfigPath, o as loadDoomConfigLayers, s as loadDoomConfigLenient, t as globalDoomConfigDirectory } from "./config-CKA07FxG.mjs";
3
+ export { DOOM_PLANNING_THINKING_LEVELS, DOOM_VOICE_ENGINES, DOOM_VOICE_MODES, DOOM_VOICE_TTS_ENGINES, configLeafKeys, configRootKeys, configScopeOf, globalDoomConfigDirectory, globalDoomConfigPath, loadDoomConfig, loadDoomConfigAsync, loadDoomConfigLayers, loadDoomConfigLenient, mergeDoomConfigs, parseAutocompactModeConfig, parseDoomConfig, parsePlanningModeConfig, repositoryDoomConfigPath, resolvePlanningPlansDirectory, resolveVoiceConfig, valueAtKeyPath };