codeam-cli 2.32.8 → 2.32.9

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 (2) hide show
  1. package/dist/index.js +52 -36
  2. package/package.json +1 -1
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.32.8",
501
+ version: "2.32.9",
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",
@@ -5869,7 +5869,7 @@ function readAnonId() {
5869
5869
  }
5870
5870
  function superProperties() {
5871
5871
  return {
5872
- cliVersion: true ? "2.32.8" : "0.0.0-dev",
5872
+ cliVersion: true ? "2.32.9" : "0.0.0-dev",
5873
5873
  nodeVersion: process.version,
5874
5874
  platform: process.platform,
5875
5875
  arch: process.arch,
@@ -17746,6 +17746,34 @@ var requestPreviewDetectH = (ctx) => {
17746
17746
  function compileReadyPattern(pattern) {
17747
17747
  return new RegExp(pattern, "i");
17748
17748
  }
17749
+ async function waitForDevServerReady(devServer, readyRe, opts = {
17750
+ timeoutMs: 12e4
17751
+ }) {
17752
+ let readyMatched = false;
17753
+ const READY_BUFFER_MAX = 32768;
17754
+ let readyBuffer = "";
17755
+ const consume = (chunk) => {
17756
+ const s = chunk.toString();
17757
+ opts.onChunk?.(s);
17758
+ if (readyMatched) return;
17759
+ readyBuffer += s;
17760
+ if (readyBuffer.length > READY_BUFFER_MAX) {
17761
+ readyBuffer = readyBuffer.slice(-READY_BUFFER_MAX);
17762
+ }
17763
+ if (readyRe.test(readyBuffer)) readyMatched = true;
17764
+ };
17765
+ devServer.stdout?.on("data", consume);
17766
+ devServer.stderr?.on("data", consume);
17767
+ const deadline = Date.now() + opts.timeoutMs;
17768
+ while (!readyMatched && Date.now() < deadline) {
17769
+ if (devServer.exitCode !== null) {
17770
+ return { kind: "exited", code: devServer.exitCode };
17771
+ }
17772
+ await new Promise((r) => setTimeout(r, 250));
17773
+ }
17774
+ if (readyMatched) return { kind: "ready" };
17775
+ return { kind: "timeout" };
17776
+ }
17749
17777
  function normalizeDetectionForSpawn(detection, cwd) {
17750
17778
  if (detection.command !== "npx") return detection;
17751
17779
  const args2 = detection.args ?? [];
@@ -17850,42 +17878,30 @@ var previewStartH = (ctx, _cmd, parsed) => {
17850
17878
  });
17851
17879
  emitProgress("BIND_PORT", String(detection.port));
17852
17880
  emitProgress("WAITING_FOR_READY", detection.ready_pattern);
17853
- let readyMatched = false;
17854
17881
  let expoUrl = null;
17855
17882
  const readyRe = compileReadyPattern(detection.ready_pattern);
17856
- const READY_BUFFER_MAX = 32768;
17857
- let readyBuffer = "";
17858
- const onChunk = (chunk) => {
17859
- const s = chunk.toString();
17860
- if (!readyMatched) {
17861
- readyBuffer += s;
17862
- if (readyBuffer.length > READY_BUFFER_MAX) {
17863
- readyBuffer = readyBuffer.slice(-READY_BUFFER_MAX);
17883
+ const outcome = await waitForDevServerReady(devServer, readyRe, {
17884
+ timeoutMs: 12e4,
17885
+ onChunk: (s) => {
17886
+ if (!expoUrl && detection.framework === "Expo") {
17887
+ expoUrl = parseExpoUrl(s);
17864
17888
  }
17865
- if (readyRe.test(readyBuffer)) readyMatched = true;
17866
17889
  }
17867
- if (!expoUrl && detection.framework === "Expo") expoUrl = parseExpoUrl(s);
17868
- };
17869
- devServer.stdout.on("data", onChunk);
17870
- devServer.stderr.on("data", onChunk);
17871
- const readyDeadline = Date.now() + 12e4;
17872
- while (!readyMatched && Date.now() < readyDeadline) {
17873
- if (devServer.exitCode !== null) {
17874
- void postPreviewEvent({
17875
- sessionId: ctx.sessionId,
17876
- pluginId: ctx.pluginId,
17877
- pluginAuthToken,
17878
- type: "preview_error",
17879
- payload: {
17880
- stage: "spawn",
17881
- message: `Dev server exited (code ${devServer.exitCode}).`
17882
- }
17883
- });
17884
- return;
17885
- }
17886
- await new Promise((r) => setTimeout(r, 250));
17890
+ });
17891
+ if (outcome.kind === "exited") {
17892
+ void postPreviewEvent({
17893
+ sessionId: ctx.sessionId,
17894
+ pluginId: ctx.pluginId,
17895
+ pluginAuthToken,
17896
+ type: "preview_error",
17897
+ payload: {
17898
+ stage: "spawn",
17899
+ message: `Dev server exited (code ${outcome.code}).`
17900
+ }
17901
+ });
17902
+ return;
17887
17903
  }
17888
- if (!readyMatched) {
17904
+ if (outcome.kind === "timeout") {
17889
17905
  try {
17890
17906
  devServer.kill("SIGTERM");
17891
17907
  } catch {
@@ -24947,7 +24963,7 @@ function checkChokidar() {
24947
24963
  }
24948
24964
  async function doctor(args2 = []) {
24949
24965
  const json = args2.includes("--json");
24950
- const cliVersion = true ? "2.32.8" : "0.0.0-dev";
24966
+ const cliVersion = true ? "2.32.9" : "0.0.0-dev";
24951
24967
  const apiBase = resolveApiBaseUrl();
24952
24968
  const diagnosticId = (0, import_node_crypto8.randomUUID)();
24953
24969
  log.info("doctor", `run id=${diagnosticId} cli=${cliVersion}`);
@@ -25146,7 +25162,7 @@ async function completion(args2) {
25146
25162
  // src/commands/version.ts
25147
25163
  var import_picocolors13 = __toESM(require("picocolors"));
25148
25164
  function version2() {
25149
- const v = true ? "2.32.8" : "unknown";
25165
+ const v = true ? "2.32.9" : "unknown";
25150
25166
  console.log(`${import_picocolors13.default.bold("codeam-cli")} ${import_picocolors13.default.cyan(v)}`);
25151
25167
  }
25152
25168
 
@@ -25432,7 +25448,7 @@ function checkForUpdates() {
25432
25448
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
25433
25449
  if (process.env.CI) return;
25434
25450
  if (!process.stdout.isTTY) return;
25435
- const current = true ? "2.32.8" : null;
25451
+ const current = true ? "2.32.9" : null;
25436
25452
  if (!current) return;
25437
25453
  const cache = readCache();
25438
25454
  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.32.8",
3
+ "version": "2.32.9",
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",