@kvman/kvcoder 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/files/edit-text.d.ts.map +1 -1
- package/dist/files/edit-text.js +7 -5
- package/dist/files/edit-text.js.map +1 -1
- package/dist/web/components/call.css +1 -1
- package/dist/web/components/connectors.css +1 -1
- package/dist/web/components/conversation.css +1 -1
- package/dist/web/components/conversation.js +650 -637
- package/dist/web/components/mcp-sign-in.css +1 -1
- package/dist/web/components/model.css +1 -1
- package/dist/web/components/question.css +1 -1
- package/dist/web/components/sessions.css +1 -1
- package/locales/ar.json +7 -2
- package/locales/en.json +7 -2
- package/package.json +1 -1
|
@@ -190,14 +190,14 @@ var ee = U({
|
|
|
190
190
|
d: "m6 9 6 6 6-6",
|
|
191
191
|
key: "qrunsl"
|
|
192
192
|
}]]
|
|
193
|
-
}),
|
|
193
|
+
}), J = U({
|
|
194
194
|
name: "chevron-right",
|
|
195
195
|
size: 24,
|
|
196
196
|
node: [["path", {
|
|
197
197
|
d: "m9 18 6-6-6-6",
|
|
198
198
|
key: "mthhwq"
|
|
199
199
|
}]]
|
|
200
|
-
}),
|
|
200
|
+
}), re = U({
|
|
201
201
|
name: "circle-check",
|
|
202
202
|
size: 24,
|
|
203
203
|
node: [["circle", {
|
|
@@ -210,7 +210,7 @@ var ee = U({
|
|
|
210
210
|
key: "xofnsj"
|
|
211
211
|
}]],
|
|
212
212
|
aliases: ["check-circle-2"]
|
|
213
|
-
}),
|
|
213
|
+
}), ie = U({
|
|
214
214
|
name: "circle-question-mark",
|
|
215
215
|
size: 24,
|
|
216
216
|
node: [
|
|
@@ -230,7 +230,7 @@ var ee = U({
|
|
|
230
230
|
}]
|
|
231
231
|
],
|
|
232
232
|
aliases: ["help-circle", "circle-help"]
|
|
233
|
-
}),
|
|
233
|
+
}), ae = U({
|
|
234
234
|
name: "code",
|
|
235
235
|
size: 24,
|
|
236
236
|
node: [["path", {
|
|
@@ -240,7 +240,7 @@ var ee = U({
|
|
|
240
240
|
d: "m8 6-6 6 6 6",
|
|
241
241
|
key: "ppft3o"
|
|
242
242
|
}]]
|
|
243
|
-
}),
|
|
243
|
+
}), oe = U({
|
|
244
244
|
name: "copy",
|
|
245
245
|
size: 24,
|
|
246
246
|
node: [["rect", {
|
|
@@ -255,7 +255,7 @@ var ee = U({
|
|
|
255
255
|
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",
|
|
256
256
|
key: "zix9uf"
|
|
257
257
|
}]]
|
|
258
|
-
}),
|
|
258
|
+
}), se = U({
|
|
259
259
|
name: "ellipsis",
|
|
260
260
|
size: 24,
|
|
261
261
|
node: [
|
|
@@ -279,7 +279,7 @@ var ee = U({
|
|
|
279
279
|
}]
|
|
280
280
|
],
|
|
281
281
|
aliases: ["more-horizontal"]
|
|
282
|
-
}),
|
|
282
|
+
}), ce = U({
|
|
283
283
|
name: "external-link",
|
|
284
284
|
size: 24,
|
|
285
285
|
node: [
|
|
@@ -296,7 +296,7 @@ var ee = U({
|
|
|
296
296
|
key: "a6xqqp"
|
|
297
297
|
}]
|
|
298
298
|
]
|
|
299
|
-
}),
|
|
299
|
+
}), le = U({
|
|
300
300
|
name: "eye",
|
|
301
301
|
size: 24,
|
|
302
302
|
node: [["path", {
|
|
@@ -308,7 +308,7 @@ var ee = U({
|
|
|
308
308
|
r: "3",
|
|
309
309
|
key: "1v7zrd"
|
|
310
310
|
}]]
|
|
311
|
-
}),
|
|
311
|
+
}), ue = U({
|
|
312
312
|
name: "info",
|
|
313
313
|
size: 24,
|
|
314
314
|
node: [
|
|
@@ -327,7 +327,7 @@ var ee = U({
|
|
|
327
327
|
key: "e9boi3"
|
|
328
328
|
}]
|
|
329
329
|
]
|
|
330
|
-
}),
|
|
330
|
+
}), de = U({
|
|
331
331
|
name: "notebook-text",
|
|
332
332
|
size: 24,
|
|
333
333
|
node: [
|
|
@@ -368,7 +368,7 @@ var ee = U({
|
|
|
368
368
|
key: "p1seyn"
|
|
369
369
|
}]
|
|
370
370
|
]
|
|
371
|
-
}),
|
|
371
|
+
}), fe = U({
|
|
372
372
|
name: "panel-right",
|
|
373
373
|
size: 24,
|
|
374
374
|
node: [["rect", {
|
|
@@ -382,14 +382,14 @@ var ee = U({
|
|
|
382
382
|
d: "M15 3v18",
|
|
383
383
|
key: "14nvp0"
|
|
384
384
|
}]]
|
|
385
|
-
}),
|
|
385
|
+
}), pe = U({
|
|
386
386
|
name: "paperclip",
|
|
387
387
|
size: 24,
|
|
388
388
|
node: [["path", {
|
|
389
389
|
d: "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",
|
|
390
390
|
key: "1miecu"
|
|
391
391
|
}]]
|
|
392
|
-
}),
|
|
392
|
+
}), me = U({
|
|
393
393
|
name: "rotate-cw",
|
|
394
394
|
size: 24,
|
|
395
395
|
node: [["path", {
|
|
@@ -399,7 +399,7 @@ var ee = U({
|
|
|
399
399
|
d: "M21 3v5h-5",
|
|
400
400
|
key: "1q7to0"
|
|
401
401
|
}]]
|
|
402
|
-
}),
|
|
402
|
+
}), he = U({
|
|
403
403
|
name: "scroll-text",
|
|
404
404
|
size: 24,
|
|
405
405
|
node: [
|
|
@@ -420,7 +420,7 @@ var ee = U({
|
|
|
420
420
|
key: "1ph1d7"
|
|
421
421
|
}]
|
|
422
422
|
]
|
|
423
|
-
}),
|
|
423
|
+
}), ge = U({
|
|
424
424
|
name: "search",
|
|
425
425
|
size: 24,
|
|
426
426
|
node: [["path", {
|
|
@@ -432,7 +432,7 @@ var ee = U({
|
|
|
432
432
|
r: "8",
|
|
433
433
|
key: "4ej97u"
|
|
434
434
|
}]]
|
|
435
|
-
}),
|
|
435
|
+
}), _e = U({
|
|
436
436
|
name: "shield-alert",
|
|
437
437
|
size: 24,
|
|
438
438
|
node: [
|
|
@@ -449,7 +449,7 @@ var ee = U({
|
|
|
449
449
|
key: "1drbdi"
|
|
450
450
|
}]
|
|
451
451
|
]
|
|
452
|
-
}),
|
|
452
|
+
}), ve = U({
|
|
453
453
|
name: "square",
|
|
454
454
|
size: 24,
|
|
455
455
|
node: [["rect", {
|
|
@@ -460,7 +460,7 @@ var ee = U({
|
|
|
460
460
|
rx: "2",
|
|
461
461
|
key: "afitv7"
|
|
462
462
|
}]]
|
|
463
|
-
}),
|
|
463
|
+
}), ye = U({
|
|
464
464
|
name: "x",
|
|
465
465
|
size: 24,
|
|
466
466
|
node: [["path", {
|
|
@@ -470,25 +470,25 @@ var ee = U({
|
|
|
470
470
|
d: "m6 6 12 12",
|
|
471
471
|
key: "d8bk6v"
|
|
472
472
|
}]]
|
|
473
|
-
}),
|
|
474
|
-
function
|
|
475
|
-
let t =
|
|
476
|
-
return t === void 0 ?
|
|
473
|
+
}), be = "<meta http-equiv=\"Content-Security-Policy\" content=\"default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src data:; font-src data:; media-src data:; form-action 'none'; base-uri 'none'\">", xe = /^\s*<!doctype[^>]*>/i;
|
|
474
|
+
function Se(e) {
|
|
475
|
+
let t = xe.exec(e)?.[0];
|
|
476
|
+
return t === void 0 ? be + e : t + be + e.slice(t.length);
|
|
477
477
|
}
|
|
478
|
-
var
|
|
479
|
-
function
|
|
480
|
-
return `<!doctype html>${
|
|
478
|
+
var Ce = (e) => e.replaceAll("&", "&").replaceAll("\"", """), we = "html,body{margin:0;block-size:100%}iframe{display:block;border:0;inline-size:100%;block-size:100%}";
|
|
479
|
+
function Te(e) {
|
|
480
|
+
return `<!doctype html>${be}<style>${we}</style><iframe sandbox="allow-scripts" referrerpolicy="no-referrer" srcdoc="${Ce(Se(e))}"></iframe>`;
|
|
481
481
|
}
|
|
482
482
|
//#endregion
|
|
483
483
|
//#region web/src/ArtifactFrame.vue?vue&type=script&setup=true&lang.ts
|
|
484
|
-
var
|
|
484
|
+
var Ee = ["title", "srcdoc"], De = /* @__PURE__ */ c({
|
|
485
485
|
__name: "ArtifactFrame",
|
|
486
486
|
props: {
|
|
487
487
|
label: {},
|
|
488
488
|
content: {}
|
|
489
489
|
},
|
|
490
490
|
setup(e) {
|
|
491
|
-
let n = e, r = t(() =>
|
|
491
|
+
let n = e, r = t(() => Te(n.content));
|
|
492
492
|
return (e, t) => (g(), i("iframe", {
|
|
493
493
|
class: "kvc-artifact-frame",
|
|
494
494
|
sandbox: "allow-scripts",
|
|
@@ -496,63 +496,63 @@ var De = ["title", "srcdoc"], Oe = /* @__PURE__ */ c({
|
|
|
496
496
|
title: n.label,
|
|
497
497
|
srcdoc: r.value,
|
|
498
498
|
"data-test": "artifact-frame"
|
|
499
|
-
}, null, 8,
|
|
499
|
+
}, null, 8, Ee));
|
|
500
500
|
}
|
|
501
|
-
}),
|
|
501
|
+
}), Oe = /* @__PURE__ */ new Set(["localhost", "127.0.0.1"]), ke = {
|
|
502
502
|
"http:": "80",
|
|
503
503
|
"https:": "443"
|
|
504
|
-
},
|
|
505
|
-
function
|
|
504
|
+
}, Ae = (e) => e.port === "" ? ke[e.protocol] ?? "" : e.port;
|
|
505
|
+
function je(e, t) {
|
|
506
506
|
let n = e.trim();
|
|
507
507
|
if (n === "" || /\s/.test(n) || !URL.canParse(n)) return;
|
|
508
508
|
let r = new URL(n);
|
|
509
|
-
if ((r.protocol === "http:" || r.protocol === "https:") &&
|
|
509
|
+
if ((r.protocol === "http:" || r.protocol === "https:") && Oe.has(r.hostname) && r.username === "" && r.password === "") return Ae(r) === Ae(t) ? void 0 : r.href;
|
|
510
510
|
}
|
|
511
511
|
//#endregion
|
|
512
512
|
//#region web/src/kvman.ts
|
|
513
|
-
function
|
|
513
|
+
function Y() {
|
|
514
514
|
let e = u("kvman");
|
|
515
515
|
if (e === void 0) throw Error("kvcoder components run inside kvwebui, which provides kvman.");
|
|
516
516
|
return e;
|
|
517
517
|
}
|
|
518
|
-
var
|
|
519
|
-
function
|
|
518
|
+
var Me = () => document.documentElement.lang === "" ? void 0 : document.documentElement.lang;
|
|
519
|
+
function X(e) {
|
|
520
520
|
return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : {};
|
|
521
521
|
}
|
|
522
|
-
function
|
|
522
|
+
function Ne(e, t) {
|
|
523
523
|
return t === "" ? e("kvcoder.ui.newChat") : t;
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function Pe(e) {
|
|
526
526
|
let t = e.indexOf("/");
|
|
527
527
|
return t < 0 ? `kernel.errors.${e}` : `${e.slice(0, t)}.errors.${e.slice(t + 1)}`;
|
|
528
528
|
}
|
|
529
|
-
function
|
|
529
|
+
function Fe(e) {
|
|
530
530
|
if (!(e instanceof Error) || !("problem" in e)) return;
|
|
531
531
|
let t = e.problem;
|
|
532
532
|
if (typeof t == "object" && t && "code" in t && typeof t.code == "string") return {
|
|
533
533
|
code: t.code,
|
|
534
|
-
params:
|
|
534
|
+
params: Ie("params" in t ? t.params : void 0)
|
|
535
535
|
};
|
|
536
536
|
}
|
|
537
|
-
function
|
|
538
|
-
return Object.fromEntries(Object.entries(
|
|
537
|
+
function Ie(e) {
|
|
538
|
+
return Object.fromEntries(Object.entries(X(e)).map(([e, t]) => [e, typeof t == "string" ? t : JSON.stringify(t)]));
|
|
539
539
|
}
|
|
540
|
-
var
|
|
541
|
-
function
|
|
542
|
-
let t =
|
|
540
|
+
var Le = 200, Re = /^(\d{3}:)?\s*\{.*?"message"\s*:\s*"((?:[^"\\]|\\.)*)"/s;
|
|
541
|
+
function ze(e) {
|
|
542
|
+
let t = Re.exec(e);
|
|
543
543
|
return t?.[2] === void 0 ? e : `${t[1] === void 0 ? "" : `${t[1]} `}${t[2].replaceAll("\\\"", "\"")}`;
|
|
544
544
|
}
|
|
545
|
-
function
|
|
546
|
-
let { reason: t } =
|
|
545
|
+
function Be(e) {
|
|
546
|
+
let { reason: t } = X(e);
|
|
547
547
|
if (typeof t != "string" || t.trim() === "") return;
|
|
548
|
-
let n =
|
|
549
|
-
return n.length >
|
|
548
|
+
let n = ze(t);
|
|
549
|
+
return n.length > Le ? `${n.slice(0, Le)}…` : n;
|
|
550
550
|
}
|
|
551
|
-
function
|
|
552
|
-
let n =
|
|
553
|
-
e.toast(n === void 0 ? "kvcoder.ui.failed" :
|
|
551
|
+
function Z(e, t) {
|
|
552
|
+
let n = Fe(t);
|
|
553
|
+
e.toast(n === void 0 ? "kvcoder.ui.failed" : Pe(n.code), n?.params ?? {}, "error");
|
|
554
554
|
}
|
|
555
|
-
var
|
|
555
|
+
var Ve = /* @__PURE__ */ new Set([
|
|
556
556
|
"Arab",
|
|
557
557
|
"Hebr",
|
|
558
558
|
"Thaa",
|
|
@@ -560,17 +560,17 @@ var He = /* @__PURE__ */ new Set([
|
|
|
560
560
|
"Nkoo",
|
|
561
561
|
"Adlm"
|
|
562
562
|
]);
|
|
563
|
-
function
|
|
563
|
+
function He(e) {
|
|
564
564
|
let t = e === void 0 ? void 0 : new Intl.Locale(e).maximize().script;
|
|
565
|
-
return t !== void 0 &&
|
|
565
|
+
return t !== void 0 && Ve.has(t);
|
|
566
566
|
}
|
|
567
|
-
var
|
|
568
|
-
function
|
|
569
|
-
let t =
|
|
567
|
+
var Ue = (e, t) => He(t) ? `\u2066${e}\u2069` : e, We = (e) => He(Me()) ? `\u2068${e}\u2069` : e;
|
|
568
|
+
function Ge(e) {
|
|
569
|
+
let t = Me(), n = {
|
|
570
570
|
style: "currency",
|
|
571
571
|
currency: "USD"
|
|
572
572
|
};
|
|
573
|
-
return
|
|
573
|
+
return Ue(e === 0 || e >= .01 ? new Intl.NumberFormat(t, n).format(e) : new Intl.NumberFormat(t, e < 1e-4 ? {
|
|
574
574
|
...n,
|
|
575
575
|
maximumSignificantDigits: 1
|
|
576
576
|
} : {
|
|
@@ -578,45 +578,46 @@ function Ke(e) {
|
|
|
578
578
|
minimumFractionDigits: 4
|
|
579
579
|
}).format(e), t);
|
|
580
580
|
}
|
|
581
|
+
var Ke = (e) => new Intl.NumberFormat(Me(), {
|
|
582
|
+
notation: "compact",
|
|
583
|
+
maximumFractionDigits: 1
|
|
584
|
+
}).format(e);
|
|
581
585
|
function qe(e, t, n) {
|
|
582
|
-
let r =
|
|
583
|
-
notation: "compact",
|
|
584
|
-
maximumFractionDigits: 1
|
|
585
|
-
}).format(t.input + t.output), i = Ke(t.cost), a = Math.round(n / 1e3);
|
|
586
|
+
let r = Math.round(n / 1e3);
|
|
586
587
|
return e("kvcoder.ui.totals", {
|
|
587
|
-
time:
|
|
588
|
-
|
|
589
|
-
cost: i
|
|
588
|
+
time: r < 60 ? e("kvcoder.ui.seconds", { count: r }) : e("kvcoder.ui.minutes", { count: Math.round(r / 60) }),
|
|
589
|
+
cost: Ge(t.cost)
|
|
590
590
|
});
|
|
591
591
|
}
|
|
592
592
|
function Je(e, t) {
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
593
|
+
return e("kvcoder.ui.tokensUsed", { tokens: Ke(t.input + t.output) });
|
|
594
|
+
}
|
|
595
|
+
function Ye(e, t) {
|
|
596
|
+
if (t !== null && t.window !== null) return {
|
|
597
|
+
short: e("kvcoder.ui.memory", { percent: Math.round(t.tokens / t.window * 100) }),
|
|
598
|
+
full: e("kvcoder.ui.memoryDetail", {
|
|
599
|
+
tokens: Ke(t.tokens),
|
|
600
|
+
window: Ke(t.window),
|
|
601
|
+
at: Math.round(t.compactAt * 100)
|
|
602
|
+
})
|
|
603
|
+
};
|
|
603
604
|
}
|
|
604
605
|
//#endregion
|
|
605
606
|
//#region web/src/ArtifactUrlFrame.vue?vue&type=script&setup=true&lang.ts
|
|
606
|
-
var
|
|
607
|
+
var Xe = ["title", "src"], Ze = {
|
|
607
608
|
key: 1,
|
|
608
609
|
class: "kvc-muted",
|
|
609
610
|
role: "alert",
|
|
610
611
|
"data-test": "artifact-url-refused"
|
|
611
|
-
},
|
|
612
|
+
}, Qe = /* @__PURE__ */ c({
|
|
612
613
|
__name: "ArtifactUrlFrame",
|
|
613
614
|
props: {
|
|
614
615
|
label: {},
|
|
615
616
|
content: {}
|
|
616
617
|
},
|
|
617
618
|
setup(e) {
|
|
618
|
-
let n = e, r =
|
|
619
|
-
return (e, t) => a.value === void 0 ? (g(), i("p",
|
|
619
|
+
let n = e, r = Y(), a = t(() => je(n.content, window.location));
|
|
620
|
+
return (e, t) => a.value === void 0 ? (g(), i("p", Ze, w(T(r).t("kvcoder.ui.artifacts.urlRefused")), 1)) : (g(), i("iframe", {
|
|
620
621
|
key: 0,
|
|
621
622
|
class: "kvc-artifact-frame",
|
|
622
623
|
sandbox: "allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-downloads",
|
|
@@ -624,48 +625,48 @@ var Ye = ["title", "src"], Xe = {
|
|
|
624
625
|
title: n.label,
|
|
625
626
|
src: a.value,
|
|
626
627
|
"data-test": "artifact-url-frame"
|
|
627
|
-
}, null, 8,
|
|
628
|
+
}, null, 8, Xe));
|
|
628
629
|
}
|
|
629
|
-
}),
|
|
630
|
+
}), $e = ["aria-label"], et = { class: "kvc-artifact-head" }, tt = { class: "kvc-artifact-name" }, nt = {
|
|
630
631
|
key: 0,
|
|
631
632
|
role: "tablist",
|
|
632
633
|
class: "kvc-artifact-tabs"
|
|
633
|
-
},
|
|
634
|
+
}, rt = [
|
|
634
635
|
"aria-selected",
|
|
635
636
|
"data-test",
|
|
636
637
|
"onClick"
|
|
637
|
-
],
|
|
638
|
+
], it = {
|
|
638
639
|
key: 1,
|
|
639
640
|
class: "kvc-artifact-title kvc-oneline",
|
|
640
641
|
"data-test": "artifact-title"
|
|
641
|
-
},
|
|
642
|
+
}, at = {
|
|
642
643
|
class: "kvc-muted",
|
|
643
644
|
"data-test": "artifact-meta"
|
|
644
|
-
},
|
|
645
|
+
}, ot = { "data-test": "artifact-format" }, st = { "data-test": "artifact-version" }, ct = { class: "kvc-artifact-actions" }, lt = ["aria-label"], ut = [
|
|
645
646
|
"aria-pressed",
|
|
646
647
|
"aria-label",
|
|
647
648
|
"title"
|
|
648
|
-
],
|
|
649
|
+
], dt = { class: "kvc-tab-text" }, ft = [
|
|
649
650
|
"aria-pressed",
|
|
650
651
|
"aria-label",
|
|
651
652
|
"title"
|
|
652
|
-
],
|
|
653
|
+
], pt = { class: "kvc-tab-text" }, mt = [
|
|
653
654
|
"href",
|
|
654
655
|
"aria-label",
|
|
655
656
|
"title"
|
|
656
|
-
],
|
|
657
|
+
], ht = [
|
|
657
658
|
"disabled",
|
|
658
659
|
"aria-label",
|
|
659
660
|
"title"
|
|
660
|
-
],
|
|
661
|
+
], gt = ["aria-label", "title"], _t = {
|
|
661
662
|
class: "kvc-artifact-body",
|
|
662
663
|
"data-test": "artifact-body"
|
|
663
|
-
},
|
|
664
|
+
}, vt = {
|
|
664
665
|
key: 0,
|
|
665
666
|
class: "kvc-artifact-source",
|
|
666
667
|
dir: "ltr",
|
|
667
668
|
"data-test": "artifact-source"
|
|
668
|
-
},
|
|
669
|
+
}, yt = /* @__PURE__ */ c({
|
|
669
670
|
__name: "ArtifactPanel",
|
|
670
671
|
props: {
|
|
671
672
|
list: {},
|
|
@@ -674,16 +675,16 @@ var Ye = ["title", "src"], Xe = {
|
|
|
674
675
|
},
|
|
675
676
|
emits: ["select", "close"],
|
|
676
677
|
setup(c, { emit: l }) {
|
|
677
|
-
let u = c, d = l, f =
|
|
678
|
+
let u = c, d = l, f = Y(), p = t(() => u.list.find((e) => e.id === u.shown)), m = t(() => u.content?.id === u.shown ? u.content : void 0), h = t(() => m.value?.title ?? p.value?.title ?? ""), _ = t(() => m.value?.version ?? p.value?.version ?? 1), b = t(() => m.value?.format ?? p.value?.format ?? "markdown"), S = t(() => m.value?.content ?? ""), C = t(() => f.t("kvcoder.ui.artifacts.frameLabel", { title: h.value })), E = v("preview");
|
|
678
679
|
O(() => u.shown, () => E.value = "preview");
|
|
679
680
|
async function D() {
|
|
680
681
|
try {
|
|
681
682
|
await navigator.clipboard.writeText(S.value), f.toast("kvcoder.ui.copied", {}, "success");
|
|
682
683
|
} catch (e) {
|
|
683
|
-
|
|
684
|
+
Z(f, e);
|
|
684
685
|
}
|
|
685
686
|
}
|
|
686
|
-
let k = t(() => b.value === "url" ?
|
|
687
|
+
let k = t(() => b.value === "url" ? je(S.value, window.location) : void 0), A = t(() => ({
|
|
687
688
|
type: "markdown",
|
|
688
689
|
text: "kvcoder.markdown",
|
|
689
690
|
params: { text: S.value }
|
|
@@ -692,7 +693,7 @@ var Ye = ["title", "src"], Xe = {
|
|
|
692
693
|
class: "kvc-artifact-panel",
|
|
693
694
|
"data-test": "artifact-panel",
|
|
694
695
|
"aria-label": T(f).t("kvcoder.ui.artifacts.title")
|
|
695
|
-
}, [a("div",
|
|
696
|
+
}, [a("div", et, [a("div", tt, [u.list.length > 1 ? (g(), i("div", nt, [(g(!0), i(e, null, y(u.list, (e) => (g(), i("button", {
|
|
696
697
|
key: e.id,
|
|
697
698
|
type: "button",
|
|
698
699
|
role: "tab",
|
|
@@ -700,11 +701,11 @@ var Ye = ["title", "src"], Xe = {
|
|
|
700
701
|
"aria-selected": e.id === u.shown,
|
|
701
702
|
"data-test": `artifact-tab-${e.id}`,
|
|
702
703
|
onClick: (t) => d("select", e.id)
|
|
703
|
-
}, w(e.title), 9,
|
|
704
|
-
a("span",
|
|
704
|
+
}, w(e.title), 9, rt))), 128))])) : (g(), i("span", it, w(h.value), 1)), a("span", at, [
|
|
705
|
+
a("span", ot, w(T(f).t(`kvcoder.ui.artifacts.format.${b.value}`)), 1),
|
|
705
706
|
c[3] ||= o(" · ", -1),
|
|
706
|
-
a("span",
|
|
707
|
-
])]), a("div",
|
|
707
|
+
a("span", st, w(T(f).t("kvcoder.ui.artifacts.version", { version: _.value })), 1)
|
|
708
|
+
])]), a("div", ct, [
|
|
708
709
|
a("div", {
|
|
709
710
|
class: "kvc-tabs",
|
|
710
711
|
role: "group",
|
|
@@ -717,11 +718,11 @@ var Ye = ["title", "src"], Xe = {
|
|
|
717
718
|
title: T(f).t("kvcoder.ui.artifacts.preview"),
|
|
718
719
|
"data-test": "artifact-view-preview",
|
|
719
720
|
onClick: c[0] ||= (e) => E.value = "preview"
|
|
720
|
-
}, [s(T(
|
|
721
|
+
}, [s(T(le), {
|
|
721
722
|
size: 16,
|
|
722
723
|
class: "kvc-tab-icon",
|
|
723
724
|
"aria-hidden": "true"
|
|
724
|
-
}), a("span",
|
|
725
|
+
}), a("span", dt, w(T(f).t("kvcoder.ui.artifacts.preview")), 1)], 8, ut), a("button", {
|
|
725
726
|
type: "button",
|
|
726
727
|
class: "kvc-tab",
|
|
727
728
|
"aria-pressed": E.value === "source",
|
|
@@ -729,11 +730,11 @@ var Ye = ["title", "src"], Xe = {
|
|
|
729
730
|
title: T(f).t("kvcoder.ui.artifacts.source"),
|
|
730
731
|
"data-test": "artifact-view-source",
|
|
731
732
|
onClick: c[1] ||= (e) => E.value = "source"
|
|
732
|
-
}, [s(T(
|
|
733
|
+
}, [s(T(ae), {
|
|
733
734
|
size: 16,
|
|
734
735
|
class: "kvc-tab-icon",
|
|
735
736
|
"aria-hidden": "true"
|
|
736
|
-
}), a("span",
|
|
737
|
+
}), a("span", pt, w(T(f).t("kvcoder.ui.artifacts.source")), 1)], 8, ft)], 8, lt),
|
|
737
738
|
k.value === void 0 ? r("v-if", !0) : (g(), i("a", {
|
|
738
739
|
key: 0,
|
|
739
740
|
href: k.value,
|
|
@@ -743,10 +744,10 @@ var Ye = ["title", "src"], Xe = {
|
|
|
743
744
|
"aria-label": T(f).t("kvcoder.ui.artifacts.openUrl"),
|
|
744
745
|
title: T(f).t("kvcoder.ui.artifacts.openUrl"),
|
|
745
746
|
"data-test": "artifact-open-url"
|
|
746
|
-
}, [s(T(
|
|
747
|
+
}, [s(T(ce), {
|
|
747
748
|
size: 16,
|
|
748
749
|
"aria-hidden": "true"
|
|
749
|
-
})], 8,
|
|
750
|
+
})], 8, mt)),
|
|
750
751
|
a("button", {
|
|
751
752
|
type: "button",
|
|
752
753
|
class: "kvc-button kvc-icon-button",
|
|
@@ -755,10 +756,10 @@ var Ye = ["title", "src"], Xe = {
|
|
|
755
756
|
title: T(f).t("kvcoder.ui.copy"),
|
|
756
757
|
"data-test": "artifact-copy",
|
|
757
758
|
onClick: D
|
|
758
|
-
}, [s(T(
|
|
759
|
+
}, [s(T(oe), {
|
|
759
760
|
size: 16,
|
|
760
761
|
"aria-hidden": "true"
|
|
761
|
-
})], 8,
|
|
762
|
+
})], 8, ht),
|
|
762
763
|
a("button", {
|
|
763
764
|
type: "button",
|
|
764
765
|
class: "kvc-button kvc-icon-button",
|
|
@@ -766,24 +767,24 @@ var Ye = ["title", "src"], Xe = {
|
|
|
766
767
|
title: T(f).t("kvcoder.ui.artifacts.close"),
|
|
767
768
|
"data-test": "artifact-close",
|
|
768
769
|
onClick: c[2] ||= (e) => d("close")
|
|
769
|
-
}, [s(T(
|
|
770
|
+
}, [s(T(ye), {
|
|
770
771
|
size: 16,
|
|
771
772
|
"aria-hidden": "true"
|
|
772
|
-
})], 8,
|
|
773
|
-
])]), a("div",
|
|
773
|
+
})], 8, gt)
|
|
774
|
+
])]), a("div", _t, [E.value === "source" && m.value !== void 0 ? (g(), i("pre", vt, w(S.value), 1)) : b.value === "markdown" && m.value !== void 0 ? (g(), n(x(T(f).View), {
|
|
774
775
|
key: 1,
|
|
775
776
|
view: A.value
|
|
776
|
-
}, null, 8, ["view"])) : b.value === "html" && m.value !== void 0 ? (g(), n(
|
|
777
|
+
}, null, 8, ["view"])) : b.value === "html" && m.value !== void 0 ? (g(), n(De, {
|
|
777
778
|
key: 2,
|
|
778
779
|
label: C.value,
|
|
779
780
|
content: S.value
|
|
780
|
-
}, null, 8, ["label", "content"])) : b.value === "url" && m.value !== void 0 ? (g(), n(
|
|
781
|
+
}, null, 8, ["label", "content"])) : b.value === "url" && m.value !== void 0 ? (g(), n(Qe, {
|
|
781
782
|
key: 3,
|
|
782
783
|
label: C.value,
|
|
783
784
|
content: S.value
|
|
784
|
-
}, null, 8, ["label", "content"])) : r("v-if", !0)])], 8,
|
|
785
|
+
}, null, 8, ["label", "content"])) : r("v-if", !0)])], 8, $e));
|
|
785
786
|
}
|
|
786
|
-
}),
|
|
787
|
+
}), bt = [
|
|
787
788
|
{ name: "compact" },
|
|
788
789
|
{ name: "export" },
|
|
789
790
|
{ name: "fork" },
|
|
@@ -794,7 +795,7 @@ var Ye = ["title", "src"], Xe = {
|
|
|
794
795
|
argument: !0
|
|
795
796
|
}
|
|
796
797
|
];
|
|
797
|
-
function
|
|
798
|
+
function xt(e) {
|
|
798
799
|
let t = /^\/(\S*)(\s+(.*))?$/.exec(e);
|
|
799
800
|
if (!(t === null || e.includes("\n"))) return {
|
|
800
801
|
word: t[1] ?? "",
|
|
@@ -802,9 +803,9 @@ function bt(e) {
|
|
|
802
803
|
named: t[2] !== void 0
|
|
803
804
|
};
|
|
804
805
|
}
|
|
805
|
-
function
|
|
806
|
+
function St(e, t) {
|
|
806
807
|
let n = (t) => e.named ? t === e.word : t.startsWith(e.word);
|
|
807
|
-
return [...
|
|
808
|
+
return [...bt.filter((e) => n(e.name)).map((e) => ({
|
|
808
809
|
kind: "own",
|
|
809
810
|
command: e
|
|
810
811
|
})), ...t.filter((e) => n(e.name)).map((e) => ({
|
|
@@ -814,36 +815,36 @@ function xt(e, t) {
|
|
|
814
815
|
}
|
|
815
816
|
//#endregion
|
|
816
817
|
//#region web/src/MessageComposer.vue?vue&type=script&setup=true&lang.ts
|
|
817
|
-
var
|
|
818
|
+
var Ct = { class: "kvc-composer" }, wt = { class: "kvc-box" }, Tt = ["aria-label"], Et = {
|
|
818
819
|
key: 0,
|
|
819
820
|
class: "kvc-muted kvc-none",
|
|
820
821
|
"data-test": "slash-wait"
|
|
821
|
-
},
|
|
822
|
+
}, Dt = [
|
|
822
823
|
"aria-disabled",
|
|
823
824
|
"aria-selected",
|
|
824
825
|
"data-active",
|
|
825
826
|
"data-test",
|
|
826
827
|
"onMousemove",
|
|
827
828
|
"onClick"
|
|
828
|
-
],
|
|
829
|
+
], Ot = { class: "kvc-slash-name" }, kt = {
|
|
829
830
|
class: "kvc-mono",
|
|
830
831
|
dir: "ltr"
|
|
831
|
-
},
|
|
832
|
+
}, At = { class: "kvc-muted" }, jt = {
|
|
832
833
|
key: 1,
|
|
833
834
|
class: "kvc-muted kvc-none",
|
|
834
835
|
"data-test": "slash-none"
|
|
835
|
-
},
|
|
836
|
+
}, Mt = {
|
|
836
837
|
key: 1,
|
|
837
838
|
style: {
|
|
838
839
|
display: "flex",
|
|
839
840
|
gap: "6px",
|
|
840
841
|
"flex-wrap": "wrap"
|
|
841
842
|
}
|
|
842
|
-
},
|
|
843
|
+
}, Nt = ["aria-label", "onClick"], Pt = ["placeholder", "aria-label"], Ft = { class: "kvc-composer-row" }, It = [
|
|
843
844
|
"aria-label",
|
|
844
845
|
"title",
|
|
845
846
|
"disabled"
|
|
846
|
-
],
|
|
847
|
+
], Lt = { class: "kvc-muted kvc-composer-hint" }, Rt = ["aria-label", "disabled"], zt = /* @__PURE__ */ c({
|
|
847
848
|
__name: "MessageComposer",
|
|
848
849
|
props: {
|
|
849
850
|
running: { type: Boolean },
|
|
@@ -859,7 +860,7 @@ var St = { class: "kvc-composer" }, Ct = { class: "kvc-box" }, wt = ["aria-label
|
|
|
859
860
|
"registered"
|
|
860
861
|
],
|
|
861
862
|
setup(n, { emit: c }) {
|
|
862
|
-
let l = n, u = c, d =
|
|
863
|
+
let l = n, u = c, d = Y(), f = v(""), p = v([]), m = v(null), h = v(!1), _ = v(0), x = v(!1), S = t(() => l.commands === void 0 ? void 0 : xt(f.value)), C = t(() => l.commands === "wait"), E = t(() => S.value === void 0 ? [] : St(S.value, l.registered ?? [])), k = (e) => !C.value || e.kind === "registered", j = t(() => E.value.filter(k)), M = t(() => j.value[_.value]), N = t(() => j.value.length < E.value.length), P = (e) => e.kind === "own" && "argument" in e.command, F = (e) => d.t(e.kind === "own" ? `kvcoder.ui.slash.${e.command.name}` : e.command.description);
|
|
863
864
|
O(f, () => {
|
|
864
865
|
_.value = 0, x.value = !1;
|
|
865
866
|
});
|
|
@@ -927,7 +928,7 @@ var St = { class: "kvc-composer" }, Ct = { class: "kvc-box" }, wt = ["aria-label
|
|
|
927
928
|
if (ee(e)) return e.preventDefault();
|
|
928
929
|
e.key !== "Enter" || e.shiftKey || e.isComposing || (e.preventDefault(), B());
|
|
929
930
|
}
|
|
930
|
-
return (t, n) => (g(), i("div",
|
|
931
|
+
return (t, n) => (g(), i("div", Ct, [a("div", wt, [
|
|
931
932
|
S.value !== void 0 && !x.value ? (g(), i("div", {
|
|
932
933
|
key: 0,
|
|
933
934
|
class: "kvc-slash",
|
|
@@ -935,7 +936,7 @@ var St = { class: "kvc-composer" }, Ct = { class: "kvc-box" }, wt = ["aria-label
|
|
|
935
936
|
"aria-label": T(d).t("kvcoder.ui.slash.title"),
|
|
936
937
|
"data-test": "slash-list"
|
|
937
938
|
}, [
|
|
938
|
-
N.value ? (g(), i("p",
|
|
939
|
+
N.value ? (g(), i("p", Et, w(T(d).t("kvcoder.ui.slash.wait")), 1)) : r("v-if", !0),
|
|
939
940
|
(g(!0), i(e, null, y(E.value, (t) => (g(), i("div", {
|
|
940
941
|
key: t.command.name,
|
|
941
942
|
class: "kvc-slash-row",
|
|
@@ -946,10 +947,10 @@ var St = { class: "kvc-composer" }, Ct = { class: "kvc-box" }, wt = ["aria-label
|
|
|
946
947
|
"data-test": `slash-${t.command.name}`,
|
|
947
948
|
onMousemove: (e) => H(t),
|
|
948
949
|
onClick: (e) => U(t)
|
|
949
|
-
}, [a("span",
|
|
950
|
-
E.value.length === 0 ? (g(), i("p",
|
|
951
|
-
], 8,
|
|
952
|
-
p.value.length > 0 ? (g(), i("div",
|
|
950
|
+
}, [a("span", Ot, [a("span", kt, [o("/" + w(t.command.name), 1), P(t) ? (g(), i(e, { key: 0 }, [o(" <" + w(T(d).t(`kvcoder.ui.slash.${t.command.name}.argument`)) + ">", 1)], 64)) : r("v-if", !0)])]), a("span", At, w(F(t)), 1)], 40, Dt))), 128)),
|
|
951
|
+
E.value.length === 0 ? (g(), i("p", jt, w(T(d).t("kvcoder.ui.slash.none")), 1)) : r("v-if", !0)
|
|
952
|
+
], 8, Tt)) : r("v-if", !0),
|
|
953
|
+
p.value.length > 0 ? (g(), i("div", Mt, [(g(!0), i(e, null, y(p.value, (e) => (g(), i("span", {
|
|
953
954
|
key: e.id,
|
|
954
955
|
class: "kvc-chip",
|
|
955
956
|
"data-test": "attachment"
|
|
@@ -962,7 +963,7 @@ var St = { class: "kvc-composer" }, Ct = { class: "kvc-box" }, wt = ["aria-label
|
|
|
962
963
|
},
|
|
963
964
|
"aria-label": T(d).t("kvcoder.ui.removeAttachment"),
|
|
964
965
|
onClick: (t) => p.value = p.value.filter((t) => t.id !== e.id)
|
|
965
|
-
}, [s(T(
|
|
966
|
+
}, [s(T(ye), { size: 12 })], 8, Nt)]))), 128))])) : r("v-if", !0),
|
|
966
967
|
A(a("textarea", {
|
|
967
968
|
"onUpdate:modelValue": n[0] ||= (e) => f.value = e,
|
|
968
969
|
placeholder: l.placeholder,
|
|
@@ -971,8 +972,8 @@ var St = { class: "kvc-composer" }, Ct = { class: "kvc-box" }, wt = ["aria-label
|
|
|
971
972
|
"data-test": "composer-text",
|
|
972
973
|
onKeydown: W,
|
|
973
974
|
onPaste: R
|
|
974
|
-
}, null, 40,
|
|
975
|
-
a("div",
|
|
975
|
+
}, null, 40, Pt), [[D, f.value]]),
|
|
976
|
+
a("div", Ft, [
|
|
976
977
|
a("input", {
|
|
977
978
|
ref_key: "picker",
|
|
978
979
|
ref: m,
|
|
@@ -989,16 +990,16 @@ var St = { class: "kvc-composer" }, Ct = { class: "kvc-box" }, wt = ["aria-label
|
|
|
989
990
|
title: T(d).t("kvcoder.ui.attach"),
|
|
990
991
|
disabled: h.value,
|
|
991
992
|
onClick: n[1] ||= (e) => m.value?.click()
|
|
992
|
-
}, [s(T(
|
|
993
|
+
}, [s(T(pe), { size: 16 })], 8, It),
|
|
993
994
|
b(t.$slots, "controls"),
|
|
994
|
-
a("span",
|
|
995
|
+
a("span", Lt, w(T(d).t("kvcoder.ui.enterSends")), 1),
|
|
995
996
|
l.running ? (g(), i("button", {
|
|
996
997
|
key: 0,
|
|
997
998
|
type: "button",
|
|
998
999
|
class: "kvc-button",
|
|
999
1000
|
"data-test": "stop",
|
|
1000
1001
|
onClick: n[2] ||= (e) => u("stop")
|
|
1001
|
-
}, [s(T(
|
|
1002
|
+
}, [s(T(ve), { size: 14 }), o(w(T(d).t("kvcoder.ui.stop")), 1)])) : r("v-if", !0),
|
|
1002
1003
|
a("button", {
|
|
1003
1004
|
type: "button",
|
|
1004
1005
|
class: "kvc-button kvc-primary",
|
|
@@ -1006,14 +1007,14 @@ var St = { class: "kvc-composer" }, Ct = { class: "kvc-box" }, wt = ["aria-label
|
|
|
1006
1007
|
disabled: f.value.trim() === "" || h.value || l.blocked === !0,
|
|
1007
1008
|
"data-test": "send",
|
|
1008
1009
|
onClick: B
|
|
1009
|
-
}, [s(T(G), { size: 16 })], 8,
|
|
1010
|
+
}, [s(T(G), { size: 16 })], 8, Rt)
|
|
1010
1011
|
])
|
|
1011
1012
|
])]));
|
|
1012
1013
|
}
|
|
1013
1014
|
});
|
|
1014
1015
|
//#endregion
|
|
1015
1016
|
//#region web/src/model-groups.ts
|
|
1016
|
-
function
|
|
1017
|
+
function Bt(e, t, n) {
|
|
1017
1018
|
let r = new Map(e.map((e) => [e.id, e.title])), i = new Set(e.filter((e) => e.status !== "needsKey").map((e) => e.id)), a = t.filter((e) => i.has(e.provider) || e.id === n), o = /* @__PURE__ */ new Map();
|
|
1018
1019
|
for (let e of a) {
|
|
1019
1020
|
let t = o.get(e.provider) ?? {
|
|
@@ -1028,7 +1029,7 @@ function zt(e, t, n) {
|
|
|
1028
1029
|
}
|
|
1029
1030
|
return [...o.values()].sort((e, t) => e.title.localeCompare(t.title));
|
|
1030
1031
|
}
|
|
1031
|
-
function
|
|
1032
|
+
function Vt(e, t) {
|
|
1032
1033
|
let n = t.toLowerCase().split(/\s+/).filter((e) => e !== ""), r = (e) => n.every((t) => `${e.name} ${e.id}`.toLowerCase().includes(t)), i = e.map((e) => ({
|
|
1033
1034
|
...e,
|
|
1034
1035
|
models: e.models.filter(r)
|
|
@@ -1039,38 +1040,38 @@ function Bt(e, t) {
|
|
|
1039
1040
|
total: e.reduce((e, t) => e + t.models.length, 0)
|
|
1040
1041
|
};
|
|
1041
1042
|
}
|
|
1042
|
-
var
|
|
1043
|
+
var Ht = [
|
|
1043
1044
|
"off",
|
|
1044
1045
|
"minimal",
|
|
1045
1046
|
"low",
|
|
1046
1047
|
"medium",
|
|
1047
1048
|
"high"
|
|
1048
|
-
],
|
|
1049
|
+
], Ut = { class: "kvc-picker" }, Wt = [
|
|
1049
1050
|
"aria-expanded",
|
|
1050
1051
|
"aria-label",
|
|
1051
1052
|
"disabled"
|
|
1052
|
-
],
|
|
1053
|
+
], Gt = { class: "kvc-picker-label" }, Kt = ["onKeydown"], qt = { class: "kvc-search" }, Jt = [
|
|
1053
1054
|
"placeholder",
|
|
1054
1055
|
"aria-label",
|
|
1055
1056
|
"onKeydown"
|
|
1056
|
-
],
|
|
1057
|
+
], Yt = ["aria-label"], Xt = ["aria-selected", "data-active"], Zt = { class: "kvc-model-name" }, Qt = {
|
|
1057
1058
|
class: "kvc-group",
|
|
1058
1059
|
role: "presentation",
|
|
1059
1060
|
"data-test": "model-group"
|
|
1060
|
-
},
|
|
1061
|
+
}, $t = [
|
|
1061
1062
|
"aria-selected",
|
|
1062
1063
|
"data-active",
|
|
1063
1064
|
"data-test",
|
|
1064
1065
|
"onClick",
|
|
1065
1066
|
"onMousemove"
|
|
1066
|
-
],
|
|
1067
|
+
], en = { class: "kvc-model-name" }, tn = {
|
|
1067
1068
|
key: 1,
|
|
1068
1069
|
class: "kvc-muted kvc-none",
|
|
1069
1070
|
"data-test": "model-none"
|
|
1070
|
-
},
|
|
1071
|
+
}, nn = {
|
|
1071
1072
|
class: "kvc-muted kvc-count",
|
|
1072
1073
|
"data-test": "model-count"
|
|
1073
|
-
},
|
|
1074
|
+
}, rn = 24, an = /* @__PURE__ */ c({
|
|
1074
1075
|
__name: "ModelPicker",
|
|
1075
1076
|
props: {
|
|
1076
1077
|
groups: {},
|
|
@@ -1081,7 +1082,7 @@ var Vt = [
|
|
|
1081
1082
|
},
|
|
1082
1083
|
emits: ["pick", "none"],
|
|
1083
1084
|
setup(o, { emit: c }) {
|
|
1084
|
-
let l = o, u = c, f =
|
|
1085
|
+
let l = o, u = c, f = Y(), m = v(!1), h = v(""), _ = v(0), b = E("trigger"), x = E("search"), S = E("panel"), C = t(() => Vt(l.groups, h.value)), k = t(() => C.value.groups.flatMap((e) => e.models)), N = t(() => l.groups.flatMap((e) => e.models).find((e) => e.id === l.current)?.name ?? l.current ?? l.empty ?? ""), P = t(() => l.none !== void 0 && h.value.trim() === ""), F = t(() => +!!P.value), I = t(() => k.value.length + F.value), L = (e) => {
|
|
1085
1086
|
let t = k.value.findIndex((t) => t.id === e);
|
|
1086
1087
|
return t < 0 ? -1 : t + F.value;
|
|
1087
1088
|
};
|
|
@@ -1095,7 +1096,7 @@ var Vt = [
|
|
|
1095
1096
|
function H() {
|
|
1096
1097
|
let e = S.value, t = b.value?.closest(".kvc-conversation")?.getBoundingClientRect();
|
|
1097
1098
|
if (e === null || t === void 0) return;
|
|
1098
|
-
let n = e.getBoundingClientRect(), r = t.left +
|
|
1099
|
+
let n = e.getBoundingClientRect(), r = t.left + rn - (n.left - B), i = t.right - rn - (n.right - B), a = r > 0 ? r : i < 0 ? i : 0;
|
|
1099
1100
|
a !== B && (B = a, e.style.translate = `${a}px 0`);
|
|
1100
1101
|
}
|
|
1101
1102
|
function U() {
|
|
@@ -1116,14 +1117,14 @@ var Vt = [
|
|
|
1116
1117
|
function te() {
|
|
1117
1118
|
P.value && _.value === 0 ? K() : G(k.value[_.value - F.value]?.id);
|
|
1118
1119
|
}
|
|
1119
|
-
function
|
|
1120
|
+
function J(e) {
|
|
1120
1121
|
e.target instanceof Node && !b.value?.parentElement?.contains(e.target) && (m.value = !1);
|
|
1121
1122
|
}
|
|
1122
1123
|
return O(h, () => _.value = 0), O(m, (e) => {
|
|
1123
|
-
e ? (document.addEventListener("pointerdown",
|
|
1124
|
+
e ? (document.addEventListener("pointerdown", J), V = requestAnimationFrame(U)) : (document.removeEventListener("pointerdown", J), cancelAnimationFrame(V));
|
|
1124
1125
|
}), p(() => {
|
|
1125
|
-
document.removeEventListener("pointerdown",
|
|
1126
|
-
}), (t, o) => (g(), i("div",
|
|
1126
|
+
document.removeEventListener("pointerdown", J), cancelAnimationFrame(V);
|
|
1127
|
+
}), (t, o) => (g(), i("div", Ut, [a("button", {
|
|
1127
1128
|
ref_key: "trigger",
|
|
1128
1129
|
ref: b,
|
|
1129
1130
|
type: "button",
|
|
@@ -1134,10 +1135,10 @@ var Vt = [
|
|
|
1134
1135
|
disabled: l.disabled,
|
|
1135
1136
|
"data-test": "model-picker",
|
|
1136
1137
|
onClick: o[0] ||= (e) => m.value ? R() : z()
|
|
1137
|
-
}, [a("span",
|
|
1138
|
+
}, [a("span", Gt, w(N.value), 1), s(T(ne), {
|
|
1138
1139
|
size: 16,
|
|
1139
1140
|
"aria-hidden": "true"
|
|
1140
|
-
})], 8,
|
|
1141
|
+
})], 8, Wt), m.value ? (g(), i("div", {
|
|
1141
1142
|
key: 0,
|
|
1142
1143
|
ref_key: "panel",
|
|
1143
1144
|
ref: S,
|
|
@@ -1145,7 +1146,7 @@ var Vt = [
|
|
|
1145
1146
|
"data-test": "model-popover",
|
|
1146
1147
|
onKeydown: j(M(R, ["stop"]), ["esc"])
|
|
1147
1148
|
}, [
|
|
1148
|
-
a("label",
|
|
1149
|
+
a("label", qt, [s(T(ge), {
|
|
1149
1150
|
size: 16,
|
|
1150
1151
|
"aria-hidden": "true"
|
|
1151
1152
|
}), A(a("input", {
|
|
@@ -1164,7 +1165,7 @@ var Vt = [
|
|
|
1164
1165
|
o[3] ||= j(M((e) => W(-1), ["prevent"]), ["up"]),
|
|
1165
1166
|
j(M(te, ["prevent"]), ["enter"])
|
|
1166
1167
|
]
|
|
1167
|
-
}, null, 40,
|
|
1168
|
+
}, null, 40, Jt), [[D, h.value]])]),
|
|
1168
1169
|
a("div", {
|
|
1169
1170
|
id: "kvc-models",
|
|
1170
1171
|
class: "kvc-options",
|
|
@@ -1180,12 +1181,12 @@ var Vt = [
|
|
|
1180
1181
|
"data-test": "model-none-entry",
|
|
1181
1182
|
onClick: K,
|
|
1182
1183
|
onMousemove: o[4] ||= (e) => _.value = 0
|
|
1183
|
-
}, [a("span",
|
|
1184
|
+
}, [a("span", Zt, w(l.none), 1), l.current === null ? (g(), n(T(q), {
|
|
1184
1185
|
key: 0,
|
|
1185
1186
|
size: 16,
|
|
1186
1187
|
"aria-hidden": "true"
|
|
1187
|
-
})) : r("v-if", !0)], 40,
|
|
1188
|
-
(g(!0), i(e, null, y(C.value.groups, (t) => (g(), i(e, { key: t.provider }, [a("div",
|
|
1188
|
+
})) : r("v-if", !0)], 40, Xt)) : r("v-if", !0),
|
|
1189
|
+
(g(!0), i(e, null, y(C.value.groups, (t) => (g(), i(e, { key: t.provider }, [a("div", Qt, w(t.title), 1), (g(!0), i(e, null, y(t.models, (e) => (g(), i("div", {
|
|
1189
1190
|
key: e.id,
|
|
1190
1191
|
class: "kvc-model",
|
|
1191
1192
|
role: "option",
|
|
@@ -1194,20 +1195,20 @@ var Vt = [
|
|
|
1194
1195
|
"data-test": `model-${e.id}`,
|
|
1195
1196
|
onClick: (t) => G(e.id),
|
|
1196
1197
|
onMousemove: (t) => _.value = L(e.id)
|
|
1197
|
-
}, [a("span",
|
|
1198
|
+
}, [a("span", en, w(e.name), 1), e.id === l.current ? (g(), n(T(q), {
|
|
1198
1199
|
key: 0,
|
|
1199
1200
|
size: 16,
|
|
1200
1201
|
"aria-hidden": "true"
|
|
1201
|
-
})) : r("v-if", !0)], 40,
|
|
1202
|
-
C.value.shown === 0 ? (g(), i("p",
|
|
1203
|
-
], 8,
|
|
1204
|
-
a("p",
|
|
1202
|
+
})) : r("v-if", !0)], 40, $t))), 128))], 64))), 128)),
|
|
1203
|
+
C.value.shown === 0 ? (g(), i("p", tn, w(T(f).t("kvcoder.ui.noModels")), 1)) : r("v-if", !0)
|
|
1204
|
+
], 8, Yt),
|
|
1205
|
+
a("p", nn, w(T(f).t("kvcoder.ui.modelsCount", {
|
|
1205
1206
|
shown: C.value.shown,
|
|
1206
1207
|
total: C.value.total
|
|
1207
1208
|
})), 1)
|
|
1208
|
-
], 40,
|
|
1209
|
+
], 40, Kt)) : r("v-if", !0)]));
|
|
1209
1210
|
}
|
|
1210
|
-
}),
|
|
1211
|
+
}), on = ["value", "aria-label"], sn = ["value"], cn = /* @__PURE__ */ c({
|
|
1211
1212
|
__name: "ModelControls",
|
|
1212
1213
|
props: {
|
|
1213
1214
|
groups: {},
|
|
@@ -1217,8 +1218,8 @@ var Vt = [
|
|
|
1217
1218
|
},
|
|
1218
1219
|
emits: ["model", "thinking"],
|
|
1219
1220
|
setup(t, { emit: n }) {
|
|
1220
|
-
let r = t, o = n, c =
|
|
1221
|
-
return (t, n) => (g(), i(e, null, [s(
|
|
1221
|
+
let r = t, o = n, c = Y(), l = (e) => Ht.find((t) => e.target instanceof HTMLSelectElement && t === e.target.value) ?? "medium";
|
|
1222
|
+
return (t, n) => (g(), i(e, null, [s(an, {
|
|
1222
1223
|
groups: r.groups,
|
|
1223
1224
|
current: r.model,
|
|
1224
1225
|
empty: r.empty,
|
|
@@ -1233,15 +1234,15 @@ var Vt = [
|
|
|
1233
1234
|
"aria-label": T(c).t("kvcoder.ui.thinking"),
|
|
1234
1235
|
"data-test": "thinking-picker",
|
|
1235
1236
|
onChange: n[1] ||= (e) => o("thinking", l(e))
|
|
1236
|
-
}, [(g(!0), i(e, null, y(T(
|
|
1237
|
+
}, [(g(!0), i(e, null, y(T(Ht), (e) => (g(), i("option", {
|
|
1237
1238
|
key: e,
|
|
1238
1239
|
value: e
|
|
1239
|
-
}, w(T(c).t(`kvcoder.ui.thinkingLevels.${e}`)), 9,
|
|
1240
|
+
}, w(T(c).t(`kvcoder.ui.thinkingLevels.${e}`)), 9, sn))), 128))], 40, on)], 64));
|
|
1240
1241
|
}
|
|
1241
1242
|
});
|
|
1242
1243
|
//#endregion
|
|
1243
1244
|
//#region web/src/remember-model.ts
|
|
1244
|
-
async function
|
|
1245
|
+
async function ln(e, t) {
|
|
1245
1246
|
try {
|
|
1246
1247
|
await e.exec("kernel.settings.set", {
|
|
1247
1248
|
key: "kvai.defaultModel",
|
|
@@ -1249,20 +1250,20 @@ async function cn(e, t) {
|
|
|
1249
1250
|
scope: "global"
|
|
1250
1251
|
}), e.refresh();
|
|
1251
1252
|
} catch (t) {
|
|
1252
|
-
|
|
1253
|
+
Z(e, t);
|
|
1253
1254
|
}
|
|
1254
1255
|
}
|
|
1255
1256
|
//#endregion
|
|
1256
1257
|
//#region web/src/use-chat-model.ts
|
|
1257
|
-
function
|
|
1258
|
+
function un(e, t) {
|
|
1258
1259
|
let n = e.find((e) => e.key === t)?.value;
|
|
1259
1260
|
return typeof n == "string" && n !== "" ? n : null;
|
|
1260
1261
|
}
|
|
1261
|
-
function
|
|
1262
|
+
function dn(e) {
|
|
1262
1263
|
let t = e.find((e) => e.key === "kvcoder.thinking")?.value;
|
|
1263
|
-
return
|
|
1264
|
+
return Ht.find((e) => e === t) ?? "medium";
|
|
1264
1265
|
}
|
|
1265
|
-
function
|
|
1266
|
+
function fn(e, n) {
|
|
1266
1267
|
let r = v([]), i = v([]), a = v(null), o = v(null), s = v("medium"), c = v(null), l = v(!1), u = v(!1);
|
|
1267
1268
|
m(async () => {
|
|
1268
1269
|
try {
|
|
@@ -1271,14 +1272,14 @@ function dn(e, n) {
|
|
|
1271
1272
|
e.exec("kvai.provider.list", {}),
|
|
1272
1273
|
e.exec("kvai.model.list", {})
|
|
1273
1274
|
]);
|
|
1274
|
-
a.value =
|
|
1275
|
+
a.value = un(t, "kvcoder.model") ?? un(t, "kvai.defaultModel"), s.value = dn(t), r.value = n, i.value = o;
|
|
1275
1276
|
} catch (e) {
|
|
1276
1277
|
u.value = !0, n(e);
|
|
1277
1278
|
} finally {
|
|
1278
1279
|
l.value = !0;
|
|
1279
1280
|
}
|
|
1280
1281
|
});
|
|
1281
|
-
let d = t(() => o.value ?? a.value), f = t(() => c.value ?? s.value), p = t(() =>
|
|
1282
|
+
let d = t(() => o.value ?? a.value), f = t(() => c.value ?? s.value), p = t(() => Bt(r.value, i.value, d.value)), h = t(() => r.value.find((e) => e.id === i.value.find((e) => e.id === d.value)?.provider));
|
|
1282
1283
|
return {
|
|
1283
1284
|
current: d,
|
|
1284
1285
|
thinking: f,
|
|
@@ -1295,29 +1296,29 @@ function dn(e, n) {
|
|
|
1295
1296
|
}
|
|
1296
1297
|
//#endregion
|
|
1297
1298
|
//#region web/src/ChatStart.vue?vue&type=script&setup=true&lang.ts
|
|
1298
|
-
var
|
|
1299
|
+
var pn = {
|
|
1299
1300
|
class: "kvc-start",
|
|
1300
1301
|
"data-test": "chat-start"
|
|
1301
|
-
},
|
|
1302
|
+
}, mn = {
|
|
1302
1303
|
key: 0,
|
|
1303
1304
|
class: "kvc-muted kvc-start-note",
|
|
1304
1305
|
role: "status",
|
|
1305
1306
|
"data-test": "key-needed"
|
|
1306
|
-
},
|
|
1307
|
+
}, hn = {
|
|
1307
1308
|
key: 1,
|
|
1308
1309
|
class: "kvc-muted kvc-start-note",
|
|
1309
1310
|
role: "status",
|
|
1310
1311
|
"data-test": "choose-model"
|
|
1311
|
-
},
|
|
1312
|
+
}, gn = {
|
|
1312
1313
|
key: 2,
|
|
1313
1314
|
class: "kvc-muted kvc-start-note"
|
|
1314
|
-
},
|
|
1315
|
+
}, _n = /* @__PURE__ */ c({
|
|
1315
1316
|
__name: "ChatStart",
|
|
1316
1317
|
props: { registered: {} },
|
|
1317
1318
|
setup(t) {
|
|
1318
|
-
let n =
|
|
1319
|
+
let n = Y(), r = t, c = fn(n, (e) => Z(n, e));
|
|
1319
1320
|
async function l(e) {
|
|
1320
|
-
c.pickModel(e), await
|
|
1321
|
+
c.pickModel(e), await ln(n, e);
|
|
1321
1322
|
}
|
|
1322
1323
|
async function u() {
|
|
1323
1324
|
let { id: e } = await n.exec("kvcoder.session.create", {}), t = c.changes();
|
|
@@ -1335,7 +1336,7 @@ var fn = {
|
|
|
1335
1336
|
...e.fileIds.length > 0 ? { fileIds: e.fileIds } : {}
|
|
1336
1337
|
}), n.navigate("kvcoder.session", { sessionId: t });
|
|
1337
1338
|
} catch (e) {
|
|
1338
|
-
|
|
1339
|
+
Z(n, e);
|
|
1339
1340
|
}
|
|
1340
1341
|
}
|
|
1341
1342
|
async function f(e, t) {
|
|
@@ -1349,15 +1350,15 @@ var fn = {
|
|
|
1349
1350
|
text: t === "" ? n.t(e.message) : t
|
|
1350
1351
|
}), n.navigate("kvcoder.session", { sessionId: r });
|
|
1351
1352
|
} catch (e) {
|
|
1352
|
-
|
|
1353
|
+
Z(n, e);
|
|
1353
1354
|
}
|
|
1354
1355
|
}
|
|
1355
|
-
return (t, u) => (g(), i(e, null, [a("div",
|
|
1356
|
+
return (t, u) => (g(), i(e, null, [a("div", pn, [a("h1", null, w(T(n).t("kvcoder.ui.startHeading", { workspace: T(n).workspace.value.name })), 1), T(c).state.value === "needsKey" && T(c).provider.value ? (g(), i("p", mn, [o(w(T(n).t("kvcoder.ui.keyNeeded", { provider: T(c).provider.value.title })) + " ", 1), a("button", {
|
|
1356
1357
|
type: "button",
|
|
1357
1358
|
class: "kvc-link-button",
|
|
1358
1359
|
"data-test": "add-key",
|
|
1359
1360
|
onClick: u[0] ||= (e) => T(n).navigate("kvai.provider", { providerId: T(c).provider.value.id })
|
|
1360
|
-
}, w(T(n).t("kvcoder.ui.addKey")), 1)])) : T(c).state.value === "noModel" ? (g(), i("p",
|
|
1361
|
+
}, w(T(n).t("kvcoder.ui.addKey")), 1)])) : T(c).state.value === "noModel" ? (g(), i("p", hn, w(T(n).t("kvcoder.ui.chooseModelHint")), 1)) : (g(), i("p", gn, w(T(n).t("kvcoder.ui.startHint")), 1))]), s(zt, {
|
|
1361
1362
|
running: !1,
|
|
1362
1363
|
placeholder: T(n).t("kvcoder.ui.startPlaceholder"),
|
|
1363
1364
|
blocked: T(c).state.value !== "ready",
|
|
@@ -1366,7 +1367,7 @@ var fn = {
|
|
|
1366
1367
|
onSend: d,
|
|
1367
1368
|
onRegistered: f
|
|
1368
1369
|
}, {
|
|
1369
|
-
controls: k(() => [s(
|
|
1370
|
+
controls: k(() => [s(cn, {
|
|
1370
1371
|
groups: T(c).groups.value,
|
|
1371
1372
|
model: T(c).current.value,
|
|
1372
1373
|
thinking: T(c).thinking.value,
|
|
@@ -1390,23 +1391,23 @@ var fn = {
|
|
|
1390
1391
|
});
|
|
1391
1392
|
//#endregion
|
|
1392
1393
|
//#region web/src/use-now.ts
|
|
1393
|
-
function
|
|
1394
|
+
function vn() {
|
|
1394
1395
|
let e = v(Date.now()), t;
|
|
1395
1396
|
return m(() => t = setInterval(() => e.value = Date.now(), 1e3)), p(() => clearInterval(t)), e;
|
|
1396
1397
|
}
|
|
1397
1398
|
//#endregion
|
|
1398
1399
|
//#region web/src/CommandProgress.vue?vue&type=script&setup=true&lang.ts
|
|
1399
|
-
var
|
|
1400
|
+
var yn = ["data-command"], bn = { class: "kvc-activity-text" }, xn = {
|
|
1400
1401
|
style: { "font-weight": "500" },
|
|
1401
1402
|
"data-test": "command-title"
|
|
1402
|
-
},
|
|
1403
|
+
}, Sn = {
|
|
1403
1404
|
class: "kvc-muted",
|
|
1404
1405
|
"data-test": "command-seconds"
|
|
1405
|
-
},
|
|
1406
|
+
}, Cn = /* @__PURE__ */ c({
|
|
1406
1407
|
__name: "CommandProgress",
|
|
1407
1408
|
props: { working: {} },
|
|
1408
1409
|
setup(e) {
|
|
1409
|
-
let n = e, r =
|
|
1410
|
+
let n = e, r = Y(), o = vn(), s = t(() => Math.max(0, Math.floor((o.value - n.working.startedAt) / 1e3)));
|
|
1410
1411
|
return (e, t) => (g(), i("div", {
|
|
1411
1412
|
class: "kvc-activity",
|
|
1412
1413
|
role: "status",
|
|
@@ -1418,19 +1419,19 @@ var vn = ["data-command"], yn = { class: "kvc-activity-text" }, bn = {
|
|
|
1418
1419
|
class: "kvc-spin",
|
|
1419
1420
|
"aria-hidden": "true"
|
|
1420
1421
|
}, null, -1),
|
|
1421
|
-
a("span",
|
|
1422
|
-
a("span",
|
|
1423
|
-
], 8,
|
|
1422
|
+
a("span", bn, [a("span", xn, w(T(r).t(`kvcoder.ui.working.${n.working.name}`)), 1)]),
|
|
1423
|
+
a("span", Sn, w(T(r).t("kvcoder.ui.seconds", { count: s.value })), 1)
|
|
1424
|
+
], 8, yn));
|
|
1424
1425
|
}
|
|
1425
|
-
}),
|
|
1426
|
-
function
|
|
1426
|
+
}), wn = 5;
|
|
1427
|
+
function Tn(e, t) {
|
|
1427
1428
|
let n = Math.max(0, Math.floor(t / 1e3));
|
|
1428
1429
|
return n < 60 ? e("kvcoder.ui.seconds", { count: n }) : e("kvcoder.ui.jobs.minutes", {
|
|
1429
1430
|
minutes: Math.floor(n / 60),
|
|
1430
1431
|
seconds: n % 60
|
|
1431
1432
|
});
|
|
1432
1433
|
}
|
|
1433
|
-
function
|
|
1434
|
+
function En(e, n, r) {
|
|
1434
1435
|
let i = v([]), a = v({}), o = v(/* @__PURE__ */ new Set()), s = v(Date.now()), c = t(() => i.value.filter((e) => e.status === "running")), l = 0, u;
|
|
1435
1436
|
async function d() {
|
|
1436
1437
|
for (let t of Object.keys(a.value)) {
|
|
@@ -1448,7 +1449,7 @@ function Tn(e, n, r) {
|
|
|
1448
1449
|
try {
|
|
1449
1450
|
i.value = await e.exec("kvcoder.job.list", { sessionId: n() }), await d();
|
|
1450
1451
|
} catch (t) {
|
|
1451
|
-
|
|
1452
|
+
Z(e, t);
|
|
1452
1453
|
}
|
|
1453
1454
|
}
|
|
1454
1455
|
async function m(e) {
|
|
@@ -1469,13 +1470,13 @@ function Tn(e, n, r) {
|
|
|
1469
1470
|
id: t
|
|
1470
1471
|
});
|
|
1471
1472
|
} catch (t) {
|
|
1472
|
-
|
|
1473
|
+
Z(e, t);
|
|
1473
1474
|
}
|
|
1474
1475
|
o.value = new Set([...o.value].filter((e) => e !== t)), await f();
|
|
1475
1476
|
}
|
|
1476
1477
|
return O(() => c.value.length > 0 || r.value, (e) => {
|
|
1477
1478
|
clearInterval(u), u = void 0, e && (u = setInterval(() => {
|
|
1478
|
-
s.value = Date.now(), l += 1, l %
|
|
1479
|
+
s.value = Date.now(), l += 1, l % wn === 0 && f();
|
|
1479
1480
|
}, 1e3));
|
|
1480
1481
|
}, { immediate: !0 }), p(() => clearInterval(u)), {
|
|
1481
1482
|
jobs: i,
|
|
@@ -1490,25 +1491,25 @@ function Tn(e, n, r) {
|
|
|
1490
1491
|
}
|
|
1491
1492
|
//#endregion
|
|
1492
1493
|
//#region web/src/JobItem.vue?vue&type=script&setup=true&lang.ts
|
|
1493
|
-
var
|
|
1494
|
+
var Dn = ["data-test", "data-status"], On = { class: "kvc-job-head" }, kn = {
|
|
1494
1495
|
class: "kvc-job-title kvc-oneline",
|
|
1495
1496
|
"data-test": "job-title"
|
|
1496
|
-
},
|
|
1497
|
+
}, An = {
|
|
1497
1498
|
key: 0,
|
|
1498
1499
|
class: "kvc-muted",
|
|
1499
1500
|
"data-test": "job-time"
|
|
1500
|
-
},
|
|
1501
|
+
}, jn = {
|
|
1501
1502
|
key: 1,
|
|
1502
1503
|
class: "kvc-chip",
|
|
1503
1504
|
"data-test": "job-status"
|
|
1504
|
-
},
|
|
1505
|
+
}, Mn = {
|
|
1505
1506
|
key: 0,
|
|
1506
1507
|
class: "kvc-job-links"
|
|
1507
|
-
},
|
|
1508
|
+
}, Nn = ["href"], Pn = { class: "kvc-actions" }, Fn = ["aria-expanded", "data-test"], In = ["disabled", "data-test"], Ln = {
|
|
1508
1509
|
key: 1,
|
|
1509
1510
|
class: "kvc-output",
|
|
1510
1511
|
"data-test": "job-output"
|
|
1511
|
-
},
|
|
1512
|
+
}, Rn = /* @__PURE__ */ c({
|
|
1512
1513
|
__name: "JobItem",
|
|
1513
1514
|
props: {
|
|
1514
1515
|
job: {},
|
|
@@ -1518,57 +1519,57 @@ var En = ["data-test", "data-status"], Dn = { class: "kvc-job-head" }, On = {
|
|
|
1518
1519
|
},
|
|
1519
1520
|
emits: ["stop", "logs"],
|
|
1520
1521
|
setup(t, { emit: n }) {
|
|
1521
|
-
let s = t, c = n, l =
|
|
1522
|
+
let s = t, c = n, l = Y();
|
|
1522
1523
|
return (t, n) => (g(), i("div", {
|
|
1523
1524
|
class: "kvc-job",
|
|
1524
1525
|
"data-test": `job-${s.job.id}`,
|
|
1525
1526
|
"data-status": s.job.status
|
|
1526
1527
|
}, [
|
|
1527
|
-
a("div",
|
|
1528
|
-
s.job.links.length > 0 ? (g(), i("div",
|
|
1528
|
+
a("div", On, [a("span", kn, w(s.job.title), 1), s.job.status === "running" ? (g(), i("span", An, w(T(Tn)(T(l).t, s.now - Date.parse(s.job.startedAt))), 1)) : (g(), i("span", jn, [o(w(T(l).t(`kvcoder.ui.jobs.status.${s.job.status}`)), 1), s.job.exitCode !== void 0 && s.job.exitCode !== 0 ? (g(), i(e, { key: 0 }, [o(" · " + w(T(l).t("kvcoder.ui.exitCode", { code: s.job.exitCode })), 1)], 64)) : r("v-if", !0)]))]),
|
|
1529
|
+
s.job.links.length > 0 ? (g(), i("div", Mn, [(g(!0), i(e, null, y(s.job.links, (e) => (g(), i("a", {
|
|
1529
1530
|
key: e,
|
|
1530
1531
|
href: e,
|
|
1531
1532
|
target: "_blank",
|
|
1532
1533
|
rel: "noopener noreferrer",
|
|
1533
1534
|
class: "kvc-link kvc-mono",
|
|
1534
1535
|
"data-test": "job-link"
|
|
1535
|
-
}, w(e), 9,
|
|
1536
|
-
a("div",
|
|
1536
|
+
}, w(e), 9, Nn))), 128))])) : r("v-if", !0),
|
|
1537
|
+
a("div", Pn, [a("button", {
|
|
1537
1538
|
type: "button",
|
|
1538
1539
|
class: "kvc-button",
|
|
1539
1540
|
"aria-expanded": s.logs !== void 0,
|
|
1540
1541
|
"data-test": `job-logs-${s.job.id}`,
|
|
1541
1542
|
onClick: n[0] ||= (e) => c("logs")
|
|
1542
|
-
}, w(T(l).t("kvcoder.ui.jobs.logs")), 9,
|
|
1543
|
+
}, w(T(l).t("kvcoder.ui.jobs.logs")), 9, Fn), s.job.status === "running" ? (g(), i("button", {
|
|
1543
1544
|
key: 0,
|
|
1544
1545
|
type: "button",
|
|
1545
1546
|
class: "kvc-button kvc-primary",
|
|
1546
1547
|
disabled: s.stopping,
|
|
1547
1548
|
"data-test": `job-stop-${s.job.id}`,
|
|
1548
1549
|
onClick: n[1] ||= (e) => c("stop")
|
|
1549
|
-
}, w(T(l).t("kvcoder.ui.jobs.stop")), 9,
|
|
1550
|
-
s.logs === void 0 ? r("v-if", !0) : (g(), i("pre",
|
|
1551
|
-
], 8,
|
|
1550
|
+
}, w(T(l).t("kvcoder.ui.jobs.stop")), 9, In)) : r("v-if", !0)]),
|
|
1551
|
+
s.logs === void 0 ? r("v-if", !0) : (g(), i("pre", Ln, w(s.logs === "" ? T(l).t("kvcoder.ui.jobs.noOutput") : s.logs), 1))
|
|
1552
|
+
], 8, Dn));
|
|
1552
1553
|
}
|
|
1553
|
-
}),
|
|
1554
|
+
}), zn = {
|
|
1554
1555
|
key: 0,
|
|
1555
1556
|
class: "kvc-jobs",
|
|
1556
1557
|
"data-test": "jobs"
|
|
1557
|
-
},
|
|
1558
|
+
}, Bn = ["aria-expanded"], Vn = ["aria-label", "onKeydown"], Hn = /* @__PURE__ */ c({
|
|
1558
1559
|
__name: "JobsChip",
|
|
1559
1560
|
props: {
|
|
1560
1561
|
sessionId: {},
|
|
1561
1562
|
stamp: {}
|
|
1562
1563
|
},
|
|
1563
1564
|
setup(t) {
|
|
1564
|
-
let c = t, l =
|
|
1565
|
+
let c = t, l = Y(), u = v(!1), d = E("trigger"), { jobs: f, running: h, logs: _, stopping: b, now: x, load: S, toggleLogs: C, stop: D } = En(l, () => c.sessionId, u);
|
|
1565
1566
|
function k() {
|
|
1566
1567
|
u.value = !1, d.value?.focus();
|
|
1567
1568
|
}
|
|
1568
1569
|
function A(e) {
|
|
1569
1570
|
e.target instanceof Node && !d.value?.parentElement?.contains(e.target) && (u.value = !1);
|
|
1570
1571
|
}
|
|
1571
|
-
return m(S), O(() => [c.sessionId, c.stamp], S), O(u, (e) => e ? document.addEventListener("pointerdown", A) : document.removeEventListener("pointerdown", A)), p(() => document.removeEventListener("pointerdown", A)), (t, c) => T(h).length > 0 || u.value ? (g(), i("div",
|
|
1572
|
+
return m(S), O(() => [c.sessionId, c.stamp], S), O(u, (e) => e ? document.addEventListener("pointerdown", A) : document.removeEventListener("pointerdown", A)), p(() => document.removeEventListener("pointerdown", A)), (t, c) => T(h).length > 0 || u.value ? (g(), i("div", zn, [a("button", {
|
|
1572
1573
|
ref_key: "trigger",
|
|
1573
1574
|
ref: d,
|
|
1574
1575
|
type: "button",
|
|
@@ -1587,14 +1588,14 @@ var En = ["data-test", "data-status"], Dn = { class: "kvc-job-head" }, On = {
|
|
|
1587
1588
|
size: 16,
|
|
1588
1589
|
"aria-hidden": "true"
|
|
1589
1590
|
})
|
|
1590
|
-
], 8,
|
|
1591
|
+
], 8, Bn), u.value ? (g(), i("div", {
|
|
1591
1592
|
key: 0,
|
|
1592
1593
|
class: "kvc-popover kvc-jobs-panel",
|
|
1593
1594
|
role: "dialog",
|
|
1594
1595
|
"aria-label": T(l).t("kvcoder.ui.jobs.title"),
|
|
1595
1596
|
"data-test": "jobs-popover",
|
|
1596
1597
|
onKeydown: j(M(k, ["stop"]), ["esc"])
|
|
1597
|
-
}, [(g(!0), i(e, null, y(T(f), (e) => (g(), n(
|
|
1598
|
+
}, [(g(!0), i(e, null, y(T(f), (e) => (g(), n(Rn, {
|
|
1598
1599
|
key: e.id,
|
|
1599
1600
|
job: e,
|
|
1600
1601
|
now: T(x),
|
|
@@ -1609,12 +1610,12 @@ var En = ["data-test", "data-status"], Dn = { class: "kvc-job-head" }, On = {
|
|
|
1609
1610
|
"stopping",
|
|
1610
1611
|
"onStop",
|
|
1611
1612
|
"onLogs"
|
|
1612
|
-
]))), 128))], 40,
|
|
1613
|
+
]))), 128))], 40, Vn)) : r("v-if", !0)])) : r("v-if", !0);
|
|
1613
1614
|
}
|
|
1614
1615
|
});
|
|
1615
1616
|
//#endregion
|
|
1616
1617
|
//#region web/src/use-dismiss.ts
|
|
1617
|
-
function
|
|
1618
|
+
function Un(e, t, n) {
|
|
1618
1619
|
let r = (e) => {
|
|
1619
1620
|
e.target instanceof Node && t()?.contains(e.target) !== !0 && n();
|
|
1620
1621
|
}, i = (e) => {
|
|
@@ -1628,26 +1629,19 @@ function Hn(e, t, n) {
|
|
|
1628
1629
|
}
|
|
1629
1630
|
//#endregion
|
|
1630
1631
|
//#region web/src/ConversationHeader.vue?vue&type=script&setup=true&lang.ts
|
|
1631
|
-
var
|
|
1632
|
+
var Wn = { class: "kvc-header" }, Gn = { class: "kvc-title" }, Kn = ["aria-label"], qn = {
|
|
1632
1633
|
key: 1,
|
|
1633
1634
|
"data-test": "session-title"
|
|
1634
|
-
},
|
|
1635
|
-
class: "kvc-muted",
|
|
1636
|
-
"data-test": "session-totals"
|
|
1637
|
-
}, Jn = {
|
|
1638
|
-
key: 2,
|
|
1639
|
-
class: "kvc-muted",
|
|
1640
|
-
"data-test": "session-context"
|
|
1641
|
-
}, Yn = [
|
|
1635
|
+
}, Jn = { class: "kvc-muted kvc-header-stats" }, Yn = ["title"], Xn = ["title", "aria-label"], Zn = [
|
|
1642
1636
|
"aria-pressed",
|
|
1643
1637
|
"aria-label",
|
|
1644
1638
|
"title"
|
|
1645
|
-
],
|
|
1639
|
+
], Qn = ["aria-label", "aria-expanded"], $n = {
|
|
1646
1640
|
key: 0,
|
|
1647
1641
|
class: "kvc-menu",
|
|
1648
1642
|
role: "menu",
|
|
1649
1643
|
"data-test": "chat-menu-items"
|
|
1650
|
-
},
|
|
1644
|
+
}, er = ["disabled"], tr = ["disabled"], nr = ["disabled"], rr = ["disabled"], ir = ["aria-label"], ar = { style: { padding: "6px" } }, or = { class: "kvc-actions" }, sr = /* @__PURE__ */ c({
|
|
1651
1645
|
__name: "ConversationHeader",
|
|
1652
1646
|
props: {
|
|
1653
1647
|
session: {},
|
|
@@ -1670,160 +1664,163 @@ var Un = { class: "kvc-header" }, Wn = { class: "kvc-title" }, Gn = ["aria-label
|
|
|
1670
1664
|
"action",
|
|
1671
1665
|
"toggleArtifacts"
|
|
1672
1666
|
],
|
|
1673
|
-
setup(
|
|
1674
|
-
let
|
|
1675
|
-
function
|
|
1676
|
-
|
|
1667
|
+
setup(n, { emit: c }) {
|
|
1668
|
+
let l = n, u = c, d = Y(), f = v(!1), p = v(null), m = v(!1), h = E("more"), _ = vn(), y = t(() => l.runningSince === void 0 ? 0 : Math.max(0, _.value - Date.parse(l.runningSince))), b = t(() => qe(d.t, l.session.usage, l.session.durationMs + y.value)), x = t(() => `${d.t("kvcoder.ui.turns", { count: l.turns })} · ${Je(d.t, l.session.usage)}`), S = t(() => Ye(d.t, l.context)), C = t(() => d.t("kvcoder.ui.artifacts.toggle", { count: l.artifacts }));
|
|
1669
|
+
function O() {
|
|
1670
|
+
f.value = !1, m.value = !1;
|
|
1677
1671
|
}
|
|
1678
|
-
|
|
1679
|
-
function
|
|
1680
|
-
|
|
1672
|
+
Un(() => f.value || m.value, () => h.value, O);
|
|
1673
|
+
function k(e) {
|
|
1674
|
+
O(), e();
|
|
1681
1675
|
}
|
|
1682
|
-
function
|
|
1683
|
-
let e =
|
|
1684
|
-
|
|
1676
|
+
function j() {
|
|
1677
|
+
let e = p.value ?? "";
|
|
1678
|
+
p.value = null, u("action", "rename", e);
|
|
1685
1679
|
}
|
|
1686
|
-
return (
|
|
1687
|
-
a("div",
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
"
|
|
1703
|
-
|
|
1680
|
+
return (t, n) => (g(), i("header", Wn, [
|
|
1681
|
+
a("div", Gn, [p.value === null ? (g(), i("strong", qn, w(T(Ne)(T(d).t, l.session.title)), 1)) : (g(), i("form", {
|
|
1682
|
+
key: 0,
|
|
1683
|
+
onSubmit: M(j, ["prevent"])
|
|
1684
|
+
}, [A(a("input", {
|
|
1685
|
+
"onUpdate:modelValue": n[0] ||= (e) => p.value = e,
|
|
1686
|
+
class: "kvc-field",
|
|
1687
|
+
"aria-label": T(d).t("kvcoder.ui.rename"),
|
|
1688
|
+
"data-test": "rename-input",
|
|
1689
|
+
onBlur: j
|
|
1690
|
+
}, null, 40, Kn), [[D, p.value]])], 32)), a("span", Jn, [a("span", {
|
|
1691
|
+
title: x.value,
|
|
1692
|
+
"data-test": "session-totals"
|
|
1693
|
+
}, w(b.value), 9, Yn), S.value === void 0 ? r("v-if", !0) : (g(), i(e, { key: 0 }, [n[11] ||= o(" · ", -1), a("span", {
|
|
1694
|
+
title: S.value.full,
|
|
1695
|
+
"aria-label": S.value.full,
|
|
1696
|
+
"data-test": "session-context"
|
|
1697
|
+
}, w(S.value.short), 9, Xn)], 64))])]),
|
|
1698
|
+
s(Hn, {
|
|
1699
|
+
"session-id": l.session.id,
|
|
1700
|
+
stamp: l.session.updatedAt
|
|
1704
1701
|
}, null, 8, ["session-id", "stamp"]),
|
|
1705
|
-
|
|
1702
|
+
l.artifacts > 0 ? (g(), i("button", {
|
|
1706
1703
|
key: 0,
|
|
1707
1704
|
type: "button",
|
|
1708
1705
|
class: "kvc-button",
|
|
1709
|
-
"aria-pressed":
|
|
1710
|
-
"aria-label":
|
|
1711
|
-
title:
|
|
1706
|
+
"aria-pressed": l.artifactsOpen,
|
|
1707
|
+
"aria-label": C.value,
|
|
1708
|
+
title: C.value,
|
|
1712
1709
|
"data-test": "artifacts-toggle",
|
|
1713
|
-
onClick:
|
|
1714
|
-
}, [s(T(
|
|
1710
|
+
onClick: n[1] ||= (e) => u("toggleArtifacts")
|
|
1711
|
+
}, [s(T(fe), {
|
|
1715
1712
|
size: 16,
|
|
1716
1713
|
"aria-hidden": "true"
|
|
1717
|
-
}), o(w(
|
|
1714
|
+
}), o(w(l.artifacts), 1)], 8, Zn)) : r("v-if", !0),
|
|
1718
1715
|
a("div", {
|
|
1719
1716
|
ref_key: "more",
|
|
1720
|
-
ref:
|
|
1717
|
+
ref: h,
|
|
1721
1718
|
style: { position: "relative" }
|
|
1722
1719
|
}, [
|
|
1723
1720
|
a("button", {
|
|
1724
1721
|
type: "button",
|
|
1725
1722
|
class: "kvc-button kvc-ghost",
|
|
1726
|
-
"aria-label": T(
|
|
1727
|
-
"aria-expanded":
|
|
1723
|
+
"aria-label": T(d).t("kvcoder.ui.menu"),
|
|
1724
|
+
"aria-expanded": f.value,
|
|
1728
1725
|
"data-test": "chat-menu",
|
|
1729
|
-
onClick:
|
|
1730
|
-
|
|
1726
|
+
onClick: n[2] ||= (e) => {
|
|
1727
|
+
f.value = !f.value, m.value = !1;
|
|
1731
1728
|
}
|
|
1732
|
-
}, [s(T(
|
|
1733
|
-
|
|
1729
|
+
}, [s(T(se), { size: 18 })], 8, Qn),
|
|
1730
|
+
f.value ? (g(), i("div", $n, [
|
|
1734
1731
|
a("button", {
|
|
1735
1732
|
type: "button",
|
|
1736
1733
|
role: "menuitem",
|
|
1737
1734
|
class: "kvc-button kvc-ghost",
|
|
1738
1735
|
"data-test": "menu-rename",
|
|
1739
|
-
disabled:
|
|
1740
|
-
onClick:
|
|
1741
|
-
}, w(T(
|
|
1736
|
+
disabled: l.working,
|
|
1737
|
+
onClick: n[3] ||= (e) => k(() => p.value = l.session.title)
|
|
1738
|
+
}, w(T(d).t("kvcoder.ui.rename")), 9, er),
|
|
1742
1739
|
a("button", {
|
|
1743
1740
|
type: "button",
|
|
1744
1741
|
role: "menuitem",
|
|
1745
1742
|
class: "kvc-button kvc-ghost",
|
|
1746
1743
|
"data-test": "menu-fork",
|
|
1747
|
-
disabled:
|
|
1748
|
-
onClick:
|
|
1749
|
-
}, w(T(
|
|
1744
|
+
disabled: l.working,
|
|
1745
|
+
onClick: n[4] ||= (e) => k(() => u("action", "fork", ""))
|
|
1746
|
+
}, w(T(d).t("kvcoder.ui.fork")), 9, tr),
|
|
1750
1747
|
a("button", {
|
|
1751
1748
|
type: "button",
|
|
1752
1749
|
role: "menuitem",
|
|
1753
1750
|
class: "kvc-button kvc-ghost",
|
|
1754
1751
|
"data-test": "menu-export",
|
|
1755
|
-
disabled:
|
|
1756
|
-
onClick:
|
|
1757
|
-
}, w(T(
|
|
1752
|
+
disabled: l.working,
|
|
1753
|
+
onClick: n[5] ||= (e) => k(() => u("action", "export", ""))
|
|
1754
|
+
}, w(T(d).t("kvcoder.ui.export")), 9, nr),
|
|
1758
1755
|
a("button", {
|
|
1759
1756
|
type: "button",
|
|
1760
1757
|
role: "menuitem",
|
|
1761
1758
|
class: "kvc-button kvc-ghost",
|
|
1762
1759
|
"data-test": "menu-compact",
|
|
1763
|
-
disabled:
|
|
1764
|
-
onClick:
|
|
1765
|
-
}, w(T(
|
|
1760
|
+
disabled: l.working,
|
|
1761
|
+
onClick: n[6] ||= (e) => k(() => u("action", "compact", ""))
|
|
1762
|
+
}, w(T(d).t("kvcoder.ui.compact")), 9, rr),
|
|
1766
1763
|
a("button", {
|
|
1767
1764
|
type: "button",
|
|
1768
1765
|
role: "menuitem",
|
|
1769
1766
|
class: "kvc-button kvc-ghost",
|
|
1770
1767
|
"data-test": "menu-prompt",
|
|
1771
|
-
onClick:
|
|
1772
|
-
}, w(T(
|
|
1768
|
+
onClick: n[7] ||= (e) => k(() => u("tab", l.tab === "prompt" ? "chat" : "prompt"))
|
|
1769
|
+
}, w(T(d).t(l.tab === "prompt" ? "kvcoder.ui.showChat" : "kvcoder.ui.showPrompt")), 1),
|
|
1773
1770
|
a("button", {
|
|
1774
1771
|
type: "button",
|
|
1775
1772
|
role: "menuitem",
|
|
1776
1773
|
class: "kvc-button kvc-ghost kvc-danger",
|
|
1777
1774
|
"data-test": "menu-delete",
|
|
1778
|
-
onClick:
|
|
1779
|
-
|
|
1775
|
+
onClick: n[8] ||= (e) => {
|
|
1776
|
+
f.value = !1, m.value = !0;
|
|
1780
1777
|
}
|
|
1781
|
-
}, w(T(
|
|
1778
|
+
}, w(T(d).t("kvcoder.ui.delete")), 1)
|
|
1782
1779
|
])) : r("v-if", !0),
|
|
1783
|
-
|
|
1780
|
+
m.value ? (g(), i("div", {
|
|
1784
1781
|
key: 1,
|
|
1785
1782
|
class: "kvc-menu",
|
|
1786
1783
|
role: "alertdialog",
|
|
1787
|
-
"aria-label": T(
|
|
1784
|
+
"aria-label": T(d).t("kvcoder.ui.deleteConfirm"),
|
|
1788
1785
|
"data-test": "delete-confirm"
|
|
1789
|
-
}, [a("span",
|
|
1786
|
+
}, [a("span", ar, w(T(d).t("kvcoder.ui.deleteConfirm")), 1), a("div", or, [a("button", {
|
|
1790
1787
|
type: "button",
|
|
1791
1788
|
class: "kvc-button",
|
|
1792
|
-
onClick:
|
|
1793
|
-
}, w(T(
|
|
1789
|
+
onClick: n[9] ||= (e) => m.value = !1
|
|
1790
|
+
}, w(T(d).t("kvcoder.ui.cancel")), 1), a("button", {
|
|
1794
1791
|
type: "button",
|
|
1795
1792
|
class: "kvc-button kvc-primary",
|
|
1796
1793
|
"data-test": "confirm-delete",
|
|
1797
|
-
onClick:
|
|
1798
|
-
}, w(T(
|
|
1794
|
+
onClick: n[10] ||= (e) => k(() => u("action", "delete", ""))
|
|
1795
|
+
}, w(T(d).t("kvcoder.ui.delete")), 1)])], 8, ir)) : r("v-if", !0)
|
|
1799
1796
|
], 512)
|
|
1800
1797
|
]));
|
|
1801
1798
|
}
|
|
1802
|
-
}),
|
|
1799
|
+
}), cr = 200, lr = [
|
|
1803
1800
|
"text",
|
|
1804
1801
|
"choice",
|
|
1805
1802
|
"confirm"
|
|
1806
1803
|
];
|
|
1807
|
-
function
|
|
1804
|
+
function ur(e) {
|
|
1808
1805
|
return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
|
|
1809
1806
|
}
|
|
1810
|
-
var
|
|
1811
|
-
function
|
|
1812
|
-
let n =
|
|
1813
|
-
return
|
|
1807
|
+
var Q = (e) => typeof e == "string" && e.trim() !== "" ? e : void 0;
|
|
1808
|
+
function dr(e, t) {
|
|
1809
|
+
let n = Q(t.args);
|
|
1810
|
+
return Q(t.line) ?? (n === void 0 ? e : `${e} ${n}`);
|
|
1814
1811
|
}
|
|
1815
|
-
function
|
|
1816
|
-
let t =
|
|
1812
|
+
function fr(e) {
|
|
1813
|
+
let t = Q(e.title) ?? Q(e.description), n = Q(e.command);
|
|
1817
1814
|
return {
|
|
1818
1815
|
...t === void 0 ? {} : { description: t },
|
|
1819
1816
|
...n === void 0 ? {} : { line: n },
|
|
1820
1817
|
...e.mode === "async" ? { background: !0 } : {}
|
|
1821
1818
|
};
|
|
1822
1819
|
}
|
|
1823
|
-
function
|
|
1824
|
-
let t =
|
|
1825
|
-
if (t === void 0) return
|
|
1826
|
-
let r =
|
|
1820
|
+
function pr(e) {
|
|
1821
|
+
let t = Q(e.connector), n = Q(e.command);
|
|
1822
|
+
if (t === void 0) return fr(e);
|
|
1823
|
+
let r = Q(e.description), i = ur(typeof e.payload == "string" ? void 0 : e.payload) ?? {}, a = n === "exec" ? { line: dr(t, i) } : Object.keys(i).length === 0 ? {} : { payload: JSON.stringify(i, null, 2) }, o = t === "ask" ? lr.find((e) => e === n) : void 0;
|
|
1827
1824
|
return {
|
|
1828
1825
|
...r === void 0 ? {} : { description: r },
|
|
1829
1826
|
...n === void 0 ? {} : { label: `${t} · ${n}` },
|
|
@@ -1835,13 +1832,13 @@ function Q(e) {
|
|
|
1835
1832
|
} }
|
|
1836
1833
|
};
|
|
1837
1834
|
}
|
|
1838
|
-
function
|
|
1835
|
+
function mr(e) {
|
|
1839
1836
|
let t = e.replace(/\s+/g, " ");
|
|
1840
|
-
return t.length >
|
|
1837
|
+
return t.length > cr ? `${t.slice(0, cr)}…` : t;
|
|
1841
1838
|
}
|
|
1842
1839
|
//#endregion
|
|
1843
1840
|
//#region web/src/live-step.ts
|
|
1844
|
-
var
|
|
1841
|
+
var hr = () => ({
|
|
1845
1842
|
text: "",
|
|
1846
1843
|
thinking: "",
|
|
1847
1844
|
summarizing: !1,
|
|
@@ -1849,28 +1846,28 @@ var fr = () => ({
|
|
|
1849
1846
|
retry: null,
|
|
1850
1847
|
startedAt: Date.now()
|
|
1851
1848
|
});
|
|
1852
|
-
function
|
|
1849
|
+
function gr(e) {
|
|
1853
1850
|
return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
|
|
1854
1851
|
}
|
|
1855
|
-
function
|
|
1852
|
+
function _r(e) {
|
|
1856
1853
|
let t = e.calls.at(-1);
|
|
1857
1854
|
return t === void 0 ? e.text === "" ? e.thinking === "" ? e.retry === null ? "waiting" : "retrying" : "thinking" : "writing" : t.complete ? "running" : "preparing";
|
|
1858
1855
|
}
|
|
1859
|
-
function
|
|
1860
|
-
let r =
|
|
1856
|
+
function vr(e, t, n) {
|
|
1857
|
+
let r = gr(t.arguments);
|
|
1861
1858
|
(r === void 0 || e.calls.length === 0) && e.calls.push({
|
|
1862
1859
|
name: n,
|
|
1863
1860
|
complete: !1
|
|
1864
1861
|
});
|
|
1865
1862
|
let i = e.calls.at(-1);
|
|
1866
1863
|
if (r === void 0 || i === void 0) return;
|
|
1867
|
-
let a =
|
|
1864
|
+
let a = pr(r);
|
|
1868
1865
|
a.description !== void 0 && (i.description = a.description), a.label !== void 0 && (i.label = a.label), i.complete = "payload" in r;
|
|
1869
1866
|
}
|
|
1870
|
-
function
|
|
1867
|
+
function yr(e, t) {
|
|
1871
1868
|
if (t.type !== "progress") return { kind: "none" };
|
|
1872
|
-
let n =
|
|
1873
|
-
return n === void 0 ? { kind: "none" } : t.source === "@kvman/kvai" && !e.summarizing ? (e.retry = null, e.calls.some((e) => e.carried === !0) && (e.calls = []), n.type === "text" && typeof n.delta == "string" && (e.text += n.delta), n.type === "thinking" && typeof n.delta == "string" && (e.thinking += n.delta), n.type === "toolcall" && typeof n.name == "string" &&
|
|
1869
|
+
let n = gr(t.data);
|
|
1870
|
+
return n === void 0 ? { kind: "none" } : t.source === "@kvman/kvai" && !e.summarizing ? (e.retry = null, e.calls.some((e) => e.carried === !0) && (e.calls = []), n.type === "text" && typeof n.delta == "string" && (e.text += n.delta), n.type === "thinking" && typeof n.delta == "string" && (e.thinking += n.delta), n.type === "toolcall" && typeof n.name == "string" && vr(e, n, n.name), { kind: "none" }) : t.source === "@kvman/kvcoder" ? (n.type === "compaction" && (e.summarizing = n.state === "started"), n.type === "retry" && typeof n.attempt == "number" && typeof n.of == "number" && (e.retry = {
|
|
1874
1871
|
attempt: n.attempt,
|
|
1875
1872
|
of: n.of
|
|
1876
1873
|
}), n.type === "follow" && typeof n.jobId == "string" ? {
|
|
@@ -1884,30 +1881,30 @@ function gr(e, t) {
|
|
|
1884
1881
|
}
|
|
1885
1882
|
//#endregion
|
|
1886
1883
|
//#region web/src/ActivityLine.vue?vue&type=script&setup=true&lang.ts
|
|
1887
|
-
var
|
|
1884
|
+
var br = ["data-phase"], xr = { class: "kvc-activity-text" }, Sr = {
|
|
1888
1885
|
style: { "font-weight": "600" },
|
|
1889
1886
|
"data-test": "activity-title"
|
|
1890
|
-
},
|
|
1887
|
+
}, Cr = {
|
|
1891
1888
|
key: 0,
|
|
1892
1889
|
class: "kvc-muted",
|
|
1893
1890
|
dir: "ltr",
|
|
1894
1891
|
"data-test": "activity-label"
|
|
1895
|
-
},
|
|
1892
|
+
}, wr = {
|
|
1896
1893
|
key: 1,
|
|
1897
1894
|
style: { "font-weight": "500" },
|
|
1898
1895
|
"data-test": "activity-title"
|
|
1899
|
-
},
|
|
1896
|
+
}, Tr = {
|
|
1900
1897
|
key: 0,
|
|
1901
1898
|
class: "kvc-muted",
|
|
1902
1899
|
"data-test": "activity-phase"
|
|
1903
|
-
},
|
|
1900
|
+
}, Er = {
|
|
1904
1901
|
class: "kvc-muted",
|
|
1905
1902
|
"data-test": "activity-seconds"
|
|
1906
|
-
},
|
|
1903
|
+
}, Dr = /* @__PURE__ */ c({
|
|
1907
1904
|
__name: "ActivityLine",
|
|
1908
1905
|
props: { live: {} },
|
|
1909
1906
|
setup(n) {
|
|
1910
|
-
let o = n, s =
|
|
1907
|
+
let o = n, s = Y(), c = vn(), l = t(() => _r(o.live)), u = t(() => Math.max(0, Math.floor((c.value - o.live.startedAt) / 1e3)));
|
|
1911
1908
|
return (t, n) => (g(), i("div", {
|
|
1912
1909
|
class: "kvc-activity",
|
|
1913
1910
|
role: "status",
|
|
@@ -1919,14 +1916,14 @@ var _r = ["data-phase"], vr = { class: "kvc-activity-text" }, yr = {
|
|
|
1919
1916
|
class: "kvc-spin",
|
|
1920
1917
|
"aria-hidden": "true"
|
|
1921
1918
|
}, null, -1),
|
|
1922
|
-
a("span",
|
|
1919
|
+
a("span", xr, [o.live.calls.length > 0 ? (g(!0), i(e, { key: 0 }, y(o.live.calls, (e, t) => (g(), i("span", {
|
|
1923
1920
|
key: t,
|
|
1924
1921
|
class: "kvc-activity-call",
|
|
1925
1922
|
"data-test": "activity-call"
|
|
1926
|
-
}, [a("span",
|
|
1927
|
-
o.live.calls.length > 0 ? (g(), i("span",
|
|
1928
|
-
a("span",
|
|
1929
|
-
], 8,
|
|
1923
|
+
}, [a("span", Sr, w(e.description ?? T(s).t("kvcoder.ui.activity.preparing")), 1), e.label ? (g(), i("span", Cr, w(e.label), 1)) : r("v-if", !0)]))), 128)) : (g(), i("span", wr, w(T(s).t(`kvcoder.ui.activity.${l.value}`, o.live.retry ?? {})), 1))]),
|
|
1924
|
+
o.live.calls.length > 0 ? (g(), i("span", Tr, w(T(s).t(`kvcoder.ui.activity.${l.value}`)), 1)) : r("v-if", !0),
|
|
1925
|
+
a("span", Er, w(T(s).t("kvcoder.ui.seconds", { count: u.value })), 1)
|
|
1926
|
+
], 8, br));
|
|
1930
1927
|
}
|
|
1931
1928
|
});
|
|
1932
1929
|
//#endregion
|
|
@@ -1934,34 +1931,34 @@ var _r = ["data-phase"], vr = { class: "kvc-activity-text" }, yr = {
|
|
|
1934
1931
|
function $(e) {
|
|
1935
1932
|
return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
|
|
1936
1933
|
}
|
|
1937
|
-
function
|
|
1934
|
+
function Or(e) {
|
|
1938
1935
|
return Array.isArray(e) ? e.flatMap((e) => {
|
|
1939
1936
|
let t = $(e);
|
|
1940
1937
|
return t === void 0 ? [] : [t];
|
|
1941
1938
|
}) : [];
|
|
1942
1939
|
}
|
|
1943
|
-
function
|
|
1944
|
-
return typeof e == "string" ? e :
|
|
1940
|
+
function kr(e) {
|
|
1941
|
+
return typeof e == "string" ? e : Or(e).flatMap((e) => e.type === "text" && typeof e.text == "string" ? [e.text] : []).join("\n");
|
|
1945
1942
|
}
|
|
1946
|
-
function
|
|
1947
|
-
return
|
|
1943
|
+
function Ar(e) {
|
|
1944
|
+
return Or(e.content.content).flatMap((e) => e.type === "thinking" && typeof e.thinking == "string" ? [e.thinking] : []).join("\n");
|
|
1948
1945
|
}
|
|
1949
|
-
function
|
|
1946
|
+
function jr(e) {
|
|
1950
1947
|
let t = /* @__PURE__ */ new Map();
|
|
1951
1948
|
for (let n of e) {
|
|
1952
1949
|
if (n.kind !== "assistant") continue;
|
|
1953
1950
|
let e = typeof n.durationMs == "number" ? { writtenMs: n.durationMs } : {};
|
|
1954
|
-
for (let r of
|
|
1951
|
+
for (let r of Or(n.content.content)) {
|
|
1955
1952
|
let n = $(r.arguments);
|
|
1956
1953
|
r.type === "toolCall" && typeof r.id == "string" && n !== void 0 && t.set(r.id, {
|
|
1957
|
-
...
|
|
1954
|
+
...pr(n),
|
|
1958
1955
|
...e
|
|
1959
1956
|
});
|
|
1960
1957
|
}
|
|
1961
1958
|
}
|
|
1962
1959
|
return t;
|
|
1963
1960
|
}
|
|
1964
|
-
function
|
|
1961
|
+
function Mr(e, t) {
|
|
1965
1962
|
let { description: n, connector: r, command: i } = e;
|
|
1966
1963
|
return typeof r == "string" ? {
|
|
1967
1964
|
...t,
|
|
@@ -1970,44 +1967,44 @@ function kr(e, t) {
|
|
|
1970
1967
|
...e.background === !0 ? { background: !0 } : {}
|
|
1971
1968
|
} : {
|
|
1972
1969
|
...t,
|
|
1973
|
-
...
|
|
1970
|
+
...pr(e)
|
|
1974
1971
|
};
|
|
1975
1972
|
}
|
|
1976
|
-
function
|
|
1977
|
-
let n = $(e.content.details), r =
|
|
1973
|
+
function Nr(e, t) {
|
|
1974
|
+
let n = $(e.content.details), r = kr(e.content.content), i = /\n?\[exit code (\d+)\]$/.exec(r), a = t.get(String(e.content.toolCallId)), o = typeof n?.exitCode == "number" ? n.exitCode : i === null ? void 0 : Number(i[1]);
|
|
1978
1975
|
return {
|
|
1979
|
-
...n === void 0 ? a :
|
|
1976
|
+
...n === void 0 ? a : Mr(n, a),
|
|
1980
1977
|
output: typeof n?.output == "string" ? n.output : n === void 0 ? r.replace(/\n?\[exit code \d+\]$/, "") : r,
|
|
1981
1978
|
failed: e.content.isError === !0 || o !== void 0 && o !== 0,
|
|
1982
1979
|
...typeof n?.durationMs == "number" ? { durationMs: n.durationMs } : {}
|
|
1983
1980
|
};
|
|
1984
1981
|
}
|
|
1985
|
-
var
|
|
1986
|
-
function
|
|
1987
|
-
if (e ===
|
|
1982
|
+
var Pr = "dismissed by the user";
|
|
1983
|
+
function Fr(e) {
|
|
1984
|
+
if (e === Pr) return { dismissed: !0 };
|
|
1988
1985
|
try {
|
|
1989
1986
|
return $(JSON.parse(e));
|
|
1990
1987
|
} catch {
|
|
1991
1988
|
return;
|
|
1992
1989
|
}
|
|
1993
1990
|
}
|
|
1994
|
-
function
|
|
1991
|
+
function Ir(e, t) {
|
|
1995
1992
|
if (e.kind !== "toolResult" || e.content.isError === !0) return;
|
|
1996
1993
|
let n = t.get(String(e.content.toolCallId))?.ask;
|
|
1997
1994
|
if (n === void 0) return;
|
|
1998
|
-
let r =
|
|
1995
|
+
let r = Fr(kr(e.content.content));
|
|
1999
1996
|
return r === void 0 ? void 0 : {
|
|
2000
1997
|
...n,
|
|
2001
1998
|
answer: r
|
|
2002
1999
|
};
|
|
2003
2000
|
}
|
|
2004
|
-
function
|
|
2001
|
+
function Lr(e) {
|
|
2005
2002
|
return e.kind === "user" && e.source?.kind === "extension" && e.source.name === "@kvman/kvcoder";
|
|
2006
2003
|
}
|
|
2007
|
-
function
|
|
2004
|
+
function Rr(e) {
|
|
2008
2005
|
return e.kind === "user" && (e.source?.kind === "job" || e.source?.kind === "subagent");
|
|
2009
2006
|
}
|
|
2010
|
-
function
|
|
2007
|
+
function zr(e) {
|
|
2011
2008
|
if (e.kind !== "toolResult") return;
|
|
2012
2009
|
let t = $(e.content.details);
|
|
2013
2010
|
if (t === void 0) return;
|
|
@@ -2021,11 +2018,20 @@ function Ir(e) {
|
|
|
2021
2018
|
version: o
|
|
2022
2019
|
};
|
|
2023
2020
|
}
|
|
2021
|
+
var Br = /\n\nAttached files:\n((?:- .+\n?)+)$/;
|
|
2022
|
+
function Vr(e, t) {
|
|
2023
|
+
return e.replace(Br, (e, n) => `\n\n${t}\n${n}`);
|
|
2024
|
+
}
|
|
2025
|
+
var Hr = /^The background call `([\s\S]*?)` \(job [^)\n]+\) finished:\n/;
|
|
2026
|
+
function Ur(e) {
|
|
2027
|
+
let t = Hr.exec(kr(e.content.content))?.[1]?.trim();
|
|
2028
|
+
return t === void 0 || t === "" ? void 0 : t;
|
|
2029
|
+
}
|
|
2024
2030
|
//#endregion
|
|
2025
2031
|
//#region web/src/question-options.ts
|
|
2026
|
-
function
|
|
2032
|
+
function Wr(e) {
|
|
2027
2033
|
return (Array.isArray(e.options) ? e.options : []).map((e) => {
|
|
2028
|
-
let t =
|
|
2034
|
+
let t = X(e);
|
|
2029
2035
|
return {
|
|
2030
2036
|
id: String(t.id),
|
|
2031
2037
|
label: String(t.label),
|
|
@@ -2035,56 +2041,56 @@ function Lr(e) {
|
|
|
2035
2041
|
}
|
|
2036
2042
|
//#endregion
|
|
2037
2043
|
//#region web/src/AnsweredCard.vue?vue&type=script&setup=true&lang.ts
|
|
2038
|
-
var
|
|
2044
|
+
var Gr = ["aria-label"], Kr = {
|
|
2039
2045
|
class: "kvc-card-row",
|
|
2040
2046
|
style: { "font-weight": "600" }
|
|
2041
|
-
},
|
|
2047
|
+
}, qr = {
|
|
2042
2048
|
dir: "auto",
|
|
2043
2049
|
"data-test": "answered-prompt"
|
|
2044
|
-
},
|
|
2050
|
+
}, Jr = { class: "kvc-card-body" }, Yr = {
|
|
2045
2051
|
key: 0,
|
|
2046
2052
|
class: "kvc-muted",
|
|
2047
2053
|
"data-test": "answered-skipped"
|
|
2048
|
-
},
|
|
2054
|
+
}, Xr = ["data-chosen", "data-test"], Zr = {
|
|
2049
2055
|
key: 1,
|
|
2050
2056
|
class: "kvc-answered-gap",
|
|
2051
2057
|
"aria-hidden": "true"
|
|
2052
|
-
},
|
|
2058
|
+
}, Qr = { style: {
|
|
2053
2059
|
display: "flex",
|
|
2054
2060
|
"flex-direction": "column"
|
|
2055
|
-
} },
|
|
2061
|
+
} }, $r = { dir: "auto" }, ei = {
|
|
2056
2062
|
key: 0,
|
|
2057
2063
|
class: "kvc-muted",
|
|
2058
2064
|
dir: "auto"
|
|
2059
|
-
},
|
|
2065
|
+
}, ti = {
|
|
2060
2066
|
key: 2,
|
|
2061
2067
|
class: "kvc-sr"
|
|
2062
|
-
},
|
|
2068
|
+
}, ni = {
|
|
2063
2069
|
key: 0,
|
|
2064
2070
|
class: "kvc-answered-option",
|
|
2065
2071
|
"data-chosen": "true",
|
|
2066
2072
|
"data-test": "answered-other"
|
|
2067
|
-
},
|
|
2073
|
+
}, ri = { style: {
|
|
2068
2074
|
display: "flex",
|
|
2069
2075
|
"flex-direction": "column"
|
|
2070
|
-
} },
|
|
2076
|
+
} }, ii = { class: "kvc-muted" }, ai = {
|
|
2071
2077
|
dir: "auto",
|
|
2072
2078
|
style: { "white-space": "pre-wrap" }
|
|
2073
|
-
},
|
|
2079
|
+
}, oi = {
|
|
2074
2080
|
key: 2,
|
|
2075
2081
|
class: "kvc-chip",
|
|
2076
2082
|
style: { "align-self": "flex-start" },
|
|
2077
2083
|
"data-test": "answered-confirmed"
|
|
2078
|
-
},
|
|
2084
|
+
}, si = {
|
|
2079
2085
|
key: 3,
|
|
2080
2086
|
dir: "auto",
|
|
2081
2087
|
style: { "white-space": "pre-wrap" },
|
|
2082
2088
|
"data-test": "answered-text"
|
|
2083
|
-
},
|
|
2089
|
+
}, ci = /* @__PURE__ */ c({
|
|
2084
2090
|
__name: "AnsweredCard",
|
|
2085
2091
|
props: { answered: {} },
|
|
2086
2092
|
setup(o) {
|
|
2087
|
-
let c = o, l =
|
|
2093
|
+
let c = o, l = Y(), u = t(() => String(c.answered.question.prompt ?? "")), d = t(() => c.answered.answer.dismissed === !0), f = t(() => Array.isArray(c.answered.answer.selected) ? c.answered.answer.selected : []), p = t(() => Wr(c.answered.question).map((e) => ({
|
|
2088
2094
|
...e,
|
|
2089
2095
|
chosen: f.value.includes(e.id)
|
|
2090
2096
|
}))), m = t(() => typeof c.answered.answer.other == "string" ? c.answered.answer.other : ""), h = t(() => typeof c.answered.answer.text == "string" ? c.answered.answer.text : "");
|
|
@@ -2092,11 +2098,11 @@ var Rr = ["aria-label"], zr = {
|
|
|
2092
2098
|
class: "kvc-card",
|
|
2093
2099
|
"data-test": "answered-card",
|
|
2094
2100
|
"aria-label": u.value
|
|
2095
|
-
}, [a("div",
|
|
2101
|
+
}, [a("div", Kr, [s(T(re), {
|
|
2096
2102
|
size: 18,
|
|
2097
2103
|
"aria-hidden": "true",
|
|
2098
2104
|
class: "kvc-ok"
|
|
2099
|
-
}), a("span",
|
|
2105
|
+
}), a("span", qr, w(u.value), 1)]), a("div", Jr, [d.value ? (g(), i("span", Yr, w(T(l).t("kvcoder.ui.skipped")), 1)) : c.answered.kind === "choice" ? (g(), i(e, { key: 1 }, [(g(!0), i(e, null, y(p.value, (e) => (g(), i("div", {
|
|
2100
2106
|
key: e.id,
|
|
2101
2107
|
class: "kvc-answered-option",
|
|
2102
2108
|
"data-chosen": e.chosen,
|
|
@@ -2107,19 +2113,19 @@ var Rr = ["aria-label"], zr = {
|
|
|
2107
2113
|
size: 16,
|
|
2108
2114
|
"aria-hidden": "true",
|
|
2109
2115
|
class: "kvc-ok"
|
|
2110
|
-
})) : (g(), i("span",
|
|
2111
|
-
a("span",
|
|
2112
|
-
e.chosen ? (g(), i("span",
|
|
2113
|
-
], 8,
|
|
2116
|
+
})) : (g(), i("span", Zr)),
|
|
2117
|
+
a("span", Qr, [a("span", $r, w(e.label), 1), e.description ? (g(), i("span", ei, w(e.description), 1)) : r("v-if", !0)]),
|
|
2118
|
+
e.chosen ? (g(), i("span", ti, w(T(l).t("kvcoder.ui.chosen")), 1)) : r("v-if", !0)
|
|
2119
|
+
], 8, Xr))), 128)), m.value === "" ? r("v-if", !0) : (g(), i("div", ni, [s(T(q), {
|
|
2114
2120
|
size: 16,
|
|
2115
2121
|
"aria-hidden": "true",
|
|
2116
2122
|
class: "kvc-ok"
|
|
2117
|
-
}), a("span",
|
|
2123
|
+
}), a("span", ri, [a("span", ii, w(T(l).t("kvcoder.ui.other")), 1), a("span", ai, w(m.value), 1)])]))], 64)) : c.answered.kind === "confirm" ? (g(), i("span", oi, w(T(l).t(c.answered.answer.confirmed === !0 ? "kvcoder.ui.yes" : "kvcoder.ui.no")), 1)) : (g(), i("span", si, w(h.value), 1))])], 8, Gr));
|
|
2118
2124
|
}
|
|
2119
|
-
}),
|
|
2125
|
+
}), li = {
|
|
2120
2126
|
class: "kvc-card kvc-card-row",
|
|
2121
2127
|
"data-test": "artifact-card"
|
|
2122
|
-
},
|
|
2128
|
+
}, ui = {
|
|
2123
2129
|
style: {
|
|
2124
2130
|
flex: "1 1 auto",
|
|
2125
2131
|
"min-inline-size": "0",
|
|
@@ -2128,13 +2134,13 @@ var Rr = ["aria-label"], zr = {
|
|
|
2128
2134
|
"white-space": "nowrap"
|
|
2129
2135
|
},
|
|
2130
2136
|
"data-test": "artifact-card-title"
|
|
2131
|
-
},
|
|
2137
|
+
}, di = {
|
|
2132
2138
|
class: "kvc-chip",
|
|
2133
2139
|
"data-test": "artifact-card-format"
|
|
2134
|
-
},
|
|
2140
|
+
}, fi = {
|
|
2135
2141
|
class: "kvc-muted",
|
|
2136
2142
|
"data-test": "artifact-card-version"
|
|
2137
|
-
},
|
|
2143
|
+
}, pi = /* @__PURE__ */ c({
|
|
2138
2144
|
__name: "ArtifactCard",
|
|
2139
2145
|
props: {
|
|
2140
2146
|
id: {},
|
|
@@ -2144,15 +2150,15 @@ var Rr = ["aria-label"], zr = {
|
|
|
2144
2150
|
},
|
|
2145
2151
|
emits: ["open"],
|
|
2146
2152
|
setup(e, { emit: t }) {
|
|
2147
|
-
let n = e, r = t, o =
|
|
2148
|
-
return (e, t) => (g(), i("div",
|
|
2149
|
-
s(T(
|
|
2153
|
+
let n = e, r = t, o = Y();
|
|
2154
|
+
return (e, t) => (g(), i("div", li, [
|
|
2155
|
+
s(T(fe), {
|
|
2150
2156
|
size: 16,
|
|
2151
2157
|
"aria-hidden": "true"
|
|
2152
2158
|
}),
|
|
2153
|
-
a("span",
|
|
2154
|
-
a("span",
|
|
2155
|
-
a("span",
|
|
2159
|
+
a("span", ui, w(n.title), 1),
|
|
2160
|
+
a("span", di, w(T(o).t(`kvcoder.ui.artifacts.format.${n.format}`)), 1),
|
|
2161
|
+
a("span", fi, w(T(o).t("kvcoder.ui.artifacts.version", { version: n.version })), 1),
|
|
2156
2162
|
a("button", {
|
|
2157
2163
|
type: "button",
|
|
2158
2164
|
class: "kvc-button",
|
|
@@ -2164,7 +2170,7 @@ var Rr = ["aria-label"], zr = {
|
|
|
2164
2170
|
});
|
|
2165
2171
|
//#endregion
|
|
2166
2172
|
//#region web/src/durations.ts
|
|
2167
|
-
function
|
|
2173
|
+
function mi(e, t) {
|
|
2168
2174
|
if (t < 1e3) return e("kvcoder.ui.milliseconds", { count: Math.round(t) });
|
|
2169
2175
|
if (t < 1e4) return e("kvcoder.ui.seconds", { count: (t / 1e3).toFixed(1) });
|
|
2170
2176
|
let n = Math.round(t / 1e3);
|
|
@@ -2175,11 +2181,11 @@ function si(e, t) {
|
|
|
2175
2181
|
}
|
|
2176
2182
|
//#endregion
|
|
2177
2183
|
//#region web/src/output-links.ts
|
|
2178
|
-
var
|
|
2179
|
-
function
|
|
2184
|
+
var hi = /http:\/\/(?:127\.0\.0\.1|localhost):\d+[^\s"'`<>()[\]{}]*/g, gi = /[.,;:!?]+$/;
|
|
2185
|
+
function _i(e) {
|
|
2180
2186
|
let t = [], n = 0;
|
|
2181
|
-
for (let r of e.matchAll(
|
|
2182
|
-
let i = r[0].replace(
|
|
2187
|
+
for (let r of e.matchAll(hi)) {
|
|
2188
|
+
let i = r[0].replace(gi, "");
|
|
2183
2189
|
r.index > n && t.push({
|
|
2184
2190
|
kind: "text",
|
|
2185
2191
|
text: e.slice(n, r.index)
|
|
@@ -2193,7 +2199,7 @@ function ui(e) {
|
|
|
2193
2199
|
text: e.slice(n)
|
|
2194
2200
|
}), t;
|
|
2195
2201
|
}
|
|
2196
|
-
function
|
|
2202
|
+
function vi(e) {
|
|
2197
2203
|
if (!/^[[{]/.test(e) || e.includes("\n")) return e;
|
|
2198
2204
|
try {
|
|
2199
2205
|
return JSON.stringify(JSON.parse(e), null, 2);
|
|
@@ -2204,36 +2210,36 @@ function di(e) {
|
|
|
2204
2210
|
}
|
|
2205
2211
|
//#endregion
|
|
2206
2212
|
//#region web/src/CallCard.vue?vue&type=script&setup=true&lang.ts
|
|
2207
|
-
var
|
|
2213
|
+
var yi = ["aria-expanded", "disabled"], bi = ["aria-label"], xi = { class: "kvc-lines" }, Si = {
|
|
2208
2214
|
key: 0,
|
|
2209
2215
|
style: { "font-weight": "600" },
|
|
2210
2216
|
"data-test": "call-description"
|
|
2211
|
-
},
|
|
2217
|
+
}, Ci = {
|
|
2212
2218
|
key: 1,
|
|
2213
2219
|
class: "kvc-oneline",
|
|
2214
2220
|
"data-test": "call-line"
|
|
2215
|
-
},
|
|
2221
|
+
}, wi = { class: "kvc-mono" }, Ti = {
|
|
2216
2222
|
key: 2,
|
|
2217
2223
|
class: "kvc-muted",
|
|
2218
2224
|
dir: "ltr",
|
|
2219
2225
|
style: { "align-self": "flex-start" },
|
|
2220
2226
|
"data-test": "call-label"
|
|
2221
|
-
},
|
|
2227
|
+
}, Ei = {
|
|
2222
2228
|
key: 2,
|
|
2223
2229
|
class: "kvc-chip",
|
|
2224
2230
|
"data-test": "call-background"
|
|
2225
|
-
},
|
|
2231
|
+
}, Di = {
|
|
2226
2232
|
key: 3,
|
|
2227
2233
|
class: "kvc-chip kvc-danger",
|
|
2228
2234
|
"data-test": "call-failed"
|
|
2229
|
-
},
|
|
2235
|
+
}, Oi = {
|
|
2230
2236
|
class: "kvc-muted",
|
|
2231
2237
|
"data-test": "call-time"
|
|
2232
|
-
},
|
|
2238
|
+
}, ki = {
|
|
2233
2239
|
key: 0,
|
|
2234
2240
|
class: "kvc-muted kvc-call-parts",
|
|
2235
2241
|
"data-test": "call-parts"
|
|
2236
|
-
},
|
|
2242
|
+
}, Ai = ["aria-label"], ji = ["aria-label"], Mi = ["href"], Ni = /* @__PURE__ */ c({
|
|
2237
2243
|
__name: "CallCard",
|
|
2238
2244
|
props: {
|
|
2239
2245
|
description: {},
|
|
@@ -2248,11 +2254,11 @@ var fi = ["aria-expanded", "disabled"], pi = ["aria-label"], mi = { class: "kvc-
|
|
|
2248
2254
|
background: { type: Boolean }
|
|
2249
2255
|
},
|
|
2250
2256
|
setup(s) {
|
|
2251
|
-
let c = s, l =
|
|
2257
|
+
let c = s, l = Y(), u = v(!1), d = t(() => _i(vi(c.output ?? ""))), p = t(() => c.durationMs === void 0 ? "" : mi(l.t, (c.writtenMs ?? 0) + c.durationMs)), m = t(() => {
|
|
2252
2258
|
if (c.durationMs === void 0) return "";
|
|
2253
|
-
let e =
|
|
2259
|
+
let e = mi(l.t, c.durationMs);
|
|
2254
2260
|
return c.writtenMs === void 0 ? l.t("kvcoder.ui.callRan", { ran: e }) : l.t("kvcoder.ui.callParts", {
|
|
2255
|
-
written:
|
|
2261
|
+
written: mi(l.t, c.writtenMs),
|
|
2256
2262
|
ran: e
|
|
2257
2263
|
});
|
|
2258
2264
|
}), h = t(() => c.line ?? c.payload);
|
|
@@ -2274,24 +2280,24 @@ var fi = ["aria-expanded", "disabled"], pi = ["aria-label"], mi = { class: "kvc-
|
|
|
2274
2280
|
key: 0,
|
|
2275
2281
|
class: "kvc-spin",
|
|
2276
2282
|
"aria-label": T(l).t("kvcoder.ui.running")
|
|
2277
|
-
}, null, 8,
|
|
2283
|
+
}, null, 8, bi)) : (g(), n(x(u.value ? T(ne) : T(J)), {
|
|
2278
2284
|
key: 1,
|
|
2279
2285
|
size: 16,
|
|
2280
2286
|
"aria-hidden": "true"
|
|
2281
2287
|
})),
|
|
2282
|
-
a("span",
|
|
2283
|
-
c.background ? (g(), i("span",
|
|
2284
|
-
c.failed ? (g(), i("span",
|
|
2285
|
-
a("span",
|
|
2286
|
-
], 8,
|
|
2287
|
-
m.value === "" ? r("v-if", !0) : (g(), i("p",
|
|
2288
|
+
a("span", xi, [c.description ? (g(), i("span", Si, w(c.description), 1)) : c.line ? (g(), i("span", Ci, [a("span", wi, w(T(mr)(c.line)), 1)])) : r("v-if", !0), c.label ? (g(), i("span", Ti, w(c.label), 1)) : r("v-if", !0)]),
|
|
2289
|
+
c.background ? (g(), i("span", Ei, w(T(l).t("kvcoder.ui.jobs.background")), 1)) : r("v-if", !0),
|
|
2290
|
+
c.failed ? (g(), i("span", Di, w(T(l).t("kvcoder.ui.callFailed")), 1)) : r("v-if", !0),
|
|
2291
|
+
a("span", Oi, w(p.value), 1)
|
|
2292
|
+
], 8, yi), u.value && c.output !== void 0 ? (g(), i(e, { key: 0 }, [
|
|
2293
|
+
m.value === "" ? r("v-if", !0) : (g(), i("p", ki, w(m.value), 1)),
|
|
2288
2294
|
h.value === void 0 ? r("v-if", !0) : (g(), i("pre", {
|
|
2289
2295
|
key: 1,
|
|
2290
2296
|
class: "kvc-output kvc-mono",
|
|
2291
2297
|
dir: "ltr",
|
|
2292
2298
|
"aria-label": T(l).t("kvcoder.ui.command"),
|
|
2293
2299
|
"data-test": "call-payload"
|
|
2294
|
-
}, w(h.value), 9,
|
|
2300
|
+
}, w(h.value), 9, Ai)),
|
|
2295
2301
|
c.output === "" ? r("v-if", !0) : (g(), i("pre", {
|
|
2296
2302
|
key: 2,
|
|
2297
2303
|
class: "kvc-output",
|
|
@@ -2304,53 +2310,53 @@ var fi = ["aria-expanded", "disabled"], pi = ["aria-label"], mi = { class: "kvc-
|
|
|
2304
2310
|
target: "_blank",
|
|
2305
2311
|
rel: "noopener noreferrer",
|
|
2306
2312
|
class: "kvc-link"
|
|
2307
|
-
}, w(t.href), 9,
|
|
2313
|
+
}, w(t.href), 9, Mi)) : (g(), i(e, { key: 1 }, [o(w(t.text), 1)], 64))], 64))), 128))], 8, ji))
|
|
2308
2314
|
], 64)) : r("v-if", !0)], 2));
|
|
2309
2315
|
}
|
|
2310
|
-
}),
|
|
2316
|
+
}), Pi = {
|
|
2311
2317
|
key: 0,
|
|
2312
2318
|
class: "kvc-card",
|
|
2313
2319
|
"data-test": "background-result"
|
|
2314
|
-
},
|
|
2320
|
+
}, Fi = { class: "kvc-card-row" }, Ii = { "data-test": "background-title" }, Li = { class: "kvc-output" }, Ri = {
|
|
2315
2321
|
key: 1,
|
|
2316
2322
|
class: "kvc-card",
|
|
2317
2323
|
"data-test": "kvcoder-hint"
|
|
2318
|
-
},
|
|
2324
|
+
}, zi = { class: "kvc-card-row" }, Bi = { class: "kvc-card-body kvc-muted" }, Vi = {
|
|
2319
2325
|
key: 0,
|
|
2320
2326
|
style: {
|
|
2321
2327
|
display: "flex",
|
|
2322
2328
|
gap: "6px",
|
|
2323
2329
|
"margin-block-start": "6px"
|
|
2324
2330
|
}
|
|
2325
|
-
},
|
|
2331
|
+
}, Hi = ["src", "alt"], Ui = {
|
|
2326
2332
|
key: 1,
|
|
2327
2333
|
class: "kvc-muted",
|
|
2328
2334
|
style: { display: "block" },
|
|
2329
2335
|
"data-test": "queued"
|
|
2330
|
-
},
|
|
2336
|
+
}, Wi = {
|
|
2331
2337
|
key: 3,
|
|
2332
2338
|
class: "kvc-answer",
|
|
2333
2339
|
"data-test": "assistant-message"
|
|
2334
|
-
},
|
|
2340
|
+
}, Gi = {
|
|
2335
2341
|
key: 0,
|
|
2336
2342
|
"data-test": "thinking"
|
|
2337
|
-
},
|
|
2343
|
+
}, Ki = { class: "kvc-muted" }, qi = {
|
|
2338
2344
|
class: "kvc-muted",
|
|
2339
2345
|
style: { "white-space": "pre-wrap" }
|
|
2340
|
-
},
|
|
2346
|
+
}, Ji = {
|
|
2341
2347
|
key: 7,
|
|
2342
2348
|
class: "kvc-notice",
|
|
2343
2349
|
"data-test": "notice"
|
|
2344
|
-
},
|
|
2350
|
+
}, Yi = {
|
|
2345
2351
|
key: 8,
|
|
2346
2352
|
class: "kvc-card kvc-card-row",
|
|
2347
2353
|
role: "note",
|
|
2348
2354
|
"data-test": "note"
|
|
2349
|
-
},
|
|
2355
|
+
}, Xi = {
|
|
2350
2356
|
key: 9,
|
|
2351
2357
|
class: "kvc-card",
|
|
2352
2358
|
"data-test": "summary"
|
|
2353
|
-
},
|
|
2359
|
+
}, Zi = { class: "kvc-card-row" }, Qi = { class: "kvc-card-body" }, $i = /* @__PURE__ */ c({
|
|
2354
2360
|
__name: "MessageItem",
|
|
2355
2361
|
props: {
|
|
2356
2362
|
message: {},
|
|
@@ -2358,48 +2364,51 @@ var fi = ["aria-expanded", "disabled"], pi = ["aria-label"], mi = { class: "kvc-
|
|
|
2358
2364
|
},
|
|
2359
2365
|
emits: ["openArtifact"],
|
|
2360
2366
|
setup(c, { emit: l }) {
|
|
2361
|
-
let u = c, d = l, p =
|
|
2362
|
-
let e =
|
|
2367
|
+
let u = c, d = l, p = Y(), m = t(() => kr(u.message.content.content)), h = t(() => Ar(u.message)), _ = t(() => Nr(u.message, u.calls)), v = t(() => zr(u.message)), b = t(() => {
|
|
2368
|
+
let e = u.message.source?.kind === "subagent" ? "kvcoder.ui.helperFinished" : "kvcoder.ui.backgroundFinished", t = Ur(u.message);
|
|
2369
|
+
return t === void 0 ? p.t(e) : p.t(`${e}Named`, { name: We(t) });
|
|
2370
|
+
}), S = t(() => Ir(u.message, u.calls)), C = t(() => {
|
|
2371
|
+
let e = X(u.message.content.params), t = typeof e.code == "string" ? e.code : void 0, n = Object.fromEntries(Object.entries(Ie(e.details)).map(([e, t]) => [e, We(t)])), r = t === void 0 ? {} : { error: p.t(Pe(t), n) }, i = Be(e.details), a = String(u.message.content.code);
|
|
2363
2372
|
return p.t(`kvcoder.notices.${i === void 0 || a !== "STEP_FAILED" ? a : "STEP_FAILED_REASON"}`, {
|
|
2364
2373
|
...e,
|
|
2365
2374
|
...r,
|
|
2366
|
-
...i === void 0 ? {} : { reason:
|
|
2375
|
+
...i === void 0 ? {} : { reason: We(i) }
|
|
2367
2376
|
});
|
|
2368
|
-
}),
|
|
2377
|
+
}), E = t(() => {
|
|
2369
2378
|
let e = u.message.content.params;
|
|
2370
2379
|
return p.t(String(u.message.content.key), typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : {});
|
|
2371
|
-
}),
|
|
2380
|
+
}), D = (e) => `/api/files/${encodeURIComponent(e)}?workspaceId=${encodeURIComponent(p.workspace.value.id)}`, O = (e) => ({
|
|
2372
2381
|
type: "markdown",
|
|
2373
2382
|
text: "kvcoder.markdown",
|
|
2374
2383
|
params: { text: e }
|
|
2375
2384
|
});
|
|
2376
|
-
return (t, c) => T(
|
|
2385
|
+
return (t, c) => T(Rr)(u.message) ? (g(), i("div", Pi, [a("details", null, [a("summary", Fi, [s(T(K), {
|
|
2377
2386
|
size: 16,
|
|
2378
2387
|
"aria-hidden": "true"
|
|
2379
|
-
}),
|
|
2388
|
+
}), a("span", Ii, w(b.value), 1)]), a("pre", Li, w(m.value), 1)])])) : T(Lr)(u.message) ? (g(), i("div", Ri, [a("details", null, [a("summary", zi, [s(T(ue), {
|
|
2380
2389
|
size: 16,
|
|
2381
2390
|
"aria-hidden": "true"
|
|
2382
|
-
}), o(w(T(p).t("kvcoder.ui.toModel")), 1)]), a("div",
|
|
2391
|
+
}), o(w(T(p).t("kvcoder.ui.toModel")), 1)]), a("div", Bi, w(m.value), 1)])])) : u.message.kind === "user" ? (g(), i("div", {
|
|
2383
2392
|
key: 2,
|
|
2384
2393
|
dir: "auto",
|
|
2385
2394
|
class: f(["kvc-user", { "kvc-queued": u.message.queued }]),
|
|
2386
2395
|
"data-test": "user-message"
|
|
2387
2396
|
}, [
|
|
2388
|
-
a("span", null, w(m.value), 1),
|
|
2389
|
-
u.message.fileIds ? (g(), i("span",
|
|
2397
|
+
a("span", null, w(T(Vr)(m.value, T(p).t("kvcoder.ui.attachedFiles"))), 1),
|
|
2398
|
+
u.message.fileIds ? (g(), i("span", Vi, [(g(!0), i(e, null, y(u.message.fileIds, (e) => (g(), i("img", {
|
|
2390
2399
|
key: e,
|
|
2391
|
-
src:
|
|
2400
|
+
src: D(e),
|
|
2392
2401
|
alt: T(p).t("kvcoder.ui.attachment"),
|
|
2393
2402
|
style: {
|
|
2394
2403
|
"block-size": "48px",
|
|
2395
2404
|
"border-radius": "6px"
|
|
2396
2405
|
}
|
|
2397
|
-
}, null, 8,
|
|
2398
|
-
u.message.queued ? (g(), i("span",
|
|
2399
|
-
], 2)) : u.message.kind === "assistant" && (h.value !== "" || m.value !== "") ? (g(), i("div",
|
|
2406
|
+
}, null, 8, Hi))), 128))])) : r("v-if", !0),
|
|
2407
|
+
u.message.queued ? (g(), i("span", Ui, w(T(p).t("kvcoder.ui.queued")), 1)) : r("v-if", !0)
|
|
2408
|
+
], 2)) : u.message.kind === "assistant" && (h.value !== "" || m.value !== "") ? (g(), i("div", Wi, [h.value === "" ? r("v-if", !0) : (g(), i("details", Gi, [a("summary", Ki, w(T(p).t("kvcoder.ui.thought")), 1), a("p", qi, w(h.value), 1)])), m.value === "" ? r("v-if", !0) : (g(), n(x(T(p).View), {
|
|
2400
2409
|
key: 1,
|
|
2401
|
-
view:
|
|
2402
|
-
}, null, 8, ["view"]))])) : u.message.kind === "toolResult" && v.value !== void 0 ? (g(), n(
|
|
2410
|
+
view: O(m.value)
|
|
2411
|
+
}, null, 8, ["view"]))])) : u.message.kind === "toolResult" && v.value !== void 0 ? (g(), n(pi, {
|
|
2403
2412
|
key: 4,
|
|
2404
2413
|
id: v.value.id,
|
|
2405
2414
|
title: v.value.title,
|
|
@@ -2411,7 +2420,7 @@ var fi = ["aria-expanded", "disabled"], pi = ["aria-label"], mi = { class: "kvc-
|
|
|
2411
2420
|
"title",
|
|
2412
2421
|
"format",
|
|
2413
2422
|
"version"
|
|
2414
|
-
])) :
|
|
2423
|
+
])) : S.value === void 0 ? u.message.kind === "toolResult" ? (g(), n(Ni, {
|
|
2415
2424
|
key: 6,
|
|
2416
2425
|
description: _.value.description,
|
|
2417
2426
|
label: _.value.label,
|
|
@@ -2432,64 +2441,64 @@ var fi = ["aria-expanded", "disabled"], pi = ["aria-label"], mi = { class: "kvc-
|
|
|
2432
2441
|
"written-ms",
|
|
2433
2442
|
"output",
|
|
2434
2443
|
"background"
|
|
2435
|
-
])) : u.message.kind === "notice" ? (g(), i("div",
|
|
2444
|
+
])) : u.message.kind === "notice" ? (g(), i("div", Ji, w(C.value), 1)) : u.message.kind === "note" ? (g(), i("div", Yi, [s(T(de), {
|
|
2436
2445
|
size: 18,
|
|
2437
2446
|
"aria-hidden": "true"
|
|
2438
|
-
}), o(w(
|
|
2447
|
+
}), o(w(E.value), 1)])) : u.message.kind === "summary" ? (g(), i("details", Xi, [a("summary", Zi, [s(T(he), {
|
|
2439
2448
|
size: 16,
|
|
2440
2449
|
"aria-hidden": "true"
|
|
2441
|
-
}), o(w(T(p).t("kvcoder.ui.summarized")), 1)]), a("div",
|
|
2450
|
+
}), o(w(T(p).t("kvcoder.ui.summarized")), 1)]), a("div", Qi, [(g(), n(x(T(p).View), { view: O(String(u.message.content.text ?? "")) }, null, 8, ["view"]))])])) : r("v-if", !0) : (g(), n(ci, {
|
|
2442
2451
|
key: 5,
|
|
2443
|
-
answered:
|
|
2452
|
+
answered: S.value
|
|
2444
2453
|
}, null, 8, ["answered"]));
|
|
2445
2454
|
}
|
|
2446
|
-
}),
|
|
2455
|
+
}), ea = {
|
|
2447
2456
|
class: "kvc-card kvc-ask",
|
|
2448
2457
|
"data-test": "approvals-card"
|
|
2449
|
-
},
|
|
2458
|
+
}, ta = {
|
|
2450
2459
|
class: "kvc-card-row",
|
|
2451
2460
|
style: { "font-weight": "600" }
|
|
2452
|
-
},
|
|
2461
|
+
}, na = ["data-test"], ra = { style: {
|
|
2453
2462
|
display: "flex",
|
|
2454
2463
|
"flex-direction": "column",
|
|
2455
2464
|
flex: "1 1 auto",
|
|
2456
2465
|
gap: "2px",
|
|
2457
2466
|
"min-inline-size": "0"
|
|
2458
|
-
} },
|
|
2467
|
+
} }, ia = {
|
|
2459
2468
|
key: 0,
|
|
2460
2469
|
style: { "font-weight": "600" },
|
|
2461
2470
|
"data-test": "call-description"
|
|
2462
|
-
},
|
|
2471
|
+
}, aa = {
|
|
2463
2472
|
key: 1,
|
|
2464
2473
|
class: "kvc-muted",
|
|
2465
2474
|
dir: "ltr",
|
|
2466
2475
|
style: { "align-self": "flex-start" },
|
|
2467
2476
|
"data-test": "call-label"
|
|
2468
|
-
},
|
|
2477
|
+
}, oa = {
|
|
2469
2478
|
key: 2,
|
|
2470
2479
|
dir: "ltr",
|
|
2471
2480
|
style: { "align-self": "flex-start" },
|
|
2472
2481
|
"data-test": "call-subject"
|
|
2473
|
-
},
|
|
2482
|
+
}, sa = {
|
|
2474
2483
|
key: 3,
|
|
2475
2484
|
class: "kvc-chip",
|
|
2476
2485
|
style: { "align-self": "flex-start" },
|
|
2477
2486
|
"data-test": "call-background"
|
|
2478
|
-
},
|
|
2487
|
+
}, ca = ["onClick"], la = ["onClick"], ua = {
|
|
2479
2488
|
key: 0,
|
|
2480
2489
|
class: "kvc-card-row kvc-actions",
|
|
2481
2490
|
style: { "border-block-start": "1px solid var(--kv-color-border)" }
|
|
2482
|
-
},
|
|
2491
|
+
}, da = /* @__PURE__ */ c({
|
|
2483
2492
|
__name: "ApprovalsCard",
|
|
2484
2493
|
props: { approvals: {} },
|
|
2485
2494
|
emits: ["decide"],
|
|
2486
2495
|
setup(t, { emit: n }) {
|
|
2487
|
-
let c = t, l = n, u =
|
|
2496
|
+
let c = t, l = n, u = Y(), d = (e, t) => l("decide", {
|
|
2488
2497
|
approvals: [...e],
|
|
2489
2498
|
confirmed: t
|
|
2490
2499
|
});
|
|
2491
|
-
return (t, n) => (g(), i("section",
|
|
2492
|
-
a("div",
|
|
2500
|
+
return (t, n) => (g(), i("section", ea, [
|
|
2501
|
+
a("div", ta, [s(T(_e), {
|
|
2493
2502
|
size: 18,
|
|
2494
2503
|
"aria-hidden": "true"
|
|
2495
2504
|
}), o(w(T(u).t("kvcoder.ui.allowCommands", { count: c.approvals.length })), 1)]),
|
|
@@ -2499,26 +2508,26 @@ var fi = ["aria-expanded", "disabled"], pi = ["aria-label"], mi = { class: "kvc-
|
|
|
2499
2508
|
style: { "border-block-start": "1px solid var(--kv-color-border)" },
|
|
2500
2509
|
"data-test": `approval-${e.questionId}`
|
|
2501
2510
|
}, [
|
|
2502
|
-
a("span",
|
|
2503
|
-
e.description ? (g(), i("span",
|
|
2504
|
-
e.label ? (g(), i("span",
|
|
2505
|
-
e.subject ? (g(), i("span",
|
|
2506
|
-
e.background ? (g(), i("span",
|
|
2511
|
+
a("span", ra, [
|
|
2512
|
+
e.description ? (g(), i("span", ia, w(e.description), 1)) : r("v-if", !0),
|
|
2513
|
+
e.label ? (g(), i("span", aa, w(e.label), 1)) : r("v-if", !0),
|
|
2514
|
+
e.subject ? (g(), i("span", oa, [a("span", { class: f(["kvc-mono", { "kvc-muted": e.description }]) }, w(e.subject), 3)])) : r("v-if", !0),
|
|
2515
|
+
e.background ? (g(), i("span", sa, w(T(u).t("kvcoder.ui.jobs.inBackground")), 1)) : r("v-if", !0)
|
|
2507
2516
|
]),
|
|
2508
2517
|
a("button", {
|
|
2509
2518
|
type: "button",
|
|
2510
2519
|
class: "kvc-button",
|
|
2511
2520
|
"data-test": "deny",
|
|
2512
2521
|
onClick: (t) => d([e], !1)
|
|
2513
|
-
}, w(T(u).t("kvcoder.ui.deny")), 9,
|
|
2522
|
+
}, w(T(u).t("kvcoder.ui.deny")), 9, ca),
|
|
2514
2523
|
a("button", {
|
|
2515
2524
|
type: "button",
|
|
2516
2525
|
class: "kvc-button kvc-primary",
|
|
2517
2526
|
"data-test": "allow",
|
|
2518
2527
|
onClick: (t) => d([e], !0)
|
|
2519
|
-
}, w(T(u).t("kvcoder.ui.allow")), 9,
|
|
2520
|
-
], 8,
|
|
2521
|
-
c.approvals.length > 1 ? (g(), i("div",
|
|
2528
|
+
}, w(T(u).t("kvcoder.ui.allow")), 9, la)
|
|
2529
|
+
], 8, na))), 128)),
|
|
2530
|
+
c.approvals.length > 1 ? (g(), i("div", ua, [a("button", {
|
|
2522
2531
|
type: "button",
|
|
2523
2532
|
class: "kvc-button",
|
|
2524
2533
|
"data-test": "deny-all",
|
|
@@ -2531,24 +2540,24 @@ var fi = ["aria-expanded", "disabled"], pi = ["aria-label"], mi = { class: "kvc-
|
|
|
2531
2540
|
}, w(T(u).t("kvcoder.ui.allowAll")), 1)])) : r("v-if", !0)
|
|
2532
2541
|
]));
|
|
2533
2542
|
}
|
|
2534
|
-
}),
|
|
2543
|
+
}), fa = ["aria-label"], pa = {
|
|
2535
2544
|
class: "kvc-card-row",
|
|
2536
2545
|
style: { "font-weight": "600" }
|
|
2537
|
-
},
|
|
2546
|
+
}, ma = { dir: "auto" }, ha = { class: "kvc-card-body" }, ga = ["placeholder", "aria-label"], _a = { class: "kvc-actions" }, va = ["data-test"], ya = [
|
|
2538
2547
|
"type",
|
|
2539
2548
|
"checked",
|
|
2540
2549
|
"name",
|
|
2541
2550
|
"onChange"
|
|
2542
|
-
],
|
|
2551
|
+
], ba = { style: {
|
|
2543
2552
|
display: "flex",
|
|
2544
2553
|
"flex-direction": "column"
|
|
2545
|
-
} },
|
|
2554
|
+
} }, xa = { style: { "font-weight": "500" } }, Sa = {
|
|
2546
2555
|
key: 0,
|
|
2547
2556
|
class: "kvc-muted"
|
|
2548
|
-
},
|
|
2557
|
+
}, Ca = ["placeholder", "aria-label"], wa = { class: "kvc-actions" }, Ta = ["disabled"], Ea = {
|
|
2549
2558
|
key: 2,
|
|
2550
2559
|
class: "kvc-actions"
|
|
2551
|
-
},
|
|
2560
|
+
}, Da = /* @__PURE__ */ c({
|
|
2552
2561
|
__name: "QuestionCard",
|
|
2553
2562
|
props: {
|
|
2554
2563
|
questionId: {},
|
|
@@ -2556,7 +2565,7 @@ var fi = ["aria-expanded", "disabled"], pi = ["aria-label"], mi = { class: "kvc-
|
|
|
2556
2565
|
},
|
|
2557
2566
|
emits: ["answer"],
|
|
2558
2567
|
setup(n, { emit: o }) {
|
|
2559
|
-
let c = n, l = o, u =
|
|
2568
|
+
let c = n, l = o, u = Y(), d = t(() => String(c.question.kind ?? "text")), p = t(() => String(c.question.prompt ?? "")), m = t(() => Wr(c.question)), h = t(() => c.question.multiple === !0), _ = t(() => c.question.other === !0), b = v(""), x = v([]), S = v("");
|
|
2560
2569
|
function C(e) {
|
|
2561
2570
|
l("answer", {
|
|
2562
2571
|
questionId: c.questionId,
|
|
@@ -2577,10 +2586,10 @@ var fi = ["aria-expanded", "disabled"], pi = ["aria-label"], mi = { class: "kvc-
|
|
|
2577
2586
|
class: "kvc-card kvc-ask",
|
|
2578
2587
|
"data-test": "question-card",
|
|
2579
2588
|
"aria-label": p.value
|
|
2580
|
-
}, [a("div",
|
|
2589
|
+
}, [a("div", pa, [s(T(ie), {
|
|
2581
2590
|
size: 18,
|
|
2582
2591
|
"aria-hidden": "true"
|
|
2583
|
-
}), a("span",
|
|
2592
|
+
}), a("span", ma, w(p.value), 1)]), a("div", ha, [d.value === "text" ? (g(), i(e, { key: 0 }, [A(a("input", {
|
|
2584
2593
|
"onUpdate:modelValue": n[0] ||= (e) => b.value = e,
|
|
2585
2594
|
class: "kvc-field",
|
|
2586
2595
|
dir: "auto",
|
|
@@ -2588,7 +2597,7 @@ var fi = ["aria-expanded", "disabled"], pi = ["aria-label"], mi = { class: "kvc-
|
|
|
2588
2597
|
"aria-label": p.value,
|
|
2589
2598
|
"data-test": "answer-text",
|
|
2590
2599
|
onKeydown: n[1] ||= j(M((e) => C({ text: b.value }), ["prevent"]), ["enter"])
|
|
2591
|
-
}, null, 40,
|
|
2600
|
+
}, null, 40, ga), [[D, b.value]]), a("div", _a, [a("button", {
|
|
2592
2601
|
type: "button",
|
|
2593
2602
|
class: "kvc-button",
|
|
2594
2603
|
"data-test": "skip",
|
|
@@ -2608,7 +2617,7 @@ var fi = ["aria-expanded", "disabled"], pi = ["aria-label"], mi = { class: "kvc-
|
|
|
2608
2617
|
checked: x.value.includes(e.id),
|
|
2609
2618
|
name: c.questionId,
|
|
2610
2619
|
onChange: (t) => E(e.id)
|
|
2611
|
-
}, null, 40,
|
|
2620
|
+
}, null, 40, ya), a("span", ba, [a("span", xa, w(e.label), 1), e.description ? (g(), i("span", Sa, w(e.description), 1)) : r("v-if", !0)])], 8, va))), 128)),
|
|
2612
2621
|
_.value ? A((g(), i("input", {
|
|
2613
2622
|
key: 0,
|
|
2614
2623
|
"onUpdate:modelValue": n[4] ||= (e) => S.value = e,
|
|
@@ -2616,8 +2625,8 @@ var fi = ["aria-expanded", "disabled"], pi = ["aria-label"], mi = { class: "kvc-
|
|
|
2616
2625
|
placeholder: T(u).t("kvcoder.ui.other"),
|
|
2617
2626
|
"aria-label": T(u).t("kvcoder.ui.other"),
|
|
2618
2627
|
"data-test": "answer-other"
|
|
2619
|
-
}, null, 8,
|
|
2620
|
-
a("div",
|
|
2628
|
+
}, null, 8, Ca)), [[D, S.value]]) : r("v-if", !0),
|
|
2629
|
+
a("div", wa, [a("button", {
|
|
2621
2630
|
type: "button",
|
|
2622
2631
|
class: "kvc-button",
|
|
2623
2632
|
"data-test": "skip",
|
|
@@ -2628,8 +2637,8 @@ var fi = ["aria-expanded", "disabled"], pi = ["aria-label"], mi = { class: "kvc-
|
|
|
2628
2637
|
disabled: x.value.length === 0 && S.value.trim() === "",
|
|
2629
2638
|
"data-test": "answer",
|
|
2630
2639
|
onClick: O
|
|
2631
|
-
}, w(T(u).t("kvcoder.ui.answer")), 9,
|
|
2632
|
-
], 64)) : (g(), i("div",
|
|
2640
|
+
}, w(T(u).t("kvcoder.ui.answer")), 9, Ta)])
|
|
2641
|
+
], 64)) : (g(), i("div", Ea, [a("button", {
|
|
2633
2642
|
type: "button",
|
|
2634
2643
|
class: "kvc-button",
|
|
2635
2644
|
"data-test": "answer-no",
|
|
@@ -2639,9 +2648,9 @@ var fi = ["aria-expanded", "disabled"], pi = ["aria-label"], mi = { class: "kvc-
|
|
|
2639
2648
|
class: f(["kvc-button kvc-primary", { "kvc-danger": c.question.danger === !0 }]),
|
|
2640
2649
|
"data-test": "answer-yes",
|
|
2641
2650
|
onClick: n[7] ||= (e) => C({ confirmed: !0 })
|
|
2642
|
-
}, w(T(u).t("kvcoder.ui.yes")), 3)]))])], 8,
|
|
2651
|
+
}, w(T(u).t("kvcoder.ui.yes")), 3)]))])], 8, fa));
|
|
2643
2652
|
}
|
|
2644
|
-
}),
|
|
2653
|
+
}), Oa = /* @__PURE__ */ c({
|
|
2645
2654
|
__name: "PendingCards",
|
|
2646
2655
|
props: {
|
|
2647
2656
|
pending: {},
|
|
@@ -2651,14 +2660,14 @@ var fi = ["aria-expanded", "disabled"], pi = ["aria-label"], mi = { class: "kvc-
|
|
|
2651
2660
|
setup(a, { emit: o }) {
|
|
2652
2661
|
let s = a, c = o, l = (e) => e.questionId !== null && s.hidden?.has(String(e.questionId)) !== !0, u = t(() => s.pending.filter((e) => e.kind === "question" && l(e)).map((e) => ({
|
|
2653
2662
|
questionId: String(e.questionId),
|
|
2654
|
-
question:
|
|
2663
|
+
question: X(e.question)
|
|
2655
2664
|
})));
|
|
2656
2665
|
function d(e) {
|
|
2657
|
-
let t =
|
|
2658
|
-
return t.line === void 0 ? typeof n.path == "string" ? n.path : t.payload === void 0 ? void 0 :
|
|
2666
|
+
let t = pr(e), n = X(e.payload);
|
|
2667
|
+
return t.line === void 0 ? typeof n.path == "string" ? n.path : t.payload === void 0 ? void 0 : mr(t.payload) : t.line;
|
|
2659
2668
|
}
|
|
2660
2669
|
let f = t(() => s.pending.filter((e) => e.kind === "approval" && l(e)).map((e) => {
|
|
2661
|
-
let t =
|
|
2670
|
+
let t = X(e.question), n = pr(t), r = d(t);
|
|
2662
2671
|
return {
|
|
2663
2672
|
questionId: String(e.questionId),
|
|
2664
2673
|
...n.description === void 0 ? {} : { description: n.description },
|
|
@@ -2667,12 +2676,12 @@ var fi = ["aria-expanded", "disabled"], pi = ["aria-label"], mi = { class: "kvc-
|
|
|
2667
2676
|
...n.background === !0 ? { background: !0 } : {}
|
|
2668
2677
|
};
|
|
2669
2678
|
}));
|
|
2670
|
-
return (t, a) => (g(), i(e, null, [(g(!0), i(e, null, y(u.value, (e) => (g(), n(
|
|
2679
|
+
return (t, a) => (g(), i(e, null, [(g(!0), i(e, null, y(u.value, (e) => (g(), n(Da, {
|
|
2671
2680
|
key: e.questionId,
|
|
2672
2681
|
"question-id": e.questionId,
|
|
2673
2682
|
question: e.question,
|
|
2674
2683
|
onAnswer: a[0] ||= (e) => c("answer", e)
|
|
2675
|
-
}, null, 8, ["question-id", "question"]))), 128)), f.value.length > 0 ? (g(), n(
|
|
2684
|
+
}, null, 8, ["question-id", "question"]))), 128)), f.value.length > 0 ? (g(), n(da, {
|
|
2676
2685
|
key: 0,
|
|
2677
2686
|
approvals: f.value,
|
|
2678
2687
|
onDecide: a[1] ||= (e) => c("decide", e)
|
|
@@ -2681,12 +2690,12 @@ var fi = ["aria-expanded", "disabled"], pi = ["aria-label"], mi = { class: "kvc-
|
|
|
2681
2690
|
});
|
|
2682
2691
|
//#endregion
|
|
2683
2692
|
//#region web/src/use-model-groups.ts
|
|
2684
|
-
function
|
|
2693
|
+
function ka(e, t, n) {
|
|
2685
2694
|
let r = v([]);
|
|
2686
2695
|
return m(async () => {
|
|
2687
2696
|
try {
|
|
2688
2697
|
let [n, i] = await Promise.all([e.exec("kvai.provider.list", {}), e.exec("kvai.model.list", {})]);
|
|
2689
|
-
r.value =
|
|
2698
|
+
r.value = Bt(n, i, t());
|
|
2690
2699
|
} catch (e) {
|
|
2691
2700
|
n(e);
|
|
2692
2701
|
}
|
|
@@ -2694,15 +2703,15 @@ function xa(e, t, n) {
|
|
|
2694
2703
|
}
|
|
2695
2704
|
//#endregion
|
|
2696
2705
|
//#region web/src/RecoveryActions.vue?vue&type=script&setup=true&lang.ts
|
|
2697
|
-
var
|
|
2706
|
+
var Aa = {
|
|
2698
2707
|
class: "kvc-recovery",
|
|
2699
2708
|
"data-test": "recovery"
|
|
2700
|
-
},
|
|
2709
|
+
}, ja = { class: "kvc-recovery-picker" }, Ma = /* @__PURE__ */ c({
|
|
2701
2710
|
__name: "RecoveryActions",
|
|
2702
2711
|
props: { sessionId: {} },
|
|
2703
2712
|
emits: ["sent"],
|
|
2704
2713
|
setup(e, { emit: t }) {
|
|
2705
|
-
let n = e, r = t, c =
|
|
2714
|
+
let n = e, r = t, c = Y(), l = ka(c, () => null, (e) => Z(c, e));
|
|
2706
2715
|
async function u() {
|
|
2707
2716
|
await c.exec("kvcoder.message.send", {
|
|
2708
2717
|
sessionId: n.sessionId,
|
|
@@ -2713,68 +2722,68 @@ var Sa = {
|
|
|
2713
2722
|
try {
|
|
2714
2723
|
await e();
|
|
2715
2724
|
} catch (e) {
|
|
2716
|
-
|
|
2725
|
+
Z(c, e);
|
|
2717
2726
|
}
|
|
2718
2727
|
}
|
|
2719
2728
|
let f = () => d(u), p = (e) => d(async () => {
|
|
2720
2729
|
await c.exec("kvcoder.session.configure", {
|
|
2721
2730
|
sessionId: n.sessionId,
|
|
2722
2731
|
model: e
|
|
2723
|
-
}), await
|
|
2732
|
+
}), await ln(c, e), await u();
|
|
2724
2733
|
});
|
|
2725
|
-
return (e, t) => (g(), i("div",
|
|
2734
|
+
return (e, t) => (g(), i("div", Aa, [a("button", {
|
|
2726
2735
|
type: "button",
|
|
2727
2736
|
class: "kvc-button",
|
|
2728
2737
|
"data-test": "retry",
|
|
2729
2738
|
onClick: f
|
|
2730
|
-
}, [s(T(
|
|
2739
|
+
}, [s(T(me), {
|
|
2731
2740
|
size: 14,
|
|
2732
2741
|
"aria-hidden": "true"
|
|
2733
|
-
}), o(w(T(c).t("kvcoder.ui.retry")), 1)]), a("div",
|
|
2742
|
+
}), o(w(T(c).t("kvcoder.ui.retry")), 1)]), a("div", ja, [s(an, {
|
|
2734
2743
|
groups: T(l),
|
|
2735
2744
|
current: null,
|
|
2736
2745
|
empty: T(c).t("kvcoder.ui.chooseAnotherModel"),
|
|
2737
2746
|
onPick: p
|
|
2738
2747
|
}, null, 8, ["groups", "empty"])])]));
|
|
2739
2748
|
}
|
|
2740
|
-
}),
|
|
2749
|
+
}), Na = {
|
|
2741
2750
|
class: "kvc-column",
|
|
2742
2751
|
"data-test": "prompt-tab"
|
|
2743
|
-
},
|
|
2752
|
+
}, Pa = { style: {
|
|
2744
2753
|
display: "flex",
|
|
2745
2754
|
"align-items": "center",
|
|
2746
2755
|
gap: "10px"
|
|
2747
|
-
} },
|
|
2756
|
+
} }, Fa = { style: { flex: "1 1 auto" } }, Ia = {
|
|
2748
2757
|
key: 0,
|
|
2749
2758
|
style: {
|
|
2750
2759
|
margin: "0",
|
|
2751
2760
|
"padding-inline-start": "20px"
|
|
2752
2761
|
}
|
|
2753
|
-
},
|
|
2762
|
+
}, La = {
|
|
2754
2763
|
key: 0,
|
|
2755
2764
|
class: "kvc-chip kvc-warn"
|
|
2756
|
-
},
|
|
2765
|
+
}, Ra = {
|
|
2757
2766
|
key: 1,
|
|
2758
2767
|
class: "kvc-prompt",
|
|
2759
2768
|
"data-test": "prompt-text"
|
|
2760
|
-
},
|
|
2769
|
+
}, za = /* @__PURE__ */ c({
|
|
2761
2770
|
__name: "PromptTab",
|
|
2762
2771
|
props: { sessionId: {} },
|
|
2763
2772
|
emits: ["back"],
|
|
2764
2773
|
setup(t, { emit: n }) {
|
|
2765
|
-
let c = t, l = n, u =
|
|
2774
|
+
let c = t, l = n, u = Y(), d = v(null);
|
|
2766
2775
|
O(() => c.sessionId, async (e) => {
|
|
2767
2776
|
try {
|
|
2768
2777
|
d.value = await u.exec("kvcoder.prompt.get", { sessionId: e });
|
|
2769
2778
|
} catch (e) {
|
|
2770
|
-
|
|
2779
|
+
Z(u, e);
|
|
2771
2780
|
}
|
|
2772
2781
|
}, { immediate: !0 });
|
|
2773
2782
|
async function f() {
|
|
2774
2783
|
d.value !== null && (await navigator.clipboard.writeText(d.value.prompt), u.toast("kvcoder.ui.copied", {}, "success"));
|
|
2775
2784
|
}
|
|
2776
|
-
return (t, n) => (g(), i("div",
|
|
2777
|
-
a("div",
|
|
2785
|
+
return (t, n) => (g(), i("div", Na, [
|
|
2786
|
+
a("div", Pa, [
|
|
2778
2787
|
a("button", {
|
|
2779
2788
|
type: "button",
|
|
2780
2789
|
class: "kvc-button",
|
|
@@ -2785,15 +2794,15 @@ var Sa = {
|
|
|
2785
2794
|
class: "kvc-flip",
|
|
2786
2795
|
"aria-hidden": "true"
|
|
2787
2796
|
}), o(w(T(u).t("kvcoder.ui.showChat")), 1)]),
|
|
2788
|
-
a("strong",
|
|
2797
|
+
a("strong", Fa, w(T(u).t("kvcoder.ui.promptTitle")), 1),
|
|
2789
2798
|
a("button", {
|
|
2790
2799
|
type: "button",
|
|
2791
2800
|
class: "kvc-button",
|
|
2792
2801
|
"data-test": "copy-prompt",
|
|
2793
2802
|
onClick: f
|
|
2794
|
-
}, [s(T(
|
|
2803
|
+
}, [s(T(oe), { size: 16 }), o(w(T(u).t("kvcoder.ui.copy")), 1)])
|
|
2795
2804
|
]),
|
|
2796
|
-
d.value ? (g(), i("ul",
|
|
2805
|
+
d.value ? (g(), i("ul", Ia, [(g(!0), i(e, null, y(d.value.sections, (e) => (g(), i("li", {
|
|
2797
2806
|
key: `${e.owner}/${e.id}`,
|
|
2798
2807
|
class: "kvc-muted",
|
|
2799
2808
|
"data-test": "prompt-section"
|
|
@@ -2802,20 +2811,20 @@ var Sa = {
|
|
|
2802
2811
|
owner: e.owner,
|
|
2803
2812
|
reach: T(u).t(`kvcoder.ui.reach.${e.reach}`),
|
|
2804
2813
|
size: e.size
|
|
2805
|
-
})) + " ", 1), e.included ? r("v-if", !0) : (g(), i("span",
|
|
2806
|
-
d.value ? (g(), i("pre",
|
|
2814
|
+
})) + " ", 1), e.included ? r("v-if", !0) : (g(), i("span", La, w(T(u).t("kvcoder.ui.leftOut")), 1))]))), 128))])) : r("v-if", !0),
|
|
2815
|
+
d.value ? (g(), i("pre", Ra, w(d.value.prompt), 1)) : r("v-if", !0)
|
|
2807
2816
|
]));
|
|
2808
2817
|
}
|
|
2809
2818
|
});
|
|
2810
2819
|
//#endregion
|
|
2811
2820
|
//#region web/src/use-session-actions.ts
|
|
2812
|
-
function
|
|
2821
|
+
function Ba(e, t, n) {
|
|
2813
2822
|
let r = C();
|
|
2814
2823
|
async function i(t) {
|
|
2815
2824
|
try {
|
|
2816
2825
|
await t(), await n();
|
|
2817
2826
|
} catch (t) {
|
|
2818
|
-
|
|
2827
|
+
Z(e, t);
|
|
2819
2828
|
}
|
|
2820
2829
|
}
|
|
2821
2830
|
async function a(e, t) {
|
|
@@ -2842,7 +2851,7 @@ function Ma(e, t, n) {
|
|
|
2842
2851
|
await e.exec("kvcoder.session.configure", {
|
|
2843
2852
|
sessionId: t(),
|
|
2844
2853
|
...n
|
|
2845
|
-
}), n.model !== void 0 && await
|
|
2854
|
+
}), n.model !== void 0 && await ln(e, n.model);
|
|
2846
2855
|
}),
|
|
2847
2856
|
rename: (n) => a("rename", async () => {
|
|
2848
2857
|
n.trim() !== "" && await e.exec("kvcoder.session.rename", {
|
|
@@ -2862,7 +2871,7 @@ function Ma(e, t, n) {
|
|
|
2862
2871
|
argument: i
|
|
2863
2872
|
}), await n(), !0;
|
|
2864
2873
|
} catch (t) {
|
|
2865
|
-
return
|
|
2874
|
+
return Z(e, t), !1;
|
|
2866
2875
|
}
|
|
2867
2876
|
},
|
|
2868
2877
|
remove: () => i(async () => {
|
|
@@ -2872,13 +2881,13 @@ function Ma(e, t, n) {
|
|
|
2872
2881
|
}
|
|
2873
2882
|
//#endregion
|
|
2874
2883
|
//#region web/src/SessionModel.vue
|
|
2875
|
-
var
|
|
2884
|
+
var Va = /* @__PURE__ */ c({
|
|
2876
2885
|
__name: "SessionModel",
|
|
2877
2886
|
props: { session: {} },
|
|
2878
2887
|
emits: ["changed"],
|
|
2879
2888
|
setup(e, { emit: t }) {
|
|
2880
|
-
let r = e, i = t, a =
|
|
2881
|
-
return (e, t) => (g(), n(
|
|
2889
|
+
let r = e, i = t, a = Y(), o = ka(a, () => r.session.model, (e) => Z(a, e)), s = Ba(a, () => r.session.id, () => i("changed"));
|
|
2890
|
+
return (e, t) => (g(), n(cn, {
|
|
2882
2891
|
groups: T(o),
|
|
2883
2892
|
model: r.session.model ?? null,
|
|
2884
2893
|
thinking: r.session.thinking,
|
|
@@ -2890,27 +2899,27 @@ var Na = /* @__PURE__ */ c({
|
|
|
2890
2899
|
"thinking"
|
|
2891
2900
|
]));
|
|
2892
2901
|
}
|
|
2893
|
-
}),
|
|
2902
|
+
}), Ha = ["aria-label"], Ua = { class: "kvc-card-row" }, Wa = {
|
|
2894
2903
|
key: 0,
|
|
2895
2904
|
class: "kvc-chip kvc-mono",
|
|
2896
2905
|
"data-test": "subagent-worker"
|
|
2897
|
-
},
|
|
2906
|
+
}, Ga = { style: {
|
|
2898
2907
|
flex: "1 1 auto",
|
|
2899
2908
|
"font-weight": "500"
|
|
2900
|
-
} },
|
|
2909
|
+
} }, Ka = {
|
|
2901
2910
|
key: 1,
|
|
2902
2911
|
class: "kvc-spin"
|
|
2903
|
-
},
|
|
2912
|
+
}, qa = {
|
|
2904
2913
|
key: 0,
|
|
2905
2914
|
class: "kvc-card-body"
|
|
2906
|
-
},
|
|
2915
|
+
}, Ja = {
|
|
2907
2916
|
key: 0,
|
|
2908
2917
|
class: "kvc-muted",
|
|
2909
2918
|
style: {
|
|
2910
2919
|
margin: "0",
|
|
2911
2920
|
"white-space": "pre-wrap"
|
|
2912
2921
|
}
|
|
2913
|
-
},
|
|
2922
|
+
}, Ya = /* @__PURE__ */ c({
|
|
2914
2923
|
__name: "SubagentCard",
|
|
2915
2924
|
props: {
|
|
2916
2925
|
child: {},
|
|
@@ -2918,48 +2927,48 @@ var Na = /* @__PURE__ */ c({
|
|
|
2918
2927
|
},
|
|
2919
2928
|
emits: ["answer", "decide"],
|
|
2920
2929
|
setup(e, { emit: n }) {
|
|
2921
|
-
let o = e, c = n, l =
|
|
2930
|
+
let o = e, c = n, l = Y(), u = t(() => l.t(`kvcoder.ui.status.${o.child.session.status}`));
|
|
2922
2931
|
return (e, t) => (g(), i("section", {
|
|
2923
2932
|
class: "kvc-card",
|
|
2924
2933
|
"data-test": "subagent-card",
|
|
2925
|
-
"aria-label": T(
|
|
2926
|
-
}, [a("div",
|
|
2934
|
+
"aria-label": T(Ne)(T(l).t, o.child.session.title)
|
|
2935
|
+
}, [a("div", Ua, [
|
|
2927
2936
|
s(T(te), {
|
|
2928
2937
|
size: 18,
|
|
2929
2938
|
"aria-hidden": "true"
|
|
2930
2939
|
}),
|
|
2931
|
-
o.child.session.worker === void 0 ? r("v-if", !0) : (g(), i("span",
|
|
2932
|
-
a("span",
|
|
2933
|
-
o.child.session.status === "running" ? (g(), i("span",
|
|
2940
|
+
o.child.session.worker === void 0 ? r("v-if", !0) : (g(), i("span", Wa, w(o.child.session.worker), 1)),
|
|
2941
|
+
a("span", Ga, w(T(Ne)(T(l).t, o.child.session.title)), 1),
|
|
2942
|
+
o.child.session.status === "running" ? (g(), i("span", Ka)) : r("v-if", !0),
|
|
2934
2943
|
a("span", { class: f(["kvc-chip", { "kvc-warn": o.child.session.status === "waiting" }]) }, w(u.value), 3)
|
|
2935
|
-
]), o.child.live.text !== "" || (o.child.turn?.pending.length ?? 0) > 0 ? (g(), i("div",
|
|
2944
|
+
]), o.child.live.text !== "" || (o.child.turn?.pending.length ?? 0) > 0 ? (g(), i("div", qa, [o.child.live.text === "" ? r("v-if", !0) : (g(), i("p", Ja, w(o.child.live.text), 1)), s(Oa, {
|
|
2936
2945
|
pending: o.child.turn?.pending ?? [],
|
|
2937
2946
|
hidden: o.hidden,
|
|
2938
2947
|
onAnswer: t[0] ||= (e) => c("answer", e),
|
|
2939
2948
|
onDecide: t[1] ||= (e) => c("decide", e)
|
|
2940
|
-
}, null, 8, ["pending", "hidden"])])) : r("v-if", !0)], 8,
|
|
2949
|
+
}, null, 8, ["pending", "hidden"])])) : r("v-if", !0)], 8, Ha));
|
|
2941
2950
|
}
|
|
2942
|
-
}),
|
|
2951
|
+
}), Xa = ["aria-label"], Za = { class: "kvc-card-row" }, Qa = {
|
|
2943
2952
|
class: "kvc-chip kvc-mono",
|
|
2944
2953
|
"data-test": "worker-card-name"
|
|
2945
|
-
},
|
|
2954
|
+
}, $a = {
|
|
2946
2955
|
style: {
|
|
2947
2956
|
flex: "1 1 auto",
|
|
2948
2957
|
"font-weight": "500"
|
|
2949
2958
|
},
|
|
2950
2959
|
dir: "auto",
|
|
2951
2960
|
"data-test": "worker-card-call"
|
|
2952
|
-
},
|
|
2961
|
+
}, eo = {
|
|
2953
2962
|
class: "kvc-chip",
|
|
2954
2963
|
"data-test": "worker-card-time"
|
|
2955
|
-
},
|
|
2964
|
+
}, to = ["disabled"], no = /* @__PURE__ */ c({
|
|
2956
2965
|
__name: "WorkerCard",
|
|
2957
2966
|
props: {
|
|
2958
2967
|
sessionId: {},
|
|
2959
2968
|
runId: {}
|
|
2960
2969
|
},
|
|
2961
2970
|
setup(e) {
|
|
2962
|
-
let t = e, n =
|
|
2971
|
+
let t = e, n = Y(), o = v(), c = v(Date.now()), l = v(!1), u;
|
|
2963
2972
|
m(async () => {
|
|
2964
2973
|
u = setInterval(() => c.value = Date.now(), 1e3);
|
|
2965
2974
|
try {
|
|
@@ -2968,7 +2977,7 @@ var Na = /* @__PURE__ */ c({
|
|
|
2968
2977
|
id: t.runId
|
|
2969
2978
|
});
|
|
2970
2979
|
} catch (e) {
|
|
2971
|
-
|
|
2980
|
+
Z(n, e);
|
|
2972
2981
|
}
|
|
2973
2982
|
}), p(() => clearInterval(u));
|
|
2974
2983
|
async function d() {
|
|
@@ -2979,7 +2988,7 @@ var Na = /* @__PURE__ */ c({
|
|
|
2979
2988
|
id: t.runId
|
|
2980
2989
|
});
|
|
2981
2990
|
} catch (e) {
|
|
2982
|
-
|
|
2991
|
+
Z(n, e);
|
|
2983
2992
|
}
|
|
2984
2993
|
l.value = !1;
|
|
2985
2994
|
}
|
|
@@ -2988,25 +2997,25 @@ var Na = /* @__PURE__ */ c({
|
|
|
2988
2997
|
class: "kvc-card",
|
|
2989
2998
|
"data-test": "worker-card",
|
|
2990
2999
|
"aria-label": o.value.title
|
|
2991
|
-
}, [a("div",
|
|
3000
|
+
}, [a("div", Za, [
|
|
2992
3001
|
s(T(te), {
|
|
2993
3002
|
size: 18,
|
|
2994
3003
|
"aria-hidden": "true"
|
|
2995
3004
|
}),
|
|
2996
|
-
a("span",
|
|
2997
|
-
a("span",
|
|
3005
|
+
a("span", Qa, w(o.value.title), 1),
|
|
3006
|
+
a("span", $a, w(o.value.call), 1),
|
|
2998
3007
|
t[0] ||= a("span", { class: "kvc-spin" }, null, -1),
|
|
2999
|
-
a("span",
|
|
3008
|
+
a("span", eo, w(T(n).t("kvcoder.ui.jobs.status.running")) + " · " + w(T(Tn)(T(n).t, c.value - Date.parse(o.value.startedAt))), 1),
|
|
3000
3009
|
a("button", {
|
|
3001
3010
|
type: "button",
|
|
3002
3011
|
class: "kvc-button",
|
|
3003
3012
|
disabled: l.value,
|
|
3004
3013
|
"data-test": "worker-card-stop",
|
|
3005
3014
|
onClick: d
|
|
3006
|
-
}, w(T(n).t("kvcoder.ui.jobs.stop")), 9,
|
|
3007
|
-
])], 8,
|
|
3015
|
+
}, w(T(n).t("kvcoder.ui.jobs.stop")), 9, to)
|
|
3016
|
+
])], 8, Xa));
|
|
3008
3017
|
}
|
|
3009
|
-
}),
|
|
3018
|
+
}), ro = (e) => {
|
|
3010
3019
|
let t = e.description ?? e.subject;
|
|
3011
3020
|
return {
|
|
3012
3021
|
name: "run",
|
|
@@ -3015,7 +3024,7 @@ var Na = /* @__PURE__ */ c({
|
|
|
3015
3024
|
complete: !0
|
|
3016
3025
|
};
|
|
3017
3026
|
};
|
|
3018
|
-
function
|
|
3027
|
+
function io(e, t) {
|
|
3019
3028
|
let n = v(/* @__PURE__ */ new Set()), r = /* @__PURE__ */ new Map();
|
|
3020
3029
|
function i(e) {
|
|
3021
3030
|
for (let { questionId: t } of e) n.value.delete(t), r.delete(t);
|
|
@@ -3026,18 +3035,18 @@ function Xa(e, t) {
|
|
|
3026
3035
|
for (let [t, n] of a.entries()) try {
|
|
3027
3036
|
o = (await e.exec("kvcoder.question.answer", n)).jobId ?? o;
|
|
3028
3037
|
} catch (n) {
|
|
3029
|
-
if (
|
|
3030
|
-
i(a.slice(t)),
|
|
3038
|
+
if (Fe(n)?.code === "kvcoder/QUESTION_NOT_FOUND") continue;
|
|
3039
|
+
i(a.slice(t)), Z(e, n);
|
|
3031
3040
|
return;
|
|
3032
3041
|
}
|
|
3033
3042
|
let s = o === null ? [] : [...r.values()];
|
|
3034
|
-
o !== null && r.clear(), await t(s).catch((t) =>
|
|
3043
|
+
o !== null && r.clear(), await t(s).catch((t) => Z(e, t));
|
|
3035
3044
|
}
|
|
3036
3045
|
return {
|
|
3037
3046
|
hidden: n,
|
|
3038
3047
|
answer: (e) => a([e]),
|
|
3039
3048
|
decide: ({ approvals: e, confirmed: t }) => {
|
|
3040
|
-
if (t) for (let t of e) r.set(t.questionId,
|
|
3049
|
+
if (t) for (let t of e) r.set(t.questionId, ro(t));
|
|
3041
3050
|
return a(e.map((e) => ({
|
|
3042
3051
|
questionId: e.questionId,
|
|
3043
3052
|
answer: { confirmed: t }
|
|
@@ -3047,7 +3056,7 @@ function Xa(e, t) {
|
|
|
3047
3056
|
}
|
|
3048
3057
|
//#endregion
|
|
3049
3058
|
//#region web/src/use-artifacts.ts
|
|
3050
|
-
function
|
|
3059
|
+
function ao(e, t, n, r) {
|
|
3051
3060
|
let i = v([]), a = v(void 0), o = v(void 0), s = v(!1), c = /* @__PURE__ */ new Set(), l, u = !1, d = 0, f = !1;
|
|
3052
3061
|
function h(e) {
|
|
3053
3062
|
l = e, u = !1, c.clear(), i.value = [], a.value = void 0, o.value = void 0, s.value = !1;
|
|
@@ -3160,9 +3169,9 @@ function Za(e, t, n, r) {
|
|
|
3160
3169
|
}
|
|
3161
3170
|
//#endregion
|
|
3162
3171
|
//#region web/src/use-conversation.ts
|
|
3163
|
-
var
|
|
3164
|
-
function
|
|
3165
|
-
let r = C(null), i = C([]), a = C(0), o = C([]), s = C(null), c = C(void 0), l, u = C(!1), d = _(
|
|
3172
|
+
var oo = 5e3, so = 200;
|
|
3173
|
+
function co(e, t, n) {
|
|
3174
|
+
let r = C(null), i = C([]), a = C(0), o = C([]), s = C(null), c = C(void 0), l, u = C(!1), d = _(hr()), f = S(/* @__PURE__ */ new Map()), p = /* @__PURE__ */ new Set(), m = !1;
|
|
3166
3175
|
async function g(t) {
|
|
3167
3176
|
let n = (t?.pending ?? []).flatMap((e) => e.childSessionId === null ? [] : [e.childSessionId]);
|
|
3168
3177
|
for (let e of [...f.keys()]) n.includes(e) || f.delete(e);
|
|
@@ -3174,7 +3183,7 @@ function eo(e, t, n) {
|
|
|
3174
3183
|
f.set(t, {
|
|
3175
3184
|
session: n,
|
|
3176
3185
|
turn: r,
|
|
3177
|
-
live: f.get(t)?.live ?? _(
|
|
3186
|
+
live: f.get(t)?.live ?? _(hr())
|
|
3178
3187
|
});
|
|
3179
3188
|
}
|
|
3180
3189
|
}
|
|
@@ -3182,14 +3191,14 @@ function eo(e, t, n) {
|
|
|
3182
3191
|
async function y(t, n) {
|
|
3183
3192
|
let r = await e.exec("kvcoder.message.list", {
|
|
3184
3193
|
sessionId: t,
|
|
3185
|
-
limit:
|
|
3194
|
+
limit: so
|
|
3186
3195
|
});
|
|
3187
3196
|
i.value = r.messages, a.value = r.omitted, l = n;
|
|
3188
3197
|
}
|
|
3189
3198
|
async function b(t, n, r) {
|
|
3190
3199
|
let a = await e.exec("kvcoder.message.list", {
|
|
3191
3200
|
sessionId: t,
|
|
3192
|
-
limit:
|
|
3201
|
+
limit: so,
|
|
3193
3202
|
afterSeq: r
|
|
3194
3203
|
}), o = v(a.messages);
|
|
3195
3204
|
if (o[0] !== void 0 && o[0].seq !== r + 1) return y(t, n);
|
|
@@ -3224,21 +3233,21 @@ function eo(e, t, n) {
|
|
|
3224
3233
|
async function T(t, r, i, a = []) {
|
|
3225
3234
|
let o = t, s = a;
|
|
3226
3235
|
for (; o !== void 0 && !m && !p.has(o);) {
|
|
3227
|
-
p.add(o), Object.assign(r,
|
|
3236
|
+
p.add(o), Object.assign(r, hr()), r.calls = s.map((e) => ({
|
|
3228
3237
|
...e,
|
|
3229
3238
|
complete: !0,
|
|
3230
3239
|
carried: !0
|
|
3231
3240
|
})), s = [], e.follow(o).catch(n);
|
|
3232
3241
|
let t;
|
|
3233
3242
|
for await (let i of e.stream(o)) {
|
|
3234
|
-
let e =
|
|
3243
|
+
let e = yr(r, i);
|
|
3235
3244
|
e.kind === "follow" && (t = e.jobId), e.kind === "subagent" && D(e.sessionId, e.jobId).catch(n), e.kind === "question" && w().catch(n);
|
|
3236
3245
|
}
|
|
3237
3246
|
p.delete(o);
|
|
3238
3247
|
let a = await i();
|
|
3239
3248
|
o = t ?? (a === o ? void 0 : a);
|
|
3240
3249
|
}
|
|
3241
|
-
Object.assign(r,
|
|
3250
|
+
Object.assign(r, hr());
|
|
3242
3251
|
}
|
|
3243
3252
|
async function E(e, t = []) {
|
|
3244
3253
|
u.value = !0;
|
|
@@ -3264,7 +3273,7 @@ function eo(e, t, n) {
|
|
|
3264
3273
|
}
|
|
3265
3274
|
let A = setInterval(() => {
|
|
3266
3275
|
p.size === 0 && t() !== void 0 && k().catch(n);
|
|
3267
|
-
},
|
|
3276
|
+
}, oo);
|
|
3268
3277
|
return h(() => {
|
|
3269
3278
|
m = !0, clearInterval(A);
|
|
3270
3279
|
}), O([t, () => e.workspace.value.id], () => k().catch(n), { immediate: !0 }), {
|
|
@@ -3283,15 +3292,15 @@ function eo(e, t, n) {
|
|
|
3283
3292
|
}
|
|
3284
3293
|
//#endregion
|
|
3285
3294
|
//#region web/src/use-follow-latest.ts
|
|
3286
|
-
var
|
|
3287
|
-
function
|
|
3295
|
+
var lo = 80;
|
|
3296
|
+
function uo(e, t, n) {
|
|
3288
3297
|
let r = v(!1);
|
|
3289
3298
|
function i() {
|
|
3290
3299
|
e.value !== null && (e.value.scrollTop = e.value.scrollHeight);
|
|
3291
3300
|
}
|
|
3292
3301
|
function a() {
|
|
3293
3302
|
let t = e.value;
|
|
3294
|
-
t !== null && (r.value = t.scrollHeight - t.clientHeight - t.scrollTop >
|
|
3303
|
+
t !== null && (r.value = t.scrollHeight - t.clientHeight - t.scrollTop > lo);
|
|
3295
3304
|
}
|
|
3296
3305
|
function o() {
|
|
3297
3306
|
r.value = !1, i();
|
|
@@ -3308,19 +3317,19 @@ function no(e, t, n) {
|
|
|
3308
3317
|
}
|
|
3309
3318
|
//#endregion
|
|
3310
3319
|
//#region web/src/use-slash-commands.ts
|
|
3311
|
-
function
|
|
3320
|
+
function fo(e) {
|
|
3312
3321
|
let t = C([]);
|
|
3313
3322
|
return m(async () => {
|
|
3314
3323
|
try {
|
|
3315
3324
|
t.value = await e.exec("kvcoder.slash.list", {});
|
|
3316
3325
|
} catch (t) {
|
|
3317
|
-
|
|
3326
|
+
Z(e, t);
|
|
3318
3327
|
}
|
|
3319
3328
|
}), t;
|
|
3320
3329
|
}
|
|
3321
3330
|
//#endregion
|
|
3322
3331
|
//#region web/src/use-workspace-session.ts
|
|
3323
|
-
function
|
|
3332
|
+
function po(e, n, r) {
|
|
3324
3333
|
let i = C(e.workspace.value.id);
|
|
3325
3334
|
async function a(t) {
|
|
3326
3335
|
let n;
|
|
@@ -3339,60 +3348,59 @@ function io(e, n, r) {
|
|
|
3339
3348
|
}
|
|
3340
3349
|
//#endregion
|
|
3341
3350
|
//#region web/src/ConversationView.vue?vue&type=script&setup=true&lang.ts
|
|
3342
|
-
var
|
|
3351
|
+
var mo = { class: "kvc-workspace" }, ho = { class: "kvc-stage" }, go = {
|
|
3343
3352
|
class: "kvc-conversation",
|
|
3344
3353
|
"data-test": "conversation"
|
|
3345
|
-
},
|
|
3354
|
+
}, _o = {
|
|
3346
3355
|
key: 0,
|
|
3347
3356
|
class: "kvc-start",
|
|
3348
3357
|
role: "alert",
|
|
3349
3358
|
"data-test": "load-failure"
|
|
3350
|
-
},
|
|
3359
|
+
}, vo = { class: "kvc-start-note" }, yo = {
|
|
3351
3360
|
class: "kvc-actions",
|
|
3352
3361
|
style: { "justify-content": "center" }
|
|
3353
|
-
},
|
|
3362
|
+
}, bo = {
|
|
3354
3363
|
key: 1,
|
|
3355
3364
|
class: "kvc-scrollport"
|
|
3356
|
-
},
|
|
3365
|
+
}, xo = {
|
|
3357
3366
|
key: 1,
|
|
3358
3367
|
class: "kvc-column"
|
|
3359
|
-
},
|
|
3360
|
-
key: 0,
|
|
3361
|
-
class: "kvc-muted",
|
|
3362
|
-
"data-test": "turn-totals"
|
|
3363
|
-
}, ho = {
|
|
3368
|
+
}, So = ["title"], Co = {
|
|
3364
3369
|
key: 2,
|
|
3365
3370
|
class: "kvc-notice",
|
|
3366
3371
|
"data-test": "summarizing"
|
|
3367
|
-
},
|
|
3372
|
+
}, wo = {
|
|
3368
3373
|
key: 3,
|
|
3369
3374
|
class: "kvc-answer",
|
|
3370
3375
|
"data-test": "live-answer"
|
|
3371
|
-
},
|
|
3376
|
+
}, To = ["open"], Eo = { class: "kvc-muted" }, Do = {
|
|
3372
3377
|
class: "kvc-muted",
|
|
3373
3378
|
style: { "white-space": "pre-wrap" }
|
|
3374
|
-
},
|
|
3379
|
+
}, Oo = {
|
|
3375
3380
|
key: 6,
|
|
3376
3381
|
class: "kvc-muted",
|
|
3377
3382
|
style: {
|
|
3378
3383
|
"text-align": "center",
|
|
3379
3384
|
margin: "0"
|
|
3380
3385
|
}
|
|
3381
|
-
},
|
|
3386
|
+
}, ko = /* @__PURE__ */ c({
|
|
3382
3387
|
__name: "ConversationView",
|
|
3383
3388
|
props: { sessionId: {} },
|
|
3384
3389
|
setup(c) {
|
|
3385
|
-
let l = c, u =
|
|
3390
|
+
let l = c, u = Y(), d = po(u, () => l.sessionId, (e) => Z(u, e)), f = v("chat"), p = co(u, () => d.value, (e) => Z(u, e)), { session: m, messages: h, omitted: _, turns: b, live: S, children: C } = p, D = ao(u, () => d.value, () => m.value?.updatedAt, (e) => Z(u, e)), O = t(() => D.open.value && D.shown.value !== void 0), A = t(() => jr(h.value)), j = /* @__PURE__ */ new Set([
|
|
3386
3391
|
"STEP_FAILED",
|
|
3387
3392
|
"REPLY_LOST",
|
|
3388
3393
|
"INTERRUPTED"
|
|
3389
3394
|
]), M = t(() => m.value?.status === "running"), N = t(() => M.value && b.value[0]?.outcome === void 0 ? b.value[0]?.startedAt : void 0), P = t(() => m.value?.status === "waiting" ? b.value[0]?.pending ?? [] : []), F = t(() => {
|
|
3390
3395
|
let e = /* @__PURE__ */ new Map();
|
|
3391
|
-
for (let t of h.value) t.kind === "assistant" && t.turnId !== void 0 && e.set(t.turnId, t.id);
|
|
3396
|
+
for (let t of h.value) (t.kind === "assistant" || t.kind === "toolResult") && t.turnId !== void 0 && e.set(t.turnId, t.id);
|
|
3392
3397
|
let t = /* @__PURE__ */ new Map();
|
|
3393
3398
|
for (let n of b.value) {
|
|
3394
3399
|
let r = e.get(n.id);
|
|
3395
|
-
r !== void 0 && n.outcome !== void 0 && t.set(r,
|
|
3400
|
+
r !== void 0 && n.outcome !== void 0 && t.set(r, {
|
|
3401
|
+
text: qe(u.t, n.usage, n.durationMs),
|
|
3402
|
+
tokens: Je(u.t, n.usage)
|
|
3403
|
+
});
|
|
3396
3404
|
}
|
|
3397
3405
|
return t;
|
|
3398
3406
|
});
|
|
@@ -3404,23 +3412,23 @@ var ao = { class: "kvc-workspace" }, oo = { class: "kvc-stage" }, so = {
|
|
|
3404
3412
|
...e.fileIds.length > 0 ? { fileIds: e.fileIds } : {}
|
|
3405
3413
|
}), K.resume(), await p.refresh();
|
|
3406
3414
|
} catch (e) {
|
|
3407
|
-
|
|
3415
|
+
Z(u, e);
|
|
3408
3416
|
}
|
|
3409
3417
|
}
|
|
3410
3418
|
async function L() {
|
|
3411
3419
|
if (d.value !== void 0) try {
|
|
3412
3420
|
await u.exec("kvcoder.turn.cancel", { sessionId: d.value }), await p.refresh();
|
|
3413
3421
|
} catch (e) {
|
|
3414
|
-
|
|
3422
|
+
Z(u, e);
|
|
3415
3423
|
}
|
|
3416
3424
|
}
|
|
3417
|
-
let R =
|
|
3425
|
+
let R = io(u, (e) => p.refresh(e)), z = t(() => P.value.flatMap((e) => e.kind === "worker" && e.runId !== void 0 ? [e.runId] : [])), B = t(() => P.value.filter((e) => e.questionId === null || !R.hidden.value.has(String(e.questionId)))), V = t(() => {
|
|
3418
3426
|
let e = h.value.at(-1);
|
|
3419
3427
|
return m.value?.status === "idle" && e?.kind === "notice" && j.has(String(e.content.code));
|
|
3420
|
-
}), H =
|
|
3421
|
-
let e =
|
|
3422
|
-
return e === void 0 ? u.t("kvcoder.ui.failed") : u.t(
|
|
3423
|
-
}), G = E("list"), K =
|
|
3428
|
+
}), H = fo(u), U = Ba(u, () => d.value ?? "", () => p.refresh()), W = t(() => {
|
|
3429
|
+
let e = Fe(p.loadFailure.value);
|
|
3430
|
+
return e === void 0 ? u.t("kvcoder.ui.failed") : u.t(Pe(e.code), e.params);
|
|
3431
|
+
}), G = E("list"), K = uo(G, () => [
|
|
3424
3432
|
h.value,
|
|
3425
3433
|
S.text,
|
|
3426
3434
|
S.thinking,
|
|
@@ -3437,31 +3445,31 @@ var ao = { class: "kvc-workspace" }, oo = { class: "kvc-stage" }, so = {
|
|
|
3437
3445
|
let { fileId: e } = await u.exec("kvcoder.session.export", { sessionId: d.value });
|
|
3438
3446
|
window.location.assign(`/api/files/${encodeURIComponent(e)}?workspaceId=${encodeURIComponent(u.workspace.value.id)}`);
|
|
3439
3447
|
} catch (e) {
|
|
3440
|
-
|
|
3448
|
+
Z(u, e);
|
|
3441
3449
|
}
|
|
3442
3450
|
}
|
|
3443
3451
|
let q = () => h.value.at(-1)?.kind === "notice" && h.value.at(-1)?.content.code === "SUMMARY_FAILED";
|
|
3444
3452
|
async function ne() {
|
|
3445
3453
|
return (await u.exec("kernel.settings.list", {})).find((e) => e.key === "kvcoder.compactKeep")?.value ?? null;
|
|
3446
3454
|
}
|
|
3447
|
-
async function
|
|
3455
|
+
async function J() {
|
|
3448
3456
|
let e = await U.compact();
|
|
3449
3457
|
e === !0 ? u.toast("kvcoder.ui.summarized", {}, "success") : e === !1 && !q() && u.toast("kvcoder.ui.nothingToSummarize", { count: await ne() });
|
|
3450
3458
|
}
|
|
3451
|
-
function
|
|
3459
|
+
function re(e, t) {
|
|
3452
3460
|
if (e === "new") return u.navigate("kvcoder.chat");
|
|
3453
3461
|
if (e === "prompt") return void (f.value = f.value === "prompt" ? "chat" : "prompt");
|
|
3454
3462
|
if (e === "delete") return void U.remove();
|
|
3455
|
-
U.working.value === void 0 && (f.value = "chat", e === "rename" ? U.rename(t) : e === "compact" ?
|
|
3463
|
+
U.working.value === void 0 && (f.value = "chat", e === "rename" ? U.rename(t) : e === "compact" ? J() : e === "export" ? U.exportFile() : U.fork());
|
|
3456
3464
|
}
|
|
3457
|
-
async function
|
|
3465
|
+
async function ie(e, t) {
|
|
3458
3466
|
U.working.value === void 0 && (f.value = "chat", await U.runRegistered(e, t) && e.message !== void 0 && await I({
|
|
3459
3467
|
text: t === "" ? u.t(e.message) : t,
|
|
3460
3468
|
fileIds: []
|
|
3461
3469
|
}));
|
|
3462
3470
|
}
|
|
3463
|
-
let
|
|
3464
|
-
return (t, c) => (g(), i("div",
|
|
3471
|
+
let ae = (e) => e.id;
|
|
3472
|
+
return (t, c) => (g(), i("div", mo, [T(m) && T(d) !== void 0 ? (g(), n(sr, {
|
|
3465
3473
|
key: 0,
|
|
3466
3474
|
session: T(m),
|
|
3467
3475
|
tab: f.value,
|
|
@@ -3472,7 +3480,7 @@ var ao = { class: "kvc-workspace" }, oo = { class: "kvc-stage" }, so = {
|
|
|
3472
3480
|
"artifacts-open": T(D).open.value,
|
|
3473
3481
|
working: T(U).working.value !== void 0,
|
|
3474
3482
|
onTab: c[0] ||= (e) => f.value = e,
|
|
3475
|
-
onAction:
|
|
3483
|
+
onAction: re,
|
|
3476
3484
|
onToggleArtifacts: c[1] ||= (e) => T(D).toggle()
|
|
3477
3485
|
}, null, 8, [
|
|
3478
3486
|
"session",
|
|
@@ -3483,19 +3491,19 @@ var ao = { class: "kvc-workspace" }, oo = { class: "kvc-stage" }, so = {
|
|
|
3483
3491
|
"artifacts",
|
|
3484
3492
|
"artifacts-open",
|
|
3485
3493
|
"working"
|
|
3486
|
-
])) : r("v-if", !0), a("div",
|
|
3494
|
+
])) : r("v-if", !0), a("div", ho, [a("section", go, [l.sessionId === void 0 ? (g(), n(_n, {
|
|
3487
3495
|
key: 0,
|
|
3488
3496
|
registered: T(H)
|
|
3489
|
-
}, null, 8, ["registered"])) : T(m) && T(d) !== void 0 ? (g(), i(e, { key: 1 }, [T(p).loadFailure.value === void 0 ? (g(), i("div",
|
|
3497
|
+
}, null, 8, ["registered"])) : T(m) && T(d) !== void 0 ? (g(), i(e, { key: 1 }, [T(p).loadFailure.value === void 0 ? (g(), i("div", bo, [a("div", {
|
|
3490
3498
|
ref_key: "list",
|
|
3491
3499
|
ref: G,
|
|
3492
3500
|
class: "kvc-scroll",
|
|
3493
3501
|
onScroll: c[7] ||= (...e) => T(K).onScroll && T(K).onScroll(...e)
|
|
3494
|
-
}, [f.value === "prompt" ? (g(), n(
|
|
3502
|
+
}, [f.value === "prompt" ? (g(), n(za, {
|
|
3495
3503
|
key: 0,
|
|
3496
3504
|
"session-id": T(m).id,
|
|
3497
3505
|
onBack: c[4] ||= (e) => f.value = "chat"
|
|
3498
|
-
}, null, 8, ["session-id"])) : (g(), i("div",
|
|
3506
|
+
}, null, 8, ["session-id"])) : (g(), i("div", xo, [
|
|
3499
3507
|
T(_) > 0 ? (g(), i("button", {
|
|
3500
3508
|
key: 0,
|
|
3501
3509
|
type: "button",
|
|
@@ -3504,24 +3512,29 @@ var ao = { class: "kvc-workspace" }, oo = { class: "kvc-stage" }, so = {
|
|
|
3504
3512
|
"data-test": "earlier",
|
|
3505
3513
|
onClick: te
|
|
3506
3514
|
}, w(T(u).t("kvcoder.ui.earlierMessages", { count: T(_) })), 1)) : r("v-if", !0),
|
|
3507
|
-
(g(!0), i(e, null, y(T(h), (t) => (g(), i(e, { key:
|
|
3515
|
+
(g(!0), i(e, null, y(T(h), (t) => (g(), i(e, { key: ae(t) }, [s($i, {
|
|
3508
3516
|
message: t,
|
|
3509
3517
|
calls: A.value,
|
|
3510
3518
|
onOpenArtifact: c[5] ||= (e) => T(D).openArtifact(e)
|
|
3511
|
-
}, null, 8, ["message", "calls"]), F.value.has(t.id) ? (g(), i("span",
|
|
3512
|
-
|
|
3519
|
+
}, null, 8, ["message", "calls"]), F.value.has(t.id) ? (g(), i("span", {
|
|
3520
|
+
key: 0,
|
|
3521
|
+
class: "kvc-muted",
|
|
3522
|
+
title: F.value.get(t.id)?.tokens,
|
|
3523
|
+
"data-test": "turn-totals"
|
|
3524
|
+
}, w(F.value.get(t.id)?.text), 9, So)) : r("v-if", !0)], 64))), 128)),
|
|
3525
|
+
V.value ? (g(), n(Ma, {
|
|
3513
3526
|
key: 1,
|
|
3514
3527
|
"session-id": T(m).id,
|
|
3515
3528
|
onSent: c[6] ||= (e) => {
|
|
3516
3529
|
T(K).resume(), T(p).refresh();
|
|
3517
3530
|
}
|
|
3518
3531
|
}, null, 8, ["session-id"])) : r("v-if", !0),
|
|
3519
|
-
T(S).summarizing ? (g(), i("div",
|
|
3520
|
-
M.value && (T(S).text !== "" || T(S).thinking !== "") ? (g(), i("div",
|
|
3532
|
+
T(S).summarizing ? (g(), i("div", Co, w(T(u).t("kvcoder.ui.summarizing")), 1)) : r("v-if", !0),
|
|
3533
|
+
M.value && (T(S).text !== "" || T(S).thinking !== "") ? (g(), i("div", wo, [T(S).thinking === "" ? r("v-if", !0) : (g(), i("details", {
|
|
3521
3534
|
key: 0,
|
|
3522
3535
|
open: T(S).text === "" && T(S).calls.length === 0,
|
|
3523
3536
|
"data-test": "live-thinking"
|
|
3524
|
-
}, [a("summary",
|
|
3537
|
+
}, [a("summary", Eo, w(T(u).t("kvcoder.ui.thinkingNow")), 1), a("p", Do, w(T(S).thinking), 1)], 8, To)), T(S).text === "" ? r("v-if", !0) : (g(), n(x(T(u).View), {
|
|
3525
3538
|
key: 1,
|
|
3526
3539
|
view: {
|
|
3527
3540
|
type: "markdown",
|
|
@@ -3529,15 +3542,15 @@ var ao = { class: "kvc-workspace" }, oo = { class: "kvc-stage" }, so = {
|
|
|
3529
3542
|
params: { text: T(S).text }
|
|
3530
3543
|
}
|
|
3531
3544
|
}, null, 8, ["view"]))])) : r("v-if", !0),
|
|
3532
|
-
M.value ? (g(), n(
|
|
3545
|
+
M.value ? (g(), n(Dr, {
|
|
3533
3546
|
key: 4,
|
|
3534
3547
|
live: T(S)
|
|
3535
3548
|
}, null, 8, ["live"])) : r("v-if", !0),
|
|
3536
|
-
T(U).working.value ? (g(), n(
|
|
3549
|
+
T(U).working.value ? (g(), n(Cn, {
|
|
3537
3550
|
key: 5,
|
|
3538
3551
|
working: T(U).working.value
|
|
3539
3552
|
}, null, 8, ["working"])) : r("v-if", !0),
|
|
3540
|
-
(g(!0), i(e, null, y(T(C), ([e, t]) => (g(), n(
|
|
3553
|
+
(g(!0), i(e, null, y(T(C), ([e, t]) => (g(), n(Ya, {
|
|
3541
3554
|
key: e,
|
|
3542
3555
|
child: t,
|
|
3543
3556
|
hidden: T(R).hidden.value,
|
|
@@ -3549,12 +3562,12 @@ var ao = { class: "kvc-workspace" }, oo = { class: "kvc-stage" }, so = {
|
|
|
3549
3562
|
"onAnswer",
|
|
3550
3563
|
"onDecide"
|
|
3551
3564
|
]))), 128)),
|
|
3552
|
-
(g(!0), i(e, null, y(z.value, (e) => (g(), n(
|
|
3565
|
+
(g(!0), i(e, null, y(z.value, (e) => (g(), n(no, {
|
|
3553
3566
|
key: e,
|
|
3554
3567
|
"session-id": T(m).id,
|
|
3555
3568
|
"run-id": e
|
|
3556
3569
|
}, null, 8, ["session-id", "run-id"]))), 128)),
|
|
3557
|
-
s(
|
|
3570
|
+
s(Oa, {
|
|
3558
3571
|
pending: P.value,
|
|
3559
3572
|
hidden: T(R).hidden.value,
|
|
3560
3573
|
onAnswer: T(R).answer,
|
|
@@ -3565,7 +3578,7 @@ var ao = { class: "kvc-workspace" }, oo = { class: "kvc-stage" }, so = {
|
|
|
3565
3578
|
"onAnswer",
|
|
3566
3579
|
"onDecide"
|
|
3567
3580
|
]),
|
|
3568
|
-
B.value.some((e) => e.kind !== "subagent" && e.kind !== "worker") ? (g(), i("p",
|
|
3581
|
+
B.value.some((e) => e.kind !== "subagent" && e.kind !== "worker") ? (g(), i("p", Oo, w(T(u).t("kvcoder.ui.messageDismisses")), 1)) : r("v-if", !0)
|
|
3569
3582
|
]))], 544), T(K).away.value ? (g(), i("button", {
|
|
3570
3583
|
key: 0,
|
|
3571
3584
|
type: "button",
|
|
@@ -3575,7 +3588,7 @@ var ao = { class: "kvc-workspace" }, oo = { class: "kvc-stage" }, so = {
|
|
|
3575
3588
|
}, [s(T(ee), {
|
|
3576
3589
|
size: 16,
|
|
3577
3590
|
"aria-hidden": "true"
|
|
3578
|
-
}), o(w(T(u).t("kvcoder.ui.jumpToLatest")), 1)])) : r("v-if", !0)])) : (g(), i("div",
|
|
3591
|
+
}), o(w(T(u).t("kvcoder.ui.jumpToLatest")), 1)])) : r("v-if", !0)])) : (g(), i("div", _o, [a("p", vo, w(T(u).t("kvcoder.ui.loadFailed", { error: W.value })), 1), a("div", yo, [a("button", {
|
|
3579
3592
|
type: "button",
|
|
3580
3593
|
class: "kvc-button kvc-primary",
|
|
3581
3594
|
"data-test": "load-again",
|
|
@@ -3585,7 +3598,7 @@ var ao = { class: "kvc-workspace" }, oo = { class: "kvc-stage" }, so = {
|
|
|
3585
3598
|
class: "kvc-button",
|
|
3586
3599
|
"data-test": "load-export",
|
|
3587
3600
|
onClick: c[3] ||= (e) => T(U).exportFile()
|
|
3588
|
-
}, w(T(u).t("kvcoder.ui.export")), 1)])])), s(
|
|
3601
|
+
}, w(T(u).t("kvcoder.ui.export")), 1)])])), s(zt, {
|
|
3589
3602
|
running: M.value,
|
|
3590
3603
|
placeholder: T(u).t("kvcoder.ui.placeholder"),
|
|
3591
3604
|
blocked: T(U).working.value !== void 0,
|
|
@@ -3593,10 +3606,10 @@ var ao = { class: "kvc-workspace" }, oo = { class: "kvc-stage" }, so = {
|
|
|
3593
3606
|
registered: T(H),
|
|
3594
3607
|
onSend: I,
|
|
3595
3608
|
onStop: L,
|
|
3596
|
-
onCommand:
|
|
3597
|
-
onRegistered:
|
|
3609
|
+
onCommand: re,
|
|
3610
|
+
onRegistered: ie
|
|
3598
3611
|
}, {
|
|
3599
|
-
controls: k(() => [s(
|
|
3612
|
+
controls: k(() => [s(Va, {
|
|
3600
3613
|
session: T(m),
|
|
3601
3614
|
onChanged: c[9] ||= (e) => T(p).refresh()
|
|
3602
3615
|
}, null, 8, ["session"])]),
|
|
@@ -3606,7 +3619,7 @@ var ao = { class: "kvc-workspace" }, oo = { class: "kvc-stage" }, so = {
|
|
|
3606
3619
|
"placeholder",
|
|
3607
3620
|
"blocked",
|
|
3608
3621
|
"registered"
|
|
3609
|
-
])], 64)) : r("v-if", !0)]), O.value ? (g(), n(
|
|
3622
|
+
])], 64)) : r("v-if", !0)]), O.value ? (g(), n(yt, {
|
|
3610
3623
|
key: 0,
|
|
3611
3624
|
list: T(D).list.value,
|
|
3612
3625
|
shown: T(D).shown.value,
|
|
@@ -3619,13 +3632,13 @@ var ao = { class: "kvc-workspace" }, oo = { class: "kvc-stage" }, so = {
|
|
|
3619
3632
|
"content"
|
|
3620
3633
|
])) : r("v-if", !0)])]));
|
|
3621
3634
|
}
|
|
3622
|
-
}),
|
|
3635
|
+
}), Ao = /* @__PURE__ */ c({
|
|
3623
3636
|
__name: "conversation",
|
|
3624
3637
|
props: { sessionId: {} },
|
|
3625
3638
|
setup(e) {
|
|
3626
3639
|
let t = e;
|
|
3627
|
-
return (e, r) => (g(), n(
|
|
3640
|
+
return (e, r) => (g(), n(ko, { "session-id": t.sessionId }, null, 8, ["session-id"]));
|
|
3628
3641
|
}
|
|
3629
3642
|
});
|
|
3630
3643
|
//#endregion
|
|
3631
|
-
export {
|
|
3644
|
+
export { Ao as default };
|