@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
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
const require_config = require("./config-
|
|
2
|
-
const require_harnessStore = require("./harnessStore-
|
|
1
|
+
const require_config = require("./config-Cdybp9rT.cjs");
|
|
2
|
+
const require_harnessStore = require("./harnessStore-BinxGITh.cjs");
|
|
3
3
|
require("./config-zZz80Mh5.cjs");
|
|
4
|
+
let _agimon_ai_po_core_platform = require("@agimon-ai/po-core/platform");
|
|
5
|
+
let _agimon_ai_po_core_contextProjection = require("@agimon-ai/po-core/contextProjection");
|
|
4
6
|
let _deepseek_ai_cordis = require("@deepseek-ai/cordis");
|
|
5
7
|
let _agimon_ai_po_core_config = require("@agimon-ai/po-core/config");
|
|
6
|
-
//#region src/services/
|
|
8
|
+
//#region src/services/poConfigService/index.ts
|
|
7
9
|
function deepFreeze$1(value) {
|
|
8
10
|
if (typeof value !== "object" || value === null || Object.isFrozen(value)) return value;
|
|
9
11
|
for (const child of Object.values(value)) deepFreeze$1(child);
|
|
10
12
|
return Object.freeze(value);
|
|
11
13
|
}
|
|
12
14
|
/**
|
|
13
|
-
*
|
|
15
|
+
* Po configuration published on the shared cordis Context.
|
|
14
16
|
*
|
|
15
17
|
* Every extension resolves the same instance by name, so configuration stays
|
|
16
18
|
* one read per session instead of one per consumer, and the registration is
|
|
17
19
|
* removed with the fiber that created it. The loader is injected so this stays
|
|
18
20
|
* free of filesystem access.
|
|
19
21
|
*/
|
|
20
|
-
var
|
|
22
|
+
var PoConfigService = class extends _deepseek_ai_cordis.Service {
|
|
21
23
|
loadConfig;
|
|
22
24
|
generation;
|
|
23
25
|
snapshot;
|
|
24
|
-
constructor(ctx, snapshot, loadConfig, generation = `
|
|
25
|
-
super(ctx, _agimon_ai_po_core_config.
|
|
26
|
+
constructor(ctx, snapshot, loadConfig, generation = `po-config:${crypto.randomUUID()}`) {
|
|
27
|
+
super(ctx, _agimon_ai_po_core_config.PO_CONFIG_SERVICE);
|
|
26
28
|
this.loadConfig = loadConfig;
|
|
27
29
|
this.snapshot = deepFreeze$1(snapshot);
|
|
28
30
|
this.generation = generation;
|
|
@@ -40,8 +42,6 @@ var DoomConfigService = class extends _deepseek_ai_cordis.Service {
|
|
|
40
42
|
};
|
|
41
43
|
//#endregion
|
|
42
44
|
//#region src/services/sessionConfig/index.ts
|
|
43
|
-
const DOOM_CONFIG_ENTRY_TYPE = "po:config:v1";
|
|
44
|
-
const DOOM_CONFIG_TRANSITION_ENTRY_TYPE = "po:transition:v1";
|
|
45
45
|
function isSelection(value) {
|
|
46
46
|
if (typeof value !== "object" || value === null) return false;
|
|
47
47
|
const selection = value;
|
|
@@ -50,7 +50,7 @@ function isSelection(value) {
|
|
|
50
50
|
function branchSelection(entries) {
|
|
51
51
|
for (let index = entries.length - 1; index >= 0; index -= 1) {
|
|
52
52
|
const entry = entries[index];
|
|
53
|
-
if (entry?.type === "custom" && entry.customType ===
|
|
53
|
+
if (entry?.type === "custom" && entry.customType === _agimon_ai_po_core_contextProjection.PO_CONFIG_ENTRY_TYPE && isSelection(entry.data)) return entry.data;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
function isTransitionStrategy(value) {
|
|
@@ -64,7 +64,7 @@ function isTransition(value) {
|
|
|
64
64
|
function branchTransition(entries) {
|
|
65
65
|
for (let index = entries.length - 1; index >= 0; index -= 1) {
|
|
66
66
|
const entry = entries[index];
|
|
67
|
-
if (entry?.type === "custom" && entry.customType ===
|
|
67
|
+
if (entry?.type === "custom" && entry.customType === _agimon_ai_po_core_contextProjection.PO_CONFIG_TRANSITION_ENTRY_TYPE && isTransition(entry.data)) return entry.data;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
function sameSelection(left, state) {
|
|
@@ -102,7 +102,7 @@ function deepFreeze(value) {
|
|
|
102
102
|
for (const child of Object.values(value)) deepFreeze(child);
|
|
103
103
|
return Object.freeze(value);
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function readPoConfigSelection(ctx) {
|
|
106
106
|
return branchSelection(ctx.sessionManager.getBranch());
|
|
107
107
|
}
|
|
108
108
|
function resolveContextState(ctx) {
|
|
@@ -121,26 +121,27 @@ function resolveBranchState(entries, bootstrap) {
|
|
|
121
121
|
root: bootstrap.root
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function createPoConfigContext(ctx) {
|
|
125
125
|
const { harness, pendingSelection, requiresRelaunch, root } = resolveContextState(ctx);
|
|
126
126
|
return deepFreeze({
|
|
127
|
-
settings: require_config.
|
|
127
|
+
settings: require_config.loadPoConfig(root ?? ctx.cwd),
|
|
128
128
|
harness,
|
|
129
129
|
pendingSelection,
|
|
130
130
|
requiresRelaunch
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
-
|
|
133
|
+
/** Reads the settings through the host's FileSystem, so it runs wherever the session does. */
|
|
134
|
+
async function createPoConfigContextAsync(ctx, fs, context = _agimon_ai_po_core_platform.BACKGROUND_CONTEXT) {
|
|
134
135
|
const { harness, pendingSelection, requiresRelaunch, root } = resolveContextState(ctx);
|
|
135
136
|
return deepFreeze({
|
|
136
|
-
settings: await require_config.
|
|
137
|
+
settings: await require_config.readPoConfig(fs, root ?? ctx.cwd, context),
|
|
137
138
|
harness,
|
|
138
139
|
pendingSelection,
|
|
139
140
|
requiresRelaunch
|
|
140
141
|
});
|
|
141
142
|
}
|
|
142
143
|
/** Initializes from this native session's branch, awaiting durable transition acknowledgement. */
|
|
143
|
-
async function
|
|
144
|
+
async function createNativePoConfigContext(execution, fs, context = _agimon_ai_po_core_platform.BACKGROUND_CONTEXT) {
|
|
144
145
|
const bootstrap = require_harnessStore.getSessionHarnessState(execution.sessionId);
|
|
145
146
|
const branch = (await execution.session.entries({ type: "custom" })).map((entry) => ({
|
|
146
147
|
type: String(entry.type),
|
|
@@ -153,27 +154,27 @@ async function createNativeDoomConfigContext(execution) {
|
|
|
153
154
|
...transition,
|
|
154
155
|
phase: "applied"
|
|
155
156
|
};
|
|
156
|
-
await execution.session.appendCustomEntry(
|
|
157
|
+
await execution.session.appendCustomEntry(_agimon_ai_po_core_contextProjection.PO_CONFIG_TRANSITION_ENTRY_TYPE, data);
|
|
157
158
|
branch.push({
|
|
158
159
|
type: "custom",
|
|
159
|
-
customType:
|
|
160
|
+
customType: _agimon_ai_po_core_contextProjection.PO_CONFIG_TRANSITION_ENTRY_TYPE,
|
|
160
161
|
data
|
|
161
162
|
});
|
|
162
163
|
}
|
|
163
164
|
const { harness, pendingSelection, requiresRelaunch, root } = resolveBranchState(branch, bootstrap);
|
|
164
165
|
return deepFreeze({
|
|
165
|
-
settings: await require_config.
|
|
166
|
+
settings: await require_config.readPoConfig(fs, root ?? execution.cwd, context, { environment: execution.environment }),
|
|
166
167
|
harness,
|
|
167
168
|
pendingSelection,
|
|
168
169
|
requiresRelaunch
|
|
169
170
|
});
|
|
170
171
|
}
|
|
171
|
-
function
|
|
172
|
-
pi.appendEntry(
|
|
172
|
+
function appendPoConfigSelection(pi, selection) {
|
|
173
|
+
pi.appendEntry(_agimon_ai_po_core_contextProjection.PO_CONFIG_ENTRY_TYPE, selection);
|
|
173
174
|
}
|
|
174
175
|
/** Journals the live selection, defaulting to whatever the harness store holds. */
|
|
175
176
|
function persistHarnessSelection(pi, state = require_harnessStore.getHarnessState()) {
|
|
176
|
-
|
|
177
|
+
appendPoConfigSelection(pi, {
|
|
177
178
|
version: 1,
|
|
178
179
|
majorMode: state.majorMode,
|
|
179
180
|
domains: state.domains,
|
|
@@ -181,26 +182,26 @@ function persistHarnessSelection(pi, state = require_harnessStore.getHarnessStat
|
|
|
181
182
|
compositionFingerprint: state.compositionFingerprint
|
|
182
183
|
});
|
|
183
184
|
}
|
|
184
|
-
function
|
|
185
|
-
pi.appendEntry(
|
|
185
|
+
function appendPoConfigTransition(pi, transition) {
|
|
186
|
+
pi.appendEntry(_agimon_ai_po_core_contextProjection.PO_CONFIG_TRANSITION_ENTRY_TYPE, transition);
|
|
186
187
|
}
|
|
187
|
-
function
|
|
188
|
-
pi.appendEntry(
|
|
188
|
+
function supersedePoConfigTransition(pi, transition) {
|
|
189
|
+
pi.appendEntry(_agimon_ai_po_core_contextProjection.PO_CONFIG_TRANSITION_ENTRY_TYPE, {
|
|
189
190
|
...transition,
|
|
190
191
|
phase: "superseded"
|
|
191
192
|
});
|
|
192
193
|
}
|
|
193
194
|
/** Acknowledges the latest pending transition from a fresh session that owns its exact target composition. */
|
|
194
|
-
function
|
|
195
|
+
function acknowledgePoConfigTransition(pi, ctx, harness) {
|
|
195
196
|
const transition = branchTransition(ctx.sessionManager.getBranch());
|
|
196
197
|
if (!transition || transition.phase !== "pending" || !isActiveTransitionTarget(transition.target, harness)) return false;
|
|
197
|
-
|
|
198
|
+
appendPoConfigTransition(pi, {
|
|
198
199
|
...transition,
|
|
199
200
|
phase: "applied"
|
|
200
201
|
});
|
|
201
202
|
return true;
|
|
202
203
|
}
|
|
203
|
-
function
|
|
204
|
+
function readPoConfigPendingSelection(ctx) {
|
|
204
205
|
const bootstrap = require_harnessStore.getSessionHarnessState(ctx.sessionManager.getSessionId());
|
|
205
206
|
const transition = branchTransition(ctx.sessionManager.getBranch());
|
|
206
207
|
const transitionPending = transition ? pendingFromTransition(transition) : void 0;
|
|
@@ -208,86 +209,74 @@ function readDoomConfigPendingSelection(ctx) {
|
|
|
208
209
|
const selection = branchSelection(ctx.sessionManager.getBranch());
|
|
209
210
|
return selection ? pendingFromLegacySelection(selection, bootstrap) : void 0;
|
|
210
211
|
}
|
|
211
|
-
function
|
|
212
|
-
return new
|
|
212
|
+
function providePoConfigContext(ctx, context, generation = `po-config:${crypto.randomUUID()}`) {
|
|
213
|
+
return new PoConfigService(ctx, deepFreeze(context), require_config.loadPoConfig, generation);
|
|
213
214
|
}
|
|
214
215
|
/** Returns the binding identity used to fence in-flight transitions. */
|
|
215
|
-
function
|
|
216
|
-
return
|
|
216
|
+
function readPoConfigContextGeneration(ctx) {
|
|
217
|
+
return readPoConfigService(ctx)?.generation;
|
|
217
218
|
}
|
|
218
219
|
/** Precomputes an immutable context before a transaction reaches publication. */
|
|
219
|
-
function
|
|
220
|
+
function freezePoConfigContext(context) {
|
|
220
221
|
return deepFreeze(context);
|
|
221
222
|
}
|
|
222
223
|
/** Replaces a live binding with a deeply frozen context after publication. */
|
|
223
|
-
function
|
|
224
|
+
function replacePoConfigContext(ctx, context) {
|
|
224
225
|
const next = deepFreeze(context);
|
|
225
|
-
return
|
|
226
|
+
return requirePoConfigService(ctx).replaceSnapshot(next);
|
|
226
227
|
}
|
|
227
|
-
function
|
|
228
|
-
return ctx.get(_agimon_ai_po_core_config.
|
|
228
|
+
function readPoConfigService(ctx) {
|
|
229
|
+
return ctx.get(_agimon_ai_po_core_config.PO_CONFIG_SERVICE);
|
|
229
230
|
}
|
|
230
|
-
function
|
|
231
|
-
const service =
|
|
232
|
-
if (!service) throw new Error("
|
|
231
|
+
function requirePoConfigService(ctx) {
|
|
232
|
+
const service = readPoConfigService(ctx);
|
|
233
|
+
if (!service) throw new Error("Po config service is unavailable. Load @agimon-ai/po-config/extensions/server.");
|
|
233
234
|
return service;
|
|
234
235
|
}
|
|
235
|
-
function
|
|
236
|
-
return
|
|
236
|
+
function requirePoConfigContext(ctx) {
|
|
237
|
+
return requirePoConfigService(ctx).getSnapshot();
|
|
237
238
|
}
|
|
238
239
|
//#endregion
|
|
239
|
-
Object.defineProperty(exports, "
|
|
240
|
+
Object.defineProperty(exports, "acknowledgePoConfigTransition", {
|
|
240
241
|
enumerable: true,
|
|
241
242
|
get: function() {
|
|
242
|
-
return
|
|
243
|
+
return acknowledgePoConfigTransition;
|
|
243
244
|
}
|
|
244
245
|
});
|
|
245
|
-
Object.defineProperty(exports, "
|
|
246
|
+
Object.defineProperty(exports, "appendPoConfigSelection", {
|
|
246
247
|
enumerable: true,
|
|
247
248
|
get: function() {
|
|
248
|
-
return
|
|
249
|
+
return appendPoConfigSelection;
|
|
249
250
|
}
|
|
250
251
|
});
|
|
251
|
-
Object.defineProperty(exports, "
|
|
252
|
+
Object.defineProperty(exports, "appendPoConfigTransition", {
|
|
252
253
|
enumerable: true,
|
|
253
254
|
get: function() {
|
|
254
|
-
return
|
|
255
|
+
return appendPoConfigTransition;
|
|
255
256
|
}
|
|
256
257
|
});
|
|
257
|
-
Object.defineProperty(exports, "
|
|
258
|
+
Object.defineProperty(exports, "createNativePoConfigContext", {
|
|
258
259
|
enumerable: true,
|
|
259
260
|
get: function() {
|
|
260
|
-
return
|
|
261
|
+
return createNativePoConfigContext;
|
|
261
262
|
}
|
|
262
263
|
});
|
|
263
|
-
Object.defineProperty(exports, "
|
|
264
|
+
Object.defineProperty(exports, "createPoConfigContext", {
|
|
264
265
|
enumerable: true,
|
|
265
266
|
get: function() {
|
|
266
|
-
return
|
|
267
|
+
return createPoConfigContext;
|
|
267
268
|
}
|
|
268
269
|
});
|
|
269
|
-
Object.defineProperty(exports, "
|
|
270
|
+
Object.defineProperty(exports, "createPoConfigContextAsync", {
|
|
270
271
|
enumerable: true,
|
|
271
272
|
get: function() {
|
|
272
|
-
return
|
|
273
|
+
return createPoConfigContextAsync;
|
|
273
274
|
}
|
|
274
275
|
});
|
|
275
|
-
Object.defineProperty(exports, "
|
|
276
|
+
Object.defineProperty(exports, "freezePoConfigContext", {
|
|
276
277
|
enumerable: true,
|
|
277
278
|
get: function() {
|
|
278
|
-
return
|
|
279
|
-
}
|
|
280
|
-
});
|
|
281
|
-
Object.defineProperty(exports, "createNativeDoomConfigContext", {
|
|
282
|
-
enumerable: true,
|
|
283
|
-
get: function() {
|
|
284
|
-
return createNativeDoomConfigContext;
|
|
285
|
-
}
|
|
286
|
-
});
|
|
287
|
-
Object.defineProperty(exports, "freezeDoomConfigContext", {
|
|
288
|
-
enumerable: true,
|
|
289
|
-
get: function() {
|
|
290
|
-
return freezeDoomConfigContext;
|
|
279
|
+
return freezePoConfigContext;
|
|
291
280
|
}
|
|
292
281
|
});
|
|
293
282
|
Object.defineProperty(exports, "persistHarnessSelection", {
|
|
@@ -296,47 +285,47 @@ Object.defineProperty(exports, "persistHarnessSelection", {
|
|
|
296
285
|
return persistHarnessSelection;
|
|
297
286
|
}
|
|
298
287
|
});
|
|
299
|
-
Object.defineProperty(exports, "
|
|
288
|
+
Object.defineProperty(exports, "providePoConfigContext", {
|
|
300
289
|
enumerable: true,
|
|
301
290
|
get: function() {
|
|
302
|
-
return
|
|
291
|
+
return providePoConfigContext;
|
|
303
292
|
}
|
|
304
293
|
});
|
|
305
|
-
Object.defineProperty(exports, "
|
|
294
|
+
Object.defineProperty(exports, "readPoConfigContextGeneration", {
|
|
306
295
|
enumerable: true,
|
|
307
296
|
get: function() {
|
|
308
|
-
return
|
|
297
|
+
return readPoConfigContextGeneration;
|
|
309
298
|
}
|
|
310
299
|
});
|
|
311
|
-
Object.defineProperty(exports, "
|
|
300
|
+
Object.defineProperty(exports, "readPoConfigPendingSelection", {
|
|
312
301
|
enumerable: true,
|
|
313
302
|
get: function() {
|
|
314
|
-
return
|
|
303
|
+
return readPoConfigPendingSelection;
|
|
315
304
|
}
|
|
316
305
|
});
|
|
317
|
-
Object.defineProperty(exports, "
|
|
306
|
+
Object.defineProperty(exports, "readPoConfigSelection", {
|
|
318
307
|
enumerable: true,
|
|
319
308
|
get: function() {
|
|
320
|
-
return
|
|
309
|
+
return readPoConfigSelection;
|
|
321
310
|
}
|
|
322
311
|
});
|
|
323
|
-
Object.defineProperty(exports, "
|
|
312
|
+
Object.defineProperty(exports, "replacePoConfigContext", {
|
|
324
313
|
enumerable: true,
|
|
325
314
|
get: function() {
|
|
326
|
-
return
|
|
315
|
+
return replacePoConfigContext;
|
|
327
316
|
}
|
|
328
317
|
});
|
|
329
|
-
Object.defineProperty(exports, "
|
|
318
|
+
Object.defineProperty(exports, "requirePoConfigContext", {
|
|
330
319
|
enumerable: true,
|
|
331
320
|
get: function() {
|
|
332
|
-
return
|
|
321
|
+
return requirePoConfigContext;
|
|
333
322
|
}
|
|
334
323
|
});
|
|
335
|
-
Object.defineProperty(exports, "
|
|
324
|
+
Object.defineProperty(exports, "supersedePoConfigTransition", {
|
|
336
325
|
enumerable: true,
|
|
337
326
|
get: function() {
|
|
338
|
-
return
|
|
327
|
+
return supersedePoConfigTransition;
|
|
339
328
|
}
|
|
340
329
|
});
|
|
341
330
|
|
|
342
|
-
//# sourceMappingURL=sessionConfig-
|
|
331
|
+
//# sourceMappingURL=sessionConfig-DeP6pplT.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessionConfig-DeP6pplT.cjs","names":["deepFreeze","Service","PO_CONFIG_SERVICE","PO_CONFIG_ENTRY_TYPE","PO_CONFIG_TRANSITION_ENTRY_TYPE","getSessionHarnessState","loadPoConfig","BACKGROUND_CONTEXT","readPoConfig","getHarnessState","PO_CONFIG_SERVICE"],"sources":["../src/services/poConfigService/index.ts","../src/services/sessionConfig/index.ts"],"sourcesContent":["import { type Context, Service } from '@deepseek-ai/cordis';\n\nimport {\n PO_CONFIG_SERVICE,\n type DeepReadonly,\n type PoConfig,\n type PoConfigContext,\n type PoConfigLoader,\n type IPoConfigService,\n} from '../../types/config';\n\nfunction deepFreeze<TValue>(value: TValue): DeepReadonly<TValue> {\n if (typeof value !== 'object' || value === null || Object.isFrozen(value)) {\n return value as DeepReadonly<TValue>;\n }\n for (const child of Object.values(value)) deepFreeze(child);\n return Object.freeze(value) as DeepReadonly<TValue>;\n}\n\n/**\n * Po configuration published on the shared cordis Context.\n *\n * Every extension resolves the same instance by name, so configuration stays\n * one read per session instead of one per consumer, and the registration is\n * removed with the fiber that created it. The loader is injected so this stays\n * free of filesystem access.\n */\nexport class PoConfigService extends Service implements IPoConfigService {\n readonly generation: string;\n private snapshot: PoConfigContext;\n\n constructor(\n ctx: Context,\n snapshot: PoConfigContext,\n private readonly loadConfig: PoConfigLoader,\n generation = `po-config:${crypto.randomUUID()}`,\n ) {\n super(ctx, PO_CONFIG_SERVICE);\n this.snapshot = deepFreeze(snapshot) as PoConfigContext;\n this.generation = generation;\n }\n\n getSnapshot(): PoConfigContext {\n return this.snapshot;\n }\n\n replaceSnapshot(context: PoConfigContext): PoConfigContext {\n this.snapshot = deepFreeze(context) as PoConfigContext;\n return this.snapshot;\n }\n\n load(repoRoot: string, homeDirectory?: string): PoConfig {\n return this.loadConfig(repoRoot, homeDirectory);\n }\n}\n","import { PO_CONFIG_ENTRY_TYPE, PO_CONFIG_TRANSITION_ENTRY_TYPE } from '@agimon-ai/po-core/contextProjection';\nimport type { PoHeadlessExecutionContext } from '@agimon-ai/po-core/headless';\nimport { BACKGROUND_CONTEXT, type FileSystem } from '@agimon-ai/po-core/platform';\nimport type { Context } from '@deepseek-ai/cordis';\nimport type { ExtensionAPI, ExtensionContext } from '@earendil-works/pi-coding-agent';\n\nimport type {\n PoConfigSelection as ConfigSelection,\n DeepReadonly,\n PoConfigContext,\n PoConfigPendingSelection,\n PoConfigTransitionRecord,\n PoConfigTransitionStrategy,\n HarnessState,\n IPoConfigService,\n} from '../../types/config';\nimport { PO_CONFIG_SERVICE } from '../../types/config';\nimport { loadPoConfig, readPoConfig } from '../config';\nimport { getHarnessState, getSessionHarnessState } from '../harnessStore';\nimport { PoConfigService } from '../poConfigService';\n\ntype IoContext = Parameters<FileSystem['readTextFile']>[1];\n\nexport { PO_CONFIG_ENTRY_TYPE, PO_CONFIG_TRANSITION_ENTRY_TYPE } from '@agimon-ai/po-core/contextProjection';\n\nexport type PoConfigSelection = ConfigSelection;\n\ntype PoConfigTransitionEntry = PoConfigTransitionRecord;\n\nfunction isSelection(value: unknown): value is PoConfigSelection {\n if (typeof value !== 'object' || value === null) return false;\n const selection = value as Partial<PoConfigSelection>;\n return (\n selection.version === 1 &&\n typeof selection.majorMode === 'string' &&\n Array.isArray(selection.domains) &&\n selection.domains.every((domain) => typeof domain === 'string') &&\n (selection.profile === undefined || typeof selection.profile === 'string') &&\n (selection.compositionFingerprint === undefined || typeof selection.compositionFingerprint === 'string')\n );\n}\n\nfunction branchSelection(\n entries: readonly { type: string; customType?: string; data?: unknown }[],\n): PoConfigSelection | undefined {\n for (let index = entries.length - 1; index >= 0; index -= 1) {\n const entry = entries[index];\n if (entry?.type === 'custom' && entry.customType === PO_CONFIG_ENTRY_TYPE && isSelection(entry.data)) {\n return entry.data;\n }\n }\n return undefined;\n}\n\nfunction isTransitionStrategy(value: unknown): value is PoConfigTransitionStrategy {\n return value === 'pi-reload' || value === 'process-relaunch';\n}\n\nfunction isTransition(value: unknown): value is PoConfigTransitionEntry {\n if (typeof value !== 'object' || value === null) return false;\n const transition = value as Partial<PoConfigTransitionEntry>;\n return (\n transition.version === 1 &&\n typeof transition.operationId === 'string' &&\n isSelection(transition.active) &&\n isSelection(transition.target) &&\n isTransitionStrategy(transition.strategy) &&\n (transition.phase === 'pending' ||\n transition.phase === 'applied' ||\n transition.phase === 'aborted' ||\n transition.phase === 'superseded')\n );\n}\n\nfunction branchTransition(\n entries: readonly { type: string; customType?: string; data?: unknown }[],\n): PoConfigTransitionEntry | undefined {\n for (let index = entries.length - 1; index >= 0; index -= 1) {\n const entry = entries[index];\n if (entry?.type === 'custom' && entry.customType === PO_CONFIG_TRANSITION_ENTRY_TYPE && isTransition(entry.data)) {\n return entry.data;\n }\n }\n return undefined;\n}\n\nfunction sameSelection(left: PoConfigSelection, state: HarnessState): boolean {\n return (\n left.majorMode === state.majorMode &&\n left.profile === state.profile &&\n (left.compositionFingerprint === undefined || left.compositionFingerprint === state.compositionFingerprint) &&\n left.domains.length === state.domains.length &&\n left.domains.every((domain, index) => domain === state.domains[index])\n );\n}\n\nfunction isActiveTransitionTarget(target: PoConfigSelection, state: HarnessState): boolean {\n return (\n target.compositionFingerprint !== undefined &&\n target.compositionFingerprint === state.compositionFingerprint &&\n sameSelection(target, state)\n );\n}\n\nfunction pendingFromTransition(transition: PoConfigTransitionEntry): PoConfigPendingSelection | undefined {\n if (transition.phase !== 'pending') return undefined;\n return { ...transition, phase: 'pending' };\n}\n\nfunction pendingFromLegacySelection(\n selection: PoConfigSelection,\n bootstrap: HarnessState,\n): PoConfigPendingSelection | undefined {\n if (sameSelection(selection, bootstrap)) return undefined;\n const active: PoConfigSelection = {\n version: 1,\n majorMode: bootstrap.majorMode,\n domains: [...bootstrap.domains],\n profile: bootstrap.profile,\n compositionFingerprint: bootstrap.compositionFingerprint,\n };\n return {\n version: 1,\n operationId: 'legacy-config-selection',\n active,\n target: selection,\n strategy: 'process-relaunch',\n phase: 'pending',\n };\n}\n\nfunction deepFreeze<TValue>(value: TValue): DeepReadonly<TValue> {\n if (typeof value !== 'object' || value === null || Object.isFrozen(value)) {\n return value as DeepReadonly<TValue>;\n }\n for (const child of Object.values(value)) deepFreeze(child);\n return Object.freeze(value) as DeepReadonly<TValue>;\n}\n\nexport function readPoConfigSelection(ctx: Pick<ExtensionContext, 'sessionManager'>): PoConfigSelection | undefined {\n return branchSelection(ctx.sessionManager.getBranch());\n}\n\nfunction resolveContextState(ctx: Pick<ExtensionContext, 'sessionManager'>): {\n harness: HarnessState;\n pendingSelection: PoConfigPendingSelection | undefined;\n requiresRelaunch: boolean;\n root: string | undefined;\n} {\n const bootstrap = getSessionHarnessState(ctx.sessionManager.getSessionId());\n return resolveBranchState(ctx.sessionManager.getBranch(), bootstrap);\n}\n\nfunction resolveBranchState(\n entries: readonly { type: string; customType?: string; data?: unknown }[],\n bootstrap: HarnessState,\n): {\n harness: HarnessState;\n pendingSelection: PoConfigPendingSelection | undefined;\n requiresRelaunch: boolean;\n root: string | undefined;\n} {\n const selection = branchSelection(entries);\n const transition = branchTransition(entries);\n const transitionPending = transition ? pendingFromTransition(transition) : undefined;\n const pendingSelection = transition\n ? transitionPending\n : selection\n ? pendingFromLegacySelection(selection, bootstrap)\n : undefined;\n return {\n harness: bootstrap,\n pendingSelection,\n requiresRelaunch:\n pendingSelection !== undefined &&\n (transitionPending === undefined || !isActiveTransitionTarget(pendingSelection.target, bootstrap)),\n root: bootstrap.root,\n };\n}\n\nexport function createPoConfigContext(ctx: Pick<ExtensionContext, 'cwd' | 'sessionManager'>): PoConfigContext {\n const { harness, pendingSelection, requiresRelaunch, root } = resolveContextState(ctx);\n return deepFreeze({ settings: loadPoConfig(root ?? ctx.cwd), harness, pendingSelection, requiresRelaunch });\n}\n\n/** Reads the settings through the host's FileSystem, so it runs wherever the session does. */\nexport async function createPoConfigContextAsync(\n ctx: Pick<ExtensionContext, 'cwd' | 'sessionManager'>,\n fs: FileSystem,\n context: IoContext = BACKGROUND_CONTEXT,\n): Promise<PoConfigContext> {\n const { harness, pendingSelection, requiresRelaunch, root } = resolveContextState(ctx);\n const settings = await readPoConfig(fs, root ?? ctx.cwd, context);\n return deepFreeze({ settings, harness, pendingSelection, requiresRelaunch });\n}\n\n/** Initializes from this native session's branch, awaiting durable transition acknowledgement. */\nexport async function createNativePoConfigContext(\n execution: PoHeadlessExecutionContext,\n fs: FileSystem,\n context: IoContext = BACKGROUND_CONTEXT,\n): Promise<PoConfigContext> {\n const bootstrap = getSessionHarnessState(execution.sessionId);\n const entries = await execution.session.entries({ type: 'custom' });\n const branch = entries.map((entry) => ({\n type: String(entry.type),\n customType: typeof entry.customType === 'string' ? entry.customType : undefined,\n data: entry.data,\n }));\n const transition = branchTransition(branch);\n if (transition?.phase === 'pending' && isActiveTransitionTarget(transition.target, bootstrap)) {\n const data = { ...transition, phase: 'applied' as const };\n await execution.session.appendCustomEntry(PO_CONFIG_TRANSITION_ENTRY_TYPE, data);\n branch.push({ type: 'custom', customType: PO_CONFIG_TRANSITION_ENTRY_TYPE, data });\n }\n const { harness, pendingSelection, requiresRelaunch, root } = resolveBranchState(branch, bootstrap);\n const settings = await readPoConfig(fs, root ?? execution.cwd, context, { environment: execution.environment });\n return deepFreeze({ settings, harness, pendingSelection, requiresRelaunch });\n}\n\nexport function appendPoConfigSelection(pi: Pick<ExtensionAPI, 'appendEntry'>, selection: PoConfigSelection): void {\n pi.appendEntry(PO_CONFIG_ENTRY_TYPE, selection);\n}\n\n/** Journals the live selection, defaulting to whatever the harness store holds. */\nexport function persistHarnessSelection(\n pi: Pick<ExtensionAPI, 'appendEntry'>,\n state: {\n readonly majorMode: string;\n readonly domains: readonly string[];\n readonly profile?: string;\n readonly compositionFingerprint?: string;\n } = getHarnessState(),\n): void {\n appendPoConfigSelection(pi, {\n version: 1,\n majorMode: state.majorMode,\n domains: state.domains,\n profile: state.profile,\n compositionFingerprint: state.compositionFingerprint,\n });\n}\n\nexport function appendPoConfigTransition(\n pi: Pick<ExtensionAPI, 'appendEntry'>,\n transition: PoConfigTransitionRecord,\n): void {\n pi.appendEntry(PO_CONFIG_TRANSITION_ENTRY_TYPE, transition);\n}\n\nexport function supersedePoConfigTransition(\n pi: Pick<ExtensionAPI, 'appendEntry'>,\n transition: PoConfigPendingSelection,\n): void {\n pi.appendEntry(PO_CONFIG_TRANSITION_ENTRY_TYPE, { ...transition, phase: 'superseded' });\n}\n\n/** Acknowledges the latest pending transition from a fresh session that owns its exact target composition. */\nexport function acknowledgePoConfigTransition(\n pi: Pick<ExtensionAPI, 'appendEntry'>,\n ctx: Pick<ExtensionContext, 'sessionManager'>,\n harness: HarnessState,\n): boolean {\n const transition = branchTransition(ctx.sessionManager.getBranch());\n if (!transition || transition.phase !== 'pending' || !isActiveTransitionTarget(transition.target, harness)) {\n return false;\n }\n appendPoConfigTransition(pi, { ...transition, phase: 'applied' });\n return true;\n}\n\nexport function readPoConfigPendingSelection(\n ctx: Pick<ExtensionContext, 'sessionManager'>,\n): PoConfigPendingSelection | undefined {\n const bootstrap = getSessionHarnessState(ctx.sessionManager.getSessionId());\n const transition = branchTransition(ctx.sessionManager.getBranch());\n const transitionPending = transition ? pendingFromTransition(transition) : undefined;\n if (transition) return transitionPending;\n const selection = branchSelection(ctx.sessionManager.getBranch());\n return selection ? pendingFromLegacySelection(selection, bootstrap) : undefined;\n}\n\nexport function providePoConfigContext(\n ctx: Context,\n context: PoConfigContext,\n generation = `po-config:${crypto.randomUUID()}`,\n): IPoConfigService {\n return new PoConfigService(ctx, deepFreeze(context) as PoConfigContext, loadPoConfig, generation);\n}\n\n/** Returns the binding identity used to fence in-flight transitions. */\nexport function readPoConfigContextGeneration(ctx: Context): string | undefined {\n return readPoConfigService(ctx)?.generation;\n}\n\n/** Precomputes an immutable context before a transaction reaches publication. */\nexport function freezePoConfigContext(context: PoConfigContext): PoConfigContext {\n return deepFreeze(context);\n}\n\n/** Replaces a live binding with a deeply frozen context after publication. */\nexport function replacePoConfigContext(ctx: Context, context: PoConfigContext): PoConfigContext {\n const next = deepFreeze(context);\n return requirePoConfigService(ctx).replaceSnapshot(next as PoConfigContext);\n}\n\nexport function readPoConfigService(ctx: Context): IPoConfigService | undefined {\n return ctx.get(PO_CONFIG_SERVICE) as IPoConfigService | undefined;\n}\n\nexport function requirePoConfigService(ctx: Context): IPoConfigService {\n const service = readPoConfigService(ctx);\n if (!service) throw new Error('Po config service is unavailable. Load @agimon-ai/po-config/extensions/server.');\n return service;\n}\n\nexport function requirePoConfigContext(ctx: Context): PoConfigContext {\n return requirePoConfigService(ctx).getSnapshot();\n}\n"],"mappings":";;;;;;;;AAWA,SAASA,aAAmB,OAAqC;CAC/D,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,OAAO,SAAS,KAAK,GACtE,OAAO;CAET,KAAK,MAAM,SAAS,OAAO,OAAO,KAAK,GAAG,aAAW,KAAK;CAC1D,OAAO,OAAO,OAAO,KAAK;AAC5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Dj3rlZbD.mjs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { randomUUID } from "node:crypto";
|
|
4
|
+
import fs from "node:fs";
|
|
5
|
+
//#region src/services/atomicJson/sync.ts
|
|
6
|
+
const TEMPORARY_SUFFIX = ".tmp";
|
|
7
|
+
/**
|
|
8
|
+
* Writes JSON readable by its owner only, replacing the target atomically.
|
|
9
|
+
*
|
|
10
|
+
* @deprecated Node-only sync shim; use writePrivateAtomicJsonAsync. Removed in M2.
|
|
11
|
+
*/
|
|
12
|
+
function writePrivateAtomicJson(filePath, value) {
|
|
13
|
+
fs.mkdirSync(path.dirname(filePath), {
|
|
14
|
+
mode: 448,
|
|
15
|
+
recursive: true
|
|
16
|
+
});
|
|
17
|
+
const temporaryPath = `${filePath}.${process.pid}.${randomUUID()}${TEMPORARY_SUFFIX}`;
|
|
18
|
+
try {
|
|
19
|
+
fs.writeFileSync(temporaryPath, serializePrivateJson(value), { mode: 384 });
|
|
20
|
+
fs.renameSync(temporaryPath, filePath);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
fs.rmSync(temporaryPath, { force: true });
|
|
23
|
+
throw error;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { writePrivateAtomicJson as t };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=sync-BJ8gCP9s.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-BJ8gCP9s.mjs","names":[],"sources":["../src/services/atomicJson/sync.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport { PRIVATE_DIRECTORY_MODE, PRIVATE_FILE_MODE, serializePrivateJson } from './format';\n\nconst TEMPORARY_SUFFIX = '.tmp';\n\n/**\n * Writes JSON readable by its owner only, replacing the target atomically.\n *\n * @deprecated Node-only sync shim; use writePrivateAtomicJsonAsync. Removed in M2.\n */\nexport function writePrivateAtomicJson(filePath: string, value: unknown): void {\n fs.mkdirSync(path.dirname(filePath), { mode: PRIVATE_DIRECTORY_MODE, recursive: true });\n const temporaryPath = `${filePath}.${process.pid}.${randomUUID()}${TEMPORARY_SUFFIX}`;\n try {\n fs.writeFileSync(temporaryPath, serializePrivateJson(value), { mode: PRIVATE_FILE_MODE });\n fs.renameSync(temporaryPath, filePath);\n } catch (error) {\n fs.rmSync(temporaryPath, { force: true });\n throw error;\n }\n}\n"],"mappings":";;;;;AAMA,MAAM,mBAAmB;;;;;;AAOzB,SAAgB,uBAAuB,UAAkB,OAAsB;CAC7E,GAAG,UAAU,KAAK,QAAQ,QAAQ,GAAG;EAAE,MAAA;EAA8B,WAAW;CAAK,CAAC;CACtF,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,IAAI,GAAG,WAAW,IAAI;CACnE,IAAI;EACF,GAAG,cAAc,eAAe,qBAAqB,KAAK,GAAG,EAAE,MAAA,IAAwB,CAAC;EACxF,GAAG,WAAW,eAAe,QAAQ;CACvC,SAAS,OAAO;EACd,GAAG,OAAO,eAAe,EAAE,OAAO,KAAK,CAAC;EACxC,MAAM;CACR;AACF"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { o as AgentProfile } from "./index-Nbj2iQWw.mjs";
|
|
2
|
+
//#region src/services/profiles/sync.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Loads profiles from the global and repository configs, repository last.
|
|
5
|
+
*
|
|
6
|
+
* Configured roots accumulate and inspect themselves or their direct-child
|
|
7
|
+
* directories for persona files. Later discoveries replace earlier names, and
|
|
8
|
+
* explicit entries replace discoveries. Legacy flat profile mappings remain
|
|
9
|
+
* accepted as explicit entries.
|
|
10
|
+
*
|
|
11
|
+
* @deprecated Node-only sync shim; use loadProfilesAsync. Removed in M2.
|
|
12
|
+
*/
|
|
13
|
+
declare function loadProfiles(repoRoot: string, homeDirectory?: string): AgentProfile[];
|
|
14
|
+
/**
|
|
15
|
+
* The profile catalog: every resolved profile, plus the name a launch starts on
|
|
16
|
+
* when the caller names none.
|
|
17
|
+
*
|
|
18
|
+
* `defaultProfile` mirrors `defaultMajorMode` in modes.yaml and `defaultDomains`
|
|
19
|
+
* in domains.yaml, so each selection axis declares its default in its own
|
|
20
|
+
* catalog. A repository declaration replaces a personal one. An unknown name is
|
|
21
|
+
* an error rather than a silent fallback: a typo that quietly starts the session
|
|
22
|
+
* with no persona is worse than a refused launch.
|
|
23
|
+
*
|
|
24
|
+
* @deprecated Node-only sync shim; use loadProfileCatalogAsync. Removed in M2.
|
|
25
|
+
*/
|
|
26
|
+
declare function loadProfileCatalog(repoRoot: string, homeDirectory?: string): {
|
|
27
|
+
profiles: AgentProfile[];
|
|
28
|
+
defaultProfile?: string;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Resolves one selected profile and fails clearly when its name is unknown.
|
|
32
|
+
*
|
|
33
|
+
* @deprecated Node-only sync shim; use resolveProfileAsync. Removed in M2.
|
|
34
|
+
*/
|
|
35
|
+
declare function resolveProfile(repoRoot: string, name: string, homeDirectory?: string): AgentProfile;
|
|
36
|
+
/** @deprecated Node-only sync shim; use listProfileNamesAsync. Removed in M2. */
|
|
37
|
+
declare function listProfileNames(repoRoot: string, homeDirectory?: string): string[];
|
|
38
|
+
/**
|
|
39
|
+
* Builds the persona system-prompt block, or undefined when nothing is readable.
|
|
40
|
+
*
|
|
41
|
+
* @deprecated Node-only sync shim; use buildPersonaPromptAsync. Removed in M2.
|
|
42
|
+
*/
|
|
43
|
+
declare function buildPersonaPrompt(personaRoot: string, personaDirectory: string): string | undefined;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { resolveProfile as a, loadProfiles as i, listProfileNames as n, loadProfileCatalog as r, buildPersonaPrompt as t };
|
|
46
|
+
//# sourceMappingURL=sync-CC_15kkB.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-CC_15kkB.d.mts","names":[],"sources":["../src/services/profiles/sync.ts"],"mappings":";;;;;;;;;;;;iBAkIgB,aAAa,kBAAkB,yBAAuC;;;;;;;;;;;;;iBAgBtE,mBACd,kBACA;EACG,UAAU;EAAgB;;;;;;;iBAYf,eAAe,kBAAkB,cAAc,yBAAyB;;iBAOxE,iBAAiB,kBAAkB;;;;;;iBA8BnC,mBAAmB,qBAAqB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
|
|
2
|
+
const require_atomicJson = require("./atomicJson-D3MHqnLW.cjs");
|
|
3
|
+
let node_path = require("node:path");
|
|
4
|
+
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
5
|
+
let node_crypto = require("node:crypto");
|
|
6
|
+
let node_fs = require("node:fs");
|
|
7
|
+
node_fs = require_rolldown_runtime.__toESM(node_fs, 1);
|
|
8
|
+
//#region src/services/atomicJson/sync.ts
|
|
9
|
+
const TEMPORARY_SUFFIX = ".tmp";
|
|
10
|
+
/**
|
|
11
|
+
* Writes JSON readable by its owner only, replacing the target atomically.
|
|
12
|
+
*
|
|
13
|
+
* @deprecated Node-only sync shim; use writePrivateAtomicJsonAsync. Removed in M2.
|
|
14
|
+
*/
|
|
15
|
+
function writePrivateAtomicJson(filePath, value) {
|
|
16
|
+
node_fs.default.mkdirSync(node_path.default.dirname(filePath), {
|
|
17
|
+
mode: 448,
|
|
18
|
+
recursive: true
|
|
19
|
+
});
|
|
20
|
+
const temporaryPath = `${filePath}.${process.pid}.${(0, node_crypto.randomUUID)()}${TEMPORARY_SUFFIX}`;
|
|
21
|
+
try {
|
|
22
|
+
node_fs.default.writeFileSync(temporaryPath, require_atomicJson.serializePrivateJson(value), { mode: 384 });
|
|
23
|
+
node_fs.default.renameSync(temporaryPath, filePath);
|
|
24
|
+
} catch (error) {
|
|
25
|
+
node_fs.default.rmSync(temporaryPath, { force: true });
|
|
26
|
+
throw error;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
Object.defineProperty(exports, "writePrivateAtomicJson", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function() {
|
|
33
|
+
return writePrivateAtomicJson;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=sync-Dlxz2msM.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-Dlxz2msM.cjs","names":["path","randomUUID","serializePrivateJson"],"sources":["../src/services/atomicJson/sync.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport { PRIVATE_DIRECTORY_MODE, PRIVATE_FILE_MODE, serializePrivateJson } from './format';\n\nconst TEMPORARY_SUFFIX = '.tmp';\n\n/**\n * Writes JSON readable by its owner only, replacing the target atomically.\n *\n * @deprecated Node-only sync shim; use writePrivateAtomicJsonAsync. Removed in M2.\n */\nexport function writePrivateAtomicJson(filePath: string, value: unknown): void {\n fs.mkdirSync(path.dirname(filePath), { mode: PRIVATE_DIRECTORY_MODE, recursive: true });\n const temporaryPath = `${filePath}.${process.pid}.${randomUUID()}${TEMPORARY_SUFFIX}`;\n try {\n fs.writeFileSync(temporaryPath, serializePrivateJson(value), { mode: PRIVATE_FILE_MODE });\n fs.renameSync(temporaryPath, filePath);\n } catch (error) {\n fs.rmSync(temporaryPath, { force: true });\n throw error;\n }\n}\n"],"mappings":";;;;;;;;AAMA,MAAM,mBAAmB;;;;;;AAOzB,SAAgB,uBAAuB,UAAkB,OAAsB;CAC7E,QAAA,QAAG,UAAUA,UAAAA,QAAK,QAAQ,QAAQ,GAAG;EAAE,MAAA;EAA8B,WAAW;CAAK,CAAC;CACtF,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,IAAI,IAAA,GAAGC,YAAAA,WAAAA,CAAW,IAAI;CACnE,IAAI;EACF,QAAA,QAAG,cAAc,eAAeC,mBAAAA,qBAAqB,KAAK,GAAG,EAAE,MAAA,IAAwB,CAAC;EACxF,QAAA,QAAG,WAAW,eAAe,QAAQ;CACvC,SAAS,OAAO;EACd,QAAA,QAAG,OAAO,eAAe,EAAE,OAAO,KAAK,CAAC;EACxC,MAAM;CACR;AACF"}
|
package/dist/types.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("./config-zZz80Mh5.cjs");
|
|
3
3
|
let _agimon_ai_po_core_config = require("@agimon-ai/po-core/config");
|
|
4
|
-
Object.defineProperty(exports, "
|
|
4
|
+
Object.defineProperty(exports, "PO_CONFIG_SERVICE", {
|
|
5
5
|
enumerable: true,
|
|
6
6
|
get: function() {
|
|
7
|
-
return _agimon_ai_po_core_config.
|
|
7
|
+
return _agimon_ai_po_core_config.PO_CONFIG_SERVICE;
|
|
8
8
|
}
|
|
9
9
|
});
|
package/dist/types.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { type AutocompactModeConfig, type AutocompactOverrideConfig, type AutocompactThresholdConfig, type AutocompactTokenConfig, type ConfigDiagnostic, type ConfigValueOrigin,
|
|
1
|
+
import { A as PoSelectionConfig, B as VoiceTtsConfig, C as PoConfigLayers, D as PoConfigTransitionRecord, E as PoConfigTransitionPhase, F as VoiceAutoCaptureConfig, I as VoiceConfig, L as VoiceEngine, M as ResolvedVoiceAutoCaptureConfig, N as ResolvedVoiceConfig, O as PoConfigTransitionStrategy, P as VoiceAdapterConfig, R as VoiceMode, S as PoConfigLayer, T as PoConfigSelection, V as VoiceTtsEngine, _ as PlanningModeConfig, a as ConfigDiagnostic, b as PoConfig, c as EditorConfig, d as IPoConfigService, f as LenientParseOptions, g as PlanningAgentConfig, h as PackageAttribution, i as AutocompactTokenConfig, j as ProjectTrust, k as PoHarnessContext, l as HarnessState, m as PO_CONFIG_SERVICE, n as AutocompactOverrideConfig, o as ConfigValueOrigin, p as LenientParseResult, r as AutocompactThresholdConfig, s as DeepReadonly, t as AutocompactModeConfig, u as IPoConfigLoader, v as PlanningThinkingLevel, w as PoConfigPendingSelection, x as PoConfigContext, y as PluginHookSource, z as VoiceModelConfig } from "./config-pxC7FyUJ.mjs";
|
|
2
|
+
export { type AutocompactModeConfig, type AutocompactOverrideConfig, type AutocompactThresholdConfig, type AutocompactTokenConfig, type ConfigDiagnostic, type ConfigValueOrigin, type DeepReadonly, type EditorConfig, type HarnessState, type IPoConfigLoader, type IPoConfigService, type LenientParseOptions, type LenientParseResult, PO_CONFIG_SERVICE, type PackageAttribution, type PlanningAgentConfig, type PlanningModeConfig, type PlanningThinkingLevel, type PluginHookSource, type PoConfig, type PoConfigContext, type PoConfigLayer, type PoConfigLayers, type PoConfigPendingSelection, type PoConfigSelection, type PoConfigTransitionPhase, type PoConfigTransitionRecord, type PoConfigTransitionStrategy, type PoHarnessContext, type PoSelectionConfig, type ProjectTrust, type ResolvedVoiceAutoCaptureConfig, type ResolvedVoiceConfig, type VoiceAdapterConfig, type VoiceAutoCaptureConfig, type VoiceConfig, type VoiceEngine, type VoiceMode, type VoiceModelConfig, type VoiceTtsConfig, type VoiceTtsEngine };
|
package/dist/types.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { DOOM_CONFIG_SERVICE };
|
|
1
|
+
export { t as PO_CONFIG_SERVICE } from "./config-BBvn_ZLP.mjs";
|
package/llms.txt
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/po-config",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.21",
|
|
4
4
|
"description": "Typed configuration loading, validation, and host services for composing Po sessions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent-configuration",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"bugs": {
|
|
20
20
|
"url": "https://github.com/AgiFlow/po/issues"
|
|
21
21
|
},
|
|
22
|
-
"license": "
|
|
22
|
+
"license": "BUSL-1.1",
|
|
23
23
|
"author": "Vuong Ngo",
|
|
24
24
|
"repository": {
|
|
25
25
|
"type": "git",
|
|
@@ -139,29 +139,29 @@
|
|
|
139
139
|
"registry": "https://registry.npmjs.org/"
|
|
140
140
|
},
|
|
141
141
|
"dependencies": {
|
|
142
|
-
"@agimon-ai/po-core": "0.0.0-alpha.
|
|
143
|
-
"@agimon-ai/po-telemetry": "0.0.0-alpha.
|
|
144
|
-
"@agimon-ai/po-web-components": "0.0.0-alpha.
|
|
145
|
-
"@deepseek-ai/cordis": "4.0.
|
|
146
|
-
"typebox": "1.3.
|
|
142
|
+
"@agimon-ai/po-core": "0.0.0-alpha.21",
|
|
143
|
+
"@agimon-ai/po-telemetry": "0.0.0-alpha.21",
|
|
144
|
+
"@agimon-ai/po-web-components": "0.0.0-alpha.21",
|
|
145
|
+
"@deepseek-ai/cordis": "4.0.5",
|
|
146
|
+
"typebox": "1.3.37",
|
|
147
147
|
"yaml": "2.9.1"
|
|
148
148
|
},
|
|
149
149
|
"devDependencies": {
|
|
150
|
-
"@agimon-ai/po-build": "0.0.0-alpha.
|
|
151
|
-
"@earendil-works/pi-coding-agent": "1.
|
|
150
|
+
"@agimon-ai/po-build": "0.0.0-alpha.21",
|
|
151
|
+
"@earendil-works/pi-coding-agent": "1.3.0",
|
|
152
152
|
"@modelcontextprotocol/ext-apps": "2.0.3",
|
|
153
|
-
"@modelcontextprotocol/server": "2.
|
|
154
|
-
"@playwright/test": "1.
|
|
155
|
-
"@types/node": "26.6.
|
|
153
|
+
"@modelcontextprotocol/server": "2.3.1",
|
|
154
|
+
"@playwright/test": "^1.64.0",
|
|
155
|
+
"@types/node": "26.6.5",
|
|
156
156
|
"@types/react": "19.3.0",
|
|
157
|
-
"@vitest/coverage-v8": "5.0.
|
|
157
|
+
"@vitest/coverage-v8": "5.0.4",
|
|
158
158
|
"react": "19.3.0",
|
|
159
|
-
"tsdown": "0.23.
|
|
159
|
+
"tsdown": "0.23.1",
|
|
160
160
|
"typescript": "7.0.2",
|
|
161
|
-
"vitest": "5.0.
|
|
161
|
+
"vitest": "5.0.4"
|
|
162
162
|
},
|
|
163
163
|
"peerDependencies": {
|
|
164
|
-
"@earendil-works/pi-coding-agent": "1.
|
|
164
|
+
"@earendil-works/pi-coding-agent": "1.3.0"
|
|
165
165
|
},
|
|
166
166
|
"engines": {
|
|
167
167
|
"node": ">=24"
|