@integrity-labs/agt-cli 0.28.1282 → 0.28.1284

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-5L5TDFEN.js → api-client-R6RJRYGB.js} +3 -3
  2. package/dist/bin/agt.js +7 -7
  3. package/dist/{chunk-KZ55FIP5.js → chunk-ENQZZU7H.js} +2 -2
  4. package/dist/{chunk-AG2YIBH2.js → chunk-MOEUK4YM.js} +13 -1
  5. package/dist/chunk-MOEUK4YM.js.map +1 -0
  6. package/dist/{chunk-EUD5VDGR.js → chunk-NTSHQA62.js} +2 -2
  7. package/dist/{chunk-PLL64X3Q.js → chunk-ORVKG3JD.js} +5 -5
  8. package/dist/{chunk-URE73ODK.js → chunk-UTJFYUFS.js} +62 -11
  9. package/dist/chunk-UTJFYUFS.js.map +1 -0
  10. package/dist/{chunk-FP4Z5C4N.js → chunk-VVLJQMAS.js} +3 -3
  11. package/dist/{claude-code-updater-C7BXV6S7.js → claude-code-updater-CHQOLPJQ.js} +3 -3
  12. package/dist/{claude-pair-runtime-7W5TM3MA.js → claude-pair-runtime-DULPA33Z.js} +3 -3
  13. package/dist/lib/manager-worker.js +74 -29
  14. package/dist/lib/manager-worker.js.map +1 -1
  15. package/dist/mcp/direct-chat-channel.js +15 -0
  16. package/dist/mcp/index.js +16 -1
  17. package/dist/mcp/origami.js +15 -0
  18. package/dist/mcp/slack-channel.js +15 -0
  19. package/dist/mcp/telegram-channel.js +15 -0
  20. package/dist/{persistent-session-C6G3R6BI.js → persistent-session-IAMIVRZ3.js} +6 -4
  21. package/dist/{responsiveness-probe-Q4GRRSHY.js → responsiveness-probe-CLRUQOE2.js} +4 -4
  22. package/dist/{session-auth-dead-MAJHZEHU.js → session-auth-dead-SH6ZJTOS.js} +3 -3
  23. package/package.json +1 -1
  24. package/dist/chunk-AG2YIBH2.js.map +0 -1
  25. package/dist/chunk-URE73ODK.js.map +0 -1
  26. /package/dist/{api-client-5L5TDFEN.js.map → api-client-R6RJRYGB.js.map} +0 -0
  27. /package/dist/{chunk-KZ55FIP5.js.map → chunk-ENQZZU7H.js.map} +0 -0
  28. /package/dist/{chunk-EUD5VDGR.js.map → chunk-NTSHQA62.js.map} +0 -0
  29. /package/dist/{chunk-PLL64X3Q.js.map → chunk-ORVKG3JD.js.map} +0 -0
  30. /package/dist/{chunk-FP4Z5C4N.js.map → chunk-VVLJQMAS.js.map} +0 -0
  31. /package/dist/{claude-code-updater-C7BXV6S7.js.map → claude-code-updater-CHQOLPJQ.js.map} +0 -0
  32. /package/dist/{claude-pair-runtime-7W5TM3MA.js.map → claude-pair-runtime-DULPA33Z.js.map} +0 -0
  33. /package/dist/{persistent-session-C6G3R6BI.js.map → persistent-session-IAMIVRZ3.js.map} +0 -0
  34. /package/dist/{responsiveness-probe-Q4GRRSHY.js.map → responsiveness-probe-CLRUQOE2.js.map} +0 -0
  35. /package/dist/{session-auth-dead-MAJHZEHU.js.map → session-auth-dead-SH6ZJTOS.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  encodeClaudeProjectPath
3
- } from "./chunk-AG2YIBH2.js";
3
+ } from "./chunk-MOEUK4YM.js";
4
4
 
5
5
  // src/lib/daily-session.ts
6
6
  import { randomUUID } from "crypto";
@@ -244,4 +244,4 @@ export {
244
244
  peekPreviousSession,
245
245
  readDailySessionPin
246
246
  };
247
- //# sourceMappingURL=chunk-EUD5VDGR.js.map
247
+ //# sourceMappingURL=chunk-NTSHQA62.js.map
@@ -2,7 +2,7 @@ import {
2
2
  exchangeApiKey,
3
3
  getApiKey,
4
4
  getHost
5
- } from "./chunk-FP4Z5C4N.js";
5
+ } from "./chunk-VVLJQMAS.js";
6
6
  import {
7
7
  LATE_BOUND_VARS,
8
8
  PLATFORM_DENY_PERMISSIONS,
@@ -26,11 +26,11 @@ import {
26
26
  warnIgnoredIsolationAllowlist,
27
27
  withheldRemoteMcpMessage,
28
28
  withheldRemoteMcpReasonFor
29
- } from "./chunk-URE73ODK.js";
29
+ } from "./chunk-UTJFYUFS.js";
30
30
  import {
31
31
  readDailySessionPin,
32
32
  sessionTranscriptDir
33
- } from "./chunk-EUD5VDGR.js";
33
+ } from "./chunk-NTSHQA62.js";
34
34
  import {
35
35
  classifyUnanswerablePane,
36
36
  isConsumerTermsDialogVisible,
@@ -102,7 +102,7 @@ import {
102
102
  scanConfigForLiteralSecrets,
103
103
  worseConnectivityOutcome,
104
104
  wrapScheduledTaskPrompt
105
- } from "./chunk-AG2YIBH2.js";
105
+ } from "./chunk-MOEUK4YM.js";
106
106
  import {
107
107
  claudeJsonPathFor,
108
108
  effectiveClaudeJsonPath,
@@ -13853,4 +13853,4 @@ export {
13853
13853
  managerInstallSystemUnitCommand,
13854
13854
  managerUninstallSystemUnitCommand
13855
13855
  };
13856
- //# sourceMappingURL=chunk-PLL64X3Q.js.map
13856
+ //# sourceMappingURL=chunk-ORVKG3JD.js.map
@@ -4,7 +4,7 @@ import {
4
4
  rotateDailySession,
5
5
  sessionFileExists,
6
6
  todayLocalIso
7
- } from "./chunk-EUD5VDGR.js";
7
+ } from "./chunk-NTSHQA62.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-AG2YIBH2.js";
57
+ } from "./chunk-MOEUK4YM.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-URE73ODK.js.map
6569
+ //# sourceMappingURL=chunk-UTJFYUFS.js.map