@agimon-ai/po-cloudflare 0.0.2-alpha.11 → 0.0.2-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/dist/agent-DYFqCLl2.js +6850 -0
  2. package/dist/assets/plugins/assets/base-C3j1WCCq.css +2 -0
  3. package/dist/assets/plugins/chunks/po-web-runtime-Czm_C4SJ.js +1 -0
  4. package/dist/assets/plugins/compositions.json +1 -1
  5. package/dist/assets/plugins/slots/approval.8b3f37d9-CqQk6XG_.js +2 -0
  6. package/dist/assets/plugins/slots/artifacts.47d00f81-D-vQ-7Iz.js +1 -0
  7. package/dist/assets/plugins/slots/autocompact.9a92993d-B3KTYwW1.js +1 -0
  8. package/dist/assets/plugins/slots/builtin-tools.939bbfff-CZRYQVIP.js +7 -0
  9. package/dist/assets/plugins/slots/codemode.782e5bb1-Bzl_K_vt.js +10 -0
  10. package/dist/assets/plugins/slots/domain.21790b66-CvnpuKCY.js +1 -0
  11. package/dist/assets/plugins/slots/edit.c7c85129-kaxIknZ-.js +7 -0
  12. package/dist/assets/plugins/slots/files.bbcef824-wuB8gcQA.js +2 -0
  13. package/dist/assets/plugins/slots/grep.3dfd3214-3FnU8p-d.js +1 -0
  14. package/dist/assets/plugins/slots/log.33bc7d38-C0PXQ0O1.js +4 -0
  15. package/dist/assets/plugins/slots/mcp.59c68bcb-D0CkHnIw.js +109 -0
  16. package/dist/assets/plugins/slots/{profile.ab16dcec-B5yt7eny.js → profile.ea55f5e1-BSY3iYfJ.js} +1 -1
  17. package/dist/assets/plugins/slots/prompts.9957cc84-xdCkNkoA.js +3 -0
  18. package/dist/assets/plugins/slots/read.30a617e7-qqaxVlEX.js +1 -0
  19. package/dist/assets/plugins/slots/runner.9f3559b0-DfO2Z9HG.js +8 -0
  20. package/dist/assets/plugins/slots/skill.f506a5ea-CL_n-l4h.js +4 -0
  21. package/dist/assets/plugins/slots/vault.01657352-DbG3F_on.js +1 -0
  22. package/dist/{atomicJson-C_lN9leA.js → atomicJson-BF1fVXy1.js} +1 -1
  23. package/dist/browser-BWf8OMfl.js +3 -0
  24. package/dist/childSession-Cf2-kH4O.js +22 -0
  25. package/dist/{server-D190dXDN.js → dist-B-vqs6tA.js} +1 -546
  26. package/dist/{domains-CPX1dEVa.js → domains-Bl6T2dKV.js} +2 -2
  27. package/dist/{server-C5wixba6.js → esm-BKJy3O9-.js} +3 -296
  28. package/dist/{exports-2Vv52b9v.js → exports-CxkWsXI9.js} +7 -6
  29. package/dist/{exports-BF12Ftrd.js → exports-DlcCEAe3.js} +2 -9
  30. package/dist/{extensionFile-DpVvh-ud.js → extensionFile-D7wk8tFr.js} +11 -1
  31. package/dist/harnessStore-Bap8lsAg.js +1 -0
  32. package/dist/{harnessStore-Ct329wxJ.js → harnessStore-flLz1I0F.js} +2 -2
  33. package/dist/help-DjybmnPW.js +91 -0
  34. package/dist/{hubChannel-kFgtfJnv.js → hubChannel-Bi3PQrfD.js} +3 -27
  35. package/dist/hubRevisions-58pU2dW5.js +363 -0
  36. package/dist/index.edge-C9_xuXyy.js +57 -0
  37. package/dist/{index.edge-DhV_hfZA.js → index.edge-CJ2TFpgF.js} +2 -2
  38. package/dist/index.edge-COJJ_Dv2.js +937 -0
  39. package/dist/index.edge-ChYa2LU4.js +14 -0
  40. package/dist/index.edge-ClLTmPFz.js +191 -0
  41. package/dist/{index.edge-BNElrrHY.js → index.edge-uSjRpm6Z.js} +5 -0
  42. package/dist/iso-BPQViXM8.js +10 -0
  43. package/dist/{layeredConfig-BhFC6TBD.js → layeredConfig-B4s0eZ5o.js} +11 -4
  44. package/dist/{majorModes-CZqrWarh.js → majorModes-IygGmbb8.js} +2 -2
  45. package/dist/majorModes-xpLK9HpD.js +1 -0
  46. package/dist/notification-bGq1frYG.js +99 -0
  47. package/dist/piConfig-CcoMX-1L.js +127 -0
  48. package/dist/{platformFiles-BTDsAsmT.js → platformFiles-Ccj9HCvA.js} +24 -2
  49. package/dist/pluginContributions-Be9EnCAW.js +16 -0
  50. package/dist/sealedChannel-BeWNTWys.js +27 -0
  51. package/dist/server-4CmqIbH2.js +1476 -0
  52. package/dist/{server-DesPQYzJ.js → server-5vLvBTTs.js} +1 -1
  53. package/dist/server-BHhb0oir.js +505 -0
  54. package/dist/server-Bm6pAAw8.js +935 -0
  55. package/dist/server-C82Qzoh3.js +2658 -0
  56. package/dist/server-C8HyW7wN.js +489 -0
  57. package/dist/{server-DSusAvqK.js → server-C9gff7gU.js} +1 -1
  58. package/dist/{server-CTIkoJXM.js → server-CIhwIcbA.js} +4 -4
  59. package/dist/{server-DbmCxFL-.js → server-CMaTba5B.js} +1 -1
  60. package/dist/{server-DolHpEoY.js → server-COE7BKSa.js} +1 -1
  61. package/dist/server-CQXqMpeC.js +1744 -0
  62. package/dist/{server-BG6gwBcv.js → server-CTSvwoDy.js} +5 -4
  63. package/dist/server-C_34VM3M.js +217 -0
  64. package/dist/{server-CuGXhVFA.js → server-C_3jK2WM.js} +5 -5
  65. package/dist/server-CcNMwEFQ.js +190 -0
  66. package/dist/{server-D-zQp04y.js → server-CjsKNdSN.js} +1 -1
  67. package/dist/{server-DQy8hVXg.js → server-ClsNJwdv.js} +8 -8
  68. package/dist/{server-DfBHHyQo.js → server-Co57A8MH.js} +2 -9
  69. package/dist/{server-CRtXiNBP.js → server-CpJNq249.js} +5 -5
  70. package/dist/{server-zYYAg7ki.js → server-CxGGQFJs.js} +5 -16
  71. package/dist/{server-DpVsUiA-.js → server-DSu_uLDX.js} +4 -4
  72. package/dist/server-DeSuziRK.js +680 -0
  73. package/dist/{server-BIjpcE0Y.js → server-ZsazKk-n.js} +3 -3
  74. package/dist/{server-CZoHLCxk.js → server-il_s2Ycz.js} +5 -93
  75. package/dist/server-ziNfBZ2M.js +295 -0
  76. package/dist/{sessionConfig-BLmM5XLM.js → sessionConfig-DzAs6Pt-.js} +64 -499
  77. package/dist/{notification-qvyJJ_Df.js → telemetry-Csv1ZxAn.js} +1 -99
  78. package/dist/truncate-M3KbFyVj.js +89 -0
  79. package/dist/web-Cfvbn9H1.js +3 -0
  80. package/dist/worker.js +4545 -12244
  81. package/dist/workflow-w5JPZXgc.js +23 -0
  82. package/package.json +32 -24
  83. package/dist/assets/plugins/assets/base-_m1hGahv.css +0 -2
  84. package/dist/assets/plugins/chunks/po-web-runtime-CGjOl_1I.js +0 -1
  85. package/dist/assets/plugins/slots/approval.09e72f36-BW92gZQg.js +0 -2
  86. package/dist/assets/plugins/slots/artifacts.50b639bb-B6zDJhex.js +0 -1
  87. package/dist/assets/plugins/slots/builtin-tools.75108f21-DS-dJ07p.js +0 -7
  88. package/dist/assets/plugins/slots/codemode.c58fb583--t-nrGeQ.js +0 -10
  89. package/dist/assets/plugins/slots/domain.753f9f92-DWSqP3Jw.js +0 -1
  90. package/dist/assets/plugins/slots/mcp.82cc1ff5-jPY2OCuu.js +0 -109
  91. package/dist/assets/plugins/slots/skill.62a0a1b3-GtWLT33O.js +0 -4
  92. package/dist/assets/plugins/slots/vault.3cbfcdc3-B7BKfR_H.js +0 -1
  93. package/dist/harnessStore-BDI-s999.js +0 -1
  94. package/dist/majorModes-CzAWXyaf.js +0 -1
@@ -1,102 +1,4 @@
1
1
  import { t as __commonJSMin } from "./rolldown-runtime-B-lAHAz2.js";
2
- import { Et as String$1, It as Literal, Qt as _Object_, en as Optional, wt as Union } from "./serverPlugin-pCqlBqQG.js";
3
- import { n as Check } from "./value-DGT5IoiK.js";
4
- //#region ../../core/po-core/src/schemas/notification.ts
5
- /** Provider-owned Cordis service for caller-authored notification requests. */
6
- const PO_NOTIFICATION_SERVICE = "po/notification";
7
- /** Custom session entry type used to publish normalized notification data. */
8
- const PO_NOTIFICATION_ENTRY_TYPE = "po-notification";
9
- const MAX_PO_NOTIFICATION_BODY_CHARACTERS = 4096;
10
- const PoNotificationLevelSchema = Union([
11
- Literal("info"),
12
- Literal("warning"),
13
- Literal("error")
14
- ]);
15
- /** The person must act on this notice; the host may push it to paired devices. Other notices stay in-app. */
16
- const PoNotificationAttentionSchema = Optional(Literal(true));
17
- _Object_({
18
- title: Optional(String$1({
19
- minLength: 1,
20
- maxLength: 128
21
- })),
22
- subtitle: Optional(String$1({
23
- minLength: 1,
24
- maxLength: 256
25
- })),
26
- body: String$1({
27
- minLength: 1,
28
- maxLength: MAX_PO_NOTIFICATION_BODY_CHARACTERS
29
- }),
30
- level: Optional(PoNotificationLevelSchema),
31
- attention: PoNotificationAttentionSchema
32
- }, { additionalProperties: false });
33
- const NormalizablePoNotificationRequestSchema = _Object_({
34
- title: Optional(String$1()),
35
- subtitle: Optional(String$1()),
36
- body: String$1(),
37
- level: Optional(PoNotificationLevelSchema),
38
- attention: PoNotificationAttentionSchema
39
- }, { additionalProperties: false });
40
- _Object_({
41
- version: Literal(1),
42
- title: String$1({ maxLength: 128 }),
43
- subtitle: String$1({ maxLength: 256 }),
44
- body: String$1({
45
- minLength: 1,
46
- maxLength: MAX_PO_NOTIFICATION_BODY_CHARACTERS
47
- }),
48
- level: PoNotificationLevelSchema,
49
- attention: PoNotificationAttentionSchema
50
- }, { additionalProperties: false });
51
- function replaceControlCharacters(text) {
52
- return Array.from(text, (character) => {
53
- const codePoint = character.codePointAt(0);
54
- return codePoint !== void 0 && (codePoint < 32 || codePoint === 127) ? " " : character;
55
- }).join("");
56
- }
57
- function normalizeText(text, maximum) {
58
- const normalized = replaceControlCharacters(text).replace(/\s+/gu, " ").trim();
59
- if (!normalized) return void 0;
60
- let truncated = "";
61
- for (const character of normalized) {
62
- if (truncated.length + character.length > maximum) break;
63
- truncated += character;
64
- }
65
- return truncated;
66
- }
67
- /** Normalize caller-owned notification text into a validated request. */
68
- function normalizePoNotificationRequest(request) {
69
- if (!Check(NormalizablePoNotificationRequestSchema, request)) return void 0;
70
- const body = normalizeText(request.body, MAX_PO_NOTIFICATION_BODY_CHARACTERS);
71
- if (!body) return void 0;
72
- const title = request.title && normalizeText(request.title, 128);
73
- const subtitle = request.subtitle && normalizeText(request.subtitle, 256);
74
- const normalized = {
75
- body,
76
- ...title ? { title } : {},
77
- ...subtitle ? { subtitle } : {},
78
- ...request.level ? { level: request.level } : {},
79
- ...request.attention ? { attention: true } : {}
80
- };
81
- return Object.freeze(normalized);
82
- }
83
- /** Builds normalized, versioned data for a Po notification session entry. */
84
- function createPoNotificationEntryData(request) {
85
- const normalized = normalizePoNotificationRequest(request);
86
- if (!normalized) return void 0;
87
- return Object.freeze({
88
- version: 1,
89
- title: normalized.title ?? "",
90
- subtitle: normalized.subtitle ?? "",
91
- body: normalized.body,
92
- level: normalized.level ?? "info",
93
- ...normalized.attention ? { attention: true } : {}
94
- });
95
- }
96
- function readPoNotificationService(context) {
97
- return context.get(PO_NOTIFICATION_SERVICE);
98
- }
99
- //#endregion
100
2
  //#region ../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/src/version.js
101
3
  var require_version = /* @__PURE__ */ __commonJSMin(((exports) => {
102
4
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -2529,4 +2431,4 @@ function createPoTelemetryService(options, runtimeLoader) {
2529
2431
  };
2530
2432
  }
2531
2433
  //#endregion
2532
- export { readPoNotificationService as a, createPoNotificationEntryData as i, createPoTelemetryService as n, PO_NOTIFICATION_ENTRY_TYPE as r, OperationCancelledError as t };
2434
+ export { createPoTelemetryService as n, sanitizeTelemetryAttributes as r, OperationCancelledError as t };
@@ -0,0 +1,89 @@
1
+ const DEFAULT_MAX_BYTES = 51200;
2
+ /** A trailing newline ends the last line rather than starting another. */
3
+ function splitLinesForCounting(content) {
4
+ if (content.length === 0) return [];
5
+ const lines = content.split("\n");
6
+ if (content.endsWith("\n")) lines.pop();
7
+ return lines;
8
+ }
9
+ function formatSize(bytes) {
10
+ if (bytes < 1024) return `${bytes}B`;
11
+ if (bytes < 1048576) return `${(bytes / 1024).toFixed(1)}KB`;
12
+ return `${(bytes / 1048576).toFixed(1)}MB`;
13
+ }
14
+ /** Cut one line to `maxChars` characters and mark it. */
15
+ function truncateLine(line, maxChars = 500) {
16
+ if (line.length <= maxChars) return {
17
+ text: line,
18
+ wasTruncated: false
19
+ };
20
+ return {
21
+ text: `${line.slice(0, maxChars)}... [truncated]`,
22
+ wasTruncated: true
23
+ };
24
+ }
25
+ /** Keep the first lines of `content` that fit both limits. */
26
+ function truncateHead(content, options = {}) {
27
+ const maxLines = options.maxLines ?? 2e3;
28
+ const maxBytes = options.maxBytes ?? 51200;
29
+ const totalBytes = Buffer.byteLength(content, "utf-8");
30
+ const lines = splitLinesForCounting(content);
31
+ const totalLines = lines.length;
32
+ if (totalLines <= maxLines && totalBytes <= maxBytes) return {
33
+ content,
34
+ truncated: false,
35
+ truncatedBy: null,
36
+ totalLines,
37
+ totalBytes,
38
+ outputLines: totalLines,
39
+ outputBytes: totalBytes,
40
+ lastLinePartial: false,
41
+ firstLineExceedsLimit: false,
42
+ maxLines,
43
+ maxBytes
44
+ };
45
+ const firstLine = lines[0] ?? "";
46
+ if (Buffer.byteLength(firstLine, "utf-8") > maxBytes) return {
47
+ content: "",
48
+ truncated: true,
49
+ truncatedBy: "bytes",
50
+ totalLines,
51
+ totalBytes,
52
+ outputLines: 0,
53
+ outputBytes: 0,
54
+ lastLinePartial: false,
55
+ firstLineExceedsLimit: true,
56
+ maxLines,
57
+ maxBytes
58
+ };
59
+ const kept = [];
60
+ let keptBytes = 0;
61
+ let truncatedBy = "lines";
62
+ for (let index = 0; index < lines.length && index < maxLines; index += 1) {
63
+ const line = lines[index] ?? "";
64
+ const lineBytes = Buffer.byteLength(line, "utf-8") + (index > 0 ? 1 : 0);
65
+ if (keptBytes + lineBytes > maxBytes) {
66
+ truncatedBy = "bytes";
67
+ break;
68
+ }
69
+ kept.push(line);
70
+ keptBytes += lineBytes;
71
+ }
72
+ if (kept.length >= maxLines && keptBytes <= maxBytes) truncatedBy = "lines";
73
+ const output = kept.join("\n");
74
+ return {
75
+ content: output,
76
+ truncated: true,
77
+ truncatedBy,
78
+ totalLines,
79
+ totalBytes,
80
+ outputLines: kept.length,
81
+ outputBytes: Buffer.byteLength(output, "utf-8"),
82
+ lastLinePartial: false,
83
+ firstLineExceedsLimit: false,
84
+ maxLines,
85
+ maxBytes
86
+ };
87
+ }
88
+ //#endregion
89
+ export { truncateLine as i, formatSize as n, truncateHead as r, DEFAULT_MAX_BYTES as t };
@@ -0,0 +1,3 @@
1
+ import "./serverPlugin-pCqlBqQG.js";
2
+ import "./approvalPrompt-1FPgNwMA.js";
3
+ import "./hubRevisions-58pU2dW5.js";