codeam-cli 2.46.4 → 2.46.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,19 @@ 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.5] — 2026-06-26
8
+
9
+ ### Fixed
10
+
11
+ - **cli:** Collapse thinking onto a per-turn buffer so the activity card doesn't double
12
+ - **cli:** Verify + self-heal the project Dolt DB after provisioning (codeagent-ckq)
13
+
14
+ ## [2.46.4] — 2026-06-26
15
+
16
+ ### Fixed
17
+
18
+ - **cli:** Retry + poll dolt sql-server start so it's up before the agent (codeagent-r5k)
19
+
7
20
  ## [2.46.3] — 2026-06-26
8
21
 
9
22
  ### 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.6" : "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.6",
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,56 @@ 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
+ if (!await projectDbReachable(bd)) {
15256
+ log.info(
15257
+ "beads",
15258
+ `prefix DB '${prefix}' still unreachable after bootstrap \u2014 minting a fresh local DB`
15259
+ );
15260
+ const mint = await bd.run([
15261
+ "init",
15262
+ "-p",
15263
+ prefix,
15264
+ "--shared-server",
15265
+ "--reinit-local",
15266
+ "--discard-remote",
15267
+ `--destroy-token=DESTROY-${prefix}`,
15268
+ "--non-interactive"
15269
+ ]);
15270
+ if (mint.code !== 0) {
15271
+ log.warn(
15272
+ "beads",
15273
+ `bd init --reinit-local for '${prefix}' failed (code=${mint.code}): ${mint.stderr.slice(0, 200)} \u2014 prefix DB may be absent`
15274
+ );
15275
+ }
15276
+ }
15277
+ const reachable = await projectDbReachable(bd);
15278
+ result.serverUp = reachable;
15279
+ result.initialized = reachable;
15280
+ if (!reachable) {
15281
+ log.warn(
15282
+ "beads",
15283
+ `prefix DB '${prefix}' still unreachable after bootstrap + mint \u2014 beads disabled this run`
15284
+ );
15285
+ return result;
15286
+ }
15287
+ log.info("beads", `prefix DB '${prefix}' materialized on shared server`);
15288
+ }
15289
+ } catch (err) {
15290
+ log.warn("beads", "verifying/creating the prefix DB threw (non-fatal)", err);
15291
+ }
15242
15292
  const exp = await bd.run(["config", "set", "export.auto", "true"]);
15243
15293
  result.exportEnabled = exp.code === 0;
15244
15294
  result.agentsWired = await setupAgents(bd, opts.agents ?? []);
@@ -15248,6 +15298,10 @@ async function provisionBeads(opts = {}) {
15248
15298
  );
15249
15299
  return result;
15250
15300
  }
15301
+ async function projectDbReachable(bd) {
15302
+ const ping = await bd.run(["ping"]);
15303
+ return ping.code === 0;
15304
+ }
15251
15305
  async function setupAgents(bd, agents) {
15252
15306
  const wired = [];
15253
15307
  for (const recipe of dedupeRecipes(agents)) {
@@ -17968,7 +18022,7 @@ async function autoUpgradeBeforeCriticalCommand() {
17968
18022
  if (process.env.NODE_ENV === "test") return;
17969
18023
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
17970
18024
  if (process.env.CI) return;
17971
- const current = true ? "2.46.4" : null;
18025
+ const current = true ? "2.46.6" : null;
17972
18026
  if (!current) return;
17973
18027
  const cache = readCache();
17974
18028
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
@@ -17985,7 +18039,7 @@ function checkForUpdates() {
17985
18039
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
17986
18040
  if (process.env.CI) return;
17987
18041
  if (!process.stdout.isTTY) return;
17988
- const current = true ? "2.46.4" : null;
18042
+ const current = true ? "2.46.6" : null;
17989
18043
  if (!current) return;
17990
18044
  const cache = readCache();
17991
18045
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
@@ -18427,7 +18481,7 @@ var defaultSpawner = (env, cwd, args2 = []) => (0, import_node_child_process14.s
18427
18481
  detached: false
18428
18482
  });
18429
18483
  function currentCliVersion() {
18430
- return true ? "2.46.4" : null;
18484
+ return true ? "2.46.6" : null;
18431
18485
  }
18432
18486
  function runCmd(cmd, args2, timeoutMs) {
18433
18487
  return new Promise((resolve7) => {
@@ -23751,8 +23805,18 @@ function reconcileCumulative(existing, incoming) {
23751
23805
  if (incoming.length === 0) return existing;
23752
23806
  if (incoming.startsWith(existing)) return incoming;
23753
23807
  if (existing.startsWith(incoming)) return existing;
23808
+ const shared = commonPrefixLength(existing, incoming);
23809
+ if (shared > 0 && shared >= existing.length / 2) {
23810
+ return existing.slice(0, shared) + incoming.slice(shared);
23811
+ }
23754
23812
  return existing + incoming;
23755
23813
  }
23814
+ function commonPrefixLength(a, b) {
23815
+ const max = Math.min(a.length, b.length);
23816
+ let i = 0;
23817
+ while (i < max && a.charCodeAt(i) === b.charCodeAt(i)) i += 1;
23818
+ return i;
23819
+ }
23756
23820
 
23757
23821
  // src/agents/acp/onboarding.ts
23758
23822
  var import_child_process22 = require("child_process");
@@ -24678,6 +24742,26 @@ var StreamingState = class {
24678
24742
  * no matter how many message ids the adapter spreads it across.
24679
24743
  */
24680
24744
  turnTextChunkId = null;
24745
+ /**
24746
+ * Stable chunkId that ALL `thinking` segments of the current turn collapse
24747
+ * onto (set to the first thought chunk's id, reset each {@link beginTurn}) —
24748
+ * the thinking twin of {@link turnTextChunkId}.
24749
+ *
24750
+ * Why: `claude-agent-acp` (≥0.47) re-emits the CONSOLIDATED thought under a
24751
+ * DIFFERENT message id (the same dedupe misfire that doubles text). The
24752
+ * mapper derives the thinking chunkId from that message id
24753
+ * (`<messageId>::thought`), so the consolidated re-emit lands in a SECOND
24754
+ * `::thought` buffer, BOTH get flushed `isFinal:true`, and the mobile
24755
+ * activity card (which coalesces by chunkId) stacks the two copies → the
24756
+ * thinking doubles ("TheThe user said …briefly.The user said …briefly.").
24757
+ * Text was protected by {@link turnTextChunkId}; thinking was not. Collapsing
24758
+ * every thought segment of a turn onto one reconcile buffer makes the re-emit
24759
+ * a `reconcileCumulative` REPLACE (identical snapshot) instead of a second
24760
+ * buffer. tool_use / tool_result keep their own id within the turn (distinct
24761
+ * bubbles; the adapter does NOT re-emit a consolidated tool snapshot under a
24762
+ * fresh id, so they don't share this bug).
24763
+ */
24764
+ turnThoughtChunkId = null;
24681
24765
  /**
24682
24766
  * Monotonic turn counter, bumped each {@link beginTurn}. Used to NAMESPACE
24683
24767
  * every streaming-chunk id so an id the ACP adapter REUSES across turns can't
@@ -24784,6 +24868,7 @@ var StreamingState = class {
24784
24868
  this.text = "";
24785
24869
  this.streamingChunks.clear();
24786
24870
  this.turnTextChunkId = null;
24871
+ this.turnThoughtChunkId = null;
24787
24872
  this.turnSeq += 1;
24788
24873
  if (this.pending?.kind === "permission") {
24789
24874
  clearTimeout(this.pending.timeoutTimer);
@@ -24795,7 +24880,7 @@ var StreamingState = class {
24795
24880
  await this.publisher.publishOutput({ type: "new_turn", done: false });
24796
24881
  }
24797
24882
  append(delta) {
24798
- const baseId = delta.kind === "text" ? this.turnTextChunkId ??= delta.chunkId : delta.chunkId;
24883
+ const baseId = delta.kind === "text" ? this.turnTextChunkId ??= delta.chunkId : delta.kind === "thinking" ? this.turnThoughtChunkId ??= delta.chunkId : delta.chunkId;
24799
24884
  const chunkId = `t${this.turnSeq}:${baseId}`;
24800
24885
  const existing = this.streamingChunks.get(chunkId);
24801
24886
  if (existing && existing.kind !== delta.kind) {
@@ -29764,7 +29849,7 @@ function checkChokidar() {
29764
29849
  }
29765
29850
  async function doctor(args2 = []) {
29766
29851
  const json = args2.includes("--json");
29767
- const cliVersion = true ? "2.46.4" : "0.0.0-dev";
29852
+ const cliVersion = true ? "2.46.6" : "0.0.0-dev";
29768
29853
  const apiBase2 = resolveApiBaseUrl();
29769
29854
  const diagnosticId = (0, import_node_crypto8.randomUUID)();
29770
29855
  log.info("doctor", `run id=${diagnosticId} cli=${cliVersion}`);
@@ -29963,7 +30048,7 @@ async function completion(args2) {
29963
30048
  // src/commands/version.ts
29964
30049
  var import_picocolors15 = __toESM(require("picocolors"));
29965
30050
  function version2() {
29966
- const v = true ? "2.46.4" : "unknown";
30051
+ const v = true ? "2.46.6" : "unknown";
29967
30052
  console.log(`${import_picocolors15.default.bold("codeam-cli")} ${import_picocolors15.default.cyan(v)}`);
29968
30053
  }
29969
30054
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeam-cli",
3
- "version": "2.46.4",
3
+ "version": "2.46.6",
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",