@agimon-ai/po-config 0.0.0-alpha.2 → 0.0.0-alpha.21
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.
- package/LICENSE +149 -21
- package/README.md +11 -11
- package/dist/agentPluginMcp.cjs +313 -134
- package/dist/agentPluginMcp.cjs.map +1 -1
- package/dist/agentPluginMcp.d.mts +22 -4
- package/dist/agentPluginMcp.d.mts.map +1 -1
- package/dist/agentPluginMcp.mjs +312 -134
- package/dist/agentPluginMcp.mjs.map +1 -1
- package/dist/apiContracts.cjs.map +1 -1
- package/dist/apiContracts.mjs.map +1 -1
- package/dist/atomicJson-D3MHqnLW.cjs +59 -0
- package/dist/atomicJson-D3MHqnLW.cjs.map +1 -0
- package/dist/atomicJson-Dj3rlZbD.mjs +40 -0
- package/dist/atomicJson-Dj3rlZbD.mjs.map +1 -0
- package/dist/atomicJson.cjs +4 -2
- package/dist/atomicJson.d.mts +2 -2
- package/dist/atomicJson.mjs +3 -2
- package/dist/{index-BT29GZx5.d.mts → completion-Ba0TiBHa.d.mts} +58 -27
- package/dist/completion-Ba0TiBHa.d.mts.map +1 -0
- package/dist/config-BBvn_ZLP.mjs +1 -0
- package/dist/config-Cdybp9rT.cjs +155 -0
- package/dist/config-Cdybp9rT.cjs.map +1 -0
- package/dist/config-Cxc2xw54.mjs +112 -0
- package/dist/config-Cxc2xw54.mjs.map +1 -0
- package/dist/{config-D2HbBLzo.d.mts → config-pxC7FyUJ.d.mts} +33 -33
- package/dist/config-pxC7FyUJ.d.mts.map +1 -0
- package/dist/config.cjs +21 -17
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +4 -3
- package/dist/{configPolicy-Ce1QKDxa.cjs → configPolicy-CowlLhK1.cjs} +99 -99
- package/dist/configPolicy-CowlLhK1.cjs.map +1 -0
- package/dist/{configPolicy-DCQgF5-f.mjs → configPolicy-DueX0k6i.mjs} +84 -84
- package/dist/configPolicy-DueX0k6i.mjs.map +1 -0
- package/dist/configSchema.d.mts +2 -2
- package/dist/configWriter-DCASRzr-.mjs +180 -0
- package/dist/configWriter-DCASRzr-.mjs.map +1 -0
- package/dist/configWriter-DGO0gmXo.cjs +218 -0
- package/dist/configWriter-DGO0gmXo.cjs.map +1 -0
- package/dist/configWriter.cjs +7 -4
- package/dist/configWriter.d.mts +2 -2
- package/dist/configWriter.mjs +1 -2
- package/dist/core-B0Qg0Qq2.cjs +224 -0
- package/dist/core-B0Qg0Qq2.cjs.map +1 -0
- package/dist/core-DKWW9gkh.mjs +139 -0
- package/dist/core-DKWW9gkh.mjs.map +1 -0
- package/dist/{domains-DGCb7uMC.cjs → domains-CiDUsRiX.cjs} +473 -171
- package/dist/domains-CiDUsRiX.cjs.map +1 -0
- package/dist/{domains-BroCVHrS.mjs → domains-IlieGHaY.mjs} +437 -170
- package/dist/domains-IlieGHaY.mjs.map +1 -0
- package/dist/domains.cjs +9 -3
- package/dist/domains.d.mts +3 -3
- package/dist/domains.mjs +3 -3
- package/dist/extensions/mcp-ui.mjs +1 -1
- package/dist/extensions/mcp-ui.mjs.map +1 -1
- package/dist/extensions/mcp.cjs +3 -3
- package/dist/extensions/mcp.cjs.map +1 -1
- package/dist/extensions/mcp.d.mts +1 -1
- package/dist/extensions/mcp.mjs +2 -2
- package/dist/extensions/mcp.mjs.map +1 -1
- package/dist/extensions/server.cjs +55 -47
- package/dist/extensions/server.cjs.map +1 -1
- package/dist/extensions/server.d.mts +2 -2
- package/dist/extensions/server.d.mts.map +1 -1
- package/dist/extensions/server.mjs +56 -48
- package/dist/extensions/server.mjs.map +1 -1
- package/dist/{harnessState-Dn_S7fB9.mjs → harnessState-8lZda_8r.mjs} +2 -2
- package/dist/{harnessState-Dn_S7fB9.mjs.map → harnessState-8lZda_8r.mjs.map} +1 -1
- package/dist/{harnessState-CCyBeutB.cjs → harnessState-BrmH0lG5.cjs} +2 -2
- package/dist/{harnessState-CCyBeutB.cjs.map → harnessState-BrmH0lG5.cjs.map} +1 -1
- package/dist/harnessState.cjs +1 -1
- package/dist/harnessState.d.mts +1 -1
- package/dist/harnessState.mjs +1 -2
- package/dist/{harnessStore-CJSxdSkV.cjs → harnessStore-BinxGITh.cjs} +189 -81
- package/dist/harnessStore-BinxGITh.cjs.map +1 -0
- package/dist/{harnessStore-CltwLB7M.mjs → harnessStore-w8zHmJ_H.mjs} +160 -82
- package/dist/harnessStore-w8zHmJ_H.mjs.map +1 -0
- package/dist/harnessStore.cjs +6 -1
- package/dist/harnessStore.d.mts +2 -2
- package/dist/harnessStore.mjs +1 -2
- package/dist/index-7RuIAWX1.d.mts +63 -0
- package/dist/index-7RuIAWX1.d.mts.map +1 -0
- package/dist/{index-CkDDvVQt.d.mts → index-BNcG0voG.d.mts} +61 -16
- package/dist/index-BNcG0voG.d.mts.map +1 -0
- package/dist/{index-Dy_-m7gx.d.mts → index-BTOU4XiI.d.mts} +3 -3
- package/dist/{index-Dy_-m7gx.d.mts.map → index-BTOU4XiI.d.mts.map} +1 -1
- package/dist/index-COokUToB.d.mts +83 -0
- package/dist/index-COokUToB.d.mts.map +1 -0
- package/dist/index-D3vGEYup.d.mts +135 -0
- package/dist/index-D3vGEYup.d.mts.map +1 -0
- package/dist/{index-Ch7ptOkW.d.mts → index-DNEK9W6n.d.mts} +26 -16
- package/dist/index-DNEK9W6n.d.mts.map +1 -0
- package/dist/index-D_OtYtsl.d.mts +37 -0
- package/dist/index-D_OtYtsl.d.mts.map +1 -0
- package/dist/{index-DNk4q0Qm.d.mts → index-Nbj2iQWw.d.mts} +19 -25
- package/dist/index-Nbj2iQWw.d.mts.map +1 -0
- package/dist/{index-CEUc7m16.d.mts → index-dYgF03lE.d.mts} +82 -32
- package/dist/index-dYgF03lE.d.mts.map +1 -0
- package/dist/index-fTuf8tVH.d.mts +34 -0
- package/dist/index-fTuf8tVH.d.mts.map +1 -0
- package/dist/index-nVcEC1jO.d.mts +62 -0
- package/dist/index-nVcEC1jO.d.mts.map +1 -0
- package/dist/index.cjs +81 -59
- package/dist/index.d.mts +16 -15
- package/dist/index.mjs +17 -15
- package/dist/{init-Cd3Ki6Ub.cjs → init-BdZ-gqqk.cjs} +209 -59
- package/dist/init-BdZ-gqqk.cjs.map +1 -0
- package/dist/{init-DVzhiCUE.mjs → init-DG7MxGxC.mjs} +187 -48
- package/dist/init-DG7MxGxC.mjs.map +1 -0
- package/dist/init.cjs +8 -6
- package/dist/init.d.mts +2 -2
- package/dist/init.mjs +1 -2
- package/dist/layeredConfig-BbkoIEfM.mjs +95 -0
- package/dist/layeredConfig-BbkoIEfM.mjs.map +1 -0
- package/dist/layeredConfig-Bs18dXQG.cjs +127 -0
- package/dist/layeredConfig-Bs18dXQG.cjs.map +1 -0
- package/dist/layeredConfig.cjs +5 -4
- package/dist/layeredConfig.d.mts +7 -2
- package/dist/layeredConfig.d.mts.map +1 -0
- package/dist/layeredConfig.mjs +1 -2
- package/dist/{majorModes-D1Itd8SN.mjs → majorModes-B8Km83e1.mjs} +130 -23
- package/dist/majorModes-B8Km83e1.mjs.map +1 -0
- package/dist/{majorModes-DnNSH9ZK.cjs → majorModes-CLccNMZt.cjs} +147 -22
- package/dist/majorModes-CLccNMZt.cjs.map +1 -0
- package/dist/majorModes.cjs +4 -1
- package/dist/majorModes.d.mts +2 -2
- package/dist/majorModes.mjs +1 -2
- package/dist/{piConfig-qGyCbcVj.mjs → piConfig-Bq36PQFF.mjs} +104 -69
- package/dist/piConfig-Bq36PQFF.mjs.map +1 -0
- package/dist/{piConfig-Bx26HMb_.d.mts → piConfig-C9rGUqPe.d.mts} +3 -3
- package/dist/{piConfig-Bx26HMb_.d.mts.map → piConfig-C9rGUqPe.d.mts.map} +1 -1
- package/dist/{piConfig-CCBdZXQr.cjs → piConfig-cluCie5i.cjs} +122 -70
- package/dist/piConfig-cluCie5i.cjs.map +1 -0
- package/dist/piConfig.cjs +4 -1
- package/dist/piConfig.d.mts +2 -2
- package/dist/piConfig.mjs +1 -2
- package/dist/piContext.cjs +27 -16
- package/dist/piContext.d.mts +3 -3
- package/dist/piContext.mjs +1 -2
- package/dist/{profiles-DBcYg5nA.mjs → profiles-CHict0x-.mjs} +322 -101
- package/dist/profiles-CHict0x-.mjs.map +1 -0
- package/dist/{profiles-tpplXY4r.cjs → profiles-t2EUj0aB.cjs} +359 -102
- package/dist/profiles-t2EUj0aB.cjs.map +1 -0
- package/dist/profiles.cjs +7 -1
- package/dist/profiles.d.mts +27 -3
- package/dist/profiles.d.mts.map +1 -1
- package/dist/profiles.mjs +1 -2
- package/dist/selectionSwitch.cjs +88 -22
- package/dist/selectionSwitch.cjs.map +1 -1
- package/dist/selectionSwitch.d.mts +40 -18
- package/dist/selectionSwitch.d.mts.map +1 -1
- package/dist/selectionSwitch.mjs +85 -22
- package/dist/selectionSwitch.mjs.map +1 -1
- package/dist/{sessionConfig-DV5xTRRw.mjs → sessionConfig-DFQF618G.mjs} +48 -47
- package/dist/sessionConfig-DFQF618G.mjs.map +1 -0
- package/dist/{sessionConfig-Bf6xHWLd.cjs → sessionConfig-DeP6pplT.cjs} +74 -85
- package/dist/sessionConfig-DeP6pplT.cjs.map +1 -0
- package/dist/sync-BJ8gCP9s.mjs +29 -0
- package/dist/sync-BJ8gCP9s.mjs.map +1 -0
- package/dist/sync-CC_15kkB.d.mts +46 -0
- package/dist/sync-CC_15kkB.d.mts.map +1 -0
- package/dist/sync-Dlxz2msM.cjs +37 -0
- package/dist/sync-Dlxz2msM.cjs.map +1 -0
- package/dist/types.cjs +2 -2
- package/dist/types.d.mts +2 -2
- package/dist/types.mjs +1 -2
- package/llms.txt +1 -1
- package/package.json +16 -16
- package/src/prompts/po-author-config/SKILL.md +4 -4
- package/src/prompts/po-author-config/agents/openai.yaml +1 -1
- package/src/prompts/po-author-config/references/config-contract.md +5 -5
- package/dist/atomicJson-1W0WhuFF.mjs +0 -44
- package/dist/atomicJson-1W0WhuFF.mjs.map +0 -1
- package/dist/atomicJson-Dt2z_DXl.cjs +0 -52
- package/dist/atomicJson-Dt2z_DXl.cjs.map +0 -1
- package/dist/config-CfTb0_9G.cjs +0 -219
- package/dist/config-CfTb0_9G.cjs.map +0 -1
- package/dist/config-D2HbBLzo.d.mts.map +0 -1
- package/dist/config-DoQWSt1V.mjs +0 -162
- package/dist/config-DoQWSt1V.mjs.map +0 -1
- package/dist/config-NSHRd6na.mjs +0 -2
- package/dist/configPolicy-Ce1QKDxa.cjs.map +0 -1
- package/dist/configPolicy-DCQgF5-f.mjs.map +0 -1
- package/dist/configWriter-B7uO8MuN.cjs +0 -150
- package/dist/configWriter-B7uO8MuN.cjs.map +0 -1
- package/dist/configWriter-DUtLgOlD.mjs +0 -130
- package/dist/configWriter-DUtLgOlD.mjs.map +0 -1
- package/dist/domains-BroCVHrS.mjs.map +0 -1
- package/dist/domains-DGCb7uMC.cjs.map +0 -1
- package/dist/harnessStore-CJSxdSkV.cjs.map +0 -1
- package/dist/harnessStore-CltwLB7M.mjs.map +0 -1
- package/dist/index-78zvoS9s.d.mts +0 -35
- package/dist/index-78zvoS9s.d.mts.map +0 -1
- package/dist/index-BT29GZx5.d.mts.map +0 -1
- package/dist/index-C6GaYjq-.d.mts +0 -6
- package/dist/index-C6GaYjq-.d.mts.map +0 -1
- package/dist/index-CEUc7m16.d.mts.map +0 -1
- package/dist/index-CRcoVYXz.d.mts +0 -39
- package/dist/index-CRcoVYXz.d.mts.map +0 -1
- package/dist/index-CVlciCJF.d.mts +0 -40
- package/dist/index-CVlciCJF.d.mts.map +0 -1
- package/dist/index-Ch7ptOkW.d.mts.map +0 -1
- package/dist/index-CkDDvVQt.d.mts.map +0 -1
- package/dist/index-Cvdt-Y-i.d.mts +0 -66
- package/dist/index-Cvdt-Y-i.d.mts.map +0 -1
- package/dist/index-DNk4q0Qm.d.mts.map +0 -1
- package/dist/index-DdH0w56b.d.mts +0 -116
- package/dist/index-DdH0w56b.d.mts.map +0 -1
- package/dist/init-Cd3Ki6Ub.cjs.map +0 -1
- package/dist/init-DVzhiCUE.mjs.map +0 -1
- package/dist/layeredConfig-fukqN2EA.mjs +0 -67
- package/dist/layeredConfig-fukqN2EA.mjs.map +0 -1
- package/dist/layeredConfig-ol0274TN.cjs +0 -94
- package/dist/layeredConfig-ol0274TN.cjs.map +0 -1
- package/dist/majorModes-D1Itd8SN.mjs.map +0 -1
- package/dist/majorModes-DnNSH9ZK.cjs.map +0 -1
- package/dist/piConfig-CCBdZXQr.cjs.map +0 -1
- package/dist/piConfig-qGyCbcVj.mjs.map +0 -1
- package/dist/profiles-DBcYg5nA.mjs.map +0 -1
- package/dist/profiles-tpplXY4r.cjs.map +0 -1
- package/dist/sessionConfig-Bf6xHWLd.cjs.map +0 -1
- package/dist/sessionConfig-DV5xTRRw.mjs.map +0 -1
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
|
|
2
|
+
const require_core = require("./core-B0Qg0Qq2.cjs");
|
|
3
|
+
let _agimon_ai_po_core_platform = require("@agimon-ai/po-core/platform");
|
|
4
|
+
let node_fs = require("node:fs");
|
|
5
|
+
node_fs = require_rolldown_runtime.__toESM(node_fs, 1);
|
|
6
|
+
//#region src/services/config/sync.ts
|
|
7
|
+
function readTextSync(filePath) {
|
|
8
|
+
if (filePath === void 0) return void 0;
|
|
9
|
+
try {
|
|
10
|
+
return node_fs.default.readFileSync(filePath, "utf8");
|
|
11
|
+
} catch (error) {
|
|
12
|
+
if (error.code === "ENOENT") return void 0;
|
|
13
|
+
throw error;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
async function readText$1(filePath) {
|
|
17
|
+
try {
|
|
18
|
+
return await node_fs.default.promises.readFile(filePath, "utf8");
|
|
19
|
+
} catch (error) {
|
|
20
|
+
if (error.code === "ENOENT") return void 0;
|
|
21
|
+
throw error;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/** @deprecated Node-only sync shim; use readPoConfig. Removed in M2. */
|
|
25
|
+
function loadPoConfig(repoRoot, homeDirectory = _agimon_ai_po_core_platform.nodeHost.homeDirectory(), environment = process.env) {
|
|
26
|
+
const globalPath = require_core.globalPoConfigPath(homeDirectory);
|
|
27
|
+
const repositoryPath = require_core.repositoryConfigFor(repoRoot, homeDirectory);
|
|
28
|
+
return require_core.mergeConfigLayers(require_core.configFromText(readTextSync(globalPath), globalPath), repositoryPath === void 0 ? require_core.defaultPoConfig() : require_core.configFromText(readTextSync(repositoryPath), repositoryPath), environment);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Loads the merged config, tolerating unknown keys in either file.
|
|
32
|
+
*
|
|
33
|
+
* Only `po sync` uses this. Everything that runs during a session keeps
|
|
34
|
+
* `loadPoConfig`, because a key a running extension cannot understand is
|
|
35
|
+
* better reported than silently ignored; a build that refuses to start over
|
|
36
|
+
* the same key is not.
|
|
37
|
+
*
|
|
38
|
+
* @deprecated Node-only sync shim; use readPoConfigLenient. Removed in M2.
|
|
39
|
+
*/
|
|
40
|
+
function loadPoConfigLenient(repoRoot, homeDirectory = _agimon_ai_po_core_platform.nodeHost.homeDirectory(), environment = process.env) {
|
|
41
|
+
const globalPath = require_core.globalPoConfigPath(homeDirectory);
|
|
42
|
+
const repositoryPath = require_core.repositoryConfigFor(repoRoot, homeDirectory);
|
|
43
|
+
return require_core.mergeLenientLayers(require_core.lenientConfigFromText(readTextSync(globalPath), globalPath), require_core.lenientConfigFromText(readTextSync(repositoryPath), repositoryPath ?? ""), environment);
|
|
44
|
+
}
|
|
45
|
+
/** @deprecated Node-only shim over node:fs; use readPoConfig. Removed in M2. */
|
|
46
|
+
async function loadPoConfigAsync(repoRoot, homeDirectory = _agimon_ai_po_core_platform.nodeHost.homeDirectory(), environment = process.env) {
|
|
47
|
+
const globalPath = require_core.globalPoConfigPath(homeDirectory);
|
|
48
|
+
const repositoryPath = require_core.repositoryConfigFor(repoRoot, homeDirectory);
|
|
49
|
+
const globalConfig = require_core.configFromText(await readText$1(globalPath), globalPath);
|
|
50
|
+
const repositoryConfig = repositoryPath === void 0 ? require_core.defaultPoConfig() : require_core.configFromText(await readText$1(repositoryPath), repositoryPath);
|
|
51
|
+
return require_core.mergeConfigLayers(globalConfig, repositoryConfig, environment);
|
|
52
|
+
}
|
|
53
|
+
/** @deprecated Node-only sync shim; use readPoConfigLayers. Removed in M2. */
|
|
54
|
+
function loadPoConfigLayers(repoRoot, homeDirectory = _agimon_ai_po_core_platform.nodeHost.homeDirectory(), environment = process.env) {
|
|
55
|
+
const globalPath = require_core.globalPoConfigPath(homeDirectory);
|
|
56
|
+
const repositoryPath = repoRoot === void 0 ? void 0 : require_core.repositoryConfigFor(repoRoot, homeDirectory);
|
|
57
|
+
const globalText = readTextSync(globalPath);
|
|
58
|
+
const repositoryText = readTextSync(repositoryPath);
|
|
59
|
+
const repositoryConfig = repositoryPath === void 0 ? require_core.defaultPoConfig() : require_core.configFromText(repositoryText, repositoryPath);
|
|
60
|
+
return require_core.composeConfigLayers(require_core.layerFromText(globalPath, globalText), repositoryPath === void 0 ? require_core.absentRepositoryLayer() : require_core.layerFromText(repositoryPath, repositoryText), require_core.mergeConfigLayers(require_core.configFromText(globalText, globalPath), repositoryConfig, environment));
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region src/services/config/index.ts
|
|
64
|
+
function resolved(options) {
|
|
65
|
+
return {
|
|
66
|
+
homeDirectory: options.homeDirectory ?? _agimon_ai_po_core_platform.nodeHost.homeDirectory(),
|
|
67
|
+
environment: options.environment ?? process.env
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
const readText = (fs, filePath, context) => filePath === void 0 ? Promise.resolve(void 0) : (0, _agimon_ai_po_core_platform.readTextIfExists)(fs, filePath, context);
|
|
71
|
+
/**
|
|
72
|
+
* Loads the merged global and repository config over a FileSystem. A missing
|
|
73
|
+
* file contributes the defaults, so a host with neither file, such as a fresh
|
|
74
|
+
* Durable Object filesystem, reads the same config as an empty Node home.
|
|
75
|
+
*/
|
|
76
|
+
async function readPoConfig(fs, repoRoot, context, options = {}) {
|
|
77
|
+
const { homeDirectory, environment } = resolved(options);
|
|
78
|
+
const globalPath = require_core.globalPoConfigPath(homeDirectory);
|
|
79
|
+
const repositoryPath = require_core.repositoryConfigFor(repoRoot, homeDirectory);
|
|
80
|
+
const globalConfig = require_core.configFromText(await readText(fs, globalPath, context), globalPath);
|
|
81
|
+
const repositoryConfig = repositoryPath === void 0 ? require_core.defaultPoConfig() : require_core.configFromText(await readText(fs, repositoryPath, context), repositoryPath);
|
|
82
|
+
return require_core.mergeConfigLayers(globalConfig, repositoryConfig, environment);
|
|
83
|
+
}
|
|
84
|
+
/** As `readPoConfig`, tolerating unknown keys in either file and reporting them. */
|
|
85
|
+
async function readPoConfigLenient(fs, repoRoot, context, options = {}) {
|
|
86
|
+
const { homeDirectory, environment } = resolved(options);
|
|
87
|
+
const globalPath = require_core.globalPoConfigPath(homeDirectory);
|
|
88
|
+
const repositoryPath = require_core.repositoryConfigFor(repoRoot, homeDirectory);
|
|
89
|
+
const globalConfig = require_core.lenientConfigFromText(await readText(fs, globalPath, context), globalPath);
|
|
90
|
+
const repositoryConfig = repositoryPath === void 0 ? require_core.lenientConfigFromText(void 0, "") : require_core.lenientConfigFromText(await readText(fs, repositoryPath, context), repositoryPath);
|
|
91
|
+
return require_core.mergeLenientLayers(globalConfig, repositoryConfig, environment);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* The two config files kept apart, with the merge alongside them.
|
|
95
|
+
*
|
|
96
|
+
* `repoRoot` is optional because the global file is complete on its own: a
|
|
97
|
+
* settings surface with no repository in view still has settings to show.
|
|
98
|
+
*/
|
|
99
|
+
async function readPoConfigLayers(fs, repoRoot, context, options = {}) {
|
|
100
|
+
const { homeDirectory, environment } = resolved(options);
|
|
101
|
+
const globalPath = require_core.globalPoConfigPath(homeDirectory);
|
|
102
|
+
const repositoryPath = repoRoot === void 0 ? void 0 : require_core.repositoryConfigFor(repoRoot, homeDirectory);
|
|
103
|
+
const globalText = await readText(fs, globalPath, context);
|
|
104
|
+
const repositoryText = await readText(fs, repositoryPath, context);
|
|
105
|
+
const globalLayer = require_core.layerFromText(globalPath, globalText);
|
|
106
|
+
const repositoryLayer = repositoryPath === void 0 ? require_core.absentRepositoryLayer() : require_core.layerFromText(repositoryPath, repositoryText);
|
|
107
|
+
const repositoryConfig = repositoryPath === void 0 ? require_core.defaultPoConfig() : require_core.configFromText(repositoryText, repositoryPath);
|
|
108
|
+
const effective = require_core.mergeConfigLayers(require_core.configFromText(globalText, globalPath), repositoryConfig, environment);
|
|
109
|
+
return require_core.composeConfigLayers(globalLayer, repositoryLayer, effective);
|
|
110
|
+
}
|
|
111
|
+
//#endregion
|
|
112
|
+
Object.defineProperty(exports, "loadPoConfig", {
|
|
113
|
+
enumerable: true,
|
|
114
|
+
get: function() {
|
|
115
|
+
return loadPoConfig;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
Object.defineProperty(exports, "loadPoConfigAsync", {
|
|
119
|
+
enumerable: true,
|
|
120
|
+
get: function() {
|
|
121
|
+
return loadPoConfigAsync;
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
Object.defineProperty(exports, "loadPoConfigLayers", {
|
|
125
|
+
enumerable: true,
|
|
126
|
+
get: function() {
|
|
127
|
+
return loadPoConfigLayers;
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
Object.defineProperty(exports, "loadPoConfigLenient", {
|
|
131
|
+
enumerable: true,
|
|
132
|
+
get: function() {
|
|
133
|
+
return loadPoConfigLenient;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
Object.defineProperty(exports, "readPoConfig", {
|
|
137
|
+
enumerable: true,
|
|
138
|
+
get: function() {
|
|
139
|
+
return readPoConfig;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
Object.defineProperty(exports, "readPoConfigLayers", {
|
|
143
|
+
enumerable: true,
|
|
144
|
+
get: function() {
|
|
145
|
+
return readPoConfigLayers;
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
Object.defineProperty(exports, "readPoConfigLenient", {
|
|
149
|
+
enumerable: true,
|
|
150
|
+
get: function() {
|
|
151
|
+
return readPoConfigLenient;
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
//# sourceMappingURL=config-Cdybp9rT.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-Cdybp9rT.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":["import 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":";;;;;;AAkBA,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,UAAU,aAAa;CAClE,OAAOC,aAAAA,kBACLC,aAAAA,eAAe,aAAa,UAAU,GAAG,UAAU,GACnD,mBAAmB,KAAA,IAAYC,aAAAA,gBAAgB,IAAID,aAAAA,eAAe,aAAa,cAAc,GAAG,cAAc,GAC9G,WACF;AACF;;;;;;;;;;;AAYA,SAAgB,oBACd,UACA,gBAAgBJ,4BAAAA,SAAS,cAAc,GACvC,cAAiC,QAAQ,KACrB;CACpB,MAAM,aAAaC,aAAAA,mBAAmB,aAAa;CACnD,MAAM,iBAAiBC,aAAAA,oBAAoB,UAAU,aAAa;CAClE,OAAOI,aAAAA,mBACLC,aAAAA,sBAAsB,aAAa,UAAU,GAAG,UAAU,GAC1DA,aAAAA,sBAAsB,aAAa,cAAc,GAAG,kBAAkB,EAAE,GACxE,WACF;AACF;;AAGA,eAAsB,kBACpB,UACA,gBAAgBP,4BAAAA,SAAS,cAAc,G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xD,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"}
|
|
@@ -0,0 +1,112 @@
|
|
|
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-DKWW9gkh.mjs";
|
|
2
|
+
import { nodeHost, readTextIfExists } from "@agimon-ai/po-core/platform";
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
//#region src/services/config/sync.ts
|
|
5
|
+
function readTextSync(filePath) {
|
|
6
|
+
if (filePath === void 0) return void 0;
|
|
7
|
+
try {
|
|
8
|
+
return fs.readFileSync(filePath, "utf8");
|
|
9
|
+
} catch (error) {
|
|
10
|
+
if (error.code === "ENOENT") return void 0;
|
|
11
|
+
throw error;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
async function readText$1(filePath) {
|
|
15
|
+
try {
|
|
16
|
+
return await fs.promises.readFile(filePath, "utf8");
|
|
17
|
+
} catch (error) {
|
|
18
|
+
if (error.code === "ENOENT") return void 0;
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/** @deprecated Node-only sync shim; use readPoConfig. Removed in M2. */
|
|
23
|
+
function loadPoConfig(repoRoot, homeDirectory = nodeHost.homeDirectory(), environment = process.env) {
|
|
24
|
+
const globalPath = globalPoConfigPath(homeDirectory);
|
|
25
|
+
const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);
|
|
26
|
+
return mergeConfigLayers(configFromText(readTextSync(globalPath), globalPath), repositoryPath === void 0 ? defaultPoConfig() : configFromText(readTextSync(repositoryPath), repositoryPath), environment);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Loads the merged config, tolerating unknown keys in either file.
|
|
30
|
+
*
|
|
31
|
+
* Only `po sync` uses this. Everything that runs during a session keeps
|
|
32
|
+
* `loadPoConfig`, because a key a running extension cannot understand is
|
|
33
|
+
* better reported than silently ignored; a build that refuses to start over
|
|
34
|
+
* the same key is not.
|
|
35
|
+
*
|
|
36
|
+
* @deprecated Node-only sync shim; use readPoConfigLenient. Removed in M2.
|
|
37
|
+
*/
|
|
38
|
+
function loadPoConfigLenient(repoRoot, homeDirectory = nodeHost.homeDirectory(), environment = process.env) {
|
|
39
|
+
const globalPath = globalPoConfigPath(homeDirectory);
|
|
40
|
+
const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);
|
|
41
|
+
return mergeLenientLayers(lenientConfigFromText(readTextSync(globalPath), globalPath), lenientConfigFromText(readTextSync(repositoryPath), repositoryPath ?? ""), environment);
|
|
42
|
+
}
|
|
43
|
+
/** @deprecated Node-only shim over node:fs; use readPoConfig. Removed in M2. */
|
|
44
|
+
async function loadPoConfigAsync(repoRoot, homeDirectory = nodeHost.homeDirectory(), environment = process.env) {
|
|
45
|
+
const globalPath = globalPoConfigPath(homeDirectory);
|
|
46
|
+
const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);
|
|
47
|
+
const globalConfig = configFromText(await readText$1(globalPath), globalPath);
|
|
48
|
+
const repositoryConfig = repositoryPath === void 0 ? defaultPoConfig() : configFromText(await readText$1(repositoryPath), repositoryPath);
|
|
49
|
+
return mergeConfigLayers(globalConfig, repositoryConfig, environment);
|
|
50
|
+
}
|
|
51
|
+
/** @deprecated Node-only sync shim; use readPoConfigLayers. Removed in M2. */
|
|
52
|
+
function loadPoConfigLayers(repoRoot, homeDirectory = nodeHost.homeDirectory(), environment = process.env) {
|
|
53
|
+
const globalPath = globalPoConfigPath(homeDirectory);
|
|
54
|
+
const repositoryPath = repoRoot === void 0 ? void 0 : repositoryConfigFor(repoRoot, homeDirectory);
|
|
55
|
+
const globalText = readTextSync(globalPath);
|
|
56
|
+
const repositoryText = readTextSync(repositoryPath);
|
|
57
|
+
const repositoryConfig = repositoryPath === void 0 ? defaultPoConfig() : configFromText(repositoryText, repositoryPath);
|
|
58
|
+
return composeConfigLayers(layerFromText(globalPath, globalText), repositoryPath === void 0 ? absentRepositoryLayer() : layerFromText(repositoryPath, repositoryText), mergeConfigLayers(configFromText(globalText, globalPath), repositoryConfig, environment));
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/services/config/index.ts
|
|
62
|
+
function resolved(options) {
|
|
63
|
+
return {
|
|
64
|
+
homeDirectory: options.homeDirectory ?? nodeHost.homeDirectory(),
|
|
65
|
+
environment: options.environment ?? process.env
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
const readText = (fs, filePath, context) => filePath === void 0 ? Promise.resolve(void 0) : readTextIfExists(fs, filePath, context);
|
|
69
|
+
/**
|
|
70
|
+
* Loads the merged global and repository config over a FileSystem. A missing
|
|
71
|
+
* file contributes the defaults, so a host with neither file, such as a fresh
|
|
72
|
+
* Durable Object filesystem, reads the same config as an empty Node home.
|
|
73
|
+
*/
|
|
74
|
+
async function readPoConfig(fs, repoRoot, context, options = {}) {
|
|
75
|
+
const { homeDirectory, environment } = resolved(options);
|
|
76
|
+
const globalPath = globalPoConfigPath(homeDirectory);
|
|
77
|
+
const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);
|
|
78
|
+
const globalConfig = configFromText(await readText(fs, globalPath, context), globalPath);
|
|
79
|
+
const repositoryConfig = repositoryPath === void 0 ? defaultPoConfig() : configFromText(await readText(fs, repositoryPath, context), repositoryPath);
|
|
80
|
+
return mergeConfigLayers(globalConfig, repositoryConfig, environment);
|
|
81
|
+
}
|
|
82
|
+
/** As `readPoConfig`, tolerating unknown keys in either file and reporting them. */
|
|
83
|
+
async function readPoConfigLenient(fs, repoRoot, context, options = {}) {
|
|
84
|
+
const { homeDirectory, environment } = resolved(options);
|
|
85
|
+
const globalPath = globalPoConfigPath(homeDirectory);
|
|
86
|
+
const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory);
|
|
87
|
+
const globalConfig = lenientConfigFromText(await readText(fs, globalPath, context), globalPath);
|
|
88
|
+
const repositoryConfig = repositoryPath === void 0 ? lenientConfigFromText(void 0, "") : lenientConfigFromText(await readText(fs, repositoryPath, context), repositoryPath);
|
|
89
|
+
return mergeLenientLayers(globalConfig, repositoryConfig, environment);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The two config files kept apart, with the merge alongside them.
|
|
93
|
+
*
|
|
94
|
+
* `repoRoot` is optional because the global file is complete on its own: a
|
|
95
|
+
* settings surface with no repository in view still has settings to show.
|
|
96
|
+
*/
|
|
97
|
+
async function readPoConfigLayers(fs, repoRoot, context, options = {}) {
|
|
98
|
+
const { homeDirectory, environment } = resolved(options);
|
|
99
|
+
const globalPath = globalPoConfigPath(homeDirectory);
|
|
100
|
+
const repositoryPath = repoRoot === void 0 ? void 0 : repositoryConfigFor(repoRoot, homeDirectory);
|
|
101
|
+
const globalText = await readText(fs, globalPath, context);
|
|
102
|
+
const repositoryText = await readText(fs, repositoryPath, context);
|
|
103
|
+
const globalLayer = layerFromText(globalPath, globalText);
|
|
104
|
+
const repositoryLayer = repositoryPath === void 0 ? absentRepositoryLayer() : layerFromText(repositoryPath, repositoryText);
|
|
105
|
+
const repositoryConfig = repositoryPath === void 0 ? defaultPoConfig() : configFromText(repositoryText, repositoryPath);
|
|
106
|
+
const effective = mergeConfigLayers(configFromText(globalText, globalPath), repositoryConfig, environment);
|
|
107
|
+
return composeConfigLayers(globalLayer, repositoryLayer, effective);
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
export { loadPoConfigAsync as a, loadPoConfig as i, readPoConfigLayers as n, loadPoConfigLayers as o, readPoConfigLenient as r, loadPoConfigLenient as s, readPoConfig as t };
|
|
111
|
+
|
|
112
|
+
//# sourceMappingURL=config-Cxc2xw54.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-Cxc2xw54.mjs","names":["readText"],"sources":["../src/services/config/sync.ts","../src/services/config/index.ts"],"sourcesContent":["import 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":";;;;AAkBA,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;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BAAsB,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,7 +1,7 @@
|
|
|
1
1
|
import { i as PersonaVoiceOverride, r as PersonaIdentity } from "./profiles-CTrUCmIh.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { DOOM_CONFIG_SERVICE, IDoomConfigService } from "@agimon-ai/po-core/config";
|
|
2
|
+
import { PoMcpProjection } from "@agimon-ai/po-core/mcpProjection";
|
|
4
3
|
import { PackageAttribution, PackageAttribution as PackageAttribution$1 } from "@agimon-ai/po-core/contextProjection";
|
|
4
|
+
import { IPoConfigService, PO_CONFIG_SERVICE } from "@agimon-ai/po-core/config";
|
|
5
5
|
//#region src/types/config.d.ts
|
|
6
6
|
type ProjectTrust = 'ask' | 'always' | 'never';
|
|
7
7
|
type PlanningThinkingLevel = 'off' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
|
|
@@ -149,13 +149,13 @@ interface ResolvedVoiceConfig {
|
|
|
149
149
|
* `pi` session starts on the same matrix the repository declares. The launcher
|
|
150
150
|
* keeps taking its selection from flags and the environment.
|
|
151
151
|
*/
|
|
152
|
-
interface
|
|
152
|
+
interface PoSelectionConfig {
|
|
153
153
|
majorMode?: string;
|
|
154
154
|
domains?: string[];
|
|
155
155
|
profile?: string;
|
|
156
156
|
}
|
|
157
157
|
/** The selection persisted in a Pi session entry. */
|
|
158
|
-
interface
|
|
158
|
+
interface PoConfigSelection {
|
|
159
159
|
readonly version: 1;
|
|
160
160
|
readonly majorMode: string;
|
|
161
161
|
readonly domains: readonly string[];
|
|
@@ -163,21 +163,21 @@ interface DoomConfigSelection {
|
|
|
163
163
|
/** Canonical identity of the parent/child extension composition. */
|
|
164
164
|
readonly compositionFingerprint?: string;
|
|
165
165
|
}
|
|
166
|
-
type
|
|
167
|
-
type
|
|
168
|
-
interface
|
|
166
|
+
type PoConfigTransitionStrategy = 'pi-reload' | 'process-relaunch';
|
|
167
|
+
type PoConfigTransitionPhase = 'pending' | 'applied' | 'aborted' | 'superseded';
|
|
168
|
+
interface PoConfigTransitionRecord {
|
|
169
169
|
readonly version: 1;
|
|
170
170
|
readonly operationId: string;
|
|
171
|
-
readonly active:
|
|
172
|
-
readonly target:
|
|
173
|
-
readonly strategy:
|
|
174
|
-
readonly phase:
|
|
171
|
+
readonly active: PoConfigSelection;
|
|
172
|
+
readonly target: PoConfigSelection;
|
|
173
|
+
readonly strategy: PoConfigTransitionStrategy;
|
|
174
|
+
readonly phase: PoConfigTransitionPhase;
|
|
175
175
|
}
|
|
176
176
|
/** A transition journal target that has not yet received an explicit fresh-session acknowledgement. */
|
|
177
|
-
type
|
|
177
|
+
type PoConfigPendingSelection = PoConfigTransitionRecord & {
|
|
178
178
|
readonly phase: 'pending';
|
|
179
179
|
};
|
|
180
|
-
interface
|
|
180
|
+
interface PoConfig {
|
|
181
181
|
modes?: {
|
|
182
182
|
planning?: PlanningModeConfig;
|
|
183
183
|
autocompact?: AutocompactModeConfig;
|
|
@@ -187,7 +187,7 @@ interface DoomConfig {
|
|
|
187
187
|
editor?: EditorConfig;
|
|
188
188
|
browse?: BrowseConfig;
|
|
189
189
|
voice?: VoiceConfig;
|
|
190
|
-
selection?:
|
|
190
|
+
selection?: PoSelectionConfig;
|
|
191
191
|
/** Default layout identifier, resolved against the available web template packages. */
|
|
192
192
|
web?: {
|
|
193
193
|
template?: string;
|
|
@@ -232,7 +232,7 @@ interface HarnessState {
|
|
|
232
232
|
pluginDirectories: string[];
|
|
233
233
|
pluginHooks: PluginHookSource[];
|
|
234
234
|
/** File-only authority that the Config core publishes to the session registry. */
|
|
235
|
-
mcpProjection?:
|
|
235
|
+
mcpProjection?: PoMcpProjection;
|
|
236
236
|
/** Generation-pinned hook descriptor, transported only through the state file. */
|
|
237
237
|
hookModules?: {
|
|
238
238
|
file: string;
|
|
@@ -253,30 +253,30 @@ interface HarnessState {
|
|
|
253
253
|
mcp: boolean;
|
|
254
254
|
}
|
|
255
255
|
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;
|
|
256
|
-
type
|
|
257
|
-
interface
|
|
258
|
-
readonly settings: DeepReadonly<
|
|
259
|
-
readonly harness:
|
|
256
|
+
type PoHarnessContext = DeepReadonly<HarnessState>;
|
|
257
|
+
interface PoConfigContext {
|
|
258
|
+
readonly settings: DeepReadonly<PoConfig>;
|
|
259
|
+
readonly harness: PoHarnessContext;
|
|
260
260
|
/** A journal target awaiting explicit acknowledgement; the active harness remains above. */
|
|
261
|
-
readonly pendingSelection?: DeepReadonly<
|
|
261
|
+
readonly pendingSelection?: DeepReadonly<PoConfigPendingSelection>;
|
|
262
262
|
/** Whether the active harness does not yet match the pending target. */
|
|
263
263
|
readonly requiresRelaunch: boolean;
|
|
264
264
|
}
|
|
265
265
|
/** A file-only loader; unlike the Cordis service it owns no live session snapshot. */
|
|
266
|
-
interface
|
|
267
|
-
load(repoRoot: string, homeDirectory?: string):
|
|
266
|
+
interface IPoConfigLoader {
|
|
267
|
+
load(repoRoot: string, homeDirectory?: string): PoConfig;
|
|
268
268
|
}
|
|
269
269
|
/** The config package's concrete specialization of the cross-package service contract. */
|
|
270
|
-
interface
|
|
270
|
+
interface IPoConfigService$1 extends IPoConfigService<PoConfigContext, PoConfig> {}
|
|
271
271
|
declare module '@deepseek-ai/cordis' {
|
|
272
272
|
interface Context {
|
|
273
|
-
'
|
|
273
|
+
'po/config': IPoConfigService$1;
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
/** Which file the effective value for a key came from, or that no file set it. */
|
|
277
277
|
type ConfigValueOrigin = 'global' | 'repository' | 'default';
|
|
278
278
|
/** One of the two config files, as a settings surface needs to see it. */
|
|
279
|
-
interface
|
|
279
|
+
interface PoConfigLayer {
|
|
280
280
|
filePath: string;
|
|
281
281
|
exists: boolean;
|
|
282
282
|
/**
|
|
@@ -291,16 +291,16 @@ interface DoomConfigLayer {
|
|
|
291
291
|
/**
|
|
292
292
|
* The two config files kept apart, alongside the merge every consumer sees.
|
|
293
293
|
*
|
|
294
|
-
* `
|
|
294
|
+
* `loadPoConfig` flattens global and repository into one object, which is all
|
|
295
295
|
* the runtime needs and not enough for a settings surface: a value that is set
|
|
296
296
|
* in both files looks identical to one set in neither, so an editor cannot say
|
|
297
297
|
* where a value came from, and offers a write that the merge may then ignore.
|
|
298
298
|
*/
|
|
299
|
-
interface
|
|
299
|
+
interface PoConfigLayers {
|
|
300
300
|
/** Named with the suffix because a bare `global` reads as the process global. */
|
|
301
|
-
globalFile:
|
|
302
|
-
repositoryFile:
|
|
303
|
-
effective:
|
|
301
|
+
globalFile: PoConfigLayer;
|
|
302
|
+
repositoryFile: PoConfigLayer;
|
|
303
|
+
effective: PoConfig;
|
|
304
304
|
/** Where the effective value at this key path came from. */
|
|
305
305
|
originOf(keyPath: readonly string[]): ConfigValueOrigin;
|
|
306
306
|
/** The effective value at this key path, or undefined when nothing set it. */
|
|
@@ -325,9 +325,9 @@ interface LenientParseOptions {
|
|
|
325
325
|
}
|
|
326
326
|
/** What a lenient parse returns in place of a bare config. */
|
|
327
327
|
interface LenientParseResult {
|
|
328
|
-
config:
|
|
328
|
+
config: PoConfig;
|
|
329
329
|
diagnostics: ConfigDiagnostic[];
|
|
330
330
|
}
|
|
331
331
|
//#endregion
|
|
332
|
-
export {
|
|
333
|
-
//# sourceMappingURL=config-
|
|
332
|
+
export { PoSelectionConfig as A, VoiceTtsConfig as B, PoConfigLayers as C, PoConfigTransitionRecord as D, PoConfigTransitionPhase as E, VoiceAutoCaptureConfig as F, 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, PlanningModeConfig as _, ConfigDiagnostic as a, PoConfig as b, EditorConfig as c, IPoConfigService$1 as d, LenientParseOptions as f, PlanningAgentConfig as g, PackageAttribution$1 as h, AutocompactTokenConfig as i, ProjectTrust as j, PoHarnessContext as k, HarnessState as l, PO_CONFIG_SERVICE as m, AutocompactOverrideConfig as n, ConfigValueOrigin as o, LenientParseResult as p, AutocompactThresholdConfig as r, DeepReadonly as s, AutocompactModeConfig as t, IPoConfigLoader as u, PlanningThinkingLevel as v, PoConfigPendingSelection as w, PoConfigContext as x, PluginHookSource as y, VoiceModelConfig as z };
|
|
333
|
+
//# sourceMappingURL=config-pxC7FyUJ.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-pxC7FyUJ.d.mts","names":["IPoConfigService","PoConfigServiceContract"],"sources":["../src/types/config.ts"],"mappings":";;;;;KAOY;KACA;KACA;KACA;KACA;UAEK;EACf;EAC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ClD,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"}
|
package/dist/config.cjs
CHANGED
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_configPolicy = require("./configPolicy-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
2
|
+
const require_configPolicy = require("./configPolicy-CowlLhK1.cjs");
|
|
3
|
+
const require_core = require("./core-B0Qg0Qq2.cjs");
|
|
4
|
+
const require_config = require("./config-Cdybp9rT.cjs");
|
|
5
|
+
exports.PO_PLANNING_THINKING_LEVELS = require_configPolicy.PO_PLANNING_THINKING_LEVELS;
|
|
6
|
+
exports.PO_VOICE_ENGINES = require_configPolicy.PO_VOICE_ENGINES;
|
|
7
|
+
exports.PO_VOICE_LIVE_VOICES = require_configPolicy.PO_VOICE_LIVE_VOICES;
|
|
8
|
+
exports.PO_VOICE_MODES = require_configPolicy.PO_VOICE_MODES;
|
|
9
|
+
exports.PO_VOICE_TTS_ENGINES = require_configPolicy.PO_VOICE_TTS_ENGINES;
|
|
9
10
|
exports.configLeafKeys = require_configPolicy.configLeafKeys;
|
|
10
11
|
exports.configRootKeys = require_configPolicy.configRootKeys;
|
|
11
12
|
exports.configScopeOf = require_configPolicy.configScopeOf;
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
15
|
-
exports.
|
|
16
|
-
exports.
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
13
|
+
exports.globalPoConfigDirectory = require_core.globalPoConfigDirectory;
|
|
14
|
+
exports.globalPoConfigPath = require_core.globalPoConfigPath;
|
|
15
|
+
exports.loadPoConfig = require_config.loadPoConfig;
|
|
16
|
+
exports.loadPoConfigAsync = require_config.loadPoConfigAsync;
|
|
17
|
+
exports.loadPoConfigLayers = require_config.loadPoConfigLayers;
|
|
18
|
+
exports.loadPoConfigLenient = require_config.loadPoConfigLenient;
|
|
19
|
+
exports.mergePoConfigs = require_configPolicy.mergePoConfigs;
|
|
19
20
|
exports.parseAutocompactModeConfig = require_configPolicy.parseAutocompactModeConfig;
|
|
20
|
-
exports.parseDoomConfig = require_configPolicy.parseDoomConfig;
|
|
21
21
|
exports.parsePlanningModeConfig = require_configPolicy.parsePlanningModeConfig;
|
|
22
|
-
exports.
|
|
23
|
-
exports.
|
|
22
|
+
exports.parsePoConfig = require_configPolicy.parsePoConfig;
|
|
23
|
+
exports.readPoConfig = require_config.readPoConfig;
|
|
24
|
+
exports.readPoConfigLayers = require_config.readPoConfigLayers;
|
|
25
|
+
exports.readPoConfigLenient = require_config.readPoConfigLenient;
|
|
26
|
+
exports.repositoryPoConfigPath = require_core.repositoryPoConfigPath;
|
|
27
|
+
exports.resolvePlanningPlansDirectory = require_core.resolvePlanningPlansDirectory;
|
|
24
28
|
exports.resolveVoiceConfig = require_configPolicy.resolveVoiceConfig;
|
|
25
29
|
exports.valueAtKeyPath = require_configPolicy.valueAtKeyPath;
|
package/dist/config.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as resolvePlanningPlansDirectory, S as
|
|
3
|
-
export { type ConfigDiagnostic, type ConfigKeyScope, type ConfigValueOrigin,
|
|
1
|
+
import { C as PoConfigLayers, S as PoConfigLayer, a as ConfigDiagnostic, f as LenientParseOptions, o as ConfigValueOrigin, p as LenientParseResult } from "./config-pxC7FyUJ.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-D3vGEYup.mjs";
|
|
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,3 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { a as
|
|
3
|
-
|
|
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-DueX0k6i.mjs";
|
|
2
|
+
import { a as globalPoConfigDirectory, m as resolvePlanningPlansDirectory, o as globalPoConfigPath, p as repositoryPoConfigPath } from "./core-DKWW9gkh.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-Cxc2xw54.mjs";
|
|
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 };
|