codeam-cli 2.60.29 → 2.60.32
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 +16 -0
- package/dist/index.js +90 -66
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,22 @@ 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.60.31] — 2026-07-10
|
|
8
|
+
|
|
9
|
+
### Tests
|
|
10
|
+
|
|
11
|
+
- **cli:** Fix kimi-config-provision (login removed) + stabilize Windows waitForBinary
|
|
12
|
+
|
|
13
|
+
## [2.60.29] — 2026-07-10
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- **shared:** Add CODERABBIT_* to USER_EVENTS (fix A↔B shared-drift)
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- **cli:** Route "Authentication required" to the re-auth bubble (kimi codespace)
|
|
22
|
+
|
|
7
23
|
## [2.60.28] — 2026-07-09
|
|
8
24
|
|
|
9
25
|
### Fixed
|
package/dist/index.js
CHANGED
|
@@ -5689,7 +5689,7 @@ function readAnonId() {
|
|
|
5689
5689
|
}
|
|
5690
5690
|
function superProperties() {
|
|
5691
5691
|
return {
|
|
5692
|
-
cliVersion: true ? "2.60.
|
|
5692
|
+
cliVersion: true ? "2.60.32" : "0.0.0-dev",
|
|
5693
5693
|
nodeVersion: process.version,
|
|
5694
5694
|
platform: process.platform,
|
|
5695
5695
|
arch: process.arch,
|
|
@@ -5870,7 +5870,7 @@ var os4 = __toESM(require("os"));
|
|
|
5870
5870
|
// package.json
|
|
5871
5871
|
var package_default = {
|
|
5872
5872
|
name: "codeam-cli",
|
|
5873
|
-
version: "2.60.
|
|
5873
|
+
version: "2.60.32",
|
|
5874
5874
|
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.",
|
|
5875
5875
|
type: "commonjs",
|
|
5876
5876
|
main: "dist/index.js",
|
|
@@ -6963,7 +6963,7 @@ var CommandRelayService = class {
|
|
|
6963
6963
|
// fresh + clear the "CLI update available" banner after a self-update
|
|
6964
6964
|
// (a codespace that reinstalls @latest reconnects via heartbeat, not
|
|
6965
6965
|
// pair/reconnect). Older backends ignore the extra field.
|
|
6966
|
-
..."2.60.
|
|
6966
|
+
..."2.60.32" ? { ideVersion: "2.60.32" } : {}
|
|
6967
6967
|
}).then(() => log.trace("relay", `heartbeat ok online=${online}`)).catch((err) => log.trace("relay", `heartbeat failed online=${online}`, err));
|
|
6968
6968
|
}
|
|
6969
6969
|
/**
|
|
@@ -15655,7 +15655,7 @@ async function configureCoderabbit(input, deps = {}) {
|
|
|
15655
15655
|
}
|
|
15656
15656
|
|
|
15657
15657
|
// src/commands/host-agent.ts
|
|
15658
|
-
var
|
|
15658
|
+
var import_node_child_process22 = require("child_process");
|
|
15659
15659
|
var os35 = __toESM(require("os"));
|
|
15660
15660
|
var fs41 = __toESM(require("fs"));
|
|
15661
15661
|
var path44 = __toESM(require("path"));
|
|
@@ -16074,7 +16074,6 @@ async function prepareWorkspace(repoOrPath, deployId, cloneToken) {
|
|
|
16074
16074
|
var fs35 = __toESM(require("fs"));
|
|
16075
16075
|
var os31 = __toESM(require("os"));
|
|
16076
16076
|
var path39 = __toESM(require("path"));
|
|
16077
|
-
var import_node_child_process17 = require("child_process");
|
|
16078
16077
|
var PUBLIC_TO_INTERNAL_AGENT = {
|
|
16079
16078
|
claude_code: "claude",
|
|
16080
16079
|
claude: "claude",
|
|
@@ -16188,24 +16187,9 @@ var kimiProvisioner = {
|
|
|
16188
16187
|
return { KIMI_API_KEY: auth.value };
|
|
16189
16188
|
}
|
|
16190
16189
|
credentialsFiles.forEach((f) => writeFile0600(f, auth.value));
|
|
16191
|
-
provisionKimiConfig(home);
|
|
16192
16190
|
return {};
|
|
16193
16191
|
}
|
|
16194
16192
|
};
|
|
16195
|
-
function provisionKimiConfig(home) {
|
|
16196
|
-
try {
|
|
16197
|
-
const osStrat = createOsStrategy();
|
|
16198
|
-
const binary = osStrat.findInPath("kimi");
|
|
16199
|
-
if (!binary) return;
|
|
16200
|
-
const launch = osStrat.buildLaunch(binary, ["login"]);
|
|
16201
|
-
(0, import_node_child_process17.spawnSync)(launch.cmd, launch.args, {
|
|
16202
|
-
stdio: "ignore",
|
|
16203
|
-
timeout: 6e4,
|
|
16204
|
-
env: { ...process.env, HOME: home, USERPROFILE: home }
|
|
16205
|
-
});
|
|
16206
|
-
} catch {
|
|
16207
|
-
}
|
|
16208
|
-
}
|
|
16209
16193
|
var coderabbitProvisioner = {
|
|
16210
16194
|
write(auth, home) {
|
|
16211
16195
|
const dir = path39.join(home, ".coderabbit");
|
|
@@ -16256,7 +16240,7 @@ function provisionAgentCredentials(publicAgentId, auth, homeDir2 = os31.homedir(
|
|
|
16256
16240
|
}
|
|
16257
16241
|
|
|
16258
16242
|
// src/commands/host/git-tooling.ts
|
|
16259
|
-
var
|
|
16243
|
+
var import_node_child_process17 = require("child_process");
|
|
16260
16244
|
var fs36 = __toESM(require("fs"));
|
|
16261
16245
|
var os32 = __toESM(require("os"));
|
|
16262
16246
|
var path40 = __toESM(require("path"));
|
|
@@ -16370,7 +16354,7 @@ var defaultGitToolingRunner = {
|
|
|
16370
16354
|
which(cmd) {
|
|
16371
16355
|
try {
|
|
16372
16356
|
const probe = process.platform === "win32" ? "where" : "which";
|
|
16373
|
-
(0,
|
|
16357
|
+
(0, import_node_child_process17.execFileSync)(probe, [cmd], { stdio: "ignore" });
|
|
16374
16358
|
return true;
|
|
16375
16359
|
} catch {
|
|
16376
16360
|
return false;
|
|
@@ -16378,7 +16362,7 @@ var defaultGitToolingRunner = {
|
|
|
16378
16362
|
},
|
|
16379
16363
|
run(cmd, args2, opts = {}) {
|
|
16380
16364
|
return new Promise((resolve7) => {
|
|
16381
|
-
const child = (0,
|
|
16365
|
+
const child = (0, import_node_child_process17.spawn)(cmd, args2, {
|
|
16382
16366
|
stdio: [opts.input !== void 0 ? "pipe" : "ignore", "ignore", "pipe"]
|
|
16383
16367
|
});
|
|
16384
16368
|
let stderr = "";
|
|
@@ -16532,12 +16516,12 @@ var HeadroomStatsReporter = class {
|
|
|
16532
16516
|
};
|
|
16533
16517
|
|
|
16534
16518
|
// src/commands/host/os-packages.ts
|
|
16535
|
-
var
|
|
16519
|
+
var import_node_child_process18 = require("child_process");
|
|
16536
16520
|
var PM_INSTALL_TIMEOUT_MS = 18e4;
|
|
16537
16521
|
var defaultHeadroomRunner = {
|
|
16538
16522
|
which(cmd) {
|
|
16539
16523
|
try {
|
|
16540
|
-
(0,
|
|
16524
|
+
(0, import_node_child_process18.execFileSync)("which", [cmd], { stdio: "ignore" });
|
|
16541
16525
|
return true;
|
|
16542
16526
|
} catch {
|
|
16543
16527
|
return false;
|
|
@@ -16546,7 +16530,7 @@ var defaultHeadroomRunner = {
|
|
|
16546
16530
|
run(cmd, args2, opts = {}) {
|
|
16547
16531
|
return new Promise((resolve7) => {
|
|
16548
16532
|
const spawnEnv = opts.env ?? process.env;
|
|
16549
|
-
const child = (0,
|
|
16533
|
+
const child = (0, import_node_child_process18.spawn)(cmd, args2, { stdio: ["ignore", "pipe", "pipe"], env: spawnEnv });
|
|
16550
16534
|
let stderrBuf = "";
|
|
16551
16535
|
let stdoutBuf = "";
|
|
16552
16536
|
let settled = false;
|
|
@@ -17053,14 +17037,14 @@ async function setupHeadroomForSelfHosted(agent, runner = defaultHeadroomRunner,
|
|
|
17053
17037
|
}
|
|
17054
17038
|
|
|
17055
17039
|
// src/commands/host/self-update.ts
|
|
17056
|
-
var
|
|
17040
|
+
var import_node_child_process20 = require("child_process");
|
|
17057
17041
|
|
|
17058
17042
|
// src/lib/updateNotifier.ts
|
|
17059
17043
|
var fs39 = __toESM(require("fs"));
|
|
17060
17044
|
var os34 = __toESM(require("os"));
|
|
17061
17045
|
var path43 = __toESM(require("path"));
|
|
17062
17046
|
var https6 = __toESM(require("https"));
|
|
17063
|
-
var
|
|
17047
|
+
var import_node_child_process19 = require("child_process");
|
|
17064
17048
|
var import_picocolors3 = __toESM(require("picocolors"));
|
|
17065
17049
|
var PKG_NAME = "codeam-cli";
|
|
17066
17050
|
var REGISTRY_URL = `https://registry.npmjs.org/${PKG_NAME}/latest`;
|
|
@@ -17154,7 +17138,7 @@ function notifyIfStale(currentVersion, latest) {
|
|
|
17154
17138
|
}
|
|
17155
17139
|
function isLinkedInstall() {
|
|
17156
17140
|
try {
|
|
17157
|
-
const root = (0,
|
|
17141
|
+
const root = (0, import_node_child_process19.execSync)("npm root -g", {
|
|
17158
17142
|
encoding: "utf8",
|
|
17159
17143
|
stdio: ["ignore", "pipe", "ignore"],
|
|
17160
17144
|
timeout: 2e3
|
|
@@ -17182,7 +17166,7 @@ function maybeAutoUpdate(currentVersion, latest) {
|
|
|
17182
17166
|
|
|
17183
17167
|
`
|
|
17184
17168
|
);
|
|
17185
|
-
const install = (0,
|
|
17169
|
+
const install = (0, import_node_child_process19.spawnSync)("npm", ["install", "-g", `${PKG_NAME}@latest`], {
|
|
17186
17170
|
stdio: "inherit",
|
|
17187
17171
|
env: process.env
|
|
17188
17172
|
});
|
|
@@ -17203,7 +17187,7 @@ function maybeAutoUpdate(currentVersion, latest) {
|
|
|
17203
17187
|
process.stderr.write(` ${import_picocolors3.default.green("\u2713")} Updated. Resuming session...
|
|
17204
17188
|
|
|
17205
17189
|
`);
|
|
17206
|
-
const child = (0,
|
|
17190
|
+
const child = (0, import_node_child_process19.spawnSync)("codeam", process.argv.slice(2), {
|
|
17207
17191
|
stdio: "inherit",
|
|
17208
17192
|
env: process.env
|
|
17209
17193
|
});
|
|
@@ -17213,7 +17197,7 @@ async function autoUpgradeBeforeCriticalCommand() {
|
|
|
17213
17197
|
if (process.env.NODE_ENV === "test") return;
|
|
17214
17198
|
if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
|
|
17215
17199
|
if (process.env.CI) return;
|
|
17216
|
-
const current = true ? "2.60.
|
|
17200
|
+
const current = true ? "2.60.32" : null;
|
|
17217
17201
|
if (!current) return;
|
|
17218
17202
|
const cache = readCache();
|
|
17219
17203
|
const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
|
|
@@ -17230,7 +17214,7 @@ function checkForUpdates() {
|
|
|
17230
17214
|
if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
|
|
17231
17215
|
if (process.env.CI) return;
|
|
17232
17216
|
if (!process.stdout.isTTY) return;
|
|
17233
|
-
const current = true ? "2.60.
|
|
17217
|
+
const current = true ? "2.60.32" : null;
|
|
17234
17218
|
if (!current) return;
|
|
17235
17219
|
const cache = readCache();
|
|
17236
17220
|
const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
|
|
@@ -17250,11 +17234,11 @@ var SELF_UPDATE_INTERVAL_MS = 60 * 60 * 1e3;
|
|
|
17250
17234
|
var SELF_UPDATE_VIEW_TIMEOUT_MS = 3e4;
|
|
17251
17235
|
var SELF_UPDATE_INSTALL_TIMEOUT_MS = 18e4;
|
|
17252
17236
|
function currentCliVersion() {
|
|
17253
|
-
return true ? "2.60.
|
|
17237
|
+
return true ? "2.60.32" : null;
|
|
17254
17238
|
}
|
|
17255
17239
|
function runCmd(cmd, args2, timeoutMs) {
|
|
17256
17240
|
return new Promise((resolve7) => {
|
|
17257
|
-
(0,
|
|
17241
|
+
(0, import_node_child_process20.execFile)(cmd, args2, { timeout: timeoutMs }, (err, stdout, stderr) => {
|
|
17258
17242
|
const code = err && typeof err.code === "number" ? err.code : err ? null : 0;
|
|
17259
17243
|
resolve7({ code, stdout: stdout ?? "", stderr: stderr ?? "" });
|
|
17260
17244
|
});
|
|
@@ -17316,11 +17300,11 @@ async function runSelfUpdate() {
|
|
|
17316
17300
|
}
|
|
17317
17301
|
|
|
17318
17302
|
// src/commands/host/teardown.ts
|
|
17319
|
-
var
|
|
17303
|
+
var import_node_child_process21 = require("child_process");
|
|
17320
17304
|
var fs40 = __toESM(require("fs"));
|
|
17321
17305
|
var defaultDisableService = () => {
|
|
17322
17306
|
try {
|
|
17323
|
-
(0,
|
|
17307
|
+
(0, import_node_child_process21.execFileSync)("systemctl", ["disable", "--now", "codeam-host-agent"], { stdio: "ignore" });
|
|
17324
17308
|
} catch {
|
|
17325
17309
|
}
|
|
17326
17310
|
};
|
|
@@ -17328,7 +17312,7 @@ var defaultTeardownHeadroom = () => {
|
|
|
17328
17312
|
try {
|
|
17329
17313
|
const kind = JSON.parse(fs40.readFileSync(headroomConfigPath(), "utf8")).agent;
|
|
17330
17314
|
if (kind) {
|
|
17331
|
-
(0,
|
|
17315
|
+
(0, import_node_child_process21.execFileSync)("headroom", ["unwrap", kind], { stdio: "ignore", timeout: 15e3 });
|
|
17332
17316
|
}
|
|
17333
17317
|
} catch {
|
|
17334
17318
|
}
|
|
@@ -17486,7 +17470,7 @@ var CONTROL_AGENT_META = {
|
|
|
17486
17470
|
headroomWrappable: false,
|
|
17487
17471
|
acp: false
|
|
17488
17472
|
};
|
|
17489
|
-
var defaultSpawner = (env, cwd, args2 = []) => (0,
|
|
17473
|
+
var defaultSpawner = (env, cwd, args2 = []) => (0, import_node_child_process22.spawn)(process.execPath, [process.argv[1], "pair-auto", ...args2], {
|
|
17490
17474
|
cwd,
|
|
17491
17475
|
env: { ...process.env, ...env },
|
|
17492
17476
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -17966,7 +17950,7 @@ var HostAgentSupervisor = class {
|
|
|
17966
17950
|
runAgentInstall(script) {
|
|
17967
17951
|
return new Promise((resolve7) => {
|
|
17968
17952
|
const home = process.env.HOME || os35.homedir();
|
|
17969
|
-
const child = (0,
|
|
17953
|
+
const child = (0, import_node_child_process22.spawn)("sh", ["-c", script], {
|
|
17970
17954
|
env: { ...process.env, HOME: home },
|
|
17971
17955
|
stdio: ["ignore", "pipe", "pipe"]
|
|
17972
17956
|
});
|
|
@@ -18274,11 +18258,11 @@ function makeRealApplyBudgetDeps() {
|
|
|
18274
18258
|
var import_child_process14 = require("child_process");
|
|
18275
18259
|
var import_fs = require("fs");
|
|
18276
18260
|
var import_promises = __toESM(require("fs/promises"));
|
|
18277
|
-
var
|
|
18261
|
+
var import_os8 = __toESM(require("os"));
|
|
18278
18262
|
var import_path4 = __toESM(require("path"));
|
|
18279
18263
|
var import_promises2 = require("stream/promises");
|
|
18280
18264
|
var import_which = __toESM(require("which"));
|
|
18281
|
-
var CACHED_BINARY = import_path4.default.join(
|
|
18265
|
+
var CACHED_BINARY = import_path4.default.join(import_os8.default.homedir(), ".codeam", "bin", "cloudflared");
|
|
18282
18266
|
async function resolveCloudflared(opts = {}) {
|
|
18283
18267
|
try {
|
|
18284
18268
|
return await (0, import_which.default)("cloudflared");
|
|
@@ -18378,7 +18362,7 @@ function decodeTunnelToken(token) {
|
|
|
18378
18362
|
}
|
|
18379
18363
|
async function spawnNamedTunnel(bin, token, port) {
|
|
18380
18364
|
const creds = decodeTunnelToken(token);
|
|
18381
|
-
const credDir = import_path4.default.join(
|
|
18365
|
+
const credDir = import_path4.default.join(import_os8.default.homedir(), ".codeam");
|
|
18382
18366
|
await import_promises.default.mkdir(credDir, { recursive: true });
|
|
18383
18367
|
const credFile = import_path4.default.join(credDir, `tunnel-${creds.TunnelID}.json`);
|
|
18384
18368
|
await import_promises.default.writeFile(credFile, JSON.stringify(creds), { mode: 384 });
|
|
@@ -22432,7 +22416,7 @@ async function pairAuto(args2) {
|
|
|
22432
22416
|
}
|
|
22433
22417
|
|
|
22434
22418
|
// src/services/headroom/wrap-launch.ts
|
|
22435
|
-
var
|
|
22419
|
+
var import_node_child_process23 = require("child_process");
|
|
22436
22420
|
function wrapWithHeadroom(launch, opts) {
|
|
22437
22421
|
if (!opts.enabled || !opts.headroomPresent) return launch;
|
|
22438
22422
|
return {
|
|
@@ -22445,7 +22429,7 @@ var _present;
|
|
|
22445
22429
|
function headroomPresent() {
|
|
22446
22430
|
if (_present !== void 0) return Promise.resolve(_present);
|
|
22447
22431
|
return new Promise((resolve7) => {
|
|
22448
|
-
(0,
|
|
22432
|
+
(0, import_node_child_process23.execFile)("headroom", ["--version"], (err) => {
|
|
22449
22433
|
_present = !err;
|
|
22450
22434
|
resolve7(_present);
|
|
22451
22435
|
});
|
|
@@ -22799,7 +22783,7 @@ var path60 = __toESM(require("path"));
|
|
|
22799
22783
|
|
|
22800
22784
|
// src/agents/acp/agent-binary.ts
|
|
22801
22785
|
var import_fs4 = __toESM(require("fs"));
|
|
22802
|
-
var
|
|
22786
|
+
var import_os10 = __toESM(require("os"));
|
|
22803
22787
|
var import_path8 = __toESM(require("path"));
|
|
22804
22788
|
var import_child_process25 = require("child_process");
|
|
22805
22789
|
function currentPlatformKey() {
|
|
@@ -22895,7 +22879,7 @@ function resolveCursorAgentBinary(deps = {}) {
|
|
|
22895
22879
|
const exe = import_path8.default.win32.join(localAppData, "cursor-agent", "cursor-agent.exe");
|
|
22896
22880
|
return existsSync26(exe) ? exe : null;
|
|
22897
22881
|
}
|
|
22898
|
-
const home = deps.homedir ??
|
|
22882
|
+
const home = deps.homedir ?? import_os10.default.homedir();
|
|
22899
22883
|
const unix = import_path8.default.posix.join(home, ".local", "bin", "cursor-agent");
|
|
22900
22884
|
return existsSync26(unix) ? unix : null;
|
|
22901
22885
|
}
|
|
@@ -22969,7 +22953,7 @@ async function waitForAdapterModuleGraph(command2, args2, opts = {}) {
|
|
|
22969
22953
|
}
|
|
22970
22954
|
|
|
22971
22955
|
// src/agents/kimi/installer.ts
|
|
22972
|
-
var
|
|
22956
|
+
var import_node_child_process24 = require("child_process");
|
|
22973
22957
|
var import_node_os6 = require("os");
|
|
22974
22958
|
var import_node_path6 = require("path");
|
|
22975
22959
|
var INSTALL_URL2 = "https://code.kimi.com/kimi-code/install.sh";
|
|
@@ -22977,7 +22961,7 @@ function kimiBinDir() {
|
|
|
22977
22961
|
return (0, import_node_path6.join)(process.env.KIMI_CODE_HOME || (0, import_node_path6.join)((0, import_node_os6.homedir)(), ".kimi-code"), "bin");
|
|
22978
22962
|
}
|
|
22979
22963
|
function kimiRuns() {
|
|
22980
|
-
const r = (0,
|
|
22964
|
+
const r = (0, import_node_child_process24.spawnSync)("kimi", ["--version"], { stdio: "ignore", timeout: 15e3 });
|
|
22981
22965
|
return !r.error && r.status === 0;
|
|
22982
22966
|
}
|
|
22983
22967
|
function augmentPath2() {
|
|
@@ -22987,7 +22971,7 @@ function augmentPath2() {
|
|
|
22987
22971
|
}
|
|
22988
22972
|
async function runInstaller2() {
|
|
22989
22973
|
return new Promise((resolve7) => {
|
|
22990
|
-
const proc = (0,
|
|
22974
|
+
const proc = (0, import_node_child_process24.spawn)("sh", ["-c", `curl -fsSL ${INSTALL_URL2} | bash`], { stdio: "inherit" });
|
|
22991
22975
|
proc.on("close", (code) => resolve7(code === 0));
|
|
22992
22976
|
proc.on("error", () => resolve7(false));
|
|
22993
22977
|
});
|
|
@@ -23724,7 +23708,7 @@ var HistoryService = class _HistoryService {
|
|
|
23724
23708
|
};
|
|
23725
23709
|
|
|
23726
23710
|
// src/agents/acp/client.ts
|
|
23727
|
-
var
|
|
23711
|
+
var import_node_child_process25 = require("child_process");
|
|
23728
23712
|
var fs57 = __toESM(require("fs/promises"));
|
|
23729
23713
|
var fsSync = __toESM(require("fs"));
|
|
23730
23714
|
var os46 = __toESM(require("os"));
|
|
@@ -26270,6 +26254,14 @@ var AcpClient = class {
|
|
|
26270
26254
|
* swallows the Code Assist onboarding error and never rejects `newSession`,
|
|
26271
26255
|
* so without this the session hangs forever ("loading… / offline"). */
|
|
26272
26256
|
startupFailureReject = null;
|
|
26257
|
+
/** Set for the WHOLE initial handshake (initialize → newSession). The child
|
|
26258
|
+
* `exit` handler calls it when the adapter dies mid-startup — e.g. it crashes
|
|
26259
|
+
* at `import` (ERR_MODULE_NOT_FOUND on a still-installing dep) BEFORE the
|
|
26260
|
+
* `initialize` response the handshake awaits would ever arrive. Without it,
|
|
26261
|
+
* `startOnce` hangs on that response and `start()`'s transient-retry never
|
|
26262
|
+
* engages; with it, the crash rejects immediately → retry respawns once the
|
|
26263
|
+
* install settles. Broader than {@link startupFailureReject} (newSession-only). */
|
|
26264
|
+
startAbortReject = null;
|
|
26273
26265
|
/**
|
|
26274
26266
|
* Spawn the adapter + handshake, retrying a TRANSIENT in-adapter spawn race.
|
|
26275
26267
|
*
|
|
@@ -26302,10 +26294,22 @@ var AcpClient = class {
|
|
|
26302
26294
|
}
|
|
26303
26295
|
throw lastErr;
|
|
26304
26296
|
}
|
|
26305
|
-
/** True when a failed {@link startOnce} was caused by
|
|
26306
|
-
*
|
|
26307
|
-
*
|
|
26308
|
-
*
|
|
26297
|
+
/** True when a failed {@link startOnce} was caused by a TRANSIENT install
|
|
26298
|
+
* race that clears within ms, so respawning the adapter recovers. Two
|
|
26299
|
+
* distinct races, both fresh-codespace only:
|
|
26300
|
+
* 1. The adapter's OWN spawn of the agent binary (`claude-agent-acp`
|
|
26301
|
+
* exec'ing the ~250 MB SDK-bundled `claude`) mid-atomic-rename →
|
|
26302
|
+
* `ETXTBSY`/`ENOENT`.
|
|
26303
|
+
* 2. The adapter's OWN `import` of a still-installing dependency
|
|
26304
|
+
* (`claude-agent-acp` importing `@anthropic-ai/claude-agent-sdk/sdk.mjs`
|
|
26305
|
+
* before npm finished the package's atomic rename) → the node process
|
|
26306
|
+
* exits at load with `ERR_MODULE_NOT_FOUND` / a truncated-file
|
|
26307
|
+
* `SyntaxError` (2026-07-10 incident: EVERY codespace claude deploy died
|
|
26308
|
+
* "The claude agent failed to start" here — the pre-spawn module-graph
|
|
26309
|
+
* gate probes just BEFORE the real spawn, leaving a TOCTOU window npm's
|
|
26310
|
+
* rename slips through). {@link ADAPTER_MODULE_LOAD_ERROR_RE} matches it.
|
|
26311
|
+
* Checks the thrown error's message/data AND the adapter stderr ring — the
|
|
26312
|
+
* adapter logs the real cause to stderr while returning a generic error. */
|
|
26309
26313
|
isTransientAdapterSpawn(err) {
|
|
26310
26314
|
const parts = [...this.recentStderr];
|
|
26311
26315
|
if (err instanceof Error) parts.push(err.message);
|
|
@@ -26317,7 +26321,8 @@ var AcpClient = class {
|
|
|
26317
26321
|
}
|
|
26318
26322
|
if (typeof e.details === "string") parts.push(e.details);
|
|
26319
26323
|
}
|
|
26320
|
-
|
|
26324
|
+
const joined = parts.join(" ");
|
|
26325
|
+
return TRANSIENT_ADAPTER_SPAWN_RE.test(joined) || ADAPTER_MODULE_LOAD_ERROR_RE.test(joined);
|
|
26321
26326
|
}
|
|
26322
26327
|
async startOnce() {
|
|
26323
26328
|
if (this.child) throw new Error("AcpClient already started");
|
|
@@ -26328,7 +26333,7 @@ var AcpClient = class {
|
|
|
26328
26333
|
"acpClient",
|
|
26329
26334
|
`spawn cmd=${adapter.command} args=[${adapter.args.join(",")}] cwd=${cwd}`
|
|
26330
26335
|
);
|
|
26331
|
-
const child = (0,
|
|
26336
|
+
const child = (0, import_node_child_process25.spawn)(adapter.command, adapter.args, {
|
|
26332
26337
|
cwd,
|
|
26333
26338
|
// extraEnv (e.g. CLAUDE_CODE_DISABLE_1M_CONTEXT=1 on an on-demand
|
|
26334
26339
|
// re-spawn) layers over process.env; PATH stays last so the augmented
|
|
@@ -26356,6 +26361,16 @@ var AcpClient = class {
|
|
|
26356
26361
|
child.on("exit", (code, signal) => {
|
|
26357
26362
|
if (this.stopping) return;
|
|
26358
26363
|
log.warn("acpClient", `adapter exited unexpectedly code=${code} signal=${signal}`);
|
|
26364
|
+
if (this.startAbortReject) {
|
|
26365
|
+
const tail = this.recentStderr.slice(-6).join(" | ");
|
|
26366
|
+
this.startAbortReject(
|
|
26367
|
+
new Error(
|
|
26368
|
+
`ADAPTER_EXITED_DURING_START code=${code} signal=${signal}${tail ? ` \u2014 ${tail}` : ""}`
|
|
26369
|
+
)
|
|
26370
|
+
);
|
|
26371
|
+
this.startAbortReject = null;
|
|
26372
|
+
return;
|
|
26373
|
+
}
|
|
26359
26374
|
this.opts.onUnexpectedExit?.(code, signal);
|
|
26360
26375
|
});
|
|
26361
26376
|
child.on("error", (err) => {
|
|
@@ -26377,11 +26392,17 @@ var AcpClient = class {
|
|
|
26377
26392
|
(_agent) => this.buildClient(),
|
|
26378
26393
|
stream
|
|
26379
26394
|
);
|
|
26380
|
-
|
|
26381
|
-
|
|
26382
|
-
protocolVersion: PROTOCOL_VERSION2,
|
|
26383
|
-
clientCapabilities: CLIENT_CAPABILITIES
|
|
26395
|
+
const startAborted = new Promise((_2, reject) => {
|
|
26396
|
+
this.startAbortReject = reject;
|
|
26384
26397
|
});
|
|
26398
|
+
log.info("acpClient", "initialize \u2192 sending");
|
|
26399
|
+
const initialize = await Promise.race([
|
|
26400
|
+
this.connection.initialize({
|
|
26401
|
+
protocolVersion: PROTOCOL_VERSION2,
|
|
26402
|
+
clientCapabilities: CLIENT_CAPABILITIES
|
|
26403
|
+
}),
|
|
26404
|
+
startAborted
|
|
26405
|
+
]);
|
|
26385
26406
|
log.info(
|
|
26386
26407
|
"acpClient",
|
|
26387
26408
|
`initialize \u2190 ok protocolVersion=${initialize.protocolVersion} agentCaps=${JSON.stringify(initialize.agentCapabilities ?? {}).slice(0, 200)}`
|
|
@@ -26405,12 +26426,14 @@ var AcpClient = class {
|
|
|
26405
26426
|
try {
|
|
26406
26427
|
newSession = await Promise.race([
|
|
26407
26428
|
this.connection.newSession({ cwd, mcpServers: [] }),
|
|
26408
|
-
startupFailure
|
|
26429
|
+
startupFailure,
|
|
26430
|
+
startAborted
|
|
26409
26431
|
]);
|
|
26410
26432
|
} finally {
|
|
26411
26433
|
if (startupTimer) clearTimeout(startupTimer);
|
|
26412
26434
|
this.startupFailureReject = null;
|
|
26413
26435
|
}
|
|
26436
|
+
this.startAbortReject = null;
|
|
26414
26437
|
this.sessionId = newSession.sessionId;
|
|
26415
26438
|
const newSessionMeta = newSession;
|
|
26416
26439
|
log.info(
|
|
@@ -26445,6 +26468,7 @@ var AcpClient = class {
|
|
|
26445
26468
|
this.connection = null;
|
|
26446
26469
|
this.sessionId = null;
|
|
26447
26470
|
this.startupFailureReject = null;
|
|
26471
|
+
this.startAbortReject = null;
|
|
26448
26472
|
}
|
|
26449
26473
|
/**
|
|
26450
26474
|
* Send a user prompt to the active session. Returns the
|
|
@@ -27712,7 +27736,7 @@ async function discoverRepos(workingDir, maxDepth = 4) {
|
|
|
27712
27736
|
// src/services/turn-files/files-outbox.ts
|
|
27713
27737
|
var fs60 = __toESM(require("fs/promises"));
|
|
27714
27738
|
var path65 = __toESM(require("path"));
|
|
27715
|
-
var
|
|
27739
|
+
var import_os11 = require("os");
|
|
27716
27740
|
var HOME_OUTBOX_DIR = ".codeam/outbox";
|
|
27717
27741
|
var MAX_AGE_MS = 24 * 60 * 60 * 1e3;
|
|
27718
27742
|
var BACKOFF_STEPS_MS = [
|
|
@@ -27879,7 +27903,7 @@ function applyJitter(ms) {
|
|
|
27879
27903
|
return Math.round(ms * factor);
|
|
27880
27904
|
}
|
|
27881
27905
|
function homeDir() {
|
|
27882
|
-
return process.env.HOME ?? process.env.USERPROFILE ?? (0,
|
|
27906
|
+
return process.env.HOME ?? process.env.USERPROFILE ?? (0, import_os11.tmpdir)();
|
|
27883
27907
|
}
|
|
27884
27908
|
|
|
27885
27909
|
// src/services/turn-files/turn-file-aggregator.ts
|
|
@@ -34203,7 +34227,7 @@ function checkChokidar() {
|
|
|
34203
34227
|
}
|
|
34204
34228
|
async function doctor(args2 = []) {
|
|
34205
34229
|
const json = args2.includes("--json");
|
|
34206
|
-
const cliVersion = true ? "2.60.
|
|
34230
|
+
const cliVersion = true ? "2.60.32" : "0.0.0-dev";
|
|
34207
34231
|
const apiBase2 = resolveApiBaseUrl();
|
|
34208
34232
|
const diagnosticId = (0, import_node_crypto12.randomUUID)();
|
|
34209
34233
|
log.info("doctor", `run id=${diagnosticId} cli=${cliVersion}`);
|
|
@@ -34402,7 +34426,7 @@ async function completion(args2) {
|
|
|
34402
34426
|
// src/commands/version.ts
|
|
34403
34427
|
var import_picocolors15 = __toESM(require("picocolors"));
|
|
34404
34428
|
function version2() {
|
|
34405
|
-
const v = true ? "2.60.
|
|
34429
|
+
const v = true ? "2.60.32" : "unknown";
|
|
34406
34430
|
console.log(`${import_picocolors15.default.bold("codeam-cli")} ${import_picocolors15.default.cyan(v)}`);
|
|
34407
34431
|
}
|
|
34408
34432
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeam-cli",
|
|
3
|
-
"version": "2.60.
|
|
3
|
+
"version": "2.60.32",
|
|
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",
|