@kryvenaiofficial/kryven 0.2.2 → 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.
- package/dist/cli.mjs +1127 -697
- package/package.json +3 -1
- package/scripts/postinstall.cjs +48 -0
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
|
|
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";
|
|
@@ -37700,9 +37703,18 @@ function renderInline(s) {
|
|
|
37700
37703
|
return s.replace(/`([^`]+)`/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(/__([^_]+)__/g, "$1");
|
|
37701
37704
|
}
|
|
37702
37705
|
|
|
37706
|
+
// src/tui/MessageList.tsx
|
|
37707
|
+
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
|
|
37708
|
+
var MessageList = ({ message: m }) => {
|
|
37709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
|
|
37710
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { bold: true, color: m.role === "user" ? "blue" : "green", children: m.role === "user" ? "you" : "kryven" }),
|
|
37711
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box_default, { paddingLeft: 2, flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Markdown, { text: m.content ?? "" }) })
|
|
37712
|
+
] });
|
|
37713
|
+
};
|
|
37714
|
+
|
|
37703
37715
|
// src/tui/MarkdownStream.tsx
|
|
37704
37716
|
var import_react22 = __toESM(require_react(), 1);
|
|
37705
|
-
var
|
|
37717
|
+
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
|
37706
37718
|
var LIVE_LINE_COUNT = 6;
|
|
37707
37719
|
var MAX_FPS = 20;
|
|
37708
37720
|
var FRAME_INTERVAL_MS = Math.floor(1e3 / MAX_FPS);
|
|
@@ -37780,55 +37792,21 @@ var MarkdownStream = ({
|
|
|
37780
37792
|
}
|
|
37781
37793
|
};
|
|
37782
37794
|
}, []);
|
|
37783
|
-
const
|
|
37784
|
-
|
|
37785
|
-
|
|
37786
|
-
|
|
37787
|
-
let carry = "";
|
|
37788
|
-
if (stable) {
|
|
37789
|
-
const paragraphs = stable.split(/\n{2,}/);
|
|
37790
|
-
const carryIdx = paragraphs.length - 1;
|
|
37791
|
-
carry = paragraphs[carryIdx] ?? "";
|
|
37792
|
-
let offset = 0;
|
|
37793
|
-
for (let i2 = 0; i2 < carryIdx; i2++) {
|
|
37794
|
-
const para = paragraphs[i2];
|
|
37795
|
-
if (para.trim()) {
|
|
37796
|
-
chunks.push({ id: `s-${offset}`, text: para });
|
|
37797
|
-
}
|
|
37798
|
-
offset += para.length + 2;
|
|
37799
|
-
}
|
|
37800
|
-
}
|
|
37801
|
-
const liveText2 = carry ? `${carry}
|
|
37802
|
-
${live}` : live;
|
|
37803
|
-
return { stableChunks: chunks, liveText: liveText2 };
|
|
37804
|
-
}, [displayText]);
|
|
37795
|
+
const liveText = (0, import_react22.useMemo)(
|
|
37796
|
+
() => displayText ? splitAtBoundary(displayText).live : "",
|
|
37797
|
+
[displayText]
|
|
37798
|
+
);
|
|
37805
37799
|
const liveInsideFence = (0, import_react22.useMemo)(() => isInsideCodeFence(liveText), [liveText]);
|
|
37806
37800
|
if (streamingText === void 0) return null;
|
|
37807
|
-
return /* @__PURE__ */ (0,
|
|
37808
|
-
|
|
37809
|
-
|
|
37810
|
-
/* @__PURE__ */ (0,
|
|
37811
|
-
liveInsideFence && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { color: "gray", dimColor: true, children: [
|
|
37801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
37802
|
+
liveText ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
37803
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Markdown, { text: liveText }),
|
|
37804
|
+
liveInsideFence && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Text, { color: "gray", dimColor: true, children: [
|
|
37812
37805
|
"```",
|
|
37813
37806
|
" "
|
|
37814
37807
|
] })
|
|
37815
37808
|
] }) : null,
|
|
37816
|
-
!done && /* @__PURE__ */ (0,
|
|
37817
|
-
] });
|
|
37818
|
-
};
|
|
37819
|
-
|
|
37820
|
-
// src/tui/MessageList.tsx
|
|
37821
|
-
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
|
37822
|
-
var MessageList = ({ messages, streaming }) => {
|
|
37823
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
|
|
37824
|
-
messages.map((m, i2) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
|
|
37825
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text, { bold: true, color: m.role === "user" ? "blue" : "green", children: m.role === "user" ? "you" : "kryven" }),
|
|
37826
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Box_default, { paddingLeft: 2, flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Markdown, { text: m.content ?? "" }) })
|
|
37827
|
-
] }, i2)),
|
|
37828
|
-
streaming !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
|
|
37829
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text, { bold: true, color: "green", children: "kryven" }),
|
|
37830
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Box_default, { paddingLeft: 2, flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MarkdownStream, { streamingText: streaming }) })
|
|
37831
|
-
] })
|
|
37809
|
+
!done && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text, { color: "magentaBright", dimColor: true, children: "\u258B" })
|
|
37832
37810
|
] });
|
|
37833
37811
|
};
|
|
37834
37812
|
|
|
@@ -38130,12 +38108,13 @@ var ToolCall = ({
|
|
|
38130
38108
|
truncated,
|
|
38131
38109
|
risk,
|
|
38132
38110
|
renderHint,
|
|
38133
|
-
collapsed = false
|
|
38111
|
+
collapsed = false,
|
|
38112
|
+
paused = false
|
|
38134
38113
|
}) => {
|
|
38135
38114
|
const startRef = (0, import_react25.useRef)(Date.now());
|
|
38136
38115
|
const [elapsed, setElapsed] = (0, import_react25.useState)(0);
|
|
38137
38116
|
(0, import_react25.useEffect)(() => {
|
|
38138
|
-
if (status !== "running") {
|
|
38117
|
+
if (status !== "running" || paused) {
|
|
38139
38118
|
setElapsed(Date.now() - startRef.current);
|
|
38140
38119
|
return;
|
|
38141
38120
|
}
|
|
@@ -38143,7 +38122,7 @@ var ToolCall = ({
|
|
|
38143
38122
|
setElapsed(Date.now() - startRef.current);
|
|
38144
38123
|
}, 100);
|
|
38145
38124
|
return () => clearInterval(id);
|
|
38146
|
-
}, [status]);
|
|
38125
|
+
}, [status, paused]);
|
|
38147
38126
|
const icon = STATUS_ICON[status];
|
|
38148
38127
|
const statusColor = STATUS_COLOR[status];
|
|
38149
38128
|
if (collapsed) {
|
|
@@ -38217,13 +38196,15 @@ var ToolCall = ({
|
|
|
38217
38196
|
};
|
|
38218
38197
|
var ToolCallList = ({
|
|
38219
38198
|
entries,
|
|
38220
|
-
collapseCompleted = false
|
|
38199
|
+
collapseCompleted = false,
|
|
38200
|
+
paused = false
|
|
38221
38201
|
}) => {
|
|
38222
38202
|
if (entries.length === 0) return null;
|
|
38223
38203
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Box_default, { flexDirection: "column", marginBottom: 1, children: entries.map((e) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
38224
38204
|
ToolCall,
|
|
38225
38205
|
{
|
|
38226
38206
|
...e,
|
|
38207
|
+
paused,
|
|
38227
38208
|
collapsed: collapseCompleted && e.status !== "running"
|
|
38228
38209
|
},
|
|
38229
38210
|
e.callId
|
|
@@ -38243,65 +38224,51 @@ var CompletionMenu = ({ items, selected }) => /* @__PURE__ */ (0, import_jsx_run
|
|
|
38243
38224
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { color: "gray", dimColor: true, children: "Tab to complete" })
|
|
38244
38225
|
] });
|
|
38245
38226
|
|
|
38246
|
-
// src/tui/
|
|
38247
|
-
import { opendirSync } from "node:fs";
|
|
38248
|
-
import { join as join26, dirname as dirname12, basename as basename5 } from "node:path";
|
|
38249
|
-
|
|
38250
|
-
// src/commands-palette/builtin/help.tsx
|
|
38227
|
+
// src/tui/ModelPicker.tsx
|
|
38251
38228
|
var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
|
|
38252
|
-
var
|
|
38253
|
-
|
|
38254
|
-
|
|
38255
|
-
|
|
38256
|
-
|
|
38257
|
-
|
|
38258
|
-
})
|
|
38259
|
-
};
|
|
38260
|
-
var HelpPanel = () => {
|
|
38261
|
-
const commands = [...listCommands()].sort(
|
|
38262
|
-
(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))
|
|
38263
38235
|
);
|
|
38264
|
-
|
|
38265
|
-
|
|
38266
|
-
|
|
38267
|
-
|
|
38268
|
-
")
|
|
38269
|
-
|
|
38270
|
-
|
|
38271
|
-
|
|
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,
|
|
38272
38244
|
"/",
|
|
38273
|
-
|
|
38274
|
-
|
|
38275
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Text, { children: [
|
|
38276
|
-
c3.argHint ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Text, { color: "gray", children: [
|
|
38277
|
-
c3.argHint,
|
|
38278
|
-
" "
|
|
38279
|
-
] }) : null,
|
|
38280
|
-
c3.description
|
|
38245
|
+
total,
|
|
38246
|
+
")"
|
|
38281
38247
|
] })
|
|
38282
|
-
] }
|
|
38283
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
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" : " " })
|
|
38284
38269
|
] });
|
|
38285
38270
|
};
|
|
38286
38271
|
|
|
38287
|
-
// src/commands-palette/builtin/clear.ts
|
|
38288
|
-
var clearCommand = {
|
|
38289
|
-
name: "clear",
|
|
38290
|
-
description: "Wipe conversation and start fresh",
|
|
38291
|
-
run: () => ({ type: "clear" })
|
|
38292
|
-
};
|
|
38293
|
-
|
|
38294
|
-
// src/commands-palette/builtin/quit.ts
|
|
38295
|
-
var quitCommand = {
|
|
38296
|
-
name: "quit",
|
|
38297
|
-
description: "Exit",
|
|
38298
|
-
run: () => ({ type: "exit" })
|
|
38299
|
-
};
|
|
38300
|
-
var exitCommand = {
|
|
38301
|
-
...quitCommand,
|
|
38302
|
-
name: "exit"
|
|
38303
|
-
};
|
|
38304
|
-
|
|
38305
38272
|
// src/commands-palette/parser.ts
|
|
38306
38273
|
function parseSlash(input) {
|
|
38307
38274
|
const t = input.trimStart();
|
|
@@ -38376,24 +38343,6 @@ var MODELS = [
|
|
|
38376
38343
|
{ id: "mistral-small-3.2-abliterated", publisher: "fabhaus", description: "Mistral Small 3.2, abliterated" }
|
|
38377
38344
|
];
|
|
38378
38345
|
var KNOWN_IDS = new Set(MODELS.map((m) => m.id));
|
|
38379
|
-
function formatPicker() {
|
|
38380
|
-
const byPub = /* @__PURE__ */ new Map();
|
|
38381
|
-
for (const m of MODELS) {
|
|
38382
|
-
const arr = byPub.get(m.publisher) || [];
|
|
38383
|
-
arr.push(m);
|
|
38384
|
-
byPub.set(m.publisher, arr);
|
|
38385
|
-
}
|
|
38386
|
-
const lines = [];
|
|
38387
|
-
for (const [pub, arr] of byPub) {
|
|
38388
|
-
lines.push(` ${pub}:`);
|
|
38389
|
-
for (const m of arr) {
|
|
38390
|
-
const cost = m.costIn != null && m.costOut != null ? ` $${m.costIn.toFixed(2)}/$${m.costOut.toFixed(2)} per M` : "";
|
|
38391
|
-
const desc = m.description ? ` \u2014 ${m.description}` : "";
|
|
38392
|
-
lines.push(` ${m.id}${cost}${desc}`);
|
|
38393
|
-
}
|
|
38394
|
-
}
|
|
38395
|
-
return lines.join("\n");
|
|
38396
|
-
}
|
|
38397
38346
|
function publisherFor(id) {
|
|
38398
38347
|
return MODELS.find((m) => m.id === id)?.publisher ?? "(unknown)";
|
|
38399
38348
|
}
|
|
@@ -38404,15 +38353,7 @@ var modelCommand = {
|
|
|
38404
38353
|
run: (args, ctx) => {
|
|
38405
38354
|
const trimmed = args.trim();
|
|
38406
38355
|
if (!trimmed) {
|
|
38407
|
-
return {
|
|
38408
|
-
type: "ack",
|
|
38409
|
-
message: `Current: ${ctx.model} (${publisherFor(ctx.model)})
|
|
38410
|
-
|
|
38411
|
-
Available models (${MODELS.length}):
|
|
38412
|
-
` + formatPicker() + `
|
|
38413
|
-
|
|
38414
|
-
Switch with: /model <id-or-substring>`
|
|
38415
|
-
};
|
|
38356
|
+
return { type: "model-picker" };
|
|
38416
38357
|
}
|
|
38417
38358
|
if (KNOWN_IDS.has(trimmed)) {
|
|
38418
38359
|
ctx.setModel(trimmed);
|
|
@@ -38451,8 +38392,96 @@ var moodCommand = {
|
|
|
38451
38392
|
}
|
|
38452
38393
|
};
|
|
38453
38394
|
|
|
38454
|
-
// src/
|
|
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
|
|
38455
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);
|
|
38456
38485
|
var RATES = {
|
|
38457
38486
|
flash: { in: 0.5, out: 4 },
|
|
38458
38487
|
extended: { in: 0.65, out: 7 },
|
|
@@ -38484,7 +38513,7 @@ var costCommand = {
|
|
|
38484
38513
|
description: "Show token usage this session",
|
|
38485
38514
|
run: (_args, ctx) => ({
|
|
38486
38515
|
type: "render",
|
|
38487
|
-
element: /* @__PURE__ */ (0,
|
|
38516
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CostPanel, { ctx })
|
|
38488
38517
|
})
|
|
38489
38518
|
};
|
|
38490
38519
|
var CostPanel = ({ ctx }) => {
|
|
@@ -38501,38 +38530,38 @@ var CostPanel = ({ ctx }) => {
|
|
|
38501
38530
|
const rate = rateFor(ctx.model);
|
|
38502
38531
|
const tierLabel = tierFor(ctx.model);
|
|
38503
38532
|
const usd = sessionCostUsd(ctx.conversation.all(), ctx.model);
|
|
38504
|
-
return /* @__PURE__ */ (0,
|
|
38505
|
-
/* @__PURE__ */ (0,
|
|
38506
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
38507
38536
|
"Model: ",
|
|
38508
|
-
/* @__PURE__ */ (0,
|
|
38537
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: "cyan", children: ctx.model }),
|
|
38509
38538
|
" (tier ",
|
|
38510
38539
|
tierLabel,
|
|
38511
38540
|
")"
|
|
38512
38541
|
] }),
|
|
38513
|
-
/* @__PURE__ */ (0,
|
|
38542
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { children: [
|
|
38514
38543
|
"Messages: ",
|
|
38515
38544
|
ctx.conversation.size()
|
|
38516
38545
|
] }),
|
|
38517
|
-
/* @__PURE__ */ (0,
|
|
38546
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { children: [
|
|
38518
38547
|
"Prompt tokens: ",
|
|
38519
38548
|
promptTok.toLocaleString(),
|
|
38520
38549
|
" \xB7 Completion tokens:",
|
|
38521
38550
|
" ",
|
|
38522
38551
|
completionTok.toLocaleString()
|
|
38523
38552
|
] }),
|
|
38524
|
-
/* @__PURE__ */ (0,
|
|
38553
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { children: [
|
|
38525
38554
|
"Kryven tokens charged: ",
|
|
38526
38555
|
kryvenTok.toLocaleString()
|
|
38527
38556
|
] }),
|
|
38528
|
-
/* @__PURE__ */ (0,
|
|
38557
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { children: [
|
|
38529
38558
|
"Approx USD: ",
|
|
38530
|
-
/* @__PURE__ */ (0,
|
|
38559
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { color: "green", children: [
|
|
38531
38560
|
"$",
|
|
38532
38561
|
usd.toFixed(4)
|
|
38533
38562
|
] })
|
|
38534
38563
|
] }),
|
|
38535
|
-
/* @__PURE__ */ (0,
|
|
38564
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { color: "gray", children: [
|
|
38536
38565
|
"(Rates: $",
|
|
38537
38566
|
rate.in,
|
|
38538
38567
|
"/M in, $",
|
|
@@ -38562,7 +38591,7 @@ function setSkills(skills) {
|
|
|
38562
38591
|
}
|
|
38563
38592
|
|
|
38564
38593
|
// src/commands-palette/builtin/skill.tsx
|
|
38565
|
-
var
|
|
38594
|
+
var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
|
|
38566
38595
|
var skillCommand = {
|
|
38567
38596
|
name: "skill",
|
|
38568
38597
|
description: "Run an installed skill (or list all)",
|
|
@@ -38576,17 +38605,17 @@ var skillCommand = {
|
|
|
38576
38605
|
}
|
|
38577
38606
|
return {
|
|
38578
38607
|
type: "render",
|
|
38579
|
-
element: /* @__PURE__ */ (0,
|
|
38580
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
38581
38610
|
"Skills (",
|
|
38582
38611
|
all.length,
|
|
38583
38612
|
")"
|
|
38584
38613
|
] }),
|
|
38585
|
-
all.map((s2) => /* @__PURE__ */ (0,
|
|
38586
|
-
/* @__PURE__ */ (0,
|
|
38587
|
-
/* @__PURE__ */ (0,
|
|
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 || "" })
|
|
38588
38617
|
] }, s2.name)),
|
|
38589
|
-
/* @__PURE__ */ (0,
|
|
38618
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { color: "gray", children: [
|
|
38590
38619
|
"Run with: /skill ",
|
|
38591
38620
|
"<name>",
|
|
38592
38621
|
" [args]"
|
|
@@ -38816,7 +38845,7 @@ function listAgents() {
|
|
|
38816
38845
|
}
|
|
38817
38846
|
|
|
38818
38847
|
// src/commands-palette/builtin/agent.tsx
|
|
38819
|
-
var
|
|
38848
|
+
var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
|
|
38820
38849
|
var agentCommand = {
|
|
38821
38850
|
name: "agent",
|
|
38822
38851
|
description: "Activate a custom subagent (or list available)",
|
|
@@ -38830,17 +38859,17 @@ var agentCommand = {
|
|
|
38830
38859
|
}
|
|
38831
38860
|
return {
|
|
38832
38861
|
type: "render",
|
|
38833
|
-
element: /* @__PURE__ */ (0,
|
|
38834
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
38835
38864
|
"Custom agents (",
|
|
38836
38865
|
all.length,
|
|
38837
38866
|
")"
|
|
38838
38867
|
] }),
|
|
38839
|
-
all.map((a3) => /* @__PURE__ */ (0,
|
|
38840
|
-
/* @__PURE__ */ (0,
|
|
38841
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
38842
38871
|
] }, a3.name)),
|
|
38843
|
-
/* @__PURE__ */ (0,
|
|
38872
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Text, { color: "gray", children: [
|
|
38844
38873
|
"Activate with: /agent ",
|
|
38845
38874
|
"<name>"
|
|
38846
38875
|
] })
|
|
@@ -38869,7 +38898,7 @@ ${a2.allowedTools.length ? `
|
|
|
38869
38898
|
|
|
38870
38899
|
// src/commands-palette/builtin/diff.tsx
|
|
38871
38900
|
init_execa();
|
|
38872
|
-
var
|
|
38901
|
+
var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
|
|
38873
38902
|
var diffCommand = {
|
|
38874
38903
|
name: "diff",
|
|
38875
38904
|
description: "Show the working-tree git diff (use --stat for a summary)",
|
|
@@ -38898,16 +38927,16 @@ var diffCommand = {
|
|
|
38898
38927
|
const truncated = raw.split("\n").length > 200;
|
|
38899
38928
|
return {
|
|
38900
38929
|
type: "render",
|
|
38901
|
-
element: /* @__PURE__ */ (0,
|
|
38902
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
38903
38932
|
"git diff",
|
|
38904
38933
|
statOnly ? " --stat" : ""
|
|
38905
38934
|
] }),
|
|
38906
38935
|
lines.map((l, i2) => {
|
|
38907
38936
|
const color = l.startsWith("+") && !l.startsWith("+++") ? "green" : l.startsWith("-") && !l.startsWith("---") ? "red" : l.startsWith("@@") ? "cyan" : l.startsWith("diff ") || l.startsWith("index ") ? "yellow" : "gray";
|
|
38908
|
-
return /* @__PURE__ */ (0,
|
|
38937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color, children: l.length > 200 ? l.slice(0, 200) + " \u2026" : l || "\xA0" }, i2);
|
|
38909
38938
|
}),
|
|
38910
|
-
truncated ? /* @__PURE__ */ (0,
|
|
38939
|
+
truncated ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color: "gray", children: "\u2026 (diff truncated)" }) : null
|
|
38911
38940
|
] })
|
|
38912
38941
|
};
|
|
38913
38942
|
}
|
|
@@ -39080,7 +39109,7 @@ function renderRepoMap(map, opts = {}) {
|
|
|
39080
39109
|
}
|
|
39081
39110
|
|
|
39082
39111
|
// src/commands-palette/builtin/map.tsx
|
|
39083
|
-
var
|
|
39112
|
+
var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
|
|
39084
39113
|
var mapCommand = {
|
|
39085
39114
|
name: "map",
|
|
39086
39115
|
description: "Show a symbol map of the current repo (optionally filtered by query)",
|
|
@@ -39097,9 +39126,9 @@ var mapCommand = {
|
|
|
39097
39126
|
const lines = text.split("\n");
|
|
39098
39127
|
return {
|
|
39099
39128
|
type: "render",
|
|
39100
|
-
element: /* @__PURE__ */ (0,
|
|
39101
|
-
/* @__PURE__ */ (0,
|
|
39102
|
-
lines.slice(1).map((l, i2) => /* @__PURE__ */ (0,
|
|
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))
|
|
39103
39132
|
] })
|
|
39104
39133
|
};
|
|
39105
39134
|
}
|
|
@@ -39202,7 +39231,7 @@ async function uninstallSkill(name) {
|
|
|
39202
39231
|
}
|
|
39203
39232
|
|
|
39204
39233
|
// src/commands-palette/builtin/skills.tsx
|
|
39205
|
-
var
|
|
39234
|
+
var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
|
|
39206
39235
|
var SCOPE_COLOR = {
|
|
39207
39236
|
"project-kryven": "cyan",
|
|
39208
39237
|
"project-claude": "cyan",
|
|
@@ -39221,35 +39250,35 @@ var SkillRow = ({ skill }) => {
|
|
|
39221
39250
|
const desc = skill.frontmatter.description || "(no description)";
|
|
39222
39251
|
const scope = SCOPE_LABEL[skill.scope];
|
|
39223
39252
|
const scopeColor = SCOPE_COLOR[skill.scope];
|
|
39224
|
-
return /* @__PURE__ */ (0,
|
|
39225
|
-
/* @__PURE__ */ (0,
|
|
39226
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
39227
39256
|
"[",
|
|
39228
39257
|
scope,
|
|
39229
39258
|
"]"
|
|
39230
39259
|
] }) }),
|
|
39231
|
-
/* @__PURE__ */ (0,
|
|
39260
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { color: "gray", children: desc })
|
|
39232
39261
|
] });
|
|
39233
39262
|
};
|
|
39234
|
-
var SkillList = ({ skills }) => /* @__PURE__ */ (0,
|
|
39235
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
39236
39265
|
"Skills (",
|
|
39237
39266
|
skills.length,
|
|
39238
39267
|
" installed)"
|
|
39239
39268
|
] }),
|
|
39240
|
-
skills.map((s) => /* @__PURE__ */ (0,
|
|
39241
|
-
/* @__PURE__ */ (0,
|
|
39242
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
39243
39272
|
" /skills install ",
|
|
39244
39273
|
"<url|path>",
|
|
39245
39274
|
" \u2014 install a skill from GitHub or local path"
|
|
39246
39275
|
] }),
|
|
39247
|
-
/* @__PURE__ */ (0,
|
|
39276
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Text, { color: "gray", children: [
|
|
39248
39277
|
" /skills uninstall ",
|
|
39249
39278
|
"<name>",
|
|
39250
39279
|
" \u2014 remove a user-installed skill"
|
|
39251
39280
|
] }),
|
|
39252
|
-
/* @__PURE__ */ (0,
|
|
39281
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Text, { color: "gray", children: [
|
|
39253
39282
|
" /skills info ",
|
|
39254
39283
|
"<name>",
|
|
39255
39284
|
" \u2014 show full skill metadata"
|
|
@@ -39272,19 +39301,19 @@ var SkillDetail = ({ skill }) => {
|
|
|
39272
39301
|
["Source", skill.sourcePath]
|
|
39273
39302
|
];
|
|
39274
39303
|
const bodyPreview = skill.body.trim().split("\n").slice(0, 6).join("\n");
|
|
39275
|
-
return /* @__PURE__ */ (0,
|
|
39276
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
39277
39306
|
"Skill: ",
|
|
39278
39307
|
skill.name
|
|
39279
39308
|
] }),
|
|
39280
|
-
rows.map(([k, v]) => /* @__PURE__ */ (0,
|
|
39281
|
-
/* @__PURE__ */ (0,
|
|
39282
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
39283
39312
|
] }, k)),
|
|
39284
|
-
/* @__PURE__ */ (0,
|
|
39285
|
-
/* @__PURE__ */ (0,
|
|
39286
|
-
bodyPreview.split("\n").map((l, i2) => /* @__PURE__ */ (0,
|
|
39287
|
-
skill.body.trim().split("\n").length > 6 && /* @__PURE__ */ (0,
|
|
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: [
|
|
39288
39317
|
"\u2026 (truncated \u2014 ",
|
|
39289
39318
|
skill.body.trim().split("\n").length,
|
|
39290
39319
|
" lines total)"
|
|
@@ -39302,7 +39331,7 @@ function runList() {
|
|
|
39302
39331
|
}
|
|
39303
39332
|
return {
|
|
39304
39333
|
type: "render",
|
|
39305
|
-
element: /* @__PURE__ */ (0,
|
|
39334
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SkillList, { skills: all })
|
|
39306
39335
|
};
|
|
39307
39336
|
}
|
|
39308
39337
|
function runInfo(name) {
|
|
@@ -39315,7 +39344,7 @@ function runInfo(name) {
|
|
|
39315
39344
|
}
|
|
39316
39345
|
return {
|
|
39317
39346
|
type: "render",
|
|
39318
|
-
element: /* @__PURE__ */ (0,
|
|
39347
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SkillDetail, { skill: s })
|
|
39319
39348
|
};
|
|
39320
39349
|
}
|
|
39321
39350
|
async function runInstall(source, cwd2) {
|
|
@@ -39389,7 +39418,7 @@ var skillsCommand = {
|
|
|
39389
39418
|
};
|
|
39390
39419
|
|
|
39391
39420
|
// src/commands-palette/builtin/search.tsx
|
|
39392
|
-
var
|
|
39421
|
+
var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
|
|
39393
39422
|
import { readdir as readdir3, stat as stat2, readFile as readFile3 } from "node:fs/promises";
|
|
39394
39423
|
import { join as join6, relative } from "node:path";
|
|
39395
39424
|
var IGNORE_DIRS = /* @__PURE__ */ new Set([
|
|
@@ -39489,34 +39518,34 @@ async function contentSearch(pattern, cwd2) {
|
|
|
39489
39518
|
}
|
|
39490
39519
|
return { matches, truncated };
|
|
39491
39520
|
}
|
|
39492
|
-
var FileNameResultsPanel = ({ query, results }) => /* @__PURE__ */ (0,
|
|
39493
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
39494
39523
|
results.length,
|
|
39495
39524
|
' file(s) matching "',
|
|
39496
39525
|
query,
|
|
39497
39526
|
'"'
|
|
39498
39527
|
] }),
|
|
39499
|
-
results.map(({ rel }) => /* @__PURE__ */ (0,
|
|
39500
|
-
/* @__PURE__ */ (0,
|
|
39501
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
39502
39531
|
] }, rel))
|
|
39503
39532
|
] });
|
|
39504
|
-
var ContentResultsPanel = ({ pattern, matches, truncated }) => /* @__PURE__ */ (0,
|
|
39505
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
39506
39535
|
matches.length,
|
|
39507
39536
|
" match line(s) for /",
|
|
39508
39537
|
pattern,
|
|
39509
39538
|
"/",
|
|
39510
39539
|
truncated ? " (truncated)" : ""
|
|
39511
39540
|
] }),
|
|
39512
|
-
matches.map(({ rel, line, snippet }, i2) => /* @__PURE__ */ (0,
|
|
39513
|
-
/* @__PURE__ */ (0,
|
|
39514
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
39515
39544
|
":",
|
|
39516
39545
|
line,
|
|
39517
39546
|
": "
|
|
39518
39547
|
] }),
|
|
39519
|
-
/* @__PURE__ */ (0,
|
|
39548
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text, { children: snippet.length > 80 ? snippet.slice(0, 80) + " \u2026" : snippet })
|
|
39520
39549
|
] }, i2))
|
|
39521
39550
|
] });
|
|
39522
39551
|
var searchCommand = {
|
|
@@ -39545,7 +39574,7 @@ var searchCommand = {
|
|
|
39545
39574
|
}
|
|
39546
39575
|
return {
|
|
39547
39576
|
type: "render",
|
|
39548
|
-
element: /* @__PURE__ */ (0,
|
|
39577
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ContentResultsPanel, { pattern, matches, truncated })
|
|
39549
39578
|
};
|
|
39550
39579
|
}
|
|
39551
39580
|
const results = await fileNameSearch(trimmed, ctx.cwd);
|
|
@@ -39554,13 +39583,13 @@ var searchCommand = {
|
|
|
39554
39583
|
}
|
|
39555
39584
|
return {
|
|
39556
39585
|
type: "render",
|
|
39557
|
-
element: /* @__PURE__ */ (0,
|
|
39586
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FileNameResultsPanel, { query: trimmed, results })
|
|
39558
39587
|
};
|
|
39559
39588
|
}
|
|
39560
39589
|
};
|
|
39561
39590
|
|
|
39562
39591
|
// src/commands-palette/builtin/new.tsx
|
|
39563
|
-
var
|
|
39592
|
+
var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
|
|
39564
39593
|
var TEMPLATES = [
|
|
39565
39594
|
{
|
|
39566
39595
|
name: "react",
|
|
@@ -39606,14 +39635,14 @@ var TEMPLATES = [
|
|
|
39606
39635
|
}
|
|
39607
39636
|
];
|
|
39608
39637
|
var TEMPLATE_MAP = new Map(TEMPLATES.map((t) => [t.name, t]));
|
|
39609
|
-
var TemplatePicker = () => /* @__PURE__ */ (0,
|
|
39610
|
-
/* @__PURE__ */ (0,
|
|
39611
|
-
/* @__PURE__ */ (0,
|
|
39612
|
-
/* @__PURE__ */ (0,
|
|
39613
|
-
/* @__PURE__ */ (0,
|
|
39614
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
39615
39644
|
] }, t.name)) }),
|
|
39616
|
-
/* @__PURE__ */ (0,
|
|
39645
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Text, { color: "gray", children: [
|
|
39617
39646
|
"Start with: /new ",
|
|
39618
39647
|
"<name>",
|
|
39619
39648
|
" \xB7 Blank session: /new blank"
|
|
@@ -39628,7 +39657,7 @@ var newCommand = {
|
|
|
39628
39657
|
if (!arg) {
|
|
39629
39658
|
return {
|
|
39630
39659
|
type: "render",
|
|
39631
|
-
element: /* @__PURE__ */ (0,
|
|
39660
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TemplatePicker, {})
|
|
39632
39661
|
};
|
|
39633
39662
|
}
|
|
39634
39663
|
if (arg === "blank") {
|
|
@@ -39738,7 +39767,7 @@ var exportCommand = {
|
|
|
39738
39767
|
|
|
39739
39768
|
// src/commands-palette/builtin/permissions.tsx
|
|
39740
39769
|
init_schema();
|
|
39741
|
-
var
|
|
39770
|
+
var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
|
|
39742
39771
|
import { existsSync as existsSync8, readFileSync as readFileSync6, writeFileSync as writeFileSync3, mkdirSync as mkdirSync3 } from "node:fs";
|
|
39743
39772
|
import { join as join8, dirname as dirname4 } from "node:path";
|
|
39744
39773
|
function settingsPath(cwd2) {
|
|
@@ -39823,14 +39852,14 @@ function resetRules(cwd2) {
|
|
|
39823
39852
|
const next = { ...cfg, permissions: { allow: [], ask: [], deny: [] } };
|
|
39824
39853
|
writeProjectConfig(cwd2, next);
|
|
39825
39854
|
}
|
|
39826
|
-
var BucketSection = ({ label, color, rules, emptyNote }) => /* @__PURE__ */ (0,
|
|
39827
|
-
/* @__PURE__ */ (0,
|
|
39828
|
-
rules.length === 0 ? /* @__PURE__ */ (0,
|
|
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: [
|
|
39829
39858
|
" ",
|
|
39830
39859
|
emptyNote
|
|
39831
|
-
] }) : rules.map((r) => /* @__PURE__ */ (0,
|
|
39860
|
+
] }) : rules.map((r) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Text, { color: "white", children: [
|
|
39832
39861
|
" ",
|
|
39833
|
-
/* @__PURE__ */ (0,
|
|
39862
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color, children: "\u2022" }),
|
|
39834
39863
|
" ",
|
|
39835
39864
|
r
|
|
39836
39865
|
] }, r))
|
|
@@ -39840,7 +39869,7 @@ var PermissionsView = ({
|
|
|
39840
39869
|
ask,
|
|
39841
39870
|
deny,
|
|
39842
39871
|
configPath
|
|
39843
|
-
}) => /* @__PURE__ */ (0,
|
|
39872
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
39844
39873
|
Box_default,
|
|
39845
39874
|
{
|
|
39846
39875
|
flexDirection: "column",
|
|
@@ -39849,10 +39878,10 @@ var PermissionsView = ({
|
|
|
39849
39878
|
paddingX: 1,
|
|
39850
39879
|
paddingY: 0,
|
|
39851
39880
|
children: [
|
|
39852
|
-
/* @__PURE__ */ (0,
|
|
39853
|
-
/* @__PURE__ */ (0,
|
|
39854
|
-
/* @__PURE__ */ (0,
|
|
39855
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
39856
39885
|
BucketSection,
|
|
39857
39886
|
{
|
|
39858
39887
|
label: "allow (auto-approve these tools)",
|
|
@@ -39861,7 +39890,7 @@ var PermissionsView = ({
|
|
|
39861
39890
|
emptyNote: "(none)"
|
|
39862
39891
|
}
|
|
39863
39892
|
),
|
|
39864
|
-
/* @__PURE__ */ (0,
|
|
39893
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
39865
39894
|
BucketSection,
|
|
39866
39895
|
{
|
|
39867
39896
|
label: "ask (always prompt before running)",
|
|
@@ -39870,7 +39899,7 @@ var PermissionsView = ({
|
|
|
39870
39899
|
emptyNote: "(none \u2014 risk model decides)"
|
|
39871
39900
|
}
|
|
39872
39901
|
),
|
|
39873
|
-
/* @__PURE__ */ (0,
|
|
39902
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
39874
39903
|
BucketSection,
|
|
39875
39904
|
{
|
|
39876
39905
|
label: "deny (never run these tools)",
|
|
@@ -39880,20 +39909,20 @@ var PermissionsView = ({
|
|
|
39880
39909
|
}
|
|
39881
39910
|
)
|
|
39882
39911
|
] }),
|
|
39883
|
-
/* @__PURE__ */ (0,
|
|
39884
|
-
/* @__PURE__ */ (0,
|
|
39885
|
-
/* @__PURE__ */ (0,
|
|
39886
|
-
/* @__PURE__ */ (0,
|
|
39887
|
-
/* @__PURE__ */ (0,
|
|
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" })
|
|
39888
39917
|
] }),
|
|
39889
|
-
/* @__PURE__ */ (0,
|
|
39890
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
39891
39920
|
"Manage: /permissions allow|ask|deny ",
|
|
39892
39921
|
"<pattern>",
|
|
39893
39922
|
" \xB7 /permissions rm ",
|
|
39894
39923
|
"<pattern>"
|
|
39895
39924
|
] }),
|
|
39896
|
-
/* @__PURE__ */ (0,
|
|
39925
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: "gray", children: "Reset: /permissions reset --confirm" })
|
|
39897
39926
|
] })
|
|
39898
39927
|
]
|
|
39899
39928
|
}
|
|
@@ -39910,7 +39939,7 @@ var permissionsCommand = {
|
|
|
39910
39939
|
const { allow, ask, deny } = normalizePermissions(cfg);
|
|
39911
39940
|
return {
|
|
39912
39941
|
type: "render",
|
|
39913
|
-
element: /* @__PURE__ */ (0,
|
|
39942
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
39914
39943
|
PermissionsView,
|
|
39915
39944
|
{
|
|
39916
39945
|
allow,
|
|
@@ -39989,7 +40018,7 @@ var permissionsCommand = {
|
|
|
39989
40018
|
};
|
|
39990
40019
|
|
|
39991
40020
|
// src/commands-palette/builtin/agents.tsx
|
|
39992
|
-
var
|
|
40021
|
+
var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
|
|
39993
40022
|
var SCOPE_LABEL2 = {
|
|
39994
40023
|
"project-kryven": "project",
|
|
39995
40024
|
"project-claude": "project",
|
|
@@ -40019,17 +40048,17 @@ var AgentRow = ({ agent }) => {
|
|
|
40019
40048
|
const tagColor = SCOPE_COLOR2[agent.scope] ?? "gray";
|
|
40020
40049
|
const modelNote = agent.model ? ` [${agent.model}]` : "";
|
|
40021
40050
|
const toolNote = agent.allowedTools.length > 0 ? ` \xB7 tools: ${agent.allowedTools.slice(0, 4).join(", ")}${agent.allowedTools.length > 4 ? " \u2026" : ""}` : "";
|
|
40022
|
-
return /* @__PURE__ */ (0,
|
|
40023
|
-
/* @__PURE__ */ (0,
|
|
40024
|
-
/* @__PURE__ */ (0,
|
|
40025
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
40026
40055
|
"[",
|
|
40027
40056
|
scopeTag(agent),
|
|
40028
40057
|
"]"
|
|
40029
40058
|
] }),
|
|
40030
|
-
/* @__PURE__ */ (0,
|
|
40059
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: "gray", children: modelNote })
|
|
40031
40060
|
] }),
|
|
40032
|
-
agent.description || toolNote ? /* @__PURE__ */ (0,
|
|
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: [
|
|
40033
40062
|
agent.description || "",
|
|
40034
40063
|
toolNote
|
|
40035
40064
|
] }) }) : null
|
|
@@ -40037,7 +40066,7 @@ var AgentRow = ({ agent }) => {
|
|
|
40037
40066
|
};
|
|
40038
40067
|
var BrowserPanel = ({ agents }) => {
|
|
40039
40068
|
const groups = groupByScope(agents);
|
|
40040
|
-
return /* @__PURE__ */ (0,
|
|
40069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
40041
40070
|
Box_default,
|
|
40042
40071
|
{
|
|
40043
40072
|
flexDirection: "column",
|
|
@@ -40045,30 +40074,30 @@ var BrowserPanel = ({ agents }) => {
|
|
|
40045
40074
|
borderColor: "magentaBright",
|
|
40046
40075
|
paddingX: 1,
|
|
40047
40076
|
children: [
|
|
40048
|
-
/* @__PURE__ */ (0,
|
|
40077
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { bold: true, color: "magentaBright", children: [
|
|
40049
40078
|
"Custom agents (",
|
|
40050
40079
|
agents.length,
|
|
40051
40080
|
")"
|
|
40052
40081
|
] }),
|
|
40053
|
-
[...groups.entries()].map(([label, group]) => /* @__PURE__ */ (0,
|
|
40054
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
40055
40084
|
label,
|
|
40056
40085
|
" scope (",
|
|
40057
40086
|
group.length,
|
|
40058
40087
|
")"
|
|
40059
40088
|
] }),
|
|
40060
|
-
group.map((a2) => /* @__PURE__ */ (0,
|
|
40089
|
+
group.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AgentRow, { agent: a2 }, a2.name))
|
|
40061
40090
|
] }, label)),
|
|
40062
|
-
/* @__PURE__ */ (0,
|
|
40063
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
40064
40093
|
"Activate: /agents ",
|
|
40065
40094
|
"<name>"
|
|
40066
40095
|
] }),
|
|
40067
|
-
/* @__PURE__ */ (0,
|
|
40096
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { color: "gray", children: [
|
|
40068
40097
|
"Inspect: /agents --info ",
|
|
40069
40098
|
"<name>"
|
|
40070
40099
|
] }),
|
|
40071
|
-
/* @__PURE__ */ (0,
|
|
40100
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { color: "gray", children: [
|
|
40072
40101
|
"Drop agents at .kryven/agents/",
|
|
40073
40102
|
"<name>",
|
|
40074
40103
|
".md or ~/.kryven/agents/",
|
|
@@ -40083,7 +40112,7 @@ var BrowserPanel = ({ agents }) => {
|
|
|
40083
40112
|
var InfoPanel = ({ agent }) => {
|
|
40084
40113
|
const promptLines = agent.systemPrompt.split("\n").slice(0, 20);
|
|
40085
40114
|
const truncated = agent.systemPrompt.split("\n").length > 20;
|
|
40086
|
-
return /* @__PURE__ */ (0,
|
|
40115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
40087
40116
|
Box_default,
|
|
40088
40117
|
{
|
|
40089
40118
|
flexDirection: "column",
|
|
@@ -40091,36 +40120,36 @@ var InfoPanel = ({ agent }) => {
|
|
|
40091
40120
|
borderColor: "magentaBright",
|
|
40092
40121
|
paddingX: 1,
|
|
40093
40122
|
children: [
|
|
40094
|
-
/* @__PURE__ */ (0,
|
|
40123
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { bold: true, color: "magentaBright", children: [
|
|
40095
40124
|
"Agent: ",
|
|
40096
40125
|
agent.name
|
|
40097
40126
|
] }),
|
|
40098
|
-
/* @__PURE__ */ (0,
|
|
40099
|
-
/* @__PURE__ */ (0,
|
|
40100
|
-
/* @__PURE__ */ (0,
|
|
40101
|
-
/* @__PURE__ */ (0,
|
|
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) })
|
|
40102
40131
|
] }),
|
|
40103
|
-
/* @__PURE__ */ (0,
|
|
40104
|
-
/* @__PURE__ */ (0,
|
|
40105
|
-
/* @__PURE__ */ (0,
|
|
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)" })
|
|
40106
40135
|
] }),
|
|
40107
|
-
/* @__PURE__ */ (0,
|
|
40108
|
-
/* @__PURE__ */ (0,
|
|
40109
|
-
/* @__PURE__ */ (0,
|
|
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)" })
|
|
40110
40139
|
] }),
|
|
40111
|
-
/* @__PURE__ */ (0,
|
|
40112
|
-
/* @__PURE__ */ (0,
|
|
40113
|
-
/* @__PURE__ */ (0,
|
|
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)" })
|
|
40114
40143
|
] }),
|
|
40115
|
-
/* @__PURE__ */ (0,
|
|
40116
|
-
/* @__PURE__ */ (0,
|
|
40117
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
40118
40147
|
] })
|
|
40119
40148
|
] }),
|
|
40120
|
-
/* @__PURE__ */ (0,
|
|
40121
|
-
/* @__PURE__ */ (0,
|
|
40122
|
-
promptLines.map((line, i2) => /* @__PURE__ */ (0,
|
|
40123
|
-
truncated ? /* @__PURE__ */ (0,
|
|
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: [
|
|
40124
40153
|
"\u2026 (truncated \u2014 ",
|
|
40125
40154
|
agent.systemPrompt.split("\n").length,
|
|
40126
40155
|
" lines total)"
|
|
@@ -40146,7 +40175,7 @@ var agentsCommand = {
|
|
|
40146
40175
|
}
|
|
40147
40176
|
return {
|
|
40148
40177
|
type: "render",
|
|
40149
|
-
element: /* @__PURE__ */ (0,
|
|
40178
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(BrowserPanel, { agents: all })
|
|
40150
40179
|
};
|
|
40151
40180
|
}
|
|
40152
40181
|
if (trimmed.startsWith("--info")) {
|
|
@@ -40163,7 +40192,7 @@ var agentsCommand = {
|
|
|
40163
40192
|
}
|
|
40164
40193
|
return {
|
|
40165
40194
|
type: "render",
|
|
40166
|
-
element: /* @__PURE__ */ (0,
|
|
40195
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(InfoPanel, { agent: a3 })
|
|
40167
40196
|
};
|
|
40168
40197
|
}
|
|
40169
40198
|
const [name, ...rest] = trimmed.split(/\s+/);
|
|
@@ -40307,7 +40336,7 @@ async function setAuthHeader(id, authHeader) {
|
|
|
40307
40336
|
}
|
|
40308
40337
|
|
|
40309
40338
|
// src/commands-palette/builtin/about.tsx
|
|
40310
|
-
var
|
|
40339
|
+
var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
|
|
40311
40340
|
var CLI_VERSION = "0.1.1";
|
|
40312
40341
|
var CLI_NAME = "@kryvenaiofficial/kryven";
|
|
40313
40342
|
var AboutPanel = ({ ctx }) => {
|
|
@@ -40332,9 +40361,9 @@ var AboutPanel = ({ ctx }) => {
|
|
|
40332
40361
|
const rows = [
|
|
40333
40362
|
[
|
|
40334
40363
|
"CLI",
|
|
40335
|
-
/* @__PURE__ */ (0,
|
|
40336
|
-
/* @__PURE__ */ (0,
|
|
40337
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
40338
40367
|
" v",
|
|
40339
40368
|
CLI_VERSION
|
|
40340
40369
|
] })
|
|
@@ -40342,31 +40371,31 @@ var AboutPanel = ({ ctx }) => {
|
|
|
40342
40371
|
],
|
|
40343
40372
|
[
|
|
40344
40373
|
"Model",
|
|
40345
|
-
/* @__PURE__ */ (0,
|
|
40374
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "cyan", children: ctx.model }, "model")
|
|
40346
40375
|
],
|
|
40347
40376
|
[
|
|
40348
40377
|
"Mood",
|
|
40349
|
-
/* @__PURE__ */ (0,
|
|
40378
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: "cyan", children: ctx.mood }, "mood")
|
|
40350
40379
|
],
|
|
40351
40380
|
[
|
|
40352
40381
|
"Skills",
|
|
40353
|
-
/* @__PURE__ */ (0,
|
|
40354
|
-
/* @__PURE__ */ (0,
|
|
40355
|
-
/* @__PURE__ */ (0,
|
|
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" })
|
|
40356
40385
|
] }) }, "skills")
|
|
40357
40386
|
],
|
|
40358
40387
|
[
|
|
40359
40388
|
"Agents",
|
|
40360
|
-
/* @__PURE__ */ (0,
|
|
40361
|
-
/* @__PURE__ */ (0,
|
|
40362
|
-
/* @__PURE__ */ (0,
|
|
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" })
|
|
40363
40392
|
] }) }, "agents")
|
|
40364
40393
|
],
|
|
40365
40394
|
[
|
|
40366
40395
|
"Permissions",
|
|
40367
|
-
/* @__PURE__ */ (0,
|
|
40368
|
-
/* @__PURE__ */ (0,
|
|
40369
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
40370
40399
|
" \u2014 ",
|
|
40371
40400
|
permDesc
|
|
40372
40401
|
] })
|
|
@@ -40374,9 +40403,9 @@ var AboutPanel = ({ ctx }) => {
|
|
|
40374
40403
|
],
|
|
40375
40404
|
[
|
|
40376
40405
|
"MCP servers",
|
|
40377
|
-
data === null ? /* @__PURE__ */ (0,
|
|
40378
|
-
/* @__PURE__ */ (0,
|
|
40379
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
40380
40409
|
" enabled / ",
|
|
40381
40410
|
data.mcpCount,
|
|
40382
40411
|
" configured"
|
|
@@ -40385,15 +40414,15 @@ var AboutPanel = ({ ctx }) => {
|
|
|
40385
40414
|
],
|
|
40386
40415
|
[
|
|
40387
40416
|
"Session",
|
|
40388
|
-
/* @__PURE__ */ (0,
|
|
40389
|
-
/* @__PURE__ */ (0,
|
|
40390
|
-
/* @__PURE__ */ (0,
|
|
40391
|
-
/* @__PURE__ */ (0,
|
|
40392
|
-
/* @__PURE__ */ (0,
|
|
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" })
|
|
40393
40422
|
] }, "session")
|
|
40394
40423
|
]
|
|
40395
40424
|
];
|
|
40396
|
-
return /* @__PURE__ */ (0,
|
|
40425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
40397
40426
|
Box_default,
|
|
40398
40427
|
{
|
|
40399
40428
|
flexDirection: "column",
|
|
@@ -40401,12 +40430,12 @@ var AboutPanel = ({ ctx }) => {
|
|
|
40401
40430
|
borderColor: "magenta",
|
|
40402
40431
|
paddingX: 1,
|
|
40403
40432
|
children: [
|
|
40404
|
-
/* @__PURE__ */ (0,
|
|
40405
|
-
/* @__PURE__ */ (0,
|
|
40406
|
-
/* @__PURE__ */ (0,
|
|
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 }) }),
|
|
40407
40436
|
value
|
|
40408
40437
|
] }, label)) }),
|
|
40409
|
-
/* @__PURE__ */ (0,
|
|
40438
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { color: "gray", children: [
|
|
40410
40439
|
"cwd ",
|
|
40411
40440
|
ctx.cwd
|
|
40412
40441
|
] }) })
|
|
@@ -40419,7 +40448,7 @@ var aboutCommand = {
|
|
|
40419
40448
|
description: "Show CLI version, model, skills, agents, permissions, and MCP server count",
|
|
40420
40449
|
run: (_args, ctx) => ({
|
|
40421
40450
|
type: "render",
|
|
40422
|
-
element: /* @__PURE__ */ (0,
|
|
40451
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(AboutPanel, { ctx })
|
|
40423
40452
|
})
|
|
40424
40453
|
};
|
|
40425
40454
|
|
|
@@ -40616,22 +40645,22 @@ function getThemeManager() {
|
|
|
40616
40645
|
|
|
40617
40646
|
// src/commands-palette/builtin/theme.tsx
|
|
40618
40647
|
init_load();
|
|
40619
|
-
var
|
|
40648
|
+
var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
|
|
40620
40649
|
var ThemePanel = ({
|
|
40621
40650
|
entries,
|
|
40622
40651
|
current
|
|
40623
|
-
}) => /* @__PURE__ */ (0,
|
|
40624
|
-
/* @__PURE__ */ (0,
|
|
40625
|
-
entries.map((e) => /* @__PURE__ */ (0,
|
|
40626
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
40627
40656
|
e.active ? "\u25B6 " : " ",
|
|
40628
40657
|
e.name
|
|
40629
40658
|
] }) }),
|
|
40630
|
-
/* @__PURE__ */ (0,
|
|
40659
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "gray", children: e.accent })
|
|
40631
40660
|
] }, e.name)),
|
|
40632
|
-
/* @__PURE__ */ (0,
|
|
40661
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: "gray", children: [
|
|
40633
40662
|
"Active: ",
|
|
40634
|
-
/* @__PURE__ */ (0,
|
|
40663
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: "magentaBright", children: current }),
|
|
40635
40664
|
" \xB7 ",
|
|
40636
40665
|
"/theme ",
|
|
40637
40666
|
"<name>",
|
|
@@ -40655,7 +40684,7 @@ var themeCommand = {
|
|
|
40655
40684
|
}));
|
|
40656
40685
|
return {
|
|
40657
40686
|
type: "render",
|
|
40658
|
-
element: /* @__PURE__ */ (0,
|
|
40687
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ThemePanel, { entries, current: current.name })
|
|
40659
40688
|
};
|
|
40660
40689
|
}
|
|
40661
40690
|
if (trimmed === "cycle") {
|
|
@@ -40706,7 +40735,7 @@ var themeCommand = {
|
|
|
40706
40735
|
};
|
|
40707
40736
|
|
|
40708
40737
|
// src/commands-palette/builtin/file.tsx
|
|
40709
|
-
var
|
|
40738
|
+
var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
|
|
40710
40739
|
import * as fs3 from "node:fs";
|
|
40711
40740
|
import * as path7 from "node:path";
|
|
40712
40741
|
var IGNORED_DIRS = /* @__PURE__ */ new Set([
|
|
@@ -40808,11 +40837,11 @@ function extColor(relPath) {
|
|
|
40808
40837
|
if ([".py", ".rb", ".go", ".rs"].includes(ext)) return "blue";
|
|
40809
40838
|
return "gray";
|
|
40810
40839
|
}
|
|
40811
|
-
var TreePanel = ({ entries, truncated, cwd: cwd2 }) => /* @__PURE__ */ (0,
|
|
40812
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
40813
40842
|
path7.basename(cwd2),
|
|
40814
40843
|
"/ ",
|
|
40815
|
-
/* @__PURE__ */ (0,
|
|
40844
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "gray", children: [
|
|
40816
40845
|
"(",
|
|
40817
40846
|
entries.length,
|
|
40818
40847
|
" entries)"
|
|
@@ -40823,21 +40852,21 @@ var TreePanel = ({ entries, truncated, cwd: cwd2 }) => /* @__PURE__ */ (0, impor
|
|
|
40823
40852
|
const indent = " ".repeat(depth);
|
|
40824
40853
|
const name = path7.basename(e.relPath);
|
|
40825
40854
|
if (e.isDir) {
|
|
40826
|
-
return /* @__PURE__ */ (0,
|
|
40855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "magenta", children: [
|
|
40827
40856
|
indent,
|
|
40828
|
-
/* @__PURE__ */ (0,
|
|
40857
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { bold: true, children: [
|
|
40829
40858
|
name,
|
|
40830
40859
|
"/"
|
|
40831
40860
|
] })
|
|
40832
40861
|
] }, e.relPath);
|
|
40833
40862
|
}
|
|
40834
40863
|
const color = extColor(e.relPath);
|
|
40835
|
-
return /* @__PURE__ */ (0,
|
|
40836
|
-
/* @__PURE__ */ (0,
|
|
40864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Box_default, { children: [
|
|
40865
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color, children: [
|
|
40837
40866
|
indent,
|
|
40838
40867
|
name
|
|
40839
40868
|
] }),
|
|
40840
|
-
/* @__PURE__ */ (0,
|
|
40869
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "gray", children: [
|
|
40841
40870
|
" ",
|
|
40842
40871
|
formatSize(e.size),
|
|
40843
40872
|
" ",
|
|
@@ -40845,58 +40874,58 @@ var TreePanel = ({ entries, truncated, cwd: cwd2 }) => /* @__PURE__ */ (0, impor
|
|
|
40845
40874
|
] })
|
|
40846
40875
|
] }, e.relPath);
|
|
40847
40876
|
}),
|
|
40848
|
-
truncated ? /* @__PURE__ */ (0,
|
|
40877
|
+
truncated ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "gray", children: [
|
|
40849
40878
|
"\u2026 (more files \u2014 use /file ",
|
|
40850
40879
|
"<glob>",
|
|
40851
40880
|
" to filter)"
|
|
40852
40881
|
] }) : null,
|
|
40853
|
-
/* @__PURE__ */ (0,
|
|
40882
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "gray", children: [
|
|
40854
40883
|
"Run ",
|
|
40855
|
-
/* @__PURE__ */ (0,
|
|
40884
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "cyan", children: [
|
|
40856
40885
|
"/file ",
|
|
40857
40886
|
"<glob>"
|
|
40858
40887
|
] }),
|
|
40859
40888
|
" to filter \xB7",
|
|
40860
40889
|
" ",
|
|
40861
|
-
/* @__PURE__ */ (0,
|
|
40890
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "cyan", children: [
|
|
40862
40891
|
"/file ",
|
|
40863
40892
|
"<path>"
|
|
40864
40893
|
] }),
|
|
40865
40894
|
" to read a file"
|
|
40866
40895
|
] })
|
|
40867
40896
|
] });
|
|
40868
|
-
var MatchPanel = ({ entries, pattern, truncated }) => /* @__PURE__ */ (0,
|
|
40869
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
40870
40899
|
"Matches for ",
|
|
40871
|
-
/* @__PURE__ */ (0,
|
|
40900
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { color: "cyan", children: pattern }),
|
|
40872
40901
|
" ",
|
|
40873
|
-
/* @__PURE__ */ (0,
|
|
40902
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "gray", children: [
|
|
40874
40903
|
"(",
|
|
40875
40904
|
entries.length,
|
|
40876
40905
|
truncated ? "+" : "",
|
|
40877
40906
|
" results)"
|
|
40878
40907
|
] })
|
|
40879
40908
|
] }),
|
|
40880
|
-
entries.map((e) => /* @__PURE__ */ (0,
|
|
40881
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
40882
40911
|
e.relPath,
|
|
40883
40912
|
e.isDir ? "/" : ""
|
|
40884
40913
|
] }) }),
|
|
40885
|
-
!e.isDir && /* @__PURE__ */ (0,
|
|
40914
|
+
!e.isDir && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "gray", children: [
|
|
40886
40915
|
formatSize(e.size),
|
|
40887
40916
|
" ",
|
|
40888
40917
|
formatAge(e.mtime)
|
|
40889
40918
|
] })
|
|
40890
40919
|
] }, e.relPath)),
|
|
40891
|
-
truncated ? /* @__PURE__ */ (0,
|
|
40920
|
+
truncated ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { color: "gray", children: "\u2026 (truncated to 80)" }) : null
|
|
40892
40921
|
] });
|
|
40893
40922
|
var FilePanel = ({ relPath, lines, truncated, totalLines }) => {
|
|
40894
40923
|
const color = extColor(relPath);
|
|
40895
|
-
return /* @__PURE__ */ (0,
|
|
40896
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
40897
40926
|
relPath,
|
|
40898
40927
|
" ",
|
|
40899
|
-
/* @__PURE__ */ (0,
|
|
40928
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "gray", children: [
|
|
40900
40929
|
"(",
|
|
40901
40930
|
totalLines,
|
|
40902
40931
|
" lines",
|
|
@@ -40904,14 +40933,14 @@ var FilePanel = ({ relPath, lines, truncated, totalLines }) => {
|
|
|
40904
40933
|
")"
|
|
40905
40934
|
] })
|
|
40906
40935
|
] }),
|
|
40907
|
-
lines.map((l, i2) => /* @__PURE__ */ (0,
|
|
40908
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
40909
40938
|
String(i2 + 1).padStart(4),
|
|
40910
40939
|
" "
|
|
40911
40940
|
] }) }),
|
|
40912
|
-
/* @__PURE__ */ (0,
|
|
40941
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { color, children: l.length > 160 ? l.slice(0, 160) + " \u2026" : l })
|
|
40913
40942
|
] }, i2)),
|
|
40914
|
-
truncated ? /* @__PURE__ */ (0,
|
|
40943
|
+
truncated ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "gray", children: [
|
|
40915
40944
|
"\u2026 (truncated \u2014 only first ",
|
|
40916
40945
|
lines.length,
|
|
40917
40946
|
" lines shown)"
|
|
@@ -40931,7 +40960,7 @@ var openCommand = {
|
|
|
40931
40960
|
const truncated2 = entries.length >= MAX_ITEMS;
|
|
40932
40961
|
return {
|
|
40933
40962
|
type: "render",
|
|
40934
|
-
element: /* @__PURE__ */ (0,
|
|
40963
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TreePanel, { entries, truncated: truncated2, cwd: ctx.cwd })
|
|
40935
40964
|
};
|
|
40936
40965
|
}
|
|
40937
40966
|
const resolved = path7.isAbsolute(input) ? input : path7.join(ctx.cwd, input);
|
|
@@ -40949,7 +40978,7 @@ var openCommand = {
|
|
|
40949
40978
|
const relPath = path7.relative(ctx.cwd, resolved) || input;
|
|
40950
40979
|
return {
|
|
40951
40980
|
type: "render",
|
|
40952
|
-
element: /* @__PURE__ */ (0,
|
|
40981
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
40953
40982
|
FilePanel,
|
|
40954
40983
|
{
|
|
40955
40984
|
relPath,
|
|
@@ -40967,7 +40996,7 @@ var openCommand = {
|
|
|
40967
40996
|
const truncated2 = entries.length >= MAX_ITEMS;
|
|
40968
40997
|
return {
|
|
40969
40998
|
type: "render",
|
|
40970
|
-
element: /* @__PURE__ */ (0,
|
|
40999
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TreePanel, { entries, truncated: truncated2, cwd: resolved })
|
|
40971
41000
|
};
|
|
40972
41001
|
}
|
|
40973
41002
|
const MAX_GLOB_ITEMS = 300;
|
|
@@ -40988,14 +41017,14 @@ var openCommand = {
|
|
|
40988
41017
|
const truncated = matched.length >= MAX_RESULTS;
|
|
40989
41018
|
return {
|
|
40990
41019
|
type: "render",
|
|
40991
|
-
element: /* @__PURE__ */ (0,
|
|
41020
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(MatchPanel, { entries: matched, pattern: input, truncated })
|
|
40992
41021
|
};
|
|
40993
41022
|
}
|
|
40994
41023
|
};
|
|
40995
41024
|
|
|
40996
41025
|
// src/commands-palette/builtin/sessions.tsx
|
|
40997
41026
|
init_defaults();
|
|
40998
|
-
var
|
|
41027
|
+
var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
|
|
40999
41028
|
import { readdir as readdir5, readFile as readFile6, unlink, stat as stat3 } from "node:fs/promises";
|
|
41000
41029
|
import { join as join12, basename as basename4 } from "node:path";
|
|
41001
41030
|
function fmtDate(ms) {
|
|
@@ -41037,32 +41066,32 @@ async function loadSessionFiles() {
|
|
|
41037
41066
|
metas.sort((a2, b) => b.mtimeMs - a2.mtimeMs);
|
|
41038
41067
|
return metas;
|
|
41039
41068
|
}
|
|
41040
|
-
var SessionListPanel = ({ sessions, dir }) => /* @__PURE__ */ (0,
|
|
41041
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
41042
41071
|
"Saved sessions (",
|
|
41043
41072
|
sessions.length,
|
|
41044
41073
|
") \u2014 ",
|
|
41045
41074
|
dir
|
|
41046
41075
|
] }),
|
|
41047
|
-
sessions.length === 0 ? /* @__PURE__ */ (0,
|
|
41048
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
41049
41078
|
String(i2 + 1).padStart(2),
|
|
41050
41079
|
"."
|
|
41051
41080
|
] }) }),
|
|
41052
|
-
/* @__PURE__ */ (0,
|
|
41053
|
-
/* @__PURE__ */ (0,
|
|
41054
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
41055
41084
|
s.messageCount,
|
|
41056
41085
|
"msg"
|
|
41057
41086
|
] }) }),
|
|
41058
|
-
/* @__PURE__ */ (0,
|
|
41087
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: "gray", dimColor: true, children: fmtSize(s.sizeBytes) })
|
|
41059
41088
|
] }, s.filename)) }),
|
|
41060
|
-
/* @__PURE__ */ (0,
|
|
41061
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
41062
41091
|
"Load: /sessions load ",
|
|
41063
41092
|
"<filename>"
|
|
41064
41093
|
] }),
|
|
41065
|
-
/* @__PURE__ */ (0,
|
|
41094
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: "gray", children: "Clear: /sessions clear" })
|
|
41066
41095
|
] })
|
|
41067
41096
|
] });
|
|
41068
41097
|
var sessionsCommand = {
|
|
@@ -41166,21 +41195,21 @@ Failed to delete: ${errs.join(", ")}` : "";
|
|
|
41166
41195
|
const metas = await loadSessionFiles();
|
|
41167
41196
|
return {
|
|
41168
41197
|
type: "render",
|
|
41169
|
-
element: /* @__PURE__ */ (0,
|
|
41198
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SessionListPanel, { sessions: metas, dir })
|
|
41170
41199
|
};
|
|
41171
41200
|
}
|
|
41172
41201
|
};
|
|
41173
41202
|
|
|
41174
41203
|
// src/commands-palette/builtin/commands.tsx
|
|
41175
|
-
var
|
|
41176
|
-
var CommandItem = ({ row }) => /* @__PURE__ */ (0,
|
|
41177
|
-
/* @__PURE__ */ (0,
|
|
41178
|
-
/* @__PURE__ */ (0,
|
|
41179
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
41180
41209
|
] });
|
|
41181
41210
|
var CommandsPanel = ({ rows, filter, total }) => {
|
|
41182
41211
|
const heading = filter ? `Commands matching "${filter}" (${rows.length} of ${total})` : `All commands (${rows.length})`;
|
|
41183
|
-
return /* @__PURE__ */ (0,
|
|
41212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
41184
41213
|
Box_default,
|
|
41185
41214
|
{
|
|
41186
41215
|
flexDirection: "column",
|
|
@@ -41188,9 +41217,9 @@ var CommandsPanel = ({ rows, filter, total }) => {
|
|
|
41188
41217
|
borderColor: "magenta",
|
|
41189
41218
|
paddingX: 1,
|
|
41190
41219
|
children: [
|
|
41191
|
-
/* @__PURE__ */ (0,
|
|
41192
|
-
/* @__PURE__ */ (0,
|
|
41193
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
41194
41223
|
"Use /commands ",
|
|
41195
41224
|
"<filter>",
|
|
41196
41225
|
" to search \xB7 /help for quick reference"
|
|
@@ -41232,7 +41261,7 @@ var commandsCommand = {
|
|
|
41232
41261
|
}
|
|
41233
41262
|
return {
|
|
41234
41263
|
type: "render",
|
|
41235
|
-
element: /* @__PURE__ */ (0,
|
|
41264
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CommandsPanel, { rows: filtered, filter, total: allRows.length })
|
|
41236
41265
|
};
|
|
41237
41266
|
}
|
|
41238
41267
|
};
|
|
@@ -41352,7 +41381,7 @@ function getKeybindings() {
|
|
|
41352
41381
|
}
|
|
41353
41382
|
|
|
41354
41383
|
// src/commands-palette/builtin/keybindings.tsx
|
|
41355
|
-
var
|
|
41384
|
+
var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
|
|
41356
41385
|
var KB_PATH2 = join14(homedir8(), ".kryven", "keybindings.json");
|
|
41357
41386
|
var VALID_ACTIONS = /* @__PURE__ */ new Set([
|
|
41358
41387
|
"clear",
|
|
@@ -41374,7 +41403,7 @@ async function saveToDisk(bindings) {
|
|
|
41374
41403
|
{ mode: 384 }
|
|
41375
41404
|
);
|
|
41376
41405
|
}
|
|
41377
|
-
var BindingsPanel = ({ bindings }) => /* @__PURE__ */ (0,
|
|
41406
|
+
var BindingsPanel = ({ bindings }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
41378
41407
|
Box_default,
|
|
41379
41408
|
{
|
|
41380
41409
|
flexDirection: "column",
|
|
@@ -41382,21 +41411,21 @@ var BindingsPanel = ({ bindings }) => /* @__PURE__ */ (0, import_jsx_runtime25.j
|
|
|
41382
41411
|
borderColor: "magenta",
|
|
41383
41412
|
paddingX: 1,
|
|
41384
41413
|
children: [
|
|
41385
|
-
/* @__PURE__ */ (0,
|
|
41414
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { bold: true, color: "magentaBright", children: [
|
|
41386
41415
|
"Keybindings (",
|
|
41387
41416
|
bindings.length,
|
|
41388
41417
|
")"
|
|
41389
41418
|
] }),
|
|
41390
|
-
/* @__PURE__ */ (0,
|
|
41391
|
-
/* @__PURE__ */ (0,
|
|
41392
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
41393
41422
|
] }, b.key)) }),
|
|
41394
|
-
/* @__PURE__ */ (0,
|
|
41395
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
41396
41425
|
"File: ",
|
|
41397
41426
|
KB_PATH2
|
|
41398
41427
|
] }),
|
|
41399
|
-
/* @__PURE__ */ (0,
|
|
41428
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: "gray", children: [
|
|
41400
41429
|
"/keybindings set ",
|
|
41401
41430
|
"<key>",
|
|
41402
41431
|
" ",
|
|
@@ -41405,12 +41434,12 @@ var BindingsPanel = ({ bindings }) => /* @__PURE__ */ (0, import_jsx_runtime25.j
|
|
|
41405
41434
|
"<key>",
|
|
41406
41435
|
" \xB7 /keybindings reset --confirm"
|
|
41407
41436
|
] }),
|
|
41408
|
-
/* @__PURE__ */ (0,
|
|
41437
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { color: "gray", children: "/keybindings actions \u2014 list valid action names" })
|
|
41409
41438
|
] })
|
|
41410
41439
|
]
|
|
41411
41440
|
}
|
|
41412
41441
|
);
|
|
41413
|
-
var ActionsPanel = () => /* @__PURE__ */ (0,
|
|
41442
|
+
var ActionsPanel = () => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
41414
41443
|
Box_default,
|
|
41415
41444
|
{
|
|
41416
41445
|
flexDirection: "column",
|
|
@@ -41418,12 +41447,12 @@ var ActionsPanel = () => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
|
41418
41447
|
borderColor: "magenta",
|
|
41419
41448
|
paddingX: 1,
|
|
41420
41449
|
children: [
|
|
41421
|
-
/* @__PURE__ */ (0,
|
|
41450
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { bold: true, color: "magentaBright", children: [
|
|
41422
41451
|
"Valid actions (",
|
|
41423
41452
|
VALID_ACTIONS.size,
|
|
41424
41453
|
")"
|
|
41425
41454
|
] }),
|
|
41426
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
41427
41456
|
" ",
|
|
41428
41457
|
a2
|
|
41429
41458
|
] }, a2)) })
|
|
@@ -41441,7 +41470,7 @@ var keybindingsCommand = {
|
|
|
41441
41470
|
const bindings = getKeybindings().list();
|
|
41442
41471
|
return {
|
|
41443
41472
|
type: "render",
|
|
41444
|
-
element: /* @__PURE__ */ (0,
|
|
41473
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(BindingsPanel, { bindings })
|
|
41445
41474
|
};
|
|
41446
41475
|
}
|
|
41447
41476
|
if (sub === "path") {
|
|
@@ -41450,7 +41479,7 @@ var keybindingsCommand = {
|
|
|
41450
41479
|
if (sub === "actions") {
|
|
41451
41480
|
return {
|
|
41452
41481
|
type: "render",
|
|
41453
|
-
element: /* @__PURE__ */ (0,
|
|
41482
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ActionsPanel, {})
|
|
41454
41483
|
};
|
|
41455
41484
|
}
|
|
41456
41485
|
if (sub === "reset") {
|
|
@@ -41680,7 +41709,7 @@ Preview: ${preview}`
|
|
|
41680
41709
|
|
|
41681
41710
|
// src/commands-palette/builtin/memory.tsx
|
|
41682
41711
|
init_defaults();
|
|
41683
|
-
var
|
|
41712
|
+
var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
|
|
41684
41713
|
import { readFile as readFile8, writeFile as writeFile6, mkdir as mkdir7 } from "node:fs/promises";
|
|
41685
41714
|
import { join as join16, dirname as dirname8 } from "node:path";
|
|
41686
41715
|
function getMemoryPath() {
|
|
@@ -41710,7 +41739,7 @@ function fmtDate2(ts) {
|
|
|
41710
41739
|
const pad = (n2) => String(n2).padStart(2, "0");
|
|
41711
41740
|
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}`;
|
|
41712
41741
|
}
|
|
41713
|
-
var NoteListPanel = ({ notes, path: path9 }) => /* @__PURE__ */ (0,
|
|
41742
|
+
var NoteListPanel = ({ notes, path: path9 }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
41714
41743
|
Box_default,
|
|
41715
41744
|
{
|
|
41716
41745
|
flexDirection: "column",
|
|
@@ -41718,42 +41747,42 @@ var NoteListPanel = ({ notes, path: path9 }) => /* @__PURE__ */ (0, import_jsx_r
|
|
|
41718
41747
|
borderColor: "magentaBright",
|
|
41719
41748
|
paddingX: 1,
|
|
41720
41749
|
children: [
|
|
41721
|
-
/* @__PURE__ */ (0,
|
|
41750
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { bold: true, color: "magentaBright", children: [
|
|
41722
41751
|
"Memory \u2014 ",
|
|
41723
41752
|
notes.length,
|
|
41724
41753
|
" note",
|
|
41725
41754
|
notes.length !== 1 ? "s" : "",
|
|
41726
41755
|
" ",
|
|
41727
|
-
/* @__PURE__ */ (0,
|
|
41756
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: "gray", dimColor: true, children: [
|
|
41728
41757
|
"(",
|
|
41729
41758
|
path9,
|
|
41730
41759
|
")"
|
|
41731
41760
|
] })
|
|
41732
41761
|
] }),
|
|
41733
|
-
notes.length === 0 ? /* @__PURE__ */ (0,
|
|
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: [
|
|
41734
41763
|
"No notes yet. Use /memory add ",
|
|
41735
41764
|
"<text>",
|
|
41736
41765
|
" to add one."
|
|
41737
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
41738
|
-
/* @__PURE__ */ (0,
|
|
41739
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
41740
41769
|
String(i2 + 1).padStart(2),
|
|
41741
41770
|
"."
|
|
41742
41771
|
] }) }),
|
|
41743
|
-
/* @__PURE__ */ (0,
|
|
41772
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: "gray", dimColor: true, children: fmtDate2(note.ts) })
|
|
41744
41773
|
] }),
|
|
41745
|
-
/* @__PURE__ */ (0,
|
|
41774
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Box_default, { paddingLeft: 4, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { wrap: "wrap", children: note.text }) })
|
|
41746
41775
|
] }, note.ts + "-" + i2)) }),
|
|
41747
|
-
/* @__PURE__ */ (0,
|
|
41748
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
41749
41778
|
"Add: /memory add ",
|
|
41750
41779
|
"<text>"
|
|
41751
41780
|
] }),
|
|
41752
|
-
/* @__PURE__ */ (0,
|
|
41781
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: "gray", children: [
|
|
41753
41782
|
"Remove: /memory remove ",
|
|
41754
41783
|
"<n>"
|
|
41755
41784
|
] }),
|
|
41756
|
-
/* @__PURE__ */ (0,
|
|
41785
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: "gray", children: "Clear: /memory clear" })
|
|
41757
41786
|
] })
|
|
41758
41787
|
]
|
|
41759
41788
|
}
|
|
@@ -41860,14 +41889,14 @@ var memoryCommand = {
|
|
|
41860
41889
|
}
|
|
41861
41890
|
return {
|
|
41862
41891
|
type: "render",
|
|
41863
|
-
element: /* @__PURE__ */ (0,
|
|
41892
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(NoteListPanel, { notes, path: getMemoryPath() })
|
|
41864
41893
|
};
|
|
41865
41894
|
}
|
|
41866
41895
|
};
|
|
41867
41896
|
|
|
41868
41897
|
// src/agent/hooks.tsx
|
|
41869
41898
|
init_defaults();
|
|
41870
|
-
var
|
|
41899
|
+
var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
|
|
41871
41900
|
import { existsSync as existsSync12, readFileSync as readFileSync8, writeFileSync as writeFileSync5, mkdirSync as mkdirSync4 } from "node:fs";
|
|
41872
41901
|
import { join as join17, dirname as dirname9 } from "node:path";
|
|
41873
41902
|
function globalSettingsPath() {
|
|
@@ -41962,37 +41991,37 @@ function editHook(path9, event, index, newCommand2) {
|
|
|
41962
41991
|
writeHooks(path9, hooks);
|
|
41963
41992
|
return { ok: true };
|
|
41964
41993
|
}
|
|
41965
|
-
var HookRow = ({ index, entry }) => /* @__PURE__ */ (0,
|
|
41966
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
41967
41996
|
"[",
|
|
41968
41997
|
index,
|
|
41969
41998
|
"]"
|
|
41970
41999
|
] }) }),
|
|
41971
|
-
/* @__PURE__ */ (0,
|
|
41972
|
-
/* @__PURE__ */ (0,
|
|
41973
|
-
entry.description ? /* @__PURE__ */ (0,
|
|
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: [
|
|
41974
42003
|
" # ",
|
|
41975
42004
|
entry.description
|
|
41976
42005
|
] }) : null
|
|
41977
42006
|
] });
|
|
41978
|
-
var EventSection = ({ event, entries }) => /* @__PURE__ */ (0,
|
|
41979
|
-
/* @__PURE__ */ (0,
|
|
41980
|
-
entries.length === 0 ? /* @__PURE__ */ (0,
|
|
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))
|
|
41981
42010
|
] });
|
|
41982
42011
|
var ScopePanel = ({ scope, settingsPath: settingsPath2, hooks }) => {
|
|
41983
42012
|
const events = Object.keys(hooks);
|
|
41984
|
-
return /* @__PURE__ */ (0,
|
|
41985
|
-
/* @__PURE__ */ (0,
|
|
41986
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
41987
42016
|
scope === "global" ? "Global" : "Project",
|
|
41988
42017
|
" hooks"
|
|
41989
42018
|
] }),
|
|
41990
|
-
/* @__PURE__ */ (0,
|
|
42019
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "gray", children: [
|
|
41991
42020
|
" ",
|
|
41992
42021
|
settingsPath2
|
|
41993
42022
|
] })
|
|
41994
42023
|
] }),
|
|
41995
|
-
events.length === 0 ? /* @__PURE__ */ (0,
|
|
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))
|
|
41996
42025
|
] });
|
|
41997
42026
|
};
|
|
41998
42027
|
var HooksPanel = ({
|
|
@@ -42001,7 +42030,7 @@ var HooksPanel = ({
|
|
|
42001
42030
|
globalHooks,
|
|
42002
42031
|
projectHooks,
|
|
42003
42032
|
onlyScope
|
|
42004
|
-
}) => /* @__PURE__ */ (0,
|
|
42033
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
42005
42034
|
Box_default,
|
|
42006
42035
|
{
|
|
42007
42036
|
flexDirection: "column",
|
|
@@ -42010,13 +42039,13 @@ var HooksPanel = ({
|
|
|
42010
42039
|
paddingX: 1,
|
|
42011
42040
|
paddingY: 0,
|
|
42012
42041
|
children: [
|
|
42013
|
-
/* @__PURE__ */ (0,
|
|
42014
|
-
/* @__PURE__ */ (0,
|
|
42015
|
-
(!onlyScope || onlyScope === "global") && /* @__PURE__ */ (0,
|
|
42016
|
-
(!onlyScope || onlyScope === "project") && /* @__PURE__ */ (0,
|
|
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 })
|
|
42017
42046
|
] }),
|
|
42018
|
-
/* @__PURE__ */ (0,
|
|
42019
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
42020
42049
|
"Add: /hooks add ",
|
|
42021
42050
|
"<global|project>",
|
|
42022
42051
|
" ",
|
|
@@ -42024,7 +42053,7 @@ var HooksPanel = ({
|
|
|
42024
42053
|
" ",
|
|
42025
42054
|
"<command>"
|
|
42026
42055
|
] }),
|
|
42027
|
-
/* @__PURE__ */ (0,
|
|
42056
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "gray", children: [
|
|
42028
42057
|
"Toggle: /hooks enable|disable ",
|
|
42029
42058
|
"<global|project>",
|
|
42030
42059
|
" ",
|
|
@@ -42032,7 +42061,7 @@ var HooksPanel = ({
|
|
|
42032
42061
|
" ",
|
|
42033
42062
|
"<n>"
|
|
42034
42063
|
] }),
|
|
42035
|
-
/* @__PURE__ */ (0,
|
|
42064
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "gray", children: [
|
|
42036
42065
|
"Edit: /hooks edit ",
|
|
42037
42066
|
"<global|project>",
|
|
42038
42067
|
" ",
|
|
@@ -42042,7 +42071,7 @@ var HooksPanel = ({
|
|
|
42042
42071
|
" ",
|
|
42043
42072
|
"<newcmd>"
|
|
42044
42073
|
] }),
|
|
42045
|
-
/* @__PURE__ */ (0,
|
|
42074
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "gray", children: [
|
|
42046
42075
|
"Remove: /hooks rm ",
|
|
42047
42076
|
"<global|project>",
|
|
42048
42077
|
" ",
|
|
@@ -42050,7 +42079,7 @@ var HooksPanel = ({
|
|
|
42050
42079
|
" ",
|
|
42051
42080
|
"<n>"
|
|
42052
42081
|
] }),
|
|
42053
|
-
/* @__PURE__ */ (0,
|
|
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." })
|
|
42054
42083
|
] })
|
|
42055
42084
|
]
|
|
42056
42085
|
}
|
|
@@ -42081,7 +42110,7 @@ var hooksCommand = {
|
|
|
42081
42110
|
const projectHooks = readHooks(projectPath);
|
|
42082
42111
|
return {
|
|
42083
42112
|
type: "render",
|
|
42084
|
-
element: /* @__PURE__ */ (0,
|
|
42113
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
42085
42114
|
HooksPanel,
|
|
42086
42115
|
{
|
|
42087
42116
|
globalPath,
|
|
@@ -42271,7 +42300,7 @@ Saved to ${path9}`
|
|
|
42271
42300
|
|
|
42272
42301
|
// src/commands-palette/builtin/skill-test.tsx
|
|
42273
42302
|
init_messages();
|
|
42274
|
-
var
|
|
42303
|
+
var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
|
|
42275
42304
|
function makeMockCtx(real) {
|
|
42276
42305
|
const mockConv = new Conversation();
|
|
42277
42306
|
return {
|
|
@@ -42290,7 +42319,7 @@ function makeMockCtx(real) {
|
|
|
42290
42319
|
var SkillListPanel = () => {
|
|
42291
42320
|
const skills = listSkills();
|
|
42292
42321
|
if (skills.length === 0) {
|
|
42293
|
-
return /* @__PURE__ */ (0,
|
|
42322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
42294
42323
|
Box_default,
|
|
42295
42324
|
{
|
|
42296
42325
|
flexDirection: "column",
|
|
@@ -42298,14 +42327,14 @@ var SkillListPanel = () => {
|
|
|
42298
42327
|
borderColor: "magentaBright",
|
|
42299
42328
|
paddingX: 1,
|
|
42300
42329
|
children: [
|
|
42301
|
-
/* @__PURE__ */ (0,
|
|
42302
|
-
/* @__PURE__ */ (0,
|
|
42303
|
-
/* @__PURE__ */ (0,
|
|
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" })
|
|
42304
42333
|
]
|
|
42305
42334
|
}
|
|
42306
42335
|
);
|
|
42307
42336
|
}
|
|
42308
|
-
return /* @__PURE__ */ (0,
|
|
42337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
42309
42338
|
Box_default,
|
|
42310
42339
|
{
|
|
42311
42340
|
flexDirection: "column",
|
|
@@ -42313,26 +42342,26 @@ var SkillListPanel = () => {
|
|
|
42313
42342
|
borderColor: "magentaBright",
|
|
42314
42343
|
paddingX: 1,
|
|
42315
42344
|
children: [
|
|
42316
|
-
/* @__PURE__ */ (0,
|
|
42345
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text, { bold: true, color: "magentaBright", children: [
|
|
42317
42346
|
"skill-test \u2014 ",
|
|
42318
42347
|
skills.length,
|
|
42319
42348
|
" skill",
|
|
42320
42349
|
skills.length !== 1 ? "s" : "",
|
|
42321
42350
|
" loaded"
|
|
42322
42351
|
] }),
|
|
42323
|
-
skills.map((s) => /* @__PURE__ */ (0,
|
|
42324
|
-
/* @__PURE__ */ (0,
|
|
42325
|
-
/* @__PURE__ */ (0,
|
|
42326
|
-
/* @__PURE__ */ (0,
|
|
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)" })
|
|
42327
42356
|
] }),
|
|
42328
|
-
/* @__PURE__ */ (0,
|
|
42357
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text, { color: "gray", children: [
|
|
42329
42358
|
"scope=",
|
|
42330
42359
|
s.scope,
|
|
42331
42360
|
s.frontmatter["disable-model-invocation"] ? " [user-only]" : "",
|
|
42332
42361
|
s.frontmatter["allowed-tools"] ? ` tools=${s.frontmatter["allowed-tools"].join(",")}` : ""
|
|
42333
42362
|
] }) })
|
|
42334
42363
|
] }, s.name)),
|
|
42335
|
-
/* @__PURE__ */ (0,
|
|
42364
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text, { color: "gray", children: [
|
|
42336
42365
|
"Run: /skill-test ",
|
|
42337
42366
|
"<name>",
|
|
42338
42367
|
" [args]"
|
|
@@ -42353,7 +42382,7 @@ var DryRunPanel = ({
|
|
|
42353
42382
|
const bodyLines = injectedBody.split("\n");
|
|
42354
42383
|
const previewLines = bodyLines.slice(0, 20);
|
|
42355
42384
|
const overflow = bodyLines.length - previewLines.length;
|
|
42356
|
-
return /* @__PURE__ */ (0,
|
|
42385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
42357
42386
|
Box_default,
|
|
42358
42387
|
{
|
|
42359
42388
|
flexDirection: "column",
|
|
@@ -42361,56 +42390,56 @@ var DryRunPanel = ({
|
|
|
42361
42390
|
borderColor: "magentaBright",
|
|
42362
42391
|
paddingX: 1,
|
|
42363
42392
|
children: [
|
|
42364
|
-
/* @__PURE__ */ (0,
|
|
42365
|
-
/* @__PURE__ */ (0,
|
|
42366
|
-
/* @__PURE__ */ (0,
|
|
42367
|
-
forwardedArgs ? /* @__PURE__ */ (0,
|
|
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: [
|
|
42368
42397
|
' "',
|
|
42369
42398
|
forwardedArgs,
|
|
42370
42399
|
'"'
|
|
42371
42400
|
] }) : null
|
|
42372
42401
|
] }),
|
|
42373
|
-
/* @__PURE__ */ (0,
|
|
42374
|
-
/* @__PURE__ */ (0,
|
|
42375
|
-
/* @__PURE__ */ (0,
|
|
42376
|
-
/* @__PURE__ */ (0,
|
|
42377
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
42378
42407
|
" (",
|
|
42379
42408
|
elapsedMs,
|
|
42380
42409
|
"ms)"
|
|
42381
42410
|
] })
|
|
42382
42411
|
] }),
|
|
42383
|
-
/* @__PURE__ */ (0,
|
|
42384
|
-
/* @__PURE__ */ (0,
|
|
42385
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
42386
42415
|
] })
|
|
42387
42416
|
] }),
|
|
42388
|
-
result.type === "ack" && result.message ? /* @__PURE__ */ (0,
|
|
42389
|
-
/* @__PURE__ */ (0,
|
|
42390
|
-
result.message.split("\n").map((line, i2) => /* @__PURE__ */ (0,
|
|
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: [
|
|
42391
42420
|
" ",
|
|
42392
42421
|
line
|
|
42393
42422
|
] }, i2))
|
|
42394
42423
|
] }) : null,
|
|
42395
|
-
result.type === "error" ? /* @__PURE__ */ (0,
|
|
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: [
|
|
42396
42425
|
"error: ",
|
|
42397
42426
|
result.message
|
|
42398
42427
|
] }) }) : null,
|
|
42399
|
-
result.type === "render" ? /* @__PURE__ */ (0,
|
|
42400
|
-
/* @__PURE__ */ (0,
|
|
42401
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
42402
42431
|
] }) : null,
|
|
42403
|
-
result.type === "clear" ? /* @__PURE__ */ (0,
|
|
42404
|
-
result.type === "exit" ? /* @__PURE__ */ (0,
|
|
42405
|
-
/* @__PURE__ */ (0,
|
|
42406
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
42407
42436
|
"body preview (",
|
|
42408
42437
|
bodyLines.length,
|
|
42409
42438
|
" line",
|
|
42410
42439
|
bodyLines.length !== 1 ? "s" : "",
|
|
42411
42440
|
"):"
|
|
42412
42441
|
] }),
|
|
42413
|
-
/* @__PURE__ */ (0,
|
|
42442
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
42414
42443
|
Box_default,
|
|
42415
42444
|
{
|
|
42416
42445
|
flexDirection: "column",
|
|
@@ -42418,8 +42447,8 @@ var DryRunPanel = ({
|
|
|
42418
42447
|
borderStyle: "single",
|
|
42419
42448
|
borderColor: "gray",
|
|
42420
42449
|
children: [
|
|
42421
|
-
previewLines.map((line, i2) => /* @__PURE__ */ (0,
|
|
42422
|
-
overflow > 0 ? /* @__PURE__ */ (0,
|
|
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: [
|
|
42423
42452
|
"\u2026 ",
|
|
42424
42453
|
overflow,
|
|
42425
42454
|
" more line",
|
|
@@ -42429,7 +42458,7 @@ var DryRunPanel = ({
|
|
|
42429
42458
|
}
|
|
42430
42459
|
)
|
|
42431
42460
|
] }),
|
|
42432
|
-
/* @__PURE__ */ (0,
|
|
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)" }) })
|
|
42433
42462
|
]
|
|
42434
42463
|
}
|
|
42435
42464
|
);
|
|
@@ -42441,7 +42470,7 @@ var skillTestCommand = {
|
|
|
42441
42470
|
run: async (args, ctx) => {
|
|
42442
42471
|
const trimmed = args.trim();
|
|
42443
42472
|
if (!trimmed) {
|
|
42444
|
-
return { type: "render", element: /* @__PURE__ */ (0,
|
|
42473
|
+
return { type: "render", element: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SkillListPanel, {}) };
|
|
42445
42474
|
}
|
|
42446
42475
|
const [name, ...rest] = trimmed.split(/\s+/);
|
|
42447
42476
|
if (!name) {
|
|
@@ -42487,7 +42516,7 @@ ${argText}`.trim();
|
|
|
42487
42516
|
const mockMessages = mockCtx.conversation.size();
|
|
42488
42517
|
return {
|
|
42489
42518
|
type: "render",
|
|
42490
|
-
element: /* @__PURE__ */ (0,
|
|
42519
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
42491
42520
|
DryRunPanel,
|
|
42492
42521
|
{
|
|
42493
42522
|
skillName: name,
|
|
@@ -42503,7 +42532,7 @@ ${argText}`.trim();
|
|
|
42503
42532
|
};
|
|
42504
42533
|
|
|
42505
42534
|
// src/commands-palette/builtin/metrics.tsx
|
|
42506
|
-
var
|
|
42535
|
+
var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
|
|
42507
42536
|
function computeMetrics(messages) {
|
|
42508
42537
|
let modelCalls = 0;
|
|
42509
42538
|
let toolCalls = 0;
|
|
@@ -42543,39 +42572,39 @@ var MetricsPanel = ({ ctx }) => {
|
|
|
42543
42572
|
const rows = [
|
|
42544
42573
|
[
|
|
42545
42574
|
"Model calls",
|
|
42546
|
-
/* @__PURE__ */ (0,
|
|
42575
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "magentaBright", children: m.modelCalls }) }, "mc")
|
|
42547
42576
|
],
|
|
42548
42577
|
[
|
|
42549
42578
|
"Tool calls",
|
|
42550
|
-
/* @__PURE__ */ (0,
|
|
42579
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "magentaBright", children: m.toolCalls }) }, "tc")
|
|
42551
42580
|
],
|
|
42552
42581
|
[
|
|
42553
42582
|
"Loop iterations",
|
|
42554
|
-
/* @__PURE__ */ (0,
|
|
42555
|
-
/* @__PURE__ */ (0,
|
|
42556
|
-
/* @__PURE__ */ (0,
|
|
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)" })
|
|
42557
42586
|
] }, "li")
|
|
42558
42587
|
],
|
|
42559
42588
|
[
|
|
42560
42589
|
"Avg latency",
|
|
42561
|
-
/* @__PURE__ */ (0,
|
|
42562
|
-
/* @__PURE__ */ (0,
|
|
42563
|
-
m.avgLatencyMs !== null && /* @__PURE__ */ (0,
|
|
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" })
|
|
42564
42593
|
] }, "lat")
|
|
42565
42594
|
],
|
|
42566
42595
|
[
|
|
42567
42596
|
"Messages",
|
|
42568
|
-
/* @__PURE__ */ (0,
|
|
42569
|
-
/* @__PURE__ */ (0,
|
|
42570
|
-
/* @__PURE__ */ (0,
|
|
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)" })
|
|
42571
42600
|
] }, "msgs")
|
|
42572
42601
|
],
|
|
42573
42602
|
[
|
|
42574
42603
|
"Session tokens",
|
|
42575
|
-
/* @__PURE__ */ (0,
|
|
42604
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: "magentaBright", children: ctx.sessionTokens.toLocaleString() }) }, "tok")
|
|
42576
42605
|
]
|
|
42577
42606
|
];
|
|
42578
|
-
return /* @__PURE__ */ (0,
|
|
42607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
42579
42608
|
Box_default,
|
|
42580
42609
|
{
|
|
42581
42610
|
flexDirection: "column",
|
|
@@ -42583,12 +42612,12 @@ var MetricsPanel = ({ ctx }) => {
|
|
|
42583
42612
|
borderColor: "magenta",
|
|
42584
42613
|
paddingX: 1,
|
|
42585
42614
|
children: [
|
|
42586
|
-
/* @__PURE__ */ (0,
|
|
42587
|
-
/* @__PURE__ */ (0,
|
|
42588
|
-
/* @__PURE__ */ (0,
|
|
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 }) }),
|
|
42589
42618
|
value
|
|
42590
42619
|
] }, label)) }),
|
|
42591
|
-
/* @__PURE__ */ (0,
|
|
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." }) })
|
|
42592
42621
|
]
|
|
42593
42622
|
}
|
|
42594
42623
|
);
|
|
@@ -42598,7 +42627,7 @@ var metricsCommand = {
|
|
|
42598
42627
|
description: "Show session metrics: model calls, tool calls, loop iterations, avg latency",
|
|
42599
42628
|
run: (_args, ctx) => ({
|
|
42600
42629
|
type: "render",
|
|
42601
|
-
element: /* @__PURE__ */ (0,
|
|
42630
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(MetricsPanel, { ctx })
|
|
42602
42631
|
})
|
|
42603
42632
|
};
|
|
42604
42633
|
|
|
@@ -42803,25 +42832,25 @@ var MCPClient = class {
|
|
|
42803
42832
|
};
|
|
42804
42833
|
|
|
42805
42834
|
// src/mcp/index.tsx
|
|
42806
|
-
var
|
|
42835
|
+
var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
|
|
42807
42836
|
var ServerRow = ({ server, scope }) => {
|
|
42808
42837
|
const enabled = server.enabled !== false;
|
|
42809
42838
|
const statusColor = enabled ? "green" : "gray";
|
|
42810
42839
|
const statusText = enabled ? "on " : "off";
|
|
42811
42840
|
const scopeTag2 = scope === "project" ? " [project]" : "";
|
|
42812
42841
|
const authTag = server.authHeader ? " [auth]" : "";
|
|
42813
|
-
return /* @__PURE__ */ (0,
|
|
42814
|
-
/* @__PURE__ */ (0,
|
|
42815
|
-
/* @__PURE__ */ (0,
|
|
42816
|
-
/* @__PURE__ */ (0,
|
|
42817
|
-
/* @__PURE__ */ (0,
|
|
42818
|
-
/* @__PURE__ */ (0,
|
|
42819
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
42820
42849
|
] }),
|
|
42821
|
-
server.label ? /* @__PURE__ */ (0,
|
|
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
|
|
42822
42851
|
] });
|
|
42823
42852
|
};
|
|
42824
|
-
var ListPanel = ({ servers }) => /* @__PURE__ */ (0,
|
|
42853
|
+
var ListPanel = ({ servers }) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
42825
42854
|
Box_default,
|
|
42826
42855
|
{
|
|
42827
42856
|
flexDirection: "column",
|
|
@@ -42829,35 +42858,35 @@ var ListPanel = ({ servers }) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
|
42829
42858
|
borderColor: "magentaBright",
|
|
42830
42859
|
paddingX: 1,
|
|
42831
42860
|
children: [
|
|
42832
|
-
/* @__PURE__ */ (0,
|
|
42861
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Text, { bold: true, color: "magentaBright", children: [
|
|
42833
42862
|
"MCP servers (",
|
|
42834
42863
|
servers.length,
|
|
42835
42864
|
")"
|
|
42836
42865
|
] }),
|
|
42837
|
-
servers.length === 0 ? /* @__PURE__ */ (0,
|
|
42866
|
+
servers.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Text, { color: "gray", children: [
|
|
42838
42867
|
"No servers registered. Add one with /mcp add ",
|
|
42839
42868
|
"<id> <url>",
|
|
42840
42869
|
"."
|
|
42841
|
-
] }) : servers.map((s) => /* @__PURE__ */ (0,
|
|
42842
|
-
/* @__PURE__ */ (0,
|
|
42843
|
-
/* @__PURE__ */ (0,
|
|
42844
|
-
/* @__PURE__ */ (0,
|
|
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" })
|
|
42845
42874
|
] })
|
|
42846
42875
|
]
|
|
42847
42876
|
}
|
|
42848
42877
|
);
|
|
42849
|
-
var ToolsRow = ({ tool, serverId }) => /* @__PURE__ */ (0,
|
|
42850
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
42851
42880
|
"mcp:",
|
|
42852
42881
|
serverId,
|
|
42853
42882
|
".",
|
|
42854
42883
|
tool.name
|
|
42855
42884
|
] }) }),
|
|
42856
|
-
tool.description ? /* @__PURE__ */ (0,
|
|
42885
|
+
tool.description ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: "gray", children: tool.description }) : null
|
|
42857
42886
|
] }) });
|
|
42858
42887
|
var ToolsPanel = ({ results }) => {
|
|
42859
42888
|
const total = results.reduce((n2, r) => n2 + r.tools.length, 0);
|
|
42860
|
-
return /* @__PURE__ */ (0,
|
|
42889
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
42861
42890
|
Box_default,
|
|
42862
42891
|
{
|
|
42863
42892
|
flexDirection: "column",
|
|
@@ -42865,7 +42894,7 @@ var ToolsPanel = ({ results }) => {
|
|
|
42865
42894
|
borderColor: "cyan",
|
|
42866
42895
|
paddingX: 1,
|
|
42867
42896
|
children: [
|
|
42868
|
-
/* @__PURE__ */ (0,
|
|
42897
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Text, { bold: true, color: "cyan", children: [
|
|
42869
42898
|
"MCP tools (",
|
|
42870
42899
|
total,
|
|
42871
42900
|
" across ",
|
|
@@ -42874,15 +42903,15 @@ var ToolsPanel = ({ results }) => {
|
|
|
42874
42903
|
results.length !== 1 ? "s" : "",
|
|
42875
42904
|
")"
|
|
42876
42905
|
] }),
|
|
42877
|
-
results.map((r) => /* @__PURE__ */ (0,
|
|
42878
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
42879
42908
|
r.server.id,
|
|
42880
42909
|
r.server.label ? ` \u2014 ${r.server.label}` : ""
|
|
42881
42910
|
] }),
|
|
42882
|
-
r.error ? /* @__PURE__ */ (0,
|
|
42911
|
+
r.error ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Text, { color: "red", children: [
|
|
42883
42912
|
" Error: ",
|
|
42884
42913
|
r.error
|
|
42885
|
-
] }) : r.tools.length === 0 ? /* @__PURE__ */ (0,
|
|
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))
|
|
42886
42915
|
] }, r.server.id))
|
|
42887
42916
|
]
|
|
42888
42917
|
}
|
|
@@ -42924,7 +42953,7 @@ var mcpCommand = {
|
|
|
42924
42953
|
const servers = await resolveEffectiveServers(ctx.cwd);
|
|
42925
42954
|
return {
|
|
42926
42955
|
type: "render",
|
|
42927
|
-
element: /* @__PURE__ */ (0,
|
|
42956
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ListPanel, { servers })
|
|
42928
42957
|
};
|
|
42929
42958
|
}
|
|
42930
42959
|
if (sub === "add") {
|
|
@@ -43014,7 +43043,7 @@ The token is stored as "Bearer <token>" in ~/.kryven/mcp.json.`
|
|
|
43014
43043
|
const results = await discoverToolsForServers(targets);
|
|
43015
43044
|
return {
|
|
43016
43045
|
type: "render",
|
|
43017
|
-
element: /* @__PURE__ */ (0,
|
|
43046
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ToolsPanel, { results })
|
|
43018
43047
|
};
|
|
43019
43048
|
}
|
|
43020
43049
|
return {
|
|
@@ -43032,7 +43061,7 @@ The token is stored as "Bearer <token>" in ~/.kryven/mcp.json.`
|
|
|
43032
43061
|
};
|
|
43033
43062
|
|
|
43034
43063
|
// src/tui/EconomicsLine.tsx
|
|
43035
|
-
var
|
|
43064
|
+
var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
|
|
43036
43065
|
function fmtTokens(n2) {
|
|
43037
43066
|
if (n2 < 1e3) return String(n2);
|
|
43038
43067
|
if (n2 < 1e6) return (n2 / 1e3).toFixed(1) + "k";
|
|
@@ -43071,58 +43100,58 @@ var EconomicsLine = ({
|
|
|
43071
43100
|
const credits = creditsFromTokens(displayCharged);
|
|
43072
43101
|
const hasTurnData = stats.turnCount > 0;
|
|
43073
43102
|
if (compact) {
|
|
43074
|
-
return /* @__PURE__ */ (0,
|
|
43075
|
-
/* @__PURE__ */ (0,
|
|
43103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { children: [
|
|
43104
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Text, { color: "magenta", children: [
|
|
43076
43105
|
fmtTokens(displayCharged),
|
|
43077
43106
|
" tok"
|
|
43078
43107
|
] }),
|
|
43079
|
-
hasTurnData && /* @__PURE__ */ (0,
|
|
43080
|
-
/* @__PURE__ */ (0,
|
|
43081
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
43082
43111
|
credits,
|
|
43083
43112
|
" cr"
|
|
43084
43113
|
] })
|
|
43085
43114
|
] }),
|
|
43086
|
-
hasTurnData && stats.tier && /* @__PURE__ */ (0,
|
|
43087
|
-
/* @__PURE__ */ (0,
|
|
43088
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
43089
43118
|
] })
|
|
43090
43119
|
] });
|
|
43091
43120
|
}
|
|
43092
|
-
return /* @__PURE__ */ (0,
|
|
43093
|
-
/* @__PURE__ */ (0,
|
|
43094
|
-
/* @__PURE__ */ (0,
|
|
43095
|
-
/* @__PURE__ */ (0,
|
|
43096
|
-
/* @__PURE__ */ (0,
|
|
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" })
|
|
43097
43126
|
] }),
|
|
43098
|
-
hasTurnData && /* @__PURE__ */ (0,
|
|
43099
|
-
/* @__PURE__ */ (0,
|
|
43100
|
-
/* @__PURE__ */ (0,
|
|
43101
|
-
/* @__PURE__ */ (0,
|
|
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) })
|
|
43102
43131
|
] }),
|
|
43103
|
-
/* @__PURE__ */ (0,
|
|
43104
|
-
/* @__PURE__ */ (0,
|
|
43105
|
-
/* @__PURE__ */ (0,
|
|
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) })
|
|
43106
43135
|
] }),
|
|
43107
|
-
/* @__PURE__ */ (0,
|
|
43108
|
-
/* @__PURE__ */ (0,
|
|
43109
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
43110
43139
|
] }),
|
|
43111
|
-
/* @__PURE__ */ (0,
|
|
43112
|
-
/* @__PURE__ */ (0,
|
|
43113
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
43114
43143
|
] })
|
|
43115
43144
|
] }),
|
|
43116
|
-
stats.tier && /* @__PURE__ */ (0,
|
|
43117
|
-
/* @__PURE__ */ (0,
|
|
43118
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
43119
43148
|
] }),
|
|
43120
|
-
!hasTurnData && displayCharged === 0 && /* @__PURE__ */ (0,
|
|
43149
|
+
!hasTurnData && displayCharged === 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "gray", children: "no usage recorded yet" })
|
|
43121
43150
|
] });
|
|
43122
43151
|
};
|
|
43123
43152
|
|
|
43124
43153
|
// src/commands-palette/builtin/usage.tsx
|
|
43125
|
-
var
|
|
43154
|
+
var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
|
|
43126
43155
|
function displayName(model) {
|
|
43127
43156
|
const lower = model.toLowerCase();
|
|
43128
43157
|
if (lower.includes("extended")) return "KRY-5.2 Extended";
|
|
@@ -43155,9 +43184,9 @@ var UsagePanel = ({ ctx }) => {
|
|
|
43155
43184
|
const messages = ctx.conversation.all();
|
|
43156
43185
|
const modelBuckets = buildModelBuckets(messages);
|
|
43157
43186
|
const hasBreakdown = modelBuckets.size > 0;
|
|
43158
|
-
return /* @__PURE__ */ (0,
|
|
43159
|
-
/* @__PURE__ */ (0,
|
|
43160
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
43161
43190
|
EconomicsLine,
|
|
43162
43191
|
{
|
|
43163
43192
|
sessionTokens: ctx.sessionTokens,
|
|
@@ -43165,7 +43194,7 @@ var UsagePanel = ({ ctx }) => {
|
|
|
43165
43194
|
compact: false
|
|
43166
43195
|
}
|
|
43167
43196
|
),
|
|
43168
|
-
hasBreakdown && /* @__PURE__ */ (0,
|
|
43197
|
+
hasBreakdown && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
43169
43198
|
Box_default,
|
|
43170
43199
|
{
|
|
43171
43200
|
flexDirection: "column",
|
|
@@ -43174,38 +43203,38 @@ var UsagePanel = ({ ctx }) => {
|
|
|
43174
43203
|
paddingX: 1,
|
|
43175
43204
|
marginTop: 1,
|
|
43176
43205
|
children: [
|
|
43177
|
-
/* @__PURE__ */ (0,
|
|
43178
|
-
Array.from(modelBuckets.entries()).map(([tier, bucket]) => /* @__PURE__ */ (0,
|
|
43179
|
-
/* @__PURE__ */ (0,
|
|
43180
|
-
/* @__PURE__ */ (0,
|
|
43181
|
-
/* @__PURE__ */ (0,
|
|
43182
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
43183
43212
|
] }),
|
|
43184
|
-
/* @__PURE__ */ (0,
|
|
43185
|
-
/* @__PURE__ */ (0,
|
|
43186
|
-
/* @__PURE__ */ (0,
|
|
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) })
|
|
43187
43216
|
] }),
|
|
43188
|
-
/* @__PURE__ */ (0,
|
|
43189
|
-
/* @__PURE__ */ (0,
|
|
43190
|
-
/* @__PURE__ */ (0,
|
|
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) })
|
|
43191
43220
|
] }),
|
|
43192
|
-
/* @__PURE__ */ (0,
|
|
43193
|
-
/* @__PURE__ */ (0,
|
|
43194
|
-
/* @__PURE__ */ (0,
|
|
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) })
|
|
43195
43224
|
] })
|
|
43196
43225
|
] }, tier))
|
|
43197
43226
|
]
|
|
43198
43227
|
}
|
|
43199
43228
|
),
|
|
43200
|
-
/* @__PURE__ */ (0,
|
|
43229
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Box_default, { paddingX: 1, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Text, { color: "gray", children: [
|
|
43201
43230
|
"context: ",
|
|
43202
|
-
/* @__PURE__ */ (0,
|
|
43231
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "white", children: ctx.sessionMessages }),
|
|
43203
43232
|
" msgs \xB7 conversation size: ",
|
|
43204
|
-
/* @__PURE__ */ (0,
|
|
43233
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "white", children: ctx.conversation.size() }),
|
|
43205
43234
|
" \xB7 model: ",
|
|
43206
|
-
/* @__PURE__ */ (0,
|
|
43235
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "cyan", children: displayName(ctx.model) }),
|
|
43207
43236
|
" \xB7 mood: ",
|
|
43208
|
-
/* @__PURE__ */ (0,
|
|
43237
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: "yellow", children: ctx.mood })
|
|
43209
43238
|
] }) })
|
|
43210
43239
|
] });
|
|
43211
43240
|
};
|
|
@@ -43214,55 +43243,55 @@ var usageCommand = {
|
|
|
43214
43243
|
description: "Show session token budget, accumulated spend, and per-model breakdown",
|
|
43215
43244
|
run: (_args, ctx) => ({
|
|
43216
43245
|
type: "render",
|
|
43217
|
-
element: /* @__PURE__ */ (0,
|
|
43246
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(UsagePanel, { ctx })
|
|
43218
43247
|
})
|
|
43219
43248
|
};
|
|
43220
43249
|
|
|
43221
43250
|
// src/commands-palette/builtin/vim.tsx
|
|
43222
43251
|
init_load();
|
|
43223
|
-
var
|
|
43224
|
-
var StatusPanel = ({ enabled }) => /* @__PURE__ */ (0,
|
|
43225
|
-
/* @__PURE__ */ (0,
|
|
43226
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
43227
43256
|
"Status:",
|
|
43228
43257
|
" ",
|
|
43229
|
-
/* @__PURE__ */ (0,
|
|
43258
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { bold: true, color: enabled ? "green" : "gray", children: enabled ? "enabled" : "disabled" })
|
|
43230
43259
|
] }) }),
|
|
43231
|
-
/* @__PURE__ */ (0,
|
|
43232
|
-
/* @__PURE__ */ (0,
|
|
43233
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
43234
43263
|
" ",
|
|
43235
|
-
/* @__PURE__ */ (0,
|
|
43264
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "cyan", children: "/vim on" }),
|
|
43236
43265
|
" ",
|
|
43237
43266
|
" \u2014 enable vim mode (takes effect on next launch)"
|
|
43238
43267
|
] }),
|
|
43239
|
-
/* @__PURE__ */ (0,
|
|
43268
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { children: [
|
|
43240
43269
|
" ",
|
|
43241
|
-
/* @__PURE__ */ (0,
|
|
43270
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "cyan", children: "/vim off" }),
|
|
43242
43271
|
" ",
|
|
43243
43272
|
" \u2014 disable vim mode"
|
|
43244
43273
|
] }),
|
|
43245
|
-
/* @__PURE__ */ (0,
|
|
43274
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { children: [
|
|
43246
43275
|
" ",
|
|
43247
|
-
/* @__PURE__ */ (0,
|
|
43276
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "cyan", children: "/vim bindings" }),
|
|
43248
43277
|
" ",
|
|
43249
43278
|
" \u2014 show key binding reference"
|
|
43250
43279
|
] })
|
|
43251
43280
|
] }),
|
|
43252
|
-
!enabled && /* @__PURE__ */ (0,
|
|
43281
|
+
!enabled && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { color: "gray", children: [
|
|
43253
43282
|
"Tip: run",
|
|
43254
43283
|
" ",
|
|
43255
|
-
/* @__PURE__ */ (0,
|
|
43284
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "cyan", children: "/vim on" }),
|
|
43256
43285
|
" ",
|
|
43257
43286
|
"to enable modal editing in the input line."
|
|
43258
43287
|
] }) }),
|
|
43259
|
-
enabled && /* @__PURE__ */ (0,
|
|
43288
|
+
enabled && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { color: "gray", children: [
|
|
43260
43289
|
"Active \u2014 press ",
|
|
43261
|
-
/* @__PURE__ */ (0,
|
|
43290
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "magentaBright", children: "Esc" }),
|
|
43262
43291
|
" to enter normal mode, ",
|
|
43263
|
-
/* @__PURE__ */ (0,
|
|
43292
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "magentaBright", children: "i" }),
|
|
43264
43293
|
"/",
|
|
43265
|
-
/* @__PURE__ */ (0,
|
|
43294
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "magentaBright", children: "a" }),
|
|
43266
43295
|
" to insert."
|
|
43267
43296
|
] }) })
|
|
43268
43297
|
] });
|
|
@@ -43290,16 +43319,16 @@ var BINDINGS = [
|
|
|
43290
43319
|
// Submit
|
|
43291
43320
|
["Enter", "Submit prompt (any mode)"]
|
|
43292
43321
|
];
|
|
43293
|
-
var BindingsPanel2 = () => /* @__PURE__ */ (0,
|
|
43294
|
-
/* @__PURE__ */ (0,
|
|
43295
|
-
/* @__PURE__ */ (0,
|
|
43296
|
-
/* @__PURE__ */ (0,
|
|
43297
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
43298
43327
|
] }, key)) }),
|
|
43299
|
-
/* @__PURE__ */ (0,
|
|
43328
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { color: "gray", children: [
|
|
43300
43329
|
"Vim mode must be enabled via",
|
|
43301
43330
|
" ",
|
|
43302
|
-
/* @__PURE__ */ (0,
|
|
43331
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: "cyan", children: "/vim on" }),
|
|
43303
43332
|
" ",
|
|
43304
43333
|
"and the CLI restarted for bindings to take effect."
|
|
43305
43334
|
] }) })
|
|
@@ -43313,7 +43342,7 @@ var vimCommand = {
|
|
|
43313
43342
|
if (sub === "bindings") {
|
|
43314
43343
|
return {
|
|
43315
43344
|
type: "render",
|
|
43316
|
-
element: /* @__PURE__ */ (0,
|
|
43345
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(BindingsPanel2, {})
|
|
43317
43346
|
};
|
|
43318
43347
|
}
|
|
43319
43348
|
if (sub === "on") {
|
|
@@ -43336,7 +43365,7 @@ var vimCommand = {
|
|
|
43336
43365
|
const enabled = cfg.vim === true;
|
|
43337
43366
|
return {
|
|
43338
43367
|
type: "render",
|
|
43339
|
-
element: /* @__PURE__ */ (0,
|
|
43368
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(StatusPanel, { enabled })
|
|
43340
43369
|
};
|
|
43341
43370
|
}
|
|
43342
43371
|
};
|
|
@@ -43637,7 +43666,7 @@ async function runBgAgent(id) {
|
|
|
43637
43666
|
apiKey: cfg.apiKey,
|
|
43638
43667
|
baseUrl: cfg.apiBaseUrl,
|
|
43639
43668
|
clientType: "ide",
|
|
43640
|
-
userAgent: `kryven-cli-bg/${"0.2.
|
|
43669
|
+
userAgent: `kryven-cli-bg/${"0.2.4"}`
|
|
43641
43670
|
});
|
|
43642
43671
|
const transcriptPath = join25(dir, "transcript.jsonl");
|
|
43643
43672
|
const appendTranscript = async (m) => {
|
|
@@ -43756,7 +43785,7 @@ async function runBgAgent(id) {
|
|
|
43756
43785
|
}
|
|
43757
43786
|
|
|
43758
43787
|
// src/commands-palette/builtin/bg.tsx
|
|
43759
|
-
var
|
|
43788
|
+
var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
|
|
43760
43789
|
function fmtElapsed2(start, end) {
|
|
43761
43790
|
const sec = Math.floor(((end ?? Date.now()) - start) / 1e3);
|
|
43762
43791
|
const m = Math.floor(sec / 60);
|
|
@@ -43769,26 +43798,26 @@ var STATUS_COLOR2 = {
|
|
|
43769
43798
|
killed: "red",
|
|
43770
43799
|
timeout: "yellow"
|
|
43771
43800
|
};
|
|
43772
|
-
var BgListPanel = ({ agents }) => /* @__PURE__ */ (0,
|
|
43773
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
43774
43803
|
"Background agents (",
|
|
43775
43804
|
agents.length,
|
|
43776
43805
|
")"
|
|
43777
43806
|
] }),
|
|
43778
|
-
agents.length === 0 ? /* @__PURE__ */ (0,
|
|
43807
|
+
agents.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Text, { color: "gray", children: [
|
|
43779
43808
|
"None. Start one with /bg start ",
|
|
43780
43809
|
"<prompt>",
|
|
43781
43810
|
"."
|
|
43782
|
-
] }) : agents.map((a2) => /* @__PURE__ */ (0,
|
|
43783
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
43784
43813
|
a2.id.slice(0, 8),
|
|
43785
43814
|
"\u2026"
|
|
43786
43815
|
] }) }),
|
|
43787
|
-
/* @__PURE__ */ (0,
|
|
43788
|
-
/* @__PURE__ */ (0,
|
|
43789
|
-
/* @__PURE__ */ (0,
|
|
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 || "" })
|
|
43790
43819
|
] }, a2.id)),
|
|
43791
|
-
/* @__PURE__ */ (0,
|
|
43820
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Text, { color: "gray", children: [
|
|
43792
43821
|
"/bg start ",
|
|
43793
43822
|
"<prompt>",
|
|
43794
43823
|
" \xB7 /bg logs ",
|
|
@@ -43847,27 +43876,27 @@ var bgCommand = {
|
|
|
43847
43876
|
};
|
|
43848
43877
|
}
|
|
43849
43878
|
const agents = await listBgAgents();
|
|
43850
|
-
return { type: "render", element: /* @__PURE__ */ (0,
|
|
43879
|
+
return { type: "render", element: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(BgListPanel, { agents }) };
|
|
43851
43880
|
}
|
|
43852
43881
|
};
|
|
43853
43882
|
|
|
43854
43883
|
// src/commands-palette/builtin/mode.tsx
|
|
43855
43884
|
init_modes();
|
|
43856
|
-
var
|
|
43885
|
+
var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
|
|
43857
43886
|
var ORDER = ["plan", "default", "acceptEdits", "bypass", "deny"];
|
|
43858
|
-
var ModePanel = ({ current }) => /* @__PURE__ */ (0,
|
|
43859
|
-
/* @__PURE__ */ (0,
|
|
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" }),
|
|
43860
43889
|
ORDER.map((m) => {
|
|
43861
43890
|
const active = m === current;
|
|
43862
|
-
return /* @__PURE__ */ (0,
|
|
43863
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
43864
43893
|
active ? "\u25B8 " : " ",
|
|
43865
43894
|
m
|
|
43866
43895
|
] }) }),
|
|
43867
|
-
/* @__PURE__ */ (0,
|
|
43896
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: "gray", children: MODE_DESCRIPTIONS[m] })
|
|
43868
43897
|
] }, m);
|
|
43869
43898
|
}),
|
|
43870
|
-
/* @__PURE__ */ (0,
|
|
43899
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Text, { color: "gray", children: [
|
|
43871
43900
|
"Switch: /mode ",
|
|
43872
43901
|
"<name>",
|
|
43873
43902
|
" \xB7 cycle with Shift+Tab \xB7 enable bypass with /mode bypass --confirm"
|
|
@@ -43884,7 +43913,7 @@ var modeCommand = {
|
|
|
43884
43913
|
const parts = (args ?? "").trim().split(/\s+/).filter(Boolean);
|
|
43885
43914
|
const sub = (parts[0] ?? "").toLowerCase();
|
|
43886
43915
|
if (!sub) {
|
|
43887
|
-
return { type: "render", element: /* @__PURE__ */ (0,
|
|
43916
|
+
return { type: "render", element: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ModePanel, { current: getPermissionMode() }) };
|
|
43888
43917
|
}
|
|
43889
43918
|
if (sub === "next") {
|
|
43890
43919
|
return { type: "ack", message: `Permission mode: ${cyclePermissionMode()}` };
|
|
@@ -43914,6 +43943,7 @@ var BUILTIN_COMMANDS = [
|
|
|
43914
43943
|
exitCommand,
|
|
43915
43944
|
modelCommand,
|
|
43916
43945
|
moodCommand,
|
|
43946
|
+
loginCommand2,
|
|
43917
43947
|
costCommand,
|
|
43918
43948
|
skillCommand,
|
|
43919
43949
|
agentCommand,
|
|
@@ -44057,6 +44087,7 @@ function applyCompletion(buffer, result, item) {
|
|
|
44057
44087
|
init_messages();
|
|
44058
44088
|
init_system_prompt();
|
|
44059
44089
|
init_loop();
|
|
44090
|
+
init_client();
|
|
44060
44091
|
init_errors();
|
|
44061
44092
|
|
|
44062
44093
|
// src/session/store.ts
|
|
@@ -44414,6 +44445,7 @@ var SessionsClient = class {
|
|
|
44414
44445
|
|
|
44415
44446
|
// src/tui/REPL.tsx
|
|
44416
44447
|
init_load();
|
|
44448
|
+
init_crypto();
|
|
44417
44449
|
|
|
44418
44450
|
// src/session/history.ts
|
|
44419
44451
|
var import_proper_lockfile = __toESM(require_proper_lockfile(), 1);
|
|
@@ -44571,7 +44603,48 @@ function handleVimKey(state, buffer, key) {
|
|
|
44571
44603
|
|
|
44572
44604
|
// src/tui/REPL.tsx
|
|
44573
44605
|
init_modes();
|
|
44574
|
-
|
|
44606
|
+
|
|
44607
|
+
// src/utils/update-check.ts
|
|
44608
|
+
var PACKAGE = "@kryvenaiofficial/kryven";
|
|
44609
|
+
var REGISTRY_LATEST = `https://registry.npmjs.org/${PACKAGE}/latest`;
|
|
44610
|
+
var SEMVER = /^(\d+)\.(\d+)\.(\d+)/;
|
|
44611
|
+
function compareSemver(a2, b) {
|
|
44612
|
+
const pa = SEMVER.exec(a2);
|
|
44613
|
+
const pb = SEMVER.exec(b);
|
|
44614
|
+
if (!pa || !pb) return 0;
|
|
44615
|
+
for (let i2 = 1; i2 <= 3; i2++) {
|
|
44616
|
+
const da = Number(pa[i2]);
|
|
44617
|
+
const db = Number(pb[i2]);
|
|
44618
|
+
if (da !== db) return da - db;
|
|
44619
|
+
}
|
|
44620
|
+
return 0;
|
|
44621
|
+
}
|
|
44622
|
+
async function checkForUpdate(current, timeoutMs = 2500) {
|
|
44623
|
+
if (!current || !SEMVER.test(current)) return null;
|
|
44624
|
+
try {
|
|
44625
|
+
const ac = new AbortController();
|
|
44626
|
+
const timer = setTimeout(() => ac.abort(), timeoutMs);
|
|
44627
|
+
let res;
|
|
44628
|
+
try {
|
|
44629
|
+
res = await fetch(REGISTRY_LATEST, {
|
|
44630
|
+
signal: ac.signal,
|
|
44631
|
+
headers: { accept: "application/json" }
|
|
44632
|
+
});
|
|
44633
|
+
} finally {
|
|
44634
|
+
clearTimeout(timer);
|
|
44635
|
+
}
|
|
44636
|
+
if (!res.ok) return null;
|
|
44637
|
+
const j = await res.json();
|
|
44638
|
+
const latest = String(j?.version ?? "");
|
|
44639
|
+
if (!SEMVER.test(latest)) return null;
|
|
44640
|
+
return { updateAvailable: compareSemver(latest, current) > 0, latest };
|
|
44641
|
+
} catch {
|
|
44642
|
+
return null;
|
|
44643
|
+
}
|
|
44644
|
+
}
|
|
44645
|
+
|
|
44646
|
+
// src/tui/REPL.tsx
|
|
44647
|
+
var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1);
|
|
44575
44648
|
import fs4 from "node:fs";
|
|
44576
44649
|
import path8 from "node:path";
|
|
44577
44650
|
function detectReflectCommand(cwd2) {
|
|
@@ -44610,23 +44683,26 @@ var REPL = ({
|
|
|
44610
44683
|
cwd: cwd2,
|
|
44611
44684
|
resumeMessages,
|
|
44612
44685
|
resumeSessionId,
|
|
44613
|
-
isGuest = false,
|
|
44686
|
+
isGuest: initialIsGuest = false,
|
|
44614
44687
|
noMotion: _noMotion = false,
|
|
44615
44688
|
themeOverride: _themeOverride,
|
|
44616
44689
|
seedPrompt
|
|
44617
44690
|
}) => {
|
|
44618
44691
|
const app = use_app_default();
|
|
44692
|
+
const clientRef = (0, import_react27.useRef)(client);
|
|
44693
|
+
const [isGuest, setIsGuest] = (0, import_react27.useState)(initialIsGuest);
|
|
44619
44694
|
const conversationRef = (0, import_react27.useRef)(new Conversation());
|
|
44620
44695
|
const sessionRef = (0, import_react27.useRef)(new SessionStore(resumeSessionId));
|
|
44621
44696
|
const remoteSessionRef = (0, import_react27.useRef)(null);
|
|
44622
44697
|
const abortRef = (0, import_react27.useRef)(null);
|
|
44623
44698
|
const permissionResolveRef = (0, import_react27.useRef)(null);
|
|
44624
44699
|
const readPathsRef = (0, import_react27.useRef)(/* @__PURE__ */ new Set());
|
|
44700
|
+
const toolMetaRef = (0, import_react27.useRef)(/* @__PURE__ */ new Map());
|
|
44625
44701
|
(0, import_react27.useEffect)(() => {
|
|
44626
44702
|
if (isGuest) return;
|
|
44627
44703
|
const cfg = resolveConfig();
|
|
44628
44704
|
if (cfg.apiKey && cfg.telemetry !== false) {
|
|
44629
|
-
const sessionsClient = new SessionsClient(
|
|
44705
|
+
const sessionsClient = new SessionsClient(clientRef.current);
|
|
44630
44706
|
remoteSessionRef.current = new RemoteSessionStore(
|
|
44631
44707
|
sessionRef.current.id,
|
|
44632
44708
|
sessionsClient,
|
|
@@ -44652,6 +44728,9 @@ var REPL = ({
|
|
|
44652
44728
|
const [sessionTokens, setSessionTokens] = (0, import_react27.useState)(0);
|
|
44653
44729
|
const [toolEntries, setToolEntries] = (0, import_react27.useState)([]);
|
|
44654
44730
|
const [permissionReq, setPermissionReq] = (0, import_react27.useState)(null);
|
|
44731
|
+
const [modelPicker, setModelPicker] = (0, import_react27.useState)(null);
|
|
44732
|
+
const [staticGen, setStaticGen] = (0, import_react27.useState)(0);
|
|
44733
|
+
const prevCommittedCountRef = (0, import_react27.useRef)(0);
|
|
44655
44734
|
const cfgRef = (0, import_react27.useRef)(resolveConfig());
|
|
44656
44735
|
const vimEnabledRef = (0, import_react27.useRef)(cfgRef.current.vim === true);
|
|
44657
44736
|
const vimRef = (0, import_react27.useRef)(initialVim());
|
|
@@ -44694,6 +44773,18 @@ var REPL = ({
|
|
|
44694
44773
|
}, []);
|
|
44695
44774
|
const toolsEnabled = (0, import_react27.useMemo)(() => listTools().length > 0, []);
|
|
44696
44775
|
(0, import_react27.useEffect)(() => {
|
|
44776
|
+
void checkForUpdate("0.2.4").then((info) => {
|
|
44777
|
+
if (info?.updateAvailable) {
|
|
44778
|
+
setNotes((p) => [
|
|
44779
|
+
...p,
|
|
44780
|
+
{
|
|
44781
|
+
kind: "system",
|
|
44782
|
+
text: `Update available: ${"0.2.4"} \u2192 ${info.latest}. Run \`kryven update\` to update.`
|
|
44783
|
+
}
|
|
44784
|
+
]);
|
|
44785
|
+
}
|
|
44786
|
+
}).catch(() => {
|
|
44787
|
+
});
|
|
44697
44788
|
void (async () => {
|
|
44698
44789
|
if (resumeMessages?.length) {
|
|
44699
44790
|
for (const m of resumeMessages) conversationRef.current.append(m);
|
|
@@ -44723,6 +44814,30 @@ var REPL = ({
|
|
|
44723
44814
|
}
|
|
44724
44815
|
}, [input, busy, permissionReq, overlay, cwd2]);
|
|
44725
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
|
+
}
|
|
44726
44841
|
if (permissionReq && permissionResolveRef.current) {
|
|
44727
44842
|
const ch = inputCh.toLowerCase();
|
|
44728
44843
|
let decision = null;
|
|
@@ -44791,7 +44906,37 @@ var REPL = ({
|
|
|
44791
44906
|
sessionTokens,
|
|
44792
44907
|
sessionMessages: conversationRef.current.size(),
|
|
44793
44908
|
setModel: (m) => setModel(m),
|
|
44794
|
-
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
|
+
}
|
|
44795
44940
|
}),
|
|
44796
44941
|
[model, mood, cwd2, sessionTokens]
|
|
44797
44942
|
);
|
|
@@ -44811,7 +44956,7 @@ var REPL = ({
|
|
|
44811
44956
|
if (remoteSessionRef.current) {
|
|
44812
44957
|
const cfg = resolveConfig();
|
|
44813
44958
|
if (cfg.apiKey && cfg.telemetry !== false) {
|
|
44814
|
-
const sessionsClient = new SessionsClient(
|
|
44959
|
+
const sessionsClient = new SessionsClient(clientRef.current);
|
|
44815
44960
|
remoteSessionRef.current = new RemoteSessionStore(
|
|
44816
44961
|
sessionRef.current.id,
|
|
44817
44962
|
sessionsClient,
|
|
@@ -44835,7 +44980,7 @@ var REPL = ({
|
|
|
44835
44980
|
if (remoteSessionRef.current) {
|
|
44836
44981
|
const cfg = resolveConfig();
|
|
44837
44982
|
if (cfg.apiKey && cfg.telemetry !== false) {
|
|
44838
|
-
const sessionsClient = new SessionsClient(
|
|
44983
|
+
const sessionsClient = new SessionsClient(clientRef.current);
|
|
44839
44984
|
remoteSessionRef.current = new RemoteSessionStore(
|
|
44840
44985
|
sessionRef.current.id,
|
|
44841
44986
|
sessionsClient,
|
|
@@ -44858,6 +45003,11 @@ var REPL = ({
|
|
|
44858
45003
|
case "render":
|
|
44859
45004
|
setOverlay(res.element);
|
|
44860
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
|
+
}
|
|
44861
45011
|
}
|
|
44862
45012
|
};
|
|
44863
45013
|
const askPermission = (req) => new Promise((resolve7) => {
|
|
@@ -44936,7 +45086,7 @@ var REPL = ({
|
|
|
44936
45086
|
}
|
|
44937
45087
|
};
|
|
44938
45088
|
const runGuestTurn = async (ac) => {
|
|
44939
|
-
const guestClient =
|
|
45089
|
+
const guestClient = clientRef.current;
|
|
44940
45090
|
setStreaming("");
|
|
44941
45091
|
const allMessages = conversationRef.current.all().map((m) => ({
|
|
44942
45092
|
role: m.role,
|
|
@@ -44950,6 +45100,8 @@ var REPL = ({
|
|
|
44950
45100
|
ts: Date.now()
|
|
44951
45101
|
};
|
|
44952
45102
|
conversationRef.current.append(assistant);
|
|
45103
|
+
setStreaming(null);
|
|
45104
|
+
forceRender((n2) => n2 + 1);
|
|
44953
45105
|
void sessionRef.current.appendMessage(assistant);
|
|
44954
45106
|
const remaining = res.kryven_guest?.messagesRemaining;
|
|
44955
45107
|
if (typeof remaining === "number") {
|
|
@@ -44967,7 +45119,7 @@ var REPL = ({
|
|
|
44967
45119
|
setStreaming("");
|
|
44968
45120
|
let acc = "";
|
|
44969
45121
|
let usage;
|
|
44970
|
-
for await (const ev of runTurn(
|
|
45122
|
+
for await (const ev of runTurn(clientRef.current, conversationRef.current, {
|
|
44971
45123
|
systemPrompt: sys,
|
|
44972
45124
|
model,
|
|
44973
45125
|
mood,
|
|
@@ -44987,6 +45139,8 @@ var REPL = ({
|
|
|
44987
45139
|
usage
|
|
44988
45140
|
};
|
|
44989
45141
|
conversationRef.current.append(assistant);
|
|
45142
|
+
setStreaming(null);
|
|
45143
|
+
forceRender((n2) => n2 + 1);
|
|
44990
45144
|
void sessionRef.current.appendMessage(assistant);
|
|
44991
45145
|
if (remoteSessionRef.current) {
|
|
44992
45146
|
void remoteSessionRef.current.appendMessage(assistant).catch(() => {
|
|
@@ -45014,7 +45168,7 @@ var REPL = ({
|
|
|
45014
45168
|
}
|
|
45015
45169
|
};
|
|
45016
45170
|
const reflectCmd = detectReflectCommand(cwd2);
|
|
45017
|
-
for await (const ev of runAgentLoopWithTools(
|
|
45171
|
+
for await (const ev of runAgentLoopWithTools(clientRef.current, conversationRef.current, {
|
|
45018
45172
|
systemPrompt: sys,
|
|
45019
45173
|
model,
|
|
45020
45174
|
mood,
|
|
@@ -45042,44 +45196,58 @@ var REPL = ({
|
|
|
45042
45196
|
setStreaming(null);
|
|
45043
45197
|
streamAcc = "";
|
|
45044
45198
|
flushPersistableTurns();
|
|
45045
|
-
|
|
45046
|
-
|
|
45047
|
-
{
|
|
45199
|
+
{
|
|
45200
|
+
const entry = {
|
|
45048
45201
|
callId: ev.call.id,
|
|
45049
45202
|
toolName: ev.call.function.name,
|
|
45050
45203
|
argsPreview: shortArgs(ev.call.function.arguments),
|
|
45051
45204
|
status: "running",
|
|
45052
45205
|
risk: ev.risk
|
|
45053
|
-
}
|
|
45054
|
-
]);
|
|
45055
|
-
break;
|
|
45056
|
-
case "tool_result":
|
|
45057
|
-
setToolEntries(
|
|
45058
|
-
(prev) => prev.map(
|
|
45059
|
-
(e) => e.callId === ev.callId ? { ...e, status: ev.ok ? "ok" : "error", output: ev.output, truncated: ev.truncated, renderHint: ev.renderHint } : e
|
|
45060
|
-
)
|
|
45061
|
-
);
|
|
45062
|
-
{
|
|
45063
|
-
const toolMsg = {
|
|
45064
|
-
role: "tool",
|
|
45065
|
-
content: ev.output,
|
|
45066
|
-
tool_call_id: ev.callId,
|
|
45067
|
-
ts: Date.now()
|
|
45068
45206
|
};
|
|
45069
|
-
|
|
45070
|
-
|
|
45071
|
-
void remoteSessionRef.current.appendMessage(toolMsg).catch(() => {
|
|
45072
|
-
});
|
|
45073
|
-
}
|
|
45207
|
+
toolMetaRef.current.set(entry.callId, entry);
|
|
45208
|
+
setToolEntries((prev) => [...prev, entry]);
|
|
45074
45209
|
}
|
|
45075
45210
|
break;
|
|
45076
|
-
case "
|
|
45077
|
-
|
|
45078
|
-
|
|
45079
|
-
|
|
45080
|
-
|
|
45081
|
-
|
|
45211
|
+
case "tool_result": {
|
|
45212
|
+
const finalStatus = ev.ok ? "ok" : "error";
|
|
45213
|
+
const prevMeta = toolMetaRef.current.get(ev.callId);
|
|
45214
|
+
toolMetaRef.current.set(ev.callId, {
|
|
45215
|
+
callId: ev.callId,
|
|
45216
|
+
toolName: prevMeta?.toolName ?? ev.toolName,
|
|
45217
|
+
argsPreview: prevMeta?.argsPreview ?? "",
|
|
45218
|
+
risk: prevMeta?.risk,
|
|
45219
|
+
status: finalStatus,
|
|
45220
|
+
output: ev.output,
|
|
45221
|
+
truncated: ev.truncated,
|
|
45222
|
+
renderHint: ev.renderHint
|
|
45223
|
+
});
|
|
45224
|
+
setToolEntries((prev) => prev.filter((e) => e.callId !== ev.callId));
|
|
45225
|
+
const toolMsg = {
|
|
45226
|
+
role: "tool",
|
|
45227
|
+
content: ev.output,
|
|
45228
|
+
tool_call_id: ev.callId,
|
|
45229
|
+
ts: Date.now()
|
|
45230
|
+
};
|
|
45231
|
+
void sessionRef.current.appendMessage(toolMsg);
|
|
45232
|
+
if (remoteSessionRef.current) {
|
|
45233
|
+
void remoteSessionRef.current.appendMessage(toolMsg).catch(() => {
|
|
45234
|
+
});
|
|
45235
|
+
}
|
|
45082
45236
|
break;
|
|
45237
|
+
}
|
|
45238
|
+
case "tool_blocked": {
|
|
45239
|
+
const prevMeta = toolMetaRef.current.get(ev.callId);
|
|
45240
|
+
toolMetaRef.current.set(ev.callId, {
|
|
45241
|
+
callId: ev.callId,
|
|
45242
|
+
toolName: prevMeta?.toolName ?? ev.toolName,
|
|
45243
|
+
argsPreview: prevMeta?.argsPreview ?? "",
|
|
45244
|
+
risk: prevMeta?.risk,
|
|
45245
|
+
status: "blocked",
|
|
45246
|
+
output: ev.reason
|
|
45247
|
+
});
|
|
45248
|
+
setToolEntries((prev) => prev.filter((e) => e.callId !== ev.callId));
|
|
45249
|
+
break;
|
|
45250
|
+
}
|
|
45083
45251
|
case "end_turn":
|
|
45084
45252
|
endedNormally = true;
|
|
45085
45253
|
setStreaming(null);
|
|
@@ -45115,6 +45283,7 @@ var REPL = ({
|
|
|
45115
45283
|
logger.debug("tools turn ended without end_turn event");
|
|
45116
45284
|
}
|
|
45117
45285
|
};
|
|
45286
|
+
const convSize = conversationRef.current.size();
|
|
45118
45287
|
const status = {
|
|
45119
45288
|
model,
|
|
45120
45289
|
mood,
|
|
@@ -45122,71 +45291,119 @@ var REPL = ({
|
|
|
45122
45291
|
branch: git.branch,
|
|
45123
45292
|
dirty: git.dirty,
|
|
45124
45293
|
sessionTokens,
|
|
45125
|
-
sessionMessages:
|
|
45294
|
+
sessionMessages: convSize,
|
|
45126
45295
|
costUsd: sessionCostUsd(conversationRef.current.all(), model),
|
|
45127
45296
|
mode: getPermissionMode()
|
|
45128
45297
|
};
|
|
45129
|
-
|
|
45130
|
-
|
|
45131
|
-
|
|
45132
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Text, { bold: true, color: "cyan", children: [
|
|
45133
|
-
"Kryven CLI ",
|
|
45134
|
-
"0.2.2",
|
|
45135
|
-
toolsEnabled ? " \xB7 tools enabled" : ""
|
|
45136
|
-
] }),
|
|
45137
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: "gray", children: "Powered by KRY-5.2 Extended \xB7 type /help \xB7 Ctrl+D to exit" })
|
|
45138
|
-
] }),
|
|
45139
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
45140
|
-
MessageList,
|
|
45298
|
+
const staticItems = (0, import_react27.useMemo)(() => {
|
|
45299
|
+
const gen = `g${staticGen}`;
|
|
45300
|
+
const items = [
|
|
45141
45301
|
{
|
|
45142
|
-
|
|
45143
|
-
|
|
45302
|
+
id: `${gen}-header`,
|
|
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: [
|
|
45306
|
+
"Kryven CLI ",
|
|
45307
|
+
"0.2.4",
|
|
45308
|
+
toolsEnabled ? " \xB7 tools enabled" : ""
|
|
45309
|
+
] }),
|
|
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" })
|
|
45311
|
+
] })
|
|
45144
45312
|
}
|
|
45145
|
-
|
|
45146
|
-
|
|
45147
|
-
|
|
45148
|
-
|
|
45149
|
-
|
|
45313
|
+
];
|
|
45314
|
+
const all = conversationRef.current.all();
|
|
45315
|
+
const callInfo = /* @__PURE__ */ new Map();
|
|
45316
|
+
for (const mm of all) {
|
|
45317
|
+
if (mm.role === "assistant" && Array.isArray(mm.tool_calls)) {
|
|
45318
|
+
for (const c3 of mm.tool_calls) {
|
|
45319
|
+
callInfo.set(c3.id, {
|
|
45320
|
+
toolName: c3.function?.name ?? "tool",
|
|
45321
|
+
argsPreview: shortArgs(c3.function?.arguments ?? "")
|
|
45322
|
+
});
|
|
45323
|
+
}
|
|
45324
|
+
}
|
|
45325
|
+
}
|
|
45326
|
+
for (let i2 = 0; i2 < all.length; i2++) {
|
|
45327
|
+
const m = all[i2];
|
|
45328
|
+
if (m.role === "user") {
|
|
45329
|
+
items.push({ id: `${gen}-m${i2}`, node: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MessageList, { message: m }) });
|
|
45330
|
+
} else if (m.role === "assistant") {
|
|
45331
|
+
if (typeof m.content === "string" && m.content.trim().length > 0) {
|
|
45332
|
+
items.push({ id: `${gen}-m${i2}`, node: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MessageList, { message: m }) });
|
|
45333
|
+
}
|
|
45334
|
+
} else if (m.role === "tool") {
|
|
45335
|
+
const meta = m.tool_call_id ? toolMetaRef.current.get(m.tool_call_id) : void 0;
|
|
45336
|
+
const info = m.tool_call_id ? callInfo.get(m.tool_call_id) : void 0;
|
|
45337
|
+
const entry = meta ?? {
|
|
45338
|
+
callId: m.tool_call_id ?? `t${i2}`,
|
|
45339
|
+
toolName: info?.toolName ?? "tool",
|
|
45340
|
+
argsPreview: info?.argsPreview ?? "",
|
|
45341
|
+
status: "ok",
|
|
45342
|
+
output: typeof m.content === "string" ? m.content : ""
|
|
45343
|
+
};
|
|
45344
|
+
items.push({ id: `${gen}-t${i2}`, node: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ToolCall, { ...entry }) });
|
|
45345
|
+
}
|
|
45346
|
+
}
|
|
45347
|
+
return items;
|
|
45348
|
+
}, [convSize, staticGen, toolsEnabled]);
|
|
45349
|
+
const committedCount = staticItems.length;
|
|
45350
|
+
(0, import_react27.useEffect)(() => {
|
|
45351
|
+
if (committedCount < prevCommittedCountRef.current) {
|
|
45352
|
+
setStaticGen((g) => g + 1);
|
|
45353
|
+
}
|
|
45354
|
+
prevCommittedCountRef.current = committedCount;
|
|
45355
|
+
}, [committedCount]);
|
|
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 }) })
|
|
45361
|
+
] }),
|
|
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: [
|
|
45150
45367
|
"Tool: ",
|
|
45151
|
-
/* @__PURE__ */ (0,
|
|
45368
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: "cyan", children: permissionReq.toolName }),
|
|
45152
45369
|
" ",
|
|
45153
|
-
/* @__PURE__ */ (0,
|
|
45370
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Text, { color: riskColor(permissionReq.risk), children: [
|
|
45154
45371
|
"[",
|
|
45155
45372
|
permissionReq.risk,
|
|
45156
45373
|
"]"
|
|
45157
45374
|
] })
|
|
45158
45375
|
] }),
|
|
45159
|
-
/* @__PURE__ */ (0,
|
|
45160
|
-
/* @__PURE__ */ (0,
|
|
45161
|
-
/* @__PURE__ */ (0,
|
|
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]" }),
|
|
45162
45379
|
" allow once \xB7",
|
|
45163
45380
|
" ",
|
|
45164
|
-
/* @__PURE__ */ (0,
|
|
45381
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: "green", children: "[A]" }),
|
|
45165
45382
|
" always (this command) \xB7",
|
|
45166
45383
|
" ",
|
|
45167
|
-
/* @__PURE__ */ (0,
|
|
45384
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: "green", children: "[Shift+A]" }),
|
|
45168
45385
|
" always (this tool) \xB7",
|
|
45169
45386
|
" ",
|
|
45170
|
-
/* @__PURE__ */ (0,
|
|
45387
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: "red", children: "[N]" }),
|
|
45171
45388
|
" deny"
|
|
45172
45389
|
] })
|
|
45173
45390
|
] }),
|
|
45174
|
-
notes.length > 0 && /* @__PURE__ */ (0,
|
|
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: [
|
|
45175
45392
|
n2.kind === "error" ? "\u2717 " : "\xB7 ",
|
|
45176
45393
|
n2.text
|
|
45177
45394
|
] }, i2)) }),
|
|
45178
|
-
overlay && /* @__PURE__ */ (0,
|
|
45395
|
+
overlay && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Box_default, { marginBottom: 1, flexDirection: "column", children: [
|
|
45179
45396
|
overlay,
|
|
45180
|
-
/* @__PURE__ */ (0,
|
|
45397
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: "gray", children: "(press Enter or Esc to dismiss)" })
|
|
45181
45398
|
] }),
|
|
45182
|
-
completion && completion.items.length > 0 && /* @__PURE__ */ (0,
|
|
45183
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
45184
45401
|
PromptInput,
|
|
45185
45402
|
{
|
|
45186
45403
|
value: input,
|
|
45187
45404
|
onChange: setInput,
|
|
45188
45405
|
onSubmit: submit,
|
|
45189
|
-
disabled: busy || Boolean(permissionReq),
|
|
45406
|
+
disabled: busy || Boolean(permissionReq) || Boolean(modelPicker),
|
|
45190
45407
|
placeholder: busy ? "" : void 0,
|
|
45191
45408
|
vimMode: vimEnabledRef.current ? vimRef.current.mode : null,
|
|
45192
45409
|
vimCmdline: vimEnabledRef.current ? vimRef.current.cmdline : null,
|
|
@@ -45194,8 +45411,8 @@ var REPL = ({
|
|
|
45194
45411
|
},
|
|
45195
45412
|
`pi-${vimTick}`
|
|
45196
45413
|
),
|
|
45197
|
-
/* @__PURE__ */ (0,
|
|
45198
|
-
/* @__PURE__ */ (0,
|
|
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 }) })
|
|
45199
45416
|
] });
|
|
45200
45417
|
};
|
|
45201
45418
|
|
|
@@ -45458,7 +45675,188 @@ async function bootstrapMCP(opts = {}) {
|
|
|
45458
45675
|
|
|
45459
45676
|
// src/commands/chat.ts
|
|
45460
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
|
|
45461
45858
|
async function chatCommand(opts = {}) {
|
|
45859
|
+
await maybeRunFirstRunSetup({ apiKey: opts.apiKey });
|
|
45462
45860
|
const cfg = resolveConfig(opts.apiKey);
|
|
45463
45861
|
let client;
|
|
45464
45862
|
let isGuest = false;
|
|
@@ -45467,7 +45865,7 @@ async function chatCommand(opts = {}) {
|
|
|
45467
45865
|
client = new GuestKryvenClient({
|
|
45468
45866
|
baseUrl: cfg.apiBaseUrl,
|
|
45469
45867
|
shareFingerprint: cfg.shareFingerprint !== false,
|
|
45470
|
-
userAgent: `kryven-cli/${"0.2.
|
|
45868
|
+
userAgent: `kryven-cli/${"0.2.4"}`
|
|
45471
45869
|
});
|
|
45472
45870
|
console.log(source_default.cyan("Guest mode \u2014 3 free prompts. Run `kryven login` for unlimited chat."));
|
|
45473
45871
|
} else {
|
|
@@ -45475,7 +45873,7 @@ async function chatCommand(opts = {}) {
|
|
|
45475
45873
|
apiKey: cfg.apiKey,
|
|
45476
45874
|
baseUrl: cfg.apiBaseUrl,
|
|
45477
45875
|
clientType: "ide",
|
|
45478
|
-
userAgent: `kryven-cli/${"0.2.
|
|
45876
|
+
userAgent: `kryven-cli/${"0.2.4"}`
|
|
45479
45877
|
});
|
|
45480
45878
|
}
|
|
45481
45879
|
let resumeMessages;
|
|
@@ -45542,7 +45940,7 @@ async function chatCommand(opts = {}) {
|
|
|
45542
45940
|
logger.warn("config save (touch) failed", String(err));
|
|
45543
45941
|
}
|
|
45544
45942
|
const { waitUntilExit } = render_default(
|
|
45545
|
-
|
|
45943
|
+
import_react29.default.createElement(REPL, {
|
|
45546
45944
|
client,
|
|
45547
45945
|
initialModel: model,
|
|
45548
45946
|
initialMood: mood,
|
|
@@ -45559,6 +45957,38 @@ async function chatCommand(opts = {}) {
|
|
|
45559
45957
|
await waitUntilExit();
|
|
45560
45958
|
}
|
|
45561
45959
|
|
|
45960
|
+
// src/commands/update.ts
|
|
45961
|
+
init_execa();
|
|
45962
|
+
|
|
45963
|
+
// src/shims/version.ts
|
|
45964
|
+
var KRYVEN_VERSION = "0.2.4";
|
|
45965
|
+
|
|
45966
|
+
// src/commands/update.ts
|
|
45967
|
+
var PACKAGE2 = "@kryvenaiofficial/kryven";
|
|
45968
|
+
async function updateCommand() {
|
|
45969
|
+
console.log(source_default.bold(`Updating ${PACKAGE2} to the latest version\u2026`));
|
|
45970
|
+
console.log(source_default.dim(` current: ${KRYVEN_VERSION}`));
|
|
45971
|
+
try {
|
|
45972
|
+
await execa("npm", ["install", "-g", `${PACKAGE2}@latest`], { stdio: "inherit" });
|
|
45973
|
+
console.log(
|
|
45974
|
+
source_default.green(`
|
|
45975
|
+
\u2713 Update complete. Run `) + source_default.bold(`kryven --version`) + source_default.green(` to confirm, then start with `) + source_default.bold(`kryven`) + source_default.green(`.`)
|
|
45976
|
+
);
|
|
45977
|
+
} catch (err) {
|
|
45978
|
+
console.error(source_default.red(`
|
|
45979
|
+
\u2717 Update failed: ${err.message}`));
|
|
45980
|
+
console.error(
|
|
45981
|
+
source_default.yellow(
|
|
45982
|
+
`Update manually with:
|
|
45983
|
+
npm install -g ${PACKAGE2}@latest
|
|
45984
|
+
On macOS/Linux a global install may need sudo:
|
|
45985
|
+
sudo npm install -g ${PACKAGE2}@latest`
|
|
45986
|
+
)
|
|
45987
|
+
);
|
|
45988
|
+
process.exit(1);
|
|
45989
|
+
}
|
|
45990
|
+
}
|
|
45991
|
+
|
|
45562
45992
|
// src/commands/skills.ts
|
|
45563
45993
|
import { writeFile as writeFile11, mkdir as mkdir13 } from "node:fs/promises";
|
|
45564
45994
|
import { existsSync as existsSync23 } from "node:fs";
|
|
@@ -45839,9 +46269,6 @@ async function bgWait(id, timeoutMs = 30 * 60 * 1e3) {
|
|
|
45839
46269
|
process.exit(124);
|
|
45840
46270
|
}
|
|
45841
46271
|
|
|
45842
|
-
// src/shims/version.ts
|
|
45843
|
-
var KRYVEN_VERSION = "0.2.2";
|
|
45844
|
-
|
|
45845
46272
|
// src/main.tsx
|
|
45846
46273
|
async function main(argv2) {
|
|
45847
46274
|
const bgRunIdx = argv2.indexOf("--bg-run");
|
|
@@ -45863,6 +46290,9 @@ async function main(argv2) {
|
|
|
45863
46290
|
program2.command("models").description("List models exposed by /v1/models").action(async () => {
|
|
45864
46291
|
await modelsCommand();
|
|
45865
46292
|
});
|
|
46293
|
+
program2.command("update").description("Update the Kryven CLI to the latest published version").action(async () => {
|
|
46294
|
+
await updateCommand();
|
|
46295
|
+
});
|
|
45866
46296
|
program2.command("chat", { isDefault: true }).description("Launch the chat REPL (default subcommand)").argument("[prompt...]", "Optional inline prompt to seed the session").action(async (promptParts, _options, cmd) => {
|
|
45867
46297
|
const opts = cmd.optsWithGlobals();
|
|
45868
46298
|
const seed = promptParts && promptParts.length ? promptParts.join(" ") : void 0;
|
|
@@ -45912,13 +46342,13 @@ async function main(argv2) {
|
|
|
45912
46342
|
var argv = process.argv.slice(2);
|
|
45913
46343
|
var first = argv[0];
|
|
45914
46344
|
if (first === "--version" || first === "-v" || first === "-V") {
|
|
45915
|
-
const v = "0.2.
|
|
46345
|
+
const v = "0.2.4";
|
|
45916
46346
|
process.stdout.write(v + "\n");
|
|
45917
46347
|
process.exit(0);
|
|
45918
46348
|
}
|
|
45919
46349
|
if (first === "--help" || first === "-h") {
|
|
45920
46350
|
process.stdout.write(
|
|
45921
|
-
"Usage: kryven [command] [options]\n\nCommands:\n kryven Launch chat REPL in current directory\n kryven login Save your kry_sk_* API key\n kryven logout Remove stored key\n kryven status Show config + model availability\n kryven models List /v1/models\n\nOptions:\n -v, --version Print version\n -h, --help Show this help\n --api-key <key> Override stored key for this run\n --model <id> Override default model\n --mood <name> Override default mood\n --resume <id> Resume a prior session\n\nDocs: https://kryven.cc/docs/cli\n"
|
|
46351
|
+
"Usage: kryven [command] [options]\n\nCommands:\n kryven Launch chat REPL in current directory\n kryven login Save your kry_sk_* API key\n kryven logout Remove stored key\n kryven status Show config + model availability\n kryven models List /v1/models\n kryven update Update the CLI to the latest version\n\nOptions:\n -v, --version Print version\n -h, --help Show this help\n --api-key <key> Override stored key for this run\n --model <id> Override default model\n --mood <name> Override default mood\n --resume <id> Resume a prior session\n\nDocs: https://kryven.cc/docs/cli\n"
|
|
45922
46352
|
);
|
|
45923
46353
|
process.exit(0);
|
|
45924
46354
|
}
|