@amaster.ai/employee-runtime-connector 0.1.1-beta.52 → 0.1.1-beta.53

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.
@@ -8416,18 +8416,47 @@ function piMcpToolResults(event) {
8416
8416
  for (const identity2 of identities) seen.add(identity2);
8417
8417
  results.push(parsed);
8418
8418
  };
8419
- const messages = [event?.message, ...Array.isArray(event?.messages) ? event.messages : []];
8419
+ const retainMcpResult = (rawResult) => {
8420
+ const result3 = asRecord(rawResult);
8421
+ const legacyStructuredContent = asRecord(asRecord(asRecord(result3.details).mcpResult).structuredContent);
8422
+ retain(governedMcpToolResult(legacyStructuredContent));
8423
+ const details = asRecord(result3.details);
8424
+ if (readString(details.server) !== "amaster") return;
8425
+ for (const rawContent of Array.isArray(result3.content) ? result3.content : []) {
8426
+ const content = asRecord(rawContent);
8427
+ if (readString(content.type) !== "text") continue;
8428
+ const text = readString(content.text);
8429
+ if (!text) continue;
8430
+ try {
8431
+ const directStructuredContent = asRecord(JSON.parse(text));
8432
+ const invocationId = readString(directStructuredContent.invocationId);
8433
+ const status = readString(directStructuredContent.status);
8434
+ if (!invocationId || !status) continue;
8435
+ const providerReceipt = asRecord(directStructuredContent.providerReceipt);
8436
+ const trustedProviderReceipt = readString(providerReceipt.provider) === "amaster_actions" && readString(providerReceipt.invocationId) === invocationId && Boolean(readString(providerReceipt.status));
8437
+ retain(governedMcpToolResult(trustedProviderReceipt ? directStructuredContent : {
8438
+ invocationId,
8439
+ status,
8440
+ // Never let a receipt-free success satisfy approved-action
8441
+ // completion; non-success states remain useful for control flow.
8442
+ ...status === "succeeded" ? { content: { status: "blocked" } } : {}
8443
+ }));
8444
+ } catch {
8445
+ }
8446
+ }
8447
+ };
8448
+ const messages = [
8449
+ event?.message,
8450
+ ...Array.isArray(event?.messages) ? event.messages : [],
8451
+ ...Array.isArray(event?.toolResults) ? event.toolResults : []
8452
+ ];
8420
8453
  for (const rawMessage of messages) {
8421
8454
  const message = asRecord(rawMessage);
8422
8455
  if (message.role !== "toolResult") continue;
8423
- const structuredContent = asRecord(asRecord(asRecord(message.details).mcpResult).structuredContent);
8424
- retain(governedMcpToolResult(structuredContent));
8456
+ retainMcpResult(message);
8425
8457
  }
8426
8458
  if (readString(event?.type) === "tool_execution_end") {
8427
- const structuredContent = asRecord(
8428
- asRecord(asRecord(asRecord(event?.result).details).mcpResult).structuredContent
8429
- );
8430
- retain(governedMcpToolResult(structuredContent));
8459
+ retainMcpResult(event?.result);
8431
8460
  }
8432
8461
  return results;
8433
8462
  }
@@ -10152,7 +10181,7 @@ var source_acquisition_compatibility_default = {
10152
10181
  };
10153
10182
 
10154
10183
  // src/amaster-runtime-daemon.mjs
10155
- var CONNECTOR_VERSION = "0.1.1-beta.52";
10184
+ var CONNECTOR_VERSION = "0.1.1-beta.53";
10156
10185
  var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
10157
10186
  var SOURCE_ACQUISITION_CAPABILITY = source_acquisition_compatibility_default.profileVersion;
10158
10187
  var SOURCE_ACQUISITION_PROFILE_VERSION = source_acquisition_compatibility_default.profileVersion;
@@ -6,7 +6,7 @@ import { basename, dirname, join, resolve } from "node:path";
6
6
  import { homedir, hostname } from "node:os";
7
7
  import { fileURLToPath } from "node:url";
8
8
 
9
- const CONNECTOR_VERSION = "0.1.1-beta.52";
9
+ const CONNECTOR_VERSION = "0.1.1-beta.53";
10
10
 
11
11
  const CAPABILITIES = [
12
12
  "remote_registration",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amaster.ai/employee-runtime-connector",
3
- "version": "0.1.1-beta.52",
3
+ "version": "0.1.1-beta.53",
4
4
  "description": "MirrorX runtime connector CLI and daemon",
5
5
  "license": "MIT",
6
6
  "type": "module",