codeam-cli 2.61.49 → 2.61.51
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 +13 -0
- package/dist/index.js +284 -77
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,19 @@ 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.50] — 2026-07-27
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **shared,cli:** Opencode agent — foundation (identity + ACP adapter)
|
|
12
|
+
- **cli:** Opencode runtime + credential delivery + box bake
|
|
13
|
+
|
|
14
|
+
## [2.61.49] — 2026-07-27
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- **cli:** Self-hosted OmniRoute gateway (skip MiniMax pin when omniRoute)
|
|
19
|
+
|
|
7
20
|
## [2.61.48] — 2026-07-26
|
|
8
21
|
|
|
9
22
|
### Added
|
package/dist/index.js
CHANGED
|
@@ -483,6 +483,22 @@ var AGENT_REGISTRY = {
|
|
|
483
483
|
headroomWrappable: false,
|
|
484
484
|
// Native ACP server: `kimi acp` (stdio JSON-RPC, answers `initialize`).
|
|
485
485
|
acp: true
|
|
486
|
+
},
|
|
487
|
+
opencode: {
|
|
488
|
+
id: "opencode",
|
|
489
|
+
displayName: "opencode",
|
|
490
|
+
binaryName: "opencode",
|
|
491
|
+
enabled: true,
|
|
492
|
+
// opencode is model-AGNOSTIC and AUTO-DETECTS provider API keys from env
|
|
493
|
+
// vars (ANTHROPIC_API_KEY / OPENAI_API_KEY / GEMINI_API_KEY / …) — same
|
|
494
|
+
// model as aider. So the credential is the user's OWN provider key; we set
|
|
495
|
+
// the matching env var (detected by prefix) at deploy. api_key only.
|
|
496
|
+
supportedAuthKinds: ["api_key"],
|
|
497
|
+
preferredAuthKind: "api_key",
|
|
498
|
+
// Not listed by `headroom init --global` (claude/codex/copilot only) — native.
|
|
499
|
+
headroomWrappable: false,
|
|
500
|
+
// Native ACP server: `opencode acp` (stdio JSON-RPC).
|
|
501
|
+
acp: true
|
|
486
502
|
}
|
|
487
503
|
};
|
|
488
504
|
function getEnabledAgents() {
|
|
@@ -512,6 +528,9 @@ var PUBLIC_TO_INTERNAL = {
|
|
|
512
528
|
coderabbit: "coderabbit",
|
|
513
529
|
gemini: "gemini",
|
|
514
530
|
kimi: "kimi",
|
|
531
|
+
// opencode is a real, distinct agent (its own binary + ACP server) — it does
|
|
532
|
+
// NOT map onto another runtime. Public id === internal id.
|
|
533
|
+
opencode: "opencode",
|
|
515
534
|
// OmniRoute runs Claude Code under the hood, pointed at the user's OmniRoute
|
|
516
535
|
// gateway (their vaulted base URL + token) instead of the house MiniMax
|
|
517
536
|
// proxy. Same internal runtime as the house agent — `claude` — differing only
|
|
@@ -6624,7 +6643,7 @@ function readAnonId() {
|
|
|
6624
6643
|
}
|
|
6625
6644
|
function superProperties() {
|
|
6626
6645
|
return {
|
|
6627
|
-
cliVersion: true ? "2.61.
|
|
6646
|
+
cliVersion: true ? "2.61.51" : "0.0.0-dev",
|
|
6628
6647
|
nodeVersion: process.version,
|
|
6629
6648
|
platform: process.platform,
|
|
6630
6649
|
arch: process.arch,
|
|
@@ -6805,7 +6824,7 @@ var os4 = __toESM(require("os"));
|
|
|
6805
6824
|
// package.json
|
|
6806
6825
|
var package_default = {
|
|
6807
6826
|
name: "codeam-cli",
|
|
6808
|
-
version: "2.61.
|
|
6827
|
+
version: "2.61.51",
|
|
6809
6828
|
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.",
|
|
6810
6829
|
type: "commonjs",
|
|
6811
6830
|
main: "dist/index.js",
|
|
@@ -7977,7 +7996,7 @@ var CommandRelayService = class _CommandRelayService {
|
|
|
7977
7996
|
// fresh + clear the "CLI update available" banner after a self-update
|
|
7978
7997
|
// (a codespace that reinstalls @latest reconnects via heartbeat, not
|
|
7979
7998
|
// pair/reconnect). Older backends ignore the extra field.
|
|
7980
|
-
..."2.61.
|
|
7999
|
+
..."2.61.51" ? { ideVersion: "2.61.51" } : {}
|
|
7981
8000
|
}).then(() => log.trace("relay", `heartbeat ok online=${online}`)).catch((err) => log.trace("relay", `heartbeat failed online=${online}`, err));
|
|
7982
8001
|
}
|
|
7983
8002
|
/**
|
|
@@ -8204,10 +8223,10 @@ var WINDOWS_LEGACY_JUNCTIONS = [
|
|
|
8204
8223
|
/[\\/]Start Menu([\\/]|$)/i,
|
|
8205
8224
|
/[\\/]Templates([\\/]|$)/i
|
|
8206
8225
|
];
|
|
8207
|
-
function isUnsafeWindowsWatchRoot(dir,
|
|
8226
|
+
function isUnsafeWindowsWatchRoot(dir, homedir47) {
|
|
8208
8227
|
const norm = (p2) => p2.replace(/\//g, "\\").replace(/\\+$/, "").toLowerCase();
|
|
8209
8228
|
const cwd = norm(dir);
|
|
8210
|
-
const home = norm(
|
|
8229
|
+
const home = norm(homedir47);
|
|
8211
8230
|
if (cwd === home) return true;
|
|
8212
8231
|
if (/^[a-z]:$/.test(cwd)) return true;
|
|
8213
8232
|
const sysRoots = [
|
|
@@ -16119,6 +16138,120 @@ var KimiRuntimeStrategy = class {
|
|
|
16119
16138
|
}
|
|
16120
16139
|
};
|
|
16121
16140
|
|
|
16141
|
+
// src/agents/opencode/runtime.ts
|
|
16142
|
+
var import_node_child_process14 = require("child_process");
|
|
16143
|
+
|
|
16144
|
+
// src/agents/opencode/local-token.ts
|
|
16145
|
+
var API_KEY_ENV_VARS2 = [
|
|
16146
|
+
"ANTHROPIC_API_KEY",
|
|
16147
|
+
"OPENAI_API_KEY",
|
|
16148
|
+
"GEMINI_API_KEY",
|
|
16149
|
+
"GROQ_API_KEY",
|
|
16150
|
+
"OPENROUTER_API_KEY",
|
|
16151
|
+
"DEEPSEEK_API_KEY"
|
|
16152
|
+
];
|
|
16153
|
+
async function extractLocalOpencodeToken() {
|
|
16154
|
+
for (const name of API_KEY_ENV_VARS2) {
|
|
16155
|
+
const value = process.env[name];
|
|
16156
|
+
if (value && value.trim().length > 0) {
|
|
16157
|
+
return { method: "api_key", credential: value.trim(), source: "flat-file" };
|
|
16158
|
+
}
|
|
16159
|
+
}
|
|
16160
|
+
return null;
|
|
16161
|
+
}
|
|
16162
|
+
function opencodeCredentialsPaths() {
|
|
16163
|
+
return [];
|
|
16164
|
+
}
|
|
16165
|
+
|
|
16166
|
+
// src/agents/opencode/runtime.ts
|
|
16167
|
+
var OpencodeRuntimeStrategy = class {
|
|
16168
|
+
id = "opencode";
|
|
16169
|
+
meta = getAgent("opencode");
|
|
16170
|
+
mode = "interactive";
|
|
16171
|
+
os;
|
|
16172
|
+
constructor(os59) {
|
|
16173
|
+
this.os = os59;
|
|
16174
|
+
}
|
|
16175
|
+
async prepareLaunch() {
|
|
16176
|
+
const binary = this.os.findInPath("opencode");
|
|
16177
|
+
if (!binary) {
|
|
16178
|
+
throw new Error(
|
|
16179
|
+
"opencode is not on PATH. Install it with:\n curl -fsSL https://opencode.ai/install | bash\n Then run `codeam pair` again."
|
|
16180
|
+
);
|
|
16181
|
+
}
|
|
16182
|
+
const launch = this.os.buildLaunch(binary, []);
|
|
16183
|
+
return { cmd: launch.cmd, args: launch.args };
|
|
16184
|
+
}
|
|
16185
|
+
resumeLaunchArgs(_sessionId, _opts) {
|
|
16186
|
+
return [];
|
|
16187
|
+
}
|
|
16188
|
+
resolveHistoryDir(_cwd) {
|
|
16189
|
+
return null;
|
|
16190
|
+
}
|
|
16191
|
+
parseHistoryFile(_filePath) {
|
|
16192
|
+
return [];
|
|
16193
|
+
}
|
|
16194
|
+
getCurrentUsage(_historyDir) {
|
|
16195
|
+
return null;
|
|
16196
|
+
}
|
|
16197
|
+
async fetchWeeklyUsage() {
|
|
16198
|
+
return null;
|
|
16199
|
+
}
|
|
16200
|
+
async listModels() {
|
|
16201
|
+
return [{ id: "default", label: "Provider default", contextWindow: 2e5 }];
|
|
16202
|
+
}
|
|
16203
|
+
changeModelInstruction(modelId) {
|
|
16204
|
+
return { type: "pty", ptyInput: `/model ${modelId}\r` };
|
|
16205
|
+
}
|
|
16206
|
+
summarizeInstruction(_mode) {
|
|
16207
|
+
return { ptyInput: "/compact\r" };
|
|
16208
|
+
}
|
|
16209
|
+
filterTuiOutput(lines) {
|
|
16210
|
+
return lines;
|
|
16211
|
+
}
|
|
16212
|
+
detectInteractivePrompt(_lines) {
|
|
16213
|
+
return null;
|
|
16214
|
+
}
|
|
16215
|
+
/**
|
|
16216
|
+
* Headless single-prompt invocation — powers `request_ai_summary` /
|
|
16217
|
+
* `request_ai_insight` (Files review) AND Preview detection, same as
|
|
16218
|
+
* claude/codex/gemini/kimi. opencode's non-interactive mode is
|
|
16219
|
+
* `opencode run "<prompt>"`: it runs the prompt to completion and prints the
|
|
16220
|
+
* assistant reply to stdout (auth from ~/.local/share/opencode/auth.json).
|
|
16221
|
+
* Returns `null` on spawn failure / timeout / empty output so callers skip
|
|
16222
|
+
* silently instead of bubbling a partial reply.
|
|
16223
|
+
*/
|
|
16224
|
+
async generateOneShot(prompt, opts) {
|
|
16225
|
+
const binary = this.os.findInPath("opencode");
|
|
16226
|
+
if (!binary) return null;
|
|
16227
|
+
const launch = this.os.buildLaunch(binary, ["run", prompt]);
|
|
16228
|
+
return spawnAndCapture(launch.cmd, launch.args, {
|
|
16229
|
+
cwd: opts?.cwd,
|
|
16230
|
+
timeoutMs: opts?.timeoutMs
|
|
16231
|
+
});
|
|
16232
|
+
}
|
|
16233
|
+
credentialLocator() {
|
|
16234
|
+
return {
|
|
16235
|
+
publicId: "opencode",
|
|
16236
|
+
vendor: "opencode",
|
|
16237
|
+
hint: "ANTHROPIC_API_KEY / OPENAI_API_KEY / \u2026 env var (opencode auto-detects)",
|
|
16238
|
+
watchPaths: opencodeCredentialsPaths,
|
|
16239
|
+
extract: extractLocalOpencodeToken,
|
|
16240
|
+
validate: validateNonEmptyCredential
|
|
16241
|
+
};
|
|
16242
|
+
}
|
|
16243
|
+
loginLauncher() {
|
|
16244
|
+
return {
|
|
16245
|
+
async ensureInstalled() {
|
|
16246
|
+
return createOsStrategy().findInPath("opencode") !== null;
|
|
16247
|
+
},
|
|
16248
|
+
launch() {
|
|
16249
|
+
return (0, import_node_child_process14.spawn)("opencode", ["auth", "login"], { stdio: "inherit" });
|
|
16250
|
+
}
|
|
16251
|
+
};
|
|
16252
|
+
}
|
|
16253
|
+
};
|
|
16254
|
+
|
|
16122
16255
|
// src/agents/registry.ts
|
|
16123
16256
|
var runtimeBuilders = {
|
|
16124
16257
|
claude: (os59) => new ClaudeRuntimeStrategy(os59),
|
|
@@ -16127,7 +16260,8 @@ var runtimeBuilders = {
|
|
|
16127
16260
|
cursor: (os59) => new CursorRuntimeStrategy(os59),
|
|
16128
16261
|
aider: (os59) => new AiderRuntimeStrategy(os59),
|
|
16129
16262
|
gemini: (os59) => new GeminiRuntimeStrategy(os59),
|
|
16130
|
-
kimi: (os59) => new KimiRuntimeStrategy(os59)
|
|
16263
|
+
kimi: (os59) => new KimiRuntimeStrategy(os59),
|
|
16264
|
+
opencode: (os59) => new OpencodeRuntimeStrategy(os59)
|
|
16131
16265
|
};
|
|
16132
16266
|
var deployBuilders = {
|
|
16133
16267
|
claude: () => new ClaudeDeployStrategy(),
|
|
@@ -16546,13 +16680,13 @@ async function linkDryRunPreflight(ctx) {
|
|
|
16546
16680
|
}
|
|
16547
16681
|
|
|
16548
16682
|
// src/agents/coderabbit/configure.ts
|
|
16549
|
-
var
|
|
16683
|
+
var import_node_child_process16 = require("child_process");
|
|
16550
16684
|
var import_node_os4 = require("os");
|
|
16551
16685
|
var import_node_fs5 = require("fs");
|
|
16552
16686
|
var path36 = __toESM(require("path"));
|
|
16553
16687
|
|
|
16554
16688
|
// src/agents/coderabbit/oauth.ts
|
|
16555
|
-
var
|
|
16689
|
+
var import_node_child_process15 = require("child_process");
|
|
16556
16690
|
var fs31 = __toESM(require("fs"));
|
|
16557
16691
|
var os27 = __toESM(require("os"));
|
|
16558
16692
|
var path35 = __toESM(require("path"));
|
|
@@ -16594,7 +16728,7 @@ function parseCoderabbitAuthEvent(line) {
|
|
|
16594
16728
|
function resolvePython() {
|
|
16595
16729
|
for (const bin of ["python3", "python"]) {
|
|
16596
16730
|
try {
|
|
16597
|
-
const r = (0,
|
|
16731
|
+
const r = (0, import_node_child_process15.spawnSync)(bin, ["--version"], { stdio: "ignore", timeout: 4e3 });
|
|
16598
16732
|
if (!r.error && r.status === 0) return bin;
|
|
16599
16733
|
} catch {
|
|
16600
16734
|
}
|
|
@@ -16606,13 +16740,13 @@ function spawnCoderabbitLoginProc(cmd, args2) {
|
|
|
16606
16740
|
if (python) {
|
|
16607
16741
|
const helper = path35.join(os27.tmpdir(), "codeam-cr-pty.py");
|
|
16608
16742
|
fs31.writeFileSync(helper, PYTHON_PTY_HELPER, { mode: 420 });
|
|
16609
|
-
return (0,
|
|
16743
|
+
return (0, import_node_child_process15.spawn)(python, [helper, cmd, ...args2], {
|
|
16610
16744
|
stdio: ["pipe", "pipe", "pipe"],
|
|
16611
16745
|
env: { ...process.env, TERM: "xterm-256color", COLUMNS: "220", LINES: "50" },
|
|
16612
16746
|
shell: false
|
|
16613
16747
|
});
|
|
16614
16748
|
}
|
|
16615
|
-
return (0,
|
|
16749
|
+
return (0, import_node_child_process15.spawn)(cmd, args2, { stdio: ["pipe", "pipe", "pipe"], shell: false });
|
|
16616
16750
|
}
|
|
16617
16751
|
var pendingCoderabbitLogin = null;
|
|
16618
16752
|
function setPendingCoderabbitLogin(handle) {
|
|
@@ -16757,7 +16891,7 @@ function diffCapturedCredential(before, home) {
|
|
|
16757
16891
|
|
|
16758
16892
|
// src/agents/coderabbit/configure.ts
|
|
16759
16893
|
function defaultIsLoggedIn() {
|
|
16760
|
-
const r = (0,
|
|
16894
|
+
const r = (0, import_node_child_process16.spawnSync)("coderabbit", ["auth", "status", "--agent"], {
|
|
16761
16895
|
encoding: "utf8",
|
|
16762
16896
|
timeout: 15e3
|
|
16763
16897
|
});
|
|
@@ -16775,7 +16909,7 @@ function defaultIsLoggedIn() {
|
|
|
16775
16909
|
return false;
|
|
16776
16910
|
}
|
|
16777
16911
|
function defaultLoginWithApiKey(key) {
|
|
16778
|
-
const r = (0,
|
|
16912
|
+
const r = (0, import_node_child_process16.spawnSync)("coderabbit", ["auth", "login", "--api-key", key], {
|
|
16779
16913
|
encoding: "utf8",
|
|
16780
16914
|
timeout: 3e4
|
|
16781
16915
|
});
|
|
@@ -16789,7 +16923,7 @@ function defaultLoginWithApiKey(key) {
|
|
|
16789
16923
|
function collectChangedFiles(cwd) {
|
|
16790
16924
|
const run = (args2) => {
|
|
16791
16925
|
try {
|
|
16792
|
-
const r = (0,
|
|
16926
|
+
const r = (0, import_node_child_process16.spawnSync)("git", args2, { cwd, encoding: "utf8", timeout: 1e4 });
|
|
16793
16927
|
return r.status === 0 && typeof r.stdout === "string" ? r.stdout : "";
|
|
16794
16928
|
} catch {
|
|
16795
16929
|
return "";
|
|
@@ -16998,7 +17132,7 @@ async function configureCoderabbit(input, deps = {}) {
|
|
|
16998
17132
|
}
|
|
16999
17133
|
|
|
17000
17134
|
// src/agents/coderabbit/review-pr.ts
|
|
17001
|
-
var
|
|
17135
|
+
var import_node_child_process17 = require("child_process");
|
|
17002
17136
|
function repoSlug(prRef) {
|
|
17003
17137
|
return `${prRef.owner}/${prRef.repo}`;
|
|
17004
17138
|
}
|
|
@@ -17132,7 +17266,7 @@ function defaultRunGh(args2) {
|
|
|
17132
17266
|
const stderr = [];
|
|
17133
17267
|
let proc;
|
|
17134
17268
|
try {
|
|
17135
|
-
proc = (0,
|
|
17269
|
+
proc = (0, import_node_child_process17.spawn)("gh", args2, { stdio: ["ignore", "pipe", "pipe"] });
|
|
17136
17270
|
} catch (err) {
|
|
17137
17271
|
resolve8({ code: -1, stdout: "", stderr: err instanceof Error ? err.message : String(err) });
|
|
17138
17272
|
return;
|
|
@@ -17153,7 +17287,7 @@ function defaultRunGh(args2) {
|
|
|
17153
17287
|
}
|
|
17154
17288
|
|
|
17155
17289
|
// src/commands/host-agent.ts
|
|
17156
|
-
var
|
|
17290
|
+
var import_node_child_process25 = require("child_process");
|
|
17157
17291
|
var os38 = __toESM(require("os"));
|
|
17158
17292
|
var fs43 = __toESM(require("fs"));
|
|
17159
17293
|
var path46 = __toESM(require("path"));
|
|
@@ -17166,7 +17300,7 @@ var import_node_path5 = __toESM(require("path"));
|
|
|
17166
17300
|
// src/lib/restrict-to-owner.ts
|
|
17167
17301
|
var import_node_fs6 = __toESM(require("fs"));
|
|
17168
17302
|
var import_node_os5 = __toESM(require("os"));
|
|
17169
|
-
var
|
|
17303
|
+
var import_node_child_process18 = require("child_process");
|
|
17170
17304
|
var BROAD_WINDOWS_SIDS = [
|
|
17171
17305
|
"*S-1-1-0",
|
|
17172
17306
|
"*S-1-5-11",
|
|
@@ -17178,7 +17312,7 @@ function restrictToOwner(filePath) {
|
|
|
17178
17312
|
try {
|
|
17179
17313
|
if (process.platform === "win32") {
|
|
17180
17314
|
const username = import_node_os5.default.userInfo().username;
|
|
17181
|
-
(0,
|
|
17315
|
+
(0, import_node_child_process18.execFileSync)(
|
|
17182
17316
|
"icacls",
|
|
17183
17317
|
[
|
|
17184
17318
|
filePath,
|
|
@@ -17567,9 +17701,9 @@ async function reportDeployProgress(auth, deployId, step, message, sessionId) {
|
|
|
17567
17701
|
var fs36 = __toESM(require("fs"));
|
|
17568
17702
|
var os32 = __toESM(require("os"));
|
|
17569
17703
|
var path40 = __toESM(require("path"));
|
|
17570
|
-
var
|
|
17704
|
+
var import_node_child_process19 = require("child_process");
|
|
17571
17705
|
var import_node_util4 = require("util");
|
|
17572
|
-
var execFileP4 = (0, import_node_util4.promisify)(
|
|
17706
|
+
var execFileP4 = (0, import_node_util4.promisify)(import_node_child_process19.execFile);
|
|
17573
17707
|
function isAbsolutePathTarget(target) {
|
|
17574
17708
|
return path40.isAbsolute(target);
|
|
17575
17709
|
}
|
|
@@ -17725,7 +17859,8 @@ var PUBLIC_TO_INTERNAL_AGENT = {
|
|
|
17725
17859
|
aider: "aider",
|
|
17726
17860
|
coderabbit: "coderabbit",
|
|
17727
17861
|
gemini: "gemini",
|
|
17728
|
-
kimi: "kimi"
|
|
17862
|
+
kimi: "kimi",
|
|
17863
|
+
opencode: "opencode"
|
|
17729
17864
|
};
|
|
17730
17865
|
function toInternalAgentId(publicAgentId) {
|
|
17731
17866
|
return PUBLIC_TO_INTERNAL_AGENT[publicAgentId] ?? null;
|
|
@@ -17874,13 +18009,21 @@ var coderabbitProvisioner = {
|
|
|
17874
18009
|
return {};
|
|
17875
18010
|
}
|
|
17876
18011
|
};
|
|
18012
|
+
var opencodeProvisioner = {
|
|
18013
|
+
write(auth) {
|
|
18014
|
+
const key = auth.value.trim();
|
|
18015
|
+
const envName = key.startsWith("sk-ant-") ? "ANTHROPIC_API_KEY" : key.startsWith("AIza") ? "GEMINI_API_KEY" : "OPENAI_API_KEY";
|
|
18016
|
+
return { [envName]: key };
|
|
18017
|
+
}
|
|
18018
|
+
};
|
|
17877
18019
|
var PROVISIONERS = {
|
|
17878
18020
|
claude: claudeProvisioner,
|
|
17879
18021
|
kimi: kimiProvisioner,
|
|
17880
18022
|
codex: codexProvisioner,
|
|
17881
18023
|
gemini: geminiProvisioner,
|
|
17882
18024
|
cursor: cursorProvisioner,
|
|
17883
|
-
coderabbit: coderabbitProvisioner
|
|
18025
|
+
coderabbit: coderabbitProvisioner,
|
|
18026
|
+
opencode: opencodeProvisioner
|
|
17884
18027
|
};
|
|
17885
18028
|
var UnsupportedAgentError = class extends Error {
|
|
17886
18029
|
agentId;
|
|
@@ -17899,7 +18042,7 @@ function provisionAgentCredentials(publicAgentId, auth, homeDir2 = os33.homedir(
|
|
|
17899
18042
|
}
|
|
17900
18043
|
|
|
17901
18044
|
// src/commands/host/git-tooling.ts
|
|
17902
|
-
var
|
|
18045
|
+
var import_node_child_process20 = require("child_process");
|
|
17903
18046
|
var fs38 = __toESM(require("fs"));
|
|
17904
18047
|
var os34 = __toESM(require("os"));
|
|
17905
18048
|
var path42 = __toESM(require("path"));
|
|
@@ -18099,7 +18242,7 @@ var defaultGitToolingRunner = {
|
|
|
18099
18242
|
which(cmd) {
|
|
18100
18243
|
try {
|
|
18101
18244
|
const probe = process.platform === "win32" ? "where" : "which";
|
|
18102
|
-
(0,
|
|
18245
|
+
(0, import_node_child_process20.execFileSync)(probe, [cmd], { stdio: "ignore" });
|
|
18103
18246
|
return true;
|
|
18104
18247
|
} catch {
|
|
18105
18248
|
return false;
|
|
@@ -18107,7 +18250,7 @@ var defaultGitToolingRunner = {
|
|
|
18107
18250
|
},
|
|
18108
18251
|
run(cmd, args2, opts = {}) {
|
|
18109
18252
|
return new Promise((resolve8) => {
|
|
18110
|
-
const child = (0,
|
|
18253
|
+
const child = (0, import_node_child_process20.spawn)(cmd, args2, {
|
|
18111
18254
|
stdio: [opts.input !== void 0 ? "pipe" : "ignore", "ignore", "pipe"]
|
|
18112
18255
|
});
|
|
18113
18256
|
let stderr = "";
|
|
@@ -18261,12 +18404,12 @@ var HeadroomStatsReporter = class {
|
|
|
18261
18404
|
};
|
|
18262
18405
|
|
|
18263
18406
|
// src/commands/host/os-packages.ts
|
|
18264
|
-
var
|
|
18407
|
+
var import_node_child_process21 = require("child_process");
|
|
18265
18408
|
var PM_INSTALL_TIMEOUT_MS = 18e4;
|
|
18266
18409
|
var defaultHeadroomRunner = {
|
|
18267
18410
|
which(cmd) {
|
|
18268
18411
|
try {
|
|
18269
|
-
(0,
|
|
18412
|
+
(0, import_node_child_process21.execFileSync)("which", [cmd], { stdio: "ignore" });
|
|
18270
18413
|
return true;
|
|
18271
18414
|
} catch {
|
|
18272
18415
|
return false;
|
|
@@ -18275,7 +18418,7 @@ var defaultHeadroomRunner = {
|
|
|
18275
18418
|
run(cmd, args2, opts = {}) {
|
|
18276
18419
|
return new Promise((resolve8) => {
|
|
18277
18420
|
const spawnEnv = opts.env ?? process.env;
|
|
18278
|
-
const child = (0,
|
|
18421
|
+
const child = (0, import_node_child_process21.spawn)(cmd, args2, { stdio: ["ignore", "pipe", "pipe"], env: spawnEnv });
|
|
18279
18422
|
let stderrBuf = "";
|
|
18280
18423
|
let stdoutBuf = "";
|
|
18281
18424
|
let settled = false;
|
|
@@ -18802,14 +18945,14 @@ async function setupHeadroomForSelfHosted(agent, runner = defaultHeadroomRunner,
|
|
|
18802
18945
|
}
|
|
18803
18946
|
|
|
18804
18947
|
// src/commands/host/self-update.ts
|
|
18805
|
-
var
|
|
18948
|
+
var import_node_child_process23 = require("child_process");
|
|
18806
18949
|
|
|
18807
18950
|
// src/lib/updateNotifier.ts
|
|
18808
18951
|
var fs41 = __toESM(require("fs"));
|
|
18809
18952
|
var os37 = __toESM(require("os"));
|
|
18810
18953
|
var path45 = __toESM(require("path"));
|
|
18811
18954
|
var https6 = __toESM(require("https"));
|
|
18812
|
-
var
|
|
18955
|
+
var import_node_child_process22 = require("child_process");
|
|
18813
18956
|
var import_picocolors3 = __toESM(require("picocolors"));
|
|
18814
18957
|
var PKG_NAME = "codeam-cli";
|
|
18815
18958
|
var REGISTRY_URL = `https://registry.npmjs.org/${PKG_NAME}/latest`;
|
|
@@ -18903,7 +19046,7 @@ function notifyIfStale(currentVersion, latest) {
|
|
|
18903
19046
|
}
|
|
18904
19047
|
function isLinkedInstall() {
|
|
18905
19048
|
try {
|
|
18906
|
-
const root = (0,
|
|
19049
|
+
const root = (0, import_node_child_process22.execSync)("npm root -g", {
|
|
18907
19050
|
encoding: "utf8",
|
|
18908
19051
|
stdio: ["ignore", "pipe", "ignore"],
|
|
18909
19052
|
timeout: 2e3
|
|
@@ -18931,7 +19074,7 @@ function maybeAutoUpdate(currentVersion, latest) {
|
|
|
18931
19074
|
|
|
18932
19075
|
`
|
|
18933
19076
|
);
|
|
18934
|
-
const install = (0,
|
|
19077
|
+
const install = (0, import_node_child_process22.spawnSync)("npm", ["install", "-g", `${PKG_NAME}@latest`], {
|
|
18935
19078
|
stdio: "inherit",
|
|
18936
19079
|
env: process.env
|
|
18937
19080
|
});
|
|
@@ -18952,7 +19095,7 @@ function maybeAutoUpdate(currentVersion, latest) {
|
|
|
18952
19095
|
process.stderr.write(` ${import_picocolors3.default.green("\u2713")} Updated. Resuming session...
|
|
18953
19096
|
|
|
18954
19097
|
`);
|
|
18955
|
-
const child = (0,
|
|
19098
|
+
const child = (0, import_node_child_process22.spawnSync)("codeam", process.argv.slice(2), {
|
|
18956
19099
|
stdio: "inherit",
|
|
18957
19100
|
env: process.env
|
|
18958
19101
|
});
|
|
@@ -18962,7 +19105,7 @@ async function autoUpgradeBeforeCriticalCommand() {
|
|
|
18962
19105
|
if (process.env.NODE_ENV === "test") return;
|
|
18963
19106
|
if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
|
|
18964
19107
|
if (process.env.CI) return;
|
|
18965
|
-
const current = true ? "2.61.
|
|
19108
|
+
const current = true ? "2.61.51" : null;
|
|
18966
19109
|
if (!current) return;
|
|
18967
19110
|
const cache = readCache();
|
|
18968
19111
|
const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
|
|
@@ -18979,7 +19122,7 @@ function checkForUpdates() {
|
|
|
18979
19122
|
if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
|
|
18980
19123
|
if (process.env.CI) return;
|
|
18981
19124
|
if (!process.stdout.isTTY) return;
|
|
18982
|
-
const current = true ? "2.61.
|
|
19125
|
+
const current = true ? "2.61.51" : null;
|
|
18983
19126
|
if (!current) return;
|
|
18984
19127
|
const cache = readCache();
|
|
18985
19128
|
const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
|
|
@@ -18999,11 +19142,11 @@ var SELF_UPDATE_INTERVAL_MS = 60 * 60 * 1e3;
|
|
|
18999
19142
|
var SELF_UPDATE_VIEW_TIMEOUT_MS = 3e4;
|
|
19000
19143
|
var SELF_UPDATE_INSTALL_TIMEOUT_MS = 18e4;
|
|
19001
19144
|
function currentCliVersion() {
|
|
19002
|
-
return true ? "2.61.
|
|
19145
|
+
return true ? "2.61.51" : null;
|
|
19003
19146
|
}
|
|
19004
19147
|
function runCmd(cmd, args2, timeoutMs) {
|
|
19005
19148
|
return new Promise((resolve8) => {
|
|
19006
|
-
(0,
|
|
19149
|
+
(0, import_node_child_process23.execFile)(cmd, args2, { timeout: timeoutMs }, (err, stdout, stderr) => {
|
|
19007
19150
|
const code = err && typeof err.code === "number" ? err.code : err ? null : 0;
|
|
19008
19151
|
resolve8({ code, stdout: stdout ?? "", stderr: stderr ?? "" });
|
|
19009
19152
|
});
|
|
@@ -19065,11 +19208,11 @@ async function runSelfUpdate() {
|
|
|
19065
19208
|
}
|
|
19066
19209
|
|
|
19067
19210
|
// src/commands/host/teardown.ts
|
|
19068
|
-
var
|
|
19211
|
+
var import_node_child_process24 = require("child_process");
|
|
19069
19212
|
var fs42 = __toESM(require("fs"));
|
|
19070
19213
|
var defaultDisableService = () => {
|
|
19071
19214
|
try {
|
|
19072
|
-
(0,
|
|
19215
|
+
(0, import_node_child_process24.execFileSync)("systemctl", ["disable", "--now", "codeam-host-agent"], { stdio: "ignore" });
|
|
19073
19216
|
} catch {
|
|
19074
19217
|
}
|
|
19075
19218
|
};
|
|
@@ -19077,7 +19220,7 @@ var defaultTeardownHeadroom = () => {
|
|
|
19077
19220
|
try {
|
|
19078
19221
|
const kind = JSON.parse(fs42.readFileSync(headroomConfigPath(), "utf8")).agent;
|
|
19079
19222
|
if (kind) {
|
|
19080
|
-
(0,
|
|
19223
|
+
(0, import_node_child_process24.execFileSync)("headroom", ["unwrap", kind], { stdio: "ignore", timeout: 15e3 });
|
|
19081
19224
|
}
|
|
19082
19225
|
} catch {
|
|
19083
19226
|
}
|
|
@@ -19329,7 +19472,7 @@ var DOCKER_RUN_TIMEOUT_MS = 12e4;
|
|
|
19329
19472
|
var defaultDockerRunner = {
|
|
19330
19473
|
run(args2, opts = {}) {
|
|
19331
19474
|
return new Promise((resolve8) => {
|
|
19332
|
-
const child = (0,
|
|
19475
|
+
const child = (0, import_node_child_process25.spawn)("docker", args2, {
|
|
19333
19476
|
stdio: ["ignore", "pipe", "pipe"],
|
|
19334
19477
|
env: { ...process.env, ...opts.env }
|
|
19335
19478
|
});
|
|
@@ -19375,13 +19518,13 @@ var CONTROL_AGENT_META = {
|
|
|
19375
19518
|
headroomWrappable: false,
|
|
19376
19519
|
acp: false
|
|
19377
19520
|
};
|
|
19378
|
-
var defaultSpawner = (env, cwd, args2 = []) => (0,
|
|
19521
|
+
var defaultSpawner = (env, cwd, args2 = []) => (0, import_node_child_process25.spawn)(process.execPath, [process.argv[1], "pair-auto", ...args2], {
|
|
19379
19522
|
cwd,
|
|
19380
19523
|
env: { ...process.env, ...env },
|
|
19381
19524
|
stdio: ["ignore", "pipe", "pipe"],
|
|
19382
19525
|
detached: false
|
|
19383
19526
|
});
|
|
19384
|
-
var defaultResumeSpawner = (env, cwd) => (0,
|
|
19527
|
+
var defaultResumeSpawner = (env, cwd) => (0, import_node_child_process25.spawn)(process.execPath, [process.argv[1]], {
|
|
19385
19528
|
cwd,
|
|
19386
19529
|
// CODEAM_AUTO_APPROVE=1 → ACP path (baton off). CODEAM_RESUME_LATEST=1 →
|
|
19387
19530
|
// continue the user's most-recent conversation instead of opening an empty
|
|
@@ -20198,7 +20341,7 @@ var HostAgentSupervisor = class {
|
|
|
20198
20341
|
runAgentInstall(script) {
|
|
20199
20342
|
return new Promise((resolve8) => {
|
|
20200
20343
|
const home = process.env.HOME || os38.homedir();
|
|
20201
|
-
const child = (0,
|
|
20344
|
+
const child = (0, import_node_child_process25.spawn)("sh", ["-c", script], {
|
|
20202
20345
|
env: { ...process.env, HOME: home },
|
|
20203
20346
|
stdio: ["ignore", "pipe", "pipe"]
|
|
20204
20347
|
});
|
|
@@ -20601,11 +20744,11 @@ function reclaimOwnOrphanPort(port) {
|
|
|
20601
20744
|
var import_child_process15 = require("child_process");
|
|
20602
20745
|
var import_fs = require("fs");
|
|
20603
20746
|
var import_promises = __toESM(require("fs/promises"));
|
|
20604
|
-
var
|
|
20747
|
+
var import_os9 = __toESM(require("os"));
|
|
20605
20748
|
var import_path4 = __toESM(require("path"));
|
|
20606
20749
|
var import_promises2 = require("stream/promises");
|
|
20607
20750
|
var import_which = __toESM(require("which"));
|
|
20608
|
-
var CACHED_BINARY = import_path4.default.join(
|
|
20751
|
+
var CACHED_BINARY = import_path4.default.join(import_os9.default.homedir(), ".codeam", "bin", "cloudflared");
|
|
20609
20752
|
async function resolveCloudflared(opts = {}) {
|
|
20610
20753
|
try {
|
|
20611
20754
|
return await (0, import_which.default)("cloudflared");
|
|
@@ -20705,7 +20848,7 @@ function decodeTunnelToken(token) {
|
|
|
20705
20848
|
}
|
|
20706
20849
|
async function spawnNamedTunnel(bin, token, port) {
|
|
20707
20850
|
const creds = decodeTunnelToken(token);
|
|
20708
|
-
const credDir = import_path4.default.join(
|
|
20851
|
+
const credDir = import_path4.default.join(import_os9.default.homedir(), ".codeam");
|
|
20709
20852
|
await import_promises.default.mkdir(credDir, { recursive: true });
|
|
20710
20853
|
const credFile = import_path4.default.join(credDir, `tunnel-${creds.TunnelID}.json`);
|
|
20711
20854
|
await import_promises.default.writeFile(credFile, JSON.stringify(creds), { mode: 384 });
|
|
@@ -22343,7 +22486,9 @@ var AGENT_SETUP_RECIPE = {
|
|
|
22343
22486
|
// bd 1.0.5 has no Kimi recipe → skip (like coderabbit); beads still works,
|
|
22344
22487
|
// the agent just isn't wired natively via `bd setup`.
|
|
22345
22488
|
kimi: null,
|
|
22346
|
-
coderabbit: null
|
|
22489
|
+
coderabbit: null,
|
|
22490
|
+
// bd 1.0.5 has no opencode recipe → skip; beads still works.
|
|
22491
|
+
opencode: null
|
|
22347
22492
|
};
|
|
22348
22493
|
var _provisionSeam = {
|
|
22349
22494
|
install: installBd,
|
|
@@ -25035,7 +25180,7 @@ async function pairAuto(args2) {
|
|
|
25035
25180
|
}
|
|
25036
25181
|
|
|
25037
25182
|
// src/services/headroom/wrap-launch.ts
|
|
25038
|
-
var
|
|
25183
|
+
var import_node_child_process26 = require("child_process");
|
|
25039
25184
|
function wrapWithHeadroom(launch, opts) {
|
|
25040
25185
|
if (!opts.enabled || !opts.headroomPresent) return launch;
|
|
25041
25186
|
return {
|
|
@@ -25048,7 +25193,7 @@ var _present;
|
|
|
25048
25193
|
function headroomPresent() {
|
|
25049
25194
|
if (_present !== void 0) return Promise.resolve(_present);
|
|
25050
25195
|
return new Promise((resolve8) => {
|
|
25051
|
-
(0,
|
|
25196
|
+
(0, import_node_child_process26.execFile)("headroom", ["--version"], (err) => {
|
|
25052
25197
|
_present = !err;
|
|
25053
25198
|
resolve8(_present);
|
|
25054
25199
|
});
|
|
@@ -25402,7 +25547,7 @@ var path64 = __toESM(require("path"));
|
|
|
25402
25547
|
|
|
25403
25548
|
// src/agents/acp/agent-binary.ts
|
|
25404
25549
|
var import_fs4 = __toESM(require("fs"));
|
|
25405
|
-
var
|
|
25550
|
+
var import_os11 = __toESM(require("os"));
|
|
25406
25551
|
var import_path8 = __toESM(require("path"));
|
|
25407
25552
|
var import_child_process26 = require("child_process");
|
|
25408
25553
|
function currentPlatformKey() {
|
|
@@ -25498,7 +25643,7 @@ function resolveCursorAgentBinary(deps = {}) {
|
|
|
25498
25643
|
const exe = import_path8.default.win32.join(localAppData, "cursor-agent", "cursor-agent.exe");
|
|
25499
25644
|
return existsSync27(exe) ? exe : null;
|
|
25500
25645
|
}
|
|
25501
|
-
const home = deps.homedir ??
|
|
25646
|
+
const home = deps.homedir ?? import_os11.default.homedir();
|
|
25502
25647
|
const unix = import_path8.default.posix.join(home, ".local", "bin", "cursor-agent");
|
|
25503
25648
|
return existsSync27(unix) ? unix : null;
|
|
25504
25649
|
}
|
|
@@ -25573,7 +25718,7 @@ async function waitForAdapterModuleGraph(command2, args2, opts = {}) {
|
|
|
25573
25718
|
}
|
|
25574
25719
|
|
|
25575
25720
|
// src/agents/kimi/installer.ts
|
|
25576
|
-
var
|
|
25721
|
+
var import_node_child_process27 = require("child_process");
|
|
25577
25722
|
var import_node_os11 = require("os");
|
|
25578
25723
|
var import_node_path9 = require("path");
|
|
25579
25724
|
var INSTALL_URL2 = "https://code.kimi.com/kimi-code/install.sh";
|
|
@@ -25581,7 +25726,7 @@ function kimiBinDir() {
|
|
|
25581
25726
|
return (0, import_node_path9.join)(process.env.KIMI_CODE_HOME || (0, import_node_path9.join)((0, import_node_os11.homedir)(), ".kimi-code"), "bin");
|
|
25582
25727
|
}
|
|
25583
25728
|
function kimiRuns() {
|
|
25584
|
-
const r = (0,
|
|
25729
|
+
const r = (0, import_node_child_process27.spawnSync)("kimi", ["--version"], { stdio: "ignore", timeout: 15e3 });
|
|
25585
25730
|
return !r.error && r.status === 0;
|
|
25586
25731
|
}
|
|
25587
25732
|
function augmentPath2() {
|
|
@@ -25591,7 +25736,7 @@ function augmentPath2() {
|
|
|
25591
25736
|
}
|
|
25592
25737
|
async function runInstaller2() {
|
|
25593
25738
|
return new Promise((resolve8) => {
|
|
25594
|
-
const proc = (0,
|
|
25739
|
+
const proc = (0, import_node_child_process27.spawn)("sh", ["-c", `curl -fsSL ${INSTALL_URL2} | bash`], { stdio: "inherit" });
|
|
25595
25740
|
proc.on("close", (code) => resolve8(code === 0));
|
|
25596
25741
|
proc.on("error", () => resolve8(false));
|
|
25597
25742
|
});
|
|
@@ -25624,6 +25769,53 @@ async function ensureKimiInstalled() {
|
|
|
25624
25769
|
return kimiRuns();
|
|
25625
25770
|
}
|
|
25626
25771
|
|
|
25772
|
+
// src/agents/opencode/installer.ts
|
|
25773
|
+
var import_node_child_process28 = require("child_process");
|
|
25774
|
+
var import_node_os12 = require("os");
|
|
25775
|
+
var import_node_path10 = require("path");
|
|
25776
|
+
var INSTALL_URL3 = "https://opencode.ai/install";
|
|
25777
|
+
function opencodeBinDir() {
|
|
25778
|
+
return (0, import_node_path10.join)(process.env.OPENCODE_HOME || (0, import_node_path10.join)((0, import_node_os12.homedir)(), ".opencode"), "bin");
|
|
25779
|
+
}
|
|
25780
|
+
function opencodeRuns() {
|
|
25781
|
+
const r = (0, import_node_child_process28.spawnSync)("opencode", ["--version"], { stdio: "ignore", timeout: 15e3 });
|
|
25782
|
+
return !r.error && r.status === 0;
|
|
25783
|
+
}
|
|
25784
|
+
function augmentPath3() {
|
|
25785
|
+
const dir = opencodeBinDir();
|
|
25786
|
+
const parts = (process.env.PATH ?? "").split(":");
|
|
25787
|
+
if (!parts.includes(dir)) process.env.PATH = `${dir}:${process.env.PATH ?? ""}`;
|
|
25788
|
+
}
|
|
25789
|
+
async function runInstaller3() {
|
|
25790
|
+
return new Promise((resolve8) => {
|
|
25791
|
+
const proc = (0, import_node_child_process28.spawn)("sh", ["-c", `curl -fsSL ${INSTALL_URL3} | bash`], { stdio: "inherit" });
|
|
25792
|
+
proc.on("close", (code) => resolve8(code === 0));
|
|
25793
|
+
proc.on("error", () => resolve8(false));
|
|
25794
|
+
});
|
|
25795
|
+
}
|
|
25796
|
+
async function ensureOpencodeInstalled() {
|
|
25797
|
+
augmentPath3();
|
|
25798
|
+
if (opencodeRuns()) return true;
|
|
25799
|
+
if (process.platform === "win32") {
|
|
25800
|
+
console.error(
|
|
25801
|
+
`
|
|
25802
|
+
\u2717 opencode on Windows requires WSL.
|
|
25803
|
+
Install it inside WSL (curl -fsSL ${INSTALL_URL3} | bash)
|
|
25804
|
+
then re-run \`codeam pair\`.
|
|
25805
|
+
`
|
|
25806
|
+
);
|
|
25807
|
+
return false;
|
|
25808
|
+
}
|
|
25809
|
+
console.log("\n opencode not found \u2014 installing via the official script\u2026\n");
|
|
25810
|
+
const ok = await runInstaller3();
|
|
25811
|
+
augmentPath3();
|
|
25812
|
+
if (!ok) {
|
|
25813
|
+
log.warn("opencode", "installer failed \u2014 opencode will be reported as not installed");
|
|
25814
|
+
return false;
|
|
25815
|
+
}
|
|
25816
|
+
return opencodeRuns();
|
|
25817
|
+
}
|
|
25818
|
+
|
|
25627
25819
|
// src/baton/gate.ts
|
|
25628
25820
|
function runtimeSupportsBaton(runtime) {
|
|
25629
25821
|
return typeof runtime.resolveHistoryFile === "function";
|
|
@@ -25737,6 +25929,21 @@ var REGISTRY = {
|
|
|
25737
25929
|
if (isLocalSession()) await ensureKimiInstalled();
|
|
25738
25930
|
return waitForCommandOnPath("kimi", o);
|
|
25739
25931
|
}
|
|
25932
|
+
}),
|
|
25933
|
+
// opencode speaks ACP natively via `opencode acp` — a stdio JSON-RPC server.
|
|
25934
|
+
// No npm adapter, just the user-installed `opencode` binary on PATH (baked in
|
|
25935
|
+
// the box image; provisioned on codespaces; installed on demand for a LOCAL
|
|
25936
|
+
// pair). Same {@link AdapterSpec} shape as gemini/cursor/kimi. Auth (the
|
|
25937
|
+
// ~/.local/share/opencode/auth.json login-state file) reaches opencode because
|
|
25938
|
+
// the ACP client spawns the adapter with `env: { ...process.env, ...extraEnv }`.
|
|
25939
|
+
opencode: () => ({
|
|
25940
|
+
command: "opencode",
|
|
25941
|
+
args: ["acp"],
|
|
25942
|
+
requiresAgentBinary: "opencode",
|
|
25943
|
+
waitForBinary: async (o) => {
|
|
25944
|
+
if (isLocalSession()) await ensureOpencodeInstalled();
|
|
25945
|
+
return waitForCommandOnPath("opencode", o);
|
|
25946
|
+
}
|
|
25740
25947
|
})
|
|
25741
25948
|
};
|
|
25742
25949
|
var resolvedAdapterCache = /* @__PURE__ */ new Map();
|
|
@@ -26377,7 +26584,7 @@ var HistoryService = class _HistoryService {
|
|
|
26377
26584
|
};
|
|
26378
26585
|
|
|
26379
26586
|
// src/agents/acp/client.ts
|
|
26380
|
-
var
|
|
26587
|
+
var import_node_child_process29 = require("child_process");
|
|
26381
26588
|
var fs61 = __toESM(require("fs/promises"));
|
|
26382
26589
|
var fsSync = __toESM(require("fs"));
|
|
26383
26590
|
var os52 = __toESM(require("os"));
|
|
@@ -30583,7 +30790,7 @@ var AcpClient = class {
|
|
|
30583
30790
|
"acpClient",
|
|
30584
30791
|
`spawn cmd=${adapter.command} args=[${adapter.args.join(",")}] cwd=${cwd}`
|
|
30585
30792
|
);
|
|
30586
|
-
const child = (0,
|
|
30793
|
+
const child = (0, import_node_child_process29.spawn)(adapter.command, adapter.args, {
|
|
30587
30794
|
cwd,
|
|
30588
30795
|
// extraEnv (e.g. CLAUDE_CODE_DISABLE_1M_CONTEXT=1 on an on-demand
|
|
30589
30796
|
// re-spawn) layers over process.env; PATH stays last so the augmented
|
|
@@ -31301,12 +31508,12 @@ function buildRelaunchProxyEnv(baseEnv) {
|
|
|
31301
31508
|
return env;
|
|
31302
31509
|
}
|
|
31303
31510
|
var relaunchProxyWithoutBudget = async () => {
|
|
31304
|
-
const { spawn:
|
|
31511
|
+
const { spawn: spawn44 } = await import("child_process");
|
|
31305
31512
|
killHeadroomProxy();
|
|
31306
31513
|
await new Promise((r) => setTimeout(r, 500));
|
|
31307
31514
|
const proxyEnv = buildRelaunchProxyEnv(process.env);
|
|
31308
31515
|
try {
|
|
31309
|
-
const proxy =
|
|
31516
|
+
const proxy = spawn44(
|
|
31310
31517
|
"headroom",
|
|
31311
31518
|
["proxy", "--port", "8787"],
|
|
31312
31519
|
{ stdio: "ignore", detached: true, env: proxyEnv }
|
|
@@ -32318,7 +32525,7 @@ async function discoverRepos(workingDir, maxDepth = 4) {
|
|
|
32318
32525
|
// src/services/turn-files/files-outbox.ts
|
|
32319
32526
|
var fs65 = __toESM(require("fs/promises"));
|
|
32320
32527
|
var path70 = __toESM(require("path"));
|
|
32321
|
-
var
|
|
32528
|
+
var import_os12 = require("os");
|
|
32322
32529
|
var HOME_OUTBOX_DIR = ".codeam/outbox";
|
|
32323
32530
|
var MAX_AGE_MS = 24 * 60 * 60 * 1e3;
|
|
32324
32531
|
var BACKOFF_STEPS_MS = [
|
|
@@ -32487,7 +32694,7 @@ function applyJitter(ms) {
|
|
|
32487
32694
|
return Math.round(ms * factor);
|
|
32488
32695
|
}
|
|
32489
32696
|
function homeDir() {
|
|
32490
|
-
return process.env.HOME ?? process.env.USERPROFILE ?? (0,
|
|
32697
|
+
return process.env.HOME ?? process.env.USERPROFILE ?? (0, import_os12.tmpdir)();
|
|
32491
32698
|
}
|
|
32492
32699
|
|
|
32493
32700
|
// src/services/turn-files/turn-file-aggregator.ts
|
|
@@ -35467,8 +35674,8 @@ function buildMcpServersForStart(ctx) {
|
|
|
35467
35674
|
}
|
|
35468
35675
|
|
|
35469
35676
|
// src/skills/provision.ts
|
|
35470
|
-
var
|
|
35471
|
-
function provisionSkillsForStart(home =
|
|
35677
|
+
var import_node_os13 = __toESM(require("os"));
|
|
35678
|
+
function provisionSkillsForStart(home = import_node_os13.default.homedir()) {
|
|
35472
35679
|
const materialized = [];
|
|
35473
35680
|
try {
|
|
35474
35681
|
const manifest = readSkillsManifest();
|
|
@@ -39129,7 +39336,7 @@ function checkChokidar() {
|
|
|
39129
39336
|
}
|
|
39130
39337
|
async function doctor(args2 = []) {
|
|
39131
39338
|
const json = args2.includes("--json");
|
|
39132
|
-
const cliVersion = true ? "2.61.
|
|
39339
|
+
const cliVersion = true ? "2.61.51" : "0.0.0-dev";
|
|
39133
39340
|
const apiBase2 = resolveApiBaseUrl();
|
|
39134
39341
|
const diagnosticId = (0, import_node_crypto13.randomUUID)();
|
|
39135
39342
|
log.info("doctor", `run id=${diagnosticId} cli=${cliVersion}`);
|
|
@@ -39326,10 +39533,10 @@ async function completion(args2) {
|
|
|
39326
39533
|
}
|
|
39327
39534
|
|
|
39328
39535
|
// src/integrations/mcp-run.ts
|
|
39329
|
-
var
|
|
39536
|
+
var import_node_child_process31 = require("child_process");
|
|
39330
39537
|
var import_node_fs11 = require("fs");
|
|
39331
|
-
var
|
|
39332
|
-
var
|
|
39538
|
+
var import_node_os14 = __toESM(require("os"));
|
|
39539
|
+
var import_node_path11 = __toESM(require("path"));
|
|
39333
39540
|
|
|
39334
39541
|
// src/integrations/token-client.ts
|
|
39335
39542
|
var REFRESH_AHEAD_MS = 5 * 60 * 1e3;
|
|
@@ -39382,7 +39589,7 @@ var IntegrationTokenClient = class {
|
|
|
39382
39589
|
};
|
|
39383
39590
|
|
|
39384
39591
|
// src/integrations/stdio-proxy.ts
|
|
39385
|
-
var
|
|
39592
|
+
var import_node_child_process30 = require("child_process");
|
|
39386
39593
|
var import_node_readline3 = __toESM(require("readline"));
|
|
39387
39594
|
var RESTART_CHECK_INTERVAL_MS = 3e4;
|
|
39388
39595
|
var SIGKILL_ESCALATION_MS = 2e3;
|
|
@@ -39503,8 +39710,8 @@ var RestartableStdioProxy = class {
|
|
|
39503
39710
|
}
|
|
39504
39711
|
async spawnChild(stdout, preResolved) {
|
|
39505
39712
|
const spec = preResolved ?? await this.opts.spawnSpec();
|
|
39506
|
-
const
|
|
39507
|
-
const child =
|
|
39713
|
+
const spawn44 = this.opts.spawnImpl ?? import_node_child_process30.spawn;
|
|
39714
|
+
const child = spawn44(spec.command, spec.args, {
|
|
39508
39715
|
env: { ...process.env, ...spec.env },
|
|
39509
39716
|
// env only — never argv
|
|
39510
39717
|
stdio: ["pipe", "pipe", "inherit"]
|
|
@@ -39543,7 +39750,7 @@ function resolveDelivery(id) {
|
|
|
39543
39750
|
function commandExists(command2) {
|
|
39544
39751
|
try {
|
|
39545
39752
|
const probe = process.platform === "win32" ? "where" : "which";
|
|
39546
|
-
(0,
|
|
39753
|
+
(0, import_node_child_process31.execFileSync)(probe, [command2], { stdio: "ignore" });
|
|
39547
39754
|
return true;
|
|
39548
39755
|
} catch {
|
|
39549
39756
|
return false;
|
|
@@ -39551,8 +39758,8 @@ function commandExists(command2) {
|
|
|
39551
39758
|
}
|
|
39552
39759
|
function localBinCandidates(command2) {
|
|
39553
39760
|
return [
|
|
39554
|
-
|
|
39555
|
-
|
|
39761
|
+
import_node_path11.default.join(import_node_os14.default.homedir(), ".local", "bin", command2),
|
|
39762
|
+
import_node_path11.default.join(import_node_os14.default.homedir(), ".cargo", "bin", command2)
|
|
39556
39763
|
];
|
|
39557
39764
|
}
|
|
39558
39765
|
function resolveLauncherPath(command2, deps = {
|
|
@@ -39576,7 +39783,7 @@ function ensureCommand(command2) {
|
|
|
39576
39783
|
}
|
|
39577
39784
|
if (command2 === "uvx") {
|
|
39578
39785
|
try {
|
|
39579
|
-
(0,
|
|
39786
|
+
(0, import_node_child_process31.execSync)("curl -LsSf https://astral.sh/uv/install.sh | sh", {
|
|
39580
39787
|
stdio: ["ignore", process.stderr, process.stderr],
|
|
39581
39788
|
timeout: 18e4,
|
|
39582
39789
|
env: { ...process.env, UV_NO_MODIFY_PATH: "1" }
|
|
@@ -39585,7 +39792,7 @@ function ensureCommand(command2) {
|
|
|
39585
39792
|
}
|
|
39586
39793
|
if (resolveLauncherPath(command2) !== command2) return;
|
|
39587
39794
|
try {
|
|
39588
|
-
(0,
|
|
39795
|
+
(0, import_node_child_process31.execSync)("python3 -m pip install --user --quiet uv", {
|
|
39589
39796
|
stdio: ["ignore", process.stderr, process.stderr],
|
|
39590
39797
|
timeout: 18e4
|
|
39591
39798
|
});
|
|
@@ -39651,7 +39858,7 @@ async function mcpRun(args2) {
|
|
|
39651
39858
|
// src/commands/version.ts
|
|
39652
39859
|
var import_picocolors15 = __toESM(require("picocolors"));
|
|
39653
39860
|
function version2() {
|
|
39654
|
-
const v = true ? "2.61.
|
|
39861
|
+
const v = true ? "2.61.51" : "unknown";
|
|
39655
39862
|
console.log(`${import_picocolors15.default.bold("codeam-cli")} ${import_picocolors15.default.cyan(v)}`);
|
|
39656
39863
|
}
|
|
39657
39864
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeam-cli",
|
|
3
|
-
"version": "2.61.
|
|
3
|
+
"version": "2.61.51",
|
|
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",
|