codeam-cli 2.23.7 → 2.23.9

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,24 @@ 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.23.8] — 2026-05-26
8
+
9
+ ### Added
10
+
11
+ - **cli:** Capture ~/.claude.json on codeam link claude (#196)
12
+
13
+ ## [2.23.7] — 2026-05-26
14
+
15
+ ### Added
16
+
17
+ - **cli:** Emit typed agent_banner chunk for Claude startup splash (#195)
18
+
19
+ ## [2.23.6] — 2026-05-26
20
+
21
+ ### Fixed
22
+
23
+ - **cli:** Raise listProjectFiles cap from 5000 to 50000 (#194)
24
+
7
25
  ## [2.23.5] — 2026-05-25
8
26
 
9
27
  ### Added
package/dist/index.js CHANGED
@@ -441,7 +441,7 @@ var import_qrcode_terminal = __toESM(require("qrcode-terminal"));
441
441
  // package.json
442
442
  var package_default = {
443
443
  name: "codeam-cli",
444
- version: "2.23.7",
444
+ version: "2.23.9",
445
445
  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.",
446
446
  type: "commonjs",
447
447
  main: "dist/index.js",
@@ -718,6 +718,12 @@ async function postLinkCredential(input) {
718
718
  if (input.modelPreference) {
719
719
  body.modelPreference = input.modelPreference;
720
720
  }
721
+ if (input.agentState) {
722
+ body.agentState = input.agentState;
723
+ }
724
+ if (input.preserveSession) {
725
+ body.preserveSession = true;
726
+ }
721
727
  try {
722
728
  await _transport.postJsonAuthed(
723
729
  `${API_BASE}/api/plugin/agents/${input.agentId}/link`,
@@ -5768,7 +5774,7 @@ function readAnonId() {
5768
5774
  }
5769
5775
  function superProperties() {
5770
5776
  return {
5771
- cliVersion: true ? "2.23.7" : "0.0.0-dev",
5777
+ cliVersion: true ? "2.23.9" : "0.0.0-dev",
5772
5778
  nodeVersion: process.version,
5773
5779
  platform: process.platform,
5774
5780
  arch: process.arch,
@@ -9036,11 +9042,12 @@ function claudeCredentialsPaths() {
9036
9042
  ];
9037
9043
  }
9038
9044
  async function extractLocalClaudeToken() {
9045
+ const agentState = readClaudeAgentState();
9039
9046
  for (const flat of claudeCredentialsPaths()) {
9040
9047
  if (!fs7.existsSync(flat)) continue;
9041
9048
  const credential = fs7.readFileSync(flat, "utf8").trim();
9042
9049
  if (credential.length > 0) {
9043
- return { method: "oauth", credential, source: "flat-file" };
9050
+ return { method: "oauth", credential, source: "flat-file", agentState };
9044
9051
  }
9045
9052
  }
9046
9053
  if (process.platform === "darwin") {
@@ -9053,7 +9060,7 @@ async function extractLocalClaudeToken() {
9053
9060
  );
9054
9061
  const credential = stdout.trim();
9055
9062
  if (credential.length > 0) {
9056
- return { method: "oauth", credential, source: "macos-keychain" };
9063
+ return { method: "oauth", credential, source: "macos-keychain", agentState };
9057
9064
  }
9058
9065
  } catch {
9059
9066
  }
@@ -9061,6 +9068,19 @@ async function extractLocalClaudeToken() {
9061
9068
  }
9062
9069
  return null;
9063
9070
  }
9071
+ function readClaudeAgentState() {
9072
+ const STATE_MAX_BYTES = 256 * 1024;
9073
+ const candidate = path10.join(os9.homedir(), ".claude.json");
9074
+ try {
9075
+ if (!fs7.existsSync(candidate)) return void 0;
9076
+ const buf = fs7.readFileSync(candidate);
9077
+ if (buf.length === 0 || buf.length > STATE_MAX_BYTES) return void 0;
9078
+ const text = buf.toString("utf8").trim();
9079
+ return text.length > 0 ? text : void 0;
9080
+ } catch {
9081
+ return void 0;
9082
+ }
9083
+ }
9064
9084
 
9065
9085
  // src/agents/claude/link.ts
9066
9086
  function claudeCredentialLocator() {
@@ -15251,7 +15271,8 @@ async function uploadAndSucceed(ctx, paired, pluginId, token) {
15251
15271
  pluginId,
15252
15272
  pluginAuthToken: paired.pluginAuthToken,
15253
15273
  method: token.method,
15254
- credential: token.credential
15274
+ credential: token.credential,
15275
+ agentState: token.agentState
15255
15276
  });
15256
15277
  if (!result.ok) {
15257
15278
  uploadSpin.stop("Failed");
@@ -16079,6 +16100,14 @@ async function pair(args2 = []) {
16079
16100
  });
16080
16101
  showSuccess(`Paired with ${info.userName} (${info.plan})`);
16081
16102
  console.log("");
16103
+ if (info.pluginAuthToken) {
16104
+ void autoLinkAfterPair({
16105
+ agentId,
16106
+ sessionId: info.sessionId,
16107
+ pluginId,
16108
+ pluginAuthToken: info.pluginAuthToken
16109
+ });
16110
+ }
16082
16111
  resolve5();
16083
16112
  },
16084
16113
  () => {
@@ -16093,6 +16122,42 @@ async function pair(args2 = []) {
16093
16122
  });
16094
16123
  await start();
16095
16124
  }
16125
+ async function autoLinkAfterPair(opts) {
16126
+ if (!opts.agentId) return;
16127
+ try {
16128
+ const strategy = createAgentStrategy(opts.agentId);
16129
+ const locator = strategy.credentialLocator();
16130
+ const token = await locator.extract();
16131
+ if (!token) {
16132
+ capture("pair_auto_link_skipped", { agentId: opts.agentId, reason: "no_local_creds" });
16133
+ return;
16134
+ }
16135
+ const res = await postLinkCredential({
16136
+ agentId: locator.publicId,
16137
+ sessionId: opts.sessionId,
16138
+ pluginId: opts.pluginId,
16139
+ pluginAuthToken: opts.pluginAuthToken,
16140
+ method: token.method,
16141
+ credential: token.credential,
16142
+ agentState: token.agentState,
16143
+ preserveSession: true
16144
+ });
16145
+ if (res.ok) {
16146
+ capture("pair_auto_link_succeeded", {
16147
+ agentId: opts.agentId,
16148
+ source: token.source,
16149
+ hasState: Boolean(token.agentState)
16150
+ });
16151
+ } else {
16152
+ capture("pair_auto_link_failed", { agentId: opts.agentId, status: res.status });
16153
+ }
16154
+ } catch (err) {
16155
+ capture("pair_auto_link_threw", {
16156
+ agentId: opts.agentId,
16157
+ error: err instanceof Error ? err.message : String(err)
16158
+ });
16159
+ }
16160
+ }
16096
16161
 
16097
16162
  // src/commands/pair-auto.ts
16098
16163
  var fs28 = __toESM(require("fs"));
@@ -18482,7 +18547,7 @@ function checkChokidar() {
18482
18547
  }
18483
18548
  async function doctor(args2 = []) {
18484
18549
  const json = args2.includes("--json");
18485
- const cliVersion = true ? "2.23.7" : "0.0.0-dev";
18550
+ const cliVersion = true ? "2.23.9" : "0.0.0-dev";
18486
18551
  const apiBase = resolveApiBaseUrl();
18487
18552
  const diagnosticId = (0, import_node_crypto5.randomUUID)();
18488
18553
  log.info("doctor", `run id=${diagnosticId} cli=${cliVersion}`);
@@ -18681,7 +18746,7 @@ async function completion(args2) {
18681
18746
  // src/commands/version.ts
18682
18747
  var import_picocolors13 = __toESM(require("picocolors"));
18683
18748
  function version2() {
18684
- const v = true ? "2.23.7" : "unknown";
18749
+ const v = true ? "2.23.9" : "unknown";
18685
18750
  console.log(`${import_picocolors13.default.bold("codeam-cli")} ${import_picocolors13.default.cyan(v)}`);
18686
18751
  }
18687
18752
 
@@ -18909,7 +18974,7 @@ function checkForUpdates() {
18909
18974
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
18910
18975
  if (process.env.CI) return;
18911
18976
  if (!process.stdout.isTTY) return;
18912
- const current = true ? "2.23.7" : null;
18977
+ const current = true ? "2.23.9" : null;
18913
18978
  if (!current) return;
18914
18979
  const cache = readCache();
18915
18980
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeam-cli",
3
- "version": "2.23.7",
3
+ "version": "2.23.9",
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",