codeam-cli 2.46.4 → 2.46.5

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,12 @@ 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.4] — 2026-06-26
8
+
9
+ ### Fixed
10
+
11
+ - **cli:** Retry + poll dolt sql-server start so it's up before the agent (codeagent-r5k)
12
+
7
13
  ## [2.46.3] — 2026-06-26
8
14
 
9
15
  ### Added
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.4" : "0.0.0-dev",
5400
+ cliVersion: true ? "2.46.5" : "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.4",
5581
+ version: "2.46.5",
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",
@@ -15239,6 +15239,34 @@ async function provisionBeads(opts = {}) {
15239
15239
  log.warn("beads", "shared dolt sql-server not up \u2014 beads disabled this run");
15240
15240
  return result;
15241
15241
  }
15242
+ try {
15243
+ if (!await projectDbReachable(bd)) {
15244
+ log.info(
15245
+ "beads",
15246
+ `prefix DB '${prefix}' not reachable on shared server \u2014 self-healing via bd bootstrap`
15247
+ );
15248
+ const boot = await bd.run(["bootstrap", "--non-interactive"]);
15249
+ if (boot.code !== 0) {
15250
+ log.warn(
15251
+ "beads",
15252
+ `bd bootstrap failed (code=${boot.code}): ${boot.stderr.slice(0, 200)} \u2014 prefix DB may be absent`
15253
+ );
15254
+ }
15255
+ const reachable = await projectDbReachable(bd);
15256
+ result.serverUp = reachable;
15257
+ result.initialized = reachable;
15258
+ if (!reachable) {
15259
+ log.warn(
15260
+ "beads",
15261
+ `prefix DB '${prefix}' still unreachable after bootstrap \u2014 beads disabled this run`
15262
+ );
15263
+ return result;
15264
+ }
15265
+ log.info("beads", `prefix DB '${prefix}' materialized on shared server`);
15266
+ }
15267
+ } catch (err) {
15268
+ log.warn("beads", "verifying/creating the prefix DB threw (non-fatal)", err);
15269
+ }
15242
15270
  const exp = await bd.run(["config", "set", "export.auto", "true"]);
15243
15271
  result.exportEnabled = exp.code === 0;
15244
15272
  result.agentsWired = await setupAgents(bd, opts.agents ?? []);
@@ -15248,6 +15276,10 @@ async function provisionBeads(opts = {}) {
15248
15276
  );
15249
15277
  return result;
15250
15278
  }
15279
+ async function projectDbReachable(bd) {
15280
+ const ping = await bd.run(["ping"]);
15281
+ return ping.code === 0;
15282
+ }
15251
15283
  async function setupAgents(bd, agents) {
15252
15284
  const wired = [];
15253
15285
  for (const recipe of dedupeRecipes(agents)) {
@@ -17968,7 +18000,7 @@ async function autoUpgradeBeforeCriticalCommand() {
17968
18000
  if (process.env.NODE_ENV === "test") return;
17969
18001
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
17970
18002
  if (process.env.CI) return;
17971
- const current = true ? "2.46.4" : null;
18003
+ const current = true ? "2.46.5" : null;
17972
18004
  if (!current) return;
17973
18005
  const cache = readCache();
17974
18006
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
@@ -17985,7 +18017,7 @@ function checkForUpdates() {
17985
18017
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
17986
18018
  if (process.env.CI) return;
17987
18019
  if (!process.stdout.isTTY) return;
17988
- const current = true ? "2.46.4" : null;
18020
+ const current = true ? "2.46.5" : null;
17989
18021
  if (!current) return;
17990
18022
  const cache = readCache();
17991
18023
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
@@ -18427,7 +18459,7 @@ var defaultSpawner = (env, cwd, args2 = []) => (0, import_node_child_process14.s
18427
18459
  detached: false
18428
18460
  });
18429
18461
  function currentCliVersion() {
18430
- return true ? "2.46.4" : null;
18462
+ return true ? "2.46.5" : null;
18431
18463
  }
18432
18464
  function runCmd(cmd, args2, timeoutMs) {
18433
18465
  return new Promise((resolve7) => {
@@ -23751,8 +23783,18 @@ function reconcileCumulative(existing, incoming) {
23751
23783
  if (incoming.length === 0) return existing;
23752
23784
  if (incoming.startsWith(existing)) return incoming;
23753
23785
  if (existing.startsWith(incoming)) return existing;
23786
+ const shared = commonPrefixLength(existing, incoming);
23787
+ if (shared > 0 && shared >= existing.length / 2) {
23788
+ return existing.slice(0, shared) + incoming.slice(shared);
23789
+ }
23754
23790
  return existing + incoming;
23755
23791
  }
23792
+ function commonPrefixLength(a, b) {
23793
+ const max = Math.min(a.length, b.length);
23794
+ let i = 0;
23795
+ while (i < max && a.charCodeAt(i) === b.charCodeAt(i)) i += 1;
23796
+ return i;
23797
+ }
23756
23798
 
23757
23799
  // src/agents/acp/onboarding.ts
23758
23800
  var import_child_process22 = require("child_process");
@@ -24678,6 +24720,26 @@ var StreamingState = class {
24678
24720
  * no matter how many message ids the adapter spreads it across.
24679
24721
  */
24680
24722
  turnTextChunkId = null;
24723
+ /**
24724
+ * Stable chunkId that ALL `thinking` segments of the current turn collapse
24725
+ * onto (set to the first thought chunk's id, reset each {@link beginTurn}) —
24726
+ * the thinking twin of {@link turnTextChunkId}.
24727
+ *
24728
+ * Why: `claude-agent-acp` (≥0.47) re-emits the CONSOLIDATED thought under a
24729
+ * DIFFERENT message id (the same dedupe misfire that doubles text). The
24730
+ * mapper derives the thinking chunkId from that message id
24731
+ * (`<messageId>::thought`), so the consolidated re-emit lands in a SECOND
24732
+ * `::thought` buffer, BOTH get flushed `isFinal:true`, and the mobile
24733
+ * activity card (which coalesces by chunkId) stacks the two copies → the
24734
+ * thinking doubles ("TheThe user said …briefly.The user said …briefly.").
24735
+ * Text was protected by {@link turnTextChunkId}; thinking was not. Collapsing
24736
+ * every thought segment of a turn onto one reconcile buffer makes the re-emit
24737
+ * a `reconcileCumulative` REPLACE (identical snapshot) instead of a second
24738
+ * buffer. tool_use / tool_result keep their own id within the turn (distinct
24739
+ * bubbles; the adapter does NOT re-emit a consolidated tool snapshot under a
24740
+ * fresh id, so they don't share this bug).
24741
+ */
24742
+ turnThoughtChunkId = null;
24681
24743
  /**
24682
24744
  * Monotonic turn counter, bumped each {@link beginTurn}. Used to NAMESPACE
24683
24745
  * every streaming-chunk id so an id the ACP adapter REUSES across turns can't
@@ -24784,6 +24846,7 @@ var StreamingState = class {
24784
24846
  this.text = "";
24785
24847
  this.streamingChunks.clear();
24786
24848
  this.turnTextChunkId = null;
24849
+ this.turnThoughtChunkId = null;
24787
24850
  this.turnSeq += 1;
24788
24851
  if (this.pending?.kind === "permission") {
24789
24852
  clearTimeout(this.pending.timeoutTimer);
@@ -24795,7 +24858,7 @@ var StreamingState = class {
24795
24858
  await this.publisher.publishOutput({ type: "new_turn", done: false });
24796
24859
  }
24797
24860
  append(delta) {
24798
- const baseId = delta.kind === "text" ? this.turnTextChunkId ??= delta.chunkId : delta.chunkId;
24861
+ const baseId = delta.kind === "text" ? this.turnTextChunkId ??= delta.chunkId : delta.kind === "thinking" ? this.turnThoughtChunkId ??= delta.chunkId : delta.chunkId;
24799
24862
  const chunkId = `t${this.turnSeq}:${baseId}`;
24800
24863
  const existing = this.streamingChunks.get(chunkId);
24801
24864
  if (existing && existing.kind !== delta.kind) {
@@ -29764,7 +29827,7 @@ function checkChokidar() {
29764
29827
  }
29765
29828
  async function doctor(args2 = []) {
29766
29829
  const json = args2.includes("--json");
29767
- const cliVersion = true ? "2.46.4" : "0.0.0-dev";
29830
+ const cliVersion = true ? "2.46.5" : "0.0.0-dev";
29768
29831
  const apiBase2 = resolveApiBaseUrl();
29769
29832
  const diagnosticId = (0, import_node_crypto8.randomUUID)();
29770
29833
  log.info("doctor", `run id=${diagnosticId} cli=${cliVersion}`);
@@ -29963,7 +30026,7 @@ async function completion(args2) {
29963
30026
  // src/commands/version.ts
29964
30027
  var import_picocolors15 = __toESM(require("picocolors"));
29965
30028
  function version2() {
29966
- const v = true ? "2.46.4" : "unknown";
30029
+ const v = true ? "2.46.5" : "unknown";
29967
30030
  console.log(`${import_picocolors15.default.bold("codeam-cli")} ${import_picocolors15.default.cyan(v)}`);
29968
30031
  }
29969
30032
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeam-cli",
3
- "version": "2.46.4",
3
+ "version": "2.46.5",
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",