codeam-cli 2.39.55 → 2.39.56

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.39.55] — 2026-06-20
8
+
9
+ ### Added
10
+
11
+ - **cli:** Self-hosted host-agent auto-update + persistent headroom env
12
+
7
13
  ## [2.39.54] — 2026-06-20
8
14
 
9
15
  ### Fixed
package/dist/index.js CHANGED
@@ -5388,7 +5388,7 @@ function readAnonId() {
5388
5388
  }
5389
5389
  function superProperties() {
5390
5390
  return {
5391
- cliVersion: true ? "2.39.55" : "0.0.0-dev",
5391
+ cliVersion: true ? "2.39.56" : "0.0.0-dev",
5392
5392
  nodeVersion: process.version,
5393
5393
  platform: process.platform,
5394
5394
  arch: process.arch,
@@ -5547,7 +5547,7 @@ var os4 = __toESM(require("os"));
5547
5547
  // package.json
5548
5548
  var package_default = {
5549
5549
  name: "codeam-cli",
5550
- version: "2.39.55",
5550
+ version: "2.39.56",
5551
5551
  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.",
5552
5552
  type: "commonjs",
5553
5553
  main: "dist/index.js",
@@ -16919,12 +16919,13 @@ async function redeemEnrollToken(token, label) {
16919
16919
  controlPluginId: data.controlPluginId
16920
16920
  };
16921
16921
  }
16922
- async function sendHostHeartbeat(identity, metrics) {
16922
+ async function sendHostHeartbeat(identity, metrics, sessions3) {
16923
16923
  const start2 = process.hrtime.bigint();
16924
16924
  await postJson("/api/self-hosted/heartbeat", {
16925
16925
  hostId: identity.hostId,
16926
16926
  hostToken: identity.hostToken,
16927
- ...metrics ? { metrics } : {}
16927
+ ...metrics ? { metrics } : {},
16928
+ ...sessions3 ? { sessions: sessions3 } : {}
16928
16929
  });
16929
16930
  const elapsedNs = process.hrtime.bigint() - start2;
16930
16931
  return Math.round(Number(elapsedNs) / 1e6);
@@ -17360,7 +17361,7 @@ function checkForUpdates() {
17360
17361
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
17361
17362
  if (process.env.CI) return;
17362
17363
  if (!process.stdout.isTTY) return;
17363
- const current = true ? "2.39.55" : null;
17364
+ const current = true ? "2.39.56" : null;
17364
17365
  if (!current) return;
17365
17366
  const cache = readCache();
17366
17367
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
@@ -17720,7 +17721,7 @@ var defaultSpawner = (env, cwd, args2 = []) => (0, import_node_child_process13.s
17720
17721
  detached: false
17721
17722
  });
17722
17723
  function currentCliVersion() {
17723
- return true ? "2.39.55" : null;
17724
+ return true ? "2.39.56" : null;
17724
17725
  }
17725
17726
  function runCmd(cmd, args2, timeoutMs) {
17726
17727
  return new Promise((resolve7) => {
@@ -17897,7 +17898,8 @@ var HostAgentSupervisor = class {
17897
17898
  } catch (err) {
17898
17899
  log.trace("host-agent", "metrics collection failed", err);
17899
17900
  }
17900
- const latencyMs = await sendHostHeartbeat(this.identity, metrics);
17901
+ const sessions3 = this.activeSessions();
17902
+ const latencyMs = await sendHostHeartbeat(this.identity, metrics, sessions3);
17901
17903
  this.metrics.recordLatency(latencyMs);
17902
17904
  if (!this.reportedConnected) {
17903
17905
  this.reportedConnected = true;
@@ -17978,6 +17980,22 @@ var HostAgentSupervisor = class {
17978
17980
  childCount() {
17979
17981
  return this.children.size;
17980
17982
  }
17983
+ /**
17984
+ * Snapshot the supervisor's live children as heartbeat session entries.
17985
+ *
17986
+ * Each entry's `id` is the deployId-correlated sessionId the backend
17987
+ * recognizes (the supervisor keys its children by it — the same id a
17988
+ * `self_hosted_stop` arrives with, see `stopChild`). `agent` is the deploy's
17989
+ * `agentId`; `startedAt` is the epoch-ms spawn time tracked on the child.
17990
+ * Returns `[]` when no children are active so the backend reflects "0 active".
17991
+ */
17992
+ activeSessions() {
17993
+ return [...this.children.values()].map((child) => ({
17994
+ id: child.deployId,
17995
+ agent: child.agent,
17996
+ startedAt: child.startedAt
17997
+ }));
17998
+ }
17981
17999
  /**
17982
18000
  * Route a relay command. Only `self_hosted_deploy` / `self_hosted_stop`
17983
18001
  * are understood; anything else is ignored (the box accepts no
@@ -18094,7 +18112,12 @@ var HostAgentSupervisor = class {
18094
18112
  }
18095
18113
  report("spawning", "starting agent");
18096
18114
  const proc = this.spawnSessionChild(childEnv, cwd, extraArgs);
18097
- const child = { deployId: payload.deployId, proc };
18115
+ const child = {
18116
+ deployId: payload.deployId,
18117
+ proc,
18118
+ agent: payload.agentId,
18119
+ startedAt: Date.now()
18120
+ };
18098
18121
  this.children.set(payload.deployId, child);
18099
18122
  let tail = "";
18100
18123
  const appendTail = (buf) => {
@@ -28241,7 +28264,7 @@ function checkChokidar() {
28241
28264
  }
28242
28265
  async function doctor(args2 = []) {
28243
28266
  const json = args2.includes("--json");
28244
- const cliVersion = true ? "2.39.55" : "0.0.0-dev";
28267
+ const cliVersion = true ? "2.39.56" : "0.0.0-dev";
28245
28268
  const apiBase2 = resolveApiBaseUrl();
28246
28269
  const diagnosticId = (0, import_node_crypto8.randomUUID)();
28247
28270
  log.info("doctor", `run id=${diagnosticId} cli=${cliVersion}`);
@@ -28440,7 +28463,7 @@ async function completion(args2) {
28440
28463
  // src/commands/version.ts
28441
28464
  var import_picocolors14 = __toESM(require("picocolors"));
28442
28465
  function version2() {
28443
- const v = true ? "2.39.55" : "unknown";
28466
+ const v = true ? "2.39.56" : "unknown";
28444
28467
  console.log(`${import_picocolors14.default.bold("codeam-cli")} ${import_picocolors14.default.cyan(v)}`);
28445
28468
  }
28446
28469
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeam-cli",
3
- "version": "2.39.55",
3
+ "version": "2.39.56",
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",