@integrity-labs/agt-cli 0.28.530 → 0.28.532

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
@@ -40,7 +40,7 @@ import {
40
40
  success,
41
41
  table,
42
42
  warn
43
- } from "../chunk-7DNN4TH6.js";
43
+ } from "../chunk-DVLIHMM7.js";
44
44
  import {
45
45
  AnchorSessionClient,
46
46
  CHANNEL_REGISTRY,
@@ -71,7 +71,7 @@ import {
71
71
  requiredMcpWildcard,
72
72
  resolveChannels,
73
73
  serializeManifestForSlackCli
74
- } from "../chunk-Q4XGKOHZ.js";
74
+ } from "../chunk-3FCJXTHW.js";
75
75
  import "../chunk-XWVM4KPK.js";
76
76
 
77
77
  // src/bin/agt.ts
@@ -4834,7 +4834,7 @@ import { execFileSync, execSync } from "child_process";
4834
4834
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
4835
4835
  import chalk18 from "chalk";
4836
4836
  import ora16 from "ora";
4837
- var cliVersion = true ? "0.28.530" : "dev";
4837
+ var cliVersion = true ? "0.28.532" : "dev";
4838
4838
  async function fetchLatestVersion() {
4839
4839
  const host2 = getHost();
4840
4840
  if (!host2) return null;
@@ -6006,7 +6006,7 @@ function handleError(err) {
6006
6006
  }
6007
6007
 
6008
6008
  // src/bin/agt.ts
6009
- var cliVersion2 = true ? "0.28.530" : "dev";
6009
+ var cliVersion2 = true ? "0.28.532" : "dev";
6010
6010
  var program = new Command();
6011
6011
  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");
6012
6012
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -14493,6 +14493,21 @@ function collectMcpServerNames(mcpConfigPath) {
14493
14493
  return [];
14494
14494
  }
14495
14495
  }
14496
+ var REQUIRED_SPAWN_ENV = ["AGT_AGENT_ID", "AGT_HOST", "AGT_API_KEY"];
14497
+ function buildSpawnEnv(args) {
14498
+ const { base, agentId, runId } = args;
14499
+ const env2 = {
14500
+ ...base,
14501
+ HOME: base.HOME?.trim() || homedir6(),
14502
+ USER: base.USER?.trim() || userInfo2().username
14503
+ };
14504
+ if (runId) env2["AGT_RUN_ID"] = runId;
14505
+ env2["AGT_AGENT_ID"] = agentId;
14506
+ return env2;
14507
+ }
14508
+ function findMissingSpawnEnv(env2) {
14509
+ return REQUIRED_SPAWN_ENV.filter((k) => !env2[k]?.trim());
14510
+ }
14496
14511
  var sessions2 = /* @__PURE__ */ new Map();
14497
14512
  var PANE_LOG_DIR = join6(homedir6(), ".augmented");
14498
14513
  var PANE_TAIL_LINES = 20;
@@ -14828,17 +14843,11 @@ function spawnSession(config, session) {
14828
14843
  forwardTurnFailureNotice: !!process.env["AGT_WEDGE_TRANSIENT_NOTICE_ENABLED"] || // feature-gate-allow: registry-flag envVar operator-override precedence, not a new gate
14829
14844
  !!config.turnFailureNoticeEnabled
14830
14845
  }) : JSON.stringify(wrapperPath);
14831
- const tmuxEnv = {
14832
- ...process.env,
14833
- // Treat empty-string as missing too — `HOME=""` makes ~ resolve
14834
- // to cwd, which is the same broken outcome as no HOME, just
14835
- // better hidden.
14836
- HOME: process.env.HOME?.trim() || homedir6(),
14837
- USER: process.env.USER?.trim() || userInfo2().username
14838
- };
14839
- if (config.runId) {
14840
- tmuxEnv["AGT_RUN_ID"] = config.runId;
14841
- }
14846
+ const tmuxEnv = buildSpawnEnv({
14847
+ base: process.env,
14848
+ agentId: config.agentId,
14849
+ runId: config.runId
14850
+ });
14842
14851
  const apiKeyEnv = !openRouterMode && claudeAuthMode === "api_key" && config.anthropicApiKey ? { ANTHROPIC_API_KEY: config.anthropicApiKey } : {};
14843
14852
  const openRouterEnv = openRouterMode ? {
14844
14853
  ANTHROPIC_BASE_URL: OPENROUTER_ANTHROPIC_BASE_URL,
@@ -14862,6 +14871,12 @@ function spawnSession(config, session) {
14862
14871
  })) {
14863
14872
  log2(`[persistent-session] ${formatMissingVar(f)} agent=${codeName}`);
14864
14873
  }
14874
+ const missingSpawnEnv = findMissingSpawnEnv(probeBaseEnv);
14875
+ for (const key of missingSpawnEnv) {
14876
+ log2(
14877
+ `[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)`
14878
+ );
14879
+ }
14865
14880
  const child = spawn2("tmux", [
14866
14881
  "new-session",
14867
14882
  "-d",
@@ -15604,6 +15619,9 @@ export {
15604
15619
  restartEgressSidecar,
15605
15620
  buildDockerRunCommand,
15606
15621
  writePersistentClaudeWrapper,
15622
+ REQUIRED_SPAWN_ENV,
15623
+ buildSpawnEnv,
15624
+ findMissingSpawnEnv,
15607
15625
  paneLogPath,
15608
15626
  rotatePaneLogForDayRollover,
15609
15627
  readPaneLogTail,
@@ -15631,4 +15649,4 @@ export {
15631
15649
  stopAllSessionsAndWait,
15632
15650
  getProjectDir
15633
15651
  };
15634
- //# sourceMappingURL=chunk-Q4XGKOHZ.js.map
15652
+ //# sourceMappingURL=chunk-3FCJXTHW.js.map