@amaster.ai/employee-runtime-connector 0.1.1-beta.51 → 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.
|
@@ -8403,13 +8403,60 @@ function maybeCapturePiMessage(event, messages, usage) {
|
|
|
8403
8403
|
}
|
|
8404
8404
|
function piMcpToolResults(event) {
|
|
8405
8405
|
const results = [];
|
|
8406
|
-
const
|
|
8406
|
+
const seen = /* @__PURE__ */ new Set();
|
|
8407
|
+
const retain = (parsed) => {
|
|
8408
|
+
if (!parsed) return;
|
|
8409
|
+
const invocationId = readString(parsed.invocationId);
|
|
8410
|
+
const intentId = readString(asRecord(parsed.artifactIntent).intentId);
|
|
8411
|
+
const identities = [
|
|
8412
|
+
...invocationId ? [`invocation:${invocationId}`] : [],
|
|
8413
|
+
...intentId ? [`artifact-intent:${intentId}`] : []
|
|
8414
|
+
];
|
|
8415
|
+
if (identities.some((identity2) => seen.has(identity2))) return;
|
|
8416
|
+
for (const identity2 of identities) seen.add(identity2);
|
|
8417
|
+
results.push(parsed);
|
|
8418
|
+
};
|
|
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
|
+
];
|
|
8407
8453
|
for (const rawMessage of messages) {
|
|
8408
8454
|
const message = asRecord(rawMessage);
|
|
8409
8455
|
if (message.role !== "toolResult") continue;
|
|
8410
|
-
|
|
8411
|
-
|
|
8412
|
-
|
|
8456
|
+
retainMcpResult(message);
|
|
8457
|
+
}
|
|
8458
|
+
if (readString(event?.type) === "tool_execution_end") {
|
|
8459
|
+
retainMcpResult(event?.result);
|
|
8413
8460
|
}
|
|
8414
8461
|
return results;
|
|
8415
8462
|
}
|
|
@@ -10134,7 +10181,7 @@ var source_acquisition_compatibility_default = {
|
|
|
10134
10181
|
};
|
|
10135
10182
|
|
|
10136
10183
|
// src/amaster-runtime-daemon.mjs
|
|
10137
|
-
var CONNECTOR_VERSION = "0.1.1-beta.
|
|
10184
|
+
var CONNECTOR_VERSION = "0.1.1-beta.53";
|
|
10138
10185
|
var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
|
|
10139
10186
|
var SOURCE_ACQUISITION_CAPABILITY = source_acquisition_compatibility_default.profileVersion;
|
|
10140
10187
|
var SOURCE_ACQUISITION_PROFILE_VERSION = source_acquisition_compatibility_default.profileVersion;
|
package/dist/amaster-runtime.mjs
CHANGED
|
@@ -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.
|
|
9
|
+
const CONNECTOR_VERSION = "0.1.1-beta.53";
|
|
10
10
|
|
|
11
11
|
const CAPABILITIES = [
|
|
12
12
|
"remote_registration",
|