@integrity-labs/agt-cli 0.28.1307 → 0.28.1309

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-HAN3QU6H.js → api-client-OU7NANHC.js} +3 -3
  2. package/dist/bin/agt.js +7 -7
  3. package/dist/{chunk-IA3IT3JM.js → chunk-GODP7VNT.js} +5 -5
  4. package/dist/{chunk-I6HGFJNX.js → chunk-JZOA4A3J.js} +2 -2
  5. package/dist/{chunk-VOYD7FPP.js → chunk-LZZNWEAC.js} +3 -3
  6. package/dist/{chunk-GLX5CD6S.js → chunk-NXTNYNNV.js} +2 -2
  7. package/dist/{chunk-CQQYZUC5.js → chunk-VSJUMNQ5.js} +108 -13
  8. package/dist/chunk-VSJUMNQ5.js.map +1 -0
  9. package/dist/{chunk-4KSUIAI4.js → chunk-WW2CTOEO.js} +9 -73
  10. package/dist/chunk-WW2CTOEO.js.map +1 -0
  11. package/dist/{claude-code-updater-KA4VMUWK.js → claude-code-updater-OU4AEM5Y.js} +3 -3
  12. package/dist/{claude-pair-runtime-AAGIQSUI.js → claude-pair-runtime-H7A7ZOEW.js} +3 -3
  13. package/dist/lib/manager-worker.js +156 -27
  14. package/dist/lib/manager-worker.js.map +1 -1
  15. package/dist/mcp/direct-chat-channel.js +8 -72
  16. package/dist/mcp/index.js +18 -73
  17. package/dist/mcp/origami.js +8 -72
  18. package/dist/mcp/slack-channel.js +111 -180
  19. package/dist/mcp/telegram-channel.js +8 -72
  20. package/dist/{persistent-session-FJ4Y7XIB.js → persistent-session-OUCTECWP.js} +18 -4
  21. package/dist/{responsiveness-probe-2MCC7NOE.js → responsiveness-probe-SC72APRB.js} +4 -4
  22. package/dist/{session-auth-dead-MDZWPSED.js → session-auth-dead-MQR2SLW5.js} +3 -3
  23. package/package.json +1 -1
  24. package/dist/chunk-4KSUIAI4.js.map +0 -1
  25. package/dist/chunk-CQQYZUC5.js.map +0 -1
  26. /package/dist/{api-client-HAN3QU6H.js.map → api-client-OU7NANHC.js.map} +0 -0
  27. /package/dist/{chunk-IA3IT3JM.js.map → chunk-GODP7VNT.js.map} +0 -0
  28. /package/dist/{chunk-I6HGFJNX.js.map → chunk-JZOA4A3J.js.map} +0 -0
  29. /package/dist/{chunk-VOYD7FPP.js.map → chunk-LZZNWEAC.js.map} +0 -0
  30. /package/dist/{chunk-GLX5CD6S.js.map → chunk-NXTNYNNV.js.map} +0 -0
  31. /package/dist/{claude-code-updater-KA4VMUWK.js.map → claude-code-updater-OU4AEM5Y.js.map} +0 -0
  32. /package/dist/{claude-pair-runtime-AAGIQSUI.js.map → claude-pair-runtime-H7A7ZOEW.js.map} +0 -0
  33. /package/dist/{persistent-session-FJ4Y7XIB.js.map → persistent-session-OUCTECWP.js.map} +0 -0
  34. /package/dist/{responsiveness-probe-2MCC7NOE.js.map → responsiveness-probe-SC72APRB.js.map} +0 -0
  35. /package/dist/{session-auth-dead-MDZWPSED.js.map → session-auth-dead-MQR2SLW5.js.map} +0 -0
@@ -15,8 +15,8 @@ import {
15
15
  mintRotatedHostKey,
16
16
  probeHostKey,
17
17
  setConfigHash
18
- } from "./chunk-VOYD7FPP.js";
19
- import "./chunk-4KSUIAI4.js";
18
+ } from "./chunk-LZZNWEAC.js";
19
+ import "./chunk-WW2CTOEO.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-HAN3QU6H.js.map
39
+ //# sourceMappingURL=api-client-OU7NANHC.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-IA3IT3JM.js";
34
+ } from "../chunk-GODP7VNT.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-VOYD7FPP.js";
45
+ } from "../chunk-LZZNWEAC.js";
46
46
  import {
47
47
  getProjectDir,
48
48
  isSessionResumeDisabled,
49
49
  readDirectChatSessionState
50
- } from "../chunk-CQQYZUC5.js";
50
+ } from "../chunk-VSJUMNQ5.js";
51
51
  import {
52
52
  markDailySessionSpawn,
53
53
  sessionFileExists,
54
54
  sessionTranscriptDir
55
- } from "../chunk-GLX5CD6S.js";
55
+ } from "../chunk-NXTNYNNV.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-4KSUIAI4.js";
88
+ } from "../chunk-WW2CTOEO.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.1307" : "dev";
5210
+ var cliVersion = true ? "0.28.1309" : "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.1307" : "dev";
6470
+ var cliVersion2 = true ? "0.28.1309" : "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) => {
@@ -2,7 +2,7 @@ import {
2
2
  exchangeApiKey,
3
3
  getApiKey,
4
4
  getHost
5
- } from "./chunk-VOYD7FPP.js";
5
+ } from "./chunk-LZZNWEAC.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-CQQYZUC5.js";
29
+ } from "./chunk-VSJUMNQ5.js";
30
30
  import {
31
31
  readDailySessionPin,
32
32
  sessionTranscriptDir
33
- } from "./chunk-GLX5CD6S.js";
33
+ } from "./chunk-NXTNYNNV.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-4KSUIAI4.js";
105
+ } from "./chunk-WW2CTOEO.js";
106
106
  import {
107
107
  claudeJsonPathFor,
108
108
  effectiveClaudeJsonPath,
@@ -13876,4 +13876,4 @@ export {
13876
13876
  managerInstallSystemUnitCommand,
13877
13877
  managerUninstallSystemUnitCommand
13878
13878
  };
13879
- //# sourceMappingURL=chunk-IA3IT3JM.js.map
13879
+ //# sourceMappingURL=chunk-GODP7VNT.js.map
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-XWVM4KPK.js";
5
5
  import {
6
6
  FORCED_UPDATE_HARD_DEADLINE_MS
7
- } from "./chunk-4KSUIAI4.js";
7
+ } from "./chunk-WW2CTOEO.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-I6HGFJNX.js.map
725
+ //# sourceMappingURL=chunk-JZOA4A3J.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  HOST_ROTATE_KEY_CONFLICT
3
- } from "./chunk-4KSUIAI4.js";
3
+ } from "./chunk-WW2CTOEO.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.1307" : "dev";
106
+ var agtCliVersion = true ? "0.28.1309" : "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-VOYD7FPP.js.map
471
+ //# sourceMappingURL=chunk-LZZNWEAC.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  encodeClaudeProjectPath
3
- } from "./chunk-4KSUIAI4.js";
3
+ } from "./chunk-WW2CTOEO.js";
4
4
 
5
5
  // src/lib/daily-session.ts
6
6
  import { randomUUID } from "crypto";
@@ -245,4 +245,4 @@ export {
245
245
  peekPreviousSession,
246
246
  readDailySessionPin
247
247
  };
248
- //# sourceMappingURL=chunk-GLX5CD6S.js.map
248
+ //# sourceMappingURL=chunk-NXTNYNNV.js.map
@@ -4,7 +4,7 @@ import {
4
4
  rotateDailySession,
5
5
  sessionFileExists,
6
6
  todayLocalIso
7
- } from "./chunk-GLX5CD6S.js";
7
+ } from "./chunk-NXTNYNNV.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-4KSUIAI4.js";
57
+ } from "./chunk-WW2CTOEO.js";
58
58
  import {
59
59
  CLAUDE_CONFIG_DIR_ENV,
60
60
  approveApiKeyInClaudeConfig,
@@ -71,7 +71,7 @@ import {
71
71
  } from "./chunk-DGUM43GV.js";
72
72
 
73
73
  // src/lib/persistent-session.ts
74
- import { spawn as spawn2, execSync as execSync2, execFileSync as execFileSync3 } from "child_process";
74
+ import { spawn as spawn2, execSync as execSync2, execFile as execFile2, execFileSync as execFileSync3 } from "child_process";
75
75
 
76
76
  // src/lib/bounded-exec.ts
77
77
  import { execFileSync } from "child_process";
@@ -133,11 +133,11 @@ function hardBoundedExecFile(file, args, opts) {
133
133
  );
134
134
  }
135
135
  const nodeTimeoutMs = available ? opts.timeoutMs + killAfterMs + 5e3 : opts.timeoutMs;
136
- const { execFile: execFile2, execArgs } = boundedArgv(file, args, opts.timeoutMs, killAfterMs, available);
136
+ const { execFile: execFile3, execArgs } = boundedArgv(file, args, opts.timeoutMs, killAfterMs, available);
137
137
  const now = opts.now ?? (() => performance.now());
138
138
  const startedAt = now();
139
139
  try {
140
- const stdout = exec(execFile2, execArgs, {
140
+ const stdout = exec(execFile3, execArgs, {
141
141
  encoding: "utf-8",
142
142
  timeout: nodeTimeoutMs,
143
143
  maxBuffer: opts.maxBuffer,
@@ -4145,7 +4145,9 @@ function isolationMode(_codeName) {
4145
4145
  return process.env.AGT_ISOLATION === "docker" ? "docker" : "none";
4146
4146
  }
4147
4147
  var dockerReadinessCache = null;
4148
+ var dockerReadinessFailedAt = 0;
4148
4149
  var isolationDegradationLogged = false;
4150
+ var DOCKER_READINESS_RETRY_MS = 6e4;
4149
4151
  function probeDockerRuntime(image) {
4150
4152
  const info = hardBoundedExecFile("docker", ["info"], { timeoutMs: 15e3 });
4151
4153
  if (info.kind !== "ok") {
@@ -4163,16 +4165,87 @@ function probeDockerRuntime(image) {
4163
4165
  if (img.kind !== "ok") return { ok: false, reason: `image-missing:${image}` };
4164
4166
  return { ok: true };
4165
4167
  }
4166
- function dockerRuntimeReadiness() {
4167
- if (dockerReadinessCache) return dockerReadinessCache;
4168
- dockerReadinessCache = probeDockerRuntime(
4169
- process.env.AGT_ISOLATION_IMAGE || "agt-runtime:latest"
4170
- );
4168
+ function probeDockerRuntimeAsync(image) {
4169
+ const run = (args) => new Promise((resolve) => {
4170
+ execFile2("docker", args, { timeout: 15e3, killSignal: "SIGKILL" }, (err) => {
4171
+ const code = err?.code;
4172
+ resolve({ ok: !err, notFound: code === "ENOENT" });
4173
+ });
4174
+ });
4175
+ return run(["info"]).then(async (info) => {
4176
+ if (!info.ok) return { ok: false, reason: info.notFound ? "docker-not-installed" : "docker-daemon-unavailable" };
4177
+ const img = await run(["image", "inspect", image]);
4178
+ return img.ok ? { ok: true } : { ok: false, reason: `image-missing:${image}` };
4179
+ });
4180
+ }
4181
+ var readinessRefresh = null;
4182
+ function dockerRuntimeReadiness(now = Date.now()) {
4183
+ if (!dockerReadinessCache) {
4184
+ dockerReadinessCache = probeDockerRuntimeImpl(process.env.AGT_ISOLATION_IMAGE || "agt-runtime:latest");
4185
+ if (!dockerReadinessCache.ok) dockerReadinessFailedAt = now;
4186
+ return dockerReadinessCache;
4187
+ }
4188
+ if (!dockerReadinessCache.ok && now - dockerReadinessFailedAt >= DOCKER_READINESS_RETRY_MS && !readinessRefresh) {
4189
+ dockerReadinessFailedAt = now;
4190
+ readinessRefresh = probeDockerRuntimeAsyncImpl(process.env.AGT_ISOLATION_IMAGE || "agt-runtime:latest").then((r) => {
4191
+ if (!dockerReadinessCache?.ok) {
4192
+ dockerReadinessCache = r;
4193
+ if (!r.ok) dockerReadinessFailedAt = Date.now();
4194
+ }
4195
+ }).catch(() => {
4196
+ }).finally(() => {
4197
+ readinessRefresh = null;
4198
+ });
4199
+ }
4171
4200
  return dockerReadinessCache;
4172
4201
  }
4173
- function resetDockerRuntimeReadinessForTests(pinned = null) {
4202
+ var startProbeInFlight = null;
4203
+ var startProbeQueued = null;
4204
+ function runStartProbe() {
4205
+ const p = probeDockerRuntimeAsyncImpl(process.env.AGT_ISOLATION_IMAGE || "agt-runtime:latest").catch(
4206
+ () => ({ ok: false, reason: "docker-daemon-unavailable" })
4207
+ );
4208
+ startProbeInFlight = p;
4209
+ void p.finally(() => {
4210
+ if (startProbeInFlight === p) startProbeInFlight = null;
4211
+ });
4212
+ return p;
4213
+ }
4214
+ function dockerStartReadinessAsync(now = Date.now()) {
4215
+ const base = dockerRuntimeReadiness(now);
4216
+ if (!base.ok) return Promise.resolve(base);
4217
+ if (!startProbeInFlight) return runStartProbe();
4218
+ if (!startProbeQueued) {
4219
+ startProbeQueued = startProbeInFlight.then(() => {
4220
+ startProbeQueued = null;
4221
+ return runStartProbe();
4222
+ });
4223
+ }
4224
+ return startProbeQueued;
4225
+ }
4226
+ function dockerStartReadiness(now = Date.now()) {
4227
+ const base = dockerRuntimeReadiness(now);
4228
+ if (!base.ok) return base;
4229
+ return probeDockerRuntimeImpl(process.env.AGT_ISOLATION_IMAGE || "agt-runtime:latest");
4230
+ }
4231
+ var probeDockerRuntimeImpl = probeDockerRuntime;
4232
+ function setDockerProbeForTests(probe) {
4233
+ probeDockerRuntimeImpl = probe ?? probeDockerRuntime;
4234
+ }
4235
+ var probeDockerRuntimeAsyncImpl = probeDockerRuntimeAsync;
4236
+ function setDockerAsyncProbeForTests(probe) {
4237
+ probeDockerRuntimeAsyncImpl = probe ?? probeDockerRuntimeAsync;
4238
+ }
4239
+ function readinessRefreshForTests() {
4240
+ return readinessRefresh ?? Promise.resolve();
4241
+ }
4242
+ function resetDockerRuntimeReadinessForTests(pinned = null, failedAt = Date.now()) {
4174
4243
  dockerReadinessCache = pinned;
4244
+ dockerReadinessFailedAt = pinned && !pinned.ok ? failedAt : 0;
4175
4245
  isolationDegradationLogged = false;
4246
+ readinessRefresh = null;
4247
+ startProbeInFlight = null;
4248
+ startProbeQueued = null;
4176
4249
  }
4177
4250
  function effectiveIsolationMode(codeName, log2) {
4178
4251
  if (isolationMode(codeName) !== "docker") return "none";
@@ -4181,7 +4254,7 @@ function effectiveIsolationMode(codeName, log2) {
4181
4254
  if (!isolationDegradationLogged) {
4182
4255
  isolationDegradationLogged = true;
4183
4256
  (log2 ?? ((m) => console.warn(m)))(
4184
- `[isolation] AGT_ISOLATION=docker but the Docker runtime is unusable (reason=${readiness.reason}) - agents on this host are spawning UNISOLATED. Install Docker and the agt-runtime image, then restart the manager.`
4257
+ `[isolation] AGT_ISOLATION=docker but the Docker runtime is unusable (reason=${readiness.reason}) - agents on this host will NOT be started (ENG-12183: an isolated host never runs agents unisolated). Install Docker and the agt-runtime image; the manager re-checks every minute and starts agents once it is usable.`
4185
4258
  );
4186
4259
  }
4187
4260
  return "none";
@@ -5022,6 +5095,14 @@ function writeDirectChatSessionState(agentId, state) {
5022
5095
  function spawnBackoffMs(restartCount) {
5023
5096
  return Math.min(5e3 * Math.pow(2, restartCount), 6e4);
5024
5097
  }
5098
+ var IsolationUnavailableError = class extends Error {
5099
+ constructor(codeName, reason) {
5100
+ super(`refusing to start '${codeName}' unisolated: AGT_ISOLATION=docker but the Docker runtime is unusable (reason=${reason})`);
5101
+ this.codeName = codeName;
5102
+ this.reason = reason;
5103
+ this.name = "IsolationUnavailableError";
5104
+ }
5105
+ };
5025
5106
  function crashRespawnDeferred(existing, nowMs) {
5026
5107
  if (existing.status !== "crashed") return false;
5027
5108
  const anchor = Math.max(existing.startedAt ?? 0, existing.teardownRequestedAt ?? 0);
@@ -5033,6 +5114,10 @@ function startPersistentSession(config) {
5033
5114
  if (existing && existing.status === "running") {
5034
5115
  return existing;
5035
5116
  }
5117
+ if (isolationMode(config.codeName) === "docker") {
5118
+ const readiness = config.isolationReadiness ?? dockerStartReadiness();
5119
+ if (!readiness.ok) throw new IsolationUnavailableError(config.codeName, readiness.reason);
5120
+ }
5036
5121
  const restartCount = existing?.restartCount ?? 0;
5037
5122
  if (existing && crashRespawnDeferred(existing, Date.now())) {
5038
5123
  return existing;
@@ -6060,6 +6145,9 @@ function probeSessionLiveness(tmuxSession) {
6060
6145
  }
6061
6146
  return "alive";
6062
6147
  }
6148
+ if (isolationMode(codeName) === "docker" && classifyNoContainerSession(tmuxSession) === "host_path") {
6149
+ return "host_path";
6150
+ }
6063
6151
  return probeClaudeProcessInTmux(tmuxSession) === "alive" ? "alive" : "dead";
6064
6152
  }
6065
6153
  function dockerPgrepVerdict(stdout) {
@@ -6508,7 +6596,13 @@ export {
6508
6596
  resolveOAuthCredAction,
6509
6597
  resolveClaudeBinary,
6510
6598
  isolationMode,
6599
+ DOCKER_READINESS_RETRY_MS,
6511
6600
  dockerRuntimeReadiness,
6601
+ dockerStartReadinessAsync,
6602
+ dockerStartReadiness,
6603
+ setDockerProbeForTests,
6604
+ setDockerAsyncProbeForTests,
6605
+ readinessRefreshForTests,
6512
6606
  resetDockerRuntimeReadinessForTests,
6513
6607
  effectiveIsolationMode,
6514
6608
  EGRESS_BASELINE_DOMAINS,
@@ -6557,6 +6651,7 @@ export {
6557
6651
  readDirectChatSessionState,
6558
6652
  writeDirectChatSessionState,
6559
6653
  spawnBackoffMs,
6654
+ IsolationUnavailableError,
6560
6655
  crashRespawnDeferred,
6561
6656
  startPersistentSession,
6562
6657
  TMUX_BOOTSTRAP_HOLD_CMD,
@@ -6593,4 +6688,4 @@ export {
6593
6688
  stopAllSessionsAndWait,
6594
6689
  getProjectDir
6595
6690
  };
6596
- //# sourceMappingURL=chunk-CQQYZUC5.js.map
6691
+ //# sourceMappingURL=chunk-VSJUMNQ5.js.map