@amaster.ai/employee-runtime-connector 0.1.0-beta.19 → 0.1.0-beta.20

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.
@@ -2298,7 +2298,7 @@ function fixedRules(input, includeIssueLine) {
2298
2298
  function approvalContinuationText(input) {
2299
2299
  if (asRecord(input.nativeSession).mode !== "governed_action_approval") return "";
2300
2300
  return [
2301
- "Your first write call must repeat the previous turn's original runtime_action.submit arguments exactly.",
2301
+ "Your first write call must repeat the previous turn's original Runtime Action tool and arguments exactly.",
2302
2302
  "Do not reconstruct, summarize, or alter the action. The Gateway binds the approved request only when the canonical arguments hash is identical.",
2303
2303
  "Do not advance to another write action until that exact call returns status succeeded."
2304
2304
  ].join("\n");
@@ -4462,7 +4462,7 @@ function readWorkspaceStatus(cwd, opts = {}) {
4462
4462
  }
4463
4463
 
4464
4464
  // src/amaster-runtime-daemon.mjs
4465
- var CONNECTOR_VERSION = "0.1.0-beta.19";
4465
+ var CONNECTOR_VERSION = "0.1.0-beta.20";
4466
4466
  var MAX_CHECKPOINT_BYTES = 20 * 1024 * 1024;
4467
4467
  var CHECKPOINT_TTL_MS = 24 * 60 * 60 * 1e3;
4468
4468
  var PROMPT_AGENT_INSTRUCTION_FILE_ORDER = ["AGENTS.md", "SOUL.md"];
@@ -4472,7 +4472,7 @@ var AMASTER_PI_PROHIBITED_EXTRA_ARGS = /* @__PURE__ */ new Set(["--no-extensions
4472
4472
  var MAX_PI_CAPABILITY_SOURCE_ENTRIES = 200;
4473
4473
  var PI_COMPLETION_OUTPUT_GRACE_MS = 1e3;
4474
4474
  var PI_COMPLETION_LINE_BUFFER_MAX_CHARS = 8 * 1024 * 1024;
4475
- var PI_COMPLETION_OUTPUT_TYPES = /* @__PURE__ */ new Set(["agent_end"]);
4475
+ var PI_COMPLETION_OUTPUT_TYPES = /* @__PURE__ */ new Set(["agent_end", "approval_required"]);
4476
4476
  var PROCESS_GROUP_RSS_SAMPLE_MIN_INTERVAL_MS = 5e3;
4477
4477
  var activeRunCommands = /* @__PURE__ */ new Map();
4478
4478
  var pendingResultOutboxRunCommands = /* @__PURE__ */ new Map();
@@ -4505,7 +4505,8 @@ function resultOutboxPendingCount(config) {
4505
4505
  }
4506
4506
  function piCompletionOutputType(event) {
4507
4507
  const type = readString(asRecord(event).type);
4508
- return PI_COMPLETION_OUTPUT_TYPES.has(type ?? "") ? type : null;
4508
+ if (PI_COMPLETION_OUTPUT_TYPES.has(type ?? "")) return type;
4509
+ return piMcpToolResults(event).some((result2) => result2.status === "approval_required") ? "approval_required" : null;
4509
4510
  }
4510
4511
  function resultOutboxActiveRunCommands(config) {
4511
4512
  const dir = resultOutboxDir(config);
@@ -7237,11 +7238,11 @@ function piOutputUsageMetadataMissing(parsed) {
7237
7238
  return totalTokens <= 0;
7238
7239
  }
7239
7240
  function piCompletionOutputStopped(parsed, execution) {
7240
- return execution?.timedOut !== true && execution?.signal === "SIGTERM" && PI_COMPLETION_OUTPUT_TYPES.has(readString(parsed?.terminalEventType) ?? "") && Boolean(parsed?.summary || parsed?.finalMessage || Array.isArray(parsed?.messages) && parsed.messages.length > 0);
7241
+ return execution?.timedOut !== true && (execution?.signal === "SIGTERM" || execution?.exitCode === 143) && PI_COMPLETION_OUTPUT_TYPES.has(readString(execution?.completionOutputType) ?? "") && (execution?.completionOutputType === "approval_required" || Boolean(parsed?.summary || parsed?.finalMessage || Array.isArray(parsed?.messages) && parsed.messages.length > 0));
7241
7242
  }
7242
7243
  function piOutputValidationError(parsed, options = {}) {
7243
7244
  if (parsed?.errorMessage) return parsed.errorMessage;
7244
- if (!parsed?.hasAssistantOutput) {
7245
+ if (!parsed?.hasAssistantOutput && options.allowMissingAssistantOutput !== true) {
7245
7246
  return "Pi Agent exited without assistant output or valid turn output";
7246
7247
  }
7247
7248
  if (!parsed?.sawTurnEnd && options.allowMissingTurnEnd !== true) {
@@ -7437,7 +7438,7 @@ async function executeRunCommand(config, command) {
7437
7438
  ...Array.isArray(parsed.mcpToolResults) ? parsed.mcpToolResults.map(asRecord) : [],
7438
7439
  ...liveOutputLogger.mcpToolResults().map(asRecord)
7439
7440
  ];
7440
- const shouldPreserveNativeSession = managedMcpProfile && parsed.sessionId && execution.exitCode === 0 && !execution.timedOut && execution.cancelled !== true && !execution.spawnError && ["codex", "pi"].includes(executor.kind) && mcpToolResults.some((result3) => readString(result3.status) === "approval_required");
7441
+ const shouldPreserveNativeSession = managedMcpProfile && parsed.sessionId && (execution.exitCode === 0 || execution.completionOutputType === "approval_required") && !execution.timedOut && execution.cancelled !== true && !execution.spawnError && ["codex", "pi"].includes(executor.kind) && mcpToolResults.some((result3) => readString(result3.status) === "approval_required");
7441
7442
  if (shouldPreserveNativeSession) {
7442
7443
  try {
7443
7444
  const preserveSessionRollout = executor.kind === "pi" ? preserveManagedPiSessionRollout : preserveManagedCodexSessionRollout;
@@ -7485,7 +7486,8 @@ async function executeRunCommand(config, command) {
7485
7486
  const piUsageDiagnostic = executor.kind === "pi" && !hasOutputFlood && piOutputUsageMetadataMissing(parsed) ? "Pi Agent exited without usage metadata" : null;
7486
7487
  const completionOutputStopped = executor.kind === "pi" && piCompletionOutputStopped(parsed, execution);
7487
7488
  const piInvalidOutputError = executor.kind === "pi" ? piOutputValidationError(parsed, {
7488
- allowMissingTurnEnd: completionOutputStopped
7489
+ allowMissingTurnEnd: completionOutputStopped,
7490
+ allowMissingAssistantOutput: execution.completionOutputType === "approval_required"
7489
7491
  }) : null;
7490
7492
  const parsedErrorMessage = outputFloodError ?? memoryLimitError ?? piInvalidOutputError ?? nativeSessionRolloutError ?? nativeSessionRolloutCleanupError ?? parsed.errorMessage;
7491
7493
  const codexTransientFailure = executor.kind === "codex" && (execution.exitCode ?? 0) !== 0 ? classifyCodexTransientUpstreamError({
@@ -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.19";
8
+ const CONNECTOR_VERSION = "0.1.0-beta.20";
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.19",
3
+ "version": "0.1.0-beta.20",
4
4
  "description": "AMaster Employee runtime connector CLI and daemon",
5
5
  "license": "MIT",
6
6
  "type": "module",