codeam-cli 2.23.1 → 2.23.3

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 (3) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/index.js +102 -66
  3. package/package.json +1 -1
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.23.2] — 2026-05-25
8
+
9
+ ### Fixed
10
+
11
+ - **cli:** Fire-and-forget background handlers so they don't block start_task (#190)
12
+
13
+ ## [2.23.1] — 2026-05-25
14
+
15
+ ### Fixed
16
+
17
+ - **cli:** Payload.agentId — accept null, not just undefined (#189)
18
+
7
19
  ## [2.23.0] — 2026-05-25
8
20
 
9
21
  ### Added
package/dist/index.js CHANGED
@@ -441,7 +441,7 @@ var import_qrcode_terminal = __toESM(require("qrcode-terminal"));
441
441
  // package.json
442
442
  var package_default = {
443
443
  name: "codeam-cli",
444
- version: "2.23.1",
444
+ version: "2.23.3",
445
445
  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.",
446
446
  type: "commonjs",
447
447
  main: "dist/index.js",
@@ -5768,7 +5768,7 @@ function readAnonId() {
5768
5768
  }
5769
5769
  function superProperties() {
5770
5770
  return {
5771
- cliVersion: true ? "2.23.1" : "0.0.0-dev",
5771
+ cliVersion: true ? "2.23.3" : "0.0.0-dev",
5772
5772
  nodeVersion: process.version,
5773
5773
  platform: process.platform,
5774
5774
  arch: process.arch,
@@ -9129,6 +9129,23 @@ async function fetchClaudeQuota() {
9129
9129
 
9130
9130
  // src/services/spawn-and-capture.ts
9131
9131
  var import_child_process6 = require("child_process");
9132
+ var activeChildren = /* @__PURE__ */ new Set();
9133
+ function killActiveSpawnAndCaptureChildren() {
9134
+ for (const child of activeChildren) {
9135
+ try {
9136
+ child.kill("SIGTERM");
9137
+ } catch {
9138
+ }
9139
+ }
9140
+ setTimeout(() => {
9141
+ for (const child of activeChildren) {
9142
+ try {
9143
+ child.kill("SIGKILL");
9144
+ } catch {
9145
+ }
9146
+ }
9147
+ }, 250).unref?.();
9148
+ }
9132
9149
  async function spawnAndCapture(cmd, args2, opts = {}) {
9133
9150
  const timeoutMs = opts.timeoutMs ?? 6e4;
9134
9151
  return new Promise((resolve5) => {
@@ -9149,6 +9166,7 @@ async function spawnAndCapture(cmd, args2, opts = {}) {
9149
9166
  settle(null);
9150
9167
  return;
9151
9168
  }
9169
+ activeChildren.add(child);
9152
9170
  let stdout = "";
9153
9171
  child.stdout?.on("data", (chunk) => {
9154
9172
  stdout += chunk.toString("utf8");
@@ -9166,10 +9184,12 @@ async function spawnAndCapture(cmd, args2, opts = {}) {
9166
9184
  timer.unref();
9167
9185
  child.on("error", () => {
9168
9186
  clearTimeout(timer);
9187
+ activeChildren.delete(child);
9169
9188
  settle(null);
9170
9189
  });
9171
9190
  child.on("exit", (code) => {
9172
9191
  clearTimeout(timer);
9192
+ activeChildren.delete(child);
9173
9193
  if (code !== 0) {
9174
9194
  settle(null);
9175
9195
  return;
@@ -15452,7 +15472,7 @@ var applyFileReviewH = async (ctx, cmd, parsed) => {
15452
15472
  result
15453
15473
  );
15454
15474
  };
15455
- var requestLinkCredentialsH = async (ctx, _cmd, parsed) => {
15475
+ var requestLinkCredentialsH = (ctx, _cmd, parsed) => {
15456
15476
  const publicId = parsed.agentId;
15457
15477
  if (!publicId) return;
15458
15478
  if (!ctx.pluginAuthToken) {
@@ -15464,80 +15484,94 @@ var requestLinkCredentialsH = async (ctx, _cmd, parsed) => {
15464
15484
  log.trace("auto-link", `unknown / disabled agent: ${internalId}`);
15465
15485
  return;
15466
15486
  }
15467
- let linkCtx;
15468
- try {
15469
- linkCtx = buildLinkContext(internalId);
15470
- } catch (err) {
15471
- log.trace("auto-link", "buildLinkContext threw", err);
15472
- return;
15473
- }
15474
- const token = await linkCtx.locator.extract().catch((err) => {
15475
- log.trace("auto-link", `locator.extract failed for ${publicId}`, err);
15476
- return null;
15477
- });
15478
- if (!token) {
15479
- log.trace("auto-link", `no local ${linkCtx.displayName} credentials \u2014 skipping`);
15480
- return;
15481
- }
15482
- const result = await postLinkCredential({
15483
- agentId: publicId,
15484
- sessionId: ctx.sessionId,
15485
- pluginId: ctx.pluginId,
15486
- pluginAuthToken: ctx.pluginAuthToken,
15487
- method: token.method,
15488
- credential: token.credential
15489
- });
15490
- if (result.ok) {
15491
- log.trace("auto-link", `vaulted ${publicId} from ${token.source}`);
15492
- } else {
15493
- log.trace("auto-link", `upload failed (${result.status}): ${result.message}`);
15494
- }
15487
+ const pluginAuthToken = ctx.pluginAuthToken;
15488
+ void (async () => {
15489
+ let linkCtx;
15490
+ try {
15491
+ linkCtx = buildLinkContext(internalId);
15492
+ } catch (err) {
15493
+ log.trace("auto-link", "buildLinkContext threw", err);
15494
+ return;
15495
+ }
15496
+ const token = await linkCtx.locator.extract().catch((err) => {
15497
+ log.trace("auto-link", `locator.extract failed for ${publicId}`, err);
15498
+ return null;
15499
+ });
15500
+ if (!token) {
15501
+ log.trace("auto-link", `no local ${linkCtx.displayName} credentials \u2014 skipping`);
15502
+ return;
15503
+ }
15504
+ const result = await postLinkCredential({
15505
+ agentId: publicId,
15506
+ sessionId: ctx.sessionId,
15507
+ pluginId: ctx.pluginId,
15508
+ pluginAuthToken,
15509
+ method: token.method,
15510
+ credential: token.credential
15511
+ });
15512
+ if (result.ok) {
15513
+ log.trace("auto-link", `vaulted ${publicId} from ${token.source}`);
15514
+ } else {
15515
+ log.trace("auto-link", `upload failed (${result.status}): ${result.message}`);
15516
+ }
15517
+ })();
15495
15518
  };
15496
- var requestAiSummaryH = async (ctx, _cmd, parsed) => {
15519
+ var requestAiSummaryH = (ctx, _cmd, parsed) => {
15497
15520
  if (!ctx.pluginAuthToken) return;
15498
15521
  if (typeof ctx.runtime.generateOneShot !== "function") return;
15499
15522
  if (!parsed.prompt || !parsed.turnId || !parsed.stats) {
15500
15523
  log.trace("ai-summary", "missing prompt/turnId/stats \u2014 skipping");
15501
15524
  return;
15502
15525
  }
15503
- const text = await ctx.runtime.generateOneShot(parsed.prompt).catch((err) => {
15504
- log.trace("ai-summary", "generateOneShot threw", err);
15505
- return null;
15506
- });
15507
- if (!text) return;
15508
- await postAiResult({
15509
- sessionId: ctx.sessionId,
15510
- pluginId: ctx.pluginId,
15511
- pluginAuthToken: ctx.pluginAuthToken,
15512
- kind: "summary",
15513
- turnId: parsed.turnId,
15514
- summary: text,
15515
- stats: parsed.stats
15516
- });
15526
+ const prompt = parsed.prompt;
15527
+ const turnId = parsed.turnId;
15528
+ const stats = parsed.stats;
15529
+ const pluginAuthToken = ctx.pluginAuthToken;
15530
+ void (async () => {
15531
+ const text = await ctx.runtime.generateOneShot(prompt).catch((err) => {
15532
+ log.trace("ai-summary", "generateOneShot threw", err);
15533
+ return null;
15534
+ });
15535
+ if (!text) return;
15536
+ await postAiResult({
15537
+ sessionId: ctx.sessionId,
15538
+ pluginId: ctx.pluginId,
15539
+ pluginAuthToken,
15540
+ kind: "summary",
15541
+ turnId,
15542
+ summary: text,
15543
+ stats
15544
+ });
15545
+ })();
15517
15546
  };
15518
- var requestAiInsightH = async (ctx, _cmd, parsed) => {
15547
+ var requestAiInsightH = (ctx, _cmd, parsed) => {
15519
15548
  if (!ctx.pluginAuthToken) return;
15520
15549
  if (typeof ctx.runtime.generateOneShot !== "function") return;
15521
15550
  if (!parsed.prompt || !parsed.fileChangeId) {
15522
15551
  log.trace("ai-insight", "missing prompt/fileChangeId \u2014 skipping");
15523
15552
  return;
15524
15553
  }
15525
- const text = await ctx.runtime.generateOneShot(parsed.prompt).catch((err) => {
15526
- log.trace("ai-insight", "generateOneShot threw", err);
15527
- return null;
15528
- });
15529
- if (!text) return;
15530
- const { summary, reasoning, securityNote } = parseInsightText(text);
15531
- await postAiResult({
15532
- sessionId: ctx.sessionId,
15533
- pluginId: ctx.pluginId,
15534
- pluginAuthToken: ctx.pluginAuthToken,
15535
- kind: "insight",
15536
- fileChangeId: parsed.fileChangeId,
15537
- summary,
15538
- reasoning,
15539
- securityNote
15540
- });
15554
+ const prompt = parsed.prompt;
15555
+ const fileChangeId = parsed.fileChangeId;
15556
+ const pluginAuthToken = ctx.pluginAuthToken;
15557
+ void (async () => {
15558
+ const text = await ctx.runtime.generateOneShot(prompt).catch((err) => {
15559
+ log.trace("ai-insight", "generateOneShot threw", err);
15560
+ return null;
15561
+ });
15562
+ if (!text) return;
15563
+ const { summary, reasoning, securityNote } = parseInsightText(text);
15564
+ await postAiResult({
15565
+ sessionId: ctx.sessionId,
15566
+ pluginId: ctx.pluginId,
15567
+ pluginAuthToken,
15568
+ kind: "insight",
15569
+ fileChangeId,
15570
+ summary,
15571
+ reasoning,
15572
+ securityNote
15573
+ });
15574
+ })();
15541
15575
  };
15542
15576
  function parseInsightText(text) {
15543
15577
  const summaryMatch = text.match(/SUMMARY:\s*([\s\S]*?)(?=\n\s*(?:REASONING|SECURITY):|$)/i);
@@ -15701,6 +15735,7 @@ async function start(requestedAgent) {
15701
15735
  void streamingEmitter?.stop();
15702
15736
  closeAllTerminals();
15703
15737
  cleanupAttachmentTempFiles();
15738
+ killActiveSpawnAndCaptureChildren();
15704
15739
  process.exit(code);
15705
15740
  }
15706
15741
  }
@@ -15746,6 +15781,7 @@ async function start(requestedAgent) {
15746
15781
  void streamingEmitter?.stop();
15747
15782
  closeAllTerminals();
15748
15783
  cleanupAttachmentTempFiles();
15784
+ killActiveSpawnAndCaptureChildren();
15749
15785
  void shutdownTelemetry();
15750
15786
  process.exit(0);
15751
15787
  }
@@ -18290,7 +18326,7 @@ function checkChokidar() {
18290
18326
  }
18291
18327
  async function doctor(args2 = []) {
18292
18328
  const json = args2.includes("--json");
18293
- const cliVersion = true ? "2.23.1" : "0.0.0-dev";
18329
+ const cliVersion = true ? "2.23.3" : "0.0.0-dev";
18294
18330
  const apiBase = resolveApiBaseUrl();
18295
18331
  const diagnosticId = (0, import_node_crypto5.randomUUID)();
18296
18332
  log.info("doctor", `run id=${diagnosticId} cli=${cliVersion}`);
@@ -18489,7 +18525,7 @@ async function completion(args2) {
18489
18525
  // src/commands/version.ts
18490
18526
  var import_picocolors13 = __toESM(require("picocolors"));
18491
18527
  function version2() {
18492
- const v = true ? "2.23.1" : "unknown";
18528
+ const v = true ? "2.23.3" : "unknown";
18493
18529
  console.log(`${import_picocolors13.default.bold("codeam-cli")} ${import_picocolors13.default.cyan(v)}`);
18494
18530
  }
18495
18531
 
@@ -18717,7 +18753,7 @@ function checkForUpdates() {
18717
18753
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
18718
18754
  if (process.env.CI) return;
18719
18755
  if (!process.stdout.isTTY) return;
18720
- const current = true ? "2.23.1" : null;
18756
+ const current = true ? "2.23.3" : null;
18721
18757
  if (!current) return;
18722
18758
  const cache = readCache();
18723
18759
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeam-cli",
3
- "version": "2.23.1",
3
+ "version": "2.23.3",
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",