codeam-cli 2.26.5 → 2.26.6

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.26.5] — 2026-06-03
8
+
9
+ ### Fixed
10
+
11
+ - **vsc-plugin:** CopilotLmStrategy matches normalized agentId `copilot` (#238)
12
+
7
13
  ## [2.26.4] — 2026-06-03
8
14
 
9
15
  ### Fixed
package/dist/index.js CHANGED
@@ -472,7 +472,7 @@ var import_qrcode_terminal = __toESM(require("qrcode-terminal"));
472
472
  // package.json
473
473
  var package_default = {
474
474
  name: "codeam-cli",
475
- version: "2.26.5",
475
+ version: "2.26.6",
476
476
  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.",
477
477
  type: "commonjs",
478
478
  main: "dist/index.js",
@@ -5829,7 +5829,7 @@ function readAnonId() {
5829
5829
  }
5830
5830
  function superProperties() {
5831
5831
  return {
5832
- cliVersion: true ? "2.26.5" : "0.0.0-dev",
5832
+ cliVersion: true ? "2.26.6" : "0.0.0-dev",
5833
5833
  nodeVersion: process.version,
5834
5834
  platform: process.platform,
5835
5835
  arch: process.arch,
@@ -16074,20 +16074,64 @@ var REQUIRED_FIELDS2 = [
16074
16074
  ];
16075
16075
  function safeParseDetection(raw) {
16076
16076
  if (!raw) return null;
16077
- const stripped = raw.replace(/^```(?:json)?\s*/m, "").replace(/\s*```\s*$/m, "").trim();
16078
- let parsed;
16079
- try {
16080
- parsed = JSON.parse(stripped);
16081
- } catch {
16082
- return null;
16077
+ let parsed = tryParseObject(raw.trim());
16078
+ if (!parsed) {
16079
+ const stripped = raw.replace(/^```(?:json)?\s*/m, "").replace(/\s*```\s*$/m, "").trim();
16080
+ if (stripped !== raw.trim()) {
16081
+ parsed = tryParseObject(stripped);
16082
+ }
16083
16083
  }
16084
- if (typeof parsed !== "object" || parsed === null) return null;
16084
+ if (!parsed) {
16085
+ const candidate = extractFirstJsonObject(raw);
16086
+ if (candidate) parsed = tryParseObject(candidate);
16087
+ }
16088
+ if (!parsed) return null;
16085
16089
  const obj = parsed;
16086
16090
  for (const field of REQUIRED_FIELDS2) {
16087
16091
  if (!(field in obj)) return null;
16088
16092
  }
16089
16093
  return obj;
16090
16094
  }
16095
+ function tryParseObject(s) {
16096
+ try {
16097
+ const v = JSON.parse(s);
16098
+ return typeof v === "object" && v !== null ? v : null;
16099
+ } catch {
16100
+ return null;
16101
+ }
16102
+ }
16103
+ function extractFirstJsonObject(s) {
16104
+ const start2 = s.indexOf("{");
16105
+ if (start2 < 0) return null;
16106
+ let depth = 0;
16107
+ let inString = false;
16108
+ let escaped = false;
16109
+ for (let i = start2; i < s.length; i += 1) {
16110
+ const c2 = s[i];
16111
+ if (escaped) {
16112
+ escaped = false;
16113
+ continue;
16114
+ }
16115
+ if (inString) {
16116
+ if (c2 === "\\") {
16117
+ escaped = true;
16118
+ } else if (c2 === '"') {
16119
+ inString = false;
16120
+ }
16121
+ continue;
16122
+ }
16123
+ if (c2 === '"') {
16124
+ inString = true;
16125
+ continue;
16126
+ }
16127
+ if (c2 === "{") depth += 1;
16128
+ else if (c2 === "}") {
16129
+ depth -= 1;
16130
+ if (depth === 0) return s.slice(start2, i + 1);
16131
+ }
16132
+ }
16133
+ return null;
16134
+ }
16091
16135
  var CLOUDFLARED_URL_RE = /https:\/\/[a-z0-9-]+\.trycloudflare\.com/i;
16092
16136
  function parseCloudflaredUrl(stderr) {
16093
16137
  const match = stderr.match(CLOUDFLARED_URL_RE);
@@ -16135,6 +16179,9 @@ async function killAllPreviews() {
16135
16179
  const ids = Array.from(activePreviews.keys());
16136
16180
  await Promise.all(ids.map((id) => killPreview(id)));
16137
16181
  }
16182
+ function activePreviewSessionIds() {
16183
+ return Array.from(activePreviews.keys());
16184
+ }
16138
16185
 
16139
16186
  // src/commands/start/handlers.ts
16140
16187
  var pendingAttachmentFiles = /* @__PURE__ */ new Set();
@@ -17158,7 +17205,10 @@ async function start(requestedAgent) {
17158
17205
  void outputSvc.sendTerminalExit(sessionId, exitCode);
17159
17206
  }
17160
17207
  });
17161
- function sigintHandler() {
17208
+ let shuttingDown = false;
17209
+ async function sigintHandler() {
17210
+ if (shuttingDown) return;
17211
+ shuttingDown = true;
17162
17212
  agent.kill();
17163
17213
  outputSvc.dispose();
17164
17214
  relay.stop();
@@ -17167,7 +17217,25 @@ async function start(requestedAgent) {
17167
17217
  closeAllTerminals();
17168
17218
  cleanupAttachmentTempFiles();
17169
17219
  killActiveSpawnAndCaptureChildren();
17170
- void killAllPreviews();
17220
+ const previewSessionIds = activePreviewSessionIds();
17221
+ try {
17222
+ await killAllPreviews();
17223
+ } catch {
17224
+ }
17225
+ const previewAuthToken = session?.pluginAuthToken;
17226
+ if (previewAuthToken && previewSessionIds.length > 0) {
17227
+ await Promise.allSettled(
17228
+ previewSessionIds.map(
17229
+ (sid) => postPreviewEvent({
17230
+ sessionId: sid,
17231
+ pluginId,
17232
+ pluginAuthToken: previewAuthToken,
17233
+ type: "preview_stopped",
17234
+ payload: { reason: "session_end" }
17235
+ })
17236
+ )
17237
+ );
17238
+ }
17171
17239
  void shutdownTelemetry();
17172
17240
  process.exit(0);
17173
17241
  }
@@ -19924,7 +19992,7 @@ function checkChokidar() {
19924
19992
  }
19925
19993
  async function doctor(args2 = []) {
19926
19994
  const json = args2.includes("--json");
19927
- const cliVersion = true ? "2.26.5" : "0.0.0-dev";
19995
+ const cliVersion = true ? "2.26.6" : "0.0.0-dev";
19928
19996
  const apiBase = resolveApiBaseUrl();
19929
19997
  const diagnosticId = (0, import_node_crypto6.randomUUID)();
19930
19998
  log.info("doctor", `run id=${diagnosticId} cli=${cliVersion}`);
@@ -20123,7 +20191,7 @@ async function completion(args2) {
20123
20191
  // src/commands/version.ts
20124
20192
  var import_picocolors13 = __toESM(require("picocolors"));
20125
20193
  function version2() {
20126
- const v = true ? "2.26.5" : "unknown";
20194
+ const v = true ? "2.26.6" : "unknown";
20127
20195
  console.log(`${import_picocolors13.default.bold("codeam-cli")} ${import_picocolors13.default.cyan(v)}`);
20128
20196
  }
20129
20197
 
@@ -20351,7 +20419,7 @@ function checkForUpdates() {
20351
20419
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
20352
20420
  if (process.env.CI) return;
20353
20421
  if (!process.stdout.isTTY) return;
20354
- const current = true ? "2.26.5" : null;
20422
+ const current = true ? "2.26.6" : null;
20355
20423
  if (!current) return;
20356
20424
  const cache = readCache();
20357
20425
  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.26.5",
3
+ "version": "2.26.6",
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",