@amaster.ai/employee-runtime-connector 0.1.1-beta.27 → 0.1.1-beta.28

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.
@@ -2384,6 +2384,36 @@ function managedPiMcpArgsNormalizerExtensionSource() {
2384
2384
  ].join("\n\n");
2385
2385
  }
2386
2386
 
2387
+ // src/amaster-runtime-daemon/pi-mcp-adapter-config.mjs
2388
+ var CONFIG_HASH_V2_24_MINIMUM = [2, 24, 0];
2389
+ function piMcpAdapterVersionAtLeast(version, minimum) {
2390
+ const actual = version.split(/[.-]/, 3).map(Number);
2391
+ for (let index = 0; index < minimum.length; index += 1) {
2392
+ if (actual[index] > minimum[index]) return true;
2393
+ if (actual[index] < minimum[index]) return false;
2394
+ }
2395
+ return true;
2396
+ }
2397
+ function piMcpAdapterServerConfigIdentity(definition, adapterVersion) {
2398
+ const supportsV224Config = piMcpAdapterVersionAtLeast(adapterVersion, CONFIG_HASH_V2_24_MINIMUM);
2399
+ return {
2400
+ command: definition.command,
2401
+ args: definition.args,
2402
+ ...supportsV224Config ? { socket: definition.socket } : {},
2403
+ env: definition.env,
2404
+ cwd: definition.cwd,
2405
+ url: definition.url,
2406
+ headers: definition.headers,
2407
+ auth: definition.auth,
2408
+ ...supportsV224Config ? { protocolVersion: definition.protocolVersion } : {},
2409
+ bearerToken: definition.bearerToken,
2410
+ bearerTokenEnv: definition.bearerTokenEnv,
2411
+ exposeResources: definition.exposeResources,
2412
+ ...supportsV224Config ? { includeTools: definition.includeTools } : {},
2413
+ excludeTools: definition.excludeTools
2414
+ };
2415
+ }
2416
+
2387
2417
  // src/amaster-runtime-daemon/pi-effective-tools-attestor.mjs
2388
2418
  import { createHash as createHash2 } from "node:crypto";
2389
2419
  var MANAGED_PI_EFFECTIVE_TOOLS_ATTESTOR_FILENAME = "amaster-effective-tools-attestor.js";
@@ -2848,20 +2878,23 @@ function createManagedPiMcpProfileApi(options = {}) {
2848
2878
  function sha2562(value) {
2849
2879
  return createHash3("sha256").update(value).digest("hex");
2850
2880
  }
2851
- function adapterServerConfigHash(definition) {
2852
- return sha2562(stablePiJson({
2853
- command: definition.command,
2854
- args: definition.args,
2855
- env: definition.env,
2856
- cwd: definition.cwd,
2857
- url: definition.url,
2858
- headers: definition.headers,
2859
- auth: definition.auth,
2860
- bearerToken: definition.bearerToken,
2861
- bearerTokenEnv: definition.bearerTokenEnv,
2862
- exposeResources: definition.exposeResources,
2863
- excludeTools: definition.excludeTools
2864
- }));
2881
+ function piMcpAdapterVersion(piHome) {
2882
+ const packagePath = join4(piHome, "npm", "node_modules", "pi-mcp-adapter", "package.json");
2883
+ let packageJson;
2884
+ try {
2885
+ packageJson = JSON.parse(readFileSync3(packagePath, "utf8"));
2886
+ } catch {
2887
+ throw new Error("pi_managed_mcp_adapter_version_unavailable");
2888
+ }
2889
+ const version = typeof packageJson.version === "string" ? packageJson.version.trim() : "";
2890
+ if (!/^\d+\.\d+\.\d+(?:[-+].+)?$/.test(version)) {
2891
+ throw new Error("pi_managed_mcp_adapter_version_invalid");
2892
+ }
2893
+ return version;
2894
+ }
2895
+ function adapterServerConfigHash(definition, adapterVersion) {
2896
+ const identity2 = piMcpAdapterServerConfigIdentity(definition, adapterVersion);
2897
+ return sha2562(stablePiJson(identity2));
2865
2898
  }
2866
2899
  function validateDirectCatalog(gateway, mcpToolMode) {
2867
2900
  const catalog = record6(gateway.toolCatalog);
@@ -3483,6 +3516,7 @@ ${result3.stderr ?? ""}`, "Pi", MINIMUM_PI_VERSION);
3483
3516
  const config = {
3484
3517
  settings: {
3485
3518
  toolPrefix: "none",
3519
+ scriptMode: false,
3486
3520
  ...mcpToolMode === MANAGED_PI_DIRECT_TYPED_MCP_TOOL_MODE ? { disableProxyTool: true } : {}
3487
3521
  },
3488
3522
  mcpServers: {
@@ -3522,6 +3556,7 @@ ${result3.stderr ?? ""}`, "Pi", MINIMUM_PI_VERSION);
3522
3556
  }
3523
3557
  const cachePath = join4(profileRoot, "mcp-cache.json");
3524
3558
  let directAttestationInput = null;
3559
+ const adapterVersion = piMcpAdapterVersion(sharedRuntime.home);
3525
3560
  if (directCatalog) {
3526
3561
  writeProfileExtension(
3527
3562
  MANAGED_PI_EFFECTIVE_TOOLS_ATTESTOR_FILENAME,
@@ -3531,7 +3566,7 @@ ${result3.stderr ?? ""}`, "Pi", MINIMUM_PI_VERSION);
3531
3566
  version: 1,
3532
3567
  servers: {
3533
3568
  [SUPPORTED_SERVER_NAME2]: {
3534
- configHash: adapterServerConfigHash(serverConfig),
3569
+ configHash: adapterServerConfigHash(serverConfig, adapterVersion),
3535
3570
  tools: directCatalog.tools.map((tool) => ({
3536
3571
  name: tool.exposedName,
3537
3572
  description: tool.description,
@@ -3631,6 +3666,7 @@ ${result3.stderr ?? ""}`, "Pi", MINIMUM_PI_VERSION);
3631
3666
  const attestationFacts = {
3632
3667
  connectorVersion: nonEmpty2(input.connectorVersion, "connectorVersion"),
3633
3668
  executorKind: "pi",
3669
+ adapterVersion,
3634
3670
  ...executorAttestation,
3635
3671
  mcpToolMode,
3636
3672
  mcpArgsNormalization: mcpToolMode === MANAGED_PI_DIRECT_TYPED_MCP_TOOL_MODE ? "none" : MANAGED_PI_MCP_ARGS_NORMALIZATION,
@@ -9378,7 +9414,7 @@ function assertSourceAcquisitionRuntimeAuthority({
9378
9414
  }
9379
9415
 
9380
9416
  // src/amaster-runtime-daemon.mjs
9381
- var CONNECTOR_VERSION = "0.1.1-beta.27";
9417
+ var CONNECTOR_VERSION = "0.1.1-beta.28";
9382
9418
  var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
9383
9419
  var SOURCE_ACQUISITION_CAPABILITY = "source_acquisition_v1";
9384
9420
  var SOURCE_ACQUISITION_PROFILE_VERSION = "source_acquisition_v1";
@@ -9396,6 +9432,7 @@ var MAX_PI_CAPABILITY_SOURCE_ENTRIES = 200;
9396
9432
  var PI_COMPLETION_OUTPUT_GRACE_MS = 1e3;
9397
9433
  var PI_COMPLETION_LINE_BUFFER_MAX_CHARS = 8 * 1024 * 1024;
9398
9434
  var PI_COMPLETION_OUTPUT_TYPES = /* @__PURE__ */ new Set(["agent_end", "approval_required"]);
9435
+ var PI_MODEL_CALL_PROTOCOL_AMPLIFICATION_LIMIT = 8;
9399
9436
  var PROCESS_GROUP_RSS_SAMPLE_MIN_INTERVAL_MS = 5e3;
9400
9437
  var activeRunCommands = /* @__PURE__ */ new Map();
9401
9438
  var pendingResultOutboxRunCommands = /* @__PURE__ */ new Map();
@@ -11032,6 +11069,10 @@ async function executeModelCallCommand(config, command, signal) {
11032
11069
  config.executorMaxOutputBytes,
11033
11070
  readNumber(payload.maxOutputBytes, 512 * 1024)
11034
11071
  ));
11072
+ const protocolOutputLimitBytes = responseContract && executor.kind === "pi" ? Math.min(
11073
+ config.executorMaxOutputBytes,
11074
+ maxOutputBytes * PI_MODEL_CALL_PROTOCOL_AMPLIFICATION_LIMIT
11075
+ ) : maxOutputBytes;
11035
11076
  let piModelCallProfile = null;
11036
11077
  let piModelCallIdentity = null;
11037
11078
  let modelTarget = null;
@@ -11092,7 +11133,7 @@ async function executeModelCallCommand(config, command, signal) {
11092
11133
  env: piModelCallProfile?.env ?? baseEnv,
11093
11134
  stdin: invocation.stdin === "prompt" ? prompt : "",
11094
11135
  timeoutSeconds,
11095
- maxOutputBytes,
11136
+ maxOutputBytes: protocolOutputLimitBytes,
11096
11137
  executorKind: executor.kind,
11097
11138
  signal,
11098
11139
  ...piModelCallIdentity ? { spawnIdentity: piModelCallIdentity } : {}
@@ -11138,6 +11179,9 @@ async function executeModelCallCommand(config, command, signal) {
11138
11179
  stopReason: parsed.stopReason ?? null,
11139
11180
  terminalEventType: parsed.terminalEventType ?? null,
11140
11181
  semanticBytes,
11182
+ // Baseline requested before Pi JSONL protocol-envelope amplification.
11183
+ baseProtocolOutputLimitBytes: maxOutputBytes,
11184
+ protocolOutputLimitBytes,
11141
11185
  outputBytes: Object.values(execution.outputBytes).reduce((total, bytes) => total + bytes, 0),
11142
11186
  outputBytesByStream: execution.outputBytes,
11143
11187
  retainedOutputBytes: Object.values(execution.retainedOutputBytes).reduce((total, bytes) => total + bytes, 0),
@@ -11154,7 +11198,7 @@ async function executeModelCallCommand(config, command, signal) {
11154
11198
  outputFlood: {
11155
11199
  stream: readString(outputFlood.stream),
11156
11200
  bytes: readNumber(outputFlood.bytes, 0),
11157
- limitBytes: readNumber(outputFlood.limitBytes, maxOutputBytes)
11201
+ limitBytes: readNumber(outputFlood.limitBytes, protocolOutputLimitBytes)
11158
11202
  }
11159
11203
  } : semanticOutputExceeded ? {
11160
11204
  errorCode: "model_call_semantic_output_exceeded",
@@ -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.27";
9
+ const CONNECTOR_VERSION = "0.1.1-beta.28";
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.27",
3
+ "version": "0.1.1-beta.28",
4
4
  "description": "MirrorX runtime connector CLI and daemon",
5
5
  "license": "MIT",
6
6
  "type": "module",