@integrity-labs/agt-cli 0.28.1264 → 0.28.1266

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 (39) hide show
  1. package/dist/{api-client-Q2FXLBH5.js → api-client-5CNPCJKS.js} +3 -3
  2. package/dist/bin/agt.js +8 -8
  3. package/dist/{chunk-GSMGU2QA.js → chunk-7Z3N4G2Y.js} +6 -6
  4. package/dist/{chunk-5BXIXSSH.js → chunk-BMO6GCK2.js} +2 -2
  5. package/dist/{chunk-C3PSUSJ2.js → chunk-SGYCPC5K.js} +3 -3
  6. package/dist/{chunk-KJ5OCCSJ.js → chunk-W2GHPRPZ.js} +2 -2
  7. package/dist/{chunk-KJ5OCCSJ.js.map → chunk-W2GHPRPZ.js.map} +1 -1
  8. package/dist/{chunk-GZMUGH6X.js → chunk-WJUGK4R5.js} +48 -32
  9. package/dist/chunk-WJUGK4R5.js.map +1 -0
  10. package/dist/{chunk-HJWOXFJM.js → chunk-X2FBQPNR.js} +2 -2
  11. package/dist/{chunk-HYQ7VOC3.js → chunk-XL2HPM67.js} +19 -3
  12. package/dist/chunk-XL2HPM67.js.map +1 -0
  13. package/dist/{claude-code-updater-JQLNRK25.js → claude-code-updater-XISTQTZX.js} +3 -3
  14. package/dist/{claude-pair-runtime-M6VJ3KZ3.js → claude-pair-runtime-2XKML4U6.js} +16 -14
  15. package/dist/claude-pair-runtime-2XKML4U6.js.map +1 -0
  16. package/dist/lib/manager-worker.js +42 -40
  17. package/dist/lib/manager-worker.js.map +1 -1
  18. package/dist/mcp/direct-chat-channel.js +8 -2
  19. package/dist/mcp/index.js +1 -1
  20. package/dist/mcp/origami.js +1 -1
  21. package/dist/mcp/slack-channel.js +8 -2
  22. package/dist/mcp/telegram-channel.js +8 -2
  23. package/dist/mcp/xero.js +727 -169
  24. package/dist/{persistent-session-3OES5QXZ.js → persistent-session-YBCMFF7T.js} +7 -5
  25. package/dist/{responsiveness-probe-BSSNRCPM.js → responsiveness-probe-ZOCD6UYO.js} +5 -5
  26. package/dist/{session-auth-dead-A3TO2N63.js → session-auth-dead-U62KZ342.js} +3 -3
  27. package/package.json +1 -1
  28. package/dist/chunk-GZMUGH6X.js.map +0 -1
  29. package/dist/chunk-HYQ7VOC3.js.map +0 -1
  30. package/dist/claude-pair-runtime-M6VJ3KZ3.js.map +0 -1
  31. /package/dist/{api-client-Q2FXLBH5.js.map → api-client-5CNPCJKS.js.map} +0 -0
  32. /package/dist/{chunk-GSMGU2QA.js.map → chunk-7Z3N4G2Y.js.map} +0 -0
  33. /package/dist/{chunk-5BXIXSSH.js.map → chunk-BMO6GCK2.js.map} +0 -0
  34. /package/dist/{chunk-C3PSUSJ2.js.map → chunk-SGYCPC5K.js.map} +0 -0
  35. /package/dist/{chunk-HJWOXFJM.js.map → chunk-X2FBQPNR.js.map} +0 -0
  36. /package/dist/{claude-code-updater-JQLNRK25.js.map → claude-code-updater-XISTQTZX.js.map} +0 -0
  37. /package/dist/{persistent-session-3OES5QXZ.js.map → persistent-session-YBCMFF7T.js.map} +0 -0
  38. /package/dist/{responsiveness-probe-BSSNRCPM.js.map → responsiveness-probe-ZOCD6UYO.js.map} +0 -0
  39. /package/dist/{session-auth-dead-A3TO2N63.js.map → session-auth-dead-U62KZ342.js.map} +0 -0
@@ -4,7 +4,7 @@ import {
4
4
  rotateDailySession,
5
5
  sessionFileExists,
6
6
  todayLocalIso
7
- } from "./chunk-HJWOXFJM.js";
7
+ } from "./chunk-X2FBQPNR.js";
8
8
  import {
9
9
  classifyUnanswerablePane,
10
10
  customApiKeyDialogKeys,
@@ -22,8 +22,10 @@ import {
22
22
  parkedModalKind,
23
23
  sendDialogKeys,
24
24
  simpleTextHash,
25
- sweepDialogs
26
- } from "./chunk-HYQ7VOC3.js";
25
+ sweepDialogs,
26
+ tmuxPaneTarget,
27
+ tmuxSessionTarget
28
+ } from "./chunk-XL2HPM67.js";
27
29
  import {
28
30
  signinResetInForce
29
31
  } from "./chunk-6HBXEJHO.js";
@@ -52,7 +54,7 @@ import {
52
54
  remoteMcpConnectionEnvInfix,
53
55
  remoteMcpConnectionLabel,
54
56
  remoteMcpConnectionScopedEnvVar
55
- } from "./chunk-KJ5OCCSJ.js";
57
+ } from "./chunk-W2GHPRPZ.js";
56
58
  import {
57
59
  CLAUDE_CONFIG_DIR_ENV,
58
60
  approveApiKeyInClaudeConfig,
@@ -2726,7 +2728,7 @@ async function spawnServe(config, session) {
2726
2728
  const port = await findFreePort();
2727
2729
  const password = randomBytes(24).toString("base64url");
2728
2730
  try {
2729
- execSync(`tmux kill-session -t ${tmuxSession} 2>/dev/null`, { stdio: "ignore" });
2731
+ execSync(`tmux kill-session -t ${tmuxSessionTarget(tmuxSession)} 2>/dev/null`, { stdio: "ignore" });
2730
2732
  } catch {
2731
2733
  }
2732
2734
  mkdirSync3(join4(homedir4(), ".augmented", codeName), { recursive: true });
@@ -2785,7 +2787,7 @@ async function spawnServe(config, session) {
2785
2787
  function setupPaneLog(tmuxSession, codeName, log2) {
2786
2788
  const logPath = opencodePaneLogPath(codeName);
2787
2789
  try {
2788
- execSync(`tmux pipe-pane -t ${tmuxSession} -o 'cat >> ${logPath}'`, { stdio: "ignore" });
2790
+ execSync(`tmux pipe-pane -t ${tmuxPaneTarget(tmuxSession)} -o 'cat >> ${logPath}'`, { stdio: "ignore" });
2789
2791
  } catch (err) {
2790
2792
  log2(`[opencode-session] could not attach pane log for '${codeName}': ${err.message}`);
2791
2793
  }
@@ -2803,7 +2805,7 @@ function readOpencodePaneLogTail(codeName, lines = 40) {
2803
2805
  function isOpencodeSessionHealthy(codeName) {
2804
2806
  const tmuxSession = opencodeTmuxSession(codeName);
2805
2807
  try {
2806
- execSync(`tmux has-session -t ${tmuxSession} 2>/dev/null`, { stdio: "ignore" });
2808
+ execSync(`tmux has-session -t ${tmuxSessionTarget(tmuxSession)} 2>/dev/null`, { stdio: "ignore" });
2807
2809
  return true;
2808
2810
  } catch {
2809
2811
  return false;
@@ -2871,7 +2873,7 @@ function getBridge(codeName, port, password) {
2871
2873
  function stopOpencodeSession(codeName, log2) {
2872
2874
  const tmuxSession = opencodeTmuxSession(codeName);
2873
2875
  try {
2874
- execSync(`tmux kill-session -t ${tmuxSession} 2>/dev/null`, { stdio: "ignore" });
2876
+ execSync(`tmux kill-session -t ${tmuxSessionTarget(tmuxSession)} 2>/dev/null`, { stdio: "ignore" });
2875
2877
  log2(`[opencode-session] stopped '${tmuxSession}' for '${codeName}'`);
2876
2878
  } catch {
2877
2879
  }
@@ -2987,9 +2989,17 @@ function probeClaudeProcessInTmux(tmuxSession) {
2987
2989
  return e?.status === 1 ? "dead" : "unknown";
2988
2990
  }
2989
2991
  }
2992
+ function tmuxSessionTarget2(session) {
2993
+ let n = session;
2994
+ if (n.startsWith("="))
2995
+ n = n.slice(1);
2996
+ if (n.endsWith(":"))
2997
+ n = n.slice(0, -1);
2998
+ return `=${n}`;
2999
+ }
2990
3000
  function probeTmuxSession(tmuxSession) {
2991
3001
  try {
2992
- execFileSync2("tmux", ["has-session", "-t", tmuxSession], {
3002
+ execFileSync2("tmux", ["has-session", "-t", tmuxSessionTarget2(tmuxSession)], {
2993
3003
  stdio: "ignore",
2994
3004
  timeout: 3e3
2995
3005
  });
@@ -3202,7 +3212,7 @@ var BLOCKED_PROMPT_VERDICT_TTL_MS = 15e3;
3202
3212
  var BLOCKED_ON_PROMPT_DECISION = "blocked-on-prompt";
3203
3213
  var suspects = /* @__PURE__ */ new Map();
3204
3214
  var readAgentPane = (codeName) => new Promise((resolve) => {
3205
- execFile("tmux", ["capture-pane", "-t", `agt-${codeName}`, "-p"], { timeout: 2e3 }, (err, stdout) => {
3215
+ execFile("tmux", ["capture-pane", "-t", tmuxPaneTarget(`agt-${codeName}`), "-p"], { timeout: 2e3 }, (err, stdout) => {
3206
3216
  resolve(err ? null : String(stdout));
3207
3217
  });
3208
3218
  });
@@ -4698,7 +4708,7 @@ function applyPaneAgentIdVerdict(args) {
4698
4708
  } else {
4699
4709
  const reason = result && !result.ok ? result.reason : "no result from the kill";
4700
4710
  log2(
4701
- `[persistent-session] FAILED TO KILL session '${tmuxSession}' for '${codeName}': ${reason}. It is marked crashed, but its pane may still be running under another agent's identity. Kill it by hand: tmux kill-session -t ${tmuxSession} (ENG-8800)`
4711
+ `[persistent-session] FAILED TO KILL session '${tmuxSession}' for '${codeName}': ${reason}. It is marked crashed, but its pane may still be running under another agent's identity. Kill it by hand: tmux kill-session -t '${tmuxSessionTarget(tmuxSession)}' (ENG-8800)`
4702
4712
  );
4703
4713
  }
4704
4714
  args.onTeardownSettled?.(result ?? { ok: false, reason: "no result from the kill" });
@@ -4719,7 +4729,7 @@ function killTmuxSessionBounded(tmuxSession, deps = {}) {
4719
4729
  };
4720
4730
  let killer;
4721
4731
  try {
4722
- killer = spawnFn("tmux", ["kill-session", "-t", tmuxSession], { stdio: "ignore" });
4732
+ killer = spawnFn("tmux", ["kill-session", "-t", tmuxSessionTarget(tmuxSession)], { stdio: "ignore" });
4723
4733
  } catch (err) {
4724
4734
  settle({ ok: false, reason: `could not spawn tmux: ${err instanceof Error ? err.message : String(err)}` });
4725
4735
  return;
@@ -4866,7 +4876,7 @@ function setupPaneLog2(tmuxSession, codeName, log2) {
4866
4876
  "utf-8"
4867
4877
  );
4868
4878
  execSync2(
4869
- `tmux pipe-pane -o -t '${tmuxSession.replace(/'/g, `'\\''`)}' '${paneSinkCommand(logPath, log2).replace(/'/g, `'\\''`)}'`,
4879
+ `tmux pipe-pane -o -t '${tmuxPaneTarget(tmuxSession).replace(/'/g, `'\\''`)}' '${paneSinkCommand(logPath, log2).replace(/'/g, `'\\''`)}'`,
4870
4880
  { stdio: "ignore" }
4871
4881
  );
4872
4882
  } catch (err) {
@@ -5043,7 +5053,7 @@ function buildTmuxSpawnPlan(args) {
5043
5053
  args.claudeCmd
5044
5054
  ]
5045
5055
  },
5046
- cleanup: { argv: ["kill-session", "-t", bootstrapSession] }
5056
+ cleanup: { argv: ["kill-session", "-t", tmuxSessionTarget(bootstrapSession)] }
5047
5057
  };
5048
5058
  }
5049
5059
  function runTmuxSpawnPlan(opts) {
@@ -5156,7 +5166,7 @@ function spawnSession(config, session) {
5156
5166
  try {
5157
5167
  sanitizeMcpJson(mcpConfigPath, apiHost);
5158
5168
  try {
5159
- execSync2(`tmux kill-session -t ${tmuxSession} 2>/dev/null`, { stdio: "ignore" });
5169
+ execSync2(`tmux kill-session -t ${tmuxSessionTarget(tmuxSession)} 2>/dev/null`, { stdio: "ignore" });
5160
5170
  } catch {
5161
5171
  }
5162
5172
  if (resolveOAuthCredAction(
@@ -5520,7 +5530,7 @@ function spawnSession(config, session) {
5520
5530
  }
5521
5531
  log2(`[persistent-session] tmux session '${tmuxSession}' created for '${codeName}'`);
5522
5532
  try {
5523
- const probe = spawn2("tmux", ["show-environment", "-t", tmuxSession, "AGT_AGENT_ID"], {
5533
+ const probe = spawn2("tmux", ["show-environment", "-t", tmuxSessionTarget(tmuxSession), "AGT_AGENT_ID"], {
5524
5534
  stdio: ["ignore", "pipe", "pipe"]
5525
5535
  });
5526
5536
  let out = "";
@@ -5670,7 +5680,7 @@ async function acceptDialogs(tmuxSession, codeName, log2, primaryModel = null, s
5670
5680
  while (dialogIterations < MAX_DIALOG_ITERATIONS && loginPickerIterations < MAX_LOGIN_PICKER_ITERATIONS) {
5671
5681
  await new Promise((r) => setTimeout(r, 2e3));
5672
5682
  try {
5673
- const screen = execSync2(`tmux capture-pane -t ${tmuxSession} -p 2>/dev/null`, { encoding: "utf-8" });
5683
+ const screen = execSync2(`tmux capture-pane -t ${tmuxPaneTarget(tmuxSession)} -p 2>/dev/null`, { encoding: "utf-8" });
5674
5684
  if (isLoginPickerVisible(screen)) {
5675
5685
  noteSessionBlockedOnPrompt(codeName, "login-picker", "spawn-dialogs");
5676
5686
  if (!loginPickerReported) {
@@ -5766,7 +5776,7 @@ async function waitForPromptReady(tmuxSession) {
5766
5776
  try {
5767
5777
  const screen = execFileSync3(
5768
5778
  "tmux",
5769
- ["capture-pane", "-t", tmuxSession, "-p"],
5779
+ ["capture-pane", "-t", tmuxPaneTarget(tmuxSession), "-p"],
5770
5780
  { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }
5771
5781
  );
5772
5782
  if (screen.includes("\u276F ")) return true;
@@ -5783,11 +5793,11 @@ function sleepBlockingMs(ms) {
5783
5793
  }
5784
5794
  function defaultArmSender(tmuxSession, command) {
5785
5795
  try {
5786
- execFileSync3("tmux", ["send-keys", "-t", tmuxSession, "-l", command], {
5796
+ execFileSync3("tmux", ["send-keys", "-t", tmuxPaneTarget(tmuxSession), "-l", command], {
5787
5797
  stdio: ["ignore", "ignore", "pipe"]
5788
5798
  });
5789
5799
  sleepBlockingMs(SEND_KEYS_ENTER_DELAY_MS);
5790
- execFileSync3("tmux", ["send-keys", "-t", tmuxSession, "Enter"], {
5800
+ execFileSync3("tmux", ["send-keys", "-t", tmuxPaneTarget(tmuxSession), "Enter"], {
5791
5801
  stdio: ["ignore", "ignore", "pipe"]
5792
5802
  });
5793
5803
  return true;
@@ -5798,7 +5808,7 @@ function defaultArmSender(tmuxSession, command) {
5798
5808
  var armSender = defaultArmSender;
5799
5809
  function defaultPaneCapture(tmuxSession) {
5800
5810
  try {
5801
- return execFileSync3("tmux", ["capture-pane", "-t", tmuxSession, "-p"], {
5811
+ return execFileSync3("tmux", ["capture-pane", "-t", tmuxPaneTarget(tmuxSession), "-p"], {
5802
5812
  encoding: "utf-8",
5803
5813
  stdio: ["ignore", "pipe", "ignore"],
5804
5814
  timeout: 2e3
@@ -5813,21 +5823,26 @@ var defaultHygieneKeySender = async (tmuxSession, keys, interKeyDelayMs) => {
5813
5823
  if (i > 0 && interKeyDelayMs > 0) {
5814
5824
  await new Promise((r) => setTimeout(r, interKeyDelayMs));
5815
5825
  }
5816
- execFileSync3("tmux", ["send-keys", "-t", tmuxSession, keys[i]], {
5826
+ execFileSync3("tmux", ["send-keys", "-t", tmuxPaneTarget(tmuxSession), keys[i]], {
5817
5827
  stdio: "ignore"
5818
5828
  });
5819
5829
  }
5820
5830
  };
5821
5831
  var hygieneKeySender = defaultHygieneKeySender;
5822
5832
  var SESSION_CREATED_TIMEOUT_MS = 3e3;
5833
+ function parseSessionCreatedOutput(out, tmuxSession) {
5834
+ const [name, created] = out.trim().split(" ");
5835
+ if (name !== tmuxSession) return null;
5836
+ const secs = Number(created);
5837
+ return Number.isFinite(secs) && secs > 0 ? secs * 1e3 : null;
5838
+ }
5823
5839
  function defaultSessionCreatedProbe(tmuxSession) {
5824
5840
  try {
5825
- const created = execFileSync3("tmux", ["display", "-p", "-t", tmuxSession, "#{session_created}"], {
5841
+ const out = execFileSync3("tmux", ["display", "-p", "-t", tmuxPaneTarget(tmuxSession), "#{session_name} #{session_created}"], {
5826
5842
  encoding: "utf-8",
5827
5843
  timeout: SESSION_CREATED_TIMEOUT_MS
5828
- }).trim();
5829
- const secs = Number(created);
5830
- return Number.isFinite(secs) && secs > 0 ? secs * 1e3 : null;
5844
+ });
5845
+ return parseSessionCreatedOutput(out, tmuxSession);
5831
5846
  } catch {
5832
5847
  return null;
5833
5848
  }
@@ -5949,7 +5964,7 @@ function stopPersistentSession(codeName, log2) {
5949
5964
  log2(`[persistent-session] Stopping session for '${codeName}'`);
5950
5965
  session.status = "stopped";
5951
5966
  try {
5952
- execFileSync3("tmux", ["kill-session", "-t", `agt-${codeName}`], { stdio: ["ignore", "ignore", "pipe"] });
5967
+ execFileSync3("tmux", ["kill-session", "-t", tmuxSessionTarget(`agt-${codeName}`)], { stdio: ["ignore", "ignore", "pipe"] });
5953
5968
  } catch (err) {
5954
5969
  const stderr = (err.stderr ?? "").toString().trim();
5955
5970
  const alreadyGone = /can't find session|no server running/i.test(stderr);
@@ -6003,7 +6018,7 @@ function takeZombieDetection(codeName) {
6003
6018
  function isSessionHealthy(codeName) {
6004
6019
  const tmuxSession = `agt-${codeName}`;
6005
6020
  try {
6006
- execSync2(`tmux has-session -t ${tmuxSession} 2>/dev/null`, { stdio: "ignore" });
6021
+ execSync2(`tmux has-session -t ${tmuxSessionTarget(tmuxSession)} 2>/dev/null`, { stdio: "ignore" });
6007
6022
  } catch {
6008
6023
  const session2 = sessions2.get(codeName);
6009
6024
  if (session2 && session2.status === "running") {
@@ -6052,7 +6067,7 @@ function isSessionHealthy(codeName) {
6052
6067
  if (!claudeAlive) {
6053
6068
  const paneTail = readPaneLogTail(codeName);
6054
6069
  try {
6055
- execFileSync3("tmux", ["kill-session", "-t", tmuxSession], { stdio: "ignore" });
6070
+ execFileSync3("tmux", ["kill-session", "-t", tmuxSessionTarget(tmuxSession)], { stdio: "ignore" });
6056
6071
  } catch {
6057
6072
  }
6058
6073
  session.status = "crashed";
@@ -6152,13 +6167,13 @@ function collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, sp
6152
6167
  let launchArgs = null;
6153
6168
  let channelStatus = null;
6154
6169
  try {
6155
- execFileSync3("tmux", ["has-session", "-t", tmuxSession], { stdio: "ignore" });
6170
+ execFileSync3("tmux", ["has-session", "-t", tmuxSessionTarget(tmuxSession)], { stdio: "ignore" });
6156
6171
  tmuxAlive = true;
6157
6172
  } catch {
6158
6173
  }
6159
6174
  if (tmuxAlive) {
6160
6175
  try {
6161
- screenCapture = execFileSync3("tmux", ["capture-pane", "-t", tmuxSession, "-p", "-S", "-30"], {
6176
+ screenCapture = execFileSync3("tmux", ["capture-pane", "-t", tmuxPaneTarget(tmuxSession), "-p", "-S", "-30"], {
6162
6177
  encoding: "utf-8",
6163
6178
  timeout: 3e3
6164
6179
  }).trim();
@@ -6382,6 +6397,7 @@ export {
6382
6397
  buildTmuxSpawnPlan,
6383
6398
  runTmuxSpawnPlan,
6384
6399
  SEND_KEYS_ENTER_DELAY_MS,
6400
+ parseSessionCreatedOutput,
6385
6401
  sendToAgent,
6386
6402
  isAgentPromptReady,
6387
6403
  _internals,
@@ -6397,4 +6413,4 @@ export {
6397
6413
  stopAllSessionsAndWait,
6398
6414
  getProjectDir
6399
6415
  };
6400
- //# sourceMappingURL=chunk-GZMUGH6X.js.map
6416
+ //# sourceMappingURL=chunk-WJUGK4R5.js.map