codeam-cli 2.75.39 → 2.75.41

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,18 @@ 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.75.40] — 2026-09-27
8
+
9
+ ### Fixed
10
+
11
+ - **cli:** Guardrail_configure read/write reach their handler (#843)
12
+
13
+ ## [2.75.39] — 2026-09-27
14
+
15
+ ### Fixed
16
+
17
+ - **cli:** Host never resumes a dead session into the filesystem root (#841)
18
+
7
19
  ## [2.75.38] — 2026-09-27
8
20
 
9
21
  ### Fixed
package/dist/index.js CHANGED
@@ -3437,6 +3437,41 @@ function resolveLogDir() {
3437
3437
  var LOG_DIR = resolveLogDir();
3438
3438
  var debugFilePath = path.join(LOG_DIR, `debug-${process.pid}.log`);
3439
3439
  var fileInitialized = false;
3440
+ var LOG_RETENTION_MS = 7 * 24 * 60 * 60 * 1e3;
3441
+ var LOG_DIR_BUDGET_BYTES = 200 * 1024 * 1024;
3442
+ function pidAlive(pid) {
3443
+ try {
3444
+ process.kill(pid, 0);
3445
+ return true;
3446
+ } catch (err) {
3447
+ return err.code === "EPERM";
3448
+ }
3449
+ }
3450
+ function pruneStaleLogs(dir, now = Date.now(), isAlive = pidAlive) {
3451
+ let removed = 0;
3452
+ try {
3453
+ const entries = fs.readdirSync(dir).map((name) => ({ name, m: /^debug-(\d+)\.log/.exec(name) })).filter((e) => e.m !== null).map(({ name, m }) => {
3454
+ const full = path.join(dir, name);
3455
+ const st3 = fs.statSync(full);
3456
+ return { full, pid: Number(m[1]), mtime: st3.mtimeMs, size: st3.size };
3457
+ }).sort((a, b) => b.mtime - a.mtime);
3458
+ let used = 0;
3459
+ for (const e of entries) {
3460
+ used += e.size;
3461
+ if (e.pid === process.pid || isAlive(e.pid)) continue;
3462
+ if (now - e.mtime > LOG_RETENTION_MS || used > LOG_DIR_BUDGET_BYTES) {
3463
+ try {
3464
+ fs.unlinkSync(e.full);
3465
+ removed++;
3466
+ used -= e.size;
3467
+ } catch {
3468
+ }
3469
+ }
3470
+ }
3471
+ } catch {
3472
+ }
3473
+ return removed;
3474
+ }
3440
3475
  function maybeRotate() {
3441
3476
  try {
3442
3477
  const st3 = fs.statSync(debugFilePath);
@@ -3470,6 +3505,7 @@ function appendToFile(line) {
3470
3505
  try {
3471
3506
  if (!fileInitialized) {
3472
3507
  fs.mkdirSync(path.dirname(debugFilePath), { recursive: true, mode: 448 });
3508
+ pruneStaleLogs(path.dirname(debugFilePath));
3473
3509
  if (fs.existsSync(debugFilePath)) rotateNow();
3474
3510
  const header = jsonMode ? `${JSON.stringify({
3475
3511
  ts: (/* @__PURE__ */ new Date()).toISOString(),
@@ -10529,7 +10565,7 @@ function readAnonId() {
10529
10565
  }
10530
10566
  function superProperties() {
10531
10567
  return {
10532
- cliVersion: true ? "2.75.39" : "0.0.0-dev",
10568
+ cliVersion: true ? "2.75.41" : "0.0.0-dev",
10533
10569
  nodeVersion: process.version,
10534
10570
  platform: process.platform,
10535
10571
  arch: process.arch,
@@ -10771,7 +10807,7 @@ var http = __toESM(require("http"));
10771
10807
  // package.json
10772
10808
  var package_default = {
10773
10809
  name: "codeam-cli",
10774
- version: "2.75.39",
10810
+ version: "2.75.41",
10775
10811
  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.",
10776
10812
  type: "commonjs",
10777
10813
  main: "dist/index.js",
@@ -12101,7 +12137,7 @@ var CommandRelayService = class _CommandRelayService {
12101
12137
  // fresh + clear the "CLI update available" banner after a self-update
12102
12138
  // (a codespace that reinstalls @latest reconnects via heartbeat, not
12103
12139
  // pair/reconnect). Older backends ignore the extra field.
12104
- ..."2.75.39" ? { ideVersion: "2.75.39" } : {}
12140
+ ..."2.75.41" ? { ideVersion: "2.75.41" } : {}
12105
12141
  };
12106
12142
  try {
12107
12143
  const res = await _postJson(`${API_BASE2}/api/plugin/heartbeat`, body);
@@ -13662,7 +13698,13 @@ var startCommandSchema = import_zod.z.object({
13662
13698
  // session (Claude hot-reloads ~/.claude/skills/), or list what's installed.
13663
13699
  "add",
13664
13700
  "remove",
13665
- "list"
13701
+ "list",
13702
+ // `guardrail_configure` — read / update the session's guardrail policy.
13703
+ // ⚠️ Missing until 2026-09-26: the generic parse rejected `{action:'read'}`
13704
+ // as malformed BEFORE the handler ran, so Guardrails never loaded ("isn't
13705
+ // responding") and every save was silently dropped.
13706
+ "read",
13707
+ "write"
13666
13708
  ]).optional(),
13667
13709
  // `coderabbit_configure` (action='link_apikey') — the CodeRabbit API key.
13668
13710
  apiKey: import_zod.z.string().min(1).max(512).optional(),
@@ -27657,13 +27699,13 @@ function resolveGlobalNodeModulesDir(opts) {
27657
27699
  var STALE_STAGING_AGE_MS = CLI_UPDATE_INSTALL_TIMEOUT_MS;
27658
27700
  function sweepStaleCliStagingDirs(nodeModulesDir, now = Date.now(), deps) {
27659
27701
  if (!nodeModulesDir) return 0;
27660
- const readdirSync14 = deps?.readdirSync ?? fs51.readdirSync;
27702
+ const readdirSync15 = deps?.readdirSync ?? fs51.readdirSync;
27661
27703
  const statSync16 = deps?.statSync ?? fs51.statSync;
27662
27704
  const rmSync10 = deps?.rmSync ?? fs51.rmSync;
27663
27705
  let removed = 0;
27664
27706
  let entries;
27665
27707
  try {
27666
- entries = readdirSync14(nodeModulesDir);
27708
+ entries = readdirSync15(nodeModulesDir);
27667
27709
  } catch {
27668
27710
  return 0;
27669
27711
  }
@@ -39926,7 +39968,7 @@ function readFileVars(file) {
39926
39968
  return {};
39927
39969
  }
39928
39970
  }
39929
- function pidAlive(pid) {
39971
+ function pidAlive2(pid) {
39930
39972
  try {
39931
39973
  process.kill(pid, 0);
39932
39974
  return true;
@@ -39945,7 +39987,7 @@ function pruneStale(dir) {
39945
39987
  const m = /^(\d+)-[a-z]+\.json$/.exec(name);
39946
39988
  if (!m) continue;
39947
39989
  const pid = Number(m[1]);
39948
- if (pid === process.pid || pidAlive(pid)) continue;
39990
+ if (pid === process.pid || pidAlive2(pid)) continue;
39949
39991
  try {
39950
39992
  fs69.unlinkSync(path80.join(dir, name));
39951
39993
  } catch {
@@ -48846,7 +48888,7 @@ async function autoUpgradeBeforeCriticalCommand() {
48846
48888
  if (process.env.NODE_ENV === "test") return;
48847
48889
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
48848
48890
  if (process.env.CI) return;
48849
- const current2 = true ? "2.75.39" : null;
48891
+ const current2 = true ? "2.75.41" : null;
48850
48892
  if (!current2) return;
48851
48893
  const cache = readCache();
48852
48894
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
@@ -48863,7 +48905,7 @@ function checkForUpdates() {
48863
48905
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
48864
48906
  if (process.env.CI) return;
48865
48907
  if (!process.stdout.isTTY) return;
48866
- const current2 = true ? "2.75.39" : null;
48908
+ const current2 = true ? "2.75.41" : null;
48867
48909
  if (!current2) return;
48868
48910
  const cache = readCache();
48869
48911
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
@@ -48886,7 +48928,7 @@ var SELF_UPDATE_INSTALL_TIMEOUT_MS = 18e4;
48886
48928
  var SELF_UPDATE_LS_TIMEOUT_MS = 15e3;
48887
48929
  var SUDO_PREFLIGHT_TIMEOUT_MS = 5e3;
48888
48930
  function currentCliVersion() {
48889
- return true ? "2.75.39" : null;
48931
+ return true ? "2.75.41" : null;
48890
48932
  }
48891
48933
  async function installedVersion(deps) {
48892
48934
  const ls = await deps.run(
@@ -50862,7 +50904,7 @@ function checkChokidar() {
50862
50904
  }
50863
50905
  async function doctor(args2 = []) {
50864
50906
  const json = args2.includes("--json");
50865
- const cliVersion = true ? "2.75.39" : "0.0.0-dev";
50907
+ const cliVersion = true ? "2.75.41" : "0.0.0-dev";
50866
50908
  const apiBase2 = resolveApiBaseUrl();
50867
50909
  const diagnosticId = (0, import_node_crypto13.randomUUID)();
50868
50910
  log.info("doctor", `run id=${diagnosticId} cli=${cliVersion}`);
@@ -51386,7 +51428,7 @@ async function mcpWarm(argv = [], opts = {}) {
51386
51428
  // src/commands/version.ts
51387
51429
  var import_picocolors15 = __toESM(require("picocolors"));
51388
51430
  function version2() {
51389
- const v = true ? "2.75.39" : "unknown";
51431
+ const v = true ? "2.75.41" : "unknown";
51390
51432
  console.log(`${import_picocolors15.default.bold("codeam-cli")} ${import_picocolors15.default.cyan(v)}`);
51391
51433
  }
51392
51434
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeam-cli",
3
- "version": "2.75.39",
3
+ "version": "2.75.41",
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",