@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
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { B as String$1, ft as _Object_, rr as defineServiceContract } from "./serverPlugin-OOfjB8tm.js";
|
|
2
|
+
//#region ../../core/po-core/src/schemas/workflow.ts
|
|
3
|
+
const PO_WORKFLOW_CONTEXT_SERVICE = "po/workflow-context";
|
|
4
|
+
/** A source-relative definition, never an arbitrary host path. */
|
|
5
|
+
const PoWorkflowDefinitionRefSchema = _Object_({
|
|
6
|
+
source: String$1({ minLength: 1 }),
|
|
7
|
+
key: String$1({
|
|
8
|
+
minLength: 1,
|
|
9
|
+
pattern: "^(?!/)(?!.*\\\\)(?!.*:)(?!.*[\\u0000-\\u001f\\u007f])(?!.*(?:^|/)\\.{1,2}(?:/|$))[^/]+(?:/[^/]+)*$"
|
|
10
|
+
})
|
|
11
|
+
}, { additionalProperties: false });
|
|
12
|
+
/** Registration receipt. runId fences a runKey that can be reused later. */
|
|
13
|
+
const PoWorkflowRunRefSchema = _Object_({
|
|
14
|
+
runId: String$1({ minLength: 1 }),
|
|
15
|
+
ownerSessionId: String$1({ minLength: 1 }),
|
|
16
|
+
runKey: String$1({ minLength: 1 }),
|
|
17
|
+
registryWorkspace: String$1({ minLength: 1 })
|
|
18
|
+
}, { additionalProperties: false });
|
|
19
|
+
function readPoWorkflowContextService(context) {
|
|
20
|
+
return context.get(PO_WORKFLOW_CONTEXT_SERVICE);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Bound by a host that keeps its own metrics, such as a hosted organization, and read by this package's
|
|
24
|
+
* session telemetry (to record) and its log API (to query). A host that binds nothing keeps using the log sink.
|
|
25
|
+
*/
|
|
26
|
+
const PO_LOG_METRICS_CONTRACT = defineServiceContract("po/log-metrics", {
|
|
27
|
+
scope: "global",
|
|
28
|
+
description: "Records sanitized session telemetry and answers metrics reports for the host's own organization."
|
|
29
|
+
});
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region ../../default/po-log/src/constants/metricsStore.ts
|
|
32
|
+
/**
|
|
33
|
+
* The only telemetry attributes a metrics entry carries. A session forwards these and nothing else, and the
|
|
34
|
+
* store reads these and nothing else, so a new attribute reaches stored metrics only by being named here.
|
|
35
|
+
*/
|
|
36
|
+
const METRICS_ATTRIBUTE = {
|
|
37
|
+
session: "pi.session.id",
|
|
38
|
+
provider: "gen_ai.provider.name",
|
|
39
|
+
requestModel: "gen_ai.request.model",
|
|
40
|
+
responseModel: "gen_ai.response.model",
|
|
41
|
+
inputTokens: "gen_ai.usage.input_tokens",
|
|
42
|
+
outputTokens: "gen_ai.usage.output_tokens",
|
|
43
|
+
totalTokens: "gen_ai.usage.total_tokens",
|
|
44
|
+
cacheReadTokens: "gen_ai.usage.cache_read_tokens",
|
|
45
|
+
reasoningTokens: "gen_ai.usage.reasoning_tokens",
|
|
46
|
+
tool: "tool.name",
|
|
47
|
+
toolError: "tool.result.error",
|
|
48
|
+
tokenAttribution: "token_attribution",
|
|
49
|
+
outcome: "outcome"
|
|
50
|
+
};
|
|
51
|
+
/** The one attribution the telemetry emits for tool tokens: the whole turn's total, shared by every tool in it. */
|
|
52
|
+
const TOOL_CALL_TURN_ATTRIBUTION = "toolCallTurn";
|
|
53
|
+
const TOKEN_SORT = "total-tokens";
|
|
54
|
+
/** HTTP is the common transport for local and remote collectors. */
|
|
55
|
+
async function queryHttp(endpoint, params, fetchImpl) {
|
|
56
|
+
const search = new URLSearchParams({
|
|
57
|
+
groupBy: params.groupBy,
|
|
58
|
+
period: params.period,
|
|
59
|
+
sort: TOKEN_SORT,
|
|
60
|
+
limit: String(params.limit),
|
|
61
|
+
toolLimit: String(params.toolLimit ?? 1)
|
|
62
|
+
});
|
|
63
|
+
for (const key of [
|
|
64
|
+
"sessionId",
|
|
65
|
+
"agentName",
|
|
66
|
+
"model",
|
|
67
|
+
"provider"
|
|
68
|
+
]) {
|
|
69
|
+
const value = params.filter?.[key];
|
|
70
|
+
if (value !== void 0 && value !== "") search.set(key, value);
|
|
71
|
+
}
|
|
72
|
+
const response = await fetchImpl(`${endpoint}/api/metrics?${search.toString()}`, { signal: AbortSignal.timeout(5e3) });
|
|
73
|
+
if (!response.ok) throw new Error(`sink responded ${response.status}`);
|
|
74
|
+
const body = await response.json();
|
|
75
|
+
if (body.error || !Array.isArray(body.timeline)) throw new Error(body.error ?? "sink is an older version");
|
|
76
|
+
return body;
|
|
77
|
+
}
|
|
78
|
+
//#endregion
|
|
79
|
+
export { PO_WORKFLOW_CONTEXT_SERVICE as a, readPoWorkflowContextService as c, PO_LOG_METRICS_CONTRACT as i, METRICS_ATTRIBUTE as n, PoWorkflowDefinitionRefSchema as o, TOOL_CALL_TURN_ATTRIBUTION as r, PoWorkflowRunRefSchema as s, queryHttp as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/po-cloudflare",
|
|
3
|
-
"version": "0.0.2-alpha.
|
|
3
|
+
"version": "0.0.2-alpha.14",
|
|
4
4
|
"description": "Cloudflare Workers and Durable Objects host for Po headless sessions. Ships the built Worker and its wrangler config.",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/AgiFlow/po/issues"
|
|
@@ -22,37 +22,37 @@
|
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@agimon-ai/po-approval": "0.0.0-alpha.
|
|
26
|
-
"@agimon-ai/po-artifact": "0.0.0-alpha.
|
|
27
|
-
"@agimon-ai/po-autocompact": "0.0.0-alpha.
|
|
28
|
-
"@agimon-ai/po-autostop": "0.0.0-alpha.
|
|
29
|
-
"@agimon-ai/po-build": "0.0.0-alpha.
|
|
30
|
-
"@agimon-ai/po-cache": "0.0.0-alpha.
|
|
31
|
-
"@agimon-ai/po-calendar": "0.0.1-alpha.
|
|
32
|
-
"@agimon-ai/po-codemode": "0.0.1-alpha.
|
|
33
|
-
"@agimon-ai/po-config": "0.0.0-alpha.
|
|
34
|
-
"@agimon-ai/po-core": "0.0.0-alpha.
|
|
35
|
-
"@agimon-ai/po-db": "0.0.0-alpha.
|
|
36
|
-
"@agimon-ai/po-domain": "0.0.0-alpha.
|
|
37
|
-
"@agimon-ai/po-edit": "0.0.0-alpha.
|
|
38
|
-
"@agimon-ai/po-file-edit": "0.0.0-alpha.
|
|
39
|
-
"@agimon-ai/po-grep": "0.0.0-alpha.
|
|
40
|
-
"@agimon-ai/po-identity": "0.0.2-alpha.
|
|
41
|
-
"@agimon-ai/po-log": "0.0.0-alpha.
|
|
42
|
-
"@agimon-ai/po-major-mode": "0.0.0-alpha.
|
|
43
|
-
"@agimon-ai/po-mcp": "0.0.0-alpha.
|
|
44
|
-
"@agimon-ai/po-minor-mode": "0.0.0-alpha.
|
|
45
|
-
"@agimon-ai/po-network": "0.0.2-alpha.
|
|
46
|
-
"@agimon-ai/po-notification": "0.0.0-alpha.
|
|
47
|
-
"@agimon-ai/po-profile": "0.0.0-alpha.
|
|
48
|
-
"@agimon-ai/po-prompt": "0.0.0-alpha.
|
|
49
|
-
"@agimon-ai/po-read": "0.0.0-alpha.
|
|
50
|
-
"@agimon-ai/po-runner": "0.0.0-alpha.
|
|
51
|
-
"@agimon-ai/po-session": "0.0.0-alpha.
|
|
52
|
-
"@agimon-ai/po-skill": "0.0.0-alpha.
|
|
53
|
-
"@agimon-ai/po-ui": "0.0.0-alpha.
|
|
54
|
-
"@agimon-ai/po-vault": "0.0.0-alpha.
|
|
55
|
-
"@agimon-ai/po-web-security": "0.0.0-alpha.
|
|
25
|
+
"@agimon-ai/po-approval": "0.0.0-alpha.114",
|
|
26
|
+
"@agimon-ai/po-artifact": "0.0.0-alpha.113",
|
|
27
|
+
"@agimon-ai/po-autocompact": "0.0.0-alpha.114",
|
|
28
|
+
"@agimon-ai/po-autostop": "0.0.0-alpha.114",
|
|
29
|
+
"@agimon-ai/po-build": "0.0.0-alpha.114",
|
|
30
|
+
"@agimon-ai/po-cache": "0.0.0-alpha.114",
|
|
31
|
+
"@agimon-ai/po-calendar": "0.0.1-alpha.73",
|
|
32
|
+
"@agimon-ai/po-codemode": "0.0.1-alpha.87",
|
|
33
|
+
"@agimon-ai/po-config": "0.0.0-alpha.114",
|
|
34
|
+
"@agimon-ai/po-core": "0.0.0-alpha.114",
|
|
35
|
+
"@agimon-ai/po-db": "0.0.0-alpha.114",
|
|
36
|
+
"@agimon-ai/po-domain": "0.0.0-alpha.114",
|
|
37
|
+
"@agimon-ai/po-edit": "0.0.0-alpha.114",
|
|
38
|
+
"@agimon-ai/po-file-edit": "0.0.0-alpha.114",
|
|
39
|
+
"@agimon-ai/po-grep": "0.0.0-alpha.114",
|
|
40
|
+
"@agimon-ai/po-identity": "0.0.2-alpha.61",
|
|
41
|
+
"@agimon-ai/po-log": "0.0.0-alpha.114",
|
|
42
|
+
"@agimon-ai/po-major-mode": "0.0.0-alpha.114",
|
|
43
|
+
"@agimon-ai/po-mcp": "0.0.0-alpha.114",
|
|
44
|
+
"@agimon-ai/po-minor-mode": "0.0.0-alpha.114",
|
|
45
|
+
"@agimon-ai/po-network": "0.0.2-alpha.61",
|
|
46
|
+
"@agimon-ai/po-notification": "0.0.0-alpha.114",
|
|
47
|
+
"@agimon-ai/po-profile": "0.0.0-alpha.114",
|
|
48
|
+
"@agimon-ai/po-prompt": "0.0.0-alpha.114",
|
|
49
|
+
"@agimon-ai/po-read": "0.0.0-alpha.114",
|
|
50
|
+
"@agimon-ai/po-runner": "0.0.0-alpha.114",
|
|
51
|
+
"@agimon-ai/po-session": "0.0.0-alpha.114",
|
|
52
|
+
"@agimon-ai/po-skill": "0.0.0-alpha.114",
|
|
53
|
+
"@agimon-ai/po-ui": "0.0.0-alpha.114",
|
|
54
|
+
"@agimon-ai/po-vault": "0.0.0-alpha.114",
|
|
55
|
+
"@agimon-ai/po-web-security": "0.0.0-alpha.114",
|
|
56
56
|
"@better-auth/sso": "1.7.12",
|
|
57
57
|
"@cloudflare/puppeteer": "1.4.0",
|
|
58
58
|
"@cloudflare/workers-types": "5.20261013.1",
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
import { At as Null, Et as String, Qt as _Object_, en as Optional, nr as defineServiceContract, wt as Union } from "./serverPlugin-pCqlBqQG.js";
|
|
2
|
-
//#region ../../core/po-core/src/schemas/profileIdentity.ts
|
|
3
|
-
/**
|
|
4
|
-
* The custom session entry the runtime journals when the active profile's
|
|
5
|
-
* persona identity changes.
|
|
6
|
-
*
|
|
7
|
-
* A profile has always been prompt text only, so a cockpit had nothing to show
|
|
8
|
-
* for it beyond the profile name already published as footer status. This entry
|
|
9
|
-
* carries the persona's display name and avatar so the transcript can attribute
|
|
10
|
-
* each assistant message to the persona that produced it.
|
|
11
|
-
*
|
|
12
|
-
* It rides Pi's `entry_appended` frames on the road the agent-model projection
|
|
13
|
-
* already uses, so any RPC client sees the change live and on replay without a
|
|
14
|
-
* new protocol.
|
|
15
|
-
*
|
|
16
|
-
* Unlike the minor-mode, context, and agent-model projections, this entry is
|
|
17
|
-
* NOT a projection: it is transcript, positioned in journal order. A cockpit
|
|
18
|
-
* folding it must keep every occurrence rather than collapsing to the latest
|
|
19
|
-
* one, because a message written before a switch keeps the identity it was
|
|
20
|
-
* written under. Collapsing would rewrite history.
|
|
21
|
-
*/
|
|
22
|
-
const PO_PROFILE_IDENTITY_ENTRY_TYPE = "po-profile-identity";
|
|
23
|
-
/**
|
|
24
|
-
* Ceiling on the encoded icon, counted on the finished `data:` URL rather than
|
|
25
|
-
* the file, so one number bounds both the journal entry and the transport.
|
|
26
|
-
*
|
|
27
|
-
* An avatar renders at 32 CSS pixels. This much room is already generous, and
|
|
28
|
-
* the cap exists because the entry is replayed with the transcript: an oversize
|
|
29
|
-
* icon is dropped and the persona keeps its name, never failing a profile load.
|
|
30
|
-
*/
|
|
31
|
-
const PROFILE_ICON_MAX_DATA_URL_LENGTH = 262144;
|
|
32
|
-
const MAX_PROFILE_NAME_LENGTH = 128;
|
|
33
|
-
/**
|
|
34
|
-
* Image types allowed for a persona icon.
|
|
35
|
-
*
|
|
36
|
-
* Deliberately narrower than the cockpit's general media catalog: `image/svg+xml`
|
|
37
|
-
* is excluded because an SVG rendered same-origin executes script, and the icon
|
|
38
|
-
* path comes from user-authored persona front-matter. Do not reconcile this list
|
|
39
|
-
* with the broader media type map.
|
|
40
|
-
*/
|
|
41
|
-
const PROFILE_ICON_MIME_TYPES = [
|
|
42
|
-
"image/png",
|
|
43
|
-
"image/jpeg",
|
|
44
|
-
"image/gif",
|
|
45
|
-
"image/webp"
|
|
46
|
-
];
|
|
47
|
-
_Object_({
|
|
48
|
-
profile: Union([String({
|
|
49
|
-
minLength: 1,
|
|
50
|
-
maxLength: MAX_PROFILE_NAME_LENGTH
|
|
51
|
-
}), Null()]),
|
|
52
|
-
name: Optional(String({
|
|
53
|
-
minLength: 1,
|
|
54
|
-
maxLength: MAX_PROFILE_NAME_LENGTH
|
|
55
|
-
})),
|
|
56
|
-
icon: Optional(String({
|
|
57
|
-
minLength: 1,
|
|
58
|
-
maxLength: PROFILE_ICON_MAX_DATA_URL_LENGTH
|
|
59
|
-
}))
|
|
60
|
-
}, { additionalProperties: false });
|
|
61
|
-
//#endregion
|
|
62
|
-
//#region ../../core/po-core/src/schemas/personTimeZone.ts
|
|
63
|
-
const PO_PERSON_TIME_ZONE_SERVICE = "po/person-time-zone";
|
|
64
|
-
defineServiceContract(PO_PERSON_TIME_ZONE_SERVICE, { scope: "session" });
|
|
65
|
-
function readPoPersonTimeZone(context) {
|
|
66
|
-
return context.get(PO_PERSON_TIME_ZONE_SERVICE);
|
|
67
|
-
}
|
|
68
|
-
/** True for a zone name this runtime's Intl accepts, such as `Australia/Sydney`. */
|
|
69
|
-
function isTimeZone(value) {
|
|
70
|
-
if (typeof value !== "string" || value.length === 0 || value.length > 64) return false;
|
|
71
|
-
try {
|
|
72
|
-
new Intl.DateTimeFormat("en", { timeZone: value });
|
|
73
|
-
return true;
|
|
74
|
-
} catch {
|
|
75
|
-
return false;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
/** The system prompt line. It names no clock time, so it stays stable and the prompt cache holds. */
|
|
79
|
-
function personTimeZoneLine(zone) {
|
|
80
|
-
return zone === void 0 ? "Person's timezone: unknown. Ask the person before acting on a clock time or date; never assume the server's zone." : `Person's timezone: ${zone.timeZone} (from their ${zone.source}). Read and write dates and clock times in this zone unless the person names another.`;
|
|
81
|
-
}
|
|
82
|
-
//#endregion
|
|
83
|
-
//#region ../../core/po-core/src/services/toolCost/index.ts
|
|
84
|
-
/** Mirrors the wire shape MCP advertises, so both estimates stay comparable. */
|
|
85
|
-
function schemaPayload(entry) {
|
|
86
|
-
return JSON.stringify({
|
|
87
|
-
name: entry.name,
|
|
88
|
-
...entry.description === void 0 ? {} : { description: entry.description },
|
|
89
|
-
...entry.parameters === void 0 ? {} : { parameters: entry.parameters }
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
function promptPayload(entry) {
|
|
93
|
-
return [entry.promptSnippet ?? "", ...entry.promptGuidelines ?? []].filter(Boolean).join("\n");
|
|
94
|
-
}
|
|
95
|
-
function tokensForTool(entry, countTokens) {
|
|
96
|
-
const schemaTokens = countTokens(schemaPayload(entry));
|
|
97
|
-
const prompt = promptPayload(entry);
|
|
98
|
-
const promptTokens = prompt.length === 0 ? 0 : countTokens(prompt);
|
|
99
|
-
return {
|
|
100
|
-
schemaTokens,
|
|
101
|
-
promptTokens,
|
|
102
|
-
totalTokens: schemaTokens + promptTokens
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
/** Journal entry the cockpit reads; mirrored by CONTEXT_ENTRY_TYPE in po-web. */
|
|
106
|
-
const PO_CONTEXT_ENTRY_TYPE = "po-context";
|
|
107
|
-
/** Session selection and transition journal identities, not transport channels. */
|
|
108
|
-
const PO_CONFIG_ENTRY_TYPE = "po:config:v1";
|
|
109
|
-
const PO_CONFIG_TRANSITION_ENTRY_TYPE = "po:transition:v1";
|
|
110
|
-
/** The tokenizer these counts came from, so a reader can judge them. */
|
|
111
|
-
const CONTEXT_PROJECTION_ESTIMATOR = "gpt-tokenizer";
|
|
112
|
-
/** Everything the runtime could not attribute lands here rather than vanishing. */
|
|
113
|
-
const CORE_GROUP = "core";
|
|
114
|
-
/** Pi's own tools have no package; the runtime itself is the owner. */
|
|
115
|
-
const CORE_OWNER = "pi";
|
|
116
|
-
const KIND_ORDER = {
|
|
117
|
-
major: 0,
|
|
118
|
-
minor: 1,
|
|
119
|
-
domain: 2,
|
|
120
|
-
shared: 3,
|
|
121
|
-
core: 4
|
|
122
|
-
};
|
|
123
|
-
const SOURCE_ORDER = {
|
|
124
|
-
extension: 0,
|
|
125
|
-
mcp: 1,
|
|
126
|
-
plugin: 2,
|
|
127
|
-
core: 3
|
|
128
|
-
};
|
|
129
|
-
function skillSource(group) {
|
|
130
|
-
if (group === "plugins") return "plugin";
|
|
131
|
-
if (group === "extensions") return "extension";
|
|
132
|
-
return "core";
|
|
133
|
-
}
|
|
134
|
-
function byRow(left, right) {
|
|
135
|
-
return SOURCE_ORDER[left.source] - SOURCE_ORDER[right.source] || left.name.localeCompare(right.name);
|
|
136
|
-
}
|
|
137
|
-
function projectContext(input) {
|
|
138
|
-
const buckets = /* @__PURE__ */ new Map();
|
|
139
|
-
const declare = (id, label, kind) => {
|
|
140
|
-
if (!buckets.has(id)) buckets.set(id, {
|
|
141
|
-
kind,
|
|
142
|
-
label,
|
|
143
|
-
items: []
|
|
144
|
-
});
|
|
145
|
-
};
|
|
146
|
-
if (input.majorMode) declare(input.majorMode, input.majorMode, "major");
|
|
147
|
-
for (const group of input.groups) declare(group.id, group.label, group.kind);
|
|
148
|
-
for (const domain of input.domains) declare(domain, domain, "domain");
|
|
149
|
-
const place = (owner, item, conditional) => {
|
|
150
|
-
const attributed = conditional ?? input.attribution[owner];
|
|
151
|
-
const id = attributed?.mode ?? CORE_GROUP;
|
|
152
|
-
const kind = attributed?.kind ?? "core";
|
|
153
|
-
declare(id, attributed && "label" in attributed ? attributed.label ?? id : id, kind);
|
|
154
|
-
buckets.get(id)?.items.push(item);
|
|
155
|
-
};
|
|
156
|
-
for (const source of input.sources) {
|
|
157
|
-
const owner = source.kind === "extension" ? source.packageName ?? source.key : source.kind === "mcp" ? source.key.slice(4) : CORE_OWNER;
|
|
158
|
-
for (const tool of source.tools) {
|
|
159
|
-
const cost = tokensForTool(tool, input.countTokens);
|
|
160
|
-
const item = {
|
|
161
|
-
name: tool.name,
|
|
162
|
-
itemKind: "tool",
|
|
163
|
-
source: source.kind === "core" ? "core" : source.kind,
|
|
164
|
-
owner,
|
|
165
|
-
tokens: cost.totalTokens,
|
|
166
|
-
active: tool.active
|
|
167
|
-
};
|
|
168
|
-
if (source.kind === "core") {
|
|
169
|
-
declare(CORE_GROUP, CORE_GROUP, "core");
|
|
170
|
-
buckets.get(CORE_GROUP)?.items.push(item);
|
|
171
|
-
} else place(owner, item, tool.contextAttribution);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
for (const skill of input.skills) place(skill.owner, {
|
|
175
|
-
name: skill.name,
|
|
176
|
-
itemKind: "skill",
|
|
177
|
-
source: skillSource(skill.group),
|
|
178
|
-
owner: skill.owner,
|
|
179
|
-
tokens: skill.promptTokens ?? 0,
|
|
180
|
-
active: true
|
|
181
|
-
}, skill.contextAttribution);
|
|
182
|
-
const groups = [...buckets.entries()].map(([id, bucket]) => {
|
|
183
|
-
const items = [...bucket.items].sort(byRow);
|
|
184
|
-
return {
|
|
185
|
-
id,
|
|
186
|
-
label: bucket.label,
|
|
187
|
-
kind: bucket.kind,
|
|
188
|
-
items,
|
|
189
|
-
tokens: items.reduce((total, item) => total + (item.active ? item.tokens : 0), 0),
|
|
190
|
-
inactiveTokens: items.reduce((total, item) => total + (item.active ? 0 : item.tokens), 0)
|
|
191
|
-
};
|
|
192
|
-
}).sort((left, right) => KIND_ORDER[left.kind] - KIND_ORDER[right.kind] || left.label.localeCompare(right.label));
|
|
193
|
-
return {
|
|
194
|
-
version: 1,
|
|
195
|
-
revision: input.revision,
|
|
196
|
-
selection: {
|
|
197
|
-
majorMode: input.majorMode,
|
|
198
|
-
domains: [...input.domains],
|
|
199
|
-
...input.profile === void 0 ? {} : { profile: input.profile }
|
|
200
|
-
},
|
|
201
|
-
groups,
|
|
202
|
-
totalTokens: groups.reduce((total, group) => total + group.tokens, 0),
|
|
203
|
-
inactiveTokens: groups.reduce((total, group) => total + group.inactiveTokens, 0),
|
|
204
|
-
...input.systemPrompt === void 0 ? {} : { systemPrompt: input.systemPrompt },
|
|
205
|
-
estimator: CONTEXT_PROJECTION_ESTIMATOR
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
//#endregion
|
|
209
|
-
export { tokensForTool as a, personTimeZoneLine as c, PROFILE_ICON_MAX_DATA_URL_LENGTH as d, PROFILE_ICON_MIME_TYPES as f, projectContext as i, readPoPersonTimeZone as l, PO_CONFIG_TRANSITION_ENTRY_TYPE as n, PO_PERSON_TIME_ZONE_SERVICE as o, PO_CONTEXT_ENTRY_TYPE as r, isTimeZone as s, PO_CONFIG_ENTRY_TYPE as t, PO_PROFILE_IDENTITY_ENTRY_TYPE as u };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./harnessStore-flLz1I0F.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./majorModes-IygGmbb8.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./worker.js";
|
package/dist/web-Cfvbn9H1.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Et as String, Qt as _Object_ } from "./serverPlugin-pCqlBqQG.js";
|
|
2
|
-
//#region ../../core/po-core/src/schemas/workflow.ts
|
|
3
|
-
const PO_WORKFLOW_CONTEXT_SERVICE = "po/workflow-context";
|
|
4
|
-
/** A source-relative definition, never an arbitrary host path. */
|
|
5
|
-
const PoWorkflowDefinitionRefSchema = _Object_({
|
|
6
|
-
source: String({ minLength: 1 }),
|
|
7
|
-
key: String({
|
|
8
|
-
minLength: 1,
|
|
9
|
-
pattern: "^(?!/)(?!.*\\\\)(?!.*:)(?!.*[\\u0000-\\u001f\\u007f])(?!.*(?:^|/)\\.{1,2}(?:/|$))[^/]+(?:/[^/]+)*$"
|
|
10
|
-
})
|
|
11
|
-
}, { additionalProperties: false });
|
|
12
|
-
/** Registration receipt. runId fences a runKey that can be reused later. */
|
|
13
|
-
const PoWorkflowRunRefSchema = _Object_({
|
|
14
|
-
runId: String({ minLength: 1 }),
|
|
15
|
-
ownerSessionId: String({ minLength: 1 }),
|
|
16
|
-
runKey: String({ minLength: 1 }),
|
|
17
|
-
registryWorkspace: String({ minLength: 1 })
|
|
18
|
-
}, { additionalProperties: false });
|
|
19
|
-
function readPoWorkflowContextService(context) {
|
|
20
|
-
return context.get(PO_WORKFLOW_CONTEXT_SERVICE);
|
|
21
|
-
}
|
|
22
|
-
//#endregion
|
|
23
|
-
export { readPoWorkflowContextService as i, PoWorkflowDefinitionRefSchema as n, PoWorkflowRunRefSchema as r, PO_WORKFLOW_CONTEXT_SERVICE as t };
|
/package/dist/assets/plugins/slots/{approval.8b3f37d9-CqQk6XG_.js → approval.293d9a00-CqQk6XG_.js}
RENAMED
|
File without changes
|
/package/dist/assets/plugins/slots/{artifacts.47d00f81-D-vQ-7Iz.js → artifacts.24567664-D-vQ-7Iz.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/assets/plugins/slots/{codemode.782e5bb1-Bzl_K_vt.js → codemode.8eaee717-Bzl_K_vt.js}
RENAMED
|
File without changes
|
/package/dist/assets/plugins/slots/{domain.21790b66-CvnpuKCY.js → domain.5e95fc37-CvnpuKCY.js}
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/assets/plugins/slots/{files.bbcef824-wuB8gcQA.js → files.daf34ed8-wuB8gcQA.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/assets/plugins/slots/{profile.ea55f5e1-BSY3iYfJ.js → profile.48851a1d-BSY3iYfJ.js}
RENAMED
|
File without changes
|
/package/dist/assets/plugins/slots/{prompts.9957cc84-xdCkNkoA.js → prompts.723d7748-xdCkNkoA.js}
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/assets/plugins/slots/{runner.9f3559b0-DfO2Z9HG.js → runner.53e9bd76-DfO2Z9HG.js}
RENAMED
|
File without changes
|
/package/dist/assets/plugins/slots/{skill.f506a5ea-CL_n-l4h.js → skill.086701a4-CL_n-l4h.js}
RENAMED
|
File without changes
|
/package/dist/assets/plugins/slots/{vault.01657352-DbG3F_on.js → vault.ac9935c8-DbG3F_on.js}
RENAMED
|
File without changes
|