@conveno/cli 0.2.0-rc.12 → 0.2.0-rc.13
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/dist/{acp-CIzgcCp9.js → acp-Bs6XS61j.js} +3 -3
- package/dist/{agy-relay-Y9o-Pw9U.js → agy-relay-BJLRYbFp.js} +2 -2
- package/dist/{args-C1eX8Ixk.js → args-C4rVCVXx.js} +3 -1
- package/dist/bin.js +16 -2
- package/dist/daemon.js +130 -6
- package/dist/{daemonError-0KnkgIRo.js → daemonError-CjxG2yUl.js} +1 -1
- package/dist/{dist-DF0nL8wE.js → dist-B14ldKRS.js} +3 -2
- package/dist/{dist-4iJnF07i.js → dist-BkhKEexU.js} +90 -21
- package/dist/{dist-BjATai4T.js → dist-C9Z1EMlM.js} +26 -5
- package/dist/{dist-B3YYLzKS.js → dist-Ca3P7aN-.js} +9 -1
- package/dist/{dist-DeN0jR3I.js → dist-CoRBNycn.js} +1 -1
- package/dist/{dist-Du1hwaux.js → dist-D4sb5RQD.js} +37 -1
- package/dist/{dist-CRj_cuHc.js → dist-DnNuDzEA.js} +112 -14
- package/dist/{hook-ByduyOom.js → hook-C60hXJdg.js} +46 -12
- package/dist/{hook-entry-DWa1oppt.js → hook-entry-WlJSM5aD.js} +9 -9
- package/dist/hook-entry-jOfjq-0A.js +1 -0
- package/dist/{main-WIfawg60.js → main-I2RMN7XN.js} +54 -15
- package/dist/{pick-BmZuv9yQ.js → pick-Colav8Wm.js} +1 -1
- package/dist/{run-Df6vFm9n.js → run-BuDbmxx_.js} +164 -28
- package/dist/{runtime-BKPod_ZQ.js → runtime-CPmrhPFJ.js} +37 -14
- package/dist/{uninstall-MaS5t1CK.js → uninstall-812XZDTG.js} +132 -8
- package/dist/{watch-CPkilo9L.js → watch-DXbOOc20.js} +4 -4
- package/package.json +13 -13
- package/dist/hook-entry-ajdMBSpY.js +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { At as pinnedAdapter, Ht as readSettings, Kt as requestDeviceCode, Lt as readAccountTokens, N as compatStatus, Nt as planSpawn, P as completeLogin, Pt as pollDeviceCode, X as findOnPath, Y as fetchAccountStatus, Yt as resolveAcpProgram, _ as adapterInstallCommand, _n as CLI_KINDS, g as acpOverrideVar, gn as writeSettings, gt as logoutAccount, p as SPAWN_TABLE, r as AccountError, v as adapterNpxCommand, z as dataPaths } from "./dist-DnNuDzEA.js";
|
|
2
2
|
import { a as fail, c as plural, d as warnBlock, i as errorBlock, l as seconds, n as cmd, o as localStamp, r as columns, s as plainError, t as closest, u as tilde } from "./fmt-C2SsP5Y0.js";
|
|
3
|
-
import { a as parseFlags, n as COMMANDS } from "./args-
|
|
3
|
+
import { a as parseFlags, n as COMMANDS } from "./args-C4rVCVXx.js";
|
|
4
4
|
import { n as connectOpts, t as adapterEnv } from "./ctx-tYftvhz_.js";
|
|
5
|
-
import { t as daemonProblem } from "./daemonError-
|
|
5
|
+
import { t as daemonProblem } from "./daemonError-CjxG2yUl.js";
|
|
6
6
|
import { basename, dirname, isAbsolute, join } from "node:path";
|
|
7
|
-
import { spawn } from "node:child_process";
|
|
7
|
+
import { execFile, spawn } from "node:child_process";
|
|
8
8
|
import { access, chmod, mkdir, open, readFile, readdir, realpath, rename as rename$1, rm, rmdir, stat, writeFile } from "node:fs/promises";
|
|
9
9
|
import { createHash, randomBytes } from "node:crypto";
|
|
10
10
|
// src/account.ts
|
|
@@ -140,6 +140,8 @@ async function runAccount(ctx, argv, io = {}) {
|
|
|
140
140
|
return accountFailure(ctx, e, "Could not read your account");
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
+
// src/version.ts
|
|
144
|
+
const VERSION = "0.2.0-rc.13";
|
|
143
145
|
// src/daemon.ts
|
|
144
146
|
async function lockPid(ctx) {
|
|
145
147
|
try {
|
|
@@ -276,6 +278,29 @@ async function stopDaemonIfRunning(ctx) {
|
|
|
276
278
|
}
|
|
277
279
|
return stopDaemon(ctx, true);
|
|
278
280
|
}
|
|
281
|
+
/**
|
|
282
|
+
* For the commands a person runs (`conveno`, `conveno setup`): when a daemon is running from a
|
|
283
|
+
* different version than this CLI (an upgrade left the old one up), stop it so the next connect
|
|
284
|
+
* starts this version's. Says nothing itself; the returned line is for the setup details. Never
|
|
285
|
+
* starts a daemon, and never throws. MCP servers and hooks must not call this: an old MCP would
|
|
286
|
+
* take the daemon back to its own version.
|
|
287
|
+
*/
|
|
288
|
+
async function replaceStaleDaemon(ctx) {
|
|
289
|
+
let running;
|
|
290
|
+
try {
|
|
291
|
+
const c = await ctx.connect(connectOpts(ctx, false));
|
|
292
|
+
running = c.daemonVersion;
|
|
293
|
+
await c.close().catch(() => void 0);
|
|
294
|
+
} catch {
|
|
295
|
+
return null;
|
|
296
|
+
}
|
|
297
|
+
if (running === void 0 || running === "0.2.0-rc.13") return null;
|
|
298
|
+
return await stopDaemon({
|
|
299
|
+
...ctx,
|
|
300
|
+
out: () => void 0,
|
|
301
|
+
err: () => void 0
|
|
302
|
+
}, true).catch(() => 1) === 0 ? `Restarted the background service: it was ${running}, now ${VERSION}.` : `The background service is still ${running} (this is ${VERSION}). Run conveno daemon stop.`;
|
|
303
|
+
}
|
|
279
304
|
const SUBCOMMANDS = [
|
|
280
305
|
"start",
|
|
281
306
|
"stop",
|
|
@@ -762,6 +787,90 @@ ${missing.map((m) => ` ${pinnedAdapter(m.pkg) ?? m.pkg}\n`).join("")}`);
|
|
|
762
787
|
printManual(ctx, missing);
|
|
763
788
|
}
|
|
764
789
|
}
|
|
790
|
+
function realWarmRunner(ctx) {
|
|
791
|
+
return { run: (file, args, timeoutMs) => {
|
|
792
|
+
const plan = planSpawn(file, args);
|
|
793
|
+
return new Promise((resolve) => {
|
|
794
|
+
execFile(plan.file, plan.args, {
|
|
795
|
+
timeout: timeoutMs,
|
|
796
|
+
windowsHide: true,
|
|
797
|
+
env: {
|
|
798
|
+
...ctx.env,
|
|
799
|
+
npm_config_update_notifier: "false"
|
|
800
|
+
},
|
|
801
|
+
maxBuffer: 16777216,
|
|
802
|
+
...plan.windowsVerbatimArguments ? { windowsVerbatimArguments: true } : {}
|
|
803
|
+
}, (err) => {
|
|
804
|
+
if (!err) return resolve(0);
|
|
805
|
+
const code = err.code;
|
|
806
|
+
resolve(typeof code === "number" ? code : null);
|
|
807
|
+
});
|
|
808
|
+
});
|
|
809
|
+
} };
|
|
810
|
+
}
|
|
811
|
+
/**
|
|
812
|
+
* The pinned `<pkg>@<version>` of every adapter these tools need that is not on PATH (nor
|
|
813
|
+
* overridden), when the person allowed on-demand adapters. Empty otherwise.
|
|
814
|
+
*/
|
|
815
|
+
function adaptersToWarm(ctx, clis) {
|
|
816
|
+
if (!(readSettings(dataPaths(ctx.platform, ctx.dataDir).settings).acpAdapterNpx === true)) return [];
|
|
817
|
+
const out = [];
|
|
818
|
+
for (const cli of clis) {
|
|
819
|
+
const acp = SPAWN_TABLE[cli]?.acp;
|
|
820
|
+
if (!acp?.adapterPackage) continue;
|
|
821
|
+
const found = resolveAcpProgram(cli, acp, {
|
|
822
|
+
env: ctx.env,
|
|
823
|
+
which: (n) => findOnPath(n, ctx.env, ctx.platform),
|
|
824
|
+
npxConsent: false
|
|
825
|
+
});
|
|
826
|
+
const pinned = pinnedAdapter(acp.adapterPackage);
|
|
827
|
+
if (!found.ok && pinned && !out.includes(pinned)) out.push(pinned);
|
|
828
|
+
}
|
|
829
|
+
return out;
|
|
830
|
+
}
|
|
831
|
+
/**
|
|
832
|
+
* Download the adapters now. `onStart` is called once, before the first download, and only when
|
|
833
|
+
* there is something to download. Never throws.
|
|
834
|
+
*/
|
|
835
|
+
async function warmAcpAdapters(ctx, clis, opts = {}) {
|
|
836
|
+
const packages = adaptersToWarm(ctx, clis);
|
|
837
|
+
if (packages.length === 0) return { status: "none" };
|
|
838
|
+
opts.onStart?.();
|
|
839
|
+
const runner = opts.runner ?? ctx.warmRunner ?? realWarmRunner(ctx);
|
|
840
|
+
const failed = [];
|
|
841
|
+
for (const pkg of packages) {
|
|
842
|
+
const args = [
|
|
843
|
+
"exec",
|
|
844
|
+
"--yes",
|
|
845
|
+
`--package=${pkg}`,
|
|
846
|
+
"--",
|
|
847
|
+
"node",
|
|
848
|
+
"-e",
|
|
849
|
+
"0"
|
|
850
|
+
];
|
|
851
|
+
opts.onLine?.(`$ npm ${args.join(" ")}`);
|
|
852
|
+
let code = null;
|
|
853
|
+
try {
|
|
854
|
+
code = await runner.run("npm", args, opts.timeoutMs ?? 3e5);
|
|
855
|
+
} catch {
|
|
856
|
+
code = null;
|
|
857
|
+
}
|
|
858
|
+
if (code !== 0) {
|
|
859
|
+
failed.push(pkg);
|
|
860
|
+
opts.onLine?.(`Could not fetch ${pkg} now (${code === null ? "no answer" : `exit ${code}`}).`);
|
|
861
|
+
} else opts.onLine?.(`${pkg} is ready.`);
|
|
862
|
+
}
|
|
863
|
+
if (failed.length === 0) return {
|
|
864
|
+
status: "ready",
|
|
865
|
+
packages
|
|
866
|
+
};
|
|
867
|
+
return {
|
|
868
|
+
status: "failed",
|
|
869
|
+
packages,
|
|
870
|
+
failed,
|
|
871
|
+
reason: "It will download the first time a worker starts."
|
|
872
|
+
};
|
|
873
|
+
}
|
|
765
874
|
// src/diff.ts
|
|
766
875
|
const splitLines = (s) => {
|
|
767
876
|
if (s === "") return [];
|
|
@@ -1558,6 +1667,10 @@ async function runInit(ctx, argv, name = "init") {
|
|
|
1558
1667
|
ref: "e_usage"
|
|
1559
1668
|
});
|
|
1560
1669
|
}
|
|
1670
|
+
if (early?.values["dry-run"] !== true) {
|
|
1671
|
+
const restarted = await replaceStaleDaemon(ctx);
|
|
1672
|
+
if (restarted) ctx.out(`${ctx.theme.status("info")} ${restarted}\n`);
|
|
1673
|
+
}
|
|
1561
1674
|
const outcome = {};
|
|
1562
1675
|
const code = await initSetup(ctx, argv, outcome, name);
|
|
1563
1676
|
if (code !== 0) return code;
|
|
@@ -1575,6 +1688,10 @@ async function runInit(ctx, argv, name = "init") {
|
|
|
1575
1688
|
flag: values["acp-adapters"] === true ? true : values["no-acp-adapters"] === true ? false : void 0,
|
|
1576
1689
|
yes: values.yes === true
|
|
1577
1690
|
});
|
|
1691
|
+
const t = ctx.theme;
|
|
1692
|
+
const warmed = await warmAcpAdapters(ctx, outcome.offer.map((a) => a.cli), { onStart: () => ctx.out(`${t.status("info")} Getting workers ready (the first download can take a minute).\n`) }).catch(() => void 0);
|
|
1693
|
+
if (warmed?.status === "ready") ctx.out(`${t.status("ok")} Workers are ready.\n`);
|
|
1694
|
+
else if (warmed?.status === "failed") ctx.out(`${t.status("info")} Couldn't get workers ready now. They download the first time one starts.\n`);
|
|
1578
1695
|
return 0;
|
|
1579
1696
|
}
|
|
1580
1697
|
async function initSetup(ctx, argv, outcome, name) {
|
|
@@ -1738,7 +1855,7 @@ async function runSetup(ctx, argv) {
|
|
|
1738
1855
|
const parsed = parseFlags(ctx, spec, argv);
|
|
1739
1856
|
if (typeof parsed === "number") return parsed;
|
|
1740
1857
|
const v = parsed.values;
|
|
1741
|
-
if (ctx.interactive && v.yes !== true && v["dry-run"] !== true) return (await import("./run-
|
|
1858
|
+
if (ctx.interactive && v.yes !== true && v["dry-run"] !== true) return (await import("./run-BuDbmxx_.js")).runTui(ctx, { start: "setup" });
|
|
1742
1859
|
return runInit(ctx, argv, "setup");
|
|
1743
1860
|
}
|
|
1744
1861
|
// src/doctor.ts
|
|
@@ -1857,8 +1974,15 @@ async function runDoctor(ctx, argv = []) {
|
|
|
1857
1974
|
const client = await ctx.connect(connectOpts(ctx, false));
|
|
1858
1975
|
try {
|
|
1859
1976
|
const { sessions } = await client["session.list"]({});
|
|
1860
|
-
|
|
1861
|
-
|
|
1977
|
+
const running = client.daemonVersion;
|
|
1978
|
+
if (running !== void 0 && running !== "0.2.0-rc.13") {
|
|
1979
|
+
daemonLine = [` ${t.status("warn")} daemon`, `running ${running}, this is ${VERSION}`];
|
|
1980
|
+
warnings++;
|
|
1981
|
+
notes.push(warnBlock(t, "Conveno's background service is from an older version.", `Run ${cmd(t, "conveno")} to restart it, or ${cmd(t, "conveno daemon stop")} and open your AI tools again.`, `The service running now is ${running}; this install is ${VERSION}. ${cmd(t, "conveno")} and ${cmd(t, "conveno setup")} restart it for you.`));
|
|
1982
|
+
} else {
|
|
1983
|
+
daemonLine = [` ${t.status("ok")} daemon`, `running, ${plural(sessions.length, "session")}`];
|
|
1984
|
+
ok++;
|
|
1985
|
+
}
|
|
1862
1986
|
} finally {
|
|
1863
1987
|
await client.close().catch(() => void 0);
|
|
1864
1988
|
}
|
|
@@ -2121,4 +2245,4 @@ async function runUninstall(ctx, argv) {
|
|
|
2121
2245
|
ctx.out(" Removed the Conveno entries. Restart open sessions to drop Conveno.\n");
|
|
2122
2246
|
return 0;
|
|
2123
2247
|
}
|
|
2124
|
-
export {
|
|
2248
|
+
export { runAccount as A, runDevices as C, stopDaemonIfRunning as D, runDaemon as E, runLogout as M, showCode as N, VERSION as O, PAIR_TIMEOUT_MS as S, replaceStaleDaemon as T, saveChoice as _, applyOptions as a, unifiedDiff as b, collectPlans as c, refreshManifest as d, renewedApprovals as f, connectedTools as g, chosenTools as h, runDoctor as i, runLogin as j, openInBrowser as k, detectAll as l, runSetup as m, inspect as n, approvalWrites as o, runInit as p, partState as r, approvedBySetup as s, runUninstall as t, pendingOptions as u, StaleError as v, runRelay as w, warmAcpAdapters as x, applyChanges as y };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as isOneShotGrok } from "./dist-
|
|
2
|
-
import {
|
|
1
|
+
import { n as isOneShotGrok } from "./dist-B14ldKRS.js";
|
|
2
|
+
import { $t as runWaker, Gt as renderBody, ct as isFromOwner, tn as senderOf } from "./dist-DnNuDzEA.js";
|
|
3
3
|
import { n as connectOpts } from "./ctx-tYftvhz_.js";
|
|
4
|
-
import { t as daemonProblem } from "./daemonError-
|
|
5
|
-
import { t as findSession } from "./pick-
|
|
4
|
+
import { t as daemonProblem } from "./daemonError-CjxG2yUl.js";
|
|
5
|
+
import { t as findSession } from "./pick-Colav8Wm.js";
|
|
6
6
|
// src/watch.ts
|
|
7
7
|
const CONNECT_MAX_RETRY_MS = 3e4;
|
|
8
8
|
const CONNECT_GIVE_UP_MS = 3e5;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@conveno/cli",
|
|
3
|
-
"version": "0.2.0-rc.
|
|
3
|
+
"version": "0.2.0-rc.13",
|
|
4
4
|
"description": "Connect AI coding CLI sessions so they can message each other.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -52,18 +52,18 @@
|
|
|
52
52
|
"zod": "4.6.7"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@conveno/acp": "0.2.0-rc.
|
|
56
|
-
"@conveno/adapter-antigravity": "0.2.0-rc.
|
|
57
|
-
"@conveno/adapter-claude": "0.2.0-rc.
|
|
58
|
-
"@conveno/adapter-codex": "0.2.0-rc.
|
|
59
|
-
"@conveno/adapter-grok": "0.2.0-rc.
|
|
60
|
-
"@conveno/adapter-opencode": "0.2.0-rc.
|
|
61
|
-
"@conveno/brand": "0.2.0-rc.
|
|
62
|
-
"@conveno/client": "0.2.0-rc.
|
|
63
|
-
"@conveno/core": "0.2.0-rc.
|
|
64
|
-
"@conveno/daemon": "0.2.0-rc.
|
|
65
|
-
"@conveno/mcp": "0.2.0-rc.
|
|
66
|
-
"@conveno/protocol": "0.2.0-rc.
|
|
55
|
+
"@conveno/acp": "0.2.0-rc.13",
|
|
56
|
+
"@conveno/adapter-antigravity": "0.2.0-rc.13",
|
|
57
|
+
"@conveno/adapter-claude": "0.2.0-rc.13",
|
|
58
|
+
"@conveno/adapter-codex": "0.2.0-rc.13",
|
|
59
|
+
"@conveno/adapter-grok": "0.2.0-rc.13",
|
|
60
|
+
"@conveno/adapter-opencode": "0.2.0-rc.13",
|
|
61
|
+
"@conveno/brand": "0.2.0-rc.13",
|
|
62
|
+
"@conveno/client": "0.2.0-rc.13",
|
|
63
|
+
"@conveno/core": "0.2.0-rc.13",
|
|
64
|
+
"@conveno/daemon": "0.2.0-rc.13",
|
|
65
|
+
"@conveno/mcp": "0.2.0-rc.13",
|
|
66
|
+
"@conveno/protocol": "0.2.0-rc.13",
|
|
67
67
|
"@types/react": "19.3.0",
|
|
68
68
|
"ink-testing-library": "4.0.0"
|
|
69
69
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { i as runHookEntry } from "./hook-entry-DWa1oppt.js";
|