@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.
@@ -4,31 +4,16 @@ import { homedir } from "node:os";
4
4
  import { delimiter, join, win32 } from "node:path";
5
5
  import { createInterface } from "node:readline";
6
6
  import { fileURLToPath } from "node:url";
7
- import { n as antigravityAdapter } from "./dist-XoKXwG-y.js";
8
- import { a as opencodeAdapter, o as claudeAdapter, r as readAllStdin } from "./hook-entry-CLAuy_HJ.js";
9
- import { t as codexAdapter } from "./dist-X1bpJWck.js";
10
- import { t as grokAdapter } from "./dist-BqfYxlVP.js";
11
- import { t as createTheme } from "./dist-CkqMgCGl.js";
12
- import { n as connect$1 } from "./dist-Ch3ohbIk.js";
13
- import { $t as realSpawnDeps, Cn as validateRename, E as attachAcpSession, Et as needsQuoting, H as dataDir, Hn as RpcErrorCode, It as pendingTurn, K as detectRepo, Kn as SessionId, Kt as readAncestry, Lt as pidAlive, M as claimSpawnRecord, Mt as parsePs1ShimTarget, Rn as MessageId, U as dataPaths, Vt as planSpawn, Yt as readModelMenus, _t as launcherPath, d as SPAWN_CLIS, dr as boolean, dt as isAntigravityApp, gr as string, i as ConvenoError, it as formatInbox, jn as CLI_KINDS, jt as parseCmdShimTarget, k as baseName, lr as _enum, mr as number, o as HEARTBEAT_INTERVAL_MS, on as resolveWindowsCommand, p as SpawnError, pn as spawnSession, qt as readCommandLine, s as NOT_FROM_USER_NOTICE, ur as array, vt as launcherText, zn as OWNER_SESSION_ID } from "./dist-DnWOZkAu.js";
14
- import "./dist-fwpPA9AY.js";
7
+ import { t as createTheme } from "./dist-BOwFdixw.js";
8
+ import { n as connect } from "./dist-DAVtixeC.js";
9
+ import { $t as readModelMenus, A as baseName, An as validateRename, At as needsQuoting, Bt as pendingTurn, Cr as number, D as attachAcpSession, Ft as parseCmdShimTarget, G as dataDir, Gt as planSpawn, It as parsePs1ShimTarget, K as dataPaths, Kn as MessageId, L as cliDescriptor, N as claimSpawnRecord, Tr as string, Vt as pidAlive, Xt as readAncestry, Y as detectRepo, Zn as RpcErrorCode, Zt as readCommandLine, a as ConvenoError, bn as spawnSession, br as boolean, bt as launcherPath, c as NOT_FROM_USER_NOTICE, dn as resolveWindowsCommand, f as SPAWN_CLIS, m as SpawnError, mt as isAntigravityApp, rn as realSpawnDeps, s as HEARTBEAT_INTERVAL_MS, st as formatInbox, tr as SessionId, vr as _enum, xt as launcherText, yr as array, zn as CLI_KINDS } from "./dist-CSSvrcKr.js";
10
+ import { t as defaultIsAlive } from "./dist-DV9DhvJC.js";
15
11
  import { access } from "node:fs/promises";
16
12
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
17
13
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
18
- // ../daemon/dist/server-BZtkbi3q.js
19
- /** `kill(pid, 0)` liveness: EPERM means the process exists but belongs to someone else. */
20
- function defaultIsAlive(pid) {
21
- try {
22
- process.kill(pid, 0);
23
- return true;
24
- } catch (e) {
25
- return e.code === "EPERM";
26
- }
27
- }
28
- `${OWNER_SESSION_ID}`;
29
- SessionId.parse("0".repeat(26));
14
+ import { a as adapterList, r as readAllStdin } from "./hook-entry-BwzBtAnd.js";
30
15
  // ../mcp/dist/index.js
31
- const SERVER_VERSION = "0.2.0-rc.16";
16
+ const SERVER_VERSION = "0.2.0-rc.18";
32
17
  const MENU_NAMES_MAX = 12;
33
18
  /**
34
19
  * One sentence for the spawn_session description: the models and efforts each CLI offered the
@@ -175,7 +160,6 @@ function createServer(opts) {
175
160
  const parentGone = () => opts.parentPid !== void 0 && !isAlive(opts.parentPid);
176
161
  const register = async () => {
177
162
  const repo = await detectRepo(cwd, { exists: pathExists });
178
- const cliVersion = process.env.CONVENO_CLI_VERSION?.trim().slice(0, 64);
179
163
  const { hostPid, hostPids, variant } = await host;
180
164
  const record = claimSpawnRecord(spawnDataDir, cli, hostPids);
181
165
  if (record?.acp) {
@@ -189,7 +173,6 @@ function createServer(opts) {
189
173
  pid: process.pid,
190
174
  ...hostPid !== void 0 ? { hostPid } : {},
191
175
  ...hostPids.length > 0 ? { hostPids: hostPids.slice(0, 8) } : {},
192
- ...cliVersion ? { cliVersion } : {},
193
176
  ...variant ? { variant } : {},
194
177
  ...repo.root ? { repo: { root: repo.root } } : {},
195
178
  ...spawnedBy.success ? { spawnedBy: spawnedBy.data } : {},
@@ -316,12 +299,12 @@ function createServer(opts) {
316
299
  actingId = void 0;
317
300
  };
318
301
  /**
319
- * The conversation a tool call comes from, in the request's `_meta`: Codex `threadId`, OpenCode
320
- * `ai.opencode/sessionID`, Antigravity `antigravity.google/root_conversation_id`.
302
+ * The conversation a tool call comes from, in the request's `_meta` key the CLI's descriptor
303
+ * names (`conversationMetaKey`): Codex `threadId`, OpenCode `ai.opencode/sessionID`.
321
304
  */
322
305
  const conversationOf = (extra) => {
323
306
  const meta = extra?._meta;
324
- const key = cli === "codex" ? "threadId" : cli === "opencode" ? "ai.opencode/sessionID" : cli === "antigravity" ? "antigravity.google/root_conversation_id" : void 0;
307
+ const key = cliDescriptor(cli)?.conversationMetaKey;
325
308
  const v = key === void 0 ? void 0 : meta?.[key];
326
309
  return typeof v === "string" && v.length > 0 && v.length <= 256 ? v : void 0;
327
310
  };
@@ -555,7 +538,7 @@ async function runStdio(opts) {
555
538
  hostPids: a.pids,
556
539
  variant: opts.cli === "antigravity" && isAntigravityApp(a.entries) ? "app" : void 0
557
540
  }));
558
- const client = await connect$1({
541
+ const client = await connect({
559
542
  kind: "mcp",
560
543
  autoStart: true,
561
544
  ...opts.daemonEntry ? { daemonEntry: opts.daemonEntry } : {}
@@ -814,13 +797,7 @@ function createRuntimeCtx() {
814
797
  bin: cliBinPath(),
815
798
  launcher: convenoLauncher(env, platform, dir, void 0, void 0, void 0, home)
816
799
  },
817
- adapters: [
818
- claudeAdapter,
819
- codexAdapter,
820
- opencodeAdapter,
821
- antigravityAdapter,
822
- grokAdapter
823
- ],
800
+ adapters: adapterList(),
824
801
  spawnRunner: [process.execPath, cliBinPath()],
825
802
  exec,
826
803
  theme,
@@ -831,7 +808,7 @@ function createRuntimeCtx() {
831
808
  prompt: (q) => promptLine(theme, q),
832
809
  now: () => /* @__PURE__ */ new Date(),
833
810
  readStdin: readAllStdin,
834
- connect: connect$1,
811
+ connect,
835
812
  ancestry: (timeoutMs) => readAncestry({
836
813
  timeoutMs,
837
814
  launcherPaths: process.argv[1] ? [process.argv[1]] : []
@@ -844,4 +821,4 @@ function createRuntimeCtx() {
844
821
  hookTimeoutMs: 2e3
845
822
  };
846
823
  }
847
- export { ask, cliBinPath, convenoCommand, convenoLauncher, createRuntimeCtx, pathConvenoIsThisInstall, promptLine, resolveDaemonEntry, windowsShortPath };
824
+ export { ask, convenoCommand, convenoLauncher, createRuntimeCtx, resolveDaemonEntry, windowsShortPath };
@@ -1,19 +1,21 @@
1
- import { $ as fetchAccountStatus, An as writeSettings, Dn as workerAskTimeoutOf, En as workerAccessOf, Gt as readAccountTokens, Ht as pollDeviceCode, L as compatStatus, On as workerUnansweredOf, R as completeLogin, Rt as pinnedAdapter, St as logoutAccount, U as dataPaths, Vt as planSpawn, Zt as readSettings, b as adapterInstallCommand, f as SPAWN_TABLE, in as resolveAcpProgram, jn as CLI_KINDS, m as WORKER_ACCESS, n as AccountError, tn as requestDeviceCode, tt as findOnPath, x as adapterNpxCommand, y as acpOverrideVar } from "./dist-DnWOZkAu.js";
1
+ import { B as compatStatus, Et as logoutAccount, Fn as workerUnansweredOf, Gt as planSpawn, Ht as pinnedAdapter, K as dataPaths, Kt as pollDeviceCode, Nn as workerAccessOf, Pn as workerAskTimeoutOf, Rn as writeSettings, S as adapterNpxCommand, Tt as loginAccountApi, V as completeLogin, Yt as readAccountTokens, _n as signedInAccountApi, b as acpOverrideVar, h as WORKER_ACCESS, it as findOnPath, ln as resolveAcpProgram, nt as fetchAccountStatus, on as requestDeviceCode, p as SPAWN_TABLE, t as AccountError, tn as readSettings, x as adapterInstallCommand, zn as CLI_KINDS } from "./dist-CSSvrcKr.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
3
  import { a as parseFlags, n as COMMANDS } from "./args-CtyKPZuN.js";
4
4
  import { n as connectOpts, t as adapterEnv } from "./ctx-tYftvhz_.js";
5
- import { t as daemonProblem } from "./daemonError-DUP5zkiR.js";
5
+ import { t as daemonProblem } from "./daemonError-CDgEtvy7.js";
6
6
  import { basename, dirname, isAbsolute, join } from "node:path";
7
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
11
- const accountIo = (ctx, io) => ({
12
- apiBase: ctx.env.CONVENO_API_URL || "https://api.conveno.dev",
11
+ const tokenFile = (ctx) => dataPaths(ctx.platform, ctx.dataDir).account;
12
+ /** The account server of the saved login, the one its tokens may be sent to. */
13
+ const accountServer = (ctx) => signedInAccountApi(tokenFile(ctx), ctx.env);
14
+ const accountIo = (ctx, io, apiBase = accountServer(ctx)) => ({
15
+ apiBase,
13
16
  now: () => ctx.now().getTime(),
14
17
  ...io.fetch ? { fetch: io.fetch } : {}
15
18
  });
16
- const tokenFile = (ctx) => dataPaths(ctx.platform, ctx.dataDir).account;
17
19
  /** Show the code as ABCD-1234, the way the page asks for it. */
18
20
  const showCode = (code) => /^[A-Za-z0-9]{8}$/.test(code) ? `${code.slice(0, 4)}-${code.slice(4)}` : code;
19
21
  /** Open a page with the system's own opener. No shell is involved, so the URL is one argument. */
@@ -65,7 +67,7 @@ async function runLogin(ctx, argv, io = {}) {
65
67
  const parsed = parseFlags(ctx, spec, argv);
66
68
  if (typeof parsed === "number") return parsed;
67
69
  const t = ctx.theme;
68
- const aio = accountIo(ctx, io);
70
+ const aio = accountIo(ctx, io, loginAccountApi(ctx.env));
69
71
  try {
70
72
  const code = await requestDeviceCode(aio);
71
73
  ctx.err([
@@ -98,13 +100,14 @@ async function runLogout(ctx, argv, io = {}) {
98
100
  if (!spec) return 2;
99
101
  const parsed = parseFlags(ctx, spec, argv);
100
102
  if (typeof parsed === "number") return parsed;
101
- const r = await logoutAccount(tokenFile(ctx), accountIo(ctx, io));
103
+ const server = accountServer(ctx);
104
+ const r = await logoutAccount(tokenFile(ctx), accountIo(ctx, io, server));
102
105
  if (!r.hadLogin) {
103
106
  ctx.out("You were not signed in.\n");
104
107
  return 0;
105
108
  }
106
109
  ctx.out(`${ctx.theme.status("ok")} Signed out.\n`);
107
- if (!r.revoked) ctx.err(`${ctx.theme.status("warn")} The account server could not be reached, so the login was only removed from this machine. Sign out everywhere at https://api.conveno.dev/account.\n`);
110
+ if (!r.revoked) ctx.err(`${ctx.theme.status("warn")} The account server could not be reached, so the login was only removed from this machine. Sign out everywhere at ${server}/account.\n`);
108
111
  return 0;
109
112
  }
110
113
  /** `conveno account`: plan and trial. */
@@ -123,7 +126,8 @@ async function runAccount(ctx, argv, io = {}) {
123
126
  ref: "e_account_not_logged_in"
124
127
  });
125
128
  try {
126
- const s = await fetchAccountStatus(tokens.refreshToken, accountIo(ctx, io));
129
+ const server = accountServer(ctx);
130
+ const s = await fetchAccountStatus(tokens.refreshToken, accountIo(ctx, io, server));
127
131
  const rows = [["Account", s.user.name], ["Plan", planLine(ctx, s)]];
128
132
  if (s.status === "trialing" && s.trialEnd !== null) {
129
133
  const left = s.trialDaysLeft ?? 0;
@@ -132,8 +136,8 @@ async function runAccount(ctx, argv, io = {}) {
132
136
  if (s.paymentFailed) rows.push(["Billing", t.paint("warn", "last payment failed")]);
133
137
  const width = Math.max(...rows.map(([k]) => k.length)) + 2;
134
138
  const lines = rows.map(([k, v]) => `${t.paint("quiet", k.padEnd(width))}${v}`);
135
- if (s.plan === "free") lines.push("", `Upgrade or start the 14-day trial at ${t.bold("https://api.conveno.dev/account")}.`);
136
- else if (s.status === "trialing") lines.push("", "No card is on file. Add one at https://api.conveno.dev/account to keep Pro.");
139
+ if (s.plan === "free") lines.push("", `Upgrade or start the 14-day trial at ${t.bold(`${server}/account`)}.`);
140
+ else if (s.status === "trialing") lines.push("", `No card is on file. Add one at ${server}/account to keep Pro.`);
137
141
  ctx.out(`${lines.join("\n")}\n`);
138
142
  return 0;
139
143
  } catch (e) {
@@ -141,7 +145,7 @@ async function runAccount(ctx, argv, io = {}) {
141
145
  }
142
146
  }
143
147
  // src/version.ts
144
- const VERSION = "0.2.0-rc.16";
148
+ const VERSION = "0.2.0-rc.18";
145
149
  // src/daemon.ts
146
150
  async function lockPid(ctx) {
147
151
  try {
@@ -294,7 +298,7 @@ async function replaceStaleDaemon(ctx) {
294
298
  } catch {
295
299
  return null;
296
300
  }
297
- if (running === void 0 || running === "0.2.0-rc.16") return null;
301
+ if (running === void 0 || running === VERSION) return null;
298
302
  return await stopDaemon({
299
303
  ...ctx,
300
304
  out: () => void 0,
@@ -395,6 +399,7 @@ function listLine(ctx, list) {
395
399
  function conflictBlock(ctx, c) {
396
400
  if (!c) return "";
397
401
  const t = ctx.theme;
402
+ const account = signedInAccountApi(dataPaths(ctx.platform, ctx.dataDir).account, ctx.env);
398
403
  const head = (l) => l ? `${l.head.slice(0, 16)} ${t.paint("quiet", `(${plural(l.length, "entry", "entries")})`)}` : "none";
399
404
  const why = c.kind === "split_view" ? [` ${c.peer?.name ?? "Another device"} signed a message with a device list this device does not hold.`, " The relay may be showing your devices different lists, for example to hide a revocation."] : [" The relay holds a device list that this device's list is not part of.", " Someone changed the list in a way this device cannot follow, or the relay is lying."];
400
405
  return `${[
@@ -411,7 +416,7 @@ function conflictBlock(ctx, c) {
411
416
  " If it lists only devices you recognize, type the head it shows (the full 64 characters) here:",
412
417
  ` ${cmd(t, "conveno devices accept <head>")}. Then revoke any device you do not recognize.`,
413
418
  " If no device you trust is left, or you did not reset the devices yourself, reset them at",
414
- ` https://api.conveno.dev/account. After a reset, run ${cmd(t, "conveno devices reset")} here and pair again.`,
419
+ ` ${account}/account. After a reset, run ${cmd(t, "conveno devices reset")} here and pair again.`,
415
420
  ""
416
421
  ].join("\n")}\n`;
417
422
  }
@@ -638,7 +643,8 @@ const STATE_TEXT = {
638
643
  connecting: "connecting",
639
644
  connected: "connected",
640
645
  disconnected: "disconnected, retrying",
641
- revoked: "off, this device was revoked"
646
+ revoked: "off, this device was revoked",
647
+ upgrade_required: "off, Conveno needs an update"
642
648
  };
643
649
  async function runRelay(ctx, argv) {
644
650
  const t = ctx.theme;
@@ -787,6 +793,9 @@ ${missing.map((m) => ` ${pinnedAdapter(m.pkg) ?? m.pkg}\n`).join("")}`);
787
793
  printManual(ctx, missing);
788
794
  }
789
795
  }
796
+ // src/acp-warm.ts
797
+ /** Longest a download may take. */
798
+ const WARM_TIMEOUT_MS = 3e5;
790
799
  function realWarmRunner(ctx) {
791
800
  return { run: (file, args, timeoutMs) => {
792
801
  const plan = planSpawn(file, args);
@@ -851,7 +860,7 @@ async function warmAcpAdapters(ctx, clis, opts = {}) {
851
860
  opts.onLine?.(`$ npm ${args.join(" ")}`);
852
861
  let code = null;
853
862
  try {
854
- code = await runner.run("npm", args, opts.timeoutMs ?? 3e5);
863
+ code = await runner.run("npm", args, opts.timeoutMs ?? WARM_TIMEOUT_MS);
855
864
  } catch {
856
865
  code = null;
857
866
  }
@@ -1925,7 +1934,7 @@ async function runSetup(ctx, argv) {
1925
1934
  });
1926
1935
  if (ctx.interactive && v.yes !== true && v["dry-run"] !== true) {
1927
1936
  if (isWorkerAccess(access)) saveWorkerAccess(ctx, { access });
1928
- return (await import("./run-B-UMVEQs.js")).runTui(ctx, { start: "setup" });
1937
+ return (await import("./run-BtYGSOMi.js")).runTui(ctx, { start: "setup" });
1929
1938
  }
1930
1939
  return runInit(ctx, argv, "setup");
1931
1940
  }
@@ -2045,8 +2054,13 @@ async function runDoctor(ctx, argv = []) {
2045
2054
  const client = await ctx.connect(connectOpts(ctx, false));
2046
2055
  try {
2047
2056
  const { sessions } = await client["session.list"]({});
2057
+ const relay = await (async () => client["relay.status"]({}))().catch(() => void 0);
2058
+ if (relay?.state === "upgrade_required") {
2059
+ warnings++;
2060
+ notes.push(warnBlock(t, "The relay no longer accepts this version of Conveno.", relay.detail ?? "Update Conveno to keep using your other computers.", "Your other computers cannot be reached until Conveno is updated."));
2061
+ }
2048
2062
  const running = client.daemonVersion;
2049
- if (running !== void 0 && running !== "0.2.0-rc.16") {
2063
+ if (running !== void 0 && running !== VERSION) {
2050
2064
  daemonLine = [` ${t.status("warn")} daemon`, `running ${running}, this is ${VERSION}`];
2051
2065
  warnings++;
2052
2066
  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.`));
@@ -1,8 +1,8 @@
1
- import { n as isOneShotGrok } from "./dist-BqfYxlVP.js";
2
- import { cn as runWaker, en as renderBody, ft as isFromOwner, un as senderOf } from "./dist-DnWOZkAu.js";
1
+ import { n as isOneShotGrok } from "./dist-CFsDqevs.js";
2
+ import { an as renderBody, gn as senderOf, ht as isFromOwner, mn as runWaker } from "./dist-CSSvrcKr.js";
3
3
  import { n as connectOpts } from "./ctx-tYftvhz_.js";
4
- import { t as daemonProblem } from "./daemonError-DUP5zkiR.js";
5
- import { t as findSession } from "./pick-UDFASnAn.js";
4
+ import { t as daemonProblem } from "./daemonError-CDgEtvy7.js";
5
+ import { t as findSession } from "./pick-BsMvXuDo.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.16",
3
+ "version": "0.2.0-rc.18",
4
4
  "description": "Connect AI coding CLI sessions so they can message each other.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -53,18 +53,18 @@
53
53
  "zod": "4.6.7"
54
54
  },
55
55
  "devDependencies": {
56
- "@conveno/acp": "0.2.0-rc.16",
57
- "@conveno/adapter-antigravity": "0.2.0-rc.16",
58
- "@conveno/adapter-claude": "0.2.0-rc.16",
59
- "@conveno/adapter-codex": "0.2.0-rc.16",
60
- "@conveno/adapter-grok": "0.2.0-rc.16",
61
- "@conveno/adapter-opencode": "0.2.0-rc.16",
62
- "@conveno/brand": "0.2.0-rc.16",
63
- "@conveno/client": "0.2.0-rc.16",
64
- "@conveno/core": "0.2.0-rc.16",
65
- "@conveno/daemon": "0.2.0-rc.16",
66
- "@conveno/mcp": "0.2.0-rc.16",
67
- "@conveno/protocol": "0.2.0-rc.16",
56
+ "@conveno/acp": "0.2.0-rc.18",
57
+ "@conveno/adapter-antigravity": "0.2.0-rc.18",
58
+ "@conveno/adapter-claude": "0.2.0-rc.18",
59
+ "@conveno/adapter-codex": "0.2.0-rc.18",
60
+ "@conveno/adapter-grok": "0.2.0-rc.18",
61
+ "@conveno/adapter-opencode": "0.2.0-rc.18",
62
+ "@conveno/brand": "0.2.0-rc.18",
63
+ "@conveno/client": "0.2.0-rc.18",
64
+ "@conveno/core": "0.2.0-rc.18",
65
+ "@conveno/daemon": "0.2.0-rc.18",
66
+ "@conveno/mcp": "0.2.0-rc.18",
67
+ "@conveno/protocol": "0.2.0-rc.18",
68
68
  "@types/react": "19.3.0",
69
69
  "ink-testing-library": "4.0.0"
70
70
  },