@integrity-labs/agt-cli 0.28.1274 → 0.28.1276

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 (34) hide show
  1. package/dist/{api-client-GIY2I6DY.js → api-client-LXSFEHBG.js} +3 -3
  2. package/dist/bin/agt.js +7 -7
  3. package/dist/{chunk-HG46MG2F.js → chunk-2JILRR4Y.js} +51 -8
  4. package/dist/{chunk-HG46MG2F.js.map → chunk-2JILRR4Y.js.map} +1 -1
  5. package/dist/{chunk-UTWVB3MI.js → chunk-C3NM6OTP.js} +2 -2
  6. package/dist/{chunk-END74F3P.js → chunk-HISRTLZ3.js} +3 -3
  7. package/dist/{chunk-6ZGAF4SD.js → chunk-IDLNB6GR.js} +17 -10
  8. package/dist/chunk-IDLNB6GR.js.map +1 -0
  9. package/dist/{chunk-YHTQMJE3.js → chunk-IEXBHI4X.js} +2 -2
  10. package/dist/{chunk-MXCJUNEP.js → chunk-ZQVYTNLA.js} +52 -1
  11. package/dist/{chunk-MXCJUNEP.js.map → chunk-ZQVYTNLA.js.map} +1 -1
  12. package/dist/{claude-code-updater-U6ESCPIL.js → claude-code-updater-GADHFGSY.js} +3 -3
  13. package/dist/{claude-pair-runtime-GZHUPW2V.js → claude-pair-runtime-TUWLJ7TS.js} +3 -3
  14. package/dist/lib/manager-worker.js +22 -21
  15. package/dist/lib/manager-worker.js.map +1 -1
  16. package/dist/mcp/direct-chat-channel.js +52 -1
  17. package/dist/mcp/index.js +282 -10
  18. package/dist/mcp/origami.js +51 -0
  19. package/dist/mcp/slack-channel.js +52 -1
  20. package/dist/mcp/telegram-channel.js +52 -1
  21. package/dist/{persistent-session-C62TH4M6.js → persistent-session-VII4LBJ2.js} +6 -4
  22. package/dist/{responsiveness-probe-FMFTIMHU.js → responsiveness-probe-GX3TEW2E.js} +4 -4
  23. package/dist/{session-auth-dead-B6UDTSKE.js → session-auth-dead-7NXTFGDV.js} +3 -3
  24. package/package.json +1 -1
  25. package/dist/chunk-6ZGAF4SD.js.map +0 -1
  26. /package/dist/{api-client-GIY2I6DY.js.map → api-client-LXSFEHBG.js.map} +0 -0
  27. /package/dist/{chunk-UTWVB3MI.js.map → chunk-C3NM6OTP.js.map} +0 -0
  28. /package/dist/{chunk-END74F3P.js.map → chunk-HISRTLZ3.js.map} +0 -0
  29. /package/dist/{chunk-YHTQMJE3.js.map → chunk-IEXBHI4X.js.map} +0 -0
  30. /package/dist/{claude-code-updater-U6ESCPIL.js.map → claude-code-updater-GADHFGSY.js.map} +0 -0
  31. /package/dist/{claude-pair-runtime-GZHUPW2V.js.map → claude-pair-runtime-TUWLJ7TS.js.map} +0 -0
  32. /package/dist/{persistent-session-C62TH4M6.js.map → persistent-session-VII4LBJ2.js.map} +0 -0
  33. /package/dist/{responsiveness-probe-FMFTIMHU.js.map → responsiveness-probe-GX3TEW2E.js.map} +0 -0
  34. /package/dist/{session-auth-dead-B6UDTSKE.js.map → session-auth-dead-7NXTFGDV.js.map} +0 -0
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-XWVM4KPK.js";
5
5
  import {
6
6
  FORCED_UPDATE_HARD_DEADLINE_MS
7
- } from "./chunk-MXCJUNEP.js";
7
+ } from "./chunk-ZQVYTNLA.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-UTWVB3MI.js.map
725
+ //# sourceMappingURL=chunk-C3NM6OTP.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  HOST_ROTATE_KEY_CONFLICT
3
- } from "./chunk-MXCJUNEP.js";
3
+ } from "./chunk-ZQVYTNLA.js";
4
4
 
5
5
  // src/lib/config.ts
6
6
  import { readFileSync, writeFileSync, mkdirSync, existsSync } from "fs";
@@ -103,7 +103,7 @@ function exchangeFailureKind(err) {
103
103
  }
104
104
 
105
105
  // src/lib/api-client.ts
106
- var agtCliVersion = true ? "0.28.1274" : "dev";
106
+ var agtCliVersion = true ? "0.28.1276" : "dev";
107
107
  var lastConfigHash = null;
108
108
  function setConfigHash(hash) {
109
109
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -468,4 +468,4 @@ export {
468
468
  api,
469
469
  getHostId
470
470
  };
471
- //# sourceMappingURL=chunk-END74F3P.js.map
471
+ //# sourceMappingURL=chunk-HISRTLZ3.js.map
@@ -4,7 +4,7 @@ import {
4
4
  rotateDailySession,
5
5
  sessionFileExists,
6
6
  todayLocalIso
7
- } from "./chunk-YHTQMJE3.js";
7
+ } from "./chunk-IEXBHI4X.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-MXCJUNEP.js";
57
+ } from "./chunk-ZQVYTNLA.js";
58
58
  import {
59
59
  CLAUDE_CONFIG_DIR_ENV,
60
60
  approveApiKeyInClaudeConfig,
@@ -2997,7 +2997,7 @@ function tmuxSessionTarget2(session) {
2997
2997
  n = n.slice(0, -1);
2998
2998
  return `=${n}`;
2999
2999
  }
3000
- var TMUX_SESSION_ABSENT = /can't find session|no server running|error connecting to .* \(No such file or directory\)/i;
3000
+ var TMUX_SESSION_ABSENT = /can't find session|no server running/i;
3001
3001
  function probeTmuxSession(tmuxSession) {
3002
3002
  try {
3003
3003
  execFileSync2("tmux", ["has-session", "-t", tmuxSessionTarget2(tmuxSession)], {
@@ -4700,7 +4700,7 @@ function applyPaneAgentIdVerdict(args) {
4700
4700
  `[persistent-session] PANE AGENT ID MISMATCH agent=${codeName} isolation=${args.isolation} \u2014 ${mismatch}`
4701
4701
  );
4702
4702
  session.status = "crashed";
4703
- session.startedAt = args.now ? args.now() : Date.now();
4703
+ session.teardownRequestedAt = args.now ? args.now() : Date.now();
4704
4704
  log2(
4705
4705
  `[persistent-session] requesting kill of session '${tmuxSession}' for '${codeName}' \u2014 refusing to run an agent under another agent's identity (ENG-8800)`
4706
4706
  );
@@ -5018,16 +5018,20 @@ function writeDirectChatSessionState(agentId, state) {
5018
5018
  function spawnBackoffMs(restartCount) {
5019
5019
  return Math.min(5e3 * Math.pow(2, restartCount), 6e4);
5020
5020
  }
5021
+ function crashRespawnDeferred(existing, nowMs) {
5022
+ if (existing.status !== "crashed") return false;
5023
+ const anchor = Math.max(existing.startedAt ?? 0, existing.teardownRequestedAt ?? 0);
5024
+ if (!anchor) return false;
5025
+ return nowMs - anchor < spawnBackoffMs(existing.restartCount ?? 0);
5026
+ }
5021
5027
  function startPersistentSession(config) {
5022
5028
  const existing = sessions2.get(config.codeName);
5023
5029
  if (existing && existing.status === "running") {
5024
5030
  return existing;
5025
5031
  }
5026
5032
  const restartCount = existing?.restartCount ?? 0;
5027
- if (existing?.status === "crashed" && existing.startedAt) {
5028
- if (Date.now() - existing.startedAt < spawnBackoffMs(restartCount)) {
5029
- return existing;
5030
- }
5033
+ if (existing && crashRespawnDeferred(existing, Date.now())) {
5034
+ return existing;
5031
5035
  }
5032
5036
  clearSessionBlockedOnPrompt(config.codeName);
5033
5037
  const session = {
@@ -6045,14 +6049,16 @@ function parseEtimeSeconds(etime) {
6045
6049
  function olderSessionProcessFromPs(psOut, tmuxSession, olderThanSeconds) {
6046
6050
  const needle = new RegExp(`(^|\\s)--name ${escapePgrepRegex(tmuxSession)}(\\s|$)`);
6047
6051
  let unreadable = false;
6052
+ let ambiguous = false;
6048
6053
  for (const line2 of psOut.split("\n")) {
6049
6054
  const m = /^\s*(\d+)\s+(\S+)\s+(.*)$/.exec(line2);
6050
6055
  if (!m || !needle.test(m[3])) continue;
6051
6056
  const age = parseEtimeSeconds(m[2]);
6052
6057
  if (age === null) unreadable = true;
6053
6058
  else if (age > olderThanSeconds) return "alive";
6059
+ else if (age + 1 > olderThanSeconds) ambiguous = true;
6054
6060
  }
6055
- return unreadable ? "unknown" : "dead";
6061
+ return unreadable || ambiguous ? "unknown" : "dead";
6056
6062
  }
6057
6063
  function probeSessionProcess(codeName) {
6058
6064
  if (effectiveIsolationMode(codeName) === "docker") {
@@ -6474,6 +6480,7 @@ export {
6474
6480
  readDirectChatSessionState,
6475
6481
  writeDirectChatSessionState,
6476
6482
  spawnBackoffMs,
6483
+ crashRespawnDeferred,
6477
6484
  startPersistentSession,
6478
6485
  TMUX_BOOTSTRAP_HOLD_CMD,
6479
6486
  TMUX_BOOTSTRAP_SESSION_PREFIX,
@@ -6504,4 +6511,4 @@ export {
6504
6511
  stopAllSessionsAndWait,
6505
6512
  getProjectDir
6506
6513
  };
6507
- //# sourceMappingURL=chunk-6ZGAF4SD.js.map
6514
+ //# sourceMappingURL=chunk-IDLNB6GR.js.map