codeam-cli 2.61.70 → 2.61.71

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.61.70] — 2026-07-28
8
+
9
+ ### Added
10
+
11
+ - **cli:** Self_hosted_cleanup — rm a deleted session's on-disk workspace on the box
12
+
7
13
  ## [2.61.69] — 2026-07-28
8
14
 
9
15
  ### Added
package/dist/index.js CHANGED
@@ -7074,7 +7074,7 @@ function readAnonId() {
7074
7074
  }
7075
7075
  function superProperties() {
7076
7076
  return {
7077
- cliVersion: true ? "2.61.70" : "0.0.0-dev",
7077
+ cliVersion: true ? "2.61.71" : "0.0.0-dev",
7078
7078
  nodeVersion: process.version,
7079
7079
  platform: process.platform,
7080
7080
  arch: process.arch,
@@ -7255,7 +7255,7 @@ var os4 = __toESM(require("os"));
7255
7255
  // package.json
7256
7256
  var package_default = {
7257
7257
  name: "codeam-cli",
7258
- version: "2.61.70",
7258
+ version: "2.61.71",
7259
7259
  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.",
7260
7260
  type: "commonjs",
7261
7261
  main: "dist/index.js",
@@ -8427,7 +8427,7 @@ var CommandRelayService = class _CommandRelayService {
8427
8427
  // fresh + clear the "CLI update available" banner after a self-update
8428
8428
  // (a codespace that reinstalls @latest reconnects via heartbeat, not
8429
8429
  // pair/reconnect). Older backends ignore the extra field.
8430
- ..."2.61.70" ? { ideVersion: "2.61.70" } : {}
8430
+ ..."2.61.71" ? { ideVersion: "2.61.71" } : {}
8431
8431
  }).then(() => log.trace("relay", `heartbeat ok online=${online}`)).catch((err) => log.trace("relay", `heartbeat failed online=${online}`, err));
8432
8432
  }
8433
8433
  /**
@@ -8763,15 +8763,15 @@ var FileWatcherService = class {
8763
8763
  );
8764
8764
  return;
8765
8765
  }
8766
- const chokidar2 = _chokidarSeam.load();
8767
- if (!chokidar2) {
8766
+ const chokidar3 = _chokidarSeam.load();
8767
+ if (!chokidar3) {
8768
8768
  log.warn(
8769
8769
  "fileWatcher",
8770
8770
  `chokidar unavailable \u2014 file change emission disabled`
8771
8771
  );
8772
8772
  return;
8773
8773
  }
8774
- const watcher = chokidar2.watch(this.opts.workingDir, {
8774
+ const watcher = chokidar3.watch(this.opts.workingDir, {
8775
8775
  ignored: [
8776
8776
  /(^|[\\/])\../,
8777
8777
  // dot-files & dot-dirs (.git, .next, .expo, .DS_Store, …)
@@ -19536,7 +19536,7 @@ async function autoUpgradeBeforeCriticalCommand() {
19536
19536
  if (process.env.NODE_ENV === "test") return;
19537
19537
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
19538
19538
  if (process.env.CI) return;
19539
- const current = true ? "2.61.70" : null;
19539
+ const current = true ? "2.61.71" : null;
19540
19540
  if (!current) return;
19541
19541
  const cache = readCache();
19542
19542
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
@@ -19553,7 +19553,7 @@ function checkForUpdates() {
19553
19553
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
19554
19554
  if (process.env.CI) return;
19555
19555
  if (!process.stdout.isTTY) return;
19556
- const current = true ? "2.61.70" : null;
19556
+ const current = true ? "2.61.71" : null;
19557
19557
  if (!current) return;
19558
19558
  const cache = readCache();
19559
19559
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
@@ -19573,7 +19573,7 @@ var SELF_UPDATE_INTERVAL_MS = 60 * 60 * 1e3;
19573
19573
  var SELF_UPDATE_VIEW_TIMEOUT_MS = 3e4;
19574
19574
  var SELF_UPDATE_INSTALL_TIMEOUT_MS = 18e4;
19575
19575
  function currentCliVersion() {
19576
- return true ? "2.61.70" : null;
19576
+ return true ? "2.61.71" : null;
19577
19577
  }
19578
19578
  function runCmd(cmd, args2, timeoutMs) {
19579
19579
  return new Promise((resolve9) => {
@@ -23300,12 +23300,12 @@ var BeadsWatcher = class {
23300
23300
  /** Start tailing the change feed. Idempotent (second call is a no-op). */
23301
23301
  start() {
23302
23302
  if (this.watcher || this.stopped) return;
23303
- const chokidar2 = _chokidarSeam2.load();
23304
- if (!chokidar2) {
23303
+ const chokidar3 = _chokidarSeam2.load();
23304
+ if (!chokidar3) {
23305
23305
  log.warn("beads", "chokidar unavailable \u2014 beads watcher disabled");
23306
23306
  return;
23307
23307
  }
23308
- const watcher = chokidar2.watch(this.feedPath, {
23308
+ const watcher = chokidar3.watch(this.feedPath, {
23309
23309
  ignoreInitial: false,
23310
23310
  // push the current state once on start
23311
23311
  persistent: true,
@@ -33633,6 +33633,38 @@ async function reportCredentialInvalid(opts, fetchImpl = fetch) {
33633
33633
  } catch {
33634
33634
  }
33635
33635
  }
33636
+ async function postCredentialSync(opts, fetchImpl = fetch) {
33637
+ const url2 = `${resolveApiBaseUrl()}/api/plugin/agents/${encodeURIComponent(opts.agent)}/credential-sync`;
33638
+ const body = JSON.stringify({
33639
+ sessionId: opts.sessionId,
33640
+ pluginId: opts.pluginId,
33641
+ method: opts.method,
33642
+ credential: opts.credential,
33643
+ ...opts.agentState ? { agentState: opts.agentState } : {}
33644
+ });
33645
+ try {
33646
+ const makeHeaders = (token) => ({
33647
+ "Content-Type": "application/json",
33648
+ "X-Plugin-Auth-Token": token
33649
+ });
33650
+ const response = await fetchImpl(url2, {
33651
+ method: "POST",
33652
+ headers: makeHeaders(opts.pluginAuthToken),
33653
+ body
33654
+ });
33655
+ if (response.status === 401 || response.status === 403) {
33656
+ const freshToken = await fetchCurrentPluginAuthToken(
33657
+ opts.sessionId,
33658
+ opts.pluginId,
33659
+ opts.pollSecret
33660
+ );
33661
+ if (freshToken !== null) {
33662
+ await fetchImpl(url2, { method: "POST", headers: makeHeaders(freshToken), body });
33663
+ }
33664
+ }
33665
+ } catch {
33666
+ }
33667
+ }
33636
33668
  async function postBudgetReached(opts, fetchImpl = fetch) {
33637
33669
  const url2 = `${resolveApiBaseUrl()}/api/sessions/${encodeURIComponent(opts.sessionId)}/headroom-budget-reached`;
33638
33670
  try {
@@ -36174,6 +36206,56 @@ function fetchQuotaUsage(runtime, historySvc) {
36174
36206
  });
36175
36207
  }
36176
36208
 
36209
+ // src/agents/claude/credential-sync.ts
36210
+ var import_chokidar2 = __toESM(require("chokidar"));
36211
+ var crypto5 = __toESM(require("crypto"));
36212
+ var CLAUDE_PUBLIC_AGENT_ID = "claude_code";
36213
+ function startClaudeCredentialSync(opts) {
36214
+ const push = opts.push ?? postCredentialSync;
36215
+ const read2 = opts.read ?? extractLocalClaudeToken;
36216
+ let lastHash = "";
36217
+ let stopped = false;
36218
+ const syncNow = async () => {
36219
+ if (stopped) return;
36220
+ try {
36221
+ const tok = await read2();
36222
+ if (!tok || !tok.credential) return;
36223
+ const hash = crypto5.createHash("sha256").update(tok.credential).digest("hex");
36224
+ if (hash === lastHash) return;
36225
+ lastHash = hash;
36226
+ await push({
36227
+ agent: CLAUDE_PUBLIC_AGENT_ID,
36228
+ sessionId: opts.sessionId,
36229
+ pluginId: opts.pluginId,
36230
+ pluginAuthToken: opts.pluginAuthToken,
36231
+ pollSecret: opts.pollSecret,
36232
+ method: "oauth",
36233
+ credential: tok.credential,
36234
+ agentState: tok.agentState
36235
+ });
36236
+ log.trace("cred-sync", "pushed fresh claude credential to the vault");
36237
+ } catch {
36238
+ }
36239
+ };
36240
+ const watcher = import_chokidar2.default.watch(claudeCredentialsPaths(), {
36241
+ ignoreInitial: true,
36242
+ // Debounce a rotation's multi-write until the file settles before reading.
36243
+ awaitWriteFinish: { stabilityThreshold: 400, pollInterval: 100 }
36244
+ });
36245
+ watcher.on("add", () => void syncNow());
36246
+ watcher.on("change", () => void syncNow());
36247
+ watcher.on("error", () => {
36248
+ });
36249
+ void syncNow();
36250
+ return {
36251
+ syncNow,
36252
+ stop: async () => {
36253
+ stopped = true;
36254
+ await watcher.close().catch(() => void 0);
36255
+ }
36256
+ };
36257
+ }
36258
+
36177
36259
  // src/beads/workflow-hint.ts
36178
36260
  var fs66 = __toESM(require("fs"));
36179
36261
  var path72 = __toESM(require("path"));
@@ -37069,6 +37151,15 @@ async function start(requestedAgent, presetSession) {
37069
37151
  process.once("exit", () => {
37070
37152
  localHeadroomReporter?.stop();
37071
37153
  });
37154
+ const claudeCredentialSync = session.agent === "claude" && session.pluginAuthToken ? startClaudeCredentialSync({
37155
+ sessionId: session.id,
37156
+ pluginId,
37157
+ pluginAuthToken: session.pluginAuthToken,
37158
+ pollSecret: session.pollSecret
37159
+ }) : null;
37160
+ process.once("exit", () => {
37161
+ void claudeCredentialSync?.stop();
37162
+ });
37072
37163
  if (!isLocalSession()) ensureClaudeOnboarded(cwd);
37073
37164
  let beads = null;
37074
37165
  const getBeads = () => beads;
@@ -39911,7 +40002,7 @@ function checkChokidar() {
39911
40002
  }
39912
40003
  async function doctor(args2 = []) {
39913
40004
  const json = args2.includes("--json");
39914
- const cliVersion = true ? "2.61.70" : "0.0.0-dev";
40005
+ const cliVersion = true ? "2.61.71" : "0.0.0-dev";
39915
40006
  const apiBase2 = resolveApiBaseUrl();
39916
40007
  const diagnosticId = (0, import_node_crypto13.randomUUID)();
39917
40008
  log.info("doctor", `run id=${diagnosticId} cli=${cliVersion}`);
@@ -40433,7 +40524,7 @@ async function mcpRun(args2) {
40433
40524
  // src/commands/version.ts
40434
40525
  var import_picocolors15 = __toESM(require("picocolors"));
40435
40526
  function version2() {
40436
- const v = true ? "2.61.70" : "unknown";
40527
+ const v = true ? "2.61.71" : "unknown";
40437
40528
  console.log(`${import_picocolors15.default.bold("codeam-cli")} ${import_picocolors15.default.cyan(v)}`);
40438
40529
  }
40439
40530
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeam-cli",
3
- "version": "2.61.70",
3
+ "version": "2.61.71",
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",