codeam-cli 2.39.17 → 2.39.18

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 (2) hide show
  1. package/dist/index.js +28 -16
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -498,7 +498,7 @@ var import_qrcode_terminal = __toESM(require("qrcode-terminal"));
498
498
  // package.json
499
499
  var package_default = {
500
500
  name: "codeam-cli",
501
- version: "2.39.17",
501
+ version: "2.39.18",
502
502
  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.",
503
503
  type: "commonjs",
504
504
  main: "dist/index.js",
@@ -5908,7 +5908,7 @@ function readAnonId() {
5908
5908
  }
5909
5909
  function superProperties() {
5910
5910
  return {
5911
- cliVersion: true ? "2.39.17" : "0.0.0-dev",
5911
+ cliVersion: true ? "2.39.18" : "0.0.0-dev",
5912
5912
  nodeVersion: process.version,
5913
5913
  platform: process.platform,
5914
5914
  arch: process.arch,
@@ -23046,7 +23046,7 @@ function parseJsonl(filePath) {
23046
23046
  }
23047
23047
  return messages;
23048
23048
  }
23049
- function post(endpoint, body) {
23049
+ function post(endpoint, body, pluginAuthToken) {
23050
23050
  return new Promise((resolve7) => {
23051
23051
  const payload = JSON.stringify(body);
23052
23052
  const u2 = new URL(`${API_BASE8}${endpoint}`);
@@ -23060,7 +23060,11 @@ function post(endpoint, body) {
23060
23060
  headers: {
23061
23061
  "Content-Type": "application/json",
23062
23062
  "Content-Length": Buffer.byteLength(payload),
23063
- ...vercelBypassHeader()
23063
+ ...vercelBypassHeader(),
23064
+ // SEC crit1 (#819): authenticate conversation-history writes so
23065
+ // the backend can verify the (sessionId, pluginId) ownership.
23066
+ // Older backends ignore the header.
23067
+ ...pluginAuthToken ? { "X-Plugin-Auth-Token": pluginAuthToken } : {}
23064
23068
  },
23065
23069
  timeout: 15e3
23066
23070
  },
@@ -23089,6 +23093,7 @@ var HistoryService = class _HistoryService {
23089
23093
  this.pluginId = pluginId;
23090
23094
  this.cwd = cwd;
23091
23095
  this.runtime = runtime;
23096
+ this.pluginAuthToken = options?.pluginAuthToken;
23092
23097
  this.bootTimeMs = options?.bootTimeMs ?? Date.now();
23093
23098
  }
23094
23099
  pluginId;
@@ -23125,6 +23130,7 @@ var HistoryService = class _HistoryService {
23125
23130
  */
23126
23131
  static BIRTHTIME_GRACE_MS = 5e3;
23127
23132
  runtime;
23133
+ pluginAuthToken;
23128
23134
  /** Store rate limit reset info detected from Claude Code output */
23129
23135
  setRateLimitReset(reset) {
23130
23136
  this._rateLimitReset = reset;
@@ -23364,11 +23370,15 @@ var HistoryService = class _HistoryService {
23364
23370
  }
23365
23371
  const sessions3 = this.runtime.listResumableSessions(this.cwd);
23366
23372
  if (sessions3.length === 0) return;
23367
- await post("/api/sessions/list", {
23368
- pluginId: this.pluginId,
23369
- agentId: this.runtime.id,
23370
- sessions: sessions3
23371
- });
23373
+ await post(
23374
+ "/api/sessions/list",
23375
+ {
23376
+ pluginId: this.pluginId,
23377
+ agentId: this.runtime.id,
23378
+ sessions: sessions3
23379
+ },
23380
+ this.pluginAuthToken
23381
+ );
23372
23382
  }
23373
23383
  /**
23374
23384
  * Read a specific session's full conversation and POST it to the API in batches.
@@ -23398,10 +23408,10 @@ var HistoryService = class _HistoryService {
23398
23408
  batchIndex: i,
23399
23409
  totalBatches
23400
23410
  };
23401
- let ok = await post("/api/sessions/conversation", body);
23411
+ let ok = await post("/api/sessions/conversation", body, this.pluginAuthToken);
23402
23412
  for (let attempt = 0; !ok && attempt < RETRY_DELAYS.length; attempt++) {
23403
23413
  await new Promise((r) => setTimeout(r, RETRY_DELAYS[attempt]));
23404
- ok = await post("/api/sessions/conversation", body);
23414
+ ok = await post("/api/sessions/conversation", body, this.pluginAuthToken);
23405
23415
  }
23406
23416
  if (!ok) {
23407
23417
  throw new Error(`Failed to upload conversation batch ${i + 1}/${totalBatches} after all retries`);
@@ -23452,7 +23462,7 @@ var HistoryService = class _HistoryService {
23452
23462
  messages: newMessages,
23453
23463
  mode: "append"
23454
23464
  };
23455
- const ok = await post("/api/sessions/conversation", body);
23465
+ const ok = await post("/api/sessions/conversation", body, this.pluginAuthToken);
23456
23466
  if (ok) {
23457
23467
  const last = newMessages[newMessages.length - 1];
23458
23468
  this.lastUploadedUuid.set(sessionId, last.id);
@@ -24042,7 +24052,9 @@ async function start(requestedAgent) {
24042
24052
  showInfo("CODEAM_ACP_DISABLED is set \u2014 running the legacy PTY pipeline.");
24043
24053
  }
24044
24054
  const runtime = createRuntimeStrategy(session.agent);
24045
- const historySvc = new HistoryService(runtime, pluginId, cwd);
24055
+ const historySvc = new HistoryService(runtime, pluginId, cwd, {
24056
+ pluginAuthToken: session.pluginAuthToken
24057
+ });
24046
24058
  const keepAliveCtx = {
24047
24059
  inCodespace: process.env.CODESPACES === "true",
24048
24060
  codespaceName: process.env.CODESPACE_NAME
@@ -27044,7 +27056,7 @@ function checkChokidar() {
27044
27056
  }
27045
27057
  async function doctor(args2 = []) {
27046
27058
  const json = args2.includes("--json");
27047
- const cliVersion = true ? "2.39.17" : "0.0.0-dev";
27059
+ const cliVersion = true ? "2.39.18" : "0.0.0-dev";
27048
27060
  const apiBase = resolveApiBaseUrl();
27049
27061
  const diagnosticId = (0, import_node_crypto8.randomUUID)();
27050
27062
  log.info("doctor", `run id=${diagnosticId} cli=${cliVersion}`);
@@ -27243,7 +27255,7 @@ async function completion(args2) {
27243
27255
  // src/commands/version.ts
27244
27256
  var import_picocolors13 = __toESM(require("picocolors"));
27245
27257
  function version2() {
27246
- const v = true ? "2.39.17" : "unknown";
27258
+ const v = true ? "2.39.18" : "unknown";
27247
27259
  console.log(`${import_picocolors13.default.bold("codeam-cli")} ${import_picocolors13.default.cyan(v)}`);
27248
27260
  }
27249
27261
 
@@ -27529,7 +27541,7 @@ function checkForUpdates() {
27529
27541
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
27530
27542
  if (process.env.CI) return;
27531
27543
  if (!process.stdout.isTTY) return;
27532
- const current = true ? "2.39.17" : null;
27544
+ const current = true ? "2.39.18" : null;
27533
27545
  if (!current) return;
27534
27546
  const cache = readCache();
27535
27547
  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.39.17",
3
+ "version": "2.39.18",
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",