@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,4 +1,4 @@
1
- import { t as ClientError } from "./dist-Ch3ohbIk.js";
1
+ import { t as ClientError } from "./dist-DAVtixeC.js";
2
2
  import { n as cmd, s as plainError } from "./fmt-C2SsP5Y0.js";
3
3
  // src/daemonError.ts
4
4
  /**
@@ -1,11 +1,12 @@
1
- import { n as connect } from "./dist-Ch3ohbIk.js";
2
- import { Bt as planProgram, Hn as RpcErrorCode, Kn as SessionId, Mn as CliKind, Sn as updateSpawnRecord, Tt as modelLabel, _ as accessAllows, c as NPX_SETUP_TIMEOUT_MS, et as findModelOption, f as SPAWN_TABLE, gn as takeAcpLaunchFile, i as ConvenoError, in as resolveAcpProgram, kn as writeModelMenu, nt as formatContinuation, tt as findOnPath, wt as menuFromConfigOptions } from "./dist-DnWOZkAu.js";
1
+ import { n as connect } from "./dist-DAVtixeC.js";
2
+ import { Bn as CliKind, Cn as takeAcpLaunchFile, In as writeModelMenu, Ot as menuFromConfigOptions, Wt as planProgram, Zn as RpcErrorCode, a as ConvenoError, at as formatContinuation, it as findOnPath, kn as updateSpawnRecord, kt as modelLabel, l as NPX_SETUP_TIMEOUT_MS, ln as resolveAcpProgram, p as SPAWN_TABLE, rt as findModelOption, tr as SessionId, v as accessAllows } from "./dist-CSSvrcKr.js";
3
3
  import { randomBytes } from "node:crypto";
4
4
  import { existsSync, rmSync } from "node:fs";
5
5
  import { Readable, Writable } from "node:stream";
6
6
  import { PROTOCOL_VERSION, client, methods, ndJsonStream } from "@agentclientprotocol/sdk";
7
7
  import { spawn, spawnSync } from "node:child_process";
8
8
  // ../acp/dist/index.js
9
+ var version = "0.2.0-rc.18";
9
10
  /**
10
11
  * Pick the option to answer with. Allowing uses `allow_once` only: `allow_always` would change the
11
12
  * CLI's own saved permissions, which is the user's call. Denying uses `reject_once`, and when the
@@ -205,7 +206,11 @@ var ToolTracker = class {
205
206
  return u.sessionUpdate === "tool_call" ? next.title ?? next.kind ?? "tool" : void 0;
206
207
  }
207
208
  };
208
- const HOST_VERSION = "0.2.0-rc.16";
209
+ const HOST_VERSION = version;
210
+ /** How long the agent gets to answer `initialize` and `session/new`. */
211
+ const SETUP_TIMEOUT_MS = 12e4;
212
+ /** How often the host looks for a stop request from `conveno stop`. */
213
+ const STOP_POLL_MS = 500;
209
214
  /** A stop request file: `conveno stop` writes it next to the spawn record. */
210
215
  const stopRequestPath = (recordPath) => recordPath.replace(/\.json$/, ".stop");
211
216
  function withTimeout$1(p, ms, what) {
@@ -328,7 +333,7 @@ var AcpHost = class {
328
333
  }
329
334
  async setup() {
330
335
  const { spec } = this;
331
- const timeout = spec.setupTimeoutMs ?? this.deps.setupTimeoutMs ?? 12e4;
336
+ const timeout = spec.setupTimeoutMs ?? this.deps.setupTimeoutMs ?? SETUP_TIMEOUT_MS;
332
337
  this.agent = await this.deps.startAgent(spec);
333
338
  const agent = this.agent;
334
339
  this.log(`started ${spec.file} (pid ${agent.pid}) for ${spec.name}`);
@@ -343,7 +348,7 @@ var AcpHost = class {
343
348
  pid: process.pid,
344
349
  agentPid: agent.pid
345
350
  });
346
- this.every(this.deps.stopPollMs ?? 500, () => {
351
+ this.every(this.deps.stopPollMs ?? STOP_POLL_MS, () => {
347
352
  const path = stopRequestPath(spec.record);
348
353
  if (existsSync(path)) {
349
354
  rmSync(path, { force: true });
@@ -1,4 +1,3 @@
1
- import "node:url";
2
1
  import { release } from "node:os";
3
2
  // ../brand/dist/index.js
4
3
  const tokens = {
@@ -51,7 +50,7 @@ const tokens = {
51
50
  },
52
51
  "roles": {
53
52
  "entry": "The one accent. The point in the mark, the orchestrator, links, primary actions, 'live'. Never used for decoration.",
54
- "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.",
55
54
  "ok/warn/error/info": "Semantic state only. Never as brand accents."
56
55
  },
57
56
  "derived": {
@@ -258,9 +257,9 @@ const tokens = {
258
257
  "c--- *"
259
258
  ],
260
259
  "showAfterMs": 400,
261
- "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."
262
261
  },
263
- "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."
264
263
  },
265
264
  "naming": {
266
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.",
@@ -292,7 +291,6 @@ const tokens = {
292
291
  "exempt": ["icons/sprite.svg (bundle)", "assets/social-preview*.svg (source for the PNG; outlined text)"]
293
292
  }
294
293
  };
295
- import.meta.url;
296
294
  const terminalTheme = {
297
295
  "name": "Conveno terminal theme",
298
296
  "version": "1.0.0-lock",
@@ -303,7 +301,7 @@ const terminalTheme = {
303
301
  "light": "#FBFCFD"
304
302
  },
305
303
  "attributes": {
306
- "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.",
307
305
  "dim": "Not used. 'quiet' is a colour, because SGR 2 is unreliable across terminals.",
308
306
  "underline": "SGR 4. URLs only.",
309
307
  "reset": "SGR 0 at the end of every coloured span and every line."
@@ -325,7 +323,7 @@ const terminalTheme = {
325
323
  }
326
324
  },
327
325
  "stamp": {
328
- "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.",
329
327
  "truecolor": {
330
328
  "dark": "#FFB547",
331
329
  "light": "#9A5700"
@@ -539,7 +537,7 @@ const terminalTheme = {
539
537
  "COLORTERM",
540
538
  "TERM"
541
539
  ],
542
- "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."
543
541
  },
544
542
  "status": {
545
543
  "shapes": {
@@ -586,12 +584,7 @@ const terminalTheme = {
586
584
  "note": "The c and the entry line are quiet; only the final point is entry (the mark's point)."
587
585
  },
588
586
  "staticLine": "c─── ●",
589
- "noMotion": "Static 'c─── ●' line when CONVENO_NO_MOTION=1, CI is set, stdout is not a TTY, or NO_COLOR with TERM=dumb."
590
- },
591
- "redaction": {
592
- "unicode": "[redacted]",
593
- "ascii": "[redacted]",
594
- "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."
595
588
  }
596
589
  };
597
590
  const ESC = "\x1B[";
@@ -660,15 +653,6 @@ function detectUnicode(ctx = currentContext()) {
660
653
  if (set(locale)) return /utf-?8/i.test(locale);
661
654
  return true;
662
655
  }
663
- /** Spinner gate from tokens.terminal.spinner.noMotion: CONVENO_NO_MOTION, CI, non-TTY, TERM=dumb. */
664
- function detectMotion(ctx = currentContext()) {
665
- const { env } = ctx;
666
- if (!falsy(env.CONVENO_NO_MOTION)) return false;
667
- if (!falsy(env.CI)) return false;
668
- if (!ctx.isTTY) return false;
669
- if (env.TERM === "dumb") return false;
670
- return true;
671
- }
672
656
  function sgr(role, level, bg) {
673
657
  const r = terminalTheme.roles[role];
674
658
  if (level === 3) {
@@ -690,7 +674,6 @@ function createTheme(opts = {}) {
690
674
  const colorLevel = detectColorLevel(ctx, opts.color);
691
675
  const background = opts.background ?? detectBackground(ctx.env);
692
676
  const unicode = opts.ascii ? false : detectUnicode(ctx);
693
- const motion = detectMotion(ctx);
694
677
  const wrap = (codes, text) => `${ESC}${codes}m${text}${RESET}`;
695
678
  const paint = (role, text, o) => {
696
679
  if (colorLevel === 0 || text === "") return text;
@@ -707,36 +690,15 @@ function createTheme(opts = {}) {
707
690
  const status = (name) => paint(tokens.terminal.glyphColors[name], glyph(name));
708
691
  const point = unicode ? "●" : tokens.terminal.asciiFallback["●"] ?? "*";
709
692
  const mark = () => `${paint("ink", "c")}${paint("entry", point)}`;
710
- const spinner = () => {
711
- const sp = tokens.terminal.spinner;
712
- const raw = unicode ? sp.frames : sp.asciiFrames;
713
- const dot = unicode ? "●" : "*";
714
- const paintFrame = (f) => {
715
- const i = f.indexOf(dot);
716
- const line = i === -1 ? f : f.slice(0, i);
717
- const tail = i === -1 ? "" : paint("entry", dot);
718
- return paint("quiet", line.trimEnd()) + " ".repeat(line.length - line.trimEnd().length) + tail;
719
- };
720
- const frames = raw.map(paintFrame);
721
- return {
722
- animated: motion,
723
- intervalMs: sp.intervalMs,
724
- showAfterMs: sp.showAfterMs,
725
- frames,
726
- staticLine: paintFrame(raw[raw.length - 1])
727
- };
728
- };
729
693
  return {
730
694
  colorLevel,
731
695
  background,
732
696
  unicode,
733
- motion,
734
697
  paint,
735
698
  bold,
736
699
  glyph,
737
700
  status,
738
- mark,
739
- spinner
701
+ mark
740
702
  };
741
703
  }
742
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 parseCliVersion, Et as needsQuoting, Ft as pendingHookContext, G as defaultProcessIo, J as editJson, Q as existedBefore, S as agentCommand, T as askedMarker, Wt as putInList, X as endTurnContinuation, a as FROM_USER_NOTICE, gt as late, kt as ownSession, l as ORCHESTRATOR_TASK_NOTICE, ln as sameJson, pt as isObject, q as dropFromList, qt as readCommandLine, s as NOT_FROM_USER_NOTICE, ut as hostPidOf, w as askedKey, xn as uninstallLauncher, xt as loadJson, zt as planLauncher } from "./dist-DnWOZkAu.js";
3
+ import { $ as endTurnContinuation, At as needsQuoting, C as agentCommand, E as askedMarker, J as defaultProcessIo, Jt as putInList, Nt as ownSession, On as uninstallLauncher, Pt as parseCliVersion, T as askedKey, Ut as planLauncher, X as dropFromList, Z as editJson, Zt as readCommandLine, c as NOT_FROM_USER_NOTICE, gt as isObject, hn as sameJson, o as FROM_USER_NOTICE, pt as hostPidOf, tt as existedBefore, u as ORCHESTRATOR_TASK_NOTICE, wt as loadJson, yt as late, zt as pendingHookContext } from "./dist-CSSvrcKr.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);