@amaster.ai/employee-runtime-connector 0.1.0-beta.47 → 0.1.0-beta.49

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.
@@ -1792,6 +1792,7 @@ function createManagedPiMcpProfileApi(options = {}) {
1792
1792
  const MANAGED_BROWSER_USE_PLUGIN = "browser-use";
1793
1793
  const MANAGED_TELEMETRY_PACKAGE = "@amaster.ai/pi-telemetry";
1794
1794
  const MANAGED_TELEMETRY_ENV_NAMES = [
1795
+ "PI_TELEMETRY_TASK_RUN_ID",
1795
1796
  "PI_TELEMETRY_SERVICE_NAME",
1796
1797
  "PI_TELEMETRY_SERVICE_VERSION",
1797
1798
  "PI_TELEMETRY_INCLUDE_PAYLOADS",
@@ -3353,6 +3354,18 @@ function tcReadString(value) {
3353
3354
  function tcReadNumber(value, fallback = 0) {
3354
3355
  return typeof value === "number" && Number.isFinite(value) ? value : fallback;
3355
3356
  }
3357
+ var TC_PI_ARGUMENT_VALIDATION_NODE_BUDGET = 4e3;
3358
+ function tcContainsPiArgumentValidation(value, depth = 0, seen = /* @__PURE__ */ new WeakSet(), budget = { remaining: TC_PI_ARGUMENT_VALIDATION_NODE_BUDGET }) {
3359
+ if (budget.remaining <= 0) return false;
3360
+ budget.remaining -= 1;
3361
+ if (typeof value === "string") {
3362
+ return /\binvalid(?:[_ -]+)tool(?:[_ -]+)arguments?\b|\binvalid args json\b|\btool[- ]arguments? (?:failed )?validation\b/i.test(value.slice(0, 2e4));
3363
+ }
3364
+ if (!value || typeof value !== "object" || depth >= 6 || seen.has(value)) return false;
3365
+ seen.add(value);
3366
+ const entries = Array.isArray(value) ? value.slice(0, 40).map((entry, index) => [String(index), entry]) : Object.entries(value).slice(0, 80);
3367
+ return entries.some(([, entry]) => tcContainsPiArgumentValidation(entry, depth + 1, seen, budget));
3368
+ }
3356
3369
  function tcTruncateText(value, maxChars = 16e3) {
3357
3370
  const text = String(value ?? "");
3358
3371
  if (text.length <= maxChars) return text;
@@ -3724,6 +3737,7 @@ function summarizePiEvent(event) {
3724
3737
  if (type === "tool_execution_start" || type === "tool_execution_end") {
3725
3738
  const toolName = tcReadString(event.toolName) ?? "unknown";
3726
3739
  const completed = type === "tool_execution_end";
3740
+ const argumentValidationFailed = completed && event.isError === true && tcContainsPiArgumentValidation(event.result);
3727
3741
  return {
3728
3742
  stream: "system",
3729
3743
  level: completed && event.isError === true ? "error" : "info",
@@ -3733,7 +3747,8 @@ function summarizePiEvent(event) {
3733
3747
  executorEventType: type,
3734
3748
  toolName,
3735
3749
  toolCallId: tcReadString(event.toolCallId),
3736
- status: completed ? event.isError === true ? "failed" : "completed" : "started"
3750
+ status: completed ? event.isError === true ? "failed" : "completed" : "started",
3751
+ ...argumentValidationFailed ? { errorCode: "invalid_tool_arguments" } : {}
3737
3752
  }
3738
3753
  };
3739
3754
  }
@@ -7845,7 +7860,7 @@ function createBrowserSessionBroker(options) {
7845
7860
  if (browserExecutablePath && !browserExecutableReady) {
7846
7861
  return { ready: false, reason: "chrome_unavailable" };
7847
7862
  }
7848
- if (typeof playwright.chromium.executablePath === "function") {
7863
+ if (!browserExecutablePath && typeof playwright.chromium.executablePath === "function") {
7849
7864
  const executablePath = playwright.chromium.executablePath();
7850
7865
  if (!executablePath || !existsSync12(executablePath)) {
7851
7866
  return { ready: false, reason: "chrome_unavailable" };
@@ -8130,7 +8145,7 @@ function createPublicNetworkScope(options = {}) {
8130
8145
  }
8131
8146
 
8132
8147
  // src/amaster-runtime-daemon.mjs
8133
- var CONNECTOR_VERSION = "0.1.0-beta.47";
8148
+ var CONNECTOR_VERSION = "0.1.0-beta.49";
8134
8149
  var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
8135
8150
  var MAX_CHECKPOINT_BYTES = 20 * 1024 * 1024;
8136
8151
  var CHECKPOINT_TTL_MS = 24 * 60 * 60 * 1e3;
@@ -9485,6 +9500,7 @@ function buildExecutorEnv(config, command, workspace) {
9485
9500
  AMASTER_RUNTIME_EXECUTION_WORKDIR: cwd,
9486
9501
  AMASTER_RUNTIME_SOURCE_WORKSPACE: workspaceContext.sourceWorkspacePath ?? cwd,
9487
9502
  ...workspaceContext.executorHome ? { AMASTER_RUNTIME_EXECUTOR_HOME: workspaceContext.executorHome } : {},
9503
+ ...commandUsesPiExecutor(command) ? { PI_TELEMETRY_TASK_RUN_ID: runId } : {},
9488
9504
  PAPERCLIP_RUN_ID: readString(runtimeAuth.runId) ?? runId,
9489
9505
  PAPERCLIP_TASK_ID: readString(runtimeAuth.issueId) ?? issueId,
9490
9506
  PAPERCLIP_AGENT_ID: readString(runtimeAuth.agentId) ?? readString(asRecord(command.payload).agentId) ?? "",
@@ -5,7 +5,7 @@ import { dirname, join, resolve } from "node:path";
5
5
  import { homedir, hostname } from "node:os";
6
6
  import { fileURLToPath } from "node:url";
7
7
 
8
- const CONNECTOR_VERSION = "0.1.0-beta.47";
8
+ const CONNECTOR_VERSION = "0.1.0-beta.49";
9
9
 
10
10
  const CAPABILITIES = [
11
11
  "remote_registration",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amaster.ai/employee-runtime-connector",
3
- "version": "0.1.0-beta.47",
3
+ "version": "0.1.0-beta.49",
4
4
  "description": "MirrorX runtime connector CLI and daemon",
5
5
  "license": "MIT",
6
6
  "type": "module",