codeam-cli 2.12.4 → 2.12.6

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.12.5] — 2026-05-14
8
+
9
+ ### Fixed
10
+
11
+ - **cli:** Rewrite filterCodexChrome — drop the brittle skipEchoContinuation state machine
12
+
13
+ ## [2.12.4] — 2026-05-14
14
+
15
+ ### Fixed
16
+
17
+ - **cli:** Report the real agent id/name/icon to /api/plugin/agents
18
+
7
19
  ## [2.12.3] — 2026-05-14
8
20
 
9
21
  ### Fixed
package/dist/index.js CHANGED
@@ -1682,7 +1682,7 @@ var import_qrcode_terminal = __toESM(require("qrcode-terminal"));
1682
1682
  // package.json
1683
1683
  var package_default = {
1684
1684
  name: "codeam-cli",
1685
- version: "2.12.4",
1685
+ version: "2.12.6",
1686
1686
  description: "Remote control Claude Code (and other AI coding agents) from your mobile phone. Pair your device, send prompts, stream responses in real-time, and approve commands \u2014 from anywhere.",
1687
1687
  type: "commonjs",
1688
1688
  main: "dist/index.js",
@@ -1990,11 +1990,10 @@ function currentLevel() {
1990
1990
  const raw = (process.env.CODEAM_LOG ?? "error").toLowerCase();
1991
1991
  return LEVELS[raw] ?? LEVELS.error;
1992
1992
  }
1993
- var fileEnabled = process.env.CODEAM_DEBUG === "1" || process.env.CODEAM_LOG === "debug" || process.env.CODEAM_LOG === "trace";
1993
+ var verboseFileEnabled = process.env.CODEAM_DEBUG === "1" || process.env.CODEAM_LOG === "debug" || process.env.CODEAM_LOG === "trace";
1994
1994
  var debugFilePath = path2.join(os3.homedir(), ".codeam", "debug.log");
1995
1995
  var fileInitialized = false;
1996
1996
  function appendToFile(line) {
1997
- if (!fileEnabled) return;
1998
1997
  try {
1999
1998
  if (!fileInitialized) {
2000
1999
  fs2.mkdirSync(path2.dirname(debugFilePath), { recursive: true });
@@ -2017,7 +2016,7 @@ function emit(level, tag, msg, err) {
2017
2016
  const line = `[codeam:${level}] ${tag} \u2014 ${msg}${detail}
2018
2017
  `;
2019
2018
  process.stderr.write(line);
2020
- if (LEVELS[level] >= LEVELS.debug) {
2019
+ if (LEVELS[level] <= LEVELS.info || verboseFileEnabled) {
2021
2020
  appendToFile(`${(/* @__PURE__ */ new Date()).toISOString()} ${line}`);
2022
2021
  }
2023
2022
  }
@@ -5801,40 +5800,48 @@ function getCurrentUsage2(historyDir) {
5801
5800
 
5802
5801
  // src/agents/codex/parsing.ts
5803
5802
  var BOX_DRAW_RE = /^[╭─╮│╰╯]/u;
5803
+ var BULLET_CHARS = "\u2022\xB7\u2027\u2219\u22C5";
5804
+ var CODEX_AGENT_REPLY_RE = new RegExp(`^[${BULLET_CHARS}]\\s`, "u");
5805
+ var STRIP_BULLET_RE = new RegExp(`^(\\s*)[${BULLET_CHARS}]\\s`, "u");
5804
5806
  var CODEX_USER_ECHO_RE = /^[›>]\s+\S/u;
5805
- var CODEX_AGENT_REPLY_RE = /^[•·]\s/u;
5806
5807
  var TIP_RE = /^\s*Tip:\s/i;
5807
5808
  var LEARN_MORE_RE = /^\s*Learn more:\s/i;
5808
5809
  var CODEX_STATUS_FOOTER_RE = /\bdefault\s+[·•]\s+\S+/i;
5810
+ var CODEAM_BANNER_RES = [
5811
+ // Bullet-prefixed banner entries (any role / launch label).
5812
+ new RegExp(`^[${BULLET_CHARS}]\\s+(Launching|Edgar|PRO|FREE|ENTERPRISE)\\b`, "i"),
5813
+ /^Paired\b/,
5814
+ /^codeam\b\s+v\d/,
5815
+ /^✓\s+Paired/,
5816
+ /^◇\s+Paired/
5817
+ ];
5809
5818
  function filterCodexChrome(lines) {
5810
5819
  const out = [];
5811
- let skipEchoContinuation = false;
5812
5820
  for (const line of lines) {
5813
5821
  const t2 = line.trimEnd();
5814
5822
  const trimmed = t2.trimStart();
5815
- if (!trimmed) {
5816
- skipEchoContinuation = false;
5817
- continue;
5818
- }
5823
+ if (!trimmed) continue;
5819
5824
  if (BOX_DRAW_RE.test(trimmed)) continue;
5820
5825
  if (/^OpenAI Codex\b/i.test(trimmed) || /^>_\s+OpenAI Codex\b/i.test(trimmed) || /^model:\s/i.test(trimmed) || /^directory:\s/i.test(trimmed)) continue;
5821
5826
  if (TIP_RE.test(t2) || LEARN_MORE_RE.test(t2)) continue;
5822
- if (CODEX_STATUS_FOOTER_RE.test(trimmed)) {
5823
- skipEchoContinuation = false;
5824
- continue;
5825
- }
5827
+ if (CODEX_STATUS_FOOTER_RE.test(trimmed)) continue;
5828
+ if (CODEAM_BANNER_RES.some((re2) => re2.test(trimmed))) continue;
5829
+ if (CODEX_USER_ECHO_RE.test(trimmed)) continue;
5826
5830
  if (CODEX_AGENT_REPLY_RE.test(trimmed)) {
5827
- skipEchoContinuation = false;
5828
- out.push(t2.replace(/^(\s*)[•·]\s/, "$1"));
5829
- continue;
5830
- }
5831
- if (CODEX_USER_ECHO_RE.test(trimmed)) {
5832
- skipEchoContinuation = true;
5831
+ out.push(t2.replace(STRIP_BULLET_RE, "$1"));
5833
5832
  continue;
5834
5833
  }
5835
- if (skipEchoContinuation) continue;
5836
5834
  out.push(t2);
5837
5835
  }
5836
+ log.trace("codex-parse", `filterCodexChrome in=${lines.length} out=${out.length}`);
5837
+ if (process.env.CODEAM_DEBUG === "1") {
5838
+ const sampleIn = lines.slice(-40).map((l, i) => ` in[${i}] ${JSON.stringify(l)}`).join("\n");
5839
+ const sampleOut = out.map((l, i) => ` out[${i}] ${JSON.stringify(l)}`).join("\n");
5840
+ log.debug("codex-parse", `
5841
+ ${sampleIn}
5842
+ ---
5843
+ ${sampleOut}`);
5844
+ }
5838
5845
  return out;
5839
5846
  }
5840
5847
  function parseCodexChrome(_line) {
@@ -6117,28 +6124,33 @@ var ChunkEmitter = class {
6117
6124
  ...body
6118
6125
  });
6119
6126
  const maxRetries = opts.critical ? 3 : 0;
6120
- log.trace(
6127
+ const t0 = Date.now();
6128
+ log.info(
6121
6129
  "chunkEmitter",
6122
- `send type=${body.type ?? "(clear)"} bytes=${payload.length}`
6130
+ `send type=${body.type ?? "(clear)"} bytes=${payload.length} done=${body.done === true}`
6123
6131
  );
6124
6132
  return new Promise((resolve2) => {
6125
6133
  const attempt = (attemptsLeft) => {
6126
6134
  _transport2.post(this.url, this.headers, payload).then(({ statusCode, body: resBody }) => {
6135
+ const tookMs = Date.now() - t0;
6127
6136
  if (statusCode === 410 || statusCode === 404 && /SESSION_NOT_FOUND|SESSION_GONE/.test(resBody)) {
6128
6137
  process.stderr.write("[codeam] session was deleted/disconnected \u2014 stopping output stream.\n");
6138
+ log.info("chunkEmitter", `dead status=${statusCode} took=${tookMs}ms`);
6129
6139
  resolve2({ dead: true });
6130
6140
  return;
6131
6141
  }
6132
6142
  if (statusCode >= 400) {
6143
+ log.warn("chunkEmitter", `api-error status=${statusCode} took=${tookMs}ms body=${resBody.slice(0, 200)}`);
6133
6144
  process.stderr.write(`[codeam] output API error ${statusCode}: ${resBody}
6134
6145
  `);
6146
+ } else {
6147
+ log.info("chunkEmitter", `ok status=${statusCode} took=${tookMs}ms`);
6135
6148
  }
6136
- log.trace("chunkEmitter", `status=${statusCode}`);
6137
6149
  resolve2({ dead: false });
6138
6150
  }).catch((err) => {
6139
- log.trace(
6151
+ log.warn(
6140
6152
  "chunkEmitter",
6141
- `error retries-left=${attemptsLeft}`,
6153
+ `error retries-left=${attemptsLeft} took=${Date.now() - t0}ms`,
6142
6154
  err
6143
6155
  );
6144
6156
  if (attemptsLeft > 0) {
@@ -10127,7 +10139,7 @@ async function stopWorkspaceFromLocal(target) {
10127
10139
  // src/commands/version.ts
10128
10140
  var import_picocolors11 = __toESM(require("picocolors"));
10129
10141
  function version() {
10130
- const v = true ? "2.12.4" : "unknown";
10142
+ const v = true ? "2.12.6" : "unknown";
10131
10143
  console.log(`${import_picocolors11.default.bold("codeam-cli")} ${import_picocolors11.default.cyan(v)}`);
10132
10144
  }
10133
10145
 
@@ -10262,7 +10274,7 @@ function checkForUpdates() {
10262
10274
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
10263
10275
  if (process.env.CI) return;
10264
10276
  if (!process.stdout.isTTY) return;
10265
- const current = true ? "2.12.4" : null;
10277
+ const current = true ? "2.12.6" : null;
10266
10278
  if (!current) return;
10267
10279
  const cache = readCache();
10268
10280
  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.12.4",
3
+ "version": "2.12.6",
4
4
  "description": "Remote control Claude Code (and other AI coding agents) from your mobile phone. Pair your device, send prompts, stream responses in real-time, and approve commands — from anywhere.",
5
5
  "type": "commonjs",
6
6
  "main": "dist/index.js",