@integrity-labs/agt-cli 0.28.1281 → 0.28.1283

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 (35) hide show
  1. package/dist/{api-client-UW5GPDR5.js → api-client-34MRJANA.js} +3 -3
  2. package/dist/bin/agt.js +7 -7
  3. package/dist/{chunk-A26WJ7TB.js → chunk-5CUCQYZH.js} +2 -2
  4. package/dist/{chunk-XNHTH267.js → chunk-D5DY5OKR.js} +62 -11
  5. package/dist/chunk-D5DY5OKR.js.map +1 -0
  6. package/dist/{chunk-O5D6I72R.js → chunk-FFLU5VIN.js} +2 -1
  7. package/dist/chunk-FFLU5VIN.js.map +1 -0
  8. package/dist/{chunk-CCWVPE2F.js → chunk-G3CTTMOE.js} +3 -3
  9. package/dist/{chunk-SHBU7NAQ.js → chunk-L4HODIVN.js} +5 -5
  10. package/dist/{chunk-FQMFWJUD.js → chunk-QK4R5ZIT.js} +2 -2
  11. package/dist/{claude-code-updater-L3NMDSSG.js → claude-code-updater-BQFWZDEI.js} +3 -3
  12. package/dist/{claude-pair-runtime-TUVLJDJZ.js → claude-pair-runtime-L6XQTJKV.js} +3 -3
  13. package/dist/lib/manager-worker.js +348 -32
  14. package/dist/lib/manager-worker.js.map +1 -1
  15. package/dist/mcp/direct-chat-channel.js +4 -0
  16. package/dist/mcp/index.js +5 -0
  17. package/dist/mcp/origami.js +4 -0
  18. package/dist/mcp/slack-channel.js +4 -0
  19. package/dist/mcp/telegram-channel.js +4 -0
  20. package/dist/{persistent-session-LMR3WHVO.js → persistent-session-ISLJXHGH.js} +6 -4
  21. package/dist/{responsiveness-probe-FWPQTPQ5.js → responsiveness-probe-X3SNNEDY.js} +4 -4
  22. package/dist/{session-auth-dead-5PNG5ILK.js → session-auth-dead-UBNHYRAW.js} +3 -3
  23. package/package.json +1 -1
  24. package/dist/chunk-O5D6I72R.js.map +0 -1
  25. package/dist/chunk-XNHTH267.js.map +0 -1
  26. /package/dist/{api-client-UW5GPDR5.js.map → api-client-34MRJANA.js.map} +0 -0
  27. /package/dist/{chunk-A26WJ7TB.js.map → chunk-5CUCQYZH.js.map} +0 -0
  28. /package/dist/{chunk-CCWVPE2F.js.map → chunk-G3CTTMOE.js.map} +0 -0
  29. /package/dist/{chunk-SHBU7NAQ.js.map → chunk-L4HODIVN.js.map} +0 -0
  30. /package/dist/{chunk-FQMFWJUD.js.map → chunk-QK4R5ZIT.js.map} +0 -0
  31. /package/dist/{claude-code-updater-L3NMDSSG.js.map → claude-code-updater-BQFWZDEI.js.map} +0 -0
  32. /package/dist/{claude-pair-runtime-TUVLJDJZ.js.map → claude-pair-runtime-L6XQTJKV.js.map} +0 -0
  33. /package/dist/{persistent-session-LMR3WHVO.js.map → persistent-session-ISLJXHGH.js.map} +0 -0
  34. /package/dist/{responsiveness-probe-FWPQTPQ5.js.map → responsiveness-probe-X3SNNEDY.js.map} +0 -0
  35. /package/dist/{session-auth-dead-5PNG5ILK.js.map → session-auth-dead-UBNHYRAW.js.map} +0 -0
@@ -15,8 +15,8 @@ import {
15
15
  mintRotatedHostKey,
16
16
  probeHostKey,
17
17
  setConfigHash
18
- } from "./chunk-CCWVPE2F.js";
19
- import "./chunk-O5D6I72R.js";
18
+ } from "./chunk-G3CTTMOE.js";
19
+ import "./chunk-FFLU5VIN.js";
20
20
  import "./chunk-DGUM43GV.js";
21
21
  export {
22
22
  ApiError,
@@ -36,4 +36,4 @@ export {
36
36
  probeHostKey,
37
37
  setConfigHash
38
38
  };
39
- //# sourceMappingURL=api-client-UW5GPDR5.js.map
39
+ //# sourceMappingURL=api-client-34MRJANA.js.map
package/dist/bin/agt.js CHANGED
@@ -31,7 +31,7 @@ import {
31
31
  success,
32
32
  table,
33
33
  warn
34
- } from "../chunk-SHBU7NAQ.js";
34
+ } from "../chunk-L4HODIVN.js";
35
35
  import {
36
36
  ApiError,
37
37
  PROD_AGT_HOST,
@@ -42,17 +42,17 @@ import {
42
42
  getHost,
43
43
  getHostId,
44
44
  setActiveTeam
45
- } from "../chunk-CCWVPE2F.js";
45
+ } from "../chunk-G3CTTMOE.js";
46
46
  import {
47
47
  getProjectDir,
48
48
  isSessionResumeDisabled,
49
49
  readDirectChatSessionState
50
- } from "../chunk-XNHTH267.js";
50
+ } from "../chunk-D5DY5OKR.js";
51
51
  import {
52
52
  markDailySessionSpawn,
53
53
  sessionFileExists,
54
54
  sessionTranscriptDir
55
- } from "../chunk-FQMFWJUD.js";
55
+ } from "../chunk-QK4R5ZIT.js";
56
56
  import "../chunk-XL2HPM67.js";
57
57
  import "../chunk-6HBXEJHO.js";
58
58
  import "../chunk-XWVM4KPK.js";
@@ -85,7 +85,7 @@ import {
85
85
  requiredMcpWildcard,
86
86
  resolveChannels,
87
87
  serializeManifestForSlackCli
88
- } from "../chunk-O5D6I72R.js";
88
+ } from "../chunk-FFLU5VIN.js";
89
89
  import "../chunk-AIUIMEUS.js";
90
90
  import "../chunk-DGUM43GV.js";
91
91
 
@@ -5207,7 +5207,7 @@ import { execFileSync, execSync } from "child_process";
5207
5207
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
5208
5208
  import chalk17 from "chalk";
5209
5209
  import ora15 from "ora";
5210
- var cliVersion = true ? "0.28.1281" : "dev";
5210
+ var cliVersion = true ? "0.28.1283" : "dev";
5211
5211
  async function fetchLatestVersion() {
5212
5212
  const host2 = getHost();
5213
5213
  if (!host2) return null;
@@ -6467,7 +6467,7 @@ function handleError(err) {
6467
6467
  }
6468
6468
 
6469
6469
  // src/bin/agt.ts
6470
- var cliVersion2 = true ? "0.28.1281" : "dev";
6470
+ var cliVersion2 = true ? "0.28.1283" : "dev";
6471
6471
  var program = new Command();
6472
6472
  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");
6473
6473
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-XWVM4KPK.js";
5
5
  import {
6
6
  FORCED_UPDATE_HARD_DEADLINE_MS
7
- } from "./chunk-O5D6I72R.js";
7
+ } from "./chunk-FFLU5VIN.js";
8
8
  import {
9
9
  effectiveClaudeJsonPath
10
10
  } from "./chunk-AIUIMEUS.js";
@@ -722,4 +722,4 @@ export {
722
722
  probeClaudeInstalls,
723
723
  maybeUpdateClaudeCode
724
724
  };
725
- //# sourceMappingURL=chunk-A26WJ7TB.js.map
725
+ //# sourceMappingURL=chunk-5CUCQYZH.js.map
@@ -4,7 +4,7 @@ import {
4
4
  rotateDailySession,
5
5
  sessionFileExists,
6
6
  todayLocalIso
7
- } from "./chunk-FQMFWJUD.js";
7
+ } from "./chunk-QK4R5ZIT.js";
8
8
  import {
9
9
  classifyUnanswerablePane,
10
10
  customApiKeyDialogKeys,
@@ -54,7 +54,7 @@ import {
54
54
  remoteMcpConnectionEnvInfix,
55
55
  remoteMcpConnectionLabel,
56
56
  remoteMcpConnectionScopedEnvVar
57
- } from "./chunk-O5D6I72R.js";
57
+ } from "./chunk-FFLU5VIN.js";
58
58
  import {
59
59
  CLAUDE_CONFIG_DIR_ENV,
60
60
  approveApiKeyInClaudeConfig,
@@ -176,6 +176,7 @@ function hardBoundedExecFile(file, args, opts) {
176
176
  status,
177
177
  message: stderr ? `${base}: ${stderr}` : base,
178
178
  bounded: available,
179
+ stderr: (stderr ?? "").trim(),
179
180
  notFound: e?.code === "ENOENT"
180
181
  };
181
182
  }
@@ -5915,6 +5916,7 @@ var _internals = {
5915
5916
  sessions2.clear();
5916
5917
  },
5917
5918
  isClaudeProcessAliveInTmux,
5919
+ probeSessionLiveness,
5918
5920
  waitForPromptReady,
5919
5921
  // ENG-5770: exported so the unit test in claude-model-alias.test.ts can
5920
5922
  // exercise the send/skip decision without spawning a real tmux session.
@@ -6009,6 +6011,33 @@ var ZOMBIE_STARTUP_GRACE_MS = 6e4;
6009
6011
  var zombieProbeCache = /* @__PURE__ */ new Map();
6010
6012
  var pendingZombieDetections = /* @__PURE__ */ new Map();
6011
6013
  function isClaudeProcessAliveInTmux(tmuxSession) {
6014
+ return probeSessionLiveness(tmuxSession) === "alive";
6015
+ }
6016
+ function paneStartCommand(tmuxSession) {
6017
+ const r = hardBoundedExecFile(
6018
+ "tmux",
6019
+ ["display-message", "-p", "-t", tmuxSessionTarget(tmuxSession), "#{pane_start_command}"],
6020
+ { timeoutMs: 3e3 }
6021
+ );
6022
+ return r.kind === "ok" ? r.stdout.trim() : null;
6023
+ }
6024
+ function classifyNoContainerSession(tmuxSession) {
6025
+ const start = paneStartCommand(tmuxSession);
6026
+ if (!start || /\bdocker\s+run\b/.test(start)) return "dead";
6027
+ return probeClaudeProcessInTmux(tmuxSession) === "alive" ? "host_path" : "dead";
6028
+ }
6029
+ function classifyDockerExecFailure(status, message, stderr) {
6030
+ const text = `${message ?? ""}
6031
+ ${stderr ?? ""}`;
6032
+ if (/no such container|is not running|container [0-9a-f]+ is not running/i.test(text)) return "no_container";
6033
+ if (stderr !== void 0 && stderr.trim() !== "") return "unknown";
6034
+ const dockerSpoke = /error response from daemon|cannot connect to the docker daemon|error during connect|permission denied|docker:/i.test(text);
6035
+ if (dockerSpoke) return "unknown";
6036
+ if (status === 1) return "no_match";
6037
+ if (status === 125 || status === 126) return "no_container";
6038
+ return "unknown";
6039
+ }
6040
+ function probeSessionLiveness(tmuxSession) {
6012
6041
  const codeName = tmuxSession.replace(/^agt-/, "");
6013
6042
  if (effectiveIsolationMode(codeName) === "docker") {
6014
6043
  const r = hardBoundedExecFile(
@@ -6023,13 +6052,15 @@ function isClaudeProcessAliveInTmux(tmuxSession) {
6023
6052
  // the one the code produced.
6024
6053
  { timeoutMs: 8e3 }
6025
6054
  );
6026
- if (r.kind === "ok") return r.stdout.trim().length > 0;
6027
- if (r.kind === "failed" && (r.status === 1 || r.status === 125 || r.status === 126)) {
6028
- return false;
6055
+ if (r.kind === "ok") return r.stdout.trim().length > 0 ? "alive" : "dead";
6056
+ if (r.kind === "failed") {
6057
+ const why = classifyDockerExecFailure(r.status, r.message, r.stderr);
6058
+ if (why === "no_container") return classifyNoContainerSession(tmuxSession);
6059
+ if (why === "no_match") return "dead";
6029
6060
  }
6030
- return true;
6061
+ return "alive";
6031
6062
  }
6032
- return probeClaudeProcessInTmux(tmuxSession) === "alive";
6063
+ return probeClaudeProcessInTmux(tmuxSession) === "alive" ? "alive" : "dead";
6033
6064
  }
6034
6065
  function dockerPgrepVerdict(stdout) {
6035
6066
  const m = /pgrep_rc=(\d+)\s*$/.exec(stdout.trim());
@@ -6151,11 +6182,29 @@ function isSessionHealthy(codeName) {
6151
6182
  if (!withinGrace) {
6152
6183
  const cached = zombieProbeCache.get(codeName);
6153
6184
  const cacheFresh = cached !== void 0 && Date.now() - cached.at < ZOMBIE_PROBE_TTL_MS;
6154
- const claudeAlive = cacheFresh ? cached.alive : isClaudeProcessAliveInTmux(tmuxSession);
6185
+ const liveness = cacheFresh ? cached.liveness : probeSessionLiveness(tmuxSession);
6155
6186
  if (!cacheFresh) {
6156
- zombieProbeCache.set(codeName, { at: Date.now(), alive: claudeAlive });
6187
+ zombieProbeCache.set(codeName, { at: Date.now(), liveness });
6188
+ }
6189
+ if (liveness === "host_path") {
6190
+ try {
6191
+ execFileSync3("tmux", ["kill-session", "-t", tmuxSessionTarget(tmuxSession)], { stdio: "ignore" });
6192
+ } catch {
6193
+ }
6194
+ session.status = "crashed";
6195
+ if (!pendingZombieDetections.has(codeName)) {
6196
+ pendingZombieDetections.set(codeName, {
6197
+ kind: "migrated",
6198
+ codeName,
6199
+ tmuxSession,
6200
+ detectedAt: Date.now(),
6201
+ paneTail: null
6202
+ });
6203
+ }
6204
+ zombieProbeCache.delete(codeName);
6205
+ return false;
6157
6206
  }
6158
- if (!claudeAlive) {
6207
+ if (liveness === "dead") {
6159
6208
  const paneTail = readPaneLogTail(codeName);
6160
6209
  try {
6161
6210
  execFileSync3("tmux", ["kill-session", "-t", tmuxSessionTarget(tmuxSession)], { stdio: "ignore" });
@@ -6172,6 +6221,7 @@ function isSessionHealthy(codeName) {
6172
6221
  session.lastFailureSessionId = failedUuid;
6173
6222
  if (!pendingZombieDetections.has(codeName)) {
6174
6223
  pendingZombieDetections.set(codeName, {
6224
+ kind: "zombie",
6175
6225
  codeName,
6176
6226
  tmuxSession,
6177
6227
  detectedAt: Date.now(),
@@ -6500,6 +6550,7 @@ export {
6500
6550
  injectMessageWithStatus,
6501
6551
  stopPersistentSession,
6502
6552
  getSessionState,
6553
+ classifyDockerExecFailure,
6503
6554
  dockerPgrepVerdict,
6504
6555
  dockerContainerStateVerdict,
6505
6556
  parseEtimeSeconds,
@@ -6515,4 +6566,4 @@ export {
6515
6566
  stopAllSessionsAndWait,
6516
6567
  getProjectDir
6517
6568
  };
6518
- //# sourceMappingURL=chunk-XNHTH267.js.map
6569
+ //# sourceMappingURL=chunk-D5DY5OKR.js.map