@integrity-labs/agt-cli 0.28.1189 → 0.28.1191

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.
Files changed (26) hide show
  1. package/dist/bin/agt.js +6 -6
  2. package/dist/{chunk-6C22ELAZ.js → chunk-5RDPFXWO.js} +54 -21
  3. package/dist/chunk-5RDPFXWO.js.map +1 -0
  4. package/dist/{chunk-GYY5LC6U.js → chunk-7T4CZ2NS.js} +2 -2
  5. package/dist/{chunk-M5QY6SXB.js → chunk-GRU6GNLP.js} +31 -5
  6. package/dist/chunk-GRU6GNLP.js.map +1 -0
  7. package/dist/{chunk-CJ3KE25W.js → chunk-L5BWZX3Z.js} +3 -3
  8. package/dist/{chunk-BG7IPLTE.js → chunk-VS3QXUDM.js} +2 -2
  9. package/dist/{claude-code-updater-CQ2SWFEJ.js → claude-code-updater-JPVLPWVR.js} +3 -3
  10. package/dist/{claude-pair-runtime-N54HX4ZR.js → claude-pair-runtime-JXXYGKWS.js} +3 -3
  11. package/dist/lib/manager-worker.js +28 -21
  12. package/dist/lib/manager-worker.js.map +1 -1
  13. package/dist/{persistent-session-NL7N3MA4.js → persistent-session-NSA3UYRF.js} +4 -4
  14. package/dist/{responsiveness-probe-BMLAPOIY.js → responsiveness-probe-MWH3BKAL.js} +4 -4
  15. package/dist/{session-auth-dead-PTHDHHK4.js → session-auth-dead-RYU7ZB56.js} +3 -3
  16. package/package.json +1 -1
  17. package/dist/chunk-6C22ELAZ.js.map +0 -1
  18. package/dist/chunk-M5QY6SXB.js.map +0 -1
  19. /package/dist/{chunk-GYY5LC6U.js.map → chunk-7T4CZ2NS.js.map} +0 -0
  20. /package/dist/{chunk-CJ3KE25W.js.map → chunk-L5BWZX3Z.js.map} +0 -0
  21. /package/dist/{chunk-BG7IPLTE.js.map → chunk-VS3QXUDM.js.map} +0 -0
  22. /package/dist/{claude-code-updater-CQ2SWFEJ.js.map → claude-code-updater-JPVLPWVR.js.map} +0 -0
  23. /package/dist/{claude-pair-runtime-N54HX4ZR.js.map → claude-pair-runtime-JXXYGKWS.js.map} +0 -0
  24. /package/dist/{persistent-session-NL7N3MA4.js.map → persistent-session-NSA3UYRF.js.map} +0 -0
  25. /package/dist/{responsiveness-probe-BMLAPOIY.js.map → responsiveness-probe-MWH3BKAL.js.map} +0 -0
  26. /package/dist/{session-auth-dead-PTHDHHK4.js.map → session-auth-dead-RYU7ZB56.js.map} +0 -0
package/dist/bin/agt.js CHANGED
@@ -40,17 +40,17 @@ import {
40
40
  success,
41
41
  table,
42
42
  warn
43
- } from "../chunk-6C22ELAZ.js";
43
+ } from "../chunk-5RDPFXWO.js";
44
44
  import {
45
45
  getProjectDir,
46
46
  isSessionResumeDisabled,
47
47
  readDirectChatSessionState
48
- } from "../chunk-CJ3KE25W.js";
48
+ } from "../chunk-L5BWZX3Z.js";
49
49
  import {
50
50
  markDailySessionSpawn,
51
51
  sessionFileExists,
52
52
  sessionTranscriptDir
53
- } from "../chunk-GYY5LC6U.js";
53
+ } from "../chunk-7T4CZ2NS.js";
54
54
  import "../chunk-OO36JBFI.js";
55
55
  import "../chunk-6HBXEJHO.js";
56
56
  import "../chunk-XWVM4KPK.js";
@@ -83,7 +83,7 @@ import {
83
83
  requiredMcpWildcard,
84
84
  resolveChannels,
85
85
  serializeManifestForSlackCli
86
- } from "../chunk-M5QY6SXB.js";
86
+ } from "../chunk-GRU6GNLP.js";
87
87
  import "../chunk-AIUIMEUS.js";
88
88
  import "../chunk-DGUM43GV.js";
89
89
 
@@ -5200,7 +5200,7 @@ import { execFileSync, execSync } from "child_process";
5200
5200
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
5201
5201
  import chalk17 from "chalk";
5202
5202
  import ora15 from "ora";
5203
- var cliVersion = true ? "0.28.1189" : "dev";
5203
+ var cliVersion = true ? "0.28.1191" : "dev";
5204
5204
  async function fetchLatestVersion() {
5205
5205
  const host2 = getHost();
5206
5206
  if (!host2) return null;
@@ -6460,7 +6460,7 @@ function handleError(err) {
6460
6460
  }
6461
6461
 
6462
6462
  // src/bin/agt.ts
6463
- var cliVersion2 = true ? "0.28.1189" : "dev";
6463
+ var cliVersion2 = true ? "0.28.1191" : "dev";
6464
6464
  var program = new Command();
6465
6465
  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");
6466
6466
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -16,11 +16,11 @@ import {
16
16
  parseEnvFileEntries,
17
17
  parseEnvIntegrations,
18
18
  shellQuote
19
- } from "./chunk-CJ3KE25W.js";
19
+ } from "./chunk-L5BWZX3Z.js";
20
20
  import {
21
21
  readDailySessionPin,
22
22
  sessionTranscriptDir
23
- } from "./chunk-GYY5LC6U.js";
23
+ } from "./chunk-7T4CZ2NS.js";
24
24
  import {
25
25
  classifyUnanswerablePane,
26
26
  isConsumerTermsDialogVisible,
@@ -91,7 +91,7 @@ import {
91
91
  scanConfigForLiteralSecrets,
92
92
  worseConnectivityOutcome,
93
93
  wrapScheduledTaskPrompt
94
- } from "./chunk-M5QY6SXB.js";
94
+ } from "./chunk-GRU6GNLP.js";
95
95
  import {
96
96
  claudeJsonPathFor,
97
97
  effectiveClaudeJsonPath,
@@ -8079,7 +8079,7 @@ function exchangeFailureKind(err) {
8079
8079
  }
8080
8080
 
8081
8081
  // src/lib/api-client.ts
8082
- var agtCliVersion = true ? "0.28.1189" : "dev";
8082
+ var agtCliVersion = true ? "0.28.1191" : "dev";
8083
8083
  var lastConfigHash = null;
8084
8084
  function setConfigHash(hash) {
8085
8085
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -10623,21 +10623,47 @@ import { delimiter as pathDelimiter, join as join8 } from "path";
10623
10623
  import { existsSync as existsSync7, readFileSync as readFileSync8 } from "fs";
10624
10624
  import { homedir as homedir6 } from "os";
10625
10625
 
10626
+ // src/lib/probe-message-redact.ts
10627
+ var MIN_SECRET_LENGTH = 8;
10628
+ function stringsIn(value) {
10629
+ if (typeof value === "string") return [value];
10630
+ if (value === null || typeof value !== "object") return [];
10631
+ return Object.values(value).flatMap(stringsIn);
10632
+ }
10633
+ function longestKnownValue(sources) {
10634
+ return sources.flatMap(stringsIn).filter((v) => v.length >= MIN_SECRET_LENGTH).reduce((longest, v) => Math.max(longest, v.length), 0);
10635
+ }
10636
+ function redactKnownValues(text, sources) {
10637
+ const values = sources.flatMap(stringsIn).filter((v) => v.length >= MIN_SECRET_LENGTH).sort((a, b) => b.length - a.length);
10638
+ return values.reduce((out, value) => out.split(value).join("[redacted]"), text);
10639
+ }
10640
+
10626
10641
  // src/lib/mcp-stdio-probe.ts
10627
10642
  import { spawn } from "child_process";
10628
10643
  var DEFAULT_TIMEOUT_MS = 15e3;
10644
+ var STDERR_TAIL_MAX = 500;
10645
+ var STDERR_KEEP_MIN = 64 * 1024;
10646
+ var TOOL_ERROR_TEXT_MAX = 1e3;
10647
+ function toolErrorText(result, env) {
10648
+ const content = result?.content;
10649
+ if (!Array.isArray(content)) return void 0;
10650
+ const text = content.map((part) => part?.text).filter((t) => typeof t === "string").join(" ");
10651
+ return redactKnownValues(text, [env]).replace(/\s+/g, " ").trim().slice(0, TOOL_ERROR_TEXT_MAX) || void 0;
10652
+ }
10629
10653
  async function probeMcpStdio(config) {
10630
10654
  const timeoutMs = config.timeoutMs ?? DEFAULT_TIMEOUT_MS;
10655
+ const childEnv = { ...process.env, ...config.env ?? {} };
10631
10656
  const child = spawn(config.command, config.args ?? [], {
10632
10657
  // Faithful reproduction of the real spawn: the child inherits the manager's
10633
10658
  // process env (PATH/HOME so `node`/`npx` resolve) with the entry's env
10634
10659
  // overlaid, exactly as Claude Code spawns it.
10635
- env: { ...process.env, ...config.env ?? {} },
10660
+ env: childEnv,
10636
10661
  cwd: config.cwd,
10637
10662
  stdio: ["pipe", "pipe", "pipe"]
10638
10663
  });
10639
10664
  let stdout = "";
10640
- let stderrTail = "";
10665
+ let stderrBuffer = "";
10666
+ const stderrKeep = Math.max(STDERR_KEEP_MIN, 2 * longestKnownValue([childEnv]) + STDERR_TAIL_MAX);
10641
10667
  const pending = /* @__PURE__ */ new Map();
10642
10668
  return await new Promise((resolve) => {
10643
10669
  let done = false;
@@ -10650,7 +10676,7 @@ async function probeMcpStdio(config) {
10650
10676
  child.kill("SIGKILL");
10651
10677
  } catch {
10652
10678
  }
10653
- resolve(outcome);
10679
+ resolve(outcome.message ? { ...outcome, message: redactKnownValues(outcome.message, [childEnv]) } : outcome);
10654
10680
  };
10655
10681
  const timer = setTimeout(() => {
10656
10682
  finish({
@@ -10670,15 +10696,17 @@ async function probeMcpStdio(config) {
10670
10696
  if (!done) {
10671
10697
  finish({
10672
10698
  status: "down",
10673
- message: `MCP server exited (code ${code ?? "null"})${stderrTail ? `: ${stderrTail.trim().slice(-200)}` : ""}`
10699
+ message: `MCP server exited (code ${code ?? "null"})${stderrBuffer ? `: ${redactKnownValues(stderrBuffer, [childEnv]).trim().slice(-200)}` : ""}`
10674
10700
  });
10675
10701
  }
10676
10702
  });
10677
10703
  child.stdin.on("error", () => {
10678
10704
  });
10705
+ child.stderr.setEncoding("utf8");
10679
10706
  child.stderr.on("data", (d) => {
10680
- stderrTail = (stderrTail + d.toString()).slice(-500);
10707
+ stderrBuffer = (stderrBuffer + d).slice(-stderrKeep);
10681
10708
  });
10709
+ child.stdout.setEncoding("utf8");
10682
10710
  child.stdout.on("data", (d) => {
10683
10711
  stdout += d.toString();
10684
10712
  let nl;
@@ -10732,7 +10760,11 @@ async function probeMcpStdio(config) {
10732
10760
  if (done) return;
10733
10761
  if (call.error) return finish({ status: "down", message: `MCP tools/call ${testTool} error: ${call.error.message ?? "unknown"}` });
10734
10762
  if (call.result?.isError === true) {
10735
- return finish({ status: "down", message: `MCP tool ${testTool} returned an error result` });
10763
+ const reason = toolErrorText(call.result, childEnv);
10764
+ return finish({
10765
+ status: "down",
10766
+ message: `MCP tool ${testTool} returned an error result${reason ? `: ${reason}` : ""}`
10767
+ });
10736
10768
  }
10737
10769
  return finish({
10738
10770
  status: "ok",
@@ -10990,13 +11022,13 @@ function didNotRunReasonFor(text, exitCode) {
10990
11022
  }
10991
11023
  var CREDENTIAL_SHAPED = /\b(gh[pousr]_[A-Za-z0-9]{16,}|github_pat_[A-Za-z0-9_]{20,}|xox[abprs]-[A-Za-z0-9-]{10,}|sk-[A-Za-z0-9]{20,}|eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}|AKIA[0-9A-Z]{16})\b/g;
10992
11024
  var MAX_MESSAGE_CHARS = 200;
10993
- function redactAndBound(line) {
10994
- const redacted = line.replace(CREDENTIAL_SHAPED, "<redacted>");
11025
+ function redactAndBound(line, childEnv) {
11026
+ const redacted = redactKnownValues(line, [childEnv]).replace(CREDENTIAL_SHAPED, "<redacted>");
10995
11027
  return redacted.length > MAX_MESSAGE_CHARS ? `${redacted.slice(0, MAX_MESSAGE_CHARS - 1)}\u2026` : redacted;
10996
11028
  }
10997
- function firstMeaningfulLine(stderr, stdout, fallback) {
11029
+ function firstMeaningfulLine(stderr, stdout, fallback, childEnv) {
10998
11030
  const line = firstReasonLine(stderr, "failure") ?? firstReasonLine(stdout, "failure") ?? firstReasonLine(fallback, "failure") ?? "";
10999
- return redactAndBound(line);
11031
+ return redactAndBound(line, childEnv);
11000
11032
  }
11001
11033
  function firstReasonLine(v, lane = "ok") {
11002
11034
  const contradicts = lane === "failure" ? GH_SUCCESS_MARKER : GH_FAILURE_MARKER;
@@ -11056,7 +11088,7 @@ function runCliProbe(binary, args, opts = {}) {
11056
11088
  const firstLine = firstReasonLine(stdout, "ok");
11057
11089
  resolve({
11058
11090
  status: "ok",
11059
- message: firstLine ? `${binary}: ${redactAndBound(firstLine)}` : `${binary}: ok`
11091
+ message: firstLine ? `${binary}: ${redactAndBound(firstLine, childEnv)}` : `${binary}: ok`
11060
11092
  });
11061
11093
  return;
11062
11094
  }
@@ -11065,9 +11097,9 @@ function runCliProbe(binary, args, opts = {}) {
11065
11097
  logSearchedPath(binary, childEnv, "ENOENT \u2014 no such binary anywhere on it");
11066
11098
  resolve({
11067
11099
  status: "unverified",
11068
- // ENG-9173 vocabulary: say WHY in the field that survives. The
11100
+ // ENG-9173 vocabulary: say WHY in the field code can branch on. The
11069
11101
  // status alone cannot distinguish this from any other unverified
11070
- // row, and the message below is dropped before persistence.
11102
+ // row, and the message below is for humans only.
11071
11103
  cause: "not_run",
11072
11104
  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.`
11073
11105
  });
@@ -11094,7 +11126,7 @@ ${e.message}`;
11094
11126
  // catches a shim which started and could not find the tool behind
11095
11127
  // it, which is the shape that actually reaches production.
11096
11128
  cause: "not_run",
11097
- message: `${binary} probe did not run \u2014 ${didNotRun}. This is NOT a verdict about the integration: ${firstMeaningfulLine(stderr, stdout, e.message)}`
11129
+ message: `${binary} probe did not run \u2014 ${didNotRun}. This is NOT a verdict about the integration: ${firstMeaningfulLine(stderr, stdout, e.message, childEnv)}`
11098
11130
  });
11099
11131
  return;
11100
11132
  }
@@ -11105,14 +11137,14 @@ ${e.message}`;
11105
11137
  // ENG-10529: present only when the matched signature carries one.
11106
11138
  // The broker entry deliberately carries none — see its comment.
11107
11139
  ...transient.cause ? { cause: transient.cause } : {},
11108
- message: `${binary} probe inconclusive \u2014 ${transient.reason}: ${firstMeaningfulLine(stderr, stdout, e.message)}`
11140
+ message: `${binary} probe inconclusive \u2014 ${transient.reason}: ${firstMeaningfulLine(stderr, stdout, e.message, childEnv)}`
11109
11141
  });
11110
11142
  return;
11111
11143
  }
11112
11144
  resolve({
11113
11145
  status: "down",
11114
11146
  .../* @__PURE__ */ ((c) => c ? { cause: c } : {})(downCauseFor(diagnostic)),
11115
- message: `${binary} exited non-zero: ${firstMeaningfulLine(stderr, stdout, e.message)}`
11147
+ message: `${binary} exited non-zero: ${firstMeaningfulLine(stderr, stdout, e.message, childEnv)}`
11116
11148
  });
11117
11149
  }
11118
11150
  );
@@ -13579,6 +13611,7 @@ export {
13579
13611
  givenUpMcpServerKeys,
13580
13612
  describeBlockedPromptHold,
13581
13613
  reapMissingMcpSessions,
13614
+ redactKnownValues,
13582
13615
  markQuarantinedForProbe,
13583
13616
  FIRST_CONNECT_WINDOW_MS,
13584
13617
  isWithinReconnectQuiesceWindow,
@@ -13614,4 +13647,4 @@ export {
13614
13647
  managerInstallSystemUnitCommand,
13615
13648
  managerUninstallSystemUnitCommand
13616
13649
  };
13617
- //# sourceMappingURL=chunk-6C22ELAZ.js.map
13650
+ //# sourceMappingURL=chunk-5RDPFXWO.js.map