@amaster.ai/employee-runtime-connector 0.1.1-beta.349 → 0.1.1-beta.350

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/README.md CHANGED
@@ -18,6 +18,28 @@ npm install --omit=dev --prefix /opt/pi-cli-runtime @amaster.ai/employee-runtime
18
18
 
19
19
  Do not use `latest`, `^`, or `~` in a runtime image. The image tag and connector package version should identify one immutable deployment.
20
20
 
21
+ ## Tool transcript payloads
22
+
23
+ Task-mode Pi tool start/end events retain bounded input and result data instead
24
+ of replacing both with lifecycle labels. Call IDs and `isError` stay unchanged;
25
+ older summary-only events still replay. This changes reporting only, not tool
26
+ execution or task acceptance. Existing known-runtime-credential redaction runs
27
+ before projection; the projection additionally redacts credential-like keys,
28
+ Bearer/credential assignments and private keys, and omits binary content blocks.
29
+
30
+ The projection limits strings to 2,000 characters, total text to 6,000 characters,
31
+ depth to 7, traversal to 240 nodes, arrays to 20 items and objects to 30 fields.
32
+ Serialized payloads above 12,000 characters use an explicit omission notice so
33
+ the JSONL event is never cut mid-record. Truncation remains visible. File paths
34
+ are data: Windows drive/UNC paths and CRLF text are JSON-escaped without shell
35
+ commands or OS-specific path conversion. The module is included in the existing
36
+ Node 20 daemon bundle on every platform.
37
+
38
+ Existing historical events cannot gain details that were never uploaded.
39
+ New details require the executing desktop/cloud connector to use the updated
40
+ bundle; deploying the frontend alone is insufficient. No connector install,
41
+ restart or release is performed by the source change.
42
+
21
43
  ## Incremental type safety
22
44
 
23
45
  `pnpm typecheck` runs the legacy entry-point syntax checks plus TypeScript strict
@@ -26477,6 +26477,75 @@ function terminatingRunDispositionEvidence(results, expected = {}) {
26477
26477
  };
26478
26478
  }
26479
26479
 
26480
+ // src/amaster-runtime-daemon/typed/tool-transcript-payload.mjs
26481
+ var SECRET_KEY = /secret|token|password|passwd|credential|private[_-]?key|api[_-]?key|authorization|cookie|bearer|jwt/i;
26482
+ var OMITTED = "[\u5185\u5BB9\u5DF2\u622A\u65AD]";
26483
+ var REDACTED = "[\u5DF2\u8131\u654F]";
26484
+ function scrubText(text2) {
26485
+ return text2.replace(/-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?(?:-----END [A-Z ]*PRIVATE KEY-----|$)/g, REDACTED).replace(/\b((?:set-cookie|cookie)\s*:\s*)[^\r\n]*/gi, `$1${REDACTED}`).replace(/\bBearer\s+[^\s"'<>]+/gi, `Bearer ${REDACTED}`).replace(/(--(?:api[_-]?key|token|password|secret)\s+)(?:"[^"]*"|'[^']*'|\S+)/gi, `$1${REDACTED}`).replace(/\b((?:api[_-]?key|access[_-]?token|refresh[_-]?token|password|passwd|secret|credential|authorization|cookie)\s*[=:]\s*)(?:"[^"\r\n]*"|'[^'\r\n]*'|[^\s&,;]+)/gi, `$1${REDACTED}`).replace(/(https?:\/\/)[^\s/@]+:[^\s/@]+@/gi, `$1${REDACTED}@`);
26486
+ }
26487
+ function compactToolTranscriptPayload(value) {
26488
+ const budget = { nodes: 240, chars: 6e3, truncated: false };
26489
+ const seen = /* @__PURE__ */ new WeakSet();
26490
+ const omitted = () => {
26491
+ budget.truncated = true;
26492
+ return OMITTED;
26493
+ };
26494
+ function visit(input, depth = 0) {
26495
+ if (--budget.nodes < 0 || depth > 7 || budget.chars <= 0) return omitted();
26496
+ if (typeof input === "string") {
26497
+ if (/^\s*[{[]/.test(input)) {
26498
+ try {
26499
+ return JSON.stringify(visit(JSON.parse(input), depth + 1));
26500
+ } catch {
26501
+ return "\u7ED3\u6784\u5316\u5185\u5BB9\u4E0D\u5B8C\u6574\uFF0C\u672A\u5305\u542B\u5728\u8FC7\u7A0B\u6458\u8981\u4E2D";
26502
+ }
26503
+ }
26504
+ const text2 = scrubText(input);
26505
+ const limit = Math.min(2e3, budget.chars);
26506
+ budget.chars -= Math.min(text2.length, limit);
26507
+ return text2.length > limit ? text2.slice(0, limit) + omitted() : text2;
26508
+ }
26509
+ if (input == null || typeof input === "boolean" || typeof input === "number") return input;
26510
+ if (typeof input !== "object") return void 0;
26511
+ if (seen.has(input)) return omitted();
26512
+ seen.add(input);
26513
+ let result2;
26514
+ const object = (
26515
+ /** @type {Record<string, unknown>} */
26516
+ input
26517
+ );
26518
+ if (Array.isArray(input)) {
26519
+ const items = input.slice(0, 20).map((item) => visit(item, depth + 1));
26520
+ if (input.length > 20) items.push(omitted());
26521
+ result2 = items;
26522
+ } else if (typeof object.type === "string" && ["image", "audio", "resource"].includes(object.type)) {
26523
+ result2 = { type: object.type, summary: "\u9644\u4EF6\u5185\u5BB9\u672A\u5305\u542B\u5728\u8FC7\u7A0B\u6458\u8981\u4E2D" };
26524
+ } else {
26525
+ const fields = /* @__PURE__ */ Object.create(null);
26526
+ const entries = Object.entries(input);
26527
+ for (const [key, entry] of entries.slice(0, 30)) {
26528
+ if (key.length > 120) {
26529
+ omitted();
26530
+ continue;
26531
+ }
26532
+ fields[key] = SECRET_KEY.test(key) ? REDACTED : visit(entry, depth + 1);
26533
+ }
26534
+ if (entries.length > 30) {
26535
+ omitted();
26536
+ fields._truncated = true;
26537
+ }
26538
+ result2 = fields;
26539
+ }
26540
+ seen.delete(input);
26541
+ return result2;
26542
+ }
26543
+ const projected = visit(value);
26544
+ const data = budget.truncated && projected && typeof projected === "object" && !Array.isArray(projected) ? { ...projected, _truncated: true } : projected;
26545
+ if (JSON.stringify(data ?? null).length > 12e3) return { summary: "\u5185\u5BB9\u8FC7\u957F\uFF0C\u672A\u5305\u542B\u5728\u8FC7\u7A0B\u6458\u8981\u4E2D", _truncated: true };
26546
+ return data;
26547
+ }
26548
+
26480
26549
  // src/amaster-runtime-daemon/transcript-compaction.mjs
26481
26550
  function tcAsRecord(value) {
26482
26551
  return typeof value === "object" && value !== null && !Array.isArray(value) ? value : {};
@@ -26600,12 +26669,12 @@ function compactPiToolLifecycleForTranscript(event, readableSummary) {
26600
26669
  type,
26601
26670
  toolCallId,
26602
26671
  toolName,
26603
- args: { summary }
26672
+ args: record10.args == null ? { summary } : compactToolTranscriptPayload(record10.args)
26604
26673
  } : {
26605
26674
  type,
26606
26675
  toolCallId,
26607
26676
  toolName,
26608
- result: summary,
26677
+ result: record10.result == null ? summary : compactToolTranscriptPayload(record10.result),
26609
26678
  isError: record10.isError === true
26610
26679
  });
26611
26680
  }
@@ -33749,7 +33818,7 @@ function assertRequiredTaskAttachmentMaterialized(input, materialized) {
33749
33818
  }
33750
33819
 
33751
33820
  // src/amaster-runtime-daemon.mjs
33752
- var CONNECTOR_VERSION = "0.1.1-beta.349";
33821
+ var CONNECTOR_VERSION = "0.1.1-beta.350";
33753
33822
  var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
33754
33823
  var daemonRequire = createRequire(import.meta.url);
33755
33824
  var MAX_CHECKPOINT_BYTES = 20 * 1024 * 1024;
@@ -7,7 +7,7 @@ import { homedir, hostname } from "node:os";
7
7
  import { fileURLToPath } from "node:url";
8
8
  import { BUILD_SUPPORTED_CAPABILITIES } from "./amaster-runtime-daemon/capability-registry.mjs";
9
9
 
10
- const CONNECTOR_VERSION = "0.1.1-beta.349";
10
+ const CONNECTOR_VERSION = "0.1.1-beta.350";
11
11
 
12
12
  const CONFIG_KEY_MAP = new Map([
13
13
  ["server_url", "AMASTER_EMPLOYEE_SERVER_URL"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amaster.ai/employee-runtime-connector",
3
- "version": "0.1.1-beta.349",
3
+ "version": "0.1.1-beta.350",
4
4
  "description": "MirrorX runtime connector CLI and daemon",
5
5
  "license": "MIT",
6
6
  "type": "module",