@integrity-labs/agt-cli 0.28.735 → 0.28.736

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.
package/dist/bin/agt.js CHANGED
@@ -41,12 +41,12 @@ import {
41
41
  success,
42
42
  table,
43
43
  warn
44
- } from "../chunk-AZZ7MLBE.js";
44
+ } from "../chunk-F5UORP7D.js";
45
45
  import {
46
46
  getProjectDir,
47
47
  isSessionResumeDisabled,
48
48
  readDirectChatSessionState
49
- } from "../chunk-5CF4DRXA.js";
49
+ } from "../chunk-6J6G4HOG.js";
50
50
  import {
51
51
  AnchorSessionClient,
52
52
  CHANNEL_REGISTRY,
@@ -5467,7 +5467,7 @@ import { execFileSync, execSync } from "child_process";
5467
5467
  import { existsSync as existsSync11, realpathSync as realpathSync2 } from "fs";
5468
5468
  import chalk18 from "chalk";
5469
5469
  import ora16 from "ora";
5470
- var cliVersion = true ? "0.28.735" : "dev";
5470
+ var cliVersion = true ? "0.28.736" : "dev";
5471
5471
  async function fetchLatestVersion() {
5472
5472
  const host2 = getHost();
5473
5473
  if (!host2) return null;
@@ -6654,7 +6654,7 @@ function handleError(err) {
6654
6654
  }
6655
6655
 
6656
6656
  // src/bin/agt.ts
6657
- var cliVersion2 = true ? "0.28.735" : "dev";
6657
+ var cliVersion2 = true ? "0.28.736" : "dev";
6658
6658
  var program = new Command();
6659
6659
  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");
6660
6660
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -3357,6 +3357,48 @@ function isolationMode(codeName) {
3357
3357
  if (allow.length > 0 && (!codeName || !allow.includes(codeName))) return "none";
3358
3358
  return "docker";
3359
3359
  }
3360
+ var dockerReadinessCache = null;
3361
+ var isolationDegradationLogged = false;
3362
+ function probeDockerRuntime(image) {
3363
+ try {
3364
+ execFileSync3("docker", ["info"], { stdio: "ignore", timeout: 15e3 });
3365
+ } catch (err) {
3366
+ const code = err?.code;
3367
+ return {
3368
+ ok: false,
3369
+ reason: code === "ENOENT" ? "docker-not-installed" : "docker-daemon-unavailable"
3370
+ };
3371
+ }
3372
+ try {
3373
+ execFileSync3("docker", ["image", "inspect", image], { stdio: "ignore", timeout: 15e3 });
3374
+ } catch {
3375
+ return { ok: false, reason: `image-missing:${image}` };
3376
+ }
3377
+ return { ok: true };
3378
+ }
3379
+ function dockerRuntimeReadiness() {
3380
+ if (dockerReadinessCache) return dockerReadinessCache;
3381
+ dockerReadinessCache = probeDockerRuntime(
3382
+ process.env.AGT_ISOLATION_IMAGE || "agt-runtime:latest"
3383
+ );
3384
+ return dockerReadinessCache;
3385
+ }
3386
+ function resetDockerRuntimeReadinessForTests(pinned = null) {
3387
+ dockerReadinessCache = pinned;
3388
+ isolationDegradationLogged = false;
3389
+ }
3390
+ function effectiveIsolationMode(codeName, log2) {
3391
+ if (isolationMode(codeName) !== "docker") return "none";
3392
+ const readiness = dockerRuntimeReadiness();
3393
+ if (readiness.ok) return "docker";
3394
+ if (!isolationDegradationLogged) {
3395
+ isolationDegradationLogged = true;
3396
+ (log2 ?? ((m) => console.warn(m)))(
3397
+ `[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.`
3398
+ );
3399
+ }
3400
+ return "none";
3401
+ }
3360
3402
  var EGRESS_BASELINE_DOMAINS = [
3361
3403
  ".anthropic.com",
3362
3404
  // claude API
@@ -4015,14 +4057,15 @@ function spawnSession(config, session) {
4015
4057
  tmuxSessionEnvArgs.push("-e", `${key}=${value}`);
4016
4058
  }
4017
4059
  const sessionHomeDir = process.env.HOME?.trim() || homedir5();
4060
+ const effectiveMode = effectiveIsolationMode(codeName, log2);
4018
4061
  let egress;
4019
- if (egressMode(codeName) === "allowlist") {
4062
+ if (effectiveMode === "docker" && egressMode(codeName) === "allowlist") {
4020
4063
  const allowlist = config.egressAllowlist ?? buildEgressAllowlist(null);
4021
4064
  const allowlistHostPath = writeEgressAllowlist(codeName, allowlist, sessionHomeDir);
4022
4065
  egress = { allowlistHostPath };
4023
4066
  log2(`[persistent-session] egress allowlist for '${codeName}': ${allowlist.length} domains (deny-by-default)`);
4024
4067
  }
4025
- const claudeCmd = isolationMode(codeName) === "docker" ? buildDockerRunCommand({
4068
+ const claudeCmd = effectiveMode === "docker" ? buildDockerRunCommand({
4026
4069
  codeName,
4027
4070
  agentId: config.agentId,
4028
4071
  wrapperPath,
@@ -4084,7 +4127,7 @@ function spawnSession(config, session) {
4084
4127
  ...config.openRouter.smallFastModel ? { ANTHROPIC_SMALL_FAST_MODEL: config.openRouter.smallFastModel } : {}
4085
4128
  } : {};
4086
4129
  const channelSecretEnv = config.channelSpawnSecrets ?? {};
4087
- const probeBaseEnv = isolationMode(codeName) === "docker" ? {
4130
+ const probeBaseEnv = effectiveMode === "docker" ? {
4088
4131
  HOME: tmuxEnv["HOME"],
4089
4132
  ...apiKeyEnv,
4090
4133
  ...openRouterEnv,
@@ -4105,7 +4148,7 @@ function spawnSession(config, session) {
4105
4148
  const missingSpawnEnv = findMissingSpawnEnv(probeBaseEnv);
4106
4149
  for (const key of missingSpawnEnv) {
4107
4150
  log2(
4108
- `[persistent-session] MISSING SPAWN ENV ${key} agent=${codeName} isolation=${isolationMode(codeName)} \u2014 programs reading process.env.${key} will fail (e.g. the agt-bin/gh GitHub credential shim hard-exits without AGT_AGENT_ID, taking every git fetch/push with it)`
4151
+ `[persistent-session] MISSING SPAWN ENV ${key} agent=${codeName} isolation=${effectiveMode} \u2014 programs reading process.env.${key} will fail (e.g. the agt-bin/gh GitHub credential shim hard-exits without AGT_AGENT_ID, taking every git fetch/push with it)`
4109
4152
  );
4110
4153
  }
4111
4154
  try {
@@ -4160,7 +4203,7 @@ function spawnSession(config, session) {
4160
4203
  });
4161
4204
  if (mismatch) {
4162
4205
  log2(
4163
- `[persistent-session] PANE AGENT ID MISMATCH agent=${codeName} isolation=${isolationMode(codeName)} \u2014 ${mismatch}`
4206
+ `[persistent-session] PANE AGENT ID MISMATCH agent=${codeName} isolation=${effectiveMode} \u2014 ${mismatch}`
4164
4207
  );
4165
4208
  session.status = "crashed";
4166
4209
  session.startedAt = Date.now();
@@ -4540,7 +4583,7 @@ var zombieProbeCache = /* @__PURE__ */ new Map();
4540
4583
  var pendingZombieDetections = /* @__PURE__ */ new Map();
4541
4584
  function isClaudeProcessAliveInTmux(tmuxSession) {
4542
4585
  const codeName = tmuxSession.replace(/^agt-/, "");
4543
- if (isolationMode(codeName) === "docker") {
4586
+ if (effectiveIsolationMode(codeName) === "docker") {
4544
4587
  try {
4545
4588
  const out = execFileSync3("docker", ["exec", `agt-${codeName}`, "pgrep", "-f", "claude"], {
4546
4589
  encoding: "utf-8",
@@ -4664,7 +4707,7 @@ function collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, sp
4664
4707
  screenCapture: null,
4665
4708
  launchArgs: null,
4666
4709
  channelStatus: null,
4667
- isolated: isolationMode(codeName) === "docker",
4710
+ isolated: effectiveIsolationMode(codeName) === "docker",
4668
4711
  quarantinedChannels,
4669
4712
  // ENG-7188: undefined when the accessor is absent = NO SIGNAL. Both
4670
4713
  // return paths carry it; a field on only one is the divergence class
@@ -4756,7 +4799,7 @@ function collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, sp
4756
4799
  // limit size
4757
4800
  launchArgs,
4758
4801
  channelStatus,
4759
- isolated: isolationMode(codeName) === "docker",
4802
+ isolated: effectiveIsolationMode(codeName) === "docker",
4760
4803
  quarantinedChannels,
4761
4804
  // ENG-7188: undefined when the accessor is absent = NO SIGNAL. Both
4762
4805
  // return paths carry it; a field on only one is the divergence class
@@ -4838,6 +4881,9 @@ export {
4838
4881
  resolveOAuthCredAction,
4839
4882
  resolveClaudeBinary,
4840
4883
  isolationMode,
4884
+ dockerRuntimeReadiness,
4885
+ resetDockerRuntimeReadinessForTests,
4886
+ effectiveIsolationMode,
4841
4887
  EGRESS_BASELINE_DOMAINS,
4842
4888
  egressMode,
4843
4889
  buildEgressAllowlist,
@@ -4883,4 +4929,4 @@ export {
4883
4929
  stopAllSessionsAndWait,
4884
4930
  getProjectDir
4885
4931
  };
4886
- //# sourceMappingURL=chunk-5CF4DRXA.js.map
4932
+ //# sourceMappingURL=chunk-6J6G4HOG.js.map