codeam-cli 2.39.40 → 2.39.42

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,18 @@ 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.39.41] — 2026-06-19
8
+
9
+ ### Fixed
10
+
11
+ - **cli:** Install yarn on demand when a yarn project lacks it
12
+
13
+ ## [2.39.40] — 2026-06-19
14
+
15
+ ### Added
16
+
17
+ - **cli:** Run named preview tunnel via token, fallback to quick tunnel
18
+
7
19
  ## [2.39.39] — 2026-06-19
8
20
 
9
21
  ### 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.39.40",
501
+ version: "2.39.42",
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",
@@ -5908,7 +5908,7 @@ function readAnonId() {
5908
5908
  }
5909
5909
  function superProperties() {
5910
5910
  return {
5911
- cliVersion: true ? "2.39.40" : "0.0.0-dev",
5911
+ cliVersion: true ? "2.39.42" : "0.0.0-dev",
5912
5912
  nodeVersion: process.version,
5913
5913
  platform: process.platform,
5914
5914
  arch: process.arch,
@@ -15260,6 +15260,7 @@ var os28 = __toESM(require("os"));
15260
15260
  var path42 = __toESM(require("path"));
15261
15261
  var import_crypto3 = require("crypto");
15262
15262
  var import_child_process19 = require("child_process");
15263
+ var import_which2 = __toESM(require("which"));
15263
15264
 
15264
15265
  // src/lib/payload.ts
15265
15266
  var import_zod = require("zod");
@@ -16953,6 +16954,12 @@ function detectMissingNodeDeps(cwd) {
16953
16954
  }
16954
16955
  return { cmd: "npm", args: ["install", "--legacy-peer-deps"] };
16955
16956
  }
16957
+ async function ensureYarnInstalled(deps) {
16958
+ if (await deps.hasYarn()) return { ok: true, code: 0 };
16959
+ const res = await deps.installYarn();
16960
+ if (!res.ok) return res;
16961
+ return await deps.hasYarn() ? { ok: true, code: 0 } : { ok: false, code: res.code };
16962
+ }
16956
16963
  function isJsInstallCommand(cmd, args2) {
16957
16964
  const known = ["npm", "pnpm", "yarn", "bun"];
16958
16965
  if (!known.includes(cmd)) return false;
@@ -18958,6 +18965,35 @@ var previewStartH = (ctx, _cmd, parsed) => {
18958
18965
  const missingDeps = detectMissingNodeDeps(process.cwd());
18959
18966
  let preflightRan = false;
18960
18967
  if (missingDeps) {
18968
+ if (missingDeps.cmd === "yarn") {
18969
+ const ensured = await ensureYarnInstalled({
18970
+ hasYarn: async () => Boolean(await (0, import_which2.default)("yarn", { nothrow: true })),
18971
+ installYarn: async () => {
18972
+ emitProgress("SETUP_RUN", "installing yarn (not found on PATH) \u2014 npm install -g yarn");
18973
+ const r = await runSetupCommand(
18974
+ "npm",
18975
+ ["install", "-g", "yarn"],
18976
+ process.cwd(),
18977
+ detection.env,
18978
+ { timeoutMs: INSTALL_TIMEOUT_MS }
18979
+ );
18980
+ return { ok: r.status === "ok", code: r.code };
18981
+ }
18982
+ });
18983
+ if (!ensured.ok) {
18984
+ void postPreviewEvent({
18985
+ sessionId: ctx.sessionId,
18986
+ pluginId: ctx.pluginId,
18987
+ pluginAuthToken,
18988
+ type: "preview_error",
18989
+ payload: {
18990
+ stage: "spawn",
18991
+ message: `This project uses yarn but yarn isn't installed, and installing it automatically failed (npm install -g yarn, exit ${ensured.code}). Install yarn in this environment and try the preview again.`
18992
+ }
18993
+ });
18994
+ return;
18995
+ }
18996
+ }
18961
18997
  emitProgress(
18962
18998
  "SETUP_RUN",
18963
18999
  `${missingDeps.cmd} ${missingDeps.args.join(" ")} (pre-flight \u2014 node_modules missing)`
@@ -19037,6 +19073,19 @@ var previewStartH = (ctx, _cmd, parsed) => {
19037
19073
  return;
19038
19074
  }
19039
19075
  }
19076
+ if (await isPortListening(detection.port)) {
19077
+ void postPreviewEvent({
19078
+ sessionId: ctx.sessionId,
19079
+ pluginId: ctx.pluginId,
19080
+ pluginAuthToken,
19081
+ type: "preview_error",
19082
+ payload: {
19083
+ stage: "spawn",
19084
+ message: `Port ${detection.port} is already in use by another process, so the dev server can't start there. Stop whatever is listening on port ${detection.port} and try the preview again.`
19085
+ }
19086
+ });
19087
+ return;
19088
+ }
19040
19089
  const spawnable = normalizeDetectionForSpawn(detection, process.cwd());
19041
19090
  emitProgress(
19042
19091
  "BOOT_SEQUENCE",
@@ -27240,7 +27289,7 @@ function checkChokidar() {
27240
27289
  }
27241
27290
  async function doctor(args2 = []) {
27242
27291
  const json = args2.includes("--json");
27243
- const cliVersion = true ? "2.39.40" : "0.0.0-dev";
27292
+ const cliVersion = true ? "2.39.42" : "0.0.0-dev";
27244
27293
  const apiBase2 = resolveApiBaseUrl();
27245
27294
  const diagnosticId = (0, import_node_crypto8.randomUUID)();
27246
27295
  log.info("doctor", `run id=${diagnosticId} cli=${cliVersion}`);
@@ -27439,7 +27488,7 @@ async function completion(args2) {
27439
27488
  // src/commands/version.ts
27440
27489
  var import_picocolors13 = __toESM(require("picocolors"));
27441
27490
  function version2() {
27442
- const v = true ? "2.39.40" : "unknown";
27491
+ const v = true ? "2.39.42" : "unknown";
27443
27492
  console.log(`${import_picocolors13.default.bold("codeam-cli")} ${import_picocolors13.default.cyan(v)}`);
27444
27493
  }
27445
27494
 
@@ -27725,7 +27774,7 @@ function checkForUpdates() {
27725
27774
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
27726
27775
  if (process.env.CI) return;
27727
27776
  if (!process.stdout.isTTY) return;
27728
- const current = true ? "2.39.40" : null;
27777
+ const current = true ? "2.39.42" : null;
27729
27778
  if (!current) return;
27730
27779
  const cache = readCache();
27731
27780
  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.39.40",
3
+ "version": "2.39.42",
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",