codeam-cli 2.39.56 → 2.39.57

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 +26 -11
  2. package/package.json +1 -1
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.56" : "0.0.0-dev",
5391
+ cliVersion: true ? "2.39.57" : "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.56",
5550
+ version: "2.39.57",
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,17 +16919,23 @@ async function redeemEnrollToken(token, label) {
16919
16919
  controlPluginId: data.controlPluginId
16920
16920
  };
16921
16921
  }
16922
- async function sendHostHeartbeat(identity, metrics, sessions3) {
16922
+ async function sendHostHeartbeat(identity, metrics) {
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 } : {},
16928
- ...sessions3 ? { sessions: sessions3 } : {}
16927
+ ...metrics ? { metrics } : {}
16929
16928
  });
16930
16929
  const elapsedNs = process.hrtime.bigint() - start2;
16931
16930
  return Math.round(Number(elapsedNs) / 1e6);
16932
16931
  }
16932
+ async function reportSessionEvent(identity, body) {
16933
+ await postJson("/api/self-hosted/session-event", {
16934
+ hostId: identity.hostId,
16935
+ hostToken: identity.hostToken,
16936
+ ...body
16937
+ });
16938
+ }
16933
16939
  function isSealedEnvelope(v) {
16934
16940
  if (typeof v !== "object" || v === null) return false;
16935
16941
  const o = v;
@@ -17361,7 +17367,7 @@ function checkForUpdates() {
17361
17367
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
17362
17368
  if (process.env.CI) return;
17363
17369
  if (!process.stdout.isTTY) return;
17364
- const current = true ? "2.39.56" : null;
17370
+ const current = true ? "2.39.57" : null;
17365
17371
  if (!current) return;
17366
17372
  const cache = readCache();
17367
17373
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
@@ -17721,7 +17727,7 @@ var defaultSpawner = (env, cwd, args2 = []) => (0, import_node_child_process13.s
17721
17727
  detached: false
17722
17728
  });
17723
17729
  function currentCliVersion() {
17724
- return true ? "2.39.56" : null;
17730
+ return true ? "2.39.57" : null;
17725
17731
  }
17726
17732
  function runCmd(cmd, args2, timeoutMs) {
17727
17733
  return new Promise((resolve7) => {
@@ -17862,6 +17868,10 @@ var HostAgentSupervisor = class {
17862
17868
  void this.beat();
17863
17869
  this.heartbeatTimer = setInterval(() => void this.beat(), HEARTBEAT_INTERVAL_MS);
17864
17870
  this.heartbeatTimer.unref?.();
17871
+ void reportSessionEvent(
17872
+ { hostId: this.identity.hostId, hostToken: this.identity.hostToken },
17873
+ { event: "reconcile", activeDeployIds: this.activeSessions().map((s) => s.id) }
17874
+ ).catch((err) => log.trace("host-agent", "boot reconcile failed (best-effort)", err));
17865
17875
  const updateMs = this.selfUpdateIntervalMs();
17866
17876
  if (updateMs > 0) {
17867
17877
  this.selfUpdateTimer = setInterval(() => void this.selfUpdateTick(), updateMs);
@@ -17898,8 +17908,7 @@ var HostAgentSupervisor = class {
17898
17908
  } catch (err) {
17899
17909
  log.trace("host-agent", "metrics collection failed", err);
17900
17910
  }
17901
- const sessions3 = this.activeSessions();
17902
- const latencyMs = await sendHostHeartbeat(this.identity, metrics, sessions3);
17911
+ const latencyMs = await sendHostHeartbeat(this.identity, metrics);
17903
17912
  this.metrics.recordLatency(latencyMs);
17904
17913
  if (!this.reportedConnected) {
17905
17914
  this.reportedConnected = true;
@@ -18131,6 +18140,12 @@ var HostAgentSupervisor = class {
18131
18140
  if (tracked) {
18132
18141
  this.children.delete(payload.deployId);
18133
18142
  }
18143
+ if (tracked) {
18144
+ void reportSessionEvent(
18145
+ { hostId: this.identity.hostId, hostToken: this.identity.hostToken },
18146
+ { event: "ended", deployId: payload.deployId }
18147
+ ).catch((err) => log.trace("host-agent", "session ended report failed (best-effort)", err));
18148
+ }
18134
18149
  if (tracked && typeof code === "number" && code !== 0) {
18135
18150
  const detail = tail.trim().slice(-500);
18136
18151
  report("failed", detail ? `agent exited (${code}): ${detail}` : `agent exited (${code})`);
@@ -28264,7 +28279,7 @@ function checkChokidar() {
28264
28279
  }
28265
28280
  async function doctor(args2 = []) {
28266
28281
  const json = args2.includes("--json");
28267
- const cliVersion = true ? "2.39.56" : "0.0.0-dev";
28282
+ const cliVersion = true ? "2.39.57" : "0.0.0-dev";
28268
28283
  const apiBase2 = resolveApiBaseUrl();
28269
28284
  const diagnosticId = (0, import_node_crypto8.randomUUID)();
28270
28285
  log.info("doctor", `run id=${diagnosticId} cli=${cliVersion}`);
@@ -28463,7 +28478,7 @@ async function completion(args2) {
28463
28478
  // src/commands/version.ts
28464
28479
  var import_picocolors14 = __toESM(require("picocolors"));
28465
28480
  function version2() {
28466
- const v = true ? "2.39.56" : "unknown";
28481
+ const v = true ? "2.39.57" : "unknown";
28467
28482
  console.log(`${import_picocolors14.default.bold("codeam-cli")} ${import_picocolors14.default.cyan(v)}`);
28468
28483
  }
28469
28484
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeam-cli",
3
- "version": "2.39.56",
3
+ "version": "2.39.57",
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",