codeam-cli 2.43.3 → 2.43.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.
Files changed (3) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/index.js +136 -13
  3. package/package.json +1 -1
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.43.4] — 2026-06-25
8
+
9
+ ### Fixed
10
+
11
+ - **cli:** Codex conversation resume loads the transcript (per-agent history)
12
+
13
+ ## [2.43.3] — 2026-06-25
14
+
15
+ ### Fixed
16
+
17
+ - **cli:** Codex can reach the Beads/Dolt socket in the autonomous plane
18
+
7
19
  ## [2.43.2] — 2026-06-25
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.43.3" : "0.0.0-dev",
5400
+ cliVersion: true ? "2.43.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.43.3",
5581
+ version: "2.43.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",
@@ -12222,6 +12222,64 @@ function listResumableSessions2(cwd, homeOverride) {
12222
12222
  out2.sort((a, b) => b.timestamp - a.timestamp);
12223
12223
  return out2;
12224
12224
  }
12225
+ function resolveHistoryFile(cwd, sessionId, homeOverride) {
12226
+ const home = homeOverride ?? import_node_os.default.homedir();
12227
+ const sessionsRoot = import_node_path2.default.join(home, ".codex", "sessions");
12228
+ if (!import_node_fs3.default.existsSync(sessionsRoot)) return null;
12229
+ let resolvedCurrent;
12230
+ try {
12231
+ resolvedCurrent = import_node_fs3.default.realpathSync(cwd);
12232
+ } catch {
12233
+ resolvedCurrent = import_node_path2.default.resolve(cwd);
12234
+ }
12235
+ const now = /* @__PURE__ */ new Date();
12236
+ for (let dayOffset = 0; dayOffset < 7; dayOffset += 1) {
12237
+ const d3 = new Date(now.getTime() - dayOffset * 24 * 60 * 60 * 1e3);
12238
+ const yyyy = String(d3.getUTCFullYear());
12239
+ const mm = String(d3.getUTCMonth() + 1).padStart(2, "0");
12240
+ const dd = String(d3.getUTCDate()).padStart(2, "0");
12241
+ const dayDir = import_node_path2.default.join(sessionsRoot, yyyy, mm, dd);
12242
+ if (!import_node_fs3.default.existsSync(dayDir)) continue;
12243
+ let dayFiles;
12244
+ try {
12245
+ dayFiles = import_node_fs3.default.readdirSync(dayDir, { withFileTypes: true });
12246
+ } catch {
12247
+ continue;
12248
+ }
12249
+ for (const entry of dayFiles) {
12250
+ if (!entry.isFile()) continue;
12251
+ if (!entry.name.startsWith("rollout-") || !entry.name.endsWith(".jsonl")) continue;
12252
+ const filePath = import_node_path2.default.join(dayDir, entry.name);
12253
+ let metaCwd;
12254
+ let metaId;
12255
+ try {
12256
+ const raw = import_node_fs3.default.readFileSync(filePath, "utf8");
12257
+ for (const line of raw.split("\n")) {
12258
+ if (!line.trim()) continue;
12259
+ const rec = parseLine(line);
12260
+ if (!rec) continue;
12261
+ if (rec.type === "session_meta") {
12262
+ const meta = rec.payload;
12263
+ metaCwd = typeof meta?.cwd === "string" ? meta.cwd : void 0;
12264
+ metaId = typeof meta?.id === "string" ? meta.id : void 0;
12265
+ break;
12266
+ }
12267
+ }
12268
+ } catch {
12269
+ continue;
12270
+ }
12271
+ if (metaId !== sessionId || !metaCwd) continue;
12272
+ let resolvedMeta;
12273
+ try {
12274
+ resolvedMeta = import_node_fs3.default.realpathSync(metaCwd);
12275
+ } catch {
12276
+ resolvedMeta = import_node_path2.default.resolve(metaCwd);
12277
+ }
12278
+ if (resolvedMeta === resolvedCurrent) return filePath;
12279
+ }
12280
+ }
12281
+ return null;
12282
+ }
12225
12283
  function getCurrentUsage2(historyDir) {
12226
12284
  if (!import_node_fs3.default.existsSync(historyDir)) return null;
12227
12285
  const files = import_node_fs3.default.readdirSync(historyDir).filter((f) => f.startsWith("rollout-") && f.endsWith(".jsonl")).map((f) => ({ name: f, full: import_node_path2.default.join(historyDir, f) })).map((e) => ({ ...e, mtime: import_node_fs3.default.statSync(e.full).mtimeMs })).sort((a, b) => b.mtime - a.mtime);
@@ -12386,6 +12444,9 @@ var CodexRuntimeStrategy = class {
12386
12444
  parseHistoryFile(filePath) {
12387
12445
  return parseHistoryFile2(filePath);
12388
12446
  }
12447
+ resolveHistoryFile(cwd, sessionId) {
12448
+ return resolveHistoryFile(cwd, sessionId);
12449
+ }
12389
12450
  getCurrentUsage(historyDir) {
12390
12451
  return getCurrentUsage2(historyDir);
12391
12452
  }
@@ -17402,9 +17463,24 @@ var codexProvisioner = {
17402
17463
  return {};
17403
17464
  }
17404
17465
  };
17466
+ var geminiProvisioner = {
17467
+ write(auth, home) {
17468
+ const settingsJson = path43.join(home, ".gemini", "settings.json");
17469
+ const oauthCreds = path43.join(home, ".gemini", "oauth_creds.json");
17470
+ if (auth.kind === "api_key") {
17471
+ rmIfExists(oauthCreds);
17472
+ writeFile0600(settingsJson, '{"security":{"auth":{"selectedType":"gemini-api-key"}}}');
17473
+ return { GEMINI_API_KEY: auth.value };
17474
+ }
17475
+ writeFile0600(oauthCreds, auth.value);
17476
+ writeFile0600(settingsJson, '{"security":{"auth":{"selectedType":"oauth-personal"}}}');
17477
+ return {};
17478
+ }
17479
+ };
17405
17480
  var PROVISIONERS = {
17406
17481
  claude: claudeProvisioner,
17407
- codex: codexProvisioner
17482
+ codex: codexProvisioner,
17483
+ gemini: geminiProvisioner
17408
17484
  };
17409
17485
  var UnsupportedAgentError = class extends Error {
17410
17486
  agentId;
@@ -17823,7 +17899,7 @@ async function autoUpgradeBeforeCriticalCommand() {
17823
17899
  if (process.env.NODE_ENV === "test") return;
17824
17900
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
17825
17901
  if (process.env.CI) return;
17826
- const current = true ? "2.43.3" : null;
17902
+ const current = true ? "2.43.5" : null;
17827
17903
  if (!current) return;
17828
17904
  const cache = readCache();
17829
17905
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
@@ -17840,7 +17916,7 @@ function checkForUpdates() {
17840
17916
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
17841
17917
  if (process.env.CI) return;
17842
17918
  if (!process.stdout.isTTY) return;
17843
- const current = true ? "2.43.3" : null;
17919
+ const current = true ? "2.43.5" : null;
17844
17920
  if (!current) return;
17845
17921
  const cache = readCache();
17846
17922
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
@@ -18278,7 +18354,7 @@ var defaultSpawner = (env, cwd, args2 = []) => (0, import_node_child_process14.s
18278
18354
  detached: false
18279
18355
  });
18280
18356
  function currentCliVersion() {
18281
- return true ? "2.43.3" : null;
18357
+ return true ? "2.43.5" : null;
18282
18358
  }
18283
18359
  function runCmd(cmd, args2, timeoutMs) {
18284
18360
  return new Promise((resolve7) => {
@@ -20090,9 +20166,56 @@ var HistoryService = class _HistoryService {
20090
20166
  * still fails after all attempts so callers skip newTurnResume instead of
20091
20167
  * showing an empty conversation.
20092
20168
  */
20169
+ /**
20170
+ * Resolve the on-disk transcript file for a conversation, agent-aware.
20171
+ *
20172
+ * Claude stores `<projectDir>/<sessionId>.jsonl`. Other agents name the
20173
+ * file differently and key the session id INSIDE it (Codex rollouts), so
20174
+ * when the strategy exposes `resolveHistoryFile` we defer to it. Returns
20175
+ * null when no transcript exists for this session yet.
20176
+ */
20177
+ resolveConversationFile(sessionId) {
20178
+ if (this.runtime.resolveHistoryFile) {
20179
+ return this.runtime.resolveHistoryFile(this.cwd, sessionId);
20180
+ }
20181
+ return path49.join(this.projectDir, `${sessionId}.jsonl`);
20182
+ }
20183
+ /**
20184
+ * Parse a conversation's messages from disk, agent-aware. Claude uses the
20185
+ * service's own JSONL parser (unchanged); agents with a custom on-disk
20186
+ * layout parse via their strategy's {@link RuntimeStrategy.parseHistoryFile}
20187
+ * (e.g. Codex rollouts), mapping the shared NormalizedMessage shape onto our
20188
+ * wire shape and dropping `system` rows (the conversation view renders only
20189
+ * user/agent). Returns [] when the file is missing/unreadable — same
20190
+ * convention as parseJsonl.
20191
+ */
20192
+ readConversation(sessionId) {
20193
+ if (this.runtime.resolveHistoryFile) {
20194
+ const filePath = this.runtime.resolveHistoryFile(this.cwd, sessionId);
20195
+ if (!filePath) return [];
20196
+ let parsed;
20197
+ try {
20198
+ parsed = this.runtime.parseHistoryFile(filePath);
20199
+ } catch (err) {
20200
+ log.warn("history:readConversation", `parseHistoryFile failed for ${filePath}`, err);
20201
+ return [];
20202
+ }
20203
+ return parsed.filter(
20204
+ (m) => m.role === "user" || m.role === "agent"
20205
+ ).map((m) => {
20206
+ const ms = new Date(m.timestamp).getTime();
20207
+ return {
20208
+ id: m.id,
20209
+ role: m.role,
20210
+ text: m.text,
20211
+ timestamp: Number.isFinite(ms) ? ms : Date.now()
20212
+ };
20213
+ });
20214
+ }
20215
+ return parseJsonl(path49.join(this.projectDir, `${sessionId}.jsonl`));
20216
+ }
20093
20217
  async loadConversation(sessionId) {
20094
- const filePath = path49.join(this.projectDir, `${sessionId}.jsonl`);
20095
- const messages = parseJsonl(filePath);
20218
+ const messages = this.readConversation(sessionId);
20096
20219
  if (messages.length === 0) return;
20097
20220
  const totalBatches = Math.ceil(messages.length / CONVERSATION_BATCH_SIZE);
20098
20221
  const RETRY_DELAYS = [500, 1e3, 2e3, 4e3, 8e3];
@@ -20141,7 +20264,8 @@ var HistoryService = class _HistoryService {
20141
20264
  * or no transcript exists yet (not an error).
20142
20265
  */
20143
20266
  async uploadConversationIfChanged(sessionId) {
20144
- const filePath = path49.join(this.projectDir, `${sessionId}.jsonl`);
20267
+ const filePath = this.resolveConversationFile(sessionId);
20268
+ if (!filePath) return false;
20145
20269
  let mtimeMs;
20146
20270
  try {
20147
20271
  mtimeMs = fs42.statSync(filePath).mtimeMs;
@@ -20183,8 +20307,7 @@ var HistoryService = class _HistoryService {
20183
20307
  sessionId = this.currentConversationId;
20184
20308
  if (!sessionId) return 0;
20185
20309
  }
20186
- const filePath = path49.join(this.projectDir, `${sessionId}.jsonl`);
20187
- const messages = parseJsonl(filePath);
20310
+ const messages = this.readConversation(sessionId);
20188
20311
  if (messages.length === 0) return 0;
20189
20312
  const marker = this.lastUploadedUuid.get(sessionId);
20190
20313
  let newMessages = messages;
@@ -29392,7 +29515,7 @@ function checkChokidar() {
29392
29515
  }
29393
29516
  async function doctor(args2 = []) {
29394
29517
  const json = args2.includes("--json");
29395
- const cliVersion = true ? "2.43.3" : "0.0.0-dev";
29518
+ const cliVersion = true ? "2.43.5" : "0.0.0-dev";
29396
29519
  const apiBase2 = resolveApiBaseUrl();
29397
29520
  const diagnosticId = (0, import_node_crypto8.randomUUID)();
29398
29521
  log.info("doctor", `run id=${diagnosticId} cli=${cliVersion}`);
@@ -29591,7 +29714,7 @@ async function completion(args2) {
29591
29714
  // src/commands/version.ts
29592
29715
  var import_picocolors14 = __toESM(require("picocolors"));
29593
29716
  function version2() {
29594
- const v = true ? "2.43.3" : "unknown";
29717
+ const v = true ? "2.43.5" : "unknown";
29595
29718
  console.log(`${import_picocolors14.default.bold("codeam-cli")} ${import_picocolors14.default.cyan(v)}`);
29596
29719
  }
29597
29720
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeam-cli",
3
- "version": "2.43.3",
3
+ "version": "2.43.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",