@conveno/cli 0.2.0-rc.10 → 0.2.0-rc.12
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/README.md +2 -4
- package/dist/{acp-TSjX4JP9.js → acp-CIzgcCp9.js} +3 -3
- package/dist/{agy-relay-D-OWo85B.js → agy-relay-Y9o-Pw9U.js} +3 -2
- package/dist/{args-B3Cj2Ie4.js → args-C1eX8Ixk.js} +3 -3
- package/dist/bin.js +2 -2
- package/dist/daemon.js +213 -18
- package/dist/{daemonError-C05GqdhQ.js → daemonError-0KnkgIRo.js} +1 -1
- package/dist/{dist-BLfduOoT.js → dist-4iJnF07i.js} +5 -5
- package/dist/{dist-D_O_JLLq.js → dist-B3YYLzKS.js} +2 -1
- package/dist/{dist-MK-cK1JY.js → dist-BjATai4T.js} +15 -16
- package/dist/{dist-STNJjbNH.js → dist-CRj_cuHc.js} +188 -95
- package/dist/{dist-DaIpdMke.js → dist-DF0nL8wE.js} +48 -7
- package/dist/{dist-CVdpCNJo.js → dist-DeN0jR3I.js} +1 -1
- package/dist/{dist-VOS92iqO.js → dist-Du1hwaux.js} +20 -13
- package/dist/{hook-CDF1A8AY.js → hook-ByduyOom.js} +62 -2
- package/dist/hook-entry-DWa1oppt.js +1343 -0
- package/dist/hook-entry-ajdMBSpY.js +1 -0
- package/dist/{main-BhKTG0AI.js → main-WIfawg60.js} +12 -12
- package/dist/{pick-DLp6w_-z.js → pick-BmZuv9yQ.js} +1 -1
- package/dist/{run-eCXO1SyO.js → run-Df6vFm9n.js} +76 -104
- package/dist/{runtime-BGPlr8CI.js → runtime-BKPod_ZQ.js} +93 -90
- package/dist/{uninstall-DQlzpv5R.js → uninstall-MaS5t1CK.js} +132 -42
- package/dist/{watch-D0KIPowJ.js → watch-CPkilo9L.js} +29 -7
- package/package.json +13 -15
- package/dist/hook-entry-C0bPssOy.js +0 -1
- package/dist/hook-entry-CQQU-e_t.js +0 -2500
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { i as runHookEntry } from "./hook-entry-DWa1oppt.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as parseFlags, i as commandHelp, n as COMMANDS, r as COMMAND_NAMES, t as ALL_COMMAND_NAMES } from "./args-
|
|
4
|
-
import { t as daemonProblem } from "./daemonError-
|
|
1
|
+
import { Kt as runLaunchFile, R as dataPaths, Rt as realSpawnDeps, Zt as spawnSession, d as SPAWN_CLIS, dn as CLI_KINDS, f as SPAWN_TABLE, p as SpawnError } from "./dist-CRj_cuHc.js";
|
|
2
|
+
import { C as runRelay, D as runAccount, O as runLogin, S as runDevices, i as runDoctor, k as runLogout, m as runSetup, p as runInit, t as runUninstall, w as runDaemon } from "./uninstall-MaS5t1CK.js";
|
|
3
|
+
import { a as parseFlags, i as commandHelp, n as COMMANDS, r as COMMAND_NAMES, t as ALL_COMMAND_NAMES } from "./args-C1eX8Ixk.js";
|
|
4
|
+
import { t as daemonProblem } from "./daemonError-0KnkgIRo.js";
|
|
5
5
|
import { chmod, mkdir, writeFile } from "node:fs/promises";
|
|
6
6
|
import { join, resolve } from "node:path";
|
|
7
7
|
import { a as fail, c as plural, d as warnBlock, n as cmd, r as columns, s as plainError, t as closest, u as tilde } from "./fmt-C2SsP5Y0.js";
|
|
8
|
-
import { t as runHook } from "./hook-
|
|
8
|
+
import { t as runHook } from "./hook-ByduyOom.js";
|
|
9
9
|
import { n as connectOpts, t as adapterEnv } from "./ctx-tYftvhz_.js";
|
|
10
|
-
import { t as findSession } from "./pick-
|
|
10
|
+
import { t as findSession } from "./pick-BmZuv9yQ.js";
|
|
11
11
|
import { readFileSync } from "node:fs";
|
|
12
12
|
// src/version.ts
|
|
13
|
-
const VERSION = "0.2.0-rc.
|
|
13
|
+
const VERSION = "0.2.0-rc.12";
|
|
14
14
|
// src/errorLog.ts
|
|
15
15
|
/** The message of an unexpected error, as it is. Not the softened text `plainError` gives. */
|
|
16
16
|
function rawMessage(e) {
|
|
@@ -572,11 +572,11 @@ async function dispatch(name, rest, ctx) {
|
|
|
572
572
|
case "rename": return runRename(ctx, rest);
|
|
573
573
|
case "lead": return runLead(ctx, rest);
|
|
574
574
|
case "spawn": return runSpawn(ctx, rest);
|
|
575
|
-
case "acp-host": return (await import("./acp-
|
|
576
|
-
case "stop": return (await import("./acp-
|
|
575
|
+
case "acp-host": return (await import("./acp-CIzgcCp9.js")).runAcpHostCmd(ctx, rest);
|
|
576
|
+
case "stop": return (await import("./acp-CIzgcCp9.js")).runStop(ctx, rest);
|
|
577
577
|
case "spawn-run": return runSpawnRun(ctx, rest);
|
|
578
|
-
case "agy-relay": return (await import("./agy-relay-
|
|
579
|
-
case "watch": return (await import("./watch-
|
|
578
|
+
case "agy-relay": return (await import("./agy-relay-Y9o-Pw9U.js")).runAgyRelay(ctx, rest);
|
|
579
|
+
case "watch": return (await import("./watch-CPkilo9L.js")).runWatch(ctx, rest);
|
|
580
580
|
case "devices": return runDevices(ctx, rest);
|
|
581
581
|
case "relay": return runRelay(ctx, rest);
|
|
582
582
|
case "doctor": return runDoctor(ctx, rest);
|
|
@@ -615,7 +615,7 @@ function opensApp(env, tty = {
|
|
|
615
615
|
async function main(argv, ctx) {
|
|
616
616
|
const [command, ...rest] = argv;
|
|
617
617
|
if (command === void 0 && opensApp(ctx.env)) try {
|
|
618
|
-
return await (await import("./run-
|
|
618
|
+
return await (await import("./run-Df6vFm9n.js")).runTui(ctx);
|
|
619
619
|
} catch (e) {
|
|
620
620
|
ctx.err(`The app could not start (${rawMessage(e)}). Showing the help instead.\n`);
|
|
621
621
|
ctx.out(helpText(ctx));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Box, Text, render, useApp, useInput, useStdin, useStdout } from "ink";
|
|
2
2
|
import { n as connectOpts, t as adapterEnv } from "./ctx-tYftvhz_.js";
|
|
3
|
-
import { t as daemonProblem } from "./daemonError-
|
|
3
|
+
import { t as daemonProblem } from "./daemonError-0KnkgIRo.js";
|
|
4
4
|
import { a as fail, n as cmd, s as plainError, u as tilde } from "./fmt-C2SsP5Y0.js";
|
|
5
5
|
import { createContext, useContext, useEffect, useImperativeHandle, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { Bt as requestDeviceCode, It as readSettings, J as fetchAccountStatus, Lt as readSpawnRecord, M as compatStatus, Mt as readAccountTokens, N as completeLogin, Ot as planSpawn, R as dataPaths, Rt as realSpawnDeps, Xt as spawnRecordPath, Y as findOnPath, Zt as spawnSession, ft as logoutAccount, kt as pollDeviceCode, n as AccountError, un as writeSettings, wn as SESSION_NAME_PATTERN } from "./dist-CRj_cuHc.js";
|
|
7
|
+
import { A as showCode$1, E as openInBrowser, T as stopDaemonIfRunning, _ as saveChoice, a as applyOptions, b as unifiedDiff, c as collectPlans, d as refreshManifest, f as renewedApprovals, g as connectedTools, h as chosenTools, l as detectAll, n as inspect, o as approvalWrites, r as partState, s as approvedBySetup, t as runUninstall, u as pendingOptions, v as StaleError, x as PAIR_TIMEOUT_MS, y as applyChanges } from "./uninstall-MaS5t1CK.js";
|
|
8
8
|
import { i as tokens, n as detectColorLevel, r as detectUnicode } from "./dist-BRjg9CLd.js";
|
|
9
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { readFileSync, statSync, writeFileSync } from "node:fs";
|
|
@@ -12,7 +12,7 @@ import { Readable } from "node:stream";
|
|
|
12
12
|
import { basename, posix, win32 } from "node:path";
|
|
13
13
|
import { spawn } from "node:child_process";
|
|
14
14
|
import { homedir } from "node:os";
|
|
15
|
-
import { r as stopRequestPath, t as killProcessTree } from "./dist-
|
|
15
|
+
import { r as stopRequestPath, t as killProcessTree } from "./dist-4iJnF07i.js";
|
|
16
16
|
// src/tui/home/deps.ts
|
|
17
17
|
/**
|
|
18
18
|
* What home does outside the store: sign in and out, and take Conveno away. Real in the app, fake
|
|
@@ -570,14 +570,10 @@ function Choices({ items, multi = false, value, onChange, onSubmit, focusIndex,
|
|
|
570
570
|
else if (input === " ") toggle(focus);
|
|
571
571
|
else if (key.return) submit(focus);
|
|
572
572
|
}, { isActive });
|
|
573
|
-
const mark = multi ?
|
|
573
|
+
const mark = multi ? {
|
|
574
574
|
on: "[x]",
|
|
575
575
|
off: "[ ]",
|
|
576
576
|
no: "[-]"
|
|
577
|
-
} : {
|
|
578
|
-
on: "●",
|
|
579
|
-
off: "○",
|
|
580
|
-
no: "–"
|
|
581
577
|
} : void 0;
|
|
582
578
|
const pointer = k.ascii ? ">" : "›";
|
|
583
579
|
const labelW = Math.max(0, ...items.map((i) => [...i.label].length));
|
|
@@ -587,7 +583,7 @@ function Choices({ items, multi = false, value, onChange, onSubmit, focusIndex,
|
|
|
587
583
|
const focused = i === focus && !item.disabled;
|
|
588
584
|
const picked = value.includes(item.id);
|
|
589
585
|
const lead = focused ? pointer : " ";
|
|
590
|
-
const room = Math.max(0, full - 2 - (mark ?
|
|
586
|
+
const room = Math.max(0, full - 2 - (mark ? 4 : 0));
|
|
591
587
|
const label = cut(item.label, Math.min(labelW, room), k.ascii);
|
|
592
588
|
const hintRoom = room - [...label].length - 2;
|
|
593
589
|
const labelProps = item.disabled ? tint(k.c.quiet) : focused ? {
|
|
@@ -612,7 +608,10 @@ function Choices({ items, multi = false, value, onChange, onSubmit, focusIndex,
|
|
|
612
608
|
children: `${lead} `
|
|
613
609
|
}),
|
|
614
610
|
mark ? /* @__PURE__ */ jsx(Text, {
|
|
615
|
-
...item.disabled ? k.quiet : picked ?
|
|
611
|
+
...item.disabled ? k.quiet : picked ? {
|
|
612
|
+
...tint(k.c.entry),
|
|
613
|
+
...strong(k)
|
|
614
|
+
} : k.quiet,
|
|
616
615
|
children: `${item.disabled ? mark.no : picked ? mark.on : mark.off} `
|
|
617
616
|
}) : null,
|
|
618
617
|
/* @__PURE__ */ jsx(Text, {
|
|
@@ -1153,11 +1152,9 @@ function useTravel(trigger, length) {
|
|
|
1153
1152
|
const TOOL_NAMES$1 = {
|
|
1154
1153
|
claude: "Claude Code",
|
|
1155
1154
|
codex: "Codex",
|
|
1156
|
-
copilot: "GitHub Copilot",
|
|
1157
1155
|
opencode: "OpenCode",
|
|
1158
1156
|
antigravity: "Antigravity",
|
|
1159
|
-
grok: "Grok Build"
|
|
1160
|
-
cursor: "Cursor"
|
|
1157
|
+
grok: "Grok Build"
|
|
1161
1158
|
};
|
|
1162
1159
|
/** "Claude Code" for `claude`. An unknown id shows as it is. */
|
|
1163
1160
|
const toolName$1 = (cli) => TOOL_NAMES$1[cli] ?? cli;
|
|
@@ -1190,11 +1187,16 @@ function reasonOf(e, fallback = "That did not work.") {
|
|
|
1190
1187
|
const line = (e instanceof Error ? e.message : typeof e === "string" ? e : "").split("\n")[0]?.trim();
|
|
1191
1188
|
return line ? line : fallback;
|
|
1192
1189
|
}
|
|
1193
|
-
/**
|
|
1190
|
+
/**
|
|
1191
|
+
* The state of a session in one or two words: working, idle, waking up, on next prompt, waiting for
|
|
1192
|
+
* you. A message waits for "waking up" only when something can wake the session; one that cannot
|
|
1193
|
+
* (`wakeable` false, such as a window nothing listens in yet) gets it at its next prompt.
|
|
1194
|
+
*/
|
|
1194
1195
|
function stateWord(s) {
|
|
1195
1196
|
if (s.status === "busy") return "working";
|
|
1196
1197
|
if (s.status === "waiting_on_question") return "waiting for you";
|
|
1197
|
-
|
|
1198
|
+
if ((s.unreadCount ?? 0) === 0) return "idle";
|
|
1199
|
+
return s.wakeable === false ? "on next prompt" : "waking up";
|
|
1198
1200
|
}
|
|
1199
1201
|
/** What a card says on its last line: the state, and the computer for a remote session. */
|
|
1200
1202
|
function stateLine(s) {
|
|
@@ -1219,6 +1221,7 @@ function problemsOf(setup) {
|
|
|
1219
1221
|
if (!h.fixId) continue;
|
|
1220
1222
|
const cli = h.fixId.split(":")[1] ?? "";
|
|
1221
1223
|
const check = setup.clis.find((c) => c.cli === cli);
|
|
1224
|
+
if (check?.chosen === false) continue;
|
|
1222
1225
|
out.push({
|
|
1223
1226
|
fixId: h.fixId,
|
|
1224
1227
|
label: check?.label ?? toolName$1(cli)
|
|
@@ -3160,8 +3163,6 @@ function getMouseSetting(ctx) {
|
|
|
3160
3163
|
if (mouseForcedOff(ctx)) return false;
|
|
3161
3164
|
return readRaw(ctx).appMouse !== false;
|
|
3162
3165
|
}
|
|
3163
|
-
// src/installers.ts
|
|
3164
|
-
const COPILOT_MIN_NODE = 22;
|
|
3165
3166
|
const NPM_DOCS_EACCES = "https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally";
|
|
3166
3167
|
const isWin = (platform) => platform === "win32";
|
|
3167
3168
|
function script(platform, shUrl, psUrl) {
|
|
@@ -3197,12 +3198,8 @@ function npmGlobal(platform, pkg) {
|
|
|
3197
3198
|
display: `npm install -g ${pkg}`
|
|
3198
3199
|
};
|
|
3199
3200
|
}
|
|
3200
|
-
/** Major version of a Node version string such as "v22.4.0" or "22.4.0". NaN when unreadable. */
|
|
3201
|
-
function nodeMajor(version) {
|
|
3202
|
-
return Number.parseInt(version.replace(/^v/i, ""), 10);
|
|
3203
|
-
}
|
|
3204
3201
|
/** How to install `cli` on `platform`, or why Conveno cannot do it. Pure. */
|
|
3205
|
-
function installPlan(cli, platform
|
|
3202
|
+
function installPlan(cli, platform) {
|
|
3206
3203
|
switch (cli) {
|
|
3207
3204
|
case "claude": return {
|
|
3208
3205
|
installable: true,
|
|
@@ -3212,15 +3209,6 @@ function installPlan(cli, platform, nodeVersion) {
|
|
|
3212
3209
|
installable: true,
|
|
3213
3210
|
steps: [npmGlobal(platform, "@openai/codex")]
|
|
3214
3211
|
};
|
|
3215
|
-
case "copilot":
|
|
3216
|
-
if (!(nodeMajor(nodeVersion) >= COPILOT_MIN_NODE)) return {
|
|
3217
|
-
installable: false,
|
|
3218
|
-
hint: `GitHub Copilot CLI needs Node ${COPILOT_MIN_NODE} or newer, and this computer has Node ${nodeVersion.replace(/^v/i, "")}. Update Node from nodejs.org, then run conveno setup again.`
|
|
3219
|
-
};
|
|
3220
|
-
return {
|
|
3221
|
-
installable: true,
|
|
3222
|
-
steps: [npmGlobal(platform, "@github/copilot")]
|
|
3223
|
-
};
|
|
3224
3212
|
case "opencode": return {
|
|
3225
3213
|
installable: true,
|
|
3226
3214
|
steps: [npmGlobal(platform, "@opencode/cli")]
|
|
@@ -3233,33 +3221,14 @@ function installPlan(cli, platform, nodeVersion) {
|
|
|
3233
3221
|
installable: true,
|
|
3234
3222
|
steps: [script(platform, "https://antigravity.google/cli/install.sh", "https://antigravity.google/cli/install.ps1")]
|
|
3235
3223
|
};
|
|
3236
|
-
case "cursor": return {
|
|
3237
|
-
installable: false,
|
|
3238
|
-
hint: "Install it from cursor.com, then run conveno setup."
|
|
3239
|
-
};
|
|
3240
3224
|
}
|
|
3241
3225
|
}
|
|
3242
3226
|
/**
|
|
3243
|
-
* Update route
|
|
3244
|
-
*
|
|
3245
|
-
* unreadable version gets no update.
|
|
3227
|
+
* Update route. No tool needs one now: any OpenCode 1.x or 2.x works, so nothing is offered. Kept
|
|
3228
|
+
* as the one place to add a route again if a tool ever gets a floor.
|
|
3246
3229
|
*/
|
|
3247
|
-
function updatePlan(
|
|
3248
|
-
|
|
3249
|
-
const m = /^v?(\d+)\.(\d+)/.exec(installedVersion.trim());
|
|
3250
|
-
if (!m) return { available: false };
|
|
3251
|
-
const major = Number(m[1]);
|
|
3252
|
-
const minor = Number(m[2]);
|
|
3253
|
-
if (major > 2 || major === 2 && minor >= 4) return { available: false };
|
|
3254
|
-
const args = major < 2 ? ["upgrade", "--major"] : ["upgrade"];
|
|
3255
|
-
return {
|
|
3256
|
-
available: true,
|
|
3257
|
-
steps: [{
|
|
3258
|
-
file: "opencode",
|
|
3259
|
-
args,
|
|
3260
|
-
display: `opencode ${args.join(" ")}`
|
|
3261
|
-
}]
|
|
3262
|
-
};
|
|
3230
|
+
function updatePlan(_cli, _installedVersion) {
|
|
3231
|
+
return { available: false };
|
|
3263
3232
|
}
|
|
3264
3233
|
/** Real process I/O. */
|
|
3265
3234
|
function realInstallDeps() {
|
|
@@ -3268,7 +3237,6 @@ function realInstallDeps() {
|
|
|
3268
3237
|
platform,
|
|
3269
3238
|
env: process.env,
|
|
3270
3239
|
home: homedir(),
|
|
3271
|
-
nodeVersion: process.versions.node,
|
|
3272
3240
|
isFile: (p) => {
|
|
3273
3241
|
try {
|
|
3274
3242
|
return statSync(p).isFile();
|
|
@@ -3418,7 +3386,7 @@ async function runSteps(steps, deps, onProgress) {
|
|
|
3418
3386
|
}
|
|
3419
3387
|
/** Install `cli` using its official route. Output lines go to `onProgress`. */
|
|
3420
3388
|
async function runInstall(cli, deps, onProgress) {
|
|
3421
|
-
const plan = installPlan(cli, deps.platform
|
|
3389
|
+
const plan = installPlan(cli, deps.platform);
|
|
3422
3390
|
if (!plan.installable) return {
|
|
3423
3391
|
ok: false,
|
|
3424
3392
|
reason: plan.hint,
|
|
@@ -3429,11 +3397,9 @@ async function runInstall(cli, deps, onProgress) {
|
|
|
3429
3397
|
const BINARIES = {
|
|
3430
3398
|
claude: ["claude"],
|
|
3431
3399
|
codex: ["codex"],
|
|
3432
|
-
copilot: ["copilot"],
|
|
3433
3400
|
opencode: ["opencode"],
|
|
3434
3401
|
grok: ["grok"],
|
|
3435
|
-
antigravity: ["agy"]
|
|
3436
|
-
cursor: ["cursor-agent", "agent"]
|
|
3402
|
+
antigravity: ["agy"]
|
|
3437
3403
|
};
|
|
3438
3404
|
/** Run `npm prefix -g` and return its first output line. Undefined on any failure. */
|
|
3439
3405
|
function npmPrefix(deps) {
|
|
@@ -3479,13 +3445,11 @@ async function extraDirs(cli, deps) {
|
|
|
3479
3445
|
case "antigravity": return w ? [p.join(deps.env.LOCALAPPDATA || p.join(deps.home, "AppData", "Local"), "agy", "bin")] : [local];
|
|
3480
3446
|
case "grok": return [p.join(deps.home, ".grok", "bin")];
|
|
3481
3447
|
case "codex":
|
|
3482
|
-
case "copilot":
|
|
3483
3448
|
case "opencode": {
|
|
3484
3449
|
const prefix = await npmPrefix(deps);
|
|
3485
3450
|
if (!prefix) return [];
|
|
3486
3451
|
return [w ? prefix : p.join(prefix, "bin")];
|
|
3487
3452
|
}
|
|
3488
|
-
case "cursor": return [];
|
|
3489
3453
|
}
|
|
3490
3454
|
}
|
|
3491
3455
|
/**
|
|
@@ -3574,9 +3538,13 @@ function healthFrom(input) {
|
|
|
3574
3538
|
level: "error",
|
|
3575
3539
|
text: "Conveno can't be reached"
|
|
3576
3540
|
});
|
|
3577
|
-
const
|
|
3578
|
-
const
|
|
3579
|
-
|
|
3541
|
+
const mine = input.clis.filter((c) => c.chosen !== false);
|
|
3542
|
+
const installed = mine.filter((c) => c.status !== "not-installed" || c.connected);
|
|
3543
|
+
const good = installed.filter((c) => c.status === "ready" || c.status === "not-installed").length;
|
|
3544
|
+
out.push(mine.length === 0 ? {
|
|
3545
|
+
level: "warn",
|
|
3546
|
+
text: "No AI tools chosen yet"
|
|
3547
|
+
} : installed.length === 0 ? {
|
|
3580
3548
|
level: "warn",
|
|
3581
3549
|
text: "No supported CLI found on this machine"
|
|
3582
3550
|
} : {
|
|
@@ -3618,7 +3586,18 @@ function healthFrom(input) {
|
|
|
3618
3586
|
}
|
|
3619
3587
|
/** The same facts as `conveno doctor`, as friendly rows. Never throws. */
|
|
3620
3588
|
async function loadSetup(ctx) {
|
|
3621
|
-
const
|
|
3589
|
+
const rows = await Promise.all(ctx.adapters.map((a) => inspect(ctx, a)));
|
|
3590
|
+
const chosen = new Set(await chosenTools(ctx));
|
|
3591
|
+
const connected = new Set(await connectedTools(ctx));
|
|
3592
|
+
const clis = rows.map((r) => {
|
|
3593
|
+
const check = checkFromRow(r, ctx.compat);
|
|
3594
|
+
return {
|
|
3595
|
+
...check,
|
|
3596
|
+
chosen: chosen.has(r.adapter.cli),
|
|
3597
|
+
...connected.has(r.adapter.cli) ? { connected: true } : {},
|
|
3598
|
+
...check.status === "not-installed" && connected.has(r.adapter.cli) ? { note: "connected, but the program is not on this computer" } : {}
|
|
3599
|
+
};
|
|
3600
|
+
});
|
|
3622
3601
|
let daemon = "stopped";
|
|
3623
3602
|
let sync;
|
|
3624
3603
|
try {
|
|
@@ -3681,7 +3660,7 @@ async function planFor(ctx, fixId) {
|
|
|
3681
3660
|
installed: false,
|
|
3682
3661
|
configPaths: []
|
|
3683
3662
|
}));
|
|
3684
|
-
if (detection.installed) found.push({
|
|
3663
|
+
if (detection.installed || parsed.kind === "uninstall") found.push({
|
|
3685
3664
|
adapter,
|
|
3686
3665
|
detection
|
|
3687
3666
|
});
|
|
@@ -3768,31 +3747,25 @@ function setHelpers(ctx, on) {
|
|
|
3768
3747
|
const TOOL_NAMES = {
|
|
3769
3748
|
claude: "Claude Code",
|
|
3770
3749
|
codex: "Codex",
|
|
3771
|
-
copilot: "GitHub Copilot",
|
|
3772
3750
|
opencode: "OpenCode",
|
|
3773
3751
|
antigravity: "Antigravity",
|
|
3774
|
-
grok: "Grok Build"
|
|
3775
|
-
cursor: "Cursor"
|
|
3752
|
+
grok: "Grok Build"
|
|
3776
3753
|
};
|
|
3777
3754
|
/** The order the tools are listed in. */
|
|
3778
3755
|
const TOOL_ORDER = [
|
|
3779
3756
|
"claude",
|
|
3780
3757
|
"codex",
|
|
3781
|
-
"copilot",
|
|
3782
3758
|
"opencode",
|
|
3783
3759
|
"antigravity",
|
|
3784
|
-
"grok"
|
|
3785
|
-
"cursor"
|
|
3760
|
+
"grok"
|
|
3786
3761
|
];
|
|
3787
3762
|
/** Lowercase short names, as a person would say them in a sentence. */
|
|
3788
3763
|
const SHORT_NAMES = {
|
|
3789
3764
|
claude: "claude",
|
|
3790
3765
|
codex: "codex",
|
|
3791
|
-
copilot: "copilot",
|
|
3792
3766
|
opencode: "opencode",
|
|
3793
3767
|
antigravity: "antigravity",
|
|
3794
|
-
grok: "grok"
|
|
3795
|
-
cursor: "cursor"
|
|
3768
|
+
grok: "grok"
|
|
3796
3769
|
};
|
|
3797
3770
|
const toolName = (cli, fallback) => TOOL_NAMES[cli] ?? fallback ?? cli;
|
|
3798
3771
|
const WELCOME_LINES = ["Your AI coding tools, working as one team.", "One leads, the others pick up the work, even when idle."];
|
|
@@ -3801,12 +3774,11 @@ const updateQuestion = (name, major) => major ? `${name} needs version 2 to work
|
|
|
3801
3774
|
const SAMPLE_TASK = "write tests for the login page";
|
|
3802
3775
|
/**
|
|
3803
3776
|
* What each tool asks the first time it runs with Conveno, with the exact label to pick. The
|
|
3804
|
-
* labels are the tools' own: Codex's startup hook review (codex-rs tui startup_hooks_review.rs)
|
|
3805
|
-
*
|
|
3777
|
+
* labels are the tools' own: Codex's startup hook review (codex-rs tui startup_hooks_review.rs)
|
|
3778
|
+
* and Antigravity's command approval.
|
|
3806
3779
|
*/
|
|
3807
3780
|
const FIRST_RUN_APPROVALS = {
|
|
3808
3781
|
codex: "Codex: when it says \"Hooks need review\", choose \"Review hooks\" and trust only the ones that run `conveno hook codex`.",
|
|
3809
|
-
copilot: "Copilot: when it asks to launch \"user:conveno\", choose \"Yes, and always allow\". It asks once per folder.",
|
|
3810
3782
|
antigravity: "Antigravity: when it asks to run Conveno's helper, choose the \"always allow\" option that saves to settings."
|
|
3811
3783
|
};
|
|
3812
3784
|
// src/tui/onboarding/deps.ts
|
|
@@ -3824,7 +3796,7 @@ async function detectTools(ctx) {
|
|
|
3824
3796
|
const tools = await Promise.all((await detectAll(ctx)).map(async ({ adapter, detection }) => {
|
|
3825
3797
|
const cli = adapter.cli;
|
|
3826
3798
|
const known = KNOWN.has(cli);
|
|
3827
|
-
const route = known ? installPlan(cli, ctx.platform
|
|
3799
|
+
const route = known ? installPlan(cli, ctx.platform) : {
|
|
3828
3800
|
installable: false,
|
|
3829
3801
|
hint: ""
|
|
3830
3802
|
};
|
|
@@ -3839,8 +3811,7 @@ async function detectTools(ctx) {
|
|
|
3839
3811
|
...o.defaultYes ? { defaultYes: true } : {}
|
|
3840
3812
|
});
|
|
3841
3813
|
}
|
|
3842
|
-
|
|
3843
|
-
if (detection.installed) connected = await adapter.plan(env, {}).then((p) => p.length === 0).catch(() => false);
|
|
3814
|
+
const connected = await adapter.plan(env, {}).then((p) => p.length === 0).catch(() => false);
|
|
3844
3815
|
const major = Number.parseInt((detection.version ?? "").replace(/^v/i, ""), 10) < 2;
|
|
3845
3816
|
return {
|
|
3846
3817
|
cli,
|
|
@@ -3868,7 +3839,7 @@ const installIo = (ctx) => ({
|
|
|
3868
3839
|
});
|
|
3869
3840
|
async function installTool(ctx, cli, io) {
|
|
3870
3841
|
const name = toolName(cli);
|
|
3871
|
-
const plan = installPlan(cli, ctx.platform
|
|
3842
|
+
const plan = installPlan(cli, ctx.platform);
|
|
3872
3843
|
if (!plan.installable) return {
|
|
3873
3844
|
ok: false,
|
|
3874
3845
|
reason: plan.hint
|
|
@@ -3929,11 +3900,9 @@ const accountIo = (ctx) => ({
|
|
|
3929
3900
|
const PROCESS_NAMES = {
|
|
3930
3901
|
claude: "claude",
|
|
3931
3902
|
codex: "codex",
|
|
3932
|
-
copilot: "copilot",
|
|
3933
3903
|
opencode: "opencode",
|
|
3934
3904
|
antigravity: "agy",
|
|
3935
|
-
grok: "grok"
|
|
3936
|
-
cursor: "cursor-agent"
|
|
3905
|
+
grok: "grok"
|
|
3937
3906
|
};
|
|
3938
3907
|
/** Names of the programs running now, lowercase, without folders or `.exe`. */
|
|
3939
3908
|
async function runningNames(ctx) {
|
|
@@ -3963,8 +3932,9 @@ function createOnboardingDeps(ctx) {
|
|
|
3963
3932
|
update: (cli, io) => updateTool(ctx, cli, io),
|
|
3964
3933
|
connect: (cli, accept, io) => changeTool(ctx, cli, fixIdWith(cli, accept), "connect", io),
|
|
3965
3934
|
disconnect: (cli, io) => changeTool(ctx, cli, `uninstall:${cli}`, "remove Conveno from", io),
|
|
3966
|
-
|
|
3967
|
-
|
|
3935
|
+
chosen: () => chosenTools(ctx),
|
|
3936
|
+
saveChoice: async (tools, lead) => {
|
|
3937
|
+
saveChoice(ctx, tools, lead);
|
|
3968
3938
|
},
|
|
3969
3939
|
signedIn: async () => await readAccountTokens(tokenFile(ctx)).catch(() => null) !== null,
|
|
3970
3940
|
signIn: async ({ signal, onCode }) => {
|
|
@@ -4175,14 +4145,12 @@ const pushLog = (r, lines) => ({
|
|
|
4175
4145
|
function reduce(s, a) {
|
|
4176
4146
|
switch (a.type) {
|
|
4177
4147
|
case "loaded": {
|
|
4178
|
-
const
|
|
4179
|
-
const connected = a.tools.filter((t) => t.connected);
|
|
4180
|
-
const initial = s.start === "tools" && connected.length > 0 ? connected : installed;
|
|
4148
|
+
const known = new Set(a.tools.map((t) => t.cli));
|
|
4181
4149
|
return {
|
|
4182
4150
|
...s,
|
|
4183
4151
|
tools: a.tools,
|
|
4184
4152
|
signedIn: a.signedIn,
|
|
4185
|
-
picked:
|
|
4153
|
+
picked: a.chosen.filter((c) => known.has(c))
|
|
4186
4154
|
};
|
|
4187
4155
|
}
|
|
4188
4156
|
case "begin": return s.step === "welcome" && s.tools ? {
|
|
@@ -4459,7 +4427,8 @@ function Line({ tone, children }) {
|
|
|
4459
4427
|
const list = (names) => names.length <= 1 ? names[0] ?? "" : `${names.slice(0, -1).join(", ")} and ${names[names.length - 1]}`;
|
|
4460
4428
|
function toolHint(t) {
|
|
4461
4429
|
const parts = [];
|
|
4462
|
-
if (!t.installed) parts.push(
|
|
4430
|
+
if (!t.installed && t.connected) parts.push("already connected · not on this computer");
|
|
4431
|
+
else if (!t.installed) parts.push(t.installable ? "not installed · I can install it" : "not installed");
|
|
4463
4432
|
else if (t.connected) parts.push("already connected");
|
|
4464
4433
|
else parts.push("on this computer");
|
|
4465
4434
|
if (t.installed && t.update) parts.push("needs an update");
|
|
@@ -4771,18 +4740,12 @@ function tryLine(s) {
|
|
|
4771
4740
|
return s.signedIn ? `Open ${name} as usual. It can now reach your other computers.` : `Open ${name} as usual. Add more tools any time with conveno setup.`;
|
|
4772
4741
|
}
|
|
4773
4742
|
/**
|
|
4774
|
-
* The one-time approvals the connected tools will ask for.
|
|
4775
|
-
* when its idle wake is on: accepted now, or already on (then it is not among the open options).
|
|
4743
|
+
* The one-time approvals the connected tools will ask for.
|
|
4776
4744
|
*/
|
|
4777
4745
|
function firstRunApprovals(s) {
|
|
4778
4746
|
return connectedRows(s).flatMap((r) => {
|
|
4779
4747
|
const note = FIRST_RUN_APPROVALS[r.cli];
|
|
4780
4748
|
if (!note || r.approved === true) return [];
|
|
4781
|
-
if (r.cli === "copilot") {
|
|
4782
|
-
const pending = (s.tools?.find((t) => t.cli === "copilot"))?.options.some((o) => o.id === "copilot-idle-wake") ?? false;
|
|
4783
|
-
const accepted = s.answers["option:copilot:copilot-idle-wake"] === true;
|
|
4784
|
-
if (pending && !accepted) return [];
|
|
4785
|
-
}
|
|
4786
4749
|
return [note];
|
|
4787
4750
|
});
|
|
4788
4751
|
}
|
|
@@ -4841,18 +4804,27 @@ function Onboarding({ deps, start, onDone }) {
|
|
|
4841
4804
|
}, []);
|
|
4842
4805
|
useEffect(() => {
|
|
4843
4806
|
const d = depsRef.current;
|
|
4844
|
-
Promise.all([
|
|
4807
|
+
Promise.all([
|
|
4808
|
+
d.detect(),
|
|
4809
|
+
d.signedIn().catch(() => false),
|
|
4810
|
+
d.chosen().catch(() => [])
|
|
4811
|
+
]).then(([tools, signedIn, chosen]) => {
|
|
4845
4812
|
if (live.current) dispatch({
|
|
4846
4813
|
type: "loaded",
|
|
4847
4814
|
tools,
|
|
4848
|
-
signedIn
|
|
4815
|
+
signedIn,
|
|
4816
|
+
chosen
|
|
4849
4817
|
});
|
|
4850
4818
|
});
|
|
4851
4819
|
}, []);
|
|
4852
4820
|
useEffect(() => {
|
|
4853
|
-
if (s.step !== "
|
|
4821
|
+
if (s.step !== "account" && s.step !== "finish") return;
|
|
4822
|
+
if (led.current) return;
|
|
4854
4823
|
led.current = true;
|
|
4855
|
-
|
|
4824
|
+
const tools = connectedRows(s).map((r) => r.cli);
|
|
4825
|
+
if (tools.length === 0) return;
|
|
4826
|
+
const lead = s.lead && tools.includes(s.lead) ? s.lead : void 0;
|
|
4827
|
+
depsRef.current.saveChoice(tools, lead).catch(() => {});
|
|
4856
4828
|
}, [s]);
|
|
4857
4829
|
useEffect(() => {
|
|
4858
4830
|
if (s.step !== "working") return;
|