@kvman/kvcoder 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.d.ts +12 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/connector-call.d.ts +1 -1
- package/dist/connector-call.d.ts.map +1 -1
- package/dist/connector-call.js +2 -2
- package/dist/connector-call.js.map +1 -1
- package/dist/connectors/fs.d.ts.map +1 -1
- package/dist/connectors/fs.js +12 -3
- package/dist/connectors/fs.js.map +1 -1
- package/dist/files/edit-text.d.ts +2 -1
- package/dist/files/edit-text.d.ts.map +1 -1
- package/dist/files/edit-text.js +5 -1
- package/dist/files/edit-text.js.map +1 -1
- package/dist/files/search-text.d.ts +6 -2
- package/dist/files/search-text.d.ts.map +1 -1
- package/dist/files/search-text.js +14 -6
- package/dist/files/search-text.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/messages/fitting-messages.d.ts +7 -0
- package/dist/messages/fitting-messages.d.ts.map +1 -0
- package/dist/messages/fitting-messages.js +19 -0
- package/dist/messages/fitting-messages.js.map +1 -0
- package/dist/messages/register-messages.d.ts.map +1 -1
- package/dist/messages/register-messages.js +9 -5
- package/dist/messages/register-messages.js.map +1 -1
- package/dist/prompt/build-prompt.d.ts.map +1 -1
- package/dist/prompt/build-prompt.js +1 -0
- package/dist/prompt/build-prompt.js.map +1 -1
- package/dist/prompt/working-method.js +1 -1
- package/dist/prompt/working-method.js.map +1 -1
- package/dist/register-settings.d.ts +2 -2
- package/dist/register-settings.js +2 -2
- package/dist/register-settings.js.map +1 -1
- package/dist/sessions/register-context.d.ts +3 -0
- package/dist/sessions/register-context.d.ts.map +1 -0
- package/dist/sessions/register-context.js +23 -0
- package/dist/sessions/register-context.js.map +1 -0
- package/dist/sessions/register-sessions.js +1 -1
- package/dist/sessions/register-sessions.js.map +1 -1
- package/dist/turns/compaction.d.ts +4 -0
- package/dist/turns/compaction.d.ts.map +1 -1
- package/dist/turns/compaction.js +32 -25
- package/dist/turns/compaction.js.map +1 -1
- package/dist/turns/message-stamp.d.ts +3 -0
- package/dist/turns/message-stamp.d.ts.map +1 -0
- package/dist/turns/message-stamp.js +16 -0
- package/dist/turns/message-stamp.js.map +1 -0
- package/dist/turns/model-context.d.ts.map +1 -1
- package/dist/turns/model-context.js +10 -2
- package/dist/turns/model-context.js.map +1 -1
- package/dist/turns/read-again.d.ts +6 -0
- package/dist/turns/read-again.d.ts.map +1 -0
- package/dist/turns/read-again.js +16 -0
- package/dist/turns/read-again.js.map +1 -0
- package/dist/turns/run-command.d.ts.map +1 -1
- package/dist/turns/run-command.js +4 -1
- package/dist/turns/run-command.js.map +1 -1
- package/dist/turns/sent-size.d.ts +4 -0
- package/dist/turns/sent-size.d.ts.map +1 -0
- package/dist/turns/sent-size.js +22 -0
- package/dist/turns/sent-size.js.map +1 -0
- package/dist/turns/settle-calls.d.ts +2 -2
- package/dist/turns/settle-calls.d.ts.map +1 -1
- package/dist/turns/settle-calls.js +10 -2
- package/dist/turns/settle-calls.js.map +1 -1
- package/dist/turns/step.js +2 -2
- package/dist/turns/step.js.map +1 -1
- package/dist/web/components/call.css +1 -1
- package/dist/web/components/call.js +30 -21
- package/dist/web/components/connectors.css +1 -1
- package/dist/web/components/conversation.css +1 -1
- package/dist/web/components/conversation.js +663 -555
- 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/docs/connectors.md +2 -2
- package/locales/ar.json +6 -1
- package/locales/en.json +6 -1
- package/package.json +3 -3
|
@@ -122,7 +122,7 @@ var ee = U({
|
|
|
122
122
|
d: "M12 19V5",
|
|
123
123
|
key: "x0mq9r"
|
|
124
124
|
}]]
|
|
125
|
-
}),
|
|
125
|
+
}), K = U({
|
|
126
126
|
name: "bell-ring",
|
|
127
127
|
size: 24,
|
|
128
128
|
node: [
|
|
@@ -143,7 +143,7 @@ var ee = U({
|
|
|
143
143
|
key: "tap9e0"
|
|
144
144
|
}]
|
|
145
145
|
]
|
|
146
|
-
}),
|
|
146
|
+
}), te = U({
|
|
147
147
|
name: "bot",
|
|
148
148
|
size: 24,
|
|
149
149
|
node: [
|
|
@@ -176,21 +176,21 @@ var ee = U({
|
|
|
176
176
|
key: "rq6x2g"
|
|
177
177
|
}]
|
|
178
178
|
]
|
|
179
|
-
}),
|
|
179
|
+
}), q = U({
|
|
180
180
|
name: "check",
|
|
181
181
|
size: 24,
|
|
182
182
|
node: [["path", {
|
|
183
183
|
d: "M20 6 9 17l-5-5",
|
|
184
184
|
key: "1gmf2c"
|
|
185
185
|
}]]
|
|
186
|
-
}),
|
|
186
|
+
}), ne = U({
|
|
187
187
|
name: "chevron-down",
|
|
188
188
|
size: 24,
|
|
189
189
|
node: [["path", {
|
|
190
190
|
d: "m6 9 6 6 6-6",
|
|
191
191
|
key: "qrunsl"
|
|
192
192
|
}]]
|
|
193
|
-
}),
|
|
193
|
+
}), re = U({
|
|
194
194
|
name: "chevron-right",
|
|
195
195
|
size: 24,
|
|
196
196
|
node: [["path", {
|
|
@@ -589,14 +589,26 @@ function qe(e, t, n) {
|
|
|
589
589
|
cost: i
|
|
590
590
|
});
|
|
591
591
|
}
|
|
592
|
+
function Je(e, t) {
|
|
593
|
+
if (t === null || t.window === null) return;
|
|
594
|
+
let n = Ne(), r = new Intl.NumberFormat(n, {
|
|
595
|
+
notation: "compact",
|
|
596
|
+
maximumFractionDigits: 1
|
|
597
|
+
}).format(t.window);
|
|
598
|
+
return e("kvcoder.ui.context", {
|
|
599
|
+
percent: Math.round(t.tokens / t.window * 100),
|
|
600
|
+
window: r,
|
|
601
|
+
at: Math.round(t.compactAt * 100)
|
|
602
|
+
});
|
|
603
|
+
}
|
|
592
604
|
//#endregion
|
|
593
605
|
//#region web/src/ArtifactUrlFrame.vue?vue&type=script&setup=true&lang.ts
|
|
594
|
-
var
|
|
606
|
+
var Ye = ["title", "src"], Xe = {
|
|
595
607
|
key: 1,
|
|
596
608
|
class: "kvc-muted",
|
|
597
609
|
role: "alert",
|
|
598
610
|
"data-test": "artifact-url-refused"
|
|
599
|
-
},
|
|
611
|
+
}, Ze = /* @__PURE__ */ c({
|
|
600
612
|
__name: "ArtifactUrlFrame",
|
|
601
613
|
props: {
|
|
602
614
|
label: {},
|
|
@@ -604,7 +616,7 @@ var Je = ["title", "src"], Ye = {
|
|
|
604
616
|
},
|
|
605
617
|
setup(e) {
|
|
606
618
|
let n = e, r = J(), a = t(() => Me(n.content, window.location));
|
|
607
|
-
return (e, t) => a.value === void 0 ? (g(), i("p",
|
|
619
|
+
return (e, t) => a.value === void 0 ? (g(), i("p", Xe, w(T(r).t("kvcoder.ui.artifacts.urlRefused")), 1)) : (g(), i("iframe", {
|
|
608
620
|
key: 0,
|
|
609
621
|
class: "kvc-artifact-frame",
|
|
610
622
|
sandbox: "allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-downloads",
|
|
@@ -612,48 +624,48 @@ var Je = ["title", "src"], Ye = {
|
|
|
612
624
|
title: n.label,
|
|
613
625
|
src: a.value,
|
|
614
626
|
"data-test": "artifact-url-frame"
|
|
615
|
-
}, null, 8,
|
|
627
|
+
}, null, 8, Ye));
|
|
616
628
|
}
|
|
617
|
-
}),
|
|
629
|
+
}), Qe = ["aria-label"], $e = { class: "kvc-artifact-head" }, et = { class: "kvc-artifact-name" }, tt = {
|
|
618
630
|
key: 0,
|
|
619
631
|
role: "tablist",
|
|
620
632
|
class: "kvc-artifact-tabs"
|
|
621
|
-
},
|
|
633
|
+
}, nt = [
|
|
622
634
|
"aria-selected",
|
|
623
635
|
"data-test",
|
|
624
636
|
"onClick"
|
|
625
|
-
],
|
|
637
|
+
], rt = {
|
|
626
638
|
key: 1,
|
|
627
639
|
class: "kvc-artifact-title kvc-oneline",
|
|
628
640
|
"data-test": "artifact-title"
|
|
629
|
-
},
|
|
641
|
+
}, it = {
|
|
630
642
|
class: "kvc-muted",
|
|
631
643
|
"data-test": "artifact-meta"
|
|
632
|
-
},
|
|
644
|
+
}, at = { "data-test": "artifact-format" }, ot = { "data-test": "artifact-version" }, st = { class: "kvc-artifact-actions" }, ct = ["aria-label"], lt = [
|
|
633
645
|
"aria-pressed",
|
|
634
646
|
"aria-label",
|
|
635
647
|
"title"
|
|
636
|
-
],
|
|
648
|
+
], ut = { class: "kvc-tab-text" }, dt = [
|
|
637
649
|
"aria-pressed",
|
|
638
650
|
"aria-label",
|
|
639
651
|
"title"
|
|
640
|
-
],
|
|
652
|
+
], ft = { class: "kvc-tab-text" }, pt = [
|
|
641
653
|
"href",
|
|
642
654
|
"aria-label",
|
|
643
655
|
"title"
|
|
644
|
-
],
|
|
656
|
+
], mt = [
|
|
645
657
|
"disabled",
|
|
646
658
|
"aria-label",
|
|
647
659
|
"title"
|
|
648
|
-
],
|
|
660
|
+
], ht = ["aria-label", "title"], gt = {
|
|
649
661
|
class: "kvc-artifact-body",
|
|
650
662
|
"data-test": "artifact-body"
|
|
651
|
-
},
|
|
663
|
+
}, _t = {
|
|
652
664
|
key: 0,
|
|
653
665
|
class: "kvc-artifact-source",
|
|
654
666
|
dir: "ltr",
|
|
655
667
|
"data-test": "artifact-source"
|
|
656
|
-
},
|
|
668
|
+
}, vt = /* @__PURE__ */ c({
|
|
657
669
|
__name: "ArtifactPanel",
|
|
658
670
|
props: {
|
|
659
671
|
list: {},
|
|
@@ -680,7 +692,7 @@ var Je = ["title", "src"], Ye = {
|
|
|
680
692
|
class: "kvc-artifact-panel",
|
|
681
693
|
"data-test": "artifact-panel",
|
|
682
694
|
"aria-label": T(f).t("kvcoder.ui.artifacts.title")
|
|
683
|
-
}, [a("div",
|
|
695
|
+
}, [a("div", $e, [a("div", et, [u.list.length > 1 ? (g(), i("div", tt, [(g(!0), i(e, null, y(u.list, (e) => (g(), i("button", {
|
|
684
696
|
key: e.id,
|
|
685
697
|
type: "button",
|
|
686
698
|
role: "tab",
|
|
@@ -688,11 +700,11 @@ var Je = ["title", "src"], Ye = {
|
|
|
688
700
|
"aria-selected": e.id === u.shown,
|
|
689
701
|
"data-test": `artifact-tab-${e.id}`,
|
|
690
702
|
onClick: (t) => d("select", e.id)
|
|
691
|
-
}, w(e.title), 9,
|
|
692
|
-
a("span",
|
|
703
|
+
}, w(e.title), 9, nt))), 128))])) : (g(), i("span", rt, w(h.value), 1)), a("span", it, [
|
|
704
|
+
a("span", at, w(T(f).t(`kvcoder.ui.artifacts.format.${b.value}`)), 1),
|
|
693
705
|
c[3] ||= o(" · ", -1),
|
|
694
|
-
a("span",
|
|
695
|
-
])]), a("div",
|
|
706
|
+
a("span", ot, w(T(f).t("kvcoder.ui.artifacts.version", { version: _.value })), 1)
|
|
707
|
+
])]), a("div", st, [
|
|
696
708
|
a("div", {
|
|
697
709
|
class: "kvc-tabs",
|
|
698
710
|
role: "group",
|
|
@@ -709,7 +721,7 @@ var Je = ["title", "src"], Ye = {
|
|
|
709
721
|
size: 16,
|
|
710
722
|
class: "kvc-tab-icon",
|
|
711
723
|
"aria-hidden": "true"
|
|
712
|
-
}), a("span",
|
|
724
|
+
}), a("span", ut, w(T(f).t("kvcoder.ui.artifacts.preview")), 1)], 8, lt), a("button", {
|
|
713
725
|
type: "button",
|
|
714
726
|
class: "kvc-tab",
|
|
715
727
|
"aria-pressed": E.value === "source",
|
|
@@ -721,7 +733,7 @@ var Je = ["title", "src"], Ye = {
|
|
|
721
733
|
size: 16,
|
|
722
734
|
class: "kvc-tab-icon",
|
|
723
735
|
"aria-hidden": "true"
|
|
724
|
-
}), a("span",
|
|
736
|
+
}), a("span", ft, w(T(f).t("kvcoder.ui.artifacts.source")), 1)], 8, dt)], 8, ct),
|
|
725
737
|
k.value === void 0 ? r("v-if", !0) : (g(), i("a", {
|
|
726
738
|
key: 0,
|
|
727
739
|
href: k.value,
|
|
@@ -734,7 +746,7 @@ var Je = ["title", "src"], Ye = {
|
|
|
734
746
|
}, [s(T(le), {
|
|
735
747
|
size: 16,
|
|
736
748
|
"aria-hidden": "true"
|
|
737
|
-
})], 8,
|
|
749
|
+
})], 8, pt)),
|
|
738
750
|
a("button", {
|
|
739
751
|
type: "button",
|
|
740
752
|
class: "kvc-button kvc-icon-button",
|
|
@@ -746,7 +758,7 @@ var Je = ["title", "src"], Ye = {
|
|
|
746
758
|
}, [s(T(se), {
|
|
747
759
|
size: 16,
|
|
748
760
|
"aria-hidden": "true"
|
|
749
|
-
})], 8,
|
|
761
|
+
})], 8, mt),
|
|
750
762
|
a("button", {
|
|
751
763
|
type: "button",
|
|
752
764
|
class: "kvc-button kvc-icon-button",
|
|
@@ -757,21 +769,21 @@ var Je = ["title", "src"], Ye = {
|
|
|
757
769
|
}, [s(T(be), {
|
|
758
770
|
size: 16,
|
|
759
771
|
"aria-hidden": "true"
|
|
760
|
-
})], 8,
|
|
761
|
-
])]), a("div",
|
|
772
|
+
})], 8, ht)
|
|
773
|
+
])]), a("div", gt, [E.value === "source" && m.value !== void 0 ? (g(), i("pre", _t, w(S.value), 1)) : b.value === "markdown" && m.value !== void 0 ? (g(), n(x(T(f).View), {
|
|
762
774
|
key: 1,
|
|
763
775
|
view: A.value
|
|
764
776
|
}, null, 8, ["view"])) : b.value === "html" && m.value !== void 0 ? (g(), n(Oe, {
|
|
765
777
|
key: 2,
|
|
766
778
|
label: C.value,
|
|
767
779
|
content: S.value
|
|
768
|
-
}, null, 8, ["label", "content"])) : b.value === "url" && m.value !== void 0 ? (g(), n(
|
|
780
|
+
}, null, 8, ["label", "content"])) : b.value === "url" && m.value !== void 0 ? (g(), n(Ze, {
|
|
769
781
|
key: 3,
|
|
770
782
|
label: C.value,
|
|
771
783
|
content: S.value
|
|
772
|
-
}, null, 8, ["label", "content"])) : r("v-if", !0)])], 8,
|
|
784
|
+
}, null, 8, ["label", "content"])) : r("v-if", !0)])], 8, Qe));
|
|
773
785
|
}
|
|
774
|
-
}),
|
|
786
|
+
}), yt = [
|
|
775
787
|
{ name: "compact" },
|
|
776
788
|
{ name: "export" },
|
|
777
789
|
{ name: "fork" },
|
|
@@ -782,7 +794,7 @@ var Je = ["title", "src"], Ye = {
|
|
|
782
794
|
argument: !0
|
|
783
795
|
}
|
|
784
796
|
];
|
|
785
|
-
function
|
|
797
|
+
function bt(e) {
|
|
786
798
|
let t = /^\/(\S*)(\s+(.*))?$/.exec(e);
|
|
787
799
|
if (!(t === null || e.includes("\n"))) return {
|
|
788
800
|
word: t[1] ?? "",
|
|
@@ -790,9 +802,9 @@ function yt(e) {
|
|
|
790
802
|
named: t[2] !== void 0
|
|
791
803
|
};
|
|
792
804
|
}
|
|
793
|
-
function
|
|
805
|
+
function xt(e, t) {
|
|
794
806
|
let n = (t) => e.named ? t === e.word : t.startsWith(e.word);
|
|
795
|
-
return [...
|
|
807
|
+
return [...yt.filter((e) => n(e.name)).map((e) => ({
|
|
796
808
|
kind: "own",
|
|
797
809
|
command: e
|
|
798
810
|
})), ...t.filter((e) => n(e.name)).map((e) => ({
|
|
@@ -802,36 +814,36 @@ function bt(e, t) {
|
|
|
802
814
|
}
|
|
803
815
|
//#endregion
|
|
804
816
|
//#region web/src/MessageComposer.vue?vue&type=script&setup=true&lang.ts
|
|
805
|
-
var
|
|
817
|
+
var St = { class: "kvc-composer" }, Ct = { class: "kvc-box" }, wt = ["aria-label"], Tt = {
|
|
806
818
|
key: 0,
|
|
807
819
|
class: "kvc-muted kvc-none",
|
|
808
820
|
"data-test": "slash-wait"
|
|
809
|
-
},
|
|
821
|
+
}, Et = [
|
|
810
822
|
"aria-disabled",
|
|
811
823
|
"aria-selected",
|
|
812
824
|
"data-active",
|
|
813
825
|
"data-test",
|
|
814
826
|
"onMousemove",
|
|
815
827
|
"onClick"
|
|
816
|
-
],
|
|
828
|
+
], Dt = { class: "kvc-slash-name" }, Ot = {
|
|
817
829
|
class: "kvc-mono",
|
|
818
830
|
dir: "ltr"
|
|
819
|
-
},
|
|
831
|
+
}, kt = { class: "kvc-muted" }, At = {
|
|
820
832
|
key: 1,
|
|
821
833
|
class: "kvc-muted kvc-none",
|
|
822
834
|
"data-test": "slash-none"
|
|
823
|
-
},
|
|
835
|
+
}, jt = {
|
|
824
836
|
key: 1,
|
|
825
837
|
style: {
|
|
826
838
|
display: "flex",
|
|
827
839
|
gap: "6px",
|
|
828
840
|
"flex-wrap": "wrap"
|
|
829
841
|
}
|
|
830
|
-
},
|
|
842
|
+
}, Mt = ["aria-label", "onClick"], Nt = ["placeholder", "aria-label"], Pt = { class: "kvc-composer-row" }, Ft = [
|
|
831
843
|
"aria-label",
|
|
832
844
|
"title",
|
|
833
845
|
"disabled"
|
|
834
|
-
],
|
|
846
|
+
], It = { class: "kvc-muted kvc-composer-hint" }, Lt = ["aria-label", "disabled"], Rt = /* @__PURE__ */ c({
|
|
835
847
|
__name: "MessageComposer",
|
|
836
848
|
props: {
|
|
837
849
|
running: { type: Boolean },
|
|
@@ -847,11 +859,11 @@ var xt = { class: "kvc-composer" }, St = { class: "kvc-box" }, Ct = ["aria-label
|
|
|
847
859
|
"registered"
|
|
848
860
|
],
|
|
849
861
|
setup(n, { emit: c }) {
|
|
850
|
-
let l = n, u = c, d = J(), f = v(""), p = v([]), m = v(null), h = v(!1), _ = v(0), x = v(!1), S = t(() => l.commands === void 0 ? void 0 :
|
|
862
|
+
let l = n, u = c, d = J(), f = v(""), p = v([]), m = v(null), h = v(!1), _ = v(0), x = v(!1), S = t(() => l.commands === void 0 ? void 0 : bt(f.value)), C = t(() => l.commands === "wait"), E = t(() => S.value === void 0 ? [] : xt(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);
|
|
851
863
|
O(f, () => {
|
|
852
864
|
_.value = 0, x.value = !1;
|
|
853
865
|
});
|
|
854
|
-
async function
|
|
866
|
+
async function I(e) {
|
|
855
867
|
h.value = !0;
|
|
856
868
|
try {
|
|
857
869
|
for (let t of e) {
|
|
@@ -872,44 +884,50 @@ var xt = { class: "kvc-composer" }, St = { class: "kvc-box" }, Ct = ["aria-label
|
|
|
872
884
|
h.value = !1;
|
|
873
885
|
}
|
|
874
886
|
}
|
|
875
|
-
async function
|
|
887
|
+
async function L(e) {
|
|
876
888
|
let t = e.target;
|
|
877
|
-
t instanceof HTMLInputElement && t.files !== null && (await
|
|
889
|
+
t instanceof HTMLInputElement && t.files !== null && (await I([...t.files]), t.value = "");
|
|
878
890
|
}
|
|
879
|
-
function
|
|
891
|
+
function R(e) {
|
|
880
892
|
let t = [...e.clipboardData?.files ?? []];
|
|
881
|
-
t.length !== 0 && (e.preventDefault(),
|
|
893
|
+
t.length !== 0 && (e.preventDefault(), I(t));
|
|
882
894
|
}
|
|
883
|
-
function
|
|
884
|
-
let e =
|
|
885
|
-
|
|
895
|
+
function z() {
|
|
896
|
+
let e = M.value, t = S.value?.argument ?? "";
|
|
897
|
+
l.blocked === !0 || e === void 0 || P(e) && t === "" || (e.kind === "own" ? u("command", e.command.name, t) : u("registered", e.command, t), f.value = "");
|
|
886
898
|
}
|
|
887
|
-
function
|
|
888
|
-
if (S.value !== void 0) return
|
|
899
|
+
function B() {
|
|
900
|
+
if (S.value !== void 0) return z();
|
|
889
901
|
let e = f.value.trim();
|
|
890
902
|
e === "" || h.value || l.blocked === !0 || (u("send", {
|
|
891
903
|
text: e,
|
|
892
904
|
fileIds: p.value.map((e) => e.id)
|
|
893
905
|
}), f.value = "", p.value = []);
|
|
894
906
|
}
|
|
895
|
-
function
|
|
896
|
-
|
|
907
|
+
function V(e) {
|
|
908
|
+
j.value.length > 0 && (_.value = (_.value + e + j.value.length) % j.value.length);
|
|
897
909
|
}
|
|
898
|
-
function
|
|
910
|
+
function H(e) {
|
|
911
|
+
k(e) && (_.value = j.value.indexOf(e));
|
|
912
|
+
}
|
|
913
|
+
function U(e) {
|
|
914
|
+
k(e) && (H(e), z());
|
|
915
|
+
}
|
|
916
|
+
function ee(e) {
|
|
899
917
|
if (S.value === void 0) return !1;
|
|
900
|
-
let t =
|
|
918
|
+
let t = M.value;
|
|
901
919
|
if (e.key === "Escape") x.value = !0;
|
|
902
|
-
else if (e.key === "ArrowDown")
|
|
903
|
-
else if (e.key === "ArrowUp")
|
|
904
|
-
else if (e.key === "Tab" && t !== void 0
|
|
920
|
+
else if (e.key === "ArrowDown") V(1);
|
|
921
|
+
else if (e.key === "ArrowUp") V(-1);
|
|
922
|
+
else if (e.key === "Tab" && t !== void 0) f.value = `/${t.command.name} `;
|
|
905
923
|
else return !1;
|
|
906
924
|
return !0;
|
|
907
925
|
}
|
|
908
|
-
function
|
|
909
|
-
if (
|
|
910
|
-
e.key !== "Enter" || e.shiftKey || e.isComposing || (e.preventDefault(),
|
|
926
|
+
function W(e) {
|
|
927
|
+
if (ee(e)) return e.preventDefault();
|
|
928
|
+
e.key !== "Enter" || e.shiftKey || e.isComposing || (e.preventDefault(), B());
|
|
911
929
|
}
|
|
912
|
-
return (t, n) => (g(), i("div",
|
|
930
|
+
return (t, n) => (g(), i("div", St, [a("div", Ct, [
|
|
913
931
|
S.value !== void 0 && !x.value ? (g(), i("div", {
|
|
914
932
|
key: 0,
|
|
915
933
|
class: "kvc-slash",
|
|
@@ -917,23 +935,21 @@ var xt = { class: "kvc-composer" }, St = { class: "kvc-box" }, Ct = ["aria-label
|
|
|
917
935
|
"aria-label": T(d).t("kvcoder.ui.slash.title"),
|
|
918
936
|
"data-test": "slash-list"
|
|
919
937
|
}, [
|
|
920
|
-
|
|
921
|
-
(g(!0), i(e, null, y(E.value, (t
|
|
938
|
+
N.value ? (g(), i("p", Tt, w(T(d).t("kvcoder.ui.slash.wait")), 1)) : r("v-if", !0),
|
|
939
|
+
(g(!0), i(e, null, y(E.value, (t) => (g(), i("div", {
|
|
922
940
|
key: t.command.name,
|
|
923
941
|
class: "kvc-slash-row",
|
|
924
942
|
role: "option",
|
|
925
|
-
"aria-disabled":
|
|
926
|
-
"aria-selected":
|
|
927
|
-
"data-active":
|
|
943
|
+
"aria-disabled": !k(t),
|
|
944
|
+
"aria-selected": t === M.value,
|
|
945
|
+
"data-active": t === M.value,
|
|
928
946
|
"data-test": `slash-${t.command.name}`,
|
|
929
|
-
onMousemove: (e) =>
|
|
930
|
-
onClick: (e) =>
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
], 8, Ct)) : r("v-if", !0),
|
|
936
|
-
p.value.length > 0 ? (g(), i("div", At, [(g(!0), i(e, null, y(p.value, (e) => (g(), i("span", {
|
|
947
|
+
onMousemove: (e) => H(t),
|
|
948
|
+
onClick: (e) => U(t)
|
|
949
|
+
}, [a("span", Dt, [a("span", Ot, [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", kt, w(F(t)), 1)], 40, Et))), 128)),
|
|
950
|
+
E.value.length === 0 ? (g(), i("p", At, w(T(d).t("kvcoder.ui.slash.none")), 1)) : r("v-if", !0)
|
|
951
|
+
], 8, wt)) : r("v-if", !0),
|
|
952
|
+
p.value.length > 0 ? (g(), i("div", jt, [(g(!0), i(e, null, y(p.value, (e) => (g(), i("span", {
|
|
937
953
|
key: e.id,
|
|
938
954
|
class: "kvc-chip",
|
|
939
955
|
"data-test": "attachment"
|
|
@@ -946,17 +962,17 @@ var xt = { class: "kvc-composer" }, St = { class: "kvc-box" }, Ct = ["aria-label
|
|
|
946
962
|
},
|
|
947
963
|
"aria-label": T(d).t("kvcoder.ui.removeAttachment"),
|
|
948
964
|
onClick: (t) => p.value = p.value.filter((t) => t.id !== e.id)
|
|
949
|
-
}, [s(T(be), { size: 12 })], 8,
|
|
965
|
+
}, [s(T(be), { size: 12 })], 8, Mt)]))), 128))])) : r("v-if", !0),
|
|
950
966
|
A(a("textarea", {
|
|
951
967
|
"onUpdate:modelValue": n[0] ||= (e) => f.value = e,
|
|
952
968
|
placeholder: l.placeholder,
|
|
953
969
|
"aria-label": l.placeholder,
|
|
954
970
|
rows: "2",
|
|
955
971
|
"data-test": "composer-text",
|
|
956
|
-
onKeydown:
|
|
957
|
-
onPaste:
|
|
958
|
-
}, null, 40,
|
|
959
|
-
a("div",
|
|
972
|
+
onKeydown: W,
|
|
973
|
+
onPaste: R
|
|
974
|
+
}, null, 40, Nt), [[D, f.value]]),
|
|
975
|
+
a("div", Pt, [
|
|
960
976
|
a("input", {
|
|
961
977
|
ref_key: "picker",
|
|
962
978
|
ref: m,
|
|
@@ -964,7 +980,7 @@ var xt = { class: "kvc-composer" }, St = { class: "kvc-box" }, Ct = ["aria-label
|
|
|
964
980
|
multiple: "",
|
|
965
981
|
hidden: "",
|
|
966
982
|
"data-test": "composer-files",
|
|
967
|
-
onChange:
|
|
983
|
+
onChange: L
|
|
968
984
|
}, null, 544),
|
|
969
985
|
a("button", {
|
|
970
986
|
type: "button",
|
|
@@ -973,9 +989,9 @@ var xt = { class: "kvc-composer" }, St = { class: "kvc-box" }, Ct = ["aria-label
|
|
|
973
989
|
title: T(d).t("kvcoder.ui.attach"),
|
|
974
990
|
disabled: h.value,
|
|
975
991
|
onClick: n[1] ||= (e) => m.value?.click()
|
|
976
|
-
}, [s(T(me), { size: 16 })], 8,
|
|
992
|
+
}, [s(T(me), { size: 16 })], 8, Ft),
|
|
977
993
|
b(t.$slots, "controls"),
|
|
978
|
-
a("span",
|
|
994
|
+
a("span", It, w(T(d).t("kvcoder.ui.enterSends")), 1),
|
|
979
995
|
l.running ? (g(), i("button", {
|
|
980
996
|
key: 0,
|
|
981
997
|
type: "button",
|
|
@@ -989,15 +1005,15 @@ var xt = { class: "kvc-composer" }, St = { class: "kvc-box" }, Ct = ["aria-label
|
|
|
989
1005
|
"aria-label": T(d).t("kvcoder.ui.send"),
|
|
990
1006
|
disabled: f.value.trim() === "" || h.value || l.blocked === !0,
|
|
991
1007
|
"data-test": "send",
|
|
992
|
-
onClick:
|
|
993
|
-
}, [s(T(G), { size: 16 })], 8,
|
|
1008
|
+
onClick: B
|
|
1009
|
+
}, [s(T(G), { size: 16 })], 8, Lt)
|
|
994
1010
|
])
|
|
995
1011
|
])]));
|
|
996
1012
|
}
|
|
997
1013
|
});
|
|
998
1014
|
//#endregion
|
|
999
1015
|
//#region web/src/model-groups.ts
|
|
1000
|
-
function
|
|
1016
|
+
function zt(e, t, n) {
|
|
1001
1017
|
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();
|
|
1002
1018
|
for (let e of a) {
|
|
1003
1019
|
let t = o.get(e.provider) ?? {
|
|
@@ -1012,7 +1028,7 @@ function Rt(e, t, n) {
|
|
|
1012
1028
|
}
|
|
1013
1029
|
return [...o.values()].sort((e, t) => e.title.localeCompare(t.title));
|
|
1014
1030
|
}
|
|
1015
|
-
function
|
|
1031
|
+
function Bt(e, t) {
|
|
1016
1032
|
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) => ({
|
|
1017
1033
|
...e,
|
|
1018
1034
|
models: e.models.filter(r)
|
|
@@ -1023,38 +1039,38 @@ function zt(e, t) {
|
|
|
1023
1039
|
total: e.reduce((e, t) => e + t.models.length, 0)
|
|
1024
1040
|
};
|
|
1025
1041
|
}
|
|
1026
|
-
var
|
|
1042
|
+
var Vt = [
|
|
1027
1043
|
"off",
|
|
1028
1044
|
"minimal",
|
|
1029
1045
|
"low",
|
|
1030
1046
|
"medium",
|
|
1031
1047
|
"high"
|
|
1032
|
-
],
|
|
1048
|
+
], Ht = { class: "kvc-picker" }, Ut = [
|
|
1033
1049
|
"aria-expanded",
|
|
1034
1050
|
"aria-label",
|
|
1035
1051
|
"disabled"
|
|
1036
|
-
],
|
|
1052
|
+
], Wt = { class: "kvc-picker-label" }, Gt = ["onKeydown"], Kt = { class: "kvc-search" }, qt = [
|
|
1037
1053
|
"placeholder",
|
|
1038
1054
|
"aria-label",
|
|
1039
1055
|
"onKeydown"
|
|
1040
|
-
],
|
|
1056
|
+
], Jt = ["aria-label"], Yt = ["aria-selected", "data-active"], Xt = { class: "kvc-model-name" }, Zt = {
|
|
1041
1057
|
class: "kvc-group",
|
|
1042
1058
|
role: "presentation",
|
|
1043
1059
|
"data-test": "model-group"
|
|
1044
|
-
},
|
|
1060
|
+
}, Qt = [
|
|
1045
1061
|
"aria-selected",
|
|
1046
1062
|
"data-active",
|
|
1047
1063
|
"data-test",
|
|
1048
1064
|
"onClick",
|
|
1049
1065
|
"onMousemove"
|
|
1050
|
-
],
|
|
1066
|
+
], $t = { class: "kvc-model-name" }, en = {
|
|
1051
1067
|
key: 1,
|
|
1052
1068
|
class: "kvc-muted kvc-none",
|
|
1053
1069
|
"data-test": "model-none"
|
|
1054
|
-
},
|
|
1070
|
+
}, tn = {
|
|
1055
1071
|
class: "kvc-muted kvc-count",
|
|
1056
1072
|
"data-test": "model-count"
|
|
1057
|
-
},
|
|
1073
|
+
}, nn = 24, rn = /* @__PURE__ */ c({
|
|
1058
1074
|
__name: "ModelPicker",
|
|
1059
1075
|
props: {
|
|
1060
1076
|
groups: {},
|
|
@@ -1065,7 +1081,7 @@ var Bt = [
|
|
|
1065
1081
|
},
|
|
1066
1082
|
emits: ["pick", "none"],
|
|
1067
1083
|
setup(o, { emit: c }) {
|
|
1068
|
-
let l = o, u = c, f = J(), m = v(!1), h = v(""), _ = v(0), b = E("trigger"), x = E("search"), S = E("panel"), C = t(() =>
|
|
1084
|
+
let l = o, u = c, f = J(), m = v(!1), h = v(""), _ = v(0), b = E("trigger"), x = E("search"), S = E("panel"), C = t(() => Bt(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) => {
|
|
1069
1085
|
let t = k.value.findIndex((t) => t.id === e);
|
|
1070
1086
|
return t < 0 ? -1 : t + F.value;
|
|
1071
1087
|
};
|
|
@@ -1079,7 +1095,7 @@ var Bt = [
|
|
|
1079
1095
|
function H() {
|
|
1080
1096
|
let e = S.value, t = b.value?.closest(".kvc-conversation")?.getBoundingClientRect();
|
|
1081
1097
|
if (e === null || t === void 0) return;
|
|
1082
|
-
let n = e.getBoundingClientRect(), r = t.left +
|
|
1098
|
+
let n = e.getBoundingClientRect(), r = t.left + nn - (n.left - B), i = t.right - nn - (n.right - B), a = r > 0 ? r : i < 0 ? i : 0;
|
|
1083
1099
|
a !== B && (B = a, e.style.translate = `${a}px 0`);
|
|
1084
1100
|
}
|
|
1085
1101
|
function U() {
|
|
@@ -1094,20 +1110,20 @@ var Bt = [
|
|
|
1094
1110
|
function G(e) {
|
|
1095
1111
|
e !== void 0 && (u("pick", e), R());
|
|
1096
1112
|
}
|
|
1097
|
-
function
|
|
1113
|
+
function K() {
|
|
1098
1114
|
u("none"), R();
|
|
1099
1115
|
}
|
|
1100
|
-
function
|
|
1101
|
-
P.value && _.value === 0 ?
|
|
1116
|
+
function te() {
|
|
1117
|
+
P.value && _.value === 0 ? K() : G(k.value[_.value - F.value]?.id);
|
|
1102
1118
|
}
|
|
1103
|
-
function
|
|
1119
|
+
function re(e) {
|
|
1104
1120
|
e.target instanceof Node && !b.value?.parentElement?.contains(e.target) && (m.value = !1);
|
|
1105
1121
|
}
|
|
1106
1122
|
return O(h, () => _.value = 0), O(m, (e) => {
|
|
1107
|
-
e ? (document.addEventListener("pointerdown",
|
|
1123
|
+
e ? (document.addEventListener("pointerdown", re), V = requestAnimationFrame(U)) : (document.removeEventListener("pointerdown", re), cancelAnimationFrame(V));
|
|
1108
1124
|
}), p(() => {
|
|
1109
|
-
document.removeEventListener("pointerdown",
|
|
1110
|
-
}), (t, o) => (g(), i("div",
|
|
1125
|
+
document.removeEventListener("pointerdown", re), cancelAnimationFrame(V);
|
|
1126
|
+
}), (t, o) => (g(), i("div", Ht, [a("button", {
|
|
1111
1127
|
ref_key: "trigger",
|
|
1112
1128
|
ref: b,
|
|
1113
1129
|
type: "button",
|
|
@@ -1118,10 +1134,10 @@ var Bt = [
|
|
|
1118
1134
|
disabled: l.disabled,
|
|
1119
1135
|
"data-test": "model-picker",
|
|
1120
1136
|
onClick: o[0] ||= (e) => m.value ? R() : z()
|
|
1121
|
-
}, [a("span",
|
|
1137
|
+
}, [a("span", Wt, w(N.value), 1), s(T(ne), {
|
|
1122
1138
|
size: 16,
|
|
1123
1139
|
"aria-hidden": "true"
|
|
1124
|
-
})], 8,
|
|
1140
|
+
})], 8, Ut), m.value ? (g(), i("div", {
|
|
1125
1141
|
key: 0,
|
|
1126
1142
|
ref_key: "panel",
|
|
1127
1143
|
ref: S,
|
|
@@ -1129,7 +1145,7 @@ var Bt = [
|
|
|
1129
1145
|
"data-test": "model-popover",
|
|
1130
1146
|
onKeydown: j(M(R, ["stop"]), ["esc"])
|
|
1131
1147
|
}, [
|
|
1132
|
-
a("label",
|
|
1148
|
+
a("label", Kt, [s(T(_e), {
|
|
1133
1149
|
size: 16,
|
|
1134
1150
|
"aria-hidden": "true"
|
|
1135
1151
|
}), A(a("input", {
|
|
@@ -1146,9 +1162,9 @@ var Bt = [
|
|
|
1146
1162
|
onKeydown: [
|
|
1147
1163
|
o[2] ||= j(M((e) => W(1), ["prevent"]), ["down"]),
|
|
1148
1164
|
o[3] ||= j(M((e) => W(-1), ["prevent"]), ["up"]),
|
|
1149
|
-
j(M(
|
|
1165
|
+
j(M(te, ["prevent"]), ["enter"])
|
|
1150
1166
|
]
|
|
1151
|
-
}, null, 40,
|
|
1167
|
+
}, null, 40, qt), [[D, h.value]])]),
|
|
1152
1168
|
a("div", {
|
|
1153
1169
|
id: "kvc-models",
|
|
1154
1170
|
class: "kvc-options",
|
|
@@ -1162,14 +1178,14 @@ var Bt = [
|
|
|
1162
1178
|
"aria-selected": l.current === null,
|
|
1163
1179
|
"data-active": _.value === 0,
|
|
1164
1180
|
"data-test": "model-none-entry",
|
|
1165
|
-
onClick:
|
|
1181
|
+
onClick: K,
|
|
1166
1182
|
onMousemove: o[4] ||= (e) => _.value = 0
|
|
1167
|
-
}, [a("span",
|
|
1183
|
+
}, [a("span", Xt, w(l.none), 1), l.current === null ? (g(), n(T(q), {
|
|
1168
1184
|
key: 0,
|
|
1169
1185
|
size: 16,
|
|
1170
1186
|
"aria-hidden": "true"
|
|
1171
|
-
})) : r("v-if", !0)], 40,
|
|
1172
|
-
(g(!0), i(e, null, y(C.value.groups, (t) => (g(), i(e, { key: t.provider }, [a("div",
|
|
1187
|
+
})) : r("v-if", !0)], 40, Yt)) : r("v-if", !0),
|
|
1188
|
+
(g(!0), i(e, null, y(C.value.groups, (t) => (g(), i(e, { key: t.provider }, [a("div", Zt, w(t.title), 1), (g(!0), i(e, null, y(t.models, (e) => (g(), i("div", {
|
|
1173
1189
|
key: e.id,
|
|
1174
1190
|
class: "kvc-model",
|
|
1175
1191
|
role: "option",
|
|
@@ -1178,20 +1194,20 @@ var Bt = [
|
|
|
1178
1194
|
"data-test": `model-${e.id}`,
|
|
1179
1195
|
onClick: (t) => G(e.id),
|
|
1180
1196
|
onMousemove: (t) => _.value = L(e.id)
|
|
1181
|
-
}, [a("span",
|
|
1197
|
+
}, [a("span", $t, w(e.name), 1), e.id === l.current ? (g(), n(T(q), {
|
|
1182
1198
|
key: 0,
|
|
1183
1199
|
size: 16,
|
|
1184
1200
|
"aria-hidden": "true"
|
|
1185
|
-
})) : r("v-if", !0)], 40,
|
|
1186
|
-
C.value.shown === 0 ? (g(), i("p",
|
|
1187
|
-
], 8,
|
|
1188
|
-
a("p",
|
|
1201
|
+
})) : r("v-if", !0)], 40, Qt))), 128))], 64))), 128)),
|
|
1202
|
+
C.value.shown === 0 ? (g(), i("p", en, w(T(f).t("kvcoder.ui.noModels")), 1)) : r("v-if", !0)
|
|
1203
|
+
], 8, Jt),
|
|
1204
|
+
a("p", tn, w(T(f).t("kvcoder.ui.modelsCount", {
|
|
1189
1205
|
shown: C.value.shown,
|
|
1190
1206
|
total: C.value.total
|
|
1191
1207
|
})), 1)
|
|
1192
|
-
], 40,
|
|
1208
|
+
], 40, Gt)) : r("v-if", !0)]));
|
|
1193
1209
|
}
|
|
1194
|
-
}),
|
|
1210
|
+
}), an = ["value", "aria-label"], on = ["value"], sn = /* @__PURE__ */ c({
|
|
1195
1211
|
__name: "ModelControls",
|
|
1196
1212
|
props: {
|
|
1197
1213
|
groups: {},
|
|
@@ -1201,8 +1217,8 @@ var Bt = [
|
|
|
1201
1217
|
},
|
|
1202
1218
|
emits: ["model", "thinking"],
|
|
1203
1219
|
setup(t, { emit: n }) {
|
|
1204
|
-
let r = t, o = n, c = J(), l = (e) =>
|
|
1205
|
-
return (t, n) => (g(), i(e, null, [s(
|
|
1220
|
+
let r = t, o = n, c = J(), l = (e) => Vt.find((t) => e.target instanceof HTMLSelectElement && t === e.target.value) ?? "medium";
|
|
1221
|
+
return (t, n) => (g(), i(e, null, [s(rn, {
|
|
1206
1222
|
groups: r.groups,
|
|
1207
1223
|
current: r.model,
|
|
1208
1224
|
empty: r.empty,
|
|
@@ -1217,15 +1233,15 @@ var Bt = [
|
|
|
1217
1233
|
"aria-label": T(c).t("kvcoder.ui.thinking"),
|
|
1218
1234
|
"data-test": "thinking-picker",
|
|
1219
1235
|
onChange: n[1] ||= (e) => o("thinking", l(e))
|
|
1220
|
-
}, [(g(!0), i(e, null, y(T(
|
|
1236
|
+
}, [(g(!0), i(e, null, y(T(Vt), (e) => (g(), i("option", {
|
|
1221
1237
|
key: e,
|
|
1222
1238
|
value: e
|
|
1223
|
-
}, w(T(c).t(`kvcoder.ui.thinkingLevels.${e}`)), 9,
|
|
1239
|
+
}, w(T(c).t(`kvcoder.ui.thinkingLevels.${e}`)), 9, on))), 128))], 40, an)], 64));
|
|
1224
1240
|
}
|
|
1225
1241
|
});
|
|
1226
1242
|
//#endregion
|
|
1227
1243
|
//#region web/src/remember-model.ts
|
|
1228
|
-
async function
|
|
1244
|
+
async function cn(e, t) {
|
|
1229
1245
|
try {
|
|
1230
1246
|
await e.exec("kernel.settings.set", {
|
|
1231
1247
|
key: "kvai.defaultModel",
|
|
@@ -1238,15 +1254,15 @@ async function sn(e, t) {
|
|
|
1238
1254
|
}
|
|
1239
1255
|
//#endregion
|
|
1240
1256
|
//#region web/src/use-chat-model.ts
|
|
1241
|
-
function
|
|
1257
|
+
function ln(e, t) {
|
|
1242
1258
|
let n = e.find((e) => e.key === t)?.value;
|
|
1243
1259
|
return typeof n == "string" && n !== "" ? n : null;
|
|
1244
1260
|
}
|
|
1245
|
-
function
|
|
1261
|
+
function un(e) {
|
|
1246
1262
|
let t = e.find((e) => e.key === "kvcoder.thinking")?.value;
|
|
1247
|
-
return
|
|
1263
|
+
return Vt.find((e) => e === t) ?? "medium";
|
|
1248
1264
|
}
|
|
1249
|
-
function
|
|
1265
|
+
function dn(e, n) {
|
|
1250
1266
|
let r = v([]), i = v([]), a = v(null), o = v(null), s = v("medium"), c = v(null), l = v(!1), u = v(!1);
|
|
1251
1267
|
m(async () => {
|
|
1252
1268
|
try {
|
|
@@ -1255,14 +1271,14 @@ function un(e, n) {
|
|
|
1255
1271
|
e.exec("kvai.provider.list", {}),
|
|
1256
1272
|
e.exec("kvai.model.list", {})
|
|
1257
1273
|
]);
|
|
1258
|
-
a.value =
|
|
1274
|
+
a.value = ln(t, "kvcoder.model") ?? ln(t, "kvai.defaultModel"), s.value = un(t), r.value = n, i.value = o;
|
|
1259
1275
|
} catch (e) {
|
|
1260
1276
|
u.value = !0, n(e);
|
|
1261
1277
|
} finally {
|
|
1262
1278
|
l.value = !0;
|
|
1263
1279
|
}
|
|
1264
1280
|
});
|
|
1265
|
-
let d = t(() => o.value ?? a.value), f = t(() => c.value ?? s.value), p = t(() =>
|
|
1281
|
+
let d = t(() => o.value ?? a.value), f = t(() => c.value ?? s.value), p = t(() => zt(r.value, i.value, d.value)), h = t(() => r.value.find((e) => e.id === i.value.find((e) => e.id === d.value)?.provider));
|
|
1266
1282
|
return {
|
|
1267
1283
|
current: d,
|
|
1268
1284
|
thinking: f,
|
|
@@ -1279,37 +1295,41 @@ function un(e, n) {
|
|
|
1279
1295
|
}
|
|
1280
1296
|
//#endregion
|
|
1281
1297
|
//#region web/src/ChatStart.vue?vue&type=script&setup=true&lang.ts
|
|
1282
|
-
var
|
|
1298
|
+
var fn = {
|
|
1283
1299
|
class: "kvc-start",
|
|
1284
1300
|
"data-test": "chat-start"
|
|
1285
|
-
},
|
|
1301
|
+
}, pn = {
|
|
1286
1302
|
key: 0,
|
|
1287
1303
|
class: "kvc-muted kvc-start-note",
|
|
1288
1304
|
role: "status",
|
|
1289
1305
|
"data-test": "key-needed"
|
|
1290
|
-
},
|
|
1306
|
+
}, mn = {
|
|
1291
1307
|
key: 1,
|
|
1292
1308
|
class: "kvc-muted kvc-start-note",
|
|
1293
1309
|
role: "status",
|
|
1294
1310
|
"data-test": "choose-model"
|
|
1295
|
-
},
|
|
1311
|
+
}, hn = {
|
|
1296
1312
|
key: 2,
|
|
1297
1313
|
class: "kvc-muted kvc-start-note"
|
|
1298
|
-
},
|
|
1314
|
+
}, gn = /* @__PURE__ */ c({
|
|
1299
1315
|
__name: "ChatStart",
|
|
1300
1316
|
props: { registered: {} },
|
|
1301
1317
|
setup(t) {
|
|
1302
|
-
let n = J(), r = t, c =
|
|
1318
|
+
let n = J(), r = t, c = dn(n, (e) => X(n, e));
|
|
1303
1319
|
async function l(e) {
|
|
1304
|
-
c.pickModel(e), await
|
|
1320
|
+
c.pickModel(e), await cn(n, e);
|
|
1305
1321
|
}
|
|
1306
|
-
async function u(
|
|
1322
|
+
async function u() {
|
|
1323
|
+
let { id: e } = await n.exec("kvcoder.session.create", {}), t = c.changes();
|
|
1324
|
+
return Object.keys(t).length > 0 && await n.exec("kvcoder.session.configure", {
|
|
1325
|
+
sessionId: e,
|
|
1326
|
+
...t
|
|
1327
|
+
}), e;
|
|
1328
|
+
}
|
|
1329
|
+
async function d(e) {
|
|
1307
1330
|
try {
|
|
1308
|
-
let
|
|
1309
|
-
|
|
1310
|
-
sessionId: t,
|
|
1311
|
-
...r
|
|
1312
|
-
}), await n.exec("kvcoder.message.send", {
|
|
1331
|
+
let t = await u();
|
|
1332
|
+
await n.exec("kvcoder.message.send", {
|
|
1313
1333
|
sessionId: t,
|
|
1314
1334
|
text: e.text,
|
|
1315
1335
|
...e.fileIds.length > 0 ? { fileIds: e.fileIds } : {}
|
|
@@ -1318,20 +1338,35 @@ var dn = {
|
|
|
1318
1338
|
X(n, e);
|
|
1319
1339
|
}
|
|
1320
1340
|
}
|
|
1321
|
-
|
|
1341
|
+
async function f(e, t) {
|
|
1342
|
+
try {
|
|
1343
|
+
let r = await u();
|
|
1344
|
+
await n.exec(e.command, {
|
|
1345
|
+
sessionId: r,
|
|
1346
|
+
argument: t
|
|
1347
|
+
}), e.message !== void 0 && await n.exec("kvcoder.message.send", {
|
|
1348
|
+
sessionId: r,
|
|
1349
|
+
text: t === "" ? n.t(e.message) : t
|
|
1350
|
+
}), n.navigate("kvcoder.session", { sessionId: r });
|
|
1351
|
+
} catch (e) {
|
|
1352
|
+
X(n, e);
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
return (t, u) => (g(), i(e, null, [a("div", fn, [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", pn, [o(w(T(n).t("kvcoder.ui.keyNeeded", { provider: T(c).provider.value.title })) + " ", 1), a("button", {
|
|
1322
1356
|
type: "button",
|
|
1323
1357
|
class: "kvc-link-button",
|
|
1324
1358
|
"data-test": "add-key",
|
|
1325
|
-
onClick:
|
|
1326
|
-
}, w(T(n).t("kvcoder.ui.addKey")), 1)])) : T(c).state.value === "noModel" ? (g(), i("p",
|
|
1359
|
+
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", mn, w(T(n).t("kvcoder.ui.chooseModelHint")), 1)) : (g(), i("p", hn, w(T(n).t("kvcoder.ui.startHint")), 1))]), s(Rt, {
|
|
1327
1361
|
running: !1,
|
|
1328
1362
|
placeholder: T(n).t("kvcoder.ui.startPlaceholder"),
|
|
1329
1363
|
blocked: T(c).state.value !== "ready",
|
|
1330
1364
|
commands: "wait",
|
|
1331
1365
|
registered: r.registered,
|
|
1332
|
-
onSend:
|
|
1366
|
+
onSend: d,
|
|
1367
|
+
onRegistered: f
|
|
1333
1368
|
}, {
|
|
1334
|
-
controls: k(() => [s(
|
|
1369
|
+
controls: k(() => [s(sn, {
|
|
1335
1370
|
groups: T(c).groups.value,
|
|
1336
1371
|
model: T(c).current.value,
|
|
1337
1372
|
thinking: T(c).thinking.value,
|
|
@@ -1355,23 +1390,23 @@ var dn = {
|
|
|
1355
1390
|
});
|
|
1356
1391
|
//#endregion
|
|
1357
1392
|
//#region web/src/use-now.ts
|
|
1358
|
-
function
|
|
1393
|
+
function _n() {
|
|
1359
1394
|
let e = v(Date.now()), t;
|
|
1360
1395
|
return m(() => t = setInterval(() => e.value = Date.now(), 1e3)), p(() => clearInterval(t)), e;
|
|
1361
1396
|
}
|
|
1362
1397
|
//#endregion
|
|
1363
1398
|
//#region web/src/CommandProgress.vue?vue&type=script&setup=true&lang.ts
|
|
1364
|
-
var
|
|
1399
|
+
var vn = ["data-command"], yn = { class: "kvc-activity-text" }, bn = {
|
|
1365
1400
|
style: { "font-weight": "500" },
|
|
1366
1401
|
"data-test": "command-title"
|
|
1367
|
-
},
|
|
1402
|
+
}, xn = {
|
|
1368
1403
|
class: "kvc-muted",
|
|
1369
1404
|
"data-test": "command-seconds"
|
|
1370
|
-
},
|
|
1405
|
+
}, Sn = /* @__PURE__ */ c({
|
|
1371
1406
|
__name: "CommandProgress",
|
|
1372
1407
|
props: { working: {} },
|
|
1373
1408
|
setup(e) {
|
|
1374
|
-
let n = e, r = J(), o =
|
|
1409
|
+
let n = e, r = J(), o = _n(), s = t(() => Math.max(0, Math.floor((o.value - n.working.startedAt) / 1e3)));
|
|
1375
1410
|
return (e, t) => (g(), i("div", {
|
|
1376
1411
|
class: "kvc-activity",
|
|
1377
1412
|
role: "status",
|
|
@@ -1383,19 +1418,19 @@ var _n = ["data-command"], vn = { class: "kvc-activity-text" }, yn = {
|
|
|
1383
1418
|
class: "kvc-spin",
|
|
1384
1419
|
"aria-hidden": "true"
|
|
1385
1420
|
}, null, -1),
|
|
1386
|
-
a("span",
|
|
1387
|
-
a("span",
|
|
1388
|
-
], 8,
|
|
1421
|
+
a("span", yn, [a("span", bn, w(T(r).t(`kvcoder.ui.working.${n.working.name}`)), 1)]),
|
|
1422
|
+
a("span", xn, w(T(r).t("kvcoder.ui.seconds", { count: s.value })), 1)
|
|
1423
|
+
], 8, vn));
|
|
1389
1424
|
}
|
|
1390
|
-
}),
|
|
1391
|
-
function
|
|
1425
|
+
}), Cn = 5;
|
|
1426
|
+
function wn(e, t) {
|
|
1392
1427
|
let n = Math.max(0, Math.floor(t / 1e3));
|
|
1393
1428
|
return n < 60 ? e("kvcoder.ui.seconds", { count: n }) : e("kvcoder.ui.jobs.minutes", {
|
|
1394
1429
|
minutes: Math.floor(n / 60),
|
|
1395
1430
|
seconds: n % 60
|
|
1396
1431
|
});
|
|
1397
1432
|
}
|
|
1398
|
-
function
|
|
1433
|
+
function Tn(e, n, r) {
|
|
1399
1434
|
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;
|
|
1400
1435
|
async function d() {
|
|
1401
1436
|
for (let t of Object.keys(a.value)) {
|
|
@@ -1440,7 +1475,7 @@ function wn(e, n, r) {
|
|
|
1440
1475
|
}
|
|
1441
1476
|
return O(() => c.value.length > 0 || r.value, (e) => {
|
|
1442
1477
|
clearInterval(u), u = void 0, e && (u = setInterval(() => {
|
|
1443
|
-
s.value = Date.now(), l += 1, l %
|
|
1478
|
+
s.value = Date.now(), l += 1, l % Cn === 0 && f();
|
|
1444
1479
|
}, 1e3));
|
|
1445
1480
|
}, { immediate: !0 }), p(() => clearInterval(u)), {
|
|
1446
1481
|
jobs: i,
|
|
@@ -1455,25 +1490,25 @@ function wn(e, n, r) {
|
|
|
1455
1490
|
}
|
|
1456
1491
|
//#endregion
|
|
1457
1492
|
//#region web/src/JobItem.vue?vue&type=script&setup=true&lang.ts
|
|
1458
|
-
var
|
|
1493
|
+
var En = ["data-test", "data-status"], Dn = { class: "kvc-job-head" }, On = {
|
|
1459
1494
|
class: "kvc-job-title kvc-oneline",
|
|
1460
1495
|
"data-test": "job-title"
|
|
1461
|
-
},
|
|
1496
|
+
}, kn = {
|
|
1462
1497
|
key: 0,
|
|
1463
1498
|
class: "kvc-muted",
|
|
1464
1499
|
"data-test": "job-time"
|
|
1465
|
-
},
|
|
1500
|
+
}, An = {
|
|
1466
1501
|
key: 1,
|
|
1467
1502
|
class: "kvc-chip",
|
|
1468
1503
|
"data-test": "job-status"
|
|
1469
|
-
},
|
|
1504
|
+
}, jn = {
|
|
1470
1505
|
key: 0,
|
|
1471
1506
|
class: "kvc-job-links"
|
|
1472
|
-
},
|
|
1507
|
+
}, Mn = ["href"], Nn = { class: "kvc-actions" }, Pn = ["aria-expanded", "data-test"], Fn = ["disabled", "data-test"], In = {
|
|
1473
1508
|
key: 1,
|
|
1474
1509
|
class: "kvc-output",
|
|
1475
1510
|
"data-test": "job-output"
|
|
1476
|
-
},
|
|
1511
|
+
}, Ln = /* @__PURE__ */ c({
|
|
1477
1512
|
__name: "JobItem",
|
|
1478
1513
|
props: {
|
|
1479
1514
|
job: {},
|
|
@@ -1489,51 +1524,51 @@ var Tn = ["data-test", "data-status"], En = { class: "kvc-job-head" }, Dn = {
|
|
|
1489
1524
|
"data-test": `job-${s.job.id}`,
|
|
1490
1525
|
"data-status": s.job.status
|
|
1491
1526
|
}, [
|
|
1492
|
-
a("div",
|
|
1493
|
-
s.job.links.length > 0 ? (g(), i("div",
|
|
1527
|
+
a("div", Dn, [a("span", On, w(s.job.title), 1), s.job.status === "running" ? (g(), i("span", kn, w(T(wn)(T(l).t, s.now - Date.parse(s.job.startedAt))), 1)) : (g(), i("span", An, [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)]))]),
|
|
1528
|
+
s.job.links.length > 0 ? (g(), i("div", jn, [(g(!0), i(e, null, y(s.job.links, (e) => (g(), i("a", {
|
|
1494
1529
|
key: e,
|
|
1495
1530
|
href: e,
|
|
1496
1531
|
target: "_blank",
|
|
1497
1532
|
rel: "noopener noreferrer",
|
|
1498
1533
|
class: "kvc-link kvc-mono",
|
|
1499
1534
|
"data-test": "job-link"
|
|
1500
|
-
}, w(e), 9,
|
|
1501
|
-
a("div",
|
|
1535
|
+
}, w(e), 9, Mn))), 128))])) : r("v-if", !0),
|
|
1536
|
+
a("div", Nn, [a("button", {
|
|
1502
1537
|
type: "button",
|
|
1503
1538
|
class: "kvc-button",
|
|
1504
1539
|
"aria-expanded": s.logs !== void 0,
|
|
1505
1540
|
"data-test": `job-logs-${s.job.id}`,
|
|
1506
1541
|
onClick: n[0] ||= (e) => c("logs")
|
|
1507
|
-
}, w(T(l).t("kvcoder.ui.jobs.logs")), 9,
|
|
1542
|
+
}, w(T(l).t("kvcoder.ui.jobs.logs")), 9, Pn), s.job.status === "running" ? (g(), i("button", {
|
|
1508
1543
|
key: 0,
|
|
1509
1544
|
type: "button",
|
|
1510
1545
|
class: "kvc-button kvc-primary",
|
|
1511
1546
|
disabled: s.stopping,
|
|
1512
1547
|
"data-test": `job-stop-${s.job.id}`,
|
|
1513
1548
|
onClick: n[1] ||= (e) => c("stop")
|
|
1514
|
-
}, w(T(l).t("kvcoder.ui.jobs.stop")), 9,
|
|
1515
|
-
s.logs === void 0 ? r("v-if", !0) : (g(), i("pre",
|
|
1516
|
-
], 8,
|
|
1549
|
+
}, w(T(l).t("kvcoder.ui.jobs.stop")), 9, Fn)) : r("v-if", !0)]),
|
|
1550
|
+
s.logs === void 0 ? r("v-if", !0) : (g(), i("pre", In, w(s.logs === "" ? T(l).t("kvcoder.ui.jobs.noOutput") : s.logs), 1))
|
|
1551
|
+
], 8, En));
|
|
1517
1552
|
}
|
|
1518
|
-
}),
|
|
1553
|
+
}), Rn = {
|
|
1519
1554
|
key: 0,
|
|
1520
1555
|
class: "kvc-jobs",
|
|
1521
1556
|
"data-test": "jobs"
|
|
1522
|
-
},
|
|
1557
|
+
}, zn = ["aria-expanded"], Bn = ["aria-label", "onKeydown"], Vn = /* @__PURE__ */ c({
|
|
1523
1558
|
__name: "JobsChip",
|
|
1524
1559
|
props: {
|
|
1525
1560
|
sessionId: {},
|
|
1526
1561
|
stamp: {}
|
|
1527
1562
|
},
|
|
1528
1563
|
setup(t) {
|
|
1529
|
-
let c = t, l = J(), u = v(!1), d = E("trigger"), { jobs: f, running: h, logs: _, stopping: b, now: x, load: S, toggleLogs: C, stop: D } =
|
|
1564
|
+
let c = t, l = J(), u = v(!1), d = E("trigger"), { jobs: f, running: h, logs: _, stopping: b, now: x, load: S, toggleLogs: C, stop: D } = Tn(l, () => c.sessionId, u);
|
|
1530
1565
|
function k() {
|
|
1531
1566
|
u.value = !1, d.value?.focus();
|
|
1532
1567
|
}
|
|
1533
1568
|
function A(e) {
|
|
1534
1569
|
e.target instanceof Node && !d.value?.parentElement?.contains(e.target) && (u.value = !1);
|
|
1535
1570
|
}
|
|
1536
|
-
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",
|
|
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", Rn, [a("button", {
|
|
1537
1572
|
ref_key: "trigger",
|
|
1538
1573
|
ref: d,
|
|
1539
1574
|
type: "button",
|
|
@@ -1548,18 +1583,18 @@ var Tn = ["data-test", "data-status"], En = { class: "kvc-job-head" }, Dn = {
|
|
|
1548
1583
|
"aria-hidden": "true"
|
|
1549
1584
|
}, null, -1),
|
|
1550
1585
|
o(w(T(l).t("kvcoder.ui.jobs.running", { count: T(h).length })), 1),
|
|
1551
|
-
s(T(
|
|
1586
|
+
s(T(ne), {
|
|
1552
1587
|
size: 16,
|
|
1553
1588
|
"aria-hidden": "true"
|
|
1554
1589
|
})
|
|
1555
|
-
], 8,
|
|
1590
|
+
], 8, zn), u.value ? (g(), i("div", {
|
|
1556
1591
|
key: 0,
|
|
1557
1592
|
class: "kvc-popover kvc-jobs-panel",
|
|
1558
1593
|
role: "dialog",
|
|
1559
1594
|
"aria-label": T(l).t("kvcoder.ui.jobs.title"),
|
|
1560
1595
|
"data-test": "jobs-popover",
|
|
1561
1596
|
onKeydown: j(M(k, ["stop"]), ["esc"])
|
|
1562
|
-
}, [(g(!0), i(e, null, y(T(f), (e) => (g(), n(
|
|
1597
|
+
}, [(g(!0), i(e, null, y(T(f), (e) => (g(), n(Ln, {
|
|
1563
1598
|
key: e.id,
|
|
1564
1599
|
job: e,
|
|
1565
1600
|
now: T(x),
|
|
@@ -1574,12 +1609,12 @@ var Tn = ["data-test", "data-status"], En = { class: "kvc-job-head" }, Dn = {
|
|
|
1574
1609
|
"stopping",
|
|
1575
1610
|
"onStop",
|
|
1576
1611
|
"onLogs"
|
|
1577
|
-
]))), 128))], 40,
|
|
1612
|
+
]))), 128))], 40, Bn)) : r("v-if", !0)])) : r("v-if", !0);
|
|
1578
1613
|
}
|
|
1579
1614
|
});
|
|
1580
1615
|
//#endregion
|
|
1581
1616
|
//#region web/src/use-dismiss.ts
|
|
1582
|
-
function
|
|
1617
|
+
function Hn(e, t, n) {
|
|
1583
1618
|
let r = (e) => {
|
|
1584
1619
|
e.target instanceof Node && t()?.contains(e.target) !== !0 && n();
|
|
1585
1620
|
}, i = (e) => {
|
|
@@ -1593,27 +1628,32 @@ function Vn(e, t, n) {
|
|
|
1593
1628
|
}
|
|
1594
1629
|
//#endregion
|
|
1595
1630
|
//#region web/src/ConversationHeader.vue?vue&type=script&setup=true&lang.ts
|
|
1596
|
-
var
|
|
1631
|
+
var Un = { class: "kvc-header" }, Wn = { class: "kvc-title" }, Gn = ["aria-label"], Kn = {
|
|
1597
1632
|
key: 1,
|
|
1598
1633
|
"data-test": "session-title"
|
|
1599
|
-
},
|
|
1634
|
+
}, qn = {
|
|
1600
1635
|
class: "kvc-muted",
|
|
1601
1636
|
"data-test": "session-totals"
|
|
1602
|
-
},
|
|
1637
|
+
}, Jn = {
|
|
1638
|
+
key: 2,
|
|
1639
|
+
class: "kvc-muted",
|
|
1640
|
+
"data-test": "session-context"
|
|
1641
|
+
}, Yn = [
|
|
1603
1642
|
"aria-pressed",
|
|
1604
1643
|
"aria-label",
|
|
1605
1644
|
"title"
|
|
1606
|
-
],
|
|
1645
|
+
], Xn = ["aria-label", "aria-expanded"], Zn = {
|
|
1607
1646
|
key: 0,
|
|
1608
1647
|
class: "kvc-menu",
|
|
1609
1648
|
role: "menu",
|
|
1610
1649
|
"data-test": "chat-menu-items"
|
|
1611
|
-
},
|
|
1650
|
+
}, Qn = ["disabled"], $n = ["disabled"], er = ["disabled"], tr = ["disabled"], nr = ["aria-label"], rr = { style: { padding: "6px" } }, ir = { class: "kvc-actions" }, ar = /* @__PURE__ */ c({
|
|
1612
1651
|
__name: "ConversationHeader",
|
|
1613
1652
|
props: {
|
|
1614
1653
|
session: {},
|
|
1615
1654
|
tab: {},
|
|
1616
1655
|
turns: {},
|
|
1656
|
+
context: { default: null },
|
|
1617
1657
|
runningSince: { default: void 0 },
|
|
1618
1658
|
artifacts: { default: 0 },
|
|
1619
1659
|
artifactsOpen: {
|
|
@@ -1631,30 +1671,34 @@ var Hn = { class: "kvc-header" }, Un = { class: "kvc-title" }, Wn = ["aria-label
|
|
|
1631
1671
|
"toggleArtifacts"
|
|
1632
1672
|
],
|
|
1633
1673
|
setup(e, { emit: n }) {
|
|
1634
|
-
let c = e, l = n, u = J(), d = v(!1), f = v(null), p = v(!1), m = E("more"), h =
|
|
1635
|
-
function
|
|
1674
|
+
let c = e, l = n, u = J(), d = v(!1), f = v(null), p = v(!1), m = E("more"), h = _n(), _ = t(() => c.runningSince === void 0 ? 0 : Math.max(0, h.value - Date.parse(c.runningSince))), y = t(() => `${u.t("kvcoder.ui.turns", { count: c.turns })} · ${qe(u.t, c.session.usage, c.session.durationMs + _.value)}`), b = t(() => Je(u.t, c.context)), x = t(() => u.t("kvcoder.ui.artifacts.toggle", { count: c.artifacts }));
|
|
1675
|
+
function S() {
|
|
1636
1676
|
d.value = !1, p.value = !1;
|
|
1637
1677
|
}
|
|
1638
|
-
|
|
1639
|
-
function
|
|
1640
|
-
|
|
1678
|
+
Hn(() => d.value || p.value, () => m.value, S);
|
|
1679
|
+
function C(e) {
|
|
1680
|
+
S(), e();
|
|
1641
1681
|
}
|
|
1642
|
-
function
|
|
1682
|
+
function O() {
|
|
1643
1683
|
let e = f.value ?? "";
|
|
1644
1684
|
f.value = null, l("action", "rename", e);
|
|
1645
1685
|
}
|
|
1646
|
-
return (e, t) => (g(), i("header",
|
|
1647
|
-
a("div",
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1686
|
+
return (e, t) => (g(), i("header", Un, [
|
|
1687
|
+
a("div", Wn, [
|
|
1688
|
+
f.value === null ? (g(), i("strong", Kn, w(T(Pe)(T(u).t, c.session.title)), 1)) : (g(), i("form", {
|
|
1689
|
+
key: 0,
|
|
1690
|
+
onSubmit: M(O, ["prevent"])
|
|
1691
|
+
}, [A(a("input", {
|
|
1692
|
+
"onUpdate:modelValue": t[0] ||= (e) => f.value = e,
|
|
1693
|
+
class: "kvc-field",
|
|
1694
|
+
"aria-label": T(u).t("kvcoder.ui.rename"),
|
|
1695
|
+
"data-test": "rename-input",
|
|
1696
|
+
onBlur: O
|
|
1697
|
+
}, null, 40, Gn), [[D, f.value]])], 32)),
|
|
1698
|
+
a("span", qn, w(y.value), 1),
|
|
1699
|
+
b.value === void 0 ? r("v-if", !0) : (g(), i("span", Jn, w(b.value), 1))
|
|
1700
|
+
]),
|
|
1701
|
+
s(Vn, {
|
|
1658
1702
|
"session-id": c.session.id,
|
|
1659
1703
|
stamp: c.session.updatedAt
|
|
1660
1704
|
}, null, 8, ["session-id", "stamp"]),
|
|
@@ -1663,14 +1707,14 @@ var Hn = { class: "kvc-header" }, Un = { class: "kvc-title" }, Wn = ["aria-label
|
|
|
1663
1707
|
type: "button",
|
|
1664
1708
|
class: "kvc-button",
|
|
1665
1709
|
"aria-pressed": c.artifactsOpen,
|
|
1666
|
-
"aria-label":
|
|
1667
|
-
title:
|
|
1710
|
+
"aria-label": x.value,
|
|
1711
|
+
title: x.value,
|
|
1668
1712
|
"data-test": "artifacts-toggle",
|
|
1669
1713
|
onClick: t[1] ||= (e) => l("toggleArtifacts")
|
|
1670
1714
|
}, [s(T(pe), {
|
|
1671
1715
|
size: 16,
|
|
1672
1716
|
"aria-hidden": "true"
|
|
1673
|
-
}), o(w(c.artifacts), 1)], 8,
|
|
1717
|
+
}), o(w(c.artifacts), 1)], 8, Yn)) : r("v-if", !0),
|
|
1674
1718
|
a("div", {
|
|
1675
1719
|
ref_key: "more",
|
|
1676
1720
|
ref: m,
|
|
@@ -1685,46 +1729,46 @@ var Hn = { class: "kvc-header" }, Un = { class: "kvc-title" }, Wn = ["aria-label
|
|
|
1685
1729
|
onClick: t[2] ||= (e) => {
|
|
1686
1730
|
d.value = !d.value, p.value = !1;
|
|
1687
1731
|
}
|
|
1688
|
-
}, [s(T(ce), { size: 18 })], 8,
|
|
1689
|
-
d.value ? (g(), i("div",
|
|
1732
|
+
}, [s(T(ce), { size: 18 })], 8, Xn),
|
|
1733
|
+
d.value ? (g(), i("div", Zn, [
|
|
1690
1734
|
a("button", {
|
|
1691
1735
|
type: "button",
|
|
1692
1736
|
role: "menuitem",
|
|
1693
1737
|
class: "kvc-button kvc-ghost",
|
|
1694
1738
|
"data-test": "menu-rename",
|
|
1695
1739
|
disabled: c.working,
|
|
1696
|
-
onClick: t[3] ||= (e) =>
|
|
1697
|
-
}, w(T(u).t("kvcoder.ui.rename")), 9,
|
|
1740
|
+
onClick: t[3] ||= (e) => C(() => f.value = c.session.title)
|
|
1741
|
+
}, w(T(u).t("kvcoder.ui.rename")), 9, Qn),
|
|
1698
1742
|
a("button", {
|
|
1699
1743
|
type: "button",
|
|
1700
1744
|
role: "menuitem",
|
|
1701
1745
|
class: "kvc-button kvc-ghost",
|
|
1702
1746
|
"data-test": "menu-fork",
|
|
1703
1747
|
disabled: c.working,
|
|
1704
|
-
onClick: t[4] ||= (e) =>
|
|
1705
|
-
}, w(T(u).t("kvcoder.ui.fork")), 9,
|
|
1748
|
+
onClick: t[4] ||= (e) => C(() => l("action", "fork", ""))
|
|
1749
|
+
}, w(T(u).t("kvcoder.ui.fork")), 9, $n),
|
|
1706
1750
|
a("button", {
|
|
1707
1751
|
type: "button",
|
|
1708
1752
|
role: "menuitem",
|
|
1709
1753
|
class: "kvc-button kvc-ghost",
|
|
1710
1754
|
"data-test": "menu-export",
|
|
1711
1755
|
disabled: c.working,
|
|
1712
|
-
onClick: t[5] ||= (e) =>
|
|
1713
|
-
}, w(T(u).t("kvcoder.ui.export")), 9,
|
|
1756
|
+
onClick: t[5] ||= (e) => C(() => l("action", "export", ""))
|
|
1757
|
+
}, w(T(u).t("kvcoder.ui.export")), 9, er),
|
|
1714
1758
|
a("button", {
|
|
1715
1759
|
type: "button",
|
|
1716
1760
|
role: "menuitem",
|
|
1717
1761
|
class: "kvc-button kvc-ghost",
|
|
1718
1762
|
"data-test": "menu-compact",
|
|
1719
1763
|
disabled: c.working,
|
|
1720
|
-
onClick: t[6] ||= (e) =>
|
|
1721
|
-
}, w(T(u).t("kvcoder.ui.compact")), 9,
|
|
1764
|
+
onClick: t[6] ||= (e) => C(() => l("action", "compact", ""))
|
|
1765
|
+
}, w(T(u).t("kvcoder.ui.compact")), 9, tr),
|
|
1722
1766
|
a("button", {
|
|
1723
1767
|
type: "button",
|
|
1724
1768
|
role: "menuitem",
|
|
1725
1769
|
class: "kvc-button kvc-ghost",
|
|
1726
1770
|
"data-test": "menu-prompt",
|
|
1727
|
-
onClick: t[7] ||= (e) =>
|
|
1771
|
+
onClick: t[7] ||= (e) => C(() => l("tab", c.tab === "prompt" ? "chat" : "prompt"))
|
|
1728
1772
|
}, w(T(u).t(c.tab === "prompt" ? "kvcoder.ui.showChat" : "kvcoder.ui.showPrompt")), 1),
|
|
1729
1773
|
a("button", {
|
|
1730
1774
|
type: "button",
|
|
@@ -1742,7 +1786,7 @@ var Hn = { class: "kvc-header" }, Un = { class: "kvc-title" }, Wn = ["aria-label
|
|
|
1742
1786
|
role: "alertdialog",
|
|
1743
1787
|
"aria-label": T(u).t("kvcoder.ui.deleteConfirm"),
|
|
1744
1788
|
"data-test": "delete-confirm"
|
|
1745
|
-
}, [a("span",
|
|
1789
|
+
}, [a("span", rr, w(T(u).t("kvcoder.ui.deleteConfirm")), 1), a("div", ir, [a("button", {
|
|
1746
1790
|
type: "button",
|
|
1747
1791
|
class: "kvc-button",
|
|
1748
1792
|
onClick: t[9] ||= (e) => p.value = !1
|
|
@@ -1750,25 +1794,25 @@ var Hn = { class: "kvc-header" }, Un = { class: "kvc-title" }, Wn = ["aria-label
|
|
|
1750
1794
|
type: "button",
|
|
1751
1795
|
class: "kvc-button kvc-primary",
|
|
1752
1796
|
"data-test": "confirm-delete",
|
|
1753
|
-
onClick: t[10] ||= (e) =>
|
|
1754
|
-
}, w(T(u).t("kvcoder.ui.delete")), 1)])], 8,
|
|
1797
|
+
onClick: t[10] ||= (e) => C(() => l("action", "delete", ""))
|
|
1798
|
+
}, w(T(u).t("kvcoder.ui.delete")), 1)])], 8, nr)) : r("v-if", !0)
|
|
1755
1799
|
], 512)
|
|
1756
1800
|
]));
|
|
1757
1801
|
}
|
|
1758
|
-
}),
|
|
1802
|
+
}), or = 200, sr = [
|
|
1759
1803
|
"text",
|
|
1760
1804
|
"choice",
|
|
1761
1805
|
"confirm"
|
|
1762
1806
|
];
|
|
1763
|
-
function
|
|
1807
|
+
function cr(e) {
|
|
1764
1808
|
return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
|
|
1765
1809
|
}
|
|
1766
1810
|
var Z = (e) => typeof e == "string" && e.trim() !== "" ? e : void 0;
|
|
1767
|
-
function
|
|
1811
|
+
function lr(e, t) {
|
|
1768
1812
|
let n = Z(t.args);
|
|
1769
1813
|
return Z(t.line) ?? (n === void 0 ? e : `${e} ${n}`);
|
|
1770
1814
|
}
|
|
1771
|
-
function
|
|
1815
|
+
function ur(e) {
|
|
1772
1816
|
let t = Z(e.title) ?? Z(e.description), n = Z(e.command);
|
|
1773
1817
|
return {
|
|
1774
1818
|
...t === void 0 ? {} : { description: t },
|
|
@@ -1778,8 +1822,8 @@ function cr(e) {
|
|
|
1778
1822
|
}
|
|
1779
1823
|
function Q(e) {
|
|
1780
1824
|
let t = Z(e.connector), n = Z(e.command);
|
|
1781
|
-
if (t === void 0) return
|
|
1782
|
-
let r = Z(e.description), i =
|
|
1825
|
+
if (t === void 0) return ur(e);
|
|
1826
|
+
let r = Z(e.description), i = cr(typeof e.payload == "string" ? void 0 : e.payload) ?? {}, a = n === "exec" ? { line: lr(t, i) } : Object.keys(i).length === 0 ? {} : { payload: JSON.stringify(i, null, 2) }, o = t === "ask" ? sr.find((e) => e === n) : void 0;
|
|
1783
1827
|
return {
|
|
1784
1828
|
...r === void 0 ? {} : { description: r },
|
|
1785
1829
|
...n === void 0 ? {} : { label: `${t} · ${n}` },
|
|
@@ -1791,13 +1835,13 @@ function Q(e) {
|
|
|
1791
1835
|
} }
|
|
1792
1836
|
};
|
|
1793
1837
|
}
|
|
1794
|
-
function
|
|
1838
|
+
function dr(e) {
|
|
1795
1839
|
let t = e.replace(/\s+/g, " ");
|
|
1796
|
-
return t.length >
|
|
1840
|
+
return t.length > or ? `${t.slice(0, or)}…` : t;
|
|
1797
1841
|
}
|
|
1798
1842
|
//#endregion
|
|
1799
1843
|
//#region web/src/live-step.ts
|
|
1800
|
-
var
|
|
1844
|
+
var fr = () => ({
|
|
1801
1845
|
text: "",
|
|
1802
1846
|
thinking: "",
|
|
1803
1847
|
summarizing: !1,
|
|
@@ -1805,15 +1849,15 @@ var ur = () => ({
|
|
|
1805
1849
|
retry: null,
|
|
1806
1850
|
startedAt: Date.now()
|
|
1807
1851
|
});
|
|
1808
|
-
function
|
|
1852
|
+
function pr(e) {
|
|
1809
1853
|
return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
|
|
1810
1854
|
}
|
|
1811
|
-
function
|
|
1855
|
+
function mr(e) {
|
|
1812
1856
|
let t = e.calls.at(-1);
|
|
1813
1857
|
return t === void 0 ? e.text === "" ? e.thinking === "" ? e.retry === null ? "waiting" : "retrying" : "thinking" : "writing" : t.complete ? "running" : "preparing";
|
|
1814
1858
|
}
|
|
1815
|
-
function
|
|
1816
|
-
let r =
|
|
1859
|
+
function hr(e, t, n) {
|
|
1860
|
+
let r = pr(t.arguments);
|
|
1817
1861
|
(r === void 0 || e.calls.length === 0) && e.calls.push({
|
|
1818
1862
|
name: n,
|
|
1819
1863
|
complete: !1
|
|
@@ -1823,10 +1867,10 @@ function pr(e, t, n) {
|
|
|
1823
1867
|
let a = Q(r);
|
|
1824
1868
|
a.description !== void 0 && (i.description = a.description), a.label !== void 0 && (i.label = a.label), i.complete = "payload" in r;
|
|
1825
1869
|
}
|
|
1826
|
-
function
|
|
1870
|
+
function gr(e, t) {
|
|
1827
1871
|
if (t.type !== "progress") return { kind: "none" };
|
|
1828
|
-
let n =
|
|
1829
|
-
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" &&
|
|
1872
|
+
let n = pr(t.data);
|
|
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" && hr(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 = {
|
|
1830
1874
|
attempt: n.attempt,
|
|
1831
1875
|
of: n.of
|
|
1832
1876
|
}), n.type === "follow" && typeof n.jobId == "string" ? {
|
|
@@ -1840,30 +1884,30 @@ function mr(e, t) {
|
|
|
1840
1884
|
}
|
|
1841
1885
|
//#endregion
|
|
1842
1886
|
//#region web/src/ActivityLine.vue?vue&type=script&setup=true&lang.ts
|
|
1843
|
-
var
|
|
1887
|
+
var _r = ["data-phase"], vr = { class: "kvc-activity-text" }, yr = {
|
|
1844
1888
|
style: { "font-weight": "600" },
|
|
1845
1889
|
"data-test": "activity-title"
|
|
1846
|
-
},
|
|
1890
|
+
}, br = {
|
|
1847
1891
|
key: 0,
|
|
1848
1892
|
class: "kvc-muted",
|
|
1849
1893
|
dir: "ltr",
|
|
1850
1894
|
"data-test": "activity-label"
|
|
1851
|
-
},
|
|
1895
|
+
}, xr = {
|
|
1852
1896
|
key: 1,
|
|
1853
1897
|
style: { "font-weight": "500" },
|
|
1854
1898
|
"data-test": "activity-title"
|
|
1855
|
-
},
|
|
1899
|
+
}, Sr = {
|
|
1856
1900
|
key: 0,
|
|
1857
1901
|
class: "kvc-muted",
|
|
1858
1902
|
"data-test": "activity-phase"
|
|
1859
|
-
},
|
|
1903
|
+
}, Cr = {
|
|
1860
1904
|
class: "kvc-muted",
|
|
1861
1905
|
"data-test": "activity-seconds"
|
|
1862
|
-
},
|
|
1906
|
+
}, wr = /* @__PURE__ */ c({
|
|
1863
1907
|
__name: "ActivityLine",
|
|
1864
1908
|
props: { live: {} },
|
|
1865
1909
|
setup(n) {
|
|
1866
|
-
let o = n, s = J(), c =
|
|
1910
|
+
let o = n, s = J(), c = _n(), l = t(() => mr(o.live)), u = t(() => Math.max(0, Math.floor((c.value - o.live.startedAt) / 1e3)));
|
|
1867
1911
|
return (t, n) => (g(), i("div", {
|
|
1868
1912
|
class: "kvc-activity",
|
|
1869
1913
|
role: "status",
|
|
@@ -1875,14 +1919,14 @@ var hr = ["data-phase"], gr = { class: "kvc-activity-text" }, _r = {
|
|
|
1875
1919
|
class: "kvc-spin",
|
|
1876
1920
|
"aria-hidden": "true"
|
|
1877
1921
|
}, null, -1),
|
|
1878
|
-
a("span",
|
|
1922
|
+
a("span", vr, [o.live.calls.length > 0 ? (g(!0), i(e, { key: 0 }, y(o.live.calls, (e, t) => (g(), i("span", {
|
|
1879
1923
|
key: t,
|
|
1880
1924
|
class: "kvc-activity-call",
|
|
1881
1925
|
"data-test": "activity-call"
|
|
1882
|
-
}, [a("span",
|
|
1883
|
-
o.live.calls.length > 0 ? (g(), i("span",
|
|
1884
|
-
a("span",
|
|
1885
|
-
], 8,
|
|
1926
|
+
}, [a("span", yr, w(e.description ?? T(s).t("kvcoder.ui.activity.preparing")), 1), e.label ? (g(), i("span", br, w(e.label), 1)) : r("v-if", !0)]))), 128)) : (g(), i("span", xr, w(T(s).t(`kvcoder.ui.activity.${l.value}`, o.live.retry ?? {})), 1))]),
|
|
1927
|
+
o.live.calls.length > 0 ? (g(), i("span", Sr, w(T(s).t(`kvcoder.ui.activity.${l.value}`)), 1)) : r("v-if", !0),
|
|
1928
|
+
a("span", Cr, w(T(s).t("kvcoder.ui.seconds", { count: u.value })), 1)
|
|
1929
|
+
], 8, _r));
|
|
1886
1930
|
}
|
|
1887
1931
|
});
|
|
1888
1932
|
//#endregion
|
|
@@ -1890,24 +1934,24 @@ var hr = ["data-phase"], gr = { class: "kvc-activity-text" }, _r = {
|
|
|
1890
1934
|
function $(e) {
|
|
1891
1935
|
return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
|
|
1892
1936
|
}
|
|
1893
|
-
function
|
|
1937
|
+
function Tr(e) {
|
|
1894
1938
|
return Array.isArray(e) ? e.flatMap((e) => {
|
|
1895
1939
|
let t = $(e);
|
|
1896
1940
|
return t === void 0 ? [] : [t];
|
|
1897
1941
|
}) : [];
|
|
1898
1942
|
}
|
|
1899
|
-
function
|
|
1900
|
-
return typeof e == "string" ? e :
|
|
1943
|
+
function Er(e) {
|
|
1944
|
+
return typeof e == "string" ? e : Tr(e).flatMap((e) => e.type === "text" && typeof e.text == "string" ? [e.text] : []).join("\n");
|
|
1901
1945
|
}
|
|
1902
|
-
function
|
|
1903
|
-
return
|
|
1946
|
+
function Dr(e) {
|
|
1947
|
+
return Tr(e.content.content).flatMap((e) => e.type === "thinking" && typeof e.thinking == "string" ? [e.thinking] : []).join("\n");
|
|
1904
1948
|
}
|
|
1905
|
-
function
|
|
1949
|
+
function Or(e) {
|
|
1906
1950
|
let t = /* @__PURE__ */ new Map();
|
|
1907
1951
|
for (let n of e) {
|
|
1908
1952
|
if (n.kind !== "assistant") continue;
|
|
1909
1953
|
let e = typeof n.durationMs == "number" ? { writtenMs: n.durationMs } : {};
|
|
1910
|
-
for (let r of
|
|
1954
|
+
for (let r of Tr(n.content.content)) {
|
|
1911
1955
|
let n = $(r.arguments);
|
|
1912
1956
|
r.type === "toolCall" && typeof r.id == "string" && n !== void 0 && t.set(r.id, {
|
|
1913
1957
|
...Q(n),
|
|
@@ -1917,7 +1961,7 @@ function Er(e) {
|
|
|
1917
1961
|
}
|
|
1918
1962
|
return t;
|
|
1919
1963
|
}
|
|
1920
|
-
function
|
|
1964
|
+
function kr(e, t) {
|
|
1921
1965
|
let { description: n, connector: r, command: i } = e;
|
|
1922
1966
|
return typeof r == "string" ? {
|
|
1923
1967
|
...t,
|
|
@@ -1929,41 +1973,41 @@ function Dr(e, t) {
|
|
|
1929
1973
|
...Q(e)
|
|
1930
1974
|
};
|
|
1931
1975
|
}
|
|
1932
|
-
function
|
|
1933
|
-
let n = $(e.content.details), r =
|
|
1976
|
+
function Ar(e, t) {
|
|
1977
|
+
let n = $(e.content.details), r = Er(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]);
|
|
1934
1978
|
return {
|
|
1935
|
-
...n === void 0 ? a :
|
|
1936
|
-
output: typeof n?.output == "string" ? n.output : r.replace(/\n?\[exit code \d+\]$/, ""),
|
|
1979
|
+
...n === void 0 ? a : kr(n, a),
|
|
1980
|
+
output: typeof n?.output == "string" ? n.output : n === void 0 ? r.replace(/\n?\[exit code \d+\]$/, "") : r,
|
|
1937
1981
|
failed: e.content.isError === !0 || o !== void 0 && o !== 0,
|
|
1938
1982
|
...typeof n?.durationMs == "number" ? { durationMs: n.durationMs } : {}
|
|
1939
1983
|
};
|
|
1940
1984
|
}
|
|
1941
|
-
var
|
|
1942
|
-
function
|
|
1943
|
-
if (e ===
|
|
1985
|
+
var jr = "dismissed by the user";
|
|
1986
|
+
function Mr(e) {
|
|
1987
|
+
if (e === jr) return { dismissed: !0 };
|
|
1944
1988
|
try {
|
|
1945
1989
|
return $(JSON.parse(e));
|
|
1946
1990
|
} catch {
|
|
1947
1991
|
return;
|
|
1948
1992
|
}
|
|
1949
1993
|
}
|
|
1950
|
-
function
|
|
1994
|
+
function Nr(e, t) {
|
|
1951
1995
|
if (e.kind !== "toolResult" || e.content.isError === !0) return;
|
|
1952
1996
|
let n = t.get(String(e.content.toolCallId))?.ask;
|
|
1953
1997
|
if (n === void 0) return;
|
|
1954
|
-
let r =
|
|
1998
|
+
let r = Mr(Er(e.content.content));
|
|
1955
1999
|
return r === void 0 ? void 0 : {
|
|
1956
2000
|
...n,
|
|
1957
2001
|
answer: r
|
|
1958
2002
|
};
|
|
1959
2003
|
}
|
|
1960
|
-
function
|
|
2004
|
+
function Pr(e) {
|
|
1961
2005
|
return e.kind === "user" && e.source?.kind === "extension" && e.source.name === "@kvman/kvcoder";
|
|
1962
2006
|
}
|
|
1963
|
-
function
|
|
2007
|
+
function Fr(e) {
|
|
1964
2008
|
return e.kind === "user" && (e.source?.kind === "job" || e.source?.kind === "subagent");
|
|
1965
2009
|
}
|
|
1966
|
-
function
|
|
2010
|
+
function Ir(e) {
|
|
1967
2011
|
if (e.kind !== "toolResult") return;
|
|
1968
2012
|
let t = $(e.content.details);
|
|
1969
2013
|
if (t === void 0) return;
|
|
@@ -1979,7 +2023,7 @@ function Pr(e) {
|
|
|
1979
2023
|
}
|
|
1980
2024
|
//#endregion
|
|
1981
2025
|
//#region web/src/question-options.ts
|
|
1982
|
-
function
|
|
2026
|
+
function Lr(e) {
|
|
1983
2027
|
return (Array.isArray(e.options) ? e.options : []).map((e) => {
|
|
1984
2028
|
let t = Y(e);
|
|
1985
2029
|
return {
|
|
@@ -1991,56 +2035,56 @@ function Fr(e) {
|
|
|
1991
2035
|
}
|
|
1992
2036
|
//#endregion
|
|
1993
2037
|
//#region web/src/AnsweredCard.vue?vue&type=script&setup=true&lang.ts
|
|
1994
|
-
var
|
|
2038
|
+
var Rr = ["aria-label"], zr = {
|
|
1995
2039
|
class: "kvc-card-row",
|
|
1996
2040
|
style: { "font-weight": "600" }
|
|
1997
|
-
},
|
|
2041
|
+
}, Br = {
|
|
1998
2042
|
dir: "auto",
|
|
1999
2043
|
"data-test": "answered-prompt"
|
|
2000
|
-
},
|
|
2044
|
+
}, Vr = { class: "kvc-card-body" }, Hr = {
|
|
2001
2045
|
key: 0,
|
|
2002
2046
|
class: "kvc-muted",
|
|
2003
2047
|
"data-test": "answered-skipped"
|
|
2004
|
-
},
|
|
2048
|
+
}, Ur = ["data-chosen", "data-test"], Wr = {
|
|
2005
2049
|
key: 1,
|
|
2006
2050
|
class: "kvc-answered-gap",
|
|
2007
2051
|
"aria-hidden": "true"
|
|
2008
|
-
},
|
|
2052
|
+
}, Gr = { style: {
|
|
2009
2053
|
display: "flex",
|
|
2010
2054
|
"flex-direction": "column"
|
|
2011
|
-
} },
|
|
2055
|
+
} }, Kr = { dir: "auto" }, qr = {
|
|
2012
2056
|
key: 0,
|
|
2013
2057
|
class: "kvc-muted",
|
|
2014
2058
|
dir: "auto"
|
|
2015
|
-
},
|
|
2059
|
+
}, Jr = {
|
|
2016
2060
|
key: 2,
|
|
2017
2061
|
class: "kvc-sr"
|
|
2018
|
-
},
|
|
2062
|
+
}, Yr = {
|
|
2019
2063
|
key: 0,
|
|
2020
2064
|
class: "kvc-answered-option",
|
|
2021
2065
|
"data-chosen": "true",
|
|
2022
2066
|
"data-test": "answered-other"
|
|
2023
|
-
},
|
|
2067
|
+
}, Xr = { style: {
|
|
2024
2068
|
display: "flex",
|
|
2025
2069
|
"flex-direction": "column"
|
|
2026
|
-
} },
|
|
2070
|
+
} }, Zr = { class: "kvc-muted" }, Qr = {
|
|
2027
2071
|
dir: "auto",
|
|
2028
2072
|
style: { "white-space": "pre-wrap" }
|
|
2029
|
-
},
|
|
2073
|
+
}, $r = {
|
|
2030
2074
|
key: 2,
|
|
2031
2075
|
class: "kvc-chip",
|
|
2032
2076
|
style: { "align-self": "flex-start" },
|
|
2033
2077
|
"data-test": "answered-confirmed"
|
|
2034
|
-
},
|
|
2078
|
+
}, ei = {
|
|
2035
2079
|
key: 3,
|
|
2036
2080
|
dir: "auto",
|
|
2037
2081
|
style: { "white-space": "pre-wrap" },
|
|
2038
2082
|
"data-test": "answered-text"
|
|
2039
|
-
},
|
|
2083
|
+
}, ti = /* @__PURE__ */ c({
|
|
2040
2084
|
__name: "AnsweredCard",
|
|
2041
2085
|
props: { answered: {} },
|
|
2042
2086
|
setup(o) {
|
|
2043
|
-
let c = o, l = J(), 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(() =>
|
|
2087
|
+
let c = o, l = J(), 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(() => Lr(c.answered.question).map((e) => ({
|
|
2044
2088
|
...e,
|
|
2045
2089
|
chosen: f.value.includes(e.id)
|
|
2046
2090
|
}))), m = t(() => typeof c.answered.answer.other == "string" ? c.answered.answer.other : ""), h = t(() => typeof c.answered.answer.text == "string" ? c.answered.answer.text : "");
|
|
@@ -2048,34 +2092,34 @@ var Ir = ["aria-label"], Lr = {
|
|
|
2048
2092
|
class: "kvc-card",
|
|
2049
2093
|
"data-test": "answered-card",
|
|
2050
2094
|
"aria-label": u.value
|
|
2051
|
-
}, [a("div",
|
|
2095
|
+
}, [a("div", zr, [s(T(ie), {
|
|
2052
2096
|
size: 18,
|
|
2053
2097
|
"aria-hidden": "true",
|
|
2054
2098
|
class: "kvc-ok"
|
|
2055
|
-
}), a("span",
|
|
2099
|
+
}), a("span", Br, w(u.value), 1)]), a("div", Vr, [d.value ? (g(), i("span", Hr, 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", {
|
|
2056
2100
|
key: e.id,
|
|
2057
2101
|
class: "kvc-answered-option",
|
|
2058
2102
|
"data-chosen": e.chosen,
|
|
2059
2103
|
"data-test": `answered-option-${e.id}`
|
|
2060
2104
|
}, [
|
|
2061
|
-
e.chosen ? (g(), n(T(
|
|
2105
|
+
e.chosen ? (g(), n(T(q), {
|
|
2062
2106
|
key: 0,
|
|
2063
2107
|
size: 16,
|
|
2064
2108
|
"aria-hidden": "true",
|
|
2065
2109
|
class: "kvc-ok"
|
|
2066
|
-
})) : (g(), i("span",
|
|
2067
|
-
a("span",
|
|
2068
|
-
e.chosen ? (g(), i("span",
|
|
2069
|
-
], 8,
|
|
2110
|
+
})) : (g(), i("span", Wr)),
|
|
2111
|
+
a("span", Gr, [a("span", Kr, w(e.label), 1), e.description ? (g(), i("span", qr, w(e.description), 1)) : r("v-if", !0)]),
|
|
2112
|
+
e.chosen ? (g(), i("span", Jr, w(T(l).t("kvcoder.ui.chosen")), 1)) : r("v-if", !0)
|
|
2113
|
+
], 8, Ur))), 128)), m.value === "" ? r("v-if", !0) : (g(), i("div", Yr, [s(T(q), {
|
|
2070
2114
|
size: 16,
|
|
2071
2115
|
"aria-hidden": "true",
|
|
2072
2116
|
class: "kvc-ok"
|
|
2073
|
-
}), a("span",
|
|
2117
|
+
}), a("span", Xr, [a("span", Zr, w(T(l).t("kvcoder.ui.other")), 1), a("span", Qr, w(m.value), 1)])]))], 64)) : c.answered.kind === "confirm" ? (g(), i("span", $r, w(T(l).t(c.answered.answer.confirmed === !0 ? "kvcoder.ui.yes" : "kvcoder.ui.no")), 1)) : (g(), i("span", ei, w(h.value), 1))])], 8, Rr));
|
|
2074
2118
|
}
|
|
2075
|
-
}),
|
|
2119
|
+
}), ni = {
|
|
2076
2120
|
class: "kvc-card kvc-card-row",
|
|
2077
2121
|
"data-test": "artifact-card"
|
|
2078
|
-
},
|
|
2122
|
+
}, ri = {
|
|
2079
2123
|
style: {
|
|
2080
2124
|
flex: "1 1 auto",
|
|
2081
2125
|
"min-inline-size": "0",
|
|
@@ -2084,13 +2128,13 @@ var Ir = ["aria-label"], Lr = {
|
|
|
2084
2128
|
"white-space": "nowrap"
|
|
2085
2129
|
},
|
|
2086
2130
|
"data-test": "artifact-card-title"
|
|
2087
|
-
},
|
|
2131
|
+
}, ii = {
|
|
2088
2132
|
class: "kvc-chip",
|
|
2089
2133
|
"data-test": "artifact-card-format"
|
|
2090
|
-
},
|
|
2134
|
+
}, ai = {
|
|
2091
2135
|
class: "kvc-muted",
|
|
2092
2136
|
"data-test": "artifact-card-version"
|
|
2093
|
-
},
|
|
2137
|
+
}, oi = /* @__PURE__ */ c({
|
|
2094
2138
|
__name: "ArtifactCard",
|
|
2095
2139
|
props: {
|
|
2096
2140
|
id: {},
|
|
@@ -2101,14 +2145,14 @@ var Ir = ["aria-label"], Lr = {
|
|
|
2101
2145
|
emits: ["open"],
|
|
2102
2146
|
setup(e, { emit: t }) {
|
|
2103
2147
|
let n = e, r = t, o = J();
|
|
2104
|
-
return (e, t) => (g(), i("div",
|
|
2148
|
+
return (e, t) => (g(), i("div", ni, [
|
|
2105
2149
|
s(T(pe), {
|
|
2106
2150
|
size: 16,
|
|
2107
2151
|
"aria-hidden": "true"
|
|
2108
2152
|
}),
|
|
2109
|
-
a("span",
|
|
2110
|
-
a("span",
|
|
2111
|
-
a("span",
|
|
2153
|
+
a("span", ri, w(n.title), 1),
|
|
2154
|
+
a("span", ii, w(T(o).t(`kvcoder.ui.artifacts.format.${n.format}`)), 1),
|
|
2155
|
+
a("span", ai, w(T(o).t("kvcoder.ui.artifacts.version", { version: n.version })), 1),
|
|
2112
2156
|
a("button", {
|
|
2113
2157
|
type: "button",
|
|
2114
2158
|
class: "kvc-button",
|
|
@@ -2120,7 +2164,7 @@ var Ir = ["aria-label"], Lr = {
|
|
|
2120
2164
|
});
|
|
2121
2165
|
//#endregion
|
|
2122
2166
|
//#region web/src/durations.ts
|
|
2123
|
-
function
|
|
2167
|
+
function si(e, t) {
|
|
2124
2168
|
if (t < 1e3) return e("kvcoder.ui.milliseconds", { count: Math.round(t) });
|
|
2125
2169
|
if (t < 1e4) return e("kvcoder.ui.seconds", { count: (t / 1e3).toFixed(1) });
|
|
2126
2170
|
let n = Math.round(t / 1e3);
|
|
@@ -2131,11 +2175,11 @@ function ai(e, t) {
|
|
|
2131
2175
|
}
|
|
2132
2176
|
//#endregion
|
|
2133
2177
|
//#region web/src/output-links.ts
|
|
2134
|
-
var
|
|
2135
|
-
function
|
|
2178
|
+
var ci = /http:\/\/(?:127\.0\.0\.1|localhost):\d+[^\s"'`<>()[\]{}]*/g, li = /[.,;:!?]+$/;
|
|
2179
|
+
function ui(e) {
|
|
2136
2180
|
let t = [], n = 0;
|
|
2137
|
-
for (let r of e.matchAll(
|
|
2138
|
-
let i = r[0].replace(
|
|
2181
|
+
for (let r of e.matchAll(ci)) {
|
|
2182
|
+
let i = r[0].replace(li, "");
|
|
2139
2183
|
r.index > n && t.push({
|
|
2140
2184
|
kind: "text",
|
|
2141
2185
|
text: e.slice(n, r.index)
|
|
@@ -2149,38 +2193,47 @@ function ci(e) {
|
|
|
2149
2193
|
text: e.slice(n)
|
|
2150
2194
|
}), t;
|
|
2151
2195
|
}
|
|
2196
|
+
function di(e) {
|
|
2197
|
+
if (!/^[[{]/.test(e) || e.includes("\n")) return e;
|
|
2198
|
+
try {
|
|
2199
|
+
return JSON.stringify(JSON.parse(e), null, 2);
|
|
2200
|
+
} catch (t) {
|
|
2201
|
+
if (t instanceof SyntaxError) return e;
|
|
2202
|
+
throw t;
|
|
2203
|
+
}
|
|
2204
|
+
}
|
|
2152
2205
|
//#endregion
|
|
2153
2206
|
//#region web/src/CallCard.vue?vue&type=script&setup=true&lang.ts
|
|
2154
|
-
var
|
|
2207
|
+
var fi = ["aria-expanded", "disabled"], pi = ["aria-label"], mi = { class: "kvc-lines" }, hi = {
|
|
2155
2208
|
key: 0,
|
|
2156
2209
|
style: { "font-weight": "600" },
|
|
2157
2210
|
"data-test": "call-description"
|
|
2158
|
-
},
|
|
2211
|
+
}, gi = {
|
|
2159
2212
|
key: 1,
|
|
2160
2213
|
class: "kvc-oneline",
|
|
2161
2214
|
"data-test": "call-line"
|
|
2162
|
-
},
|
|
2215
|
+
}, _i = { class: "kvc-mono" }, vi = {
|
|
2163
2216
|
key: 2,
|
|
2164
2217
|
class: "kvc-muted",
|
|
2165
2218
|
dir: "ltr",
|
|
2166
2219
|
style: { "align-self": "flex-start" },
|
|
2167
2220
|
"data-test": "call-label"
|
|
2168
|
-
},
|
|
2221
|
+
}, yi = {
|
|
2169
2222
|
key: 2,
|
|
2170
2223
|
class: "kvc-chip",
|
|
2171
2224
|
"data-test": "call-background"
|
|
2172
|
-
},
|
|
2225
|
+
}, bi = {
|
|
2173
2226
|
key: 3,
|
|
2174
2227
|
class: "kvc-chip kvc-danger",
|
|
2175
2228
|
"data-test": "call-failed"
|
|
2176
|
-
},
|
|
2229
|
+
}, xi = {
|
|
2177
2230
|
class: "kvc-muted",
|
|
2178
2231
|
"data-test": "call-time"
|
|
2179
|
-
},
|
|
2232
|
+
}, Si = {
|
|
2180
2233
|
key: 0,
|
|
2181
2234
|
class: "kvc-muted kvc-call-parts",
|
|
2182
2235
|
"data-test": "call-parts"
|
|
2183
|
-
},
|
|
2236
|
+
}, Ci = ["aria-label"], wi = ["aria-label"], Ti = ["href"], Ei = /* @__PURE__ */ c({
|
|
2184
2237
|
__name: "CallCard",
|
|
2185
2238
|
props: {
|
|
2186
2239
|
description: {},
|
|
@@ -2195,11 +2248,11 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
|
|
|
2195
2248
|
background: { type: Boolean }
|
|
2196
2249
|
},
|
|
2197
2250
|
setup(s) {
|
|
2198
|
-
let c = s, l = J(), u = v(!1), d = t(() =>
|
|
2251
|
+
let c = s, l = J(), u = v(!1), d = t(() => ui(di(c.output ?? ""))), p = t(() => c.durationMs === void 0 ? "" : si(l.t, (c.writtenMs ?? 0) + c.durationMs)), m = t(() => {
|
|
2199
2252
|
if (c.durationMs === void 0) return "";
|
|
2200
|
-
let e =
|
|
2253
|
+
let e = si(l.t, c.durationMs);
|
|
2201
2254
|
return c.writtenMs === void 0 ? l.t("kvcoder.ui.callRan", { ran: e }) : l.t("kvcoder.ui.callParts", {
|
|
2202
|
-
written:
|
|
2255
|
+
written: si(l.t, c.writtenMs),
|
|
2203
2256
|
ran: e
|
|
2204
2257
|
});
|
|
2205
2258
|
}), h = t(() => c.line ?? c.payload);
|
|
@@ -2221,24 +2274,24 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
|
|
|
2221
2274
|
key: 0,
|
|
2222
2275
|
class: "kvc-spin",
|
|
2223
2276
|
"aria-label": T(l).t("kvcoder.ui.running")
|
|
2224
|
-
}, null, 8,
|
|
2277
|
+
}, null, 8, pi)) : (g(), n(x(u.value ? T(ne) : T(re)), {
|
|
2225
2278
|
key: 1,
|
|
2226
2279
|
size: 16,
|
|
2227
2280
|
"aria-hidden": "true"
|
|
2228
2281
|
})),
|
|
2229
|
-
a("span",
|
|
2230
|
-
c.background ? (g(), i("span",
|
|
2231
|
-
c.failed ? (g(), i("span",
|
|
2232
|
-
a("span",
|
|
2233
|
-
], 8,
|
|
2234
|
-
m.value === "" ? r("v-if", !0) : (g(), i("p",
|
|
2282
|
+
a("span", mi, [c.description ? (g(), i("span", hi, w(c.description), 1)) : c.line ? (g(), i("span", gi, [a("span", _i, w(T(dr)(c.line)), 1)])) : r("v-if", !0), c.label ? (g(), i("span", vi, w(c.label), 1)) : r("v-if", !0)]),
|
|
2283
|
+
c.background ? (g(), i("span", yi, w(T(l).t("kvcoder.ui.jobs.background")), 1)) : r("v-if", !0),
|
|
2284
|
+
c.failed ? (g(), i("span", bi, w(T(l).t("kvcoder.ui.callFailed")), 1)) : r("v-if", !0),
|
|
2285
|
+
a("span", xi, w(p.value), 1)
|
|
2286
|
+
], 8, fi), u.value && c.output !== void 0 ? (g(), i(e, { key: 0 }, [
|
|
2287
|
+
m.value === "" ? r("v-if", !0) : (g(), i("p", Si, w(m.value), 1)),
|
|
2235
2288
|
h.value === void 0 ? r("v-if", !0) : (g(), i("pre", {
|
|
2236
2289
|
key: 1,
|
|
2237
2290
|
class: "kvc-output kvc-mono",
|
|
2238
2291
|
dir: "ltr",
|
|
2239
2292
|
"aria-label": T(l).t("kvcoder.ui.command"),
|
|
2240
2293
|
"data-test": "call-payload"
|
|
2241
|
-
}, w(h.value), 9,
|
|
2294
|
+
}, w(h.value), 9, Ci)),
|
|
2242
2295
|
c.output === "" ? r("v-if", !0) : (g(), i("pre", {
|
|
2243
2296
|
key: 2,
|
|
2244
2297
|
class: "kvc-output",
|
|
@@ -2251,53 +2304,53 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
|
|
|
2251
2304
|
target: "_blank",
|
|
2252
2305
|
rel: "noopener noreferrer",
|
|
2253
2306
|
class: "kvc-link"
|
|
2254
|
-
}, w(t.href), 9,
|
|
2307
|
+
}, w(t.href), 9, Ti)) : (g(), i(e, { key: 1 }, [o(w(t.text), 1)], 64))], 64))), 128))], 8, wi))
|
|
2255
2308
|
], 64)) : r("v-if", !0)], 2));
|
|
2256
2309
|
}
|
|
2257
|
-
}),
|
|
2310
|
+
}), Di = {
|
|
2258
2311
|
key: 0,
|
|
2259
2312
|
class: "kvc-card",
|
|
2260
2313
|
"data-test": "background-result"
|
|
2261
|
-
},
|
|
2314
|
+
}, Oi = { class: "kvc-card-row" }, ki = { class: "kvc-output" }, Ai = {
|
|
2262
2315
|
key: 1,
|
|
2263
2316
|
class: "kvc-card",
|
|
2264
2317
|
"data-test": "kvcoder-hint"
|
|
2265
|
-
},
|
|
2318
|
+
}, ji = { class: "kvc-card-row" }, Mi = { class: "kvc-card-body kvc-muted" }, Ni = {
|
|
2266
2319
|
key: 0,
|
|
2267
2320
|
style: {
|
|
2268
2321
|
display: "flex",
|
|
2269
2322
|
gap: "6px",
|
|
2270
2323
|
"margin-block-start": "6px"
|
|
2271
2324
|
}
|
|
2272
|
-
},
|
|
2325
|
+
}, Pi = ["src", "alt"], Fi = {
|
|
2273
2326
|
key: 1,
|
|
2274
2327
|
class: "kvc-muted",
|
|
2275
2328
|
style: { display: "block" },
|
|
2276
2329
|
"data-test": "queued"
|
|
2277
|
-
},
|
|
2330
|
+
}, Ii = {
|
|
2278
2331
|
key: 3,
|
|
2279
2332
|
class: "kvc-answer",
|
|
2280
2333
|
"data-test": "assistant-message"
|
|
2281
|
-
},
|
|
2334
|
+
}, Li = {
|
|
2282
2335
|
key: 0,
|
|
2283
2336
|
"data-test": "thinking"
|
|
2284
|
-
},
|
|
2337
|
+
}, Ri = { class: "kvc-muted" }, zi = {
|
|
2285
2338
|
class: "kvc-muted",
|
|
2286
2339
|
style: { "white-space": "pre-wrap" }
|
|
2287
|
-
},
|
|
2340
|
+
}, Bi = {
|
|
2288
2341
|
key: 7,
|
|
2289
2342
|
class: "kvc-notice",
|
|
2290
2343
|
"data-test": "notice"
|
|
2291
|
-
},
|
|
2344
|
+
}, Vi = {
|
|
2292
2345
|
key: 8,
|
|
2293
2346
|
class: "kvc-card kvc-card-row",
|
|
2294
2347
|
role: "note",
|
|
2295
2348
|
"data-test": "note"
|
|
2296
|
-
},
|
|
2349
|
+
}, Hi = {
|
|
2297
2350
|
key: 9,
|
|
2298
2351
|
class: "kvc-card",
|
|
2299
2352
|
"data-test": "summary"
|
|
2300
|
-
},
|
|
2353
|
+
}, Ui = { class: "kvc-card-row" }, Wi = { class: "kvc-card-body" }, Gi = /* @__PURE__ */ c({
|
|
2301
2354
|
__name: "MessageItem",
|
|
2302
2355
|
props: {
|
|
2303
2356
|
message: {},
|
|
@@ -2305,7 +2358,7 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
|
|
|
2305
2358
|
},
|
|
2306
2359
|
emits: ["openArtifact"],
|
|
2307
2360
|
setup(c, { emit: l }) {
|
|
2308
|
-
let u = c, d = l, p = J(), m = t(() =>
|
|
2361
|
+
let u = c, d = l, p = J(), m = t(() => Er(u.message.content.content)), h = t(() => Dr(u.message)), _ = t(() => Ar(u.message, u.calls)), v = t(() => Ir(u.message)), b = t(() => Nr(u.message, u.calls)), S = t(() => {
|
|
2309
2362
|
let e = Y(u.message.content.params), t = typeof e.code == "string" ? e.code : void 0, n = Object.fromEntries(Object.entries(Le(e.details)).map(([e, t]) => [e, Ge(t)])), r = t === void 0 ? {} : { error: p.t(Fe(t), n) }, i = Ve(e.details), a = String(u.message.content.code);
|
|
2310
2363
|
return p.t(`kvcoder.notices.${i === void 0 || a !== "STEP_FAILED" ? a : "STEP_FAILED_REASON"}`, {
|
|
2311
2364
|
...e,
|
|
@@ -2320,20 +2373,20 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
|
|
|
2320
2373
|
text: "kvcoder.markdown",
|
|
2321
2374
|
params: { text: e }
|
|
2322
2375
|
});
|
|
2323
|
-
return (t, c) => T(
|
|
2376
|
+
return (t, c) => T(Fr)(u.message) ? (g(), i("div", Di, [a("details", null, [a("summary", Oi, [s(T(K), {
|
|
2324
2377
|
size: 16,
|
|
2325
2378
|
"aria-hidden": "true"
|
|
2326
|
-
}), o(w(T(p).t(u.message.source?.kind === "subagent" ? "kvcoder.ui.helperFinished" : "kvcoder.ui.backgroundFinished")), 1)]), a("pre",
|
|
2379
|
+
}), o(w(T(p).t(u.message.source?.kind === "subagent" ? "kvcoder.ui.helperFinished" : "kvcoder.ui.backgroundFinished")), 1)]), a("pre", ki, w(m.value), 1)])])) : T(Pr)(u.message) ? (g(), i("div", Ai, [a("details", null, [a("summary", ji, [s(T(de), {
|
|
2327
2380
|
size: 16,
|
|
2328
2381
|
"aria-hidden": "true"
|
|
2329
|
-
}), o(w(T(p).t("kvcoder.ui.toModel")), 1)]), a("div",
|
|
2382
|
+
}), o(w(T(p).t("kvcoder.ui.toModel")), 1)]), a("div", Mi, w(m.value), 1)])])) : u.message.kind === "user" ? (g(), i("div", {
|
|
2330
2383
|
key: 2,
|
|
2331
2384
|
dir: "auto",
|
|
2332
2385
|
class: f(["kvc-user", { "kvc-queued": u.message.queued }]),
|
|
2333
2386
|
"data-test": "user-message"
|
|
2334
2387
|
}, [
|
|
2335
2388
|
a("span", null, w(m.value), 1),
|
|
2336
|
-
u.message.fileIds ? (g(), i("span",
|
|
2389
|
+
u.message.fileIds ? (g(), i("span", Ni, [(g(!0), i(e, null, y(u.message.fileIds, (e) => (g(), i("img", {
|
|
2337
2390
|
key: e,
|
|
2338
2391
|
src: E(e),
|
|
2339
2392
|
alt: T(p).t("kvcoder.ui.attachment"),
|
|
@@ -2341,12 +2394,12 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
|
|
|
2341
2394
|
"block-size": "48px",
|
|
2342
2395
|
"border-radius": "6px"
|
|
2343
2396
|
}
|
|
2344
|
-
}, null, 8,
|
|
2345
|
-
u.message.queued ? (g(), i("span",
|
|
2346
|
-
], 2)) : u.message.kind === "assistant" && (h.value !== "" || m.value !== "") ? (g(), i("div",
|
|
2397
|
+
}, null, 8, Pi))), 128))])) : r("v-if", !0),
|
|
2398
|
+
u.message.queued ? (g(), i("span", Fi, w(T(p).t("kvcoder.ui.queued")), 1)) : r("v-if", !0)
|
|
2399
|
+
], 2)) : u.message.kind === "assistant" && (h.value !== "" || m.value !== "") ? (g(), i("div", Ii, [h.value === "" ? r("v-if", !0) : (g(), i("details", Li, [a("summary", Ri, w(T(p).t("kvcoder.ui.thought")), 1), a("p", zi, w(h.value), 1)])), m.value === "" ? r("v-if", !0) : (g(), n(x(T(p).View), {
|
|
2347
2400
|
key: 1,
|
|
2348
2401
|
view: D(m.value)
|
|
2349
|
-
}, null, 8, ["view"]))])) : u.message.kind === "toolResult" && v.value !== void 0 ? (g(), n(
|
|
2402
|
+
}, null, 8, ["view"]))])) : u.message.kind === "toolResult" && v.value !== void 0 ? (g(), n(oi, {
|
|
2350
2403
|
key: 4,
|
|
2351
2404
|
id: v.value.id,
|
|
2352
2405
|
title: v.value.title,
|
|
@@ -2358,7 +2411,7 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
|
|
|
2358
2411
|
"title",
|
|
2359
2412
|
"format",
|
|
2360
2413
|
"version"
|
|
2361
|
-
])) : b.value === void 0 ? u.message.kind === "toolResult" ? (g(), n(
|
|
2414
|
+
])) : b.value === void 0 ? u.message.kind === "toolResult" ? (g(), n(Ei, {
|
|
2362
2415
|
key: 6,
|
|
2363
2416
|
description: _.value.description,
|
|
2364
2417
|
label: _.value.label,
|
|
@@ -2379,54 +2432,54 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
|
|
|
2379
2432
|
"written-ms",
|
|
2380
2433
|
"output",
|
|
2381
2434
|
"background"
|
|
2382
|
-
])) : u.message.kind === "notice" ? (g(), i("div",
|
|
2435
|
+
])) : u.message.kind === "notice" ? (g(), i("div", Bi, w(S.value), 1)) : u.message.kind === "note" ? (g(), i("div", Vi, [s(T(fe), {
|
|
2383
2436
|
size: 18,
|
|
2384
2437
|
"aria-hidden": "true"
|
|
2385
|
-
}), o(w(C.value), 1)])) : u.message.kind === "summary" ? (g(), i("details",
|
|
2438
|
+
}), o(w(C.value), 1)])) : u.message.kind === "summary" ? (g(), i("details", Hi, [a("summary", Ui, [s(T(ge), {
|
|
2386
2439
|
size: 16,
|
|
2387
2440
|
"aria-hidden": "true"
|
|
2388
|
-
}), o(w(T(p).t("kvcoder.ui.summarized")), 1)]), a("div",
|
|
2441
|
+
}), o(w(T(p).t("kvcoder.ui.summarized")), 1)]), a("div", Wi, [(g(), n(x(T(p).View), { view: D(String(u.message.content.text ?? "")) }, null, 8, ["view"]))])])) : r("v-if", !0) : (g(), n(ti, {
|
|
2389
2442
|
key: 5,
|
|
2390
2443
|
answered: b.value
|
|
2391
2444
|
}, null, 8, ["answered"]));
|
|
2392
2445
|
}
|
|
2393
|
-
}),
|
|
2446
|
+
}), Ki = {
|
|
2394
2447
|
class: "kvc-card kvc-ask",
|
|
2395
2448
|
"data-test": "approvals-card"
|
|
2396
|
-
},
|
|
2449
|
+
}, qi = {
|
|
2397
2450
|
class: "kvc-card-row",
|
|
2398
2451
|
style: { "font-weight": "600" }
|
|
2399
|
-
},
|
|
2452
|
+
}, Ji = ["data-test"], Yi = { style: {
|
|
2400
2453
|
display: "flex",
|
|
2401
2454
|
"flex-direction": "column",
|
|
2402
2455
|
flex: "1 1 auto",
|
|
2403
2456
|
gap: "2px",
|
|
2404
2457
|
"min-inline-size": "0"
|
|
2405
|
-
} },
|
|
2458
|
+
} }, Xi = {
|
|
2406
2459
|
key: 0,
|
|
2407
2460
|
style: { "font-weight": "600" },
|
|
2408
2461
|
"data-test": "call-description"
|
|
2409
|
-
},
|
|
2462
|
+
}, Zi = {
|
|
2410
2463
|
key: 1,
|
|
2411
2464
|
class: "kvc-muted",
|
|
2412
2465
|
dir: "ltr",
|
|
2413
2466
|
style: { "align-self": "flex-start" },
|
|
2414
2467
|
"data-test": "call-label"
|
|
2415
|
-
},
|
|
2468
|
+
}, Qi = {
|
|
2416
2469
|
key: 2,
|
|
2417
2470
|
dir: "ltr",
|
|
2418
2471
|
style: { "align-self": "flex-start" },
|
|
2419
2472
|
"data-test": "call-subject"
|
|
2420
|
-
},
|
|
2473
|
+
}, $i = {
|
|
2421
2474
|
key: 3,
|
|
2422
2475
|
class: "kvc-chip",
|
|
2423
2476
|
style: { "align-self": "flex-start" },
|
|
2424
2477
|
"data-test": "call-background"
|
|
2425
|
-
},
|
|
2478
|
+
}, ea = ["onClick"], ta = ["onClick"], na = {
|
|
2426
2479
|
key: 0,
|
|
2427
2480
|
class: "kvc-card-row kvc-actions",
|
|
2428
2481
|
style: { "border-block-start": "1px solid var(--kv-color-border)" }
|
|
2429
|
-
},
|
|
2482
|
+
}, ra = /* @__PURE__ */ c({
|
|
2430
2483
|
__name: "ApprovalsCard",
|
|
2431
2484
|
props: { approvals: {} },
|
|
2432
2485
|
emits: ["decide"],
|
|
@@ -2435,8 +2488,8 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
|
|
|
2435
2488
|
approvals: [...e],
|
|
2436
2489
|
confirmed: t
|
|
2437
2490
|
});
|
|
2438
|
-
return (t, n) => (g(), i("section",
|
|
2439
|
-
a("div",
|
|
2491
|
+
return (t, n) => (g(), i("section", Ki, [
|
|
2492
|
+
a("div", qi, [s(T(ve), {
|
|
2440
2493
|
size: 18,
|
|
2441
2494
|
"aria-hidden": "true"
|
|
2442
2495
|
}), o(w(T(u).t("kvcoder.ui.allowCommands", { count: c.approvals.length })), 1)]),
|
|
@@ -2446,26 +2499,26 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
|
|
|
2446
2499
|
style: { "border-block-start": "1px solid var(--kv-color-border)" },
|
|
2447
2500
|
"data-test": `approval-${e.questionId}`
|
|
2448
2501
|
}, [
|
|
2449
|
-
a("span",
|
|
2450
|
-
e.description ? (g(), i("span",
|
|
2451
|
-
e.label ? (g(), i("span",
|
|
2452
|
-
e.subject ? (g(), i("span",
|
|
2453
|
-
e.background ? (g(), i("span",
|
|
2502
|
+
a("span", Yi, [
|
|
2503
|
+
e.description ? (g(), i("span", Xi, w(e.description), 1)) : r("v-if", !0),
|
|
2504
|
+
e.label ? (g(), i("span", Zi, w(e.label), 1)) : r("v-if", !0),
|
|
2505
|
+
e.subject ? (g(), i("span", Qi, [a("span", { class: f(["kvc-mono", { "kvc-muted": e.description }]) }, w(e.subject), 3)])) : r("v-if", !0),
|
|
2506
|
+
e.background ? (g(), i("span", $i, w(T(u).t("kvcoder.ui.jobs.inBackground")), 1)) : r("v-if", !0)
|
|
2454
2507
|
]),
|
|
2455
2508
|
a("button", {
|
|
2456
2509
|
type: "button",
|
|
2457
2510
|
class: "kvc-button",
|
|
2458
2511
|
"data-test": "deny",
|
|
2459
2512
|
onClick: (t) => d([e], !1)
|
|
2460
|
-
}, w(T(u).t("kvcoder.ui.deny")), 9,
|
|
2513
|
+
}, w(T(u).t("kvcoder.ui.deny")), 9, ea),
|
|
2461
2514
|
a("button", {
|
|
2462
2515
|
type: "button",
|
|
2463
2516
|
class: "kvc-button kvc-primary",
|
|
2464
2517
|
"data-test": "allow",
|
|
2465
2518
|
onClick: (t) => d([e], !0)
|
|
2466
|
-
}, w(T(u).t("kvcoder.ui.allow")), 9,
|
|
2467
|
-
], 8,
|
|
2468
|
-
c.approvals.length > 1 ? (g(), i("div",
|
|
2519
|
+
}, w(T(u).t("kvcoder.ui.allow")), 9, ta)
|
|
2520
|
+
], 8, Ji))), 128)),
|
|
2521
|
+
c.approvals.length > 1 ? (g(), i("div", na, [a("button", {
|
|
2469
2522
|
type: "button",
|
|
2470
2523
|
class: "kvc-button",
|
|
2471
2524
|
"data-test": "deny-all",
|
|
@@ -2478,24 +2531,24 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
|
|
|
2478
2531
|
}, w(T(u).t("kvcoder.ui.allowAll")), 1)])) : r("v-if", !0)
|
|
2479
2532
|
]));
|
|
2480
2533
|
}
|
|
2481
|
-
}),
|
|
2534
|
+
}), ia = ["aria-label"], aa = {
|
|
2482
2535
|
class: "kvc-card-row",
|
|
2483
2536
|
style: { "font-weight": "600" }
|
|
2484
|
-
},
|
|
2537
|
+
}, oa = { dir: "auto" }, sa = { class: "kvc-card-body" }, ca = ["placeholder", "aria-label"], la = { class: "kvc-actions" }, ua = ["data-test"], da = [
|
|
2485
2538
|
"type",
|
|
2486
2539
|
"checked",
|
|
2487
2540
|
"name",
|
|
2488
2541
|
"onChange"
|
|
2489
|
-
],
|
|
2542
|
+
], fa = { style: {
|
|
2490
2543
|
display: "flex",
|
|
2491
2544
|
"flex-direction": "column"
|
|
2492
|
-
} },
|
|
2545
|
+
} }, pa = { style: { "font-weight": "500" } }, ma = {
|
|
2493
2546
|
key: 0,
|
|
2494
2547
|
class: "kvc-muted"
|
|
2495
|
-
},
|
|
2548
|
+
}, ha = ["placeholder", "aria-label"], ga = { class: "kvc-actions" }, _a = ["disabled"], va = {
|
|
2496
2549
|
key: 2,
|
|
2497
2550
|
class: "kvc-actions"
|
|
2498
|
-
},
|
|
2551
|
+
}, ya = /* @__PURE__ */ c({
|
|
2499
2552
|
__name: "QuestionCard",
|
|
2500
2553
|
props: {
|
|
2501
2554
|
questionId: {},
|
|
@@ -2503,7 +2556,7 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
|
|
|
2503
2556
|
},
|
|
2504
2557
|
emits: ["answer"],
|
|
2505
2558
|
setup(n, { emit: o }) {
|
|
2506
|
-
let c = n, l = o, u = J(), d = t(() => String(c.question.kind ?? "text")), p = t(() => String(c.question.prompt ?? "")), m = t(() =>
|
|
2559
|
+
let c = n, l = o, u = J(), d = t(() => String(c.question.kind ?? "text")), p = t(() => String(c.question.prompt ?? "")), m = t(() => Lr(c.question)), h = t(() => c.question.multiple === !0), _ = t(() => c.question.other === !0), b = v(""), x = v([]), S = v("");
|
|
2507
2560
|
function C(e) {
|
|
2508
2561
|
l("answer", {
|
|
2509
2562
|
questionId: c.questionId,
|
|
@@ -2524,10 +2577,10 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
|
|
|
2524
2577
|
class: "kvc-card kvc-ask",
|
|
2525
2578
|
"data-test": "question-card",
|
|
2526
2579
|
"aria-label": p.value
|
|
2527
|
-
}, [a("div",
|
|
2580
|
+
}, [a("div", aa, [s(T(ae), {
|
|
2528
2581
|
size: 18,
|
|
2529
2582
|
"aria-hidden": "true"
|
|
2530
|
-
}), a("span",
|
|
2583
|
+
}), a("span", oa, w(p.value), 1)]), a("div", sa, [d.value === "text" ? (g(), i(e, { key: 0 }, [A(a("input", {
|
|
2531
2584
|
"onUpdate:modelValue": n[0] ||= (e) => b.value = e,
|
|
2532
2585
|
class: "kvc-field",
|
|
2533
2586
|
dir: "auto",
|
|
@@ -2535,7 +2588,7 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
|
|
|
2535
2588
|
"aria-label": p.value,
|
|
2536
2589
|
"data-test": "answer-text",
|
|
2537
2590
|
onKeydown: n[1] ||= j(M((e) => C({ text: b.value }), ["prevent"]), ["enter"])
|
|
2538
|
-
}, null, 40,
|
|
2591
|
+
}, null, 40, ca), [[D, b.value]]), a("div", la, [a("button", {
|
|
2539
2592
|
type: "button",
|
|
2540
2593
|
class: "kvc-button",
|
|
2541
2594
|
"data-test": "skip",
|
|
@@ -2555,7 +2608,7 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
|
|
|
2555
2608
|
checked: x.value.includes(e.id),
|
|
2556
2609
|
name: c.questionId,
|
|
2557
2610
|
onChange: (t) => E(e.id)
|
|
2558
|
-
}, null, 40,
|
|
2611
|
+
}, null, 40, da), a("span", fa, [a("span", pa, w(e.label), 1), e.description ? (g(), i("span", ma, w(e.description), 1)) : r("v-if", !0)])], 8, ua))), 128)),
|
|
2559
2612
|
_.value ? A((g(), i("input", {
|
|
2560
2613
|
key: 0,
|
|
2561
2614
|
"onUpdate:modelValue": n[4] ||= (e) => S.value = e,
|
|
@@ -2563,8 +2616,8 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
|
|
|
2563
2616
|
placeholder: T(u).t("kvcoder.ui.other"),
|
|
2564
2617
|
"aria-label": T(u).t("kvcoder.ui.other"),
|
|
2565
2618
|
"data-test": "answer-other"
|
|
2566
|
-
}, null, 8,
|
|
2567
|
-
a("div",
|
|
2619
|
+
}, null, 8, ha)), [[D, S.value]]) : r("v-if", !0),
|
|
2620
|
+
a("div", ga, [a("button", {
|
|
2568
2621
|
type: "button",
|
|
2569
2622
|
class: "kvc-button",
|
|
2570
2623
|
"data-test": "skip",
|
|
@@ -2575,8 +2628,8 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
|
|
|
2575
2628
|
disabled: x.value.length === 0 && S.value.trim() === "",
|
|
2576
2629
|
"data-test": "answer",
|
|
2577
2630
|
onClick: O
|
|
2578
|
-
}, w(T(u).t("kvcoder.ui.answer")), 9,
|
|
2579
|
-
], 64)) : (g(), i("div",
|
|
2631
|
+
}, w(T(u).t("kvcoder.ui.answer")), 9, _a)])
|
|
2632
|
+
], 64)) : (g(), i("div", va, [a("button", {
|
|
2580
2633
|
type: "button",
|
|
2581
2634
|
class: "kvc-button",
|
|
2582
2635
|
"data-test": "answer-no",
|
|
@@ -2586,9 +2639,9 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
|
|
|
2586
2639
|
class: f(["kvc-button kvc-primary", { "kvc-danger": c.question.danger === !0 }]),
|
|
2587
2640
|
"data-test": "answer-yes",
|
|
2588
2641
|
onClick: n[7] ||= (e) => C({ confirmed: !0 })
|
|
2589
|
-
}, w(T(u).t("kvcoder.ui.yes")), 3)]))])], 8,
|
|
2642
|
+
}, w(T(u).t("kvcoder.ui.yes")), 3)]))])], 8, ia));
|
|
2590
2643
|
}
|
|
2591
|
-
}),
|
|
2644
|
+
}), ba = /* @__PURE__ */ c({
|
|
2592
2645
|
__name: "PendingCards",
|
|
2593
2646
|
props: {
|
|
2594
2647
|
pending: {},
|
|
@@ -2602,7 +2655,7 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
|
|
|
2602
2655
|
})));
|
|
2603
2656
|
function d(e) {
|
|
2604
2657
|
let t = Q(e), n = Y(e.payload);
|
|
2605
|
-
return t.line === void 0 ? typeof n.path == "string" ? n.path : t.payload === void 0 ? void 0 :
|
|
2658
|
+
return t.line === void 0 ? typeof n.path == "string" ? n.path : t.payload === void 0 ? void 0 : dr(t.payload) : t.line;
|
|
2606
2659
|
}
|
|
2607
2660
|
let f = t(() => s.pending.filter((e) => e.kind === "approval" && l(e)).map((e) => {
|
|
2608
2661
|
let t = Y(e.question), n = Q(t), r = d(t);
|
|
@@ -2614,12 +2667,12 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
|
|
|
2614
2667
|
...n.background === !0 ? { background: !0 } : {}
|
|
2615
2668
|
};
|
|
2616
2669
|
}));
|
|
2617
|
-
return (t, a) => (g(), i(e, null, [(g(!0), i(e, null, y(u.value, (e) => (g(), n(
|
|
2670
|
+
return (t, a) => (g(), i(e, null, [(g(!0), i(e, null, y(u.value, (e) => (g(), n(ya, {
|
|
2618
2671
|
key: e.questionId,
|
|
2619
2672
|
"question-id": e.questionId,
|
|
2620
2673
|
question: e.question,
|
|
2621
2674
|
onAnswer: a[0] ||= (e) => c("answer", e)
|
|
2622
|
-
}, null, 8, ["question-id", "question"]))), 128)), f.value.length > 0 ? (g(), n(
|
|
2675
|
+
}, null, 8, ["question-id", "question"]))), 128)), f.value.length > 0 ? (g(), n(ra, {
|
|
2623
2676
|
key: 0,
|
|
2624
2677
|
approvals: f.value,
|
|
2625
2678
|
onDecide: a[1] ||= (e) => c("decide", e)
|
|
@@ -2628,12 +2681,12 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
|
|
|
2628
2681
|
});
|
|
2629
2682
|
//#endregion
|
|
2630
2683
|
//#region web/src/use-model-groups.ts
|
|
2631
|
-
function
|
|
2684
|
+
function xa(e, t, n) {
|
|
2632
2685
|
let r = v([]);
|
|
2633
2686
|
return m(async () => {
|
|
2634
2687
|
try {
|
|
2635
2688
|
let [n, i] = await Promise.all([e.exec("kvai.provider.list", {}), e.exec("kvai.model.list", {})]);
|
|
2636
|
-
r.value =
|
|
2689
|
+
r.value = zt(n, i, t());
|
|
2637
2690
|
} catch (e) {
|
|
2638
2691
|
n(e);
|
|
2639
2692
|
}
|
|
@@ -2641,15 +2694,15 @@ function va(e, t, n) {
|
|
|
2641
2694
|
}
|
|
2642
2695
|
//#endregion
|
|
2643
2696
|
//#region web/src/RecoveryActions.vue?vue&type=script&setup=true&lang.ts
|
|
2644
|
-
var
|
|
2697
|
+
var Sa = {
|
|
2645
2698
|
class: "kvc-recovery",
|
|
2646
2699
|
"data-test": "recovery"
|
|
2647
|
-
},
|
|
2700
|
+
}, Ca = { class: "kvc-recovery-picker" }, wa = /* @__PURE__ */ c({
|
|
2648
2701
|
__name: "RecoveryActions",
|
|
2649
2702
|
props: { sessionId: {} },
|
|
2650
2703
|
emits: ["sent"],
|
|
2651
2704
|
setup(e, { emit: t }) {
|
|
2652
|
-
let n = e, r = t, c = J(), l =
|
|
2705
|
+
let n = e, r = t, c = J(), l = xa(c, () => null, (e) => X(c, e));
|
|
2653
2706
|
async function u() {
|
|
2654
2707
|
await c.exec("kvcoder.message.send", {
|
|
2655
2708
|
sessionId: n.sessionId,
|
|
@@ -2667,9 +2720,9 @@ var ya = {
|
|
|
2667
2720
|
await c.exec("kvcoder.session.configure", {
|
|
2668
2721
|
sessionId: n.sessionId,
|
|
2669
2722
|
model: e
|
|
2670
|
-
}), await
|
|
2723
|
+
}), await cn(c, e), await u();
|
|
2671
2724
|
});
|
|
2672
|
-
return (e, t) => (g(), i("div",
|
|
2725
|
+
return (e, t) => (g(), i("div", Sa, [a("button", {
|
|
2673
2726
|
type: "button",
|
|
2674
2727
|
class: "kvc-button",
|
|
2675
2728
|
"data-test": "retry",
|
|
@@ -2677,34 +2730,34 @@ var ya = {
|
|
|
2677
2730
|
}, [s(T(he), {
|
|
2678
2731
|
size: 14,
|
|
2679
2732
|
"aria-hidden": "true"
|
|
2680
|
-
}), o(w(T(c).t("kvcoder.ui.retry")), 1)]), a("div",
|
|
2733
|
+
}), o(w(T(c).t("kvcoder.ui.retry")), 1)]), a("div", Ca, [s(rn, {
|
|
2681
2734
|
groups: T(l),
|
|
2682
2735
|
current: null,
|
|
2683
2736
|
empty: T(c).t("kvcoder.ui.chooseAnotherModel"),
|
|
2684
2737
|
onPick: p
|
|
2685
2738
|
}, null, 8, ["groups", "empty"])])]));
|
|
2686
2739
|
}
|
|
2687
|
-
}),
|
|
2740
|
+
}), Ta = {
|
|
2688
2741
|
class: "kvc-column",
|
|
2689
2742
|
"data-test": "prompt-tab"
|
|
2690
|
-
},
|
|
2743
|
+
}, Ea = { style: {
|
|
2691
2744
|
display: "flex",
|
|
2692
2745
|
"align-items": "center",
|
|
2693
2746
|
gap: "10px"
|
|
2694
|
-
} },
|
|
2747
|
+
} }, Da = { style: { flex: "1 1 auto" } }, Oa = {
|
|
2695
2748
|
key: 0,
|
|
2696
2749
|
style: {
|
|
2697
2750
|
margin: "0",
|
|
2698
2751
|
"padding-inline-start": "20px"
|
|
2699
2752
|
}
|
|
2700
|
-
},
|
|
2753
|
+
}, ka = {
|
|
2701
2754
|
key: 0,
|
|
2702
2755
|
class: "kvc-chip kvc-warn"
|
|
2703
|
-
},
|
|
2756
|
+
}, Aa = {
|
|
2704
2757
|
key: 1,
|
|
2705
2758
|
class: "kvc-prompt",
|
|
2706
2759
|
"data-test": "prompt-text"
|
|
2707
|
-
},
|
|
2760
|
+
}, ja = /* @__PURE__ */ c({
|
|
2708
2761
|
__name: "PromptTab",
|
|
2709
2762
|
props: { sessionId: {} },
|
|
2710
2763
|
emits: ["back"],
|
|
@@ -2720,8 +2773,8 @@ var ya = {
|
|
|
2720
2773
|
async function f() {
|
|
2721
2774
|
d.value !== null && (await navigator.clipboard.writeText(d.value.prompt), u.toast("kvcoder.ui.copied", {}, "success"));
|
|
2722
2775
|
}
|
|
2723
|
-
return (t, n) => (g(), i("div",
|
|
2724
|
-
a("div",
|
|
2776
|
+
return (t, n) => (g(), i("div", Ta, [
|
|
2777
|
+
a("div", Ea, [
|
|
2725
2778
|
a("button", {
|
|
2726
2779
|
type: "button",
|
|
2727
2780
|
class: "kvc-button",
|
|
@@ -2732,7 +2785,7 @@ var ya = {
|
|
|
2732
2785
|
class: "kvc-flip",
|
|
2733
2786
|
"aria-hidden": "true"
|
|
2734
2787
|
}), o(w(T(u).t("kvcoder.ui.showChat")), 1)]),
|
|
2735
|
-
a("strong",
|
|
2788
|
+
a("strong", Da, w(T(u).t("kvcoder.ui.promptTitle")), 1),
|
|
2736
2789
|
a("button", {
|
|
2737
2790
|
type: "button",
|
|
2738
2791
|
class: "kvc-button",
|
|
@@ -2740,7 +2793,7 @@ var ya = {
|
|
|
2740
2793
|
onClick: f
|
|
2741
2794
|
}, [s(T(se), { size: 16 }), o(w(T(u).t("kvcoder.ui.copy")), 1)])
|
|
2742
2795
|
]),
|
|
2743
|
-
d.value ? (g(), i("ul",
|
|
2796
|
+
d.value ? (g(), i("ul", Oa, [(g(!0), i(e, null, y(d.value.sections, (e) => (g(), i("li", {
|
|
2744
2797
|
key: `${e.owner}/${e.id}`,
|
|
2745
2798
|
class: "kvc-muted",
|
|
2746
2799
|
"data-test": "prompt-section"
|
|
@@ -2749,14 +2802,14 @@ var ya = {
|
|
|
2749
2802
|
owner: e.owner,
|
|
2750
2803
|
reach: T(u).t(`kvcoder.ui.reach.${e.reach}`),
|
|
2751
2804
|
size: e.size
|
|
2752
|
-
})) + " ", 1), e.included ? r("v-if", !0) : (g(), i("span",
|
|
2753
|
-
d.value ? (g(), i("pre",
|
|
2805
|
+
})) + " ", 1), e.included ? r("v-if", !0) : (g(), i("span", ka, w(T(u).t("kvcoder.ui.leftOut")), 1))]))), 128))])) : r("v-if", !0),
|
|
2806
|
+
d.value ? (g(), i("pre", Aa, w(d.value.prompt), 1)) : r("v-if", !0)
|
|
2754
2807
|
]));
|
|
2755
2808
|
}
|
|
2756
2809
|
});
|
|
2757
2810
|
//#endregion
|
|
2758
2811
|
//#region web/src/use-session-actions.ts
|
|
2759
|
-
function
|
|
2812
|
+
function Ma(e, t, n) {
|
|
2760
2813
|
let r = C();
|
|
2761
2814
|
async function i(t) {
|
|
2762
2815
|
try {
|
|
@@ -2789,7 +2842,7 @@ function ka(e, t, n) {
|
|
|
2789
2842
|
await e.exec("kvcoder.session.configure", {
|
|
2790
2843
|
sessionId: t(),
|
|
2791
2844
|
...n
|
|
2792
|
-
}), n.model !== void 0 && await
|
|
2845
|
+
}), n.model !== void 0 && await cn(e, n.model);
|
|
2793
2846
|
}),
|
|
2794
2847
|
rename: (n) => a("rename", async () => {
|
|
2795
2848
|
n.trim() !== "" && await e.exec("kvcoder.session.rename", {
|
|
@@ -2819,13 +2872,13 @@ function ka(e, t, n) {
|
|
|
2819
2872
|
}
|
|
2820
2873
|
//#endregion
|
|
2821
2874
|
//#region web/src/SessionModel.vue
|
|
2822
|
-
var
|
|
2875
|
+
var Na = /* @__PURE__ */ c({
|
|
2823
2876
|
__name: "SessionModel",
|
|
2824
2877
|
props: { session: {} },
|
|
2825
2878
|
emits: ["changed"],
|
|
2826
2879
|
setup(e, { emit: t }) {
|
|
2827
|
-
let r = e, i = t, a = J(), o =
|
|
2828
|
-
return (e, t) => (g(), n(
|
|
2880
|
+
let r = e, i = t, a = J(), o = xa(a, () => r.session.model, (e) => X(a, e)), s = Ma(a, () => r.session.id, () => i("changed"));
|
|
2881
|
+
return (e, t) => (g(), n(sn, {
|
|
2829
2882
|
groups: T(o),
|
|
2830
2883
|
model: r.session.model ?? null,
|
|
2831
2884
|
thinking: r.session.thinking,
|
|
@@ -2837,27 +2890,27 @@ var Aa = /* @__PURE__ */ c({
|
|
|
2837
2890
|
"thinking"
|
|
2838
2891
|
]));
|
|
2839
2892
|
}
|
|
2840
|
-
}),
|
|
2893
|
+
}), Pa = ["aria-label"], Fa = { class: "kvc-card-row" }, Ia = {
|
|
2841
2894
|
key: 0,
|
|
2842
2895
|
class: "kvc-chip kvc-mono",
|
|
2843
2896
|
"data-test": "subagent-worker"
|
|
2844
|
-
},
|
|
2897
|
+
}, La = { style: {
|
|
2845
2898
|
flex: "1 1 auto",
|
|
2846
2899
|
"font-weight": "500"
|
|
2847
|
-
} },
|
|
2900
|
+
} }, Ra = {
|
|
2848
2901
|
key: 1,
|
|
2849
2902
|
class: "kvc-spin"
|
|
2850
|
-
},
|
|
2903
|
+
}, za = {
|
|
2851
2904
|
key: 0,
|
|
2852
2905
|
class: "kvc-card-body"
|
|
2853
|
-
},
|
|
2906
|
+
}, Ba = {
|
|
2854
2907
|
key: 0,
|
|
2855
2908
|
class: "kvc-muted",
|
|
2856
2909
|
style: {
|
|
2857
2910
|
margin: "0",
|
|
2858
2911
|
"white-space": "pre-wrap"
|
|
2859
2912
|
}
|
|
2860
|
-
},
|
|
2913
|
+
}, Va = /* @__PURE__ */ c({
|
|
2861
2914
|
__name: "SubagentCard",
|
|
2862
2915
|
props: {
|
|
2863
2916
|
child: {},
|
|
@@ -2870,36 +2923,36 @@ var Aa = /* @__PURE__ */ c({
|
|
|
2870
2923
|
class: "kvc-card",
|
|
2871
2924
|
"data-test": "subagent-card",
|
|
2872
2925
|
"aria-label": T(Pe)(T(l).t, o.child.session.title)
|
|
2873
|
-
}, [a("div",
|
|
2874
|
-
s(T(
|
|
2926
|
+
}, [a("div", Fa, [
|
|
2927
|
+
s(T(te), {
|
|
2875
2928
|
size: 18,
|
|
2876
2929
|
"aria-hidden": "true"
|
|
2877
2930
|
}),
|
|
2878
|
-
o.child.session.worker === void 0 ? r("v-if", !0) : (g(), i("span",
|
|
2879
|
-
a("span",
|
|
2880
|
-
o.child.session.status === "running" ? (g(), i("span",
|
|
2931
|
+
o.child.session.worker === void 0 ? r("v-if", !0) : (g(), i("span", Ia, w(o.child.session.worker), 1)),
|
|
2932
|
+
a("span", La, w(T(Pe)(T(l).t, o.child.session.title)), 1),
|
|
2933
|
+
o.child.session.status === "running" ? (g(), i("span", Ra)) : r("v-if", !0),
|
|
2881
2934
|
a("span", { class: f(["kvc-chip", { "kvc-warn": o.child.session.status === "waiting" }]) }, w(u.value), 3)
|
|
2882
|
-
]), o.child.live.text !== "" || (o.child.turn?.pending.length ?? 0) > 0 ? (g(), i("div",
|
|
2935
|
+
]), o.child.live.text !== "" || (o.child.turn?.pending.length ?? 0) > 0 ? (g(), i("div", za, [o.child.live.text === "" ? r("v-if", !0) : (g(), i("p", Ba, w(o.child.live.text), 1)), s(ba, {
|
|
2883
2936
|
pending: o.child.turn?.pending ?? [],
|
|
2884
2937
|
hidden: o.hidden,
|
|
2885
2938
|
onAnswer: t[0] ||= (e) => c("answer", e),
|
|
2886
2939
|
onDecide: t[1] ||= (e) => c("decide", e)
|
|
2887
|
-
}, null, 8, ["pending", "hidden"])])) : r("v-if", !0)], 8,
|
|
2940
|
+
}, null, 8, ["pending", "hidden"])])) : r("v-if", !0)], 8, Pa));
|
|
2888
2941
|
}
|
|
2889
|
-
}),
|
|
2942
|
+
}), Ha = ["aria-label"], Ua = { class: "kvc-card-row" }, Wa = {
|
|
2890
2943
|
class: "kvc-chip kvc-mono",
|
|
2891
2944
|
"data-test": "worker-card-name"
|
|
2892
|
-
},
|
|
2945
|
+
}, Ga = {
|
|
2893
2946
|
style: {
|
|
2894
2947
|
flex: "1 1 auto",
|
|
2895
2948
|
"font-weight": "500"
|
|
2896
2949
|
},
|
|
2897
2950
|
dir: "auto",
|
|
2898
2951
|
"data-test": "worker-card-call"
|
|
2899
|
-
},
|
|
2952
|
+
}, Ka = {
|
|
2900
2953
|
class: "kvc-chip",
|
|
2901
2954
|
"data-test": "worker-card-time"
|
|
2902
|
-
},
|
|
2955
|
+
}, qa = ["disabled"], Ja = /* @__PURE__ */ c({
|
|
2903
2956
|
__name: "WorkerCard",
|
|
2904
2957
|
props: {
|
|
2905
2958
|
sessionId: {},
|
|
@@ -2935,25 +2988,25 @@ var Aa = /* @__PURE__ */ c({
|
|
|
2935
2988
|
class: "kvc-card",
|
|
2936
2989
|
"data-test": "worker-card",
|
|
2937
2990
|
"aria-label": o.value.title
|
|
2938
|
-
}, [a("div",
|
|
2939
|
-
s(T(
|
|
2991
|
+
}, [a("div", Ua, [
|
|
2992
|
+
s(T(te), {
|
|
2940
2993
|
size: 18,
|
|
2941
2994
|
"aria-hidden": "true"
|
|
2942
2995
|
}),
|
|
2943
|
-
a("span",
|
|
2944
|
-
a("span",
|
|
2996
|
+
a("span", Wa, w(o.value.title), 1),
|
|
2997
|
+
a("span", Ga, w(o.value.call), 1),
|
|
2945
2998
|
t[0] ||= a("span", { class: "kvc-spin" }, null, -1),
|
|
2946
|
-
a("span",
|
|
2999
|
+
a("span", Ka, w(T(n).t("kvcoder.ui.jobs.status.running")) + " · " + w(T(wn)(T(n).t, c.value - Date.parse(o.value.startedAt))), 1),
|
|
2947
3000
|
a("button", {
|
|
2948
3001
|
type: "button",
|
|
2949
3002
|
class: "kvc-button",
|
|
2950
3003
|
disabled: l.value,
|
|
2951
3004
|
"data-test": "worker-card-stop",
|
|
2952
3005
|
onClick: d
|
|
2953
|
-
}, w(T(n).t("kvcoder.ui.jobs.stop")), 9,
|
|
2954
|
-
])], 8,
|
|
3006
|
+
}, w(T(n).t("kvcoder.ui.jobs.stop")), 9, qa)
|
|
3007
|
+
])], 8, Ha));
|
|
2955
3008
|
}
|
|
2956
|
-
}),
|
|
3009
|
+
}), Ya = (e) => {
|
|
2957
3010
|
let t = e.description ?? e.subject;
|
|
2958
3011
|
return {
|
|
2959
3012
|
name: "run",
|
|
@@ -2962,7 +3015,7 @@ var Aa = /* @__PURE__ */ c({
|
|
|
2962
3015
|
complete: !0
|
|
2963
3016
|
};
|
|
2964
3017
|
};
|
|
2965
|
-
function
|
|
3018
|
+
function Xa(e, t) {
|
|
2966
3019
|
let n = v(/* @__PURE__ */ new Set()), r = /* @__PURE__ */ new Map();
|
|
2967
3020
|
function i(e) {
|
|
2968
3021
|
for (let { questionId: t } of e) n.value.delete(t), r.delete(t);
|
|
@@ -2984,7 +3037,7 @@ function qa(e, t) {
|
|
|
2984
3037
|
hidden: n,
|
|
2985
3038
|
answer: (e) => a([e]),
|
|
2986
3039
|
decide: ({ approvals: e, confirmed: t }) => {
|
|
2987
|
-
if (t) for (let t of e) r.set(t.questionId,
|
|
3040
|
+
if (t) for (let t of e) r.set(t.questionId, Ya(t));
|
|
2988
3041
|
return a(e.map((e) => ({
|
|
2989
3042
|
questionId: e.questionId,
|
|
2990
3043
|
answer: { confirmed: t }
|
|
@@ -2994,7 +3047,7 @@ function qa(e, t) {
|
|
|
2994
3047
|
}
|
|
2995
3048
|
//#endregion
|
|
2996
3049
|
//#region web/src/use-artifacts.ts
|
|
2997
|
-
function
|
|
3050
|
+
function Za(e, t, n, r) {
|
|
2998
3051
|
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;
|
|
2999
3052
|
function h(e) {
|
|
3000
3053
|
l = e, u = !1, c.clear(), i.value = [], a.value = void 0, o.value = void 0, s.value = !1;
|
|
@@ -3107,109 +3160,138 @@ function Ja(e, t, n, r) {
|
|
|
3107
3160
|
}
|
|
3108
3161
|
//#endregion
|
|
3109
3162
|
//#region web/src/use-conversation.ts
|
|
3110
|
-
var
|
|
3111
|
-
function
|
|
3112
|
-
let r = C(null), i = C([]), a = C(0), o = C([]), s = C(!1),
|
|
3113
|
-
async function
|
|
3163
|
+
var Qa = 5e3, $a = 200;
|
|
3164
|
+
function eo(e, t, n) {
|
|
3165
|
+
let r = C(null), i = C([]), a = C(0), o = C([]), s = C(null), c = C(void 0), l, u = C(!1), d = _(fr()), f = S(/* @__PURE__ */ new Map()), p = /* @__PURE__ */ new Set(), m = !1;
|
|
3166
|
+
async function g(t) {
|
|
3114
3167
|
let n = (t?.pending ?? []).flatMap((e) => e.childSessionId === null ? [] : [e.childSessionId]);
|
|
3115
|
-
for (let e of [...
|
|
3168
|
+
for (let e of [...f.keys()]) n.includes(e) || f.delete(e);
|
|
3116
3169
|
for (let t of n) {
|
|
3117
3170
|
let [n, [r]] = await Promise.all([e.exec("kvcoder.session.get", { sessionId: t }), e.exec("kvcoder.turn.list", {
|
|
3118
3171
|
sessionId: t,
|
|
3119
3172
|
limit: 1
|
|
3120
3173
|
})]);
|
|
3121
|
-
|
|
3174
|
+
f.set(t, {
|
|
3122
3175
|
session: n,
|
|
3123
3176
|
turn: r,
|
|
3124
|
-
live:
|
|
3177
|
+
live: f.get(t)?.live ?? _(fr())
|
|
3125
3178
|
});
|
|
3126
3179
|
}
|
|
3127
3180
|
}
|
|
3128
|
-
|
|
3181
|
+
let v = (e) => e.filter((e) => e.queued !== !0);
|
|
3182
|
+
async function y(t, n) {
|
|
3183
|
+
let r = await e.exec("kvcoder.message.list", {
|
|
3184
|
+
sessionId: t,
|
|
3185
|
+
limit: $a
|
|
3186
|
+
});
|
|
3187
|
+
i.value = r.messages, a.value = r.omitted, l = n;
|
|
3188
|
+
}
|
|
3189
|
+
async function b(t, n, r) {
|
|
3190
|
+
let a = await e.exec("kvcoder.message.list", {
|
|
3191
|
+
sessionId: t,
|
|
3192
|
+
limit: $a,
|
|
3193
|
+
afterSeq: r
|
|
3194
|
+
}), o = v(a.messages);
|
|
3195
|
+
if (o[0] !== void 0 && o[0].seq !== r + 1) return y(t, n);
|
|
3196
|
+
let s = v(i.value), c = s.at(-1)?.seq ?? r;
|
|
3197
|
+
i.value = [
|
|
3198
|
+
...s,
|
|
3199
|
+
...o.filter((e) => (e.seq ?? c) > c),
|
|
3200
|
+
...a.messages.filter((e) => e.queued === !0)
|
|
3201
|
+
];
|
|
3202
|
+
}
|
|
3203
|
+
async function x(t) {
|
|
3204
|
+
let n = `${e.workspace.value.id}:${t}`, r = l === n ? v(i.value).at(-1)?.seq : void 0;
|
|
3205
|
+
try {
|
|
3206
|
+
await (r === void 0 ? y(t, n) : b(t, n, r)), c.value = void 0;
|
|
3207
|
+
} catch (e) {
|
|
3208
|
+
c.value = e;
|
|
3209
|
+
}
|
|
3210
|
+
}
|
|
3211
|
+
async function w() {
|
|
3129
3212
|
let n = t();
|
|
3130
3213
|
if (n === void 0) return;
|
|
3131
|
-
let [
|
|
3214
|
+
let [i, a, c] = await Promise.all([
|
|
3132
3215
|
e.exec("kvcoder.session.get", { sessionId: n }),
|
|
3133
|
-
e.exec("kvcoder.message.list", {
|
|
3134
|
-
sessionId: n,
|
|
3135
|
-
limit: 200
|
|
3136
|
-
}),
|
|
3137
3216
|
e.exec("kvcoder.turn.list", {
|
|
3138
3217
|
sessionId: n,
|
|
3139
3218
|
limit: 50
|
|
3140
|
-
})
|
|
3219
|
+
}),
|
|
3220
|
+
e.exec("kvcoder.context.get", { sessionId: n })
|
|
3141
3221
|
]);
|
|
3142
|
-
r.value !== null && r.value.status !==
|
|
3222
|
+
r.value !== null && r.value.status !== i.status && e.refresh(), r.value = i, o.value = a, s.value = c, await x(n), await g(i.status === "waiting" ? a[0] : void 0);
|
|
3143
3223
|
}
|
|
3144
|
-
async function
|
|
3224
|
+
async function T(t, r, i, a = []) {
|
|
3145
3225
|
let o = t, s = a;
|
|
3146
|
-
for (; o !== void 0 && !
|
|
3147
|
-
|
|
3226
|
+
for (; o !== void 0 && !m && !p.has(o);) {
|
|
3227
|
+
p.add(o), Object.assign(r, fr()), r.calls = s.map((e) => ({
|
|
3148
3228
|
...e,
|
|
3149
3229
|
complete: !0,
|
|
3150
3230
|
carried: !0
|
|
3151
3231
|
})), s = [], e.follow(o).catch(n);
|
|
3152
3232
|
let t;
|
|
3153
3233
|
for await (let i of e.stream(o)) {
|
|
3154
|
-
let e =
|
|
3155
|
-
e.kind === "follow" && (t = e.jobId), e.kind === "subagent" &&
|
|
3234
|
+
let e = gr(r, i);
|
|
3235
|
+
e.kind === "follow" && (t = e.jobId), e.kind === "subagent" && D(e.sessionId, e.jobId).catch(n), e.kind === "question" && w().catch(n);
|
|
3156
3236
|
}
|
|
3157
|
-
|
|
3237
|
+
p.delete(o);
|
|
3158
3238
|
let a = await i();
|
|
3159
3239
|
o = t ?? (a === o ? void 0 : a);
|
|
3160
3240
|
}
|
|
3161
|
-
Object.assign(r,
|
|
3241
|
+
Object.assign(r, fr());
|
|
3162
3242
|
}
|
|
3163
|
-
async function
|
|
3164
|
-
|
|
3243
|
+
async function E(e, t = []) {
|
|
3244
|
+
u.value = !0;
|
|
3165
3245
|
try {
|
|
3166
|
-
await
|
|
3246
|
+
await T(e, d, async () => (await w(), r.value?.status === "running" ? r.value.stepJobId : void 0), t);
|
|
3167
3247
|
} finally {
|
|
3168
|
-
|
|
3248
|
+
u.value = p.size > 0;
|
|
3169
3249
|
}
|
|
3170
3250
|
}
|
|
3171
|
-
async function
|
|
3172
|
-
await
|
|
3173
|
-
let r =
|
|
3174
|
-
r !== void 0 && (await
|
|
3251
|
+
async function D(t, n) {
|
|
3252
|
+
await w();
|
|
3253
|
+
let r = f.get(t);
|
|
3254
|
+
r !== void 0 && (await T(n, r.live, async () => {
|
|
3175
3255
|
let n = await e.exec("kvcoder.session.get", { sessionId: t });
|
|
3176
3256
|
return n.status === "running" ? n.stepJobId : void 0;
|
|
3177
|
-
}), await
|
|
3257
|
+
}), await k());
|
|
3178
3258
|
}
|
|
3179
|
-
async function
|
|
3180
|
-
await
|
|
3259
|
+
async function k(e = []) {
|
|
3260
|
+
await w();
|
|
3181
3261
|
let t = r.value;
|
|
3182
|
-
t?.status === "running" && t.stepJobId !== void 0 &&
|
|
3183
|
-
for (let [e, t] of
|
|
3262
|
+
t?.status === "running" && t.stepJobId !== void 0 && E(t.stepJobId, e).catch(n);
|
|
3263
|
+
for (let [e, t] of f) t.session.status === "running" && t.session.stepJobId !== void 0 && D(e, t.session.stepJobId).catch(n);
|
|
3184
3264
|
}
|
|
3185
|
-
let
|
|
3186
|
-
|
|
3187
|
-
},
|
|
3265
|
+
let A = setInterval(() => {
|
|
3266
|
+
p.size === 0 && t() !== void 0 && k().catch(n);
|
|
3267
|
+
}, Qa);
|
|
3188
3268
|
return h(() => {
|
|
3189
|
-
|
|
3190
|
-
}), O([t, () => e.workspace.value.id], () =>
|
|
3269
|
+
m = !0, clearInterval(A);
|
|
3270
|
+
}), O([t, () => e.workspace.value.id], () => k().catch(n), { immediate: !0 }), {
|
|
3191
3271
|
session: r,
|
|
3192
3272
|
messages: i,
|
|
3193
3273
|
omitted: a,
|
|
3194
3274
|
turns: o,
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3275
|
+
context: s,
|
|
3276
|
+
loadFailure: c,
|
|
3277
|
+
live: d,
|
|
3278
|
+
streaming: u,
|
|
3279
|
+
children: f,
|
|
3280
|
+
refresh: k,
|
|
3281
|
+
stream: E
|
|
3200
3282
|
};
|
|
3201
3283
|
}
|
|
3202
3284
|
//#endregion
|
|
3203
3285
|
//#region web/src/use-follow-latest.ts
|
|
3204
|
-
var
|
|
3205
|
-
function
|
|
3286
|
+
var to = 80;
|
|
3287
|
+
function no(e, t, n) {
|
|
3206
3288
|
let r = v(!1);
|
|
3207
3289
|
function i() {
|
|
3208
3290
|
e.value !== null && (e.value.scrollTop = e.value.scrollHeight);
|
|
3209
3291
|
}
|
|
3210
3292
|
function a() {
|
|
3211
3293
|
let t = e.value;
|
|
3212
|
-
t !== null && (r.value = t.scrollHeight - t.clientHeight - t.scrollTop >
|
|
3294
|
+
t !== null && (r.value = t.scrollHeight - t.clientHeight - t.scrollTop > to);
|
|
3213
3295
|
}
|
|
3214
3296
|
function o() {
|
|
3215
3297
|
r.value = !1, i();
|
|
@@ -3226,7 +3308,7 @@ function Qa(e, t, n) {
|
|
|
3226
3308
|
}
|
|
3227
3309
|
//#endregion
|
|
3228
3310
|
//#region web/src/use-slash-commands.ts
|
|
3229
|
-
function
|
|
3311
|
+
function ro(e) {
|
|
3230
3312
|
let t = C([]);
|
|
3231
3313
|
return m(async () => {
|
|
3232
3314
|
try {
|
|
@@ -3238,7 +3320,7 @@ function $a(e) {
|
|
|
3238
3320
|
}
|
|
3239
3321
|
//#endregion
|
|
3240
3322
|
//#region web/src/use-workspace-session.ts
|
|
3241
|
-
function
|
|
3323
|
+
function io(e, n, r) {
|
|
3242
3324
|
let i = C(e.workspace.value.id);
|
|
3243
3325
|
async function a(t) {
|
|
3244
3326
|
let n;
|
|
@@ -3257,39 +3339,50 @@ function eo(e, n, r) {
|
|
|
3257
3339
|
}
|
|
3258
3340
|
//#endregion
|
|
3259
3341
|
//#region web/src/ConversationView.vue?vue&type=script&setup=true&lang.ts
|
|
3260
|
-
var
|
|
3342
|
+
var ao = { class: "kvc-workspace" }, oo = { class: "kvc-stage" }, so = {
|
|
3261
3343
|
class: "kvc-conversation",
|
|
3262
3344
|
"data-test": "conversation"
|
|
3263
|
-
},
|
|
3345
|
+
}, co = {
|
|
3346
|
+
key: 0,
|
|
3347
|
+
class: "kvc-start",
|
|
3348
|
+
role: "alert",
|
|
3349
|
+
"data-test": "load-failure"
|
|
3350
|
+
}, lo = { class: "kvc-start-note" }, uo = {
|
|
3351
|
+
class: "kvc-actions",
|
|
3352
|
+
style: { "justify-content": "center" }
|
|
3353
|
+
}, fo = {
|
|
3354
|
+
key: 1,
|
|
3355
|
+
class: "kvc-scrollport"
|
|
3356
|
+
}, po = {
|
|
3264
3357
|
key: 1,
|
|
3265
3358
|
class: "kvc-column"
|
|
3266
|
-
},
|
|
3359
|
+
}, mo = {
|
|
3267
3360
|
key: 0,
|
|
3268
3361
|
class: "kvc-muted",
|
|
3269
3362
|
"data-test": "turn-totals"
|
|
3270
|
-
},
|
|
3363
|
+
}, ho = {
|
|
3271
3364
|
key: 2,
|
|
3272
3365
|
class: "kvc-notice",
|
|
3273
3366
|
"data-test": "summarizing"
|
|
3274
|
-
},
|
|
3367
|
+
}, go = {
|
|
3275
3368
|
key: 3,
|
|
3276
3369
|
class: "kvc-answer",
|
|
3277
3370
|
"data-test": "live-answer"
|
|
3278
|
-
},
|
|
3371
|
+
}, _o = ["open"], vo = { class: "kvc-muted" }, yo = {
|
|
3279
3372
|
class: "kvc-muted",
|
|
3280
3373
|
style: { "white-space": "pre-wrap" }
|
|
3281
|
-
},
|
|
3374
|
+
}, bo = {
|
|
3282
3375
|
key: 6,
|
|
3283
3376
|
class: "kvc-muted",
|
|
3284
3377
|
style: {
|
|
3285
3378
|
"text-align": "center",
|
|
3286
3379
|
margin: "0"
|
|
3287
3380
|
}
|
|
3288
|
-
},
|
|
3381
|
+
}, xo = /* @__PURE__ */ c({
|
|
3289
3382
|
__name: "ConversationView",
|
|
3290
3383
|
props: { sessionId: {} },
|
|
3291
3384
|
setup(c) {
|
|
3292
|
-
let l = c, u = J(), d =
|
|
3385
|
+
let l = c, u = J(), d = io(u, () => l.sessionId, (e) => X(u, e)), f = v("chat"), p = eo(u, () => d.value, (e) => X(u, e)), { session: m, messages: h, omitted: _, turns: b, live: S, children: C } = p, D = Za(u, () => d.value, () => m.value?.updatedAt, (e) => X(u, e)), O = t(() => D.open.value && D.shown.value !== void 0), A = t(() => Or(h.value)), j = /* @__PURE__ */ new Set([
|
|
3293
3386
|
"STEP_FAILED",
|
|
3294
3387
|
"REPLY_LOST",
|
|
3295
3388
|
"INTERRUPTED"
|
|
@@ -3309,7 +3402,7 @@ var to = { class: "kvc-workspace" }, no = { class: "kvc-stage" }, ro = {
|
|
|
3309
3402
|
sessionId: d.value,
|
|
3310
3403
|
text: e.text,
|
|
3311
3404
|
...e.fileIds.length > 0 ? { fileIds: e.fileIds } : {}
|
|
3312
|
-
}),
|
|
3405
|
+
}), K.resume(), await p.refresh();
|
|
3313
3406
|
} catch (e) {
|
|
3314
3407
|
X(u, e);
|
|
3315
3408
|
}
|
|
@@ -3321,10 +3414,13 @@ var to = { class: "kvc-workspace" }, no = { class: "kvc-stage" }, ro = {
|
|
|
3321
3414
|
X(u, e);
|
|
3322
3415
|
}
|
|
3323
3416
|
}
|
|
3324
|
-
let R =
|
|
3417
|
+
let R = Xa(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(() => {
|
|
3325
3418
|
let e = h.value.at(-1);
|
|
3326
3419
|
return m.value?.status === "idle" && e?.kind === "notice" && j.has(String(e.content.code));
|
|
3327
|
-
}), H =
|
|
3420
|
+
}), H = ro(u), U = Ma(u, () => d.value ?? "", () => p.refresh()), W = t(() => {
|
|
3421
|
+
let e = Ie(p.loadFailure.value);
|
|
3422
|
+
return e === void 0 ? u.t("kvcoder.ui.failed") : u.t(Fe(e.code), e.params);
|
|
3423
|
+
}), G = E("list"), K = no(G, () => [
|
|
3328
3424
|
h.value,
|
|
3329
3425
|
S.text,
|
|
3330
3426
|
S.thinking,
|
|
@@ -3344,60 +3440,62 @@ var to = { class: "kvc-workspace" }, no = { class: "kvc-stage" }, ro = {
|
|
|
3344
3440
|
X(u, e);
|
|
3345
3441
|
}
|
|
3346
3442
|
}
|
|
3347
|
-
let
|
|
3348
|
-
async function
|
|
3443
|
+
let q = () => h.value.at(-1)?.kind === "notice" && h.value.at(-1)?.content.code === "SUMMARY_FAILED";
|
|
3444
|
+
async function ne() {
|
|
3349
3445
|
return (await u.exec("kernel.settings.list", {})).find((e) => e.key === "kvcoder.compactKeep")?.value ?? null;
|
|
3350
3446
|
}
|
|
3351
3447
|
async function re() {
|
|
3352
3448
|
let e = await U.compact();
|
|
3353
|
-
e === !0 ? u.toast("kvcoder.ui.summarized", {}, "success") : e === !1 && !
|
|
3449
|
+
e === !0 ? u.toast("kvcoder.ui.summarized", {}, "success") : e === !1 && !q() && u.toast("kvcoder.ui.nothingToSummarize", { count: await ne() });
|
|
3354
3450
|
}
|
|
3355
|
-
function
|
|
3451
|
+
function ie(e, t) {
|
|
3356
3452
|
if (e === "new") return u.navigate("kvcoder.chat");
|
|
3357
3453
|
if (e === "prompt") return void (f.value = f.value === "prompt" ? "chat" : "prompt");
|
|
3358
3454
|
if (e === "delete") return void U.remove();
|
|
3359
3455
|
U.working.value === void 0 && (f.value = "chat", e === "rename" ? U.rename(t) : e === "compact" ? re() : e === "export" ? U.exportFile() : U.fork());
|
|
3360
3456
|
}
|
|
3361
|
-
async function
|
|
3457
|
+
async function ae(e, t) {
|
|
3362
3458
|
U.working.value === void 0 && (f.value = "chat", await U.runRegistered(e, t) && e.message !== void 0 && await I({
|
|
3363
3459
|
text: t === "" ? u.t(e.message) : t,
|
|
3364
3460
|
fileIds: []
|
|
3365
3461
|
}));
|
|
3366
3462
|
}
|
|
3367
|
-
let
|
|
3368
|
-
return (t, c) => (g(), i("div",
|
|
3463
|
+
let oe = (e) => e.id;
|
|
3464
|
+
return (t, c) => (g(), i("div", ao, [T(m) && T(d) !== void 0 ? (g(), n(ar, {
|
|
3369
3465
|
key: 0,
|
|
3370
3466
|
session: T(m),
|
|
3371
3467
|
tab: f.value,
|
|
3372
3468
|
turns: T(b).length,
|
|
3469
|
+
context: T(p).context.value,
|
|
3373
3470
|
"running-since": N.value,
|
|
3374
3471
|
artifacts: T(D).list.value.length,
|
|
3375
3472
|
"artifacts-open": T(D).open.value,
|
|
3376
3473
|
working: T(U).working.value !== void 0,
|
|
3377
3474
|
onTab: c[0] ||= (e) => f.value = e,
|
|
3378
|
-
onAction:
|
|
3475
|
+
onAction: ie,
|
|
3379
3476
|
onToggleArtifacts: c[1] ||= (e) => T(D).toggle()
|
|
3380
3477
|
}, null, 8, [
|
|
3381
3478
|
"session",
|
|
3382
3479
|
"tab",
|
|
3383
3480
|
"turns",
|
|
3481
|
+
"context",
|
|
3384
3482
|
"running-since",
|
|
3385
3483
|
"artifacts",
|
|
3386
3484
|
"artifacts-open",
|
|
3387
3485
|
"working"
|
|
3388
|
-
])) : r("v-if", !0), a("div",
|
|
3486
|
+
])) : r("v-if", !0), a("div", oo, [a("section", so, [l.sessionId === void 0 ? (g(), n(gn, {
|
|
3389
3487
|
key: 0,
|
|
3390
3488
|
registered: T(H)
|
|
3391
|
-
}, null, 8, ["registered"])) : T(m) && T(d) !== void 0 ? (g(), i(e, { key: 1 }, [
|
|
3489
|
+
}, null, 8, ["registered"])) : T(m) && T(d) !== void 0 ? (g(), i(e, { key: 1 }, [T(p).loadFailure.value === void 0 ? (g(), i("div", fo, [a("div", {
|
|
3392
3490
|
ref_key: "list",
|
|
3393
|
-
ref:
|
|
3491
|
+
ref: G,
|
|
3394
3492
|
class: "kvc-scroll",
|
|
3395
|
-
onScroll: c[
|
|
3396
|
-
}, [f.value === "prompt" ? (g(), n(
|
|
3493
|
+
onScroll: c[7] ||= (...e) => T(K).onScroll && T(K).onScroll(...e)
|
|
3494
|
+
}, [f.value === "prompt" ? (g(), n(ja, {
|
|
3397
3495
|
key: 0,
|
|
3398
3496
|
"session-id": T(m).id,
|
|
3399
|
-
onBack: c[
|
|
3400
|
-
}, null, 8, ["session-id"])) : (g(), i("div",
|
|
3497
|
+
onBack: c[4] ||= (e) => f.value = "chat"
|
|
3498
|
+
}, null, 8, ["session-id"])) : (g(), i("div", po, [
|
|
3401
3499
|
T(_) > 0 ? (g(), i("button", {
|
|
3402
3500
|
key: 0,
|
|
3403
3501
|
type: "button",
|
|
@@ -3406,24 +3504,24 @@ var to = { class: "kvc-workspace" }, no = { class: "kvc-stage" }, ro = {
|
|
|
3406
3504
|
"data-test": "earlier",
|
|
3407
3505
|
onClick: te
|
|
3408
3506
|
}, w(T(u).t("kvcoder.ui.earlierMessages", { count: T(_) })), 1)) : r("v-if", !0),
|
|
3409
|
-
(g(!0), i(e, null, y(T(h), (t) => (g(), i(e, { key:
|
|
3507
|
+
(g(!0), i(e, null, y(T(h), (t) => (g(), i(e, { key: oe(t) }, [s(Gi, {
|
|
3410
3508
|
message: t,
|
|
3411
3509
|
calls: A.value,
|
|
3412
|
-
onOpenArtifact: c[
|
|
3413
|
-
}, null, 8, ["message", "calls"]), F.value.has(t.id) ? (g(), i("span",
|
|
3414
|
-
V.value ? (g(), n(
|
|
3510
|
+
onOpenArtifact: c[5] ||= (e) => T(D).openArtifact(e)
|
|
3511
|
+
}, null, 8, ["message", "calls"]), F.value.has(t.id) ? (g(), i("span", mo, w(F.value.get(t.id)), 1)) : r("v-if", !0)], 64))), 128)),
|
|
3512
|
+
V.value ? (g(), n(wa, {
|
|
3415
3513
|
key: 1,
|
|
3416
3514
|
"session-id": T(m).id,
|
|
3417
|
-
onSent: c[
|
|
3418
|
-
T(
|
|
3515
|
+
onSent: c[6] ||= (e) => {
|
|
3516
|
+
T(K).resume(), T(p).refresh();
|
|
3419
3517
|
}
|
|
3420
3518
|
}, null, 8, ["session-id"])) : r("v-if", !0),
|
|
3421
|
-
T(S).summarizing ? (g(), i("div",
|
|
3422
|
-
M.value && (T(S).text !== "" || T(S).thinking !== "") ? (g(), i("div",
|
|
3519
|
+
T(S).summarizing ? (g(), i("div", ho, w(T(u).t("kvcoder.ui.summarizing")), 1)) : r("v-if", !0),
|
|
3520
|
+
M.value && (T(S).text !== "" || T(S).thinking !== "") ? (g(), i("div", go, [T(S).thinking === "" ? r("v-if", !0) : (g(), i("details", {
|
|
3423
3521
|
key: 0,
|
|
3424
3522
|
open: T(S).text === "" && T(S).calls.length === 0,
|
|
3425
3523
|
"data-test": "live-thinking"
|
|
3426
|
-
}, [a("summary",
|
|
3524
|
+
}, [a("summary", vo, w(T(u).t("kvcoder.ui.thinkingNow")), 1), a("p", yo, w(T(S).thinking), 1)], 8, _o)), T(S).text === "" ? r("v-if", !0) : (g(), n(x(T(u).View), {
|
|
3427
3525
|
key: 1,
|
|
3428
3526
|
view: {
|
|
3429
3527
|
type: "markdown",
|
|
@@ -3431,15 +3529,15 @@ var to = { class: "kvc-workspace" }, no = { class: "kvc-stage" }, ro = {
|
|
|
3431
3529
|
params: { text: T(S).text }
|
|
3432
3530
|
}
|
|
3433
3531
|
}, null, 8, ["view"]))])) : r("v-if", !0),
|
|
3434
|
-
M.value ? (g(), n(
|
|
3532
|
+
M.value ? (g(), n(wr, {
|
|
3435
3533
|
key: 4,
|
|
3436
3534
|
live: T(S)
|
|
3437
3535
|
}, null, 8, ["live"])) : r("v-if", !0),
|
|
3438
|
-
T(U).working.value ? (g(), n(
|
|
3536
|
+
T(U).working.value ? (g(), n(Sn, {
|
|
3439
3537
|
key: 5,
|
|
3440
3538
|
working: T(U).working.value
|
|
3441
3539
|
}, null, 8, ["working"])) : r("v-if", !0),
|
|
3442
|
-
(g(!0), i(e, null, y(T(C), ([e, t]) => (g(), n(
|
|
3540
|
+
(g(!0), i(e, null, y(T(C), ([e, t]) => (g(), n(Va, {
|
|
3443
3541
|
key: e,
|
|
3444
3542
|
child: t,
|
|
3445
3543
|
hidden: T(R).hidden.value,
|
|
@@ -3451,12 +3549,12 @@ var to = { class: "kvc-workspace" }, no = { class: "kvc-stage" }, ro = {
|
|
|
3451
3549
|
"onAnswer",
|
|
3452
3550
|
"onDecide"
|
|
3453
3551
|
]))), 128)),
|
|
3454
|
-
(g(!0), i(e, null, y(z.value, (e) => (g(), n(
|
|
3552
|
+
(g(!0), i(e, null, y(z.value, (e) => (g(), n(Ja, {
|
|
3455
3553
|
key: e,
|
|
3456
3554
|
"session-id": T(m).id,
|
|
3457
3555
|
"run-id": e
|
|
3458
3556
|
}, null, 8, ["session-id", "run-id"]))), 128)),
|
|
3459
|
-
s(
|
|
3557
|
+
s(ba, {
|
|
3460
3558
|
pending: P.value,
|
|
3461
3559
|
hidden: T(R).hidden.value,
|
|
3462
3560
|
onAnswer: T(R).answer,
|
|
@@ -3467,17 +3565,27 @@ var to = { class: "kvc-workspace" }, no = { class: "kvc-stage" }, ro = {
|
|
|
3467
3565
|
"onAnswer",
|
|
3468
3566
|
"onDecide"
|
|
3469
3567
|
]),
|
|
3470
|
-
B.value.some((e) => e.kind !== "subagent" && e.kind !== "worker") ? (g(), i("p",
|
|
3471
|
-
]))], 544), T(
|
|
3568
|
+
B.value.some((e) => e.kind !== "subagent" && e.kind !== "worker") ? (g(), i("p", bo, w(T(u).t("kvcoder.ui.messageDismisses")), 1)) : r("v-if", !0)
|
|
3569
|
+
]))], 544), T(K).away.value ? (g(), i("button", {
|
|
3472
3570
|
key: 0,
|
|
3473
3571
|
type: "button",
|
|
3474
3572
|
class: "kvc-button kvc-jump",
|
|
3475
3573
|
"data-test": "jump-to-latest",
|
|
3476
|
-
onClick: c[
|
|
3574
|
+
onClick: c[8] ||= (...e) => T(K).resume && T(K).resume(...e)
|
|
3477
3575
|
}, [s(T(ee), {
|
|
3478
3576
|
size: 16,
|
|
3479
3577
|
"aria-hidden": "true"
|
|
3480
|
-
}), o(w(T(u).t("kvcoder.ui.jumpToLatest")), 1)])) : r("v-if", !0)]),
|
|
3578
|
+
}), o(w(T(u).t("kvcoder.ui.jumpToLatest")), 1)])) : r("v-if", !0)])) : (g(), i("div", co, [a("p", lo, w(T(u).t("kvcoder.ui.loadFailed", { error: W.value })), 1), a("div", uo, [a("button", {
|
|
3579
|
+
type: "button",
|
|
3580
|
+
class: "kvc-button kvc-primary",
|
|
3581
|
+
"data-test": "load-again",
|
|
3582
|
+
onClick: c[2] ||= (e) => T(p).refresh()
|
|
3583
|
+
}, w(T(u).t("kvcoder.ui.tryAgain")), 1), a("button", {
|
|
3584
|
+
type: "button",
|
|
3585
|
+
class: "kvc-button",
|
|
3586
|
+
"data-test": "load-export",
|
|
3587
|
+
onClick: c[3] ||= (e) => T(U).exportFile()
|
|
3588
|
+
}, w(T(u).t("kvcoder.ui.export")), 1)])])), s(Rt, {
|
|
3481
3589
|
running: M.value,
|
|
3482
3590
|
placeholder: T(u).t("kvcoder.ui.placeholder"),
|
|
3483
3591
|
blocked: T(U).working.value !== void 0,
|
|
@@ -3485,12 +3593,12 @@ var to = { class: "kvc-workspace" }, no = { class: "kvc-stage" }, ro = {
|
|
|
3485
3593
|
registered: T(H),
|
|
3486
3594
|
onSend: I,
|
|
3487
3595
|
onStop: L,
|
|
3488
|
-
onCommand:
|
|
3489
|
-
onRegistered:
|
|
3596
|
+
onCommand: ie,
|
|
3597
|
+
onRegistered: ae
|
|
3490
3598
|
}, {
|
|
3491
|
-
controls: k(() => [s(
|
|
3599
|
+
controls: k(() => [s(Na, {
|
|
3492
3600
|
session: T(m),
|
|
3493
|
-
onChanged: c[
|
|
3601
|
+
onChanged: c[9] ||= (e) => T(p).refresh()
|
|
3494
3602
|
}, null, 8, ["session"])]),
|
|
3495
3603
|
_: 1
|
|
3496
3604
|
}, 8, [
|
|
@@ -3498,26 +3606,26 @@ var to = { class: "kvc-workspace" }, no = { class: "kvc-stage" }, ro = {
|
|
|
3498
3606
|
"placeholder",
|
|
3499
3607
|
"blocked",
|
|
3500
3608
|
"registered"
|
|
3501
|
-
])], 64)) : r("v-if", !0)]), O.value ? (g(), n(
|
|
3609
|
+
])], 64)) : r("v-if", !0)]), O.value ? (g(), n(vt, {
|
|
3502
3610
|
key: 0,
|
|
3503
3611
|
list: T(D).list.value,
|
|
3504
3612
|
shown: T(D).shown.value,
|
|
3505
3613
|
content: T(D).content.value,
|
|
3506
|
-
onSelect: c[
|
|
3507
|
-
onClose: c[
|
|
3614
|
+
onSelect: c[10] ||= (e) => T(D).select(e),
|
|
3615
|
+
onClose: c[11] ||= (e) => T(D).close()
|
|
3508
3616
|
}, null, 8, [
|
|
3509
3617
|
"list",
|
|
3510
3618
|
"shown",
|
|
3511
3619
|
"content"
|
|
3512
3620
|
])) : r("v-if", !0)])]));
|
|
3513
3621
|
}
|
|
3514
|
-
}),
|
|
3622
|
+
}), So = /* @__PURE__ */ c({
|
|
3515
3623
|
__name: "conversation",
|
|
3516
3624
|
props: { sessionId: {} },
|
|
3517
3625
|
setup(e) {
|
|
3518
3626
|
let t = e;
|
|
3519
|
-
return (e, r) => (g(), n(
|
|
3627
|
+
return (e, r) => (g(), n(xo, { "session-id": t.sessionId }, null, 8, ["session-id"]));
|
|
3520
3628
|
}
|
|
3521
3629
|
});
|
|
3522
3630
|
//#endregion
|
|
3523
|
-
export {
|
|
3631
|
+
export { So as default };
|