@conveno/cli 0.2.0-rc.1 → 0.2.0-rc.2

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 CHANGED
@@ -45,7 +45,7 @@ Then open two CLI sessions, for example Claude Code and Codex. In one, ask it to
45
45
  | `conveno auto [on\|off\|resume] [<session>]`, `conveno auto limit <n\|default> [<session>]` | Auto mode for a session: waiting messages become its next prompt when its turn ends, and an idle Claude Code or OpenCode session is woken. Without a name it changes the session it is typed in; without arguments it lists the sessions. `resume` lifts a pause by the limit: 20 automatic turns per rolling hour, and a chain of sessions answering each other stops after 20 automatic turns with no person in between (`limit` changes both for one session). The orchestrator may resume a session once per hour; the owner any time. See `packages/protocol/PROTOCOL.md`, section 6.7. |
46
46
  | `conveno peek <session> [-n 10] [--raw-json]` | Read the last turns (prompts, replies, tool calls) of another session on this machine, with secrets redacted on a best-effort basis. `-n` is 1 to 50. Works for Claude Code, Codex, OpenCode, Copilot and Grok, and for any worker started with `--acp`; Cursor and Antigravity sessions otherwise answer that peek is not supported yet. `--raw-json` prints the daemon's answer. |
47
47
  | `conveno peek on\|off [session]` | Allow or stop other sessions reading yours. With no session it covers every session online now. The daemon log records each peek (who, whom, how many turns), never the text. |
48
- | `conveno doctor` | Check each CLI and the daemon, and say which delivery works for each: next turn, end of turn, idle wake, or inbox only. |
48
+ | `conveno doctor [--cli <list>]` | Check each CLI and the daemon, and say which delivery works for each: next turn, end of turn, idle wake, or inbox only. `--cli claude,codex` checks only those CLIs, so problems in the others do not count. |
49
49
  | `conveno login [--no-browser]` | Sign in to your Conveno account for Pro. Shows a code and a link, opens the browser, and waits for you to approve the code. The tokens go to `account.json` in the data dir, readable by you only. The local mesh does not need an account. |
50
50
  | `conveno logout` | Sign out on the server and delete the saved tokens. |
51
51
  | `conveno account` | Show your plan and trial. |
@@ -1,13 +1,13 @@
1
1
  import { chmodSync, existsSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
2
- import { n as connect } from "./dist-DsRTUePN.js";
3
- import { $ as isAllowed, Ut as spawnRecordPath, Yt as takeAcpLaunchFile, ft as parseAllowPatterns, jt as readSpawnRecord, m as acpTurnsPath, q as formatContinuation, r as ConvenoError, sn as CliKind, tn as updateSpawnRecord, xn as SessionId, yn as RpcErrorCode } from "./dist-_qrCNXUP.js";
2
+ import { n as connect } from "./dist-BEZPNGU5.js";
3
+ import { $ as isAllowed, Ut as spawnRecordPath, Yt as takeAcpLaunchFile, ft as parseAllowPatterns, jt as readSpawnRecord, m as acpTurnsPath, q as formatContinuation, r as ConvenoError, sn as CliKind, tn as updateSpawnRecord, xn as SessionId, yn as RpcErrorCode } from "./dist-_sq6DmrE.js";
4
4
  import { randomBytes } from "node:crypto";
5
5
  import { Readable, Writable } from "node:stream";
6
6
  import { PROTOCOL_VERSION, client, methods, ndJsonStream } from "@agentclientprotocol/sdk";
7
7
  import { appendFile } from "node:fs/promises";
8
8
  import { t as redact } from "./dist-DcmKjrmu.js";
9
9
  import { spawn, spawnSync } from "node:child_process";
10
- import { i as parseFlags, l as fail, o as cmd, t as COMMANDS, u as localStamp } from "./args-DHkLY6_f.js";
10
+ import { i as parseFlags, l as fail, o as cmd, t as COMMANDS, u as localStamp } from "./args-DEYV4Ran.js";
11
11
  // ../acp/dist/index.js
12
12
  /**
13
13
  * Pick the option to answer with. Allowing uses `allow_once` only: `allow_always` would change the
@@ -174,7 +174,7 @@ function parseTurns(text) {
174
174
  }
175
175
  return out;
176
176
  }
177
- const HOST_VERSION = "0.2.0-rc.1";
177
+ const HOST_VERSION = "0.2.0-rc.2";
178
178
  /** A stop request file: `conveno stop` writes it next to the spawn record. */
179
179
  const stopRequestPath = (recordPath) => recordPath.replace(/\.json$/, ".stop");
180
180
  function withTimeout(p, ms, what) {
@@ -382,9 +382,13 @@ const COMMANDS = [
382
382
  },
383
383
  {
384
384
  name: "doctor",
385
- usage: "conveno doctor",
385
+ usage: "conveno doctor [--cli <list>]",
386
386
  summary: "Check each CLI and the daemon",
387
- flags: {}
387
+ flags: { cli: {
388
+ type: "string",
389
+ value: "<list>",
390
+ help: "Only these CLIs, comma separated, such as claude,codex"
391
+ } }
388
392
  },
389
393
  {
390
394
  name: "login",
package/dist/bin.js CHANGED
@@ -26,9 +26,9 @@ for (const stream of [process.stdout, process.stderr]) stream.on("error", (err)
26
26
  });
27
27
  try {
28
28
  let code;
29
- if (isHook) code = await (await import("./hook-entry-Daxws9EC.js")).runHookEntry(argv.slice(1));
29
+ if (isHook) code = await (await import("./hook-entry-jDI9wAt-.js")).runHookEntry(argv.slice(1));
30
30
  else {
31
- const [{ main }, { createRuntimeCtx }] = await Promise.all([import("./main-sIWDc4jt.js"), import("./runtime-5nEur1P5.js")]);
31
+ const [{ main }, { createRuntimeCtx }] = await Promise.all([import("./main-DyHE7TAz.js"), import("./runtime-DPrz7M0s.js")]);
32
32
  code = await main(argv, createRuntimeCtx());
33
33
  }
34
34
  if (isHook) process.exit(code);
package/dist/daemon.js CHANGED
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  import { homedir, hostname, userInfo } from "node:os";
3
- import { $t as turnHops, A as currentAccessToken, An as encodeFrame, B as effectiveHolder, Bn as parseIpcRequest, C as claimOrchestrator, Ct as proofsMatch, E as clientProof, En as Ticket, Et as readAncestry, F as defaultProcessIo, Fn as makeResult, H as entriesNewestFirst, Hn as safeParse, Ht as samePath, I as describeToolCall, In as newDeviceId, Jt as tailJsonl, Kt as statusAfterLiveness, L as detectRepo, Ln as newMessageId, M as dataDir, Mn as isSocketPathTooLong, N as dataPaths, Nn as makeError, On as createLineDecoder, Ot as readHeadLine, P as decideAutoContinue, Pn as makeEventNotification, Q as holderAfterDeparture, Qt as tooManyUnreadMessage, Rn as newSessionId, Rt as resolveRecipient, S as bindAccountDevice, T as classifyPermission, Tt as readAccountTokens, U as evaluateLiveness, Un as sanitizeLine, Vn as parseRelayFrame, Wn as socketPathTooLongMessage, Xt as takeWithinBytes, Z as generateSessionName, Zt as toIso, _ as asString, _n as PROTOCOL_VERSION, _t as pendingForInjection, at as jwtClaim, b as autoLimitsFromEnv, cn as DeviceId, ct as markDelivered, d as ackEntries, dt as notFound, en as unsupportedTranscript, fn as HUMAN_ANSWERER, gn as PERMISSION_ANSWERS, gt as pauseLabel, hn as ORCHESTRATOR_ALIAS, j as daemonProof, k as createWmiWalker, kn as defaultSocketPath, kt as readInbox, ln as EVENT_NAMES, lt as nameMatchesPattern, n as AccountError, nn as validateRename, p as acpTranscript, pn as Message, r as ConvenoError, rt as isRecord, s as RESPONSE_BUDGET_BYTES, tt as isOnline, ut as newAuthNonce, vn as RelayPayload, x as baseName, xn as SessionId, xt as planSpawn, y as autoCandidates, yn as RpcErrorCode, zn as newTicketId } from "./dist-_qrCNXUP.js";
3
+ import { $t as turnHops, A as currentAccessToken, An as encodeFrame, B as effectiveHolder, Bn as parseIpcRequest, C as claimOrchestrator, Ct as proofsMatch, E as clientProof, En as Ticket, Et as readAncestry, F as defaultProcessIo, Fn as makeResult, H as entriesNewestFirst, Hn as safeParse, Ht as samePath, I as describeToolCall, In as newDeviceId, Jt as tailJsonl, Kt as statusAfterLiveness, L as detectRepo, Ln as newMessageId, M as dataDir, Mn as isSocketPathTooLong, N as dataPaths, Nn as makeError, On as createLineDecoder, Ot as readHeadLine, P as decideAutoContinue, Pn as makeEventNotification, Q as holderAfterDeparture, Qt as tooManyUnreadMessage, Rn as newSessionId, Rt as resolveRecipient, S as bindAccountDevice, T as classifyPermission, Tt as readAccountTokens, U as evaluateLiveness, Un as sanitizeLine, Vn as parseRelayFrame, Wn as socketPathTooLongMessage, Xt as takeWithinBytes, Z as generateSessionName, Zt as toIso, _ as asString, _n as PROTOCOL_VERSION, _t as pendingForInjection, at as jwtClaim, b as autoLimitsFromEnv, cn as DeviceId, ct as markDelivered, d as ackEntries, dt as notFound, en as unsupportedTranscript, fn as HUMAN_ANSWERER, gn as PERMISSION_ANSWERS, gt as pauseLabel, hn as ORCHESTRATOR_ALIAS, j as daemonProof, k as createWmiWalker, kn as defaultSocketPath, kt as readInbox, ln as EVENT_NAMES, lt as nameMatchesPattern, n as AccountError, nn as validateRename, p as acpTranscript, pn as Message, r as ConvenoError, rt as isRecord, s as RESPONSE_BUDGET_BYTES, tt as isOnline, ut as newAuthNonce, vn as RelayPayload, x as baseName, xn as SessionId, xt as planSpawn, y as autoCandidates, yn as RpcErrorCode, zn as newTicketId } from "./dist-_sq6DmrE.js";
4
4
  import { randomBytes } from "node:crypto";
5
5
  import { appendFileSync, chmodSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync } from "node:fs";
6
6
  import { connect, createServer } from "node:net";
7
7
  import { dirname, join, posix, win32 } from "node:path";
8
8
  import { n as redactWithReport } from "./dist-DcmKjrmu.js";
9
- import { _ as sasMatches, a as JoinerPairing, b as signRelayHello, c as decodePairMessage, d as forkPoint, f as generateIdentity, g as publicRecord, h as parseIdentity, i as InviterPairing, l as deviceFingerprint, m as openEnvelope, n as ENVELOPE_MAX_AGE_MS, o as appendRevoke, p as headMatches, r as ENVELOPE_MAX_FUTURE_MS, s as chainHead, t as CryptoError, u as encodePairMessage, v as sealEnvelope, x as verifyChain, y as serializeIdentity } from "./dist-CWvQqhPj.js";
9
+ import { _ as sasMatches, a as JoinerPairing, b as signRelayHello, c as decodePairMessage, d as forkPoint, f as generateIdentity, g as publicRecord, h as parseIdentity, i as InviterPairing, l as deviceFingerprint, m as openEnvelope, n as ENVELOPE_MAX_AGE_MS, o as appendRevoke, p as headMatches, r as ENVELOPE_MAX_FUTURE_MS, s as chainHead, t as CryptoError, u as encodePairMessage, v as sealEnvelope, x as verifyChain, y as serializeIdentity } from "./dist-hYvLf29C.js";
10
10
  import { execFileSync } from "node:child_process";
11
11
  import { DatabaseSync } from "node:sqlite";
12
- import { c as claudeTranscript, i as codexTranscript, t as openCodeTranscript } from "./dist-D8gPpZKN.js";
12
+ import { c as claudeTranscript, i as codexTranscript, t as openCodeTranscript } from "./dist-BVE5ihb8.js";
13
13
  import { readFile, readdir, stat } from "node:fs/promises";
14
14
  // ../daemon/src/lifecycle.ts
15
15
  /** Thrown when another Conveno daemon already owns the lock file or answers on the socket. */
@@ -2434,7 +2434,7 @@ var TicketService = class {
2434
2434
  }
2435
2435
  };
2436
2436
  // ../daemon/src/server.ts
2437
- const DAEMON_VERSION = "0.2.0-rc.1";
2437
+ const DAEMON_VERSION = "0.2.0-rc.2";
2438
2438
  /** A connection that has not finished the handshake by then is closed. */
2439
2439
  const AUTH_TIMEOUT_MS = 5e3;
2440
2440
  /** Unread messages one session may hold. */
@@ -3,7 +3,7 @@ import { mkdir, open, readFile, rm, stat } from "node:fs/promises";
3
3
  import { createConnection } from "node:net";
4
4
  import { homedir } from "node:os";
5
5
  import { dirname, join } from "node:path";
6
- import { An as encodeFrame, Ct as proofsMatch, E as clientProof, M as dataDir, Mn as isSocketPathTooLong, N as dataPaths, On as createLineDecoder, Wn as socketPathTooLongMessage, _n as PROTOCOL_VERSION, bn as RpcResponse, dn as EventPayload, j as daemonProof, jn as ipcMethods, kn as defaultSocketPath, r as ConvenoError, ut as newAuthNonce, yn as RpcErrorCode } from "./dist-_qrCNXUP.js";
6
+ import { An as encodeFrame, Ct as proofsMatch, E as clientProof, M as dataDir, Mn as isSocketPathTooLong, N as dataPaths, On as createLineDecoder, Wn as socketPathTooLongMessage, _n as PROTOCOL_VERSION, bn as RpcResponse, dn as EventPayload, j as daemonProof, jn as ipcMethods, kn as defaultSocketPath, r as ConvenoError, ut as newAuthNonce, yn as RpcErrorCode } from "./dist-_sq6DmrE.js";
7
7
  // ../client/dist/index.js
8
8
  const DEFAULT_REQUEST_TIMEOUT_MS = 5e3;
9
9
  const DEFAULT_START_TIMEOUT_MS = 1e4;
@@ -1,4 +1,4 @@
1
- import { Ft as relayPermission, Gt as startTurnContext, H as entriesNewestFirst, Ht as samePath, I as describeToolCall, Jt as tailJsonl, Mt as readTailLines, Ot as readHeadLine, Pt as recordCliInfo, V as endTurnContinuation, X as formatPermissionDecision, Zt as toIso, _ as asString, dt as notFound, it as isTranscriptPath, pt as parseCliVersion, qt as subdirsNewestFirst, rn as waitForWork, rt as isRecord, vt as pendingHookContext, yt as pickNewestSince } from "./dist-_qrCNXUP.js";
1
+ import { Ft as relayPermission, Gt as startTurnContext, H as entriesNewestFirst, Ht as samePath, I as describeToolCall, Jt as tailJsonl, Mt as readTailLines, Ot as readHeadLine, Pt as recordCliInfo, V as endTurnContinuation, X as formatPermissionDecision, Zt as toIso, _ as asString, dt as notFound, it as isTranscriptPath, pt as parseCliVersion, qt as subdirsNewestFirst, rn as waitForWork, rt as isRecord, vt as pendingHookContext, yt as pickNewestSince } from "./dist-_sq6DmrE.js";
2
2
  import { isAbsolute, join } from "node:path";
3
3
  import { readFile, stat } from "node:fs/promises";
4
4
  import { applyEdits, modify, parse, printParseErrorCode } from "jsonc-parser";
@@ -506,7 +506,7 @@ const stopHookActive = (input) => isObject(input) && input.stop_hook_active ===
506
506
  * listener armed on this Stop wakes the session with what waits, as a new turn.
507
507
  * - Listen: the background listener (`asyncRewake`). Waits for work and exits 2 with the framed
508
508
  * messages on stderr, which wakes Claude even when the session is idle. Exit 0, silent, when it
509
- * stops for any other reason.
509
+ * stops for any other reason, and at once in `claude -p` (`CLAUDE_CODE_ENTRYPOINT=sdk-cli`).
510
510
  */
511
511
  async function hook$2(event, input, ctx) {
512
512
  switch (event) {
@@ -535,6 +535,7 @@ async function hook$2(event, input, ctx) {
535
535
  }
536
536
  case PERMISSION_EVENT$1: return permissionHook$1(input, ctx);
537
537
  case LISTEN_EVENT: {
538
+ if (process.env.CLAUDE_CODE_ENTRYPOINT === "sdk-cli") return EMPTY$4;
538
539
  const text = await waitForWork(ctx, { maxMs: LISTEN_MAX_MS });
539
540
  return text === null ? EMPTY$4 : {
540
541
  stdout: "",
@@ -8896,6 +8896,8 @@ const CLI_VERB = new RegExp(String.raw`(?:^|[\s"'/])conveno(?:\.cmd|\.ps1)?${VER
8896
8896
  const SHIM_FILE = /(?:^|[\s"'/^])conveno\.(?:cmd|ps1)(?![\w.-])/;
8897
8897
  /** An installed `@conveno/cli` entry script, in any package-manager layout. */
8898
8898
  const INSTALLED_BIN = String.raw`@conveno/cli/(?:[^\s"']*/)?bin\.js`;
8899
+ /** Programs that run a command line: shells, node, and Conveno's own entry points (shims and bin). */
8900
+ const LAUNCHER_EXES = /^-?(?:(?:ba|z|da|a|fi|k|c|tc)?sh|cmd|powershell|pwsh|env|node|nodejs|conveno(?:\.cmd|\.ps1)?)$/;
8899
8901
  /**
8900
8902
  * Is this command line part of launching Conveno itself, as opposed to the CLI that hosts it?
8901
8903
  * Precise on purpose; a shell is skipped only when it is running a Conveno command:
@@ -8908,11 +8910,13 @@ const INSTALLED_BIN = String.raw`@conveno/cli/(?:[^\s"']*/)?bin\.js`;
8908
8910
  */
8909
8911
  function isConvenoLauncher(command, launcherPaths = []) {
8910
8912
  const line = norm(command);
8913
+ const [exe, ...rest] = tokens(line);
8914
+ const name = exe?.split("/").pop()?.replace(/\.exe$/, "");
8915
+ if (name === void 0 || !LAUNCHER_EXES.test(name)) return false;
8911
8916
  if (CLI_VERB.test(line) || SHIM_FILE.test(line)) return true;
8912
8917
  const bins = launcherPaths.map(norm).filter((p) => p !== "");
8913
8918
  for (const bin of [...bins.map(escapeRe), INSTALLED_BIN]) if (new RegExp(`${bin}${VERB}`).test(line)) return true;
8914
- const [exe, ...rest] = tokens(line);
8915
- if (exe === void 0 || !/(?:^|\/)node(?:\.exe)?$/.test(exe)) return false;
8919
+ if (!/(?:^|\/)node(?:\.exe)?$/.test(exe ?? "")) return false;
8916
8920
  const script = rest.find((t) => !t.startsWith("-"));
8917
8921
  return script !== void 0 && (bins.includes(script) || new RegExp(`${INSTALLED_BIN}$`).test(script));
8918
8922
  }
@@ -2,7 +2,7 @@ import { randomBytes as randomBytes$1 } from "@noble/ciphers/utils.js";
2
2
  import { equalBytes } from "@noble/curves/utils.js";
3
3
  import { sha256 } from "@noble/hashes/sha2.js";
4
4
  import { bytesToHex, concatBytes, utf8ToBytes } from "@noble/hashes/utils.js";
5
- import { Gn as _enum, Jn as discriminatedUnion, Kn as array, Qn as string, Xn as number, Yn as literal, Zn as object, cn as DeviceId } from "./dist-_qrCNXUP.js";
5
+ import { Gn as _enum, Jn as discriminatedUnion, Kn as array, Qn as string, Xn as number, Yn as literal, Zn as object, cn as DeviceId } from "./dist-_sq6DmrE.js";
6
6
  import { ed25519, x25519 } from "@noble/curves/ed25519.js";
7
7
  import { chacha20poly1305 } from "@noble/ciphers/chacha.js";
8
8
  import { expand, extract } from "@noble/hashes/hkdf.js";
@@ -1,4 +1,4 @@
1
- import { nt as isPermissionHook } from "./dist-_qrCNXUP.js";
1
+ import { nt as isPermissionHook } from "./dist-_sq6DmrE.js";
2
2
  // src/ctx.ts
3
3
  const adapterEnv = (ctx, opts = {}) => ({
4
4
  home: ctx.home,
@@ -1,10 +1,10 @@
1
1
  import { homedir } from "node:os";
2
2
  import { join } from "node:path";
3
- import { Et as readAncestry, Gt as startTurnContext, M as dataDir, R as dropFromList, V as endTurnContinuation, Vt as sameJson, W as existedBefore, et as isObject, ot as loadJson, pt as parseCliVersion, vt as pendingHookContext, wt as putInList, z as editJson } from "./dist-_qrCNXUP.js";
4
- import { a as Za, n as opencodeAdapter, o as cs, r as codexAdapter, s as claudeAdapter } from "./dist-D8gPpZKN.js";
3
+ import { Et as readAncestry, Gt as startTurnContext, M as dataDir, R as dropFromList, V as endTurnContinuation, Vt as sameJson, W as existedBefore, et as isObject, ot as loadJson, pt as parseCliVersion, vt as pendingHookContext, wt as putInList, z as editJson } from "./dist-_sq6DmrE.js";
4
+ import { a as Za, n as opencodeAdapter, o as cs, r as codexAdapter, s as claudeAdapter } from "./dist-BVE5ihb8.js";
5
5
  import { readFile } from "node:fs/promises";
6
- import { n as connect } from "./dist-DsRTUePN.js";
7
- import { t as runHook } from "./hook-bfp9_AVT.js";
6
+ import { n as connect } from "./dist-BEZPNGU5.js";
7
+ import { t as runHook } from "./hook-DlTGn8Do.js";
8
8
  // ../adapters/antigravity/dist/index.js
9
9
  const SERVER_NAME$3 = "conveno";
10
10
  /** The name of our entry in hooks.json. Antigravity keys hooks by an arbitrary name. */
@@ -0,0 +1 @@
1
+ export { i as runHookEntry } from "./hook-entry-BWfePrqh.js";