@conveno/cli 0.2.0-rc.11 → 0.2.0-rc.12

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,5 @@
1
1
  import { appendFileSync } from "node:fs";
2
+ import { tt as hookLogLine, y as appendHookLog } from "./dist-CRj_cuHc.js";
2
3
  import { n as connectOpts } from "./ctx-tYftvhz_.js";
3
4
  // src/hook.ts
4
5
  /**
@@ -39,6 +40,49 @@ async function findHostPid(ctx, client, cli, local) {
39
40
  function timingLine(cli, event, ms, procMs, timedOut) {
40
41
  return `${(/* @__PURE__ */ new Date()).toISOString()} cli=${cli} event=${event} ms=${ms}${procMs === void 0 ? "" : ` proc_ms=${procMs}`} timeout=${timedOut ? "yes" : "no"}\n`;
41
42
  }
43
+ /**
44
+ * The client with its answers noted in `trace`: the session a lookup resolved to, the messages
45
+ * handed over, the turn state recorded. The hook sees the same client.
46
+ */
47
+ function traced(client, trace) {
48
+ return new Proxy(client, { get(target, prop, receiver) {
49
+ const value = Reflect.get(target, prop, receiver);
50
+ if (typeof prop !== "string" || !prop.includes(".") || typeof value !== "function") return value;
51
+ return async (...args) => {
52
+ let r;
53
+ try {
54
+ r = await value.apply(target, args);
55
+ } catch (e) {
56
+ const code = e?.code;
57
+ trace.error = `error ${typeof code === "number" || typeof code === "string" ? code : "unknown"}`;
58
+ throw e;
59
+ }
60
+ const out = r;
61
+ const count = Array.isArray(out?.messages) ? out.messages.length : 0;
62
+ if ((prop === "session.bind" || prop === "session.byHost") && out?.session?.name) trace.session = out.session.name;
63
+ else if (prop === "turn.start") trace.turn = "busy";
64
+ else if (prop === "turn.end") {
65
+ trace.delivered += count;
66
+ trace.turn = count > 0 ? "busy" : "idle";
67
+ } else if (prop === "message.deliver" || prop === "turn.wake") trace.delivered += count;
68
+ return r;
69
+ };
70
+ } });
71
+ }
72
+ /** The CLI's own conversation id in a hook's input, whichever way that CLI spells it. */
73
+ function conversationIn(input) {
74
+ if (typeof input !== "object" || input === null) return void 0;
75
+ const o = input;
76
+ for (const key of [
77
+ "session_id",
78
+ "sessionId",
79
+ "sessionID",
80
+ "conversationId"
81
+ ]) {
82
+ const v = o[key];
83
+ if (typeof v === "string" && v !== "") return v;
84
+ }
85
+ }
42
86
  /** After a timeout, the hook gets this many more timeouts' worth of time to finish recording. */
43
87
  const FINISH_GRACE_FACTOR = 2;
44
88
  /** How long before the hook's timeout its messages count as too late to print. */
@@ -60,6 +104,8 @@ async function runHook(ctx, argv) {
60
104
  const listener = adapter.listenEvents?.includes(event) === true;
61
105
  const deadline = listener ? void 0 : Date.now() + ctx.hookTimeoutMs - DEADLINE_MARGIN_MS;
62
106
  const t0 = ctx.timingLog && !listener ? Date.now() : void 0;
107
+ const trace = { delivered: 0 };
108
+ let conversation;
63
109
  let timedOut = false;
64
110
  let client;
65
111
  let timer;
@@ -74,9 +120,13 @@ async function runHook(ctx, argv) {
74
120
  }
75
121
  };
76
122
  const [input, connected] = await Promise.all([readInput(), ctx.connect(connectOpts(ctx, false))]);
77
- client = connected;
123
+ client = ctx.hookLog ? traced(connected, trace) : connected;
124
+ if (ctx.hookLog) conversation = conversationIn(input);
78
125
  const hostPid = await findHostPid(ctx, connected, adapter.cli, () => early ?? ctx.ancestry(1200));
79
- if (hostPid === void 0) return NOTHING;
126
+ if (hostPid === void 0) {
127
+ await adapter.hookWithoutSession?.(event, input).catch(() => {});
128
+ return NOTHING;
129
+ }
80
130
  return adapter.hook(event, input, {
81
131
  client,
82
132
  hostPid,
@@ -99,6 +149,16 @@ async function runHook(ctx, argv) {
99
149
  if (listener && out.stderr) ctx.err(out.stderr.endsWith("\n") ? out.stderr : `${out.stderr}\n`);
100
150
  if (listener) code = out.exitCode;
101
151
  } catch {} finally {
152
+ if (ctx.hookLog) {
153
+ const result = timedOut ? "timeout" : trace.error ?? (trace.delivered > 0 ? `delivered ${trace.delivered}` : trace.turn ?? "nothing");
154
+ appendHookLog(ctx.hookLog, hookLogLine({
155
+ cli: adapter.cli,
156
+ event,
157
+ conversationId: conversation,
158
+ session: trace.session,
159
+ result
160
+ }));
161
+ }
102
162
  if (t0 !== void 0 && ctx.timingLog) {
103
163
  const up = ctx.uptimeMs?.();
104
164
  try {
@@ -1,13 +1,13 @@
1
1
  import { homedir } from "node:os";
2
- import { n as antigravityAdapter } from "./dist-KWlFKO7H.js";
2
+ import { n as antigravityAdapter } from "./dist-Du1hwaux.js";
3
3
  import { isAbsolute, join } from "node:path";
4
- import { Et as readAncestry, Ft as requeueMessages, Gt as startTurnContext, H as endTurnContinuation, P as dataDir, _t as pendingHookContext, dt as ownSession, nn as waitForWorkBatch, pt as parseCliVersion, tn as waitForWork } from "./dist-qONHJRJk.js";
4
+ import { Ct as pendingHookContext, G as endTurnContinuation, Ht as requeueMessages, It as readSettings, L as dataDir, Nt as readAncestry, Qt as startTurnContext, R as dataPaths, _t as ownSession, cn as waitForWork, ln as waitForWorkBatch, nt as hookLogPath, r as CLAUDE_PENDING_TURN_FOLDER, wt as pendingTurn, yt as parseCliVersion } from "./dist-CRj_cuHc.js";
5
5
  import { readFile } from "node:fs/promises";
6
6
  import { applyEdits, modify, parse, printParseErrorCode } from "jsonc-parser";
7
- import { t as codexAdapter } from "./dist-DEjU_KXC.js";
8
- import { t as grokAdapter } from "./dist-Y0JDSJP_.js";
9
- import { n as connect } from "./dist-n6XMTlyN.js";
10
- import { t as runHook } from "./hook-CDF1A8AY.js";
7
+ import { t as codexAdapter } from "./dist-BjATai4T.js";
8
+ import { t as grokAdapter } from "./dist-DF0nL8wE.js";
9
+ import { n as connect } from "./dist-B3YYLzKS.js";
10
+ import { t as runHook } from "./hook-ByduyOom.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. */
@@ -67,7 +67,8 @@ const HOOK_EVENTS = [
67
67
  "SessionStart",
68
68
  "UserPromptSubmit",
69
69
  "PostToolUse",
70
- "Stop"
70
+ "Stop",
71
+ "SessionEnd"
71
72
  ];
72
73
  /** Older versions also installed a PermissionRequest hook; uninstall still removes it. */
73
74
  const LEGACY_HOOK_EVENTS = ["PermissionRequest"];
@@ -129,7 +130,8 @@ const HANDLERS = {
129
130
  SessionStart: ["SessionStart", LISTEN_EVENT],
130
131
  UserPromptSubmit: ["UserPromptSubmit"],
131
132
  PostToolUse: ["PostToolUse"],
132
- Stop: ["Stop", LISTEN_EVENT]
133
+ Stop: ["Stop", LISTEN_EVENT],
134
+ SessionEnd: ["SessionEnd"]
133
135
  };
134
136
  const EMPTY$1 = {
135
137
  stdout: "",
@@ -151,7 +153,7 @@ function paths(env) {
151
153
  * The program and arguments of one hook, in exec form: Claude Code spawns `command` with `args` and
152
154
  * no shell, so nothing is quoted and Git Bash, PowerShell and `sh` read it alike
153
155
  * (https://code.claude.com/docs/en/hooks, "Exec form and shell form"; `args` since Claude Code
154
- * 2.1.139, older than the 2.1.332 minimum). On Windows `command` must be a real executable, not an
156
+ * 2.1.139, the `minimum` in compat.json). On Windows `command` must be a real executable, not an
155
157
  * npm `.cmd` shim, so a bare `conveno` there becomes `node <conveno's script>`, the pattern the
156
158
  * docs give for npm tools.
157
159
  */
@@ -202,7 +204,7 @@ const desiredServer = (env) => {
202
204
  env: {}
203
205
  };
204
206
  };
205
- const OUR_EVENTS = /^(SessionStart|UserPromptSubmit|PostToolUse|Stop|Listen|PermissionRequest)$/;
207
+ const OUR_EVENTS = /^(SessionStart|UserPromptSubmit|PostToolUse|Stop|SessionEnd|Listen|PermissionRequest)$/;
206
208
  /**
207
209
  * Recognizes our hook handler even if the conveno path changed since install: exec form (`args`
208
210
  * ending in `hook claude <event>`) or the shell form older versions wrote.
@@ -391,7 +393,7 @@ async function uninstallPlan$1(env) {
391
393
  path: p.settings,
392
394
  before: setFile.raw,
393
395
  after: editJson(setFile, edits),
394
- description: "Remove the Conveno SessionStart, UserPromptSubmit, PostToolUse and Stop hooks and the listener."
396
+ description: "Remove the Conveno SessionStart, UserPromptSubmit, PostToolUse, Stop and SessionEnd hooks and the listener."
395
397
  });
396
398
  }
397
399
  return changes;
@@ -417,38 +419,58 @@ function claudeSessionId(input) {
417
419
  return isObject(input) && typeof input.session_id === "string" && input.session_id !== "" ? input.session_id : void 0;
418
420
  }
419
421
  /**
420
- * Finds the session by Claude Code's own session id where the daemon knows it, with the host pid as
421
- * the fallback. The MCP server records the id it was started with, but that id is not the hooks'
422
- * after `/clear`, and after `--continue` or `--resume` without an id it can be the startup one
423
- * (docs, `CLAUDE_CODE_SESSION_ID`). So on a miss the hook looks the session up by pid and, when that
424
- * finds this host's Claude session, records the hooks' id on it, so later hooks match it directly.
425
- * Never throws: on any failure the pid lookup of the helpers applies.
422
+ * The hook's context with Claude Code's own session id, which the daemon binds to the window's
423
+ * session (`session.bind`): `/clear`, `--resume` and `--continue` give a new id to the same window,
424
+ * and the window's session follows it. `turnStart` says whether this event may move the window to
425
+ * the id (a session start or a prompt); any other event of a session that is not the window's
426
+ * current one is ignored.
426
427
  */
427
- async function withSessionId(ctx, input) {
428
+ function withSessionId(ctx, input, turnStart) {
428
429
  const nativeId = claudeSessionId(input);
429
430
  if (nativeId === void 0 || ctx.nativeId !== void 0) return ctx;
431
+ return {
432
+ ...ctx,
433
+ cli: ctx.cli ?? "claude",
434
+ nativeId,
435
+ turnStart
436
+ };
437
+ }
438
+ /** `source` of a SessionStart input: startup, resume, clear, compact or fork. */
439
+ const startSource = (input) => isObject(input) && typeof input.source === "string" ? input.source : void 0;
440
+ /** The notes of turns that started before their session registered (`pendingTurn`). */
441
+ const pendingTurns = () => pendingTurn(dataDir(process.platform, process.env, homedir()), CLAUDE_PENDING_TURN_FOLDER);
442
+ /**
443
+ * No Claude Code session is online yet: a prompt that comes now (Claude Code started with one)
444
+ * leaves its note, so the MCP server starts the turn when it registers.
445
+ */
446
+ async function hookWithoutSession(event, input) {
447
+ if (event !== "UserPromptSubmit") return;
448
+ const id = claudeSessionId(input);
449
+ if (id !== void 0) await pendingTurns().mark(id);
450
+ }
451
+ /** A turn that ended no longer waits for its session to register. */
452
+ async function clearPendingTurn(input) {
453
+ const id = claudeSessionId(input);
454
+ if (id !== void 0) await pendingTurns().clear(id);
455
+ }
456
+ /**
457
+ * Whether a listener armed by this SessionStart may listen. A window that has just started is
458
+ * woken before its first prompt only when the user asked for it (`wakeBeforeFirstPrompt`) or the
459
+ * lead started it. Every other start (resume, clear, compact, fork) and every Stop listens.
460
+ */
461
+ async function mayListen(ctx, input) {
462
+ if (!isObject(input) || input.hook_event_name !== "SessionStart") return true;
463
+ if (startSource(input) !== "startup") return true;
430
464
  try {
431
- const { client, hostPid: pid } = ctx;
432
- if ((await client["session.byHost"]({
433
- pid,
434
- nativeId
435
- })).session) return {
436
- ...ctx,
437
- nativeId
438
- };
439
- const byPid = await client["session.byHost"]({ pid });
440
- if (byPid.session?.cli !== "claude") return ctx;
441
- await client["session.setNative"]({
442
- sessionId: byPid.session.id,
443
- nativeId
444
- });
445
- return {
446
- ...ctx,
447
- nativeId
448
- };
449
- } catch {
450
- return ctx;
465
+ if (readSettings(dataPaths(process.platform, dataDir(process.platform, process.env, homedir())).settings).wakeBeforeFirstPrompt === true) return true;
466
+ } catch {}
467
+ for (let i = 0; i < 20; i++) {
468
+ const session = await ownSession(ctx).catch(() => null);
469
+ if (session) return session.spawned;
470
+ if (ctx.isAlive && !ctx.isAlive(ctx.hostPid)) return false;
471
+ await new Promise((r) => setTimeout(r, 500));
451
472
  }
473
+ return false;
452
474
  }
453
475
  /**
454
476
  * Never throws: any failure means "deliver nothing this time". What a hook prints stays within
@@ -476,22 +498,38 @@ async function hook$1(event, input, ctx) {
476
498
  deadline: Date.now() + DELIVER_DEADLINE_MS
477
499
  };
478
500
  switch (event) {
479
- case "SessionStart": return contextOutput(event, await pendingHookContext(await withSessionId(ctx, input), opts));
480
- case "UserPromptSubmit": return contextOutput(event, await startTurnContext(await withSessionId(ctx, input), opts));
501
+ case "SessionStart": return contextOutput(event, await pendingHookContext(withSessionId(ctx, input, true), opts));
502
+ case "UserPromptSubmit": {
503
+ const own = withSessionId(ctx, input, true);
504
+ const id = own.nativeId;
505
+ const onNoSession = async () => {
506
+ if (id !== void 0) await pendingTurns().mark(id);
507
+ };
508
+ return contextOutput(event, await startTurnContext(own, {
509
+ ...opts,
510
+ onNoSession
511
+ }));
512
+ }
481
513
  case "PostToolUse":
482
514
  if (inSubagent(input)) return EMPTY$1;
483
- return contextOutput(event, await pendingHookContext(await withSessionId(ctx, input), opts));
515
+ return contextOutput(event, await pendingHookContext(withSessionId(ctx, input, false), opts));
484
516
  case "Stop": {
485
- const reason = await endTurnContinuation(await withSessionId(ctx, input), {
517
+ await clearPendingTurn(input);
518
+ const reason = await endTurnContinuation(withSessionId(ctx, input, false), {
486
519
  ...opts,
487
520
  allowContinue: !stopHookActive(input)
488
521
  });
489
522
  return contextOutput(event, reason);
490
523
  }
524
+ case "SessionEnd":
525
+ await clearPendingTurn(input);
526
+ await endTurnContinuation(withSessionId(ctx, input, false), { allowContinue: false });
527
+ return EMPTY$1;
491
528
  case LISTEN_EVENT: {
492
529
  const entry = process.env.CLAUDE_CODE_ENTRYPOINT;
493
530
  if (entry !== void 0 && NON_INTERACTIVE_ENTRYPOINTS.has(entry)) return EMPTY$1;
494
- const own = await withSessionId(ctx, input);
531
+ const own = withSessionId(ctx, input, isObject(input) && input.hook_event_name === "SessionStart");
532
+ if (!await mayListen(own, input)) return EMPTY$1;
495
533
  const r = await waitForWorkBatch(own, {
496
534
  maxMs: LISTEN_MAX_MS,
497
535
  registerWaitMs: LISTEN_REGISTER_WAIT_MS,
@@ -525,6 +563,7 @@ const claudeAdapter = {
525
563
  plan: plan$1,
526
564
  uninstallPlan: uninstallPlan$1,
527
565
  hook: hook$1,
566
+ hookWithoutSession,
528
567
  listenEvents: [LISTEN_EVENT],
529
568
  delivery: delivery$1
530
569
  };
@@ -876,15 +915,6 @@ const V2_MIN = [
876
915
  2,
877
916
  0
878
917
  ];
879
- /**
880
- * The 2.x release Conveno is checked against (the 2.4.3 source). Older 2.x still gets the right
881
- * config, but waking is only supported from here; doctor says so.
882
- */
883
- const V2_SUPPORTED = [
884
- 2,
885
- 4,
886
- 0
887
- ];
888
918
  /** `$XDG_CONFIG_HOME/opencode` when XDG_CONFIG_HOME is an absolute path, else `~/.config/opencode`. */
889
919
  function configDir(env) {
890
920
  const xdg = env.env.XDG_CONFIG_HOME;
@@ -968,12 +998,6 @@ function atLeast(v, min) {
968
998
  function isV2OrLater(v) {
969
999
  return atLeast(v, V2_MIN);
970
1000
  }
971
- /** One line for `conveno doctor` when this OpenCode is a 2.x release older than the supported one. */
972
- async function opencodeDoctorNotes(env) {
973
- const v = await installedVersion(env);
974
- if (!v || !isV2OrLater(v) || atLeast(v, V2_SUPPORTED)) return [];
975
- return [`OpenCode ${v.join(".")} is older than 2.4, the oldest 2.x Conveno supports. Update OpenCode so waking works.`];
976
- }
977
1001
  async function installedVersion(env) {
978
1002
  try {
979
1003
  const res = await env.exec("opencode", ["--version"]);
@@ -1155,7 +1179,8 @@ const EMPTY = {
1155
1179
  * - Stopped: the turn failed or the user interrupted it. Records the end and never continues.
1156
1180
  * - Listen: the background listener. Waits for work while the session is idle.
1157
1181
  * - Requeue: the plugin could not send the prompt; puts the messages (`ids` in the input) back to queued.
1158
- * - Deleted: the OpenCode session was deleted; unregisters its Conveno session.
1182
+ * - Deleted: the OpenCode session was deleted; records that its turn is over. The window's Conveno
1183
+ * session stays: it follows whichever OpenCode session the user is in next.
1159
1184
  * - Title: prints the session's Conveno name, which the plugin sets as the OpenCode session title.
1160
1185
  */
1161
1186
  async function hook(event, input, ctx) {
@@ -1167,7 +1192,9 @@ async function hook(event, input, ctx) {
1167
1192
  const native = typeof input === "object" && input !== null ? input.sessionID : void 0;
1168
1193
  if (typeof native === "string" && native !== "") ctx = {
1169
1194
  ...ctx,
1170
- nativeId: native
1195
+ cli: ctx.cli ?? "opencode",
1196
+ nativeId: native,
1197
+ turnStart: event === "Idle" || event === "Stopped"
1171
1198
  };
1172
1199
  if (event === "Deleted") {
1173
1200
  await release(ctx, input);
@@ -1205,15 +1232,14 @@ function recordIds(client, ids) {
1205
1232
  };
1206
1233
  } });
1207
1234
  }
1208
- /** `Deleted`: the OpenCode session is gone, so its Conveno session goes offline now. */
1235
+ /**
1236
+ * `Deleted`: the OpenCode session is gone. If it is the one the window's session follows, its turn
1237
+ * (if any) is over. The window itself lives on, so the Conveno session is not removed.
1238
+ */
1209
1239
  async function release(ctx, input) {
1210
- try {
1211
- const id = input?.sessionID;
1212
- if (typeof id !== "string" || id === "") return;
1213
- const session = await ownSession(ctx);
1214
- if (!session) return;
1215
- await ctx.client["session.unregister"]({ sessionId: session.id });
1216
- } catch {}
1240
+ const id = input?.sessionID;
1241
+ if (typeof id !== "string" || id === "") return;
1242
+ await endTurnContinuation(ctx, { allowContinue: false });
1217
1243
  }
1218
1244
  /** `Requeue`: sending the prompt failed, so the messages go back to queued for the next turn. */
1219
1245
  async function requeue(ctx, input) {
@@ -1236,13 +1262,9 @@ async function sessionName(ctx) {
1236
1262
  return null;
1237
1263
  }
1238
1264
  }
1239
- /**
1240
- * Only the plugin delivers, on 1.x and 2.4+ alike; it adds nothing to a prompt the user types.
1241
- * 2.0 to 2.3 are not supported (`opencodeDoctorNotes`), so doctor claims no waking for them.
1242
- */
1265
+ /** Only the plugin delivers, on 1.x and 2.x alike; it adds nothing to a prompt the user types. */
1243
1266
  function delivery(detection) {
1244
- const v = detection.version === void 0 ? void 0 : parseVersion(detection.version);
1245
- const supported = v !== void 0 && (!isV2OrLater(v) || atLeast(v, V2_SUPPORTED));
1267
+ const supported = detection.version !== void 0 && parseVersion(detection.version) !== void 0;
1246
1268
  return {
1247
1269
  nextTurn: false,
1248
1270
  endOfTurn: supported,
@@ -1250,7 +1272,6 @@ function delivery(detection) {
1250
1272
  };
1251
1273
  }
1252
1274
  const opencodeAdapter = {
1253
- doctorNotes: opencodeDoctorNotes,
1254
1275
  cli: "opencode",
1255
1276
  displayName: "OpenCode",
1256
1277
  deliveryTier: "inbox",
@@ -1285,8 +1306,10 @@ function isProcessAlive(pid) {
1285
1306
  }
1286
1307
  function createHookCtx() {
1287
1308
  const launcherPaths = process.argv[1] ? [process.argv[1]] : [];
1309
+ const data = dataDir(process.platform, process.env, homedir());
1288
1310
  return {
1289
- dataDir: dataDir(process.platform, process.env, homedir()),
1311
+ dataDir: data,
1312
+ ...process.env.CONVENO_HOOK_LOG === "0" ? {} : { hookLog: hookLogPath(data) },
1290
1313
  adapters: [
1291
1314
  claudeAdapter,
1292
1315
  codexAdapter,
@@ -0,0 +1 @@
1
+ export { i as runHookEntry } from "./hook-entry-DWa1oppt.js";
@@ -1,16 +1,16 @@
1
- import { F as dataPaths, Wt as spawnSession, d as SPAWN_TABLE, f as SpawnError, in as CLI_KINDS, jt as realSpawnDeps, u as SPAWN_CLIS, zt as runLaunchFile } from "./dist-qONHJRJk.js";
2
- import { E as runLogout, T as runLogin, b as runRelay, i as runDoctor, m as runSetup, p as runInit, t as runUninstall, w as runAccount, x as runDaemon, y as runDevices } from "./uninstall-Blt-KHI5.js";
1
+ import { Kt as runLaunchFile, R as dataPaths, Rt as realSpawnDeps, Zt as spawnSession, d as SPAWN_CLIS, dn as CLI_KINDS, f as SPAWN_TABLE, p as SpawnError } from "./dist-CRj_cuHc.js";
2
+ import { C as runRelay, D as runAccount, O as runLogin, S as runDevices, i as runDoctor, k as runLogout, m as runSetup, p as runInit, t as runUninstall, w as runDaemon } from "./uninstall-MaS5t1CK.js";
3
3
  import { a as parseFlags, i as commandHelp, n as COMMANDS, r as COMMAND_NAMES, t as ALL_COMMAND_NAMES } from "./args-C1eX8Ixk.js";
4
- import { t as daemonProblem } from "./daemonError-DraepwsB.js";
4
+ import { t as daemonProblem } from "./daemonError-0KnkgIRo.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-CDF1A8AY.js";
8
+ import { t as runHook } from "./hook-ByduyOom.js";
9
9
  import { n as connectOpts, t as adapterEnv } from "./ctx-tYftvhz_.js";
10
- import { t as findSession } from "./pick-B-axJvgf.js";
10
+ import { t as findSession } from "./pick-BmZuv9yQ.js";
11
11
  import { readFileSync } from "node:fs";
12
12
  // src/version.ts
13
- const VERSION = "0.2.0-rc.11";
13
+ const VERSION = "0.2.0-rc.12";
14
14
  // src/errorLog.ts
15
15
  /** The message of an unexpected error, as it is. Not the softened text `plainError` gives. */
16
16
  function rawMessage(e) {
@@ -572,11 +572,11 @@ async function dispatch(name, rest, ctx) {
572
572
  case "rename": return runRename(ctx, rest);
573
573
  case "lead": return runLead(ctx, rest);
574
574
  case "spawn": return runSpawn(ctx, rest);
575
- case "acp-host": return (await import("./acp-BOSDOzU7.js")).runAcpHostCmd(ctx, rest);
576
- case "stop": return (await import("./acp-BOSDOzU7.js")).runStop(ctx, rest);
575
+ case "acp-host": return (await import("./acp-CIzgcCp9.js")).runAcpHostCmd(ctx, rest);
576
+ case "stop": return (await import("./acp-CIzgcCp9.js")).runStop(ctx, rest);
577
577
  case "spawn-run": return runSpawnRun(ctx, rest);
578
- case "agy-relay": return (await import("./agy-relay-BUo9uRng.js")).runAgyRelay(ctx, rest);
579
- case "watch": return (await import("./watch-CuZ7jPVd.js")).runWatch(ctx, rest);
578
+ case "agy-relay": return (await import("./agy-relay-Y9o-Pw9U.js")).runAgyRelay(ctx, rest);
579
+ case "watch": return (await import("./watch-CPkilo9L.js")).runWatch(ctx, rest);
580
580
  case "devices": return runDevices(ctx, rest);
581
581
  case "relay": return runRelay(ctx, rest);
582
582
  case "doctor": return runDoctor(ctx, rest);
@@ -615,7 +615,7 @@ function opensApp(env, tty = {
615
615
  async function main(argv, ctx) {
616
616
  const [command, ...rest] = argv;
617
617
  if (command === void 0 && opensApp(ctx.env)) try {
618
- return await (await import("./run-CtGfzzwB.js")).runTui(ctx);
618
+ return await (await import("./run-Df6vFm9n.js")).runTui(ctx);
619
619
  } catch (e) {
620
620
  ctx.err(`The app could not start (${rawMessage(e)}). Showing the help instead.\n`);
621
621
  ctx.out(helpText(ctx));
@@ -1,4 +1,4 @@
1
- import { vn as SessionId } from "./dist-qONHJRJk.js";
1
+ import { Tn as SessionId } from "./dist-CRj_cuHc.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) {