@kryvenaiofficial/kryven 0.2.3 → 0.2.4

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.
Files changed (2) hide show
  1. package/dist/cli.mjs +921 -620
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -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_react29 = __toESM(require_react(), 1);
32503
32506
 
32504
32507
  // node_modules/ink/build/render.js
32505
32508
  import { Stream } from "node:stream";
@@ -38105,12 +38108,13 @@ var ToolCall = ({
38105
38108
  truncated,
38106
38109
  risk,
38107
38110
  renderHint,
38108
- collapsed = false
38111
+ collapsed = false,
38112
+ paused = false
38109
38113
  }) => {
38110
38114
  const startRef = (0, import_react25.useRef)(Date.now());
38111
38115
  const [elapsed, setElapsed] = (0, import_react25.useState)(0);
38112
38116
  (0, import_react25.useEffect)(() => {
38113
- if (status !== "running") {
38117
+ if (status !== "running" || paused) {
38114
38118
  setElapsed(Date.now() - startRef.current);
38115
38119
  return;
38116
38120
  }
@@ -38118,7 +38122,7 @@ var ToolCall = ({
38118
38122
  setElapsed(Date.now() - startRef.current);
38119
38123
  }, 100);
38120
38124
  return () => clearInterval(id);
38121
- }, [status]);
38125
+ }, [status, paused]);
38122
38126
  const icon = STATUS_ICON[status];
38123
38127
  const statusColor = STATUS_COLOR[status];
38124
38128
  if (collapsed) {
@@ -38192,13 +38196,15 @@ var ToolCall = ({
38192
38196
  };
38193
38197
  var ToolCallList = ({
38194
38198
  entries,
38195
- collapseCompleted = false
38199
+ collapseCompleted = false,
38200
+ paused = false
38196
38201
  }) => {
38197
38202
  if (entries.length === 0) return null;
38198
38203
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Box_default, { flexDirection: "column", marginBottom: 1, children: entries.map((e) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
38199
38204
  ToolCall,
38200
38205
  {
38201
38206
  ...e,
38207
+ paused,
38202
38208
  collapsed: collapseCompleted && e.status !== "running"
38203
38209
  },
38204
38210
  e.callId
@@ -38218,65 +38224,51 @@ var CompletionMenu = ({ items, selected }) => /* @__PURE__ */ (0, import_jsx_run
38218
38224
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { color: "gray", dimColor: true, children: "Tab to complete" })
38219
38225
  ] });
38220
38226
 
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
38227
+ // src/tui/ModelPicker.tsx
38226
38228
  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)
38229
+ var VISIBLE = 10;
38230
+ var ModelPicker = ({ models, selected, current }) => {
38231
+ const total = models.length;
38232
+ const start = Math.max(
38233
+ 0,
38234
+ Math.min(selected - Math.floor(VISIBLE / 2), Math.max(0, total - VISIBLE))
38238
38235
  );
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: [
38236
+ const end = Math.min(total, start + VISIBLE);
38237
+ const windowed = models.slice(start, end);
38238
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
38239
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Box_default, { children: [
38240
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { bold: true, color: "cyan", children: "Select a model " }),
38241
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Text, { color: "gray", children: [
38242
+ "\u2014 \u2191/\u2193 move \xB7 Enter switch \xB7 Esc cancel (",
38243
+ selected + 1,
38247
38244
  "/",
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
38245
+ total,
38246
+ ")"
38256
38247
  ] })
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" }) })
38248
+ ] }),
38249
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { color: "gray", dimColor: true, children: start > 0 ? " \u2191 more" : " " }),
38250
+ windowed.map((m, i2) => {
38251
+ const idx = start + i2;
38252
+ const isSel = idx === selected;
38253
+ const isCur = m.id === current;
38254
+ const cost = m.costIn != null && m.costOut != null ? ` $${m.costIn.toFixed(2)}/$${m.costOut.toFixed(2)}` : "";
38255
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Box_default, { children: [
38256
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Box_default, { width: 2, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { color: "cyanBright", children: isSel ? "\u25B6" : " " }) }),
38257
+ /* @__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: [
38258
+ m.id,
38259
+ isCur ? " \u25CF" : ""
38260
+ ] }) }),
38261
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Text, { color: "gray", children: [
38262
+ m.publisher,
38263
+ m.description ? ` \u2014 ${m.description}` : "",
38264
+ cost
38265
+ ] })
38266
+ ] }, m.id);
38267
+ }),
38268
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { color: "gray", dimColor: true, children: end < total ? " \u2193 more" : " " })
38259
38269
  ] });
38260
38270
  };
38261
38271
 
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"
38278
- };
38279
-
38280
38272
  // src/commands-palette/parser.ts
38281
38273
  function parseSlash(input) {
38282
38274
  const t = input.trimStart();
@@ -38351,24 +38343,6 @@ var MODELS = [
38351
38343
  { id: "mistral-small-3.2-abliterated", publisher: "fabhaus", description: "Mistral Small 3.2, abliterated" }
38352
38344
  ];
38353
38345
  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
38346
  function publisherFor(id) {
38373
38347
  return MODELS.find((m) => m.id === id)?.publisher ?? "(unknown)";
38374
38348
  }
@@ -38379,15 +38353,7 @@ var modelCommand = {
38379
38353
  run: (args, ctx) => {
38380
38354
  const trimmed = args.trim();
38381
38355
  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
- };
38356
+ return { type: "model-picker" };
38391
38357
  }
38392
38358
  if (KNOWN_IDS.has(trimmed)) {
38393
38359
  ctx.setModel(trimmed);
@@ -38426,8 +38392,96 @@ var moodCommand = {
38426
38392
  }
38427
38393
  };
38428
38394
 
38429
- // src/commands-palette/builtin/cost.tsx
38395
+ // src/tui/input/complete.ts
38396
+ import { opendirSync } from "node:fs";
38397
+ import { join as join26, dirname as dirname12, basename as basename5 } from "node:path";
38398
+
38399
+ // src/commands-palette/builtin/help.tsx
38430
38400
  var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
38401
+ var helpCommand = {
38402
+ name: "help",
38403
+ description: "Show available slash commands",
38404
+ run: () => ({
38405
+ type: "render",
38406
+ element: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(HelpPanel, {})
38407
+ })
38408
+ };
38409
+ var HelpPanel = () => {
38410
+ const commands = [...listCommands()].sort(
38411
+ (a2, b) => a2.name.localeCompare(b.name)
38412
+ );
38413
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
38414
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Text, { bold: true, color: "cyan", children: [
38415
+ "Kryven CLI commands (",
38416
+ commands.length,
38417
+ ")"
38418
+ ] }),
38419
+ commands.map((c3) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Box_default, { children: [
38420
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Box_default, { width: 16, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Text, { color: "cyan", children: [
38421
+ "/",
38422
+ c3.name
38423
+ ] }) }),
38424
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Text, { children: [
38425
+ c3.argHint ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Text, { color: "gray", children: [
38426
+ c3.argHint,
38427
+ " "
38428
+ ] }) : null,
38429
+ c3.description
38430
+ ] })
38431
+ ] }, c3.name)),
38432
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text, { color: "gray", children: "Ctrl+C to cancel an in-flight response \xB7 Ctrl+D to exit" }) })
38433
+ ] });
38434
+ };
38435
+
38436
+ // src/commands-palette/builtin/clear.ts
38437
+ var clearCommand = {
38438
+ name: "clear",
38439
+ description: "Wipe conversation and start fresh",
38440
+ run: () => ({ type: "clear" })
38441
+ };
38442
+
38443
+ // src/commands-palette/builtin/quit.ts
38444
+ var quitCommand = {
38445
+ name: "quit",
38446
+ description: "Exit",
38447
+ run: () => ({ type: "exit" })
38448
+ };
38449
+ var exitCommand = {
38450
+ ...quitCommand,
38451
+ name: "exit"
38452
+ };
38453
+
38454
+ // src/commands-palette/builtin/login.ts
38455
+ init_crypto();
38456
+ var loginCommand2 = {
38457
+ name: "login",
38458
+ description: "Sign in / re-enter your API key (kry_sk_\u2026) for this session",
38459
+ argHint: "<kry_sk_\u2026>",
38460
+ run: async (args, ctx) => {
38461
+ const key = args.trim();
38462
+ if (!key) {
38463
+ return {
38464
+ type: "ack",
38465
+ 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."
38466
+ };
38467
+ }
38468
+ if (!isValidApiKey(key)) {
38469
+ return {
38470
+ type: "error",
38471
+ message: 'Invalid key format. Expected "kry_sk_" followed by 48 hex chars.'
38472
+ };
38473
+ }
38474
+ if (!ctx.relogin) {
38475
+ return { type: "error", message: "Re-login isn't available here. Exit and run: kryven login" };
38476
+ }
38477
+ const res = await ctx.relogin(key);
38478
+ if (!res.ok) return { type: "error", message: res.message };
38479
+ return { type: "ack", message: `${res.message} (${maskApiKey(key)})` };
38480
+ }
38481
+ };
38482
+
38483
+ // src/commands-palette/builtin/cost.tsx
38484
+ var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
38431
38485
  var RATES = {
38432
38486
  flash: { in: 0.5, out: 4 },
38433
38487
  extended: { in: 0.65, out: 7 },
@@ -38459,7 +38513,7 @@ var costCommand = {
38459
38513
  description: "Show token usage this session",
38460
38514
  run: (_args, ctx) => ({
38461
38515
  type: "render",
38462
- element: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CostPanel, { ctx })
38516
+ element: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CostPanel, { ctx })
38463
38517
  })
38464
38518
  };
38465
38519
  var CostPanel = ({ ctx }) => {
@@ -38476,38 +38530,38 @@ var CostPanel = ({ ctx }) => {
38476
38530
  const rate = rateFor(ctx.model);
38477
38531
  const tierLabel = tierFor(ctx.model);
38478
38532
  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: [
38533
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 1, children: [
38534
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { bold: true, color: "magenta", children: "Session cost" }),
38535
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { children: [
38482
38536
  "Model: ",
38483
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text, { color: "cyan", children: ctx.model }),
38537
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: "cyan", children: ctx.model }),
38484
38538
  " (tier ",
38485
38539
  tierLabel,
38486
38540
  ")"
38487
38541
  ] }),
38488
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Text, { children: [
38542
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { children: [
38489
38543
  "Messages: ",
38490
38544
  ctx.conversation.size()
38491
38545
  ] }),
38492
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Text, { children: [
38546
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { children: [
38493
38547
  "Prompt tokens: ",
38494
38548
  promptTok.toLocaleString(),
38495
38549
  " \xB7 Completion tokens:",
38496
38550
  " ",
38497
38551
  completionTok.toLocaleString()
38498
38552
  ] }),
38499
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Text, { children: [
38553
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { children: [
38500
38554
  "Kryven tokens charged: ",
38501
38555
  kryvenTok.toLocaleString()
38502
38556
  ] }),
38503
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Text, { children: [
38557
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { children: [
38504
38558
  "Approx USD: ",
38505
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Text, { color: "green", children: [
38559
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { color: "green", children: [
38506
38560
  "$",
38507
38561
  usd.toFixed(4)
38508
38562
  ] })
38509
38563
  ] }),
38510
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Text, { color: "gray", children: [
38564
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { color: "gray", children: [
38511
38565
  "(Rates: $",
38512
38566
  rate.in,
38513
38567
  "/M in, $",
@@ -38537,7 +38591,7 @@ function setSkills(skills) {
38537
38591
  }
38538
38592
 
38539
38593
  // src/commands-palette/builtin/skill.tsx
38540
- var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
38594
+ var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
38541
38595
  var skillCommand = {
38542
38596
  name: "skill",
38543
38597
  description: "Run an installed skill (or list all)",
@@ -38551,17 +38605,17 @@ var skillCommand = {
38551
38605
  }
38552
38606
  return {
38553
38607
  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: [
38608
+ element: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
38609
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { bold: true, color: "cyan", children: [
38556
38610
  "Skills (",
38557
38611
  all.length,
38558
38612
  ")"
38559
38613
  ] }),
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 || "" })
38614
+ all.map((s2) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Box_default, { children: [
38615
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box_default, { width: 28, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { color: "cyan", children: s2.name }) }),
38616
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { color: "gray", children: s2.frontmatter.description || "" })
38563
38617
  ] }, s2.name)),
38564
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { color: "gray", children: [
38618
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { color: "gray", children: [
38565
38619
  "Run with: /skill ",
38566
38620
  "<name>",
38567
38621
  " [args]"
@@ -38791,7 +38845,7 @@ function listAgents() {
38791
38845
  }
38792
38846
 
38793
38847
  // src/commands-palette/builtin/agent.tsx
38794
- var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
38848
+ var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
38795
38849
  var agentCommand = {
38796
38850
  name: "agent",
38797
38851
  description: "Activate a custom subagent (or list available)",
@@ -38805,17 +38859,17 @@ var agentCommand = {
38805
38859
  }
38806
38860
  return {
38807
38861
  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: [
38862
+ element: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
38863
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Text, { bold: true, color: "cyan", children: [
38810
38864
  "Custom agents (",
38811
38865
  all.length,
38812
38866
  ")"
38813
38867
  ] }),
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 })
38868
+ all.map((a3) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Box_default, { children: [
38869
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Box_default, { width: 28, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { color: "cyan", children: a3.name }) }),
38870
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { color: "gray", children: a3.description })
38817
38871
  ] }, a3.name)),
38818
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { color: "gray", children: [
38872
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Text, { color: "gray", children: [
38819
38873
  "Activate with: /agent ",
38820
38874
  "<name>"
38821
38875
  ] })
@@ -38844,7 +38898,7 @@ ${a2.allowedTools.length ? `
38844
38898
 
38845
38899
  // src/commands-palette/builtin/diff.tsx
38846
38900
  init_execa();
38847
- var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
38901
+ var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
38848
38902
  var diffCommand = {
38849
38903
  name: "diff",
38850
38904
  description: "Show the working-tree git diff (use --stat for a summary)",
@@ -38873,16 +38927,16 @@ var diffCommand = {
38873
38927
  const truncated = raw.split("\n").length > 200;
38874
38928
  return {
38875
38929
  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: [
38930
+ element: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Box_default, { flexDirection: "column", children: [
38931
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Text, { bold: true, color: "magentaBright", children: [
38878
38932
  "git diff",
38879
38933
  statOnly ? " --stat" : ""
38880
38934
  ] }),
38881
38935
  lines.map((l, i2) => {
38882
38936
  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);
38937
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color, children: l.length > 200 ? l.slice(0, 200) + " \u2026" : l || "\xA0" }, i2);
38884
38938
  }),
38885
- truncated ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { color: "gray", children: "\u2026 (diff truncated)" }) : null
38939
+ truncated ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color: "gray", children: "\u2026 (diff truncated)" }) : null
38886
38940
  ] })
38887
38941
  };
38888
38942
  }
@@ -39055,7 +39109,7 @@ function renderRepoMap(map, opts = {}) {
39055
39109
  }
39056
39110
 
39057
39111
  // src/commands-palette/builtin/map.tsx
39058
- var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
39112
+ var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
39059
39113
  var mapCommand = {
39060
39114
  name: "map",
39061
39115
  description: "Show a symbol map of the current repo (optionally filtered by query)",
@@ -39072,9 +39126,9 @@ var mapCommand = {
39072
39126
  const lines = text.split("\n");
39073
39127
  return {
39074
39128
  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))
39129
+ element: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Box_default, { flexDirection: "column", children: [
39130
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { bold: true, color: "magentaBright", children: lines[0] }),
39131
+ lines.slice(1).map((l, i2) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: "gray", children: l }, i2))
39078
39132
  ] })
39079
39133
  };
39080
39134
  }
@@ -39177,7 +39231,7 @@ async function uninstallSkill(name) {
39177
39231
  }
39178
39232
 
39179
39233
  // src/commands-palette/builtin/skills.tsx
39180
- var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
39234
+ var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
39181
39235
  var SCOPE_COLOR = {
39182
39236
  "project-kryven": "cyan",
39183
39237
  "project-claude": "cyan",
@@ -39196,35 +39250,35 @@ var SkillRow = ({ skill }) => {
39196
39250
  const desc = skill.frontmatter.description || "(no description)";
39197
39251
  const scope = SCOPE_LABEL[skill.scope];
39198
39252
  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: [
39253
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Box_default, { children: [
39254
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Box_default, { width: 26, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { color: "magentaBright", children: skill.name }) }),
39255
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Box_default, { width: 10, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Text, { color: scopeColor, children: [
39202
39256
  "[",
39203
39257
  scope,
39204
39258
  "]"
39205
39259
  ] }) }),
39206
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: "gray", children: desc })
39260
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { color: "gray", children: desc })
39207
39261
  ] });
39208
39262
  };
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: [
39263
+ var SkillList = ({ skills }) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 1, children: [
39264
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Text, { bold: true, color: "magentaBright", children: [
39211
39265
  "Skills (",
39212
39266
  skills.length,
39213
39267
  " installed)"
39214
39268
  ] }),
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: [
39269
+ skills.map((s) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SkillRow, { skill: s }, s.name)),
39270
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
39271
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Text, { color: "gray", children: [
39218
39272
  " /skills install ",
39219
39273
  "<url|path>",
39220
39274
  " \u2014 install a skill from GitHub or local path"
39221
39275
  ] }),
39222
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Text, { color: "gray", children: [
39276
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Text, { color: "gray", children: [
39223
39277
  " /skills uninstall ",
39224
39278
  "<name>",
39225
39279
  " \u2014 remove a user-installed skill"
39226
39280
  ] }),
39227
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Text, { color: "gray", children: [
39281
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Text, { color: "gray", children: [
39228
39282
  " /skills info ",
39229
39283
  "<name>",
39230
39284
  " \u2014 show full skill metadata"
@@ -39247,19 +39301,19 @@ var SkillDetail = ({ skill }) => {
39247
39301
  ["Source", skill.sourcePath]
39248
39302
  ];
39249
39303
  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: [
39304
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 1, children: [
39305
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Text, { bold: true, color: "magentaBright", children: [
39252
39306
  "Skill: ",
39253
39307
  skill.name
39254
39308
  ] }),
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 })
39309
+ rows.map(([k, v]) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Box_default, { children: [
39310
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Box_default, { width: 22, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { color: "gray", children: k }) }),
39311
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { children: v })
39258
39312
  ] }, 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: [
39313
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
39314
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { color: "gray", children: "Body preview:" }),
39315
+ bodyPreview.split("\n").map((l, i2) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { color: "white", children: l }, i2)),
39316
+ skill.body.trim().split("\n").length > 6 && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Text, { color: "gray", children: [
39263
39317
  "\u2026 (truncated \u2014 ",
39264
39318
  skill.body.trim().split("\n").length,
39265
39319
  " lines total)"
@@ -39277,7 +39331,7 @@ function runList() {
39277
39331
  }
39278
39332
  return {
39279
39333
  type: "render",
39280
- element: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SkillList, { skills: all })
39334
+ element: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SkillList, { skills: all })
39281
39335
  };
39282
39336
  }
39283
39337
  function runInfo(name) {
@@ -39290,7 +39344,7 @@ function runInfo(name) {
39290
39344
  }
39291
39345
  return {
39292
39346
  type: "render",
39293
- element: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SkillDetail, { skill: s })
39347
+ element: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SkillDetail, { skill: s })
39294
39348
  };
39295
39349
  }
39296
39350
  async function runInstall(source, cwd2) {
@@ -39364,7 +39418,7 @@ var skillsCommand = {
39364
39418
  };
39365
39419
 
39366
39420
  // src/commands-palette/builtin/search.tsx
39367
- var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
39421
+ var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
39368
39422
  import { readdir as readdir3, stat as stat2, readFile as readFile3 } from "node:fs/promises";
39369
39423
  import { join as join6, relative } from "node:path";
39370
39424
  var IGNORE_DIRS = /* @__PURE__ */ new Set([
@@ -39464,34 +39518,34 @@ async function contentSearch(pattern, cwd2) {
39464
39518
  }
39465
39519
  return { matches, truncated };
39466
39520
  }
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: [
39521
+ var FileNameResultsPanel = ({ query, results }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Box_default, { flexDirection: "column", children: [
39522
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Text, { bold: true, color: "magentaBright", children: [
39469
39523
  results.length,
39470
39524
  ' file(s) matching "',
39471
39525
  query,
39472
39526
  '"'
39473
39527
  ] }),
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 })
39528
+ results.map(({ rel }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Box_default, { children: [
39529
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text, { color: "gray", children: " " }),
39530
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text, { color: "cyan", children: rel })
39477
39531
  ] }, rel))
39478
39532
  ] });
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: [
39533
+ var ContentResultsPanel = ({ pattern, matches, truncated }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Box_default, { flexDirection: "column", children: [
39534
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Text, { bold: true, color: "magentaBright", children: [
39481
39535
  matches.length,
39482
39536
  " match line(s) for /",
39483
39537
  pattern,
39484
39538
  "/",
39485
39539
  truncated ? " (truncated)" : ""
39486
39540
  ] }),
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: [
39541
+ matches.map(({ rel, line, snippet }, i2) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Box_default, { flexDirection: "row", children: [
39542
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text, { color: "cyan", children: rel }),
39543
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Text, { color: "gray", children: [
39490
39544
  ":",
39491
39545
  line,
39492
39546
  ": "
39493
39547
  ] }),
39494
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { children: snippet.length > 80 ? snippet.slice(0, 80) + " \u2026" : snippet })
39548
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text, { children: snippet.length > 80 ? snippet.slice(0, 80) + " \u2026" : snippet })
39495
39549
  ] }, i2))
39496
39550
  ] });
39497
39551
  var searchCommand = {
@@ -39520,7 +39574,7 @@ var searchCommand = {
39520
39574
  }
39521
39575
  return {
39522
39576
  type: "render",
39523
- element: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ContentResultsPanel, { pattern, matches, truncated })
39577
+ element: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ContentResultsPanel, { pattern, matches, truncated })
39524
39578
  };
39525
39579
  }
39526
39580
  const results = await fileNameSearch(trimmed, ctx.cwd);
@@ -39529,13 +39583,13 @@ var searchCommand = {
39529
39583
  }
39530
39584
  return {
39531
39585
  type: "render",
39532
- element: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FileNameResultsPanel, { query: trimmed, results })
39586
+ element: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FileNameResultsPanel, { query: trimmed, results })
39533
39587
  };
39534
39588
  }
39535
39589
  };
39536
39590
 
39537
39591
  // src/commands-palette/builtin/new.tsx
39538
- var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
39592
+ var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
39539
39593
  var TEMPLATES = [
39540
39594
  {
39541
39595
  name: "react",
@@ -39581,14 +39635,14 @@ var TEMPLATES = [
39581
39635
  }
39582
39636
  ];
39583
39637
  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 })
39638
+ var TemplatePicker = () => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 1, children: [
39639
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { bold: true, color: "magentaBright", children: "New conversation \u2014 choose a template" }),
39640
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: TEMPLATES.map((t) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Box_default, { children: [
39641
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Box_default, { width: 12, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { color: "magenta", children: t.name }) }),
39642
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Box_default, { width: 22, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { bold: true, children: t.label }) }),
39643
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { color: "gray", children: t.description })
39590
39644
  ] }, t.name)) }),
39591
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Text, { color: "gray", children: [
39645
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Text, { color: "gray", children: [
39592
39646
  "Start with: /new ",
39593
39647
  "<name>",
39594
39648
  " \xB7 Blank session: /new blank"
@@ -39603,7 +39657,7 @@ var newCommand = {
39603
39657
  if (!arg) {
39604
39658
  return {
39605
39659
  type: "render",
39606
- element: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TemplatePicker, {})
39660
+ element: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TemplatePicker, {})
39607
39661
  };
39608
39662
  }
39609
39663
  if (arg === "blank") {
@@ -39713,7 +39767,7 @@ var exportCommand = {
39713
39767
 
39714
39768
  // src/commands-palette/builtin/permissions.tsx
39715
39769
  init_schema();
39716
- var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
39770
+ var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
39717
39771
  import { existsSync as existsSync8, readFileSync as readFileSync6, writeFileSync as writeFileSync3, mkdirSync as mkdirSync3 } from "node:fs";
39718
39772
  import { join as join8, dirname as dirname4 } from "node:path";
39719
39773
  function settingsPath(cwd2) {
@@ -39798,14 +39852,14 @@ function resetRules(cwd2) {
39798
39852
  const next = { ...cfg, permissions: { allow: [], ask: [], deny: [] } };
39799
39853
  writeProjectConfig(cwd2, next);
39800
39854
  }
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: [
39855
+ var BucketSection = ({ label, color, rules, emptyNote }) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
39856
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { bold: true, color, children: label }),
39857
+ rules.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Text, { color: "gray", children: [
39804
39858
  " ",
39805
39859
  emptyNote
39806
- ] }) : rules.map((r) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Text, { color: "white", children: [
39860
+ ] }) : rules.map((r) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Text, { color: "white", children: [
39807
39861
  " ",
39808
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { color, children: "\u2022" }),
39862
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color, children: "\u2022" }),
39809
39863
  " ",
39810
39864
  r
39811
39865
  ] }, r))
@@ -39815,7 +39869,7 @@ var PermissionsView = ({
39815
39869
  ask,
39816
39870
  deny,
39817
39871
  configPath
39818
- }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
39872
+ }) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
39819
39873
  Box_default,
39820
39874
  {
39821
39875
  flexDirection: "column",
@@ -39824,10 +39878,10 @@ var PermissionsView = ({
39824
39878
  paddingX: 1,
39825
39879
  paddingY: 0,
39826
39880
  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)(
39881
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { bold: true, color: "magentaBright", children: "Project permissions" }),
39882
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: "gray", children: configPath }),
39883
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
39884
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
39831
39885
  BucketSection,
39832
39886
  {
39833
39887
  label: "allow (auto-approve these tools)",
@@ -39836,7 +39890,7 @@ var PermissionsView = ({
39836
39890
  emptyNote: "(none)"
39837
39891
  }
39838
39892
  ),
39839
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
39893
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
39840
39894
  BucketSection,
39841
39895
  {
39842
39896
  label: "ask (always prompt before running)",
@@ -39845,7 +39899,7 @@ var PermissionsView = ({
39845
39899
  emptyNote: "(none \u2014 risk model decides)"
39846
39900
  }
39847
39901
  ),
39848
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
39902
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
39849
39903
  BucketSection,
39850
39904
  {
39851
39905
  label: "deny (never run these tools)",
@@ -39855,20 +39909,20 @@ var PermissionsView = ({
39855
39909
  }
39856
39910
  )
39857
39911
  ] }),
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" })
39912
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
39913
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: "gray", children: "Risk model defaults:" }),
39914
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: "gray", children: " low (read-only) \u2192 auto-allow" }),
39915
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: "gray", children: " medium (writes/net) \u2192 ask once per session" }),
39916
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: "gray", children: " high (destructive) \u2192 always ask" })
39863
39917
  ] }),
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: [
39918
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
39919
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Text, { color: "gray", children: [
39866
39920
  "Manage: /permissions allow|ask|deny ",
39867
39921
  "<pattern>",
39868
39922
  " \xB7 /permissions rm ",
39869
39923
  "<pattern>"
39870
39924
  ] }),
39871
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { color: "gray", children: "Reset: /permissions reset --confirm" })
39925
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: "gray", children: "Reset: /permissions reset --confirm" })
39872
39926
  ] })
39873
39927
  ]
39874
39928
  }
@@ -39885,7 +39939,7 @@ var permissionsCommand = {
39885
39939
  const { allow, ask, deny } = normalizePermissions(cfg);
39886
39940
  return {
39887
39941
  type: "render",
39888
- element: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
39942
+ element: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
39889
39943
  PermissionsView,
39890
39944
  {
39891
39945
  allow,
@@ -39964,7 +40018,7 @@ var permissionsCommand = {
39964
40018
  };
39965
40019
 
39966
40020
  // src/commands-palette/builtin/agents.tsx
39967
- var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
40021
+ var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
39968
40022
  var SCOPE_LABEL2 = {
39969
40023
  "project-kryven": "project",
39970
40024
  "project-claude": "project",
@@ -39994,17 +40048,17 @@ var AgentRow = ({ agent }) => {
39994
40048
  const tagColor = SCOPE_COLOR2[agent.scope] ?? "gray";
39995
40049
  const modelNote = agent.model ? ` [${agent.model}]` : "";
39996
40050
  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: [
40051
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { flexDirection: "column", marginBottom: 0, children: [
40052
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { children: [
40053
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Box_default, { width: 24, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "magentaBright", bold: true, children: agent.name }) }),
40054
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { color: tagColor, dimColor: true, children: [
40001
40055
  "[",
40002
40056
  scopeTag(agent),
40003
40057
  "]"
40004
40058
  ] }),
40005
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: "gray", children: modelNote })
40059
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "gray", children: modelNote })
40006
40060
  ] }),
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: [
40061
+ agent.description || toolNote ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { color: "gray", children: [
40008
40062
  agent.description || "",
40009
40063
  toolNote
40010
40064
  ] }) }) : null
@@ -40012,7 +40066,7 @@ var AgentRow = ({ agent }) => {
40012
40066
  };
40013
40067
  var BrowserPanel = ({ agents }) => {
40014
40068
  const groups = groupByScope(agents);
40015
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
40069
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
40016
40070
  Box_default,
40017
40071
  {
40018
40072
  flexDirection: "column",
@@ -40020,30 +40074,30 @@ var BrowserPanel = ({ agents }) => {
40020
40074
  borderColor: "magentaBright",
40021
40075
  paddingX: 1,
40022
40076
  children: [
40023
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Text, { bold: true, color: "magentaBright", children: [
40077
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { bold: true, color: "magentaBright", children: [
40024
40078
  "Custom agents (",
40025
40079
  agents.length,
40026
40080
  ")"
40027
40081
  ] }),
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: [
40082
+ [...groups.entries()].map(([label, group]) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
40083
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { color: "cyan", bold: true, children: [
40030
40084
  label,
40031
40085
  " scope (",
40032
40086
  group.length,
40033
40087
  ")"
40034
40088
  ] }),
40035
- group.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AgentRow, { agent: a2 }, a2.name))
40089
+ group.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AgentRow, { agent: a2 }, a2.name))
40036
40090
  ] }, 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: [
40091
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
40092
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { color: "gray", children: [
40039
40093
  "Activate: /agents ",
40040
40094
  "<name>"
40041
40095
  ] }),
40042
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Text, { color: "gray", children: [
40096
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { color: "gray", children: [
40043
40097
  "Inspect: /agents --info ",
40044
40098
  "<name>"
40045
40099
  ] }),
40046
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Text, { color: "gray", children: [
40100
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { color: "gray", children: [
40047
40101
  "Drop agents at .kryven/agents/",
40048
40102
  "<name>",
40049
40103
  ".md or ~/.kryven/agents/",
@@ -40058,7 +40112,7 @@ var BrowserPanel = ({ agents }) => {
40058
40112
  var InfoPanel = ({ agent }) => {
40059
40113
  const promptLines = agent.systemPrompt.split("\n").slice(0, 20);
40060
40114
  const truncated = agent.systemPrompt.split("\n").length > 20;
40061
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
40115
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
40062
40116
  Box_default,
40063
40117
  {
40064
40118
  flexDirection: "column",
@@ -40066,36 +40120,36 @@ var InfoPanel = ({ agent }) => {
40066
40120
  borderColor: "magentaBright",
40067
40121
  paddingX: 1,
40068
40122
  children: [
40069
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Text, { bold: true, color: "magentaBright", children: [
40123
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { bold: true, color: "magentaBright", children: [
40070
40124
  "Agent: ",
40071
40125
  agent.name
40072
40126
  ] }),
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) })
40127
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
40128
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { children: [
40129
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "gray", children: "Scope" }) }),
40130
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "cyan", children: scopeTag(agent) })
40077
40131
  ] }),
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)" })
40132
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { children: [
40133
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "gray", children: "Model" }) }),
40134
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { children: agent.model ?? "(default)" })
40081
40135
  ] }),
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)" })
40136
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { children: [
40137
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "gray", children: "Tools" }) }),
40138
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { children: agent.allowedTools.length > 0 ? agent.allowedTools.join(", ") : "(all)" })
40085
40139
  ] }),
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)" })
40140
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { children: [
40141
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "gray", children: "Description" }) }),
40142
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { children: agent.description || "(none)" })
40089
40143
  ] }),
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 })
40144
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { children: [
40145
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "gray", children: "Source" }) }),
40146
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "gray", children: agent.sourcePath })
40093
40147
  ] })
40094
40148
  ] }),
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: [
40149
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
40150
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "magentaBright", bold: true, children: "System prompt preview:" }),
40151
+ promptLines.map((line, i2) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "gray", children: line || " " }, i2)),
40152
+ truncated ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { color: "gray", dimColor: true, children: [
40099
40153
  "\u2026 (truncated \u2014 ",
40100
40154
  agent.systemPrompt.split("\n").length,
40101
40155
  " lines total)"
@@ -40121,7 +40175,7 @@ var agentsCommand = {
40121
40175
  }
40122
40176
  return {
40123
40177
  type: "render",
40124
- element: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(BrowserPanel, { agents: all })
40178
+ element: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(BrowserPanel, { agents: all })
40125
40179
  };
40126
40180
  }
40127
40181
  if (trimmed.startsWith("--info")) {
@@ -40138,7 +40192,7 @@ var agentsCommand = {
40138
40192
  }
40139
40193
  return {
40140
40194
  type: "render",
40141
- element: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(InfoPanel, { agent: a3 })
40195
+ element: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(InfoPanel, { agent: a3 })
40142
40196
  };
40143
40197
  }
40144
40198
  const [name, ...rest] = trimmed.split(/\s+/);
@@ -40282,7 +40336,7 @@ async function setAuthHeader(id, authHeader) {
40282
40336
  }
40283
40337
 
40284
40338
  // src/commands-palette/builtin/about.tsx
40285
- var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
40339
+ var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
40286
40340
  var CLI_VERSION = "0.1.1";
40287
40341
  var CLI_NAME = "@kryvenaiofficial/kryven";
40288
40342
  var AboutPanel = ({ ctx }) => {
@@ -40307,9 +40361,9 @@ var AboutPanel = ({ ctx }) => {
40307
40361
  const rows = [
40308
40362
  [
40309
40363
  "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: [
40364
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { children: [
40365
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "magentaBright", children: CLI_NAME }),
40366
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { color: "gray", children: [
40313
40367
  " v",
40314
40368
  CLI_VERSION
40315
40369
  ] })
@@ -40317,31 +40371,31 @@ var AboutPanel = ({ ctx }) => {
40317
40371
  ],
40318
40372
  [
40319
40373
  "Model",
40320
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "cyan", children: ctx.model }, "model")
40374
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "cyan", children: ctx.model }, "model")
40321
40375
  ],
40322
40376
  [
40323
40377
  "Mood",
40324
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "cyan", children: ctx.mood }, "mood")
40378
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "cyan", children: ctx.mood }, "mood")
40325
40379
  ],
40326
40380
  [
40327
40381
  "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" })
40382
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { children: skills.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "gray", children: "none installed" }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { children: [
40383
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "magentaBright", children: skills.length }),
40384
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "gray", children: " installed" })
40331
40385
  ] }) }, "skills")
40332
40386
  ],
40333
40387
  [
40334
40388
  "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" })
40389
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { children: agents.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "gray", children: "none loaded" }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { children: [
40390
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "magentaBright", children: agents.length }),
40391
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "gray", children: " loaded" })
40338
40392
  ] }) }, "agents")
40339
40393
  ],
40340
40394
  [
40341
40395
  "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: [
40396
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { children: [
40397
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "yellow", children: permMode }),
40398
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { color: "gray", children: [
40345
40399
  " \u2014 ",
40346
40400
  permDesc
40347
40401
  ] })
@@ -40349,9 +40403,9 @@ var AboutPanel = ({ ctx }) => {
40349
40403
  ],
40350
40404
  [
40351
40405
  "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: [
40406
+ data === null ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "gray", children: "loading\u2026" }, "mcp") : data.mcpCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "gray", children: "none configured" }, "mcp") : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { children: [
40407
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "magentaBright", children: data.mcpEnabled }),
40408
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { color: "gray", children: [
40355
40409
  " enabled / ",
40356
40410
  data.mcpCount,
40357
40411
  " configured"
@@ -40360,15 +40414,15 @@ var AboutPanel = ({ ctx }) => {
40360
40414
  ],
40361
40415
  [
40362
40416
  "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" })
40417
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { children: [
40418
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "magentaBright", children: ctx.sessionMessages }),
40419
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "gray", children: " messages \xB7 " }),
40420
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "magentaBright", children: ctx.sessionTokens.toLocaleString() }),
40421
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "gray", children: " tokens" })
40368
40422
  ] }, "session")
40369
40423
  ]
40370
40424
  ];
40371
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
40425
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
40372
40426
  Box_default,
40373
40427
  {
40374
40428
  flexDirection: "column",
@@ -40376,12 +40430,12 @@ var AboutPanel = ({ ctx }) => {
40376
40430
  borderColor: "magenta",
40377
40431
  paddingX: 1,
40378
40432
  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 }) }),
40433
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { bold: true, color: "magentaBright", children: "About Kryven CLI" }),
40434
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: rows.map(([label, value]) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Box_default, { children: [
40435
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Box_default, { width: 18, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "gray", children: label }) }),
40382
40436
  value
40383
40437
  ] }, 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: [
40438
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { color: "gray", children: [
40385
40439
  "cwd ",
40386
40440
  ctx.cwd
40387
40441
  ] }) })
@@ -40394,7 +40448,7 @@ var aboutCommand = {
40394
40448
  description: "Show CLI version, model, skills, agents, permissions, and MCP server count",
40395
40449
  run: (_args, ctx) => ({
40396
40450
  type: "render",
40397
- element: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AboutPanel, { ctx })
40451
+ element: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(AboutPanel, { ctx })
40398
40452
  })
40399
40453
  };
40400
40454
 
@@ -40591,22 +40645,22 @@ function getThemeManager() {
40591
40645
 
40592
40646
  // src/commands-palette/builtin/theme.tsx
40593
40647
  init_load();
40594
- var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
40648
+ var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
40595
40649
  var ThemePanel = ({
40596
40650
  entries,
40597
40651
  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: [
40652
+ }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 1, children: [
40653
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { bold: true, color: "magenta", children: "Themes" }),
40654
+ entries.map((e) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Box_default, { children: [
40655
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Box_default, { width: 24, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: e.active ? "magentaBright" : "white", bold: e.active, children: [
40602
40656
  e.active ? "\u25B6 " : " ",
40603
40657
  e.name
40604
40658
  ] }) }),
40605
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "gray", children: e.accent })
40659
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "gray", children: e.accent })
40606
40660
  ] }, e.name)),
40607
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { color: "gray", children: [
40661
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "gray", children: [
40608
40662
  "Active: ",
40609
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "magentaBright", children: current }),
40663
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "magentaBright", children: current }),
40610
40664
  " \xB7 ",
40611
40665
  "/theme ",
40612
40666
  "<name>",
@@ -40630,7 +40684,7 @@ var themeCommand = {
40630
40684
  }));
40631
40685
  return {
40632
40686
  type: "render",
40633
- element: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ThemePanel, { entries, current: current.name })
40687
+ element: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ThemePanel, { entries, current: current.name })
40634
40688
  };
40635
40689
  }
40636
40690
  if (trimmed === "cycle") {
@@ -40681,7 +40735,7 @@ var themeCommand = {
40681
40735
  };
40682
40736
 
40683
40737
  // src/commands-palette/builtin/file.tsx
40684
- var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
40738
+ var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
40685
40739
  import * as fs3 from "node:fs";
40686
40740
  import * as path7 from "node:path";
40687
40741
  var IGNORED_DIRS = /* @__PURE__ */ new Set([
@@ -40783,11 +40837,11 @@ function extColor(relPath) {
40783
40837
  if ([".py", ".rb", ".go", ".rs"].includes(ext)) return "blue";
40784
40838
  return "gray";
40785
40839
  }
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: [
40840
+ var TreePanel = ({ entries, truncated, cwd: cwd2 }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magentaBright", paddingX: 1, children: [
40841
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { bold: true, color: "magentaBright", children: [
40788
40842
  path7.basename(cwd2),
40789
40843
  "/ ",
40790
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "gray", children: [
40844
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "gray", children: [
40791
40845
  "(",
40792
40846
  entries.length,
40793
40847
  " entries)"
@@ -40798,21 +40852,21 @@ var TreePanel = ({ entries, truncated, cwd: cwd2 }) => /* @__PURE__ */ (0, impor
40798
40852
  const indent = " ".repeat(depth);
40799
40853
  const name = path7.basename(e.relPath);
40800
40854
  if (e.isDir) {
40801
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "magenta", children: [
40855
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "magenta", children: [
40802
40856
  indent,
40803
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { bold: true, children: [
40857
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { bold: true, children: [
40804
40858
  name,
40805
40859
  "/"
40806
40860
  ] })
40807
40861
  ] }, e.relPath);
40808
40862
  }
40809
40863
  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: [
40864
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Box_default, { children: [
40865
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color, children: [
40812
40866
  indent,
40813
40867
  name
40814
40868
  ] }),
40815
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "gray", children: [
40869
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "gray", children: [
40816
40870
  " ",
40817
40871
  formatSize(e.size),
40818
40872
  " ",
@@ -40820,58 +40874,58 @@ var TreePanel = ({ entries, truncated, cwd: cwd2 }) => /* @__PURE__ */ (0, impor
40820
40874
  ] })
40821
40875
  ] }, e.relPath);
40822
40876
  }),
40823
- truncated ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "gray", children: [
40877
+ truncated ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "gray", children: [
40824
40878
  "\u2026 (more files \u2014 use /file ",
40825
40879
  "<glob>",
40826
40880
  " to filter)"
40827
40881
  ] }) : null,
40828
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "gray", children: [
40882
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "gray", children: [
40829
40883
  "Run ",
40830
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "cyan", children: [
40884
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "cyan", children: [
40831
40885
  "/file ",
40832
40886
  "<glob>"
40833
40887
  ] }),
40834
40888
  " to filter \xB7",
40835
40889
  " ",
40836
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "cyan", children: [
40890
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "cyan", children: [
40837
40891
  "/file ",
40838
40892
  "<path>"
40839
40893
  ] }),
40840
40894
  " to read a file"
40841
40895
  ] })
40842
40896
  ] });
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: [
40897
+ var MatchPanel = ({ entries, pattern, truncated }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magentaBright", paddingX: 1, children: [
40898
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { bold: true, color: "magentaBright", children: [
40845
40899
  "Matches for ",
40846
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "cyan", children: pattern }),
40900
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { color: "cyan", children: pattern }),
40847
40901
  " ",
40848
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "gray", children: [
40902
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "gray", children: [
40849
40903
  "(",
40850
40904
  entries.length,
40851
40905
  truncated ? "+" : "",
40852
40906
  " results)"
40853
40907
  ] })
40854
40908
  ] }),
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: [
40909
+ entries.map((e) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Box_default, { children: [
40910
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Box_default, { minWidth: 40, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: e.isDir ? "magenta" : extColor(e.relPath), children: [
40857
40911
  e.relPath,
40858
40912
  e.isDir ? "/" : ""
40859
40913
  ] }) }),
40860
- !e.isDir && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "gray", children: [
40914
+ !e.isDir && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "gray", children: [
40861
40915
  formatSize(e.size),
40862
40916
  " ",
40863
40917
  formatAge(e.mtime)
40864
40918
  ] })
40865
40919
  ] }, e.relPath)),
40866
- truncated ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "gray", children: "\u2026 (truncated to 80)" }) : null
40920
+ truncated ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { color: "gray", children: "\u2026 (truncated to 80)" }) : null
40867
40921
  ] });
40868
40922
  var FilePanel = ({ relPath, lines, truncated, totalLines }) => {
40869
40923
  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: [
40924
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magentaBright", paddingX: 1, children: [
40925
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { bold: true, color: "magentaBright", children: [
40872
40926
  relPath,
40873
40927
  " ",
40874
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "gray", children: [
40928
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "gray", children: [
40875
40929
  "(",
40876
40930
  totalLines,
40877
40931
  " lines",
@@ -40879,14 +40933,14 @@ var FilePanel = ({ relPath, lines, truncated, totalLines }) => {
40879
40933
  ")"
40880
40934
  ] })
40881
40935
  ] }),
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: [
40936
+ lines.map((l, i2) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Box_default, { children: [
40937
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Box_default, { width: 5, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "gray", children: [
40884
40938
  String(i2 + 1).padStart(4),
40885
40939
  " "
40886
40940
  ] }) }),
40887
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color, children: l.length > 160 ? l.slice(0, 160) + " \u2026" : l })
40941
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { color, children: l.length > 160 ? l.slice(0, 160) + " \u2026" : l })
40888
40942
  ] }, i2)),
40889
- truncated ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "gray", children: [
40943
+ truncated ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "gray", children: [
40890
40944
  "\u2026 (truncated \u2014 only first ",
40891
40945
  lines.length,
40892
40946
  " lines shown)"
@@ -40906,7 +40960,7 @@ var openCommand = {
40906
40960
  const truncated2 = entries.length >= MAX_ITEMS;
40907
40961
  return {
40908
40962
  type: "render",
40909
- element: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TreePanel, { entries, truncated: truncated2, cwd: ctx.cwd })
40963
+ element: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TreePanel, { entries, truncated: truncated2, cwd: ctx.cwd })
40910
40964
  };
40911
40965
  }
40912
40966
  const resolved = path7.isAbsolute(input) ? input : path7.join(ctx.cwd, input);
@@ -40924,7 +40978,7 @@ var openCommand = {
40924
40978
  const relPath = path7.relative(ctx.cwd, resolved) || input;
40925
40979
  return {
40926
40980
  type: "render",
40927
- element: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
40981
+ element: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
40928
40982
  FilePanel,
40929
40983
  {
40930
40984
  relPath,
@@ -40942,7 +40996,7 @@ var openCommand = {
40942
40996
  const truncated2 = entries.length >= MAX_ITEMS;
40943
40997
  return {
40944
40998
  type: "render",
40945
- element: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TreePanel, { entries, truncated: truncated2, cwd: resolved })
40999
+ element: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TreePanel, { entries, truncated: truncated2, cwd: resolved })
40946
41000
  };
40947
41001
  }
40948
41002
  const MAX_GLOB_ITEMS = 300;
@@ -40963,14 +41017,14 @@ var openCommand = {
40963
41017
  const truncated = matched.length >= MAX_RESULTS;
40964
41018
  return {
40965
41019
  type: "render",
40966
- element: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(MatchPanel, { entries: matched, pattern: input, truncated })
41020
+ element: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(MatchPanel, { entries: matched, pattern: input, truncated })
40967
41021
  };
40968
41022
  }
40969
41023
  };
40970
41024
 
40971
41025
  // src/commands-palette/builtin/sessions.tsx
40972
41026
  init_defaults();
40973
- var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
41027
+ var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
40974
41028
  import { readdir as readdir5, readFile as readFile6, unlink, stat as stat3 } from "node:fs/promises";
40975
41029
  import { join as join12, basename as basename4 } from "node:path";
40976
41030
  function fmtDate(ms) {
@@ -41012,32 +41066,32 @@ async function loadSessionFiles() {
41012
41066
  metas.sort((a2, b) => b.mtimeMs - a2.mtimeMs);
41013
41067
  return metas;
41014
41068
  }
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: [
41069
+ var SessionListPanel = ({ sessions, dir }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magentaBright", paddingX: 1, children: [
41070
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { bold: true, color: "magentaBright", children: [
41017
41071
  "Saved sessions (",
41018
41072
  sessions.length,
41019
41073
  ") \u2014 ",
41020
41074
  dir
41021
41075
  ] }),
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: [
41076
+ sessions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: "gray", children: "No sessions saved yet. Use /save to save the current conversation." }) }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: sessions.map((s, i2) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { flexDirection: "row", marginBottom: 0, children: [
41077
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { width: 4, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: "gray", dimColor: true, children: [
41024
41078
  String(i2 + 1).padStart(2),
41025
41079
  "."
41026
41080
  ] }) }),
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: [
41081
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { width: 34, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: "magenta", children: s.basename }) }),
41082
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { width: 18, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: "gray", children: fmtDate(s.mtimeMs) }) }),
41083
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Box_default, { width: 8, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: "cyan", children: [
41030
41084
  s.messageCount,
41031
41085
  "msg"
41032
41086
  ] }) }),
41033
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { color: "gray", dimColor: true, children: fmtSize(s.sizeBytes) })
41087
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: "gray", dimColor: true, children: fmtSize(s.sizeBytes) })
41034
41088
  ] }, 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: [
41089
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
41090
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { color: "gray", children: [
41037
41091
  "Load: /sessions load ",
41038
41092
  "<filename>"
41039
41093
  ] }),
41040
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { color: "gray", children: "Clear: /sessions clear" })
41094
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: "gray", children: "Clear: /sessions clear" })
41041
41095
  ] })
41042
41096
  ] });
41043
41097
  var sessionsCommand = {
@@ -41141,21 +41195,21 @@ Failed to delete: ${errs.join(", ")}` : "";
41141
41195
  const metas = await loadSessionFiles();
41142
41196
  return {
41143
41197
  type: "render",
41144
- element: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(SessionListPanel, { sessions: metas, dir })
41198
+ element: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SessionListPanel, { sessions: metas, dir })
41145
41199
  };
41146
41200
  }
41147
41201
  };
41148
41202
 
41149
41203
  // 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 })
41204
+ var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
41205
+ var CommandItem = ({ row }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Box_default, { children: [
41206
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: "magentaBright", children: "/" + row.name }) }),
41207
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { width: 26, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: "cyan", children: row.hint }) }),
41208
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: "white", children: row.description })
41155
41209
  ] });
41156
41210
  var CommandsPanel = ({ rows, filter, total }) => {
41157
41211
  const heading = filter ? `Commands matching "${filter}" (${rows.length} of ${total})` : `All commands (${rows.length})`;
41158
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
41212
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
41159
41213
  Box_default,
41160
41214
  {
41161
41215
  flexDirection: "column",
@@ -41163,9 +41217,9 @@ var CommandsPanel = ({ rows, filter, total }) => {
41163
41217
  borderColor: "magenta",
41164
41218
  paddingX: 1,
41165
41219
  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: [
41220
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { bold: true, color: "magentaBright", children: heading }),
41221
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { flexDirection: "column", marginTop: 1, children: rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CommandItem, { row }, row.name)) }),
41222
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Text, { color: "gray", children: [
41169
41223
  "Use /commands ",
41170
41224
  "<filter>",
41171
41225
  " to search \xB7 /help for quick reference"
@@ -41207,7 +41261,7 @@ var commandsCommand = {
41207
41261
  }
41208
41262
  return {
41209
41263
  type: "render",
41210
- element: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(CommandsPanel, { rows: filtered, filter, total: allRows.length })
41264
+ element: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CommandsPanel, { rows: filtered, filter, total: allRows.length })
41211
41265
  };
41212
41266
  }
41213
41267
  };
@@ -41327,7 +41381,7 @@ function getKeybindings() {
41327
41381
  }
41328
41382
 
41329
41383
  // src/commands-palette/builtin/keybindings.tsx
41330
- var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
41384
+ var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
41331
41385
  var KB_PATH2 = join14(homedir8(), ".kryven", "keybindings.json");
41332
41386
  var VALID_ACTIONS = /* @__PURE__ */ new Set([
41333
41387
  "clear",
@@ -41349,7 +41403,7 @@ async function saveToDisk(bindings) {
41349
41403
  { mode: 384 }
41350
41404
  );
41351
41405
  }
41352
- var BindingsPanel = ({ bindings }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
41406
+ var BindingsPanel = ({ bindings }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
41353
41407
  Box_default,
41354
41408
  {
41355
41409
  flexDirection: "column",
@@ -41357,21 +41411,21 @@ var BindingsPanel = ({ bindings }) => /* @__PURE__ */ (0, import_jsx_runtime25.j
41357
41411
  borderColor: "magenta",
41358
41412
  paddingX: 1,
41359
41413
  children: [
41360
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Text, { bold: true, color: "magentaBright", children: [
41414
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { bold: true, color: "magentaBright", children: [
41361
41415
  "Keybindings (",
41362
41416
  bindings.length,
41363
41417
  ")"
41364
41418
  ] }),
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 })
41419
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: bindings.map((b) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Box_default, { children: [
41420
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box_default, { width: 26, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { color: "magenta", children: b.key }) }),
41421
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { color: "cyan", children: b.action })
41368
41422
  ] }, 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: [
41423
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
41424
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: "gray", children: [
41371
41425
  "File: ",
41372
41426
  KB_PATH2
41373
41427
  ] }),
41374
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Text, { color: "gray", children: [
41428
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: "gray", children: [
41375
41429
  "/keybindings set ",
41376
41430
  "<key>",
41377
41431
  " ",
@@ -41380,12 +41434,12 @@ var BindingsPanel = ({ bindings }) => /* @__PURE__ */ (0, import_jsx_runtime25.j
41380
41434
  "<key>",
41381
41435
  " \xB7 /keybindings reset --confirm"
41382
41436
  ] }),
41383
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: "gray", children: "/keybindings actions \u2014 list valid action names" })
41437
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { color: "gray", children: "/keybindings actions \u2014 list valid action names" })
41384
41438
  ] })
41385
41439
  ]
41386
41440
  }
41387
41441
  );
41388
- var ActionsPanel = () => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
41442
+ var ActionsPanel = () => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
41389
41443
  Box_default,
41390
41444
  {
41391
41445
  flexDirection: "column",
@@ -41393,12 +41447,12 @@ var ActionsPanel = () => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
41393
41447
  borderColor: "magenta",
41394
41448
  paddingX: 1,
41395
41449
  children: [
41396
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Text, { bold: true, color: "magentaBright", children: [
41450
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { bold: true, color: "magentaBright", children: [
41397
41451
  "Valid actions (",
41398
41452
  VALID_ACTIONS.size,
41399
41453
  ")"
41400
41454
  ] }),
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: [
41455
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: [...VALID_ACTIONS].map((a2) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: "cyan", children: [
41402
41456
  " ",
41403
41457
  a2
41404
41458
  ] }, a2)) })
@@ -41416,7 +41470,7 @@ var keybindingsCommand = {
41416
41470
  const bindings = getKeybindings().list();
41417
41471
  return {
41418
41472
  type: "render",
41419
- element: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(BindingsPanel, { bindings })
41473
+ element: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(BindingsPanel, { bindings })
41420
41474
  };
41421
41475
  }
41422
41476
  if (sub === "path") {
@@ -41425,7 +41479,7 @@ var keybindingsCommand = {
41425
41479
  if (sub === "actions") {
41426
41480
  return {
41427
41481
  type: "render",
41428
- element: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ActionsPanel, {})
41482
+ element: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ActionsPanel, {})
41429
41483
  };
41430
41484
  }
41431
41485
  if (sub === "reset") {
@@ -41655,7 +41709,7 @@ Preview: ${preview}`
41655
41709
 
41656
41710
  // src/commands-palette/builtin/memory.tsx
41657
41711
  init_defaults();
41658
- var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
41712
+ var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
41659
41713
  import { readFile as readFile8, writeFile as writeFile6, mkdir as mkdir7 } from "node:fs/promises";
41660
41714
  import { join as join16, dirname as dirname8 } from "node:path";
41661
41715
  function getMemoryPath() {
@@ -41685,7 +41739,7 @@ function fmtDate2(ts) {
41685
41739
  const pad = (n2) => String(n2).padStart(2, "0");
41686
41740
  return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}`;
41687
41741
  }
41688
- var NoteListPanel = ({ notes, path: path9 }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
41742
+ var NoteListPanel = ({ notes, path: path9 }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
41689
41743
  Box_default,
41690
41744
  {
41691
41745
  flexDirection: "column",
@@ -41693,42 +41747,42 @@ var NoteListPanel = ({ notes, path: path9 }) => /* @__PURE__ */ (0, import_jsx_r
41693
41747
  borderColor: "magentaBright",
41694
41748
  paddingX: 1,
41695
41749
  children: [
41696
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { bold: true, color: "magentaBright", children: [
41750
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { bold: true, color: "magentaBright", children: [
41697
41751
  "Memory \u2014 ",
41698
41752
  notes.length,
41699
41753
  " note",
41700
41754
  notes.length !== 1 ? "s" : "",
41701
41755
  " ",
41702
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: "gray", dimColor: true, children: [
41756
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: "gray", dimColor: true, children: [
41703
41757
  "(",
41704
41758
  path9,
41705
41759
  ")"
41706
41760
  ] })
41707
41761
  ] }),
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: [
41762
+ notes.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: "gray", children: [
41709
41763
  "No notes yet. Use /memory add ",
41710
41764
  "<text>",
41711
41765
  " 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: [
41766
+ ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: notes.map((note, i2) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
41767
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Box_default, { children: [
41768
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Box_default, { width: 4, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: "magenta", bold: true, children: [
41715
41769
  String(i2 + 1).padStart(2),
41716
41770
  "."
41717
41771
  ] }) }),
41718
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { color: "gray", dimColor: true, children: fmtDate2(note.ts) })
41772
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: "gray", dimColor: true, children: fmtDate2(note.ts) })
41719
41773
  ] }),
41720
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box_default, { paddingLeft: 4, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { wrap: "wrap", children: note.text }) })
41774
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Box_default, { paddingLeft: 4, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { wrap: "wrap", children: note.text }) })
41721
41775
  ] }, 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: [
41776
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
41777
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: "gray", children: [
41724
41778
  "Add: /memory add ",
41725
41779
  "<text>"
41726
41780
  ] }),
41727
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: "gray", children: [
41781
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: "gray", children: [
41728
41782
  "Remove: /memory remove ",
41729
41783
  "<n>"
41730
41784
  ] }),
41731
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { color: "gray", children: "Clear: /memory clear" })
41785
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: "gray", children: "Clear: /memory clear" })
41732
41786
  ] })
41733
41787
  ]
41734
41788
  }
@@ -41835,14 +41889,14 @@ var memoryCommand = {
41835
41889
  }
41836
41890
  return {
41837
41891
  type: "render",
41838
- element: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(NoteListPanel, { notes, path: getMemoryPath() })
41892
+ element: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(NoteListPanel, { notes, path: getMemoryPath() })
41839
41893
  };
41840
41894
  }
41841
41895
  };
41842
41896
 
41843
41897
  // src/agent/hooks.tsx
41844
41898
  init_defaults();
41845
- var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
41899
+ var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
41846
41900
  import { existsSync as existsSync12, readFileSync as readFileSync8, writeFileSync as writeFileSync5, mkdirSync as mkdirSync4 } from "node:fs";
41847
41901
  import { join as join17, dirname as dirname9 } from "node:path";
41848
41902
  function globalSettingsPath() {
@@ -41937,37 +41991,37 @@ function editHook(path9, event, index, newCommand2) {
41937
41991
  writeHooks(path9, hooks);
41938
41992
  return { ok: true };
41939
41993
  }
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: [
41994
+ var HookRow = ({ index, entry }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Box_default, { flexDirection: "row", marginLeft: 2, children: [
41995
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Box_default, { width: 4, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "gray", children: [
41942
41996
  "[",
41943
41997
  index,
41944
41998
  "]"
41945
41999
  ] }) }),
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: [
42000
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Box_default, { width: 3, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { color: entry.enabled ? "green" : "gray", children: entry.enabled ? "on" : "off" }) }),
42001
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { color: entry.enabled ? "white" : "gray", children: entry.command }),
42002
+ entry.description ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "gray", children: [
41949
42003
  " # ",
41950
42004
  entry.description
41951
42005
  ] }) : null
41952
42006
  ] });
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))
42007
+ var EventSection = ({ event, entries }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
42008
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { bold: true, color: "cyan", children: event }),
42009
+ entries.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { color: "gray", dimColor: true, children: " (no hooks)" }) : entries.map((e, i2) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(HookRow, { index: i2, entry: e }, i2))
41956
42010
  ] });
41957
42011
  var ScopePanel = ({ scope, settingsPath: settingsPath2, hooks }) => {
41958
42012
  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: [
42013
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
42014
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Box_default, { children: [
42015
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { bold: true, color: "magentaBright", children: [
41962
42016
  scope === "global" ? "Global" : "Project",
41963
42017
  " hooks"
41964
42018
  ] }),
41965
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: "gray", children: [
42019
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "gray", children: [
41966
42020
  " ",
41967
42021
  settingsPath2
41968
42022
  ] })
41969
42023
  ] }),
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))
42024
+ events.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { color: "gray", dimColor: true, children: " (none defined)" }) : events.map((ev) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(EventSection, { event: ev, entries: hooks[ev] }, ev))
41971
42025
  ] });
41972
42026
  };
41973
42027
  var HooksPanel = ({
@@ -41976,7 +42030,7 @@ var HooksPanel = ({
41976
42030
  globalHooks,
41977
42031
  projectHooks,
41978
42032
  onlyScope
41979
- }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
42033
+ }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
41980
42034
  Box_default,
41981
42035
  {
41982
42036
  flexDirection: "column",
@@ -41985,13 +42039,13 @@ var HooksPanel = ({
41985
42039
  paddingX: 1,
41986
42040
  paddingY: 0,
41987
42041
  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 })
42042
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { bold: true, color: "magentaBright", children: "Workflow hooks" }),
42043
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
42044
+ (!onlyScope || onlyScope === "global") && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ScopePanel, { scope: "global", settingsPath: globalPath, hooks: globalHooks }),
42045
+ (!onlyScope || onlyScope === "project") && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ScopePanel, { scope: "project", settingsPath: projectPath, hooks: projectHooks })
41992
42046
  ] }),
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: [
42047
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
42048
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "gray", children: [
41995
42049
  "Add: /hooks add ",
41996
42050
  "<global|project>",
41997
42051
  " ",
@@ -41999,7 +42053,7 @@ var HooksPanel = ({
41999
42053
  " ",
42000
42054
  "<command>"
42001
42055
  ] }),
42002
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: "gray", children: [
42056
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "gray", children: [
42003
42057
  "Toggle: /hooks enable|disable ",
42004
42058
  "<global|project>",
42005
42059
  " ",
@@ -42007,7 +42061,7 @@ var HooksPanel = ({
42007
42061
  " ",
42008
42062
  "<n>"
42009
42063
  ] }),
42010
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: "gray", children: [
42064
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "gray", children: [
42011
42065
  "Edit: /hooks edit ",
42012
42066
  "<global|project>",
42013
42067
  " ",
@@ -42017,7 +42071,7 @@ var HooksPanel = ({
42017
42071
  " ",
42018
42072
  "<newcmd>"
42019
42073
  ] }),
42020
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: "gray", children: [
42074
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "gray", children: [
42021
42075
  "Remove: /hooks rm ",
42022
42076
  "<global|project>",
42023
42077
  " ",
@@ -42025,7 +42079,7 @@ var HooksPanel = ({
42025
42079
  " ",
42026
42080
  "<n>"
42027
42081
  ] }),
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." })
42082
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { color: "yellow", children: "Execution is opt-in \u2014 set KRYVEN_HOOKS=1 to run before_tool/after_tool/on_error hooks." })
42029
42083
  ] })
42030
42084
  ]
42031
42085
  }
@@ -42056,7 +42110,7 @@ var hooksCommand = {
42056
42110
  const projectHooks = readHooks(projectPath);
42057
42111
  return {
42058
42112
  type: "render",
42059
- element: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
42113
+ element: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
42060
42114
  HooksPanel,
42061
42115
  {
42062
42116
  globalPath,
@@ -42246,7 +42300,7 @@ Saved to ${path9}`
42246
42300
 
42247
42301
  // src/commands-palette/builtin/skill-test.tsx
42248
42302
  init_messages();
42249
- var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
42303
+ var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
42250
42304
  function makeMockCtx(real) {
42251
42305
  const mockConv = new Conversation();
42252
42306
  return {
@@ -42265,7 +42319,7 @@ function makeMockCtx(real) {
42265
42319
  var SkillListPanel = () => {
42266
42320
  const skills = listSkills();
42267
42321
  if (skills.length === 0) {
42268
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
42322
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
42269
42323
  Box_default,
42270
42324
  {
42271
42325
  flexDirection: "column",
@@ -42273,14 +42327,14 @@ var SkillListPanel = () => {
42273
42327
  borderColor: "magentaBright",
42274
42328
  paddingX: 1,
42275
42329
  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" })
42330
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { bold: true, color: "magentaBright", children: "skill-test" }),
42331
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "gray", children: "No skills loaded." }),
42332
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "gray", children: "Install one: `kryven skills install <url>` or drop a SKILL.md at .kryven/skills/<name>/SKILL.md" })
42279
42333
  ]
42280
42334
  }
42281
42335
  );
42282
42336
  }
42283
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
42337
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
42284
42338
  Box_default,
42285
42339
  {
42286
42340
  flexDirection: "column",
@@ -42288,26 +42342,26 @@ var SkillListPanel = () => {
42288
42342
  borderColor: "magentaBright",
42289
42343
  paddingX: 1,
42290
42344
  children: [
42291
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { bold: true, color: "magentaBright", children: [
42345
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text, { bold: true, color: "magentaBright", children: [
42292
42346
  "skill-test \u2014 ",
42293
42347
  skills.length,
42294
42348
  " skill",
42295
42349
  skills.length !== 1 ? "s" : "",
42296
42350
  " loaded"
42297
42351
  ] }),
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)" })
42352
+ skills.map((s) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Box_default, { flexDirection: "column", marginTop: 0, children: [
42353
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Box_default, { children: [
42354
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box_default, { width: 28, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "cyan", children: s.name }) }),
42355
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "gray", children: s.frontmatter.description ?? "(no description)" })
42302
42356
  ] }),
42303
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "gray", children: [
42357
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text, { color: "gray", children: [
42304
42358
  "scope=",
42305
42359
  s.scope,
42306
42360
  s.frontmatter["disable-model-invocation"] ? " [user-only]" : "",
42307
42361
  s.frontmatter["allowed-tools"] ? ` tools=${s.frontmatter["allowed-tools"].join(",")}` : ""
42308
42362
  ] }) })
42309
42363
  ] }, s.name)),
42310
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "gray", children: [
42364
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text, { color: "gray", children: [
42311
42365
  "Run: /skill-test ",
42312
42366
  "<name>",
42313
42367
  " [args]"
@@ -42328,7 +42382,7 @@ var DryRunPanel = ({
42328
42382
  const bodyLines = injectedBody.split("\n");
42329
42383
  const previewLines = bodyLines.slice(0, 20);
42330
42384
  const overflow = bodyLines.length - previewLines.length;
42331
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
42385
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
42332
42386
  Box_default,
42333
42387
  {
42334
42388
  flexDirection: "column",
@@ -42336,56 +42390,56 @@ var DryRunPanel = ({
42336
42390
  borderColor: "magentaBright",
42337
42391
  paddingX: 1,
42338
42392
  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: [
42393
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Box_default, { marginBottom: 1, children: [
42394
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { bold: true, color: "magentaBright", children: "skill-test: " }),
42395
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { bold: true, color: "cyan", children: skillName }),
42396
+ forwardedArgs ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text, { color: "gray", children: [
42343
42397
  ' "',
42344
42398
  forwardedArgs,
42345
42399
  '"'
42346
42400
  ] }) : null
42347
42401
  ] }),
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: [
42402
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Box_default, { flexDirection: "column", children: [
42403
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Box_default, { children: [
42404
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box_default, { width: 20, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "gray", children: "result.type" }) }),
42405
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: typeColor, bold: true, children: result.type }),
42406
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text, { color: "gray", children: [
42353
42407
  " (",
42354
42408
  elapsedMs,
42355
42409
  "ms)"
42356
42410
  ] })
42357
42411
  ] }),
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 })
42412
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Box_default, { children: [
42413
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box_default, { width: 20, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "gray", children: "mock msgs appended" }) }),
42414
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { children: mockMessages })
42361
42415
  ] })
42362
42416
  ] }),
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: [
42417
+ result.type === "ack" && result.message ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
42418
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "gray", children: "ack message:" }),
42419
+ result.message.split("\n").map((line, i2) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text, { children: [
42366
42420
  " ",
42367
42421
  line
42368
42422
  ] }, i2))
42369
42423
  ] }) : 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: [
42424
+ result.type === "error" ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text, { color: "red", children: [
42371
42425
  "error: ",
42372
42426
  result.message
42373
42427
  ] }) }) : 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 })
42428
+ result.type === "render" ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
42429
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "cyan", children: "render element:" }),
42430
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box_default, { paddingLeft: 2, borderStyle: "single", borderColor: "gray", children: result.element })
42377
42431
  ] }) : 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: [
42432
+ result.type === "clear" ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "yellow", children: " (skill would clear the conversation)" }) }) : null,
42433
+ result.type === "exit" ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "yellow", children: " (skill would exit the CLI)" }) }) : null,
42434
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
42435
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text, { color: "gray", children: [
42382
42436
  "body preview (",
42383
42437
  bodyLines.length,
42384
42438
  " line",
42385
42439
  bodyLines.length !== 1 ? "s" : "",
42386
42440
  "):"
42387
42441
  ] }),
42388
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
42442
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
42389
42443
  Box_default,
42390
42444
  {
42391
42445
  flexDirection: "column",
@@ -42393,8 +42447,8 @@ var DryRunPanel = ({
42393
42447
  borderStyle: "single",
42394
42448
  borderColor: "gray",
42395
42449
  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: [
42450
+ previewLines.map((line, i2) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "white", children: line.length > 120 ? line.slice(0, 120) + " \u2026" : line || " " }, i2)),
42451
+ overflow > 0 ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text, { color: "gray", dimColor: true, children: [
42398
42452
  "\u2026 ",
42399
42453
  overflow,
42400
42454
  " more line",
@@ -42404,7 +42458,7 @@ var DryRunPanel = ({
42404
42458
  }
42405
42459
  )
42406
42460
  ] }),
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)" }) })
42461
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "gray", dimColor: true, children: "(mock context \u2014 live conversation unchanged)" }) })
42408
42462
  ]
42409
42463
  }
42410
42464
  );
@@ -42416,7 +42470,7 @@ var skillTestCommand = {
42416
42470
  run: async (args, ctx) => {
42417
42471
  const trimmed = args.trim();
42418
42472
  if (!trimmed) {
42419
- return { type: "render", element: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SkillListPanel, {}) };
42473
+ return { type: "render", element: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SkillListPanel, {}) };
42420
42474
  }
42421
42475
  const [name, ...rest] = trimmed.split(/\s+/);
42422
42476
  if (!name) {
@@ -42462,7 +42516,7 @@ ${argText}`.trim();
42462
42516
  const mockMessages = mockCtx.conversation.size();
42463
42517
  return {
42464
42518
  type: "render",
42465
- element: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
42519
+ element: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
42466
42520
  DryRunPanel,
42467
42521
  {
42468
42522
  skillName: name,
@@ -42478,7 +42532,7 @@ ${argText}`.trim();
42478
42532
  };
42479
42533
 
42480
42534
  // src/commands-palette/builtin/metrics.tsx
42481
- var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
42535
+ var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
42482
42536
  function computeMetrics(messages) {
42483
42537
  let modelCalls = 0;
42484
42538
  let toolCalls = 0;
@@ -42518,39 +42572,39 @@ var MetricsPanel = ({ ctx }) => {
42518
42572
  const rows = [
42519
42573
  [
42520
42574
  "Model calls",
42521
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "magentaBright", children: m.modelCalls }) }, "mc")
42575
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "magentaBright", children: m.modelCalls }) }, "mc")
42522
42576
  ],
42523
42577
  [
42524
42578
  "Tool calls",
42525
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: "magentaBright", children: m.toolCalls }) }, "tc")
42579
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "magentaBright", children: m.toolCalls }) }, "tc")
42526
42580
  ],
42527
42581
  [
42528
42582
  "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)" })
42583
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { children: [
42584
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "magentaBright", children: m.loopIterations }),
42585
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "gray", children: " (1 per model call)" })
42532
42586
  ] }, "li")
42533
42587
  ],
42534
42588
  [
42535
42589
  "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" })
42590
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { children: [
42591
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: m.avgLatencyMs === null ? "gray" : "cyan", children: fmtLatency(m.avgLatencyMs) }),
42592
+ m.avgLatencyMs !== null && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "gray", children: " per turn" })
42539
42593
  ] }, "lat")
42540
42594
  ],
42541
42595
  [
42542
42596
  "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)" })
42597
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { children: [
42598
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "magentaBright", children: ctx.sessionMessages }),
42599
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "gray", children: " total (incl. tool results)" })
42546
42600
  ] }, "msgs")
42547
42601
  ],
42548
42602
  [
42549
42603
  "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")
42604
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "magentaBright", children: ctx.sessionTokens.toLocaleString() }) }, "tok")
42551
42605
  ]
42552
42606
  ];
42553
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
42607
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
42554
42608
  Box_default,
42555
42609
  {
42556
42610
  flexDirection: "column",
@@ -42558,12 +42612,12 @@ var MetricsPanel = ({ ctx }) => {
42558
42612
  borderColor: "magenta",
42559
42613
  paddingX: 1,
42560
42614
  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 }) }),
42615
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { bold: true, color: "magentaBright", children: "Session metrics" }),
42616
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: rows.map(([label, value]) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Box_default, { children: [
42617
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box_default, { width: 18, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "gray", children: label }) }),
42564
42618
  value
42565
42619
  ] }, 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." }) })
42620
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "gray", children: "Latency = user-message \u2192 first assistant-turn ts delta." }) })
42567
42621
  ]
42568
42622
  }
42569
42623
  );
@@ -42573,7 +42627,7 @@ var metricsCommand = {
42573
42627
  description: "Show session metrics: model calls, tool calls, loop iterations, avg latency",
42574
42628
  run: (_args, ctx) => ({
42575
42629
  type: "render",
42576
- element: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(MetricsPanel, { ctx })
42630
+ element: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(MetricsPanel, { ctx })
42577
42631
  })
42578
42632
  };
42579
42633
 
@@ -42778,25 +42832,25 @@ var MCPClient = class {
42778
42832
  };
42779
42833
 
42780
42834
  // src/mcp/index.tsx
42781
- var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
42835
+ var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
42782
42836
  var ServerRow = ({ server, scope }) => {
42783
42837
  const enabled = server.enabled !== false;
42784
42838
  const statusColor = enabled ? "green" : "gray";
42785
42839
  const statusText = enabled ? "on " : "off";
42786
42840
  const scopeTag2 = scope === "project" ? " [project]" : "";
42787
42841
  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 })
42842
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box_default, { flexDirection: "column", marginBottom: 0, children: [
42843
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box_default, { children: [
42844
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Box_default, { width: 3, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: statusColor, children: statusText }) }),
42845
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Box_default, { width: 18, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "magentaBright", bold: true, children: server.id }) }),
42846
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "gray", children: server.url }),
42847
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "cyan", children: scopeTag2 }),
42848
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "yellow", children: authTag })
42795
42849
  ] }),
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
42850
+ server.label ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Box_default, { paddingLeft: 21, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "gray", children: server.label }) }) : null
42797
42851
  ] });
42798
42852
  };
42799
- var ListPanel = ({ servers }) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
42853
+ var ListPanel = ({ servers }) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
42800
42854
  Box_default,
42801
42855
  {
42802
42856
  flexDirection: "column",
@@ -42804,35 +42858,35 @@ var ListPanel = ({ servers }) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
42804
42858
  borderColor: "magentaBright",
42805
42859
  paddingX: 1,
42806
42860
  children: [
42807
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { bold: true, color: "magentaBright", children: [
42861
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Text, { bold: true, color: "magentaBright", children: [
42808
42862
  "MCP servers (",
42809
42863
  servers.length,
42810
42864
  ")"
42811
42865
  ] }),
42812
- servers.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { color: "gray", children: [
42866
+ servers.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Text, { color: "gray", children: [
42813
42867
  "No servers registered. Add one with /mcp add ",
42814
42868
  "<id> <url>",
42815
42869
  "."
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" })
42870
+ ] }) : servers.map((s) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ServerRow, { server: s }, s.id)),
42871
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
42872
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "gray", children: "Manage: /mcp add|remove|enable|disable|auth|tools" }),
42873
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "gray", children: "Config: ~/.kryven/mcp.json \xB7 project overlay: .kryven/mcp.json" })
42820
42874
  ] })
42821
42875
  ]
42822
42876
  }
42823
42877
  );
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: [
42878
+ var ToolsRow = ({ tool, serverId }) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Box_default, { flexDirection: "column", marginBottom: 0, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box_default, { children: [
42879
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Box_default, { width: 20, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Text, { color: "cyan", children: [
42826
42880
  "mcp:",
42827
42881
  serverId,
42828
42882
  ".",
42829
42883
  tool.name
42830
42884
  ] }) }),
42831
- tool.description ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "gray", children: tool.description }) : null
42885
+ tool.description ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "gray", children: tool.description }) : null
42832
42886
  ] }) });
42833
42887
  var ToolsPanel = ({ results }) => {
42834
42888
  const total = results.reduce((n2, r) => n2 + r.tools.length, 0);
42835
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
42889
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
42836
42890
  Box_default,
42837
42891
  {
42838
42892
  flexDirection: "column",
@@ -42840,7 +42894,7 @@ var ToolsPanel = ({ results }) => {
42840
42894
  borderColor: "cyan",
42841
42895
  paddingX: 1,
42842
42896
  children: [
42843
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { bold: true, color: "cyan", children: [
42897
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Text, { bold: true, color: "cyan", children: [
42844
42898
  "MCP tools (",
42845
42899
  total,
42846
42900
  " across ",
@@ -42849,15 +42903,15 @@ var ToolsPanel = ({ results }) => {
42849
42903
  results.length !== 1 ? "s" : "",
42850
42904
  ")"
42851
42905
  ] }),
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: [
42906
+ results.map((r) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
42907
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Text, { color: "magentaBright", bold: true, children: [
42854
42908
  r.server.id,
42855
42909
  r.server.label ? ` \u2014 ${r.server.label}` : ""
42856
42910
  ] }),
42857
- r.error ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { color: "red", children: [
42911
+ r.error ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Text, { color: "red", children: [
42858
42912
  " Error: ",
42859
42913
  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))
42914
+ ] }) : r.tools.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "gray", children: " (no tools discovered)" }) : r.tools.map((t) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ToolsRow, { tool: t, serverId: r.server.id }, t.name))
42861
42915
  ] }, r.server.id))
42862
42916
  ]
42863
42917
  }
@@ -42899,7 +42953,7 @@ var mcpCommand = {
42899
42953
  const servers = await resolveEffectiveServers(ctx.cwd);
42900
42954
  return {
42901
42955
  type: "render",
42902
- element: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ListPanel, { servers })
42956
+ element: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ListPanel, { servers })
42903
42957
  };
42904
42958
  }
42905
42959
  if (sub === "add") {
@@ -42989,7 +43043,7 @@ The token is stored as "Bearer <token>" in ~/.kryven/mcp.json.`
42989
43043
  const results = await discoverToolsForServers(targets);
42990
43044
  return {
42991
43045
  type: "render",
42992
- element: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ToolsPanel, { results })
43046
+ element: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ToolsPanel, { results })
42993
43047
  };
42994
43048
  }
42995
43049
  return {
@@ -43007,7 +43061,7 @@ The token is stored as "Bearer <token>" in ~/.kryven/mcp.json.`
43007
43061
  };
43008
43062
 
43009
43063
  // src/tui/EconomicsLine.tsx
43010
- var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
43064
+ var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
43011
43065
  function fmtTokens(n2) {
43012
43066
  if (n2 < 1e3) return String(n2);
43013
43067
  if (n2 < 1e6) return (n2 / 1e3).toFixed(1) + "k";
@@ -43046,58 +43100,58 @@ var EconomicsLine = ({
43046
43100
  const credits = creditsFromTokens(displayCharged);
43047
43101
  const hasTurnData = stats.turnCount > 0;
43048
43102
  if (compact) {
43049
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box_default, { children: [
43050
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Text, { color: "magenta", children: [
43103
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { children: [
43104
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Text, { color: "magenta", children: [
43051
43105
  fmtTokens(displayCharged),
43052
43106
  " tok"
43053
43107
  ] }),
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: [
43108
+ hasTurnData && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
43109
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "gray", children: " \xB7 " }),
43110
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Text, { color: "magentaBright", children: [
43057
43111
  credits,
43058
43112
  " cr"
43059
43113
  ] })
43060
43114
  ] }),
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 })
43115
+ hasTurnData && stats.tier && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
43116
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "gray", children: " \xB7 " }),
43117
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "gray", children: stats.tier })
43064
43118
  ] })
43065
43119
  ] });
43066
43120
  }
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" })
43121
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { paddingX: 1, borderStyle: "single", borderColor: "gray", flexDirection: "row", flexWrap: "wrap", children: [
43122
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { marginRight: 2, children: [
43123
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "gray", children: "session: " }),
43124
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "magentaBright", bold: true, children: fmtTokens(displayCharged) }),
43125
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "gray", children: " tok" })
43072
43126
  ] }),
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) })
43127
+ hasTurnData && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
43128
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { marginRight: 2, children: [
43129
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "gray", children: "in: " }),
43130
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "cyan", children: fmtTokens(stats.promptTokens) })
43077
43131
  ] }),
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) })
43132
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { marginRight: 2, children: [
43133
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "gray", children: "out: " }),
43134
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "green", children: fmtTokens(stats.completionTokens) })
43081
43135
  ] }),
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 })
43136
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { marginRight: 2, children: [
43137
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "gray", children: "turns: " }),
43138
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "white", children: stats.turnCount })
43085
43139
  ] }),
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 })
43140
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { marginRight: 2, children: [
43141
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "gray", children: "credits: " }),
43142
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "magenta", children: credits })
43089
43143
  ] })
43090
43144
  ] }),
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 })
43145
+ stats.tier && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { children: [
43146
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "gray", children: "plan: " }),
43147
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "yellow", children: stats.tier })
43094
43148
  ] }),
43095
- !hasTurnData && displayCharged === 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "gray", children: "no usage recorded yet" })
43149
+ !hasTurnData && displayCharged === 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "gray", children: "no usage recorded yet" })
43096
43150
  ] });
43097
43151
  };
43098
43152
 
43099
43153
  // src/commands-palette/builtin/usage.tsx
43100
- var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
43154
+ var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
43101
43155
  function displayName(model) {
43102
43156
  const lower = model.toLowerCase();
43103
43157
  if (lower.includes("extended")) return "KRY-5.2 Extended";
@@ -43130,9 +43184,9 @@ var UsagePanel = ({ ctx }) => {
43130
43184
  const messages = ctx.conversation.all();
43131
43185
  const modelBuckets = buildModelBuckets(messages);
43132
43186
  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)(
43187
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Box_default, { flexDirection: "column", children: [
43188
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { bold: true, color: "magentaBright", children: "/usage \u2014 session budget & token breakdown" }) }),
43189
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
43136
43190
  EconomicsLine,
43137
43191
  {
43138
43192
  sessionTokens: ctx.sessionTokens,
@@ -43140,7 +43194,7 @@ var UsagePanel = ({ ctx }) => {
43140
43194
  compact: false
43141
43195
  }
43142
43196
  ),
43143
- hasBreakdown && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
43197
+ hasBreakdown && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
43144
43198
  Box_default,
43145
43199
  {
43146
43200
  flexDirection: "column",
@@ -43149,38 +43203,38 @@ var UsagePanel = ({ ctx }) => {
43149
43203
  paddingX: 1,
43150
43204
  marginTop: 1,
43151
43205
  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 })
43206
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { bold: true, color: "magenta", children: "Per-model breakdown" }),
43207
+ Array.from(modelBuckets.entries()).map(([tier, bucket]) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Box_default, { flexDirection: "row", flexWrap: "wrap", children: [
43208
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Box_default, { width: 22, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "cyan", children: displayName(tier) }) }),
43209
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Box_default, { marginRight: 2, children: [
43210
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "gray", children: "turns: " }),
43211
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "white", children: bucket.turns })
43158
43212
  ] }),
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) })
43213
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Box_default, { marginRight: 2, children: [
43214
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "gray", children: "in: " }),
43215
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "cyan", children: fmtTokens2(bucket.promptTokens) })
43162
43216
  ] }),
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) })
43217
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Box_default, { marginRight: 2, children: [
43218
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "gray", children: "out: " }),
43219
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "green", children: fmtTokens2(bucket.completionTokens) })
43166
43220
  ] }),
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) })
43221
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Box_default, { children: [
43222
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "gray", children: "charged: " }),
43223
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "magentaBright", children: fmtTokens2(bucket.chargedTokens) })
43170
43224
  ] })
43171
43225
  ] }, tier))
43172
43226
  ]
43173
43227
  }
43174
43228
  ),
43175
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Box_default, { paddingX: 1, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Text, { color: "gray", children: [
43229
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Box_default, { paddingX: 1, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Text, { color: "gray", children: [
43176
43230
  "context: ",
43177
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "white", children: ctx.sessionMessages }),
43231
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "white", children: ctx.sessionMessages }),
43178
43232
  " msgs \xB7 conversation size: ",
43179
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "white", children: ctx.conversation.size() }),
43233
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "white", children: ctx.conversation.size() }),
43180
43234
  " \xB7 model: ",
43181
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "cyan", children: displayName(ctx.model) }),
43235
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "cyan", children: displayName(ctx.model) }),
43182
43236
  " \xB7 mood: ",
43183
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "yellow", children: ctx.mood })
43237
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "yellow", children: ctx.mood })
43184
43238
  ] }) })
43185
43239
  ] });
43186
43240
  };
@@ -43189,55 +43243,55 @@ var usageCommand = {
43189
43243
  description: "Show session token budget, accumulated spend, and per-model breakdown",
43190
43244
  run: (_args, ctx) => ({
43191
43245
  type: "render",
43192
- element: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(UsagePanel, { ctx })
43246
+ element: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(UsagePanel, { ctx })
43193
43247
  })
43194
43248
  };
43195
43249
 
43196
43250
  // src/commands-palette/builtin/vim.tsx
43197
43251
  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: [
43252
+ var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
43253
+ var StatusPanel = ({ enabled }) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 1, children: [
43254
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { bold: true, color: "magentaBright", children: "Vim Mode" }),
43255
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { children: [
43202
43256
  "Status:",
43203
43257
  " ",
43204
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { bold: true, color: enabled ? "green" : "gray", children: enabled ? "enabled" : "disabled" })
43258
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { bold: true, color: enabled ? "green" : "gray", children: enabled ? "enabled" : "disabled" })
43205
43259
  ] }) }),
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: [
43260
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
43261
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "gray", children: "Commands:" }),
43262
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { children: [
43209
43263
  " ",
43210
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "cyan", children: "/vim on" }),
43264
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "cyan", children: "/vim on" }),
43211
43265
  " ",
43212
43266
  " \u2014 enable vim mode (takes effect on next launch)"
43213
43267
  ] }),
43214
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Text, { children: [
43268
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { children: [
43215
43269
  " ",
43216
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "cyan", children: "/vim off" }),
43270
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "cyan", children: "/vim off" }),
43217
43271
  " ",
43218
43272
  " \u2014 disable vim mode"
43219
43273
  ] }),
43220
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Text, { children: [
43274
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { children: [
43221
43275
  " ",
43222
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "cyan", children: "/vim bindings" }),
43276
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "cyan", children: "/vim bindings" }),
43223
43277
  " ",
43224
43278
  " \u2014 show key binding reference"
43225
43279
  ] })
43226
43280
  ] }),
43227
- !enabled && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Text, { color: "gray", children: [
43281
+ !enabled && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { color: "gray", children: [
43228
43282
  "Tip: run",
43229
43283
  " ",
43230
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "cyan", children: "/vim on" }),
43284
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "cyan", children: "/vim on" }),
43231
43285
  " ",
43232
43286
  "to enable modal editing in the input line."
43233
43287
  ] }) }),
43234
- enabled && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Text, { color: "gray", children: [
43288
+ enabled && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { color: "gray", children: [
43235
43289
  "Active \u2014 press ",
43236
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "magentaBright", children: "Esc" }),
43290
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "magentaBright", children: "Esc" }),
43237
43291
  " to enter normal mode, ",
43238
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "magentaBright", children: "i" }),
43292
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "magentaBright", children: "i" }),
43239
43293
  "/",
43240
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "magentaBright", children: "a" }),
43294
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "magentaBright", children: "a" }),
43241
43295
  " to insert."
43242
43296
  ] }) })
43243
43297
  ] });
@@ -43265,16 +43319,16 @@ var BINDINGS = [
43265
43319
  // Submit
43266
43320
  ["Enter", "Submit prompt (any mode)"]
43267
43321
  ];
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 })
43322
+ var BindingsPanel2 = () => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 1, children: [
43323
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { bold: true, color: "magentaBright", children: "Vim key-binding reference" }),
43324
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: BINDINGS.map(([key, desc]) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Box_default, { children: [
43325
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Box_default, { width: 20, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "cyan", children: key }) }),
43326
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { children: desc })
43273
43327
  ] }, key)) }),
43274
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Text, { color: "gray", children: [
43328
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { color: "gray", children: [
43275
43329
  "Vim mode must be enabled via",
43276
43330
  " ",
43277
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "cyan", children: "/vim on" }),
43331
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "cyan", children: "/vim on" }),
43278
43332
  " ",
43279
43333
  "and the CLI restarted for bindings to take effect."
43280
43334
  ] }) })
@@ -43288,7 +43342,7 @@ var vimCommand = {
43288
43342
  if (sub === "bindings") {
43289
43343
  return {
43290
43344
  type: "render",
43291
- element: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(BindingsPanel2, {})
43345
+ element: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(BindingsPanel2, {})
43292
43346
  };
43293
43347
  }
43294
43348
  if (sub === "on") {
@@ -43311,7 +43365,7 @@ var vimCommand = {
43311
43365
  const enabled = cfg.vim === true;
43312
43366
  return {
43313
43367
  type: "render",
43314
- element: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(StatusPanel, { enabled })
43368
+ element: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(StatusPanel, { enabled })
43315
43369
  };
43316
43370
  }
43317
43371
  };
@@ -43612,7 +43666,7 @@ async function runBgAgent(id) {
43612
43666
  apiKey: cfg.apiKey,
43613
43667
  baseUrl: cfg.apiBaseUrl,
43614
43668
  clientType: "ide",
43615
- userAgent: `kryven-cli-bg/${"0.2.3"}`
43669
+ userAgent: `kryven-cli-bg/${"0.2.4"}`
43616
43670
  });
43617
43671
  const transcriptPath = join25(dir, "transcript.jsonl");
43618
43672
  const appendTranscript = async (m) => {
@@ -43731,7 +43785,7 @@ async function runBgAgent(id) {
43731
43785
  }
43732
43786
 
43733
43787
  // src/commands-palette/builtin/bg.tsx
43734
- var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
43788
+ var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
43735
43789
  function fmtElapsed2(start, end) {
43736
43790
  const sec = Math.floor(((end ?? Date.now()) - start) / 1e3);
43737
43791
  const m = Math.floor(sec / 60);
@@ -43744,26 +43798,26 @@ var STATUS_COLOR2 = {
43744
43798
  killed: "red",
43745
43799
  timeout: "yellow"
43746
43800
  };
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: [
43801
+ var BgListPanel = ({ agents }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
43802
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Text, { bold: true, color: "cyan", children: [
43749
43803
  "Background agents (",
43750
43804
  agents.length,
43751
43805
  ")"
43752
43806
  ] }),
43753
- agents.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { color: "gray", children: [
43807
+ agents.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Text, { color: "gray", children: [
43754
43808
  "None. Start one with /bg start ",
43755
43809
  "<prompt>",
43756
43810
  "."
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: [
43811
+ ] }) : agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Box_default, { children: [
43812
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Box_default, { width: 11, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Text, { color: "cyan", children: [
43759
43813
  a2.id.slice(0, 8),
43760
43814
  "\u2026"
43761
43815
  ] }) }),
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 || "" })
43816
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Box_default, { width: 11, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: STATUS_COLOR2[a2.status] ?? "white", children: a2.status }) }),
43817
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Box_default, { width: 8, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: "gray", children: fmtElapsed2(a2.startedAt, a2.finishedAt) }) }),
43818
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: "gray", wrap: "truncate-end", children: a2.lastLine || "" })
43765
43819
  ] }, a2.id)),
43766
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { color: "gray", children: [
43820
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Text, { color: "gray", children: [
43767
43821
  "/bg start ",
43768
43822
  "<prompt>",
43769
43823
  " \xB7 /bg logs ",
@@ -43822,27 +43876,27 @@ var bgCommand = {
43822
43876
  };
43823
43877
  }
43824
43878
  const agents = await listBgAgents();
43825
- return { type: "render", element: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(BgListPanel, { agents }) };
43879
+ return { type: "render", element: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(BgListPanel, { agents }) };
43826
43880
  }
43827
43881
  };
43828
43882
 
43829
43883
  // src/commands-palette/builtin/mode.tsx
43830
43884
  init_modes();
43831
- var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
43885
+ var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
43832
43886
  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" }),
43887
+ var ModePanel = ({ current }) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
43888
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { bold: true, color: "cyan", children: "Permission mode" }),
43835
43889
  ORDER.map((m) => {
43836
43890
  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: [
43891
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Box_default, { children: [
43892
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Text, { color: active ? "greenBright" : "cyan", bold: active, children: [
43839
43893
  active ? "\u25B8 " : " ",
43840
43894
  m
43841
43895
  ] }) }),
43842
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: "gray", children: MODE_DESCRIPTIONS[m] })
43896
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: "gray", children: MODE_DESCRIPTIONS[m] })
43843
43897
  ] }, m);
43844
43898
  }),
43845
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Text, { color: "gray", children: [
43899
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Text, { color: "gray", children: [
43846
43900
  "Switch: /mode ",
43847
43901
  "<name>",
43848
43902
  " \xB7 cycle with Shift+Tab \xB7 enable bypass with /mode bypass --confirm"
@@ -43859,7 +43913,7 @@ var modeCommand = {
43859
43913
  const parts = (args ?? "").trim().split(/\s+/).filter(Boolean);
43860
43914
  const sub = (parts[0] ?? "").toLowerCase();
43861
43915
  if (!sub) {
43862
- return { type: "render", element: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ModePanel, { current: getPermissionMode() }) };
43916
+ return { type: "render", element: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ModePanel, { current: getPermissionMode() }) };
43863
43917
  }
43864
43918
  if (sub === "next") {
43865
43919
  return { type: "ack", message: `Permission mode: ${cyclePermissionMode()}` };
@@ -43889,6 +43943,7 @@ var BUILTIN_COMMANDS = [
43889
43943
  exitCommand,
43890
43944
  modelCommand,
43891
43945
  moodCommand,
43946
+ loginCommand2,
43892
43947
  costCommand,
43893
43948
  skillCommand,
43894
43949
  agentCommand,
@@ -44032,6 +44087,7 @@ function applyCompletion(buffer, result, item) {
44032
44087
  init_messages();
44033
44088
  init_system_prompt();
44034
44089
  init_loop();
44090
+ init_client();
44035
44091
  init_errors();
44036
44092
 
44037
44093
  // src/session/store.ts
@@ -44389,6 +44445,7 @@ var SessionsClient = class {
44389
44445
 
44390
44446
  // src/tui/REPL.tsx
44391
44447
  init_load();
44448
+ init_crypto();
44392
44449
 
44393
44450
  // src/session/history.ts
44394
44451
  var import_proper_lockfile = __toESM(require_proper_lockfile(), 1);
@@ -44587,7 +44644,7 @@ async function checkForUpdate(current, timeoutMs = 2500) {
44587
44644
  }
44588
44645
 
44589
44646
  // src/tui/REPL.tsx
44590
- var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
44647
+ var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1);
44591
44648
  import fs4 from "node:fs";
44592
44649
  import path8 from "node:path";
44593
44650
  function detectReflectCommand(cwd2) {
@@ -44626,12 +44683,14 @@ var REPL = ({
44626
44683
  cwd: cwd2,
44627
44684
  resumeMessages,
44628
44685
  resumeSessionId,
44629
- isGuest = false,
44686
+ isGuest: initialIsGuest = false,
44630
44687
  noMotion: _noMotion = false,
44631
44688
  themeOverride: _themeOverride,
44632
44689
  seedPrompt
44633
44690
  }) => {
44634
44691
  const app = use_app_default();
44692
+ const clientRef = (0, import_react27.useRef)(client);
44693
+ const [isGuest, setIsGuest] = (0, import_react27.useState)(initialIsGuest);
44635
44694
  const conversationRef = (0, import_react27.useRef)(new Conversation());
44636
44695
  const sessionRef = (0, import_react27.useRef)(new SessionStore(resumeSessionId));
44637
44696
  const remoteSessionRef = (0, import_react27.useRef)(null);
@@ -44643,7 +44702,7 @@ var REPL = ({
44643
44702
  if (isGuest) return;
44644
44703
  const cfg = resolveConfig();
44645
44704
  if (cfg.apiKey && cfg.telemetry !== false) {
44646
- const sessionsClient = new SessionsClient(client);
44705
+ const sessionsClient = new SessionsClient(clientRef.current);
44647
44706
  remoteSessionRef.current = new RemoteSessionStore(
44648
44707
  sessionRef.current.id,
44649
44708
  sessionsClient,
@@ -44669,6 +44728,7 @@ var REPL = ({
44669
44728
  const [sessionTokens, setSessionTokens] = (0, import_react27.useState)(0);
44670
44729
  const [toolEntries, setToolEntries] = (0, import_react27.useState)([]);
44671
44730
  const [permissionReq, setPermissionReq] = (0, import_react27.useState)(null);
44731
+ const [modelPicker, setModelPicker] = (0, import_react27.useState)(null);
44672
44732
  const [staticGen, setStaticGen] = (0, import_react27.useState)(0);
44673
44733
  const prevCommittedCountRef = (0, import_react27.useRef)(0);
44674
44734
  const cfgRef = (0, import_react27.useRef)(resolveConfig());
@@ -44713,13 +44773,13 @@ var REPL = ({
44713
44773
  }, []);
44714
44774
  const toolsEnabled = (0, import_react27.useMemo)(() => listTools().length > 0, []);
44715
44775
  (0, import_react27.useEffect)(() => {
44716
- void checkForUpdate("0.2.3").then((info) => {
44776
+ void checkForUpdate("0.2.4").then((info) => {
44717
44777
  if (info?.updateAvailable) {
44718
44778
  setNotes((p) => [
44719
44779
  ...p,
44720
44780
  {
44721
44781
  kind: "system",
44722
- text: `Update available: ${"0.2.3"} \u2192 ${info.latest}. Run \`kryven update\` to update.`
44782
+ text: `Update available: ${"0.2.4"} \u2192 ${info.latest}. Run \`kryven update\` to update.`
44723
44783
  }
44724
44784
  ]);
44725
44785
  }
@@ -44754,6 +44814,30 @@ var REPL = ({
44754
44814
  }
44755
44815
  }, [input, busy, permissionReq, overlay, cwd2]);
44756
44816
  use_input_default((inputCh, key) => {
44817
+ if (modelPicker) {
44818
+ if (key.upArrow) {
44819
+ setModelPicker((p) => p ? { sel: Math.max(0, p.sel - 1) } : p);
44820
+ return;
44821
+ }
44822
+ if (key.downArrow) {
44823
+ setModelPicker((p) => p ? { sel: Math.min(MODELS.length - 1, p.sel + 1) } : p);
44824
+ return;
44825
+ }
44826
+ if (key.return) {
44827
+ const m = MODELS[modelPicker.sel];
44828
+ if (m) {
44829
+ setModel(m.id);
44830
+ setNotes((p) => [...p, { kind: "system", text: `Model: ${m.id} (${m.publisher})` }]);
44831
+ }
44832
+ setModelPicker(null);
44833
+ return;
44834
+ }
44835
+ if (key.escape) {
44836
+ setModelPicker(null);
44837
+ return;
44838
+ }
44839
+ return;
44840
+ }
44757
44841
  if (permissionReq && permissionResolveRef.current) {
44758
44842
  const ch = inputCh.toLowerCase();
44759
44843
  let decision = null;
@@ -44822,7 +44906,37 @@ var REPL = ({
44822
44906
  sessionTokens,
44823
44907
  sessionMessages: conversationRef.current.size(),
44824
44908
  setModel: (m) => setModel(m),
44825
- setMood: (m) => setMood(m)
44909
+ setMood: (m) => setMood(m),
44910
+ // /login: validate a new key, persist it, and hot-swap the live client so
44911
+ // the next message uses it — no restart. Flips guest -> authenticated too.
44912
+ relogin: async (rawKey) => {
44913
+ const key = rawKey.trim();
44914
+ if (!isValidApiKey(key)) {
44915
+ return { ok: false, message: 'Invalid key format (expected "kry_sk_" + 48 hex chars).' };
44916
+ }
44917
+ const cfg = resolveConfig();
44918
+ const candidate = new KryvenClient({
44919
+ apiKey: key,
44920
+ baseUrl: cfg.apiBaseUrl,
44921
+ clientType: "ide",
44922
+ userAgent: `kryven-cli/${"0.2.4"}`
44923
+ });
44924
+ try {
44925
+ await candidate.ping();
44926
+ } catch (err) {
44927
+ return { ok: false, message: `Key rejected: ${friendlyMessage(err)}` };
44928
+ }
44929
+ try {
44930
+ const u2 = loadUserConfig();
44931
+ saveUserConfig({ ...u2, apiKey: key });
44932
+ } catch (err) {
44933
+ logger.warn("relogin: config save failed", String(err));
44934
+ }
44935
+ clientRef.current = candidate;
44936
+ setIsGuest(false);
44937
+ const toolHint = listTools().length === 0 ? " Restart kryven to enable tools." : "";
44938
+ return { ok: true, message: `Logged in \u2014 key validated, saved, and active for this session.${toolHint}` };
44939
+ }
44826
44940
  }),
44827
44941
  [model, mood, cwd2, sessionTokens]
44828
44942
  );
@@ -44842,7 +44956,7 @@ var REPL = ({
44842
44956
  if (remoteSessionRef.current) {
44843
44957
  const cfg = resolveConfig();
44844
44958
  if (cfg.apiKey && cfg.telemetry !== false) {
44845
- const sessionsClient = new SessionsClient(client);
44959
+ const sessionsClient = new SessionsClient(clientRef.current);
44846
44960
  remoteSessionRef.current = new RemoteSessionStore(
44847
44961
  sessionRef.current.id,
44848
44962
  sessionsClient,
@@ -44866,7 +44980,7 @@ var REPL = ({
44866
44980
  if (remoteSessionRef.current) {
44867
44981
  const cfg = resolveConfig();
44868
44982
  if (cfg.apiKey && cfg.telemetry !== false) {
44869
- const sessionsClient = new SessionsClient(client);
44983
+ const sessionsClient = new SessionsClient(clientRef.current);
44870
44984
  remoteSessionRef.current = new RemoteSessionStore(
44871
44985
  sessionRef.current.id,
44872
44986
  sessionsClient,
@@ -44889,6 +45003,11 @@ var REPL = ({
44889
45003
  case "render":
44890
45004
  setOverlay(res.element);
44891
45005
  return;
45006
+ case "model-picker": {
45007
+ const idx = MODELS.findIndex((m) => m.id === model);
45008
+ setModelPicker({ sel: idx >= 0 ? idx : 0 });
45009
+ return;
45010
+ }
44892
45011
  }
44893
45012
  };
44894
45013
  const askPermission = (req) => new Promise((resolve7) => {
@@ -44967,7 +45086,7 @@ var REPL = ({
44967
45086
  }
44968
45087
  };
44969
45088
  const runGuestTurn = async (ac) => {
44970
- const guestClient = client;
45089
+ const guestClient = clientRef.current;
44971
45090
  setStreaming("");
44972
45091
  const allMessages = conversationRef.current.all().map((m) => ({
44973
45092
  role: m.role,
@@ -45000,7 +45119,7 @@ var REPL = ({
45000
45119
  setStreaming("");
45001
45120
  let acc = "";
45002
45121
  let usage;
45003
- for await (const ev of runTurn(client, conversationRef.current, {
45122
+ for await (const ev of runTurn(clientRef.current, conversationRef.current, {
45004
45123
  systemPrompt: sys,
45005
45124
  model,
45006
45125
  mood,
@@ -45049,7 +45168,7 @@ var REPL = ({
45049
45168
  }
45050
45169
  };
45051
45170
  const reflectCmd = detectReflectCommand(cwd2);
45052
- for await (const ev of runAgentLoopWithTools(client, conversationRef.current, {
45171
+ for await (const ev of runAgentLoopWithTools(clientRef.current, conversationRef.current, {
45053
45172
  systemPrompt: sys,
45054
45173
  model,
45055
45174
  mood,
@@ -45181,14 +45300,14 @@ var REPL = ({
45181
45300
  const items = [
45182
45301
  {
45183
45302
  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: [
45303
+ node: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
45304
+ KRYVEN_PIXEL_WORDMARK.map((line) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: "magentaBright", children: line }, line)),
45305
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Text, { bold: true, color: "cyan", children: [
45187
45306
  "Kryven CLI ",
45188
- "0.2.3",
45307
+ "0.2.4",
45189
45308
  toolsEnabled ? " \xB7 tools enabled" : ""
45190
45309
  ] }),
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" })
45310
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: "gray", children: "Powered by KRY-5.2 Extended \xB7 type /help \xB7 Ctrl+D to exit" })
45192
45311
  ] })
45193
45312
  }
45194
45313
  ];
@@ -45207,10 +45326,10 @@ var REPL = ({
45207
45326
  for (let i2 = 0; i2 < all.length; i2++) {
45208
45327
  const m = all[i2];
45209
45328
  if (m.role === "user") {
45210
- items.push({ id: `${gen}-m${i2}`, node: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(MessageList, { message: m }) });
45329
+ items.push({ id: `${gen}-m${i2}`, node: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MessageList, { message: m }) });
45211
45330
  } else if (m.role === "assistant") {
45212
45331
  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 }) });
45332
+ items.push({ id: `${gen}-m${i2}`, node: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MessageList, { message: m }) });
45214
45333
  }
45215
45334
  } else if (m.role === "tool") {
45216
45335
  const meta = m.tool_call_id ? toolMetaRef.current.get(m.tool_call_id) : void 0;
@@ -45222,7 +45341,7 @@ var REPL = ({
45222
45341
  status: "ok",
45223
45342
  output: typeof m.content === "string" ? m.content : ""
45224
45343
  };
45225
- items.push({ id: `${gen}-t${i2}`, node: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ToolCall, { ...entry }) });
45344
+ items.push({ id: `${gen}-t${i2}`, node: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ToolCall, { ...entry }) });
45226
45345
  }
45227
45346
  }
45228
45347
  return items;
@@ -45234,56 +45353,57 @@ var REPL = ({
45234
45353
  }
45235
45354
  prevCommittedCountRef.current = committedCount;
45236
45355
  }, [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 }) })
45356
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Box_default, { flexDirection: "column", children: [
45357
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Static, { items: staticItems, children: (item) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Box_default, { flexDirection: "column", children: item.node }, item.id) }, staticGen),
45358
+ streaming != null && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
45359
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { bold: true, color: "green", children: "kryven" }),
45360
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Box_default, { paddingLeft: 2, flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MarkdownStream, { streamingText: streaming, done: !busy }) })
45242
45361
  ] }),
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: [
45362
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ToolCallList, { entries: toolEntries, paused: Boolean(permissionReq) }),
45363
+ modelPicker && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ModelPicker, { models: MODELS, selected: modelPicker.sel, current: model }),
45364
+ permissionReq && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, borderStyle: "round", borderColor: "yellow", paddingX: 1, children: [
45365
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { bold: true, children: "Permission required" }),
45366
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Text, { children: [
45247
45367
  "Tool: ",
45248
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: "cyan", children: permissionReq.toolName }),
45368
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: "cyan", children: permissionReq.toolName }),
45249
45369
  " ",
45250
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Text, { color: riskColor(permissionReq.risk), children: [
45370
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Text, { color: riskColor(permissionReq.risk), children: [
45251
45371
  "[",
45252
45372
  permissionReq.risk,
45253
45373
  "]"
45254
45374
  ] })
45255
45375
  ] }),
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]" }),
45376
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: "gray", children: permissionReq.argsPreview }),
45377
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Text, { children: [
45378
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: "green", children: "[Y]" }),
45259
45379
  " allow once \xB7",
45260
45380
  " ",
45261
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: "green", children: "[A]" }),
45381
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: "green", children: "[A]" }),
45262
45382
  " always (this command) \xB7",
45263
45383
  " ",
45264
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: "green", children: "[Shift+A]" }),
45384
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: "green", children: "[Shift+A]" }),
45265
45385
  " always (this tool) \xB7",
45266
45386
  " ",
45267
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: "red", children: "[N]" }),
45387
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: "red", children: "[N]" }),
45268
45388
  " deny"
45269
45389
  ] })
45270
45390
  ] }),
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: [
45391
+ notes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Box_default, { flexDirection: "column", marginBottom: 1, children: notes.slice(-3).map((n2, i2) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Text, { color: n2.kind === "error" ? "red" : "gray", children: [
45272
45392
  n2.kind === "error" ? "\u2717 " : "\xB7 ",
45273
45393
  n2.text
45274
45394
  ] }, i2)) }),
45275
- overlay && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Box_default, { marginBottom: 1, flexDirection: "column", children: [
45395
+ overlay && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Box_default, { marginBottom: 1, flexDirection: "column", children: [
45276
45396
  overlay,
45277
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: "gray", children: "(press Enter or Esc to dismiss)" })
45397
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: "gray", children: "(press Enter or Esc to dismiss)" })
45278
45398
  ] }),
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)(
45399
+ completion && completion.items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CompletionMenu, { items: completion.items, selected: 0 }),
45400
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
45281
45401
  PromptInput,
45282
45402
  {
45283
45403
  value: input,
45284
45404
  onChange: setInput,
45285
45405
  onSubmit: submit,
45286
- disabled: busy || Boolean(permissionReq),
45406
+ disabled: busy || Boolean(permissionReq) || Boolean(modelPicker),
45287
45407
  placeholder: busy ? "" : void 0,
45288
45408
  vimMode: vimEnabledRef.current ? vimRef.current.mode : null,
45289
45409
  vimCmdline: vimEnabledRef.current ? vimRef.current.cmdline : null,
@@ -45291,8 +45411,8 @@ var REPL = ({
45291
45411
  },
45292
45412
  `pi-${vimTick}`
45293
45413
  ),
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 }) })
45414
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Box_default, { marginTop: 1, children: busy && !permissionReq && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Spinner2, { label: "thinking\u2026 (Ctrl+C to cancel)" }) }),
45415
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(StatusBar, { status }) })
45296
45416
  ] });
45297
45417
  };
45298
45418
 
@@ -45555,7 +45675,188 @@ async function bootstrapMCP(opts = {}) {
45555
45675
 
45556
45676
  // src/commands/chat.ts
45557
45677
  init_store();
45678
+
45679
+ // src/tui/SetupWizard.tsx
45680
+ var import_react28 = __toESM(require_react(), 1);
45681
+ init_client();
45682
+ init_crypto();
45683
+ init_errors();
45684
+ init_load();
45685
+ var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1);
45686
+ import { dirname as dirname16 } from "node:path";
45687
+ var OPTIONS = [
45688
+ {
45689
+ id: "guest",
45690
+ title: "Quick start (guest)",
45691
+ desc: "3 free prompts, no key, no signup - try Kryven right now"
45692
+ },
45693
+ {
45694
+ id: "key",
45695
+ title: "Sign in with an API key",
45696
+ desc: "Paste your kry_sk_ key for unlimited chat + the full tool agent"
45697
+ }
45698
+ ];
45699
+ var SetupWizard = ({
45700
+ baseUrl,
45701
+ onDone
45702
+ }) => {
45703
+ const [step, setStep] = (0, import_react28.useState)("choose");
45704
+ const [sel, setSel] = (0, import_react28.useState)(0);
45705
+ const [keyVal, setKeyVal] = (0, import_react28.useState)("");
45706
+ const [error, setError] = (0, import_react28.useState)(null);
45707
+ use_input_default((input, key) => {
45708
+ if (key.ctrl && input === "c") {
45709
+ onDone({ mode: "cancel" });
45710
+ return;
45711
+ }
45712
+ if (step === "choose") {
45713
+ if (key.upArrow || input === "k") setSel((s) => (s + OPTIONS.length - 1) % OPTIONS.length);
45714
+ else if (key.downArrow || input === "j") setSel((s) => (s + 1) % OPTIONS.length);
45715
+ else if (input === "1") setSel(0);
45716
+ else if (input === "2") setSel(1);
45717
+ else if (key.return) {
45718
+ if (OPTIONS[sel].id === "guest") onDone({ mode: "guest" });
45719
+ else {
45720
+ setError(null);
45721
+ setStep("enter-key");
45722
+ }
45723
+ }
45724
+ } else if (step === "enter-key") {
45725
+ if (key.escape) {
45726
+ setStep("choose");
45727
+ setKeyVal("");
45728
+ setError(null);
45729
+ }
45730
+ }
45731
+ });
45732
+ const submitKey = (raw) => {
45733
+ const k = raw.trim();
45734
+ if (!isValidApiKey(k)) {
45735
+ setError('Invalid format - expected "kry_sk_" followed by 48 hex chars.');
45736
+ return;
45737
+ }
45738
+ setStep("validating");
45739
+ setError(null);
45740
+ void (async () => {
45741
+ try {
45742
+ await new KryvenClient({
45743
+ apiKey: k,
45744
+ baseUrl,
45745
+ clientType: "ide",
45746
+ userAgent: `kryven-cli/${"0.2.4"}`
45747
+ }).ping();
45748
+ onDone({ mode: "key", key: k });
45749
+ } catch (err) {
45750
+ setError(`Key rejected: ${friendlyMessage(err)}`);
45751
+ setStep("enter-key");
45752
+ }
45753
+ })();
45754
+ };
45755
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Box_default, { flexDirection: "column", children: [
45756
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
45757
+ Box_default,
45758
+ {
45759
+ flexDirection: "column",
45760
+ borderStyle: "round",
45761
+ borderColor: "magenta",
45762
+ paddingX: 2,
45763
+ marginBottom: 1,
45764
+ children: [
45765
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { bold: true, color: "magentaBright", children: "\u2726 Kryven CLI Setup Wizard" }),
45766
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: "gray", children: "Let's configure your Kryven CLI. Press Ctrl+C any time to exit." })
45767
+ ]
45768
+ }
45769
+ ),
45770
+ step === "choose" && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Box_default, { flexDirection: "column", paddingX: 1, children: [
45771
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: "white", children: "How would you like to start?" }),
45772
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: "gray", children: "Use \u2191/\u2193 (or 1-2), Enter to confirm." }),
45773
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: OPTIONS.map((o2, i2) => {
45774
+ const on6 = i2 === sel;
45775
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
45776
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Text, { color: on6 ? "greenBright" : "white", bold: on6, children: [
45777
+ on6 ? "(\u25CF)" : "(\u25CB)",
45778
+ " ",
45779
+ i2 + 1,
45780
+ ". ",
45781
+ o2.title,
45782
+ o2.id === "guest" ? " (recommended)" : ""
45783
+ ] }),
45784
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Text, { color: "gray", children: [
45785
+ " ",
45786
+ o2.desc
45787
+ ] })
45788
+ ] }, o2.id);
45789
+ }) }),
45790
+ error && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: "red", children: error })
45791
+ ] }),
45792
+ step === "enter-key" && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Box_default, { flexDirection: "column", paddingX: 1, children: [
45793
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { children: "Paste your Kryven API key:" }),
45794
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: "gray", children: "Get one at https://kryven.cc/api-dashboard" }),
45795
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Box_default, { marginTop: 1, borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
45796
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: "cyan", children: "kry> " }),
45797
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
45798
+ build_default,
45799
+ {
45800
+ value: keyVal,
45801
+ onChange: setKeyVal,
45802
+ onSubmit: submitKey,
45803
+ mask: "*",
45804
+ placeholder: "kry_sk_..."
45805
+ }
45806
+ )
45807
+ ] }),
45808
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: "gray", children: "Enter to validate \xB7 Esc to go back" }),
45809
+ error && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: "red", children: error })
45810
+ ] }),
45811
+ step === "validating" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: "yellow", children: "Validating key against /v1/models\u2026" }) })
45812
+ ] });
45813
+ };
45814
+ function runSetupWizard(baseUrl) {
45815
+ return new Promise((resolve7) => {
45816
+ const instance = render_default(
45817
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
45818
+ SetupWizard,
45819
+ {
45820
+ baseUrl,
45821
+ onDone: (r) => {
45822
+ instance.unmount();
45823
+ resolve7(r);
45824
+ }
45825
+ }
45826
+ ),
45827
+ { exitOnCtrlC: false }
45828
+ );
45829
+ });
45830
+ }
45831
+ async function maybeRunFirstRunSetup(opts) {
45832
+ const cfg = resolveConfig(opts.apiKey);
45833
+ const user = loadUserConfig();
45834
+ if (user.setupComplete || cfg.apiKeySource !== "none" || !process.stdin.isTTY) return;
45835
+ console.log(source_default.green(`[OK] Config directory ready at ${dirname16(cfg.configPath)}`));
45836
+ console.log(source_default.green("[OK] 6 built-in tools available (Read/Write/Edit/Bash/Glob/Grep)"));
45837
+ console.log(source_default.cyan("\n-> Starting setup wizard...\n"));
45838
+ const res = await runSetupWizard(cfg.apiBaseUrl);
45839
+ if (res.mode === "cancel") {
45840
+ console.log(source_default.dim("\nSetup cancelled. Run `kryven` again whenever you're ready.\n"));
45841
+ process.exit(0);
45842
+ }
45843
+ const cur = loadUserConfig();
45844
+ if (res.mode === "key" && res.key) {
45845
+ saveUserConfig({ ...cur, apiKey: res.key, setupComplete: true });
45846
+ console.log(source_default.green("\n[OK] API key validated and saved. You're all set.\n"));
45847
+ } else {
45848
+ saveUserConfig({ ...cur, setupComplete: true });
45849
+ console.log(
45850
+ source_default.cyan(
45851
+ "\n-> Starting in guest mode (3 free prompts). Run /login (or `kryven login`) anytime to sign in.\n"
45852
+ )
45853
+ );
45854
+ }
45855
+ }
45856
+
45857
+ // src/commands/chat.ts
45558
45858
  async function chatCommand(opts = {}) {
45859
+ await maybeRunFirstRunSetup({ apiKey: opts.apiKey });
45559
45860
  const cfg = resolveConfig(opts.apiKey);
45560
45861
  let client;
45561
45862
  let isGuest = false;
@@ -45564,7 +45865,7 @@ async function chatCommand(opts = {}) {
45564
45865
  client = new GuestKryvenClient({
45565
45866
  baseUrl: cfg.apiBaseUrl,
45566
45867
  shareFingerprint: cfg.shareFingerprint !== false,
45567
- userAgent: `kryven-cli/${"0.2.3"}`
45868
+ userAgent: `kryven-cli/${"0.2.4"}`
45568
45869
  });
45569
45870
  console.log(source_default.cyan("Guest mode \u2014 3 free prompts. Run `kryven login` for unlimited chat."));
45570
45871
  } else {
@@ -45572,7 +45873,7 @@ async function chatCommand(opts = {}) {
45572
45873
  apiKey: cfg.apiKey,
45573
45874
  baseUrl: cfg.apiBaseUrl,
45574
45875
  clientType: "ide",
45575
- userAgent: `kryven-cli/${"0.2.3"}`
45876
+ userAgent: `kryven-cli/${"0.2.4"}`
45576
45877
  });
45577
45878
  }
45578
45879
  let resumeMessages;
@@ -45639,7 +45940,7 @@ async function chatCommand(opts = {}) {
45639
45940
  logger.warn("config save (touch) failed", String(err));
45640
45941
  }
45641
45942
  const { waitUntilExit } = render_default(
45642
- import_react28.default.createElement(REPL, {
45943
+ import_react29.default.createElement(REPL, {
45643
45944
  client,
45644
45945
  initialModel: model,
45645
45946
  initialMood: mood,
@@ -45660,7 +45961,7 @@ async function chatCommand(opts = {}) {
45660
45961
  init_execa();
45661
45962
 
45662
45963
  // src/shims/version.ts
45663
- var KRYVEN_VERSION = "0.2.3";
45964
+ var KRYVEN_VERSION = "0.2.4";
45664
45965
 
45665
45966
  // src/commands/update.ts
45666
45967
  var PACKAGE2 = "@kryvenaiofficial/kryven";
@@ -46041,7 +46342,7 @@ async function main(argv2) {
46041
46342
  var argv = process.argv.slice(2);
46042
46343
  var first = argv[0];
46043
46344
  if (first === "--version" || first === "-v" || first === "-V") {
46044
- const v = "0.2.3";
46345
+ const v = "0.2.4";
46045
46346
  process.stdout.write(v + "\n");
46046
46347
  process.exit(0);
46047
46348
  }