codeam-cli 2.74.0 → 2.74.1

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,16 @@ 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.74.0] — 2026-09-03
8
+
9
+ ### Added
10
+
11
+ - **cli:** Tool router (4 schemas instead of hundreds) + house agent's real context window (#700)
12
+
13
+ ### Tests
14
+
15
+ - **cli:** Two of today's tests were not Windows-portable — main went red (#699)
16
+
7
17
  ## [2.73.10] — 2026-09-03
8
18
 
9
19
  ### Fixed
package/dist/index.js CHANGED
@@ -271,8 +271,8 @@ var init_stdio_proxy = __esm({
271
271
  }
272
272
  async spawnChild(stdout, preResolved) {
273
273
  const spec = preResolved ?? await this.opts.spawnSpec();
274
- const spawn47 = this.opts.spawnImpl ?? import_node_child_process33.spawn;
275
- const child = spawn47(spec.command, spec.args, {
274
+ const spawn48 = this.opts.spawnImpl ?? import_node_child_process33.spawn;
275
+ const child = spawn48(spec.command, spec.args, {
276
276
  env: { ...process.env, ...spec.env },
277
277
  // env only — never argv
278
278
  stdio: ["pipe", "pipe", "inherit"]
@@ -8136,7 +8136,7 @@ function readAnonId() {
8136
8136
  }
8137
8137
  function superProperties() {
8138
8138
  return {
8139
- cliVersion: true ? "2.74.0" : "0.0.0-dev",
8139
+ cliVersion: true ? "2.74.1" : "0.0.0-dev",
8140
8140
  nodeVersion: process.version,
8141
8141
  platform: process.platform,
8142
8142
  arch: process.arch,
@@ -8378,7 +8378,7 @@ var http = __toESM(require("http"));
8378
8378
  // package.json
8379
8379
  var package_default = {
8380
8380
  name: "codeam-cli",
8381
- version: "2.74.0",
8381
+ version: "2.74.1",
8382
8382
  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.",
8383
8383
  type: "commonjs",
8384
8384
  main: "dist/index.js",
@@ -9971,7 +9971,7 @@ var CommandRelayService = class _CommandRelayService {
9971
9971
  // fresh + clear the "CLI update available" banner after a self-update
9972
9972
  // (a codespace that reinstalls @latest reconnects via heartbeat, not
9973
9973
  // pair/reconnect). Older backends ignore the extra field.
9974
- ..."2.74.0" ? { ideVersion: "2.74.0" } : {}
9974
+ ..."2.74.1" ? { ideVersion: "2.74.1" } : {}
9975
9975
  }).then(() => log.trace("relay", `heartbeat ok online=${online}`)).catch((err) => log.trace("relay", `heartbeat failed online=${online}`, err));
9976
9976
  }
9977
9977
  /**
@@ -22272,7 +22272,7 @@ async function autoUpgradeBeforeCriticalCommand() {
22272
22272
  if (process.env.NODE_ENV === "test") return;
22273
22273
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
22274
22274
  if (process.env.CI) return;
22275
- const current2 = true ? "2.74.0" : null;
22275
+ const current2 = true ? "2.74.1" : null;
22276
22276
  if (!current2) return;
22277
22277
  const cache = readCache();
22278
22278
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
@@ -22289,7 +22289,7 @@ function checkForUpdates() {
22289
22289
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
22290
22290
  if (process.env.CI) return;
22291
22291
  if (!process.stdout.isTTY) return;
22292
- const current2 = true ? "2.74.0" : null;
22292
+ const current2 = true ? "2.74.1" : null;
22293
22293
  if (!current2) return;
22294
22294
  const cache = readCache();
22295
22295
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
@@ -22312,7 +22312,7 @@ var SELF_UPDATE_INSTALL_TIMEOUT_MS = 18e4;
22312
22312
  var SELF_UPDATE_LS_TIMEOUT_MS = 15e3;
22313
22313
  var SUDO_PREFLIGHT_TIMEOUT_MS = 5e3;
22314
22314
  function currentCliVersion() {
22315
- return true ? "2.74.0" : null;
22315
+ return true ? "2.74.1" : null;
22316
22316
  }
22317
22317
  async function installedVersion(deps) {
22318
22318
  const ls = await deps.run(
@@ -36844,12 +36844,12 @@ function buildRelaunchProxyEnv(baseEnv) {
36844
36844
  return env;
36845
36845
  }
36846
36846
  var relaunchProxyWithoutBudget = async () => {
36847
- const { spawn: spawn47 } = await import("child_process");
36847
+ const { spawn: spawn48 } = await import("child_process");
36848
36848
  killHeadroomProxy();
36849
36849
  await new Promise((r) => setTimeout(r, 500));
36850
36850
  const proxyEnv = buildRelaunchProxyEnv(process.env);
36851
36851
  try {
36852
- const proxy = spawn47(
36852
+ const proxy = spawn48(
36853
36853
  "headroom",
36854
36854
  ["proxy", "--port", "8787"],
36855
36855
  { stdio: "ignore", detached: true, env: proxyEnv }
@@ -47437,7 +47437,7 @@ function checkChokidar() {
47437
47437
  }
47438
47438
  async function doctor(args2 = []) {
47439
47439
  const json = args2.includes("--json");
47440
- const cliVersion = true ? "2.74.0" : "0.0.0-dev";
47440
+ const cliVersion = true ? "2.74.1" : "0.0.0-dev";
47441
47441
  const apiBase2 = resolveApiBaseUrl();
47442
47442
  const diagnosticId = (0, import_node_crypto13.randomUUID)();
47443
47443
  log.info("doctor", `run id=${diagnosticId} cli=${cliVersion}`);
@@ -47635,6 +47635,15 @@ async function completion(args2) {
47635
47635
 
47636
47636
  // src/integrations/mcp-run.ts
47637
47637
  var import_node_child_process34 = require("child_process");
47638
+
47639
+ // src/integrations/launcher-env.ts
47640
+ var LAUNCHER_ENV = Object.freeze({
47641
+ npm_config_audit: "false",
47642
+ npm_config_fund: "false",
47643
+ npm_config_update_notifier: "false"
47644
+ });
47645
+
47646
+ // src/integrations/mcp-run.ts
47638
47647
  var import_node_fs14 = require("fs");
47639
47648
  var import_node_os14 = __toESM(require("os"));
47640
47649
  var import_node_path13 = __toESM(require("path"));
@@ -47764,6 +47773,14 @@ function ensureCommand(command2) {
47764
47773
  );
47765
47774
  }
47766
47775
  }
47776
+ function childEnvFor(delivery, token) {
47777
+ const env = { ...LAUNCHER_ENV, ...delivery.staticEnv };
47778
+ for (const [envVar, field] of Object.entries(delivery.envMapping)) {
47779
+ const value = token[field];
47780
+ if (typeof value === "string" && value) env[envVar] = value;
47781
+ }
47782
+ return env;
47783
+ }
47767
47784
  async function mcpRun(args2) {
47768
47785
  const id = args2[0] ?? process.env.CODEAM_MCP_INTEGRATION_ID;
47769
47786
  const sessionId = process.env.CODEAM_MCP_SESSION_ID;
@@ -47813,12 +47830,7 @@ async function mcpRun(args2) {
47813
47830
  const proxy = new RestartableStdioProxy({
47814
47831
  spawnSpec: async () => {
47815
47832
  current2 = await client3.getToken(id);
47816
- const env = { ...delivery.staticEnv };
47817
- for (const [envVar, field] of Object.entries(delivery.envMapping)) {
47818
- const value = current2[field];
47819
- if (typeof value === "string" && value) env[envVar] = value;
47820
- }
47821
- return { command: launcher, args: delivery.args, env };
47833
+ return { command: launcher, args: delivery.args, env: childEnvFor(delivery, current2) };
47822
47834
  },
47823
47835
  shouldRestartNow: () => current2 !== null && new Date(current2.expiresAt).getTime() - Date.now() < RESTART_AHEAD_MS
47824
47836
  });
@@ -47865,37 +47877,72 @@ function warmCommand(target) {
47865
47877
  }
47866
47878
  return null;
47867
47879
  }
47868
- async function mcpWarm(argv = []) {
47869
- const timeoutMs = 3e5;
47880
+ var WARM_PACKAGE_TIMEOUT_MS = 12e4;
47881
+ var WARM_TOTAL_BUDGET_MS = 10 * 6e4;
47882
+ var WARM_CONCURRENCY = 4;
47883
+ function runCapturing(command2, args2, timeoutMs) {
47884
+ return new Promise((resolve11) => {
47885
+ const child = (0, import_node_child_process35.spawn)(command2, args2, {
47886
+ env: { ...process.env, ...LAUNCHER_ENV },
47887
+ stdio: ["ignore", "ignore", "pipe"]
47888
+ });
47889
+ let stderr = "";
47890
+ child.stderr?.setEncoding("utf8");
47891
+ child.stderr?.on("data", (c2) => stderr += c2);
47892
+ const timer = setTimeout(() => {
47893
+ child.kill("SIGKILL");
47894
+ resolve11({ status: null, stderr, error: new Error(`spawn ${command2} ETIMEDOUT`) });
47895
+ }, timeoutMs);
47896
+ child.on("error", (error) => {
47897
+ clearTimeout(timer);
47898
+ resolve11({ status: null, stderr, error });
47899
+ });
47900
+ child.on("close", (status2) => {
47901
+ clearTimeout(timer);
47902
+ resolve11({ status: status2, stderr });
47903
+ });
47904
+ });
47905
+ }
47906
+ async function mcpWarm(argv = [], opts = {}) {
47907
+ const packageTimeoutMs = opts.packageTimeoutMs ?? WARM_PACKAGE_TIMEOUT_MS;
47908
+ const totalBudgetMs = opts.totalBudgetMs ?? WARM_TOTAL_BUDGET_MS;
47909
+ const concurrency = opts.concurrency ?? WARM_CONCURRENCY;
47870
47910
  const targets = warmTargets();
47871
47911
  const only = argv.filter((a) => !a.startsWith("-"));
47872
47912
  const selected = only.length > 0 ? targets.filter((t2) => only.includes(t2.id)) : targets;
47873
47913
  const result = { warmed: [], skipped: [], failed: [] };
47874
47914
  console.log(`[codeam mcp-warm] ${selected.length} MCP package(s) to pre-fetch`);
47875
- for (const target of selected) {
47876
- const cmd = warmCommand(target);
47877
- if (!cmd) {
47878
- result.skipped.push(`${target.spec} (no warm recipe for '${target.launcher}')`);
47879
- continue;
47880
- }
47881
- const started = Date.now();
47882
- const run = (0, import_node_child_process35.spawnSync)(cmd.command, cmd.args, {
47883
- stdio: ["ignore", "ignore", "pipe"],
47884
- timeout: timeoutMs,
47885
- encoding: "utf8"
47886
- });
47887
- const secs = ((Date.now() - started) / 1e3).toFixed(1);
47888
- if (run.status === 0) {
47889
- result.warmed.push(target.spec);
47890
- console.log(` OK ${target.spec} (${secs}s)`);
47891
- } else {
47892
- const noise = /^npm (warn|notice)\b/;
47893
- const lines = (run.stderr ?? "").split("\n").map((l) => l.trim()).filter((l) => l.length > 0 && !noise.test(l));
47894
- const reason = run.error?.message ?? lines[lines.length - 1] ?? `exit ${String(run.status)} (no stderr)`;
47895
- result.failed.push({ spec: target.spec, reason });
47896
- console.log(` MISS ${target.spec} (${secs}s) \u2014 fetched at runtime instead: ${reason}`);
47915
+ const deadline = Date.now() + totalBudgetMs;
47916
+ const queue = [...selected];
47917
+ const worker = async () => {
47918
+ for (let target = queue.shift(); target; target = queue.shift()) {
47919
+ const cmd = warmCommand(target);
47920
+ if (!cmd) {
47921
+ result.skipped.push(`${target.spec} (no warm recipe for '${target.launcher}')`);
47922
+ continue;
47923
+ }
47924
+ const remaining = deadline - Date.now();
47925
+ if (remaining <= 0) {
47926
+ result.failed.push({ spec: target.spec, reason: "warm budget spent" });
47927
+ console.log(` MISS ${target.spec} (0.0s) \u2014 fetched at runtime instead: warm budget spent`);
47928
+ continue;
47929
+ }
47930
+ const started = Date.now();
47931
+ const run = await runCapturing(cmd.command, cmd.args, Math.min(packageTimeoutMs, remaining));
47932
+ const secs = ((Date.now() - started) / 1e3).toFixed(1);
47933
+ if (run.status === 0) {
47934
+ result.warmed.push(target.spec);
47935
+ console.log(` OK ${target.spec} (${secs}s)`);
47936
+ } else {
47937
+ const noise = /^npm (warn|notice)\b/;
47938
+ const lines = run.stderr.split("\n").map((l) => l.trim()).filter((l) => l.length > 0 && !noise.test(l));
47939
+ const reason = run.error?.message ?? lines[lines.length - 1] ?? `exit ${String(run.status)} (no stderr)`;
47940
+ result.failed.push({ spec: target.spec, reason });
47941
+ console.log(` MISS ${target.spec} (${secs}s) \u2014 fetched at runtime instead: ${reason}`);
47942
+ }
47897
47943
  }
47898
- }
47944
+ };
47945
+ await Promise.all(Array.from({ length: Math.max(1, concurrency) }, worker));
47899
47946
  console.log(
47900
47947
  `[codeam mcp-warm] warmed=${result.warmed.length} failed=${result.failed.length} skipped=${result.skipped.length}`
47901
47948
  );
@@ -47903,12 +47950,13 @@ async function mcpWarm(argv = []) {
47903
47950
  "mcpWarm",
47904
47951
  `warmed=${result.warmed.length} failed=${result.failed.length} skipped=${result.skipped.length}`
47905
47952
  );
47953
+ return result;
47906
47954
  }
47907
47955
 
47908
47956
  // src/commands/version.ts
47909
47957
  var import_picocolors15 = __toESM(require("picocolors"));
47910
47958
  function version2() {
47911
- const v = true ? "2.74.0" : "unknown";
47959
+ const v = true ? "2.74.1" : "unknown";
47912
47960
  console.log(`${import_picocolors15.default.bold("codeam-cli")} ${import_picocolors15.default.cyan(v)}`);
47913
47961
  }
47914
47962
 
@@ -48110,7 +48158,8 @@ async function main() {
48110
48158
  return mcpRun(args);
48111
48159
  }
48112
48160
  if (command === "mcp-warm") {
48113
- return mcpWarm(args);
48161
+ await mcpWarm(args);
48162
+ return;
48114
48163
  }
48115
48164
  if (command === "mcp-router") {
48116
48165
  return mcpRouter();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeam-cli",
3
- "version": "2.74.0",
3
+ "version": "2.74.1",
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",