codeam-cli 2.46.2 → 2.46.4

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.46.3] — 2026-06-26
8
+
9
+ ### Added
10
+
11
+ - **cli:** Detect Cursor plan paywall reply → actionable upgrade-link bubble
12
+
13
+ ## [2.46.2] — 2026-06-26
14
+
15
+ ### Added
16
+
17
+ - **cli:** Cursor generateOneShot → enables Preview detection + AI summaries
18
+
7
19
  ## [2.46.1] — 2026-06-26
8
20
 
9
21
  ### Fixed
package/dist/index.js CHANGED
@@ -5397,7 +5397,7 @@ function readAnonId() {
5397
5397
  }
5398
5398
  function superProperties() {
5399
5399
  return {
5400
- cliVersion: true ? "2.46.2" : "0.0.0-dev",
5400
+ cliVersion: true ? "2.46.4" : "0.0.0-dev",
5401
5401
  nodeVersion: process.version,
5402
5402
  platform: process.platform,
5403
5403
  arch: process.arch,
@@ -5578,7 +5578,7 @@ var os4 = __toESM(require("os"));
5578
5578
  // package.json
5579
5579
  var package_default = {
5580
5580
  name: "codeam-cli",
5581
- version: "2.46.2",
5581
+ version: "2.46.4",
5582
5582
  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.",
5583
5583
  type: "commonjs",
5584
5584
  main: "dist/index.js",
@@ -14895,29 +14895,54 @@ var _daemonSeam = {
14895
14895
  * `Dolt server: running`; down blocks say `Dolt server: not running`.
14896
14896
  * Match the affirmative form explicitly so "not running" can't false-positive.
14897
14897
  */
14898
- isRunning: (statusStdout) => /Dolt server:\s*running/i.test(statusStdout)
14898
+ isRunning: (statusStdout) => /Dolt server:\s*running/i.test(statusStdout),
14899
+ /**
14900
+ * Poll delay behind a seam so tests stub it to a no-op (no real timers).
14901
+ * Production uses a short fixed delay between status re-probes.
14902
+ */
14903
+ sleep: (ms) => new Promise((r) => setTimeout(r, ms))
14899
14904
  };
14900
- async function ensureSharedServer(adapter) {
14901
- const status2 = await adapter.run(["dolt", "status"]);
14902
- if (status2.code === 0 && _daemonSeam.isRunning(status2.stdout)) {
14905
+ var DEFAULTS = { startAttempts: 2, pollAttempts: 10, pollDelayMs: 500 };
14906
+ async function ensureSharedServer(adapter, options = {}) {
14907
+ const startAttempts = options.startAttempts ?? DEFAULTS.startAttempts;
14908
+ const pollAttempts = options.pollAttempts ?? DEFAULTS.pollAttempts;
14909
+ const pollDelayMs = options.pollDelayMs ?? DEFAULTS.pollDelayMs;
14910
+ const probe = async () => {
14911
+ const status2 = await adapter.run(["dolt", "status"]);
14912
+ return status2.code === 0 && _daemonSeam.isRunning(status2.stdout);
14913
+ };
14914
+ if (await probe()) {
14903
14915
  log.trace("beads", "shared dolt sql-server already running \u2014 reusing");
14904
14916
  return { up: true, started: false };
14905
14917
  }
14906
- log.info("beads", "shared dolt sql-server not running \u2014 starting (detached)");
14907
- const start2 = await adapter.run(["dolt", "start"]);
14908
- if (start2.code !== 0) {
14918
+ for (let attempt = 1; attempt <= startAttempts; attempt++) {
14919
+ log.info(
14920
+ "beads",
14921
+ `shared dolt sql-server not running \u2014 starting (detached), attempt ${attempt}/${startAttempts}`
14922
+ );
14923
+ const start2 = await adapter.run(["dolt", "start"]);
14924
+ if (start2.code !== 0) {
14925
+ log.warn(
14926
+ "beads",
14927
+ `bd dolt start failed (code=${start2.code}): ${start2.stderr.slice(0, 200)} \u2014 retrying`
14928
+ );
14929
+ if (attempt < startAttempts) await _daemonSeam.sleep(pollDelayMs);
14930
+ continue;
14931
+ }
14932
+ for (let poll = 1; poll <= pollAttempts; poll++) {
14933
+ if (await probe()) {
14934
+ log.info("beads", `shared dolt sql-server up after ${poll} status poll(s)`);
14935
+ return { up: true, started: true };
14936
+ }
14937
+ if (poll < pollAttempts) await _daemonSeam.sleep(pollDelayMs);
14938
+ }
14909
14939
  log.warn(
14910
14940
  "beads",
14911
- `bd dolt start failed (code=${start2.code}): ${start2.stderr.slice(0, 200)} \u2014 beads memory unavailable this run`
14941
+ `shared dolt sql-server not listening after ${pollAttempts} polls (start attempt ${attempt}/${startAttempts})`
14912
14942
  );
14913
- return { up: false, started: false };
14914
- }
14915
- const recheck = await adapter.run(["dolt", "status"]);
14916
- const up = recheck.code === 0 && _daemonSeam.isRunning(recheck.stdout);
14917
- if (!up) {
14918
- log.warn("beads", "shared dolt sql-server still not reachable after start \u2014 non-fatal");
14919
14943
  }
14920
- return { up, started: up };
14944
+ log.warn("beads", "shared dolt sql-server still not reachable after all retries \u2014 non-fatal");
14945
+ return { up: false, started: false };
14921
14946
  }
14922
14947
 
14923
14948
  // src/beads/project-key.ts
@@ -17943,7 +17968,7 @@ async function autoUpgradeBeforeCriticalCommand() {
17943
17968
  if (process.env.NODE_ENV === "test") return;
17944
17969
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
17945
17970
  if (process.env.CI) return;
17946
- const current = true ? "2.46.2" : null;
17971
+ const current = true ? "2.46.4" : null;
17947
17972
  if (!current) return;
17948
17973
  const cache = readCache();
17949
17974
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
@@ -17960,7 +17985,7 @@ function checkForUpdates() {
17960
17985
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
17961
17986
  if (process.env.CI) return;
17962
17987
  if (!process.stdout.isTTY) return;
17963
- const current = true ? "2.46.2" : null;
17988
+ const current = true ? "2.46.4" : null;
17964
17989
  if (!current) return;
17965
17990
  const cache = readCache();
17966
17991
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
@@ -18402,7 +18427,7 @@ var defaultSpawner = (env, cwd, args2 = []) => (0, import_node_child_process14.s
18402
18427
  detached: false
18403
18428
  });
18404
18429
  function currentCliVersion() {
18405
- return true ? "2.46.2" : null;
18430
+ return true ? "2.46.4" : null;
18406
18431
  }
18407
18432
  function runCmd(cmd, args2, timeoutMs) {
18408
18433
  return new Promise((resolve7) => {
@@ -25014,6 +25039,12 @@ function replyIsAuthFailure(finalText) {
25014
25039
  return t2.length > 0 && t2.length <= 200 && looksLikeAuthFailure(t2);
25015
25040
  }
25016
25041
  var AUTH_FAILURE_MESSAGE = "\u{1F512} **Authentication failed \u2014 your agent credentials are invalid or expired (API 401).**\n\nTap [Re-authenticate this agent](codeam://reauth) to renew your credentials in Profile \u203A Agents, then send your message again.";
25042
+ function replyIsCursorUpgradeRequired(finalText) {
25043
+ const t2 = finalText.trim().toLowerCase();
25044
+ if (t2.length === 0 || t2.length > 200) return false;
25045
+ return t2.includes("upgrade your plan to continue") || t2.includes("upgrade your plan") && t2.includes("continue");
25046
+ }
25047
+ var CURSOR_UPGRADE_MESSAGE = "\u26A1 **Cursor needs a paid plan to run the agent.**\n\nThe headless Cursor Agent requires Cursor **Pro** \u2014 your Free plan\u2019s included usage does NOT cover Agent runs, even with quota left. This is your Cursor account (not CodeAgent). Upgrade, then send your message again:\n\n[Upgrade to Cursor Pro \u2192](https://cursor.com/dashboard)";
25017
25048
  var TURN_FAILURE_MESSAGE = "\u26A0\uFE0F **The agent hit an error and couldn\u2019t finish this turn.** Please send your message again.";
25018
25049
  var PROVIDER_OUTAGE_RE = /overloaded_error|\boverloaded\b|service[ _]unavailable|temporarily[ _]unavailable|(?:api error|http|status)[:\s]+(?:529|503|502|504)\b|\b(?:529|503|502|504)\b[^\n]{0,40}(?:overload|unavailable|gateway|upstream|server error)|bad gateway|gateway time-?out|upstream (?:error|connect|timeout)/i;
25019
25050
  function looksLikeProviderOutage(text) {
@@ -25470,7 +25501,13 @@ async function handleCommand(cmd, client2, relay, acpSessionId, models, streamin
25470
25501
  try {
25471
25502
  const reply = await client2.prompt(blocks);
25472
25503
  const finalText = streaming.getCurrentText();
25473
- if (replyIsAuthFailure(finalText)) {
25504
+ if (opts.agent === "cursor" && replyIsCursorUpgradeRequired(finalText)) {
25505
+ await streaming.closeWithBubble(CURSOR_UPGRADE_MESSAGE);
25506
+ history.appendAgentReply(CURSOR_UPGRADE_MESSAGE);
25507
+ void history.flush();
25508
+ log.info("acpRunner", `start_task \u2190 cursor-plan-upgrade-required id=${cmd.id.slice(0, 8)}`);
25509
+ await relay.sendResult(cmd.id, "failed", { error: "cursor plan upgrade required" });
25510
+ } else if (replyIsAuthFailure(finalText)) {
25474
25511
  await streaming.closeWithBubble(AUTH_FAILURE_MESSAGE);
25475
25512
  history.appendAgentReply(AUTH_FAILURE_MESSAGE);
25476
25513
  void history.flush();
@@ -29727,7 +29764,7 @@ function checkChokidar() {
29727
29764
  }
29728
29765
  async function doctor(args2 = []) {
29729
29766
  const json = args2.includes("--json");
29730
- const cliVersion = true ? "2.46.2" : "0.0.0-dev";
29767
+ const cliVersion = true ? "2.46.4" : "0.0.0-dev";
29731
29768
  const apiBase2 = resolveApiBaseUrl();
29732
29769
  const diagnosticId = (0, import_node_crypto8.randomUUID)();
29733
29770
  log.info("doctor", `run id=${diagnosticId} cli=${cliVersion}`);
@@ -29926,7 +29963,7 @@ async function completion(args2) {
29926
29963
  // src/commands/version.ts
29927
29964
  var import_picocolors15 = __toESM(require("picocolors"));
29928
29965
  function version2() {
29929
- const v = true ? "2.46.2" : "unknown";
29966
+ const v = true ? "2.46.4" : "unknown";
29930
29967
  console.log(`${import_picocolors15.default.bold("codeam-cli")} ${import_picocolors15.default.cyan(v)}`);
29931
29968
  }
29932
29969
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeam-cli",
3
- "version": "2.46.2",
3
+ "version": "2.46.4",
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",