@kvman/kvcoder 0.1.1 → 0.1.2
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 +34 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/connectors/delegate.d.ts.map +1 -1
- package/dist/connectors/delegate.js +1 -0
- package/dist/connectors/delegate.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/prompt/session-prompt.d.ts +1 -1
- package/dist/prompt/session-prompt.d.ts.map +1 -1
- package/dist/prompt/session-prompt.js +17 -2
- package/dist/prompt/session-prompt.js.map +1 -1
- package/dist/registry/register-connectors.d.ts +1 -0
- package/dist/registry/register-connectors.d.ts.map +1 -1
- package/dist/registry/register-connectors.js +32 -4
- package/dist/registry/register-connectors.js.map +1 -1
- package/dist/registry/register-slash-commands.d.ts +6 -0
- package/dist/registry/register-slash-commands.d.ts.map +1 -0
- package/dist/registry/register-slash-commands.js +85 -0
- package/dist/registry/register-slash-commands.js.map +1 -0
- package/dist/schemas/records.d.ts +1 -0
- package/dist/schemas/records.d.ts.map +1 -1
- package/dist/schemas/records.js +2 -0
- package/dist/schemas/records.js.map +1 -1
- package/dist/schemas/registry.d.ts +32 -0
- package/dist/schemas/registry.d.ts.map +1 -1
- package/dist/schemas/registry.js +9 -2
- package/dist/schemas/registry.js.map +1 -1
- package/dist/sessions/new-session.d.ts.map +1 -1
- package/dist/sessions/new-session.js +1 -0
- package/dist/sessions/new-session.js.map +1 -1
- package/dist/store/collections.d.ts +18 -0
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/collections.js +5 -2
- package/dist/store/collections.js.map +1 -1
- package/dist/turns/start-turn.d.ts +1 -0
- package/dist/turns/start-turn.d.ts.map +1 -1
- package/dist/web/components/conversation.js +217 -168
- package/docs/connectors.md +21 -1
- package/locales/ar.json +4 -0
- package/locales/en.json +4 -0
- package/package.json +3 -3
|
@@ -53,19 +53,19 @@ function I(e, t = {}) {
|
|
|
53
53
|
var L = (e) => {
|
|
54
54
|
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
55
55
|
return !1;
|
|
56
|
-
}, R = (e) => e === "",
|
|
57
|
-
function
|
|
58
|
-
return u(
|
|
56
|
+
}, R = (e) => e === "", z = (e) => e?.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), B = /* @__PURE__ */ Symbol("lucide-icons");
|
|
57
|
+
function V() {
|
|
58
|
+
return u(B, {});
|
|
59
59
|
}
|
|
60
60
|
//#endregion
|
|
61
61
|
//#region ../../node_modules/.pnpm/@lucide+vue@1.49.0_vue@3.5.43_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/Icon.mjs
|
|
62
|
-
var
|
|
63
|
-
name: e &&
|
|
62
|
+
var H = ({ name: e, iconNode: t, "icon-node": n, icon: r = {
|
|
63
|
+
name: e && z(e),
|
|
64
64
|
node: t ?? n ?? [],
|
|
65
65
|
size: 24,
|
|
66
66
|
aliases: []
|
|
67
67
|
}, absoluteStrokeWidth: i, "absolute-stroke-width": a, nonScalingStroke: o, "non-scaling-stroke": s, strokeWidth: c, "stroke-width": u, size: d, width: f = d, height: p = d, color: m, ...h }, { slots: g }) => {
|
|
68
|
-
let { size: _, color: v, strokeWidth: y = 2, absoluteStrokeWidth: b = !1, nonScalingStroke: x = !1, class: S = "" } =
|
|
68
|
+
let { size: _, color: v, strokeWidth: y = 2, absoluteStrokeWidth: b = !1, nonScalingStroke: x = !1, class: S = "" } = V(), C = R(i) || R(a) || i === !0 || a === !0 || b === !0, w = R(o) || R(s) || o === !0 || s === !0 || x === !0;
|
|
69
69
|
delete h.class;
|
|
70
70
|
let T = g.default?.(), [, E, D = []] = I(r, {
|
|
71
71
|
color: m ?? v,
|
|
@@ -82,17 +82,17 @@ var V = ({ name: e, iconNode: t, "icon-node": n, icon: r = {
|
|
|
82
82
|
};
|
|
83
83
|
//#endregion
|
|
84
84
|
//#region ../../node_modules/.pnpm/@lucide+vue@1.49.0_vue@3.5.43_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/createLucideIcon.mjs
|
|
85
|
-
function
|
|
85
|
+
function U(e, t = []) {
|
|
86
86
|
let n = typeof e == "string" ? {
|
|
87
87
|
name: e,
|
|
88
88
|
node: t
|
|
89
89
|
} : e;
|
|
90
|
-
return (e, { slots: t }) => l(
|
|
90
|
+
return (e, { slots: t }) => l(H, {
|
|
91
91
|
...e,
|
|
92
92
|
icon: n
|
|
93
93
|
}, t.default ? { default: t.default } : void 0);
|
|
94
94
|
}
|
|
95
|
-
var
|
|
95
|
+
var ee = U({
|
|
96
96
|
name: "arrow-down",
|
|
97
97
|
size: 24,
|
|
98
98
|
node: [["path", {
|
|
@@ -102,7 +102,7 @@ var te = H({
|
|
|
102
102
|
d: "m19 12-7 7-7-7",
|
|
103
103
|
key: "1idqje"
|
|
104
104
|
}]]
|
|
105
|
-
}),
|
|
105
|
+
}), W = U({
|
|
106
106
|
name: "arrow-left",
|
|
107
107
|
size: 24,
|
|
108
108
|
node: [["path", {
|
|
@@ -112,7 +112,7 @@ var te = H({
|
|
|
112
112
|
d: "M19 12H5",
|
|
113
113
|
key: "x3x0zl"
|
|
114
114
|
}]]
|
|
115
|
-
}),
|
|
115
|
+
}), G = U({
|
|
116
116
|
name: "arrow-up",
|
|
117
117
|
size: 24,
|
|
118
118
|
node: [["path", {
|
|
@@ -122,7 +122,7 @@ var te = H({
|
|
|
122
122
|
d: "M12 19V5",
|
|
123
123
|
key: "x0mq9r"
|
|
124
124
|
}]]
|
|
125
|
-
}),
|
|
125
|
+
}), te = U({
|
|
126
126
|
name: "bell-ring",
|
|
127
127
|
size: 24,
|
|
128
128
|
node: [
|
|
@@ -143,7 +143,7 @@ var te = H({
|
|
|
143
143
|
key: "tap9e0"
|
|
144
144
|
}]
|
|
145
145
|
]
|
|
146
|
-
}),
|
|
146
|
+
}), ne = U({
|
|
147
147
|
name: "bot",
|
|
148
148
|
size: 24,
|
|
149
149
|
node: [
|
|
@@ -176,28 +176,28 @@ var te = H({
|
|
|
176
176
|
key: "rq6x2g"
|
|
177
177
|
}]
|
|
178
178
|
]
|
|
179
|
-
}),
|
|
179
|
+
}), K = 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
|
+
}), re = 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
|
-
}), q =
|
|
193
|
+
}), q = U({
|
|
194
194
|
name: "chevron-right",
|
|
195
195
|
size: 24,
|
|
196
196
|
node: [["path", {
|
|
197
197
|
d: "m9 18 6-6-6-6",
|
|
198
198
|
key: "mthhwq"
|
|
199
199
|
}]]
|
|
200
|
-
}), ie =
|
|
200
|
+
}), ie = U({
|
|
201
201
|
name: "circle-check",
|
|
202
202
|
size: 24,
|
|
203
203
|
node: [["circle", {
|
|
@@ -210,7 +210,7 @@ var te = H({
|
|
|
210
210
|
key: "xofnsj"
|
|
211
211
|
}]],
|
|
212
212
|
aliases: ["check-circle-2"]
|
|
213
|
-
}), ae =
|
|
213
|
+
}), ae = U({
|
|
214
214
|
name: "circle-question-mark",
|
|
215
215
|
size: 24,
|
|
216
216
|
node: [
|
|
@@ -230,7 +230,7 @@ var te = H({
|
|
|
230
230
|
}]
|
|
231
231
|
],
|
|
232
232
|
aliases: ["help-circle", "circle-help"]
|
|
233
|
-
}), oe =
|
|
233
|
+
}), oe = U({
|
|
234
234
|
name: "code",
|
|
235
235
|
size: 24,
|
|
236
236
|
node: [["path", {
|
|
@@ -240,7 +240,7 @@ var te = H({
|
|
|
240
240
|
d: "m8 6-6 6 6 6",
|
|
241
241
|
key: "ppft3o"
|
|
242
242
|
}]]
|
|
243
|
-
}), se =
|
|
243
|
+
}), se = U({
|
|
244
244
|
name: "copy",
|
|
245
245
|
size: 24,
|
|
246
246
|
node: [["rect", {
|
|
@@ -255,7 +255,7 @@ var te = H({
|
|
|
255
255
|
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",
|
|
256
256
|
key: "zix9uf"
|
|
257
257
|
}]]
|
|
258
|
-
}), ce =
|
|
258
|
+
}), ce = U({
|
|
259
259
|
name: "ellipsis",
|
|
260
260
|
size: 24,
|
|
261
261
|
node: [
|
|
@@ -279,7 +279,7 @@ var te = H({
|
|
|
279
279
|
}]
|
|
280
280
|
],
|
|
281
281
|
aliases: ["more-horizontal"]
|
|
282
|
-
}), le =
|
|
282
|
+
}), le = U({
|
|
283
283
|
name: "external-link",
|
|
284
284
|
size: 24,
|
|
285
285
|
node: [
|
|
@@ -296,7 +296,7 @@ var te = H({
|
|
|
296
296
|
key: "a6xqqp"
|
|
297
297
|
}]
|
|
298
298
|
]
|
|
299
|
-
}), ue =
|
|
299
|
+
}), ue = U({
|
|
300
300
|
name: "eye",
|
|
301
301
|
size: 24,
|
|
302
302
|
node: [["path", {
|
|
@@ -308,7 +308,7 @@ var te = H({
|
|
|
308
308
|
r: "3",
|
|
309
309
|
key: "1v7zrd"
|
|
310
310
|
}]]
|
|
311
|
-
}), de =
|
|
311
|
+
}), de = U({
|
|
312
312
|
name: "info",
|
|
313
313
|
size: 24,
|
|
314
314
|
node: [
|
|
@@ -327,7 +327,7 @@ var te = H({
|
|
|
327
327
|
key: "e9boi3"
|
|
328
328
|
}]
|
|
329
329
|
]
|
|
330
|
-
}), fe =
|
|
330
|
+
}), fe = U({
|
|
331
331
|
name: "notebook-text",
|
|
332
332
|
size: 24,
|
|
333
333
|
node: [
|
|
@@ -368,7 +368,7 @@ var te = H({
|
|
|
368
368
|
key: "p1seyn"
|
|
369
369
|
}]
|
|
370
370
|
]
|
|
371
|
-
}), pe =
|
|
371
|
+
}), pe = U({
|
|
372
372
|
name: "panel-right",
|
|
373
373
|
size: 24,
|
|
374
374
|
node: [["rect", {
|
|
@@ -382,14 +382,14 @@ var te = H({
|
|
|
382
382
|
d: "M15 3v18",
|
|
383
383
|
key: "14nvp0"
|
|
384
384
|
}]]
|
|
385
|
-
}), me =
|
|
385
|
+
}), me = U({
|
|
386
386
|
name: "paperclip",
|
|
387
387
|
size: 24,
|
|
388
388
|
node: [["path", {
|
|
389
389
|
d: "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",
|
|
390
390
|
key: "1miecu"
|
|
391
391
|
}]]
|
|
392
|
-
}), he =
|
|
392
|
+
}), he = U({
|
|
393
393
|
name: "rotate-cw",
|
|
394
394
|
size: 24,
|
|
395
395
|
node: [["path", {
|
|
@@ -399,7 +399,7 @@ var te = H({
|
|
|
399
399
|
d: "M21 3v5h-5",
|
|
400
400
|
key: "1q7to0"
|
|
401
401
|
}]]
|
|
402
|
-
}), ge =
|
|
402
|
+
}), ge = U({
|
|
403
403
|
name: "scroll-text",
|
|
404
404
|
size: 24,
|
|
405
405
|
node: [
|
|
@@ -420,7 +420,7 @@ var te = H({
|
|
|
420
420
|
key: "1ph1d7"
|
|
421
421
|
}]
|
|
422
422
|
]
|
|
423
|
-
}), _e =
|
|
423
|
+
}), _e = U({
|
|
424
424
|
name: "search",
|
|
425
425
|
size: 24,
|
|
426
426
|
node: [["path", {
|
|
@@ -432,7 +432,7 @@ var te = H({
|
|
|
432
432
|
r: "8",
|
|
433
433
|
key: "4ej97u"
|
|
434
434
|
}]]
|
|
435
|
-
}), ve =
|
|
435
|
+
}), ve = U({
|
|
436
436
|
name: "shield-alert",
|
|
437
437
|
size: 24,
|
|
438
438
|
node: [
|
|
@@ -449,7 +449,7 @@ var te = H({
|
|
|
449
449
|
key: "1drbdi"
|
|
450
450
|
}]
|
|
451
451
|
]
|
|
452
|
-
}), ye =
|
|
452
|
+
}), ye = U({
|
|
453
453
|
name: "square",
|
|
454
454
|
size: 24,
|
|
455
455
|
node: [["rect", {
|
|
@@ -460,7 +460,7 @@ var te = H({
|
|
|
460
460
|
rx: "2",
|
|
461
461
|
key: "afitv7"
|
|
462
462
|
}]]
|
|
463
|
-
}), be =
|
|
463
|
+
}), be = U({
|
|
464
464
|
name: "x",
|
|
465
465
|
size: 24,
|
|
466
466
|
node: [["path", {
|
|
@@ -790,8 +790,15 @@ function yt(e) {
|
|
|
790
790
|
named: t[2] !== void 0
|
|
791
791
|
};
|
|
792
792
|
}
|
|
793
|
-
function bt(e) {
|
|
794
|
-
|
|
793
|
+
function bt(e, t) {
|
|
794
|
+
let n = (t) => e.named ? t === e.word : t.startsWith(e.word);
|
|
795
|
+
return [...vt.filter((e) => n(e.name)).map((e) => ({
|
|
796
|
+
kind: "own",
|
|
797
|
+
command: e
|
|
798
|
+
})), ...t.filter((e) => n(e.name)).map((e) => ({
|
|
799
|
+
kind: "registered",
|
|
800
|
+
command: e
|
|
801
|
+
}))];
|
|
795
802
|
}
|
|
796
803
|
//#endregion
|
|
797
804
|
//#region web/src/MessageComposer.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -830,19 +837,21 @@ var xt = { class: "kvc-composer" }, St = { class: "kvc-box" }, Ct = ["aria-label
|
|
|
830
837
|
running: { type: Boolean },
|
|
831
838
|
placeholder: {},
|
|
832
839
|
blocked: { type: Boolean },
|
|
833
|
-
commands: {}
|
|
840
|
+
commands: {},
|
|
841
|
+
registered: {}
|
|
834
842
|
},
|
|
835
843
|
emits: [
|
|
836
844
|
"send",
|
|
837
845
|
"stop",
|
|
838
|
-
"command"
|
|
846
|
+
"command",
|
|
847
|
+
"registered"
|
|
839
848
|
],
|
|
840
849
|
setup(n, { emit: c }) {
|
|
841
|
-
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 : yt(f.value)), C = t(() => l.commands === "wait"), E = t(() => S.value === void 0 ? [] : bt(S.value));
|
|
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 : yt(f.value)), C = t(() => l.commands === "wait"), E = t(() => S.value === void 0 ? [] : bt(S.value, l.registered ?? [])), k = (e) => e.kind === "own" && "argument" in e.command, j = (e) => d.t(e.kind === "own" ? `kvcoder.ui.slash.${e.command.name}` : e.command.description);
|
|
842
851
|
O(f, () => {
|
|
843
852
|
_.value = 0, x.value = !1;
|
|
844
853
|
});
|
|
845
|
-
async function
|
|
854
|
+
async function M(e) {
|
|
846
855
|
h.value = !0;
|
|
847
856
|
try {
|
|
848
857
|
for (let t of e) {
|
|
@@ -863,42 +872,42 @@ var xt = { class: "kvc-composer" }, St = { class: "kvc-box" }, Ct = ["aria-label
|
|
|
863
872
|
h.value = !1;
|
|
864
873
|
}
|
|
865
874
|
}
|
|
866
|
-
async function
|
|
875
|
+
async function N(e) {
|
|
867
876
|
let t = e.target;
|
|
868
|
-
t instanceof HTMLInputElement && t.files !== null && (await
|
|
877
|
+
t instanceof HTMLInputElement && t.files !== null && (await M([...t.files]), t.value = "");
|
|
869
878
|
}
|
|
870
|
-
function
|
|
879
|
+
function P(e) {
|
|
871
880
|
let t = [...e.clipboardData?.files ?? []];
|
|
872
|
-
t.length !== 0 && (e.preventDefault(),
|
|
881
|
+
t.length !== 0 && (e.preventDefault(), M(t));
|
|
873
882
|
}
|
|
874
|
-
function
|
|
883
|
+
function F() {
|
|
875
884
|
let e = E.value[_.value], t = S.value?.argument ?? "";
|
|
876
|
-
C.value || l.blocked === !0 || e === void 0 ||
|
|
885
|
+
C.value || l.blocked === !0 || e === void 0 || k(e) && t === "" || (e.kind === "own" ? u("command", e.command.name, t) : u("registered", e.command, t), f.value = "");
|
|
877
886
|
}
|
|
878
|
-
function
|
|
879
|
-
if (S.value !== void 0) return
|
|
887
|
+
function I() {
|
|
888
|
+
if (S.value !== void 0) return F();
|
|
880
889
|
let e = f.value.trim();
|
|
881
890
|
e === "" || h.value || l.blocked === !0 || (u("send", {
|
|
882
891
|
text: e,
|
|
883
892
|
fileIds: p.value.map((e) => e.id)
|
|
884
893
|
}), f.value = "", p.value = []);
|
|
885
894
|
}
|
|
886
|
-
function
|
|
895
|
+
function L(e) {
|
|
887
896
|
!C.value && E.value.length > 0 && (_.value = (_.value + e + E.value.length) % E.value.length);
|
|
888
897
|
}
|
|
889
|
-
function
|
|
898
|
+
function R(e) {
|
|
890
899
|
if (S.value === void 0) return !1;
|
|
891
900
|
let t = E.value[_.value];
|
|
892
901
|
if (e.key === "Escape") x.value = !0;
|
|
893
|
-
else if (e.key === "ArrowDown")
|
|
894
|
-
else if (e.key === "ArrowUp")
|
|
895
|
-
else if (e.key === "Tab" && t !== void 0 && !C.value) f.value = `/${t.name} `;
|
|
902
|
+
else if (e.key === "ArrowDown") L(1);
|
|
903
|
+
else if (e.key === "ArrowUp") L(-1);
|
|
904
|
+
else if (e.key === "Tab" && t !== void 0 && !C.value) f.value = `/${t.command.name} `;
|
|
896
905
|
else return !1;
|
|
897
906
|
return !0;
|
|
898
907
|
}
|
|
899
|
-
function
|
|
900
|
-
if (
|
|
901
|
-
e.key !== "Enter" || e.shiftKey || e.isComposing || (e.preventDefault(),
|
|
908
|
+
function z(e) {
|
|
909
|
+
if (R(e)) return e.preventDefault();
|
|
910
|
+
e.key !== "Enter" || e.shiftKey || e.isComposing || (e.preventDefault(), I());
|
|
902
911
|
}
|
|
903
912
|
return (t, n) => (g(), i("div", xt, [a("div", St, [
|
|
904
913
|
S.value !== void 0 && !x.value ? (g(), i("div", {
|
|
@@ -910,18 +919,18 @@ var xt = { class: "kvc-composer" }, St = { class: "kvc-box" }, Ct = ["aria-label
|
|
|
910
919
|
}, [
|
|
911
920
|
C.value ? (g(), i("p", wt, w(T(d).t("kvcoder.ui.slash.wait")), 1)) : r("v-if", !0),
|
|
912
921
|
(g(!0), i(e, null, y(E.value, (t, n) => (g(), i("div", {
|
|
913
|
-
key: t.name,
|
|
922
|
+
key: t.command.name,
|
|
914
923
|
class: "kvc-slash-row",
|
|
915
924
|
role: "option",
|
|
916
925
|
"aria-disabled": C.value,
|
|
917
926
|
"aria-selected": !C.value && n === _.value,
|
|
918
927
|
"data-active": !C.value && n === _.value,
|
|
919
|
-
"data-test": `slash-${t.name}`,
|
|
928
|
+
"data-test": `slash-${t.command.name}`,
|
|
920
929
|
onMousemove: (e) => _.value = n,
|
|
921
930
|
onClick: (e) => {
|
|
922
|
-
_.value = n,
|
|
931
|
+
_.value = n, F();
|
|
923
932
|
}
|
|
924
|
-
}, [a("span", Et, [a("span", Dt, [o("/" + w(t.name), 1),
|
|
933
|
+
}, [a("span", Et, [a("span", Dt, [o("/" + w(t.command.name), 1), k(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", Ot, w(j(t)), 1)], 40, Tt))), 128)),
|
|
925
934
|
E.value.length === 0 ? (g(), i("p", kt, w(T(d).t("kvcoder.ui.slash.none")), 1)) : r("v-if", !0)
|
|
926
935
|
], 8, Ct)) : r("v-if", !0),
|
|
927
936
|
p.value.length > 0 ? (g(), i("div", At, [(g(!0), i(e, null, y(p.value, (e) => (g(), i("span", {
|
|
@@ -944,8 +953,8 @@ var xt = { class: "kvc-composer" }, St = { class: "kvc-box" }, Ct = ["aria-label
|
|
|
944
953
|
"aria-label": l.placeholder,
|
|
945
954
|
rows: "2",
|
|
946
955
|
"data-test": "composer-text",
|
|
947
|
-
onKeydown:
|
|
948
|
-
onPaste:
|
|
956
|
+
onKeydown: z,
|
|
957
|
+
onPaste: P
|
|
949
958
|
}, null, 40, Mt), [[D, f.value]]),
|
|
950
959
|
a("div", Nt, [
|
|
951
960
|
a("input", {
|
|
@@ -955,7 +964,7 @@ var xt = { class: "kvc-composer" }, St = { class: "kvc-box" }, Ct = ["aria-label
|
|
|
955
964
|
multiple: "",
|
|
956
965
|
hidden: "",
|
|
957
966
|
"data-test": "composer-files",
|
|
958
|
-
onChange:
|
|
967
|
+
onChange: N
|
|
959
968
|
}, null, 544),
|
|
960
969
|
a("button", {
|
|
961
970
|
type: "button",
|
|
@@ -980,8 +989,8 @@ var xt = { class: "kvc-composer" }, St = { class: "kvc-box" }, Ct = ["aria-label
|
|
|
980
989
|
"aria-label": T(d).t("kvcoder.ui.send"),
|
|
981
990
|
disabled: f.value.trim() === "" || h.value || l.blocked === !0,
|
|
982
991
|
"data-test": "send",
|
|
983
|
-
onClick:
|
|
984
|
-
}, [s(T(
|
|
992
|
+
onClick: I
|
|
993
|
+
}, [s(T(G), { size: 16 })], 8, It)
|
|
985
994
|
])
|
|
986
995
|
])]));
|
|
987
996
|
}
|
|
@@ -1063,41 +1072,41 @@ var Bt = [
|
|
|
1063
1072
|
function R() {
|
|
1064
1073
|
m.value = !1, b.value?.focus();
|
|
1065
1074
|
}
|
|
1066
|
-
async function
|
|
1067
|
-
h.value = "", _.value = Math.max(L(l.current ?? ""), 0),
|
|
1075
|
+
async function z() {
|
|
1076
|
+
h.value = "", _.value = Math.max(L(l.current ?? ""), 0), B = 0, m.value = !0, await d(), H(), x.value?.focus(), ee();
|
|
1068
1077
|
}
|
|
1069
|
-
let
|
|
1070
|
-
function
|
|
1078
|
+
let B = 0, V = 0;
|
|
1079
|
+
function H() {
|
|
1071
1080
|
let e = S.value, t = b.value?.closest(".kvc-conversation")?.getBoundingClientRect();
|
|
1072
1081
|
if (e === null || t === void 0) return;
|
|
1073
|
-
let n = e.getBoundingClientRect(), r = t.left + tn - (n.left -
|
|
1074
|
-
a !==
|
|
1082
|
+
let n = e.getBoundingClientRect(), r = t.left + tn - (n.left - B), i = t.right - tn - (n.right - B), a = r > 0 ? r : i < 0 ? i : 0;
|
|
1083
|
+
a !== B && (B = a, e.style.translate = `${a}px 0`);
|
|
1075
1084
|
}
|
|
1076
|
-
function
|
|
1077
|
-
|
|
1085
|
+
function U() {
|
|
1086
|
+
H(), V = requestAnimationFrame(U);
|
|
1078
1087
|
}
|
|
1079
|
-
function
|
|
1088
|
+
function ee() {
|
|
1080
1089
|
S.value?.querySelector("[data-active=\"true\"]")?.scrollIntoView?.({ block: "nearest" });
|
|
1081
1090
|
}
|
|
1082
|
-
async function
|
|
1083
|
-
I.value !== 0 && (_.value = (_.value + e + I.value) % I.value, await d(),
|
|
1091
|
+
async function W(e) {
|
|
1092
|
+
I.value !== 0 && (_.value = (_.value + e + I.value) % I.value, await d(), ee());
|
|
1084
1093
|
}
|
|
1085
|
-
function
|
|
1094
|
+
function G(e) {
|
|
1086
1095
|
e !== void 0 && (u("pick", e), R());
|
|
1087
1096
|
}
|
|
1088
|
-
function
|
|
1097
|
+
function te() {
|
|
1089
1098
|
u("none"), R();
|
|
1090
1099
|
}
|
|
1091
|
-
function
|
|
1092
|
-
P.value && _.value === 0 ?
|
|
1100
|
+
function ne() {
|
|
1101
|
+
P.value && _.value === 0 ? te() : G(k.value[_.value - F.value]?.id);
|
|
1093
1102
|
}
|
|
1094
1103
|
function q(e) {
|
|
1095
1104
|
e.target instanceof Node && !b.value?.parentElement?.contains(e.target) && (m.value = !1);
|
|
1096
1105
|
}
|
|
1097
1106
|
return O(h, () => _.value = 0), O(m, (e) => {
|
|
1098
|
-
e ? (document.addEventListener("pointerdown", q),
|
|
1107
|
+
e ? (document.addEventListener("pointerdown", q), V = requestAnimationFrame(U)) : (document.removeEventListener("pointerdown", q), cancelAnimationFrame(V));
|
|
1099
1108
|
}), p(() => {
|
|
1100
|
-
document.removeEventListener("pointerdown", q), cancelAnimationFrame(
|
|
1109
|
+
document.removeEventListener("pointerdown", q), cancelAnimationFrame(V);
|
|
1101
1110
|
}), (t, o) => (g(), i("div", Vt, [a("button", {
|
|
1102
1111
|
ref_key: "trigger",
|
|
1103
1112
|
ref: b,
|
|
@@ -1108,8 +1117,8 @@ var Bt = [
|
|
|
1108
1117
|
"aria-label": `${T(f).t("kvcoder.ui.model")}: ${N.value}`,
|
|
1109
1118
|
disabled: l.disabled,
|
|
1110
1119
|
"data-test": "model-picker",
|
|
1111
|
-
onClick: o[0] ||= (e) => m.value ? R() :
|
|
1112
|
-
}, [a("span", Ut, w(N.value), 1), s(T(
|
|
1120
|
+
onClick: o[0] ||= (e) => m.value ? R() : z()
|
|
1121
|
+
}, [a("span", Ut, w(N.value), 1), s(T(re), {
|
|
1113
1122
|
size: 16,
|
|
1114
1123
|
"aria-hidden": "true"
|
|
1115
1124
|
})], 8, Ht), m.value ? (g(), i("div", {
|
|
@@ -1135,9 +1144,9 @@ var Bt = [
|
|
|
1135
1144
|
"aria-label": T(f).t("kvcoder.ui.searchModels"),
|
|
1136
1145
|
"data-test": "model-search",
|
|
1137
1146
|
onKeydown: [
|
|
1138
|
-
o[2] ||= j(M((e) =>
|
|
1139
|
-
o[3] ||= j(M((e) =>
|
|
1140
|
-
j(M(
|
|
1147
|
+
o[2] ||= j(M((e) => W(1), ["prevent"]), ["down"]),
|
|
1148
|
+
o[3] ||= j(M((e) => W(-1), ["prevent"]), ["up"]),
|
|
1149
|
+
j(M(ne, ["prevent"]), ["enter"])
|
|
1141
1150
|
]
|
|
1142
1151
|
}, null, 40, Kt), [[D, h.value]])]),
|
|
1143
1152
|
a("div", {
|
|
@@ -1153,9 +1162,9 @@ var Bt = [
|
|
|
1153
1162
|
"aria-selected": l.current === null,
|
|
1154
1163
|
"data-active": _.value === 0,
|
|
1155
1164
|
"data-test": "model-none-entry",
|
|
1156
|
-
onClick:
|
|
1165
|
+
onClick: te,
|
|
1157
1166
|
onMousemove: o[4] ||= (e) => _.value = 0
|
|
1158
|
-
}, [a("span", Yt, w(l.none), 1), l.current === null ? (g(), n(T(
|
|
1167
|
+
}, [a("span", Yt, w(l.none), 1), l.current === null ? (g(), n(T(K), {
|
|
1159
1168
|
key: 0,
|
|
1160
1169
|
size: 16,
|
|
1161
1170
|
"aria-hidden": "true"
|
|
@@ -1167,9 +1176,9 @@ var Bt = [
|
|
|
1167
1176
|
"aria-selected": e.id === l.current,
|
|
1168
1177
|
"data-active": L(e.id) === _.value,
|
|
1169
1178
|
"data-test": `model-${e.id}`,
|
|
1170
|
-
onClick: (t) =>
|
|
1179
|
+
onClick: (t) => G(e.id),
|
|
1171
1180
|
onMousemove: (t) => _.value = L(e.id)
|
|
1172
|
-
}, [a("span", Qt, w(e.name), 1), e.id === l.current ? (g(), n(T(
|
|
1181
|
+
}, [a("span", Qt, w(e.name), 1), e.id === l.current ? (g(), n(T(K), {
|
|
1173
1182
|
key: 0,
|
|
1174
1183
|
size: 16,
|
|
1175
1184
|
"aria-hidden": "true"
|
|
@@ -1288,17 +1297,18 @@ var dn = {
|
|
|
1288
1297
|
class: "kvc-muted kvc-start-note"
|
|
1289
1298
|
}, hn = /* @__PURE__ */ c({
|
|
1290
1299
|
__name: "ChatStart",
|
|
1300
|
+
props: { registered: {} },
|
|
1291
1301
|
setup(t) {
|
|
1292
|
-
let n = J(), r = un(n, (e) => X(n, e));
|
|
1293
|
-
async function c(e) {
|
|
1294
|
-
r.pickModel(e), await sn(n, e);
|
|
1295
|
-
}
|
|
1302
|
+
let n = J(), r = t, c = un(n, (e) => X(n, e));
|
|
1296
1303
|
async function l(e) {
|
|
1304
|
+
c.pickModel(e), await sn(n, e);
|
|
1305
|
+
}
|
|
1306
|
+
async function u(e) {
|
|
1297
1307
|
try {
|
|
1298
|
-
let { id: t } = await n.exec("kvcoder.session.create", {}),
|
|
1299
|
-
Object.keys(
|
|
1308
|
+
let { id: t } = await n.exec("kvcoder.session.create", {}), r = c.changes();
|
|
1309
|
+
Object.keys(r).length > 0 && await n.exec("kvcoder.session.configure", {
|
|
1300
1310
|
sessionId: t,
|
|
1301
|
-
...
|
|
1311
|
+
...r
|
|
1302
1312
|
}), await n.exec("kvcoder.message.send", {
|
|
1303
1313
|
sessionId: t,
|
|
1304
1314
|
text: e.text,
|
|
@@ -1308,25 +1318,26 @@ var dn = {
|
|
|
1308
1318
|
X(n, e);
|
|
1309
1319
|
}
|
|
1310
1320
|
}
|
|
1311
|
-
return (t,
|
|
1321
|
+
return (t, d) => (g(), i(e, null, [a("div", dn, [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", fn, [o(w(T(n).t("kvcoder.ui.keyNeeded", { provider: T(c).provider.value.title })) + " ", 1), a("button", {
|
|
1312
1322
|
type: "button",
|
|
1313
1323
|
class: "kvc-link-button",
|
|
1314
1324
|
"data-test": "add-key",
|
|
1315
|
-
onClick:
|
|
1316
|
-
}, w(T(n).t("kvcoder.ui.addKey")), 1)])) : T(
|
|
1325
|
+
onClick: d[0] ||= (e) => T(n).navigate("kvai.provider", { providerId: T(c).provider.value.id })
|
|
1326
|
+
}, w(T(n).t("kvcoder.ui.addKey")), 1)])) : T(c).state.value === "noModel" ? (g(), i("p", pn, w(T(n).t("kvcoder.ui.chooseModelHint")), 1)) : (g(), i("p", mn, w(T(n).t("kvcoder.ui.startHint")), 1))]), s(Lt, {
|
|
1317
1327
|
running: !1,
|
|
1318
1328
|
placeholder: T(n).t("kvcoder.ui.startPlaceholder"),
|
|
1319
|
-
blocked: T(
|
|
1329
|
+
blocked: T(c).state.value !== "ready",
|
|
1320
1330
|
commands: "wait",
|
|
1321
|
-
|
|
1331
|
+
registered: r.registered,
|
|
1332
|
+
onSend: u
|
|
1322
1333
|
}, {
|
|
1323
1334
|
controls: k(() => [s(on, {
|
|
1324
|
-
groups: T(
|
|
1325
|
-
model: T(
|
|
1326
|
-
thinking: T(
|
|
1327
|
-
empty: T(
|
|
1328
|
-
onModel:
|
|
1329
|
-
onThinking: T(
|
|
1335
|
+
groups: T(c).groups.value,
|
|
1336
|
+
model: T(c).current.value,
|
|
1337
|
+
thinking: T(c).thinking.value,
|
|
1338
|
+
empty: T(c).state.value === "loading" ? "" : T(n).t("kvcoder.ui.chooseModel"),
|
|
1339
|
+
onModel: l,
|
|
1340
|
+
onThinking: T(c).pickThinking
|
|
1330
1341
|
}, null, 8, [
|
|
1331
1342
|
"groups",
|
|
1332
1343
|
"model",
|
|
@@ -1335,7 +1346,11 @@ var dn = {
|
|
|
1335
1346
|
"onThinking"
|
|
1336
1347
|
])]),
|
|
1337
1348
|
_: 1
|
|
1338
|
-
}, 8, [
|
|
1349
|
+
}, 8, [
|
|
1350
|
+
"placeholder",
|
|
1351
|
+
"blocked",
|
|
1352
|
+
"registered"
|
|
1353
|
+
])], 64));
|
|
1339
1354
|
}
|
|
1340
1355
|
});
|
|
1341
1356
|
//#endregion
|
|
@@ -1533,7 +1548,7 @@ var Tn = ["data-test", "data-status"], En = { class: "kvc-job-head" }, Dn = {
|
|
|
1533
1548
|
"aria-hidden": "true"
|
|
1534
1549
|
}, null, -1),
|
|
1535
1550
|
o(w(T(l).t("kvcoder.ui.jobs.running", { count: T(h).length })), 1),
|
|
1536
|
-
s(T(
|
|
1551
|
+
s(T(re), {
|
|
1537
1552
|
size: 16,
|
|
1538
1553
|
"aria-hidden": "true"
|
|
1539
1554
|
})
|
|
@@ -2043,7 +2058,7 @@ var Ir = ["aria-label"], Lr = {
|
|
|
2043
2058
|
"data-chosen": e.chosen,
|
|
2044
2059
|
"data-test": `answered-option-${e.id}`
|
|
2045
2060
|
}, [
|
|
2046
|
-
e.chosen ? (g(), n(T(
|
|
2061
|
+
e.chosen ? (g(), n(T(K), {
|
|
2047
2062
|
key: 0,
|
|
2048
2063
|
size: 16,
|
|
2049
2064
|
"aria-hidden": "true",
|
|
@@ -2051,7 +2066,7 @@ var Ir = ["aria-label"], Lr = {
|
|
|
2051
2066
|
})) : (g(), i("span", Hr)),
|
|
2052
2067
|
a("span", Ur, [a("span", Wr, w(e.label), 1), e.description ? (g(), i("span", Gr, w(e.description), 1)) : r("v-if", !0)]),
|
|
2053
2068
|
e.chosen ? (g(), i("span", Kr, w(T(l).t("kvcoder.ui.chosen")), 1)) : r("v-if", !0)
|
|
2054
|
-
], 8, Vr))), 128)), m.value === "" ? r("v-if", !0) : (g(), i("div", qr, [s(T(
|
|
2069
|
+
], 8, Vr))), 128)), m.value === "" ? r("v-if", !0) : (g(), i("div", qr, [s(T(K), {
|
|
2055
2070
|
size: 16,
|
|
2056
2071
|
"aria-hidden": "true",
|
|
2057
2072
|
class: "kvc-ok"
|
|
@@ -2206,7 +2221,7 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
|
|
|
2206
2221
|
key: 0,
|
|
2207
2222
|
class: "kvc-spin",
|
|
2208
2223
|
"aria-label": T(l).t("kvcoder.ui.running")
|
|
2209
|
-
}, null, 8, ui)) : (g(), n(x(u.value ? T(
|
|
2224
|
+
}, null, 8, ui)) : (g(), n(x(u.value ? T(re) : T(q)), {
|
|
2210
2225
|
key: 1,
|
|
2211
2226
|
size: 16,
|
|
2212
2227
|
"aria-hidden": "true"
|
|
@@ -2305,7 +2320,7 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
|
|
|
2305
2320
|
text: "kvcoder.markdown",
|
|
2306
2321
|
params: { text: e }
|
|
2307
2322
|
});
|
|
2308
|
-
return (t, c) => T(Nr)(u.message) ? (g(), i("div", wi, [a("details", null, [a("summary", Ti, [s(T(
|
|
2323
|
+
return (t, c) => T(Nr)(u.message) ? (g(), i("div", wi, [a("details", null, [a("summary", Ti, [s(T(te), {
|
|
2309
2324
|
size: 16,
|
|
2310
2325
|
"aria-hidden": "true"
|
|
2311
2326
|
}), o(w(T(p).t(u.message.source?.kind === "subagent" ? "kvcoder.ui.helperFinished" : "kvcoder.ui.backgroundFinished")), 1)]), a("pre", Ei, w(m.value), 1)])])) : T(Mr)(u.message) ? (g(), i("div", Di, [a("details", null, [a("summary", Oi, [s(T(de), {
|
|
@@ -2712,7 +2727,7 @@ var ya = {
|
|
|
2712
2727
|
class: "kvc-button",
|
|
2713
2728
|
"data-test": "prompt-back",
|
|
2714
2729
|
onClick: n[0] ||= (e) => l("back")
|
|
2715
|
-
}, [s(T(
|
|
2730
|
+
}, [s(T(W), {
|
|
2716
2731
|
size: 16,
|
|
2717
2732
|
class: "kvc-flip",
|
|
2718
2733
|
"aria-hidden": "true"
|
|
@@ -2787,6 +2802,16 @@ function ka(e, t, n) {
|
|
|
2787
2802
|
let { fileId: n } = await e.exec("kvcoder.session.export", { sessionId: t() });
|
|
2788
2803
|
window.location.assign(`/api/files/${encodeURIComponent(n)}?workspaceId=${encodeURIComponent(e.workspace.value.id)}`);
|
|
2789
2804
|
}),
|
|
2805
|
+
runRegistered: async (r, i) => {
|
|
2806
|
+
try {
|
|
2807
|
+
return await e.exec(r.command, {
|
|
2808
|
+
sessionId: t(),
|
|
2809
|
+
argument: i
|
|
2810
|
+
}), await n(), !0;
|
|
2811
|
+
} catch (t) {
|
|
2812
|
+
return X(e, t), !1;
|
|
2813
|
+
}
|
|
2814
|
+
},
|
|
2790
2815
|
remove: () => i(async () => {
|
|
2791
2816
|
await e.exec("kvcoder.session.delete", { sessionId: t() }), e.navigate("kvcoder.chat");
|
|
2792
2817
|
})
|
|
@@ -2846,7 +2871,7 @@ var Aa = /* @__PURE__ */ c({
|
|
|
2846
2871
|
"data-test": "subagent-card",
|
|
2847
2872
|
"aria-label": T(Pe)(T(l).t, o.child.session.title)
|
|
2848
2873
|
}, [a("div", Ma, [
|
|
2849
|
-
s(T(
|
|
2874
|
+
s(T(ne), {
|
|
2850
2875
|
size: 18,
|
|
2851
2876
|
"aria-hidden": "true"
|
|
2852
2877
|
}),
|
|
@@ -2911,7 +2936,7 @@ var Aa = /* @__PURE__ */ c({
|
|
|
2911
2936
|
"data-test": "worker-card",
|
|
2912
2937
|
"aria-label": o.value.title
|
|
2913
2938
|
}, [a("div", Ba, [
|
|
2914
|
-
s(T(
|
|
2939
|
+
s(T(ne), {
|
|
2915
2940
|
size: 18,
|
|
2916
2941
|
"aria-hidden": "true"
|
|
2917
2942
|
}),
|
|
@@ -3200,8 +3225,20 @@ function Qa(e, t, n) {
|
|
|
3200
3225
|
};
|
|
3201
3226
|
}
|
|
3202
3227
|
//#endregion
|
|
3228
|
+
//#region web/src/use-slash-commands.ts
|
|
3229
|
+
function $a(e) {
|
|
3230
|
+
let t = C([]);
|
|
3231
|
+
return m(async () => {
|
|
3232
|
+
try {
|
|
3233
|
+
t.value = await e.exec("kvcoder.slash.list", {});
|
|
3234
|
+
} catch (t) {
|
|
3235
|
+
X(e, t);
|
|
3236
|
+
}
|
|
3237
|
+
}), t;
|
|
3238
|
+
}
|
|
3239
|
+
//#endregion
|
|
3203
3240
|
//#region web/src/use-workspace-session.ts
|
|
3204
|
-
function
|
|
3241
|
+
function eo(e, n, r) {
|
|
3205
3242
|
let i = C(e.workspace.value.id);
|
|
3206
3243
|
async function a(t) {
|
|
3207
3244
|
let n;
|
|
@@ -3220,39 +3257,39 @@ function $a(e, n, r) {
|
|
|
3220
3257
|
}
|
|
3221
3258
|
//#endregion
|
|
3222
3259
|
//#region web/src/ConversationView.vue?vue&type=script&setup=true&lang.ts
|
|
3223
|
-
var
|
|
3260
|
+
var to = { class: "kvc-workspace" }, no = { class: "kvc-stage" }, ro = {
|
|
3224
3261
|
class: "kvc-conversation",
|
|
3225
3262
|
"data-test": "conversation"
|
|
3226
|
-
},
|
|
3263
|
+
}, io = { class: "kvc-scrollport" }, ao = {
|
|
3227
3264
|
key: 1,
|
|
3228
3265
|
class: "kvc-column"
|
|
3229
|
-
},
|
|
3266
|
+
}, oo = {
|
|
3230
3267
|
key: 0,
|
|
3231
3268
|
class: "kvc-muted",
|
|
3232
3269
|
"data-test": "turn-totals"
|
|
3233
|
-
},
|
|
3270
|
+
}, so = {
|
|
3234
3271
|
key: 2,
|
|
3235
3272
|
class: "kvc-notice",
|
|
3236
3273
|
"data-test": "summarizing"
|
|
3237
|
-
},
|
|
3274
|
+
}, co = {
|
|
3238
3275
|
key: 3,
|
|
3239
3276
|
class: "kvc-answer",
|
|
3240
3277
|
"data-test": "live-answer"
|
|
3241
|
-
},
|
|
3278
|
+
}, lo = ["open"], uo = { class: "kvc-muted" }, fo = {
|
|
3242
3279
|
class: "kvc-muted",
|
|
3243
3280
|
style: { "white-space": "pre-wrap" }
|
|
3244
|
-
},
|
|
3281
|
+
}, po = {
|
|
3245
3282
|
key: 6,
|
|
3246
3283
|
class: "kvc-muted",
|
|
3247
3284
|
style: {
|
|
3248
3285
|
"text-align": "center",
|
|
3249
3286
|
margin: "0"
|
|
3250
3287
|
}
|
|
3251
|
-
},
|
|
3288
|
+
}, mo = /* @__PURE__ */ c({
|
|
3252
3289
|
__name: "ConversationView",
|
|
3253
3290
|
props: { sessionId: {} },
|
|
3254
3291
|
setup(c) {
|
|
3255
|
-
let l = c, u = J(), d =
|
|
3292
|
+
let l = c, u = J(), d = eo(u, () => l.sessionId, (e) => X(u, e)), f = v("chat"), p = Xa(u, () => d.value, (e) => X(u, e)), { session: m, messages: h, omitted: _, turns: b, live: S, children: C } = p, D = Ja(u, () => d.value, () => m.value?.updatedAt, (e) => X(u, e)), O = t(() => D.open.value && D.shown.value !== void 0), A = t(() => Er(h.value)), j = /* @__PURE__ */ new Set([
|
|
3256
3293
|
"STEP_FAILED",
|
|
3257
3294
|
"REPLY_LOST",
|
|
3258
3295
|
"INTERRUPTED"
|
|
@@ -3272,7 +3309,7 @@ var eo = { class: "kvc-workspace" }, to = { class: "kvc-stage" }, no = {
|
|
|
3272
3309
|
sessionId: d.value,
|
|
3273
3310
|
text: e.text,
|
|
3274
3311
|
...e.fileIds.length > 0 ? { fileIds: e.fileIds } : {}
|
|
3275
|
-
}),
|
|
3312
|
+
}), G.resume(), await p.refresh();
|
|
3276
3313
|
} catch (e) {
|
|
3277
3314
|
X(u, e);
|
|
3278
3315
|
}
|
|
@@ -3284,10 +3321,10 @@ var eo = { class: "kvc-workspace" }, to = { class: "kvc-stage" }, no = {
|
|
|
3284
3321
|
X(u, e);
|
|
3285
3322
|
}
|
|
3286
3323
|
}
|
|
3287
|
-
let R = qa(u, (e) => p.refresh(e)),
|
|
3324
|
+
let R = qa(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(() => {
|
|
3288
3325
|
let e = h.value.at(-1);
|
|
3289
3326
|
return m.value?.status === "idle" && e?.kind === "notice" && j.has(String(e.content.code));
|
|
3290
|
-
}),
|
|
3327
|
+
}), H = $a(u), U = ka(u, () => d.value ?? "", () => p.refresh()), W = E("list"), G = Qa(W, () => [
|
|
3291
3328
|
h.value,
|
|
3292
3329
|
S.text,
|
|
3293
3330
|
S.thinking,
|
|
@@ -3297,9 +3334,9 @@ var eo = { class: "kvc-workspace" }, to = { class: "kvc-stage" }, no = {
|
|
|
3297
3334
|
P.value,
|
|
3298
3335
|
C.size,
|
|
3299
3336
|
R.hidden.value,
|
|
3300
|
-
|
|
3337
|
+
U.working.value
|
|
3301
3338
|
], () => d.value);
|
|
3302
|
-
async function
|
|
3339
|
+
async function te() {
|
|
3303
3340
|
if (d.value !== void 0) try {
|
|
3304
3341
|
let { fileId: e } = await u.exec("kvcoder.session.export", { sessionId: d.value });
|
|
3305
3342
|
window.location.assign(`/api/files/${encodeURIComponent(e)}?workspaceId=${encodeURIComponent(u.workspace.value.id)}`);
|
|
@@ -3308,21 +3345,27 @@ var eo = { class: "kvc-workspace" }, to = { class: "kvc-stage" }, no = {
|
|
|
3308
3345
|
}
|
|
3309
3346
|
}
|
|
3310
3347
|
let ne = () => h.value.at(-1)?.kind === "notice" && h.value.at(-1)?.content.code === "SUMMARY_FAILED";
|
|
3311
|
-
async function
|
|
3348
|
+
async function K() {
|
|
3312
3349
|
return (await u.exec("kernel.settings.list", {})).find((e) => e.key === "kvcoder.compactKeep")?.value ?? null;
|
|
3313
3350
|
}
|
|
3314
|
-
async function
|
|
3315
|
-
let e = await
|
|
3316
|
-
e === !0 ? u.toast("kvcoder.ui.summarized", {}, "success") : e === !1 && !ne() && u.toast("kvcoder.ui.nothingToSummarize", { count: await
|
|
3351
|
+
async function re() {
|
|
3352
|
+
let e = await U.compact();
|
|
3353
|
+
e === !0 ? u.toast("kvcoder.ui.summarized", {}, "success") : e === !1 && !ne() && u.toast("kvcoder.ui.nothingToSummarize", { count: await K() });
|
|
3317
3354
|
}
|
|
3318
|
-
function
|
|
3355
|
+
function q(e, t) {
|
|
3319
3356
|
if (e === "new") return u.navigate("kvcoder.chat");
|
|
3320
3357
|
if (e === "prompt") return void (f.value = f.value === "prompt" ? "chat" : "prompt");
|
|
3321
|
-
if (e === "delete") return void
|
|
3322
|
-
|
|
3358
|
+
if (e === "delete") return void U.remove();
|
|
3359
|
+
U.working.value === void 0 && (f.value = "chat", e === "rename" ? U.rename(t) : e === "compact" ? re() : e === "export" ? U.exportFile() : U.fork());
|
|
3323
3360
|
}
|
|
3324
|
-
|
|
3325
|
-
|
|
3361
|
+
async function ie(e, t) {
|
|
3362
|
+
U.working.value === void 0 && (f.value = "chat", await U.runRegistered(e, t) && e.message !== void 0 && await I({
|
|
3363
|
+
text: t === "" ? u.t(e.message) : t,
|
|
3364
|
+
fileIds: []
|
|
3365
|
+
}));
|
|
3366
|
+
}
|
|
3367
|
+
let ae = (e) => e.id;
|
|
3368
|
+
return (t, c) => (g(), i("div", to, [T(m) && T(d) !== void 0 ? (g(), n(rr, {
|
|
3326
3369
|
key: 0,
|
|
3327
3370
|
session: T(m),
|
|
3328
3371
|
tab: f.value,
|
|
@@ -3330,9 +3373,9 @@ var eo = { class: "kvc-workspace" }, to = { class: "kvc-stage" }, no = {
|
|
|
3330
3373
|
"running-since": N.value,
|
|
3331
3374
|
artifacts: T(D).list.value.length,
|
|
3332
3375
|
"artifacts-open": T(D).open.value,
|
|
3333
|
-
working: T(
|
|
3376
|
+
working: T(U).working.value !== void 0,
|
|
3334
3377
|
onTab: c[0] ||= (e) => f.value = e,
|
|
3335
|
-
onAction:
|
|
3378
|
+
onAction: q,
|
|
3336
3379
|
onToggleArtifacts: c[1] ||= (e) => T(D).toggle()
|
|
3337
3380
|
}, null, 8, [
|
|
3338
3381
|
"session",
|
|
@@ -3342,42 +3385,45 @@ var eo = { class: "kvc-workspace" }, to = { class: "kvc-stage" }, no = {
|
|
|
3342
3385
|
"artifacts",
|
|
3343
3386
|
"artifacts-open",
|
|
3344
3387
|
"working"
|
|
3345
|
-
])) : r("v-if", !0), a("div",
|
|
3388
|
+
])) : r("v-if", !0), a("div", no, [a("section", ro, [l.sessionId === void 0 ? (g(), n(hn, {
|
|
3389
|
+
key: 0,
|
|
3390
|
+
registered: T(H)
|
|
3391
|
+
}, null, 8, ["registered"])) : T(m) && T(d) !== void 0 ? (g(), i(e, { key: 1 }, [a("div", io, [a("div", {
|
|
3346
3392
|
ref_key: "list",
|
|
3347
|
-
ref:
|
|
3393
|
+
ref: W,
|
|
3348
3394
|
class: "kvc-scroll",
|
|
3349
|
-
onScroll: c[5] ||= (...e) => T(
|
|
3395
|
+
onScroll: c[5] ||= (...e) => T(G).onScroll && T(G).onScroll(...e)
|
|
3350
3396
|
}, [f.value === "prompt" ? (g(), n(Oa, {
|
|
3351
3397
|
key: 0,
|
|
3352
3398
|
"session-id": T(m).id,
|
|
3353
3399
|
onBack: c[2] ||= (e) => f.value = "chat"
|
|
3354
|
-
}, null, 8, ["session-id"])) : (g(), i("div",
|
|
3400
|
+
}, null, 8, ["session-id"])) : (g(), i("div", ao, [
|
|
3355
3401
|
T(_) > 0 ? (g(), i("button", {
|
|
3356
3402
|
key: 0,
|
|
3357
3403
|
type: "button",
|
|
3358
3404
|
class: "kvc-button",
|
|
3359
3405
|
style: { "align-self": "center" },
|
|
3360
3406
|
"data-test": "earlier",
|
|
3361
|
-
onClick:
|
|
3407
|
+
onClick: te
|
|
3362
3408
|
}, w(T(u).t("kvcoder.ui.earlierMessages", { count: T(_) })), 1)) : r("v-if", !0),
|
|
3363
|
-
(g(!0), i(e, null, y(T(h), (t) => (g(), i(e, { key:
|
|
3409
|
+
(g(!0), i(e, null, y(T(h), (t) => (g(), i(e, { key: ae(t) }, [s(Hi, {
|
|
3364
3410
|
message: t,
|
|
3365
3411
|
calls: A.value,
|
|
3366
3412
|
onOpenArtifact: c[3] ||= (e) => T(D).openArtifact(e)
|
|
3367
|
-
}, null, 8, ["message", "calls"]), F.value.has(t.id) ? (g(), i("span",
|
|
3368
|
-
|
|
3413
|
+
}, null, 8, ["message", "calls"]), F.value.has(t.id) ? (g(), i("span", oo, w(F.value.get(t.id)), 1)) : r("v-if", !0)], 64))), 128)),
|
|
3414
|
+
V.value ? (g(), n(xa, {
|
|
3369
3415
|
key: 1,
|
|
3370
3416
|
"session-id": T(m).id,
|
|
3371
3417
|
onSent: c[4] ||= (e) => {
|
|
3372
|
-
T(
|
|
3418
|
+
T(G).resume(), T(p).refresh();
|
|
3373
3419
|
}
|
|
3374
3420
|
}, null, 8, ["session-id"])) : r("v-if", !0),
|
|
3375
|
-
T(S).summarizing ? (g(), i("div",
|
|
3376
|
-
M.value && (T(S).text !== "" || T(S).thinking !== "") ? (g(), i("div",
|
|
3421
|
+
T(S).summarizing ? (g(), i("div", so, w(T(u).t("kvcoder.ui.summarizing")), 1)) : r("v-if", !0),
|
|
3422
|
+
M.value && (T(S).text !== "" || T(S).thinking !== "") ? (g(), i("div", co, [T(S).thinking === "" ? r("v-if", !0) : (g(), i("details", {
|
|
3377
3423
|
key: 0,
|
|
3378
3424
|
open: T(S).text === "" && T(S).calls.length === 0,
|
|
3379
3425
|
"data-test": "live-thinking"
|
|
3380
|
-
}, [a("summary",
|
|
3426
|
+
}, [a("summary", uo, w(T(u).t("kvcoder.ui.thinkingNow")), 1), a("p", fo, w(T(S).thinking), 1)], 8, lo)), T(S).text === "" ? r("v-if", !0) : (g(), n(x(T(u).View), {
|
|
3381
3427
|
key: 1,
|
|
3382
3428
|
view: {
|
|
3383
3429
|
type: "markdown",
|
|
@@ -3389,9 +3435,9 @@ var eo = { class: "kvc-workspace" }, to = { class: "kvc-stage" }, no = {
|
|
|
3389
3435
|
key: 4,
|
|
3390
3436
|
live: T(S)
|
|
3391
3437
|
}, null, 8, ["live"])) : r("v-if", !0),
|
|
3392
|
-
T(
|
|
3438
|
+
T(U).working.value ? (g(), n(xn, {
|
|
3393
3439
|
key: 5,
|
|
3394
|
-
working: T(
|
|
3440
|
+
working: T(U).working.value
|
|
3395
3441
|
}, null, 8, ["working"])) : r("v-if", !0),
|
|
3396
3442
|
(g(!0), i(e, null, y(T(C), ([e, t]) => (g(), n(Ra, {
|
|
3397
3443
|
key: e,
|
|
@@ -3405,7 +3451,7 @@ var eo = { class: "kvc-workspace" }, to = { class: "kvc-stage" }, no = {
|
|
|
3405
3451
|
"onAnswer",
|
|
3406
3452
|
"onDecide"
|
|
3407
3453
|
]))), 128)),
|
|
3408
|
-
(g(!0), i(e, null, y(
|
|
3454
|
+
(g(!0), i(e, null, y(z.value, (e) => (g(), n(Ga, {
|
|
3409
3455
|
key: e,
|
|
3410
3456
|
"session-id": T(m).id,
|
|
3411
3457
|
"run-id": e
|
|
@@ -3421,24 +3467,26 @@ var eo = { class: "kvc-workspace" }, to = { class: "kvc-stage" }, no = {
|
|
|
3421
3467
|
"onAnswer",
|
|
3422
3468
|
"onDecide"
|
|
3423
3469
|
]),
|
|
3424
|
-
|
|
3425
|
-
]))], 544), T(
|
|
3470
|
+
B.value.some((e) => e.kind !== "subagent" && e.kind !== "worker") ? (g(), i("p", po, w(T(u).t("kvcoder.ui.messageDismisses")), 1)) : r("v-if", !0)
|
|
3471
|
+
]))], 544), T(G).away.value ? (g(), i("button", {
|
|
3426
3472
|
key: 0,
|
|
3427
3473
|
type: "button",
|
|
3428
3474
|
class: "kvc-button kvc-jump",
|
|
3429
3475
|
"data-test": "jump-to-latest",
|
|
3430
|
-
onClick: c[6] ||= (...e) => T(
|
|
3431
|
-
}, [s(T(
|
|
3476
|
+
onClick: c[6] ||= (...e) => T(G).resume && T(G).resume(...e)
|
|
3477
|
+
}, [s(T(ee), {
|
|
3432
3478
|
size: 16,
|
|
3433
3479
|
"aria-hidden": "true"
|
|
3434
3480
|
}), o(w(T(u).t("kvcoder.ui.jumpToLatest")), 1)])) : r("v-if", !0)]), s(Lt, {
|
|
3435
3481
|
running: M.value,
|
|
3436
3482
|
placeholder: T(u).t("kvcoder.ui.placeholder"),
|
|
3437
|
-
blocked: T(
|
|
3483
|
+
blocked: T(U).working.value !== void 0,
|
|
3438
3484
|
commands: "run",
|
|
3485
|
+
registered: T(H),
|
|
3439
3486
|
onSend: I,
|
|
3440
3487
|
onStop: L,
|
|
3441
|
-
onCommand:
|
|
3488
|
+
onCommand: q,
|
|
3489
|
+
onRegistered: ie
|
|
3442
3490
|
}, {
|
|
3443
3491
|
controls: k(() => [s(Aa, {
|
|
3444
3492
|
session: T(m),
|
|
@@ -3448,7 +3496,8 @@ var eo = { class: "kvc-workspace" }, to = { class: "kvc-stage" }, no = {
|
|
|
3448
3496
|
}, 8, [
|
|
3449
3497
|
"running",
|
|
3450
3498
|
"placeholder",
|
|
3451
|
-
"blocked"
|
|
3499
|
+
"blocked",
|
|
3500
|
+
"registered"
|
|
3452
3501
|
])], 64)) : r("v-if", !0)]), O.value ? (g(), n(_t, {
|
|
3453
3502
|
key: 0,
|
|
3454
3503
|
list: T(D).list.value,
|
|
@@ -3462,13 +3511,13 @@ var eo = { class: "kvc-workspace" }, to = { class: "kvc-stage" }, no = {
|
|
|
3462
3511
|
"content"
|
|
3463
3512
|
])) : r("v-if", !0)])]));
|
|
3464
3513
|
}
|
|
3465
|
-
}),
|
|
3514
|
+
}), ho = /* @__PURE__ */ c({
|
|
3466
3515
|
__name: "conversation",
|
|
3467
3516
|
props: { sessionId: {} },
|
|
3468
3517
|
setup(e) {
|
|
3469
3518
|
let t = e;
|
|
3470
|
-
return (e, r) => (g(), n(
|
|
3519
|
+
return (e, r) => (g(), n(mo, { "session-id": t.sessionId }, null, 8, ["session-id"]));
|
|
3471
3520
|
}
|
|
3472
3521
|
});
|
|
3473
3522
|
//#endregion
|
|
3474
|
-
export {
|
|
3523
|
+
export { ho as default };
|