codeam-cli 2.35.1 → 2.35.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ All notable changes to `codeam-cli` are documented here.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [2.35.1] — 2026-06-10
8
+
9
+ ### Fixed
10
+
11
+ - **cli:** Sync package-lock with @beads/bd@1.0.5 (npm ci was failing on main CI)
12
+ - **cli:** Symlink bd into a dir that is actually on PATH
13
+
7
14
  ## [2.35.0] — 2026-06-10
8
15
 
9
16
  ### Fixed
package/dist/index.js CHANGED
@@ -498,7 +498,7 @@ var import_qrcode_terminal = __toESM(require("qrcode-terminal"));
498
498
  // package.json
499
499
  var package_default = {
500
500
  name: "codeam-cli",
501
- version: "2.35.1",
501
+ version: "2.35.2",
502
502
  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.",
503
503
  type: "commonjs",
504
504
  main: "dist/index.js",
@@ -5898,7 +5898,7 @@ function readAnonId() {
5898
5898
  }
5899
5899
  function superProperties() {
5900
5900
  return {
5901
- cliVersion: true ? "2.35.1" : "0.0.0-dev",
5901
+ cliVersion: true ? "2.35.2" : "0.0.0-dev",
5902
5902
  nodeVersion: process.version,
5903
5903
  platform: process.platform,
5904
5904
  arch: process.arch,
@@ -6630,11 +6630,17 @@ var AgentService = class _AgentService {
6630
6630
  restart(sessionId, auto = false) {
6631
6631
  if (!this.strategy || !this.initialLaunch) return;
6632
6632
  const resumeArgs = this.runtime.resumeLaunchArgs(sessionId, { auto });
6633
+ const launch = this.runtime.prepareResumeLaunch?.(sessionId, { auto }) ?? {
6634
+ cmd: this.initialLaunch.cmd,
6635
+ args: [...this.initialLaunch.args, ...resumeArgs]
6636
+ };
6637
+ this.agentBusy = false;
6638
+ if (this.quietTimer) {
6639
+ clearTimeout(this.quietTimer);
6640
+ this.quietTimer = null;
6641
+ }
6633
6642
  this.strategy.kill();
6634
- this.strategy.spawn(this.initialLaunch.cmd, this.opts.cwd, [
6635
- ...this.initialLaunch.args,
6636
- ...resumeArgs
6637
- ]);
6643
+ this.strategy.spawn(launch.cmd, this.opts.cwd, launch.args);
6638
6644
  if (resumeArgs.length === 0 && this.runtime.postSpawnInstruction) {
6639
6645
  const { ptyInput } = this.runtime.postSpawnInstruction(sessionId);
6640
6646
  setTimeout(() => {
@@ -10037,6 +10043,28 @@ var ClaudeRuntimeStrategy = class {
10037
10043
  if (opts?.auto) args2.push("--dangerously-skip-permissions");
10038
10044
  return args2;
10039
10045
  }
10046
+ /**
10047
+ * Resume relaunch as a COMPLETE command. We deliberately rebuild the
10048
+ * launch from scratch with `--resume <id>` rather than appending it
10049
+ * onto the spawn-time args, because those carried `--session-id
10050
+ * <uuid>` (the conversation binding from the initial spawn). Claude
10051
+ * Code rejects `--session-id` together with `--resume` and exits
10052
+ * immediately — that was the "resume → agent fully dead, even new
10053
+ * prompts get no response" bug. Building a fresh launch drops the
10054
+ * conflicting flag by construction.
10055
+ *
10056
+ * Synchronous on purpose: by the time a resume happens the binary
10057
+ * was already resolved (the initial spawn succeeded), so
10058
+ * `buildClaudeLaunch` re-probes PATH without needing the async
10059
+ * installer fallback.
10060
+ */
10061
+ prepareResumeLaunch(sessionId, opts) {
10062
+ const launch = buildClaudeLaunch(this.resumeLaunchArgs(sessionId, opts), this.os);
10063
+ if (!launch) {
10064
+ return { cmd: this.meta.binaryName, args: this.resumeLaunchArgs(sessionId, opts) };
10065
+ }
10066
+ return launch;
10067
+ }
10040
10068
  resolveHistoryDir(cwd) {
10041
10069
  return resolveHistoryDir(cwd);
10042
10070
  }
@@ -15714,7 +15742,7 @@ var fs32 = __toESM(require("fs"));
15714
15742
  var os25 = __toESM(require("os"));
15715
15743
  var path39 = __toESM(require("path"));
15716
15744
  var import_crypto3 = require("crypto");
15717
- var import_child_process16 = require("child_process");
15745
+ var import_child_process17 = require("child_process");
15718
15746
 
15719
15747
  // src/lib/payload.ts
15720
15748
  var import_zod = require("zod");
@@ -17136,6 +17164,77 @@ function parseExpoUrl(stdout) {
17136
17164
  return match ? match[0] : null;
17137
17165
  }
17138
17166
 
17167
+ // src/services/preview/port-ready.ts
17168
+ var net = __toESM(require("net"));
17169
+ function isPortListening(port, host = "127.0.0.1") {
17170
+ return new Promise((resolve7) => {
17171
+ const socket = new net.Socket();
17172
+ const done = (result) => {
17173
+ socket.removeAllListeners();
17174
+ socket.destroy();
17175
+ resolve7(result);
17176
+ };
17177
+ socket.setTimeout(1e3);
17178
+ socket.once("connect", () => done(true));
17179
+ socket.once("timeout", () => done(false));
17180
+ socket.once("error", () => done(false));
17181
+ socket.connect(port, host);
17182
+ });
17183
+ }
17184
+ async function waitForPortListening(port, opts) {
17185
+ const interval = opts.intervalMs ?? 500;
17186
+ const deadline = Date.now() + opts.timeoutMs;
17187
+ for (; ; ) {
17188
+ if (await isPortListening(port)) return true;
17189
+ if (Date.now() >= deadline) return false;
17190
+ await new Promise((r) => setTimeout(r, interval));
17191
+ }
17192
+ }
17193
+
17194
+ // src/services/preview/run-setup.ts
17195
+ var import_child_process12 = require("child_process");
17196
+ function runSetupCommand(cmd, args2, cwd, env, opts) {
17197
+ return new Promise((resolve7) => {
17198
+ const child = (0, import_child_process12.spawn)(cmd, args2, {
17199
+ cwd,
17200
+ env: { ...process.env, ...env ?? {} },
17201
+ stdio: ["ignore", "pipe", "pipe"]
17202
+ });
17203
+ let settled = false;
17204
+ const tag = `setup:${cmd}`;
17205
+ const onChunk = (chunk) => {
17206
+ const text = chunk.toString().replace(/\n+$/g, "");
17207
+ if (text.length === 0) return;
17208
+ log.info("preview", `${tag}: ${text}`);
17209
+ };
17210
+ child.stdout?.on("data", onChunk);
17211
+ child.stderr?.on("data", onChunk);
17212
+ const timer = setTimeout(() => {
17213
+ if (settled) return;
17214
+ settled = true;
17215
+ log.info("preview", `${tag}: timed out after ${opts.timeoutMs}ms \u2014 killing`);
17216
+ try {
17217
+ child.kill("SIGTERM");
17218
+ } catch {
17219
+ }
17220
+ resolve7({ status: "timeout", code: null });
17221
+ }, opts.timeoutMs);
17222
+ child.once("exit", (code) => {
17223
+ if (settled) return;
17224
+ settled = true;
17225
+ clearTimeout(timer);
17226
+ if (code === 0) resolve7({ status: "ok", code: 0 });
17227
+ else resolve7({ status: "failed", code });
17228
+ });
17229
+ child.once("error", () => {
17230
+ if (settled) return;
17231
+ settled = true;
17232
+ clearTimeout(timer);
17233
+ resolve7({ status: "failed", code: null });
17234
+ });
17235
+ });
17236
+ }
17237
+
17139
17238
  // src/services/preview/setup-deps.ts
17140
17239
  var import_fs2 = __toESM(require("fs"));
17141
17240
  var import_path6 = __toESM(require("path"));
@@ -17202,7 +17301,7 @@ function activePreviewSessionIds() {
17202
17301
  }
17203
17302
 
17204
17303
  // src/beads/bd-adapter.ts
17205
- var import_child_process12 = require("child_process");
17304
+ var import_child_process13 = require("child_process");
17206
17305
  var fs29 = __toESM(require("fs"));
17207
17306
  var os24 = __toESM(require("os"));
17208
17307
  var path35 = __toESM(require("path"));
@@ -17256,7 +17355,7 @@ function _defaultSpawn(binaryPath, args2, opts) {
17256
17355
  return new Promise((resolve7) => {
17257
17356
  let proc;
17258
17357
  try {
17259
- proc = (0, import_child_process12.spawn)(binaryPath, args2, { cwd: opts.cwd, env: opts.env });
17358
+ proc = (0, import_child_process13.spawn)(binaryPath, args2, { cwd: opts.cwd, env: opts.env });
17260
17359
  } catch (err) {
17261
17360
  resolve7({ code: -1, stdout: "", stderr: err.message });
17262
17361
  return;
@@ -17392,12 +17491,12 @@ function defaultBeadsHomeDir() {
17392
17491
  }
17393
17492
 
17394
17493
  // src/beads/provisioner.ts
17395
- var import_child_process14 = require("child_process");
17494
+ var import_child_process15 = require("child_process");
17396
17495
  var fs30 = __toESM(require("fs"));
17397
17496
  var path36 = __toESM(require("path"));
17398
17497
 
17399
17498
  // src/beads/install-bd.ts
17400
- var import_child_process13 = require("child_process");
17499
+ var import_child_process14 = require("child_process");
17401
17500
  var INSTALL_SH_URL = "https://raw.githubusercontent.com/gastownhall/beads/main/scripts/install.sh";
17402
17501
  var INSTALL_PS1_URL = "https://raw.githubusercontent.com/gastownhall/beads/main/install.ps1";
17403
17502
  function resolveInstallStrategy(platform2) {
@@ -17428,7 +17527,7 @@ function _defaultInstallSpawn(strategy) {
17428
17527
  return new Promise((resolve7) => {
17429
17528
  let proc;
17430
17529
  try {
17431
- proc = (0, import_child_process13.spawn)(strategy.command, strategy.args, { env: process.env });
17530
+ proc = (0, import_child_process14.spawn)(strategy.command, strategy.args, { env: process.env });
17432
17531
  } catch (err) {
17433
17532
  resolve7({ ok: false, code: -1, stderr: err.message });
17434
17533
  return;
@@ -17532,7 +17631,7 @@ function linkBdOntoPath(binaryPath) {
17532
17631
  log.info("beads", `linked bd onto PATH: ${linkPath} -> ${binaryPath}`);
17533
17632
  }
17534
17633
  function setGitBeadsRole() {
17535
- (0, import_child_process14.execFileSync)("git", ["config", "--global", "beads.role", "contributor"], {
17634
+ (0, import_child_process15.execFileSync)("git", ["config", "--global", "beads.role", "contributor"], {
17536
17635
  stdio: "ignore"
17537
17636
  });
17538
17637
  }
@@ -17639,7 +17738,7 @@ var crypto3 = __toESM(require("crypto"));
17639
17738
  var path38 = __toESM(require("path"));
17640
17739
 
17641
17740
  // src/beads/project-key.ts
17642
- var import_child_process15 = require("child_process");
17741
+ var import_child_process16 = require("child_process");
17643
17742
  var crypto2 = __toESM(require("crypto"));
17644
17743
  var fs31 = __toESM(require("fs"));
17645
17744
  var path37 = __toESM(require("path"));
@@ -17686,7 +17785,7 @@ function findRepoRoot(cwd) {
17686
17785
  }
17687
17786
  var _execSeam2 = {
17688
17787
  exec: (file, args2, opts) => {
17689
- const out2 = (0, import_child_process15.execFileSync)(file, args2, opts);
17788
+ const out2 = (0, import_child_process16.execFileSync)(file, args2, opts);
17690
17789
  return typeof out2 === "string" ? out2 : out2.toString("utf8");
17691
17790
  },
17692
17791
  realpath: (p2) => fs31.realpathSync(p2)
@@ -18226,7 +18325,7 @@ var sessionTerminated = async (ctx, cmd) => {
18226
18325
  } catch {
18227
18326
  }
18228
18327
  try {
18229
- const proc = (0, import_child_process16.spawn)("bash", ["-lc", "pm2 delete codeam-pair >/dev/null 2>&1 || true"], {
18328
+ const proc = (0, import_child_process17.spawn)("bash", ["-lc", "pm2 delete codeam-pair >/dev/null 2>&1 || true"], {
18230
18329
  detached: true,
18231
18330
  stdio: "ignore"
18232
18331
  });
@@ -18248,7 +18347,7 @@ var shutdownSession = async (ctx, cmd) => {
18248
18347
  }
18249
18348
  if (ctx.keepAliveCtx.inCodespace && ctx.keepAliveCtx.codespaceName) {
18250
18349
  try {
18251
- const stopProc = (0, import_child_process16.spawn)(
18350
+ const stopProc = (0, import_child_process17.spawn)(
18252
18351
  "bash",
18253
18352
  ["-lc", `sleep 1; gh codespace stop -c ${JSON.stringify(ctx.keepAliveCtx.codespaceName)} >/dev/null 2>&1 || true`],
18254
18353
  { detached: true, stdio: "ignore" }
@@ -18258,7 +18357,7 @@ var shutdownSession = async (ctx, cmd) => {
18258
18357
  }
18259
18358
  }
18260
18359
  try {
18261
- const proc = (0, import_child_process16.spawn)("bash", ["-lc", "pm2 delete codeam-pair >/dev/null 2>&1 || true"], {
18360
+ const proc = (0, import_child_process17.spawn)("bash", ["-lc", "pm2 delete codeam-pair >/dev/null 2>&1 || true"], {
18262
18361
  detached: true,
18263
18362
  stdio: "ignore"
18264
18363
  });
@@ -18658,11 +18757,21 @@ async function waitForDevServerReady(devServer, readyRe, opts = {
18658
18757
  };
18659
18758
  devServer.stdout?.on("data", consume);
18660
18759
  devServer.stderr?.on("data", consume);
18760
+ let probeInFlight = false;
18661
18761
  const deadline = Date.now() + opts.timeoutMs;
18662
18762
  while (!readyMatched && Date.now() < deadline) {
18663
18763
  if (devServer.exitCode !== null) {
18664
18764
  return { kind: "exited", code: devServer.exitCode };
18665
18765
  }
18766
+ if (opts.portProbe && !probeInFlight) {
18767
+ probeInFlight = true;
18768
+ void opts.portProbe().then((up) => {
18769
+ if (up) readyMatched = true;
18770
+ }).catch(() => {
18771
+ }).finally(() => {
18772
+ probeInFlight = false;
18773
+ });
18774
+ }
18666
18775
  await new Promise((r) => setTimeout(r, 250));
18667
18776
  }
18668
18777
  if (readyMatched) return { kind: "ready" };
@@ -18682,6 +18791,8 @@ function normalizeDetectionForSpawn(detection, cwd) {
18682
18791
  args: args2.slice(1)
18683
18792
  };
18684
18793
  }
18794
+ var INSTALL_TIMEOUT_MS = 5 * 6e4;
18795
+ var SETUP_TIMEOUT_MS = 2 * 6e4;
18685
18796
  var previewStartH = (ctx, _cmd, parsed) => {
18686
18797
  if (!ctx.pluginAuthToken) {
18687
18798
  log.info("preview", "no pluginAuthToken \u2014 skipping start");
@@ -18719,13 +18830,27 @@ var previewStartH = (ctx, _cmd, parsed) => {
18719
18830
  "SETUP_RUN",
18720
18831
  `${missingDeps.cmd} ${missingDeps.args.join(" ")} (pre-flight \u2014 node_modules missing)`
18721
18832
  );
18722
- const exitCode = await runOnce(
18833
+ const result = await runSetupCommand(
18723
18834
  missingDeps.cmd,
18724
18835
  missingDeps.args,
18725
18836
  process.cwd(),
18726
- detection.env
18837
+ detection.env,
18838
+ { timeoutMs: INSTALL_TIMEOUT_MS }
18727
18839
  );
18728
- if (exitCode !== 0) {
18840
+ if (result.status === "timeout") {
18841
+ void postPreviewEvent({
18842
+ sessionId: ctx.sessionId,
18843
+ pluginId: ctx.pluginId,
18844
+ pluginAuthToken,
18845
+ type: "preview_error",
18846
+ payload: {
18847
+ stage: "ready_timeout",
18848
+ message: `Dependency install (${missingDeps.cmd} ${missingDeps.args.join(" ")}) didn't finish within ${Math.round(INSTALL_TIMEOUT_MS / 1e3)}s and was stopped. Run it manually in this project, then try the preview again.`
18849
+ }
18850
+ });
18851
+ return;
18852
+ }
18853
+ if (result.status === "failed") {
18729
18854
  void postPreviewEvent({
18730
18855
  sessionId: ctx.sessionId,
18731
18856
  pluginId: ctx.pluginId,
@@ -18733,7 +18858,7 @@ var previewStartH = (ctx, _cmd, parsed) => {
18733
18858
  type: "preview_error",
18734
18859
  payload: {
18735
18860
  stage: "spawn",
18736
- message: `Dependency install failed (${missingDeps.cmd} ${missingDeps.args.join(" ")}, exit ${exitCode}). Run it manually in this project and try again.`
18861
+ message: `Dependency install failed (${missingDeps.cmd} ${missingDeps.args.join(" ")}, exit ${result.code}). Run it manually in this project and try again.`
18737
18862
  }
18738
18863
  });
18739
18864
  return;
@@ -18745,8 +18870,28 @@ var previewStartH = (ctx, _cmd, parsed) => {
18745
18870
  ) : detection.setup_commands ?? [];
18746
18871
  for (const setup of agentSetupCommands) {
18747
18872
  emitProgress("SETUP_RUN", `${setup.cmd} ${setup.args.join(" ")}`);
18748
- const exitCode = await runOnce(setup.cmd, setup.args, process.cwd(), detection.env);
18749
- if (exitCode !== 0) {
18873
+ const timeoutMs = isJsInstallCommand(setup.cmd, setup.args) ? INSTALL_TIMEOUT_MS : SETUP_TIMEOUT_MS;
18874
+ const result = await runSetupCommand(
18875
+ setup.cmd,
18876
+ setup.args,
18877
+ process.cwd(),
18878
+ detection.env,
18879
+ { timeoutMs }
18880
+ );
18881
+ if (result.status === "timeout") {
18882
+ void postPreviewEvent({
18883
+ sessionId: ctx.sessionId,
18884
+ pluginId: ctx.pluginId,
18885
+ pluginAuthToken,
18886
+ type: "preview_error",
18887
+ payload: {
18888
+ stage: "ready_timeout",
18889
+ message: `Setup step (${setup.cmd} ${setup.args.join(" ")}) didn't finish within ${Math.round(timeoutMs / 1e3)}s and was stopped.`
18890
+ }
18891
+ });
18892
+ return;
18893
+ }
18894
+ if (result.status === "failed") {
18750
18895
  void postPreviewEvent({
18751
18896
  sessionId: ctx.sessionId,
18752
18897
  pluginId: ctx.pluginId,
@@ -18754,7 +18899,7 @@ var previewStartH = (ctx, _cmd, parsed) => {
18754
18899
  type: "preview_error",
18755
18900
  payload: {
18756
18901
  stage: "spawn",
18757
- message: `Setup failed (${setup.cmd} ${setup.args.join(" ")}, exit ${exitCode}).`
18902
+ message: `Setup failed (${setup.cmd} ${setup.args.join(" ")}, exit ${result.code}).`
18758
18903
  }
18759
18904
  });
18760
18905
  return;
@@ -18765,7 +18910,7 @@ var previewStartH = (ctx, _cmd, parsed) => {
18765
18910
  "BOOT_SEQUENCE",
18766
18911
  `${spawnable.command} ${spawnable.args.join(" ")}`
18767
18912
  );
18768
- const devServer = (0, import_child_process16.spawn)(spawnable.command, spawnable.args, {
18913
+ const devServer = (0, import_child_process17.spawn)(spawnable.command, spawnable.args, {
18769
18914
  cwd: process.cwd(),
18770
18915
  env: { ...process.env, ...spawnable.env ?? {} },
18771
18916
  stdio: ["ignore", "pipe", "pipe"]
@@ -18774,13 +18919,15 @@ var previewStartH = (ctx, _cmd, parsed) => {
18774
18919
  emitProgress("WAITING_FOR_READY", detection.ready_pattern);
18775
18920
  let expoUrl = null;
18776
18921
  const readyRe = compileReadyPattern(detection.ready_pattern);
18922
+ const isNextJs = /next/i.test(detection.framework);
18777
18923
  const outcome = await waitForDevServerReady(devServer, readyRe, {
18778
18924
  timeoutMs: 12e4,
18779
18925
  onChunk: (s) => {
18780
18926
  if (!expoUrl && detection.framework === "Expo") {
18781
18927
  expoUrl = parseExpoUrl(s);
18782
18928
  }
18783
- }
18929
+ },
18930
+ portProbe: isNextJs ? () => waitForPortListening(detection.port, { timeoutMs: 1e3, intervalMs: 250 }) : void 0
18784
18931
  });
18785
18932
  if (outcome.kind === "exited") {
18786
18933
  void postPreviewEvent({
@@ -18891,7 +19038,7 @@ var previewStartH = (ctx, _cmd, parsed) => {
18891
19038
  });
18892
19039
  return;
18893
19040
  }
18894
- tunnel = (0, import_child_process16.spawn)(bin, ["tunnel", "--url", `http://localhost:${detection.port}`], {
19041
+ tunnel = (0, import_child_process17.spawn)(bin, ["tunnel", "--url", `http://localhost:${detection.port}`], {
18895
19042
  stdio: ["ignore", "pipe", "pipe"]
18896
19043
  });
18897
19044
  let parsedUrl = null;
@@ -18987,25 +19134,6 @@ var previewStopH = (ctx) => {
18987
19134
  });
18988
19135
  })();
18989
19136
  };
18990
- function runOnce(cmd, args2, cwd, env) {
18991
- return new Promise((resolve7) => {
18992
- const child = (0, import_child_process16.spawn)(cmd, args2, {
18993
- cwd,
18994
- env: { ...process.env, ...env ?? {} },
18995
- stdio: ["ignore", "pipe", "pipe"]
18996
- });
18997
- const tag = `setup:${cmd}`;
18998
- const onChunk = (chunk) => {
18999
- const text = chunk.toString().replace(/\n+$/g, "");
19000
- if (text.length === 0) return;
19001
- log.info("preview", `${tag}: ${text}`);
19002
- };
19003
- child.stdout?.on("data", onChunk);
19004
- child.stderr?.on("data", onChunk);
19005
- child.once("exit", (code) => resolve7(code));
19006
- child.once("error", () => resolve7(-1));
19007
- });
19008
- }
19009
19137
  var savePreviewConfigH = (_ctx, _cmd, parsed) => {
19010
19138
  const detection = parsed.detection;
19011
19139
  if (!detection) {
@@ -19085,7 +19213,7 @@ async function dispatchCommand(ctx, cmd) {
19085
19213
  }
19086
19214
 
19087
19215
  // src/services/file-watcher.service.ts
19088
- var import_child_process17 = require("child_process");
19216
+ var import_child_process18 = require("child_process");
19089
19217
  var fs33 = __toESM(require("fs"));
19090
19218
  var os26 = __toESM(require("os"));
19091
19219
  var path40 = __toESM(require("path"));
@@ -19851,7 +19979,7 @@ async function _runGitImpl(cwd, args2, opts = {}) {
19851
19979
  return new Promise((resolve7) => {
19852
19980
  let proc;
19853
19981
  try {
19854
- proc = (0, import_child_process17.spawn)("git", args2, { cwd, env: process.env });
19982
+ proc = (0, import_child_process18.spawn)("git", args2, { cwd, env: process.env });
19855
19983
  } catch {
19856
19984
  resolve7(null);
19857
19985
  return;
@@ -19883,7 +20011,7 @@ function _runGit(cwd, args2, opts = {}) {
19883
20011
  var import_crypto4 = require("crypto");
19884
20012
 
19885
20013
  // src/services/turn-files/git-changeset.ts
19886
- var import_child_process18 = require("child_process");
20014
+ var import_child_process19 = require("child_process");
19887
20015
  var path41 = __toESM(require("path"));
19888
20016
  async function collectRepoChangeset(opts) {
19889
20017
  const status2 = await runGit3(opts.repoRoot, ["status", "--porcelain=v1", "-z"]);
@@ -19967,7 +20095,7 @@ function defaultRunGit(cwd, args2) {
19967
20095
  return new Promise((resolve7) => {
19968
20096
  let proc;
19969
20097
  try {
19970
- proc = (0, import_child_process18.spawn)("git", args2, { cwd, env: process.env });
20098
+ proc = (0, import_child_process19.spawn)("git", args2, { cwd, env: process.env });
19971
20099
  } catch {
19972
20100
  resolve7(null);
19973
20101
  return;
@@ -22822,13 +22950,13 @@ function fetchQuotaUsage(runtime, historySvc) {
22822
22950
  }
22823
22951
 
22824
22952
  // src/commands/start/keep-alive.ts
22825
- var import_child_process19 = require("child_process");
22953
+ var import_child_process20 = require("child_process");
22826
22954
  function buildKeepAlive(ctx) {
22827
22955
  let timer = null;
22828
22956
  async function setIdleTimeout(minutes) {
22829
22957
  if (!ctx.inCodespace || !ctx.codespaceName) return;
22830
22958
  await new Promise((resolve7) => {
22831
- const proc = (0, import_child_process19.spawn)(
22959
+ const proc = (0, import_child_process20.spawn)(
22832
22960
  "gh",
22833
22961
  [
22834
22962
  "api",
@@ -23777,11 +23905,11 @@ async function logout() {
23777
23905
  var import_picocolors10 = __toESM(require("picocolors"));
23778
23906
 
23779
23907
  // src/services/providers/github-codespaces.ts
23780
- var import_child_process20 = require("child_process");
23908
+ var import_child_process21 = require("child_process");
23781
23909
  var import_util4 = require("util");
23782
23910
  var import_picocolors8 = __toESM(require("picocolors"));
23783
23911
  var path44 = __toESM(require("path"));
23784
- var execFileP5 = (0, import_util4.promisify)(import_child_process20.execFile);
23912
+ var execFileP5 = (0, import_util4.promisify)(import_child_process21.execFile);
23785
23913
  var MAX_BUFFER = 8 * 1024 * 1024;
23786
23914
  function resetStdinForChild() {
23787
23915
  if (process.stdin.isTTY) {
@@ -23825,7 +23953,7 @@ var GitHubCodespacesProvider = class {
23825
23953
  if (!isAuthed) {
23826
23954
  resetStdinForChild();
23827
23955
  await new Promise((resolve7, reject) => {
23828
- const proc = (0, import_child_process20.spawn)("gh", ["auth", "login", "-s", "codespace,repo,read:user"], {
23956
+ const proc = (0, import_child_process21.spawn)("gh", ["auth", "login", "-s", "codespace,repo,read:user"], {
23829
23957
  stdio: "inherit"
23830
23958
  });
23831
23959
  proc.on("exit", (code) => {
@@ -23859,7 +23987,7 @@ var GitHubCodespacesProvider = class {
23859
23987
  wt(noteLines.join("\n"), "One more permission needed");
23860
23988
  resetStdinForChild();
23861
23989
  const refreshCode = await new Promise((resolve7, reject) => {
23862
- const proc = (0, import_child_process20.spawn)(
23990
+ const proc = (0, import_child_process21.spawn)(
23863
23991
  "gh",
23864
23992
  ["auth", "refresh", "-h", "github.com", "-s", "codespace"],
23865
23993
  { stdio: "inherit" }
@@ -24009,7 +24137,7 @@ var GitHubCodespacesProvider = class {
24009
24137
  O2.step(`Installing gh via ${installCmd.describe}\u2026`);
24010
24138
  resetStdinForChild();
24011
24139
  const ok = await new Promise((resolve7) => {
24012
- const proc = (0, import_child_process20.spawn)(installCmd.exe, installCmd.args, { stdio: "inherit" });
24140
+ const proc = (0, import_child_process21.spawn)(installCmd.exe, installCmd.args, { stdio: "inherit" });
24013
24141
  proc.on("exit", (code) => resolve7(code === 0));
24014
24142
  proc.on("error", () => resolve7(false));
24015
24143
  });
@@ -24036,7 +24164,7 @@ var GitHubCodespacesProvider = class {
24036
24164
  );
24037
24165
  resetStdinForChild();
24038
24166
  await new Promise((resolve7, reject) => {
24039
- const proc = (0, import_child_process20.spawn)(
24167
+ const proc = (0, import_child_process21.spawn)(
24040
24168
  "gh",
24041
24169
  ["auth", "refresh", "-h", "github.com", "-s", "repo,read:org"],
24042
24170
  { stdio: "inherit" }
@@ -24214,7 +24342,7 @@ var GitHubCodespacesProvider = class {
24214
24342
  async streamCommand(workspaceId, command2) {
24215
24343
  resetStdinForChild();
24216
24344
  return new Promise((resolve7, reject) => {
24217
- const proc = (0, import_child_process20.spawn)(
24345
+ const proc = (0, import_child_process21.spawn)(
24218
24346
  "gh",
24219
24347
  ["codespace", "ssh", "-c", workspaceId, "--", "-tt", command2],
24220
24348
  { stdio: "inherit" }
@@ -24241,11 +24369,11 @@ var GitHubCodespacesProvider = class {
24241
24369
  `mkdir -p ${shellQuote(remoteDir)} && tar -xzf - -C ${shellQuote(remoteDir)}`
24242
24370
  ];
24243
24371
  await new Promise((resolve7, reject) => {
24244
- const tar = (0, import_child_process20.spawn)("tar", tarArgs, {
24372
+ const tar = (0, import_child_process21.spawn)("tar", tarArgs, {
24245
24373
  stdio: ["ignore", "pipe", "pipe"],
24246
24374
  env: tarEnv
24247
24375
  });
24248
- const ssh = (0, import_child_process20.spawn)("gh", sshArgs, {
24376
+ const ssh = (0, import_child_process21.spawn)("gh", sshArgs, {
24249
24377
  stdio: [tar.stdout, "pipe", "pipe"]
24250
24378
  });
24251
24379
  let tarErr = "";
@@ -24279,7 +24407,7 @@ var GitHubCodespacesProvider = class {
24279
24407
  }
24280
24408
  const cmd = parts.join(" && ");
24281
24409
  await new Promise((resolve7, reject) => {
24282
- const proc = (0, import_child_process20.spawn)(
24410
+ const proc = (0, import_child_process21.spawn)(
24283
24411
  "gh",
24284
24412
  ["codespace", "ssh", "-c", workspaceId, "--", cmd],
24285
24413
  { stdio: ["pipe", "pipe", "pipe"] }
@@ -24337,11 +24465,11 @@ function shellQuote(s) {
24337
24465
  }
24338
24466
 
24339
24467
  // src/services/providers/gitpod.ts
24340
- var import_child_process21 = require("child_process");
24468
+ var import_child_process22 = require("child_process");
24341
24469
  var import_util5 = require("util");
24342
24470
  var path45 = __toESM(require("path"));
24343
24471
  var import_picocolors9 = __toESM(require("picocolors"));
24344
- var execFileP6 = (0, import_util5.promisify)(import_child_process21.execFile);
24472
+ var execFileP6 = (0, import_util5.promisify)(import_child_process22.execFile);
24345
24473
  var MAX_BUFFER2 = 8 * 1024 * 1024;
24346
24474
  function resetStdinForChild2() {
24347
24475
  if (process.stdin.isTTY) {
@@ -24381,7 +24509,7 @@ var GitpodProvider = class {
24381
24509
  );
24382
24510
  resetStdinForChild2();
24383
24511
  await new Promise((resolve7, reject) => {
24384
- const proc = (0, import_child_process21.spawn)("gitpod", ["login"], { stdio: "inherit" });
24512
+ const proc = (0, import_child_process22.spawn)("gitpod", ["login"], { stdio: "inherit" });
24385
24513
  proc.on("exit", (code) => {
24386
24514
  if (code === 0) resolve7();
24387
24515
  else reject(new Error("gitpod login failed."));
@@ -24533,7 +24661,7 @@ var GitpodProvider = class {
24533
24661
  async streamCommand(workspaceId, command2) {
24534
24662
  resetStdinForChild2();
24535
24663
  return new Promise((resolve7, reject) => {
24536
- const proc = (0, import_child_process21.spawn)(
24664
+ const proc = (0, import_child_process22.spawn)(
24537
24665
  "gitpod",
24538
24666
  ["workspace", "ssh", workspaceId, "--", "-tt", command2],
24539
24667
  { stdio: "inherit" }
@@ -24553,11 +24681,11 @@ var GitpodProvider = class {
24553
24681
  const tarEnv = { ...process.env, COPYFILE_DISABLE: "1" };
24554
24682
  const remoteCmd = `mkdir -p ${shellQuote2(remoteDir)} && tar -xzf - -C ${shellQuote2(remoteDir)}`;
24555
24683
  await new Promise((resolve7, reject) => {
24556
- const tar = (0, import_child_process21.spawn)("tar", tarArgs, {
24684
+ const tar = (0, import_child_process22.spawn)("tar", tarArgs, {
24557
24685
  stdio: ["ignore", "pipe", "pipe"],
24558
24686
  env: tarEnv
24559
24687
  });
24560
- const ssh = (0, import_child_process21.spawn)(
24688
+ const ssh = (0, import_child_process22.spawn)(
24561
24689
  "gitpod",
24562
24690
  ["workspace", "ssh", workspaceId, "--", remoteCmd],
24563
24691
  { stdio: [tar.stdout, "pipe", "pipe"] }
@@ -24589,7 +24717,7 @@ var GitpodProvider = class {
24589
24717
  }
24590
24718
  const cmd = parts.join(" && ");
24591
24719
  await new Promise((resolve7, reject) => {
24592
- const proc = (0, import_child_process21.spawn)(
24720
+ const proc = (0, import_child_process22.spawn)(
24593
24721
  "gitpod",
24594
24722
  ["workspace", "ssh", workspaceId, "--", cmd],
24595
24723
  { stdio: ["pipe", "pipe", "pipe"] }
@@ -24613,10 +24741,10 @@ function shellQuote2(s) {
24613
24741
  }
24614
24742
 
24615
24743
  // src/services/providers/gitlab-workspaces.ts
24616
- var import_child_process22 = require("child_process");
24744
+ var import_child_process23 = require("child_process");
24617
24745
  var import_util6 = require("util");
24618
24746
  var path46 = __toESM(require("path"));
24619
- var execFileP7 = (0, import_util6.promisify)(import_child_process22.execFile);
24747
+ var execFileP7 = (0, import_util6.promisify)(import_child_process23.execFile);
24620
24748
  var MAX_BUFFER3 = 8 * 1024 * 1024;
24621
24749
  var GITLAB_API_BASE = process.env.CODEAM_GITLAB_API_URL ?? "https://gitlab.com/api/v4";
24622
24750
  function resetStdinForChild3() {
@@ -24658,7 +24786,7 @@ var GitLabWorkspacesProvider = class {
24658
24786
  );
24659
24787
  resetStdinForChild3();
24660
24788
  await new Promise((resolve7, reject) => {
24661
- const proc = (0, import_child_process22.spawn)(
24789
+ const proc = (0, import_child_process23.spawn)(
24662
24790
  "glab",
24663
24791
  ["auth", "login", "--scopes", "api,read_user,read_repository"],
24664
24792
  { stdio: "inherit" }
@@ -24830,7 +24958,7 @@ Docs: https://docs.gitlab.com/ee/user/workspace/configuration.html`
24830
24958
  const sshHost = process.env.CODEAM_GITLAB_SSH_HOST ?? "workspaces.gitlab.com";
24831
24959
  resetStdinForChild3();
24832
24960
  return new Promise((resolve7, reject) => {
24833
- const proc = (0, import_child_process22.spawn)(
24961
+ const proc = (0, import_child_process23.spawn)(
24834
24962
  "ssh",
24835
24963
  ["-tt", "-o", "StrictHostKeyChecking=accept-new", `${workspaceId}@${sshHost}`, command2],
24836
24964
  { stdio: "inherit" }
@@ -24851,8 +24979,8 @@ Docs: https://docs.gitlab.com/ee/user/workspace/configuration.html`
24851
24979
  const tarEnv = { ...process.env, COPYFILE_DISABLE: "1" };
24852
24980
  const remoteCmd = `mkdir -p ${shellQuote3(remoteDir)} && tar -xzf - -C ${shellQuote3(remoteDir)}`;
24853
24981
  await new Promise((resolve7, reject) => {
24854
- const tar = (0, import_child_process22.spawn)("tar", tarArgs, { stdio: ["ignore", "pipe", "pipe"], env: tarEnv });
24855
- const ssh = (0, import_child_process22.spawn)(
24982
+ const tar = (0, import_child_process23.spawn)("tar", tarArgs, { stdio: ["ignore", "pipe", "pipe"], env: tarEnv });
24983
+ const ssh = (0, import_child_process23.spawn)(
24856
24984
  "ssh",
24857
24985
  ["-o", "StrictHostKeyChecking=accept-new", `${workspaceId}@${sshHost}`, remoteCmd],
24858
24986
  { stdio: [tar.stdout, "pipe", "pipe"] }
@@ -24882,7 +25010,7 @@ Docs: https://docs.gitlab.com/ee/user/workspace/configuration.html`
24882
25010
  }
24883
25011
  const cmd = parts.join(" && ");
24884
25012
  await new Promise((resolve7, reject) => {
24885
- const proc = (0, import_child_process22.spawn)(
25013
+ const proc = (0, import_child_process23.spawn)(
24886
25014
  "ssh",
24887
25015
  ["-o", "StrictHostKeyChecking=accept-new", `${workspaceId}@${sshHost}`, cmd],
24888
25016
  { stdio: ["pipe", "pipe", "pipe"] }
@@ -24941,10 +25069,10 @@ function shellQuote3(s) {
24941
25069
  }
24942
25070
 
24943
25071
  // src/services/providers/railway.ts
24944
- var import_child_process23 = require("child_process");
25072
+ var import_child_process24 = require("child_process");
24945
25073
  var import_util7 = require("util");
24946
25074
  var path47 = __toESM(require("path"));
24947
- var execFileP8 = (0, import_util7.promisify)(import_child_process23.execFile);
25075
+ var execFileP8 = (0, import_util7.promisify)(import_child_process24.execFile);
24948
25076
  var MAX_BUFFER4 = 8 * 1024 * 1024;
24949
25077
  function resetStdinForChild4() {
24950
25078
  if (process.stdin.isTTY) {
@@ -24985,7 +25113,7 @@ var RailwayProvider = class {
24985
25113
  );
24986
25114
  resetStdinForChild4();
24987
25115
  await new Promise((resolve7, reject) => {
24988
- const proc = (0, import_child_process23.spawn)("railway", ["login"], { stdio: "inherit" });
25116
+ const proc = (0, import_child_process24.spawn)("railway", ["login"], { stdio: "inherit" });
24989
25117
  proc.on("exit", (code) => {
24990
25118
  if (code === 0) resolve7();
24991
25119
  else reject(new Error("railway login failed."));
@@ -25128,7 +25256,7 @@ var RailwayProvider = class {
25128
25256
  }
25129
25257
  resetStdinForChild4();
25130
25258
  return new Promise((resolve7, reject) => {
25131
- const proc = (0, import_child_process23.spawn)(
25259
+ const proc = (0, import_child_process24.spawn)(
25132
25260
  "railway",
25133
25261
  ["shell", "--project", projectId, "--service", serviceId, "--command", command2],
25134
25262
  { stdio: "inherit" }
@@ -25152,8 +25280,8 @@ var RailwayProvider = class {
25152
25280
  const tarEnv = { ...process.env, COPYFILE_DISABLE: "1" };
25153
25281
  const remoteCmd = `mkdir -p ${shellQuote4(remoteDir)} && tar -xzf - -C ${shellQuote4(remoteDir)}`;
25154
25282
  await new Promise((resolve7, reject) => {
25155
- const tar = (0, import_child_process23.spawn)("tar", tarArgs, { stdio: ["ignore", "pipe", "pipe"], env: tarEnv });
25156
- const sh = (0, import_child_process23.spawn)(
25283
+ const tar = (0, import_child_process24.spawn)("tar", tarArgs, { stdio: ["ignore", "pipe", "pipe"], env: tarEnv });
25284
+ const sh = (0, import_child_process24.spawn)(
25157
25285
  "railway",
25158
25286
  ["shell", "--project", projectId, "--service", serviceId, "--command", remoteCmd],
25159
25287
  { stdio: [tar.stdout, "pipe", "pipe"] }
@@ -25186,7 +25314,7 @@ var RailwayProvider = class {
25186
25314
  }
25187
25315
  const cmd = parts.join(" && ");
25188
25316
  await new Promise((resolve7, reject) => {
25189
- const proc = (0, import_child_process23.spawn)(
25317
+ const proc = (0, import_child_process24.spawn)(
25190
25318
  "railway",
25191
25319
  ["shell", "--project", projectId, "--service", serviceId, "--command", cmd],
25192
25320
  { stdio: ["pipe", "pipe", "pipe"] }
@@ -25891,7 +26019,7 @@ function checkChokidar() {
25891
26019
  }
25892
26020
  async function doctor(args2 = []) {
25893
26021
  const json = args2.includes("--json");
25894
- const cliVersion = true ? "2.35.1" : "0.0.0-dev";
26022
+ const cliVersion = true ? "2.35.2" : "0.0.0-dev";
25895
26023
  const apiBase = resolveApiBaseUrl();
25896
26024
  const diagnosticId = (0, import_node_crypto8.randomUUID)();
25897
26025
  log.info("doctor", `run id=${diagnosticId} cli=${cliVersion}`);
@@ -26090,7 +26218,7 @@ async function completion(args2) {
26090
26218
  // src/commands/version.ts
26091
26219
  var import_picocolors13 = __toESM(require("picocolors"));
26092
26220
  function version2() {
26093
- const v = true ? "2.35.1" : "unknown";
26221
+ const v = true ? "2.35.2" : "unknown";
26094
26222
  console.log(`${import_picocolors13.default.bold("codeam-cli")} ${import_picocolors13.default.cyan(v)}`);
26095
26223
  }
26096
26224
 
@@ -26376,7 +26504,7 @@ function checkForUpdates() {
26376
26504
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
26377
26505
  if (process.env.CI) return;
26378
26506
  if (!process.stdout.isTTY) return;
26379
- const current = true ? "2.35.1" : null;
26507
+ const current = true ? "2.35.2" : null;
26380
26508
  if (!current) return;
26381
26509
  const cache = readCache();
26382
26510
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeam-cli",
3
- "version": "2.35.1",
3
+ "version": "2.35.2",
4
4
  "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 — async. The terminal companion for CodeAgent Mobile.",
5
5
  "type": "commonjs",
6
6
  "main": "dist/index.js",