@integrity-labs/agt-cli 0.28.1273 → 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 (34) hide show
  1. package/dist/{api-client-PENFPEFF.js → api-client-5S4JHNCY.js} +3 -3
  2. package/dist/bin/agt.js +7 -7
  3. package/dist/{chunk-5J56SF6P.js → chunk-4UXZAUEY.js} +2 -2
  4. package/dist/{chunk-QLNKB2E3.js → chunk-7D6EMIHG.js} +30 -15
  5. package/dist/chunk-7D6EMIHG.js.map +1 -0
  6. package/dist/{chunk-3WRBN6EY.js → chunk-7PIMV2ID.js} +10 -8
  7. package/dist/{chunk-3WRBN6EY.js.map → chunk-7PIMV2ID.js.map} +1 -1
  8. package/dist/{chunk-3P3COJTT.js → chunk-BSVQWPBC.js} +3 -3
  9. package/dist/{chunk-H2CESPPE.js → chunk-GRWU34ID.js} +2 -2
  10. package/dist/{chunk-QOH2AE5I.js → chunk-V2BS3IN3.js} +9 -2
  11. package/dist/{chunk-QOH2AE5I.js.map → chunk-V2BS3IN3.js.map} +1 -1
  12. package/dist/{claude-code-updater-NWNHKBJE.js → claude-code-updater-EC3JMSNJ.js} +3 -3
  13. package/dist/{claude-pair-runtime-EMBJDR4W.js → claude-pair-runtime-NPBFKJSQ.js} +3 -3
  14. package/dist/lib/manager-worker.js +765 -447
  15. package/dist/lib/manager-worker.js.map +1 -1
  16. package/dist/mcp/direct-chat-channel.js +9 -2
  17. package/dist/mcp/index.js +8 -1
  18. package/dist/mcp/origami.js +8 -1
  19. package/dist/mcp/slack-channel.js +9 -2
  20. package/dist/mcp/telegram-channel.js +9 -2
  21. package/dist/{persistent-session-7VJJ4AD7.js → persistent-session-EJUOBWXJ.js} +8 -4
  22. package/dist/{responsiveness-probe-XGTPNCKO.js → responsiveness-probe-GBYZCGXX.js} +4 -4
  23. package/dist/{session-auth-dead-4CCOVCU3.js → session-auth-dead-4U6NDCWN.js} +3 -3
  24. package/package.json +1 -1
  25. package/dist/chunk-QLNKB2E3.js.map +0 -1
  26. /package/dist/{api-client-PENFPEFF.js.map → api-client-5S4JHNCY.js.map} +0 -0
  27. /package/dist/{chunk-5J56SF6P.js.map → chunk-4UXZAUEY.js.map} +0 -0
  28. /package/dist/{chunk-3P3COJTT.js.map → chunk-BSVQWPBC.js.map} +0 -0
  29. /package/dist/{chunk-H2CESPPE.js.map → chunk-GRWU34ID.js.map} +0 -0
  30. /package/dist/{claude-code-updater-NWNHKBJE.js.map → claude-code-updater-EC3JMSNJ.js.map} +0 -0
  31. /package/dist/{claude-pair-runtime-EMBJDR4W.js.map → claude-pair-runtime-NPBFKJSQ.js.map} +0 -0
  32. /package/dist/{persistent-session-7VJJ4AD7.js.map → persistent-session-EJUOBWXJ.js.map} +0 -0
  33. /package/dist/{responsiveness-probe-XGTPNCKO.js.map → responsiveness-probe-GBYZCGXX.js.map} +0 -0
  34. /package/dist/{session-auth-dead-4CCOVCU3.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-3P3COJTT.js";
19
- import "./chunk-QOH2AE5I.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-PENFPEFF.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-3WRBN6EY.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-3P3COJTT.js";
45
+ } from "../chunk-BSVQWPBC.js";
46
46
  import {
47
47
  getProjectDir,
48
48
  isSessionResumeDisabled,
49
49
  readDirectChatSessionState
50
- } from "../chunk-QLNKB2E3.js";
50
+ } from "../chunk-7D6EMIHG.js";
51
51
  import {
52
52
  markDailySessionSpawn,
53
53
  sessionFileExists,
54
54
  sessionTranscriptDir
55
- } from "../chunk-H2CESPPE.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-QOH2AE5I.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.1273" : "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.1273" : "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-QOH2AE5I.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-5J56SF6P.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-H2CESPPE.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-QOH2AE5I.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)], {
@@ -4042,6 +4042,16 @@ function projectClaudeSettingsNotice(codeName, outcome) {
4042
4042
  }
4043
4043
  }
4044
4044
 
4045
+ // src/lib/isolation-allowlist.ts
4046
+ function warnIgnoredIsolationAllowlist(log2, env = process.env) {
4047
+ const raw = env.AGT_ISOLATION_AGENTS;
4048
+ if (raw == null || raw.trim() === "") return null;
4049
+ const scope = env.AGT_ISOLATION === "docker" ? "Docker isolation is requested (AGT_ISOLATION=docker) for every agent on this host; the isolation readiness check reports whether it is in effect" : 'AGT_ISOLATION is not "docker", so no agent on this host is isolated';
4050
+ const msg = `[isolation] WARNING: AGT_ISOLATION_AGENTS is set (${JSON.stringify(raw)}) but is IGNORED since ENG-11871: ${scope}. Remove it from the manager environment (e.g. /etc/systemd/system/agt-manager.service.d/*.conf). To take a host out of isolation, follow the ADR-0014 rollback: a last-sorting drop-in setting Environment="AGT_ISOLATION=none" (deleting 10-isolation.conf alone is not enough, the unit body also sets it).`;
4051
+ log2(msg);
4052
+ return msg;
4053
+ }
4054
+
4045
4055
  // src/lib/persistent-session.ts
4046
4056
  var OPENROUTER_ANTHROPIC_BASE_URL = "https://openrouter.ai/api";
4047
4057
  function syncClaudeCredsToRoot() {
@@ -4127,11 +4137,8 @@ function resolveClaudeBinary() {
4127
4137
  }
4128
4138
  return "claude";
4129
4139
  }
4130
- function isolationMode(codeName) {
4131
- if (process.env.AGT_ISOLATION !== "docker") return "none";
4132
- const allow = (process.env.AGT_ISOLATION_AGENTS ?? "").split(",").map((s) => s.trim()).filter(Boolean);
4133
- if (allow.length > 0 && (!codeName || !allow.includes(codeName))) return "none";
4134
- return "docker";
4140
+ function isolationMode(_codeName) {
4141
+ return process.env.AGT_ISOLATION === "docker" ? "docker" : "none";
4135
4142
  }
4136
4143
  var dockerReadinessCache = null;
4137
4144
  var isolationDegradationLogged = false;
@@ -4693,7 +4700,7 @@ function applyPaneAgentIdVerdict(args) {
4693
4700
  `[persistent-session] PANE AGENT ID MISMATCH agent=${codeName} isolation=${args.isolation} \u2014 ${mismatch}`
4694
4701
  );
4695
4702
  session.status = "crashed";
4696
- session.startedAt = args.now ? args.now() : Date.now();
4703
+ session.teardownRequestedAt = args.now ? args.now() : Date.now();
4697
4704
  log2(
4698
4705
  `[persistent-session] requesting kill of session '${tmuxSession}' for '${codeName}' \u2014 refusing to run an agent under another agent's identity (ENG-8800)`
4699
4706
  );
@@ -5011,16 +5018,20 @@ function writeDirectChatSessionState(agentId, state) {
5011
5018
  function spawnBackoffMs(restartCount) {
5012
5019
  return Math.min(5e3 * Math.pow(2, restartCount), 6e4);
5013
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
+ }
5014
5027
  function startPersistentSession(config) {
5015
5028
  const existing = sessions2.get(config.codeName);
5016
5029
  if (existing && existing.status === "running") {
5017
5030
  return existing;
5018
5031
  }
5019
5032
  const restartCount = existing?.restartCount ?? 0;
5020
- if (existing?.status === "crashed" && existing.startedAt) {
5021
- if (Date.now() - existing.startedAt < spawnBackoffMs(restartCount)) {
5022
- return existing;
5023
- }
5033
+ if (existing && crashRespawnDeferred(existing, Date.now())) {
5034
+ return existing;
5024
5035
  }
5025
5036
  clearSessionBlockedOnPrompt(config.codeName);
5026
5037
  const session = {
@@ -6038,14 +6049,16 @@ function parseEtimeSeconds(etime) {
6038
6049
  function olderSessionProcessFromPs(psOut, tmuxSession, olderThanSeconds) {
6039
6050
  const needle = new RegExp(`(^|\\s)--name ${escapePgrepRegex(tmuxSession)}(\\s|$)`);
6040
6051
  let unreadable = false;
6052
+ let ambiguous = false;
6041
6053
  for (const line2 of psOut.split("\n")) {
6042
6054
  const m = /^\s*(\d+)\s+(\S+)\s+(.*)$/.exec(line2);
6043
6055
  if (!m || !needle.test(m[3])) continue;
6044
6056
  const age = parseEtimeSeconds(m[2]);
6045
6057
  if (age === null) unreadable = true;
6046
6058
  else if (age > olderThanSeconds) return "alive";
6059
+ else if (age + 1 > olderThanSeconds) ambiguous = true;
6047
6060
  }
6048
- return unreadable ? "unknown" : "dead";
6061
+ return unreadable || ambiguous ? "unknown" : "dead";
6049
6062
  }
6050
6063
  function probeSessionProcess(codeName) {
6051
6064
  if (effectiveIsolationMode(codeName) === "docker") {
@@ -6413,6 +6426,7 @@ export {
6413
6426
  resolveModelPolicySpawnEnv,
6414
6427
  failoverRestartNotice,
6415
6428
  policyResolvedModel,
6429
+ warnIgnoredIsolationAllowlist,
6416
6430
  resolveSessionTz,
6417
6431
  resolveOAuthCredAction,
6418
6432
  resolveClaudeBinary,
@@ -6466,6 +6480,7 @@ export {
6466
6480
  readDirectChatSessionState,
6467
6481
  writeDirectChatSessionState,
6468
6482
  spawnBackoffMs,
6483
+ crashRespawnDeferred,
6469
6484
  startPersistentSession,
6470
6485
  TMUX_BOOTSTRAP_HOLD_CMD,
6471
6486
  TMUX_BOOTSTRAP_SESSION_PREFIX,
@@ -6496,4 +6511,4 @@ export {
6496
6511
  stopAllSessionsAndWait,
6497
6512
  getProjectDir
6498
6513
  };
6499
- //# sourceMappingURL=chunk-QLNKB2E3.js.map
6514
+ //# sourceMappingURL=chunk-7D6EMIHG.js.map