local-commander-agent-linux-x64 0.3.53 → 0.3.54

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "local-commander-agent-linux-x64",
3
- "version": "0.3.53",
3
+ "version": "0.3.54",
4
4
  "description": "Local Commander runtime for Linux x64. Installed automatically by local-commander-agent; run npx local-commander-agent@latest instead.",
5
5
  "os": [
6
6
  "linux"
package/runtime/agent.mjs CHANGED
@@ -27150,11 +27150,13 @@ var NativeJournal = class _NativeJournal {
27150
27150
  }
27151
27151
  /** The journal lock is only taken over once the previous agent process has exited, so its in-process work is gone.
27152
27152
  * An interrupted entry is AGENT_RESTARTED (stopped, outcome unknown) when it recorded its supervisors and none is
27153
- * still alive; otherwise, including every entry from an older agent, it stays EXECUTION_UNKNOWN (#194). */
27153
+ * still alive; otherwise, including every entry from an older agent, it stays EXECUTION_UNKNOWN (#194).
27154
+ * Previously reported unknown work gets the same proof check on a later startup, never on a mere reconnect. */
27154
27155
  recoverAfterRestart(liveness) {
27155
27156
  return this.enqueue(async () => {
27156
27157
  let count4 = 0;
27157
- const interrupted = [...this.entries.values()].filter((e) => ["accepted", "running"].includes(e.state));
27158
+ const retryUnknown = (e) => e.state === "unknown" && e.resultCode === "EXECUTION_UNKNOWN" && !!e.workspaceGrantId && !!e.policyVersion && e.supervisors !== void 0;
27159
+ const interrupted = [...this.entries.values()].filter((e) => ["accepted", "running"].includes(e.state) || retryUnknown(e));
27158
27160
  const pids = [...new Set(interrupted.flatMap((e) => e.supervisors ?? []))];
27159
27161
  const linuxSupervisors = interrupted.flatMap((e) => e.linuxSupervisors ?? []), darwinSupervisors = interrupted.flatMap((e) => e.darwinSupervisors ?? []);
27160
27162
  let live = /* @__PURE__ */ new Set();
@@ -27167,11 +27169,19 @@ var NativeJournal = class _NativeJournal {
27167
27169
  }
27168
27170
  for (const original of this.entries.values()) {
27169
27171
  const stranded = original.state === "prepared";
27170
- if (!stranded && !["accepted", "running"].includes(original.state)) continue;
27172
+ const retry = retryUnknown(original);
27173
+ if (!stranded && !["accepted", "running"].includes(original.state) && !retry) continue;
27171
27174
  const e = clone2(original);
27172
27175
  e.state = stranded ? "rejected" : "unknown";
27173
27176
  const stopped2 = !!e.supervisors && (e.supervisors.length === 0 || !!live && e.supervisors.every((pid) => !live.has(pid)));
27174
- if (!stranded && e.workspaceGrantId && e.policyVersion) e.resultCode = stopped2 ? "AGENT_RESTARTED" : "EXECUTION_UNKNOWN";
27177
+ if (retry && !stopped2) continue;
27178
+ if (!stranded && e.workspaceGrantId && e.policyVersion) {
27179
+ e.resultCode = stopped2 ? "AGENT_RESTARTED" : "EXECUTION_UNKNOWN";
27180
+ if (stopped2) {
27181
+ delete e.reportedAt;
27182
+ if (e.result) e.result = { ...e.result, treeTerminated: true };
27183
+ }
27184
+ }
27175
27185
  e.updatedAt = this.now().toISOString();
27176
27186
  const last = e.guardEvents?.at(-1);
27177
27187
  if (last && last.event.phase !== "result") {
@@ -29246,6 +29256,27 @@ async function resolvePosixExecutable(command, searchPath = process.env.PATH ??
29246
29256
  // agent/src/job-supervisor.ts
29247
29257
  import { spawn as spawn4 } from "node:child_process";
29248
29258
  import path16 from "node:path";
29259
+ var supervisorFailureCodes = /* @__PURE__ */ new Set([
29260
+ "SUPERVISOR_PLATFORM_UNSUPPORTED",
29261
+ "INVALID_SUPERVISOR_PATH",
29262
+ "INVALID_SUPERVISOR_ARGS",
29263
+ "INVALID_SUPERVISOR_LIMIT",
29264
+ "SUPERVISOR_INPUT_LIMIT",
29265
+ "SUPERVISOR_CONTROL_CLOSED",
29266
+ "SUPERVISOR_START_FAILED",
29267
+ "SUPERVISOR_DIAGNOSTIC_FAILURE",
29268
+ "SUPERVISOR_PROTOCOL_INVALID",
29269
+ "SUPERVISOR_PROTOCOL_LIMIT",
29270
+ "SUPERVISOR_EXECUTION_UNKNOWN",
29271
+ "SUPERVISOR_DEADLINE_EXCEEDED"
29272
+ ]);
29273
+ var nativeFailureCode = /^(WIN32_[0-9]{1,10}|EXECUTION_OUTCOME_UNKNOWN|INVALID_OR_FAILED_START)$/;
29274
+ function supervisorFailureDiagnostic(error62) {
29275
+ if (!(error62 instanceof Error) || !supervisorFailureCodes.has(error62.message)) return null;
29276
+ const stage = typeof error62.cause === "string" && /^(REQUEST|BRIDGE|CGROUP|EXECUTION|CLEANUP)$/.test(error62.cause) ? error62.cause : void 0;
29277
+ const nativeCode = typeof error62.cause === "string" && nativeFailureCode.test(error62.cause) ? error62.cause : void 0;
29278
+ return { code: error62.message, ...stage ? { stage } : {}, ...nativeCode ? { nativeCode } : {} };
29279
+ }
29249
29280
  function absolute(value) {
29250
29281
  return typeof value === "string" && value.length > 0 && value.length < 32767 && !value.includes("\0") && path16.isAbsolute(value) && path16.resolve(value) === value;
29251
29282
  }
@@ -29329,7 +29360,7 @@ async function runSupervised(helper, request, options = {}) {
29329
29360
  if (pid === null || !Number.isInteger(m.exitCode) || typeof m.timedOut !== "boolean" || typeof m.cancelled !== "boolean" || m.treeTerminated !== true) throw Error();
29330
29361
  outcome = { exitCode: m.exitCode, timedOut: m.timedOut, cancelled: m.cancelled, treeTerminated: true };
29331
29362
  } else if (m.type === "error") {
29332
- fail7("SUPERVISOR_EXECUTION_UNKNOWN", typeof m.stage === "string" && /^(REQUEST|BRIDGE|CGROUP|EXECUTION|CLEANUP)$/.test(m.stage) ? m.stage : void 0);
29363
+ fail7("SUPERVISOR_EXECUTION_UNKNOWN", typeof m.stage === "string" && /^(REQUEST|BRIDGE|CGROUP|EXECUTION|CLEANUP)$/.test(m.stage) ? m.stage : typeof m.code === "string" && nativeFailureCode.test(m.code) ? m.code : void 0);
29333
29364
  return;
29334
29365
  } else throw Error();
29335
29366
  } catch {
@@ -32286,7 +32317,7 @@ var NativeRuntime = class {
32286
32317
  if (!stored.created) {
32287
32318
  if (!journalBinding(stored.entry, binding2)) throw Error("IDEMPOTENCY_CONFLICT");
32288
32319
  if (stored.entry.result) {
32289
- this.send({ type: "result", version: 1, binding: binding2, result: await outboundResult(frame.tool, journalResult(stored.entry.result), binding2, this.optionalTelemetry, this.options.efficiencyLedger) });
32320
+ this.send({ type: "result", version: 1, binding: binding2, result: await outboundResult(frame.tool, journalResult(stored.entry.result, stored.entry.resultCode), binding2, this.optionalTelemetry, this.options.efficiencyLedger) });
32290
32321
  return;
32291
32322
  }
32292
32323
  if (stored.entry.state === "prepared") {
@@ -32385,6 +32416,8 @@ var NativeRuntime = class {
32385
32416
  } else {
32386
32417
  const isCommand = frame.tool.name === "command_run" || frame.tool.name.startsWith("git_") || frame.tool.name === "project_snapshot";
32387
32418
  const uncertain = error62 instanceof Error && error62.message === "GUARD_EVIDENCE_FAILED" || isCommand && !(error62 instanceof NativeToolError);
32419
+ const supervisorFailure = supervisorFailureDiagnostic(error62);
32420
+ if (supervisorFailure) context.stderr.append("\n" + JSON.stringify({ supervisorFailure }) + "\n");
32388
32421
  const output2 = { exitCode: null, timedOut: false, cancelled: abort.signal.aborted, treeTerminated: !uncertain, stdout: context.stdout.toString(), stderr: context.stderr.toString(), stdoutTruncated: context.stdout.truncated, stderrTruncated: context.stderr.truncated, resultCode: uncertain ? "EXECUTION_UNKNOWN" : abort.signal.aborted ? "CANCELLED" : safeCode(error62) };
32389
32422
  try {
32390
32423
  const { resultCode, ...raw } = output2;
@@ -32425,7 +32458,7 @@ var NativeRuntime = class {
32425
32458
  const fresh = await this.options.journal.get(binding2.executionId);
32426
32459
  let result2;
32427
32460
  if (fresh?.result) {
32428
- result2 = this.completedResults.get(binding2.executionId) ?? (context ? await outboundResult(context.tool.call, journalResult(fresh.result), binding2, this.optionalTelemetry, this.options.efficiencyLedger) : journalResult(fresh.result));
32461
+ result2 = this.completedResults.get(binding2.executionId) ?? (context ? await outboundResult(context.tool.call, journalResult(fresh.result, fresh.resultCode), binding2, this.optionalTelemetry, this.options.efficiencyLedger) : journalResult(fresh.result, fresh.resultCode));
32429
32462
  if (frame.action === "output" && this.options.efficiencyLedger) {
32430
32463
  const notice = await this.optionalTelemetry.run(() => this.options.efficiencyLedger.consumeNoticeForExecution?.(binding2.executionId), null);
32431
32464
  if (notice) result2 = { ...result2, efficiencyNotice: notice };
@@ -51371,7 +51404,7 @@ async function restoreContentAudit(input2, output2, key) {
51371
51404
  }
51372
51405
 
51373
51406
  // agent/src/main.ts
51374
- var AGENT_VERSION2 = true ? "0.3.53" : "0.3.2";
51407
+ var AGENT_VERSION2 = true ? "0.3.54" : "0.3.2";
51375
51408
  var NETWORK_PUBLIC_KEY = true ? "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAvmu+81vWtJBQDZNHcAIW\nzCSxpG+R9RBsum2df5mP2cOW+wyUDTpnYquFge1qgI5YYTF96j0xCyXL8B9FeNWs\n939opWNmv53j+CQlS4cEIQhBbZSCu0eC4icsVEzBhvf68MB+E668SOtZBcVTEnyh\n96PTcupxS10rQJBWDinbKBXRC2gvGYeu01rWa/nsrndy4vAYP5t3yQtdOC8e8mr0\n+2Mg2Qhiq+KiTCtDd+L9oXvoLqqJYbzUIveNGha25AWxF1Weblp0gOM87hell5gV\nK7q4ZLUq/wBRGYNmQRdLyV7/WRE1FFPSW21/SBZQ/5aU4UqJU/MjMcrJUrnRKngz\nYKmo0czkxS3N7Q2KVxomgR1AQSuQFKMrboZYKjShADp9RIYUxzs7cYg51Of5PnHh\n6Ax+VevDGfzjMD+yHuyxYZqCtX4OwgolJxz63UQbzKlris+8xb5lLYTbIuz90Pss\nn6HK/F5May25c6oMmS3nh/NsiZopL1OvdtWKTt1L4WlRAgMBAAE=\n-----END PUBLIC KEY-----\n" : "";
51376
51409
  var AI_CONNECTION_SHIPPED = false;
51377
51410
  var QUARANTINE_RETRY_MS = 6e4;
@@ -1,25 +1,25 @@
1
1
  {
2
- "version": "0.3.53",
2
+ "version": "0.3.54",
3
3
  "experimental": true,
4
4
  "platform": "linux",
5
5
  "arch": "x64",
6
6
  "node": "v22.23.3",
7
- "source": "44697372c54ffeb2ce6427ec76442552384df0f2",
8
- "sourceTreeSha256": "da9d3b2b9fa21f7f341ea14778318396e7441c379d04beb56f15995fffd44c3e",
7
+ "source": "290242c5ff447bde95b9e32265f107b1baa60fac",
8
+ "sourceTreeSha256": "df0bc5156ec0df2fc6159cdd1fecf1a989a45771bd4ef8cb34947df58f4601c7",
9
9
  "qualification": "unqualified",
10
10
  "lifecycleVersion": 1,
11
11
  "packaging": "npm platform package runtime",
12
12
  "files": {
13
13
  "NODE-LICENSE.txt": "c738ae413cf561f174e34f6961f8ca458aae2369a73640dda6234c629b98bcc4",
14
- "agent.mjs": "f56a88553f99e14806c26c334126846acdca6f979330cd2300ea7aba8450829e",
14
+ "agent.mjs": "604d8a7dddcc5ee040060ca15e446f4633425cd0bd9bbd20815f965d7a0033e8",
15
15
  "job-host.mjs": "54ab42fa00a53dfd4df6c93fd9e6692d5e03a0870aba8bf501f398905694b72d",
16
16
  "lifecycle.mjs": "c9a2d3380117e3f7f96390b5f0ed782aa93d49108b552127132df420b1de326c",
17
17
  "node": "fde6a4bf8d0562f7751d1a2d6cb9b417c4cfe107bbcb0aa3e9a24e125e348f48",
18
18
  "posix-host": "ded54a9c316dbd3b2ddd77193f0ea0e0e279bbc2a52a7fe4ccb88e5accf0011b"
19
19
  },
20
20
  "assembly": {
21
- "baseVersion": "0.3.52",
22
- "baseIntegrity": "sha512-4NxrTvdBEOTmdWX9QfdtL/+3h1PVnyoH4ERUMTPHoqdZ5m5gXqhQDOizPIeVK2MaSB88wpASS9UPOzu/7pKApw==",
21
+ "baseVersion": "0.3.53",
22
+ "baseIntegrity": "sha512-+P6B48HxSrEgZPgCKIDka84LSM24LVFyhOekFsdW/hC4RNEdUelBKBMTqir2IlUQnqd1+hj8EdDm0OwSC5YmHw==",
23
23
  "unchangedNativeInputs": "846ebe44",
24
24
  "sourceTreeHashScope": "rebuilt agent and lifecycle bundles"
25
25
  }