@integrity-labs/agt-cli 0.28.1274 → 0.28.1275

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 (31) hide show
  1. package/dist/{api-client-GIY2I6DY.js → api-client-5S4JHNCY.js} +3 -3
  2. package/dist/bin/agt.js +7 -7
  3. package/dist/{chunk-UTWVB3MI.js → chunk-4UXZAUEY.js} +2 -2
  4. package/dist/{chunk-6ZGAF4SD.js → chunk-7D6EMIHG.js} +17 -10
  5. package/dist/chunk-7D6EMIHG.js.map +1 -0
  6. package/dist/{chunk-HG46MG2F.js → chunk-7PIMV2ID.js} +5 -5
  7. package/dist/{chunk-END74F3P.js → chunk-BSVQWPBC.js} +3 -3
  8. package/dist/{chunk-YHTQMJE3.js → chunk-GRWU34ID.js} +2 -2
  9. package/dist/{chunk-MXCJUNEP.js → chunk-V2BS3IN3.js} +1 -1
  10. package/dist/{chunk-MXCJUNEP.js.map → chunk-V2BS3IN3.js.map} +1 -1
  11. package/dist/{claude-code-updater-U6ESCPIL.js → claude-code-updater-EC3JMSNJ.js} +3 -3
  12. package/dist/{claude-pair-runtime-GZHUPW2V.js → claude-pair-runtime-NPBFKJSQ.js} +3 -3
  13. package/dist/lib/manager-worker.js +21 -21
  14. package/dist/mcp/direct-chat-channel.js +1 -1
  15. package/dist/mcp/slack-channel.js +1 -1
  16. package/dist/mcp/telegram-channel.js +1 -1
  17. package/dist/{persistent-session-C62TH4M6.js → persistent-session-EJUOBWXJ.js} +6 -4
  18. package/dist/{responsiveness-probe-FMFTIMHU.js → responsiveness-probe-GBYZCGXX.js} +4 -4
  19. package/dist/{session-auth-dead-B6UDTSKE.js → session-auth-dead-4U6NDCWN.js} +3 -3
  20. package/package.json +1 -1
  21. package/dist/chunk-6ZGAF4SD.js.map +0 -1
  22. /package/dist/{api-client-GIY2I6DY.js.map → api-client-5S4JHNCY.js.map} +0 -0
  23. /package/dist/{chunk-UTWVB3MI.js.map → chunk-4UXZAUEY.js.map} +0 -0
  24. /package/dist/{chunk-HG46MG2F.js.map → chunk-7PIMV2ID.js.map} +0 -0
  25. /package/dist/{chunk-END74F3P.js.map → chunk-BSVQWPBC.js.map} +0 -0
  26. /package/dist/{chunk-YHTQMJE3.js.map → chunk-GRWU34ID.js.map} +0 -0
  27. /package/dist/{claude-code-updater-U6ESCPIL.js.map → claude-code-updater-EC3JMSNJ.js.map} +0 -0
  28. /package/dist/{claude-pair-runtime-GZHUPW2V.js.map → claude-pair-runtime-NPBFKJSQ.js.map} +0 -0
  29. /package/dist/{persistent-session-C62TH4M6.js.map → persistent-session-EJUOBWXJ.js.map} +0 -0
  30. /package/dist/{responsiveness-probe-FMFTIMHU.js.map → responsiveness-probe-GBYZCGXX.js.map} +0 -0
  31. /package/dist/{session-auth-dead-B6UDTSKE.js.map → session-auth-dead-4U6NDCWN.js.map} +0 -0
@@ -15,8 +15,8 @@ import {
15
15
  mintRotatedHostKey,
16
16
  probeHostKey,
17
17
  setConfigHash
18
- } from "./chunk-END74F3P.js";
19
- import "./chunk-MXCJUNEP.js";
18
+ } from "./chunk-BSVQWPBC.js";
19
+ import "./chunk-V2BS3IN3.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-GIY2I6DY.js.map
39
+ //# sourceMappingURL=api-client-5S4JHNCY.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-HG46MG2F.js";
34
+ } from "../chunk-7PIMV2ID.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-END74F3P.js";
45
+ } from "../chunk-BSVQWPBC.js";
46
46
  import {
47
47
  getProjectDir,
48
48
  isSessionResumeDisabled,
49
49
  readDirectChatSessionState
50
- } from "../chunk-6ZGAF4SD.js";
50
+ } from "../chunk-7D6EMIHG.js";
51
51
  import {
52
52
  markDailySessionSpawn,
53
53
  sessionFileExists,
54
54
  sessionTranscriptDir
55
- } from "../chunk-YHTQMJE3.js";
55
+ } from "../chunk-GRWU34ID.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-MXCJUNEP.js";
88
+ } from "../chunk-V2BS3IN3.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.1274" : "dev";
5210
+ var cliVersion = true ? "0.28.1275" : "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.1274" : "dev";
6470
+ var cliVersion2 = true ? "0.28.1275" : "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-MXCJUNEP.js";
7
+ } from "./chunk-V2BS3IN3.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-4UXZAUEY.js.map
@@ -4,7 +4,7 @@ import {
4
4
  rotateDailySession,
5
5
  sessionFileExists,
6
6
  todayLocalIso
7
- } from "./chunk-YHTQMJE3.js";
7
+ } from "./chunk-GRWU34ID.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-V2BS3IN3.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-7D6EMIHG.js.map