codeam-cli 2.19.0 → 2.20.1

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,91 @@ 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.20.0] — 2026-05-24
8
+
9
+ ### Added
10
+
11
+ - **shared:** CODEAM_TEST_MODE env var to route clients at dev preview (#176)
12
+
13
+ ## [2.19.0] — 2026-05-24
14
+
15
+ ### Added
16
+
17
+ - **both-plugins:** PostHog telemetry, mirrors the CLI (closes #95) (#142)
18
+ - **both-plugins:** Bundle Hanken Grotesk + JetBrains Mono fonts (closes #96) (#147)
19
+ - **vsc-plugin:** Add Copy Install Command CTA to empty agents state (closes #116) (#166)
20
+ - **vsc-plugin:** 3-state status bar with rich Markdown tooltip (closes #115) (#167)
21
+ - **both-plugins:** All-detector agent discovery; enable cursor/coderabbit/aider (closes #102 follow-up) (#171)
22
+ - **both-plugins:** A11y pass — ARIA, focus rings, mnemonics, focus order (closes #106) (#172)
23
+ - **both-plugins:** FooterStatusStrip — at-a-glance connection summary (closes #114) (#174)
24
+ - **vsc-plugin:** Brand polish — GlassCard + cyberpunk h3 voice (closes #79) (#175)
25
+
26
+ ### CI
27
+
28
+ - Drop node 18 + skip Vitest on Windows + advisory backend probes (#128)
29
+
30
+ ### Changed
31
+
32
+ - **vsc-plugin:** Split controller-panel.ts (partial #89) (#143)
33
+ - **jetbrains-plugin:** Extract RemoteCommandRouter (partial #89) (#144)
34
+ - **jetbrains-plugin:** Split AgentOutputMonitor — publisher + text utils (partial #89) (#145)
35
+ - **both-plugins:** Remove dead WebSocketService + AgentBridgeService (closes #90) (#149)
36
+ - **jetbrains-plugin:** Extract RoundedPanel + DeviceConnectionPanel (further #89) (#151)
37
+ - **jetbrains-plugin:** Split TerminalAgentService — publisher + reader (further #89) (#152)
38
+ - **jetbrains-plugin:** Extract Swing-walk helpers from AgentOutputMonitor (further #89) (#153)
39
+ - **jetbrains-plugin:** Extract Cascade JS + Codeium process tap (further #89) (#154)
40
+ - **jetbrains-plugin:** Extract AIAssistant text-extraction helpers (further #89) (#155)
41
+ - **jetbrains-plugin:** Extract JcefCaptureState from AgentOutputMonitor (closes #89 follow-up) (#156)
42
+ - **jetbrains-plugin:** Split ControllerPanel HTTP + QR + row factory (closes #89 follow-up) (#157)
43
+ - **shared:** Centralize PROTOCOL_VERSION + lifecycle constants (closes #97) (#164)
44
+ - **both-plugins:** Lock notification voice to canonical CodeAgent Mobile copy (closes #105) (#165)
45
+ - **vsc-plugin:** Deprecate Claude PTY-directo + Claude handlers (closes #102) (#169)
46
+ - **jetbrains-plugin:** Deprecate Claude PTY-directo + handlers (closes #102) (#170)
47
+
48
+ ### Chore
49
+
50
+ - **jetbrains-plugin:** Delete dead RobotPasteStrategy (partial #90) (#139)
51
+ - **workflow:** Delete release-single.yml — drift surface (closes #110) (#158)
52
+ - **both-plugins:** Wire logger.trace into every empty catch (closes #111) (#173)
53
+
54
+ ### Fixed
55
+
56
+ - **ci:** Smoke test reads stderr too — banners moved off stdout in v2.18.x
57
+ - **vsc-plugin:** Add webview CSP + render QR locally (closes #70) (#117)
58
+ - **both-plugins:** Store pluginAuthToken in SecretStorage / PasswordSafe (closes #71) (#118)
59
+ - **vsc-plugin:** Authenticate the observer-bridge on 127.0.0.1:47832 (closes #72) (#119)
60
+ - **vsc-plugin:** Realpath candidate + workspace before sandbox check (closes #73) (#120)
61
+ - **vsc-plugin:** Gate workbench-injection cleanup behind a one-shot flag (closes #74) (#121)
62
+ - **jetbrains-plugin:** Drop untilBuild cap + re-enable plugin-structure warnings (closes #76) (#122)
63
+ - **jetbrains-plugin:** Adopt CodeAgent Mobile brand palette + drop stale strings (closes #80) (#123)
64
+ - **jetbrains-plugin:** Lift resume_session 500ms sleeps off EDT + WS reader (partial #75) (#124)
65
+ - **jetbrains-plugin:** Surface action group under Tools menu (closes #77) (#125)
66
+ - **both-plugins:** 401 recovery — clear token, stop transports, surface re-pair UX (closes #78) (#126)
67
+ - **vsc-plugin:** Adopt CodeAgent brand palette in webview (partial #79) (#127)
68
+ - **cli:** Make tests + parser cross-platform; restore Windows in CI (#129)
69
+ - **both-plugins:** Align clearRemoteOutput on CLI wire shape (closes #83) (#130)
70
+ - **both-plugins:** Honor heartbeatIntervalMs setting in CommandRelayService (closes #84) (#131)
71
+ - **both-plugins:** Cap base64 attachments at 10 MB (closes #92) (#132)
72
+ - **both-plugins:** Refuse to overwrite malformed MCP config (closes #93) (#133)
73
+ - **vsc-plugin:** Exclude .pdb + tests from .vsix (closes #86) (#134)
74
+ - **both-plugins:** De-dup commands by id on SSE reconnect (closes #85) (#135)
75
+ - **both-plugins:** Surface a 3-state Connected/Reconnecting/Offline dot (closes #94) (#136)
76
+ - **both-plugins:** Align strategy contract — same fields + StrategyResult (closes #82) (#137)
77
+ - **vsc-plugin:** Defer eager activation work to first pair (closes #87) (#138)
78
+ - **both-plugins:** Align command-handler surface (closes #81) (#140)
79
+ - **vsc-plugin:** Drop Python PTY helper, route Claude through node-pty (closes #88) (#146)
80
+ - **jetbrains-plugin:** Lift remaining EDT-blocking sites in dispatch (closes #75) (#150)
81
+ - **jetbrains-plugin:** Multi-IDE verifier matrix + dynamic-plugin marker (closes #100, #108) (#159)
82
+ - **jetbrains-plugin:** Track all known projects in IdeIntegrationService (closes #99) (#160)
83
+ - **vsc-plugin:** Per-window port + per-workspace pluginId (closes #103) (#161)
84
+ - **vsc-plugin:** Cache SettingsService config + react to mid-session changes (closes #107) (#162)
85
+ - **vsc-plugin:** Drop \`as unknown as Record<string, unknown>\` casts (closes #104) (#163)
86
+
87
+ ### Tests
88
+
89
+ - **vsc-plugin:** Cover webview-security helpers + extract sanitizeSessionId (partial #91) (#141)
90
+ - **vsc-plugin:** Cover CommandRelayService dispatch + dedup + state (closes #91) (#148)
91
+
7
92
  ## [2.18.2] — 2026-05-24
8
93
 
9
94
  ### Fixed
package/dist/index.js CHANGED
@@ -316,6 +316,15 @@ function isKnownAgentId(id) {
316
316
 
317
317
  // ../../packages/shared/src/api-url.ts
318
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
+ }
319
328
 
320
329
  // src/config.ts
321
330
  var fs = __toESM(require("fs"));
@@ -432,7 +441,7 @@ var import_qrcode_terminal = __toESM(require("qrcode-terminal"));
432
441
  // package.json
433
442
  var package_default = {
434
443
  name: "codeam-cli",
435
- version: "2.19.0",
444
+ version: "2.20.1",
436
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.",
437
446
  type: "commonjs",
438
447
  main: "dist/index.js",
@@ -619,7 +628,7 @@ function computePollDelay({ baseMs, failures }) {
619
628
  }
620
629
 
621
630
  // src/services/pairing.service.ts
622
- var API_BASE = process.env.CODEAM_API_URL ?? DEFAULT_API_BASE_URL;
631
+ var API_BASE = resolveApiBaseUrl();
623
632
  async function requestCode(pluginId) {
624
633
  try {
625
634
  const runtime = process.env.CODESPACES === "true" ? "github-codespaces" : "local";
@@ -5731,7 +5740,7 @@ function readAnonId() {
5731
5740
  }
5732
5741
  function superProperties() {
5733
5742
  return {
5734
- cliVersion: true ? "2.19.0" : "0.0.0-dev",
5743
+ cliVersion: true ? "2.20.1" : "0.0.0-dev",
5735
5744
  nodeVersion: process.version,
5736
5745
  platform: process.platform,
5737
5746
  arch: process.arch,
@@ -5822,7 +5831,7 @@ function maybePrintFirstRunBanner() {
5822
5831
  }
5823
5832
 
5824
5833
  // src/services/command-relay.service.ts
5825
- var API_BASE2 = process.env.CODEAM_API_URL ?? DEFAULT_API_BASE_URL;
5834
+ var API_BASE2 = resolveApiBaseUrl();
5826
5835
  var CommandRelayService = class {
5827
5836
  constructor(pluginId, onCommand, agentMeta) {
5828
5837
  this.pluginId = pluginId;
@@ -9522,6 +9531,9 @@ var ClaudeRuntimeStrategy = class {
9522
9531
  detectInteractivePrompt(lines) {
9523
9532
  return detectSelector(lines) ?? detectListSelector(lines);
9524
9533
  }
9534
+ detectReadyPrompt(lines) {
9535
+ return lines.some((l) => /^\?\s.*shortcut/i.test(l.trim()));
9536
+ }
9525
9537
  credentialLocator() {
9526
9538
  return claudeCredentialLocator();
9527
9539
  }
@@ -10402,6 +10414,9 @@ var CodexRuntimeStrategy = class {
10402
10414
  detectInteractivePrompt(lines) {
10403
10415
  return detectCodexSelector(lines);
10404
10416
  }
10417
+ detectReadyPrompt(lines) {
10418
+ return lines.some((l) => /[│┃]\s*›/u.test(l));
10419
+ }
10405
10420
  credentialLocator() {
10406
10421
  return codexCredentialLocator();
10407
10422
  }
@@ -10849,6 +10864,9 @@ var CursorRuntimeStrategy = class {
10849
10864
  detectInteractivePrompt(lines) {
10850
10865
  return detectCursorSelector(lines);
10851
10866
  }
10867
+ detectReadyPrompt(lines) {
10868
+ return lines.some((l) => /[│┃]\s*[›>]\s/u.test(l));
10869
+ }
10852
10870
  credentialLocator() {
10853
10871
  return cursorCredentialLocator();
10854
10872
  }
@@ -11056,6 +11074,12 @@ var AiderRuntimeStrategy = class {
11056
11074
  detectInteractivePrompt(lines) {
11057
11075
  return detectAiderSelector(lines);
11058
11076
  }
11077
+ detectReadyPrompt(lines) {
11078
+ return lines.some((l) => {
11079
+ const t2 = l.replace(/\x1B\[[^@-~]*[@-~]/g, "").trim();
11080
+ return t2 === ">" || /^>\s*$/.test(t2) || /^\.\.\.\s*>\s*$/.test(t2);
11081
+ });
11082
+ }
11059
11083
  credentialLocator() {
11060
11084
  return aiderCredentialLocator();
11061
11085
  }
@@ -11157,7 +11181,7 @@ var ChromeStepTracker = class {
11157
11181
  // src/services/output/chunk-emitter.ts
11158
11182
  var https3 = __toESM(require("https"));
11159
11183
  var http3 = __toESM(require("http"));
11160
- var API_BASE3 = process.env.CODEAM_API_URL ?? DEFAULT_API_BASE_URL;
11184
+ var API_BASE3 = resolveApiBaseUrl();
11161
11185
  var ChunkEmitter = class {
11162
11186
  constructor(opts) {
11163
11187
  this.opts = opts;
@@ -11353,6 +11377,20 @@ var OutputService = class _OutputService {
11353
11377
  emitter;
11354
11378
  runtime;
11355
11379
  lastSentContent = "";
11380
+ /**
11381
+ * Wall-clock of the most recent tick where the rendered + filtered
11382
+ * content actually changed. Most agent TUIs keep redrawing a
11383
+ * spinner + input prompt after the response is settled (Claude:
11384
+ * `? for shortcuts`; Codex: ratatui input bar), which keeps
11385
+ * `pty.lastPushTime` moving and prevents the PTY-idle heuristic
11386
+ * from ever crossing the IDLE_MS threshold — so the turn never
11387
+ * finalises and `done: true` never reaches the webapp's
11388
+ * canonical-refresh path. Tracking content-stability separately
11389
+ * closes that hole: PTY can churn all it wants, but once the
11390
+ * filtered TUI output stops changing for a beat we know the
11391
+ * agent is done.
11392
+ */
11393
+ lastContentChangeAt = 0;
11356
11394
  pollTimer = null;
11357
11395
  startTime = 0;
11358
11396
  terminalTurnPending = false;
@@ -11366,6 +11404,22 @@ var OutputService = class _OutputService {
11366
11404
  static IDLE_MS = 3e3;
11367
11405
  /** Same threshold but tighter for selectors (UI is ready to interact immediately). */
11368
11406
  static SELECTOR_IDLE_MS = 1500;
11407
+ /**
11408
+ * Content-stable threshold. When the rendered + filtered content
11409
+ * hasn't changed for this long AND we can see Claude's "? for
11410
+ * shortcuts" prompt re-drawn at the bottom (= back to input
11411
+ * state), we know the response is settled even though the PTY
11412
+ * itself is still pushing spinner / status redraws. Tighter than
11413
+ * IDLE_MS because the ready-prompt is a strong signal on its own.
11414
+ */
11415
+ static READY_STABLE_MS = 800;
11416
+ /**
11417
+ * Hard content-stable fallback. If the filtered content has been
11418
+ * unchanged for this long, finalize regardless of the ready
11419
+ * prompt — covers cases where Claude's TUI doesn't redraw the
11420
+ * shortcuts line (older versions, headless runs).
11421
+ */
11422
+ static CONTENT_STABLE_MS = 8e3;
11369
11423
  /**
11370
11424
  * Grace period before tick processes anything — Claude needs ~100-
11371
11425
  * 200 ms after `\r` to clear the input echo and re-render the TUI.
@@ -11487,6 +11541,7 @@ var OutputService = class _OutputService {
11487
11541
  this.pty.activate();
11488
11542
  this.steps.reset();
11489
11543
  this.lastSentContent = "";
11544
+ this.lastContentChangeAt = 0;
11490
11545
  this.startTime = Date.now();
11491
11546
  this.pollTimer = setInterval(() => this.tick(), _OutputService.POLL_MS);
11492
11547
  }
@@ -11579,18 +11634,32 @@ var OutputService = class _OutputService {
11579
11634
  return;
11580
11635
  }
11581
11636
  const idleMs = this.pty.lastPushTime > 0 ? now - this.pty.lastPushTime : elapsed;
11637
+ if (content !== this.lastSentContent) {
11638
+ this.lastContentChangeAt = now;
11639
+ this.lastSentContent = content;
11640
+ this.send({ type: "text", content, done: false }).catch(() => {
11641
+ });
11642
+ }
11643
+ const contentStableMs = this.lastContentChangeAt > 0 ? now - this.lastContentChangeAt : 0;
11644
+ const readyPrompt = this.runtime.detectReadyPrompt?.(lines) ?? false;
11582
11645
  log.trace(
11583
11646
  "outputSvc",
11584
- `tick content (raw=${this.pty.size}B lines=${lines.length} content=${content.length} idleMs=${idleMs})`
11647
+ `tick content (raw=${this.pty.size}B lines=${lines.length} content=${content.length} idleMs=${idleMs} stableMs=${contentStableMs} ready=${readyPrompt})`
11585
11648
  );
11586
11649
  if (idleMs >= _OutputService.IDLE_MS) {
11650
+ log.trace("outputSvc", `finalize: idleMs=${idleMs}`);
11587
11651
  this.finalize();
11588
11652
  return;
11589
11653
  }
11590
- if (content !== this.lastSentContent) {
11591
- this.lastSentContent = content;
11592
- this.send({ type: "text", content, done: false }).catch(() => {
11593
- });
11654
+ if (readyPrompt && contentStableMs >= _OutputService.READY_STABLE_MS) {
11655
+ log.trace("outputSvc", `finalize: readyPrompt + stableMs=${contentStableMs}`);
11656
+ this.finalize();
11657
+ return;
11658
+ }
11659
+ if (contentStableMs >= _OutputService.CONTENT_STABLE_MS) {
11660
+ log.trace("outputSvc", `finalize: stableMs=${contentStableMs} (fallback)`);
11661
+ this.finalize();
11662
+ return;
11594
11663
  }
11595
11664
  }
11596
11665
  finalize() {
@@ -11662,7 +11731,7 @@ var historyRecordSchema = import_zod.z.object({
11662
11731
  content: import_zod.z.union([import_zod.z.string(), import_zod.z.array(import_zod.z.unknown())]).optional()
11663
11732
  }).passthrough().optional()
11664
11733
  }).passthrough();
11665
- var API_BASE4 = process.env.CODEAM_API_URL ?? DEFAULT_API_BASE_URL;
11734
+ var API_BASE4 = resolveApiBaseUrl();
11666
11735
  function extractText2(content) {
11667
11736
  if (typeof content === "string") return content;
11668
11737
  if (Array.isArray(content)) {
@@ -12269,7 +12338,7 @@ function _post2(url, headers, payload) {
12269
12338
  }
12270
12339
 
12271
12340
  // src/services/file-watcher.service.ts
12272
- var API_BASE5 = process.env.CODEAM_API_URL ?? DEFAULT_API_BASE_URL;
12341
+ var API_BASE5 = resolveApiBaseUrl();
12273
12342
  var DEBOUNCE_MS = 250;
12274
12343
  var MAX_RETRIES = 2;
12275
12344
  var RETRY_BACKOFF_MS = 300;
@@ -12745,7 +12814,7 @@ function _get(url, headers) {
12745
12814
  }
12746
12815
 
12747
12816
  // src/services/streaming-emitter.service.ts
12748
- var API_BASE6 = process.env.CODEAM_API_URL ?? DEFAULT_API_BASE_URL;
12817
+ var API_BASE6 = resolveApiBaseUrl();
12749
12818
  var TICK_MS = 50;
12750
12819
  var ANSWER_POLL_MS = 1500;
12751
12820
  var SELECTOR_STABLE_MS = 800;
@@ -14617,7 +14686,7 @@ async function pair(args2 = []) {
14617
14686
  var fs24 = __toESM(require("fs"));
14618
14687
  var os24 = __toESM(require("os"));
14619
14688
  var import_crypto6 = require("crypto");
14620
- var API_BASE7 = process.env.CODEAM_API_URL ?? DEFAULT_API_BASE_URL;
14689
+ var API_BASE7 = resolveApiBaseUrl();
14621
14690
  function fail(msg) {
14622
14691
  console.error(`
14623
14692
  ${msg}
@@ -14847,7 +14916,7 @@ function status() {
14847
14916
 
14848
14917
  // src/commands/logout.ts
14849
14918
  var import_picocolors6 = __toESM(require("picocolors"));
14850
- var API_BASE8 = process.env.CODEAM_API_URL ?? DEFAULT_API_BASE_URL;
14919
+ var API_BASE8 = resolveApiBaseUrl();
14851
14920
  async function notifyBackendOffline() {
14852
14921
  const cfg = loadCliConfig();
14853
14922
  const pluginIds = /* @__PURE__ */ new Set([
@@ -17321,8 +17390,8 @@ function checkChokidar() {
17321
17390
  }
17322
17391
  async function doctor(args2 = []) {
17323
17392
  const json = args2.includes("--json");
17324
- const cliVersion = true ? "2.19.0" : "0.0.0-dev";
17325
- const apiBase = process.env.CODEAM_API_URL ?? DEFAULT_API_BASE_URL;
17393
+ const cliVersion = true ? "2.20.1" : "0.0.0-dev";
17394
+ const apiBase = resolveApiBaseUrl();
17326
17395
  const diagnosticId = (0, import_node_crypto5.randomUUID)();
17327
17396
  log.info("doctor", `run id=${diagnosticId} cli=${cliVersion}`);
17328
17397
  const [dns, health] = await Promise.all([
@@ -17372,6 +17441,13 @@ ${import_picocolors12.default.bold(" codeam doctor")}
17372
17441
  `);
17373
17442
  out2.write(` ${import_picocolors12.default.dim("api")} ${r.apiBase}
17374
17443
  `);
17444
+ if (process.env.CODEAM_TEST_MODE === "1" || process.env.CODEAM_TEST_MODE?.toLowerCase() === "true") {
17445
+ out2.write(` ${import_picocolors12.default.dim("mode")} ${import_picocolors12.default.yellow("TEST_MODE \u2014 using dev preview")}
17446
+ `);
17447
+ } else if (process.env.CODEAM_API_URL) {
17448
+ out2.write(` ${import_picocolors12.default.dim("mode")} ${import_picocolors12.default.yellow("CODEAM_API_URL override")}
17449
+ `);
17450
+ }
17375
17451
  out2.write(` ${import_picocolors12.default.dim("diag id")} ${r.diagnosticId}
17376
17452
  `);
17377
17453
  out2.write("\n");
@@ -17513,7 +17589,7 @@ async function completion(args2) {
17513
17589
  // src/commands/version.ts
17514
17590
  var import_picocolors13 = __toESM(require("picocolors"));
17515
17591
  function version2() {
17516
- const v = true ? "2.19.0" : "unknown";
17592
+ const v = true ? "2.20.1" : "unknown";
17517
17593
  console.log(`${import_picocolors13.default.bold("codeam-cli")} ${import_picocolors13.default.cyan(v)}`);
17518
17594
  }
17519
17595
 
@@ -17741,7 +17817,7 @@ function checkForUpdates() {
17741
17817
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
17742
17818
  if (process.env.CI) return;
17743
17819
  if (!process.stdout.isTTY) return;
17744
- const current = true ? "2.19.0" : null;
17820
+ const current = true ? "2.20.1" : null;
17745
17821
  if (!current) return;
17746
17822
  const cache = readCache();
17747
17823
  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.19.0",
3
+ "version": "2.20.1",
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",