@kryvenaiofficial/kryven 0.2.3 → 0.2.5

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/dist/cli.mjs CHANGED
@@ -5310,7 +5310,7 @@ var require_cross_spawn = __commonJS({
5310
5310
  var cp2 = __require("child_process");
5311
5311
  var parse = require_parse();
5312
5312
  var enoent = require_enoent();
5313
- function spawn9(command, args, options) {
5313
+ function spawn10(command, args, options) {
5314
5314
  const parsed = parse(command, args, options);
5315
5315
  const spawned = cp2.spawn(parsed.command, parsed.args, parsed.options);
5316
5316
  enoent.hookChildProcess(spawned, parsed);
@@ -5322,8 +5322,8 @@ var require_cross_spawn = __commonJS({
5322
5322
  result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
5323
5323
  return result;
5324
5324
  }
5325
- module.exports = spawn9;
5326
- module.exports.spawn = spawn9;
5325
+ module.exports = spawn10;
5326
+ module.exports.spawn = spawn10;
5327
5327
  module.exports.sync = spawnSync3;
5328
5328
  module.exports._parse = parse;
5329
5329
  module.exports._enoent = enoent;
@@ -16228,7 +16228,10 @@ var init_schema = __esm({
16228
16228
  shareFingerprint: external_exports.boolean().optional(),
16229
16229
  vim: external_exports.boolean().optional(),
16230
16230
  theme: external_exports.string().optional(),
16231
- lastSessionId: external_exports.string().optional()
16231
+ lastSessionId: external_exports.string().optional(),
16232
+ // Set once the first-run setup wizard has been completed (or skipped), so it
16233
+ // doesn't run on every launch.
16234
+ setupComplete: external_exports.boolean().optional()
16232
16235
  });
16233
16236
  ProjectConfigSchema = external_exports.object({
16234
16237
  permissions: external_exports.object({
@@ -32499,7 +32502,7 @@ async function modelsCommand() {
32499
32502
  }
32500
32503
 
32501
32504
  // src/commands/chat.ts
32502
- var import_react28 = __toESM(require_react(), 1);
32505
+ var import_react30 = __toESM(require_react(), 1);
32503
32506
 
32504
32507
  // node_modules/ink/build/render.js
32505
32508
  import { Stream } from "node:stream";
@@ -37654,7 +37657,7 @@ var import_react20 = __toESM(require_react(), 1);
37654
37657
  var import_react21 = __toESM(require_react(), 1);
37655
37658
 
37656
37659
  // src/tui/REPL.tsx
37657
- var import_react27 = __toESM(require_react(), 1);
37660
+ var import_react28 = __toESM(require_react(), 1);
37658
37661
 
37659
37662
  // src/tui/Markdown.tsx
37660
37663
  var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
@@ -37807,6 +37810,9 @@ var MarkdownStream = ({
37807
37810
  ] });
37808
37811
  };
37809
37812
 
37813
+ // src/tui/PromptInput.tsx
37814
+ var import_react24 = __toESM(require_react(), 1);
37815
+
37810
37816
  // node_modules/ink-text-input/build/index.js
37811
37817
  var import_react23 = __toESM(require_react(), 1);
37812
37818
  function TextInput({ value: originalValue, placeholder = "", focus = true, mask, highlightPastedText = false, showCursor = true, onChange, onSubmit }) {
@@ -37899,6 +37905,13 @@ var build_default = TextInput;
37899
37905
 
37900
37906
  // src/tui/PromptInput.tsx
37901
37907
  var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
37908
+ var EXAMPLES = [
37909
+ "Fix the failing test",
37910
+ "Add a dark mode toggle",
37911
+ "Explain this stack trace",
37912
+ "Refactor this function",
37913
+ "Find the rate limiter"
37914
+ ];
37902
37915
  var PromptInput = ({
37903
37916
  value,
37904
37917
  onChange,
@@ -37907,26 +37920,41 @@ var PromptInput = ({
37907
37920
  placeholder,
37908
37921
  vimMode,
37909
37922
  vimCmdline,
37910
- accentColor
37923
+ accentColor,
37924
+ model,
37925
+ mood,
37926
+ themeColors
37911
37927
  }) => {
37928
+ const fg = themeColors?.fg ?? "#F5EFE6";
37929
+ const muted = themeColors?.muted ?? "#736560";
37930
+ const info = themeColors?.info ?? "#7EA8C4";
37931
+ const accent = accentColor ?? "#8B5CF6";
37912
37932
  const isStatic = disabled || vimMode === "NORMAL";
37913
- const border = disabled ? "gray" : vimMode === "NORMAL" ? "yellow" : accentColor || "cyan";
37914
- const label = vimCmdline != null ? `:${vimCmdline}` : vimMode === "NORMAL" ? "N" : vimMode === "INSERT" ? "I" : disabled ? "\xB7" : ">";
37915
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Box_default, { borderStyle: "round", borderColor: border, paddingX: 1, children: [
37916
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { color: vimMode === "NORMAL" ? "yellow" : "cyan", children: [
37917
- label,
37918
- " "
37919
- ] }),
37920
- isStatic ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: disabled ? "gray" : "white", children: value || placeholder || "" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
37921
- build_default,
37922
- {
37923
- value,
37924
- onChange,
37925
- onSubmit,
37926
- placeholder: placeholder ?? "Type a message, /help for commands, /quit to exit"
37927
- }
37928
- )
37929
- ] });
37933
+ const barColor = disabled ? muted : vimMode === "NORMAL" ? "#F59E0B" : accent;
37934
+ const example = (0, import_react24.useMemo)(() => EXAMPLES[Math.floor(Math.random() * EXAMPLES.length)], []);
37935
+ const ph = placeholder ?? `Ask anything... "${example}"`;
37936
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
37937
+ Box_default,
37938
+ {
37939
+ flexDirection: "column",
37940
+ width: "100%",
37941
+ paddingLeft: 1,
37942
+ borderStyle: "single",
37943
+ borderTop: false,
37944
+ borderRight: false,
37945
+ borderBottom: false,
37946
+ borderLeftColor: barColor,
37947
+ children: [
37948
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Box_default, { children: isStatic ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: value ? fg : muted, children: vimCmdline != null ? `:${vimCmdline}` : value || ph }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(build_default, { value, onChange, onSubmit, placeholder: ph }) }),
37949
+ (mood || model) && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Box_default, { marginTop: 1, flexDirection: "row", children: [
37950
+ mood ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: info, children: mood }) : null,
37951
+ mood && model ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: muted, children: " \xB7 " }) : null,
37952
+ model ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: fg, children: model }) : null,
37953
+ vimMode ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: muted, children: ` ${vimMode === "NORMAL" ? "N" : "I"}` }) : null
37954
+ ] })
37955
+ ]
37956
+ }
37957
+ );
37930
37958
  };
37931
37959
 
37932
37960
  // src/tui/StatusBar.tsx
@@ -37986,12 +38014,12 @@ function fmt(n2) {
37986
38014
  }
37987
38015
 
37988
38016
  // node_modules/ink-spinner/build/index.js
37989
- var import_react24 = __toESM(require_react(), 1);
38017
+ var import_react25 = __toESM(require_react(), 1);
37990
38018
  var import_cli_spinners = __toESM(require_cli_spinners(), 1);
37991
38019
  function Spinner({ type = "dots" }) {
37992
- const [frame, setFrame] = (0, import_react24.useState)(0);
38020
+ const [frame, setFrame] = (0, import_react25.useState)(0);
37993
38021
  const spinner = import_cli_spinners.default[type];
37994
- (0, import_react24.useEffect)(() => {
38022
+ (0, import_react25.useEffect)(() => {
37995
38023
  const timer = setInterval(() => {
37996
38024
  setFrame((previousFrame) => {
37997
38025
  const isLastFrame = previousFrame === spinner.frames.length - 1;
@@ -38002,7 +38030,7 @@ function Spinner({ type = "dots" }) {
38002
38030
  clearInterval(timer);
38003
38031
  };
38004
38032
  }, [spinner]);
38005
- return import_react24.default.createElement(Text, null, spinner.frames[frame]);
38033
+ return import_react25.default.createElement(Text, null, spinner.frames[frame]);
38006
38034
  }
38007
38035
  var build_default2 = Spinner;
38008
38036
 
@@ -38014,7 +38042,7 @@ var Spinner2 = ({ label }) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text
38014
38042
  ] });
38015
38043
 
38016
38044
  // src/tui/ToolCall.tsx
38017
- var import_react25 = __toESM(require_react(), 1);
38045
+ var import_react26 = __toESM(require_react(), 1);
38018
38046
  var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
38019
38047
  var STATUS_ICON = {
38020
38048
  running: "\u25D0",
@@ -38105,12 +38133,13 @@ var ToolCall = ({
38105
38133
  truncated,
38106
38134
  risk,
38107
38135
  renderHint,
38108
- collapsed = false
38136
+ collapsed = false,
38137
+ paused = false
38109
38138
  }) => {
38110
- const startRef = (0, import_react25.useRef)(Date.now());
38111
- const [elapsed, setElapsed] = (0, import_react25.useState)(0);
38112
- (0, import_react25.useEffect)(() => {
38113
- if (status !== "running") {
38139
+ const startRef = (0, import_react26.useRef)(Date.now());
38140
+ const [elapsed, setElapsed] = (0, import_react26.useState)(0);
38141
+ (0, import_react26.useEffect)(() => {
38142
+ if (status !== "running" || paused) {
38114
38143
  setElapsed(Date.now() - startRef.current);
38115
38144
  return;
38116
38145
  }
@@ -38118,7 +38147,7 @@ var ToolCall = ({
38118
38147
  setElapsed(Date.now() - startRef.current);
38119
38148
  }, 100);
38120
38149
  return () => clearInterval(id);
38121
- }, [status]);
38150
+ }, [status, paused]);
38122
38151
  const icon = STATUS_ICON[status];
38123
38152
  const statusColor = STATUS_COLOR[status];
38124
38153
  if (collapsed) {
@@ -38192,13 +38221,15 @@ var ToolCall = ({
38192
38221
  };
38193
38222
  var ToolCallList = ({
38194
38223
  entries,
38195
- collapseCompleted = false
38224
+ collapseCompleted = false,
38225
+ paused = false
38196
38226
  }) => {
38197
38227
  if (entries.length === 0) return null;
38198
38228
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Box_default, { flexDirection: "column", marginBottom: 1, children: entries.map((e) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
38199
38229
  ToolCall,
38200
38230
  {
38201
38231
  ...e,
38232
+ paused,
38202
38233
  collapsed: collapseCompleted && e.status !== "running"
38203
38234
  },
38204
38235
  e.callId
@@ -38218,63 +38249,77 @@ var CompletionMenu = ({ items, selected }) => /* @__PURE__ */ (0, import_jsx_run
38218
38249
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { color: "gray", dimColor: true, children: "Tab to complete" })
38219
38250
  ] });
38220
38251
 
38221
- // src/tui/input/complete.ts
38222
- import { opendirSync } from "node:fs";
38223
- import { join as join26, dirname as dirname12, basename as basename5 } from "node:path";
38224
-
38225
- // src/commands-palette/builtin/help.tsx
38252
+ // src/tui/ModelPicker.tsx
38226
38253
  var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
38227
- var helpCommand = {
38228
- name: "help",
38229
- description: "Show available slash commands",
38230
- run: () => ({
38231
- type: "render",
38232
- element: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(HelpPanel, {})
38233
- })
38234
- };
38235
- var HelpPanel = () => {
38236
- const commands = [...listCommands()].sort(
38237
- (a2, b) => a2.name.localeCompare(b.name)
38254
+ var VISIBLE = 10;
38255
+ var ModelPicker = ({ models, selected, current }) => {
38256
+ const total = models.length;
38257
+ const start = Math.max(
38258
+ 0,
38259
+ Math.min(selected - Math.floor(VISIBLE / 2), Math.max(0, total - VISIBLE))
38238
38260
  );
38239
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
38240
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Text, { bold: true, color: "cyan", children: [
38241
- "Kryven CLI commands (",
38242
- commands.length,
38243
- ")"
38244
- ] }),
38245
- commands.map((c3) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Box_default, { children: [
38246
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Box_default, { width: 16, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Text, { color: "cyan", children: [
38261
+ const end = Math.min(total, start + VISIBLE);
38262
+ const windowed = models.slice(start, end);
38263
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
38264
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Box_default, { children: [
38265
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { bold: true, color: "cyan", children: "Select a model " }),
38266
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Text, { color: "gray", children: [
38267
+ "\u2014 \u2191/\u2193 move \xB7 Enter switch \xB7 Esc cancel (",
38268
+ selected + 1,
38247
38269
  "/",
38248
- c3.name
38249
- ] }) }),
38250
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Text, { children: [
38251
- c3.argHint ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Text, { color: "gray", children: [
38252
- c3.argHint,
38253
- " "
38254
- ] }) : null,
38255
- c3.description
38270
+ total,
38271
+ ")"
38256
38272
  ] })
38257
- ] }, c3.name)),
38258
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { color: "gray", children: "Ctrl+C to cancel an in-flight response \xB7 Ctrl+D to exit" }) })
38273
+ ] }),
38274
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { color: "gray", dimColor: true, children: start > 0 ? " \u2191 more" : " " }),
38275
+ windowed.map((m, i2) => {
38276
+ const idx = start + i2;
38277
+ const isSel = idx === selected;
38278
+ const isCur = m.id === current;
38279
+ const cost = m.costIn != null && m.costOut != null ? ` $${m.costIn.toFixed(2)}/$${m.costOut.toFixed(2)}` : "";
38280
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Box_default, { children: [
38281
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Box_default, { width: 2, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { color: "cyanBright", children: isSel ? "\u25B6" : " " }) }),
38282
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Box_default, { width: 30, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Text, { color: isSel ? "greenBright" : "white", bold: isSel, children: [
38283
+ m.id,
38284
+ isCur ? " \u25CF" : ""
38285
+ ] }) }),
38286
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Text, { color: "gray", children: [
38287
+ m.publisher,
38288
+ m.description ? ` \u2014 ${m.description}` : "",
38289
+ cost
38290
+ ] })
38291
+ ] }, m.id);
38292
+ }),
38293
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { color: "gray", dimColor: true, children: end < total ? " \u2193 more" : " " })
38259
38294
  ] });
38260
38295
  };
38261
38296
 
38262
- // src/commands-palette/builtin/clear.ts
38263
- var clearCommand = {
38264
- name: "clear",
38265
- description: "Wipe conversation and start fresh",
38266
- run: () => ({ type: "clear" })
38267
- };
38268
-
38269
- // src/commands-palette/builtin/quit.ts
38270
- var quitCommand = {
38271
- name: "quit",
38272
- description: "Exit",
38273
- run: () => ({ type: "exit" })
38274
- };
38275
- var exitCommand = {
38276
- ...quitCommand,
38277
- name: "exit"
38297
+ // src/tui/Wordmark.tsx
38298
+ var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
38299
+ var ROWS = [
38300
+ "## ## ##### ## ## ## ## ##### ## ##",
38301
+ "## ## ## ## #### ## ## ## ### ##",
38302
+ "#### ##### ## ## ## ##### #### ##",
38303
+ "## ## ## ## ## ## ## ## ## ####",
38304
+ "## ## ## ## ## ### ##### ## ###"
38305
+ ];
38306
+ var Wordmark = ({ muted, fg }) => {
38307
+ const rows = ROWS.map((r) => r.replace(/#/g, "\u2588"));
38308
+ const width = Math.max(...rows.map((r) => r.length));
38309
+ const mid = Math.floor(width / 2);
38310
+ let split = mid;
38311
+ outer: for (let d = 0; d <= mid; d++) {
38312
+ for (const c3 of [mid - d, mid + d]) {
38313
+ if (c3 >= 0 && c3 <= width && rows.every((r) => (r[c3] ?? " ") === " ")) {
38314
+ split = c3;
38315
+ break outer;
38316
+ }
38317
+ }
38318
+ }
38319
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Box_default, { flexDirection: "column", children: rows.map((line, i2) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Box_default, { flexDirection: "row", children: [
38320
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text, { color: muted, children: line.slice(0, split) }),
38321
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text, { bold: true, color: fg, children: line.slice(split) })
38322
+ ] }, i2)) });
38278
38323
  };
38279
38324
 
38280
38325
  // src/commands-palette/parser.ts
@@ -38351,24 +38396,6 @@ var MODELS = [
38351
38396
  { id: "mistral-small-3.2-abliterated", publisher: "fabhaus", description: "Mistral Small 3.2, abliterated" }
38352
38397
  ];
38353
38398
  var KNOWN_IDS = new Set(MODELS.map((m) => m.id));
38354
- function formatPicker() {
38355
- const byPub = /* @__PURE__ */ new Map();
38356
- for (const m of MODELS) {
38357
- const arr = byPub.get(m.publisher) || [];
38358
- arr.push(m);
38359
- byPub.set(m.publisher, arr);
38360
- }
38361
- const lines = [];
38362
- for (const [pub, arr] of byPub) {
38363
- lines.push(` ${pub}:`);
38364
- for (const m of arr) {
38365
- const cost = m.costIn != null && m.costOut != null ? ` $${m.costIn.toFixed(2)}/$${m.costOut.toFixed(2)} per M` : "";
38366
- const desc = m.description ? ` \u2014 ${m.description}` : "";
38367
- lines.push(` ${m.id}${cost}${desc}`);
38368
- }
38369
- }
38370
- return lines.join("\n");
38371
- }
38372
38399
  function publisherFor(id) {
38373
38400
  return MODELS.find((m) => m.id === id)?.publisher ?? "(unknown)";
38374
38401
  }
@@ -38379,15 +38406,7 @@ var modelCommand = {
38379
38406
  run: (args, ctx) => {
38380
38407
  const trimmed = args.trim();
38381
38408
  if (!trimmed) {
38382
- return {
38383
- type: "ack",
38384
- message: `Current: ${ctx.model} (${publisherFor(ctx.model)})
38385
-
38386
- Available models (${MODELS.length}):
38387
- ` + formatPicker() + `
38388
-
38389
- Switch with: /model <id-or-substring>`
38390
- };
38409
+ return { type: "model-picker" };
38391
38410
  }
38392
38411
  if (KNOWN_IDS.has(trimmed)) {
38393
38412
  ctx.setModel(trimmed);
@@ -38426,8 +38445,96 @@ var moodCommand = {
38426
38445
  }
38427
38446
  };
38428
38447
 
38448
+ // src/tui/input/complete.ts
38449
+ import { opendirSync } from "node:fs";
38450
+ import { join as join26, dirname as dirname12, basename as basename5 } from "node:path";
38451
+
38452
+ // src/commands-palette/builtin/help.tsx
38453
+ var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
38454
+ var helpCommand = {
38455
+ name: "help",
38456
+ description: "Show available slash commands",
38457
+ run: () => ({
38458
+ type: "render",
38459
+ element: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(HelpPanel, {})
38460
+ })
38461
+ };
38462
+ var HelpPanel = () => {
38463
+ const commands = [...listCommands()].sort(
38464
+ (a2, b) => a2.name.localeCompare(b.name)
38465
+ );
38466
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
38467
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { bold: true, color: "cyan", children: [
38468
+ "Kryven CLI commands (",
38469
+ commands.length,
38470
+ ")"
38471
+ ] }),
38472
+ commands.map((c3) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { children: [
38473
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Box_default, { width: 16, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { color: "cyan", children: [
38474
+ "/",
38475
+ c3.name
38476
+ ] }) }),
38477
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { children: [
38478
+ c3.argHint ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { color: "gray", children: [
38479
+ c3.argHint,
38480
+ " "
38481
+ ] }) : null,
38482
+ c3.description
38483
+ ] })
38484
+ ] }, c3.name)),
38485
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: "gray", children: "Ctrl+C to cancel an in-flight response \xB7 Ctrl+D to exit" }) })
38486
+ ] });
38487
+ };
38488
+
38489
+ // src/commands-palette/builtin/clear.ts
38490
+ var clearCommand = {
38491
+ name: "clear",
38492
+ description: "Wipe conversation and start fresh",
38493
+ run: () => ({ type: "clear" })
38494
+ };
38495
+
38496
+ // src/commands-palette/builtin/quit.ts
38497
+ var quitCommand = {
38498
+ name: "quit",
38499
+ description: "Exit",
38500
+ run: () => ({ type: "exit" })
38501
+ };
38502
+ var exitCommand = {
38503
+ ...quitCommand,
38504
+ name: "exit"
38505
+ };
38506
+
38507
+ // src/commands-palette/builtin/login.ts
38508
+ init_crypto();
38509
+ var loginCommand2 = {
38510
+ name: "login",
38511
+ description: "Sign in / re-enter your API key (kry_sk_\u2026) for this session",
38512
+ argHint: "<kry_sk_\u2026>",
38513
+ run: async (args, ctx) => {
38514
+ const key = args.trim();
38515
+ if (!key) {
38516
+ return {
38517
+ type: "ack",
38518
+ message: "Usage: /login <kry_sk_\u2026>\nPaste your Kryven API key to sign in again (e.g. after it was disabled or rotated). It's validated against /v1/models, saved to ~/.kryven/config.json, and used immediately. Get a key at https://kryven.cc/api-dashboard."
38519
+ };
38520
+ }
38521
+ if (!isValidApiKey(key)) {
38522
+ return {
38523
+ type: "error",
38524
+ message: 'Invalid key format. Expected "kry_sk_" followed by 48 hex chars.'
38525
+ };
38526
+ }
38527
+ if (!ctx.relogin) {
38528
+ return { type: "error", message: "Re-login isn't available here. Exit and run: kryven login" };
38529
+ }
38530
+ const res = await ctx.relogin(key);
38531
+ if (!res.ok) return { type: "error", message: res.message };
38532
+ return { type: "ack", message: `${res.message} (${maskApiKey(key)})` };
38533
+ }
38534
+ };
38535
+
38429
38536
  // src/commands-palette/builtin/cost.tsx
38430
- var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
38537
+ var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
38431
38538
  var RATES = {
38432
38539
  flash: { in: 0.5, out: 4 },
38433
38540
  extended: { in: 0.65, out: 7 },
@@ -38459,7 +38566,7 @@ var costCommand = {
38459
38566
  description: "Show token usage this session",
38460
38567
  run: (_args, ctx) => ({
38461
38568
  type: "render",
38462
- element: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CostPanel, { ctx })
38569
+ element: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CostPanel, { ctx })
38463
38570
  })
38464
38571
  };
38465
38572
  var CostPanel = ({ ctx }) => {
@@ -38476,38 +38583,38 @@ var CostPanel = ({ ctx }) => {
38476
38583
  const rate = rateFor(ctx.model);
38477
38584
  const tierLabel = tierFor(ctx.model);
38478
38585
  const usd = sessionCostUsd(ctx.conversation.all(), ctx.model);
38479
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 1, children: [
38480
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text, { bold: true, color: "magenta", children: "Session cost" }),
38481
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Text, { children: [
38586
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 1, children: [
38587
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { bold: true, color: "magenta", children: "Session cost" }),
38588
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { children: [
38482
38589
  "Model: ",
38483
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text, { color: "cyan", children: ctx.model }),
38590
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { color: "cyan", children: ctx.model }),
38484
38591
  " (tier ",
38485
38592
  tierLabel,
38486
38593
  ")"
38487
38594
  ] }),
38488
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Text, { children: [
38595
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { children: [
38489
38596
  "Messages: ",
38490
38597
  ctx.conversation.size()
38491
38598
  ] }),
38492
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Text, { children: [
38599
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { children: [
38493
38600
  "Prompt tokens: ",
38494
38601
  promptTok.toLocaleString(),
38495
38602
  " \xB7 Completion tokens:",
38496
38603
  " ",
38497
38604
  completionTok.toLocaleString()
38498
38605
  ] }),
38499
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Text, { children: [
38606
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { children: [
38500
38607
  "Kryven tokens charged: ",
38501
38608
  kryvenTok.toLocaleString()
38502
38609
  ] }),
38503
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Text, { children: [
38610
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { children: [
38504
38611
  "Approx USD: ",
38505
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Text, { color: "green", children: [
38612
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { color: "green", children: [
38506
38613
  "$",
38507
38614
  usd.toFixed(4)
38508
38615
  ] })
38509
38616
  ] }),
38510
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Text, { color: "gray", children: [
38617
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { color: "gray", children: [
38511
38618
  "(Rates: $",
38512
38619
  rate.in,
38513
38620
  "/M in, $",
@@ -38537,7 +38644,7 @@ function setSkills(skills) {
38537
38644
  }
38538
38645
 
38539
38646
  // src/commands-palette/builtin/skill.tsx
38540
- var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
38647
+ var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
38541
38648
  var skillCommand = {
38542
38649
  name: "skill",
38543
38650
  description: "Run an installed skill (or list all)",
@@ -38551,17 +38658,17 @@ var skillCommand = {
38551
38658
  }
38552
38659
  return {
38553
38660
  type: "render",
38554
- element: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
38555
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { bold: true, color: "cyan", children: [
38661
+ element: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
38662
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Text, { bold: true, color: "cyan", children: [
38556
38663
  "Skills (",
38557
38664
  all.length,
38558
38665
  ")"
38559
38666
  ] }),
38560
- all.map((s2) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { children: [
38561
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Box_default, { width: 28, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: "cyan", children: s2.name }) }),
38562
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: "gray", children: s2.frontmatter.description || "" })
38667
+ all.map((s2) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Box_default, { children: [
38668
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Box_default, { width: 28, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { color: "cyan", children: s2.name }) }),
38669
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { color: "gray", children: s2.frontmatter.description || "" })
38563
38670
  ] }, s2.name)),
38564
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { color: "gray", children: [
38671
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Text, { color: "gray", children: [
38565
38672
  "Run with: /skill ",
38566
38673
  "<name>",
38567
38674
  " [args]"
@@ -38791,7 +38898,7 @@ function listAgents() {
38791
38898
  }
38792
38899
 
38793
38900
  // src/commands-palette/builtin/agent.tsx
38794
- var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
38901
+ var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
38795
38902
  var agentCommand = {
38796
38903
  name: "agent",
38797
38904
  description: "Activate a custom subagent (or list available)",
@@ -38805,17 +38912,17 @@ var agentCommand = {
38805
38912
  }
38806
38913
  return {
38807
38914
  type: "render",
38808
- element: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
38809
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { bold: true, color: "cyan", children: [
38915
+ element: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
38916
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Text, { bold: true, color: "cyan", children: [
38810
38917
  "Custom agents (",
38811
38918
  all.length,
38812
38919
  ")"
38813
38920
  ] }),
38814
- all.map((a3) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Box_default, { children: [
38815
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box_default, { width: 28, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { color: "cyan", children: a3.name }) }),
38816
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { color: "gray", children: a3.description })
38921
+ all.map((a3) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Box_default, { children: [
38922
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Box_default, { width: 28, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color: "cyan", children: a3.name }) }),
38923
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color: "gray", children: a3.description })
38817
38924
  ] }, a3.name)),
38818
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { color: "gray", children: [
38925
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Text, { color: "gray", children: [
38819
38926
  "Activate with: /agent ",
38820
38927
  "<name>"
38821
38928
  ] })
@@ -38844,7 +38951,7 @@ ${a2.allowedTools.length ? `
38844
38951
 
38845
38952
  // src/commands-palette/builtin/diff.tsx
38846
38953
  init_execa();
38847
- var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
38954
+ var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
38848
38955
  var diffCommand = {
38849
38956
  name: "diff",
38850
38957
  description: "Show the working-tree git diff (use --stat for a summary)",
@@ -38873,16 +38980,16 @@ var diffCommand = {
38873
38980
  const truncated = raw.split("\n").length > 200;
38874
38981
  return {
38875
38982
  type: "render",
38876
- element: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Box_default, { flexDirection: "column", children: [
38877
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Text, { bold: true, color: "magentaBright", children: [
38983
+ element: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Box_default, { flexDirection: "column", children: [
38984
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Text, { bold: true, color: "magentaBright", children: [
38878
38985
  "git diff",
38879
38986
  statOnly ? " --stat" : ""
38880
38987
  ] }),
38881
38988
  lines.map((l, i2) => {
38882
38989
  const color = l.startsWith("+") && !l.startsWith("+++") ? "green" : l.startsWith("-") && !l.startsWith("---") ? "red" : l.startsWith("@@") ? "cyan" : l.startsWith("diff ") || l.startsWith("index ") ? "yellow" : "gray";
38883
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { color, children: l.length > 200 ? l.slice(0, 200) + " \u2026" : l || "\xA0" }, i2);
38990
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color, children: l.length > 200 ? l.slice(0, 200) + " \u2026" : l || "\xA0" }, i2);
38884
38991
  }),
38885
- truncated ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { color: "gray", children: "\u2026 (diff truncated)" }) : null
38992
+ truncated ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: "gray", children: "\u2026 (diff truncated)" }) : null
38886
38993
  ] })
38887
38994
  };
38888
38995
  }
@@ -39055,7 +39162,7 @@ function renderRepoMap(map, opts = {}) {
39055
39162
  }
39056
39163
 
39057
39164
  // src/commands-palette/builtin/map.tsx
39058
- var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
39165
+ var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
39059
39166
  var mapCommand = {
39060
39167
  name: "map",
39061
39168
  description: "Show a symbol map of the current repo (optionally filtered by query)",
@@ -39072,9 +39179,9 @@ var mapCommand = {
39072
39179
  const lines = text.split("\n");
39073
39180
  return {
39074
39181
  type: "render",
39075
- element: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Box_default, { flexDirection: "column", children: [
39076
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { bold: true, color: "magentaBright", children: lines[0] }),
39077
- lines.slice(1).map((l, i2) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color: "gray", children: l }, i2))
39182
+ element: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Box_default, { flexDirection: "column", children: [
39183
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { bold: true, color: "magentaBright", children: lines[0] }),
39184
+ lines.slice(1).map((l, i2) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { color: "gray", children: l }, i2))
39078
39185
  ] })
39079
39186
  };
39080
39187
  }
@@ -39177,7 +39284,7 @@ async function uninstallSkill(name) {
39177
39284
  }
39178
39285
 
39179
39286
  // src/commands-palette/builtin/skills.tsx
39180
- var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
39287
+ var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
39181
39288
  var SCOPE_COLOR = {
39182
39289
  "project-kryven": "cyan",
39183
39290
  "project-claude": "cyan",
@@ -39196,35 +39303,35 @@ var SkillRow = ({ skill }) => {
39196
39303
  const desc = skill.frontmatter.description || "(no description)";
39197
39304
  const scope = SCOPE_LABEL[skill.scope];
39198
39305
  const scopeColor = SCOPE_COLOR[skill.scope];
39199
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Box_default, { children: [
39200
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Box_default, { width: 26, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: "magentaBright", children: skill.name }) }),
39201
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Box_default, { width: 10, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Text, { color: scopeColor, children: [
39306
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Box_default, { children: [
39307
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Box_default, { width: 26, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text, { color: "magentaBright", children: skill.name }) }),
39308
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Box_default, { width: 10, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Text, { color: scopeColor, children: [
39202
39309
  "[",
39203
39310
  scope,
39204
39311
  "]"
39205
39312
  ] }) }),
39206
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: "gray", children: desc })
39313
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text, { color: "gray", children: desc })
39207
39314
  ] });
39208
39315
  };
39209
- var SkillList = ({ skills }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 1, children: [
39210
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Text, { bold: true, color: "magentaBright", children: [
39316
+ var SkillList = ({ skills }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 1, children: [
39317
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Text, { bold: true, color: "magentaBright", children: [
39211
39318
  "Skills (",
39212
39319
  skills.length,
39213
39320
  " installed)"
39214
39321
  ] }),
39215
- skills.map((s) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SkillRow, { skill: s }, s.name)),
39216
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
39217
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Text, { color: "gray", children: [
39322
+ skills.map((s) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SkillRow, { skill: s }, s.name)),
39323
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
39324
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Text, { color: "gray", children: [
39218
39325
  " /skills install ",
39219
39326
  "<url|path>",
39220
39327
  " \u2014 install a skill from GitHub or local path"
39221
39328
  ] }),
39222
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Text, { color: "gray", children: [
39329
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Text, { color: "gray", children: [
39223
39330
  " /skills uninstall ",
39224
39331
  "<name>",
39225
39332
  " \u2014 remove a user-installed skill"
39226
39333
  ] }),
39227
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Text, { color: "gray", children: [
39334
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Text, { color: "gray", children: [
39228
39335
  " /skills info ",
39229
39336
  "<name>",
39230
39337
  " \u2014 show full skill metadata"
@@ -39247,19 +39354,19 @@ var SkillDetail = ({ skill }) => {
39247
39354
  ["Source", skill.sourcePath]
39248
39355
  ];
39249
39356
  const bodyPreview = skill.body.trim().split("\n").slice(0, 6).join("\n");
39250
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 1, children: [
39251
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Text, { bold: true, color: "magentaBright", children: [
39357
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 1, children: [
39358
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Text, { bold: true, color: "magentaBright", children: [
39252
39359
  "Skill: ",
39253
39360
  skill.name
39254
39361
  ] }),
39255
- rows.map(([k, v]) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Box_default, { children: [
39256
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Box_default, { width: 22, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: "gray", children: k }) }),
39257
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { children: v })
39362
+ rows.map(([k, v]) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Box_default, { children: [
39363
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Box_default, { width: 22, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text, { color: "gray", children: k }) }),
39364
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text, { children: v })
39258
39365
  ] }, k)),
39259
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
39260
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: "gray", children: "Body preview:" }),
39261
- bodyPreview.split("\n").map((l, i2) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: "white", children: l }, i2)),
39262
- skill.body.trim().split("\n").length > 6 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Text, { color: "gray", children: [
39366
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
39367
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text, { color: "gray", children: "Body preview:" }),
39368
+ bodyPreview.split("\n").map((l, i2) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text, { color: "white", children: l }, i2)),
39369
+ skill.body.trim().split("\n").length > 6 && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Text, { color: "gray", children: [
39263
39370
  "\u2026 (truncated \u2014 ",
39264
39371
  skill.body.trim().split("\n").length,
39265
39372
  " lines total)"
@@ -39277,7 +39384,7 @@ function runList() {
39277
39384
  }
39278
39385
  return {
39279
39386
  type: "render",
39280
- element: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SkillList, { skills: all })
39387
+ element: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SkillList, { skills: all })
39281
39388
  };
39282
39389
  }
39283
39390
  function runInfo(name) {
@@ -39290,7 +39397,7 @@ function runInfo(name) {
39290
39397
  }
39291
39398
  return {
39292
39399
  type: "render",
39293
- element: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SkillDetail, { skill: s })
39400
+ element: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SkillDetail, { skill: s })
39294
39401
  };
39295
39402
  }
39296
39403
  async function runInstall(source, cwd2) {
@@ -39364,7 +39471,7 @@ var skillsCommand = {
39364
39471
  };
39365
39472
 
39366
39473
  // src/commands-palette/builtin/search.tsx
39367
- var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
39474
+ var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
39368
39475
  import { readdir as readdir3, stat as stat2, readFile as readFile3 } from "node:fs/promises";
39369
39476
  import { join as join6, relative } from "node:path";
39370
39477
  var IGNORE_DIRS = /* @__PURE__ */ new Set([
@@ -39464,34 +39571,34 @@ async function contentSearch(pattern, cwd2) {
39464
39571
  }
39465
39572
  return { matches, truncated };
39466
39573
  }
39467
- var FileNameResultsPanel = ({ query, results }) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Box_default, { flexDirection: "column", children: [
39468
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Text, { bold: true, color: "magentaBright", children: [
39574
+ var FileNameResultsPanel = ({ query, results }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Box_default, { flexDirection: "column", children: [
39575
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Text, { bold: true, color: "magentaBright", children: [
39469
39576
  results.length,
39470
39577
  ' file(s) matching "',
39471
39578
  query,
39472
39579
  '"'
39473
39580
  ] }),
39474
- results.map(({ rel }) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Box_default, { children: [
39475
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { color: "gray", children: " " }),
39476
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { color: "cyan", children: rel })
39581
+ results.map(({ rel }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Box_default, { children: [
39582
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { color: "gray", children: " " }),
39583
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { color: "cyan", children: rel })
39477
39584
  ] }, rel))
39478
39585
  ] });
39479
- var ContentResultsPanel = ({ pattern, matches, truncated }) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Box_default, { flexDirection: "column", children: [
39480
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Text, { bold: true, color: "magentaBright", children: [
39586
+ var ContentResultsPanel = ({ pattern, matches, truncated }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Box_default, { flexDirection: "column", children: [
39587
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Text, { bold: true, color: "magentaBright", children: [
39481
39588
  matches.length,
39482
39589
  " match line(s) for /",
39483
39590
  pattern,
39484
39591
  "/",
39485
39592
  truncated ? " (truncated)" : ""
39486
39593
  ] }),
39487
- matches.map(({ rel, line, snippet }, i2) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Box_default, { flexDirection: "row", children: [
39488
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { color: "cyan", children: rel }),
39489
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Text, { color: "gray", children: [
39594
+ matches.map(({ rel, line, snippet }, i2) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Box_default, { flexDirection: "row", children: [
39595
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { color: "cyan", children: rel }),
39596
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Text, { color: "gray", children: [
39490
39597
  ":",
39491
39598
  line,
39492
39599
  ": "
39493
39600
  ] }),
39494
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { children: snippet.length > 80 ? snippet.slice(0, 80) + " \u2026" : snippet })
39601
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { children: snippet.length > 80 ? snippet.slice(0, 80) + " \u2026" : snippet })
39495
39602
  ] }, i2))
39496
39603
  ] });
39497
39604
  var searchCommand = {
@@ -39520,7 +39627,7 @@ var searchCommand = {
39520
39627
  }
39521
39628
  return {
39522
39629
  type: "render",
39523
- element: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ContentResultsPanel, { pattern, matches, truncated })
39630
+ element: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ContentResultsPanel, { pattern, matches, truncated })
39524
39631
  };
39525
39632
  }
39526
39633
  const results = await fileNameSearch(trimmed, ctx.cwd);
@@ -39529,13 +39636,13 @@ var searchCommand = {
39529
39636
  }
39530
39637
  return {
39531
39638
  type: "render",
39532
- element: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FileNameResultsPanel, { query: trimmed, results })
39639
+ element: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(FileNameResultsPanel, { query: trimmed, results })
39533
39640
  };
39534
39641
  }
39535
39642
  };
39536
39643
 
39537
39644
  // src/commands-palette/builtin/new.tsx
39538
- var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
39645
+ var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
39539
39646
  var TEMPLATES = [
39540
39647
  {
39541
39648
  name: "react",
@@ -39581,14 +39688,14 @@ var TEMPLATES = [
39581
39688
  }
39582
39689
  ];
39583
39690
  var TEMPLATE_MAP = new Map(TEMPLATES.map((t) => [t.name, t]));
39584
- var TemplatePicker = () => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 1, children: [
39585
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text, { bold: true, color: "magentaBright", children: "New conversation \u2014 choose a template" }),
39586
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: TEMPLATES.map((t) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Box_default, { children: [
39587
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Box_default, { width: 12, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text, { color: "magenta", children: t.name }) }),
39588
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Box_default, { width: 22, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text, { bold: true, children: t.label }) }),
39589
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text, { color: "gray", children: t.description })
39691
+ var TemplatePicker = () => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 1, children: [
39692
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { bold: true, color: "magentaBright", children: "New conversation \u2014 choose a template" }),
39693
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: TEMPLATES.map((t) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Box_default, { children: [
39694
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Box_default, { width: 12, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: "magenta", children: t.name }) }),
39695
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Box_default, { width: 22, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { bold: true, children: t.label }) }),
39696
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: "gray", children: t.description })
39590
39697
  ] }, t.name)) }),
39591
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Text, { color: "gray", children: [
39698
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Text, { color: "gray", children: [
39592
39699
  "Start with: /new ",
39593
39700
  "<name>",
39594
39701
  " \xB7 Blank session: /new blank"
@@ -39603,7 +39710,7 @@ var newCommand = {
39603
39710
  if (!arg) {
39604
39711
  return {
39605
39712
  type: "render",
39606
- element: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TemplatePicker, {})
39713
+ element: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TemplatePicker, {})
39607
39714
  };
39608
39715
  }
39609
39716
  if (arg === "blank") {
@@ -39713,7 +39820,7 @@ var exportCommand = {
39713
39820
 
39714
39821
  // src/commands-palette/builtin/permissions.tsx
39715
39822
  init_schema();
39716
- var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
39823
+ var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
39717
39824
  import { existsSync as existsSync8, readFileSync as readFileSync6, writeFileSync as writeFileSync3, mkdirSync as mkdirSync3 } from "node:fs";
39718
39825
  import { join as join8, dirname as dirname4 } from "node:path";
39719
39826
  function settingsPath(cwd2) {
@@ -39798,14 +39905,14 @@ function resetRules(cwd2) {
39798
39905
  const next = { ...cfg, permissions: { allow: [], ask: [], deny: [] } };
39799
39906
  writeProjectConfig(cwd2, next);
39800
39907
  }
39801
- var BucketSection = ({ label, color, rules, emptyNote }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
39802
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { bold: true, color, children: label }),
39803
- rules.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Text, { color: "gray", children: [
39908
+ var BucketSection = ({ label, color, rules, emptyNote }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
39909
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { bold: true, color, children: label }),
39910
+ rules.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { color: "gray", children: [
39804
39911
  " ",
39805
39912
  emptyNote
39806
- ] }) : rules.map((r) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Text, { color: "white", children: [
39913
+ ] }) : rules.map((r) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { color: "white", children: [
39807
39914
  " ",
39808
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { color, children: "\u2022" }),
39915
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color, children: "\u2022" }),
39809
39916
  " ",
39810
39917
  r
39811
39918
  ] }, r))
@@ -39815,7 +39922,7 @@ var PermissionsView = ({
39815
39922
  ask,
39816
39923
  deny,
39817
39924
  configPath
39818
- }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
39925
+ }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
39819
39926
  Box_default,
39820
39927
  {
39821
39928
  flexDirection: "column",
@@ -39824,10 +39931,10 @@ var PermissionsView = ({
39824
39931
  paddingX: 1,
39825
39932
  paddingY: 0,
39826
39933
  children: [
39827
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { bold: true, color: "magentaBright", children: "Project permissions" }),
39828
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { color: "gray", children: configPath }),
39829
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
39830
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
39934
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { bold: true, color: "magentaBright", children: "Project permissions" }),
39935
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "gray", children: configPath }),
39936
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
39937
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
39831
39938
  BucketSection,
39832
39939
  {
39833
39940
  label: "allow (auto-approve these tools)",
@@ -39836,7 +39943,7 @@ var PermissionsView = ({
39836
39943
  emptyNote: "(none)"
39837
39944
  }
39838
39945
  ),
39839
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
39946
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
39840
39947
  BucketSection,
39841
39948
  {
39842
39949
  label: "ask (always prompt before running)",
@@ -39845,7 +39952,7 @@ var PermissionsView = ({
39845
39952
  emptyNote: "(none \u2014 risk model decides)"
39846
39953
  }
39847
39954
  ),
39848
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
39955
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
39849
39956
  BucketSection,
39850
39957
  {
39851
39958
  label: "deny (never run these tools)",
@@ -39855,20 +39962,20 @@ var PermissionsView = ({
39855
39962
  }
39856
39963
  )
39857
39964
  ] }),
39858
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
39859
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { color: "gray", children: "Risk model defaults:" }),
39860
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { color: "gray", children: " low (read-only) \u2192 auto-allow" }),
39861
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { color: "gray", children: " medium (writes/net) \u2192 ask once per session" }),
39862
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { color: "gray", children: " high (destructive) \u2192 always ask" })
39965
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
39966
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "gray", children: "Risk model defaults:" }),
39967
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "gray", children: " low (read-only) \u2192 auto-allow" }),
39968
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "gray", children: " medium (writes/net) \u2192 ask once per session" }),
39969
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "gray", children: " high (destructive) \u2192 always ask" })
39863
39970
  ] }),
39864
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
39865
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Text, { color: "gray", children: [
39971
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
39972
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { color: "gray", children: [
39866
39973
  "Manage: /permissions allow|ask|deny ",
39867
39974
  "<pattern>",
39868
39975
  " \xB7 /permissions rm ",
39869
39976
  "<pattern>"
39870
39977
  ] }),
39871
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { color: "gray", children: "Reset: /permissions reset --confirm" })
39978
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "gray", children: "Reset: /permissions reset --confirm" })
39872
39979
  ] })
39873
39980
  ]
39874
39981
  }
@@ -39885,7 +39992,7 @@ var permissionsCommand = {
39885
39992
  const { allow, ask, deny } = normalizePermissions(cfg);
39886
39993
  return {
39887
39994
  type: "render",
39888
- element: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
39995
+ element: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
39889
39996
  PermissionsView,
39890
39997
  {
39891
39998
  allow,
@@ -39964,7 +40071,7 @@ var permissionsCommand = {
39964
40071
  };
39965
40072
 
39966
40073
  // src/commands-palette/builtin/agents.tsx
39967
- var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
40074
+ var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
39968
40075
  var SCOPE_LABEL2 = {
39969
40076
  "project-kryven": "project",
39970
40077
  "project-claude": "project",
@@ -39994,17 +40101,17 @@ var AgentRow = ({ agent }) => {
39994
40101
  const tagColor = SCOPE_COLOR2[agent.scope] ?? "gray";
39995
40102
  const modelNote = agent.model ? ` [${agent.model}]` : "";
39996
40103
  const toolNote = agent.allowedTools.length > 0 ? ` \xB7 tools: ${agent.allowedTools.slice(0, 4).join(", ")}${agent.allowedTools.length > 4 ? " \u2026" : ""}` : "";
39997
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Box_default, { flexDirection: "column", marginBottom: 0, children: [
39998
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Box_default, { children: [
39999
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Box_default, { width: 24, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: "magentaBright", bold: true, children: agent.name }) }),
40000
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Text, { color: tagColor, dimColor: true, children: [
40104
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Box_default, { flexDirection: "column", marginBottom: 0, children: [
40105
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Box_default, { children: [
40106
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Box_default, { width: 24, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "magentaBright", bold: true, children: agent.name }) }),
40107
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { color: tagColor, dimColor: true, children: [
40001
40108
  "[",
40002
40109
  scopeTag(agent),
40003
40110
  "]"
40004
40111
  ] }),
40005
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: "gray", children: modelNote })
40112
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "gray", children: modelNote })
40006
40113
  ] }),
40007
- agent.description || toolNote ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Text, { color: "gray", children: [
40114
+ agent.description || toolNote ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { color: "gray", children: [
40008
40115
  agent.description || "",
40009
40116
  toolNote
40010
40117
  ] }) }) : null
@@ -40012,7 +40119,7 @@ var AgentRow = ({ agent }) => {
40012
40119
  };
40013
40120
  var BrowserPanel = ({ agents }) => {
40014
40121
  const groups = groupByScope(agents);
40015
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
40122
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
40016
40123
  Box_default,
40017
40124
  {
40018
40125
  flexDirection: "column",
@@ -40020,30 +40127,30 @@ var BrowserPanel = ({ agents }) => {
40020
40127
  borderColor: "magentaBright",
40021
40128
  paddingX: 1,
40022
40129
  children: [
40023
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Text, { bold: true, color: "magentaBright", children: [
40130
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { bold: true, color: "magentaBright", children: [
40024
40131
  "Custom agents (",
40025
40132
  agents.length,
40026
40133
  ")"
40027
40134
  ] }),
40028
- [...groups.entries()].map(([label, group]) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
40029
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Text, { color: "cyan", bold: true, children: [
40135
+ [...groups.entries()].map(([label, group]) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
40136
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { color: "cyan", bold: true, children: [
40030
40137
  label,
40031
40138
  " scope (",
40032
40139
  group.length,
40033
40140
  ")"
40034
40141
  ] }),
40035
- group.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AgentRow, { agent: a2 }, a2.name))
40142
+ group.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(AgentRow, { agent: a2 }, a2.name))
40036
40143
  ] }, label)),
40037
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
40038
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Text, { color: "gray", children: [
40144
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
40145
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { color: "gray", children: [
40039
40146
  "Activate: /agents ",
40040
40147
  "<name>"
40041
40148
  ] }),
40042
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Text, { color: "gray", children: [
40149
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { color: "gray", children: [
40043
40150
  "Inspect: /agents --info ",
40044
40151
  "<name>"
40045
40152
  ] }),
40046
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Text, { color: "gray", children: [
40153
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { color: "gray", children: [
40047
40154
  "Drop agents at .kryven/agents/",
40048
40155
  "<name>",
40049
40156
  ".md or ~/.kryven/agents/",
@@ -40058,7 +40165,7 @@ var BrowserPanel = ({ agents }) => {
40058
40165
  var InfoPanel = ({ agent }) => {
40059
40166
  const promptLines = agent.systemPrompt.split("\n").slice(0, 20);
40060
40167
  const truncated = agent.systemPrompt.split("\n").length > 20;
40061
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
40168
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
40062
40169
  Box_default,
40063
40170
  {
40064
40171
  flexDirection: "column",
@@ -40066,36 +40173,36 @@ var InfoPanel = ({ agent }) => {
40066
40173
  borderColor: "magentaBright",
40067
40174
  paddingX: 1,
40068
40175
  children: [
40069
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Text, { bold: true, color: "magentaBright", children: [
40176
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { bold: true, color: "magentaBright", children: [
40070
40177
  "Agent: ",
40071
40178
  agent.name
40072
40179
  ] }),
40073
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
40074
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Box_default, { children: [
40075
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: "gray", children: "Scope" }) }),
40076
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: "cyan", children: scopeTag(agent) })
40180
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
40181
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Box_default, { children: [
40182
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "gray", children: "Scope" }) }),
40183
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "cyan", children: scopeTag(agent) })
40077
40184
  ] }),
40078
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Box_default, { children: [
40079
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: "gray", children: "Model" }) }),
40080
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { children: agent.model ?? "(default)" })
40185
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Box_default, { children: [
40186
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "gray", children: "Model" }) }),
40187
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { children: agent.model ?? "(default)" })
40081
40188
  ] }),
40082
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Box_default, { children: [
40083
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: "gray", children: "Tools" }) }),
40084
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { children: agent.allowedTools.length > 0 ? agent.allowedTools.join(", ") : "(all)" })
40189
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Box_default, { children: [
40190
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "gray", children: "Tools" }) }),
40191
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { children: agent.allowedTools.length > 0 ? agent.allowedTools.join(", ") : "(all)" })
40085
40192
  ] }),
40086
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Box_default, { children: [
40087
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: "gray", children: "Description" }) }),
40088
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { children: agent.description || "(none)" })
40193
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Box_default, { children: [
40194
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "gray", children: "Description" }) }),
40195
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { children: agent.description || "(none)" })
40089
40196
  ] }),
40090
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Box_default, { children: [
40091
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: "gray", children: "Source" }) }),
40092
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: "gray", children: agent.sourcePath })
40197
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Box_default, { children: [
40198
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "gray", children: "Source" }) }),
40199
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "gray", children: agent.sourcePath })
40093
40200
  ] })
40094
40201
  ] }),
40095
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
40096
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: "magentaBright", bold: true, children: "System prompt preview:" }),
40097
- promptLines.map((line, i2) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: "gray", children: line || " " }, i2)),
40098
- truncated ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Text, { color: "gray", dimColor: true, children: [
40202
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
40203
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "magentaBright", bold: true, children: "System prompt preview:" }),
40204
+ promptLines.map((line, i2) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "gray", children: line || " " }, i2)),
40205
+ truncated ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { color: "gray", dimColor: true, children: [
40099
40206
  "\u2026 (truncated \u2014 ",
40100
40207
  agent.systemPrompt.split("\n").length,
40101
40208
  " lines total)"
@@ -40121,7 +40228,7 @@ var agentsCommand = {
40121
40228
  }
40122
40229
  return {
40123
40230
  type: "render",
40124
- element: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(BrowserPanel, { agents: all })
40231
+ element: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(BrowserPanel, { agents: all })
40125
40232
  };
40126
40233
  }
40127
40234
  if (trimmed.startsWith("--info")) {
@@ -40138,7 +40245,7 @@ var agentsCommand = {
40138
40245
  }
40139
40246
  return {
40140
40247
  type: "render",
40141
- element: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(InfoPanel, { agent: a3 })
40248
+ element: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(InfoPanel, { agent: a3 })
40142
40249
  };
40143
40250
  }
40144
40251
  const [name, ...rest] = trimmed.split(/\s+/);
@@ -40173,7 +40280,7 @@ ${a2.systemPrompt}${toolLine}${argText}`.trim(),
40173
40280
  };
40174
40281
 
40175
40282
  // src/commands-palette/builtin/about.tsx
40176
- var import_react26 = __toESM(require_react(), 1);
40283
+ var import_react27 = __toESM(require_react(), 1);
40177
40284
  init_modes();
40178
40285
 
40179
40286
  // src/mcp/manager.ts
@@ -40282,12 +40389,12 @@ async function setAuthHeader(id, authHeader) {
40282
40389
  }
40283
40390
 
40284
40391
  // src/commands-palette/builtin/about.tsx
40285
- var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
40392
+ var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
40286
40393
  var CLI_VERSION = "0.1.1";
40287
40394
  var CLI_NAME = "@kryvenaiofficial/kryven";
40288
40395
  var AboutPanel = ({ ctx }) => {
40289
- const [data, setData] = (0, import_react26.useState)(null);
40290
- (0, import_react26.useEffect)(() => {
40396
+ const [data, setData] = (0, import_react27.useState)(null);
40397
+ (0, import_react27.useEffect)(() => {
40291
40398
  let cancelled = false;
40292
40399
  resolveEffectiveServers(ctx.cwd).then((servers) => {
40293
40400
  if (cancelled) return;
@@ -40307,9 +40414,9 @@ var AboutPanel = ({ ctx }) => {
40307
40414
  const rows = [
40308
40415
  [
40309
40416
  "CLI",
40310
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { children: [
40311
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "magentaBright", children: CLI_NAME }),
40312
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { color: "gray", children: [
40417
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { children: [
40418
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "magentaBright", children: CLI_NAME }),
40419
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "gray", children: [
40313
40420
  " v",
40314
40421
  CLI_VERSION
40315
40422
  ] })
@@ -40317,31 +40424,31 @@ var AboutPanel = ({ ctx }) => {
40317
40424
  ],
40318
40425
  [
40319
40426
  "Model",
40320
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "cyan", children: ctx.model }, "model")
40427
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "cyan", children: ctx.model }, "model")
40321
40428
  ],
40322
40429
  [
40323
40430
  "Mood",
40324
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "cyan", children: ctx.mood }, "mood")
40431
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "cyan", children: ctx.mood }, "mood")
40325
40432
  ],
40326
40433
  [
40327
40434
  "Skills",
40328
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { children: skills.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "gray", children: "none installed" }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { children: [
40329
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "magentaBright", children: skills.length }),
40330
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "gray", children: " installed" })
40435
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { children: skills.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "gray", children: "none installed" }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { children: [
40436
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "magentaBright", children: skills.length }),
40437
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "gray", children: " installed" })
40331
40438
  ] }) }, "skills")
40332
40439
  ],
40333
40440
  [
40334
40441
  "Agents",
40335
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { children: agents.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "gray", children: "none loaded" }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { children: [
40336
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "magentaBright", children: agents.length }),
40337
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "gray", children: " loaded" })
40442
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { children: agents.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "gray", children: "none loaded" }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { children: [
40443
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "magentaBright", children: agents.length }),
40444
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "gray", children: " loaded" })
40338
40445
  ] }) }, "agents")
40339
40446
  ],
40340
40447
  [
40341
40448
  "Permissions",
40342
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { children: [
40343
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "yellow", children: permMode }),
40344
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { color: "gray", children: [
40449
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { children: [
40450
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "yellow", children: permMode }),
40451
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "gray", children: [
40345
40452
  " \u2014 ",
40346
40453
  permDesc
40347
40454
  ] })
@@ -40349,9 +40456,9 @@ var AboutPanel = ({ ctx }) => {
40349
40456
  ],
40350
40457
  [
40351
40458
  "MCP servers",
40352
- data === null ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "gray", children: "loading\u2026" }, "mcp") : data.mcpCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "gray", children: "none configured" }, "mcp") : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { children: [
40353
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "magentaBright", children: data.mcpEnabled }),
40354
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { color: "gray", children: [
40459
+ data === null ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "gray", children: "loading\u2026" }, "mcp") : data.mcpCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "gray", children: "none configured" }, "mcp") : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { children: [
40460
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "magentaBright", children: data.mcpEnabled }),
40461
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "gray", children: [
40355
40462
  " enabled / ",
40356
40463
  data.mcpCount,
40357
40464
  " configured"
@@ -40360,15 +40467,15 @@ var AboutPanel = ({ ctx }) => {
40360
40467
  ],
40361
40468
  [
40362
40469
  "Session",
40363
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { children: [
40364
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "magentaBright", children: ctx.sessionMessages }),
40365
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "gray", children: " messages \xB7 " }),
40366
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "magentaBright", children: ctx.sessionTokens.toLocaleString() }),
40367
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "gray", children: " tokens" })
40470
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { children: [
40471
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "magentaBright", children: ctx.sessionMessages }),
40472
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "gray", children: " messages \xB7 " }),
40473
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "magentaBright", children: ctx.sessionTokens.toLocaleString() }),
40474
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "gray", children: " tokens" })
40368
40475
  ] }, "session")
40369
40476
  ]
40370
40477
  ];
40371
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
40478
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
40372
40479
  Box_default,
40373
40480
  {
40374
40481
  flexDirection: "column",
@@ -40376,12 +40483,12 @@ var AboutPanel = ({ ctx }) => {
40376
40483
  borderColor: "magenta",
40377
40484
  paddingX: 1,
40378
40485
  children: [
40379
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { bold: true, color: "magentaBright", children: "About Kryven CLI" }),
40380
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: rows.map(([label, value]) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { children: [
40381
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Box_default, { width: 18, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "gray", children: label }) }),
40486
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { bold: true, color: "magentaBright", children: "About Kryven CLI" }),
40487
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: rows.map(([label, value]) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Box_default, { children: [
40488
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Box_default, { width: 18, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "gray", children: label }) }),
40382
40489
  value
40383
40490
  ] }, label)) }),
40384
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { color: "gray", children: [
40491
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "gray", children: [
40385
40492
  "cwd ",
40386
40493
  ctx.cwd
40387
40494
  ] }) })
@@ -40394,7 +40501,7 @@ var aboutCommand = {
40394
40501
  description: "Show CLI version, model, skills, agents, permissions, and MCP server count",
40395
40502
  run: (_args, ctx) => ({
40396
40503
  type: "render",
40397
- element: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AboutPanel, { ctx })
40504
+ element: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(AboutPanel, { ctx })
40398
40505
  })
40399
40506
  };
40400
40507
 
@@ -40591,22 +40698,22 @@ function getThemeManager() {
40591
40698
 
40592
40699
  // src/commands-palette/builtin/theme.tsx
40593
40700
  init_load();
40594
- var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
40701
+ var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
40595
40702
  var ThemePanel = ({
40596
40703
  entries,
40597
40704
  current
40598
- }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 1, children: [
40599
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { bold: true, color: "magenta", children: "Themes" }),
40600
- entries.map((e) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Box_default, { children: [
40601
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Box_default, { width: 24, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { color: e.active ? "magentaBright" : "white", bold: e.active, children: [
40705
+ }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 1, children: [
40706
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { bold: true, color: "magenta", children: "Themes" }),
40707
+ entries.map((e) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Box_default, { children: [
40708
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Box_default, { width: 24, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: e.active ? "magentaBright" : "white", bold: e.active, children: [
40602
40709
  e.active ? "\u25B6 " : " ",
40603
40710
  e.name
40604
40711
  ] }) }),
40605
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "gray", children: e.accent })
40712
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { color: "gray", children: e.accent })
40606
40713
  ] }, e.name)),
40607
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { color: "gray", children: [
40714
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "gray", children: [
40608
40715
  "Active: ",
40609
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "magentaBright", children: current }),
40716
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { color: "magentaBright", children: current }),
40610
40717
  " \xB7 ",
40611
40718
  "/theme ",
40612
40719
  "<name>",
@@ -40630,7 +40737,7 @@ var themeCommand = {
40630
40737
  }));
40631
40738
  return {
40632
40739
  type: "render",
40633
- element: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ThemePanel, { entries, current: current.name })
40740
+ element: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ThemePanel, { entries, current: current.name })
40634
40741
  };
40635
40742
  }
40636
40743
  if (trimmed === "cycle") {
@@ -40681,7 +40788,7 @@ var themeCommand = {
40681
40788
  };
40682
40789
 
40683
40790
  // src/commands-palette/builtin/file.tsx
40684
- var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
40791
+ var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
40685
40792
  import * as fs3 from "node:fs";
40686
40793
  import * as path7 from "node:path";
40687
40794
  var IGNORED_DIRS = /* @__PURE__ */ new Set([
@@ -40783,11 +40890,11 @@ function extColor(relPath) {
40783
40890
  if ([".py", ".rb", ".go", ".rs"].includes(ext)) return "blue";
40784
40891
  return "gray";
40785
40892
  }
40786
- var TreePanel = ({ entries, truncated, cwd: cwd2 }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magentaBright", paddingX: 1, children: [
40787
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { bold: true, color: "magentaBright", children: [
40893
+ var TreePanel = ({ entries, truncated, cwd: cwd2 }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magentaBright", paddingX: 1, children: [
40894
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { bold: true, color: "magentaBright", children: [
40788
40895
  path7.basename(cwd2),
40789
40896
  "/ ",
40790
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "gray", children: [
40897
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: "gray", children: [
40791
40898
  "(",
40792
40899
  entries.length,
40793
40900
  " entries)"
@@ -40798,21 +40905,21 @@ var TreePanel = ({ entries, truncated, cwd: cwd2 }) => /* @__PURE__ */ (0, impor
40798
40905
  const indent = " ".repeat(depth);
40799
40906
  const name = path7.basename(e.relPath);
40800
40907
  if (e.isDir) {
40801
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "magenta", children: [
40908
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: "magenta", children: [
40802
40909
  indent,
40803
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { bold: true, children: [
40910
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { bold: true, children: [
40804
40911
  name,
40805
40912
  "/"
40806
40913
  ] })
40807
40914
  ] }, e.relPath);
40808
40915
  }
40809
40916
  const color = extColor(e.relPath);
40810
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Box_default, { children: [
40811
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color, children: [
40917
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { children: [
40918
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color, children: [
40812
40919
  indent,
40813
40920
  name
40814
40921
  ] }),
40815
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "gray", children: [
40922
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: "gray", children: [
40816
40923
  " ",
40817
40924
  formatSize(e.size),
40818
40925
  " ",
@@ -40820,58 +40927,58 @@ var TreePanel = ({ entries, truncated, cwd: cwd2 }) => /* @__PURE__ */ (0, impor
40820
40927
  ] })
40821
40928
  ] }, e.relPath);
40822
40929
  }),
40823
- truncated ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "gray", children: [
40930
+ truncated ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: "gray", children: [
40824
40931
  "\u2026 (more files \u2014 use /file ",
40825
40932
  "<glob>",
40826
40933
  " to filter)"
40827
40934
  ] }) : null,
40828
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "gray", children: [
40935
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: "gray", children: [
40829
40936
  "Run ",
40830
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "cyan", children: [
40937
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: "cyan", children: [
40831
40938
  "/file ",
40832
40939
  "<glob>"
40833
40940
  ] }),
40834
40941
  " to filter \xB7",
40835
40942
  " ",
40836
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "cyan", children: [
40943
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: "cyan", children: [
40837
40944
  "/file ",
40838
40945
  "<path>"
40839
40946
  ] }),
40840
40947
  " to read a file"
40841
40948
  ] })
40842
40949
  ] });
40843
- var MatchPanel = ({ entries, pattern, truncated }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magentaBright", paddingX: 1, children: [
40844
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { bold: true, color: "magentaBright", children: [
40950
+ var MatchPanel = ({ entries, pattern, truncated }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magentaBright", paddingX: 1, children: [
40951
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { bold: true, color: "magentaBright", children: [
40845
40952
  "Matches for ",
40846
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "cyan", children: pattern }),
40953
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: "cyan", children: pattern }),
40847
40954
  " ",
40848
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "gray", children: [
40955
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: "gray", children: [
40849
40956
  "(",
40850
40957
  entries.length,
40851
40958
  truncated ? "+" : "",
40852
40959
  " results)"
40853
40960
  ] })
40854
40961
  ] }),
40855
- entries.map((e) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Box_default, { children: [
40856
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Box_default, { minWidth: 40, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: e.isDir ? "magenta" : extColor(e.relPath), children: [
40962
+ entries.map((e) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { children: [
40963
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { minWidth: 40, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: e.isDir ? "magenta" : extColor(e.relPath), children: [
40857
40964
  e.relPath,
40858
40965
  e.isDir ? "/" : ""
40859
40966
  ] }) }),
40860
- !e.isDir && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "gray", children: [
40967
+ !e.isDir && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: "gray", children: [
40861
40968
  formatSize(e.size),
40862
40969
  " ",
40863
40970
  formatAge(e.mtime)
40864
40971
  ] })
40865
40972
  ] }, e.relPath)),
40866
- truncated ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "gray", children: "\u2026 (truncated to 80)" }) : null
40973
+ truncated ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: "gray", children: "\u2026 (truncated to 80)" }) : null
40867
40974
  ] });
40868
40975
  var FilePanel = ({ relPath, lines, truncated, totalLines }) => {
40869
40976
  const color = extColor(relPath);
40870
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magentaBright", paddingX: 1, children: [
40871
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { bold: true, color: "magentaBright", children: [
40977
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magentaBright", paddingX: 1, children: [
40978
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { bold: true, color: "magentaBright", children: [
40872
40979
  relPath,
40873
40980
  " ",
40874
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "gray", children: [
40981
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: "gray", children: [
40875
40982
  "(",
40876
40983
  totalLines,
40877
40984
  " lines",
@@ -40879,14 +40986,14 @@ var FilePanel = ({ relPath, lines, truncated, totalLines }) => {
40879
40986
  ")"
40880
40987
  ] })
40881
40988
  ] }),
40882
- lines.map((l, i2) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Box_default, { children: [
40883
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Box_default, { width: 5, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "gray", children: [
40989
+ lines.map((l, i2) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { children: [
40990
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { width: 5, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: "gray", children: [
40884
40991
  String(i2 + 1).padStart(4),
40885
40992
  " "
40886
40993
  ] }) }),
40887
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color, children: l.length > 160 ? l.slice(0, 160) + " \u2026" : l })
40994
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color, children: l.length > 160 ? l.slice(0, 160) + " \u2026" : l })
40888
40995
  ] }, i2)),
40889
- truncated ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "gray", children: [
40996
+ truncated ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: "gray", children: [
40890
40997
  "\u2026 (truncated \u2014 only first ",
40891
40998
  lines.length,
40892
40999
  " lines shown)"
@@ -40906,7 +41013,7 @@ var openCommand = {
40906
41013
  const truncated2 = entries.length >= MAX_ITEMS;
40907
41014
  return {
40908
41015
  type: "render",
40909
- element: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TreePanel, { entries, truncated: truncated2, cwd: ctx.cwd })
41016
+ element: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TreePanel, { entries, truncated: truncated2, cwd: ctx.cwd })
40910
41017
  };
40911
41018
  }
40912
41019
  const resolved = path7.isAbsolute(input) ? input : path7.join(ctx.cwd, input);
@@ -40924,7 +41031,7 @@ var openCommand = {
40924
41031
  const relPath = path7.relative(ctx.cwd, resolved) || input;
40925
41032
  return {
40926
41033
  type: "render",
40927
- element: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
41034
+ element: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
40928
41035
  FilePanel,
40929
41036
  {
40930
41037
  relPath,
@@ -40942,7 +41049,7 @@ var openCommand = {
40942
41049
  const truncated2 = entries.length >= MAX_ITEMS;
40943
41050
  return {
40944
41051
  type: "render",
40945
- element: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TreePanel, { entries, truncated: truncated2, cwd: resolved })
41052
+ element: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TreePanel, { entries, truncated: truncated2, cwd: resolved })
40946
41053
  };
40947
41054
  }
40948
41055
  const MAX_GLOB_ITEMS = 300;
@@ -40963,14 +41070,14 @@ var openCommand = {
40963
41070
  const truncated = matched.length >= MAX_RESULTS;
40964
41071
  return {
40965
41072
  type: "render",
40966
- element: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(MatchPanel, { entries: matched, pattern: input, truncated })
41073
+ element: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(MatchPanel, { entries: matched, pattern: input, truncated })
40967
41074
  };
40968
41075
  }
40969
41076
  };
40970
41077
 
40971
41078
  // src/commands-palette/builtin/sessions.tsx
40972
41079
  init_defaults();
40973
- var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
41080
+ var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
40974
41081
  import { readdir as readdir5, readFile as readFile6, unlink, stat as stat3 } from "node:fs/promises";
40975
41082
  import { join as join12, basename as basename4 } from "node:path";
40976
41083
  function fmtDate(ms) {
@@ -41012,32 +41119,32 @@ async function loadSessionFiles() {
41012
41119
  metas.sort((a2, b) => b.mtimeMs - a2.mtimeMs);
41013
41120
  return metas;
41014
41121
  }
41015
- var SessionListPanel = ({ sessions, dir }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magentaBright", paddingX: 1, children: [
41016
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { bold: true, color: "magentaBright", children: [
41122
+ var SessionListPanel = ({ sessions, dir }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magentaBright", paddingX: 1, children: [
41123
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Text, { bold: true, color: "magentaBright", children: [
41017
41124
  "Saved sessions (",
41018
41125
  sessions.length,
41019
41126
  ") \u2014 ",
41020
41127
  dir
41021
41128
  ] }),
41022
- sessions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { color: "gray", children: "No sessions saved yet. Use /save to save the current conversation." }) }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: sessions.map((s, i2) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Box_default, { flexDirection: "row", marginBottom: 0, children: [
41023
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Box_default, { width: 4, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "gray", dimColor: true, children: [
41129
+ sessions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: "gray", children: "No sessions saved yet. Use /save to save the current conversation." }) }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: sessions.map((s, i2) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Box_default, { flexDirection: "row", marginBottom: 0, children: [
41130
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { width: 4, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Text, { color: "gray", dimColor: true, children: [
41024
41131
  String(i2 + 1).padStart(2),
41025
41132
  "."
41026
41133
  ] }) }),
41027
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Box_default, { width: 34, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { color: "magenta", children: s.basename }) }),
41028
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Box_default, { width: 18, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { color: "gray", children: fmtDate(s.mtimeMs) }) }),
41029
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Box_default, { width: 8, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "cyan", children: [
41134
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { width: 34, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: "magenta", children: s.basename }) }),
41135
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { width: 18, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: "gray", children: fmtDate(s.mtimeMs) }) }),
41136
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { width: 8, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Text, { color: "cyan", children: [
41030
41137
  s.messageCount,
41031
41138
  "msg"
41032
41139
  ] }) }),
41033
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { color: "gray", dimColor: true, children: fmtSize(s.sizeBytes) })
41140
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: "gray", dimColor: true, children: fmtSize(s.sizeBytes) })
41034
41141
  ] }, s.filename)) }),
41035
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
41036
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "gray", children: [
41142
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
41143
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Text, { color: "gray", children: [
41037
41144
  "Load: /sessions load ",
41038
41145
  "<filename>"
41039
41146
  ] }),
41040
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { color: "gray", children: "Clear: /sessions clear" })
41147
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: "gray", children: "Clear: /sessions clear" })
41041
41148
  ] })
41042
41149
  ] });
41043
41150
  var sessionsCommand = {
@@ -41141,21 +41248,21 @@ Failed to delete: ${errs.join(", ")}` : "";
41141
41248
  const metas = await loadSessionFiles();
41142
41249
  return {
41143
41250
  type: "render",
41144
- element: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(SessionListPanel, { sessions: metas, dir })
41251
+ element: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SessionListPanel, { sessions: metas, dir })
41145
41252
  };
41146
41253
  }
41147
41254
  };
41148
41255
 
41149
41256
  // src/commands-palette/builtin/commands.tsx
41150
- var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
41151
- var CommandItem = ({ row }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { children: [
41152
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: "magentaBright", children: "/" + row.name }) }),
41153
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { width: 26, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: "cyan", children: row.hint }) }),
41154
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: "white", children: row.description })
41257
+ var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
41258
+ var CommandItem = ({ row }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Box_default, { children: [
41259
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { color: "magentaBright", children: "/" + row.name }) }),
41260
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box_default, { width: 26, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { color: "cyan", children: row.hint }) }),
41261
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { color: "white", children: row.description })
41155
41262
  ] });
41156
41263
  var CommandsPanel = ({ rows, filter, total }) => {
41157
41264
  const heading = filter ? `Commands matching "${filter}" (${rows.length} of ${total})` : `All commands (${rows.length})`;
41158
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
41265
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
41159
41266
  Box_default,
41160
41267
  {
41161
41268
  flexDirection: "column",
@@ -41163,9 +41270,9 @@ var CommandsPanel = ({ rows, filter, total }) => {
41163
41270
  borderColor: "magenta",
41164
41271
  paddingX: 1,
41165
41272
  children: [
41166
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { bold: true, color: "magentaBright", children: heading }),
41167
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { flexDirection: "column", marginTop: 1, children: rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(CommandItem, { row }, row.name)) }),
41168
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: "gray", children: [
41273
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { bold: true, color: "magentaBright", children: heading }),
41274
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box_default, { flexDirection: "column", marginTop: 1, children: rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CommandItem, { row }, row.name)) }),
41275
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: "gray", children: [
41169
41276
  "Use /commands ",
41170
41277
  "<filter>",
41171
41278
  " to search \xB7 /help for quick reference"
@@ -41207,7 +41314,7 @@ var commandsCommand = {
41207
41314
  }
41208
41315
  return {
41209
41316
  type: "render",
41210
- element: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(CommandsPanel, { rows: filtered, filter, total: allRows.length })
41317
+ element: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CommandsPanel, { rows: filtered, filter, total: allRows.length })
41211
41318
  };
41212
41319
  }
41213
41320
  };
@@ -41327,7 +41434,7 @@ function getKeybindings() {
41327
41434
  }
41328
41435
 
41329
41436
  // src/commands-palette/builtin/keybindings.tsx
41330
- var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
41437
+ var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
41331
41438
  var KB_PATH2 = join14(homedir8(), ".kryven", "keybindings.json");
41332
41439
  var VALID_ACTIONS = /* @__PURE__ */ new Set([
41333
41440
  "clear",
@@ -41349,7 +41456,7 @@ async function saveToDisk(bindings) {
41349
41456
  { mode: 384 }
41350
41457
  );
41351
41458
  }
41352
- var BindingsPanel = ({ bindings }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
41459
+ var BindingsPanel = ({ bindings }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
41353
41460
  Box_default,
41354
41461
  {
41355
41462
  flexDirection: "column",
@@ -41357,21 +41464,21 @@ var BindingsPanel = ({ bindings }) => /* @__PURE__ */ (0, import_jsx_runtime25.j
41357
41464
  borderColor: "magenta",
41358
41465
  paddingX: 1,
41359
41466
  children: [
41360
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Text, { bold: true, color: "magentaBright", children: [
41467
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { bold: true, color: "magentaBright", children: [
41361
41468
  "Keybindings (",
41362
41469
  bindings.length,
41363
41470
  ")"
41364
41471
  ] }),
41365
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: bindings.map((b) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Box_default, { children: [
41366
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { width: 26, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: "magenta", children: b.key }) }),
41367
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: "cyan", children: b.action })
41472
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: bindings.map((b) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Box_default, { children: [
41473
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Box_default, { width: 26, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: "magenta", children: b.key }) }),
41474
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: "cyan", children: b.action })
41368
41475
  ] }, b.key)) }),
41369
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
41370
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Text, { color: "gray", children: [
41476
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
41477
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: "gray", children: [
41371
41478
  "File: ",
41372
41479
  KB_PATH2
41373
41480
  ] }),
41374
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Text, { color: "gray", children: [
41481
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: "gray", children: [
41375
41482
  "/keybindings set ",
41376
41483
  "<key>",
41377
41484
  " ",
@@ -41380,12 +41487,12 @@ var BindingsPanel = ({ bindings }) => /* @__PURE__ */ (0, import_jsx_runtime25.j
41380
41487
  "<key>",
41381
41488
  " \xB7 /keybindings reset --confirm"
41382
41489
  ] }),
41383
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: "gray", children: "/keybindings actions \u2014 list valid action names" })
41490
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: "gray", children: "/keybindings actions \u2014 list valid action names" })
41384
41491
  ] })
41385
41492
  ]
41386
41493
  }
41387
41494
  );
41388
- var ActionsPanel = () => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
41495
+ var ActionsPanel = () => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
41389
41496
  Box_default,
41390
41497
  {
41391
41498
  flexDirection: "column",
@@ -41393,12 +41500,12 @@ var ActionsPanel = () => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
41393
41500
  borderColor: "magenta",
41394
41501
  paddingX: 1,
41395
41502
  children: [
41396
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Text, { bold: true, color: "magentaBright", children: [
41503
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { bold: true, color: "magentaBright", children: [
41397
41504
  "Valid actions (",
41398
41505
  VALID_ACTIONS.size,
41399
41506
  ")"
41400
41507
  ] }),
41401
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: [...VALID_ACTIONS].map((a2) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Text, { color: "cyan", children: [
41508
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: [...VALID_ACTIONS].map((a2) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: "cyan", children: [
41402
41509
  " ",
41403
41510
  a2
41404
41511
  ] }, a2)) })
@@ -41416,7 +41523,7 @@ var keybindingsCommand = {
41416
41523
  const bindings = getKeybindings().list();
41417
41524
  return {
41418
41525
  type: "render",
41419
- element: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(BindingsPanel, { bindings })
41526
+ element: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(BindingsPanel, { bindings })
41420
41527
  };
41421
41528
  }
41422
41529
  if (sub === "path") {
@@ -41425,7 +41532,7 @@ var keybindingsCommand = {
41425
41532
  if (sub === "actions") {
41426
41533
  return {
41427
41534
  type: "render",
41428
- element: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ActionsPanel, {})
41535
+ element: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ActionsPanel, {})
41429
41536
  };
41430
41537
  }
41431
41538
  if (sub === "reset") {
@@ -41655,7 +41762,7 @@ Preview: ${preview}`
41655
41762
 
41656
41763
  // src/commands-palette/builtin/memory.tsx
41657
41764
  init_defaults();
41658
- var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
41765
+ var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
41659
41766
  import { readFile as readFile8, writeFile as writeFile6, mkdir as mkdir7 } from "node:fs/promises";
41660
41767
  import { join as join16, dirname as dirname8 } from "node:path";
41661
41768
  function getMemoryPath() {
@@ -41685,7 +41792,7 @@ function fmtDate2(ts) {
41685
41792
  const pad = (n2) => String(n2).padStart(2, "0");
41686
41793
  return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}`;
41687
41794
  }
41688
- var NoteListPanel = ({ notes, path: path9 }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
41795
+ var NoteListPanel = ({ notes, path: path9 }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
41689
41796
  Box_default,
41690
41797
  {
41691
41798
  flexDirection: "column",
@@ -41693,42 +41800,42 @@ var NoteListPanel = ({ notes, path: path9 }) => /* @__PURE__ */ (0, import_jsx_r
41693
41800
  borderColor: "magentaBright",
41694
41801
  paddingX: 1,
41695
41802
  children: [
41696
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { bold: true, color: "magentaBright", children: [
41803
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { bold: true, color: "magentaBright", children: [
41697
41804
  "Memory \u2014 ",
41698
41805
  notes.length,
41699
41806
  " note",
41700
41807
  notes.length !== 1 ? "s" : "",
41701
41808
  " ",
41702
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: "gray", dimColor: true, children: [
41809
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "gray", dimColor: true, children: [
41703
41810
  "(",
41704
41811
  path9,
41705
41812
  ")"
41706
41813
  ] })
41707
41814
  ] }),
41708
- notes.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: "gray", children: [
41815
+ notes.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "gray", children: [
41709
41816
  "No notes yet. Use /memory add ",
41710
41817
  "<text>",
41711
41818
  " to add one."
41712
- ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: notes.map((note, i2) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
41713
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Box_default, { children: [
41714
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box_default, { width: 4, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: "magenta", bold: true, children: [
41819
+ ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: notes.map((note, i2) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
41820
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Box_default, { children: [
41821
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Box_default, { width: 4, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "magenta", bold: true, children: [
41715
41822
  String(i2 + 1).padStart(2),
41716
41823
  "."
41717
41824
  ] }) }),
41718
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { color: "gray", dimColor: true, children: fmtDate2(note.ts) })
41825
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { color: "gray", dimColor: true, children: fmtDate2(note.ts) })
41719
41826
  ] }),
41720
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box_default, { paddingLeft: 4, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { wrap: "wrap", children: note.text }) })
41827
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Box_default, { paddingLeft: 4, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { wrap: "wrap", children: note.text }) })
41721
41828
  ] }, note.ts + "-" + i2)) }),
41722
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
41723
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: "gray", children: [
41829
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
41830
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "gray", children: [
41724
41831
  "Add: /memory add ",
41725
41832
  "<text>"
41726
41833
  ] }),
41727
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: "gray", children: [
41834
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "gray", children: [
41728
41835
  "Remove: /memory remove ",
41729
41836
  "<n>"
41730
41837
  ] }),
41731
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { color: "gray", children: "Clear: /memory clear" })
41838
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { color: "gray", children: "Clear: /memory clear" })
41732
41839
  ] })
41733
41840
  ]
41734
41841
  }
@@ -41835,14 +41942,14 @@ var memoryCommand = {
41835
41942
  }
41836
41943
  return {
41837
41944
  type: "render",
41838
- element: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(NoteListPanel, { notes, path: getMemoryPath() })
41945
+ element: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(NoteListPanel, { notes, path: getMemoryPath() })
41839
41946
  };
41840
41947
  }
41841
41948
  };
41842
41949
 
41843
41950
  // src/agent/hooks.tsx
41844
41951
  init_defaults();
41845
- var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
41952
+ var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
41846
41953
  import { existsSync as existsSync12, readFileSync as readFileSync8, writeFileSync as writeFileSync5, mkdirSync as mkdirSync4 } from "node:fs";
41847
41954
  import { join as join17, dirname as dirname9 } from "node:path";
41848
41955
  function globalSettingsPath() {
@@ -41937,37 +42044,37 @@ function editHook(path9, event, index, newCommand2) {
41937
42044
  writeHooks(path9, hooks);
41938
42045
  return { ok: true };
41939
42046
  }
41940
- var HookRow = ({ index, entry }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Box_default, { flexDirection: "row", marginLeft: 2, children: [
41941
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Box_default, { width: 4, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: "gray", children: [
42047
+ var HookRow = ({ index, entry }) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Box_default, { flexDirection: "row", marginLeft: 2, children: [
42048
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box_default, { width: 4, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text, { color: "gray", children: [
41942
42049
  "[",
41943
42050
  index,
41944
42051
  "]"
41945
42052
  ] }) }),
41946
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Box_default, { width: 3, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: entry.enabled ? "green" : "gray", children: entry.enabled ? "on" : "off" }) }),
41947
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: entry.enabled ? "white" : "gray", children: entry.command }),
41948
- entry.description ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: "gray", children: [
42053
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box_default, { width: 3, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: entry.enabled ? "green" : "gray", children: entry.enabled ? "on" : "off" }) }),
42054
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: entry.enabled ? "white" : "gray", children: entry.command }),
42055
+ entry.description ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text, { color: "gray", children: [
41949
42056
  " # ",
41950
42057
  entry.description
41951
42058
  ] }) : null
41952
42059
  ] });
41953
- var EventSection = ({ event, entries }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
41954
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { bold: true, color: "cyan", children: event }),
41955
- entries.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: "gray", dimColor: true, children: " (no hooks)" }) : entries.map((e, i2) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(HookRow, { index: i2, entry: e }, i2))
42060
+ var EventSection = ({ event, entries }) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
42061
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { bold: true, color: "cyan", children: event }),
42062
+ entries.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "gray", dimColor: true, children: " (no hooks)" }) : entries.map((e, i2) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(HookRow, { index: i2, entry: e }, i2))
41956
42063
  ] });
41957
42064
  var ScopePanel = ({ scope, settingsPath: settingsPath2, hooks }) => {
41958
42065
  const events = Object.keys(hooks);
41959
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
41960
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Box_default, { children: [
41961
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { bold: true, color: "magentaBright", children: [
42066
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
42067
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Box_default, { children: [
42068
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text, { bold: true, color: "magentaBright", children: [
41962
42069
  scope === "global" ? "Global" : "Project",
41963
42070
  " hooks"
41964
42071
  ] }),
41965
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: "gray", children: [
42072
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text, { color: "gray", children: [
41966
42073
  " ",
41967
42074
  settingsPath2
41968
42075
  ] })
41969
42076
  ] }),
41970
- events.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: "gray", dimColor: true, children: " (none defined)" }) : events.map((ev) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(EventSection, { event: ev, entries: hooks[ev] }, ev))
42077
+ events.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "gray", dimColor: true, children: " (none defined)" }) : events.map((ev) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(EventSection, { event: ev, entries: hooks[ev] }, ev))
41971
42078
  ] });
41972
42079
  };
41973
42080
  var HooksPanel = ({
@@ -41976,7 +42083,7 @@ var HooksPanel = ({
41976
42083
  globalHooks,
41977
42084
  projectHooks,
41978
42085
  onlyScope
41979
- }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
42086
+ }) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
41980
42087
  Box_default,
41981
42088
  {
41982
42089
  flexDirection: "column",
@@ -41985,13 +42092,13 @@ var HooksPanel = ({
41985
42092
  paddingX: 1,
41986
42093
  paddingY: 0,
41987
42094
  children: [
41988
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { bold: true, color: "magentaBright", children: "Workflow hooks" }),
41989
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
41990
- (!onlyScope || onlyScope === "global") && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ScopePanel, { scope: "global", settingsPath: globalPath, hooks: globalHooks }),
41991
- (!onlyScope || onlyScope === "project") && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ScopePanel, { scope: "project", settingsPath: projectPath, hooks: projectHooks })
42095
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { bold: true, color: "magentaBright", children: "Workflow hooks" }),
42096
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
42097
+ (!onlyScope || onlyScope === "global") && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ScopePanel, { scope: "global", settingsPath: globalPath, hooks: globalHooks }),
42098
+ (!onlyScope || onlyScope === "project") && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ScopePanel, { scope: "project", settingsPath: projectPath, hooks: projectHooks })
41992
42099
  ] }),
41993
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
41994
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: "gray", children: [
42100
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
42101
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text, { color: "gray", children: [
41995
42102
  "Add: /hooks add ",
41996
42103
  "<global|project>",
41997
42104
  " ",
@@ -41999,7 +42106,7 @@ var HooksPanel = ({
41999
42106
  " ",
42000
42107
  "<command>"
42001
42108
  ] }),
42002
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: "gray", children: [
42109
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text, { color: "gray", children: [
42003
42110
  "Toggle: /hooks enable|disable ",
42004
42111
  "<global|project>",
42005
42112
  " ",
@@ -42007,7 +42114,7 @@ var HooksPanel = ({
42007
42114
  " ",
42008
42115
  "<n>"
42009
42116
  ] }),
42010
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: "gray", children: [
42117
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text, { color: "gray", children: [
42011
42118
  "Edit: /hooks edit ",
42012
42119
  "<global|project>",
42013
42120
  " ",
@@ -42017,7 +42124,7 @@ var HooksPanel = ({
42017
42124
  " ",
42018
42125
  "<newcmd>"
42019
42126
  ] }),
42020
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: "gray", children: [
42127
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text, { color: "gray", children: [
42021
42128
  "Remove: /hooks rm ",
42022
42129
  "<global|project>",
42023
42130
  " ",
@@ -42025,7 +42132,7 @@ var HooksPanel = ({
42025
42132
  " ",
42026
42133
  "<n>"
42027
42134
  ] }),
42028
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: "yellow", children: "Execution is opt-in \u2014 set KRYVEN_HOOKS=1 to run before_tool/after_tool/on_error hooks." })
42135
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "yellow", children: "Execution is opt-in \u2014 set KRYVEN_HOOKS=1 to run before_tool/after_tool/on_error hooks." })
42029
42136
  ] })
42030
42137
  ]
42031
42138
  }
@@ -42056,7 +42163,7 @@ var hooksCommand = {
42056
42163
  const projectHooks = readHooks(projectPath);
42057
42164
  return {
42058
42165
  type: "render",
42059
- element: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
42166
+ element: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
42060
42167
  HooksPanel,
42061
42168
  {
42062
42169
  globalPath,
@@ -42246,7 +42353,7 @@ Saved to ${path9}`
42246
42353
 
42247
42354
  // src/commands-palette/builtin/skill-test.tsx
42248
42355
  init_messages();
42249
- var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
42356
+ var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
42250
42357
  function makeMockCtx(real) {
42251
42358
  const mockConv = new Conversation();
42252
42359
  return {
@@ -42265,7 +42372,7 @@ function makeMockCtx(real) {
42265
42372
  var SkillListPanel = () => {
42266
42373
  const skills = listSkills();
42267
42374
  if (skills.length === 0) {
42268
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
42375
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
42269
42376
  Box_default,
42270
42377
  {
42271
42378
  flexDirection: "column",
@@ -42273,14 +42380,14 @@ var SkillListPanel = () => {
42273
42380
  borderColor: "magentaBright",
42274
42381
  paddingX: 1,
42275
42382
  children: [
42276
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { bold: true, color: "magentaBright", children: "skill-test" }),
42277
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { color: "gray", children: "No skills loaded." }),
42278
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { color: "gray", children: "Install one: `kryven skills install <url>` or drop a SKILL.md at .kryven/skills/<name>/SKILL.md" })
42383
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { bold: true, color: "magentaBright", children: "skill-test" }),
42384
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "gray", children: "No skills loaded." }),
42385
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "gray", children: "Install one: `kryven skills install <url>` or drop a SKILL.md at .kryven/skills/<name>/SKILL.md" })
42279
42386
  ]
42280
42387
  }
42281
42388
  );
42282
42389
  }
42283
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
42390
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
42284
42391
  Box_default,
42285
42392
  {
42286
42393
  flexDirection: "column",
@@ -42288,26 +42395,26 @@ var SkillListPanel = () => {
42288
42395
  borderColor: "magentaBright",
42289
42396
  paddingX: 1,
42290
42397
  children: [
42291
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { bold: true, color: "magentaBright", children: [
42398
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { bold: true, color: "magentaBright", children: [
42292
42399
  "skill-test \u2014 ",
42293
42400
  skills.length,
42294
42401
  " skill",
42295
42402
  skills.length !== 1 ? "s" : "",
42296
42403
  " loaded"
42297
42404
  ] }),
42298
- skills.map((s) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Box_default, { flexDirection: "column", marginTop: 0, children: [
42299
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Box_default, { children: [
42300
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Box_default, { width: 28, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { color: "cyan", children: s.name }) }),
42301
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { color: "gray", children: s.frontmatter.description ?? "(no description)" })
42405
+ skills.map((s) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Box_default, { flexDirection: "column", marginTop: 0, children: [
42406
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Box_default, { children: [
42407
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box_default, { width: 28, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "cyan", children: s.name }) }),
42408
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "gray", children: s.frontmatter.description ?? "(no description)" })
42302
42409
  ] }),
42303
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "gray", children: [
42410
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { color: "gray", children: [
42304
42411
  "scope=",
42305
42412
  s.scope,
42306
42413
  s.frontmatter["disable-model-invocation"] ? " [user-only]" : "",
42307
42414
  s.frontmatter["allowed-tools"] ? ` tools=${s.frontmatter["allowed-tools"].join(",")}` : ""
42308
42415
  ] }) })
42309
42416
  ] }, s.name)),
42310
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "gray", children: [
42417
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { color: "gray", children: [
42311
42418
  "Run: /skill-test ",
42312
42419
  "<name>",
42313
42420
  " [args]"
@@ -42328,7 +42435,7 @@ var DryRunPanel = ({
42328
42435
  const bodyLines = injectedBody.split("\n");
42329
42436
  const previewLines = bodyLines.slice(0, 20);
42330
42437
  const overflow = bodyLines.length - previewLines.length;
42331
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
42438
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
42332
42439
  Box_default,
42333
42440
  {
42334
42441
  flexDirection: "column",
@@ -42336,56 +42443,56 @@ var DryRunPanel = ({
42336
42443
  borderColor: "magentaBright",
42337
42444
  paddingX: 1,
42338
42445
  children: [
42339
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Box_default, { marginBottom: 1, children: [
42340
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { bold: true, color: "magentaBright", children: "skill-test: " }),
42341
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { bold: true, color: "cyan", children: skillName }),
42342
- forwardedArgs ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "gray", children: [
42446
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Box_default, { marginBottom: 1, children: [
42447
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { bold: true, color: "magentaBright", children: "skill-test: " }),
42448
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { bold: true, color: "cyan", children: skillName }),
42449
+ forwardedArgs ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { color: "gray", children: [
42343
42450
  ' "',
42344
42451
  forwardedArgs,
42345
42452
  '"'
42346
42453
  ] }) : null
42347
42454
  ] }),
42348
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Box_default, { flexDirection: "column", children: [
42349
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Box_default, { children: [
42350
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Box_default, { width: 20, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { color: "gray", children: "result.type" }) }),
42351
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { color: typeColor, bold: true, children: result.type }),
42352
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "gray", children: [
42455
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Box_default, { flexDirection: "column", children: [
42456
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Box_default, { children: [
42457
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box_default, { width: 20, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "gray", children: "result.type" }) }),
42458
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: typeColor, bold: true, children: result.type }),
42459
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { color: "gray", children: [
42353
42460
  " (",
42354
42461
  elapsedMs,
42355
42462
  "ms)"
42356
42463
  ] })
42357
42464
  ] }),
42358
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Box_default, { children: [
42359
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Box_default, { width: 20, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { color: "gray", children: "mock msgs appended" }) }),
42360
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { children: mockMessages })
42465
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Box_default, { children: [
42466
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box_default, { width: 20, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "gray", children: "mock msgs appended" }) }),
42467
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { children: mockMessages })
42361
42468
  ] })
42362
42469
  ] }),
42363
- result.type === "ack" && result.message ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
42364
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { color: "gray", children: "ack message:" }),
42365
- result.message.split("\n").map((line, i2) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { children: [
42470
+ result.type === "ack" && result.message ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
42471
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "gray", children: "ack message:" }),
42472
+ result.message.split("\n").map((line, i2) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { children: [
42366
42473
  " ",
42367
42474
  line
42368
42475
  ] }, i2))
42369
42476
  ] }) : null,
42370
- result.type === "error" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "red", children: [
42477
+ result.type === "error" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { color: "red", children: [
42371
42478
  "error: ",
42372
42479
  result.message
42373
42480
  ] }) }) : null,
42374
- result.type === "render" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
42375
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { color: "cyan", children: "render element:" }),
42376
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Box_default, { paddingLeft: 2, borderStyle: "single", borderColor: "gray", children: result.element })
42481
+ result.type === "render" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
42482
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "cyan", children: "render element:" }),
42483
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box_default, { paddingLeft: 2, borderStyle: "single", borderColor: "gray", children: result.element })
42377
42484
  ] }) : null,
42378
- result.type === "clear" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { color: "yellow", children: " (skill would clear the conversation)" }) }) : null,
42379
- result.type === "exit" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { color: "yellow", children: " (skill would exit the CLI)" }) }) : null,
42380
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
42381
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "gray", children: [
42485
+ result.type === "clear" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "yellow", children: " (skill would clear the conversation)" }) }) : null,
42486
+ result.type === "exit" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "yellow", children: " (skill would exit the CLI)" }) }) : null,
42487
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
42488
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { color: "gray", children: [
42382
42489
  "body preview (",
42383
42490
  bodyLines.length,
42384
42491
  " line",
42385
42492
  bodyLines.length !== 1 ? "s" : "",
42386
42493
  "):"
42387
42494
  ] }),
42388
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
42495
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
42389
42496
  Box_default,
42390
42497
  {
42391
42498
  flexDirection: "column",
@@ -42393,8 +42500,8 @@ var DryRunPanel = ({
42393
42500
  borderStyle: "single",
42394
42501
  borderColor: "gray",
42395
42502
  children: [
42396
- previewLines.map((line, i2) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { color: "white", children: line.length > 120 ? line.slice(0, 120) + " \u2026" : line || " " }, i2)),
42397
- overflow > 0 ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "gray", dimColor: true, children: [
42503
+ previewLines.map((line, i2) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "white", children: line.length > 120 ? line.slice(0, 120) + " \u2026" : line || " " }, i2)),
42504
+ overflow > 0 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { color: "gray", dimColor: true, children: [
42398
42505
  "\u2026 ",
42399
42506
  overflow,
42400
42507
  " more line",
@@ -42404,7 +42511,7 @@ var DryRunPanel = ({
42404
42511
  }
42405
42512
  )
42406
42513
  ] }),
42407
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { color: "gray", dimColor: true, children: "(mock context \u2014 live conversation unchanged)" }) })
42514
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "gray", dimColor: true, children: "(mock context \u2014 live conversation unchanged)" }) })
42408
42515
  ]
42409
42516
  }
42410
42517
  );
@@ -42416,7 +42523,7 @@ var skillTestCommand = {
42416
42523
  run: async (args, ctx) => {
42417
42524
  const trimmed = args.trim();
42418
42525
  if (!trimmed) {
42419
- return { type: "render", element: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SkillListPanel, {}) };
42526
+ return { type: "render", element: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SkillListPanel, {}) };
42420
42527
  }
42421
42528
  const [name, ...rest] = trimmed.split(/\s+/);
42422
42529
  if (!name) {
@@ -42462,7 +42569,7 @@ ${argText}`.trim();
42462
42569
  const mockMessages = mockCtx.conversation.size();
42463
42570
  return {
42464
42571
  type: "render",
42465
- element: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
42572
+ element: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
42466
42573
  DryRunPanel,
42467
42574
  {
42468
42575
  skillName: name,
@@ -42478,7 +42585,7 @@ ${argText}`.trim();
42478
42585
  };
42479
42586
 
42480
42587
  // src/commands-palette/builtin/metrics.tsx
42481
- var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
42588
+ var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
42482
42589
  function computeMetrics(messages) {
42483
42590
  let modelCalls = 0;
42484
42591
  let toolCalls = 0;
@@ -42518,39 +42625,39 @@ var MetricsPanel = ({ ctx }) => {
42518
42625
  const rows = [
42519
42626
  [
42520
42627
  "Model calls",
42521
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "magentaBright", children: m.modelCalls }) }, "mc")
42628
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "magentaBright", children: m.modelCalls }) }, "mc")
42522
42629
  ],
42523
42630
  [
42524
42631
  "Tool calls",
42525
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "magentaBright", children: m.toolCalls }) }, "tc")
42632
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "magentaBright", children: m.toolCalls }) }, "tc")
42526
42633
  ],
42527
42634
  [
42528
42635
  "Loop iterations",
42529
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text, { children: [
42530
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "magentaBright", children: m.loopIterations }),
42531
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "gray", children: " (1 per model call)" })
42636
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Text, { children: [
42637
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "magentaBright", children: m.loopIterations }),
42638
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "gray", children: " (1 per model call)" })
42532
42639
  ] }, "li")
42533
42640
  ],
42534
42641
  [
42535
42642
  "Avg latency",
42536
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text, { children: [
42537
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: m.avgLatencyMs === null ? "gray" : "cyan", children: fmtLatency(m.avgLatencyMs) }),
42538
- m.avgLatencyMs !== null && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "gray", children: " per turn" })
42643
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Text, { children: [
42644
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: m.avgLatencyMs === null ? "gray" : "cyan", children: fmtLatency(m.avgLatencyMs) }),
42645
+ m.avgLatencyMs !== null && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "gray", children: " per turn" })
42539
42646
  ] }, "lat")
42540
42647
  ],
42541
42648
  [
42542
42649
  "Messages",
42543
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text, { children: [
42544
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "magentaBright", children: ctx.sessionMessages }),
42545
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "gray", children: " total (incl. tool results)" })
42650
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Text, { children: [
42651
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "magentaBright", children: ctx.sessionMessages }),
42652
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "gray", children: " total (incl. tool results)" })
42546
42653
  ] }, "msgs")
42547
42654
  ],
42548
42655
  [
42549
42656
  "Session tokens",
42550
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "magentaBright", children: ctx.sessionTokens.toLocaleString() }) }, "tok")
42657
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "magentaBright", children: ctx.sessionTokens.toLocaleString() }) }, "tok")
42551
42658
  ]
42552
42659
  ];
42553
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
42660
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
42554
42661
  Box_default,
42555
42662
  {
42556
42663
  flexDirection: "column",
@@ -42558,12 +42665,12 @@ var MetricsPanel = ({ ctx }) => {
42558
42665
  borderColor: "magenta",
42559
42666
  paddingX: 1,
42560
42667
  children: [
42561
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { bold: true, color: "magentaBright", children: "Session metrics" }),
42562
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: rows.map(([label, value]) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Box_default, { children: [
42563
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box_default, { width: 18, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "gray", children: label }) }),
42668
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { bold: true, color: "magentaBright", children: "Session metrics" }),
42669
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: rows.map(([label, value]) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box_default, { children: [
42670
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Box_default, { width: 18, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "gray", children: label }) }),
42564
42671
  value
42565
42672
  ] }, label)) }),
42566
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "gray", children: "Latency = user-message \u2192 first assistant-turn ts delta." }) })
42673
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "gray", children: "Latency = user-message \u2192 first assistant-turn ts delta." }) })
42567
42674
  ]
42568
42675
  }
42569
42676
  );
@@ -42573,7 +42680,7 @@ var metricsCommand = {
42573
42680
  description: "Show session metrics: model calls, tool calls, loop iterations, avg latency",
42574
42681
  run: (_args, ctx) => ({
42575
42682
  type: "render",
42576
- element: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(MetricsPanel, { ctx })
42683
+ element: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(MetricsPanel, { ctx })
42577
42684
  })
42578
42685
  };
42579
42686
 
@@ -42778,25 +42885,25 @@ var MCPClient = class {
42778
42885
  };
42779
42886
 
42780
42887
  // src/mcp/index.tsx
42781
- var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
42888
+ var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
42782
42889
  var ServerRow = ({ server, scope }) => {
42783
42890
  const enabled = server.enabled !== false;
42784
42891
  const statusColor = enabled ? "green" : "gray";
42785
42892
  const statusText = enabled ? "on " : "off";
42786
42893
  const scopeTag2 = scope === "project" ? " [project]" : "";
42787
42894
  const authTag = server.authHeader ? " [auth]" : "";
42788
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Box_default, { flexDirection: "column", marginBottom: 0, children: [
42789
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Box_default, { children: [
42790
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box_default, { width: 3, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: statusColor, children: statusText }) }),
42791
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box_default, { width: 18, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "magentaBright", bold: true, children: server.id }) }),
42792
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "gray", children: server.url }),
42793
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "cyan", children: scopeTag2 }),
42794
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "yellow", children: authTag })
42895
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { flexDirection: "column", marginBottom: 0, children: [
42896
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { children: [
42897
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Box_default, { width: 3, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: statusColor, children: statusText }) }),
42898
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Box_default, { width: 18, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "magentaBright", bold: true, children: server.id }) }),
42899
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "gray", children: server.url }),
42900
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "cyan", children: scopeTag2 }),
42901
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "yellow", children: authTag })
42795
42902
  ] }),
42796
- server.label ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box_default, { paddingLeft: 21, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "gray", children: server.label }) }) : null
42903
+ server.label ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Box_default, { paddingLeft: 21, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "gray", children: server.label }) }) : null
42797
42904
  ] });
42798
42905
  };
42799
- var ListPanel = ({ servers }) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
42906
+ var ListPanel = ({ servers }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
42800
42907
  Box_default,
42801
42908
  {
42802
42909
  flexDirection: "column",
@@ -42804,35 +42911,35 @@ var ListPanel = ({ servers }) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
42804
42911
  borderColor: "magentaBright",
42805
42912
  paddingX: 1,
42806
42913
  children: [
42807
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { bold: true, color: "magentaBright", children: [
42914
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Text, { bold: true, color: "magentaBright", children: [
42808
42915
  "MCP servers (",
42809
42916
  servers.length,
42810
42917
  ")"
42811
42918
  ] }),
42812
- servers.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { color: "gray", children: [
42919
+ servers.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Text, { color: "gray", children: [
42813
42920
  "No servers registered. Add one with /mcp add ",
42814
42921
  "<id> <url>",
42815
42922
  "."
42816
- ] }) : servers.map((s) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ServerRow, { server: s }, s.id)),
42817
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
42818
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "gray", children: "Manage: /mcp add|remove|enable|disable|auth|tools" }),
42819
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "gray", children: "Config: ~/.kryven/mcp.json \xB7 project overlay: .kryven/mcp.json" })
42923
+ ] }) : servers.map((s) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ServerRow, { server: s }, s.id)),
42924
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
42925
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "gray", children: "Manage: /mcp add|remove|enable|disable|auth|tools" }),
42926
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "gray", children: "Config: ~/.kryven/mcp.json \xB7 project overlay: .kryven/mcp.json" })
42820
42927
  ] })
42821
42928
  ]
42822
42929
  }
42823
42930
  );
42824
- var ToolsRow = ({ tool, serverId }) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box_default, { flexDirection: "column", marginBottom: 0, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Box_default, { children: [
42825
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box_default, { width: 20, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { color: "cyan", children: [
42931
+ var ToolsRow = ({ tool, serverId }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Box_default, { flexDirection: "column", marginBottom: 0, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { children: [
42932
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Box_default, { width: 20, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Text, { color: "cyan", children: [
42826
42933
  "mcp:",
42827
42934
  serverId,
42828
42935
  ".",
42829
42936
  tool.name
42830
42937
  ] }) }),
42831
- tool.description ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "gray", children: tool.description }) : null
42938
+ tool.description ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "gray", children: tool.description }) : null
42832
42939
  ] }) });
42833
42940
  var ToolsPanel = ({ results }) => {
42834
42941
  const total = results.reduce((n2, r) => n2 + r.tools.length, 0);
42835
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
42942
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
42836
42943
  Box_default,
42837
42944
  {
42838
42945
  flexDirection: "column",
@@ -42840,7 +42947,7 @@ var ToolsPanel = ({ results }) => {
42840
42947
  borderColor: "cyan",
42841
42948
  paddingX: 1,
42842
42949
  children: [
42843
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { bold: true, color: "cyan", children: [
42950
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Text, { bold: true, color: "cyan", children: [
42844
42951
  "MCP tools (",
42845
42952
  total,
42846
42953
  " across ",
@@ -42849,15 +42956,15 @@ var ToolsPanel = ({ results }) => {
42849
42956
  results.length !== 1 ? "s" : "",
42850
42957
  ")"
42851
42958
  ] }),
42852
- results.map((r) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
42853
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { color: "magentaBright", bold: true, children: [
42959
+ results.map((r) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
42960
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Text, { color: "magentaBright", bold: true, children: [
42854
42961
  r.server.id,
42855
42962
  r.server.label ? ` \u2014 ${r.server.label}` : ""
42856
42963
  ] }),
42857
- r.error ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { color: "red", children: [
42964
+ r.error ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Text, { color: "red", children: [
42858
42965
  " Error: ",
42859
42966
  r.error
42860
- ] }) : r.tools.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "gray", children: " (no tools discovered)" }) : r.tools.map((t) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ToolsRow, { tool: t, serverId: r.server.id }, t.name))
42967
+ ] }) : r.tools.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "gray", children: " (no tools discovered)" }) : r.tools.map((t) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ToolsRow, { tool: t, serverId: r.server.id }, t.name))
42861
42968
  ] }, r.server.id))
42862
42969
  ]
42863
42970
  }
@@ -42899,7 +43006,7 @@ var mcpCommand = {
42899
43006
  const servers = await resolveEffectiveServers(ctx.cwd);
42900
43007
  return {
42901
43008
  type: "render",
42902
- element: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ListPanel, { servers })
43009
+ element: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ListPanel, { servers })
42903
43010
  };
42904
43011
  }
42905
43012
  if (sub === "add") {
@@ -42989,7 +43096,7 @@ The token is stored as "Bearer <token>" in ~/.kryven/mcp.json.`
42989
43096
  const results = await discoverToolsForServers(targets);
42990
43097
  return {
42991
43098
  type: "render",
42992
- element: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ToolsPanel, { results })
43099
+ element: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ToolsPanel, { results })
42993
43100
  };
42994
43101
  }
42995
43102
  return {
@@ -43007,7 +43114,7 @@ The token is stored as "Bearer <token>" in ~/.kryven/mcp.json.`
43007
43114
  };
43008
43115
 
43009
43116
  // src/tui/EconomicsLine.tsx
43010
- var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
43117
+ var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
43011
43118
  function fmtTokens(n2) {
43012
43119
  if (n2 < 1e3) return String(n2);
43013
43120
  if (n2 < 1e6) return (n2 / 1e3).toFixed(1) + "k";
@@ -43046,58 +43153,58 @@ var EconomicsLine = ({
43046
43153
  const credits = creditsFromTokens(displayCharged);
43047
43154
  const hasTurnData = stats.turnCount > 0;
43048
43155
  if (compact) {
43049
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box_default, { children: [
43050
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Text, { color: "magenta", children: [
43156
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Box_default, { children: [
43157
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Text, { color: "magenta", children: [
43051
43158
  fmtTokens(displayCharged),
43052
43159
  " tok"
43053
43160
  ] }),
43054
- hasTurnData && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
43055
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "gray", children: " \xB7 " }),
43056
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Text, { color: "magentaBright", children: [
43161
+ hasTurnData && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
43162
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "gray", children: " \xB7 " }),
43163
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Text, { color: "magentaBright", children: [
43057
43164
  credits,
43058
43165
  " cr"
43059
43166
  ] })
43060
43167
  ] }),
43061
- hasTurnData && stats.tier && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
43062
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "gray", children: " \xB7 " }),
43063
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "gray", children: stats.tier })
43168
+ hasTurnData && stats.tier && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
43169
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "gray", children: " \xB7 " }),
43170
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "gray", children: stats.tier })
43064
43171
  ] })
43065
43172
  ] });
43066
43173
  }
43067
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box_default, { paddingX: 1, borderStyle: "single", borderColor: "gray", flexDirection: "row", flexWrap: "wrap", children: [
43068
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box_default, { marginRight: 2, children: [
43069
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "gray", children: "session: " }),
43070
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "magentaBright", bold: true, children: fmtTokens(displayCharged) }),
43071
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "gray", children: " tok" })
43174
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Box_default, { paddingX: 1, borderStyle: "single", borderColor: "gray", flexDirection: "row", flexWrap: "wrap", children: [
43175
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Box_default, { marginRight: 2, children: [
43176
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "gray", children: "session: " }),
43177
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "magentaBright", bold: true, children: fmtTokens(displayCharged) }),
43178
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "gray", children: " tok" })
43072
43179
  ] }),
43073
- hasTurnData && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
43074
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box_default, { marginRight: 2, children: [
43075
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "gray", children: "in: " }),
43076
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "cyan", children: fmtTokens(stats.promptTokens) })
43180
+ hasTurnData && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
43181
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Box_default, { marginRight: 2, children: [
43182
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "gray", children: "in: " }),
43183
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "cyan", children: fmtTokens(stats.promptTokens) })
43077
43184
  ] }),
43078
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box_default, { marginRight: 2, children: [
43079
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "gray", children: "out: " }),
43080
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "green", children: fmtTokens(stats.completionTokens) })
43185
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Box_default, { marginRight: 2, children: [
43186
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "gray", children: "out: " }),
43187
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "green", children: fmtTokens(stats.completionTokens) })
43081
43188
  ] }),
43082
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box_default, { marginRight: 2, children: [
43083
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "gray", children: "turns: " }),
43084
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "white", children: stats.turnCount })
43189
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Box_default, { marginRight: 2, children: [
43190
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "gray", children: "turns: " }),
43191
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "white", children: stats.turnCount })
43085
43192
  ] }),
43086
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box_default, { marginRight: 2, children: [
43087
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "gray", children: "credits: " }),
43088
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "magenta", children: credits })
43193
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Box_default, { marginRight: 2, children: [
43194
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "gray", children: "credits: " }),
43195
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "magenta", children: credits })
43089
43196
  ] })
43090
43197
  ] }),
43091
- stats.tier && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box_default, { children: [
43092
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "gray", children: "plan: " }),
43093
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "yellow", children: stats.tier })
43198
+ stats.tier && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Box_default, { children: [
43199
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "gray", children: "plan: " }),
43200
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "yellow", children: stats.tier })
43094
43201
  ] }),
43095
- !hasTurnData && displayCharged === 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "gray", children: "no usage recorded yet" })
43202
+ !hasTurnData && displayCharged === 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "gray", children: "no usage recorded yet" })
43096
43203
  ] });
43097
43204
  };
43098
43205
 
43099
43206
  // src/commands-palette/builtin/usage.tsx
43100
- var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
43207
+ var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
43101
43208
  function displayName(model) {
43102
43209
  const lower = model.toLowerCase();
43103
43210
  if (lower.includes("extended")) return "KRY-5.2 Extended";
@@ -43130,9 +43237,9 @@ var UsagePanel = ({ ctx }) => {
43130
43237
  const messages = ctx.conversation.all();
43131
43238
  const modelBuckets = buildModelBuckets(messages);
43132
43239
  const hasBreakdown = modelBuckets.size > 0;
43133
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { flexDirection: "column", children: [
43134
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { bold: true, color: "magentaBright", children: "/usage \u2014 session budget & token breakdown" }) }),
43135
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
43240
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Box_default, { flexDirection: "column", children: [
43241
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { bold: true, color: "magentaBright", children: "/usage \u2014 session budget & token breakdown" }) }),
43242
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
43136
43243
  EconomicsLine,
43137
43244
  {
43138
43245
  sessionTokens: ctx.sessionTokens,
@@ -43140,7 +43247,7 @@ var UsagePanel = ({ ctx }) => {
43140
43247
  compact: false
43141
43248
  }
43142
43249
  ),
43143
- hasBreakdown && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
43250
+ hasBreakdown && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
43144
43251
  Box_default,
43145
43252
  {
43146
43253
  flexDirection: "column",
@@ -43149,38 +43256,38 @@ var UsagePanel = ({ ctx }) => {
43149
43256
  paddingX: 1,
43150
43257
  marginTop: 1,
43151
43258
  children: [
43152
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { bold: true, color: "magenta", children: "Per-model breakdown" }),
43153
- Array.from(modelBuckets.entries()).map(([tier, bucket]) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { flexDirection: "row", flexWrap: "wrap", children: [
43154
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Box_default, { width: 22, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "cyan", children: displayName(tier) }) }),
43155
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { marginRight: 2, children: [
43156
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "gray", children: "turns: " }),
43157
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "white", children: bucket.turns })
43259
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { bold: true, color: "magenta", children: "Per-model breakdown" }),
43260
+ Array.from(modelBuckets.entries()).map(([tier, bucket]) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Box_default, { flexDirection: "row", flexWrap: "wrap", children: [
43261
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Box_default, { width: 22, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "cyan", children: displayName(tier) }) }),
43262
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Box_default, { marginRight: 2, children: [
43263
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "gray", children: "turns: " }),
43264
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "white", children: bucket.turns })
43158
43265
  ] }),
43159
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { marginRight: 2, children: [
43160
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "gray", children: "in: " }),
43161
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "cyan", children: fmtTokens2(bucket.promptTokens) })
43266
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Box_default, { marginRight: 2, children: [
43267
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "gray", children: "in: " }),
43268
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "cyan", children: fmtTokens2(bucket.promptTokens) })
43162
43269
  ] }),
43163
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { marginRight: 2, children: [
43164
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "gray", children: "out: " }),
43165
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "green", children: fmtTokens2(bucket.completionTokens) })
43270
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Box_default, { marginRight: 2, children: [
43271
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "gray", children: "out: " }),
43272
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "green", children: fmtTokens2(bucket.completionTokens) })
43166
43273
  ] }),
43167
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { children: [
43168
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "gray", children: "charged: " }),
43169
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "magentaBright", children: fmtTokens2(bucket.chargedTokens) })
43274
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Box_default, { children: [
43275
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "gray", children: "charged: " }),
43276
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "magentaBright", children: fmtTokens2(bucket.chargedTokens) })
43170
43277
  ] })
43171
43278
  ] }, tier))
43172
43279
  ]
43173
43280
  }
43174
43281
  ),
43175
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Box_default, { paddingX: 1, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Text, { color: "gray", children: [
43282
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Box_default, { paddingX: 1, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { color: "gray", children: [
43176
43283
  "context: ",
43177
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "white", children: ctx.sessionMessages }),
43284
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "white", children: ctx.sessionMessages }),
43178
43285
  " msgs \xB7 conversation size: ",
43179
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "white", children: ctx.conversation.size() }),
43286
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "white", children: ctx.conversation.size() }),
43180
43287
  " \xB7 model: ",
43181
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "cyan", children: displayName(ctx.model) }),
43288
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "cyan", children: displayName(ctx.model) }),
43182
43289
  " \xB7 mood: ",
43183
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "yellow", children: ctx.mood })
43290
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "yellow", children: ctx.mood })
43184
43291
  ] }) })
43185
43292
  ] });
43186
43293
  };
@@ -43189,55 +43296,55 @@ var usageCommand = {
43189
43296
  description: "Show session token budget, accumulated spend, and per-model breakdown",
43190
43297
  run: (_args, ctx) => ({
43191
43298
  type: "render",
43192
- element: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(UsagePanel, { ctx })
43299
+ element: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(UsagePanel, { ctx })
43193
43300
  })
43194
43301
  };
43195
43302
 
43196
43303
  // src/commands-palette/builtin/vim.tsx
43197
43304
  init_load();
43198
- var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
43199
- var StatusPanel = ({ enabled }) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 1, children: [
43200
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { bold: true, color: "magentaBright", children: "Vim Mode" }),
43201
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Text, { children: [
43305
+ var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
43306
+ var StatusPanel = ({ enabled }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 1, children: [
43307
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { bold: true, color: "magentaBright", children: "Vim Mode" }),
43308
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Text, { children: [
43202
43309
  "Status:",
43203
43310
  " ",
43204
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { bold: true, color: enabled ? "green" : "gray", children: enabled ? "enabled" : "disabled" })
43311
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { bold: true, color: enabled ? "green" : "gray", children: enabled ? "enabled" : "disabled" })
43205
43312
  ] }) }),
43206
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
43207
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "gray", children: "Commands:" }),
43208
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Text, { children: [
43313
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
43314
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: "gray", children: "Commands:" }),
43315
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Text, { children: [
43209
43316
  " ",
43210
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "cyan", children: "/vim on" }),
43317
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: "cyan", children: "/vim on" }),
43211
43318
  " ",
43212
43319
  " \u2014 enable vim mode (takes effect on next launch)"
43213
43320
  ] }),
43214
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Text, { children: [
43321
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Text, { children: [
43215
43322
  " ",
43216
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "cyan", children: "/vim off" }),
43323
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: "cyan", children: "/vim off" }),
43217
43324
  " ",
43218
43325
  " \u2014 disable vim mode"
43219
43326
  ] }),
43220
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Text, { children: [
43327
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Text, { children: [
43221
43328
  " ",
43222
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "cyan", children: "/vim bindings" }),
43329
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: "cyan", children: "/vim bindings" }),
43223
43330
  " ",
43224
43331
  " \u2014 show key binding reference"
43225
43332
  ] })
43226
43333
  ] }),
43227
- !enabled && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Text, { color: "gray", children: [
43334
+ !enabled && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Text, { color: "gray", children: [
43228
43335
  "Tip: run",
43229
43336
  " ",
43230
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "cyan", children: "/vim on" }),
43337
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: "cyan", children: "/vim on" }),
43231
43338
  " ",
43232
43339
  "to enable modal editing in the input line."
43233
43340
  ] }) }),
43234
- enabled && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Text, { color: "gray", children: [
43341
+ enabled && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Text, { color: "gray", children: [
43235
43342
  "Active \u2014 press ",
43236
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "magentaBright", children: "Esc" }),
43343
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: "magentaBright", children: "Esc" }),
43237
43344
  " to enter normal mode, ",
43238
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "magentaBright", children: "i" }),
43345
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: "magentaBright", children: "i" }),
43239
43346
  "/",
43240
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "magentaBright", children: "a" }),
43347
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: "magentaBright", children: "a" }),
43241
43348
  " to insert."
43242
43349
  ] }) })
43243
43350
  ] });
@@ -43265,16 +43372,16 @@ var BINDINGS = [
43265
43372
  // Submit
43266
43373
  ["Enter", "Submit prompt (any mode)"]
43267
43374
  ];
43268
- var BindingsPanel2 = () => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 1, children: [
43269
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { bold: true, color: "magentaBright", children: "Vim key-binding reference" }),
43270
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: BINDINGS.map(([key, desc]) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Box_default, { children: [
43271
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Box_default, { width: 20, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "cyan", children: key }) }),
43272
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { children: desc })
43375
+ var BindingsPanel2 = () => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 1, children: [
43376
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { bold: true, color: "magentaBright", children: "Vim key-binding reference" }),
43377
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: BINDINGS.map(([key, desc]) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Box_default, { children: [
43378
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Box_default, { width: 20, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: "cyan", children: key }) }),
43379
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { children: desc })
43273
43380
  ] }, key)) }),
43274
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Text, { color: "gray", children: [
43381
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Text, { color: "gray", children: [
43275
43382
  "Vim mode must be enabled via",
43276
43383
  " ",
43277
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "cyan", children: "/vim on" }),
43384
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: "cyan", children: "/vim on" }),
43278
43385
  " ",
43279
43386
  "and the CLI restarted for bindings to take effect."
43280
43387
  ] }) })
@@ -43288,7 +43395,7 @@ var vimCommand = {
43288
43395
  if (sub === "bindings") {
43289
43396
  return {
43290
43397
  type: "render",
43291
- element: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(BindingsPanel2, {})
43398
+ element: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(BindingsPanel2, {})
43292
43399
  };
43293
43400
  }
43294
43401
  if (sub === "on") {
@@ -43311,7 +43418,7 @@ var vimCommand = {
43311
43418
  const enabled = cfg.vim === true;
43312
43419
  return {
43313
43420
  type: "render",
43314
- element: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(StatusPanel, { enabled })
43421
+ element: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(StatusPanel, { enabled })
43315
43422
  };
43316
43423
  }
43317
43424
  };
@@ -43612,7 +43719,7 @@ async function runBgAgent(id) {
43612
43719
  apiKey: cfg.apiKey,
43613
43720
  baseUrl: cfg.apiBaseUrl,
43614
43721
  clientType: "ide",
43615
- userAgent: `kryven-cli-bg/${"0.2.3"}`
43722
+ userAgent: `kryven-cli-bg/${"0.2.5"}`
43616
43723
  });
43617
43724
  const transcriptPath = join25(dir, "transcript.jsonl");
43618
43725
  const appendTranscript = async (m) => {
@@ -43731,7 +43838,7 @@ async function runBgAgent(id) {
43731
43838
  }
43732
43839
 
43733
43840
  // src/commands-palette/builtin/bg.tsx
43734
- var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
43841
+ var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
43735
43842
  function fmtElapsed2(start, end) {
43736
43843
  const sec = Math.floor(((end ?? Date.now()) - start) / 1e3);
43737
43844
  const m = Math.floor(sec / 60);
@@ -43744,26 +43851,26 @@ var STATUS_COLOR2 = {
43744
43851
  killed: "red",
43745
43852
  timeout: "yellow"
43746
43853
  };
43747
- var BgListPanel = ({ agents }) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
43748
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { bold: true, color: "cyan", children: [
43854
+ var BgListPanel = ({ agents }) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
43855
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Text, { bold: true, color: "cyan", children: [
43749
43856
  "Background agents (",
43750
43857
  agents.length,
43751
43858
  ")"
43752
43859
  ] }),
43753
- agents.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { color: "gray", children: [
43860
+ agents.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Text, { color: "gray", children: [
43754
43861
  "None. Start one with /bg start ",
43755
43862
  "<prompt>",
43756
43863
  "."
43757
- ] }) : agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Box_default, { children: [
43758
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Box_default, { width: 11, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { color: "cyan", children: [
43864
+ ] }) : agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Box_default, { children: [
43865
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Box_default, { width: 11, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Text, { color: "cyan", children: [
43759
43866
  a2.id.slice(0, 8),
43760
43867
  "\u2026"
43761
43868
  ] }) }),
43762
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Box_default, { width: 11, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: STATUS_COLOR2[a2.status] ?? "white", children: a2.status }) }),
43763
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Box_default, { width: 8, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "gray", children: fmtElapsed2(a2.startedAt, a2.finishedAt) }) }),
43764
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "gray", wrap: "truncate-end", children: a2.lastLine || "" })
43869
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Box_default, { width: 11, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: STATUS_COLOR2[a2.status] ?? "white", children: a2.status }) }),
43870
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Box_default, { width: 8, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: "gray", children: fmtElapsed2(a2.startedAt, a2.finishedAt) }) }),
43871
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: "gray", wrap: "truncate-end", children: a2.lastLine || "" })
43765
43872
  ] }, a2.id)),
43766
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { color: "gray", children: [
43873
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Text, { color: "gray", children: [
43767
43874
  "/bg start ",
43768
43875
  "<prompt>",
43769
43876
  " \xB7 /bg logs ",
@@ -43822,27 +43929,27 @@ var bgCommand = {
43822
43929
  };
43823
43930
  }
43824
43931
  const agents = await listBgAgents();
43825
- return { type: "render", element: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(BgListPanel, { agents }) };
43932
+ return { type: "render", element: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(BgListPanel, { agents }) };
43826
43933
  }
43827
43934
  };
43828
43935
 
43829
43936
  // src/commands-palette/builtin/mode.tsx
43830
43937
  init_modes();
43831
- var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
43938
+ var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1);
43832
43939
  var ORDER = ["plan", "default", "acceptEdits", "bypass", "deny"];
43833
- var ModePanel = ({ current }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
43834
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { bold: true, color: "cyan", children: "Permission mode" }),
43940
+ var ModePanel = ({ current }) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
43941
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { bold: true, color: "cyan", children: "Permission mode" }),
43835
43942
  ORDER.map((m) => {
43836
43943
  const active = m === current;
43837
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Box_default, { children: [
43838
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Text, { color: active ? "greenBright" : "cyan", bold: active, children: [
43944
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Box_default, { children: [
43945
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Text, { color: active ? "greenBright" : "cyan", bold: active, children: [
43839
43946
  active ? "\u25B8 " : " ",
43840
43947
  m
43841
43948
  ] }) }),
43842
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: "gray", children: MODE_DESCRIPTIONS[m] })
43949
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: "gray", children: MODE_DESCRIPTIONS[m] })
43843
43950
  ] }, m);
43844
43951
  }),
43845
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Text, { color: "gray", children: [
43952
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Text, { color: "gray", children: [
43846
43953
  "Switch: /mode ",
43847
43954
  "<name>",
43848
43955
  " \xB7 cycle with Shift+Tab \xB7 enable bypass with /mode bypass --confirm"
@@ -43859,7 +43966,7 @@ var modeCommand = {
43859
43966
  const parts = (args ?? "").trim().split(/\s+/).filter(Boolean);
43860
43967
  const sub = (parts[0] ?? "").toLowerCase();
43861
43968
  if (!sub) {
43862
- return { type: "render", element: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ModePanel, { current: getPermissionMode() }) };
43969
+ return { type: "render", element: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ModePanel, { current: getPermissionMode() }) };
43863
43970
  }
43864
43971
  if (sub === "next") {
43865
43972
  return { type: "ack", message: `Permission mode: ${cyclePermissionMode()}` };
@@ -43889,6 +43996,7 @@ var BUILTIN_COMMANDS = [
43889
43996
  exitCommand,
43890
43997
  modelCommand,
43891
43998
  moodCommand,
43999
+ loginCommand2,
43892
44000
  costCommand,
43893
44001
  skillCommand,
43894
44002
  agentCommand,
@@ -44032,6 +44140,7 @@ function applyCompletion(buffer, result, item) {
44032
44140
  init_messages();
44033
44141
  init_system_prompt();
44034
44142
  init_loop();
44143
+ init_client();
44035
44144
  init_errors();
44036
44145
 
44037
44146
  // src/session/store.ts
@@ -44389,6 +44498,7 @@ var SessionsClient = class {
44389
44498
 
44390
44499
  // src/tui/REPL.tsx
44391
44500
  init_load();
44501
+ init_crypto();
44392
44502
 
44393
44503
  // src/session/history.ts
44394
44504
  var import_proper_lockfile = __toESM(require_proper_lockfile(), 1);
@@ -44587,7 +44697,7 @@ async function checkForUpdate(current, timeoutMs = 2500) {
44587
44697
  }
44588
44698
 
44589
44699
  // src/tui/REPL.tsx
44590
- var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
44700
+ var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1);
44591
44701
  import fs4 from "node:fs";
44592
44702
  import path8 from "node:path";
44593
44703
  function detectReflectCommand(cwd2) {
@@ -44605,13 +44715,6 @@ function detectReflectCommand(cwd2) {
44605
44715
  }
44606
44716
  return null;
44607
44717
  }
44608
- var KRYVEN_PIXEL_WORDMARK = [
44609
- "## ## ##### ## ## ## ## ##### ## ##",
44610
- "## ## ## ## #### ## ## ## ### ##",
44611
- "#### ##### ## ## ## ##### #### ##",
44612
- "## ## ## ## ## ## ## ## ## ####",
44613
- "## ## ## ## ## ### ##### ## ###"
44614
- ];
44615
44718
  function shortArgs(args, max = 80) {
44616
44719
  const s = typeof args === "string" ? args : JSON.stringify(args);
44617
44720
  return s.length > max ? s.slice(0, max - 1) + "\u2026" : s;
@@ -44626,24 +44729,26 @@ var REPL = ({
44626
44729
  cwd: cwd2,
44627
44730
  resumeMessages,
44628
44731
  resumeSessionId,
44629
- isGuest = false,
44732
+ isGuest: initialIsGuest = false,
44630
44733
  noMotion: _noMotion = false,
44631
44734
  themeOverride: _themeOverride,
44632
44735
  seedPrompt
44633
44736
  }) => {
44634
44737
  const app = use_app_default();
44635
- const conversationRef = (0, import_react27.useRef)(new Conversation());
44636
- const sessionRef = (0, import_react27.useRef)(new SessionStore(resumeSessionId));
44637
- const remoteSessionRef = (0, import_react27.useRef)(null);
44638
- const abortRef = (0, import_react27.useRef)(null);
44639
- const permissionResolveRef = (0, import_react27.useRef)(null);
44640
- const readPathsRef = (0, import_react27.useRef)(/* @__PURE__ */ new Set());
44641
- const toolMetaRef = (0, import_react27.useRef)(/* @__PURE__ */ new Map());
44642
- (0, import_react27.useEffect)(() => {
44738
+ const clientRef = (0, import_react28.useRef)(client);
44739
+ const [isGuest, setIsGuest] = (0, import_react28.useState)(initialIsGuest);
44740
+ const conversationRef = (0, import_react28.useRef)(new Conversation());
44741
+ const sessionRef = (0, import_react28.useRef)(new SessionStore(resumeSessionId));
44742
+ const remoteSessionRef = (0, import_react28.useRef)(null);
44743
+ const abortRef = (0, import_react28.useRef)(null);
44744
+ const permissionResolveRef = (0, import_react28.useRef)(null);
44745
+ const readPathsRef = (0, import_react28.useRef)(/* @__PURE__ */ new Set());
44746
+ const toolMetaRef = (0, import_react28.useRef)(/* @__PURE__ */ new Map());
44747
+ (0, import_react28.useEffect)(() => {
44643
44748
  if (isGuest) return;
44644
44749
  const cfg = resolveConfig();
44645
44750
  if (cfg.apiKey && cfg.telemetry !== false) {
44646
- const sessionsClient = new SessionsClient(client);
44751
+ const sessionsClient = new SessionsClient(clientRef.current);
44647
44752
  remoteSessionRef.current = new RemoteSessionStore(
44648
44753
  sessionRef.current.id,
44649
44754
  sessionsClient,
@@ -44657,28 +44762,42 @@ var REPL = ({
44657
44762
  );
44658
44763
  };
44659
44764
  }, []);
44660
- const [input, setInput] = (0, import_react27.useState)("");
44661
- const [streaming, setStreaming] = (0, import_react27.useState)(null);
44662
- const [busy, setBusy] = (0, import_react27.useState)(false);
44663
- const [model, setModel] = (0, import_react27.useState)(initialModel);
44664
- const [mood, setMood] = (0, import_react27.useState)(initialMood);
44665
- const [git, setGit] = (0, import_react27.useState)({ isRepo: false });
44666
- const [, forceRender] = (0, import_react27.useState)(0);
44667
- const [overlay, setOverlay] = (0, import_react27.useState)(null);
44668
- const [notes, setNotes] = (0, import_react27.useState)([]);
44669
- const [sessionTokens, setSessionTokens] = (0, import_react27.useState)(0);
44670
- const [toolEntries, setToolEntries] = (0, import_react27.useState)([]);
44671
- const [permissionReq, setPermissionReq] = (0, import_react27.useState)(null);
44672
- const [staticGen, setStaticGen] = (0, import_react27.useState)(0);
44673
- const prevCommittedCountRef = (0, import_react27.useRef)(0);
44674
- const cfgRef = (0, import_react27.useRef)(resolveConfig());
44675
- const vimEnabledRef = (0, import_react27.useRef)(cfgRef.current.vim === true);
44676
- const vimRef = (0, import_react27.useRef)(initialVim());
44677
- const [vimTick, setVimTick] = (0, import_react27.useState)(0);
44678
- const themeMgrRef = (0, import_react27.useRef)(null);
44679
- const keyMgrRef = (0, import_react27.useRef)(null);
44680
- const [accentColor, setAccentColor] = (0, import_react27.useState)("#8B5CF6");
44681
- (0, import_react27.useEffect)(() => {
44765
+ const [input, setInput] = (0, import_react28.useState)("");
44766
+ const [streaming, setStreaming] = (0, import_react28.useState)(null);
44767
+ const [busy, setBusy] = (0, import_react28.useState)(false);
44768
+ const [model, setModel] = (0, import_react28.useState)(initialModel);
44769
+ const [mood, setMood] = (0, import_react28.useState)(initialMood);
44770
+ const [git, setGit] = (0, import_react28.useState)({ isRepo: false });
44771
+ const [, forceRender] = (0, import_react28.useState)(0);
44772
+ const [overlay, setOverlay] = (0, import_react28.useState)(null);
44773
+ const [notes, setNotes] = (0, import_react28.useState)([]);
44774
+ const [sessionTokens, setSessionTokens] = (0, import_react28.useState)(0);
44775
+ const [toolEntries, setToolEntries] = (0, import_react28.useState)([]);
44776
+ const [permissionReq, setPermissionReq] = (0, import_react28.useState)(null);
44777
+ const [modelPicker, setModelPicker] = (0, import_react28.useState)(null);
44778
+ const [staticGen, setStaticGen] = (0, import_react28.useState)(0);
44779
+ const prevCommittedCountRef = (0, import_react28.useRef)(0);
44780
+ const cfgRef = (0, import_react28.useRef)(resolveConfig());
44781
+ const vimEnabledRef = (0, import_react28.useRef)(cfgRef.current.vim === true);
44782
+ const vimRef = (0, import_react28.useRef)(initialVim());
44783
+ const [vimTick, setVimTick] = (0, import_react28.useState)(0);
44784
+ const themeMgrRef = (0, import_react28.useRef)(null);
44785
+ const keyMgrRef = (0, import_react28.useRef)(null);
44786
+ const initialTheme = (() => {
44787
+ const name = _themeOverride || cfgRef.current.theme || "default";
44788
+ const c3 = (BUILTIN_THEMES.find((b) => b.name === name) ?? BUILTIN_THEMES.find((b) => b.name === "default"))?.colors;
44789
+ return {
44790
+ fg: c3?.fg ?? "#F5EFE6",
44791
+ muted: c3?.muted ?? "#736560",
44792
+ warn: c3?.warn ?? "#F59E0B",
44793
+ accent: c3?.accent ?? "#8B5CF6",
44794
+ info: c3?.info ?? "#7EA8C4",
44795
+ border: c3?.border ?? "#3F3F46"
44796
+ };
44797
+ })();
44798
+ const [accentColor, setAccentColor] = (0, import_react28.useState)(initialTheme.accent);
44799
+ const [theme, setTheme] = (0, import_react28.useState)(initialTheme);
44800
+ (0, import_react28.useEffect)(() => {
44682
44801
  let cancelled = false;
44683
44802
  (async () => {
44684
44803
  try {
@@ -44686,10 +44805,22 @@ var REPL = ({
44686
44805
  await tm.loadAll();
44687
44806
  const name = _themeOverride || cfgRef.current.theme || "default";
44688
44807
  tm.setActive(name);
44808
+ const applyColors = (c3) => {
44809
+ if (!c3) return;
44810
+ if (c3.accent) setAccentColor(c3.accent);
44811
+ setTheme((p) => ({
44812
+ fg: c3.fg ?? p.fg,
44813
+ muted: c3.muted ?? p.muted,
44814
+ warn: c3.warn ?? p.warn,
44815
+ accent: c3.accent ?? p.accent,
44816
+ info: c3.info ?? p.info,
44817
+ border: c3.border ?? p.border
44818
+ }));
44819
+ };
44689
44820
  const t = tm.current();
44690
- if (!cancelled && t?.colors?.accent) setAccentColor(t.colors.accent);
44691
- tm.on("change", (theme) => {
44692
- if (theme?.colors?.accent) setAccentColor(theme.colors.accent);
44821
+ if (!cancelled) applyColors(t?.colors);
44822
+ tm.on("change", (theme2) => {
44823
+ applyColors(theme2?.colors);
44693
44824
  });
44694
44825
  tm.watchForChanges();
44695
44826
  themeMgrRef.current = tm;
@@ -44711,15 +44842,15 @@ var REPL = ({
44711
44842
  keyMgrRef.current?.stopWatching?.();
44712
44843
  };
44713
44844
  }, []);
44714
- const toolsEnabled = (0, import_react27.useMemo)(() => listTools().length > 0, []);
44715
- (0, import_react27.useEffect)(() => {
44716
- void checkForUpdate("0.2.3").then((info) => {
44845
+ const toolsEnabled = (0, import_react28.useMemo)(() => listTools().length > 0, []);
44846
+ (0, import_react28.useEffect)(() => {
44847
+ void checkForUpdate("0.2.5").then((info) => {
44717
44848
  if (info?.updateAvailable) {
44718
44849
  setNotes((p) => [
44719
44850
  ...p,
44720
44851
  {
44721
44852
  kind: "system",
44722
- text: `Update available: ${"0.2.3"} \u2192 ${info.latest}. Run \`kryven update\` to update.`
44853
+ text: `Update available: ${"0.2.5"} \u2192 ${info.latest}. Run \`kryven update\` to update.`
44723
44854
  }
44724
44855
  ]);
44725
44856
  }
@@ -44745,7 +44876,7 @@ var REPL = ({
44745
44876
  }
44746
44877
  })();
44747
44878
  }, []);
44748
- const completion = (0, import_react27.useMemo)(() => {
44879
+ const completion = (0, import_react28.useMemo)(() => {
44749
44880
  if (busy || permissionReq || overlay || !input) return null;
44750
44881
  try {
44751
44882
  return getCompletions(input, input.length, cwd2);
@@ -44754,6 +44885,30 @@ var REPL = ({
44754
44885
  }
44755
44886
  }, [input, busy, permissionReq, overlay, cwd2]);
44756
44887
  use_input_default((inputCh, key) => {
44888
+ if (modelPicker) {
44889
+ if (key.upArrow) {
44890
+ setModelPicker((p) => p ? { sel: Math.max(0, p.sel - 1) } : p);
44891
+ return;
44892
+ }
44893
+ if (key.downArrow) {
44894
+ setModelPicker((p) => p ? { sel: Math.min(MODELS.length - 1, p.sel + 1) } : p);
44895
+ return;
44896
+ }
44897
+ if (key.return) {
44898
+ const m = MODELS[modelPicker.sel];
44899
+ if (m) {
44900
+ setModel(m.id);
44901
+ setNotes((p) => [...p, { kind: "system", text: `Model: ${m.id} (${m.publisher})` }]);
44902
+ }
44903
+ setModelPicker(null);
44904
+ return;
44905
+ }
44906
+ if (key.escape) {
44907
+ setModelPicker(null);
44908
+ return;
44909
+ }
44910
+ return;
44911
+ }
44757
44912
  if (permissionReq && permissionResolveRef.current) {
44758
44913
  const ch = inputCh.toLowerCase();
44759
44914
  let decision = null;
@@ -44813,7 +44968,7 @@ var REPL = ({
44813
44968
  if (out.consumed) setVimTick((n2) => n2 + 1);
44814
44969
  }
44815
44970
  });
44816
- const slashCtx = (0, import_react27.useMemo)(
44971
+ const slashCtx = (0, import_react28.useMemo)(
44817
44972
  () => ({
44818
44973
  conversation: conversationRef.current,
44819
44974
  model,
@@ -44822,7 +44977,37 @@ var REPL = ({
44822
44977
  sessionTokens,
44823
44978
  sessionMessages: conversationRef.current.size(),
44824
44979
  setModel: (m) => setModel(m),
44825
- setMood: (m) => setMood(m)
44980
+ setMood: (m) => setMood(m),
44981
+ // /login: validate a new key, persist it, and hot-swap the live client so
44982
+ // the next message uses it — no restart. Flips guest -> authenticated too.
44983
+ relogin: async (rawKey) => {
44984
+ const key = rawKey.trim();
44985
+ if (!isValidApiKey(key)) {
44986
+ return { ok: false, message: 'Invalid key format (expected "kry_sk_" + 48 hex chars).' };
44987
+ }
44988
+ const cfg = resolveConfig();
44989
+ const candidate = new KryvenClient({
44990
+ apiKey: key,
44991
+ baseUrl: cfg.apiBaseUrl,
44992
+ clientType: "ide",
44993
+ userAgent: `kryven-cli/${"0.2.5"}`
44994
+ });
44995
+ try {
44996
+ await candidate.ping();
44997
+ } catch (err) {
44998
+ return { ok: false, message: `Key rejected: ${friendlyMessage(err)}` };
44999
+ }
45000
+ try {
45001
+ const u2 = loadUserConfig();
45002
+ saveUserConfig({ ...u2, apiKey: key });
45003
+ } catch (err) {
45004
+ logger.warn("relogin: config save failed", String(err));
45005
+ }
45006
+ clientRef.current = candidate;
45007
+ setIsGuest(false);
45008
+ const toolHint = listTools().length === 0 ? " Restart kryven to enable tools." : "";
45009
+ return { ok: true, message: `Logged in \u2014 key validated, saved, and active for this session.${toolHint}` };
45010
+ }
44826
45011
  }),
44827
45012
  [model, mood, cwd2, sessionTokens]
44828
45013
  );
@@ -44842,7 +45027,7 @@ var REPL = ({
44842
45027
  if (remoteSessionRef.current) {
44843
45028
  const cfg = resolveConfig();
44844
45029
  if (cfg.apiKey && cfg.telemetry !== false) {
44845
- const sessionsClient = new SessionsClient(client);
45030
+ const sessionsClient = new SessionsClient(clientRef.current);
44846
45031
  remoteSessionRef.current = new RemoteSessionStore(
44847
45032
  sessionRef.current.id,
44848
45033
  sessionsClient,
@@ -44866,7 +45051,7 @@ var REPL = ({
44866
45051
  if (remoteSessionRef.current) {
44867
45052
  const cfg = resolveConfig();
44868
45053
  if (cfg.apiKey && cfg.telemetry !== false) {
44869
- const sessionsClient = new SessionsClient(client);
45054
+ const sessionsClient = new SessionsClient(clientRef.current);
44870
45055
  remoteSessionRef.current = new RemoteSessionStore(
44871
45056
  sessionRef.current.id,
44872
45057
  sessionsClient,
@@ -44889,6 +45074,11 @@ var REPL = ({
44889
45074
  case "render":
44890
45075
  setOverlay(res.element);
44891
45076
  return;
45077
+ case "model-picker": {
45078
+ const idx = MODELS.findIndex((m) => m.id === model);
45079
+ setModelPicker({ sel: idx >= 0 ? idx : 0 });
45080
+ return;
45081
+ }
44892
45082
  }
44893
45083
  };
44894
45084
  const askPermission = (req) => new Promise((resolve7) => {
@@ -44967,7 +45157,7 @@ var REPL = ({
44967
45157
  }
44968
45158
  };
44969
45159
  const runGuestTurn = async (ac) => {
44970
- const guestClient = client;
45160
+ const guestClient = clientRef.current;
44971
45161
  setStreaming("");
44972
45162
  const allMessages = conversationRef.current.all().map((m) => ({
44973
45163
  role: m.role,
@@ -45000,7 +45190,7 @@ var REPL = ({
45000
45190
  setStreaming("");
45001
45191
  let acc = "";
45002
45192
  let usage;
45003
- for await (const ev of runTurn(client, conversationRef.current, {
45193
+ for await (const ev of runTurn(clientRef.current, conversationRef.current, {
45004
45194
  systemPrompt: sys,
45005
45195
  model,
45006
45196
  mood,
@@ -45049,7 +45239,7 @@ var REPL = ({
45049
45239
  }
45050
45240
  };
45051
45241
  const reflectCmd = detectReflectCommand(cwd2);
45052
- for await (const ev of runAgentLoopWithTools(client, conversationRef.current, {
45242
+ for await (const ev of runAgentLoopWithTools(clientRef.current, conversationRef.current, {
45053
45243
  systemPrompt: sys,
45054
45244
  model,
45055
45245
  mood,
@@ -45165,6 +45355,7 @@ var REPL = ({
45165
45355
  }
45166
45356
  };
45167
45357
  const convSize = conversationRef.current.size();
45358
+ const isHome = convSize === 0 && streaming == null;
45168
45359
  const status = {
45169
45360
  model,
45170
45361
  mood,
@@ -45176,19 +45367,19 @@ var REPL = ({
45176
45367
  costUsd: sessionCostUsd(conversationRef.current.all(), model),
45177
45368
  mode: getPermissionMode()
45178
45369
  };
45179
- const staticItems = (0, import_react27.useMemo)(() => {
45370
+ const staticItems = (0, import_react28.useMemo)(() => {
45180
45371
  const gen = `g${staticGen}`;
45181
45372
  const items = [
45182
45373
  {
45183
45374
  id: `${gen}-header`,
45184
- node: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
45185
- KRYVEN_PIXEL_WORDMARK.map((line) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: "magentaBright", children: line }, line)),
45186
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Text, { bold: true, color: "cyan", children: [
45375
+ node: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
45376
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Wordmark, { muted: theme.muted, fg: theme.fg }),
45377
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Text, { color: theme.muted, children: [
45187
45378
  "Kryven CLI ",
45188
- "0.2.3",
45189
- toolsEnabled ? " \xB7 tools enabled" : ""
45190
- ] }),
45191
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: "gray", children: "Powered by KRY-5.2 Extended \xB7 type /help \xB7 Ctrl+D to exit" })
45379
+ "0.2.5",
45380
+ toolsEnabled ? " \xB7 tools" : "",
45381
+ " \xB7 Powered by KRY-5.2 Extended"
45382
+ ] }) })
45192
45383
  ] })
45193
45384
  }
45194
45385
  ];
@@ -45207,10 +45398,10 @@ var REPL = ({
45207
45398
  for (let i2 = 0; i2 < all.length; i2++) {
45208
45399
  const m = all[i2];
45209
45400
  if (m.role === "user") {
45210
- items.push({ id: `${gen}-m${i2}`, node: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(MessageList, { message: m }) });
45401
+ items.push({ id: `${gen}-m${i2}`, node: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MessageList, { message: m }) });
45211
45402
  } else if (m.role === "assistant") {
45212
45403
  if (typeof m.content === "string" && m.content.trim().length > 0) {
45213
- items.push({ id: `${gen}-m${i2}`, node: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(MessageList, { message: m }) });
45404
+ items.push({ id: `${gen}-m${i2}`, node: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MessageList, { message: m }) });
45214
45405
  }
45215
45406
  } else if (m.role === "tool") {
45216
45407
  const meta = m.tool_call_id ? toolMetaRef.current.get(m.tool_call_id) : void 0;
@@ -45222,77 +45413,104 @@ var REPL = ({
45222
45413
  status: "ok",
45223
45414
  output: typeof m.content === "string" ? m.content : ""
45224
45415
  };
45225
- items.push({ id: `${gen}-t${i2}`, node: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ToolCall, { ...entry }) });
45416
+ items.push({ id: `${gen}-t${i2}`, node: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ToolCall, { ...entry }) });
45226
45417
  }
45227
45418
  }
45228
45419
  return items;
45229
45420
  }, [convSize, staticGen, toolsEnabled]);
45230
45421
  const committedCount = staticItems.length;
45231
- (0, import_react27.useEffect)(() => {
45422
+ (0, import_react28.useEffect)(() => {
45232
45423
  if (committedCount < prevCommittedCountRef.current) {
45233
45424
  setStaticGen((g) => g + 1);
45234
45425
  }
45235
45426
  prevCommittedCountRef.current = committedCount;
45236
45427
  }, [committedCount]);
45237
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Box_default, { flexDirection: "column", children: [
45238
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Static, { items: staticItems, children: (item) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Box_default, { flexDirection: "column", children: item.node }, item.id) }, staticGen),
45239
- streaming != null && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
45240
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { bold: true, color: "green", children: "kryven" }),
45241
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Box_default, { paddingLeft: 2, flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(MarkdownStream, { streamingText: streaming, done: !busy }) })
45428
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Box_default, { flexDirection: "column", children: [
45429
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Static, { items: staticItems, children: (item) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Box_default, { flexDirection: "column", children: item.node }, item.id) }, staticGen),
45430
+ streaming != null && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
45431
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { bold: true, color: "green", children: "kryven" }),
45432
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Box_default, { paddingLeft: 2, flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MarkdownStream, { streamingText: streaming, done: !busy }) })
45242
45433
  ] }),
45243
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ToolCallList, { entries: toolEntries }),
45244
- permissionReq && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, borderStyle: "round", borderColor: "yellow", paddingX: 1, children: [
45245
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { bold: true, children: "Permission required" }),
45246
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Text, { children: [
45434
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ToolCallList, { entries: toolEntries, paused: Boolean(permissionReq) }),
45435
+ modelPicker && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ModelPicker, { models: MODELS, selected: modelPicker.sel, current: model }),
45436
+ permissionReq && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, borderStyle: "round", borderColor: "yellow", paddingX: 1, children: [
45437
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { bold: true, children: "Permission required" }),
45438
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Text, { children: [
45247
45439
  "Tool: ",
45248
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: "cyan", children: permissionReq.toolName }),
45440
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: "cyan", children: permissionReq.toolName }),
45249
45441
  " ",
45250
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Text, { color: riskColor(permissionReq.risk), children: [
45442
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Text, { color: riskColor(permissionReq.risk), children: [
45251
45443
  "[",
45252
45444
  permissionReq.risk,
45253
45445
  "]"
45254
45446
  ] })
45255
45447
  ] }),
45256
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: "gray", children: permissionReq.argsPreview }),
45257
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Text, { children: [
45258
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: "green", children: "[Y]" }),
45448
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: "gray", children: permissionReq.argsPreview }),
45449
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Text, { children: [
45450
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: "green", children: "[Y]" }),
45259
45451
  " allow once \xB7",
45260
45452
  " ",
45261
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: "green", children: "[A]" }),
45453
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: "green", children: "[A]" }),
45262
45454
  " always (this command) \xB7",
45263
45455
  " ",
45264
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: "green", children: "[Shift+A]" }),
45456
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: "green", children: "[Shift+A]" }),
45265
45457
  " always (this tool) \xB7",
45266
45458
  " ",
45267
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: "red", children: "[N]" }),
45459
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: "red", children: "[N]" }),
45268
45460
  " deny"
45269
45461
  ] })
45270
45462
  ] }),
45271
- notes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Box_default, { flexDirection: "column", marginBottom: 1, children: notes.slice(-3).map((n2, i2) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Text, { color: n2.kind === "error" ? "red" : "gray", children: [
45463
+ notes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Box_default, { flexDirection: "column", marginBottom: 1, children: notes.slice(-3).map((n2, i2) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Text, { color: n2.kind === "error" ? "red" : "gray", children: [
45272
45464
  n2.kind === "error" ? "\u2717 " : "\xB7 ",
45273
45465
  n2.text
45274
45466
  ] }, i2)) }),
45275
- overlay && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Box_default, { marginBottom: 1, flexDirection: "column", children: [
45467
+ overlay && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Box_default, { marginBottom: 1, flexDirection: "column", children: [
45276
45468
  overlay,
45277
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: "gray", children: "(press Enter or Esc to dismiss)" })
45469
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: "gray", children: "(press Enter or Esc to dismiss)" })
45278
45470
  ] }),
45279
- completion && completion.items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CompletionMenu, { items: completion.items, selected: 0 }),
45280
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
45471
+ completion && completion.items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CompletionMenu, { items: completion.items, selected: 0 }),
45472
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
45281
45473
  PromptInput,
45282
45474
  {
45283
45475
  value: input,
45284
45476
  onChange: setInput,
45285
45477
  onSubmit: submit,
45286
- disabled: busy || Boolean(permissionReq),
45478
+ disabled: busy || Boolean(permissionReq) || Boolean(modelPicker),
45287
45479
  placeholder: busy ? "" : void 0,
45288
45480
  vimMode: vimEnabledRef.current ? vimRef.current.mode : null,
45289
45481
  vimCmdline: vimEnabledRef.current ? vimRef.current.cmdline : null,
45290
- accentColor
45482
+ accentColor,
45483
+ model,
45484
+ mood,
45485
+ themeColors: theme
45291
45486
  },
45292
45487
  `pi-${vimTick}`
45293
45488
  ),
45294
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Box_default, { marginTop: 1, children: busy && !permissionReq && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Spinner2, { label: "thinking\u2026 (Ctrl+C to cancel)" }) }),
45295
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(StatusBar, { status }) })
45489
+ isHome ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
45490
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Box_default, { flexDirection: "row", gap: 2, justifyContent: "flex-end", children: [
45491
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Text, { children: [
45492
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: theme.fg, children: "/model" }),
45493
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: theme.muted, children: " models" })
45494
+ ] }),
45495
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Text, { children: [
45496
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: theme.fg, children: "/help" }),
45497
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: theme.muted, children: " commands" })
45498
+ ] }),
45499
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Text, { children: [
45500
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: theme.fg, children: "shift+tab" }),
45501
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: theme.muted, children: " mode" })
45502
+ ] })
45503
+ ] }),
45504
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Box_default, { marginTop: 1, flexDirection: "row", children: [
45505
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: theme.warn, children: "\u25CF Tip " }),
45506
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: theme.muted, children: "Run " }),
45507
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: theme.fg, children: isGuest ? "/login" : "/model" }),
45508
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: theme.muted, children: isGuest ? " to unlock unlimited chat and tools." : " to switch models, or /help for all commands." })
45509
+ ] })
45510
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
45511
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Box_default, { marginTop: 1, children: busy && !permissionReq && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Spinner2, { label: "thinking\u2026 (Ctrl+C to cancel)" }) }),
45512
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(StatusBar, { status }) })
45513
+ ] })
45296
45514
  ] });
45297
45515
  };
45298
45516
 
@@ -45555,7 +45773,201 @@ async function bootstrapMCP(opts = {}) {
45555
45773
 
45556
45774
  // src/commands/chat.ts
45557
45775
  init_store();
45776
+
45777
+ // src/tui/SetupWizard.tsx
45778
+ var import_react29 = __toESM(require_react(), 1);
45779
+ init_client();
45780
+ init_crypto();
45781
+ init_errors();
45782
+ init_load();
45783
+ var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1);
45784
+ import { dirname as dirname16 } from "node:path";
45785
+ import { spawn as spawn8 } from "node:child_process";
45786
+ var OPTIONS = [
45787
+ {
45788
+ id: "guest",
45789
+ title: "Quick start (guest)",
45790
+ desc: "3 free prompts, no key, no signup - try Kryven right now"
45791
+ },
45792
+ {
45793
+ id: "key",
45794
+ title: "Sign in with an API key",
45795
+ desc: "Paste your kry_sk_ key for unlimited chat + the full tool agent"
45796
+ }
45797
+ ];
45798
+ var SetupWizard = ({
45799
+ baseUrl,
45800
+ onDone
45801
+ }) => {
45802
+ const [step, setStep] = (0, import_react29.useState)("choose");
45803
+ const [sel, setSel] = (0, import_react29.useState)(0);
45804
+ const [keyVal, setKeyVal] = (0, import_react29.useState)("");
45805
+ const [error, setError] = (0, import_react29.useState)(null);
45806
+ use_input_default((input, key) => {
45807
+ if (key.ctrl && input === "c") {
45808
+ onDone({ mode: "cancel" });
45809
+ return;
45810
+ }
45811
+ if (step === "choose") {
45812
+ if (key.upArrow || input === "k") setSel((s) => (s + OPTIONS.length - 1) % OPTIONS.length);
45813
+ else if (key.downArrow || input === "j") setSel((s) => (s + 1) % OPTIONS.length);
45814
+ else if (input === "1") setSel(0);
45815
+ else if (input === "2") setSel(1);
45816
+ else if (key.return) {
45817
+ if (OPTIONS[sel].id === "guest") onDone({ mode: "guest" });
45818
+ else {
45819
+ setError(null);
45820
+ setStep("enter-key");
45821
+ }
45822
+ }
45823
+ } else if (step === "enter-key") {
45824
+ if (key.escape) {
45825
+ setStep("choose");
45826
+ setKeyVal("");
45827
+ setError(null);
45828
+ }
45829
+ }
45830
+ });
45831
+ const submitKey = (raw) => {
45832
+ const k = raw.trim();
45833
+ if (!isValidApiKey(k)) {
45834
+ setError('Invalid format - expected "kry_sk_" followed by 48 hex chars.');
45835
+ return;
45836
+ }
45837
+ setStep("validating");
45838
+ setError(null);
45839
+ void (async () => {
45840
+ try {
45841
+ await new KryvenClient({
45842
+ apiKey: k,
45843
+ baseUrl,
45844
+ clientType: "ide",
45845
+ userAgent: `kryven-cli/${"0.2.5"}`
45846
+ }).ping();
45847
+ onDone({ mode: "key", key: k });
45848
+ } catch (err) {
45849
+ setError(`Key rejected: ${friendlyMessage(err)}`);
45850
+ setStep("enter-key");
45851
+ }
45852
+ })();
45853
+ };
45854
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Box_default, { flexDirection: "column", children: [
45855
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
45856
+ Box_default,
45857
+ {
45858
+ flexDirection: "column",
45859
+ borderStyle: "round",
45860
+ borderColor: "magenta",
45861
+ paddingX: 2,
45862
+ marginBottom: 1,
45863
+ children: [
45864
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { bold: true, color: "magentaBright", children: "\u2726 Kryven CLI Setup Wizard" }),
45865
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: "gray", children: "Let's configure your Kryven CLI. Press Ctrl+C any time to exit." })
45866
+ ]
45867
+ }
45868
+ ),
45869
+ step === "choose" && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Box_default, { flexDirection: "column", paddingX: 1, children: [
45870
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: "white", children: "How would you like to start?" }),
45871
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: "gray", children: "Use \u2191/\u2193 (or 1-2), Enter to confirm." }),
45872
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: OPTIONS.map((o2, i2) => {
45873
+ const on6 = i2 === sel;
45874
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
45875
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { color: on6 ? "greenBright" : "white", bold: on6, children: [
45876
+ on6 ? "(\u25CF)" : "(\u25CB)",
45877
+ " ",
45878
+ i2 + 1,
45879
+ ". ",
45880
+ o2.title,
45881
+ o2.id === "guest" ? " (recommended)" : ""
45882
+ ] }),
45883
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { color: "gray", children: [
45884
+ " ",
45885
+ o2.desc
45886
+ ] })
45887
+ ] }, o2.id);
45888
+ }) }),
45889
+ error && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: "red", children: error })
45890
+ ] }),
45891
+ step === "enter-key" && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Box_default, { flexDirection: "column", paddingX: 1, children: [
45892
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { children: "Paste your Kryven API key:" }),
45893
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: "gray", children: "Get one at https://kryven.cc/api-dashboard" }),
45894
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Box_default, { marginTop: 1, borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
45895
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: "cyan", children: "kry> " }),
45896
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
45897
+ build_default,
45898
+ {
45899
+ value: keyVal,
45900
+ onChange: setKeyVal,
45901
+ onSubmit: submitKey,
45902
+ mask: "*",
45903
+ placeholder: "kry_sk_..."
45904
+ }
45905
+ )
45906
+ ] }),
45907
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: "gray", children: "Enter to validate \xB7 Esc to go back" }),
45908
+ error && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: "red", children: error })
45909
+ ] }),
45910
+ step === "validating" && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: "yellow", children: "Validating key against /v1/models\u2026" }) })
45911
+ ] });
45912
+ };
45913
+ function openBrowser(url) {
45914
+ try {
45915
+ if (process.platform === "win32") {
45916
+ spawn8("cmd", ["/c", "start", "", url], { detached: true, stdio: "ignore" }).unref();
45917
+ } else if (process.platform === "darwin") {
45918
+ spawn8("open", [url], { detached: true, stdio: "ignore" }).unref();
45919
+ } else {
45920
+ spawn8("xdg-open", [url], { detached: true, stdio: "ignore" }).unref();
45921
+ }
45922
+ } catch {
45923
+ }
45924
+ }
45925
+ function runSetupWizard(baseUrl) {
45926
+ return new Promise((resolve7) => {
45927
+ const instance = render_default(
45928
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
45929
+ SetupWizard,
45930
+ {
45931
+ baseUrl,
45932
+ onDone: (r) => {
45933
+ instance.unmount();
45934
+ resolve7(r);
45935
+ }
45936
+ }
45937
+ ),
45938
+ { exitOnCtrlC: false }
45939
+ );
45940
+ });
45941
+ }
45942
+ async function maybeRunFirstRunSetup(opts) {
45943
+ const cfg = resolveConfig(opts.apiKey);
45944
+ const user = loadUserConfig();
45945
+ if (user.setupComplete || cfg.apiKeySource !== "none" || !process.stdin.isTTY) return;
45946
+ console.log(source_default.green(`[OK] Config directory ready at ${dirname16(cfg.configPath)}`));
45947
+ console.log(source_default.green("[OK] 6 built-in tools available (Read/Write/Edit/Bash/Glob/Grep)"));
45948
+ console.log(source_default.cyan("\n-> Starting setup wizard...\n"));
45949
+ const res = await runSetupWizard(cfg.apiBaseUrl);
45950
+ if (res.mode === "cancel") {
45951
+ console.log(source_default.dim("\nSetup cancelled. Run `kryven` again whenever you're ready.\n"));
45952
+ process.exit(0);
45953
+ }
45954
+ const cur = loadUserConfig();
45955
+ if (res.mode === "key" && res.key) {
45956
+ saveUserConfig({ ...cur, apiKey: res.key, setupComplete: true });
45957
+ console.log(source_default.green("\n[OK] API key validated and saved. You're all set.\n"));
45958
+ } else {
45959
+ saveUserConfig({ ...cur, setupComplete: true });
45960
+ const plansUrl = `${cfg.apiBaseUrl.replace(/\/$/, "")}/cli`;
45961
+ openBrowser(plansUrl);
45962
+ console.log(source_default.cyan("\n-> Starting in guest mode (3 free prompts)."));
45963
+ console.log(source_default.gray(` Opened our plans in your browser: ${plansUrl}`));
45964
+ console.log(source_default.gray(" Run /login (or `kryven login`) anytime to sign in.\n"));
45965
+ }
45966
+ }
45967
+
45968
+ // src/commands/chat.ts
45558
45969
  async function chatCommand(opts = {}) {
45970
+ await maybeRunFirstRunSetup({ apiKey: opts.apiKey });
45559
45971
  const cfg = resolveConfig(opts.apiKey);
45560
45972
  let client;
45561
45973
  let isGuest = false;
@@ -45564,7 +45976,7 @@ async function chatCommand(opts = {}) {
45564
45976
  client = new GuestKryvenClient({
45565
45977
  baseUrl: cfg.apiBaseUrl,
45566
45978
  shareFingerprint: cfg.shareFingerprint !== false,
45567
- userAgent: `kryven-cli/${"0.2.3"}`
45979
+ userAgent: `kryven-cli/${"0.2.5"}`
45568
45980
  });
45569
45981
  console.log(source_default.cyan("Guest mode \u2014 3 free prompts. Run `kryven login` for unlimited chat."));
45570
45982
  } else {
@@ -45572,7 +45984,7 @@ async function chatCommand(opts = {}) {
45572
45984
  apiKey: cfg.apiKey,
45573
45985
  baseUrl: cfg.apiBaseUrl,
45574
45986
  clientType: "ide",
45575
- userAgent: `kryven-cli/${"0.2.3"}`
45987
+ userAgent: `kryven-cli/${"0.2.5"}`
45576
45988
  });
45577
45989
  }
45578
45990
  let resumeMessages;
@@ -45639,7 +46051,7 @@ async function chatCommand(opts = {}) {
45639
46051
  logger.warn("config save (touch) failed", String(err));
45640
46052
  }
45641
46053
  const { waitUntilExit } = render_default(
45642
- import_react28.default.createElement(REPL, {
46054
+ import_react30.default.createElement(REPL, {
45643
46055
  client,
45644
46056
  initialModel: model,
45645
46057
  initialMood: mood,
@@ -45660,7 +46072,7 @@ async function chatCommand(opts = {}) {
45660
46072
  init_execa();
45661
46073
 
45662
46074
  // src/shims/version.ts
45663
- var KRYVEN_VERSION = "0.2.3";
46075
+ var KRYVEN_VERSION = "0.2.5";
45664
46076
 
45665
46077
  // src/commands/update.ts
45666
46078
  var PACKAGE2 = "@kryvenaiofficial/kryven";
@@ -45693,7 +46105,7 @@ import { writeFile as writeFile11, mkdir as mkdir13 } from "node:fs/promises";
45693
46105
  import { existsSync as existsSync23 } from "node:fs";
45694
46106
  import { join as join32 } from "node:path";
45695
46107
  import { homedir as homedir12 } from "node:os";
45696
- import { spawn as spawn8 } from "node:child_process";
46108
+ import { spawn as spawn9 } from "node:child_process";
45697
46109
  var SCOPE_LABEL3 = {
45698
46110
  "project-kryven": "project (.kryven)",
45699
46111
  "project-claude": "project (.claude)",
@@ -45803,7 +46215,7 @@ async function skillsCreate(name) {
45803
46215
  const editor = process.env.EDITOR || process.env.VISUAL || "vi";
45804
46216
  console.log(source_default.dim(`Opening in ${editor}\u2026`));
45805
46217
  await new Promise((resolveP) => {
45806
- const child = spawn8(editor, [file], { stdio: "inherit" });
46218
+ const child = spawn9(editor, [file], { stdio: "inherit" });
45807
46219
  child.on("close", () => resolveP());
45808
46220
  child.on("error", () => resolveP());
45809
46221
  });
@@ -45841,7 +46253,7 @@ async function skillsUpdate(name) {
45841
46253
  continue;
45842
46254
  }
45843
46255
  const r = await new Promise((resolveP) => {
45844
- const child = spawn8("git", ["-C", dir, "pull", "--ff-only"], { stdio: ["ignore", "pipe", "pipe"] });
46256
+ const child = spawn9("git", ["-C", dir, "pull", "--ff-only"], { stdio: ["ignore", "pipe", "pipe"] });
45845
46257
  const chunks = [];
45846
46258
  child.stdout.on("data", (d) => chunks.push(d));
45847
46259
  child.stderr.on("data", (d) => chunks.push(d));
@@ -46041,7 +46453,7 @@ async function main(argv2) {
46041
46453
  var argv = process.argv.slice(2);
46042
46454
  var first = argv[0];
46043
46455
  if (first === "--version" || first === "-v" || first === "-V") {
46044
- const v = "0.2.3";
46456
+ const v = "0.2.5";
46045
46457
  process.stdout.write(v + "\n");
46046
46458
  process.exit(0);
46047
46459
  }