codeam-cli 2.75.34 → 2.75.36

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 (3) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/index.js +432 -356
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -77,12 +77,12 @@ var require_src = __commonJS({
77
77
  lineEnd: `${CSI2}K`,
78
78
  lineStart: `${CSI2}1K`,
79
79
  lines(count) {
80
- let clear = "";
80
+ let clear2 = "";
81
81
  for (let i = 0; i < count; i++)
82
- clear += this.line + (i < count - 1 ? cursor.up() : "");
82
+ clear2 += this.line + (i < count - 1 ? cursor.up() : "");
83
83
  if (count)
84
- clear += cursor.left;
85
- return clear;
84
+ clear2 += cursor.left;
85
+ return clear2;
86
86
  }
87
87
  };
88
88
  module2.exports = { cursor, scroll, erase, beep };
@@ -357,8 +357,8 @@ function defaultSpawn(timeoutMs) {
357
357
  });
358
358
  }
359
359
  function resolveConvexBin(cwd) {
360
- const local = path95.join(cwd, "node_modules", ".bin", process.platform === "win32" ? "convex.cmd" : "convex");
361
- if (fs81.existsSync(local)) return { cmd: local, args: [] };
360
+ const local = path96.join(cwd, "node_modules", ".bin", process.platform === "win32" ? "convex.cmd" : "convex");
361
+ if (fs82.existsSync(local)) return { cmd: local, args: [] };
362
362
  return { cmd: "npx", args: ["--yes", "convex"] };
363
363
  }
364
364
  function redact(text, key) {
@@ -489,13 +489,13 @@ async function runConvexAdminMcp(client3, id) {
489
489
  });
490
490
  await server.connect(new StdioServerTransport());
491
491
  }
492
- var import_node_child_process32, fs81, path95, TOOLS;
492
+ var import_node_child_process32, fs82, path96, TOOLS;
493
493
  var init_convex_admin_mcp = __esm({
494
494
  "src/integrations/convex-admin-mcp.ts"() {
495
495
  "use strict";
496
496
  import_node_child_process32 = require("child_process");
497
- fs81 = __toESM(require("fs"));
498
- path95 = __toESM(require("path"));
497
+ fs82 = __toESM(require("fs"));
498
+ path96 = __toESM(require("path"));
499
499
  TOOLS = [
500
500
  {
501
501
  name: "tables",
@@ -578,7 +578,7 @@ function createToolCallWatchdog(deps) {
578
578
  const clearTimer = deps.clearTimer ?? ((t2) => clearTimeout(t2));
579
579
  const timers = /* @__PURE__ */ new Map();
580
580
  const answered = /* @__PURE__ */ new Set();
581
- const clear = (id) => {
581
+ const clear2 = (id) => {
582
582
  const t2 = timers.get(id);
583
583
  if (t2) {
584
584
  clearTimer(t2);
@@ -590,7 +590,7 @@ function createToolCallWatchdog(deps) {
590
590
  const m = msg;
591
591
  if (m.method !== "tools/call" || m.id === void 0) return;
592
592
  const id = m.id;
593
- clear(id);
593
+ clear2(id);
594
594
  const timer = setTimer(() => {
595
595
  timers.delete(id);
596
596
  answered.add(id);
@@ -610,7 +610,7 @@ function createToolCallWatchdog(deps) {
610
610
  onServerMessage(msg) {
611
611
  const m = msg;
612
612
  if (m.id === void 0 || m.method !== void 0) return false;
613
- clear(m.id);
613
+ clear2(m.id);
614
614
  return answered.delete(m.id);
615
615
  },
616
616
  dispose() {
@@ -1135,12 +1135,25 @@ var PUBLIC_TO_INTERNAL = {
1135
1135
  "managed-codex": "claude",
1136
1136
  "managed-claude": "claude"
1137
1137
  };
1138
+ var INTERNAL_TO_PUBLIC = {
1139
+ claude: "claude_code",
1140
+ codex: "codex",
1141
+ cursor: "cursor",
1142
+ aider: "aider",
1143
+ coderabbit: "coderabbit",
1144
+ gemini: "gemini",
1145
+ kimi: "kimi",
1146
+ opencode: "opencode"
1147
+ };
1138
1148
  function isPublicToInternalKey(v) {
1139
1149
  return Object.prototype.hasOwnProperty.call(PUBLIC_TO_INTERNAL, v);
1140
1150
  }
1141
1151
  function publicToInternal(publicId) {
1142
1152
  return isPublicToInternalKey(publicId) ? PUBLIC_TO_INTERNAL[publicId] : null;
1143
1153
  }
1154
+ function internalToPublic(internal) {
1155
+ return INTERNAL_TO_PUBLIC[internal] ?? null;
1156
+ }
1144
1157
  var TERMINAL_AGENT_PREFIX = "__terminal__:";
1145
1158
  var AGENT_ID_ALIASES = {
1146
1159
  claude_code: "claude",
@@ -3532,11 +3545,11 @@ function quiet(fn) {
3532
3545
  log.debug(TAG, "ignored sync error", err);
3533
3546
  }
3534
3547
  }
3535
- function rmIfExistsQuiet(path97) {
3548
+ function rmIfExistsQuiet(path98) {
3536
3549
  try {
3537
- fs2.rmSync(path97, { force: true });
3550
+ fs2.rmSync(path98, { force: true });
3538
3551
  } catch (err) {
3539
- log.debug(TAG, `rmIfExists failed for ${path97}`, err);
3552
+ log.debug(TAG, `rmIfExists failed for ${path98}`, err);
3540
3553
  }
3541
3554
  }
3542
3555
  function killQuiet(target, signal = "SIGTERM") {
@@ -3740,8 +3753,8 @@ function createGetModuleFromFilename(basePath = process.argv[1] ? (0, import_pat
3740
3753
  return decodedFile;
3741
3754
  };
3742
3755
  }
3743
- function normalizeWindowsPath(path97) {
3744
- return path97.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
3756
+ function normalizeWindowsPath(path98) {
3757
+ return path98.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
3745
3758
  }
3746
3759
 
3747
3760
  // ../../node_modules/@posthog/core/dist/error-tracking/index.mjs
@@ -4815,20 +4828,20 @@ var ErrorPropertiesBuilder = class {
4815
4828
  };
4816
4829
  return context;
4817
4830
  }
4818
- buildCoercingContext(mechanism, hint, depth = 0) {
4819
- const coerce = (input, depth2) => {
4820
- if (!(depth2 <= MAX_CAUSE_RECURSION)) return;
4831
+ buildCoercingContext(mechanism, hint, depth2 = 0) {
4832
+ const coerce = (input, depth3) => {
4833
+ if (!(depth3 <= MAX_CAUSE_RECURSION)) return;
4821
4834
  {
4822
- const ctx = this.buildCoercingContext(mechanism, hint, depth2);
4835
+ const ctx = this.buildCoercingContext(mechanism, hint, depth3);
4823
4836
  return this.applyCoercers(input, ctx);
4824
4837
  }
4825
4838
  };
4826
4839
  const context = {
4827
4840
  ...hint,
4828
- syntheticException: 0 == depth ? hint.syntheticException : void 0,
4841
+ syntheticException: 0 == depth2 ? hint.syntheticException : void 0,
4829
4842
  mechanism,
4830
- apply: (input) => coerce(input, depth),
4831
- next: (input) => coerce(input, depth + 1)
4843
+ apply: (input) => coerce(input, depth2),
4844
+ next: (input) => coerce(input, depth2 + 1)
4832
4845
  };
4833
4846
  return context;
4834
4847
  }
@@ -6474,13 +6487,13 @@ var PostHogCoreStateless = class {
6474
6487
  sentFromRoute += batchMessages.length;
6475
6488
  }
6476
6489
  }
6477
- async _sendOtlpBatch({ path: path97, payload }) {
6490
+ async _sendOtlpBatch({ path: path98, payload }) {
6478
6491
  if (this.disabled) return {
6479
6492
  kind: "fatal",
6480
6493
  error: new Error("The client is disabled")
6481
6494
  };
6482
6495
  const serialized = JSON.stringify(payload);
6483
- const url2 = `${this.host}/i/v1/${path97}?token=${encodeURIComponent(this.apiKey)}`;
6496
+ const url2 = `${this.host}/i/v1/${path98}?token=${encodeURIComponent(this.apiKey)}`;
6484
6497
  const gzippedPayload = this.disableCompression ? null : await this.compressPayload(serialized);
6485
6498
  const fetchOptions = {
6486
6499
  method: "POST",
@@ -7126,7 +7139,7 @@ function encodeBigInt(value, logger) {
7126
7139
  intValue: decimal
7127
7140
  };
7128
7141
  }
7129
- function encodeAnyValue(value, logger, state, depth) {
7142
+ function encodeAnyValue(value, logger, state, depth2) {
7130
7143
  if (state.remainingNodes <= 0) return {
7131
7144
  stringValue: TRUNCATED_VALUE
7132
7145
  };
@@ -7174,7 +7187,7 @@ function encodeAnyValue(value, logger, state, depth) {
7174
7187
  if (state.ancestors.has(value)) return {
7175
7188
  stringValue: CIRCULAR_VALUE
7176
7189
  };
7177
- if (depth >= MAX_JSON_SAFE_VALUE_DEPTH) return {
7190
+ if (depth2 >= MAX_JSON_SAFE_VALUE_DEPTH) return {
7178
7191
  stringValue: TRUNCATED_VALUE
7179
7192
  };
7180
7193
  if (value instanceof Date) {
@@ -7188,17 +7201,17 @@ function encodeAnyValue(value, logger, state, depth) {
7188
7201
  try {
7189
7202
  try {
7190
7203
  const toJSON = value.toJSON;
7191
- if ("function" == typeof toJSON) return encodeAnyValue(toJSON.call(value), logger, state, depth + 1);
7204
+ if ("function" == typeof toJSON) return encodeAnyValue(toJSON.call(value), logger, state, depth2 + 1);
7192
7205
  } catch {
7193
7206
  }
7194
7207
  if (isArray(value)) return {
7195
7208
  arrayValue: {
7196
- values: encodeArrayValues(value, logger, state, depth + 1)
7209
+ values: encodeArrayValues(value, logger, state, depth2 + 1)
7197
7210
  }
7198
7211
  };
7199
7212
  return {
7200
7213
  kvlistValue: {
7201
- values: encodeKeyValueList(value, logger, state, depth + 1)
7214
+ values: encodeKeyValueList(value, logger, state, depth2 + 1)
7202
7215
  }
7203
7216
  };
7204
7217
  } finally {
@@ -7209,14 +7222,14 @@ function encodeAnyValue(value, logger, state, depth) {
7209
7222
  stringValue: sanitizeString(String(value))
7210
7223
  };
7211
7224
  }
7212
- function encodeArrayValues(values, logger, state, depth) {
7225
+ function encodeArrayValues(values, logger, state, depth2) {
7213
7226
  const result = [];
7214
7227
  const itemCount = Math.min(values.length, MAX_JSON_SAFE_VALUE_ITEMS);
7215
7228
  let index = 0;
7216
7229
  for (; index < itemCount && state.remainingNodes > 0; index++) try {
7217
7230
  const element = index in values ? values[index] : void 0;
7218
7231
  if (isNullish(element)) continue;
7219
- result.push(encodeAnyValue(element, logger, state, depth));
7232
+ result.push(encodeAnyValue(element, logger, state, depth2));
7220
7233
  } catch {
7221
7234
  result.push({
7222
7235
  stringValue: UNSERIALIZABLE_VALUE
@@ -7227,7 +7240,7 @@ function encodeArrayValues(values, logger, state, depth) {
7227
7240
  });
7228
7241
  return result;
7229
7242
  }
7230
- function encodeKeyValueList(attrs, logger, state, depth) {
7243
+ function encodeKeyValueList(attrs, logger, state, depth2) {
7231
7244
  const result = [];
7232
7245
  for (const key in attrs) if (propertyIsEnumerable.call(attrs, key)) {
7233
7246
  if (!key) {
@@ -7243,7 +7256,7 @@ function encodeKeyValueList(attrs, logger, state, depth) {
7243
7256
  if (isNull(value) || isUndefined(value)) continue;
7244
7257
  result.push({
7245
7258
  key: sanitizeString(key),
7246
- value: encodeAnyValue(value, logger, state, depth)
7259
+ value: encodeAnyValue(value, logger, state, depth2)
7247
7260
  });
7248
7261
  } catch {
7249
7262
  result.push({
@@ -7720,14 +7733,14 @@ async function addSourceContext(frames, openSourceFile = import_promises.open, l
7720
7733
  LRU_FILE_CONTENTS_CACHE.reduce();
7721
7734
  return frames;
7722
7735
  }
7723
- async function openRegularSourceFile(path97, openSourceFile, logger) {
7736
+ async function openRegularSourceFile(path98, openSourceFile, logger) {
7724
7737
  let fileHandle;
7725
7738
  let isValid = false;
7726
7739
  try {
7727
- fileHandle = await openSourceFile(path97, import_node_fs.constants.O_RDONLY | import_node_fs.constants.O_NONBLOCK);
7740
+ fileHandle = await openSourceFile(path98, import_node_fs.constants.O_RDONLY | import_node_fs.constants.O_NONBLOCK);
7728
7741
  const fileStat = await fileHandle.stat();
7729
7742
  if (!fileStat.isFile()) return;
7730
- if (fileStat.size > MAX_CONTEXTLINES_FILE_SIZE) return void logger?.debug(`Skipping source context for oversized file ${path97}: ${fileStat.size} bytes exceeds ${MAX_CONTEXTLINES_FILE_SIZE}`);
7743
+ if (fileStat.size > MAX_CONTEXTLINES_FILE_SIZE) return void logger?.debug(`Skipping source context for oversized file ${path98}: ${fileStat.size} bytes exceeds ${MAX_CONTEXTLINES_FILE_SIZE}`);
7731
7744
  isValid = true;
7732
7745
  return fileHandle;
7733
7746
  } catch {
@@ -7737,8 +7750,8 @@ async function openRegularSourceFile(path97, openSourceFile, logger) {
7737
7750
  });
7738
7751
  }
7739
7752
  }
7740
- async function getContextLinesFromFile(path97, ranges, output, cacheKey, openSourceFile, logger) {
7741
- const fileHandle = await openRegularSourceFile(path97, openSourceFile, logger);
7753
+ async function getContextLinesFromFile(path98, ranges, output, cacheKey, openSourceFile, logger) {
7754
+ const fileHandle = await openRegularSourceFile(path98, openSourceFile, logger);
7742
7755
  if (void 0 === fileHandle) return void LRU_FILE_CONTENTS_FS_READ_FAILED.set(cacheKey, 1);
7743
7756
  const openedFileHandle = fileHandle;
7744
7757
  return new Promise((resolve12) => {
@@ -7840,22 +7853,22 @@ function clearLineContext(frame) {
7840
7853
  delete frame.context_line;
7841
7854
  delete frame.post_context;
7842
7855
  }
7843
- function shouldSkipContextLinesForFile(path97) {
7844
- return path97.startsWith("node:") || path97.endsWith(".min.js") || path97.endsWith(".min.cjs") || path97.endsWith(".min.mjs") || path97.startsWith("data:");
7856
+ function shouldSkipContextLinesForFile(path98) {
7857
+ return path98.startsWith("node:") || path98.endsWith(".min.js") || path98.endsWith(".min.cjs") || path98.endsWith(".min.mjs") || path98.startsWith("data:");
7845
7858
  }
7846
7859
  function shouldSkipContextLinesForFrame(frame) {
7847
7860
  if (void 0 !== frame.lineno && frame.lineno > MAX_CONTEXTLINES_LINENO) return true;
7848
7861
  if (void 0 !== frame.colno && frame.colno > MAX_CONTEXTLINES_COLNO) return true;
7849
7862
  return false;
7850
7863
  }
7851
- function makeSourceCacheKey(path97, basePath) {
7852
- if ((0, import_node_path.isAbsolute)(path97)) return JSON.stringify([
7864
+ function makeSourceCacheKey(path98, basePath) {
7865
+ if ((0, import_node_path.isAbsolute)(path98)) return JSON.stringify([
7853
7866
  null,
7854
- path97
7867
+ path98
7855
7868
  ]);
7856
7869
  return void 0 === basePath ? void 0 : JSON.stringify([
7857
7870
  basePath,
7858
- path97
7871
+ path98
7859
7872
  ]);
7860
7873
  }
7861
7874
  function rangeExistsInContentCache(cacheKey, range) {
@@ -10516,7 +10529,7 @@ function readAnonId() {
10516
10529
  }
10517
10530
  function superProperties() {
10518
10531
  return {
10519
- cliVersion: true ? "2.75.34" : "0.0.0-dev",
10532
+ cliVersion: true ? "2.75.36" : "0.0.0-dev",
10520
10533
  nodeVersion: process.version,
10521
10534
  platform: process.platform,
10522
10535
  arch: process.arch,
@@ -10758,7 +10771,7 @@ var http = __toESM(require("http"));
10758
10771
  // package.json
10759
10772
  var package_default = {
10760
10773
  name: "codeam-cli",
10761
- version: "2.75.34",
10774
+ version: "2.75.36",
10762
10775
  description: "Workflow-continuity bridge for AI coding agents. Wrap Claude Code or Codex in a PTY and supervise, approve, and redirect the session from any device \u2014 async. The terminal companion for CodeAgent Mobile.",
10763
10776
  type: "commonjs",
10764
10777
  main: "dist/index.js",
@@ -12088,7 +12101,7 @@ var CommandRelayService = class _CommandRelayService {
12088
12101
  // fresh + clear the "CLI update available" banner after a self-update
12089
12102
  // (a codespace that reinstalls @latest reconnects via heartbeat, not
12090
12103
  // pair/reconnect). Older backends ignore the extra field.
12091
- ..."2.75.34" ? { ideVersion: "2.75.34" } : {}
12104
+ ..."2.75.36" ? { ideVersion: "2.75.36" } : {}
12092
12105
  };
12093
12106
  try {
12094
12107
  const res = await _postJson(`${API_BASE2}/api/plugin/heartbeat`, body);
@@ -12161,10 +12174,12 @@ var CommandRelayService = class _CommandRelayService {
12161
12174
  installed: true
12162
12175
  }
12163
12176
  ];
12177
+ const linkedAgentId = this.linkedAgentIdProvider?.() ?? null;
12164
12178
  _postJson(`${API_BASE2}/api/plugin/agents`, {
12165
12179
  pluginId: this.pluginId,
12166
12180
  agents,
12167
- capabilities: { squad: true }
12181
+ capabilities: { squad: true },
12182
+ ...linkedAgentId ? { linkedAgentId } : {}
12168
12183
  }).then(() => {
12169
12184
  this.agentsRegistered = true;
12170
12185
  }).catch(() => {
@@ -12175,6 +12190,16 @@ var CommandRelayService = class _CommandRelayService {
12175
12190
  * switch). Heartbeats pick the new id up on their next tick; call
12176
12191
  * {@link reannounceAgents} to push the new `/api/plugin/agents` entry.
12177
12192
  */
12193
+ /**
12194
+ * The PUBLIC id of the agent really running (`managed-codex`, `claude_code`),
12195
+ * sent alongside the runtime-keyed `agents` list. The runtime id is `claude`
12196
+ * for every managed agent, so without this a session the host RESUMED on a
12197
+ * managed agent read as the user's own Claude in the app (owner, 2026-09-26).
12198
+ */
12199
+ linkedAgentIdProvider = null;
12200
+ setLinkedAgentIdProvider(provider) {
12201
+ this.linkedAgentIdProvider = provider;
12202
+ }
12178
12203
  setAgentMeta(meta) {
12179
12204
  this.agentMeta = meta;
12180
12205
  }
@@ -12394,10 +12419,10 @@ var WINDOWS_LEGACY_JUNCTIONS = [
12394
12419
  /[\\/]Start Menu([\\/]|$)/i,
12395
12420
  /[\\/]Templates([\\/]|$)/i
12396
12421
  ];
12397
- function isUnsafeWindowsWatchRoot(dir, homedir52) {
12422
+ function isUnsafeWindowsWatchRoot(dir, homedir53) {
12398
12423
  const norm = (p2) => p2.replace(/\//g, "\\").replace(/\\+$/, "").toLowerCase();
12399
12424
  const cwd = norm(dir);
12400
- const home = norm(homedir52);
12425
+ const home = norm(homedir53);
12401
12426
  if (cwd === home) return true;
12402
12427
  if (/^[a-z]:$/.test(cwd)) return true;
12403
12428
  const sysRoots = [
@@ -13796,8 +13821,8 @@ async function isExistingFile(absPath) {
13796
13821
  return false;
13797
13822
  }
13798
13823
  }
13799
- async function walkForSuffix(dir, needleVariants, depth, ctx) {
13800
- if (depth > MAX_WALK_DEPTH) return;
13824
+ async function walkForSuffix(dir, needleVariants, depth2, ctx) {
13825
+ if (depth2 > MAX_WALK_DEPTH) return;
13801
13826
  if (ctx.visited > MAX_VISITED_DIRS) return;
13802
13827
  if (ctx.matches.length >= ctx.cap) return;
13803
13828
  ctx.visited++;
@@ -13819,7 +13844,7 @@ async function walkForSuffix(dir, needleVariants, depth, ctx) {
13819
13844
  if (!e.isDirectory()) continue;
13820
13845
  if (SUBDIR_IGNORE.has(e.name)) continue;
13821
13846
  if (e.name.startsWith(".") && SUBDIR_IGNORE.has(e.name)) continue;
13822
- await walkForSuffix(path7.join(dir, e.name), needleVariants, depth + 1, ctx);
13847
+ await walkForSuffix(path7.join(dir, e.name), needleVariants, depth2 + 1, ctx);
13823
13848
  if (ctx.matches.length >= ctx.cap) return;
13824
13849
  }
13825
13850
  }
@@ -13941,7 +13966,7 @@ async function listProjectFiles(opts = {}) {
13941
13966
  const q2 = (opts.query ?? "").trim().toLowerCase();
13942
13967
  const out2 = [];
13943
13968
  let truncated = false;
13944
- async function walk(dir, depth) {
13969
+ async function walk(dir, depth2) {
13945
13970
  if (out2.length >= cap) {
13946
13971
  truncated = true;
13947
13972
  return;
@@ -13960,8 +13985,8 @@ async function listProjectFiles(opts = {}) {
13960
13985
  if (PROJECT_IGNORE.has(e.name)) continue;
13961
13986
  const full = path8.join(dir, e.name);
13962
13987
  if (e.isDirectory()) {
13963
- if (depth >= 12) continue;
13964
- await walk(full, depth + 1);
13988
+ if (depth2 >= 12) continue;
13989
+ await walk(full, depth2 + 1);
13965
13990
  } else if (e.isFile()) {
13966
13991
  const rel = path8.relative(root, full);
13967
13992
  if (q2 && !rel.toLowerCase().includes(q2) && !e.name.toLowerCase().includes(q2)) {
@@ -17127,10 +17152,10 @@ function buildForPlatform(platform3) {
17127
17152
  var import_node_crypto4 = require("crypto");
17128
17153
 
17129
17154
  // src/agents/claude/resolver.ts
17130
- function buildClaudeLaunch(extraArgs = [], os66 = createOsStrategy()) {
17131
- const found = os66.findInPath("claude") ?? os66.findInPath("claude-code");
17155
+ function buildClaudeLaunch(extraArgs = [], os67 = createOsStrategy()) {
17156
+ const found = os67.findInPath("claude") ?? os67.findInPath("claude-code");
17132
17157
  if (!found) return null;
17133
- return os66.buildLaunch(found, extraArgs);
17158
+ return os67.buildLaunch(found, extraArgs);
17134
17159
  }
17135
17160
 
17136
17161
  // src/agents/claude/installer.ts
@@ -17908,8 +17933,8 @@ var ClaudeRuntimeStrategy = class {
17908
17933
  meta = getAgent("claude");
17909
17934
  mode = "interactive";
17910
17935
  os;
17911
- constructor(os66) {
17912
- this.os = os66;
17936
+ constructor(os67) {
17937
+ this.os = os67;
17913
17938
  }
17914
17939
  /**
17915
17940
  * Claude Code's react-ink TUI enables bracketed-paste mode at
@@ -19003,8 +19028,8 @@ function codexCredentialLocator() {
19003
19028
  function codexLoginLauncher() {
19004
19029
  return {
19005
19030
  async ensureInstalled() {
19006
- const os66 = createOsStrategy();
19007
- return os66.findInPath("codex") !== null;
19031
+ const os67 = createOsStrategy();
19032
+ return os67.findInPath("codex") !== null;
19008
19033
  },
19009
19034
  launch() {
19010
19035
  return (0, import_node_child_process3.spawn)("codex", ["login"], { stdio: "inherit" });
@@ -19027,8 +19052,8 @@ var CodexRuntimeStrategy = class {
19027
19052
  meta = getAgent("codex");
19028
19053
  mode = "interactive";
19029
19054
  os;
19030
- constructor(os66) {
19031
- this.os = os66;
19055
+ constructor(os67) {
19056
+ this.os = os67;
19032
19057
  }
19033
19058
  async prepareLaunch() {
19034
19059
  let binary = this.os.findInPath("codex");
@@ -19138,12 +19163,12 @@ var CodexRuntimeStrategy = class {
19138
19163
  });
19139
19164
  }
19140
19165
  };
19141
- function resolveNpm(os66) {
19142
- return os66.id === "win32" ? "npm.cmd" : "npm";
19166
+ function resolveNpm(os67) {
19167
+ return os67.id === "win32" ? "npm.cmd" : "npm";
19143
19168
  }
19144
- async function installCodexViaNpm(os66) {
19169
+ async function installCodexViaNpm(os67) {
19145
19170
  return new Promise((resolve12, reject) => {
19146
- const proc = (0, import_node_child_process4.spawn)(resolveNpm(os66), ["install", "-g", "@openai/codex"], {
19171
+ const proc = (0, import_node_child_process4.spawn)(resolveNpm(os67), ["install", "-g", "@openai/codex"], {
19147
19172
  stdio: "inherit"
19148
19173
  });
19149
19174
  proc.on("close", (code) => {
@@ -19160,16 +19185,16 @@ async function installCodexViaNpm(os66) {
19160
19185
  });
19161
19186
  });
19162
19187
  }
19163
- function augmentNpmGlobalBin(os66) {
19188
+ function augmentNpmGlobalBin(os67) {
19164
19189
  try {
19165
- const result = (0, import_node_child_process4.spawnSync)(resolveNpm(os66), ["prefix", "-g"], {
19190
+ const result = (0, import_node_child_process4.spawnSync)(resolveNpm(os67), ["prefix", "-g"], {
19166
19191
  stdio: ["ignore", "pipe", "ignore"]
19167
19192
  });
19168
19193
  if (result.status !== 0) return;
19169
19194
  const prefix = result.stdout.toString().trim();
19170
19195
  if (!prefix) return;
19171
- const binDir = os66.id === "win32" ? prefix : path24.join(prefix, "bin");
19172
- os66.augmentPath([binDir]);
19196
+ const binDir = os67.id === "win32" ? prefix : path24.join(prefix, "bin");
19197
+ os67.augmentPath([binDir]);
19173
19198
  } catch {
19174
19199
  }
19175
19200
  }
@@ -19363,10 +19388,10 @@ function manualInstallHint(runner, tools) {
19363
19388
  const argv = osPackageInstallArgv(detectPackageManager(runner), [...tools]);
19364
19389
  return argv ? `\`sudo ${argv.join(" ")}\`` : `your package manager (e.g. \`${pkgs}\`)`;
19365
19390
  }
19366
- function writeUnzipShim(os66, runner) {
19391
+ function writeUnzipShim(os67, runner) {
19367
19392
  const python = ["python3", "python"].find((p2) => runner.which(p2));
19368
19393
  if (!python) return null;
19369
- const dir = os66.scratchPath("codeam-cr-prereq");
19394
+ const dir = os67.scratchPath("codeam-cr-prereq");
19370
19395
  const shim = path26.join(dir, "unzip");
19371
19396
  const script = `#!/bin/sh
19372
19397
  set -e
@@ -19388,9 +19413,9 @@ exec ${python} -m zipfile -e "$archive" "$dest"
19388
19413
  (0, import_node_fs5.chmodSync)(shim, 448);
19389
19414
  return dir;
19390
19415
  }
19391
- async function ensureInstallPrerequisites(os66, deps = {}) {
19416
+ async function ensureInstallPrerequisites(os67, deps = {}) {
19392
19417
  const runner = deps.runner ?? defaultOsRunner;
19393
- const missing = REQUIRED_TOOLS.filter((t2) => os66.findInPath(t2) === null);
19418
+ const missing = REQUIRED_TOOLS.filter((t2) => os67.findInPath(t2) === null);
19394
19419
  if (missing.length === 0) return { ok: true, extraPath: [] };
19395
19420
  log.info(
19396
19421
  "coderabbit",
@@ -19409,10 +19434,10 @@ async function ensureInstallPrerequisites(os66, deps = {}) {
19409
19434
  );
19410
19435
  }
19411
19436
  }
19412
- const stillMissing = REQUIRED_TOOLS.filter((t2) => os66.findInPath(t2) === null);
19437
+ const stillMissing = REQUIRED_TOOLS.filter((t2) => os67.findInPath(t2) === null);
19413
19438
  if (stillMissing.length === 0) return { ok: true, extraPath: [] };
19414
19439
  if (stillMissing.length === 1 && stillMissing[0] === "unzip") {
19415
- const shimDir = writeUnzipShim(os66, runner);
19440
+ const shimDir = writeUnzipShim(os67, runner);
19416
19441
  if (shimDir) {
19417
19442
  log.info("coderabbit", "unzip is unavailable \u2014 using a scoped python zipfile shim");
19418
19443
  return { ok: true, extraPath: [shimDir] };
@@ -19475,15 +19500,15 @@ function summarizeInstallFailure(output) {
19475
19500
  }
19476
19501
  return lines.length > 0 ? lines[lines.length - 1] : null;
19477
19502
  }
19478
- async function ensureCoderabbitInstalled(os66, deps = {}) {
19479
- if (os66.findInPath("coderabbit")) return { ok: true };
19480
- if (os66.id === "win32") {
19503
+ async function ensureCoderabbitInstalled(os67, deps = {}) {
19504
+ if (os67.findInPath("coderabbit")) return { ok: true };
19505
+ if (os67.id === "win32") {
19481
19506
  return {
19482
19507
  ok: false,
19483
19508
  error: "CodeRabbit on Windows requires WSL. Install the CLI inside your WSL distribution (curl -fsSL https://cli.coderabbit.ai/install.sh | sh), then try again."
19484
19509
  };
19485
19510
  }
19486
- const prereq = await ensureInstallPrerequisites(os66, deps);
19511
+ const prereq = await ensureInstallPrerequisites(os67, deps);
19487
19512
  if (!prereq.ok) return { ok: false, error: prereq.error };
19488
19513
  const env = { ...process.env };
19489
19514
  if (prereq.extraPath.length > 0) {
@@ -19492,8 +19517,8 @@ async function ensureCoderabbitInstalled(os66, deps = {}) {
19492
19517
  log.info("coderabbit", "CodeRabbit CLI not found \u2014 installing via the official script");
19493
19518
  const run = deps.runInstallScript ?? defaultRunInstallScript;
19494
19519
  const { code, output } = await run(env);
19495
- os66.augmentPath([`${os66.homeDir()}/.local/bin`, "/opt/homebrew/bin"]);
19496
- const binary = os66.findInPath("coderabbit");
19520
+ os67.augmentPath([`${os67.homeDir()}/.local/bin`, "/opt/homebrew/bin"]);
19521
+ const binary = os67.findInPath("coderabbit");
19497
19522
  const detail = summarizeInstallFailure(output);
19498
19523
  if (binary !== null) {
19499
19524
  if (code === 0) return { ok: true };
@@ -19547,10 +19572,10 @@ function coderabbitCredentialLocator() {
19547
19572
  validate: validateNonEmptyCredential
19548
19573
  };
19549
19574
  }
19550
- function coderabbitLoginLauncher(os66) {
19575
+ function coderabbitLoginLauncher(os67) {
19551
19576
  return {
19552
19577
  async ensureInstalled() {
19553
- const result = await ensureCoderabbitInstalled(os66);
19578
+ const result = await ensureCoderabbitInstalled(os67);
19554
19579
  if (!result.ok && result.error) console.error(`
19555
19580
  \u2717 ${result.error}
19556
19581
  `);
@@ -19610,8 +19635,8 @@ function pickLine(obj) {
19610
19635
  function toHunk(raw, groupSeverity) {
19611
19636
  if (!raw || typeof raw !== "object") return null;
19612
19637
  const o = raw;
19613
- const path97 = asString(pick(o, ["file_path", "filePath", "file", "path", "filename", "fileName"])) ?? asString(pick(o, ["location"])?.path);
19614
- if (!path97) return null;
19638
+ const path98 = asString(pick(o, ["file_path", "filePath", "file", "path", "filename", "fileName"])) ?? asString(pick(o, ["location"])?.path);
19639
+ if (!path98) return null;
19615
19640
  const message = asString(
19616
19641
  pick(o, [
19617
19642
  "comment",
@@ -19628,7 +19653,7 @@ function toHunk(raw, groupSeverity) {
19628
19653
  const severity = normSeverity(pick(o, ["severity", "level", "priority", "impact"])) ?? normSeverity(groupSeverity);
19629
19654
  const locObj = pick(o, ["location"]) ?? o;
19630
19655
  return {
19631
- path: path97.trim(),
19656
+ path: path98.trim(),
19632
19657
  line: pickLine(o) ?? pickLine(locObj),
19633
19658
  severity,
19634
19659
  message: (title && message ? `${title}: ${message}` : title || message).trim() || "(no message)"
@@ -19711,10 +19736,10 @@ function parsePlain(stdout) {
19711
19736
  for (const line of stdout.split(/\r?\n/)) {
19712
19737
  const m = line.match(HUNK_LINE_RE);
19713
19738
  if (!m) continue;
19714
- const [, path97, lineNo, sevToken, message] = m;
19715
- if (!path97 || !lineNo || !message) continue;
19739
+ const [, path98, lineNo, sevToken, message] = m;
19740
+ if (!path98 || !lineNo || !message) continue;
19716
19741
  hunks.push({
19717
- path: path97.trim(),
19742
+ path: path98.trim(),
19718
19743
  line: Number(lineNo),
19719
19744
  severity: sevToken ? SEVERITY_MAP[sevToken.toLowerCase()] : void 0,
19720
19745
  message: message.trim().replace(/^[*-]\s+/, "")
@@ -19774,8 +19799,8 @@ var CoderabbitRuntimeStrategy = class {
19774
19799
  meta = getAgent("coderabbit");
19775
19800
  mode = "batch";
19776
19801
  os;
19777
- constructor(os66) {
19778
- this.os = os66;
19802
+ constructor(os67) {
19803
+ this.os = os67;
19779
19804
  }
19780
19805
  getDefaultArgs() {
19781
19806
  return ["review", "--agent"];
@@ -20046,10 +20071,10 @@ function cursorCredentialLocator() {
20046
20071
  validate: validateNonEmptyCredential
20047
20072
  };
20048
20073
  }
20049
- function cursorLoginLauncher(os66) {
20074
+ function cursorLoginLauncher(os67) {
20050
20075
  return {
20051
20076
  async ensureInstalled() {
20052
- if (os66.findInPath("cursor-agent")) return true;
20077
+ if (os67.findInPath("cursor-agent")) return true;
20053
20078
  console.error(
20054
20079
  "\n \u2717 cursor-agent binary not on PATH.\n Install Cursor (https://cursor.com/) and ensure the CLI\n plugin is enabled, then re-run `codeam link cursor`.\n"
20055
20080
  );
@@ -20113,8 +20138,8 @@ var CursorRuntimeStrategy = class {
20113
20138
  meta = getAgent("cursor");
20114
20139
  mode = "interactive";
20115
20140
  os;
20116
- constructor(os66) {
20117
- this.os = os66;
20141
+ constructor(os67) {
20142
+ this.os = os67;
20118
20143
  }
20119
20144
  async prepareLaunch() {
20120
20145
  const binary = this.os.findInPath("cursor-agent");
@@ -20331,10 +20356,10 @@ function aiderCredentialLocator() {
20331
20356
  validate: validateNonEmptyCredential
20332
20357
  };
20333
20358
  }
20334
- function aiderLoginLauncher(os66) {
20359
+ function aiderLoginLauncher(os67) {
20335
20360
  return {
20336
20361
  async ensureInstalled() {
20337
- if (os66.findInPath("aider")) return true;
20362
+ if (os67.findInPath("aider")) return true;
20338
20363
  console.error(
20339
20364
  "\n \u2717 aider binary not on PATH.\n Install Aider:\n pip install aider-chat\n then re-run `codeam link aider`.\n"
20340
20365
  );
@@ -20344,7 +20369,7 @@ function aiderLoginLauncher(os66) {
20344
20369
  console.error(
20345
20370
  "\n Aider has no interactive login flow.\n Set ANTHROPIC_API_KEY or OPENAI_API_KEY in your shell,\n or re-run `codeam link aider --api-key=<your-key>`.\n"
20346
20371
  );
20347
- return (0, import_node_child_process11.spawn)(os66.id === "win32" ? "cmd.exe" : "sh", os66.id === "win32" ? ["/c", "exit", "0"] : ["-c", "exit 0"], {
20372
+ return (0, import_node_child_process11.spawn)(os67.id === "win32" ? "cmd.exe" : "sh", os67.id === "win32" ? ["/c", "exit", "0"] : ["-c", "exit 0"], {
20348
20373
  stdio: "ignore"
20349
20374
  });
20350
20375
  }
@@ -20433,14 +20458,14 @@ function defaultSdkDir() {
20433
20458
  return resolveSdkDirViaRequire();
20434
20459
  }
20435
20460
  function resolveClaudeNativeBinary(deps = {}) {
20436
- const existsSync30 = deps.existsSync ?? import_fs.default.existsSync;
20461
+ const existsSync31 = deps.existsSync ?? import_fs.default.existsSync;
20437
20462
  const platformKey = deps.platformKey ?? currentPlatformKey();
20438
20463
  const sdkDir = deps.sdkDir !== void 0 ? deps.sdkDir : defaultSdkDir();
20439
20464
  if (!sdkDir) return null;
20440
20465
  const scopeDir = import_path4.default.dirname(sdkDir);
20441
20466
  const binName = platformKey.startsWith("win32-") ? "claude.exe" : "claude";
20442
20467
  const candidate = import_path4.default.join(scopeDir, `claude-agent-sdk-${platformKey}`, binName);
20443
- return existsSync30(candidate) ? candidate : null;
20468
+ return existsSync31(candidate) ? candidate : null;
20444
20469
  }
20445
20470
  var realSleep = (ms) => new Promise((resolve12) => setTimeout(resolve12, ms));
20446
20471
  async function waitForClaudeNativeBinary(opts = {}) {
@@ -20522,18 +20547,18 @@ function augmentUserLocalBinPaths(deps = {}) {
20522
20547
  env.PATH = [...additions, ...parts].join(p2.delimiter);
20523
20548
  }
20524
20549
  function resolveCursorAgentBinary(deps = {}) {
20525
- const existsSync30 = deps.existsSync ?? import_fs.default.existsSync;
20550
+ const existsSync31 = deps.existsSync ?? import_fs.default.existsSync;
20526
20551
  const platform3 = deps.platform ?? process.platform;
20527
20552
  const env = deps.env ?? process.env;
20528
20553
  if (platform3 === "win32") {
20529
20554
  const localAppData = env.LOCALAPPDATA;
20530
20555
  if (!localAppData) return null;
20531
20556
  const exe = import_path4.default.win32.join(localAppData, "cursor-agent", "cursor-agent.exe");
20532
- return existsSync30(exe) ? exe : null;
20557
+ return existsSync31(exe) ? exe : null;
20533
20558
  }
20534
20559
  const home = deps.homedir ?? import_os4.default.homedir();
20535
20560
  const unix = import_path4.default.posix.join(home, ".local", "bin", "cursor-agent");
20536
- return existsSync30(unix) ? unix : null;
20561
+ return existsSync31(unix) ? unix : null;
20537
20562
  }
20538
20563
  async function waitForCursorAgent(opts = {}) {
20539
20564
  const timeoutMs = opts.timeoutMs ?? 18e4;
@@ -20619,8 +20644,8 @@ var AiderRuntimeStrategy = class {
20619
20644
  meta = getAgent("aider");
20620
20645
  mode = "interactive";
20621
20646
  os;
20622
- constructor(os66) {
20623
- this.os = os66;
20647
+ constructor(os67) {
20648
+ this.os = os67;
20624
20649
  }
20625
20650
  async prepareLaunch() {
20626
20651
  augmentUserLocalBinPaths();
@@ -20753,8 +20778,8 @@ function geminiCredentialLocator() {
20753
20778
  function geminiLoginLauncher() {
20754
20779
  return {
20755
20780
  async ensureInstalled() {
20756
- const os66 = createOsStrategy();
20757
- return os66.findInPath("gemini") !== null;
20781
+ const os67 = createOsStrategy();
20782
+ return os67.findInPath("gemini") !== null;
20758
20783
  },
20759
20784
  launch() {
20760
20785
  return (0, import_node_child_process12.spawn)("gemini", ["auth", "login"], { stdio: "inherit" });
@@ -20944,8 +20969,8 @@ var GeminiRuntimeStrategy = class {
20944
20969
  meta = getAgent("gemini");
20945
20970
  mode = "interactive";
20946
20971
  os;
20947
- constructor(os66) {
20948
- this.os = os66;
20972
+ constructor(os67) {
20973
+ this.os = os67;
20949
20974
  }
20950
20975
  async prepareLaunch() {
20951
20976
  const binary = this.os.findInPath("gemini");
@@ -21237,8 +21262,8 @@ var KimiRuntimeStrategy = class {
21237
21262
  meta = getAgent("kimi");
21238
21263
  mode = "interactive";
21239
21264
  os;
21240
- constructor(os66) {
21241
- this.os = os66;
21265
+ constructor(os67) {
21266
+ this.os = os67;
21242
21267
  }
21243
21268
  async prepareLaunch() {
21244
21269
  const binary = this.os.findInPath("kimi");
@@ -21381,8 +21406,8 @@ var OpencodeRuntimeStrategy = class {
21381
21406
  meta = getAgent("opencode");
21382
21407
  mode = "interactive";
21383
21408
  os;
21384
- constructor(os66) {
21385
- this.os = os66;
21409
+ constructor(os67) {
21410
+ this.os = os67;
21386
21411
  }
21387
21412
  async prepareLaunch() {
21388
21413
  const binary = this.os.findInPath("opencode");
@@ -21467,20 +21492,20 @@ var OpencodeRuntimeStrategy = class {
21467
21492
 
21468
21493
  // src/agents/registry.ts
21469
21494
  var runtimeBuilders = {
21470
- claude: (os66) => new ClaudeRuntimeStrategy(os66),
21471
- codex: (os66) => new CodexRuntimeStrategy(os66),
21472
- coderabbit: (os66) => new CoderabbitRuntimeStrategy(os66),
21473
- cursor: (os66) => new CursorRuntimeStrategy(os66),
21474
- aider: (os66) => new AiderRuntimeStrategy(os66),
21475
- gemini: (os66) => new GeminiRuntimeStrategy(os66),
21476
- kimi: (os66) => new KimiRuntimeStrategy(os66),
21477
- opencode: (os66) => new OpencodeRuntimeStrategy(os66)
21495
+ claude: (os67) => new ClaudeRuntimeStrategy(os67),
21496
+ codex: (os67) => new CodexRuntimeStrategy(os67),
21497
+ coderabbit: (os67) => new CoderabbitRuntimeStrategy(os67),
21498
+ cursor: (os67) => new CursorRuntimeStrategy(os67),
21499
+ aider: (os67) => new AiderRuntimeStrategy(os67),
21500
+ gemini: (os67) => new GeminiRuntimeStrategy(os67),
21501
+ kimi: (os67) => new KimiRuntimeStrategy(os67),
21502
+ opencode: (os67) => new OpencodeRuntimeStrategy(os67)
21478
21503
  };
21479
21504
  var deployBuilders = {
21480
21505
  claude: () => new ClaudeDeployStrategy(),
21481
21506
  codex: () => new CodexDeployStrategy()
21482
21507
  };
21483
- function createAgentStrategy(agent, os66 = createOsStrategy()) {
21508
+ function createAgentStrategy(agent, os67 = createOsStrategy()) {
21484
21509
  if (!AGENT_REGISTRY[agent]?.enabled) {
21485
21510
  throw new Error(
21486
21511
  `Agent "${agent}" is not supported in this codeam-cli version. Upgrade with 'npm i -g codeam-cli@latest'.`
@@ -21490,10 +21515,10 @@ function createAgentStrategy(agent, os66 = createOsStrategy()) {
21490
21515
  if (!build) {
21491
21516
  throw new Error(`No runtime strategy registered for agent "${agent}"`);
21492
21517
  }
21493
- return build(os66);
21518
+ return build(os67);
21494
21519
  }
21495
- function createInteractiveAgentStrategy(agent, os66 = createOsStrategy()) {
21496
- const s = createAgentStrategy(agent, os66);
21520
+ function createInteractiveAgentStrategy(agent, os67 = createOsStrategy()) {
21521
+ const s = createAgentStrategy(agent, os67);
21497
21522
  if (s.mode !== "interactive") {
21498
21523
  throw new Error(
21499
21524
  `Agent "${agent}" is a batch agent; use createAgentStrategy + .runOneShot for one-shot reviews.`
@@ -22207,8 +22232,8 @@ function collectChangedFiles(cwd) {
22207
22232
  }
22208
22233
  return [...byPath.values()];
22209
22234
  }
22210
- function restoreCoderabbitOauthBlob(os66, value) {
22211
- const dir = path38.join(os66.homeDir(), ".coderabbit");
22235
+ function restoreCoderabbitOauthBlob(os67, value) {
22236
+ const dir = path38.join(os67.homeDir(), ".coderabbit");
22212
22237
  (0, import_node_fs6.mkdirSync)(dir, { recursive: true });
22213
22238
  let file = "auth.json";
22214
22239
  let contents = value.trim();
@@ -22228,26 +22253,26 @@ function installFailureMessage(result) {
22228
22253
  return result.error ?? "CodeRabbit CLI could not be installed";
22229
22254
  }
22230
22255
  async function configureCoderabbit(input, deps = {}) {
22231
- const os66 = deps.os ?? createOsStrategy();
22256
+ const os67 = deps.os ?? createOsStrategy();
22232
22257
  const ensureInstalled = deps.ensureInstalled ?? ensureCoderabbitInstalled;
22233
22258
  const isLoggedIn = deps.isLoggedIn ?? defaultIsLoggedIn;
22234
22259
  const runOAuth = deps.runOAuthLogin ?? runCoderabbitOAuthLogin;
22235
22260
  const snapshot = deps.snapshotDir ?? (() => snapshotCredentialDir());
22236
22261
  const capture2 = deps.captureCredential ?? ((b) => diffCapturedCredential(b));
22237
22262
  const loginWithApiKey = deps.loginWithApiKey ?? defaultLoginWithApiKey;
22238
- const home = os66.homeDir();
22239
- os66.augmentPath(
22240
- os66.id === "win32" ? [
22263
+ const home = os67.homeDir();
22264
+ os67.augmentPath(
22265
+ os67.id === "win32" ? [
22241
22266
  path38.join(home, ".local", "bin"),
22242
22267
  path38.join(process.env.APPDATA ?? path38.join(home, "AppData", "Roaming"), "npm"),
22243
22268
  path38.join(home, "scoop", "shims")
22244
22269
  ] : [path38.join(home, ".local", "bin"), "/opt/homebrew/bin", "/usr/local/bin"]
22245
22270
  );
22246
- const installed2 = os66.findInPath("coderabbit") !== null;
22271
+ const installed2 = os67.findInPath("coderabbit") !== null;
22247
22272
  const base = () => ({
22248
22273
  action: input.action,
22249
22274
  supported: true,
22250
- installed: os66.findInPath("coderabbit") !== null,
22275
+ installed: os67.findInPath("coderabbit") !== null,
22251
22276
  loggedIn: false
22252
22277
  });
22253
22278
  if (input.action === "status") {
@@ -22261,7 +22286,7 @@ async function configureCoderabbit(input, deps = {}) {
22261
22286
  const key = (input.apiKey ?? "").trim();
22262
22287
  if (!key) return { ...res2, error: "No API key provided" };
22263
22288
  if (!res2.installed) {
22264
- const inst = await ensureInstalled(os66);
22289
+ const inst = await ensureInstalled(os67);
22265
22290
  res2.installed = inst.ok;
22266
22291
  if (!inst.ok) return { ...res2, error: installFailureMessage(inst) };
22267
22292
  }
@@ -22285,7 +22310,7 @@ async function configureCoderabbit(input, deps = {}) {
22285
22310
  }
22286
22311
  if (!res2.installed) {
22287
22312
  deps.onEvent?.({ kind: "installing" });
22288
- const inst = await ensureInstalled(os66);
22313
+ const inst = await ensureInstalled(os67);
22289
22314
  res2.installed = inst.ok;
22290
22315
  if (!inst.ok) return { ...res2, error: installFailureMessage(inst) };
22291
22316
  }
@@ -22302,7 +22327,7 @@ async function configureCoderabbit(input, deps = {}) {
22302
22327
  return { ...res2, loggedIn: true, linked: true };
22303
22328
  }
22304
22329
  try {
22305
- restoreCoderabbitOauthBlob(os66, cred.credential);
22330
+ restoreCoderabbitOauthBlob(os67, cred.credential);
22306
22331
  } catch (err) {
22307
22332
  return {
22308
22333
  ...res2,
@@ -22326,7 +22351,7 @@ async function configureCoderabbit(input, deps = {}) {
22326
22351
  const res2 = base();
22327
22352
  if (!installed2) {
22328
22353
  deps.onEvent?.({ kind: "installing" });
22329
- const inst = await ensureInstalled(os66);
22354
+ const inst = await ensureInstalled(os67);
22330
22355
  res2.installed = inst.ok;
22331
22356
  if (!inst.ok) return { ...res2, error: installFailureMessage(inst) };
22332
22357
  }
@@ -22366,7 +22391,7 @@ async function configureCoderabbit(input, deps = {}) {
22366
22391
  }
22367
22392
  const res = base();
22368
22393
  if (!res.installed) {
22369
- const inst = await ensureInstalled(os66);
22394
+ const inst = await ensureInstalled(os67);
22370
22395
  res.installed = inst.ok;
22371
22396
  if (!inst.ok) return { ...res, error: installFailureMessage(inst) };
22372
22397
  }
@@ -23319,7 +23344,7 @@ function tryParseObject(s) {
23319
23344
  function extractFirstJsonObject(s) {
23320
23345
  const start2 = s.indexOf("{");
23321
23346
  if (start2 < 0) return null;
23322
- let depth = 0;
23347
+ let depth2 = 0;
23323
23348
  let inString = false;
23324
23349
  let escaped = false;
23325
23350
  for (let i = start2; i < s.length; i += 1) {
@@ -23340,10 +23365,10 @@ function extractFirstJsonObject(s) {
23340
23365
  inString = true;
23341
23366
  continue;
23342
23367
  }
23343
- if (c2 === "{") depth += 1;
23368
+ if (c2 === "{") depth2 += 1;
23344
23369
  else if (c2 === "}") {
23345
- depth -= 1;
23346
- if (depth === 0) return s.slice(start2, i + 1);
23370
+ depth2 -= 1;
23371
+ if (depth2 === 0) return s.slice(start2, i + 1);
23347
23372
  }
23348
23373
  }
23349
23374
  return null;
@@ -25754,11 +25779,11 @@ function resolveDoltInstallStrategy(platform3) {
25754
25779
  }
25755
25780
  var DOLT_RELEASE_BASE = "https://github.com/dolthub/dolt/releases/latest/download";
25756
25781
  function doltPlatformTuple(platform3, arch2) {
25757
- const os66 = platform3 === "win32" ? "windows" : platform3 === "darwin" ? "darwin" : "linux";
25782
+ const os67 = platform3 === "win32" ? "windows" : platform3 === "darwin" ? "darwin" : "linux";
25758
25783
  const a = arch2 === "x64" ? "amd64" : arch2 === "arm64" ? "arm64" : null;
25759
25784
  if (!a) return null;
25760
- if (os66 === "windows" && a !== "amd64") return null;
25761
- return `${os66}-${a}`;
25785
+ if (os67 === "windows" && a !== "amd64") return null;
25786
+ return `${os67}-${a}`;
25762
25787
  }
25763
25788
  function resolveDoltTarballStrategy(targetDir, platform3, arch2) {
25764
25789
  const tuple = doltPlatformTuple(platform3, arch2);
@@ -27447,7 +27472,7 @@ var vcsAgentReviewH = async (ctx, cmd, parsed) => {
27447
27472
  });
27448
27473
  const token = ctx.pluginAuthToken;
27449
27474
  void (async () => {
27450
- const os66 = createOsStrategy();
27475
+ const os67 = createOsStrategy();
27451
27476
  try {
27452
27477
  const report = await reviewPullRequest(
27453
27478
  {
@@ -27456,7 +27481,7 @@ var vcsAgentReviewH = async (ctx, cmd, parsed) => {
27456
27481
  baseBranch: parsed.baseBranch
27457
27482
  },
27458
27483
  {
27459
- runReview: (input) => new CoderabbitRuntimeStrategy(os66).runOneShot(input),
27484
+ runReview: (input) => new CoderabbitRuntimeStrategy(os67).runOneShot(input),
27460
27485
  runGh: (args2) => defaultRunGh(args2),
27461
27486
  postReport: async (r) => {
27462
27487
  if (!token) return;
@@ -27596,7 +27621,7 @@ function sweepStaleCliStagingDirs(nodeModulesDir, now = Date.now(), deps) {
27596
27621
  if (!nodeModulesDir) return 0;
27597
27622
  const readdirSync14 = deps?.readdirSync ?? fs51.readdirSync;
27598
27623
  const statSync15 = deps?.statSync ?? fs51.statSync;
27599
- const rmSync9 = deps?.rmSync ?? fs51.rmSync;
27624
+ const rmSync10 = deps?.rmSync ?? fs51.rmSync;
27600
27625
  let removed = 0;
27601
27626
  let entries;
27602
27627
  try {
@@ -27610,7 +27635,7 @@ function sweepStaleCliStagingDirs(nodeModulesDir, now = Date.now(), deps) {
27610
27635
  try {
27611
27636
  const st3 = statSync15(full);
27612
27637
  if (now - st3.mtimeMs < STALE_STAGING_AGE_MS) continue;
27613
- rmSync9(full, { recursive: true, force: true });
27638
+ rmSync10(full, { recursive: true, force: true });
27614
27639
  removed++;
27615
27640
  } catch {
27616
27641
  }
@@ -28636,11 +28661,11 @@ function resolveTokenValue(args2) {
28636
28661
  }
28637
28662
  const fileFlag = args2.find((a) => a.startsWith("--token-file="));
28638
28663
  if (fileFlag) {
28639
- const path97 = fileFlag.slice("--token-file=".length);
28664
+ const path98 = fileFlag.slice("--token-file=".length);
28640
28665
  try {
28641
- const content = fs52.readFileSync(path97, "utf8").trim();
28642
- if (content.length === 0) fail(`--token-file ${path97} is empty`);
28643
- rmIfExistsQuiet(path97);
28666
+ const content = fs52.readFileSync(path98, "utf8").trim();
28667
+ if (content.length === 0) fail(`--token-file ${path98} is empty`);
28668
+ rmIfExistsQuiet(path98);
28644
28669
  return content;
28645
28670
  } catch (err) {
28646
28671
  fail(`Could not read --token-file: ${err.message}`);
@@ -29733,9 +29758,9 @@ async function prepareWorkspace(repoOrPath, deployId, cloneToken, provider = "gi
29733
29758
 
29734
29759
  // src/agents/acp/runner.ts
29735
29760
  var import_node_crypto11 = require("crypto");
29736
- var fs71 = __toESM(require("fs"));
29737
- var os55 = __toESM(require("os"));
29738
- var path82 = __toESM(require("path"));
29761
+ var fs72 = __toESM(require("fs"));
29762
+ var os56 = __toESM(require("os"));
29763
+ var path83 = __toESM(require("path"));
29739
29764
 
29740
29765
  // src/lib/provider-routing.ts
29741
29766
  var fs55 = __toESM(require("fs"));
@@ -37912,15 +37937,15 @@ function defaultRunGit(cwd, args2) {
37912
37937
  });
37913
37938
  }
37914
37939
  async function discoverRepos(workingDir, maxDepth = 4) {
37915
- const fs82 = await import("fs/promises");
37940
+ const fs83 = await import("fs/promises");
37916
37941
  const out2 = [];
37917
37942
  await walk(workingDir, 0);
37918
37943
  return out2;
37919
- async function walk(dir, depth) {
37920
- if (depth > maxDepth) return;
37944
+ async function walk(dir, depth2) {
37945
+ if (depth2 > maxDepth) return;
37921
37946
  let entries = [];
37922
37947
  try {
37923
- const dirents = await fs82.readdir(dir, { withFileTypes: true });
37948
+ const dirents = await fs83.readdir(dir, { withFileTypes: true });
37924
37949
  entries = dirents.filter((d3) => !d3.name.startsWith(".") || d3.name === ".git").map((d3) => ({ name: d3.name, isDirectory: d3.isDirectory() }));
37925
37950
  } catch {
37926
37951
  return;
@@ -37940,7 +37965,7 @@ async function discoverRepos(workingDir, maxDepth = 4) {
37940
37965
  if (!entry.isDirectory) continue;
37941
37966
  if (entry.name === "node_modules") continue;
37942
37967
  if (entry.name === "dist" || entry.name === "build") continue;
37943
- await walk(path74.join(dir, entry.name), depth + 1);
37968
+ await walk(path74.join(dir, entry.name), depth2 + 1);
37944
37969
  }
37945
37970
  }
37946
37971
  }
@@ -38655,10 +38680,52 @@ async function postCredentialSync(opts, fetchImpl = fetch) {
38655
38680
  }
38656
38681
  }
38657
38682
 
38658
- // src/packs/gates.ts
38659
- var import_node_child_process23 = require("child_process");
38683
+ // src/services/turn-marker.ts
38660
38684
  var fs65 = __toESM(require("fs"));
38685
+ var os52 = __toESM(require("os"));
38661
38686
  var path76 = __toESM(require("path"));
38687
+ var depth = 0;
38688
+ function codeamHome() {
38689
+ return path76.join(os52.homedir(), ".codeam");
38690
+ }
38691
+ function turnMarkerPath(pid = process.pid, home = codeamHome()) {
38692
+ return path76.join(home, "turns", String(pid));
38693
+ }
38694
+ function mark() {
38695
+ try {
38696
+ const file = turnMarkerPath();
38697
+ fs65.mkdirSync(path76.dirname(file), { recursive: true });
38698
+ fs65.writeFileSync(file, String(Date.now()));
38699
+ } catch {
38700
+ }
38701
+ }
38702
+ function clear() {
38703
+ try {
38704
+ fs65.rmSync(turnMarkerPath(), { force: true });
38705
+ } catch {
38706
+ }
38707
+ }
38708
+ async function withTurnMarker(fn) {
38709
+ if (depth++ === 0) mark();
38710
+ try {
38711
+ return await fn();
38712
+ } finally {
38713
+ if (--depth === 0) clear();
38714
+ }
38715
+ }
38716
+ function isProcessMidTurn(pid, home) {
38717
+ if (!pid) return false;
38718
+ try {
38719
+ return fs65.existsSync(turnMarkerPath(pid, home));
38720
+ } catch {
38721
+ return false;
38722
+ }
38723
+ }
38724
+
38725
+ // src/packs/gates.ts
38726
+ var import_node_child_process23 = require("child_process");
38727
+ var fs66 = __toESM(require("fs"));
38728
+ var path77 = __toESM(require("path"));
38662
38729
  var defaultCommandRunner = (file, args2, cwd, timeoutMs, env) => new Promise((resolve12) => {
38663
38730
  (0, import_node_child_process23.execFile)(
38664
38731
  file,
@@ -38708,7 +38775,7 @@ async function changedFiles(run, cwd, from, to) {
38708
38775
  }
38709
38776
  function readWorkspaceFile(cwd, relPath) {
38710
38777
  try {
38711
- return fs65.readFileSync(path76.join(cwd, relPath), "utf8");
38778
+ return fs66.readFileSync(path77.join(cwd, relPath), "utf8");
38712
38779
  } catch {
38713
38780
  return null;
38714
38781
  }
@@ -38717,14 +38784,14 @@ var NO_TEST_PLACEHOLDER = 'echo "Error: no test specified"';
38717
38784
  var CHECKS_TIMEOUT_MS = 5 * 6e4;
38718
38785
  function detectChecksCommand(cwd) {
38719
38786
  try {
38720
- const cfg = JSON.parse(fs65.readFileSync(path76.join(cwd, ".codeam", "pack.json"), "utf8"));
38787
+ const cfg = JSON.parse(fs66.readFileSync(path77.join(cwd, ".codeam", "pack.json"), "utf8"));
38721
38788
  if (typeof cfg.checksCommand === "string" && cfg.checksCommand.trim().length > 0) {
38722
38789
  return cfg.checksCommand.trim();
38723
38790
  }
38724
38791
  } catch {
38725
38792
  }
38726
38793
  try {
38727
- const pkg = JSON.parse(fs65.readFileSync(path76.join(cwd, "package.json"), "utf8"));
38794
+ const pkg = JSON.parse(fs66.readFileSync(path77.join(cwd, "package.json"), "utf8"));
38728
38795
  const test = pkg.scripts?.test;
38729
38796
  if (typeof test === "string" && test.trim().length > 0 && !test.includes(NO_TEST_PLACEHOLDER)) {
38730
38797
  return "npm test";
@@ -38742,39 +38809,39 @@ ${res.stderr}`.trim();
38742
38809
  }
38743
38810
 
38744
38811
  // src/packs/run-store.ts
38745
- var fs66 = __toESM(require("fs"));
38746
- var path77 = __toESM(require("path"));
38812
+ var fs67 = __toESM(require("fs"));
38813
+ var path78 = __toESM(require("path"));
38747
38814
  var crypto5 = __toESM(require("crypto"));
38748
38815
  function packsDir(cwd) {
38749
- return path77.join(cwd, ".codeam", "packs");
38816
+ return path78.join(cwd, ".codeam", "packs");
38750
38817
  }
38751
38818
  function runDir(cwd, runId) {
38752
- return path77.join(packsDir(cwd), runId);
38819
+ return path78.join(packsDir(cwd), runId);
38753
38820
  }
38754
38821
  function newRunId() {
38755
38822
  return `pk_${Date.now().toString(36)}_${crypto5.randomBytes(4).toString("hex")}`;
38756
38823
  }
38757
38824
  function writeJsonAtomic(file, value) {
38758
- fs66.mkdirSync(path77.dirname(file), { recursive: true });
38825
+ fs67.mkdirSync(path78.dirname(file), { recursive: true });
38759
38826
  const tmp = `${file}.tmp`;
38760
- fs66.writeFileSync(tmp, JSON.stringify(value, null, 2));
38761
- fs66.renameSync(tmp, file);
38827
+ fs67.writeFileSync(tmp, JSON.stringify(value, null, 2));
38828
+ fs67.renameSync(tmp, file);
38762
38829
  }
38763
38830
  function saveRun(cwd, state) {
38764
- writeJsonAtomic(path77.join(runDir(cwd, state.runId), "run.json"), state);
38831
+ writeJsonAtomic(path78.join(runDir(cwd, state.runId), "run.json"), state);
38765
38832
  }
38766
38833
  function saveStageHandoff(cwd, runId, stageIndex, role, handoff) {
38767
38834
  const name = `${String(stageIndex + 1).padStart(2, "0")}-${role}.json`;
38768
- writeJsonAtomic(path77.join(runDir(cwd, runId), name), handoff);
38835
+ writeJsonAtomic(path78.join(runDir(cwd, runId), name), handoff);
38769
38836
  }
38770
38837
  function loadLatestRun(cwd) {
38771
38838
  try {
38772
38839
  const dir = packsDir(cwd);
38773
- const entries = fs66.readdirSync(dir, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name).sort();
38840
+ const entries = fs67.readdirSync(dir, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name).sort();
38774
38841
  for (let i = entries.length - 1; i >= 0; i--) {
38775
- const file = path77.join(dir, entries[i], "run.json");
38842
+ const file = path78.join(dir, entries[i], "run.json");
38776
38843
  try {
38777
- const parsed = JSON.parse(fs66.readFileSync(file, "utf8"));
38844
+ const parsed = JSON.parse(fs67.readFileSync(file, "utf8"));
38778
38845
  if (parsed && typeof parsed.runId === "string") return parsed;
38779
38846
  } catch {
38780
38847
  }
@@ -38785,17 +38852,17 @@ function loadLatestRun(cwd) {
38785
38852
  }
38786
38853
  function ensureLedgerIgnored(cwd) {
38787
38854
  try {
38788
- const gitDir = path77.join(cwd, ".git");
38789
- if (!fs66.existsSync(gitDir)) return;
38790
- const exclude = path77.join(gitDir, "info", "exclude");
38855
+ const gitDir = path78.join(cwd, ".git");
38856
+ if (!fs67.existsSync(gitDir)) return;
38857
+ const exclude = path78.join(gitDir, "info", "exclude");
38791
38858
  let existing = "";
38792
38859
  try {
38793
- existing = fs66.readFileSync(exclude, "utf8");
38860
+ existing = fs67.readFileSync(exclude, "utf8");
38794
38861
  } catch {
38795
38862
  }
38796
38863
  if (existing.includes(".codeam/packs/")) return;
38797
- fs66.mkdirSync(path77.dirname(exclude), { recursive: true });
38798
- fs66.writeFileSync(exclude, `${existing.trimEnd()}
38864
+ fs67.mkdirSync(path78.dirname(exclude), { recursive: true });
38865
+ fs67.writeFileSync(exclude, `${existing.trimEnd()}
38799
38866
  .codeam/packs/
38800
38867
  `.trimStart());
38801
38868
  } catch {
@@ -39776,20 +39843,20 @@ async function mcpRouter() {
39776
39843
  }
39777
39844
 
39778
39845
  // src/integrations/mcp-secrets.ts
39779
- var fs68 = __toESM(require("fs"));
39780
- var os53 = __toESM(require("os"));
39781
- var path79 = __toESM(require("path"));
39846
+ var fs69 = __toESM(require("fs"));
39847
+ var os54 = __toESM(require("os"));
39848
+ var path80 = __toESM(require("path"));
39782
39849
  var MCP_SECRETS_FILE_ENV = "CODEAM_MCP_SECRETS_FILE";
39783
39850
  function mcpSecretsDir() {
39784
- return path79.join(os53.homedir(), ".codeam", "mcp-secrets");
39851
+ return path80.join(os54.homedir(), ".codeam", "mcp-secrets");
39785
39852
  }
39786
39853
  function mcpSecretsPath(scope, pid = process.pid) {
39787
- return path79.join(mcpSecretsDir(), `${pid}-${scope}.json`);
39854
+ return path80.join(mcpSecretsDir(), `${pid}-${scope}.json`);
39788
39855
  }
39789
39856
  var registeredForCleanup = /* @__PURE__ */ new Set();
39790
39857
  function readFileVars(file) {
39791
39858
  try {
39792
- const parsed = JSON.parse(fs68.readFileSync(file, "utf8"));
39859
+ const parsed = JSON.parse(fs69.readFileSync(file, "utf8"));
39793
39860
  if (!parsed || typeof parsed !== "object") return {};
39794
39861
  const out2 = {};
39795
39862
  for (const [k2, v] of Object.entries(parsed)) {
@@ -39811,7 +39878,7 @@ function pidAlive(pid) {
39811
39878
  function pruneStale(dir) {
39812
39879
  let names = [];
39813
39880
  try {
39814
- names = fs68.readdirSync(dir);
39881
+ names = fs69.readdirSync(dir);
39815
39882
  } catch {
39816
39883
  return;
39817
39884
  }
@@ -39821,25 +39888,25 @@ function pruneStale(dir) {
39821
39888
  const pid = Number(m[1]);
39822
39889
  if (pid === process.pid || pidAlive(pid)) continue;
39823
39890
  try {
39824
- fs68.unlinkSync(path79.join(dir, name));
39891
+ fs69.unlinkSync(path80.join(dir, name));
39825
39892
  } catch {
39826
39893
  }
39827
39894
  }
39828
39895
  }
39829
39896
  function writeMcpSecrets(vars, file) {
39830
39897
  try {
39831
- const dir = path79.dirname(file);
39832
- fs68.mkdirSync(dir, { recursive: true, mode: 448 });
39898
+ const dir = path80.dirname(file);
39899
+ fs69.mkdirSync(dir, { recursive: true, mode: 448 });
39833
39900
  pruneStale(dir);
39834
39901
  const tmp = `${file}.${process.pid}.tmp`;
39835
- fs68.writeFileSync(tmp, JSON.stringify(vars), { mode: 384 });
39836
- fs68.renameSync(tmp, file);
39837
- fs68.chmodSync(file, 384);
39902
+ fs69.writeFileSync(tmp, JSON.stringify(vars), { mode: 384 });
39903
+ fs69.renameSync(tmp, file);
39904
+ fs69.chmodSync(file, 384);
39838
39905
  if (!registeredForCleanup.has(file)) {
39839
39906
  registeredForCleanup.add(file);
39840
39907
  process.once("exit", () => {
39841
39908
  try {
39842
- fs68.unlinkSync(file);
39909
+ fs69.unlinkSync(file);
39843
39910
  } catch {
39844
39911
  }
39845
39912
  });
@@ -39925,11 +39992,11 @@ function previewMcpServer(bridge) {
39925
39992
  };
39926
39993
  }
39927
39994
  function httpCall(baseUrl, token) {
39928
- return async (path97, method, body, timeoutMs) => {
39995
+ return async (path98, method, body, timeoutMs) => {
39929
39996
  const ac = new AbortController();
39930
39997
  const timer = setTimeout(() => ac.abort(), timeoutMs);
39931
39998
  try {
39932
- const res = await fetch(`${baseUrl}${path97}`, {
39999
+ const res = await fetch(`${baseUrl}${path98}`, {
39933
40000
  method,
39934
40001
  headers: { authorization: `Bearer ${token}`, "content-type": "application/json" },
39935
40002
  ...method === "POST" ? { body: JSON.stringify(body ?? {}) } : {},
@@ -41700,8 +41767,8 @@ var ACP_COMMAND_HANDLERS = {
41700
41767
  integrations_sync: integrationsSyncH,
41701
41768
  integrations_detect: integrationsDetectH,
41702
41769
  beads_action: beadsActionH,
41703
- start_task: startTaskH,
41704
- group_mention_task: groupMentionTaskH,
41770
+ start_task: (ctx) => withTurnMarker(() => startTaskH(ctx)),
41771
+ group_mention_task: (ctx) => withTurnMarker(() => groupMentionTaskH(ctx)),
41705
41772
  stop_task: stopTaskH,
41706
41773
  escape_key: stopTaskH,
41707
41774
  get_conversation: getConversationH,
@@ -41713,7 +41780,7 @@ var ACP_COMMAND_HANDLERS = {
41713
41780
  select_option: selectOptionH,
41714
41781
  provide_input: provideInputH,
41715
41782
  resume_session: resumeSessionH,
41716
- switch_agent: switchAgentH,
41783
+ switch_agent: (ctx) => withTurnMarker(() => switchAgentH(ctx)),
41717
41784
  change_model: changeModelH,
41718
41785
  summarize: summarizeH,
41719
41786
  session_terminated: sessionShutdownH,
@@ -42825,17 +42892,17 @@ async function runAcpSession(opts) {
42825
42892
  switchCredentialEnv = provisionAgentCredentials(agentId, auth);
42826
42893
  },
42827
42894
  provisionHouseProxy: ({ baseUrl, token, model, managedAgentId }) => {
42828
- const claudeConfigDir = path82.join(
42829
- os55.homedir(),
42895
+ const claudeConfigDir = path83.join(
42896
+ os56.homedir(),
42830
42897
  ".codeam",
42831
42898
  "house-claude",
42832
42899
  `switch-${opts.pluginId}`
42833
42900
  );
42834
42901
  try {
42835
- fs71.mkdirSync(claudeConfigDir, { recursive: true, mode: 448 });
42902
+ fs72.mkdirSync(claudeConfigDir, { recursive: true, mode: 448 });
42836
42903
  } catch {
42837
42904
  }
42838
- const memoryFile = path82.join(claudeConfigDir, "CLAUDE.md");
42905
+ const memoryFile = path83.join(claudeConfigDir, "CLAUDE.md");
42839
42906
  ensureBeadsWorkflowHint(void 0, memoryFile);
42840
42907
  ensureAgentStandard(void 0, memoryFile);
42841
42908
  const cfg = {
@@ -42858,6 +42925,11 @@ async function runAcpSession(opts) {
42858
42925
  relay.reannounceAgents();
42859
42926
  }
42860
42927
  };
42928
+ relay.setLinkedAgentIdProvider(() => {
42929
+ if (houseActive) return isManagedProviderId(houseWireId) ? houseWireId : null;
42930
+ return internalToPublic(opts.agent);
42931
+ });
42932
+ relay.reannounceAgents();
42861
42933
  const switchAgentForSession = async (rawAgentId) => {
42862
42934
  const result = await performAgentSwitch(switchDeps, rawAgentId);
42863
42935
  if (result.ok) refreshSquadRoster();
@@ -44058,9 +44130,9 @@ function pickPinnedSession(pinnedId, listSessions2) {
44058
44130
  }
44059
44131
 
44060
44132
  // src/agents/retired-proxy-cleanup.ts
44061
- var fs72 = __toESM(require("fs"));
44062
- var path83 = __toESM(require("path"));
44063
- var os56 = __toESM(require("os"));
44133
+ var fs73 = __toESM(require("fs"));
44134
+ var path84 = __toESM(require("path"));
44135
+ var os57 = __toESM(require("os"));
44064
44136
  var RETIRED_PROXY_RE = /^https?:\/\/(?:127\.0\.0\.1|localhost|\[::1\]):8787(?:[/?#]|$)/i;
44065
44137
  var HEADROOM_CMD_RE = /(^|[\s/"'])headroom(\s|$)/i;
44066
44138
  var MARKETPLACE_KEY = "headroom-marketplace";
@@ -44069,12 +44141,12 @@ function isHeadroomHook(group) {
44069
44141
  (h) => typeof h?.command === "string" && HEADROOM_CMD_RE.test(h.command)
44070
44142
  );
44071
44143
  }
44072
- function sanitizeRetiredProxyConfig(homeDir2 = os56.homedir()) {
44144
+ function sanitizeRetiredProxyConfig(homeDir2 = os57.homedir()) {
44073
44145
  const out2 = { inspected: false, changed: false, removed: [] };
44074
- const file = path83.join(homeDir2, ".claude", "settings.json");
44146
+ const file = path84.join(homeDir2, ".claude", "settings.json");
44075
44147
  let parsed;
44076
44148
  try {
44077
- parsed = JSON.parse(fs72.readFileSync(file, "utf8"));
44149
+ parsed = JSON.parse(fs73.readFileSync(file, "utf8"));
44078
44150
  } catch {
44079
44151
  return out2;
44080
44152
  }
@@ -44116,9 +44188,9 @@ function sanitizeRetiredProxyConfig(homeDir2 = os56.homedir()) {
44116
44188
  if (!out2.changed) return out2;
44117
44189
  try {
44118
44190
  const tmp = `${file}.codeam.tmp`;
44119
- fs72.writeFileSync(tmp, `${JSON.stringify(parsed, null, 2)}
44191
+ fs73.writeFileSync(tmp, `${JSON.stringify(parsed, null, 2)}
44120
44192
  `, { mode: 384 });
44121
- fs72.renameSync(tmp, file);
44193
+ fs73.renameSync(tmp, file);
44122
44194
  } catch {
44123
44195
  out2.changed = false;
44124
44196
  }
@@ -44650,7 +44722,7 @@ var AcpDriver = class {
44650
44722
  };
44651
44723
 
44652
44724
  // src/baton/transcript-mirror.ts
44653
- var fs73 = __toESM(require("fs"));
44725
+ var fs74 = __toESM(require("fs"));
44654
44726
  var TranscriptMirror = class {
44655
44727
  constructor(deps) {
44656
44728
  this.deps = deps;
@@ -44744,7 +44816,7 @@ var TranscriptMirror = class {
44744
44816
  }
44745
44817
  };
44746
44818
  function defaultWatch(file, onChange) {
44747
- const w3 = fs73.watch(file, { persistent: false }, () => onChange());
44819
+ const w3 = fs74.watch(file, { persistent: false }, () => onChange());
44748
44820
  return () => w3.close();
44749
44821
  }
44750
44822
 
@@ -45090,16 +45162,16 @@ function keepDeviceAwake(deps = {}) {
45090
45162
  }
45091
45163
 
45092
45164
  // src/agents/claude/onboarding.ts
45093
- var fs74 = __toESM(require("fs"));
45094
- var os58 = __toESM(require("os"));
45095
- var path84 = __toESM(require("path"));
45165
+ var fs75 = __toESM(require("fs"));
45166
+ var os59 = __toESM(require("os"));
45167
+ var path85 = __toESM(require("path"));
45096
45168
  var ONBOARDING_VERSION_SENTINEL = "9999.0.0";
45097
45169
  function ensureClaudeOnboarded(cwd) {
45098
45170
  try {
45099
- const file = path84.join(os58.homedir(), ".claude.json");
45171
+ const file = path85.join(os59.homedir(), ".claude.json");
45100
45172
  let config = {};
45101
45173
  try {
45102
- config = JSON.parse(fs74.readFileSync(file, "utf8"));
45174
+ config = JSON.parse(fs75.readFileSync(file, "utf8"));
45103
45175
  } catch {
45104
45176
  }
45105
45177
  let changed = false;
@@ -45124,8 +45196,8 @@ function ensureClaudeOnboarded(cwd) {
45124
45196
  }
45125
45197
  }
45126
45198
  if (!changed) return;
45127
- fs74.mkdirSync(path84.dirname(file), { recursive: true });
45128
- fs74.writeFileSync(file, JSON.stringify(config, null, 2));
45199
+ fs75.mkdirSync(path85.dirname(file), { recursive: true });
45200
+ fs75.writeFileSync(file, JSON.stringify(config, null, 2));
45129
45201
  log.info(
45130
45202
  "claude",
45131
45203
  `pre-completed Claude onboarding${cwd ? ` + trusted workspace ${cwd}` : ""}`
@@ -45902,7 +45974,7 @@ var import_picocolors10 = __toESM(require("picocolors"));
45902
45974
  var import_child_process30 = require("child_process");
45903
45975
  var import_util4 = require("util");
45904
45976
  var import_picocolors8 = __toESM(require("picocolors"));
45905
- var path85 = __toESM(require("path"));
45977
+ var path86 = __toESM(require("path"));
45906
45978
  var execFileP6 = (0, import_util4.promisify)(import_child_process30.execFile);
45907
45979
  var MAX_BUFFER = 8 * 1024 * 1024;
45908
45980
  function resetStdinForChild() {
@@ -46391,7 +46463,7 @@ var GitHubCodespacesProvider = class {
46391
46463
  });
46392
46464
  }
46393
46465
  async uploadFile(workspaceId, remotePath, contents, options = {}) {
46394
- const remoteDir = path85.posix.dirname(remotePath);
46466
+ const remoteDir = path86.posix.dirname(remotePath);
46395
46467
  const parts = [
46396
46468
  `mkdir -p ${shellQuote(remoteDir)}`,
46397
46469
  `cat > ${shellQuote(remotePath)}`
@@ -46461,7 +46533,7 @@ function shellQuote(s) {
46461
46533
  // src/services/providers/gitpod.ts
46462
46534
  var import_child_process31 = require("child_process");
46463
46535
  var import_util5 = require("util");
46464
- var path86 = __toESM(require("path"));
46536
+ var path87 = __toESM(require("path"));
46465
46537
  var import_picocolors9 = __toESM(require("picocolors"));
46466
46538
  var execFileP7 = (0, import_util5.promisify)(import_child_process31.execFile);
46467
46539
  var MAX_BUFFER2 = 8 * 1024 * 1024;
@@ -46701,7 +46773,7 @@ var GitpodProvider = class {
46701
46773
  });
46702
46774
  }
46703
46775
  async uploadFile(workspaceId, remotePath, contents, options = {}) {
46704
- const remoteDir = path86.posix.dirname(remotePath);
46776
+ const remoteDir = path87.posix.dirname(remotePath);
46705
46777
  const parts = [
46706
46778
  `mkdir -p ${shellQuote2(remoteDir)}`,
46707
46779
  `cat > ${shellQuote2(remotePath)}`
@@ -46737,7 +46809,7 @@ function shellQuote2(s) {
46737
46809
  // src/services/providers/gitlab-workspaces.ts
46738
46810
  var import_child_process32 = require("child_process");
46739
46811
  var import_util6 = require("util");
46740
- var path87 = __toESM(require("path"));
46812
+ var path88 = __toESM(require("path"));
46741
46813
  var execFileP8 = (0, import_util6.promisify)(import_child_process32.execFile);
46742
46814
  var MAX_BUFFER3 = 8 * 1024 * 1024;
46743
46815
  var GITLAB_API_BASE = process.env.CODEAM_GITLAB_API_URL ?? "https://gitlab.com/api/v4";
@@ -46997,7 +47069,7 @@ Docs: https://docs.gitlab.com/ee/user/workspace/configuration.html`
46997
47069
  }
46998
47070
  async uploadFile(workspaceId, remotePath, contents, options = {}) {
46999
47071
  const sshHost = process.env.CODEAM_GITLAB_SSH_HOST ?? "workspaces.gitlab.com";
47000
- const remoteDir = path87.posix.dirname(remotePath);
47072
+ const remoteDir = path88.posix.dirname(remotePath);
47001
47073
  const parts = [`mkdir -p ${shellQuote3(remoteDir)}`, `cat > ${shellQuote3(remotePath)}`];
47002
47074
  if (options.mode != null) {
47003
47075
  parts.push(`chmod ${options.mode.toString(8)} ${shellQuote3(remotePath)}`);
@@ -47065,7 +47137,7 @@ function shellQuote3(s) {
47065
47137
  // src/services/providers/railway.ts
47066
47138
  var import_child_process33 = require("child_process");
47067
47139
  var import_util7 = require("util");
47068
- var path88 = __toESM(require("path"));
47140
+ var path89 = __toESM(require("path"));
47069
47141
  var execFileP9 = (0, import_util7.promisify)(import_child_process33.execFile);
47070
47142
  var MAX_BUFFER4 = 8 * 1024 * 1024;
47071
47143
  function resetStdinForChild4() {
@@ -47301,7 +47373,7 @@ var RailwayProvider = class {
47301
47373
  if (!projectId || !serviceId) {
47302
47374
  throw new Error("Invalid Railway workspace id (expected projectId/serviceId).");
47303
47375
  }
47304
- const remoteDir = path88.posix.dirname(remotePath);
47376
+ const remoteDir = path89.posix.dirname(remotePath);
47305
47377
  const parts = [`mkdir -p ${shellQuote4(remoteDir)}`, `cat > ${shellQuote4(remotePath)}`];
47306
47378
  if (options.mode != null) {
47307
47379
  parts.push(`chmod ${options.mode.toString(8)} ${shellQuote4(remotePath)}`);
@@ -47841,34 +47913,35 @@ async function stopWorkspaceFromLocal(target) {
47841
47913
  }
47842
47914
 
47843
47915
  // src/commands/host/host-client.ts
47844
- var fs75 = __toESM(require("fs"));
47845
- var os59 = __toESM(require("os"));
47846
- var path89 = __toESM(require("path"));
47916
+ var fs76 = __toESM(require("fs"));
47917
+ var os60 = __toESM(require("os"));
47918
+ var path90 = __toESM(require("path"));
47847
47919
  var import_node_crypto12 = require("crypto");
47848
47920
  function sampleCpuTimes() {
47849
47921
  let idle = 0;
47850
47922
  let total = 0;
47851
- for (const cpu of os59.cpus()) {
47923
+ for (const cpu of os60.cpus()) {
47852
47924
  const t2 = cpu.times;
47853
47925
  idle += t2.idle;
47854
47926
  total += t2.user + t2.nice + t2.sys + t2.idle + t2.irq;
47855
47927
  }
47856
47928
  return { idle, total };
47857
47929
  }
47930
+ var MAX_REPORTED_LATENCY_MS = 6e4;
47858
47931
  var MetricsCollector = class {
47859
47932
  prevCpu = null;
47860
47933
  lastLatencyMs = 0;
47861
47934
  /** Record the measured round-trip of the heartbeat just sent. */
47862
47935
  recordLatency(latencyMs) {
47863
- this.lastLatencyMs = Math.max(0, Math.round(latencyMs));
47936
+ this.lastLatencyMs = Math.min(MAX_REPORTED_LATENCY_MS, Math.max(0, Math.round(latencyMs)));
47864
47937
  }
47865
47938
  cpuPct() {
47866
47939
  const current2 = sampleCpuTimes();
47867
47940
  const prev = this.prevCpu;
47868
47941
  this.prevCpu = current2;
47869
47942
  if (!prev) {
47870
- const cores = os59.cpus().length || 1;
47871
- const proxy = os59.loadavg()[0] / cores * 100;
47943
+ const cores = os60.cpus().length || 1;
47944
+ const proxy = os60.loadavg()[0] / cores * 100;
47872
47945
  return Math.min(100, Math.max(0, Math.round(proxy)));
47873
47946
  }
47874
47947
  const idleDelta = current2.idle - prev.idle;
@@ -47881,8 +47954,8 @@ var MetricsCollector = class {
47881
47954
  collect() {
47882
47955
  return {
47883
47956
  cpuPct: this.cpuPct(),
47884
- ramUsedMb: Math.round((os59.totalmem() - os59.freemem()) / 1048576),
47885
- ramTotalMb: Math.round(os59.totalmem() / 1048576),
47957
+ ramUsedMb: Math.round((os60.totalmem() - os60.freemem()) / 1048576),
47958
+ ramTotalMb: Math.round(os60.totalmem() / 1048576),
47886
47959
  latencyMs: this.lastLatencyMs
47887
47960
  };
47888
47961
  }
@@ -47891,19 +47964,19 @@ function apiBase() {
47891
47964
  return process.env.CODEAM_API_URL ?? resolveApiBaseUrl();
47892
47965
  }
47893
47966
  function hostIdentityPath() {
47894
- return path89.join(os59.homedir(), ".codeam", "host-agent.json");
47967
+ return path90.join(os60.homedir(), ".codeam", "host-agent.json");
47895
47968
  }
47896
47969
  function collectOsInfo() {
47897
47970
  return {
47898
- distro: os59.platform(),
47899
- arch: os59.arch(),
47900
- kernel: os59.release(),
47971
+ distro: os60.platform(),
47972
+ arch: os60.arch(),
47973
+ kernel: os60.release(),
47901
47974
  nodeVersion: process.versions.node
47902
47975
  };
47903
47976
  }
47904
47977
  function loadHostIdentity() {
47905
47978
  try {
47906
- const raw = fs75.readFileSync(hostIdentityPath(), "utf8");
47979
+ const raw = fs76.readFileSync(hostIdentityPath(), "utf8");
47907
47980
  const parsed = JSON.parse(raw);
47908
47981
  if (typeof parsed === "object" && parsed !== null && typeof parsed.hostId === "string" && typeof parsed.hostToken === "string" && typeof parsed.controlPluginId === "string") {
47909
47982
  const p2 = parsed;
@@ -47931,8 +48004,8 @@ function ensureControlPollSecret(identity, save = saveHostIdentity) {
47931
48004
  }
47932
48005
  function saveHostIdentity(identity) {
47933
48006
  const file = hostIdentityPath();
47934
- fs75.mkdirSync(path89.dirname(file), { recursive: true, mode: 448 });
47935
- fs75.writeFileSync(file, JSON.stringify(identity, null, 2), {
48007
+ fs76.mkdirSync(path90.dirname(file), { recursive: true, mode: 448 });
48008
+ fs76.writeFileSync(file, JSON.stringify(identity, null, 2), {
47936
48009
  encoding: "utf8",
47937
48010
  mode: 384
47938
48011
  });
@@ -47977,7 +48050,7 @@ function isTerminalEnrollError(err) {
47977
48050
  }
47978
48051
  function deleteHostIdentity() {
47979
48052
  try {
47980
- fs75.rmSync(hostIdentityPath(), { force: true });
48053
+ fs76.rmSync(hostIdentityPath(), { force: true });
47981
48054
  } catch {
47982
48055
  }
47983
48056
  }
@@ -48001,7 +48074,7 @@ async function postJson(pathname, body) {
48001
48074
  function resolveHostLabel(label) {
48002
48075
  const explicit = label?.trim();
48003
48076
  const envLabel = process.env.CODEAM_HOST_LABEL?.trim();
48004
- const resolved = explicit || envLabel || os59.hostname();
48077
+ const resolved = explicit || envLabel || os60.hostname();
48005
48078
  return resolved.slice(0, 80);
48006
48079
  }
48007
48080
  async function redeemEnrollToken(token, label) {
@@ -48194,9 +48267,9 @@ async function host(args2) {
48194
48267
 
48195
48268
  // src/commands/host-agent.ts
48196
48269
  var import_node_child_process30 = require("child_process");
48197
- var os63 = __toESM(require("os"));
48198
- var fs79 = __toESM(require("fs"));
48199
- var path93 = __toESM(require("path"));
48270
+ var os64 = __toESM(require("os"));
48271
+ var fs80 = __toESM(require("fs"));
48272
+ var path94 = __toESM(require("path"));
48200
48273
 
48201
48274
  // src/skills/persist-from-payload.ts
48202
48275
  function persistOrClearSkillsFromPayload(skills) {
@@ -48205,13 +48278,13 @@ function persistOrClearSkillsFromPayload(skills) {
48205
48278
  }
48206
48279
 
48207
48280
  // src/commands/host/session-state.ts
48208
- var fs76 = __toESM(require("fs"));
48209
- var os60 = __toESM(require("os"));
48210
- var path90 = __toESM(require("path"));
48281
+ var fs77 = __toESM(require("fs"));
48282
+ var os61 = __toESM(require("os"));
48283
+ var path91 = __toESM(require("path"));
48211
48284
  function hostSessionStatePath(env = process.env) {
48212
48285
  const override = env.CODEAM_HOST_SESSION_STATE_FILE;
48213
48286
  if (override && override.trim()) return override.trim();
48214
- return path90.join(os60.homedir(), ".codeam", "host-agent-sessions.json");
48287
+ return path91.join(os61.homedir(), ".codeam", "host-agent-sessions.json");
48215
48288
  }
48216
48289
  function isRecord5(v) {
48217
48290
  if (typeof v !== "object" || v === null) return false;
@@ -48222,7 +48295,7 @@ function fileSessionChildStore(file = hostSessionStatePath()) {
48222
48295
  return {
48223
48296
  load() {
48224
48297
  try {
48225
- const raw = JSON.parse(fs76.readFileSync(file, "utf8"));
48298
+ const raw = JSON.parse(fs77.readFileSync(file, "utf8"));
48226
48299
  return Array.isArray(raw?.sessions) ? raw.sessions.filter(isRecord5) : [];
48227
48300
  } catch {
48228
48301
  return [];
@@ -48230,18 +48303,18 @@ function fileSessionChildStore(file = hostSessionStatePath()) {
48230
48303
  },
48231
48304
  save(list) {
48232
48305
  try {
48233
- fs76.mkdirSync(path90.dirname(file), { recursive: true, mode: 448 });
48306
+ fs77.mkdirSync(path91.dirname(file), { recursive: true, mode: 448 });
48234
48307
  const tmp = `${file}.${process.pid}.tmp`;
48235
- fs76.writeFileSync(tmp, JSON.stringify({ version: 1, sessions: list }, null, 2), {
48308
+ fs77.writeFileSync(tmp, JSON.stringify({ version: 1, sessions: list }, null, 2), {
48236
48309
  mode: 384
48237
48310
  });
48238
- fs76.renameSync(tmp, file);
48311
+ fs77.renameSync(tmp, file);
48239
48312
  } catch {
48240
48313
  }
48241
48314
  },
48242
48315
  clear() {
48243
48316
  try {
48244
- fs76.rmSync(file, { force: true });
48317
+ fs77.rmSync(file, { force: true });
48245
48318
  } catch {
48246
48319
  }
48247
48320
  }
@@ -48264,10 +48337,10 @@ function planSessionResume(records, max) {
48264
48337
  return { resume: ordered.slice(0, bound), dropped: ordered.slice(bound) };
48265
48338
  }
48266
48339
  function pickSavedSessionForWorkspace(sessions3, cwd, deployId) {
48267
- const target = path90.resolve(cwd);
48340
+ const target = path91.resolve(cwd);
48268
48341
  const reconnectable = (s) => !!s.pluginId && !!s.pollSecret && !!s.agent;
48269
48342
  const matches = sessions3.filter(
48270
- (s) => !!s.cwd && path90.resolve(s.cwd) === target && reconnectable(s)
48343
+ (s) => !!s.cwd && path91.resolve(s.cwd) === target && reconnectable(s)
48271
48344
  );
48272
48345
  if (matches.length > 0) {
48273
48346
  matches.sort((a, b) => b.pairedAt - a.pairedAt);
@@ -48279,11 +48352,11 @@ function pickSavedSessionForWorkspace(sessions3, cwd, deployId) {
48279
48352
 
48280
48353
  // src/commands/host/git-tooling.ts
48281
48354
  var import_node_child_process26 = require("child_process");
48282
- var fs77 = __toESM(require("fs"));
48283
- var os61 = __toESM(require("os"));
48284
- var path91 = __toESM(require("path"));
48355
+ var fs78 = __toESM(require("fs"));
48356
+ var os62 = __toESM(require("os"));
48357
+ var path92 = __toESM(require("path"));
48285
48358
  function codeamBinDir() {
48286
- return process.env.CODEAM_BIN_DIR ?? path91.join(os61.homedir(), ".codeam", "bin");
48359
+ return process.env.CODEAM_BIN_DIR ?? path92.join(os62.homedir(), ".codeam", "bin");
48287
48360
  }
48288
48361
  var FALLBACK_GH_VERSION = "2.62.0";
48289
48362
  var RELEASE_API = "https://api.github.com/repos/cli/cli/releases/latest";
@@ -48315,7 +48388,7 @@ async function download(url2, dest) {
48315
48388
  const res = await fetch(url2, { headers: { "User-Agent": "codeam-cli" } });
48316
48389
  if (!res.ok || !res.body) return false;
48317
48390
  const buf = Buffer.from(await res.arrayBuffer());
48318
- fs77.writeFileSync(dest, buf);
48391
+ fs78.writeFileSync(dest, buf);
48319
48392
  return true;
48320
48393
  } catch {
48321
48394
  return false;
@@ -48338,8 +48411,8 @@ async function ensureGhCli(runner, token, deps = {}) {
48338
48411
  const version3 = await resolveVersionFn(token);
48339
48412
  const asset = `gh_${version3}_${osToken}_${arch2}`;
48340
48413
  const url2 = `https://github.com/cli/cli/releases/download/v${version3}/${asset}.${ext}`;
48341
- const tmpRoot = fs77.mkdtempSync(path91.join(os61.tmpdir(), "codeam-gh-"));
48342
- const archive = path91.join(tmpRoot, `${asset}.${ext}`);
48414
+ const tmpRoot = fs78.mkdtempSync(path92.join(os62.tmpdir(), "codeam-gh-"));
48415
+ const archive = path92.join(tmpRoot, `${asset}.${ext}`);
48343
48416
  if (!await downloadFn(url2, archive)) {
48344
48417
  log.warn("host-agent", "gh download failed \u2014 skipping (git pull/push still work via the credential helper)");
48345
48418
  return null;
@@ -48349,16 +48422,16 @@ async function ensureGhCli(runner, token, deps = {}) {
48349
48422
  log.warn("host-agent", `gh archive extraction failed (code=${String(extract.code)}) \u2014 skipping`);
48350
48423
  return null;
48351
48424
  }
48352
- const extractedBin = path91.join(tmpRoot, asset, "bin", binaryName);
48353
- if (!fs77.existsSync(extractedBin)) {
48425
+ const extractedBin = path92.join(tmpRoot, asset, "bin", binaryName);
48426
+ if (!fs78.existsSync(extractedBin)) {
48354
48427
  log.warn("host-agent", "gh binary not found in the extracted archive \u2014 skipping");
48355
48428
  return null;
48356
48429
  }
48357
48430
  const binDir = codeamBinDir();
48358
- fs77.mkdirSync(binDir, { recursive: true });
48359
- const target = path91.join(binDir, binaryName);
48360
- fs77.copyFileSync(extractedBin, target);
48361
- fs77.chmodSync(target, 493);
48431
+ fs78.mkdirSync(binDir, { recursive: true });
48432
+ const target = path92.join(binDir, binaryName);
48433
+ fs78.copyFileSync(extractedBin, target);
48434
+ fs78.chmodSync(target, 493);
48362
48435
  log.info("host-agent", `gh installed to ${target} (v${version3})`);
48363
48436
  return target;
48364
48437
  } catch (e) {
@@ -48395,19 +48468,19 @@ async function ensureGhAuth(runner, ghCmd, token) {
48395
48468
  }
48396
48469
  function ghConfigDir() {
48397
48470
  if (process.env.GH_CONFIG_DIR) return process.env.GH_CONFIG_DIR;
48398
- if (process.env.XDG_CONFIG_HOME) return path91.join(process.env.XDG_CONFIG_HOME, "gh");
48471
+ if (process.env.XDG_CONFIG_HOME) return path92.join(process.env.XDG_CONFIG_HOME, "gh");
48399
48472
  if (process.platform === "win32" && process.env.APPDATA) {
48400
- return path91.join(process.env.APPDATA, "GitHub CLI");
48473
+ return path92.join(process.env.APPDATA, "GitHub CLI");
48401
48474
  }
48402
- return path91.join(os61.homedir(), ".config", "gh");
48475
+ return path92.join(os62.homedir(), ".config", "gh");
48403
48476
  }
48404
48477
  function writeGhHostsToken(token) {
48405
48478
  try {
48406
48479
  const dir = ghConfigDir();
48407
- const file = path91.join(dir, "hosts.yml");
48408
- if (fs77.existsSync(file)) return false;
48409
- fs77.mkdirSync(dir, { recursive: true, mode: 448 });
48410
- fs77.writeFileSync(
48480
+ const file = path92.join(dir, "hosts.yml");
48481
+ if (fs78.existsSync(file)) return false;
48482
+ fs78.mkdirSync(dir, { recursive: true, mode: 448 });
48483
+ fs78.writeFileSync(
48411
48484
  file,
48412
48485
  `github.com:
48413
48486
  oauth_token: ${token}
@@ -48450,8 +48523,8 @@ async function ensureGlabCli(runner, deps = {}) {
48450
48523
  const version3 = await resolveLatestGlabVersion();
48451
48524
  const asset = `glab_${version3}_${osToken}_${arch2}`;
48452
48525
  const url2 = `https://gitlab.com/gitlab-org/cli/-/releases/v${version3}/downloads/${asset}.${ext}`;
48453
- const tmpRoot = fs77.mkdtempSync(path91.join(os61.tmpdir(), "codeam-glab-"));
48454
- const archive = path91.join(tmpRoot, `${asset}.${ext}`);
48526
+ const tmpRoot = fs78.mkdtempSync(path92.join(os62.tmpdir(), "codeam-glab-"));
48527
+ const archive = path92.join(tmpRoot, `${asset}.${ext}`);
48455
48528
  if (!await downloadFn(url2, archive)) {
48456
48529
  log.warn("host-agent", "glab download failed \u2014 skipping (git push/pull still work)");
48457
48530
  return null;
@@ -48462,20 +48535,20 @@ async function ensureGlabCli(runner, deps = {}) {
48462
48535
  return null;
48463
48536
  }
48464
48537
  const candidates = [
48465
- path91.join(tmpRoot, "bin", binaryName),
48466
- path91.join(tmpRoot, asset, "bin", binaryName),
48467
- path91.join(tmpRoot, binaryName)
48538
+ path92.join(tmpRoot, "bin", binaryName),
48539
+ path92.join(tmpRoot, asset, "bin", binaryName),
48540
+ path92.join(tmpRoot, binaryName)
48468
48541
  ];
48469
- const extractedBin = candidates.find((c2) => fs77.existsSync(c2));
48542
+ const extractedBin = candidates.find((c2) => fs78.existsSync(c2));
48470
48543
  if (!extractedBin) {
48471
48544
  log.warn("host-agent", "glab binary not found in the extracted archive \u2014 skipping");
48472
48545
  return null;
48473
48546
  }
48474
48547
  const binDir = codeamBinDir();
48475
- fs77.mkdirSync(binDir, { recursive: true });
48476
- const target = path91.join(binDir, binaryName);
48477
- fs77.copyFileSync(extractedBin, target);
48478
- fs77.chmodSync(target, 493);
48548
+ fs78.mkdirSync(binDir, { recursive: true });
48549
+ const target = path92.join(binDir, binaryName);
48550
+ fs78.copyFileSync(extractedBin, target);
48551
+ fs78.chmodSync(target, 493);
48479
48552
  log.info("host-agent", `glab installed to ${target} (v${version3})`);
48480
48553
  return target;
48481
48554
  } catch (e) {
@@ -48557,9 +48630,9 @@ var defaultGitToolingRunner = {
48557
48630
  var import_node_child_process28 = require("child_process");
48558
48631
 
48559
48632
  // src/lib/updateNotifier.ts
48560
- var fs78 = __toESM(require("fs"));
48561
- var os62 = __toESM(require("os"));
48562
- var path92 = __toESM(require("path"));
48633
+ var fs79 = __toESM(require("fs"));
48634
+ var os63 = __toESM(require("os"));
48635
+ var path93 = __toESM(require("path"));
48563
48636
  var https8 = __toESM(require("https"));
48564
48637
  var import_node_child_process27 = require("child_process");
48565
48638
  var import_picocolors12 = __toESM(require("picocolors"));
@@ -48568,12 +48641,12 @@ var REGISTRY_URL = `https://registry.npmjs.org/${PKG_NAME}/latest`;
48568
48641
  var TTL_MS = 24 * 60 * 60 * 1e3;
48569
48642
  var REQUEST_TIMEOUT_MS = 1500;
48570
48643
  function cachePath() {
48571
- const dir = path92.join(os62.homedir(), ".codeam");
48572
- return path92.join(dir, "update-check.json");
48644
+ const dir = path93.join(os63.homedir(), ".codeam");
48645
+ return path93.join(dir, "update-check.json");
48573
48646
  }
48574
48647
  function readCache() {
48575
48648
  try {
48576
- const raw = fs78.readFileSync(cachePath(), "utf8");
48649
+ const raw = fs79.readFileSync(cachePath(), "utf8");
48577
48650
  const parsed = JSON.parse(raw);
48578
48651
  if (typeof parsed.fetchedAt !== "number" || typeof parsed.latest !== "string") return null;
48579
48652
  return parsed;
@@ -48584,10 +48657,10 @@ function readCache() {
48584
48657
  function writeCache(cache) {
48585
48658
  try {
48586
48659
  const file = cachePath();
48587
- fs78.mkdirSync(path92.dirname(file), { recursive: true });
48660
+ fs79.mkdirSync(path93.dirname(file), { recursive: true });
48588
48661
  const tmp = `${file}.${process.pid}.tmp`;
48589
- fs78.writeFileSync(tmp, JSON.stringify(cache));
48590
- fs78.renameSync(tmp, file);
48662
+ fs79.writeFileSync(tmp, JSON.stringify(cache));
48663
+ fs79.renameSync(tmp, file);
48591
48664
  } catch {
48592
48665
  }
48593
48666
  }
@@ -48661,8 +48734,8 @@ function isLinkedInstall() {
48661
48734
  timeout: 2e3
48662
48735
  }).trim();
48663
48736
  if (!root) return false;
48664
- const pkgPath = path92.join(root, PKG_NAME);
48665
- return fs78.lstatSync(pkgPath).isSymbolicLink();
48737
+ const pkgPath = path93.join(root, PKG_NAME);
48738
+ return fs79.lstatSync(pkgPath).isSymbolicLink();
48666
48739
  } catch {
48667
48740
  return false;
48668
48741
  }
@@ -48698,7 +48771,7 @@ function maybeAutoUpdate(currentVersion, latest) {
48698
48771
  return;
48699
48772
  }
48700
48773
  try {
48701
- fs78.unlinkSync(cachePath());
48774
+ fs79.unlinkSync(cachePath());
48702
48775
  } catch {
48703
48776
  }
48704
48777
  process.stderr.write(` ${import_picocolors12.default.green("\u2713")} Updated. Resuming session...
@@ -48714,7 +48787,7 @@ async function autoUpgradeBeforeCriticalCommand() {
48714
48787
  if (process.env.NODE_ENV === "test") return;
48715
48788
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
48716
48789
  if (process.env.CI) return;
48717
- const current2 = true ? "2.75.34" : null;
48790
+ const current2 = true ? "2.75.36" : null;
48718
48791
  if (!current2) return;
48719
48792
  const cache = readCache();
48720
48793
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
@@ -48731,7 +48804,7 @@ function checkForUpdates() {
48731
48804
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
48732
48805
  if (process.env.CI) return;
48733
48806
  if (!process.stdout.isTTY) return;
48734
- const current2 = true ? "2.75.34" : null;
48807
+ const current2 = true ? "2.75.36" : null;
48735
48808
  if (!current2) return;
48736
48809
  const cache = readCache();
48737
48810
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
@@ -48754,7 +48827,7 @@ var SELF_UPDATE_INSTALL_TIMEOUT_MS = 18e4;
48754
48827
  var SELF_UPDATE_LS_TIMEOUT_MS = 15e3;
48755
48828
  var SUDO_PREFLIGHT_TIMEOUT_MS = 5e3;
48756
48829
  function currentCliVersion() {
48757
- return true ? "2.75.34" : null;
48830
+ return true ? "2.75.36" : null;
48758
48831
  }
48759
48832
  async function installedVersion(deps) {
48760
48833
  const ls = await deps.run(
@@ -49113,6 +49186,7 @@ var HostAgentSupervisor = class {
49113
49186
  this.selfUpdate = deps.selfUpdate ?? runSelfUpdate;
49114
49187
  this.now = deps.now ?? (() => Date.now());
49115
49188
  this.onUpdated = deps.onUpdated ?? defaultOnUpdated;
49189
+ this.isChildMidTurn = deps.isChildMidTurn ?? ((pid) => isProcessMidTurn(pid));
49116
49190
  this.docker = deps.docker ?? defaultDockerRunner;
49117
49191
  this.postResumeFailure = deps.postResumeFailure ?? postSessionErrorBubble;
49118
49192
  }
@@ -49129,6 +49203,7 @@ var HostAgentSupervisor = class {
49129
49203
  /** Self-update check + install (injectable; defaults to runSelfUpdate). */
49130
49204
  selfUpdate;
49131
49205
  now;
49206
+ isChildMidTurn;
49132
49207
  /** Restart action after a successful self-update (defaults to process.exit). */
49133
49208
  onUpdated;
49134
49209
  /** Guards against overlapping self-update ticks (a slow npm install). */
@@ -49332,19 +49407,20 @@ var HostAgentSupervisor = class {
49332
49407
  * idle tick) rather than yank an active turn.
49333
49408
  */
49334
49409
  maybeRestartForUpdate(version3) {
49335
- if (this.children.size > 0) {
49410
+ const midTurn = [...this.children.values()].some((c2) => this.isChildMidTurn(c2.proc.pid));
49411
+ if (midTurn) {
49336
49412
  const since = this.pendingRestartSince ?? this.now();
49337
49413
  const waited = this.now() - since;
49338
49414
  if (waited < SELF_UPDATE_DEFER_MAX_MS) {
49339
49415
  log.info(
49340
49416
  "host-agent",
49341
- `self-update: ${version3} installed but ${this.children.size} child(ren) busy \u2014 deferring restart`
49417
+ `self-update: ${version3} installed but a session is mid-turn \u2014 deferring restart`
49342
49418
  );
49343
49419
  return false;
49344
49420
  }
49345
49421
  log.warn(
49346
49422
  "host-agent",
49347
- `self-update: ${version3} has been owed for ${Math.round(waited / 36e5)}h with ${this.children.size} child(ren) still running \u2014 restarting anyway rather than staying on old code`
49423
+ `self-update: ${version3} has been owed for ${Math.round(waited / 36e5)}h with a session still mid-turn \u2014 restarting anyway rather than staying on old code`
49348
49424
  );
49349
49425
  }
49350
49426
  this.onUpdated(version3);
@@ -49495,13 +49571,13 @@ var HostAgentSupervisor = class {
49495
49571
  const relay = this.relay;
49496
49572
  if (!relay) return;
49497
49573
  const raw = cmd.payload?.path;
49498
- const target = typeof raw === "string" && raw.trim() ? path93.resolve(raw.trim()) : os63.homedir();
49574
+ const target = typeof raw === "string" && raw.trim() ? path94.resolve(raw.trim()) : os64.homedir();
49499
49575
  try {
49500
- const dirents = await fs79.promises.readdir(target, { withFileTypes: true });
49576
+ const dirents = await fs80.promises.readdir(target, { withFileTypes: true });
49501
49577
  const entries = dirents.filter((d3) => !d3.name.startsWith(".")).map((d3) => ({ name: d3.name, isDir: d3.isDirectory() })).sort(
49502
49578
  (a, b) => a.isDir === b.isDir ? a.name.localeCompare(b.name) : a.isDir ? -1 : 1
49503
49579
  );
49504
- const parent = path93.dirname(target);
49580
+ const parent = path94.dirname(target);
49505
49581
  await relay.sendResult(cmd.id, "completed", {
49506
49582
  path: target,
49507
49583
  // null at the filesystem root so the UI can hide the ".." affordance.
@@ -49848,14 +49924,14 @@ var HostAgentSupervisor = class {
49848
49924
  ...buildHouseProxyChildEnv({ baseUrl, token, openRouter: openRouter === true }),
49849
49925
  CODEAM_AUTO_TOKEN: payload.autoPairToken
49850
49926
  };
49851
- const houseConfigDir = path93.join(
49852
- os63.homedir(),
49927
+ const houseConfigDir = path94.join(
49928
+ os64.homedir(),
49853
49929
  ".codeam",
49854
49930
  "house-claude",
49855
49931
  payload.deployId
49856
49932
  );
49857
49933
  try {
49858
- fs79.mkdirSync(houseConfigDir, { recursive: true, mode: 448 });
49934
+ fs80.mkdirSync(houseConfigDir, { recursive: true, mode: 448 });
49859
49935
  } catch {
49860
49936
  }
49861
49937
  childEnv.CLAUDE_CONFIG_DIR = houseConfigDir;
@@ -49881,7 +49957,7 @@ var HostAgentSupervisor = class {
49881
49957
  report("installing", "installing agent CLI");
49882
49958
  await this.runAgentInstall(payload.agentInstallScript);
49883
49959
  }
49884
- const home = process.env.HOME || os63.homedir();
49960
+ const home = process.env.HOME || os64.homedir();
49885
49961
  childEnv.PATH = `${home}/.local/bin:${process.env.PATH ?? ""}`;
49886
49962
  if (payload.cloneToken) {
49887
49963
  try {
@@ -49889,13 +49965,13 @@ var HostAgentSupervisor = class {
49889
49965
  if ((payload.repoProvider ?? "github") === "gitlab") {
49890
49966
  const glabCmd = await ensureGlabCli(defaultGitToolingRunner);
49891
49967
  if (glabCmd) {
49892
- childEnv.PATH = `${codeamBinDir()}${path93.delimiter}${childEnv.PATH}`;
49968
+ childEnv.PATH = `${codeamBinDir()}${path94.delimiter}${childEnv.PATH}`;
49893
49969
  await ensureGlabAuth(defaultGitToolingRunner, glabCmd, payload.cloneToken);
49894
49970
  }
49895
49971
  } else {
49896
49972
  const ghCmd = await ensureGhCli(defaultGitToolingRunner, payload.cloneToken);
49897
49973
  if (ghCmd) {
49898
- childEnv.PATH = `${codeamBinDir()}${path93.delimiter}${childEnv.PATH}`;
49974
+ childEnv.PATH = `${codeamBinDir()}${path94.delimiter}${childEnv.PATH}`;
49899
49975
  await ensureGhAuth(defaultGitToolingRunner, ghCmd, payload.cloneToken);
49900
49976
  }
49901
49977
  }
@@ -49923,9 +49999,9 @@ var HostAgentSupervisor = class {
49923
49999
  );
49924
50000
  if (!payload.suppressOnboardingWelcome) {
49925
50001
  try {
49926
- const cfgDir = childEnv.CLAUDE_CONFIG_DIR || path93.join(os63.homedir(), ".claude");
49927
- const projectDir = path93.join(cfgDir, "projects", encodeCwd(cwd));
49928
- const hasPriorConversation = fs79.existsSync(projectDir) && fs79.readdirSync(projectDir).some((f) => f.endsWith(".jsonl"));
50002
+ const cfgDir = childEnv.CLAUDE_CONFIG_DIR || path94.join(os64.homedir(), ".claude");
50003
+ const projectDir = path94.join(cfgDir, "projects", encodeCwd(cwd));
50004
+ const hasPriorConversation = fs80.existsSync(projectDir) && fs80.readdirSync(projectDir).some((f) => f.endsWith(".jsonl"));
49929
50005
  if (hasPriorConversation) {
49930
50006
  childEnv.CODEAM_RESUME_LATEST = "1";
49931
50007
  log.info(
@@ -50076,7 +50152,7 @@ var HostAgentSupervisor = class {
50076
50152
  fallbackResumeTarget() {
50077
50153
  const session = getActiveSession();
50078
50154
  if (!session || !session.pluginId || !session.pollSecret || !session.agent) return null;
50079
- const cwd = session.cwd && fs79.existsSync(session.cwd) ? session.cwd : process.cwd();
50155
+ const cwd = session.cwd && fs80.existsSync(session.cwd) ? session.cwd : process.cwd();
50080
50156
  const deployId = deployIdFromWorkspace(session.cwd) ?? session.id;
50081
50157
  return { deployId, cwd, session };
50082
50158
  }
@@ -50109,7 +50185,7 @@ var HostAgentSupervisor = class {
50109
50185
  log.warn("host-agent", `self_hosted_resume ${sessionId.slice(0, 8)}: no saved pairing on this box`);
50110
50186
  return;
50111
50187
  }
50112
- if (!session.cwd || !fs79.existsSync(session.cwd)) {
50188
+ if (!session.cwd || !fs80.existsSync(session.cwd)) {
50113
50189
  log.warn("host-agent", `self_hosted_resume ${sessionId.slice(0, 8)}: workspace is gone`);
50114
50190
  return;
50115
50191
  }
@@ -50151,7 +50227,7 @@ var HostAgentSupervisor = class {
50151
50227
  const persisted = new Map(this.sessionStore.load().map((r) => [r.deployId, r.agent]));
50152
50228
  for (const c2 of this.children.values()) persisted.set(c2.deployId, c2.agent);
50153
50229
  return this.listSavedSessions().map((s) => ({ s, deployId: deployIdFromWorkspace(s.cwd) })).filter(
50154
- (x) => x.deployId !== null && !!x.s.cwd && fs79.existsSync(x.s.cwd)
50230
+ (x) => x.deployId !== null && !!x.s.cwd && fs80.existsSync(x.s.cwd)
50155
50231
  ).map(({ s, deployId }) => {
50156
50232
  const agent = persisted.get(deployId);
50157
50233
  return { deployId, sessionId: s.id, ...agent ? { agent } : {} };
@@ -50166,7 +50242,7 @@ var HostAgentSupervisor = class {
50166
50242
  if (this.children.has(deployId)) return;
50167
50243
  const st3 = this.resumeStateFor(target);
50168
50244
  try {
50169
- const cwd = fs79.existsSync(target.cwd) ? target.cwd : process.cwd();
50245
+ const cwd = fs80.existsSync(target.cwd) ? target.cwd : process.cwd();
50170
50246
  const proc = this.resumeSpawner(
50171
50247
  { ...readHouseProxyChildEnv(deployId), CODEAM_RESUME_SESSION_ID: session.id },
50172
50248
  cwd
@@ -50193,7 +50269,7 @@ var HostAgentSupervisor = class {
50193
50269
  return;
50194
50270
  }
50195
50271
  if (tracked && signal) {
50196
- this.onResumeChildExit(target, 128 + (os63.constants.signals[signal] ?? 9), `signal ${signal}`);
50272
+ this.onResumeChildExit(target, 128 + (os64.constants.signals[signal] ?? 9), `signal ${signal}`);
50197
50273
  return;
50198
50274
  }
50199
50275
  log.warn(
@@ -50236,7 +50312,7 @@ var HostAgentSupervisor = class {
50236
50312
  if (Date.now() - child.startedAt < CRASH_RESPAWN_MIN_UPTIME_MS) return false;
50237
50313
  const session = pickSavedSessionForWorkspace(this.listSavedSessions(), child.cwd);
50238
50314
  if (!session) return false;
50239
- const exitCode = typeof code === "number" ? code : 128 + (signal ? os63.constants.signals[signal] ?? 9 : 9);
50315
+ const exitCode = typeof code === "number" ? code : 128 + (signal ? os64.constants.signals[signal] ?? 9 : 9);
50240
50316
  log.warn(
50241
50317
  "host-agent",
50242
50318
  `session deploy=${child.deployId.slice(0, 8)} died (${signal ?? code}) after ${Math.round((Date.now() - child.startedAt) / 1e3)}s \u2014 respawning it (resume)`
@@ -50385,12 +50461,12 @@ var HostAgentSupervisor = class {
50385
50461
  this.untrackChild(deployId);
50386
50462
  }
50387
50463
  const dirs = [
50388
- path93.join(selfHostedWorkspaceRoot(), deployId),
50389
- path93.join(os63.homedir(), ".codeam", "house-claude", deployId)
50464
+ path94.join(selfHostedWorkspaceRoot(), deployId),
50465
+ path94.join(os64.homedir(), ".codeam", "house-claude", deployId)
50390
50466
  ];
50391
50467
  for (const dir of dirs) {
50392
50468
  try {
50393
- fs79.rmSync(dir, { recursive: true, force: true });
50469
+ fs80.rmSync(dir, { recursive: true, force: true });
50394
50470
  } catch (err) {
50395
50471
  log.warn(
50396
50472
  "host-agent",
@@ -50550,8 +50626,8 @@ async function invite() {
50550
50626
  var import_node_dns = require("dns");
50551
50627
  var import_node_util6 = require("util");
50552
50628
  var import_node_crypto13 = require("crypto");
50553
- var fs80 = __toESM(require("fs"));
50554
- var path94 = __toESM(require("path"));
50629
+ var fs81 = __toESM(require("fs"));
50630
+ var path95 = __toESM(require("path"));
50555
50631
  var import_picocolors14 = __toESM(require("picocolors"));
50556
50632
  var dnsResolveP = (0, import_node_util6.promisify)(import_node_dns.resolve);
50557
50633
  async function checkDns(apiBase2) {
@@ -50607,13 +50683,13 @@ async function checkHealth(apiBase2) {
50607
50683
  }
50608
50684
  }
50609
50685
  function checkConfigDir() {
50610
- const dir = path94.join(require("os").homedir(), ".codeam");
50686
+ const dir = path95.join(require("os").homedir(), ".codeam");
50611
50687
  try {
50612
- fs80.mkdirSync(dir, { recursive: true, mode: 448 });
50613
- const probe = path94.join(dir, ".doctor-probe");
50614
- fs80.writeFileSync(probe, "ok", { mode: 384 });
50615
- const read = fs80.readFileSync(probe, "utf8");
50616
- fs80.unlinkSync(probe);
50688
+ fs81.mkdirSync(dir, { recursive: true, mode: 448 });
50689
+ const probe = path95.join(dir, ".doctor-probe");
50690
+ fs81.writeFileSync(probe, "ok", { mode: 384 });
50691
+ const read = fs81.readFileSync(probe, "utf8");
50692
+ fs81.unlinkSync(probe);
50617
50693
  if (read !== "ok") throw new Error("write/read round-trip mismatch");
50618
50694
  return {
50619
50695
  id: "config-dir",
@@ -50653,9 +50729,9 @@ function checkSessions() {
50653
50729
  }
50654
50730
  }
50655
50731
  function checkAgentBinaries() {
50656
- const os66 = createOsStrategy();
50732
+ const os67 = createOsStrategy();
50657
50733
  return getEnabledAgents().map((meta) => {
50658
- const found = os66.findInPath(meta.binaryName);
50734
+ const found = os67.findInPath(meta.binaryName);
50659
50735
  return {
50660
50736
  id: `agent-${meta.id}`,
50661
50737
  label: `Agent binary: ${meta.displayName} (${meta.binaryName})`,
@@ -50677,7 +50753,7 @@ function checkNodePty() {
50677
50753
  detail: "not required on this platform"
50678
50754
  };
50679
50755
  }
50680
- const vendoredPath = path94.join(__dirname, "vendor", "node-pty");
50756
+ const vendoredPath = path95.join(__dirname, "vendor", "node-pty");
50681
50757
  for (const target of [vendoredPath, "node-pty"]) {
50682
50758
  try {
50683
50759
  require(target);
@@ -50719,7 +50795,7 @@ function checkChokidar() {
50719
50795
  }
50720
50796
  async function doctor(args2 = []) {
50721
50797
  const json = args2.includes("--json");
50722
- const cliVersion = true ? "2.75.34" : "0.0.0-dev";
50798
+ const cliVersion = true ? "2.75.36" : "0.0.0-dev";
50723
50799
  const apiBase2 = resolveApiBaseUrl();
50724
50800
  const diagnosticId = (0, import_node_crypto13.randomUUID)();
50725
50801
  log.info("doctor", `run id=${diagnosticId} cli=${cliVersion}`);
@@ -50781,8 +50857,8 @@ ${import_picocolors14.default.bold(" codeam doctor")}
50781
50857
  `);
50782
50858
  out2.write("\n");
50783
50859
  for (const c2 of r.checks) {
50784
- const mark = c2.ok ? import_picocolors14.default.green("\u2713") : c2.optional ? import_picocolors14.default.yellow("!") : import_picocolors14.default.red("\u2717");
50785
- out2.write(` ${mark} ${c2.label}${import_picocolors14.default.dim(` \u2014 ${c2.detail}`)}
50860
+ const mark2 = c2.ok ? import_picocolors14.default.green("\u2713") : c2.optional ? import_picocolors14.default.yellow("!") : import_picocolors14.default.red("\u2717");
50861
+ out2.write(` ${mark2} ${c2.label}${import_picocolors14.default.dim(` \u2014 ${c2.detail}`)}
50786
50862
  `);
50787
50863
  if (!c2.ok && c2.hint) {
50788
50864
  for (const line of c2.hint.split("\n")) {
@@ -51243,7 +51319,7 @@ async function mcpWarm(argv = [], opts = {}) {
51243
51319
  // src/commands/version.ts
51244
51320
  var import_picocolors15 = __toESM(require("picocolors"));
51245
51321
  function version2() {
51246
- const v = true ? "2.75.34" : "unknown";
51322
+ const v = true ? "2.75.36" : "unknown";
51247
51323
  console.log(`${import_picocolors15.default.bold("codeam-cli")} ${import_picocolors15.default.cyan(v)}`);
51248
51324
  }
51249
51325
 
@@ -51392,10 +51468,10 @@ var EXIT_CODE_NAMES = {
51392
51468
  };
51393
51469
 
51394
51470
  // src/index.ts
51395
- var os65 = __toESM(require("os"));
51471
+ var os66 = __toESM(require("os"));
51396
51472
  if (!process.env.HOME) {
51397
51473
  try {
51398
- const home = os65.homedir();
51474
+ const home = os66.homedir();
51399
51475
  if (home) process.env.HOME = home;
51400
51476
  } catch {
51401
51477
  }