codeam-cli 2.18.2 → 2.20.0

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 +123 -0
  2. package/dist/index.js +41 -37
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,129 @@ 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.19.0] — 2026-05-24
8
+
9
+ ### Added
10
+
11
+ - **both-plugins:** PostHog telemetry, mirrors the CLI (closes #95) (#142)
12
+ - **both-plugins:** Bundle Hanken Grotesk + JetBrains Mono fonts (closes #96) (#147)
13
+ - **vsc-plugin:** Add Copy Install Command CTA to empty agents state (closes #116) (#166)
14
+ - **vsc-plugin:** 3-state status bar with rich Markdown tooltip (closes #115) (#167)
15
+ - **both-plugins:** All-detector agent discovery; enable cursor/coderabbit/aider (closes #102 follow-up) (#171)
16
+ - **both-plugins:** A11y pass — ARIA, focus rings, mnemonics, focus order (closes #106) (#172)
17
+ - **both-plugins:** FooterStatusStrip — at-a-glance connection summary (closes #114) (#174)
18
+ - **vsc-plugin:** Brand polish — GlassCard + cyberpunk h3 voice (closes #79) (#175)
19
+
20
+ ### CI
21
+
22
+ - Drop node 18 + skip Vitest on Windows + advisory backend probes (#128)
23
+
24
+ ### Changed
25
+
26
+ - **vsc-plugin:** Split controller-panel.ts (partial #89) (#143)
27
+ - **jetbrains-plugin:** Extract RemoteCommandRouter (partial #89) (#144)
28
+ - **jetbrains-plugin:** Split AgentOutputMonitor — publisher + text utils (partial #89) (#145)
29
+ - **both-plugins:** Remove dead WebSocketService + AgentBridgeService (closes #90) (#149)
30
+ - **jetbrains-plugin:** Extract RoundedPanel + DeviceConnectionPanel (further #89) (#151)
31
+ - **jetbrains-plugin:** Split TerminalAgentService — publisher + reader (further #89) (#152)
32
+ - **jetbrains-plugin:** Extract Swing-walk helpers from AgentOutputMonitor (further #89) (#153)
33
+ - **jetbrains-plugin:** Extract Cascade JS + Codeium process tap (further #89) (#154)
34
+ - **jetbrains-plugin:** Extract AIAssistant text-extraction helpers (further #89) (#155)
35
+ - **jetbrains-plugin:** Extract JcefCaptureState from AgentOutputMonitor (closes #89 follow-up) (#156)
36
+ - **jetbrains-plugin:** Split ControllerPanel HTTP + QR + row factory (closes #89 follow-up) (#157)
37
+ - **shared:** Centralize PROTOCOL_VERSION + lifecycle constants (closes #97) (#164)
38
+ - **both-plugins:** Lock notification voice to canonical CodeAgent Mobile copy (closes #105) (#165)
39
+ - **vsc-plugin:** Deprecate Claude PTY-directo + Claude handlers (closes #102) (#169)
40
+ - **jetbrains-plugin:** Deprecate Claude PTY-directo + handlers (closes #102) (#170)
41
+
42
+ ### Chore
43
+
44
+ - **jetbrains-plugin:** Delete dead RobotPasteStrategy (partial #90) (#139)
45
+ - **workflow:** Delete release-single.yml — drift surface (closes #110) (#158)
46
+ - **both-plugins:** Wire logger.trace into every empty catch (closes #111) (#173)
47
+
48
+ ### Fixed
49
+
50
+ - **ci:** Smoke test reads stderr too — banners moved off stdout in v2.18.x
51
+ - **vsc-plugin:** Add webview CSP + render QR locally (closes #70) (#117)
52
+ - **both-plugins:** Store pluginAuthToken in SecretStorage / PasswordSafe (closes #71) (#118)
53
+ - **vsc-plugin:** Authenticate the observer-bridge on 127.0.0.1:47832 (closes #72) (#119)
54
+ - **vsc-plugin:** Realpath candidate + workspace before sandbox check (closes #73) (#120)
55
+ - **vsc-plugin:** Gate workbench-injection cleanup behind a one-shot flag (closes #74) (#121)
56
+ - **jetbrains-plugin:** Drop untilBuild cap + re-enable plugin-structure warnings (closes #76) (#122)
57
+ - **jetbrains-plugin:** Adopt CodeAgent Mobile brand palette + drop stale strings (closes #80) (#123)
58
+ - **jetbrains-plugin:** Lift resume_session 500ms sleeps off EDT + WS reader (partial #75) (#124)
59
+ - **jetbrains-plugin:** Surface action group under Tools menu (closes #77) (#125)
60
+ - **both-plugins:** 401 recovery — clear token, stop transports, surface re-pair UX (closes #78) (#126)
61
+ - **vsc-plugin:** Adopt CodeAgent brand palette in webview (partial #79) (#127)
62
+ - **cli:** Make tests + parser cross-platform; restore Windows in CI (#129)
63
+ - **both-plugins:** Align clearRemoteOutput on CLI wire shape (closes #83) (#130)
64
+ - **both-plugins:** Honor heartbeatIntervalMs setting in CommandRelayService (closes #84) (#131)
65
+ - **both-plugins:** Cap base64 attachments at 10 MB (closes #92) (#132)
66
+ - **both-plugins:** Refuse to overwrite malformed MCP config (closes #93) (#133)
67
+ - **vsc-plugin:** Exclude .pdb + tests from .vsix (closes #86) (#134)
68
+ - **both-plugins:** De-dup commands by id on SSE reconnect (closes #85) (#135)
69
+ - **both-plugins:** Surface a 3-state Connected/Reconnecting/Offline dot (closes #94) (#136)
70
+ - **both-plugins:** Align strategy contract — same fields + StrategyResult (closes #82) (#137)
71
+ - **vsc-plugin:** Defer eager activation work to first pair (closes #87) (#138)
72
+ - **both-plugins:** Align command-handler surface (closes #81) (#140)
73
+ - **vsc-plugin:** Drop Python PTY helper, route Claude through node-pty (closes #88) (#146)
74
+ - **jetbrains-plugin:** Lift remaining EDT-blocking sites in dispatch (closes #75) (#150)
75
+ - **jetbrains-plugin:** Multi-IDE verifier matrix + dynamic-plugin marker (closes #100, #108) (#159)
76
+ - **jetbrains-plugin:** Track all known projects in IdeIntegrationService (closes #99) (#160)
77
+ - **vsc-plugin:** Per-window port + per-workspace pluginId (closes #103) (#161)
78
+ - **vsc-plugin:** Cache SettingsService config + react to mid-session changes (closes #107) (#162)
79
+ - **vsc-plugin:** Drop \`as unknown as Record<string, unknown>\` casts (closes #104) (#163)
80
+
81
+ ### Tests
82
+
83
+ - **vsc-plugin:** Cover webview-security helpers + extract sanitizeSessionId (partial #91) (#141)
84
+ - **vsc-plugin:** Cover CommandRelayService dispatch + dedup + state (closes #91) (#148)
85
+
86
+ ## [2.18.2] — 2026-05-24
87
+
88
+ ### Fixed
89
+
90
+ - **cli:** Doctor node-pty check uses vendored loader + skips non-windows
91
+
92
+ ## [2.18.1] — 2026-05-24
93
+
94
+ ### Added
95
+
96
+ - **cli:** Split AgentStrategy into Interactive + Batch shapes (#58)
97
+ - **cli:** CodeRabbit BatchAgentStrategy (#59)
98
+ - **cli:** Cursor agent strategy (InteractiveAgentStrategy) (#60)
99
+ - **cli:** Aider agent strategy (InteractiveAgentStrategy) (#61)
100
+ - **cli:** \`codeam doctor\` diagnostic command (#64)
101
+ - **cli:** PostHog telemetry with full session + user context (#65)
102
+ - **cli:** Log rotation + JSON mode + XDG-aware paths (#66)
103
+ - **cli:** Quick wins bundle — banner→stderr, unknown cmd, exit-codes, --api-key-file, logout heartbeat (#67)
104
+ - **cli:** Unknown-command typo suggester + shell completion command (#68)
105
+
106
+ ### CI
107
+
108
+ - **cli:** MacOS runner + Node 18/20/22 matrix + coverage gate (#63)
109
+
110
+ ### Changed
111
+
112
+ - **cli:** Extract OsStrategy interface — pure helpers slice (#48)
113
+ - **cli:** Move buildClaudeLaunch wrap to OsStrategy.buildLaunch (#49)
114
+ - **cli:** Inject OsStrategy into RuntimeStrategy — compose, don't branch (#50)
115
+ - **cli:** Move PTY factories under OsStrategy.createPtyStrategies (#51)
116
+ - **cli:** Relocate claude-resolver + claude-installer to agents/claude/ (#53)
117
+ - **cli:** Extract LinkStrategy + drop link.ts AGENT_META hardcode (#56)
118
+ - **cli:** Switch HistoryService to /api/sessions/conversation + /list (#54)
119
+
120
+ ### Fixed
121
+
122
+ - **cli:** AgentService.restart routes through RuntimeStrategy (#52)
123
+ - **cli:** Cap PtyBuffer + StreamingEmitter rawBuffer + eager cleanup on exit (#57)
124
+ - **cli:** Doctor marks agent-binary probes as optional
125
+
126
+ ### Tests
127
+
128
+ - **cli:** Agent contract suite — one spec runs against every registered agent (#62)
129
+
7
130
  ## [2.17.7] — 2026-05-24
8
131
 
9
132
  ### Fixed
package/dist/index.js CHANGED
@@ -89,6 +89,9 @@ var require_src = __commonJS({
89
89
  // src/commands/start.ts
90
90
  var import_picocolors2 = __toESM(require("picocolors"));
91
91
 
92
+ // ../../packages/shared/src/protocol/constants.ts
93
+ var PROTOCOL_VERSION = "2.0.0";
94
+
92
95
  // ../../packages/shared/src/protocol/renderToLines.ts
93
96
  function renderToLines(raw) {
94
97
  const screen = [""];
@@ -275,11 +278,7 @@ var AGENT_REGISTRY = {
275
278
  id: "coderabbit",
276
279
  displayName: "CodeRabbit",
277
280
  binaryName: "coderabbit",
278
- // Gated behind a feature flag until the per-agent contract test +
279
- // a real PR review smoke pass on a paid CodeRabbit tenant. Strategy
280
- // is fully implemented (BatchAgentStrategy); the flip from false →
281
- // true happens in a follow-up release.
282
- enabled: false,
281
+ enabled: true,
283
282
  supportedAuthKinds: ["oauth_token", "api_key"],
284
283
  preferredAuthKind: "oauth_token"
285
284
  },
@@ -287,12 +286,7 @@ var AGENT_REGISTRY = {
287
286
  id: "cursor",
288
287
  displayName: "Cursor Agent",
289
288
  binaryName: "cursor-agent",
290
- // Gated. Strategy implemented as InteractiveAgentStrategy; TUI
291
- // parser borrows the Codex baseline because Cursor's CLI ships a
292
- // similar ratatui-style chrome. Real parser fixtures need to be
293
- // captured against a paid Cursor account before the flag flips
294
- // false → true.
295
- enabled: false,
289
+ enabled: true,
296
290
  supportedAuthKinds: ["oauth_token", "api_key"],
297
291
  preferredAuthKind: "oauth_token"
298
292
  },
@@ -300,12 +294,10 @@ var AGENT_REGISTRY = {
300
294
  id: "aider",
301
295
  displayName: "Aider",
302
296
  binaryName: "aider",
303
- // Gated. Aider is OAuth-less — auth is ANTHROPIC_API_KEY / OPENAI_API_KEY
304
- // / etc. env vars. The link flow surfaces this via the existing
305
- // --api-key escape hatch in commands/link.ts. Flip false true
306
- // after a real PTY capture lands + the contract test passes.
307
- enabled: false,
308
- // Aider only supports api_key (raw model-provider key, not OAuth).
297
+ enabled: true,
298
+ // Aider is OAuth-less auth is via ANTHROPIC_API_KEY / OPENAI_API_KEY
299
+ // / etc. env vars or `~/.aider.conf.yml`. The link flow surfaces
300
+ // this via the existing --api-key escape hatch in commands/link.ts.
309
301
  supportedAuthKinds: ["api_key"],
310
302
  preferredAuthKind: "api_key"
311
303
  }
@@ -324,6 +316,15 @@ function isKnownAgentId(id) {
324
316
 
325
317
  // ../../packages/shared/src/api-url.ts
326
318
  var DEFAULT_API_BASE_URL = "https://api.codeagent-mobile.com";
319
+ var DEV_API_BASE_URL = "https://dev-api.codeagent-mobile.com";
320
+ function resolveApiBaseUrl() {
321
+ const env = globalThis.process?.env;
322
+ const explicit = env?.CODEAM_API_URL?.trim();
323
+ if (explicit) return explicit;
324
+ const testFlag = env?.CODEAM_TEST_MODE?.trim();
325
+ if (testFlag === "1" || testFlag?.toLowerCase() === "true") return DEV_API_BASE_URL;
326
+ return DEFAULT_API_BASE_URL;
327
+ }
327
328
 
328
329
  // src/config.ts
329
330
  var fs = __toESM(require("fs"));
@@ -440,7 +441,7 @@ var import_qrcode_terminal = __toESM(require("qrcode-terminal"));
440
441
  // package.json
441
442
  var package_default = {
442
443
  name: "codeam-cli",
443
- version: "2.18.2",
444
+ version: "2.20.0",
444
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.",
445
446
  type: "commonjs",
446
447
  main: "dist/index.js",
@@ -627,7 +628,7 @@ function computePollDelay({ baseMs, failures }) {
627
628
  }
628
629
 
629
630
  // src/services/pairing.service.ts
630
- var API_BASE = process.env.CODEAM_API_URL ?? DEFAULT_API_BASE_URL;
631
+ var API_BASE = resolveApiBaseUrl();
631
632
  async function requestCode(pluginId) {
632
633
  try {
633
634
  const runtime = process.env.CODESPACES === "true" ? "github-codespaces" : "local";
@@ -5739,7 +5740,7 @@ function readAnonId() {
5739
5740
  }
5740
5741
  function superProperties() {
5741
5742
  return {
5742
- cliVersion: true ? "2.18.2" : "0.0.0-dev",
5743
+ cliVersion: true ? "2.20.0" : "0.0.0-dev",
5743
5744
  nodeVersion: process.version,
5744
5745
  platform: process.platform,
5745
5746
  arch: process.arch,
@@ -5830,7 +5831,7 @@ function maybePrintFirstRunBanner() {
5830
5831
  }
5831
5832
 
5832
5833
  // src/services/command-relay.service.ts
5833
- var API_BASE2 = process.env.CODEAM_API_URL ?? DEFAULT_API_BASE_URL;
5834
+ var API_BASE2 = resolveApiBaseUrl();
5834
5835
  var CommandRelayService = class {
5835
5836
  constructor(pluginId, onCommand, agentMeta) {
5836
5837
  this.pluginId = pluginId;
@@ -10599,7 +10600,7 @@ var SEVERITY_MAP = {
10599
10600
  };
10600
10601
  function parseReview(stdout) {
10601
10602
  const hunks = [];
10602
- const lines = stdout.split("\n");
10603
+ const lines = stdout.split(/\r?\n/);
10603
10604
  for (const line of lines) {
10604
10605
  const m = line.match(HUNK_LINE_RE);
10605
10606
  if (!m) continue;
@@ -11165,17 +11166,13 @@ var ChromeStepTracker = class {
11165
11166
  // src/services/output/chunk-emitter.ts
11166
11167
  var https3 = __toESM(require("https"));
11167
11168
  var http3 = __toESM(require("http"));
11168
- var API_BASE3 = process.env.CODEAM_API_URL ?? DEFAULT_API_BASE_URL;
11169
+ var API_BASE3 = resolveApiBaseUrl();
11169
11170
  var ChunkEmitter = class {
11170
11171
  constructor(opts) {
11171
11172
  this.opts = opts;
11172
11173
  this.headers = {
11173
11174
  "Content-Type": "application/json",
11174
- // Tell the backend which wire-format version we speak so
11175
- // it can route legacy translations / 426 us when we're
11176
- // too far behind. Bumped to 2.0.0 with the discriminated-
11177
- // chunk + delta-chrome refactor in this release.
11178
- "X-Codeam-Protocol-Version": "2.0.0",
11175
+ "X-Codeam-Protocol-Version": PROTOCOL_VERSION,
11179
11176
  ...vercelBypassHeader()
11180
11177
  };
11181
11178
  if (opts.pluginAuthToken) {
@@ -11674,7 +11671,7 @@ var historyRecordSchema = import_zod.z.object({
11674
11671
  content: import_zod.z.union([import_zod.z.string(), import_zod.z.array(import_zod.z.unknown())]).optional()
11675
11672
  }).passthrough().optional()
11676
11673
  }).passthrough();
11677
- var API_BASE4 = process.env.CODEAM_API_URL ?? DEFAULT_API_BASE_URL;
11674
+ var API_BASE4 = resolveApiBaseUrl();
11678
11675
  function extractText2(content) {
11679
11676
  if (typeof content === "string") return content;
11680
11677
  if (Array.isArray(content)) {
@@ -12281,7 +12278,7 @@ function _post2(url, headers, payload) {
12281
12278
  }
12282
12279
 
12283
12280
  // src/services/file-watcher.service.ts
12284
- var API_BASE5 = process.env.CODEAM_API_URL ?? DEFAULT_API_BASE_URL;
12281
+ var API_BASE5 = resolveApiBaseUrl();
12285
12282
  var DEBOUNCE_MS = 250;
12286
12283
  var MAX_RETRIES = 2;
12287
12284
  var RETRY_BACKOFF_MS = 300;
@@ -12757,7 +12754,7 @@ function _get(url, headers) {
12757
12754
  }
12758
12755
 
12759
12756
  // src/services/streaming-emitter.service.ts
12760
- var API_BASE6 = process.env.CODEAM_API_URL ?? DEFAULT_API_BASE_URL;
12757
+ var API_BASE6 = resolveApiBaseUrl();
12761
12758
  var TICK_MS = 50;
12762
12759
  var ANSWER_POLL_MS = 1500;
12763
12760
  var SELECTOR_STABLE_MS = 800;
@@ -14629,7 +14626,7 @@ async function pair(args2 = []) {
14629
14626
  var fs24 = __toESM(require("fs"));
14630
14627
  var os24 = __toESM(require("os"));
14631
14628
  var import_crypto6 = require("crypto");
14632
- var API_BASE7 = process.env.CODEAM_API_URL ?? DEFAULT_API_BASE_URL;
14629
+ var API_BASE7 = resolveApiBaseUrl();
14633
14630
  function fail(msg) {
14634
14631
  console.error(`
14635
14632
  ${msg}
@@ -14859,7 +14856,7 @@ function status() {
14859
14856
 
14860
14857
  // src/commands/logout.ts
14861
14858
  var import_picocolors6 = __toESM(require("picocolors"));
14862
- var API_BASE8 = process.env.CODEAM_API_URL ?? DEFAULT_API_BASE_URL;
14859
+ var API_BASE8 = resolveApiBaseUrl();
14863
14860
  async function notifyBackendOffline() {
14864
14861
  const cfg = loadCliConfig();
14865
14862
  const pluginIds = /* @__PURE__ */ new Set([
@@ -17333,8 +17330,8 @@ function checkChokidar() {
17333
17330
  }
17334
17331
  async function doctor(args2 = []) {
17335
17332
  const json = args2.includes("--json");
17336
- const cliVersion = true ? "2.18.2" : "0.0.0-dev";
17337
- const apiBase = process.env.CODEAM_API_URL ?? DEFAULT_API_BASE_URL;
17333
+ const cliVersion = true ? "2.20.0" : "0.0.0-dev";
17334
+ const apiBase = resolveApiBaseUrl();
17338
17335
  const diagnosticId = (0, import_node_crypto5.randomUUID)();
17339
17336
  log.info("doctor", `run id=${diagnosticId} cli=${cliVersion}`);
17340
17337
  const [dns, health] = await Promise.all([
@@ -17384,6 +17381,13 @@ ${import_picocolors12.default.bold(" codeam doctor")}
17384
17381
  `);
17385
17382
  out2.write(` ${import_picocolors12.default.dim("api")} ${r.apiBase}
17386
17383
  `);
17384
+ if (process.env.CODEAM_TEST_MODE === "1" || process.env.CODEAM_TEST_MODE?.toLowerCase() === "true") {
17385
+ out2.write(` ${import_picocolors12.default.dim("mode")} ${import_picocolors12.default.yellow("TEST_MODE \u2014 using dev preview")}
17386
+ `);
17387
+ } else if (process.env.CODEAM_API_URL) {
17388
+ out2.write(` ${import_picocolors12.default.dim("mode")} ${import_picocolors12.default.yellow("CODEAM_API_URL override")}
17389
+ `);
17390
+ }
17387
17391
  out2.write(` ${import_picocolors12.default.dim("diag id")} ${r.diagnosticId}
17388
17392
  `);
17389
17393
  out2.write("\n");
@@ -17525,7 +17529,7 @@ async function completion(args2) {
17525
17529
  // src/commands/version.ts
17526
17530
  var import_picocolors13 = __toESM(require("picocolors"));
17527
17531
  function version2() {
17528
- const v = true ? "2.18.2" : "unknown";
17532
+ const v = true ? "2.20.0" : "unknown";
17529
17533
  console.log(`${import_picocolors13.default.bold("codeam-cli")} ${import_picocolors13.default.cyan(v)}`);
17530
17534
  }
17531
17535
 
@@ -17753,7 +17757,7 @@ function checkForUpdates() {
17753
17757
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
17754
17758
  if (process.env.CI) return;
17755
17759
  if (!process.stdout.isTTY) return;
17756
- const current = true ? "2.18.2" : null;
17760
+ const current = true ? "2.20.0" : null;
17757
17761
  if (!current) return;
17758
17762
  const cache = readCache();
17759
17763
  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.18.2",
3
+ "version": "2.20.0",
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",