@integrity-labs/agt-cli 0.28.749 → 0.28.751

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/dist/bin/agt.js CHANGED
@@ -41,12 +41,12 @@ import {
41
41
  success,
42
42
  table,
43
43
  warn
44
- } from "../chunk-WTBSFYTA.js";
44
+ } from "../chunk-QYAJHOZB.js";
45
45
  import {
46
46
  getProjectDir,
47
47
  isSessionResumeDisabled,
48
48
  readDirectChatSessionState
49
- } from "../chunk-3LQYVRKX.js";
49
+ } from "../chunk-LCHGVH7O.js";
50
50
  import {
51
51
  AnchorSessionClient,
52
52
  CHANNEL_REGISTRY,
@@ -79,7 +79,7 @@ import {
79
79
  serializeManifestForSlackCli,
80
80
  sessionFileExists,
81
81
  sessionTranscriptDir
82
- } from "../chunk-DFOBTAPL.js";
82
+ } from "../chunk-TZOMZFXF.js";
83
83
  import "../chunk-XWVM4KPK.js";
84
84
 
85
85
  // src/bin/agt.ts
@@ -5467,7 +5467,7 @@ import { execFileSync, execSync } from "child_process";
5467
5467
  import { existsSync as existsSync11, realpathSync as realpathSync2 } from "fs";
5468
5468
  import chalk18 from "chalk";
5469
5469
  import ora16 from "ora";
5470
- var cliVersion = true ? "0.28.749" : "dev";
5470
+ var cliVersion = true ? "0.28.751" : "dev";
5471
5471
  async function fetchLatestVersion() {
5472
5472
  const host2 = getHost();
5473
5473
  if (!host2) return null;
@@ -6654,7 +6654,7 @@ function handleError(err) {
6654
6654
  }
6655
6655
 
6656
6656
  // src/bin/agt.ts
6657
- var cliVersion2 = true ? "0.28.749" : "dev";
6657
+ var cliVersion2 = true ? "0.28.751" : "dev";
6658
6658
  var program = new Command();
6659
6659
  program.name("agt").description("Augmented CLI \u2014 agent provisioning and management").version(cliVersion2).option("--json", "Emit machine-readable JSON output (suppress spinners and colors)").option("--skip-update-check", "Skip the automatic update check on startup");
6660
6660
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -17,7 +17,7 @@ import {
17
17
  rotateDailySession,
18
18
  sessionFileExists,
19
19
  todayLocalIso
20
- } from "./chunk-DFOBTAPL.js";
20
+ } from "./chunk-TZOMZFXF.js";
21
21
  import {
22
22
  reapOrphanChannelMcps
23
23
  } from "./chunk-XWVM4KPK.js";
@@ -4929,4 +4929,4 @@ export {
4929
4929
  stopAllSessionsAndWait,
4930
4930
  getProjectDir
4931
4931
  };
4932
- //# sourceMappingURL=chunk-3LQYVRKX.js.map
4932
+ //# sourceMappingURL=chunk-LCHGVH7O.js.map
@@ -13,7 +13,7 @@ import {
13
13
  parseEnvFileEntries,
14
14
  parseEnvIntegrations,
15
15
  shellQuote
16
- } from "./chunk-3LQYVRKX.js";
16
+ } from "./chunk-LCHGVH7O.js";
17
17
  import {
18
18
  BIND_FAILURE_QUARANTINE_THRESHOLD,
19
19
  INTEGRATIONS_SECTION_END,
@@ -62,7 +62,7 @@ import {
62
62
  sessionTranscriptDir,
63
63
  worseConnectivityOutcome,
64
64
  wrapScheduledTaskPrompt
65
- } from "./chunk-DFOBTAPL.js";
65
+ } from "./chunk-TZOMZFXF.js";
66
66
  import {
67
67
  parsePsRows
68
68
  } from "./chunk-XWVM4KPK.js";
@@ -6430,7 +6430,7 @@ function exchangeFailureKind(err) {
6430
6430
  }
6431
6431
 
6432
6432
  // src/lib/api-client.ts
6433
- var agtCliVersion = true ? "0.28.749" : "dev";
6433
+ var agtCliVersion = true ? "0.28.751" : "dev";
6434
6434
  var lastConfigHash = null;
6435
6435
  function setConfigHash(hash) {
6436
6436
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -8548,11 +8548,76 @@ var DID_NOT_RUN_SIGNATURES = [
8548
8548
  // would hide a fault worth seeing.
8549
8549
  re: /AGT_AGENT_ID is not set/i,
8550
8550
  reason: "the probe process was spawned without AGT_AGENT_ID, so the credential shim could not identify the agent and nothing was probed (ENG-9005)"
8551
+ },
8552
+ {
8553
+ // THE INTERPRETER NEVER STARTED — the wrapper could not even be launched.
8554
+ //
8555
+ // The ENG-8344 credential shim is a Node script beginning
8556
+ // `#!/usr/bin/env node`. If the PATH handed to the probe omits the
8557
+ // directory holding `node`, the kernel finds and execs the shim, `env`
8558
+ // then fails to resolve its interpreter, and the process dies with exit
8559
+ // 127 and:
8560
+ //
8561
+ // env: 'node': No such file or directory
8562
+ //
8563
+ // That is a did-not-run in the purest sense — not one byte of `gh` ran —
8564
+ // and until now it matched NOTHING. Not the two entries above (the shim
8565
+ // never got far enough to print its own wording, and never read
8566
+ // AGT_AGENT_ID), and not any TRANSIENT_SIGNATURE (it is not a throttle, a
8567
+ // 5xx or a socket error). So it fell through to the flat `down`,
8568
+ // incrementing consecutive_connectivity_failures and, past the threshold,
8569
+ // opening an `integration_down` alert that reads as a GitHub outage.
8570
+ //
8571
+ // REPRODUCED on agt-aws-1 2026-08-31, not inferred:
8572
+ // PATH=<agent>/.claude/agt-bin -> env: 'node': No such file
8573
+ // PATH=<agent>/.claude/agt-bin:/usr/bin -> shim runs, finds gh 2.96.0
8574
+ // and through runCliProbe the first case graded:
8575
+ // status 'down', cause undefined,
8576
+ // "sh exited non-zero: env: 'node': No such file or directory"
8577
+ //
8578
+ // Worth stating because it corrects a plausible-looking account: a
8579
+ // truncated PATH does NOT reach the shim's own "the real gh binary is not
8580
+ // on PATH (only the Augmented shim is)" message. It cannot — that line is
8581
+ // printed by JavaScript that never executes. Anyone matching the two
8582
+ // symptoms by eye will pair the wrong cause with the wrong effect.
8583
+ //
8584
+ // NARROW, per the file's standing rule that a verdict-softening pattern
8585
+ // must never be the greedy one. A bare "No such file or directory" is far
8586
+ // too broad — a CLI may print it about a config file, a repo path or a key
8587
+ // file while genuinely failing. Both alternatives below are anchored on the
8588
+ // LAUNCH failing: `env`'s own diagnostic, and the shell's `bad interpreter`.
8589
+ // TIGHTENED IN REVIEW, and the tightening is the interesting part.
8590
+ //
8591
+ // My first pattern was `env: .{0,64}: No such file or directory`, which is
8592
+ // exactly the greedy shape this file's header warns against. `env: ` is not
8593
+ // a rare prefix — a CLI is free to print `env: GH_CONFIG_DIR: No such file
8594
+ // or directory` about a variable it was told to read, and that is a REAL
8595
+ // failure. Softening it to `unverified` would have hidden a dead credential
8596
+ // permanently, which the header names as the failure nobody ever finds.
8597
+ //
8598
+ // Two independent narrowings, either of which alone would be weak:
8599
+ //
8600
+ // - QUOTING. GNU coreutils `env` quotes the command it could not exec:
8601
+ // `env: 'node': No such file or directory`. A variable name in a
8602
+ // provider's own diagnostic is not quoted that way. `[^']+` cannot span
8603
+ // the closing quote, so it cannot drift across a longer message.
8604
+ // - EXIT STATUS. A launcher that could not exec its target exits 127
8605
+ // (command not found) or 126 (found, not executable). An ordinary CLI
8606
+ // failure that merely mentions a missing file exits with its own code —
8607
+ // 1 in every case I could produce.
8608
+ //
8609
+ // Requiring both means a match is a launch failure by two agreeing signals,
8610
+ // not by a substring. (CodeRabbit.)
8611
+ re: /\benv: '[^']+': No such file or directory|: bad interpreter: No such file or directory/i,
8612
+ exitCodes: [126, 127],
8613
+ reason: "the probe's interpreter could not be launched (a truncated PATH omitting the directory that holds `node` does this to the credential shim), so nothing was probed"
8551
8614
  }
8552
8615
  ];
8553
- function didNotRunReasonFor(text) {
8554
- for (const { re, reason } of DID_NOT_RUN_SIGNATURES) {
8555
- if (re.test(text)) return reason;
8616
+ function didNotRunReasonFor(text, exitCode) {
8617
+ for (const { re, reason, exitCodes } of DID_NOT_RUN_SIGNATURES) {
8618
+ if (!re.test(text)) continue;
8619
+ if (exitCodes && (exitCode === null || !exitCodes.includes(exitCode))) continue;
8620
+ return reason;
8556
8621
  }
8557
8622
  return null;
8558
8623
  }
@@ -8567,13 +8632,27 @@ function firstMeaningfulLine(stderr, stdout, fallback) {
8567
8632
  const line = firstLineOf(stderr) ?? firstLineOf(stdout) ?? firstLineOf(fallback) ?? "";
8568
8633
  return redactAndBound(line);
8569
8634
  }
8635
+ function logSearchedPath(binary, env, why) {
8636
+ console.warn(
8637
+ `[connectivity-probe] ${binary} did not run (${why}). PATH searched: ${effectiveSearchPath(env)}`
8638
+ );
8639
+ }
8640
+ function effectiveSearchPath(env) {
8641
+ if (process.platform === "win32") {
8642
+ const key = Object.keys(env).find((k) => k.toLowerCase() === "path");
8643
+ const value = key ? env[key] : void 0;
8644
+ return value ?? "<no PATH/Path key \u2014 Windows default lookup applies>";
8645
+ }
8646
+ return env.PATH ?? "<PATH unset \u2014 the platform default applies, conventionally /usr/bin:/bin>";
8647
+ }
8570
8648
  function runCliProbe(binary, args, opts = {}) {
8571
8649
  const timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS2;
8650
+ const childEnv = opts.env ?? process.env;
8572
8651
  return new Promise((resolve) => {
8573
8652
  execFile2(
8574
8653
  binary,
8575
8654
  args,
8576
- { timeout: timeoutMs, env: opts.env ?? process.env, windowsHide: true },
8655
+ { timeout: timeoutMs, env: childEnv, windowsHide: true },
8577
8656
  (err, stdout, stderr) => {
8578
8657
  if (!err) {
8579
8658
  const firstLine = String(stdout).split(/\r?\n/, 1)[0]?.trim();
@@ -8585,8 +8664,13 @@ function runCliProbe(binary, args, opts = {}) {
8585
8664
  }
8586
8665
  const e = err;
8587
8666
  if (e.code === "ENOENT") {
8667
+ logSearchedPath(binary, childEnv, "ENOENT \u2014 no such binary anywhere on it");
8588
8668
  resolve({
8589
8669
  status: "unverified",
8670
+ // ENG-9173 vocabulary: say WHY in the field that survives. The
8671
+ // status alone cannot distinguish this from any other unverified
8672
+ // row, and the message below is dropped before persistence.
8673
+ cause: "not_run",
8590
8674
  message: `${binary} not found on PATH \u2014 the probe could not run, so this is NOT a verdict about the integration. If the agent uses a per-agent binary (e.g. the .claude/agt-bin shim), the probe's PATH must include it.`
8591
8675
  });
8592
8676
  return;
@@ -8598,10 +8682,16 @@ function runCliProbe(binary, args, opts = {}) {
8598
8682
  const diagnostic = `${stderr ?? ""}
8599
8683
  ${stdout ?? ""}
8600
8684
  ${e.message}`;
8601
- const didNotRun = didNotRunReasonFor(diagnostic);
8685
+ const exitCode = typeof e.code === "number" ? e.code : null;
8686
+ const didNotRun = didNotRunReasonFor(diagnostic, exitCode);
8602
8687
  if (didNotRun) {
8688
+ logSearchedPath(binary, childEnv, didNotRun);
8603
8689
  resolve({
8604
8690
  status: "unverified",
8691
+ // Same reasoning as the ENOENT branch above: this is the arm that
8692
+ // catches a shim which started and could not find the tool behind
8693
+ // it, which is the shape that actually reaches production.
8694
+ cause: "not_run",
8605
8695
  message: `${binary} probe did not run \u2014 ${didNotRun}. This is NOT a verdict about the integration: ${firstMeaningfulLine(stderr, stdout, e.message)}`
8606
8696
  });
8607
8697
  return;
@@ -10476,4 +10566,4 @@ export {
10476
10566
  managerInstallSystemUnitCommand,
10477
10567
  managerUninstallSystemUnitCommand
10478
10568
  };
10479
- //# sourceMappingURL=chunk-WTBSFYTA.js.map
10569
+ //# sourceMappingURL=chunk-QYAJHOZB.js.map