codeam-cli 2.60.21 → 2.60.22

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.60.21] — 2026-07-09
8
+
9
+ ### Fixed
10
+
11
+ - **cli:** Baton — discover Codex's self-minted session id (first-turn aware)
12
+
7
13
  ## [2.60.20] — 2026-07-09
8
14
 
9
15
  ### Fixed
package/dist/index.js CHANGED
@@ -5680,7 +5680,7 @@ function readAnonId() {
5680
5680
  }
5681
5681
  function superProperties() {
5682
5682
  return {
5683
- cliVersion: true ? "2.60.21" : "0.0.0-dev",
5683
+ cliVersion: true ? "2.60.22" : "0.0.0-dev",
5684
5684
  nodeVersion: process.version,
5685
5685
  platform: process.platform,
5686
5686
  arch: process.arch,
@@ -5861,7 +5861,7 @@ var os4 = __toESM(require("os"));
5861
5861
  // package.json
5862
5862
  var package_default = {
5863
5863
  name: "codeam-cli",
5864
- version: "2.60.21",
5864
+ version: "2.60.22",
5865
5865
  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.",
5866
5866
  type: "commonjs",
5867
5867
  main: "dist/index.js",
@@ -6932,7 +6932,7 @@ var CommandRelayService = class {
6932
6932
  // fresh + clear the "CLI update available" banner after a self-update
6933
6933
  // (a codespace that reinstalls @latest reconnects via heartbeat, not
6934
6934
  // pair/reconnect). Older backends ignore the extra field.
6935
- ..."2.60.21" ? { ideVersion: "2.60.21" } : {}
6935
+ ..."2.60.22" ? { ideVersion: "2.60.22" } : {}
6936
6936
  }).then(() => log.trace("relay", `heartbeat ok online=${online}`)).catch((err) => log.trace("relay", `heartbeat failed online=${online}`, err));
6937
6937
  }
6938
6938
  /**
@@ -16733,7 +16733,7 @@ async function autoUpgradeBeforeCriticalCommand() {
16733
16733
  if (process.env.NODE_ENV === "test") return;
16734
16734
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
16735
16735
  if (process.env.CI) return;
16736
- const current = true ? "2.60.21" : null;
16736
+ const current = true ? "2.60.22" : null;
16737
16737
  if (!current) return;
16738
16738
  const cache = readCache();
16739
16739
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
@@ -16750,7 +16750,7 @@ function checkForUpdates() {
16750
16750
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
16751
16751
  if (process.env.CI) return;
16752
16752
  if (!process.stdout.isTTY) return;
16753
- const current = true ? "2.60.21" : null;
16753
+ const current = true ? "2.60.22" : null;
16754
16754
  if (!current) return;
16755
16755
  const cache = readCache();
16756
16756
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
@@ -16770,7 +16770,7 @@ var SELF_UPDATE_INTERVAL_MS = 60 * 60 * 1e3;
16770
16770
  var SELF_UPDATE_VIEW_TIMEOUT_MS = 3e4;
16771
16771
  var SELF_UPDATE_INSTALL_TIMEOUT_MS = 18e4;
16772
16772
  function currentCliVersion() {
16773
- return true ? "2.60.21" : null;
16773
+ return true ? "2.60.22" : null;
16774
16774
  }
16775
16775
  function runCmd(cmd, args2, timeoutMs) {
16776
16776
  return new Promise((resolve7) => {
@@ -30118,6 +30118,20 @@ var BatonController = class {
30118
30118
  this._active = "local_tui";
30119
30119
  this.setState("LOCAL_DRIVE");
30120
30120
  }
30121
+ /**
30122
+ * Late-bind the conversation id for an agent (Codex) that minted it only on the
30123
+ * user's first turn, so `begin()` returned null. Fires from the native driver's
30124
+ * background discovery. Idempotent + guarded: only binds while we're still in
30125
+ * the INITIAL, id-less LOCAL_DRIVE — if the user already took control (which
30126
+ * started its own session) or an id is already set, it's a no-op, so a stray
30127
+ * native id can never clobber the live conversation. Re-publishes LOCAL_DRIVE so
30128
+ * the read-only mirror arms on the now-known id.
30129
+ */
30130
+ rebindConversation(conversationId) {
30131
+ if (this._conversationId !== null || this._state !== "LOCAL_DRIVE") return;
30132
+ this._conversationId = conversationId;
30133
+ this.setState("LOCAL_DRIVE");
30134
+ }
30121
30135
  async takeControl() {
30122
30136
  await this.switchDriver(
30123
30137
  "LOCAL_DRIVE",
@@ -30179,7 +30193,7 @@ function parkTerminalForReadonly(term = {}) {
30179
30193
  }
30180
30194
 
30181
30195
  // src/baton/native-tui-driver.ts
30182
- var NativeTuiDriver = class {
30196
+ var NativeTuiDriver = class _NativeTuiDriver {
30183
30197
  constructor(deps) {
30184
30198
  this.deps = deps;
30185
30199
  this.agent = deps.agent;
@@ -30208,6 +30222,9 @@ var NativeTuiDriver = class {
30208
30222
  idleMs;
30209
30223
  now;
30210
30224
  lastOutput;
30225
+ /** How long `start()` waits for a boot-time session store (Kimi) before
30226
+ * falling back to background/late-bind discovery (Codex, first-turn store). */
30227
+ static QUICK_DISCOVER_MS = 8e3;
30211
30228
  outputSvc;
30212
30229
  historySvc;
30213
30230
  setKeepAlive;
@@ -30222,11 +30239,20 @@ var NativeTuiDriver = class {
30222
30239
  await this.agent.spawn();
30223
30240
  const preMinted = this.agent.spawnedSessionId;
30224
30241
  if (preMinted) return preMinted;
30225
- const discovered = await this.deps.runtime.discoverSessionId?.(this.deps.opts.cwd, {
30226
- sinceMs: spawnedAt
30242
+ const discover = this.deps.runtime.discoverSessionId;
30243
+ if (!discover) {
30244
+ throw new Error("NativeTuiDriver: agent did not expose a session id after spawn");
30245
+ }
30246
+ const quick = await discover(this.deps.opts.cwd, {
30247
+ sinceMs: spawnedAt,
30248
+ timeoutMs: _NativeTuiDriver.QUICK_DISCOVER_MS
30249
+ });
30250
+ if (quick) return quick;
30251
+ void discover(this.deps.opts.cwd, { sinceMs: spawnedAt }).then((id) => {
30252
+ if (id) this.deps.onLateBind?.(id);
30253
+ }).catch(() => {
30227
30254
  });
30228
- if (discovered) return discovered;
30229
- throw new Error("NativeTuiDriver: agent did not expose a session id after spawn");
30255
+ return null;
30230
30256
  }
30231
30257
  async stop() {
30232
30258
  this.agent.kill();
@@ -30640,7 +30666,12 @@ async function runBatonSession(opts) {
30640
30666
  cwd: opts.cwd
30641
30667
  },
30642
30668
  getRelay: () => relay,
30643
- getBeads: opts.getBeads ?? (() => null)
30669
+ getBeads: opts.getBeads ?? (() => null),
30670
+ // Late-bind for first-turn-minted ids (Codex): the background discovery
30671
+ // calls this once the user's first terminal turn creates the transcript.
30672
+ // Safe forward-ref — `controller` is initialised long before `begin()` runs,
30673
+ // and onLateBind only fires from inside `begin()`'s spawn.
30674
+ onLateBind: (id) => controller.rebindConversation(id)
30644
30675
  });
30645
30676
  let mirror = null;
30646
30677
  let firstLocalDrive = true;
@@ -33632,7 +33663,7 @@ function checkChokidar() {
33632
33663
  }
33633
33664
  async function doctor(args2 = []) {
33634
33665
  const json = args2.includes("--json");
33635
- const cliVersion = true ? "2.60.21" : "0.0.0-dev";
33666
+ const cliVersion = true ? "2.60.22" : "0.0.0-dev";
33636
33667
  const apiBase2 = resolveApiBaseUrl();
33637
33668
  const diagnosticId = (0, import_node_crypto12.randomUUID)();
33638
33669
  log.info("doctor", `run id=${diagnosticId} cli=${cliVersion}`);
@@ -33831,7 +33862,7 @@ async function completion(args2) {
33831
33862
  // src/commands/version.ts
33832
33863
  var import_picocolors15 = __toESM(require("picocolors"));
33833
33864
  function version2() {
33834
- const v = true ? "2.60.21" : "unknown";
33865
+ const v = true ? "2.60.22" : "unknown";
33835
33866
  console.log(`${import_picocolors15.default.bold("codeam-cli")} ${import_picocolors15.default.cyan(v)}`);
33836
33867
  }
33837
33868
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeam-cli",
3
- "version": "2.60.21",
3
+ "version": "2.60.22",
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",