@conveno/cli 0.2.0-rc.16 → 0.2.0-rc.18

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.
@@ -1,5 +1,5 @@
1
1
  import { appendFileSync } from "node:fs";
2
- import { C as appendHookLog, st as hookLogLine } from "./dist-DnWOZkAu.js";
2
+ import { ut as hookLogLine, w as appendHookLog } from "./dist-CSSvrcKr.js";
3
3
  import { n as connectOpts } from "./ctx-tYftvhz_.js";
4
4
  // src/hook.ts
5
5
  /**
@@ -140,7 +140,7 @@ async function runHook(ctx, argv) {
140
140
  hostPid ??= (async () => {
141
141
  const t = Date.now();
142
142
  try {
143
- const pid = await findHostPid(ctx, connected, adapter.cli, () => early ?? ctx.ancestry(1200));
143
+ const pid = await findHostPid(ctx, connected, adapter.cli, () => early ?? ctx.ancestry(HOOK_ANCESTRY_TIMEOUT_MS));
144
144
  if (pid === void 0) hostMissing = true;
145
145
  return pid;
146
146
  } finally {
@@ -1,13 +1,13 @@
1
1
  import { homedir } from "node:os";
2
- import { n as antigravityAdapter } from "./dist-XoKXwG-y.js";
2
+ import { n as connect } from "./dist-DAVtixeC.js";
3
+ import { $ as endTurnContinuation, Bt as pendingTurn, G as dataDir, K as dataPaths, Mn as waitForWorkBatch, Nt as ownSession, Pt as parseCliVersion, Xt as readAncestry, cn as requeueMessages, dt as hookLogPath, ft as hostAlive, i as CLI_DESCRIPTORS, jn as waitForWork, n as CLAUDE_PENDING_TURN_FOLDER, tn as readSettings, xn as startTurnContext, zt as pendingHookContext } from "./dist-CSSvrcKr.js";
4
+ import { n as antigravityAdapter } from "./dist-D6Xoip5W.js";
3
5
  import { isAbsolute, join } from "node:path";
4
- import { At as parseCliVersion, Ft as pendingHookContext, H as dataDir, It as pendingTurn, Kt as readAncestry, Tn as waitForWorkBatch, U as dataPaths, X as endTurnContinuation, Zt as readSettings, ct as hookLogPath, kt as ownSession, lt as hostAlive, mn as startTurnContext, r as CLAUDE_PENDING_TURN_FOLDER, rn as requeueMessages, wn as waitForWork } from "./dist-DnWOZkAu.js";
5
6
  import { readFile } from "node:fs/promises";
6
7
  import { applyEdits, modify, parse, printParseErrorCode } from "jsonc-parser";
7
- import { t as codexAdapter } from "./dist-X1bpJWck.js";
8
- import { t as grokAdapter } from "./dist-BqfYxlVP.js";
9
- import { n as connect } from "./dist-Ch3ohbIk.js";
10
- import { t as runHook } from "./hook-DHMu72Vf.js";
8
+ import { t as codexAdapter } from "./dist-DTMnNySx.js";
9
+ import { t as grokAdapter } from "./dist-CFsDqevs.js";
10
+ import { t as runHook } from "./hook-BA-tI6Oc.js";
11
11
  // ../adapters/claude/dist/index.js
12
12
  const isObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
13
13
  /** Read a JSON object file. Missing or blank files give `{}`; anything else that is not a JSON object throws. */
@@ -176,7 +176,7 @@ function hookProgram(env, event) {
176
176
  /** One hook handler as written to settings.json. The listener runs in the background (`asyncRewake`). */
177
177
  function handlerFor(env, arg) {
178
178
  const { command, args } = hookProgram(env, arg);
179
- return arg === "Listen" ? {
179
+ return arg === LISTEN_EVENT ? {
180
180
  type: "command",
181
181
  command,
182
182
  args,
@@ -229,7 +229,7 @@ function hasExactHook(hooks, event, handler) {
229
229
  /** Every handler Conveno wants on `event` is there, exactly. */
230
230
  const eventComplete = (env, hooks, event) => HANDLERS[event].every((arg) => hasExactHook(hooks, event, handlerFor(env, arg)));
231
231
  /** The name `conveno doctor --verbose` shows for one event. Start and Stop also arm the listener. */
232
- const hookPartName = (e) => HANDLERS[e].includes("Listen") ? `${e} hook and listener` : `${e} hook`;
232
+ const hookPartName = (e) => HANDLERS[e].includes(LISTEN_EVENT) ? `${e} hook and listener` : `${e} hook`;
233
233
  const hasOurHandler = (g) => isObject(g) && Array.isArray(g.hooks) && g.hooks.some(isOurHook);
234
234
  /** Drop our hook handlers (and groups left empty by that). */
235
235
  function stripOurHooks(groups) {
@@ -1271,17 +1271,26 @@ function delivery(detection) {
1271
1271
  idleWake: supported
1272
1272
  };
1273
1273
  }
1274
- const opencodeAdapter = {
1275
- cli: "opencode",
1276
- displayName: "OpenCode",
1277
- deliveryTier: "inbox",
1278
- detect,
1279
- plan,
1280
- uninstallPlan,
1281
- hook,
1282
- listenEvents: ["Listen"],
1283
- delivery
1274
+ // src/adapters.ts
1275
+ const ADAPTERS = {
1276
+ claude: claudeAdapter,
1277
+ codex: codexAdapter,
1278
+ opencode: {
1279
+ cli: "opencode",
1280
+ displayName: "OpenCode",
1281
+ deliveryTier: "inbox",
1282
+ detect,
1283
+ plan,
1284
+ uninstallPlan,
1285
+ hook,
1286
+ listenEvents: ["Listen"],
1287
+ delivery
1288
+ },
1289
+ antigravity: antigravityAdapter,
1290
+ grok: grokAdapter
1284
1291
  };
1292
+ /** The adapters in the order the descriptors list the CLIs. */
1293
+ const adapterList = () => CLI_DESCRIPTORS.map((d) => ADAPTERS[d.id]);
1285
1294
  // src/hook-entry.ts
1286
1295
  function readAllStdin() {
1287
1296
  if (process.stdin.isTTY) return Promise.resolve("");
@@ -1310,13 +1319,7 @@ function createHookCtx() {
1310
1319
  return {
1311
1320
  dataDir: data,
1312
1321
  ...process.env.CONVENO_HOOK_LOG === "0" ? {} : { hookLog: hookLogPath(data) },
1313
- adapters: [
1314
- claudeAdapter,
1315
- codexAdapter,
1316
- opencodeAdapter,
1317
- antigravityAdapter,
1318
- grokAdapter
1319
- ],
1322
+ adapters: adapterList(),
1320
1323
  out: (s) => void process.stdout.write(s),
1321
1324
  err: (s) => void process.stderr.write(s),
1322
1325
  readStdin: readAllStdin,
@@ -1340,4 +1343,4 @@ function createHookCtx() {
1340
1343
  function runHookEntry(argv) {
1341
1344
  return runHook(createHookCtx(), argv);
1342
1345
  }
1343
- export { opencodeAdapter as a, runHookEntry as i, isProcessAlive as n, claudeAdapter as o, readAllStdin as r, createHookCtx as t };
1346
+ export { adapterList as a, runHookEntry as i, isProcessAlive as n, readAllStdin as r, createHookCtx as t };
@@ -0,0 +1 @@
1
+ export { i as runHookEntry } from "./hook-entry-BwzBtAnd.js";
@@ -1,13 +1,13 @@
1
- import { $t as realSpawnDeps, N as cleanModelName, Nt as parseWorkerAccess, U as dataPaths, d as SPAWN_CLIS, f as SPAWN_TABLE, jn as CLI_KINDS, m as WORKER_ACCESS, p as SpawnError, pn as spawnSession, sn as runLaunchFile } from "./dist-DnWOZkAu.js";
2
- import { A as runRelay, I as runAccount, L as runLogin, M as runDaemon, P as VERSION, R as runLogout, b as workerAccessLine, i as runDoctor, k as runDevices, m as runSetup, p as runInit, t as runUninstall } from "./uninstall-jwneyeJm.js";
1
+ import { K as dataPaths, Lt as parseWorkerAccess, P as cleanModelName, bn as spawnSession, f as SPAWN_CLIS, h as WORKER_ACCESS, m as SpawnError, p as SPAWN_TABLE, pn as runLaunchFile, rn as realSpawnDeps, zn as CLI_KINDS } from "./dist-CSSvrcKr.js";
2
+ import { A as runRelay, I as runAccount, L as runLogin, M as runDaemon, P as VERSION, R as runLogout, b as workerAccessLine, i as runDoctor, k as runDevices, m as runSetup, p as runInit, t as runUninstall } from "./uninstall-01_NStQ4.js";
3
3
  import { a as parseFlags, i as commandHelp, n as COMMANDS, r as COMMAND_NAMES, t as ALL_COMMAND_NAMES } from "./args-CtyKPZuN.js";
4
- import { t as daemonProblem } from "./daemonError-DUP5zkiR.js";
4
+ import { t as daemonProblem } from "./daemonError-CDgEtvy7.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-DHMu72Vf.js";
8
+ import { t as runHook } from "./hook-BA-tI6Oc.js";
9
9
  import { n as connectOpts, t as adapterEnv } from "./ctx-tYftvhz_.js";
10
- import { t as findSession } from "./pick-UDFASnAn.js";
10
+ import { t as findSession } from "./pick-BsMvXuDo.js";
11
11
  import { readFileSync } from "node:fs";
12
12
  // src/errorLog.ts
13
13
  /** The message of an unexpected error, as it is. Not the softened text `plainError` gives. */
@@ -490,6 +490,7 @@ function relaySummary(r) {
490
490
  case "connecting": return "connecting";
491
491
  case "disconnected": return "not connected, trying again";
492
492
  case "revoked": return "off, this device was removed";
493
+ case "upgrade_required": return "off, Conveno needs an update";
493
494
  case "unpaired": return "off, no paired devices";
494
495
  default: return "off";
495
496
  }
@@ -520,6 +521,10 @@ async function runStatus(ctx, argv = []) {
520
521
  "connecting",
521
522
  "disconnected"
522
523
  ].includes(relay.state)) ctx.out(` Your other devices: ${relaySummary(relay)}\n`);
524
+ else if (relay?.state === "upgrade_required") {
525
+ ctx.out(` Your other devices: ${relaySummary(relay)}\n`);
526
+ if (relay.detail) ctx.out(` ${relay.detail}\n`);
527
+ }
523
528
  if (sessions.length === 0) {
524
529
  ctx.out(`\nNo sessions yet. Open an AI tool you have connected with ${cmd(t, "conveno setup")} and it appears here.\n`);
525
530
  return 0;
@@ -604,11 +609,11 @@ async function dispatch(name, rest, ctx) {
604
609
  case "rename": return runRename(ctx, rest);
605
610
  case "lead": return runLead(ctx, rest);
606
611
  case "spawn": return runSpawn(ctx, rest);
607
- case "acp-host": return (await import("./acp-BtwJHwcr.js")).runAcpHostCmd(ctx, rest);
608
- case "stop": return (await import("./acp-BtwJHwcr.js")).runStop(ctx, rest);
612
+ case "acp-host": return (await import("./acp-CFIh624o.js")).runAcpHostCmd(ctx, rest);
613
+ case "stop": return (await import("./acp-CFIh624o.js")).runStop(ctx, rest);
609
614
  case "spawn-run": return runSpawnRun(ctx, rest);
610
- case "agy-relay": return (await import("./agy-relay-KS1DbLqD.js")).runAgyRelay(ctx, rest);
611
- case "watch": return (await import("./watch-Cpp4Uwsd.js")).runWatch(ctx, rest);
615
+ case "agy-relay": return (await import("./agy-relay-BZ3d_-FS.js")).runAgyRelay(ctx, rest);
616
+ case "watch": return (await import("./watch-BIepRTXJ.js")).runWatch(ctx, rest);
612
617
  case "devices": return runDevices(ctx, rest);
613
618
  case "relay": return runRelay(ctx, rest);
614
619
  case "doctor": return runDoctor(ctx, rest);
@@ -647,7 +652,7 @@ function opensApp(env, tty = {
647
652
  async function main(argv, ctx) {
648
653
  const [command, ...rest] = argv;
649
654
  if (command === void 0 && opensApp(ctx.env)) try {
650
- return await (await import("./run-B-UMVEQs.js")).runTui(ctx);
655
+ return await (await import("./run-BtYGSOMi.js")).runTui(ctx);
651
656
  } catch (e) {
652
657
  ctx.err(`The app could not start (${rawMessage(e)}). Showing the help instead.\n`);
653
658
  ctx.out(helpText(ctx));
@@ -1,4 +1,4 @@
1
- import { Kn as SessionId } from "./dist-DnWOZkAu.js";
1
+ import { tr as SessionId } from "./dist-CSSvrcKr.js";
2
2
  // src/pick.ts
3
3
  /** The online session a name or id means, or undefined when nothing matches. */
4
4
  async function findSession(client, text) {
@@ -1,11 +1,11 @@
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 { C as saveChoice, D as warmAcpAdapters, E as unifiedDiff, F as openInBrowser, N as stopDaemonIfRunning, O as PAIR_TIMEOUT_MS, S as connectedTools, T as applyChanges, _ as readWorkerAccess, a as applyOptions, c as collectPlans, d as refreshManifest, f as renewedApprovals, g as UNANSWERED_TEXT, h as ACCESS_TEXT, j as replaceStaleDaemon, l as detectAll, n as inspect, o as approvalWrites, r as partState, s as approvedBySetup, t as runUninstall, u as pendingOptions, v as saveWorkerAccess, w as StaleError, x as chosenTools, y as waitText, z as showCode$1 } from "./uninstall-jwneyeJm.js";
4
- import { t as daemonProblem } from "./daemonError-DUP5zkiR.js";
3
+ import { C as saveChoice, D as warmAcpAdapters, E as unifiedDiff, F as openInBrowser, N as stopDaemonIfRunning, O as PAIR_TIMEOUT_MS, S as connectedTools, T as applyChanges, _ as readWorkerAccess, a as applyOptions, c as collectPlans, d as refreshManifest, f as renewedApprovals, g as UNANSWERED_TEXT, h as ACCESS_TEXT, j as replaceStaleDaemon, l as detectAll, n as inspect, o as approvalWrites, r as partState, s as approvedBySetup, t as runUninstall, u as pendingOptions, v as saveWorkerAccess, w as StaleError, x as chosenTools, y as waitText, z as showCode$1 } from "./uninstall-01_NStQ4.js";
4
+ import { t as daemonProblem } from "./daemonError-CDgEtvy7.js";
5
5
  import { a as fail, n as cmd, s as plainError, u as tilde } from "./fmt-C2SsP5Y0.js";
6
6
  import { createContext, useCallback, useContext, useEffect, useImperativeHandle, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
7
- import { $ as fetchAccountStatus, $t as realSpawnDeps, An as writeSettings, G as defaultProcessIo, Gn as SESSION_NAME_PATTERN, Gt as readAccountTokens, Ht as pollDeviceCode, L as compatStatus, R as completeLogin, St as logoutAccount, Tt as modelLabel, U as dataPaths, Vt as planSpawn, Xt as readProcessList, Yt as readModelMenus, Zt as readSettings, f as SPAWN_TABLE, g as WORKER_UNANSWERED, h as WORKER_ASK_TIMEOUT_CHOICES, kn as writeModelMenu, m as WORKER_ACCESS, n as AccountError, pn as spawnSession, sr as sanitizeLine, tn as requestDeviceCode, tt as findOnPath } from "./dist-DnWOZkAu.js";
8
- import { i as tokens, n as detectColorLevel, r as detectUnicode } from "./dist-CkqMgCGl.js";
7
+ import { $t as readModelMenus, B as compatStatus, Et as logoutAccount, Gt as planSpawn, In as writeModelMenu, J as defaultProcessIo, K as dataPaths, Kt as pollDeviceCode, Rn as writeSettings, Tt as loginAccountApi, V as completeLogin, Yt as readAccountTokens, _ as WORKER_UNANSWERED, _n as signedInAccountApi, bn as spawnSession, en as readProcessList, er as SESSION_NAME_PATTERN, g as WORKER_ASK_TIMEOUT_CHOICES, gr as sanitizeLine, h as WORKER_ACCESS, i as CLI_DESCRIPTORS, it as findOnPath, kt as modelLabel, nt as fetchAccountStatus, on as requestDeviceCode, p as SPAWN_TABLE, r as CLIS, rn as realSpawnDeps, t as AccountError, tn as readSettings } from "./dist-CSSvrcKr.js";
8
+ import { i as tokens, n as detectColorLevel, r as detectUnicode } from "./dist-BOwFdixw.js";
9
9
  import stringWidth from "string-width";
10
10
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
11
  import { readFileSync, statSync } from "node:fs";
@@ -13,7 +13,7 @@ import { Readable } from "node:stream";
13
13
  import { basename, posix, win32 } from "node:path";
14
14
  import { spawn } from "node:child_process";
15
15
  import { homedir } from "node:os";
16
- import { n as probeModelMenu } from "./dist-DVLAWfDg.js";
16
+ import { n as probeModelMenu } from "./dist-B7liMhCw.js";
17
17
  // src/tui/home/deps.ts
18
18
  /**
19
19
  * What home does outside the store: sign in and out, and take Conveno away. Real in the app, fake
@@ -24,7 +24,7 @@ const showCode = (code) => /^[A-Za-z0-9]{8}$/.test(code) ? `${code.slice(0, 4)}-
24
24
  const strip = (text) => text.replace(/\u001b\[[0-9;]*m/g, "");
25
25
  function createHomeDeps(ctx) {
26
26
  const io = () => ({
27
- apiBase: ctx.env.CONVENO_API_URL || "https://api.conveno.dev",
27
+ apiBase: loginAccountApi(ctx.env),
28
28
  now: () => ctx.now().getTime()
29
29
  });
30
30
  const tokenFile = () => dataPaths(ctx.platform, ctx.dataDir).account;
@@ -742,6 +742,21 @@ function KeyBar({ keys, width }) {
742
742
  }, h.k + h.label))
743
743
  });
744
744
  }
745
+ // src/tui/kit/overlay.tsx
746
+ /**
747
+ * Drawing over the screen, and the size of the detail panel.
748
+ *
749
+ * `Overlay` puts its children at a position over whatever is drawn under it (Ink 8 has
750
+ * `position="absolute"`) and blanks the cells it covers first, so nothing shows through.
751
+ *
752
+ * The detail panel is docked on the right at `xwide` (the screen gives it a column); below that
753
+ * it opens as a dialog.
754
+ */
755
+ /**
756
+ * A background colour Ink does not know. Ink fills the box with plain spaces for it and emits no
757
+ * colour code, which blanks the area even with colour off.
758
+ */
759
+ const BLANK = "blank";
745
760
  function Overlay({ top, left, width, height, maxHeight, background, children }) {
746
761
  return /* @__PURE__ */ jsx(Box, {
747
762
  position: "absolute",
@@ -750,7 +765,7 @@ function Overlay({ top, left, width, height, maxHeight, background, children })
750
765
  width,
751
766
  flexDirection: "column",
752
767
  overflow: "hidden",
753
- ...background === "none" ? {} : { backgroundColor: background ?? "blank" },
768
+ ...background === "none" ? {} : { backgroundColor: background ?? BLANK },
754
769
  ...height !== void 0 ? { height } : {},
755
770
  ...maxHeight !== void 0 ? { maxHeight } : {},
756
771
  children
@@ -929,6 +944,8 @@ function TitledBox({ width, height, grow, title, label, focused, boxed = true, c
929
944
  */
930
945
  const TOO_NARROW = "Make the window a bit wider";
931
946
  const TOO_SHORT = "Make the window a bit taller";
947
+ const DEFAULT_COLUMNS = 80;
948
+ const DEFAULT_ROWS = 24;
932
949
  const known = (n) => typeof n === "number" && Number.isFinite(n) && n > 0;
933
950
  /**
934
951
  * Read the terminal's size. A window that is not sized yet reports 0 or nothing: that is "unknown",
@@ -936,7 +953,7 @@ const known = (n) => typeof n === "number" && Number.isFinite(n) && n > 0;
936
953
  */
937
954
  function readSize(tty, prev) {
938
955
  return {
939
- columns: known(tty.columns) ? Math.floor(tty.columns) : prev?.columns ?? 80,
956
+ columns: known(tty.columns) ? Math.floor(tty.columns) : prev?.columns ?? DEFAULT_COLUMNS,
940
957
  rows: known(tty.rows) ? Math.floor(tty.rows) : prev?.rows,
941
958
  known: known(tty.columns) && known(tty.rows)
942
959
  };
@@ -998,7 +1015,7 @@ function useViewport() {
998
1015
  const { columns, rows } = useTerminalSize();
999
1016
  return {
1000
1017
  columns,
1001
- rows: rows ?? 24,
1018
+ rows: rows ?? DEFAULT_ROWS,
1002
1019
  breakpoint: breakpointOf(columns)
1003
1020
  };
1004
1021
  }
@@ -1678,10 +1695,18 @@ function HeaderBar({ width, middle, counts = [], keep = 2 }) {
1678
1695
  ]
1679
1696
  });
1680
1697
  }
1698
+ // src/tui/kit/ticker.tsx
1699
+ /**
1700
+ * One shared clock for every animation in the kit. A ticker is a tiny store (`get`, `subscribe`).
1701
+ * The real one fires every 80 ms and only runs while something listens. Tests pass a manual one
1702
+ * and call `step()`. With motion off, `useTick` returns `FINAL_TICK` so every animation shows its
1703
+ * last frame and nothing re-renders.
1704
+ */
1705
+ const TICK_MS = 80;
1681
1706
  /** What `useTick` returns when motion is off. Animations clamp to their own last frame. */
1682
1707
  const FINAL_TICK = 1e9;
1683
1708
  /** The real clock: one interval shared by everything, started by the first listener. */
1684
- function createIntervalTicker(ms = 80) {
1709
+ function createIntervalTicker(ms = TICK_MS) {
1685
1710
  let n = 0;
1686
1711
  let timer;
1687
1712
  const subs = /* @__PURE__ */ new Set();
@@ -2023,8 +2048,23 @@ function Steps({ rows, width }) {
2023
2048
  })
2024
2049
  });
2025
2050
  }
2051
+ // src/tui/kit/table.tsx
2052
+ /**
2053
+ * A one-row-per-item table. Columns have a minimum and an ideal width and a priority: when the
2054
+ * width is short, the column with the highest `drop` number goes first, then the rest share what
2055
+ * is left (ideal widths first, `eager` columns before the rest, then `grow` columns take the
2056
+ * remainder). Cells are cut with `…` by
2057
+ * terminal cells, so wide characters line up. The selected row gets a `›` marker and the
2058
+ * highlight. Heading rows (`heading(row)` returns text) span the whole width, for groups like
2059
+ * `this computer`. A click selects a row, a click on the selected row or a double-click opens it,
2060
+ * and the wheel moves the selection.
2061
+ */
2062
+ /** Cells between columns. */
2063
+ const COL_GAP = 2;
2064
+ /** Cells of the `› ` marker in front of every row. */
2065
+ const MARKER_W = 2;
2026
2066
  /** Which columns show at `width`, and how wide each one is. The widths plus gaps fit exactly. */
2027
- function placeColumns(columns, width, gap = 2) {
2067
+ function placeColumns(columns, width, gap = COL_GAP) {
2028
2068
  let cols = [...columns];
2029
2069
  const need = (cs) => cs.reduce((a, c) => a + c.min, 0) + gap * Math.max(0, cs.length - 1);
2030
2070
  while (cols.length > 1 && need(cols) > width) {
@@ -2138,12 +2178,12 @@ function flattenTree(items, idOf, parentOf) {
2138
2178
  }
2139
2179
  function Table({ columns, rows, width, height, selected = -1, keyOf, heading, heads = true, marker = true, onSelect, onActivate, isActive }) {
2140
2180
  const k = useKit();
2141
- const mw = marker ? 2 : 0;
2181
+ const mw = marker ? MARKER_W : 0;
2142
2182
  const placed = placeColumns(columns, Math.max(1, width - mw));
2143
2183
  const showHeads = heads && placed.some((p) => p.col.head);
2144
2184
  const bodyH = Math.max(1, (height ?? rows.length + 1) - (showHeads ? 1 : 0));
2145
2185
  const pointer = k.ascii ? ">" : "›";
2146
- const line = (cells) => /* @__PURE__ */ jsx(Fragment, { children: cells.map((c, i) => /* @__PURE__ */ jsxs(Text, { children: [i > 0 ? " ".repeat(2) : "", c] }, i)) });
2186
+ const line = (cells) => /* @__PURE__ */ jsx(Fragment, { children: cells.map((c, i) => /* @__PURE__ */ jsxs(Text, { children: [i > 0 ? " ".repeat(COL_GAP) : "", c] }, i)) });
2147
2187
  const renderRow = (row, isSel) => {
2148
2188
  const head = heading?.(row);
2149
2189
  const bg = isSel && k.c.select ? { backgroundColor: k.c.select } : {};
@@ -2193,7 +2233,7 @@ function Table({ columns, rows, width, height, selected = -1, keyOf, heading, he
2193
2233
  children: [" ".repeat(mw), placed.map(({ col, width: w }) => padCells((col.head ?? "").toUpperCase(), w, {
2194
2234
  ascii: k.ascii,
2195
2235
  align: col.align ?? "left"
2196
- })).join(" ".repeat(2))]
2236
+ })).join(" ".repeat(COL_GAP))]
2197
2237
  }) : null, /* @__PURE__ */ jsx(ScrollList, {
2198
2238
  items: [...rows],
2199
2239
  selected,
@@ -2253,15 +2293,10 @@ function Toast({ text, tone, width, onDone }) {
2253
2293
  });
2254
2294
  }
2255
2295
  // src/tui/names.ts
2256
- const TOOL_NAMES$1 = {
2257
- claude: "Claude Code",
2258
- codex: "Codex",
2259
- opencode: "OpenCode",
2260
- antigravity: "Antigravity",
2261
- grok: "Grok Build"
2262
- };
2296
+ /** How the app names tools and sessions on screen. No Ink or React in here: the store uses it. */
2297
+ const TOOL_NAMES = Object.fromEntries(CLI_DESCRIPTORS.map((d) => [d.id, d.name]));
2263
2298
  /** "Claude Code" for `claude`. An unknown id shows as it is. */
2264
- const toolName$1 = (cli) => TOOL_NAMES$1[cli] ?? cli;
2299
+ const toolName$1 = (cli) => TOOL_NAMES[cli] ?? cli;
2265
2300
  /** The tool a session runs in: "Antigravity app" for the desktop app, else `toolName`. */
2266
2301
  const sessionTool = (s) => s.variant === "app" && s.cli === "antigravity" ? "Antigravity app" : toolName$1(s.cli);
2267
2302
  /** The session's own name without the computer it runs on (`laptop:api-fix` is `api-fix`). */
@@ -3238,6 +3273,11 @@ function ComputersScreen({ store, deps, onBack }) {
3238
3273
  })
3239
3274
  })
3240
3275
  }),
3276
+ state.relay?.state === "upgrade_required" ? /* @__PURE__ */ jsx(Text, {
3277
+ wrap: "wrap",
3278
+ color: k.c.error,
3279
+ children: state.relay.detail ?? "Update Conveno to keep using your other computers."
3280
+ }) : null,
3241
3281
  state.devices?.conflict ? /* @__PURE__ */ jsx(Text, {
3242
3282
  wrap: "wrap",
3243
3283
  color: k.c.error,
@@ -4698,7 +4738,7 @@ function Home({ store, deps, size, onSetup, onQuit }) {
4698
4738
  ...remote > 0 ? [{ text: `${remote} on other computers` }] : []
4699
4739
  ];
4700
4740
  const relay = state.relay?.state;
4701
- const middle = state.connection === "daemon-down" ? "reconnecting…" : state.connection === "connecting" ? "connecting…" : state.connection === "error" ? "can't reach Conveno" : relay === "connected" ? "running · other computers connected" : relay === "connecting" || relay === "disconnected" ? "running · reaching other computers…" : "running";
4741
+ const middle = state.connection === "daemon-down" ? "reconnecting…" : state.connection === "connecting" ? "connecting…" : state.connection === "error" ? "can't reach Conveno" : relay === "connected" ? "running · other computers connected" : relay === "connecting" || relay === "disconnected" ? "running · reaching other computers…" : relay === "upgrade_required" ? "running · update Conveno to reach other computers" : "running";
4702
4742
  const keys = empty ? [
4703
4743
  {
4704
4744
  k: "a",
@@ -5051,6 +5091,7 @@ function depthOf(node) {
5051
5091
  for (let p = node.parentNode; p; p = p.parentNode) d++;
5052
5092
  return d;
5053
5093
  }
5094
+ const DOUBLE_CLICK_MS = 400;
5054
5095
  const ENABLE_SEQ = "\x1B[?1000h\x1B[?1006h";
5055
5096
  const DISABLE_SEQ = "\x1B[?1006l\x1B[?1002l\x1B[?1000l";
5056
5097
  /** Hit testing and dispatch. One per running app. */
@@ -5149,7 +5190,7 @@ var MouseHub = class {
5149
5190
  let double = false;
5150
5191
  if (e.button === "left") {
5151
5192
  const t = this.now();
5152
- double = this.last !== void 0 && this.last.x === e.x && this.last.y === e.y && t - this.last.t <= 400;
5193
+ double = this.last !== void 0 && this.last.x === e.x && this.last.y === e.y && t - this.last.t <= DOUBLE_CLICK_MS;
5153
5194
  this.last = double ? void 0 : {
5154
5195
  x: e.x,
5155
5196
  y: e.y,
@@ -5268,7 +5309,7 @@ function createMouseInput(ctx, real = process.stdin, out = process.stdout) {
5268
5309
  if (!usable) return {
5269
5310
  stdin: real,
5270
5311
  hub,
5271
- dispose: () => void 0
5312
+ dispose: () => {}
5272
5313
  };
5273
5314
  stream = new FilteredStdin(real, out, hub);
5274
5315
  const restore = () => {
@@ -5365,28 +5406,11 @@ function npmGlobal(platform, pkg) {
5365
5406
  }
5366
5407
  /** How to install `cli` on `platform`, or why Conveno cannot do it. Pure. */
5367
5408
  function installPlan(cli, platform) {
5368
- switch (cli) {
5369
- case "claude": return {
5370
- installable: true,
5371
- steps: [script(platform, "https://claude.ai/install.sh", "https://claude.ai/install.ps1")]
5372
- };
5373
- case "codex": return {
5374
- installable: true,
5375
- steps: [npmGlobal(platform, "@openai/codex")]
5376
- };
5377
- case "opencode": return {
5378
- installable: true,
5379
- steps: [npmGlobal(platform, "@opencode/cli")]
5380
- };
5381
- case "grok": return {
5382
- installable: true,
5383
- steps: [script(platform, "https://x.ai/cli/install.sh", "https://x.ai/cli/install.ps1")]
5384
- };
5385
- case "antigravity": return {
5386
- installable: true,
5387
- steps: [script(platform, "https://antigravity.google/cli/install.sh", "https://antigravity.google/cli/install.ps1")]
5388
- };
5389
- }
5409
+ const route = CLIS[cli].install.route;
5410
+ return {
5411
+ installable: true,
5412
+ steps: [route.kind === "script" ? script(platform, route.sh, route.ps) : npmGlobal(platform, route.package)]
5413
+ };
5390
5414
  }
5391
5415
  /**
5392
5416
  * Update route. No tool needs one now: any OpenCode 1.x or 2.x works, so nothing is offered. Kept
@@ -5559,13 +5583,6 @@ async function runInstall(cli, deps, onProgress) {
5559
5583
  };
5560
5584
  return runSteps(plan.steps, deps, onProgress);
5561
5585
  }
5562
- const BINARIES = {
5563
- claude: ["claude"],
5564
- codex: ["codex"],
5565
- opencode: ["opencode"],
5566
- grok: ["grok"],
5567
- antigravity: ["agy"]
5568
- };
5569
5586
  /** Run `npm prefix -g` and return its first output line. Undefined on any failure. */
5570
5587
  function npmPrefix(deps) {
5571
5588
  const plan = planSpawn(isWin(deps.platform) ? "npm.cmd" : "npm", ["prefix", "-g"], {
@@ -5604,18 +5621,19 @@ function npmPrefix(deps) {
5604
5621
  async function extraDirs(cli, deps) {
5605
5622
  const w = isWin(deps.platform);
5606
5623
  const p = w ? win32 : posix;
5607
- const local = p.join(deps.home, ".local", "bin");
5608
- switch (cli) {
5609
- case "claude": return [local];
5610
- case "antigravity": return w ? [p.join(deps.env.LOCALAPPDATA || p.join(deps.home, "AppData", "Local"), "agy", "bin")] : [local];
5611
- case "grok": return [p.join(deps.home, ".grok", "bin")];
5612
- case "codex":
5613
- case "opencode": {
5624
+ const out = [];
5625
+ const dirs = CLIS[cli].install.dirs;
5626
+ for (const dir of dirs) {
5627
+ if (dir.from === "npmPrefix") {
5614
5628
  const prefix = await npmPrefix(deps);
5615
- if (!prefix) return [];
5616
- return [w ? prefix : p.join(prefix, "bin")];
5629
+ if (prefix) out.push(w ? prefix : p.join(prefix, "bin"));
5630
+ continue;
5617
5631
  }
5632
+ if (dir.only && dir.only !== (w ? "win32" : "posix")) continue;
5633
+ const base = dir.from === "home" ? deps.home : deps.env.LOCALAPPDATA || p.join(deps.home, "AppData", "Local");
5634
+ out.push(p.join(base, ...dir.path));
5618
5635
  }
5636
+ return out;
5619
5637
  }
5620
5638
  /**
5621
5639
  * Where the CLI is after an install: first on the current PATH, then with PATH extended by the
@@ -5623,7 +5641,7 @@ async function extraDirs(cli, deps) {
5623
5641
  */
5624
5642
  async function findAfterInstall(cli, deps) {
5625
5643
  const search = (env) => {
5626
- for (const name of BINARIES[cli]) {
5644
+ for (const name of CLIS[cli].binaries) {
5627
5645
  const hit = findOnPath(name, env, deps.platform, deps.isFile);
5628
5646
  if (hit) return hit;
5629
5647
  }
@@ -5771,7 +5789,11 @@ async function loadSetup(ctx) {
5771
5789
  const relay = await client["relay.status"]({}).catch(() => void 0);
5772
5790
  if (relay) {
5773
5791
  if (relay.state === "connected") sync = "online";
5774
- else if (relay.state === "connecting" || relay.state === "disconnected") sync = "offline";
5792
+ else if ([
5793
+ "connecting",
5794
+ "disconnected",
5795
+ "upgrade_required"
5796
+ ].includes(relay.state)) sync = "offline";
5775
5797
  }
5776
5798
  } finally {
5777
5799
  await client.close().catch(() => void 0);
@@ -5906,30 +5928,10 @@ function setHelpers(ctx, on) {
5906
5928
  writeSettings(dataPaths(ctx.platform, ctx.dataDir).settings, { acpAdapterNpx: on });
5907
5929
  }
5908
5930
  // src/tui/onboarding/copy.ts
5909
- /** Display names. */
5910
- const TOOL_NAMES = {
5911
- claude: "Claude Code",
5912
- codex: "Codex",
5913
- opencode: "OpenCode",
5914
- antigravity: "Antigravity",
5915
- grok: "Grok Build"
5916
- };
5917
5931
  /** The order the tools are listed in. */
5918
- const TOOL_ORDER = [
5919
- "claude",
5920
- "codex",
5921
- "opencode",
5922
- "antigravity",
5923
- "grok"
5924
- ];
5932
+ const TOOL_ORDER = CLI_DESCRIPTORS.map((d) => d.id);
5925
5933
  /** Lowercase short names, as a person would say them in a sentence. */
5926
- const SHORT_NAMES = {
5927
- claude: "claude",
5928
- codex: "codex",
5929
- opencode: "opencode",
5930
- antigravity: "antigravity",
5931
- grok: "grok"
5932
- };
5934
+ const SHORT_NAMES = Object.fromEntries(CLI_DESCRIPTORS.map((d) => [d.id, d.shortName]));
5933
5935
  const toolName = (cli, fallback) => TOOL_NAMES[cli] ?? fallback ?? cli;
5934
5936
  const WELCOME_LINES = ["Your AI coding tools, working as one team.", "One leads, the others pick up the work, even when idle."];
5935
5937
  const installQuestion = (name) => `${name} isn't installed. Install it now? It takes about a minute.`;
@@ -6058,16 +6060,11 @@ async function changeTool(ctx, cli, fixId, failed, io) {
6058
6060
  }
6059
6061
  const tokenFile = (ctx) => dataPaths(ctx.platform, ctx.dataDir).account;
6060
6062
  const accountIo = (ctx) => ({
6061
- apiBase: ctx.env.CONVENO_API_URL || "https://api.conveno.dev",
6063
+ apiBase: loginAccountApi(ctx.env),
6062
6064
  now: () => ctx.now().getTime()
6063
6065
  });
6064
- const PROCESS_NAMES = {
6065
- claude: "claude",
6066
- codex: "codex",
6067
- opencode: "opencode",
6068
- antigravity: "agy",
6069
- grok: "grok"
6070
- };
6066
+ /** The name of a CLI's window process: its first binary (`agy` for Antigravity). */
6067
+ const processName = (cli) => CLIS[cli].binaries[0] ?? cli;
6071
6068
  /** Words in a command line that mark a background server, helper or protocol process, not a window. */
6072
6069
  const SERVER_ARGS = /(?:^|\s)(?:app-server|serve|daemon|mcp|acp|--managed-daemon|--service)(?=\s|$)/i;
6073
6070
  /**
@@ -6106,7 +6103,7 @@ function openTools(processes, clis) {
6106
6103
  const parts = splitCommand(p.command);
6107
6104
  if (parts && !SERVER_ARGS.test(parts.args)) open.add(parts.name);
6108
6105
  }
6109
- return clis.filter((c) => open.has(PROCESS_NAMES[c]));
6106
+ return clis.filter((c) => open.has(processName(c)));
6110
6107
  }
6111
6108
  async function runningTools(ctx, clis) {
6112
6109
  try {
@@ -7892,7 +7889,7 @@ async function createStore(ctx, opts = {}) {
7892
7889
  set({ account: { signedIn: true } });
7893
7890
  try {
7894
7891
  const s = await fetchAccountStatus(tokens.refreshToken, {
7895
- apiBase: ctx.env.CONVENO_API_URL || "https://api.conveno.dev",
7892
+ apiBase: signedInAccountApi(file, ctx.env),
7896
7893
  now: () => ctx.now().getTime()
7897
7894
  });
7898
7895
  set({ account: {
@@ -8095,7 +8092,7 @@ async function createStore(ctx, opts = {}) {
8095
8092
  writeModelMenu(dataPaths(ctx.platform, ctx.dataDir).workerModels, cli, menu);
8096
8093
  },
8097
8094
  async openAccountPage() {
8098
- const base = ctx.env.CONVENO_API_URL || "https://api.conveno.dev";
8095
+ const base = signedInAccountApi(dataPaths(ctx.platform, ctx.dataDir).account, ctx.env);
8099
8096
  openInBrowser(ctx.platform, `${base}/account`);
8100
8097
  },
8101
8098
  async refreshAccount() {