@conveno/cli 0.2.0-rc.15 → 0.2.0-rc.17

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,4 +1,4 @@
1
- import "node:url";
1
+ import { release } from "node:os";
2
2
  // ../brand/dist/index.js
3
3
  const tokens = {
4
4
  "name": "Conveno",
@@ -50,7 +50,7 @@ const tokens = {
50
50
  },
51
51
  "roles": {
52
52
  "entry": "The one accent. The point in the mark, the orchestrator, links, primary actions, 'live'. Never used for decoration.",
53
- "stamp": "Attention that needs the owner: open tickets, waiting on question. Not an error.",
53
+ "stamp": "Attention that needs the owner: waiting on a question. Not an error.",
54
54
  "ok/warn/error/info": "Semantic state only. Never as brand accents."
55
55
  },
56
56
  "derived": {
@@ -257,9 +257,9 @@ const tokens = {
257
257
  "c--- *"
258
258
  ],
259
259
  "showAfterMs": 400,
260
- "noMotion": "Static 'c─── ●' line when CONVENO_NO_MOTION=1, CI is set, stdout is not a TTY, or NO_COLOR with TERM=dumb."
260
+ "noMotion": "Static 'c─── ●' line when CONVENO_REDUCED_MOTION=1, NO_COLOR is set, or stdout is not a TTY."
261
261
  },
262
- "env": "NO_COLOR disables colour; FORCE_COLOR=0..3 forces level; COLORTERM=truecolor|24bit enables truecolor; CONVENO_NO_MOTION and CI disable spinners."
262
+ "env": "NO_COLOR disables colour; FORCE_COLOR=0..3 forces level; COLORTERM=truecolor|24bit enables truecolor; CONVENO_REDUCED_MOTION disables spinners."
263
263
  },
264
264
  "naming": {
265
265
  "cssVariables": "All CSS custom properties use the --cv- prefix (e.g. --cv-ink, --cv-ease-enter, --cv-dur-quick, --cv-fs-sm, --cv-s-4, --cv-r-md). The icon accent point colour is --cv-point.",
@@ -291,7 +291,6 @@ const tokens = {
291
291
  "exempt": ["icons/sprite.svg (bundle)", "assets/social-preview*.svg (source for the PNG; outlined text)"]
292
292
  }
293
293
  };
294
- import.meta.url;
295
294
  const terminalTheme = {
296
295
  "name": "Conveno terminal theme",
297
296
  "version": "1.0.0-lock",
@@ -302,7 +301,7 @@ const terminalTheme = {
302
301
  "light": "#FBFCFD"
303
302
  },
304
303
  "attributes": {
305
- "bold": "SGR 1. Used for names, ticket ids and the one key phrase of a line. Never the only signal.",
304
+ "bold": "SGR 1. Used for names and the one key phrase of a line. Never the only signal.",
306
305
  "dim": "Not used. 'quiet' is a colour, because SGR 2 is unreliable across terminals.",
307
306
  "underline": "SGR 4. URLs only.",
308
307
  "reset": "SGR 0 at the end of every coloured span and every line."
@@ -324,7 +323,7 @@ const terminalTheme = {
324
323
  }
325
324
  },
326
325
  "stamp": {
327
- "use": "Needs the owner: open tickets, waiting on a question. Not an error.",
326
+ "use": "Needs the owner: waiting on a question. Not an error.",
328
327
  "truecolor": {
329
328
  "dark": "#FFB547",
330
329
  "light": "#9A5700"
@@ -538,7 +537,7 @@ const terminalTheme = {
538
537
  "COLORTERM",
539
538
  "TERM"
540
539
  ],
541
- "CONVENO_NO_MOTION": "1 disables the spinner and prints the static 'c─── ●' line. CI, a non-TTY stdout, or NO_COLOR with TERM=dumb do the same."
540
+ "CONVENO_REDUCED_MOTION": "1 disables the spinner and prints the static 'c─── ●' line. NO_COLOR or a non-TTY stdout do the same."
542
541
  },
543
542
  "status": {
544
543
  "shapes": {
@@ -585,23 +584,26 @@ const terminalTheme = {
585
584
  "note": "The c and the entry line are quiet; only the final point is entry (the mark's point)."
586
585
  },
587
586
  "staticLine": "c─── ●",
588
- "noMotion": "Static 'c─── ●' line when CONVENO_NO_MOTION=1, CI is set, stdout is not a TTY, or NO_COLOR with TERM=dumb."
589
- },
590
- "redaction": {
591
- "unicode": "[redacted]",
592
- "ascii": "[redacted]",
593
- "note": "Fixed text, inverse video when colour is on."
587
+ "noMotion": "Static 'c─── ●' line when CONVENO_REDUCED_MOTION=1, NO_COLOR is set, or stdout is not a TTY."
594
588
  }
595
589
  };
596
590
  const ESC = "\x1B[";
597
591
  const RESET = `${ESC}0m`;
598
592
  const set = (v) => v !== void 0 && v !== "";
599
593
  const falsy = (v) => v === void 0 || v === "" || v === "0" || v.toLowerCase() === "false";
594
+ /** Windows 10 build 18362 (1903) or later: conhost has VT, 256 colours and Unicode box drawing. */
595
+ function modernWindows(osRelease) {
596
+ const m = /^(\d+)\.(\d+)\.(\d+)/.exec(osRelease ?? "");
597
+ if (!m) return false;
598
+ const major = Number(m[1]);
599
+ return major > 10 || major === 10 && Number(m[3]) >= 18362;
600
+ }
600
601
  function currentContext() {
601
602
  return {
602
603
  env: process.env,
603
604
  isTTY: Boolean(process.stdout.isTTY),
604
- platform: process.platform
605
+ platform: process.platform,
606
+ osRelease: release()
605
607
  };
606
608
  }
607
609
  /** Precedence from brand/components/terminal-theme.json: NO_COLOR, FORCE_COLOR, flag, TTY, COLORTERM, TERM. */
@@ -626,6 +628,7 @@ function detectColorLevel(ctx = currentContext(), flag = "auto") {
626
628
  if (colorterm === "truecolor" || colorterm === "24bit") detected = 3;
627
629
  else if (ctx.platform === "win32" && (set(env.WT_SESSION) || env.ConEmuANSI === "ON")) detected = 3;
628
630
  else if (term === "dumb") detected = 0;
631
+ else if (ctx.platform === "win32" && modernWindows(ctx.osRelease) && !/256color/.test(term)) detected = 2;
629
632
  else if (term === "" && ctx.platform !== "win32") detected = 0;
630
633
  else if (/256color/.test(term)) detected = 2;
631
634
  else detected = 1;
@@ -640,25 +643,16 @@ function detectBackground(env = process.env) {
640
643
  }
641
644
  return "dark";
642
645
  }
643
- /** False for CONVENO_ASCII=1, the legacy Windows console and non-UTF-8 locales. */
646
+ /** False for CONVENO_ASCII=1, Windows older than 10 build 18362 and non-UTF-8 locales. */
644
647
  function detectUnicode(ctx = currentContext()) {
645
648
  const { env } = ctx;
646
649
  if (!falsy(env.CONVENO_ASCII)) return false;
647
- if (ctx.platform === "win32") return set(env.WT_SESSION) || set(env.TERM_PROGRAM) || env.ConEmuANSI === "ON" || env.TERM === "xterm-256color" || env.TERM === "alacritty";
650
+ if (ctx.platform === "win32") return set(env.WT_SESSION) || set(env.TERM_PROGRAM) || env.ConEmuANSI === "ON" || env.TERM === "xterm-256color" || env.TERM === "alacritty" || modernWindows(ctx.osRelease);
648
651
  if (env.TERM === "linux") return false;
649
652
  const locale = env.LC_ALL || env.LC_CTYPE || env.LANG;
650
653
  if (set(locale)) return /utf-?8/i.test(locale);
651
654
  return true;
652
655
  }
653
- /** Spinner gate from tokens.terminal.spinner.noMotion: CONVENO_NO_MOTION, CI, non-TTY, TERM=dumb. */
654
- function detectMotion(ctx = currentContext()) {
655
- const { env } = ctx;
656
- if (!falsy(env.CONVENO_NO_MOTION)) return false;
657
- if (!falsy(env.CI)) return false;
658
- if (!ctx.isTTY) return false;
659
- if (env.TERM === "dumb") return false;
660
- return true;
661
- }
662
656
  function sgr(role, level, bg) {
663
657
  const r = terminalTheme.roles[role];
664
658
  if (level === 3) {
@@ -674,12 +668,12 @@ function createTheme(opts = {}) {
674
668
  const ctx = {
675
669
  env: opts.env ?? now.env,
676
670
  isTTY: opts.isTTY ?? now.isTTY,
677
- platform: opts.platform ?? now.platform
671
+ platform: opts.platform ?? now.platform,
672
+ ...(opts.osRelease ?? now.osRelease) !== void 0 ? { osRelease: opts.osRelease ?? now.osRelease } : {}
678
673
  };
679
674
  const colorLevel = detectColorLevel(ctx, opts.color);
680
675
  const background = opts.background ?? detectBackground(ctx.env);
681
676
  const unicode = opts.ascii ? false : detectUnicode(ctx);
682
- const motion = detectMotion(ctx);
683
677
  const wrap = (codes, text) => `${ESC}${codes}m${text}${RESET}`;
684
678
  const paint = (role, text, o) => {
685
679
  if (colorLevel === 0 || text === "") return text;
@@ -696,36 +690,15 @@ function createTheme(opts = {}) {
696
690
  const status = (name) => paint(tokens.terminal.glyphColors[name], glyph(name));
697
691
  const point = unicode ? "●" : tokens.terminal.asciiFallback["●"] ?? "*";
698
692
  const mark = () => `${paint("ink", "c")}${paint("entry", point)}`;
699
- const spinner = () => {
700
- const sp = tokens.terminal.spinner;
701
- const raw = unicode ? sp.frames : sp.asciiFrames;
702
- const dot = unicode ? "●" : "*";
703
- const paintFrame = (f) => {
704
- const i = f.indexOf(dot);
705
- const line = i === -1 ? f : f.slice(0, i);
706
- const tail = i === -1 ? "" : paint("entry", dot);
707
- return paint("quiet", line.trimEnd()) + " ".repeat(line.length - line.trimEnd().length) + tail;
708
- };
709
- const frames = raw.map(paintFrame);
710
- return {
711
- animated: motion,
712
- intervalMs: sp.intervalMs,
713
- showAfterMs: sp.showAfterMs,
714
- frames,
715
- staticLine: paintFrame(raw[raw.length - 1])
716
- };
717
- };
718
693
  return {
719
694
  colorLevel,
720
695
  background,
721
696
  unicode,
722
- motion,
723
697
  paint,
724
698
  bold,
725
699
  glyph,
726
700
  status,
727
- mark,
728
- spinner
701
+ mark
729
702
  };
730
703
  }
731
704
  export { tokens as i, detectColorLevel as n, detectUnicode as r, createTheme as t };
@@ -1,6 +1,6 @@
1
1
  import { readFile } from "node:fs/promises";
2
2
  import { join } from "node:path";
3
- import { At as pendingHookContext, C as askedKey, G as dropFromList, Ht as readCommandLine, J as endTurnContinuation, K as editJson, Pt as planLauncher, Tt as parseCliVersion, U as defaultProcessIo, X as existedBefore, a as FROM_USER_NOTICE, c as ORCHESTRATOR_TASK_NOTICE, mn as uninstallLauncher, pt as late, rn as sameJson, s as NOT_FROM_USER_NOTICE, st as hostPidOf, ut as isObject, vt as loadJson, w as askedMarker, wt as ownSession, x as agentCommand, xt as needsQuoting, zt as putInList } from "./dist-ZL7d4_97.js";
3
+ import { At as parseCliVersion, C as askedKey, Et as needsQuoting, Ft as pendingHookContext, K as dropFromList, W as defaultProcessIo, Wt as putInList, Y as endTurnContinuation, Z as existedBefore, bt as loadJson, c as ORCHESTRATOR_TASK_NOTICE, dn as sameJson, ft as isObject, ht as late, i as FROM_USER_NOTICE, kt as ownSession, lt as hostPidOf, o as NOT_FROM_USER_NOTICE, q as editJson, qt as readCommandLine, w as askedMarker, wn as uninstallLauncher, x as agentCommand, zt as planLauncher } from "./dist-Dc50_P_f.js";
4
4
  import { n as cs, t as Za } from "./toml-patch-DGzVRdd1.js";
5
5
  // ../adapters/grok/dist/index.js
6
6
  const SERVER_NAME = "conveno";
@@ -273,7 +273,7 @@ const hookCommand = (env, event) => [
273
273
  * `UserPromptSubmit` is ignored with a warning, 10-hooks.md, matcher).
274
274
  */
275
275
  const desiredGroup = (env, event) => ({
276
- ...event === "Notification" ? { matcher: IDLE_MATCHER } : {},
276
+ ...event === IDLE_EVENT ? { matcher: IDLE_MATCHER } : {},
277
277
  hooks: [{
278
278
  type: "command",
279
279
  command: hookCommand(env, event),
@@ -660,7 +660,7 @@ async function stopHook(input, ctx) {
660
660
  */
661
661
  async function hook(event, input, ctx) {
662
662
  const data = asInput(input);
663
- ctx = withConversation(data, ctx, event === "SessionStart" || event === "UserPromptSubmit");
663
+ ctx = withConversation(data, ctx, event === SESSION_START_EVENT || event === TURN_START_EVENT);
664
664
  switch (event) {
665
665
  case SESSION_START_EVENT:
666
666
  if (!inSubagent(data)) await ownSession(ctx).catch(() => null);
@@ -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 { B as dataDir, Bn as defaultSocketPath, Fn as RpcResponse, Hn as ipcMethods, Mn as PROTOCOL_VERSION, N as clientProof, On as EventPayload, Pn as RpcErrorCode, Rt as proofsMatch, St as newAuthNonce, Un as isSocketPathTooLong, V as dataPaths, Vn as encodeFrame, er as socketPathTooLongMessage, i as ConvenoError, z as daemonProof, zn as createLineDecoder } from "./dist-ZL7d4_97.js";
6
+ import { $n as defaultSocketPath, B as daemonProof, Bn as EventPayload, Dt as newAuthNonce, H as dataPaths, Jn as RpcResponse, P as clientProof, Qn as createLineDecoder, Ut as proofsMatch, V as dataDir, Wn as PROTOCOL_VERSION, er as encodeFrame, nr as isSocketPathTooLong, pr as socketPathTooLongMessage, qn as RpcErrorCode, r as ConvenoError, tr as ipcMethods } from "./dist-Dc50_P_f.js";
7
7
  // ../client/dist/index.js
8
8
  const DEFAULT_REQUEST_TIMEOUT_MS = 5e3;
9
9
  const DEFAULT_START_TIMEOUT_MS = 1e4;
@@ -33,6 +33,7 @@ const CLIENT_METHODS = [
33
33
  "message.deliver",
34
34
  "message.ack",
35
35
  "message.requeue",
36
+ "message.recent",
36
37
  "owner.send",
37
38
  "events.subscribe",
38
39
  "relay.status",
@@ -1,6 +1,6 @@
1
1
  import { readFile, readdir } from "node:fs/promises";
2
2
  import { join } from "node:path";
3
- import { At as pendingHookContext, B as dataDir, G as dropFromList, J as endTurnContinuation, K as editJson, P as compareVersions, Pt as planLauncher, Tt as parseCliVersion, X as existedBefore, mn as uninstallLauncher, pt as late, rn as sameJson, ut as isObject, vt as loadJson, w as askedMarker, wt as ownSession, x as agentCommand, xt as needsQuoting } from "./dist-ZL7d4_97.js";
3
+ import { At as parseCliVersion, Et as needsQuoting, F as compareVersions, Ft as pendingHookContext, K as dropFromList, V as dataDir, Y as endTurnContinuation, Z as existedBefore, bt as loadJson, dn as sameJson, ft as isObject, ht as late, kt as ownSession, q as editJson, w as askedMarker, wn as uninstallLauncher, x as agentCommand, zt as planLauncher } from "./dist-Dc50_P_f.js";
4
4
  // ../adapters/antigravity/dist/index.js
5
5
  const SERVER_NAME = "conveno";
6
6
  /** The name of our entry in hooks.json. Antigravity keys hooks by an arbitrary name. */
@@ -345,13 +345,13 @@ async function plan(env, opts = {}) {
345
345
  });
346
346
  const setFile = await loadJson(p.settings);
347
347
  const allow = allowList(setFile.value, p.settings);
348
- const hasRule = allow?.includes("mcp(conveno/*)") ?? false;
348
+ const hasRule = allow?.includes(PERMISSION_RULE) ?? false;
349
349
  const relay = relayRule(env);
350
350
  const hadRelay = allow?.includes(relay) ?? false;
351
351
  const known = await relayRuleKnown(env);
352
352
  const others = otherRelayRules(env);
353
353
  const hadOther = allow?.some((r) => typeof r === "string" && others.has(r)) ?? false;
354
- const wantRelay = known === void 0 ? hadRelay : (opts.accept?.includes("antigravity-allow-relay") === true || hadRelay || hadOther) && known;
354
+ const wantRelay = known === void 0 ? hadRelay : (opts.accept?.includes(RELAY_OPTION) === true || hadRelay || hadOther) && known;
355
355
  const stale = dropFromList(allow, ["permissions", "allow"], (r) => known !== void 0 && isOurRelayRule(r) && !(wantRelay && r === relay), { keepEmpty: true });
356
356
  const missing = [...hasRule ? [] : [PERMISSION_RULE], ...wantRelay && !hadRelay ? [relay] : []];
357
357
  if (missing.length > 0 || stale.length > 0) {
@@ -407,7 +407,7 @@ async function plan(env, opts = {}) {
407
407
  before: setFile.raw,
408
408
  after: editJson(setFile, ruleEdits),
409
409
  description: [
410
- missing.includes("mcp(conveno/*)") ? `Allow the agent to call Conveno's tools (${PERMISSION_RULE}) without asking. They only exchange messages between your own sessions.` : void 0,
410
+ missing.includes(PERMISSION_RULE) ? `Allow the agent to call Conveno's tools (${PERMISSION_RULE}) without asking. They only exchange messages between your own sessions.` : void 0,
411
411
  addsRelay ? `Allow the agent to start Conveno's relay (${relay}) without asking, so it can wake an idle conversation.` : void 0,
412
412
  stale.length > 0 ? "Remove the old rule that started Conveno's relay without asking." : void 0
413
413
  ].filter(Boolean).join(" ")
@@ -513,7 +513,7 @@ async function uninstallPlan(env, baseline) {
513
513
  description: `Remove the "${SERVER_NAME}" MCP server.`
514
514
  });
515
515
  const setFile = await loadJson(p.settings);
516
- const drops = dropFromList(allowList(setFile.value, p.settings), ["permissions", "allow"], (r) => r === "mcp(conveno/*)" || isOurRelayRule(r), { keepEmpty: existedBefore(baseline?.get(p.settings), ["permissions", "allow"]) });
516
+ const drops = dropFromList(allowList(setFile.value, p.settings), ["permissions", "allow"], (r) => r === PERMISSION_RULE || isOurRelayRule(r), { keepEmpty: existedBefore(baseline?.get(p.settings), ["permissions", "allow"]) });
517
517
  if (drops.length > 0) {
518
518
  const alone = drops.length === 1 && drops[0]?.path.length === 2;
519
519
  const only = Object.keys(setFile.value.permissions).length === 1 && !existedBefore(baseline?.get(p.settings), ["permissions"]);
@@ -2,7 +2,7 @@ import { execFile, spawn } from "node:child_process";
2
2
  import { readFileSync, statSync } from "node:fs";
3
3
  import { readFile } from "node:fs/promises";
4
4
  import { join } from "node:path";
5
- import { At as pendingHookContext, Ft as planProgram, It as planSpawn, J as endTurnContinuation, Q as findOnPath, Tt as parseCliVersion, sn as startTurnContext, wt as ownSession } from "./dist-ZL7d4_97.js";
5
+ import { At as parseCliVersion, Bt as planProgram, Ft as pendingHookContext, Vt as planSpawn, Y as endTurnContinuation, _n as startTurnContext, et as findOnPath, kt as ownSession } from "./dist-Dc50_P_f.js";
6
6
  import { n as cs, t as Za } from "./toml-patch-DGzVRdd1.js";
7
7
  // ../adapters/codex/dist/index.js
8
8
  const SERVER_NAME = "conveno";