@agimon-ai/po-cloudflare 0.0.2-alpha.13 → 0.0.2-alpha.14
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/dist/{agent-DYFqCLl2.js → agent-DTjnYFAN.js} +1 -1
- package/dist/{apiContracts-CDJ9sPkE.js → apiContracts-DepyzMNr.js} +80 -80
- package/dist/{approval-BSX-MRTE.js → approval-Biq3NCWj.js} +2 -2
- package/dist/{approvalPrompt-1FPgNwMA.js → approvalPrompt-DoHlIPkU.js} +2 -2
- package/dist/assets/plugins/compositions.json +1 -1
- package/dist/{atomicJson-BF1fVXy1.js → atomicJson-DCIsEywH.js} +3 -3
- package/dist/{backgroundWork-BaczP3Z1.js → backgroundWork-Bswjs1av.js} +1 -1
- package/dist/{codemode-CZ_eYTwm.js → codemode-CgVosRtU.js} +1 -1
- package/dist/{contracts-CnRs-Twx.js → contracts-CylyLZC8.js} +1 -1
- package/dist/{domains-Bl6T2dKV.js → domains-BqChtBLN.js} +23 -5
- package/dist/{exports-DlcCEAe3.js → exports-DERO0cQf.js} +760 -147
- package/dist/{exports-CxkWsXI9.js → exports-DX8LJfSj.js} +9 -9
- package/dist/{extensionFile-D7wk8tFr.js → extensionFile-Ds7RCpnb.js} +1 -1
- package/dist/{harnessStore-flLz1I0F.js → harnessStore-BectazJQ.js} +4 -4
- package/dist/harnessStore-C0Zwvny8.js +1 -0
- package/dist/{help-DjybmnPW.js → help-Dpm82qDr.js} +2 -2
- package/dist/{hubChannel-Bi3PQrfD.js → hubChannel-COvmdWGO.js} +4 -2
- package/dist/{index.edge-CJ2TFpgF.js → index.edge-B0D_Lgbx.js} +2 -2
- package/dist/{index.edge-C9_xuXyy.js → index.edge-BLmsRNW8.js} +2 -2
- package/dist/{layeredConfig-B4s0eZ5o.js → layeredConfig-pQGjhAks.js} +92 -6
- package/dist/{majorModes-IygGmbb8.js → majorModes-BrL4EtzH.js} +5 -14
- package/dist/majorModes-WXt22_km.js +1 -0
- package/dist/{mcpProjection-BA6baFpi.js → mcpProjection-pbPBBuvs.js} +2 -2
- package/dist/{notification-bGq1frYG.js → notification-CINsJWDL.js} +7 -4
- package/dist/{piConfig-CcoMX-1L.js → piConfig-BDUpA6w0.js} +5 -5
- package/dist/piSettings-tdui0CZI.js +1 -0
- package/dist/{platform-CyvF7X-b.js → platform-yhQXrrM_.js} +1 -1
- package/dist/{platformFiles-Ccj9HCvA.js → platformFiles-DB3Cw1l_.js} +1 -1
- package/dist/{protocol-Q7TFrOIs.js → protocol-B6LbEIe6.js} +2 -2
- package/dist/{server-4CmqIbH2.js → server-2o-hl3o0.js} +55 -14
- package/dist/{server-DSu_uLDX.js → server-B-br6deK.js} +6 -6
- package/dist/{server-C9gff7gU.js → server-B2G-c0hg.js} +5 -5
- package/dist/{server-CIhwIcbA.js → server-B3RgnYiZ.js} +13 -4
- package/dist/{server-C8HyW7wN.js → server-BBNCtQtl.js} +7 -7
- package/dist/{server-C_34VM3M.js → server-BmIU37Ei.js} +3 -3
- package/dist/{server-ClsNJwdv.js → server-Bqm5R8kV.js} +13 -13
- package/dist/{server-Co57A8MH.js → server-Bt6Zsqo8.js} +2 -2
- package/dist/{server-il_s2Ycz.js → server-BvYolSs9.js} +339 -43
- package/dist/{server-CpJNq249.js → server-C1x2LoKK.js} +10 -10
- package/dist/{server-CjsKNdSN.js → server-CCwwnpH0.js} +5 -5
- package/dist/{server-CxGGQFJs.js → server-CRPxNGv6.js} +6 -6
- package/dist/{server-COE7BKSa.js → server-Ci_BGVwd.js} +3 -3
- package/dist/{server-CTSvwoDy.js → server-CyYesT-G.js} +9 -9
- package/dist/{server-ziNfBZ2M.js → server-CzJjYgVk.js} +3 -3
- package/dist/{server-C_3jK2WM.js → server-D9qM5XCP.js} +23 -11
- package/dist/{server-C82Qzoh3.js → server-DE3Gzgfb.js} +10 -10
- package/dist/{server-CMaTba5B.js → server-DL6UyXfJ.js} +8 -8
- package/dist/{server-5vLvBTTs.js → server-DPTp6GXS.js} +4 -4
- package/dist/{server-CcNMwEFQ.js → server-Dgn4el5K.js} +5 -5
- package/dist/{server-CQXqMpeC.js → server-DuDp9MhD.js} +116 -54
- package/dist/{server-DeSuziRK.js → server-OerXqXJT.js} +4 -4
- package/dist/{server-ZsazKk-n.js → server-V8W5mcGu.js} +6 -6
- package/dist/{server-Bm6pAAw8.js → server-_0288DYR.js} +4 -4
- package/dist/{server-BHhb0oir.js → server-cStfn1Yv.js} +4 -4
- package/dist/{serverPlugin-pCqlBqQG.js → serverPlugin-OOfjB8tm.js} +1114 -1111
- package/dist/{sessionConfig-DzAs6Pt-.js → sessionConfig-C-zJI72k.js} +242 -54
- package/dist/{validation-CkjZwpf-.js → validation-DuOGOKEi.js} +2 -2
- package/dist/{value-DGT5IoiK.js → value-DyVsxCwZ.js} +1 -1
- package/dist/{vaultSettings-BRr8n821.js → vaultSettings-BFCRCBM3.js} +1 -1
- package/dist/web-cN41ySs9.js +3 -0
- package/dist/worker.js +15822 -1103
- package/dist/workflow-BgwWq0nq.js +79 -0
- package/package.json +32 -32
- package/dist/contextProjection-DlB6wzhm.js +0 -209
- package/dist/harnessStore-Bap8lsAg.js +0 -1
- package/dist/majorModes-xpLK9HpD.js +0 -1
- package/dist/piSettings-B6fsgIBA.js +0 -1
- package/dist/web-Cfvbn9H1.js +0 -3
- package/dist/workflow-w5JPZXgc.js +0 -23
- /package/dist/assets/plugins/slots/{approval.8b3f37d9-CqQk6XG_.js → approval.293d9a00-CqQk6XG_.js} +0 -0
- /package/dist/assets/plugins/slots/{artifacts.47d00f81-D-vQ-7Iz.js → artifacts.24567664-D-vQ-7Iz.js} +0 -0
- /package/dist/assets/plugins/slots/{autocompact.9a92993d-B3KTYwW1.js → autocompact.dd97d013-B3KTYwW1.js} +0 -0
- /package/dist/assets/plugins/slots/{builtin-tools.939bbfff-CZRYQVIP.js → builtin-tools.36d7400b-CZRYQVIP.js} +0 -0
- /package/dist/assets/plugins/slots/{codemode.782e5bb1-Bzl_K_vt.js → codemode.8eaee717-Bzl_K_vt.js} +0 -0
- /package/dist/assets/plugins/slots/{domain.21790b66-CvnpuKCY.js → domain.5e95fc37-CvnpuKCY.js} +0 -0
- /package/dist/assets/plugins/slots/{edit.c7c85129-kaxIknZ-.js → edit.385c9aa9-kaxIknZ-.js} +0 -0
- /package/dist/assets/plugins/slots/{files.bbcef824-wuB8gcQA.js → files.daf34ed8-wuB8gcQA.js} +0 -0
- /package/dist/assets/plugins/slots/{grep.3dfd3214-3FnU8p-d.js → grep.02052cdc-3FnU8p-d.js} +0 -0
- /package/dist/assets/plugins/slots/{log.33bc7d38-C0PXQ0O1.js → log.a86eb6d0-C0PXQ0O1.js} +0 -0
- /package/dist/assets/plugins/slots/{mcp.59c68bcb-D0CkHnIw.js → mcp.974af249-D0CkHnIw.js} +0 -0
- /package/dist/assets/plugins/slots/{profile.ea55f5e1-BSY3iYfJ.js → profile.48851a1d-BSY3iYfJ.js} +0 -0
- /package/dist/assets/plugins/slots/{prompts.9957cc84-xdCkNkoA.js → prompts.723d7748-xdCkNkoA.js} +0 -0
- /package/dist/assets/plugins/slots/{read.30a617e7-qqaxVlEX.js → read.46bf6536-qqaxVlEX.js} +0 -0
- /package/dist/assets/plugins/slots/{runner.9f3559b0-DfO2Z9HG.js → runner.53e9bd76-DfO2Z9HG.js} +0 -0
- /package/dist/assets/plugins/slots/{skill.f506a5ea-CL_n-l4h.js → skill.086701a4-CL_n-l4h.js} +0 -0
- /package/dist/assets/plugins/slots/{vault.01657352-DbG3F_on.js → vault.ac9935c8-DbG3F_on.js} +0 -0
|
@@ -1,34 +1,263 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
import {
|
|
1
|
+
import { B as String$1, Bn as BACKGROUND_CONTEXT, M as Record, R as Union, X as Literal, Xn as readPoFs, _ as composeServerProviderOverrides, ar as requirePoServerScope, ft as _Object_, ir as readPoServerScope, mt as Optional, n as PO_HEADLESS_HOST_SERVICE, nr as PO_SERVER_SCOPE_SERVICE } from "./serverPlugin-OOfjB8tm.js";
|
|
2
|
+
import { A as modelInputSchema, D as prepareSecretAddition, E as readPoMcpRemoteServers, F as mcpToolApproval, M as normalizeMcpAppMetadata, N as createMcpApprovalState, O as writeSecrets, P as isDestructiveMcpTool, S as createMcpGlobalSettings, T as connectRemoteMcpServers, a as listManagedMcpServers, b as SERVER_COMMAND_DESCRIPTION, c as parseMcpServerAddition, d as handleSettings, f as isRecord, g as userConfigPath, h as serverNameOf, i as addMcpServer, j as isModelVisibleMcpTool, k as USER_MCP_SCOPE, m as json, p as isVaultUnavailable, s as mutateMcpServer, u as bodyOf, v as routes, w as PO_MCP_REMOTE_SERVERS_SERVICE, x as VAULT_UNAVAILABLE, y as MCP_FLOW_ID_PARAM } from "./exports-DERO0cQf.js";
|
|
3
|
+
import { i as readTextIfExists, s as writeFileAtomic } from "./platformFiles-DB3Cw1l_.js";
|
|
4
|
+
import "./platform-yhQXrrM_.js";
|
|
5
|
+
import { c as defineRoute, d as defineServerTool, l as defineRoutedContribution, n as composeRootInjects, o as defineResource, p as defineServerPlugin, s as defineRoot, t as composeRootHooks, u as defineServerCommand } from "./extensionFile-Ds7RCpnb.js";
|
|
4
6
|
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-uSjRpm6Z.js";
|
|
5
|
-
import { s as PO_VAULT_CONTRACT } from "./vaultSettings-
|
|
6
|
-
import { i as readPoCodemode, n as PO_CODEMODE_SERVICE } from "./codemode-
|
|
7
|
-
import { t as PO_HELP_WHEN } from "./help-
|
|
7
|
+
import { s as PO_VAULT_CONTRACT } from "./vaultSettings-BFCRCBM3.js";
|
|
8
|
+
import { i as readPoCodemode, n as PO_CODEMODE_SERVICE } from "./codemode-CgVosRtU.js";
|
|
9
|
+
import { t as PO_HELP_WHEN } from "./help-Dpm82qDr.js";
|
|
10
|
+
//#region ../../default/po-mcp/src/services/mcpGlobalServers/index.ts
|
|
11
|
+
/** The parsed file, `undefined` when it does not exist, or `null` when it is not JSON. Any other read failure throws. */
|
|
12
|
+
async function readDocument(fs, filePath) {
|
|
13
|
+
const text = await readTextIfExists(fs, filePath, BACKGROUND_CONTEXT);
|
|
14
|
+
if (text === void 0) return { document: void 0 };
|
|
15
|
+
try {
|
|
16
|
+
return { document: JSON.parse(text) };
|
|
17
|
+
} catch {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
const notJson = (fileLabel) => ({
|
|
22
|
+
ok: false,
|
|
23
|
+
status: 409,
|
|
24
|
+
error: `${fileLabel} isn't valid JSON, so Po left it alone.`
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* The personal server list over the host's own filesystem, so it runs wherever Po has a `po/fs`.
|
|
28
|
+
* It is the file half of the Node settings manager's global scope: the same checks and the same
|
|
29
|
+
* add, edit and remove rules, without repositories, plugins or any process to run.
|
|
30
|
+
*/
|
|
31
|
+
function createMcpGlobalServers(options) {
|
|
32
|
+
let writes = Promise.resolve();
|
|
33
|
+
const requireFs = () => {
|
|
34
|
+
const fs = options.fs();
|
|
35
|
+
if (!fs) throw new Error("MCP settings need the host filesystem.");
|
|
36
|
+
return fs;
|
|
37
|
+
};
|
|
38
|
+
const queued = (work) => {
|
|
39
|
+
const run = writes.then(work);
|
|
40
|
+
writes = run.catch(() => void 0);
|
|
41
|
+
return run;
|
|
42
|
+
};
|
|
43
|
+
const save = (fs, filePath, document) => writeFileAtomic(fs, filePath, `${JSON.stringify(document, null, 2)}\n`, BACKGROUND_CONTEXT);
|
|
44
|
+
return {
|
|
45
|
+
async list(filePath, fileLabel) {
|
|
46
|
+
const read = await readDocument(requireFs(), filePath);
|
|
47
|
+
if (read === null) return {
|
|
48
|
+
ok: false,
|
|
49
|
+
status: 409,
|
|
50
|
+
error: `${fileLabel} isn't valid JSON.`
|
|
51
|
+
};
|
|
52
|
+
return {
|
|
53
|
+
ok: true,
|
|
54
|
+
value: listManagedMcpServers(read.document)
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
add(filePath, fileLabel, addition, secrets) {
|
|
58
|
+
return queued(async () => {
|
|
59
|
+
const fs = requireFs();
|
|
60
|
+
const read = await readDocument(fs, filePath);
|
|
61
|
+
if (read === null) return notJson(fileLabel);
|
|
62
|
+
const next = addMcpServer(read.document, addition, fileLabel);
|
|
63
|
+
if (!next.ok) return next;
|
|
64
|
+
let rollback;
|
|
65
|
+
if (secrets && secrets.writes.length > 0) {
|
|
66
|
+
const vault = options.vault();
|
|
67
|
+
if (!vault) throw new Error(VAULT_UNAVAILABLE);
|
|
68
|
+
rollback = await writeSecrets(vault, secrets.scope, secrets.writes);
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
await save(fs, filePath, next.value);
|
|
72
|
+
} catch (error) {
|
|
73
|
+
await rollback?.();
|
|
74
|
+
throw error;
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
ok: true,
|
|
78
|
+
value: void 0
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
mutate(filePath, fileLabel, name, revision, addition) {
|
|
83
|
+
return queued(async () => {
|
|
84
|
+
const fs = requireFs();
|
|
85
|
+
const read = await readDocument(fs, filePath);
|
|
86
|
+
if (read === null) return notJson(fileLabel);
|
|
87
|
+
const next = mutateMcpServer(read.document, name, revision, addition);
|
|
88
|
+
if (!next.ok) return next;
|
|
89
|
+
await save(fs, filePath, next.value);
|
|
90
|
+
return {
|
|
91
|
+
ok: true,
|
|
92
|
+
value: addition ? "none" : "possible"
|
|
93
|
+
};
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region ../../default/po-mcp/src/services/mcpGlobalHubApi/index.ts
|
|
100
|
+
const USER_CONFIG_LABEL = "your personal MCP config";
|
|
101
|
+
const NO_HOME = "Po couldn't find your home directory on this hub.";
|
|
102
|
+
const REPOSITORY_UNAVAILABLE = "Repository MCP management is not available on this host. Manage your own servers instead.";
|
|
103
|
+
const LOCAL_UNAVAILABLE = "Local command servers cannot run on this host. Add a remote server by URL instead.";
|
|
104
|
+
const MUTATION_FIELDS = /* @__PURE__ */ new Set([
|
|
105
|
+
"scope",
|
|
106
|
+
"repositoryId",
|
|
107
|
+
"target",
|
|
108
|
+
"name",
|
|
109
|
+
"revision",
|
|
110
|
+
"entry",
|
|
111
|
+
"trusted"
|
|
112
|
+
]);
|
|
113
|
+
const REVISION = /^[a-f0-9]{64}$/u;
|
|
114
|
+
const AUTHORIZATION_FLOW_PREFIX = routes.readAuthorization.path.replace(`:${MCP_FLOW_ID_PARAM}`, "");
|
|
115
|
+
/** A server entry that runs a command, which a host without processes cannot start. */
|
|
116
|
+
function isLocalEntry(entry) {
|
|
117
|
+
return isRecord(entry) && "command" in entry;
|
|
118
|
+
}
|
|
119
|
+
async function handleAddServer(servers, request, context) {
|
|
120
|
+
const body = await bodyOf(request);
|
|
121
|
+
if (!body || body.scope !== "repository" && body.scope !== "global") return json({ error: "Choose where to add the server." }, 400);
|
|
122
|
+
if (body.scope === "repository") return json({ error: REPOSITORY_UNAVAILABLE }, 501);
|
|
123
|
+
if (isLocalEntry(body.entry)) return json({ error: LOCAL_UNAVAILABLE }, 501);
|
|
124
|
+
const addition = parseMcpServerAddition(body.name, body.entry, body.trusted);
|
|
125
|
+
if (!addition.ok) return json({ error: addition.error }, addition.status);
|
|
126
|
+
const prepared = prepareSecretAddition(addition.value, body.secretFields);
|
|
127
|
+
if (!prepared.ok) return json({ error: prepared.error }, prepared.status);
|
|
128
|
+
if (body.target !== void 0) return json({ error: "Choose this workspace or one of its plugins." }, 400);
|
|
129
|
+
const filePath = userConfigPath(context);
|
|
130
|
+
if (!filePath) return json({ error: NO_HOME }, 503);
|
|
131
|
+
const { secrets } = prepared.value;
|
|
132
|
+
try {
|
|
133
|
+
const result = await servers.add(filePath, USER_CONFIG_LABEL, prepared.value.addition, secrets.length === 0 ? void 0 : {
|
|
134
|
+
scope: USER_MCP_SCOPE,
|
|
135
|
+
writes: secrets
|
|
136
|
+
});
|
|
137
|
+
return result.ok ? json({
|
|
138
|
+
scope: "global",
|
|
139
|
+
name: addition.value.name
|
|
140
|
+
}, 201) : json({ error: result.error }, result.status);
|
|
141
|
+
} catch (error) {
|
|
142
|
+
if (isVaultUnavailable(error)) return json({ error: VAULT_UNAVAILABLE }, 503);
|
|
143
|
+
return json({ error: `Po couldn't save ${USER_CONFIG_LABEL}.` }, 500);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
async function handleMutateServer(servers, request, context) {
|
|
147
|
+
const body = await bodyOf(request);
|
|
148
|
+
if (!body || Object.keys(body).some((key) => !MUTATION_FIELDS.has(key)) || body.scope !== "repository" && body.scope !== "global" || typeof body.revision !== "string" || !REVISION.test(body.revision)) return json({ error: "A saved scope, name and current revision are required." }, 400);
|
|
149
|
+
const name = serverNameOf(body.name);
|
|
150
|
+
if (!name) return json({ error: "A valid name is required." }, 400);
|
|
151
|
+
if (body.scope === "repository" || body.repositoryId !== void 0) return json({ error: REPOSITORY_UNAVAILABLE }, 501);
|
|
152
|
+
if (body.target !== void 0) return json({ error: "A saved scope, name and current revision are required." }, 400);
|
|
153
|
+
const editing = request.method === routes.editServer.method;
|
|
154
|
+
if (editing && isLocalEntry(body.entry)) return json({ error: LOCAL_UNAVAILABLE }, 501);
|
|
155
|
+
const parsed = editing ? parseMcpServerAddition(name, body.entry, body.trusted) : void 0;
|
|
156
|
+
if (parsed && !parsed.ok) return json({ error: parsed.error }, parsed.status);
|
|
157
|
+
if (!editing && body.entry !== void 0) return json({ error: "Remove does not accept an entry." }, 400);
|
|
158
|
+
const filePath = userConfigPath(context);
|
|
159
|
+
if (!filePath) return json({ error: NO_HOME }, 503);
|
|
160
|
+
try {
|
|
161
|
+
const result = await servers.mutate(filePath, USER_CONFIG_LABEL, name, body.revision, parsed?.ok ? parsed.value : void 0);
|
|
162
|
+
if (!result.ok) return json({ error: result.error }, result.status);
|
|
163
|
+
return json({
|
|
164
|
+
scope: "global",
|
|
165
|
+
name,
|
|
166
|
+
credentialsPreserved: true,
|
|
167
|
+
liveSessionsChanged: false,
|
|
168
|
+
syncRequired: false,
|
|
169
|
+
shadowedDefinition: result.value
|
|
170
|
+
});
|
|
171
|
+
} catch {
|
|
172
|
+
return json({ error: `Po couldn't save ${USER_CONFIG_LABEL}.` }, 500);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
async function handleGlobalServers(servers, context) {
|
|
176
|
+
const filePath = userConfigPath(context);
|
|
177
|
+
if (!filePath) return json({ error: NO_HOME }, 503);
|
|
178
|
+
try {
|
|
179
|
+
const result = await servers.list(filePath, USER_CONFIG_LABEL);
|
|
180
|
+
return result.ok ? json({ servers: result.value }) : json({ error: result.error }, result.status);
|
|
181
|
+
} catch {
|
|
182
|
+
return json({ error: `Po couldn't read ${USER_CONFIG_LABEL}.` }, 500);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/** Catalogs, discovery and sign-in need a repository checkout and local processes; this host has neither. */
|
|
186
|
+
function isRepositoryRoute(request, path) {
|
|
187
|
+
const flow = request.method === routes.readAuthorization.method || request.method === routes.cancelAuthorization.method;
|
|
188
|
+
return [
|
|
189
|
+
routes.catalog,
|
|
190
|
+
routes.discover,
|
|
191
|
+
routes.authorize
|
|
192
|
+
].some((route) => request.method === route.method && path === route.path) || flow && path.startsWith(AUTHORIZATION_FLOW_PREFIX);
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* The hub's MCP settings API for a host that has a filesystem but no repository checkout and no processes:
|
|
196
|
+
* approval, and the person's own remote servers. A repository route, or a command server, is answered 501,
|
|
197
|
+
* so the settings page says what this host cannot do instead of showing an empty catalog.
|
|
198
|
+
*/
|
|
199
|
+
function createMcpGlobalHubApi(options) {
|
|
200
|
+
const servers = createMcpGlobalServers({
|
|
201
|
+
fs: options.fs,
|
|
202
|
+
vault: options.vault
|
|
203
|
+
});
|
|
204
|
+
return {
|
|
205
|
+
basePath: "mcp",
|
|
206
|
+
start(context) {
|
|
207
|
+
return {
|
|
208
|
+
async fetch(request) {
|
|
209
|
+
const path = new URL(request.url).pathname;
|
|
210
|
+
if (request.method === routes.globalServers.method && path === routes.globalServers.path) return await handleGlobalServers(servers, context);
|
|
211
|
+
if ((request.method === routes.readSettings.method || request.method === routes.saveSettings.method) && path === routes.readSettings.path) return await handleSettings(options.settings, request, context);
|
|
212
|
+
if (request.method === routes.addServer.method && path === routes.addServer.path) return await handleAddServer(servers, request, context);
|
|
213
|
+
if ((request.method === routes.editServer.method || request.method === routes.removeServer.method) && path === routes.editServer.path) return await handleMutateServer(servers, request, context);
|
|
214
|
+
if (isRepositoryRoute(request, path)) return json({ error: REPOSITORY_UNAVAILABLE }, 501);
|
|
215
|
+
return json({ error: "Not found." }, 404);
|
|
216
|
+
},
|
|
217
|
+
close: () => void 0
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
//#endregion
|
|
8
223
|
//#region ../../default/po-mcp/src/extensions/(backend)/_lib/root.server.edge.ts
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
onServerRemoved: () => () => void 0
|
|
18
|
-
};
|
|
19
|
-
async function createMcpGlobalRoot(_plugin) {
|
|
20
|
-
return { value: {
|
|
224
|
+
/**
|
|
225
|
+
* Builds the hub MCP settings API at the global and workspace levels, reaching the vault through
|
|
226
|
+
* the server scope. The vault is resolved per request rather than injected, so a host without
|
|
227
|
+
* `po/vault` still mounts the API and answers 503 where a credential is needed.
|
|
228
|
+
*/
|
|
229
|
+
async function createMcpGlobalRoot(plugin) {
|
|
230
|
+
const settings = createMcpGlobalSettings(() => readPoFs(plugin.context));
|
|
231
|
+
if (plugin.host.scope === "session") return { value: {
|
|
21
232
|
hubApi: void 0,
|
|
22
|
-
settings
|
|
233
|
+
settings
|
|
23
234
|
} };
|
|
235
|
+
let scope;
|
|
236
|
+
const fiber = plugin.context.inject([PO_SERVER_SCOPE_SERVICE], (injected) => {
|
|
237
|
+
scope = requirePoServerScope(injected);
|
|
238
|
+
return () => {
|
|
239
|
+
scope = void 0;
|
|
240
|
+
};
|
|
241
|
+
});
|
|
242
|
+
await fiber.await();
|
|
243
|
+
return {
|
|
244
|
+
value: {
|
|
245
|
+
hubApi: createMcpGlobalHubApi({
|
|
246
|
+
fs: () => readPoFs(plugin.context),
|
|
247
|
+
vault: () => scope?.resolve(PO_VAULT_CONTRACT),
|
|
248
|
+
settings
|
|
249
|
+
}),
|
|
250
|
+
settings
|
|
251
|
+
},
|
|
252
|
+
onDispose: async () => {
|
|
253
|
+
await fiber.dispose();
|
|
254
|
+
}
|
|
255
|
+
};
|
|
24
256
|
}
|
|
25
257
|
//#endregion
|
|
26
258
|
//#region ../../default/po-mcp/src/extensions/(backend)/root.server.ts
|
|
27
259
|
var root_server_default$1 = defineRoot(createMcpGlobalRoot);
|
|
28
260
|
//#endregion
|
|
29
|
-
//#region ../../default/po-mcp/src/constants/mcp.ts
|
|
30
|
-
const SERVER_COMMAND_DESCRIPTION = "Show MCP configuration or begin an authorization request.";
|
|
31
|
-
//#endregion
|
|
32
261
|
//#region ../../default/po-mcp/src/schemas/mcpTestServer.ts
|
|
33
262
|
const Name = String$1({ pattern: "^[A-Za-z0-9_-]{1,64}$" });
|
|
34
263
|
const McpTestServerInput = _Object_({
|
|
@@ -324,14 +553,33 @@ function createMcpNamespace(sessionTools, sessionId) {
|
|
|
324
553
|
//#endregion
|
|
325
554
|
//#region ../../default/po-mcp/src/extensions/workspaces/sessions/(backend)/_lib/serverRoot.edge.ts
|
|
326
555
|
const NODE_ONLY = "Session-only MCP test servers need a Node host.";
|
|
556
|
+
const MAX_NOTICE_LENGTH = 300;
|
|
557
|
+
const describeError = (error) => (error instanceof Error ? error.message : String(error)).slice(0, MAX_NOTICE_LENGTH);
|
|
327
558
|
const createMcpServerRoot = (context) => {
|
|
328
559
|
let connection;
|
|
329
|
-
let
|
|
560
|
+
let serversStatus = "Remote MCP is off on this host.";
|
|
561
|
+
let approvalStatus;
|
|
562
|
+
const statusText = () => approvalStatus ? `${serversStatus}\n${approvalStatus}` : serversStatus;
|
|
330
563
|
const listeners = /* @__PURE__ */ new Set();
|
|
331
564
|
const changed = () => {
|
|
332
565
|
for (const listener of listeners) listener();
|
|
333
566
|
};
|
|
334
|
-
|
|
567
|
+
let savedAutoApprove = false;
|
|
568
|
+
const approvalListeners = /* @__PURE__ */ new Set();
|
|
569
|
+
const setSavedAutoApprove = (enabled) => {
|
|
570
|
+
if (savedAutoApprove === enabled) return;
|
|
571
|
+
savedAutoApprove = enabled;
|
|
572
|
+
for (const listener of approvalListeners) listener();
|
|
573
|
+
};
|
|
574
|
+
const approval = createMcpApprovalState({
|
|
575
|
+
globalAutoApprove: () => savedAutoApprove,
|
|
576
|
+
onGlobalChange: (listener) => {
|
|
577
|
+
approvalListeners.add(listener);
|
|
578
|
+
return () => {
|
|
579
|
+
approvalListeners.delete(listener);
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
});
|
|
335
583
|
const sessionTools = {
|
|
336
584
|
get generation() {
|
|
337
585
|
return connection?.sessionTools.generation ?? "remote:none";
|
|
@@ -364,7 +612,7 @@ const createMcpServerRoot = (context) => {
|
|
|
364
612
|
async execute(_args, execution) {
|
|
365
613
|
await execution.client.notify({
|
|
366
614
|
title: "Po MCP",
|
|
367
|
-
body:
|
|
615
|
+
body: statusText(),
|
|
368
616
|
level: "info"
|
|
369
617
|
});
|
|
370
618
|
}
|
|
@@ -384,31 +632,79 @@ const createMcpServerRoot = (context) => {
|
|
|
384
632
|
cordis.inject([PO_MCP_REMOTE_SERVERS_SERVICE], (scoped) => {
|
|
385
633
|
const service = readPoMcpRemoteServers(scoped);
|
|
386
634
|
const serverScope = readPoServerScope(scoped);
|
|
387
|
-
const
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
const
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
if (
|
|
635
|
+
const reads = /* @__PURE__ */ new Set();
|
|
636
|
+
let current = new AbortController();
|
|
637
|
+
let ended = false;
|
|
638
|
+
const readApproval = async (signal) => {
|
|
639
|
+
if (!service.loadAutoApprove) return;
|
|
640
|
+
try {
|
|
641
|
+
const enabled = await service.loadAutoApprove(signal);
|
|
642
|
+
if (signal.aborted) return;
|
|
643
|
+
setSavedAutoApprove(enabled === true);
|
|
644
|
+
approvalStatus = void 0;
|
|
645
|
+
} catch (error) {
|
|
646
|
+
if (signal.aborted) return;
|
|
647
|
+
setSavedAutoApprove(false);
|
|
648
|
+
approvalStatus = `Saved MCP approval could not load, so destructive tools ask: ${describeError(error)}`;
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
const connectServers = async (signal) => {
|
|
652
|
+
try {
|
|
653
|
+
const connected = await connectRemoteMcpServers(service, signal, approval, () => serverScope?.resolve(PO_VAULT_CONTRACT));
|
|
654
|
+
if (signal.aborted) return await connected.close();
|
|
655
|
+
connection = connected;
|
|
656
|
+
const describe = () => {
|
|
657
|
+
const names = [...new Set(connected.sessionTools.snapshot().map((tool) => tool.serverName))];
|
|
658
|
+
serversStatus = [names.length ? `Connected: ${names.join(", ")}.` : "No remote MCP server is connected.", ...connected.failures.map((failure) => `${failure.name} failed: ${failure.message}`)].join("\n");
|
|
659
|
+
};
|
|
399
660
|
describe();
|
|
661
|
+
connected.sessionTools.onChange(() => {
|
|
662
|
+
if (connection !== connected) return;
|
|
663
|
+
describe();
|
|
664
|
+
changed();
|
|
665
|
+
});
|
|
400
666
|
changed();
|
|
667
|
+
return;
|
|
668
|
+
} catch (error) {
|
|
669
|
+
if (signal.aborted) return void 0;
|
|
670
|
+
serversStatus = `Remote MCP servers could not load: ${describeError(error)}`;
|
|
671
|
+
return;
|
|
672
|
+
}
|
|
673
|
+
};
|
|
674
|
+
const refresh = () => {
|
|
675
|
+
current.abort();
|
|
676
|
+
current = new AbortController();
|
|
677
|
+
const { signal } = current;
|
|
678
|
+
setSavedAutoApprove(false);
|
|
679
|
+
approvalStatus = void 0;
|
|
680
|
+
const previous = connection;
|
|
681
|
+
connection = void 0;
|
|
682
|
+
serversStatus = previous ? "Remote MCP servers are reloading." : "Remote MCP servers are connecting.";
|
|
683
|
+
if (previous) changed();
|
|
684
|
+
const tracked = Promise.allSettled([
|
|
685
|
+
previous?.close(),
|
|
686
|
+
readApproval(signal),
|
|
687
|
+
connectServers(signal)
|
|
688
|
+
]).then(() => {
|
|
689
|
+
reads.delete(tracked);
|
|
401
690
|
});
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
691
|
+
reads.add(tracked);
|
|
692
|
+
return tracked;
|
|
693
|
+
};
|
|
694
|
+
const stopListening = service.onChange?.(() => {
|
|
695
|
+
if (!ended) refresh();
|
|
405
696
|
});
|
|
697
|
+
refresh();
|
|
406
698
|
return async () => {
|
|
407
|
-
|
|
408
|
-
|
|
699
|
+
ended = true;
|
|
700
|
+
stopListening?.();
|
|
701
|
+
current.abort();
|
|
702
|
+
await Promise.allSettled(reads);
|
|
409
703
|
const closing = connection;
|
|
410
704
|
connection = void 0;
|
|
411
|
-
|
|
705
|
+
serversStatus = "Remote MCP is off on this host.";
|
|
706
|
+
approvalStatus = void 0;
|
|
707
|
+
setSavedAutoApprove(false);
|
|
412
708
|
changed();
|
|
413
709
|
await closing?.close();
|
|
414
710
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { B as String$1, Bn as BACKGROUND_CONTEXT, Gn as PO_BROWSER_SERVICE, Hn as withAbortSignal, Qn as readPoNpm, Xn as readPoFs, Yn as readPoBrowser, Z as Integer, Zn as readPoIsolate, _ as composeServerProviderOverrides, ar as requirePoServerScope, bn as getOrThrow, ft as _Object_, l as invalidImageReason, ln as PO_SESSION_FILES_SERVICE, mt as Optional, nr as PO_SERVER_SCOPE_SERVICE, p as readPoHeadlessHost, qn as PO_SHELL_SERVICE, rr as defineServiceContract, x as PO_CONFIG_SERVICE } from "./serverPlugin-OOfjB8tm.js";
|
|
2
|
+
import "./platform-yhQXrrM_.js";
|
|
3
|
+
import { i as Errors, n as Check, r as Check$1 } from "./value-DyVsxCwZ.js";
|
|
4
|
+
import { n as readPackageConfigurations, t as readMajorModesConfig } from "./majorModes-BrL4EtzH.js";
|
|
5
|
+
import "./exports-DX8LJfSj.js";
|
|
6
|
+
import { d as defineServerTool, n as composeRootInjects, o as defineResource, p as defineServerPlugin, s as defineRoot, t as composeRootHooks } from "./extensionFile-Ds7RCpnb.js";
|
|
4
7
|
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-uSjRpm6Z.js";
|
|
5
|
-
import { i as isUnattended, n as gateApproval, o as PO_APPROVAL_SERVICE, s as readPoApproval, t as ApprovalPendingError } from "./approval-
|
|
6
|
-
import { a as PO_BACKGROUND_WORK_SERVICE, c as readPoBackgroundWorkService } from "./backgroundWork-
|
|
7
|
-
import "./
|
|
8
|
-
import
|
|
9
|
-
import "./exports-CxkWsXI9.js";
|
|
10
|
-
import { r as assertCodemodeNamespaceName, t as PO_CODEMODE_CONTRACT } from "./codemode-CZ_eYTwm.js";
|
|
11
|
-
import "./majorModes-xpLK9HpD.js";
|
|
8
|
+
import { i as isUnattended, n as gateApproval, o as PO_APPROVAL_SERVICE, s as readPoApproval, t as ApprovalPendingError } from "./approval-Biq3NCWj.js";
|
|
9
|
+
import { a as PO_BACKGROUND_WORK_SERVICE, c as readPoBackgroundWorkService } from "./backgroundWork-Bswjs1av.js";
|
|
10
|
+
import { r as assertCodemodeNamespaceName, t as PO_CODEMODE_CONTRACT } from "./codemode-CgVosRtU.js";
|
|
11
|
+
import "./majorModes-WXt22_km.js";
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/schema/meta/meta.mjs
|
|
14
14
|
/** A collection of all meta schemas. */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
1
|
+
import { $n as requirePoFs, Bn as BACKGROUND_CONTEXT, Jn as PO_SQLITE_SERVICE, Kn as PO_FS_SERVICE, _ as composeServerProviderOverrides, ar as requirePoServerScope, bn as getOrThrow, er as requirePoSqlite, gn as nodeHost, nr as PO_SERVER_SCOPE_SERVICE, pn as poHomeDirectory } from "./serverPlugin-OOfjB8tm.js";
|
|
2
|
+
import "./platform-yhQXrrM_.js";
|
|
3
|
+
import "./piSettings-tdui0CZI.js";
|
|
4
|
+
import { n as composeRootInjects, p as defineServerPlugin, s as defineRoot, t as composeRootHooks } from "./extensionFile-Ds7RCpnb.js";
|
|
4
5
|
import { t as applySqliteMigrations } from "./migrations-5gbLIQIc.js";
|
|
5
|
-
import "./
|
|
6
|
-
import { i as PO_DB_PREFIX_PATTERN, r as PO_DB_FILE, t as PO_DB_CONTRACT } from "./contracts-CnRs-Twx.js";
|
|
6
|
+
import { i as PO_DB_PREFIX_PATTERN, r as PO_DB_FILE, t as PO_DB_CONTRACT } from "./contracts-CylyLZC8.js";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
//#region ../../foundations/po-db/src/services/poDb/index.ts
|
|
9
9
|
/** sqlite names its own automatic indexes `sqlite_autoindex_*`; nobody owns those. */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { $n as requirePoFs, Bn as BACKGROUND_CONTEXT, Hn as withAbortSignal, _ as composeServerProviderOverrides } from "./serverPlugin-OOfjB8tm.js";
|
|
2
|
+
import "./platform-yhQXrrM_.js";
|
|
3
|
+
import { n as providePoConfigContext, o as createSettingsApi, t as createNativePoConfigContext } from "./sessionConfig-C-zJI72k.js";
|
|
4
|
+
import { l as defineRoutedContribution, n as composeRootInjects, o as defineResource, p as defineServerPlugin, s as defineRoot, t as composeRootHooks } from "./extensionFile-Ds7RCpnb.js";
|
|
3
5
|
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-uSjRpm6Z.js";
|
|
4
|
-
import {
|
|
5
|
-
import "./
|
|
6
|
+
import { i as readPoNotificationService } from "./notification-CINsJWDL.js";
|
|
7
|
+
import { a as createPoMcpProjectionService, i as createDisabledPoMcpProjection, n as PO_MCP_PROJECTION_SERVICE, o as isPoMcpProjection } from "./mcpProjection-pbPBBuvs.js";
|
|
6
8
|
import { t as createPoTelemetry } from "./index.edge-ChYa2LU4.js";
|
|
7
|
-
import { n as providePoConfigContext, r as createSettingsApi, t as createNativePoConfigContext } from "./sessionConfig-DzAs6Pt-.js";
|
|
8
|
-
import { a as createPoMcpProjectionService, i as createDisabledPoMcpProjection, n as PO_MCP_PROJECTION_SERVICE, o as isPoMcpProjection } from "./mcpProjection-BA6baFpi.js";
|
|
9
9
|
//#region ../../core/po-core/src/schemas/readiness.ts
|
|
10
10
|
/** Cordis service name for session-scoped package initialization. */
|
|
11
11
|
const PO_READINESS_SERVICE = "po/readiness";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as defineHook, m as runCleanups, n as composeRootInjects, p as defineServerPlugin, s as defineRoot, t as composeRootHooks } from "./extensionFile-
|
|
3
|
-
import { a as PO_BACKGROUND_WORK_SERVICE, c as readPoBackgroundWorkService, n as BACKGROUND_WORK_HOLDING_PROVIDERS, o as holdsSettledSession, s as holdsSettledSessionAfterRunnerDeadline } from "./backgroundWork-
|
|
1
|
+
import { _ as composeServerProviderOverrides } from "./serverPlugin-OOfjB8tm.js";
|
|
2
|
+
import { i as defineHook, m as runCleanups, n as composeRootInjects, p as defineServerPlugin, s as defineRoot, t as composeRootHooks } from "./extensionFile-Ds7RCpnb.js";
|
|
3
|
+
import { a as PO_BACKGROUND_WORK_SERVICE, c as readPoBackgroundWorkService, n as BACKGROUND_WORK_HOLDING_PROVIDERS, o as holdsSettledSession, s as holdsSettledSessionAfterRunnerDeadline } from "./backgroundWork-Bswjs1av.js";
|
|
4
4
|
//#region ../../foundations/po-autostop/src/constants/idlePolicy.ts
|
|
5
5
|
const DEFAULT_AUTO_STOP_DELAYS = {
|
|
6
6
|
cooldownMs: 5e3,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { $n as requirePoFs, Bn as BACKGROUND_CONTEXT, Jn as PO_SQLITE_SERVICE, Kn as PO_FS_SERVICE, _ as composeServerProviderOverrides, ar as requirePoServerScope, bn as getOrThrow, er as requirePoSqlite, gn as nodeHost, mn as createSerialRunner, nr as PO_SERVER_SCOPE_SERVICE, pn as poHomeDirectory, rr as defineServiceContract } from "./serverPlugin-OOfjB8tm.js";
|
|
2
|
+
import { n as PO_SESSION_ATTENTION_EVENT, u as poApiCallerFrom } from "./hubChannel-COvmdWGO.js";
|
|
3
3
|
import { n as infoFor, r as isSealedEnvelope, t as MAX_MESSAGES_PER_KEY } from "./sealedChannel-BeWNTWys.js";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import "./
|
|
9
|
-
import "./
|
|
10
|
-
import {
|
|
4
|
+
import { i as readTextIfExists } from "./platformFiles-DB3Cw1l_.js";
|
|
5
|
+
import "./platform-yhQXrrM_.js";
|
|
6
|
+
import { n as writePrivateAtomicJsonAsync } from "./atomicJson-DCIsEywH.js";
|
|
7
|
+
import "./piSettings-tdui0CZI.js";
|
|
8
|
+
import { n as Check } from "./value-DyVsxCwZ.js";
|
|
9
|
+
import { c as defineRoute, n as composeRootInjects, p as defineServerPlugin, s as defineRoot, t as composeRootHooks } from "./extensionFile-Ds7RCpnb.js";
|
|
10
|
+
import { a as PO_BACKGROUND_WORK_SERVICE, i as PO_BACKGROUND_WORK_CHANGED_EVENT, r as BackgroundProviderWorkItemSchema } from "./backgroundWork-Bswjs1av.js";
|
|
11
11
|
import { ECDH, createCipheriv, createDecipheriv, createECDH, createHash, createHmac, hkdfSync, randomBytes, timingSafeEqual } from "node:crypto";
|
|
12
12
|
import path from "node:path";
|
|
13
13
|
import { clearInterval as clearInterval$1, setInterval as setInterval$1, setTimeout } from "node:timers";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
1
|
+
import { $n as requirePoFs, B as String, Bn as BACKGROUND_CONTEXT, H as Number, Hn as withAbortSignal, Kn as PO_FS_SERVICE, bn as getOrThrow, ft as _Object_, hn as fileMutationRunner, mt as Optional } from "./serverPlugin-OOfjB8tm.js";
|
|
2
|
+
import "./platform-yhQXrrM_.js";
|
|
3
|
+
import { d as defineServerTool, p as defineServerPlugin, u as defineServerCommand } from "./extensionFile-Ds7RCpnb.js";
|
|
4
4
|
import { t as minimatch } from "./esm-BKJy3O9-.js";
|
|
5
5
|
import { dirname, relative, resolve, sep } from "node:path";
|
|
6
6
|
//#region ../../foundations/po-ui/src/constants/ui.ts
|
|
@@ -1,16 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { $n as requirePoFs, B as String$1, Bn as BACKGROUND_CONTEXT, Jn as PO_SQLITE_SERVICE, Kn as PO_FS_SERVICE, R as Union, W as Null, X as Literal, _ as composeServerProviderOverrides, a as PoHeadlessPromptAdmissionError, ar as requirePoServerScope, bn as getOrThrow, er as requirePoSqlite, ft as _Object_, gn as nodeHost, mn as createSerialRunner, mt as Optional, nr as PO_SERVER_SCOPE_SERVICE, pn as poHomeDirectory, rr as defineServiceContract, s as PoSessionSetupError, u as isPoHeadlessPromptAdmissionError, x as PO_CONFIG_SERVICE, yt as _Array_ } from "./serverPlugin-OOfjB8tm.js";
|
|
2
|
+
import { m as jsonApiResponses, t as defineApiContract } from "./apiContracts-DepyzMNr.js";
|
|
3
|
+
import { n as pathExists, o as removePath, s as writeFileAtomic } from "./platformFiles-DB3Cw1l_.js";
|
|
4
|
+
import "./platform-yhQXrrM_.js";
|
|
5
|
+
import "./piSettings-tdui0CZI.js";
|
|
6
|
+
import { _ as readPoPersonTimeZone, c as commitGlobalProfileRootAsync, d as inlineProfile, f as parseProfileBinding, l as loadProfilesAsync, m as PO_PERSON_TIME_ZONE_SERVICE, p as parseProfileVaultSecrets, s as ProfileCatalogChangedError, u as planGlobalProfileRootAsync, v as PO_PROFILE_IDENTITY_ENTRY_TYPE } from "./sessionConfig-C-zJI72k.js";
|
|
7
|
+
import { n as Check } from "./value-DyVsxCwZ.js";
|
|
8
|
+
import "./exports-DX8LJfSj.js";
|
|
9
|
+
import { c as defineRoute, i as defineHook, l as defineRoutedContribution, m as runCleanups, n as composeRootInjects, o as defineResource, p as defineServerPlugin, s as defineRoot, t as composeRootHooks } from "./extensionFile-Ds7RCpnb.js";
|
|
6
10
|
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-uSjRpm6Z.js";
|
|
7
|
-
import {
|
|
8
|
-
import "./platform-CyvF7X-b.js";
|
|
9
|
-
import "./piSettings-B6fsgIBA.js";
|
|
10
|
-
import { a as commitGlobalProfileRootAsync, c as buildPersonaPrompt, d as parseProfileBinding, f as parseProfileVaultSecrets, i as ProfileCatalogChangedError, l as loadProfiles, o as loadProfilesAsync, s as planGlobalProfileRootAsync, u as inlineProfile } from "./sessionConfig-DzAs6Pt-.js";
|
|
11
|
-
import "./exports-CxkWsXI9.js";
|
|
12
|
-
import { i as readPoCodemode, n as PO_CODEMODE_SERVICE } from "./codemode-CZ_eYTwm.js";
|
|
11
|
+
import { i as readPoCodemode, n as PO_CODEMODE_SERVICE } from "./codemode-CgVosRtU.js";
|
|
13
12
|
import path from "node:path";
|
|
13
|
+
//#region ../../foundations/po-config/src/services/profiles/sync.edge.ts
|
|
14
|
+
function nodeOnly(name, asyncName) {
|
|
15
|
+
throw new Error(`${name} is Node-only; use ${asyncName} with a PoPlatform on the edge.`);
|
|
16
|
+
}
|
|
17
|
+
/** @deprecated Node-only sync shim; use loadProfilesAsync. Removed in M2. */
|
|
18
|
+
function loadProfiles(_repoRoot, _homeDirectory) {
|
|
19
|
+
return nodeOnly("loadProfiles", "loadProfilesAsync");
|
|
20
|
+
}
|
|
21
|
+
/** @deprecated Node-only sync shim; use buildPersonaPromptAsync. Removed in M2. */
|
|
22
|
+
function buildPersonaPrompt(_personaRoot, _personaDirectory) {
|
|
23
|
+
return nodeOnly("buildPersonaPrompt", "buildPersonaPromptAsync");
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
14
26
|
//#region ../../foundations/po-profile/src/constants/profileMemory.ts
|
|
15
27
|
const PROFILE_MEMORY_STORE_SERVICE = "po/profile-memory-store";
|
|
16
28
|
const PROFILE_MEMORY_NAMESPACE_SOURCE = "@agimon-ai/po-profile/memory";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { i as __toESM, t as __commonJSMin } from "./rolldown-runtime-B-lAHAz2.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
2
|
+
import { $n as requirePoFs, B as String$1, Bn as BACKGROUND_CONTEXT, Xn as readPoFs, _ as composeServerProviderOverrides, bn as getOrThrow, fn as piAgentDirectory, ft as _Object_, hn as fileMutationRunner, mt as Optional } from "./serverPlugin-OOfjB8tm.js";
|
|
3
|
+
import { a as WORKFLOW_STEP_SESSION_PROVENANCE, c as PO_EDIT_PRESENCE_SERVICE } from "./hubChannel-COvmdWGO.js";
|
|
4
|
+
import { i as readTextIfExists, r as readBoundedFile, t as FileTooLargeError } from "./platformFiles-DB3Cw1l_.js";
|
|
5
|
+
import "./platform-yhQXrrM_.js";
|
|
6
|
+
import { p as resolvePlanningPlansDirectory } from "./layeredConfig-pQGjhAks.js";
|
|
7
|
+
import "./piSettings-tdui0CZI.js";
|
|
8
|
+
import { l as readPoConfig } from "./domains-BqChtBLN.js";
|
|
9
|
+
import "./value-DyVsxCwZ.js";
|
|
10
|
+
import "./exports-DX8LJfSj.js";
|
|
11
|
+
import { c as defineRoute, i as defineHook, m as runCleanups, n as composeRootInjects, p as defineServerPlugin, r as defineChannel, s as defineRoot, t as composeRootHooks } from "./extensionFile-Ds7RCpnb.js";
|
|
7
12
|
import { r as PO_CHILD_SESSION_HOOK_REGISTRY_SERVICE, s as readPoChildSessionLabels } from "./childSession-Cf2-kH4O.js";
|
|
8
|
-
import "./platform-CyvF7X-b.js";
|
|
9
13
|
import { t as createPoTelemetry } from "./index.edge-ChYa2LU4.js";
|
|
10
|
-
import "./piSettings-B6fsgIBA.js";
|
|
11
|
-
import { u as resolvePlanningPlansDirectory } from "./layeredConfig-B4s0eZ5o.js";
|
|
12
|
-
import { l as readPoConfig } from "./domains-Bl6T2dKV.js";
|
|
13
|
-
import "./exports-CxkWsXI9.js";
|
|
14
14
|
import { f as parseFileHeader, i as computeFileTag, n as resolveInputPath, o as displayPath, r as resolveReadInputPath } from "./index.edge-ClLTmPFz.js";
|
|
15
15
|
import { t as Hono } from "./dist-B-vqs6tA.js";
|
|
16
16
|
import { createHash } from "node:crypto";
|