@amaster.ai/employee-runtime-connector 0.1.1-beta.221 → 0.1.1-beta.223

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
@@ -20,6 +20,14 @@ Do not use `latest`, `^`, or `~` in a runtime image. The image tag and connector
20
20
 
21
21
  Immutable images should pin an exact package version as their baseline. The current connector does not download or replace runtime code while running; package upgrades and rollbacks belong to the image build and rollout.
22
22
 
23
+ The governed MCP cache identity follows the installed `pi-mcp-adapter` version.
24
+ Adapter 2.26+ includes `requestHeadersCommand` even when it is unset; older
25
+ versions must retain their previous identity. Upgrade the connector together
26
+ with the adapter and verify the actual version pair using the Pi MCP contract
27
+ tests. A cache identity mismatch can reject all governed tools before execution;
28
+ deleting user configuration, credentials, sessions, or connector state cannot
29
+ repair this mismatch. Each run generates its own governed cache.
30
+
23
31
  Connector capability declaration is automatic. The exact package build declares
24
32
  what it implements, and runtime readiness removes dynamic capabilities when their
25
33
  executor or supporting runtime is unavailable. Operators restrict what the Server
@@ -12261,6 +12261,12 @@ var externalObjectSummarySchema = external_exports.object({
12261
12261
  var agentAdapterTypeSchema = external_exports.string().trim().min(1).default("process").describe(`Known built-in adapters: ${AGENT_ADAPTER_TYPES.join(", ")}. External adapters may register additional non-empty string types at runtime.`);
12262
12262
  var optionalAgentAdapterTypeSchema = external_exports.string().trim().min(1).optional();
12263
12263
 
12264
+ // ../shared/src/agent-eligibility.ts
12265
+ var NON_ASSIGNABLE_AGENT_STATUSES = ["pending_approval", "terminated"];
12266
+ var ASSIGNABLE_AGENT_STATUSES = ["active", "paused", "idle", "running", "error"];
12267
+ var NON_ASSIGNABLE_AGENT_STATUS_SET = new Set(NON_ASSIGNABLE_AGENT_STATUSES);
12268
+ var ASSIGNABLE_AGENT_STATUS_SET = new Set(ASSIGNABLE_AGENT_STATUSES);
12269
+
12264
12270
  // ../shared/src/trust-policy.ts
12265
12271
  var TRUST_PRESETS = ["standard", "low_trust_review"];
12266
12272
  var LOW_TRUST_REVIEW_PRESET = "low_trust_review";
@@ -19376,6 +19382,7 @@ function resolvePiRunModelContext(agentDir, providerId, modelId) {
19376
19382
 
19377
19383
  // src/amaster-runtime-daemon/pi-mcp-adapter-config.mjs
19378
19384
  var CONFIG_HASH_V2_24_MINIMUM = [2, 24, 0];
19385
+ var CONFIG_HASH_V2_26_MINIMUM = [2, 26, 0];
19379
19386
  function piMcpAdapterVersionAtLeast(version, minimum) {
19380
19387
  const actual = version.split(/[.-]/, 3).map(Number);
19381
19388
  for (let index = 0; index < minimum.length; index += 1) {
@@ -19394,6 +19401,17 @@ function piMcpAdapterServerConfigIdentity(definition, adapterVersion) {
19394
19401
  cwd: definition.cwd,
19395
19402
  url: definition.url,
19396
19403
  headers: definition.headers,
19404
+ // Adapter 2.26 added this key to its stable hash, including when undefined.
19405
+ // Keep the older identity intact so upgrading does not invalidate either
19406
+ // generation's freshly generated governed tool cache.
19407
+ ...piMcpAdapterVersionAtLeast(adapterVersion, CONFIG_HASH_V2_26_MINIMUM) ? {
19408
+ requestHeadersCommand: definition.requestHeadersCommand ? {
19409
+ command: definition.requestHeadersCommand.command,
19410
+ args: definition.requestHeadersCommand.args,
19411
+ env: definition.requestHeadersCommand.env,
19412
+ timeoutMs: definition.requestHeadersCommand.timeoutMs
19413
+ } : void 0
19414
+ } : {},
19397
19415
  auth: definition.auth,
19398
19416
  ...supportsV224Config ? { protocolVersion: definition.protocolVersion } : {},
19399
19417
  bearerToken: definition.bearerToken,
@@ -26074,6 +26092,27 @@ function compactExecutorJsonlForTranscript(event) {
26074
26092
  _truncated: true
26075
26093
  });
26076
26094
  }
26095
+ function compactPiToolLifecycleForTranscript(event, readableSummary) {
26096
+ const record6 = tcAsRecord(event);
26097
+ const type = tcReadString(record6.type);
26098
+ if (type !== "tool_execution_start" && type !== "tool_execution_end") return null;
26099
+ const toolCallId = tcReadString(record6.toolCallId);
26100
+ if (!toolCallId) return null;
26101
+ const toolName = tcReadString(record6.toolName) ?? "tool";
26102
+ const summary = tcTruncateText(readableSummary || `${type === "tool_execution_start" ? "\u5DE5\u5177\u5F00\u59CB" : "\u5DE5\u5177\u5B8C\u6210"}\uFF1A${toolName}`, 500);
26103
+ return JSON.stringify(type === "tool_execution_start" ? {
26104
+ type,
26105
+ toolCallId,
26106
+ toolName,
26107
+ args: { summary }
26108
+ } : {
26109
+ type,
26110
+ toolCallId,
26111
+ toolName,
26112
+ result: summary,
26113
+ isError: record6.isError === true
26114
+ });
26115
+ }
26077
26116
  function summarizeTokenUsage(usage) {
26078
26117
  const record6 = tcAsRecord(usage);
26079
26118
  const inputTokens = tcReadNumber(record6.input_tokens ?? record6.inputTokens, 0);
@@ -29532,7 +29571,7 @@ function assertRequiredTaskAttachmentMaterialized(input, materialized) {
29532
29571
  }
29533
29572
 
29534
29573
  // src/amaster-runtime-daemon.mjs
29535
- var CONNECTOR_VERSION = "0.1.1-beta.221";
29574
+ var CONNECTOR_VERSION = "0.1.1-beta.223";
29536
29575
  var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
29537
29576
  var daemonRequire = createRequire(import.meta.url);
29538
29577
  var MAX_CHECKPOINT_BYTES = 20 * 1024 * 1024;
@@ -31745,7 +31784,20 @@ function createLiveOutputLogger(config, command, executorKind, protectedValues =
31745
31784
  }
31746
31785
  }
31747
31786
  let entry = null;
31748
- if (event && shouldPreserveExecutorJsonlForTranscript(executorKind, event)) {
31787
+ const summarizedEntry = summarizeExecutorOutputLine(executorKind, stream, text2);
31788
+ const piToolLifecycle = executorKind === "pi" && event ? compactPiToolLifecycleForTranscript(event, summarizedEntry?.message) : null;
31789
+ if (piToolLifecycle) {
31790
+ entry = {
31791
+ stream: "stdout",
31792
+ level: summarizedEntry?.level ?? "info",
31793
+ message: piToolLifecycle,
31794
+ payload: summarizedEntry?.payload ?? {
31795
+ presentationKind: "tool",
31796
+ executorKind,
31797
+ executorEventType: readString(event.type)
31798
+ }
31799
+ };
31800
+ } else if (event && shouldPreserveExecutorJsonlForTranscript(executorKind, event)) {
31749
31801
  entry = {
31750
31802
  stream: "stdout",
31751
31803
  level: "info",
@@ -31757,7 +31809,7 @@ function createLiveOutputLogger(config, command, executorKind, protectedValues =
31757
31809
  }
31758
31810
  };
31759
31811
  } else {
31760
- entry = summarizeExecutorOutputLine(executorKind, stream, text2);
31812
+ entry = summarizedEntry;
31761
31813
  }
31762
31814
  if (entry && shouldSuppressDuplicatePiAgentMessage(entry)) {
31763
31815
  if (stream === "stdout") {
@@ -35544,10 +35596,9 @@ async function runOnce(config) {
35544
35596
  await flushResultOutbox(config);
35545
35597
  await flushRunCompletionStates(config);
35546
35598
  const availableSlots = availableCommandSlots(config);
35547
- if (availableSlots <= 0) return 0;
35548
35599
  const leaseId = `amaster-${Date.now()}`;
35549
35600
  const polled = await postJson(config, `/api/amaster/runtime-connectors/${config.connectorId}/commands/poll`, {
35550
- limit: availableSlots,
35601
+ limit: Math.max(1, availableSlots),
35551
35602
  maxConcurrentCommands: maxConcurrentCommands(config),
35552
35603
  leaseId,
35553
35604
  leaseSeconds: config.leaseSeconds
@@ -35578,10 +35629,9 @@ async function dispatchAvailableCommands(config, options = {}) {
35578
35629
  await flushResultOutbox(config);
35579
35630
  await flushRunCompletionStates(config);
35580
35631
  const availableSlots = availableCommandSlots(config);
35581
- if (availableSlots <= 0) return 0;
35582
35632
  const leaseId = `amaster-${Date.now()}`;
35583
35633
  const polled = await postJson(config, `/api/amaster/runtime-connectors/${config.connectorId}/commands/poll`, {
35584
- limit: availableSlots,
35634
+ limit: Math.max(1, availableSlots),
35585
35635
  maxConcurrentCommands: maxConcurrentCommands(config),
35586
35636
  leaseId,
35587
35637
  leaseSeconds: config.leaseSeconds
@@ -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.221";
10
+ const CONNECTOR_VERSION = "0.1.1-beta.223";
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.221",
3
+ "version": "0.1.1-beta.223",
4
4
  "description": "MirrorX runtime connector CLI and daemon",
5
5
  "license": "MIT",
6
6
  "type": "module",