@kvman/kvcoder 0.1.7 → 0.1.9
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 +38 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/connectors/artifact.d.ts.map +1 -1
- package/dist/connectors/artifact.js +3 -1
- package/dist/connectors/artifact.js.map +1 -1
- package/dist/connectors/execution-map.d.ts +1 -1
- package/dist/connectors/execution-map.d.ts.map +1 -1
- package/dist/connectors/execution-map.js +1 -1
- package/dist/connectors/execution-map.js.map +1 -1
- package/dist/prompt/build-prompt.d.ts +6 -1
- package/dist/prompt/build-prompt.d.ts.map +1 -1
- package/dist/prompt/build-prompt.js +2 -2
- package/dist/prompt/build-prompt.js.map +1 -1
- package/dist/prompt/session-grants.d.ts +2 -0
- package/dist/prompt/session-grants.d.ts.map +1 -1
- package/dist/prompt/session-prompt.d.ts.map +1 -1
- package/dist/prompt/session-prompt.js +9 -4
- package/dist/prompt/session-prompt.js.map +1 -1
- package/dist/prompt/working-method.d.ts +6 -4
- package/dist/prompt/working-method.d.ts.map +1 -1
- package/dist/prompt/working-method.js +35 -20
- package/dist/prompt/working-method.js.map +1 -1
- package/dist/register-settings.d.ts +15 -1
- package/dist/register-settings.d.ts.map +1 -1
- package/dist/register-settings.js +19 -2
- package/dist/register-settings.js.map +1 -1
- package/dist/registry/register-connectors.d.ts +2 -0
- package/dist/registry/register-connectors.d.ts.map +1 -1
- package/dist/registry/register-connectors.js +15 -11
- package/dist/registry/register-connectors.js.map +1 -1
- package/dist/schemas/registry.d.ts +9 -1
- package/dist/schemas/registry.d.ts.map +1 -1
- package/dist/schemas/registry.js +6 -2
- package/dist/schemas/registry.js.map +1 -1
- package/dist/store/collections.d.ts +4 -0
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/turns/read-only.d.ts +7 -2
- package/dist/turns/read-only.d.ts.map +1 -1
- package/dist/turns/read-only.js +7 -4
- package/dist/turns/read-only.js.map +1 -1
- package/dist/turns/run-calls.js +1 -1
- package/dist/turns/run-calls.js.map +1 -1
- package/dist/turns/run-command.d.ts +2 -0
- package/dist/turns/run-command.d.ts.map +1 -1
- package/dist/turns/run-command.js +4 -2
- package/dist/turns/run-command.js.map +1 -1
- package/dist/web/components/approval.css +1 -1
- package/dist/web/components/approval.js +18 -31
- package/dist/web/components/call.css +1 -1
- package/dist/web/components/call.js +281 -251
- package/dist/web/components/connectors.css +1 -1
- package/dist/web/components/conversation.css +1 -1
- package/dist/web/components/conversation.js +943 -892
- 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 +13 -1
- package/docs/sections.md +2 -0
- package/locales/ar.json +15 -2
- package/locales/en.json +15 -2
- package/package.json +3 -3
|
@@ -16,7 +16,7 @@ var F = {
|
|
|
16
16
|
function L(e) {
|
|
17
17
|
return e != null;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function ee(e, t = {}) {
|
|
20
20
|
let n = t.attributeNames ?? {}, r = (e) => n[e] ?? e, i = e.size ?? e.width ?? F.width, a = e.size ?? e.height ?? F.height, o = e.aliases?.filter((e) => typeof e == "string" && e.trim() !== "").map((e) => `lucide-${e}`) ?? [], s = [...e.name ? [`lucide-${e.name}`] : [], ...o], c = t.className?.split(" ").filter(Boolean) ?? [], l = t.includeDefaultClasses === !1 ? I(...c) : I("lucide", ...s, ...c), u = t.absoluteStrokeWidth ? Number(t.strokeWidth ?? F["stroke-width"]) * Number(e.size ?? e.width ?? F.width) / Number(t.size ?? t.width ?? F.width) : t.strokeWidth ?? F["stroke-width"];
|
|
21
21
|
return [
|
|
22
22
|
"svg",
|
|
@@ -50,24 +50,24 @@ function R(e, t = {}) {
|
|
|
50
50
|
}
|
|
51
51
|
//#endregion
|
|
52
52
|
//#region ../../node_modules/.pnpm/@lucide+vue@1.49.0_vue@3.5.43_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/shared/src/utils/hasA11yProp.mjs
|
|
53
|
-
var
|
|
53
|
+
var R = (e) => {
|
|
54
54
|
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
55
55
|
return !1;
|
|
56
|
-
}, z = (e) => e === "", B = (e) => e?.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(),
|
|
57
|
-
function
|
|
58
|
-
return u(
|
|
56
|
+
}, z = (e) => e === "", B = (e) => e?.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), V = /* @__PURE__ */ Symbol("lucide-icons");
|
|
57
|
+
function te() {
|
|
58
|
+
return u(V, {});
|
|
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
|
|
62
|
+
var ne = ({ name: e, iconNode: t, "icon-node": n, icon: r = {
|
|
63
63
|
name: e && B(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 = "" } = te(), C = z(i) || z(a) || i === !0 || a === !0 || b === !0, w = z(o) || z(s) || o === !0 || s === !0 || x === !0;
|
|
69
69
|
delete h.class;
|
|
70
|
-
let T = g.default?.(), [, E, D = []] =
|
|
70
|
+
let T = g.default?.(), [, E, D = []] = ee(r, {
|
|
71
71
|
color: m ?? v,
|
|
72
72
|
width: f ?? d ?? _,
|
|
73
73
|
height: p ?? d ?? _,
|
|
@@ -75,7 +75,7 @@ var V = ({ name: e, iconNode: t, "icon-node": n, icon: r = {
|
|
|
75
75
|
absoluteStrokeWidth: C,
|
|
76
76
|
nonScalingStroke: w,
|
|
77
77
|
className: S,
|
|
78
|
-
hasA11yProp: T != null && T.length > 0 ||
|
|
78
|
+
hasA11yProp: T != null && T.length > 0 || R(h),
|
|
79
79
|
attributes: h
|
|
80
80
|
});
|
|
81
81
|
return l("svg", E, [...D.map(([e, t]) => l(e, t)), ...T ?? []]);
|
|
@@ -87,7 +87,7 @@ function H(e, t = []) {
|
|
|
87
87
|
name: e,
|
|
88
88
|
node: t
|
|
89
89
|
} : e;
|
|
90
|
-
return (e, { slots: t }) => l(
|
|
90
|
+
return (e, { slots: t }) => l(ne, {
|
|
91
91
|
...e,
|
|
92
92
|
icon: n
|
|
93
93
|
}, t.default ? { default: t.default } : void 0);
|
|
@@ -176,14 +176,14 @@ var re = H({
|
|
|
176
176
|
key: "rq6x2g"
|
|
177
177
|
}]
|
|
178
178
|
]
|
|
179
|
-
}),
|
|
179
|
+
}), ce = H({
|
|
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
|
+
}), U = H({
|
|
187
187
|
name: "chevron-down",
|
|
188
188
|
size: 24,
|
|
189
189
|
node: [["path", {
|
|
@@ -245,7 +245,7 @@ var re = H({
|
|
|
245
245
|
y2: "9",
|
|
246
246
|
key: "1dfufj"
|
|
247
247
|
}]]
|
|
248
|
-
}),
|
|
248
|
+
}), pe = H({
|
|
249
249
|
name: "circle-x",
|
|
250
250
|
size: 24,
|
|
251
251
|
node: [
|
|
@@ -265,7 +265,7 @@ var re = H({
|
|
|
265
265
|
}]
|
|
266
266
|
],
|
|
267
267
|
aliases: ["x-circle"]
|
|
268
|
-
}),
|
|
268
|
+
}), W = H({
|
|
269
269
|
name: "circle",
|
|
270
270
|
size: 24,
|
|
271
271
|
node: [["circle", {
|
|
@@ -284,7 +284,7 @@ var re = H({
|
|
|
284
284
|
d: "m8 6-6 6 6 6",
|
|
285
285
|
key: "ppft3o"
|
|
286
286
|
}]]
|
|
287
|
-
}),
|
|
287
|
+
}), he = H({
|
|
288
288
|
name: "copy",
|
|
289
289
|
size: 24,
|
|
290
290
|
node: [["rect", {
|
|
@@ -299,7 +299,7 @@ var re = H({
|
|
|
299
299
|
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",
|
|
300
300
|
key: "zix9uf"
|
|
301
301
|
}]]
|
|
302
|
-
}),
|
|
302
|
+
}), G = H({
|
|
303
303
|
name: "ellipsis",
|
|
304
304
|
size: 24,
|
|
305
305
|
node: [
|
|
@@ -817,7 +817,7 @@ var mt = [
|
|
|
817
817
|
"data-test": l.test,
|
|
818
818
|
onClick: v,
|
|
819
819
|
onKeydown: S
|
|
820
|
-
}, [a("span", ht, E(h.value), 1), s(D(
|
|
820
|
+
}, [a("span", ht, E(h.value), 1), s(D(U), {
|
|
821
821
|
size: 16,
|
|
822
822
|
"aria-hidden": "true"
|
|
823
823
|
})], 40, mt), d.value ? (_(), i("div", {
|
|
@@ -836,7 +836,7 @@ var mt = [
|
|
|
836
836
|
"data-test": `${l.test}-${e.id}`,
|
|
837
837
|
onClick: (t) => x(e.id),
|
|
838
838
|
onMousemove: (e) => f.value = t
|
|
839
|
-
}, [a("span", vt, E(e.label), 1), e.id === l.current ? (_(), n(D(
|
|
839
|
+
}, [a("span", vt, E(e.label), 1), e.id === l.current ? (_(), n(D(ce), {
|
|
840
840
|
key: 0,
|
|
841
841
|
size: 16,
|
|
842
842
|
"aria-hidden": "true"
|
|
@@ -1117,9 +1117,9 @@ var Bt = ["aria-label"], Vt = { class: "kvc-dialog-head" }, Ht = { class: "kvc-c
|
|
|
1117
1117
|
e === void 0 && (S.value = void 0);
|
|
1118
1118
|
});
|
|
1119
1119
|
let T = {
|
|
1120
|
-
todo:
|
|
1120
|
+
todo: W,
|
|
1121
1121
|
done: ue,
|
|
1122
|
-
failed:
|
|
1122
|
+
failed: pe,
|
|
1123
1123
|
skipped: fe
|
|
1124
1124
|
}, k = (e) => l.t(`kvcoder.ui.map.status.${e}`), j = (e) => c.map.steps.find((t) => t.id === e)?.title ?? e;
|
|
1125
1125
|
return (t, o) => (_(), i("div", pn, [
|
|
@@ -1350,7 +1350,7 @@ var Mn = [
|
|
|
1350
1350
|
J(d, e);
|
|
1351
1351
|
}
|
|
1352
1352
|
}
|
|
1353
|
-
let L = t(() => x.value === "url" ? Ue(S.value, window.location) : void 0),
|
|
1353
|
+
let L = t(() => x.value === "url" ? Ue(S.value, window.location) : void 0), ee = t(() => ({
|
|
1354
1354
|
type: "markdown",
|
|
1355
1355
|
text: "kvcoder.markdown",
|
|
1356
1356
|
params: { text: S.value }
|
|
@@ -1434,7 +1434,7 @@ var Mn = [
|
|
|
1434
1434
|
title: D(d).t("kvcoder.ui.copy"),
|
|
1435
1435
|
"data-test": "artifact-copy",
|
|
1436
1436
|
onClick: I
|
|
1437
|
-
}, [s(D(
|
|
1437
|
+
}, [s(D(he), {
|
|
1438
1438
|
size: 16,
|
|
1439
1439
|
"aria-hidden": "true"
|
|
1440
1440
|
})], 8, Jn)),
|
|
@@ -1455,7 +1455,7 @@ var Mn = [
|
|
|
1455
1455
|
map: l.map
|
|
1456
1456
|
}, null, 8, ["map"])) : M.value === "source" && m.value !== void 0 ? (_(), i("pre", Zn, E(S.value), 1)) : x.value === "markdown" && m.value !== void 0 ? (_(), n(C(D(d).View), {
|
|
1457
1457
|
key: 2,
|
|
1458
|
-
view:
|
|
1458
|
+
view: ee.value
|
|
1459
1459
|
}, null, 8, ["view"])) : x.value === "html" && m.value !== void 0 ? (_(), n(ze, {
|
|
1460
1460
|
key: 3,
|
|
1461
1461
|
label: w.value,
|
|
@@ -1667,7 +1667,7 @@ var ur = { class: "kvc-composer" }, dr = { class: "kvc-box" }, fr = ["aria-label
|
|
|
1667
1667
|
}
|
|
1668
1668
|
await F(e);
|
|
1669
1669
|
}
|
|
1670
|
-
function
|
|
1670
|
+
function ee(e) {
|
|
1671
1671
|
let t = [...e.clipboardData?.files ?? []];
|
|
1672
1672
|
if (t.length === 0) {
|
|
1673
1673
|
e.clipboardData?.types.length === 0 && L();
|
|
@@ -1675,12 +1675,12 @@ var ur = { class: "kvc-composer" }, dr = { class: "kvc-box" }, fr = ["aria-label
|
|
|
1675
1675
|
}
|
|
1676
1676
|
e.preventDefault(), F(t);
|
|
1677
1677
|
}
|
|
1678
|
-
function
|
|
1678
|
+
function R() {
|
|
1679
1679
|
let e = O.value, t = v.value?.argument ?? "";
|
|
1680
1680
|
l.blocked === !0 || e === void 0 || N(e) && t === "" || (e.kind === "own" ? u("command", e.command.name, t) : u("registered", e.command, t), f.value.text = "");
|
|
1681
1681
|
}
|
|
1682
1682
|
function z() {
|
|
1683
|
-
if (v.value !== void 0) return
|
|
1683
|
+
if (v.value !== void 0) return R();
|
|
1684
1684
|
let e = f.value.text.trim();
|
|
1685
1685
|
e === "" || m.value || l.blocked === !0 || f.value.sending || u("send", {
|
|
1686
1686
|
text: e,
|
|
@@ -1690,13 +1690,13 @@ var ur = { class: "kvc-composer" }, dr = { class: "kvc-box" }, fr = ["aria-label
|
|
|
1690
1690
|
function B(e) {
|
|
1691
1691
|
T.value.length > 0 && (h.value = (h.value + e + T.value.length) % T.value.length);
|
|
1692
1692
|
}
|
|
1693
|
-
function
|
|
1693
|
+
function V(e) {
|
|
1694
1694
|
w(e) && (h.value = T.value.indexOf(e));
|
|
1695
1695
|
}
|
|
1696
|
-
function
|
|
1697
|
-
w(e) && (
|
|
1696
|
+
function te(e) {
|
|
1697
|
+
w(e) && (V(e), R());
|
|
1698
1698
|
}
|
|
1699
|
-
function
|
|
1699
|
+
function ne(e) {
|
|
1700
1700
|
if (v.value === void 0) return !1;
|
|
1701
1701
|
let t = O.value;
|
|
1702
1702
|
if (e.key === "Escape") g.value = !0;
|
|
@@ -1707,7 +1707,7 @@ var ur = { class: "kvc-composer" }, dr = { class: "kvc-box" }, fr = ["aria-label
|
|
|
1707
1707
|
return !0;
|
|
1708
1708
|
}
|
|
1709
1709
|
function H(e) {
|
|
1710
|
-
if (
|
|
1710
|
+
if (ne(e)) return e.preventDefault();
|
|
1711
1711
|
e.key !== "Enter" || e.shiftKey || e.isComposing || (e.preventDefault(), z());
|
|
1712
1712
|
}
|
|
1713
1713
|
return (t, n) => (_(), i("div", ur, [a("div", dr, [
|
|
@@ -1727,8 +1727,8 @@ var ur = { class: "kvc-composer" }, dr = { class: "kvc-box" }, fr = ["aria-label
|
|
|
1727
1727
|
"aria-selected": t === O.value,
|
|
1728
1728
|
"data-active": t === O.value,
|
|
1729
1729
|
"data-test": `slash-${t.command.name}`,
|
|
1730
|
-
onMousemove: (e) =>
|
|
1731
|
-
onClick: (e) =>
|
|
1730
|
+
onMousemove: (e) => V(t),
|
|
1731
|
+
onClick: (e) => te(t)
|
|
1732
1732
|
}, [a("span", hr, [a("span", gr, [o("/" + E(t.command.name), 1), N(t) ? (_(), i(e, { key: 0 }, [o(" <" + E(D(d).t(`kvcoder.ui.slash.${t.command.name}.argument`)) + ">", 1)], 64)) : r("v-if", !0)])]), a("span", _r, E(P(t)), 1)], 40, mr))), 128)),
|
|
1733
1733
|
C.value.length === 0 ? (_(), i("p", vr, E(D(d).t("kvcoder.ui.slash.none")), 1)) : r("v-if", !0)
|
|
1734
1734
|
], 8, fr)) : r("v-if", !0),
|
|
@@ -1754,7 +1754,7 @@ var ur = { class: "kvc-composer" }, dr = { class: "kvc-box" }, fr = ["aria-label
|
|
|
1754
1754
|
rows: "2",
|
|
1755
1755
|
"data-test": "composer-text",
|
|
1756
1756
|
onKeydown: H,
|
|
1757
|
-
onPaste:
|
|
1757
|
+
onPaste: ee
|
|
1758
1758
|
}, null, 40, Cr), [[k, f.value.text]]),
|
|
1759
1759
|
a("div", wr, [
|
|
1760
1760
|
a("input", {
|
|
@@ -1795,66 +1795,27 @@ var ur = { class: "kvc-composer" }, dr = { class: "kvc-box" }, fr = ["aria-label
|
|
|
1795
1795
|
])
|
|
1796
1796
|
])]));
|
|
1797
1797
|
}
|
|
1798
|
-
}), Ar = {
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
},
|
|
1810
|
-
setup(t) {
|
|
1811
|
-
let n = K(), o = t, s = y(void 0), c = y(!1), l = y(!0), u = 0, d = !1;
|
|
1812
|
-
async function f() {
|
|
1813
|
-
let e = ++u, t = n.workspace.value.id, r = n.scope.value, i = () => !d && e === u && t === n.workspace.value.id && r === n.scope.value;
|
|
1814
|
-
l.value = !0, c.value = !1;
|
|
1815
|
-
try {
|
|
1816
|
-
let e = await n.exec("kernel.settings.list", {});
|
|
1817
|
-
if (!i()) return;
|
|
1818
|
-
let t = e.find((e) => e.key === "kvcoder.approval")?.value;
|
|
1819
|
-
if (t !== "ask" && t !== "auto" && t !== "never") throw Error("Approval mode is not loaded.");
|
|
1820
|
-
s.value = t;
|
|
1821
|
-
} catch {
|
|
1822
|
-
if (!i()) return;
|
|
1823
|
-
s.value = void 0, c.value = !0;
|
|
1824
|
-
} finally {
|
|
1825
|
-
i() && (l.value = !1);
|
|
1826
|
-
}
|
|
1827
|
-
}
|
|
1828
|
-
return h(f), A(() => [
|
|
1829
|
-
n.scope.value,
|
|
1830
|
-
n.workspace.value.id,
|
|
1831
|
-
o.refreshKey
|
|
1832
|
-
], f, { flush: "sync" }), m(() => {
|
|
1833
|
-
d = !0, u += 1;
|
|
1834
|
-
}), (t, u) => (_(), i("div", Ar, [l.value ? (_(), i("p", jr, E(D(n).t("kvcoder.ui.approvalNote.loading")), 1)) : c.value || s.value === void 0 ? (_(), i(e, { key: 1 }, [a("p", Mr, E(D(n).t("kvcoder.ui.approvalNote.failed")), 1), a("button", {
|
|
1798
|
+
}), Ar = ["data-mode"], jr = /* @__PURE__ */ c({
|
|
1799
|
+
__name: "ApprovalLine",
|
|
1800
|
+
props: { mode: {} },
|
|
1801
|
+
setup(e) {
|
|
1802
|
+
let t = K(), n = e;
|
|
1803
|
+
return (e, s) => n.mode === void 0 ? r("v-if", !0) : (_(), i("p", {
|
|
1804
|
+
key: 0,
|
|
1805
|
+
class: "kvc-muted kvc-start-note",
|
|
1806
|
+
"data-test": "approval-line",
|
|
1807
|
+
"data-mode": n.mode
|
|
1808
|
+
}, [o(E(D(t).t(`kvcoder.ui.approvalLine.${n.mode}`)) + " ", 1), a("button", {
|
|
1835
1809
|
type: "button",
|
|
1836
|
-
class: "kvc-
|
|
1837
|
-
"data-test": "approval-
|
|
1838
|
-
onClick:
|
|
1839
|
-
}, E(D(
|
|
1840
|
-
a("p", {
|
|
1841
|
-
"data-test": "approval-mode",
|
|
1842
|
-
"data-mode": s.value
|
|
1843
|
-
}, E(D(n).t(`kvcoder.ui.approvalNote.${s.value}`)), 9, Nr),
|
|
1844
|
-
a("p", Pr, E(D(n).t("kvcoder.ui.approvalNote.limits")), 1),
|
|
1845
|
-
o.withLink ? (_(), i("button", {
|
|
1846
|
-
key: 0,
|
|
1847
|
-
type: "button",
|
|
1848
|
-
class: "kvc-link-button",
|
|
1849
|
-
"data-test": "approval-config",
|
|
1850
|
-
onClick: u[1] ||= (e) => D(n).navigate("kvwebui.extension", { namespace: "kvcoder" })
|
|
1851
|
-
}, E(D(n).t("kvcoder.ui.approvalNote.openConfig")), 1)) : r("v-if", !0)
|
|
1852
|
-
], 64))]));
|
|
1810
|
+
class: "kvc-link-button",
|
|
1811
|
+
"data-test": "approval-config",
|
|
1812
|
+
onClick: s[0] ||= (e) => D(t).navigate("kvwebui.extension", { namespace: "kvcoder" })
|
|
1813
|
+
}, E(D(t).t("kvcoder.ui.approvalLine.change")), 1)], 8, Ar));
|
|
1853
1814
|
}
|
|
1854
1815
|
});
|
|
1855
1816
|
//#endregion
|
|
1856
1817
|
//#region web/src/model-groups.ts
|
|
1857
|
-
function
|
|
1818
|
+
function Mr(e, t, n) {
|
|
1858
1819
|
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();
|
|
1859
1820
|
for (let e of a) {
|
|
1860
1821
|
let t = o.get(e.provider) ?? {
|
|
@@ -1869,7 +1830,7 @@ function Ir(e, t, n) {
|
|
|
1869
1830
|
}
|
|
1870
1831
|
return [...o.values()].sort((e, t) => e.title.localeCompare(t.title));
|
|
1871
1832
|
}
|
|
1872
|
-
function
|
|
1833
|
+
function Nr(e, t) {
|
|
1873
1834
|
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) => ({
|
|
1874
1835
|
...e,
|
|
1875
1836
|
models: e.models.filter(r)
|
|
@@ -1880,38 +1841,38 @@ function Lr(e, t) {
|
|
|
1880
1841
|
total: e.reduce((e, t) => e + t.models.length, 0)
|
|
1881
1842
|
};
|
|
1882
1843
|
}
|
|
1883
|
-
var
|
|
1844
|
+
var Pr = [
|
|
1884
1845
|
"off",
|
|
1885
1846
|
"minimal",
|
|
1886
1847
|
"low",
|
|
1887
1848
|
"medium",
|
|
1888
1849
|
"high"
|
|
1889
|
-
],
|
|
1850
|
+
], Fr = { class: "kvc-picker" }, Ir = [
|
|
1890
1851
|
"aria-expanded",
|
|
1891
1852
|
"aria-label",
|
|
1892
1853
|
"disabled"
|
|
1893
|
-
],
|
|
1854
|
+
], Lr = { class: "kvc-picker-label" }, Rr = ["onKeydown"], zr = { class: "kvc-search" }, Br = [
|
|
1894
1855
|
"placeholder",
|
|
1895
1856
|
"aria-label",
|
|
1896
1857
|
"onKeydown"
|
|
1897
|
-
],
|
|
1858
|
+
], Vr = ["aria-label"], Hr = ["aria-selected", "data-active"], Ur = { class: "kvc-model-name" }, Wr = {
|
|
1898
1859
|
class: "kvc-group",
|
|
1899
1860
|
role: "presentation",
|
|
1900
1861
|
"data-test": "model-group"
|
|
1901
|
-
},
|
|
1862
|
+
}, Gr = [
|
|
1902
1863
|
"aria-selected",
|
|
1903
1864
|
"data-active",
|
|
1904
1865
|
"data-test",
|
|
1905
1866
|
"onClick",
|
|
1906
1867
|
"onMousemove"
|
|
1907
|
-
],
|
|
1868
|
+
], Kr = { class: "kvc-model-name" }, qr = {
|
|
1908
1869
|
key: 1,
|
|
1909
1870
|
class: "kvc-muted kvc-none",
|
|
1910
1871
|
"data-test": "model-none"
|
|
1911
|
-
},
|
|
1872
|
+
}, Jr = {
|
|
1912
1873
|
class: "kvc-muted kvc-count",
|
|
1913
1874
|
"data-test": "model-count"
|
|
1914
|
-
},
|
|
1875
|
+
}, Yr = 24, Xr = /* @__PURE__ */ c({
|
|
1915
1876
|
__name: "ModelPicker",
|
|
1916
1877
|
props: {
|
|
1917
1878
|
groups: {},
|
|
@@ -1922,37 +1883,37 @@ var Rr = [
|
|
|
1922
1883
|
},
|
|
1923
1884
|
emits: ["pick", "none"],
|
|
1924
1885
|
setup(o, { emit: c }) {
|
|
1925
|
-
let l = o, u = c, f = K(), p = y(!1), h = y(""), g = y(0), v = O("trigger"), x = O("search"), S = O("panel"), C = t(() =>
|
|
1886
|
+
let l = o, u = c, f = K(), p = y(!1), h = y(""), g = y(0), v = O("trigger"), x = O("search"), S = O("panel"), C = t(() => Nr(l.groups, h.value)), w = t(() => C.value.groups.flatMap((e) => e.models)), T = t(() => l.groups.flatMap((e) => e.models).find((e) => e.id === l.current)?.name ?? l.current ?? l.empty ?? ""), j = t(() => l.none !== void 0 && h.value.trim() === ""), F = t(() => +!!j.value), I = t(() => w.value.length + F.value), L = (e) => {
|
|
1926
1887
|
let t = w.value.findIndex((t) => t.id === e);
|
|
1927
1888
|
return t < 0 ? -1 : t + F.value;
|
|
1928
1889
|
};
|
|
1929
|
-
function
|
|
1890
|
+
function ee() {
|
|
1930
1891
|
p.value = !1, v.value?.focus();
|
|
1931
1892
|
}
|
|
1932
|
-
async function
|
|
1933
|
-
h.value = "", g.value = Math.max(L(l.current ?? ""), 0), z = 0, p.value = !0, await d(),
|
|
1893
|
+
async function R() {
|
|
1894
|
+
h.value = "", g.value = Math.max(L(l.current ?? ""), 0), z = 0, p.value = !0, await d(), V(), x.value?.focus(), ne();
|
|
1934
1895
|
}
|
|
1935
1896
|
let z = 0, B = 0;
|
|
1936
|
-
function
|
|
1897
|
+
function V() {
|
|
1937
1898
|
let e = S.value, t = v.value?.closest(".kvc-conversation")?.getBoundingClientRect();
|
|
1938
1899
|
if (e === null || t === void 0) return;
|
|
1939
|
-
let n = e.getBoundingClientRect(), r = t.left +
|
|
1900
|
+
let n = e.getBoundingClientRect(), r = t.left + Yr - (n.left - z), i = t.right - Yr - (n.right - z), a = r > 0 ? r : i < 0 ? i : 0;
|
|
1940
1901
|
a !== z && (z = a, e.style.translate = `${a}px 0`);
|
|
1941
1902
|
}
|
|
1942
|
-
function
|
|
1943
|
-
|
|
1903
|
+
function te() {
|
|
1904
|
+
V(), B = requestAnimationFrame(te);
|
|
1944
1905
|
}
|
|
1945
|
-
function
|
|
1906
|
+
function ne() {
|
|
1946
1907
|
S.value?.querySelector("[data-active=\"true\"]")?.scrollIntoView?.({ block: "nearest" });
|
|
1947
1908
|
}
|
|
1948
1909
|
async function H(e) {
|
|
1949
|
-
I.value !== 0 && (g.value = (g.value + e + I.value) % I.value, await d(),
|
|
1910
|
+
I.value !== 0 && (g.value = (g.value + e + I.value) % I.value, await d(), ne());
|
|
1950
1911
|
}
|
|
1951
1912
|
function re(e) {
|
|
1952
|
-
e !== void 0 && (u("pick", e),
|
|
1913
|
+
e !== void 0 && (u("pick", e), ee());
|
|
1953
1914
|
}
|
|
1954
1915
|
function ie() {
|
|
1955
|
-
u("none"),
|
|
1916
|
+
u("none"), ee();
|
|
1956
1917
|
}
|
|
1957
1918
|
function ae() {
|
|
1958
1919
|
j.value && g.value === 0 ? ie() : re(w.value[g.value - F.value]?.id);
|
|
@@ -1961,10 +1922,10 @@ var Rr = [
|
|
|
1961
1922
|
e.target instanceof Node && !v.value?.parentElement?.contains(e.target) && (p.value = !1);
|
|
1962
1923
|
}
|
|
1963
1924
|
return A(h, () => g.value = 0), A(p, (e) => {
|
|
1964
|
-
e ? (document.addEventListener("pointerdown", oe), B = requestAnimationFrame(
|
|
1925
|
+
e ? (document.addEventListener("pointerdown", oe), B = requestAnimationFrame(te)) : (document.removeEventListener("pointerdown", oe), cancelAnimationFrame(B));
|
|
1965
1926
|
}), m(() => {
|
|
1966
1927
|
document.removeEventListener("pointerdown", oe), cancelAnimationFrame(B);
|
|
1967
|
-
}), (t, o) => (_(), i("div",
|
|
1928
|
+
}), (t, o) => (_(), i("div", Fr, [a("button", {
|
|
1968
1929
|
ref_key: "trigger",
|
|
1969
1930
|
ref: v,
|
|
1970
1931
|
type: "button",
|
|
@@ -1974,19 +1935,19 @@ var Rr = [
|
|
|
1974
1935
|
"aria-label": `${D(f).t("kvcoder.ui.model")}: ${T.value}`,
|
|
1975
1936
|
disabled: l.disabled,
|
|
1976
1937
|
"data-test": "model-picker",
|
|
1977
|
-
onClick: o[0] ||= (e) => p.value ?
|
|
1978
|
-
}, [a("span",
|
|
1938
|
+
onClick: o[0] ||= (e) => p.value ? ee() : R()
|
|
1939
|
+
}, [a("span", Lr, E(T.value), 1), s(D(U), {
|
|
1979
1940
|
size: 16,
|
|
1980
1941
|
"aria-hidden": "true"
|
|
1981
|
-
})], 8,
|
|
1942
|
+
})], 8, Ir), p.value ? (_(), i("div", {
|
|
1982
1943
|
key: 0,
|
|
1983
1944
|
ref_key: "panel",
|
|
1984
1945
|
ref: S,
|
|
1985
1946
|
class: "kvc-popover",
|
|
1986
1947
|
"data-test": "model-popover",
|
|
1987
|
-
onKeydown: N(P(
|
|
1948
|
+
onKeydown: N(P(ee, ["stop"]), ["esc"])
|
|
1988
1949
|
}, [
|
|
1989
|
-
a("label",
|
|
1950
|
+
a("label", zr, [s(D(De), {
|
|
1990
1951
|
size: 16,
|
|
1991
1952
|
"aria-hidden": "true"
|
|
1992
1953
|
}), M(a("input", {
|
|
@@ -2005,7 +1966,7 @@ var Rr = [
|
|
|
2005
1966
|
o[3] ||= N(P((e) => H(-1), ["prevent"]), ["up"]),
|
|
2006
1967
|
N(P(ae, ["prevent"]), ["enter"])
|
|
2007
1968
|
]
|
|
2008
|
-
}, null, 40,
|
|
1969
|
+
}, null, 40, Br), [[k, h.value]])]),
|
|
2009
1970
|
a("div", {
|
|
2010
1971
|
id: "kvc-models",
|
|
2011
1972
|
class: "kvc-options",
|
|
@@ -2021,12 +1982,12 @@ var Rr = [
|
|
|
2021
1982
|
"data-test": "model-none-entry",
|
|
2022
1983
|
onClick: ie,
|
|
2023
1984
|
onMousemove: o[4] ||= (e) => g.value = 0
|
|
2024
|
-
}, [a("span",
|
|
1985
|
+
}, [a("span", Ur, E(l.none), 1), l.current === null ? (_(), n(D(ce), {
|
|
2025
1986
|
key: 0,
|
|
2026
1987
|
size: 16,
|
|
2027
1988
|
"aria-hidden": "true"
|
|
2028
|
-
})) : r("v-if", !0)], 40,
|
|
2029
|
-
(_(!0), i(e, null, b(C.value.groups, (t) => (_(), i(e, { key: t.provider }, [a("div",
|
|
1989
|
+
})) : r("v-if", !0)], 40, Hr)) : r("v-if", !0),
|
|
1990
|
+
(_(!0), i(e, null, b(C.value.groups, (t) => (_(), i(e, { key: t.provider }, [a("div", Wr, E(t.title), 1), (_(!0), i(e, null, b(t.models, (e) => (_(), i("div", {
|
|
2030
1991
|
key: e.id,
|
|
2031
1992
|
class: "kvc-model",
|
|
2032
1993
|
role: "option",
|
|
@@ -2035,20 +1996,20 @@ var Rr = [
|
|
|
2035
1996
|
"data-test": `model-${e.id}`,
|
|
2036
1997
|
onClick: (t) => re(e.id),
|
|
2037
1998
|
onMousemove: (t) => g.value = L(e.id)
|
|
2038
|
-
}, [a("span",
|
|
1999
|
+
}, [a("span", Kr, E(e.name), 1), e.id === l.current ? (_(), n(D(ce), {
|
|
2039
2000
|
key: 0,
|
|
2040
2001
|
size: 16,
|
|
2041
2002
|
"aria-hidden": "true"
|
|
2042
|
-
})) : r("v-if", !0)], 40,
|
|
2043
|
-
C.value.shown === 0 ? (_(), i("p",
|
|
2044
|
-
], 8,
|
|
2045
|
-
a("p",
|
|
2003
|
+
})) : r("v-if", !0)], 40, Gr))), 128))], 64))), 128)),
|
|
2004
|
+
C.value.shown === 0 ? (_(), i("p", qr, E(D(f).t("kvcoder.ui.noModels")), 1)) : r("v-if", !0)
|
|
2005
|
+
], 8, Vr),
|
|
2006
|
+
a("p", Jr, E(D(f).t("kvcoder.ui.modelsCount", {
|
|
2046
2007
|
shown: C.value.shown,
|
|
2047
2008
|
total: C.value.total
|
|
2048
2009
|
})), 1)
|
|
2049
|
-
], 40,
|
|
2010
|
+
], 40, Rr)) : r("v-if", !0)]));
|
|
2050
2011
|
}
|
|
2051
|
-
}),
|
|
2012
|
+
}), Zr = /* @__PURE__ */ c({
|
|
2052
2013
|
__name: "ModelControls",
|
|
2053
2014
|
props: {
|
|
2054
2015
|
groups: {},
|
|
@@ -2058,15 +2019,15 @@ var Rr = [
|
|
|
2058
2019
|
},
|
|
2059
2020
|
emits: ["model", "thinking"],
|
|
2060
2021
|
setup(n, { emit: r }) {
|
|
2061
|
-
let a = n, o = r, c = K(), l = t(() =>
|
|
2022
|
+
let a = n, o = r, c = K(), l = t(() => Pr.map((e) => ({
|
|
2062
2023
|
id: e,
|
|
2063
2024
|
label: c.t(`kvcoder.ui.thinkingLevels.${e}`)
|
|
2064
2025
|
})));
|
|
2065
2026
|
function u(e) {
|
|
2066
|
-
let t =
|
|
2027
|
+
let t = Pr.find((t) => t === e);
|
|
2067
2028
|
t !== void 0 && o("thinking", t);
|
|
2068
2029
|
}
|
|
2069
|
-
return (t, n) => (_(), i(e, null, [s(
|
|
2030
|
+
return (t, n) => (_(), i(e, null, [s(Xr, {
|
|
2070
2031
|
groups: a.groups,
|
|
2071
2032
|
current: a.model,
|
|
2072
2033
|
empty: a.empty,
|
|
@@ -2090,7 +2051,7 @@ var Rr = [
|
|
|
2090
2051
|
});
|
|
2091
2052
|
//#endregion
|
|
2092
2053
|
//#region web/src/remember-model.ts
|
|
2093
|
-
async function
|
|
2054
|
+
async function Qr(e, t) {
|
|
2094
2055
|
try {
|
|
2095
2056
|
await e.exec("kernel.settings.set", {
|
|
2096
2057
|
key: "kvai.defaultModel",
|
|
@@ -2102,6 +2063,21 @@ async function ni(e, t) {
|
|
|
2102
2063
|
}
|
|
2103
2064
|
}
|
|
2104
2065
|
//#endregion
|
|
2066
|
+
//#region web/src/start-settings.ts
|
|
2067
|
+
var $r = (e, t) => typeof e == "object" && e && !Array.isArray(e) ? e[t] : void 0, ei = (e, t) => typeof e == "string" && e !== "" ? e : t;
|
|
2068
|
+
function ti(e) {
|
|
2069
|
+
let t = (t) => e.find((e) => e.key === t)?.value, n = t("kvcoder.approval"), r = t("kvwebui.nav.hidden"), i = t("kvcoder.profile");
|
|
2070
|
+
return {
|
|
2071
|
+
approval: n === "ask" || n === "auto" || n === "never" ? n : void 0,
|
|
2072
|
+
approvalHidden: Array.isArray(r) && r.includes("kvwebui.extensions"),
|
|
2073
|
+
startHeading: ei($r(i, "startHeading"), "kvcoder.ui.startHeading"),
|
|
2074
|
+
placeholder: ei($r(i, "placeholder"), "kvcoder.ui.startPlaceholder")
|
|
2075
|
+
};
|
|
2076
|
+
}
|
|
2077
|
+
function ni(e) {
|
|
2078
|
+
return e.workspace.value.id === "home" ? e.t("kvcoder.ui.homeWorkspace") : e.workspace.value.name;
|
|
2079
|
+
}
|
|
2080
|
+
//#endregion
|
|
2105
2081
|
//#region web/src/use-chat-model.ts
|
|
2106
2082
|
function ri(e, t) {
|
|
2107
2083
|
let n = e.find((e) => e.key === t)?.value;
|
|
@@ -2109,10 +2085,10 @@ function ri(e, t) {
|
|
|
2109
2085
|
}
|
|
2110
2086
|
function ii(e) {
|
|
2111
2087
|
let t = e.find((e) => e.key === "kvcoder.thinking")?.value;
|
|
2112
|
-
return
|
|
2088
|
+
return Pr.find((e) => e === t) ?? "medium";
|
|
2113
2089
|
}
|
|
2114
2090
|
function ai(e, n) {
|
|
2115
|
-
let r = y([]), i = y([]), a = y(null), o = y(null), s = y("medium"), c = y(null), l = y(!1), u = y(!1);
|
|
2091
|
+
let r = y([]), i = y([]), a = y(null), o = y(null), s = y("medium"), c = y(null), l = y(!1), u = y(!1), d = y();
|
|
2116
2092
|
h(async () => {
|
|
2117
2093
|
try {
|
|
2118
2094
|
let [t, n, o] = await Promise.all([
|
|
@@ -2120,20 +2096,21 @@ function ai(e, n) {
|
|
|
2120
2096
|
e.exec("kvai.provider.list", {}),
|
|
2121
2097
|
e.exec("kvai.model.list", {})
|
|
2122
2098
|
]);
|
|
2123
|
-
a.value = ri(t, "kvcoder.model") ?? ri(t, "kvai.defaultModel"), s.value = ii(t), r.value = n, i.value = o;
|
|
2099
|
+
a.value = ri(t, "kvcoder.model") ?? ri(t, "kvai.defaultModel"), s.value = ii(t), d.value = ti(t), r.value = n, i.value = o;
|
|
2124
2100
|
} catch (e) {
|
|
2125
|
-
u.value = !0, n(e);
|
|
2101
|
+
u.value = !0, d.value = ti([]), n(e);
|
|
2126
2102
|
} finally {
|
|
2127
2103
|
l.value = !0;
|
|
2128
2104
|
}
|
|
2129
2105
|
});
|
|
2130
|
-
let
|
|
2106
|
+
let f = t(() => o.value ?? a.value), p = t(() => c.value ?? s.value), m = t(() => Mr(r.value, i.value, f.value)), g = t(() => r.value.find((e) => e.id === i.value.find((e) => e.id === f.value)?.provider));
|
|
2131
2107
|
return {
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2108
|
+
start: d,
|
|
2109
|
+
current: f,
|
|
2110
|
+
thinking: p,
|
|
2111
|
+
groups: m,
|
|
2112
|
+
provider: g,
|
|
2113
|
+
state: t(() => l.value ? u.value ? "ready" : f.value === null ? "noModel" : g.value?.status === "needsKey" ? "needsKey" : "ready" : "loading"),
|
|
2137
2114
|
changes: () => ({
|
|
2138
2115
|
...o.value === null ? {} : { model: o.value },
|
|
2139
2116
|
...c.value === null ? {} : { thinking: c.value }
|
|
@@ -2149,84 +2126,90 @@ var oi = {
|
|
|
2149
2126
|
"data-test": "chat-start"
|
|
2150
2127
|
}, si = {
|
|
2151
2128
|
key: 0,
|
|
2152
|
-
|
|
2153
|
-
role: "status",
|
|
2154
|
-
"data-test": "key-needed"
|
|
2129
|
+
"data-test": "start-heading"
|
|
2155
2130
|
}, ci = {
|
|
2156
2131
|
key: 1,
|
|
2157
2132
|
class: "kvc-muted kvc-start-note",
|
|
2158
2133
|
role: "status",
|
|
2159
|
-
"data-test": "
|
|
2134
|
+
"data-test": "key-needed"
|
|
2160
2135
|
}, li = {
|
|
2161
2136
|
key: 2,
|
|
2137
|
+
class: "kvc-muted kvc-start-note",
|
|
2138
|
+
role: "status",
|
|
2139
|
+
"data-test": "choose-model"
|
|
2140
|
+
}, ui = {
|
|
2141
|
+
key: 3,
|
|
2162
2142
|
class: "kvc-muted kvc-start-note"
|
|
2163
|
-
},
|
|
2143
|
+
}, di = /* @__PURE__ */ c({
|
|
2164
2144
|
__name: "ChatStart",
|
|
2165
2145
|
props: { registered: {} },
|
|
2166
2146
|
setup(t) {
|
|
2167
|
-
let
|
|
2168
|
-
async function
|
|
2169
|
-
|
|
2147
|
+
let c = K(), l = t, u = ai(c, (e) => J(c, e));
|
|
2148
|
+
async function d(e) {
|
|
2149
|
+
u.pickModel(e), await Qr(c, e);
|
|
2170
2150
|
}
|
|
2171
|
-
async function
|
|
2172
|
-
let t = e?.createdChat ?? (await
|
|
2151
|
+
async function f(e) {
|
|
2152
|
+
let t = e?.createdChat ?? (await c.exec("kvcoder.session.create", {})).id;
|
|
2173
2153
|
e !== void 0 && (e.createdChat = t);
|
|
2174
|
-
let
|
|
2175
|
-
return Object.keys(
|
|
2154
|
+
let n = u.changes();
|
|
2155
|
+
return Object.keys(n).length > 0 && await c.exec("kvcoder.session.configure", {
|
|
2176
2156
|
sessionId: t,
|
|
2177
|
-
...
|
|
2157
|
+
...n
|
|
2178
2158
|
}), t;
|
|
2179
2159
|
}
|
|
2180
|
-
async function
|
|
2181
|
-
let t = ir(
|
|
2182
|
-
await or(t, e, async (
|
|
2183
|
-
|
|
2184
|
-
sessionId:
|
|
2160
|
+
async function p(e) {
|
|
2161
|
+
let t = ir(c.workspace.value.id), n;
|
|
2162
|
+
await or(t, e, async (r) => {
|
|
2163
|
+
n = await f(t), await c.exec("kvcoder.message.send", {
|
|
2164
|
+
sessionId: n,
|
|
2185
2165
|
text: e.text,
|
|
2186
2166
|
...e.fileIds.length > 0 ? { fileIds: e.fileIds } : {},
|
|
2187
|
-
sendId:
|
|
2167
|
+
sendId: r
|
|
2188
2168
|
});
|
|
2189
|
-
}) &&
|
|
2169
|
+
}) && n !== void 0 ? c.navigate("kvcoder.session", { sessionId: n }) : qe(t.error)?.code === "kvcoder/SESSION_NOT_FOUND" && (t.createdChat = void 0);
|
|
2190
2170
|
}
|
|
2191
|
-
async function
|
|
2171
|
+
async function m(e, t) {
|
|
2192
2172
|
try {
|
|
2193
|
-
let
|
|
2194
|
-
await
|
|
2195
|
-
sessionId:
|
|
2173
|
+
let n = await f();
|
|
2174
|
+
await c.exec(e.command, {
|
|
2175
|
+
sessionId: n,
|
|
2196
2176
|
argument: t
|
|
2197
|
-
}), e.message !== void 0 && await
|
|
2198
|
-
sessionId:
|
|
2199
|
-
text: t === "" ?
|
|
2200
|
-
}),
|
|
2177
|
+
}), e.message !== void 0 && await c.exec("kvcoder.message.send", {
|
|
2178
|
+
sessionId: n,
|
|
2179
|
+
text: t === "" ? c.t(e.message) : t
|
|
2180
|
+
}), c.navigate("kvcoder.session", { sessionId: n });
|
|
2201
2181
|
} catch (e) {
|
|
2202
|
-
J(
|
|
2182
|
+
J(c, e);
|
|
2203
2183
|
}
|
|
2204
2184
|
}
|
|
2205
|
-
return (t,
|
|
2206
|
-
|
|
2207
|
-
D(
|
|
2185
|
+
return (t, f) => (_(), i(e, null, [a("div", oi, [
|
|
2186
|
+
D(u).start.value === void 0 ? r("v-if", !0) : (_(), i("h1", si, E(D(c).t(D(u).start.value.startHeading, { workspace: D(ni)(D(c)) })), 1)),
|
|
2187
|
+
D(u).state.value === "needsKey" && D(u).provider.value ? (_(), i("p", ci, [o(E(D(c).t("kvcoder.ui.keyNeeded", { provider: D(u).provider.value.title })) + " ", 1), a("button", {
|
|
2208
2188
|
type: "button",
|
|
2209
2189
|
class: "kvc-link-button",
|
|
2210
2190
|
"data-test": "add-key",
|
|
2211
|
-
onClick:
|
|
2212
|
-
}, E(D(
|
|
2213
|
-
|
|
2191
|
+
onClick: f[0] ||= (e) => D(c).navigate("kvai.provider", { providerId: D(u).provider.value.id })
|
|
2192
|
+
}, E(D(c).t("kvcoder.ui.addKey")), 1)])) : D(u).state.value === "noModel" ? (_(), i("p", li, E(D(c).t("kvcoder.ui.chooseModelHint")), 1)) : (_(), i("p", ui, E(D(c).t("kvcoder.ui.startHint")), 1)),
|
|
2193
|
+
D(u).start.value !== void 0 && !D(u).start.value.approvalHidden ? (_(), n(jr, {
|
|
2194
|
+
key: 4,
|
|
2195
|
+
mode: D(u).start.value.approval
|
|
2196
|
+
}, null, 8, ["mode"])) : r("v-if", !0)
|
|
2214
2197
|
]), s(kr, {
|
|
2215
2198
|
stoppable: !1,
|
|
2216
|
-
placeholder: D(
|
|
2217
|
-
blocked: D(
|
|
2199
|
+
placeholder: D(c).t(D(u).start.value?.placeholder ?? "kvcoder.ui.startPlaceholder"),
|
|
2200
|
+
blocked: D(u).state.value !== "ready",
|
|
2218
2201
|
commands: "wait",
|
|
2219
|
-
registered:
|
|
2220
|
-
onSend:
|
|
2221
|
-
onRegistered:
|
|
2202
|
+
registered: l.registered,
|
|
2203
|
+
onSend: p,
|
|
2204
|
+
onRegistered: m
|
|
2222
2205
|
}, {
|
|
2223
|
-
controls: j(() => [s(
|
|
2224
|
-
groups: D(
|
|
2225
|
-
model: D(
|
|
2226
|
-
thinking: D(
|
|
2227
|
-
empty: D(
|
|
2228
|
-
onModel:
|
|
2229
|
-
onThinking: D(
|
|
2206
|
+
controls: j(() => [s(Zr, {
|
|
2207
|
+
groups: D(u).groups.value,
|
|
2208
|
+
model: D(u).current.value,
|
|
2209
|
+
thinking: D(u).thinking.value,
|
|
2210
|
+
empty: D(u).state.value === "loading" ? "" : D(c).t("kvcoder.ui.chooseModel"),
|
|
2211
|
+
onModel: d,
|
|
2212
|
+
onThinking: D(u).pickThinking
|
|
2230
2213
|
}, null, 8, [
|
|
2231
2214
|
"groups",
|
|
2232
2215
|
"model",
|
|
@@ -2244,23 +2227,23 @@ var oi = {
|
|
|
2244
2227
|
});
|
|
2245
2228
|
//#endregion
|
|
2246
2229
|
//#region web/src/use-now.ts
|
|
2247
|
-
function
|
|
2230
|
+
function fi() {
|
|
2248
2231
|
let e = y(Date.now()), t;
|
|
2249
2232
|
return h(() => t = setInterval(() => e.value = Date.now(), 1e3)), m(() => clearInterval(t)), e;
|
|
2250
2233
|
}
|
|
2251
2234
|
//#endregion
|
|
2252
2235
|
//#region web/src/CommandProgress.vue?vue&type=script&setup=true&lang.ts
|
|
2253
|
-
var
|
|
2236
|
+
var pi = ["data-command"], mi = { class: "kvc-activity-text" }, hi = {
|
|
2254
2237
|
style: { "font-weight": "500" },
|
|
2255
2238
|
"data-test": "command-title"
|
|
2256
|
-
},
|
|
2239
|
+
}, gi = {
|
|
2257
2240
|
class: "kvc-muted",
|
|
2258
2241
|
"data-test": "command-seconds"
|
|
2259
|
-
},
|
|
2242
|
+
}, _i = /* @__PURE__ */ c({
|
|
2260
2243
|
__name: "CommandProgress",
|
|
2261
2244
|
props: { working: {} },
|
|
2262
2245
|
setup(e) {
|
|
2263
|
-
let n = e, r = K(), o =
|
|
2246
|
+
let n = e, r = K(), o = fi(), s = t(() => Math.max(0, Math.floor((o.value - n.working.startedAt) / 1e3)));
|
|
2264
2247
|
return (e, t) => (_(), i("div", {
|
|
2265
2248
|
class: "kvc-activity",
|
|
2266
2249
|
role: "status",
|
|
@@ -2272,17 +2255,17 @@ var fi = ["data-command"], pi = { class: "kvc-activity-text" }, mi = {
|
|
|
2272
2255
|
class: "kvc-spin",
|
|
2273
2256
|
"aria-hidden": "true"
|
|
2274
2257
|
}, null, -1),
|
|
2275
|
-
a("span",
|
|
2276
|
-
a("span",
|
|
2277
|
-
], 8,
|
|
2258
|
+
a("span", mi, [a("span", hi, E(D(r).t(`kvcoder.ui.working.${n.working.name}`)), 1)]),
|
|
2259
|
+
a("span", gi, E(D(r).t("kvcoder.ui.seconds", { count: s.value })), 1)
|
|
2260
|
+
], 8, pi));
|
|
2278
2261
|
}
|
|
2279
|
-
}),
|
|
2262
|
+
}), vi = ["data-state"], yi = { style: { flex: "1 1 auto" } }, bi = {
|
|
2280
2263
|
key: 0,
|
|
2281
2264
|
"data-test": "staging-changed"
|
|
2282
|
-
},
|
|
2265
|
+
}, xi = {
|
|
2283
2266
|
key: 1,
|
|
2284
2267
|
"data-test": "staging-head-moved"
|
|
2285
|
-
},
|
|
2268
|
+
}, Si = ["disabled"], Ci = /* @__PURE__ */ c({
|
|
2286
2269
|
__name: "StagingNote",
|
|
2287
2270
|
props: {
|
|
2288
2271
|
sessionId: {},
|
|
@@ -2329,7 +2312,7 @@ var fi = ["data-command"], pi = { class: "kvc-activity-text" }, mi = {
|
|
|
2329
2312
|
size: 18,
|
|
2330
2313
|
"aria-hidden": "true"
|
|
2331
2314
|
}),
|
|
2332
|
-
a("span",
|
|
2315
|
+
a("span", yi, [l.value.state === "restored" ? (_(), i(e, { key: 0 }, [o(E(D(c).t("kvcoder.ui.staging.restored")), 1)], 64)) : (_(), i(e, { key: 1 }, [l.value.paths > 0 ? (_(), i("span", bi, E(D(c).t("kvcoder.ui.staging.changed", { paths: l.value.paths })), 1)) : r("v-if", !0), l.value.headMoved ? (_(), i("span", xi, E(D(c).t("kvcoder.ui.staging.headMoved")), 1)) : r("v-if", !0)], 64))]),
|
|
2333
2316
|
l.value.state === "changed" && !l.value.headMoved ? (_(), i("button", {
|
|
2334
2317
|
key: 0,
|
|
2335
2318
|
type: "button",
|
|
@@ -2337,18 +2320,18 @@ var fi = ["data-command"], pi = { class: "kvc-activity-text" }, mi = {
|
|
|
2337
2320
|
disabled: u.value,
|
|
2338
2321
|
"data-test": "staging-restore",
|
|
2339
2322
|
onClick: d
|
|
2340
|
-
}, E(D(c).t("kvcoder.ui.staging.restore")), 9,
|
|
2341
|
-
], 8,
|
|
2323
|
+
}, E(D(c).t("kvcoder.ui.staging.restore")), 9, Si)) : r("v-if", !0)
|
|
2324
|
+
], 8, vi));
|
|
2342
2325
|
}
|
|
2343
|
-
}),
|
|
2344
|
-
function
|
|
2326
|
+
}), wi = 5;
|
|
2327
|
+
function Ti(e, t) {
|
|
2345
2328
|
let n = Math.max(0, Math.floor(t / 1e3));
|
|
2346
2329
|
return n < 60 ? e("kvcoder.ui.seconds", { count: n }) : e("kvcoder.ui.jobs.minutes", {
|
|
2347
2330
|
minutes: Math.floor(n / 60),
|
|
2348
2331
|
seconds: n % 60
|
|
2349
2332
|
});
|
|
2350
2333
|
}
|
|
2351
|
-
function
|
|
2334
|
+
function Ei(e, n, r) {
|
|
2352
2335
|
let i = y([]), a = y({}), o = y(/* @__PURE__ */ new Set()), s = y(Date.now()), c = t(() => i.value.filter((e) => e.status === "running")), l = 0, u;
|
|
2353
2336
|
async function d() {
|
|
2354
2337
|
for (let t of Object.keys(a.value)) {
|
|
@@ -2393,7 +2376,7 @@ function Ti(e, n, r) {
|
|
|
2393
2376
|
}
|
|
2394
2377
|
return A(() => c.value.length > 0 || r.value, (e) => {
|
|
2395
2378
|
clearInterval(u), u = void 0, e && (u = setInterval(() => {
|
|
2396
|
-
s.value = Date.now(), l += 1, l %
|
|
2379
|
+
s.value = Date.now(), l += 1, l % wi === 0 && f();
|
|
2397
2380
|
}, 1e3));
|
|
2398
2381
|
}, { immediate: !0 }), m(() => clearInterval(u)), {
|
|
2399
2382
|
jobs: i,
|
|
@@ -2408,25 +2391,25 @@ function Ti(e, n, r) {
|
|
|
2408
2391
|
}
|
|
2409
2392
|
//#endregion
|
|
2410
2393
|
//#region web/src/JobItem.vue?vue&type=script&setup=true&lang.ts
|
|
2411
|
-
var
|
|
2394
|
+
var Di = ["data-test", "data-status"], Oi = { class: "kvc-job-head" }, ki = {
|
|
2412
2395
|
class: "kvc-job-title kvc-oneline",
|
|
2413
2396
|
"data-test": "job-title"
|
|
2414
|
-
},
|
|
2397
|
+
}, Ai = {
|
|
2415
2398
|
key: 0,
|
|
2416
2399
|
class: "kvc-muted",
|
|
2417
2400
|
"data-test": "job-time"
|
|
2418
|
-
},
|
|
2401
|
+
}, ji = {
|
|
2419
2402
|
key: 1,
|
|
2420
2403
|
class: "kvc-chip",
|
|
2421
2404
|
"data-test": "job-status"
|
|
2422
|
-
},
|
|
2405
|
+
}, Mi = {
|
|
2423
2406
|
key: 0,
|
|
2424
2407
|
class: "kvc-job-links"
|
|
2425
|
-
},
|
|
2408
|
+
}, Ni = ["href"], Pi = { class: "kvc-actions" }, Fi = ["aria-expanded", "data-test"], Ii = ["disabled", "data-test"], Li = {
|
|
2426
2409
|
key: 2,
|
|
2427
2410
|
class: "kvc-output",
|
|
2428
2411
|
"data-test": "job-output"
|
|
2429
|
-
},
|
|
2412
|
+
}, Ri = /* @__PURE__ */ c({
|
|
2430
2413
|
__name: "JobItem",
|
|
2431
2414
|
props: {
|
|
2432
2415
|
sessionId: {},
|
|
@@ -2443,30 +2426,30 @@ var Ei = ["data-test", "data-status"], Di = { class: "kvc-job-head" }, Oi = {
|
|
|
2443
2426
|
"data-test": `job-${c.job.id}`,
|
|
2444
2427
|
"data-status": c.job.status
|
|
2445
2428
|
}, [
|
|
2446
|
-
a("div",
|
|
2447
|
-
c.job.links.length > 0 ? (_(), i("div",
|
|
2429
|
+
a("div", Oi, [a("span", ki, E(c.job.title), 1), c.job.status === "running" ? (_(), i("span", Ai, E(D(Ti)(D(u).t, c.now - Date.parse(c.job.startedAt))), 1)) : (_(), i("span", ji, [o(E(D(u).t(`kvcoder.ui.jobs.status.${c.job.status}`)), 1), c.job.exitCode !== void 0 && c.job.exitCode !== 0 ? (_(), i(e, { key: 0 }, [o(" · " + E(D(u).t("kvcoder.ui.exitCode", { code: c.job.exitCode })), 1)], 64)) : r("v-if", !0)]))]),
|
|
2430
|
+
c.job.links.length > 0 ? (_(), i("div", Mi, [(_(!0), i(e, null, b(c.job.links, (e) => (_(), i("a", {
|
|
2448
2431
|
key: e,
|
|
2449
2432
|
href: e,
|
|
2450
2433
|
target: "_blank",
|
|
2451
2434
|
rel: "noopener noreferrer",
|
|
2452
2435
|
class: "kvc-link kvc-mono",
|
|
2453
2436
|
"data-test": "job-link"
|
|
2454
|
-
}, E(e), 9,
|
|
2455
|
-
a("div",
|
|
2437
|
+
}, E(e), 9, Ni))), 128))])) : r("v-if", !0),
|
|
2438
|
+
a("div", Pi, [a("button", {
|
|
2456
2439
|
type: "button",
|
|
2457
2440
|
class: "kvc-button",
|
|
2458
2441
|
"aria-expanded": c.logs !== void 0,
|
|
2459
2442
|
"data-test": `job-logs-${c.job.id}`,
|
|
2460
2443
|
onClick: s[0] ||= (e) => l("logs")
|
|
2461
|
-
}, E(D(u).t("kvcoder.ui.jobs.logs")), 9,
|
|
2444
|
+
}, E(D(u).t("kvcoder.ui.jobs.logs")), 9, Fi), c.job.status === "running" ? (_(), i("button", {
|
|
2462
2445
|
key: 0,
|
|
2463
2446
|
type: "button",
|
|
2464
2447
|
class: "kvc-button kvc-primary",
|
|
2465
2448
|
disabled: c.stopping,
|
|
2466
2449
|
"data-test": `job-stop-${c.job.id}`,
|
|
2467
2450
|
onClick: s[1] ||= (e) => l("stop")
|
|
2468
|
-
}, E(D(u).t("kvcoder.ui.jobs.stop")), 9,
|
|
2469
|
-
c.job.staging === void 0 ? r("v-if", !0) : (_(), n(
|
|
2451
|
+
}, E(D(u).t("kvcoder.ui.jobs.stop")), 9, Ii)) : r("v-if", !0)]),
|
|
2452
|
+
c.job.staging === void 0 ? r("v-if", !0) : (_(), n(Ci, {
|
|
2470
2453
|
key: 1,
|
|
2471
2454
|
"session-id": c.sessionId,
|
|
2472
2455
|
"run-id": c.job.id,
|
|
@@ -2476,14 +2459,14 @@ var Ei = ["data-test", "data-status"], Di = { class: "kvc-job-head" }, Oi = {
|
|
|
2476
2459
|
"run-id",
|
|
2477
2460
|
"staging"
|
|
2478
2461
|
])),
|
|
2479
|
-
c.logs === void 0 ? r("v-if", !0) : (_(), i("pre",
|
|
2480
|
-
], 8,
|
|
2462
|
+
c.logs === void 0 ? r("v-if", !0) : (_(), i("pre", Li, E(c.logs === "" ? D(u).t("kvcoder.ui.jobs.noOutput") : c.logs), 1))
|
|
2463
|
+
], 8, Di));
|
|
2481
2464
|
}
|
|
2482
|
-
}),
|
|
2465
|
+
}), zi = {
|
|
2483
2466
|
key: 0,
|
|
2484
2467
|
class: "kvc-jobs",
|
|
2485
2468
|
"data-test": "jobs"
|
|
2486
|
-
},
|
|
2469
|
+
}, Bi = ["aria-expanded"], Vi = ["aria-label", "onKeydown"], Hi = /* @__PURE__ */ c({
|
|
2487
2470
|
__name: "JobsChip",
|
|
2488
2471
|
props: {
|
|
2489
2472
|
sessionId: {},
|
|
@@ -2491,14 +2474,14 @@ var Ei = ["data-test", "data-status"], Di = { class: "kvc-job-head" }, Oi = {
|
|
|
2491
2474
|
},
|
|
2492
2475
|
emits: ["running"],
|
|
2493
2476
|
setup(t, { emit: c }) {
|
|
2494
|
-
let l = t, u = c, d = K(), f = y(!1), p = O("trigger"), { jobs: g, running: v, logs: x, stopping: S, now: C, load: w, toggleLogs: T, stop: k } =
|
|
2477
|
+
let l = t, u = c, d = K(), f = y(!1), p = O("trigger"), { jobs: g, running: v, logs: x, stopping: S, now: C, load: w, toggleLogs: T, stop: k } = Ei(d, () => l.sessionId, f);
|
|
2495
2478
|
function j() {
|
|
2496
2479
|
f.value = !1, p.value?.focus();
|
|
2497
2480
|
}
|
|
2498
2481
|
function M(e) {
|
|
2499
2482
|
e.target instanceof Node && !p.value?.parentElement?.contains(e.target) && (f.value = !1);
|
|
2500
2483
|
}
|
|
2501
|
-
return A(() => v.value.length, (e) => u("running", e), { immediate: !0 }), h(w), A(() => [l.sessionId, l.stamp], w), A(f, (e) => e ? document.addEventListener("pointerdown", M) : document.removeEventListener("pointerdown", M)), m(() => document.removeEventListener("pointerdown", M)), (t, c) => D(v).length > 0 || f.value ? (_(), i("div",
|
|
2484
|
+
return A(() => v.value.length, (e) => u("running", e), { immediate: !0 }), h(w), A(() => [l.sessionId, l.stamp], w), A(f, (e) => e ? document.addEventListener("pointerdown", M) : document.removeEventListener("pointerdown", M)), m(() => document.removeEventListener("pointerdown", M)), (t, c) => D(v).length > 0 || f.value ? (_(), i("div", zi, [a("button", {
|
|
2502
2485
|
ref_key: "trigger",
|
|
2503
2486
|
ref: p,
|
|
2504
2487
|
type: "button",
|
|
@@ -2513,18 +2496,18 @@ var Ei = ["data-test", "data-status"], Di = { class: "kvc-job-head" }, Oi = {
|
|
|
2513
2496
|
"aria-hidden": "true"
|
|
2514
2497
|
}, null, -1),
|
|
2515
2498
|
o(E(D(d).t("kvcoder.ui.jobs.running", { count: D(v).length })), 1),
|
|
2516
|
-
s(D(
|
|
2499
|
+
s(D(U), {
|
|
2517
2500
|
size: 16,
|
|
2518
2501
|
"aria-hidden": "true"
|
|
2519
2502
|
})
|
|
2520
|
-
], 8,
|
|
2503
|
+
], 8, Bi), f.value ? (_(), i("div", {
|
|
2521
2504
|
key: 0,
|
|
2522
2505
|
class: "kvc-popover kvc-jobs-panel",
|
|
2523
2506
|
role: "dialog",
|
|
2524
2507
|
"aria-label": D(d).t("kvcoder.ui.jobs.title"),
|
|
2525
2508
|
"data-test": "jobs-popover",
|
|
2526
2509
|
onKeydown: N(P(j, ["stop"]), ["esc"])
|
|
2527
|
-
}, [(_(!0), i(e, null, b(D(g), (e) => (_(), n(
|
|
2510
|
+
}, [(_(!0), i(e, null, b(D(g), (e) => (_(), n(Ri, {
|
|
2528
2511
|
key: e.id,
|
|
2529
2512
|
"session-id": l.sessionId,
|
|
2530
2513
|
job: e,
|
|
@@ -2541,25 +2524,25 @@ var Ei = ["data-test", "data-status"], Di = { class: "kvc-job-head" }, Oi = {
|
|
|
2541
2524
|
"stopping",
|
|
2542
2525
|
"onStop",
|
|
2543
2526
|
"onLogs"
|
|
2544
|
-
]))), 128))], 40,
|
|
2527
|
+
]))), 128))], 40, Vi)) : r("v-if", !0)])) : r("v-if", !0);
|
|
2545
2528
|
}
|
|
2546
|
-
}),
|
|
2529
|
+
}), Ui = { class: "kvc-header" }, Wi = { class: "kvc-title" }, Gi = ["aria-label"], Ki = {
|
|
2547
2530
|
key: 1,
|
|
2548
2531
|
"data-test": "session-title"
|
|
2549
|
-
},
|
|
2532
|
+
}, qi = { class: "kvc-muted kvc-header-stats" }, Ji = ["title"], Yi = ["title", "aria-label"], Xi = [
|
|
2550
2533
|
"aria-pressed",
|
|
2551
2534
|
"aria-label",
|
|
2552
2535
|
"title"
|
|
2553
|
-
],
|
|
2536
|
+
], Zi = [
|
|
2554
2537
|
"aria-pressed",
|
|
2555
2538
|
"aria-label",
|
|
2556
2539
|
"title"
|
|
2557
|
-
],
|
|
2540
|
+
], Qi = ["aria-label", "aria-expanded"], $i = {
|
|
2558
2541
|
key: 0,
|
|
2559
2542
|
class: "kvc-menu",
|
|
2560
2543
|
role: "menu",
|
|
2561
2544
|
"data-test": "chat-menu-items"
|
|
2562
|
-
},
|
|
2545
|
+
}, ea = ["disabled"], ta = ["disabled"], na = ["disabled"], ra = ["disabled"], ia = ["aria-label"], aa = { style: { padding: "6px" } }, oa = { class: "kvc-actions" }, sa = /* @__PURE__ */ c({
|
|
2563
2546
|
__name: "ConversationHeader",
|
|
2564
2547
|
props: {
|
|
2565
2548
|
session: {},
|
|
@@ -2590,7 +2573,7 @@ var Ei = ["data-test", "data-status"], Di = { class: "kvc-job-head" }, Oi = {
|
|
|
2590
2573
|
"backgroundRunning"
|
|
2591
2574
|
],
|
|
2592
2575
|
setup(n, { emit: c }) {
|
|
2593
|
-
let l = n, u = c, d = K(), f = y(!1), p = y(null), m = y(!1), h = O("more"), g =
|
|
2576
|
+
let l = n, u = c, d = K(), f = y(!1), p = y(null), m = y(!1), h = O("more"), g = fi(), v = t(() => l.runningSince === void 0 ? 0 : Math.max(0, g.value - Date.parse(l.runningSince))), b = t(() => ot(d.t, l.session.usage, l.session.durationMs + v.value)), x = t(() => `${d.t("kvcoder.ui.turns", { count: l.turns })} · ${st(d.t, l.session.usage)} · ${ct(d.t, l.session.usageBy)}`), S = t(() => lt(d.t, l.context)), C = t(() => l.map === void 0 ? "" : d.t("kvcoder.ui.map.toggle", l.map)), w = t(() => d.t("kvcoder.ui.artifacts.toggle", { count: l.artifacts }));
|
|
2594
2577
|
function T() {
|
|
2595
2578
|
f.value = !1, m.value = !1;
|
|
2596
2579
|
}
|
|
@@ -2602,8 +2585,8 @@ var Ei = ["data-test", "data-status"], Di = { class: "kvc-job-head" }, Oi = {
|
|
|
2602
2585
|
let e = p.value ?? "";
|
|
2603
2586
|
p.value = null, u("action", "rename", e);
|
|
2604
2587
|
}
|
|
2605
|
-
return (t, n) => (_(), i("header",
|
|
2606
|
-
a("div",
|
|
2588
|
+
return (t, n) => (_(), i("header", Ui, [
|
|
2589
|
+
a("div", Wi, [p.value === null ? (_(), i("strong", Ki, E(D(Ge)(D(d).t, l.session.title)), 1)) : (_(), i("form", {
|
|
2607
2590
|
key: 0,
|
|
2608
2591
|
onSubmit: P(j, ["prevent"])
|
|
2609
2592
|
}, [M(a("input", {
|
|
@@ -2612,15 +2595,15 @@ var Ei = ["data-test", "data-status"], Di = { class: "kvc-job-head" }, Oi = {
|
|
|
2612
2595
|
"aria-label": D(d).t("kvcoder.ui.rename"),
|
|
2613
2596
|
"data-test": "rename-input",
|
|
2614
2597
|
onBlur: j
|
|
2615
|
-
}, null, 40,
|
|
2598
|
+
}, null, 40, Gi), [[k, p.value]])], 32)), a("span", qi, [a("span", {
|
|
2616
2599
|
title: x.value,
|
|
2617
2600
|
"data-test": "session-totals"
|
|
2618
|
-
}, E(b.value), 9,
|
|
2601
|
+
}, E(b.value), 9, Ji), S.value === void 0 ? r("v-if", !0) : (_(), i(e, { key: 0 }, [n[13] ||= o(" · ", -1), a("span", {
|
|
2619
2602
|
title: S.value.full,
|
|
2620
2603
|
"aria-label": S.value.full,
|
|
2621
2604
|
"data-test": "session-context"
|
|
2622
|
-
}, E(S.value.short), 9,
|
|
2623
|
-
s(
|
|
2605
|
+
}, E(S.value.short), 9, Yi)], 64))])]),
|
|
2606
|
+
s(Hi, {
|
|
2624
2607
|
"session-id": l.session.id,
|
|
2625
2608
|
stamp: l.session.updatedAt,
|
|
2626
2609
|
onRunning: n[1] ||= (e) => u("backgroundRunning", e)
|
|
@@ -2637,7 +2620,7 @@ var Ei = ["data-test", "data-status"], Di = { class: "kvc-job-head" }, Oi = {
|
|
|
2637
2620
|
}, [s(D(Ae), {
|
|
2638
2621
|
size: 16,
|
|
2639
2622
|
"aria-hidden": "true"
|
|
2640
|
-
}), o(E(D(d).t("kvcoder.ui.map.count", l.map)), 1)], 8,
|
|
2623
|
+
}), o(E(D(d).t("kvcoder.ui.map.count", l.map)), 1)], 8, Xi)),
|
|
2641
2624
|
l.artifacts > 0 ? (_(), i("button", {
|
|
2642
2625
|
key: 1,
|
|
2643
2626
|
type: "button",
|
|
@@ -2650,7 +2633,7 @@ var Ei = ["data-test", "data-status"], Di = { class: "kvc-job-head" }, Oi = {
|
|
|
2650
2633
|
}, [s(D(Ce), {
|
|
2651
2634
|
size: 16,
|
|
2652
2635
|
"aria-hidden": "true"
|
|
2653
|
-
}), o(E(l.artifacts), 1)], 8,
|
|
2636
|
+
}), o(E(l.artifacts), 1)], 8, Zi)) : r("v-if", !0),
|
|
2654
2637
|
a("div", {
|
|
2655
2638
|
ref_key: "more",
|
|
2656
2639
|
ref: h,
|
|
@@ -2665,8 +2648,8 @@ var Ei = ["data-test", "data-status"], Di = { class: "kvc-job-head" }, Oi = {
|
|
|
2665
2648
|
onClick: n[4] ||= (e) => {
|
|
2666
2649
|
f.value = !f.value, m.value = !1;
|
|
2667
2650
|
}
|
|
2668
|
-
}, [s(D(
|
|
2669
|
-
f.value ? (_(), i("div",
|
|
2651
|
+
}, [s(D(G), { size: 18 })], 8, Qi),
|
|
2652
|
+
f.value ? (_(), i("div", $i, [
|
|
2670
2653
|
a("button", {
|
|
2671
2654
|
type: "button",
|
|
2672
2655
|
role: "menuitem",
|
|
@@ -2674,7 +2657,7 @@ var Ei = ["data-test", "data-status"], Di = { class: "kvc-job-head" }, Oi = {
|
|
|
2674
2657
|
"data-test": "menu-rename",
|
|
2675
2658
|
disabled: l.working,
|
|
2676
2659
|
onClick: n[5] ||= (e) => A(() => p.value = l.session.title)
|
|
2677
|
-
}, E(D(d).t("kvcoder.ui.rename")), 9,
|
|
2660
|
+
}, E(D(d).t("kvcoder.ui.rename")), 9, ea),
|
|
2678
2661
|
a("button", {
|
|
2679
2662
|
type: "button",
|
|
2680
2663
|
role: "menuitem",
|
|
@@ -2682,7 +2665,7 @@ var Ei = ["data-test", "data-status"], Di = { class: "kvc-job-head" }, Oi = {
|
|
|
2682
2665
|
"data-test": "menu-fork",
|
|
2683
2666
|
disabled: l.working,
|
|
2684
2667
|
onClick: n[6] ||= (e) => A(() => u("action", "fork", ""))
|
|
2685
|
-
}, E(D(d).t("kvcoder.ui.fork")), 9,
|
|
2668
|
+
}, E(D(d).t("kvcoder.ui.fork")), 9, ta),
|
|
2686
2669
|
a("button", {
|
|
2687
2670
|
type: "button",
|
|
2688
2671
|
role: "menuitem",
|
|
@@ -2690,7 +2673,7 @@ var Ei = ["data-test", "data-status"], Di = { class: "kvc-job-head" }, Oi = {
|
|
|
2690
2673
|
"data-test": "menu-export",
|
|
2691
2674
|
disabled: l.working,
|
|
2692
2675
|
onClick: n[7] ||= (e) => A(() => u("action", "export", ""))
|
|
2693
|
-
}, E(D(d).t("kvcoder.ui.export")), 9,
|
|
2676
|
+
}, E(D(d).t("kvcoder.ui.export")), 9, na),
|
|
2694
2677
|
a("button", {
|
|
2695
2678
|
type: "button",
|
|
2696
2679
|
role: "menuitem",
|
|
@@ -2698,7 +2681,7 @@ var Ei = ["data-test", "data-status"], Di = { class: "kvc-job-head" }, Oi = {
|
|
|
2698
2681
|
"data-test": "menu-compact",
|
|
2699
2682
|
disabled: l.working,
|
|
2700
2683
|
onClick: n[8] ||= (e) => A(() => u("action", "compact", ""))
|
|
2701
|
-
}, E(D(d).t("kvcoder.ui.compact")), 9,
|
|
2684
|
+
}, E(D(d).t("kvcoder.ui.compact")), 9, ra),
|
|
2702
2685
|
a("button", {
|
|
2703
2686
|
type: "button",
|
|
2704
2687
|
role: "menuitem",
|
|
@@ -2722,7 +2705,7 @@ var Ei = ["data-test", "data-status"], Di = { class: "kvc-job-head" }, Oi = {
|
|
|
2722
2705
|
role: "alertdialog",
|
|
2723
2706
|
"aria-label": D(d).t("kvcoder.ui.deleteConfirm"),
|
|
2724
2707
|
"data-test": "delete-confirm"
|
|
2725
|
-
}, [a("span",
|
|
2708
|
+
}, [a("span", aa, E(D(d).t("kvcoder.ui.deleteConfirm")), 1), a("div", oa, [a("button", {
|
|
2726
2709
|
type: "button",
|
|
2727
2710
|
class: "kvc-button",
|
|
2728
2711
|
onClick: n[11] ||= (e) => m.value = !1
|
|
@@ -2731,24 +2714,24 @@ var Ei = ["data-test", "data-status"], Di = { class: "kvc-job-head" }, Oi = {
|
|
|
2731
2714
|
class: "kvc-button kvc-primary",
|
|
2732
2715
|
"data-test": "confirm-delete",
|
|
2733
2716
|
onClick: n[12] ||= (e) => A(() => u("action", "delete", ""))
|
|
2734
|
-
}, E(D(d).t("kvcoder.ui.delete")), 1)])], 8,
|
|
2717
|
+
}, E(D(d).t("kvcoder.ui.delete")), 1)])], 8, ia)) : r("v-if", !0)
|
|
2735
2718
|
], 512)
|
|
2736
2719
|
]));
|
|
2737
2720
|
}
|
|
2738
|
-
}),
|
|
2721
|
+
}), ca = 200, la = [
|
|
2739
2722
|
"text",
|
|
2740
2723
|
"choice",
|
|
2741
2724
|
"confirm"
|
|
2742
2725
|
];
|
|
2743
|
-
function
|
|
2726
|
+
function ua(e) {
|
|
2744
2727
|
return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
|
|
2745
2728
|
}
|
|
2746
2729
|
var X = (e) => typeof e == "string" && e.trim() !== "" ? e : void 0;
|
|
2747
|
-
function
|
|
2730
|
+
function da(e, t) {
|
|
2748
2731
|
let n = X(t.args);
|
|
2749
2732
|
return X(t.line) ?? (n === void 0 ? e : `${e} ${n}`);
|
|
2750
2733
|
}
|
|
2751
|
-
function
|
|
2734
|
+
function fa(e) {
|
|
2752
2735
|
let t = X(e.title) ?? X(e.description), n = X(e.command);
|
|
2753
2736
|
return {
|
|
2754
2737
|
...t === void 0 ? {} : { description: t },
|
|
@@ -2756,10 +2739,10 @@ function da(e) {
|
|
|
2756
2739
|
...e.mode === "async" ? { background: !0 } : {}
|
|
2757
2740
|
};
|
|
2758
2741
|
}
|
|
2759
|
-
function
|
|
2742
|
+
function pa(e) {
|
|
2760
2743
|
let t = X(e.connector), n = X(e.command);
|
|
2761
|
-
if (t === void 0) return
|
|
2762
|
-
let r = X(e.description), i =
|
|
2744
|
+
if (t === void 0) return fa(e);
|
|
2745
|
+
let r = X(e.description), i = ua(typeof e.payload == "string" ? void 0 : e.payload) ?? {}, a = t === "ask" ? la.find((e) => e === n) : void 0;
|
|
2763
2746
|
return {
|
|
2764
2747
|
...r === void 0 ? {} : { description: r },
|
|
2765
2748
|
connector: t,
|
|
@@ -2767,7 +2750,7 @@ function fa(e) {
|
|
|
2767
2750
|
command: n,
|
|
2768
2751
|
label: `${t} · ${n}`
|
|
2769
2752
|
},
|
|
2770
|
-
...n === "exec" ? { line:
|
|
2753
|
+
...n === "exec" ? { line: da(t, i) } : {},
|
|
2771
2754
|
fields: i,
|
|
2772
2755
|
...i.risky === !0 ? { risky: !0 } : {},
|
|
2773
2756
|
...i.background === !0 ? { background: !0 } : {},
|
|
@@ -2777,23 +2760,23 @@ function fa(e) {
|
|
|
2777
2760
|
} }
|
|
2778
2761
|
};
|
|
2779
2762
|
}
|
|
2780
|
-
var
|
|
2763
|
+
var ma = [
|
|
2781
2764
|
"edit",
|
|
2782
2765
|
"write",
|
|
2783
2766
|
"read",
|
|
2784
2767
|
"list",
|
|
2785
2768
|
"search"
|
|
2786
2769
|
];
|
|
2787
|
-
function ma(e) {
|
|
2788
|
-
return e.line === void 0 ? e.connector === "fs" ? pa.find((t) => t === e.command) ?? "fields" : e.connector === "mcp" && e.command === "call" ? "mcp-call" : e.connector === "background" && (e.command === "output" || e.command === "wait") ? "run-output" : e.connector === "delegate" && e.command === "run" ? "delegate" : "fields" : "line";
|
|
2789
|
-
}
|
|
2790
2770
|
function ha(e) {
|
|
2771
|
+
return e.line === void 0 ? e.connector === "fs" ? ma.find((t) => t === e.command) ?? "fields" : e.connector === "mcp" && e.command === "call" ? "mcp-call" : e.connector === "background" && (e.command === "output" || e.command === "wait") ? "run-output" : e.connector === "delegate" && e.command === "run" ? "delegate" : "fields" : "line";
|
|
2772
|
+
}
|
|
2773
|
+
function ga(e) {
|
|
2791
2774
|
let t = e.replace(/\s+/g, " ");
|
|
2792
|
-
return t.length >
|
|
2775
|
+
return t.length > ca ? `${t.slice(0, ca)}…` : t;
|
|
2793
2776
|
}
|
|
2794
2777
|
//#endregion
|
|
2795
2778
|
//#region web/src/live-step.ts
|
|
2796
|
-
var
|
|
2779
|
+
var _a = () => ({
|
|
2797
2780
|
text: "",
|
|
2798
2781
|
thinking: "",
|
|
2799
2782
|
summarizing: !1,
|
|
@@ -2801,28 +2784,28 @@ var ga = () => ({
|
|
|
2801
2784
|
retry: null,
|
|
2802
2785
|
startedAt: Date.now()
|
|
2803
2786
|
});
|
|
2804
|
-
function
|
|
2787
|
+
function va(e) {
|
|
2805
2788
|
return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
|
|
2806
2789
|
}
|
|
2807
|
-
function
|
|
2790
|
+
function ya(e) {
|
|
2808
2791
|
let t = e.calls.at(-1);
|
|
2809
2792
|
return t === void 0 ? e.text === "" ? e.thinking === "" ? e.retry === null ? "waiting" : "retrying" : "thinking" : "writing" : t.complete ? "running" : "preparing";
|
|
2810
2793
|
}
|
|
2811
|
-
function
|
|
2812
|
-
let r =
|
|
2794
|
+
function ba(e, t, n) {
|
|
2795
|
+
let r = va(t.arguments);
|
|
2813
2796
|
(r === void 0 || e.calls.length === 0) && e.calls.push({
|
|
2814
2797
|
name: n,
|
|
2815
2798
|
complete: !1
|
|
2816
2799
|
});
|
|
2817
2800
|
let i = e.calls.at(-1);
|
|
2818
2801
|
if (r === void 0 || i === void 0) return;
|
|
2819
|
-
let a =
|
|
2802
|
+
let a = pa(r);
|
|
2820
2803
|
a.description !== void 0 && (i.description = a.description), a.label !== void 0 && (i.label = a.label), i.complete = "payload" in r;
|
|
2821
2804
|
}
|
|
2822
|
-
function
|
|
2805
|
+
function xa(e, t) {
|
|
2823
2806
|
if (t.type !== "progress") return { kind: "none" };
|
|
2824
|
-
let n =
|
|
2825
|
-
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" &&
|
|
2807
|
+
let n = va(t.data);
|
|
2808
|
+
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" && ba(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" && Object.assign(e, {
|
|
2826
2809
|
text: "",
|
|
2827
2810
|
thinking: "",
|
|
2828
2811
|
calls: e.calls.filter((e) => e.carried === !0),
|
|
@@ -2841,37 +2824,37 @@ function ba(e, t) {
|
|
|
2841
2824
|
}
|
|
2842
2825
|
//#endregion
|
|
2843
2826
|
//#region web/src/ActivityLine.vue?vue&type=script&setup=true&lang.ts
|
|
2844
|
-
var
|
|
2827
|
+
var Sa = ["data-phase"], Ca = { class: "kvc-activity-text" }, wa = {
|
|
2845
2828
|
style: { "font-weight": "600" },
|
|
2846
2829
|
"data-test": "activity-title"
|
|
2847
|
-
},
|
|
2830
|
+
}, Ta = {
|
|
2848
2831
|
key: 0,
|
|
2849
2832
|
class: "kvc-muted",
|
|
2850
2833
|
dir: "ltr",
|
|
2851
2834
|
"data-test": "activity-label"
|
|
2852
|
-
},
|
|
2835
|
+
}, Ea = {
|
|
2853
2836
|
key: 1,
|
|
2854
2837
|
style: { "font-weight": "500" },
|
|
2855
2838
|
"data-test": "activity-title"
|
|
2856
|
-
},
|
|
2839
|
+
}, Da = {
|
|
2857
2840
|
key: 0,
|
|
2858
2841
|
class: "kvc-muted",
|
|
2859
2842
|
"data-test": "activity-phase"
|
|
2860
|
-
},
|
|
2843
|
+
}, Oa = {
|
|
2861
2844
|
key: 1,
|
|
2862
2845
|
class: "kvc-muted",
|
|
2863
2846
|
"data-test": "activity-turn"
|
|
2864
|
-
},
|
|
2847
|
+
}, ka = {
|
|
2865
2848
|
class: "kvc-muted",
|
|
2866
2849
|
"data-test": "activity-seconds"
|
|
2867
|
-
},
|
|
2850
|
+
}, Aa = /* @__PURE__ */ c({
|
|
2868
2851
|
__name: "ActivityLine",
|
|
2869
2852
|
props: {
|
|
2870
2853
|
live: {},
|
|
2871
2854
|
turn: {}
|
|
2872
2855
|
},
|
|
2873
2856
|
setup(n) {
|
|
2874
|
-
let o = n, s = K(), c =
|
|
2857
|
+
let o = n, s = K(), c = fi(), l = t(() => ya(o.live)), u = t(() => {
|
|
2875
2858
|
if (o.turn !== void 0 && o.turn.steps !== 0) return o.turn.usage.cost === 0 ? s.t("kvcoder.ui.turnSteps", { steps: o.turn.steps }) : s.t("kvcoder.ui.turnSoFar", {
|
|
2876
2859
|
steps: o.turn.steps,
|
|
2877
2860
|
cost: it(o.turn.usage.cost)
|
|
@@ -2888,15 +2871,15 @@ var xa = ["data-phase"], Sa = { class: "kvc-activity-text" }, Ca = {
|
|
|
2888
2871
|
class: "kvc-spin",
|
|
2889
2872
|
"aria-hidden": "true"
|
|
2890
2873
|
}, null, -1),
|
|
2891
|
-
a("span",
|
|
2874
|
+
a("span", Ca, [o.live.calls.length > 0 ? (_(!0), i(e, { key: 0 }, b(o.live.calls, (e, t) => (_(), i("span", {
|
|
2892
2875
|
key: t,
|
|
2893
2876
|
class: "kvc-activity-call",
|
|
2894
2877
|
"data-test": "activity-call"
|
|
2895
|
-
}, [a("span",
|
|
2896
|
-
o.live.calls.length > 0 ? (_(), i("span",
|
|
2897
|
-
u.value ? (_(), i("span",
|
|
2898
|
-
a("span",
|
|
2899
|
-
], 8,
|
|
2878
|
+
}, [a("span", wa, E(e.description ?? D(s).t("kvcoder.ui.activity.preparing")), 1), e.label ? (_(), i("span", Ta, E(e.label), 1)) : r("v-if", !0)]))), 128)) : (_(), i("span", Ea, E(D(s).t(`kvcoder.ui.activity.${l.value}`, o.live.retry ?? {})), 1))]),
|
|
2879
|
+
o.live.calls.length > 0 ? (_(), i("span", Da, E(D(s).t(`kvcoder.ui.activity.${l.value}`)), 1)) : r("v-if", !0),
|
|
2880
|
+
u.value ? (_(), i("span", Oa, E(u.value), 1)) : r("v-if", !0),
|
|
2881
|
+
a("span", ka, E(D(s).t("kvcoder.ui.seconds", { count: d.value })), 1)
|
|
2882
|
+
], 8, Sa));
|
|
2900
2883
|
}
|
|
2901
2884
|
});
|
|
2902
2885
|
//#endregion
|
|
@@ -2904,34 +2887,34 @@ var xa = ["data-phase"], Sa = { class: "kvc-activity-text" }, Ca = {
|
|
|
2904
2887
|
function Z(e) {
|
|
2905
2888
|
return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
|
|
2906
2889
|
}
|
|
2907
|
-
function
|
|
2890
|
+
function ja(e) {
|
|
2908
2891
|
return Array.isArray(e) ? e.flatMap((e) => {
|
|
2909
2892
|
let t = Z(e);
|
|
2910
2893
|
return t === void 0 ? [] : [t];
|
|
2911
2894
|
}) : [];
|
|
2912
2895
|
}
|
|
2913
|
-
function ja(e) {
|
|
2914
|
-
return typeof e == "string" ? e : Aa(e).flatMap((e) => e.type === "text" && typeof e.text == "string" ? [e.text] : []).join("\n");
|
|
2915
|
-
}
|
|
2916
2896
|
function Ma(e) {
|
|
2917
|
-
return
|
|
2897
|
+
return typeof e == "string" ? e : ja(e).flatMap((e) => e.type === "text" && typeof e.text == "string" ? [e.text] : []).join("\n");
|
|
2918
2898
|
}
|
|
2919
2899
|
function Na(e) {
|
|
2900
|
+
return ja(e.content.content).flatMap((e) => e.type === "thinking" && typeof e.thinking == "string" ? [e.thinking] : []).join("\n");
|
|
2901
|
+
}
|
|
2902
|
+
function Pa(e) {
|
|
2920
2903
|
let t = /* @__PURE__ */ new Map();
|
|
2921
2904
|
for (let n of e) {
|
|
2922
2905
|
if (n.kind !== "assistant") continue;
|
|
2923
2906
|
let e = typeof n.durationMs == "number" ? { writtenMs: n.durationMs } : {};
|
|
2924
|
-
for (let r of
|
|
2907
|
+
for (let r of ja(n.content.content)) {
|
|
2925
2908
|
let n = Z(r.arguments);
|
|
2926
2909
|
r.type === "toolCall" && typeof r.id == "string" && n !== void 0 && t.set(r.id, {
|
|
2927
|
-
...
|
|
2910
|
+
...pa(n),
|
|
2928
2911
|
...e
|
|
2929
2912
|
});
|
|
2930
2913
|
}
|
|
2931
2914
|
}
|
|
2932
2915
|
return t;
|
|
2933
2916
|
}
|
|
2934
|
-
function
|
|
2917
|
+
function Fa(e, t) {
|
|
2935
2918
|
let { description: n, connector: r, command: i } = e;
|
|
2936
2919
|
return typeof r == "string" ? {
|
|
2937
2920
|
...t,
|
|
@@ -2944,44 +2927,46 @@ function Pa(e, t) {
|
|
|
2944
2927
|
...e.background === !0 ? { background: !0 } : {}
|
|
2945
2928
|
} : {
|
|
2946
2929
|
...t,
|
|
2947
|
-
...
|
|
2930
|
+
...pa(e)
|
|
2948
2931
|
};
|
|
2949
2932
|
}
|
|
2950
|
-
function
|
|
2951
|
-
let n = Z(e.content.details), r =
|
|
2933
|
+
function Ia(e, t) {
|
|
2934
|
+
let n = Z(e.content.details), r = Ma(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]);
|
|
2952
2935
|
return {
|
|
2953
|
-
...n === void 0 ? a :
|
|
2936
|
+
...n === void 0 ? a : Fa(n, a),
|
|
2954
2937
|
output: typeof n?.output == "string" ? n.output : n === void 0 ? r.replace(/\n?\[exit code \d+\]$/, "") : r,
|
|
2955
2938
|
failed: e.content.isError === !0 || o !== void 0 && o !== 0,
|
|
2956
2939
|
...typeof n?.durationMs == "number" ? { durationMs: n.durationMs } : {}
|
|
2957
2940
|
};
|
|
2958
2941
|
}
|
|
2959
|
-
var
|
|
2960
|
-
function
|
|
2961
|
-
if (e ===
|
|
2942
|
+
var La = "dismissed by the user";
|
|
2943
|
+
function Ra(e) {
|
|
2944
|
+
if (e === La) return { dismissed: !0 };
|
|
2962
2945
|
for (let t of [e, e.split("\n", 1)[0] ?? ""]) try {
|
|
2963
2946
|
return Z(JSON.parse(t));
|
|
2964
2947
|
} catch {
|
|
2965
2948
|
continue;
|
|
2966
2949
|
}
|
|
2967
2950
|
}
|
|
2968
|
-
function
|
|
2969
|
-
if (e.kind !== "toolResult"
|
|
2951
|
+
function za(e, t) {
|
|
2952
|
+
if (e.kind !== "toolResult") return;
|
|
2970
2953
|
let n = t.get(String(e.content.toolCallId))?.ask;
|
|
2971
2954
|
if (n === void 0) return;
|
|
2972
|
-
let r =
|
|
2973
|
-
|
|
2955
|
+
let r = Ma(e.content.content);
|
|
2956
|
+
if (e.content.isError === !0 && r !== La) return;
|
|
2957
|
+
let i = Ra(r);
|
|
2958
|
+
return i === void 0 ? void 0 : {
|
|
2974
2959
|
...n,
|
|
2975
|
-
answer:
|
|
2960
|
+
answer: i
|
|
2976
2961
|
};
|
|
2977
2962
|
}
|
|
2978
|
-
function
|
|
2963
|
+
function Ba(e) {
|
|
2979
2964
|
return e.kind === "user" && e.source?.kind === "extension" && e.source.name === "@kvman/kvcoder";
|
|
2980
2965
|
}
|
|
2981
|
-
function
|
|
2966
|
+
function Va(e) {
|
|
2982
2967
|
return e.kind === "user" && (e.source?.kind === "job" || e.source?.kind === "subagent");
|
|
2983
2968
|
}
|
|
2984
|
-
function
|
|
2969
|
+
function Ha(e) {
|
|
2985
2970
|
if (e.kind !== "toolResult") return;
|
|
2986
2971
|
let t = Z(e.content.details);
|
|
2987
2972
|
if (t === void 0) return;
|
|
@@ -2995,25 +2980,37 @@ function Va(e) {
|
|
|
2995
2980
|
version: o
|
|
2996
2981
|
};
|
|
2997
2982
|
}
|
|
2998
|
-
var
|
|
2999
|
-
function Ua(e, t) {
|
|
3000
|
-
return e.replace(Ha, (e, n) => `\n\n${t}\n${n}`);
|
|
3001
|
-
}
|
|
2983
|
+
var Ua = (e) => typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
|
|
3002
2984
|
function Wa(e) {
|
|
2985
|
+
if (e.kind !== "toolResult" || e.content.isError === !0) return;
|
|
2986
|
+
let t = Ua(Ua(e.content.details)?.card), n = t?.component;
|
|
2987
|
+
if (t !== void 0 && typeof n == "string") return {
|
|
2988
|
+
component: n,
|
|
2989
|
+
props: {
|
|
2990
|
+
payload: t.payload ?? null,
|
|
2991
|
+
output: t.output ?? null
|
|
2992
|
+
}
|
|
2993
|
+
};
|
|
2994
|
+
}
|
|
2995
|
+
var Ga = /\n\nAttached files:\n((?:- .+\n?)+)$/;
|
|
2996
|
+
function Ka(e, t) {
|
|
2997
|
+
return e.replace(Ga, (e, n) => `\n\n${t}\n${n}`);
|
|
2998
|
+
}
|
|
2999
|
+
function qa(e) {
|
|
3003
3000
|
if (e.kind === "user") return e.source?.kind === "job" ? e.source.jobId : e.source?.kind === "subagent" ? e.source.sessionId : void 0;
|
|
3004
3001
|
}
|
|
3005
|
-
var
|
|
3006
|
-
function
|
|
3007
|
-
let t =
|
|
3002
|
+
var Ja = /^The background call `([\s\S]*?)` \(job [^)\n]+\) finished:\n/;
|
|
3003
|
+
function Ya(e) {
|
|
3004
|
+
let t = Ja.exec(Ma(e.content.content))?.[1]?.trim();
|
|
3008
3005
|
return t === void 0 || t === "" ? void 0 : t;
|
|
3009
3006
|
}
|
|
3010
|
-
function
|
|
3007
|
+
function Xa(e) {
|
|
3011
3008
|
let t = Z(Z(e.content.details)?.staging)?.runId;
|
|
3012
3009
|
return typeof t == "string" ? t : void 0;
|
|
3013
3010
|
}
|
|
3014
3011
|
//#endregion
|
|
3015
3012
|
//#region web/src/question-options.ts
|
|
3016
|
-
function
|
|
3013
|
+
function Za(e) {
|
|
3017
3014
|
return (Array.isArray(e.options) ? e.options : []).map((e) => {
|
|
3018
3015
|
let t = q(e);
|
|
3019
3016
|
return {
|
|
@@ -3025,56 +3022,56 @@ function Ja(e) {
|
|
|
3025
3022
|
}
|
|
3026
3023
|
//#endregion
|
|
3027
3024
|
//#region web/src/AnsweredCard.vue?vue&type=script&setup=true&lang.ts
|
|
3028
|
-
var
|
|
3025
|
+
var Qa = ["aria-label"], $a = {
|
|
3029
3026
|
class: "kvc-card-row",
|
|
3030
3027
|
style: { "font-weight": "600" }
|
|
3031
|
-
},
|
|
3028
|
+
}, eo = {
|
|
3032
3029
|
dir: "auto",
|
|
3033
3030
|
"data-test": "answered-prompt"
|
|
3034
|
-
},
|
|
3031
|
+
}, to = { class: "kvc-card-body" }, no = {
|
|
3035
3032
|
key: 0,
|
|
3036
3033
|
class: "kvc-muted",
|
|
3037
3034
|
"data-test": "answered-skipped"
|
|
3038
|
-
},
|
|
3035
|
+
}, ro = ["data-chosen", "data-test"], io = {
|
|
3039
3036
|
key: 1,
|
|
3040
3037
|
class: "kvc-answered-gap",
|
|
3041
3038
|
"aria-hidden": "true"
|
|
3042
|
-
},
|
|
3039
|
+
}, ao = { style: {
|
|
3043
3040
|
display: "flex",
|
|
3044
3041
|
"flex-direction": "column"
|
|
3045
|
-
} },
|
|
3042
|
+
} }, oo = { dir: "auto" }, so = {
|
|
3046
3043
|
key: 0,
|
|
3047
3044
|
class: "kvc-muted",
|
|
3048
3045
|
dir: "auto"
|
|
3049
|
-
},
|
|
3046
|
+
}, co = {
|
|
3050
3047
|
key: 2,
|
|
3051
3048
|
class: "kvc-sr"
|
|
3052
|
-
},
|
|
3049
|
+
}, lo = {
|
|
3053
3050
|
key: 0,
|
|
3054
3051
|
class: "kvc-answered-option",
|
|
3055
3052
|
"data-chosen": "true",
|
|
3056
3053
|
"data-test": "answered-other"
|
|
3057
|
-
},
|
|
3054
|
+
}, uo = { style: {
|
|
3058
3055
|
display: "flex",
|
|
3059
3056
|
"flex-direction": "column"
|
|
3060
|
-
} },
|
|
3057
|
+
} }, fo = { class: "kvc-muted" }, po = {
|
|
3061
3058
|
dir: "auto",
|
|
3062
3059
|
style: { "white-space": "pre-wrap" }
|
|
3063
|
-
},
|
|
3060
|
+
}, mo = {
|
|
3064
3061
|
key: 2,
|
|
3065
3062
|
class: "kvc-chip",
|
|
3066
3063
|
style: { "align-self": "flex-start" },
|
|
3067
3064
|
"data-test": "answered-confirmed"
|
|
3068
|
-
},
|
|
3065
|
+
}, ho = {
|
|
3069
3066
|
key: 3,
|
|
3070
3067
|
dir: "auto",
|
|
3071
3068
|
style: { "white-space": "pre-wrap" },
|
|
3072
3069
|
"data-test": "answered-text"
|
|
3073
|
-
},
|
|
3070
|
+
}, go = /* @__PURE__ */ c({
|
|
3074
3071
|
__name: "AnsweredCard",
|
|
3075
3072
|
props: { answered: {} },
|
|
3076
3073
|
setup(o) {
|
|
3077
|
-
let c = o, l = K(), 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(() =>
|
|
3074
|
+
let c = o, l = K(), 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(() => Za(c.answered.question).map((e) => ({
|
|
3078
3075
|
...e,
|
|
3079
3076
|
chosen: f.value.includes(e.id)
|
|
3080
3077
|
}))), m = t(() => typeof c.answered.answer.other == "string" ? c.answered.answer.other : ""), h = t(() => typeof c.answered.answer.text == "string" ? c.answered.answer.text : "");
|
|
@@ -3082,34 +3079,34 @@ var Ya = ["aria-label"], Xa = {
|
|
|
3082
3079
|
class: "kvc-card",
|
|
3083
3080
|
"data-test": "answered-card",
|
|
3084
3081
|
"aria-label": u.value
|
|
3085
|
-
}, [a("div",
|
|
3082
|
+
}, [a("div", $a, [s(D(ue), {
|
|
3086
3083
|
size: 18,
|
|
3087
3084
|
"aria-hidden": "true",
|
|
3088
3085
|
class: "kvc-ok"
|
|
3089
|
-
}), a("span",
|
|
3086
|
+
}), a("span", eo, E(u.value), 1)]), a("div", to, [d.value ? (_(), i("span", no, E(D(l).t("kvcoder.ui.skipped")), 1)) : c.answered.kind === "choice" ? (_(), i(e, { key: 1 }, [(_(!0), i(e, null, b(p.value, (e) => (_(), i("div", {
|
|
3090
3087
|
key: e.id,
|
|
3091
3088
|
class: "kvc-answered-option",
|
|
3092
3089
|
"data-chosen": e.chosen,
|
|
3093
3090
|
"data-test": `answered-option-${e.id}`
|
|
3094
3091
|
}, [
|
|
3095
|
-
e.chosen ? (_(), n(D(
|
|
3092
|
+
e.chosen ? (_(), n(D(ce), {
|
|
3096
3093
|
key: 0,
|
|
3097
3094
|
size: 16,
|
|
3098
3095
|
"aria-hidden": "true",
|
|
3099
3096
|
class: "kvc-ok"
|
|
3100
|
-
})) : (_(), i("span",
|
|
3101
|
-
a("span",
|
|
3102
|
-
e.chosen ? (_(), i("span",
|
|
3103
|
-
], 8,
|
|
3097
|
+
})) : (_(), i("span", io)),
|
|
3098
|
+
a("span", ao, [a("span", oo, E(e.label), 1), e.description ? (_(), i("span", so, E(e.description), 1)) : r("v-if", !0)]),
|
|
3099
|
+
e.chosen ? (_(), i("span", co, E(D(l).t("kvcoder.ui.chosen")), 1)) : r("v-if", !0)
|
|
3100
|
+
], 8, ro))), 128)), m.value === "" ? r("v-if", !0) : (_(), i("div", lo, [s(D(ce), {
|
|
3104
3101
|
size: 16,
|
|
3105
3102
|
"aria-hidden": "true",
|
|
3106
3103
|
class: "kvc-ok"
|
|
3107
|
-
}), a("span",
|
|
3104
|
+
}), a("span", uo, [a("span", fo, E(D(l).t("kvcoder.ui.other")), 1), a("span", po, E(m.value), 1)])]))], 64)) : c.answered.kind === "confirm" ? (_(), i("span", mo, E(D(l).t(c.answered.answer.confirmed === !0 ? "kvcoder.ui.yes" : "kvcoder.ui.no")), 1)) : (_(), i("span", ho, E(h.value), 1))])], 8, Qa));
|
|
3108
3105
|
}
|
|
3109
|
-
}),
|
|
3106
|
+
}), _o = {
|
|
3110
3107
|
class: "kvc-card kvc-card-row",
|
|
3111
3108
|
"data-test": "artifact-card"
|
|
3112
|
-
},
|
|
3109
|
+
}, vo = {
|
|
3113
3110
|
style: {
|
|
3114
3111
|
flex: "1 1 auto",
|
|
3115
3112
|
"min-inline-size": "0",
|
|
@@ -3118,13 +3115,13 @@ var Ya = ["aria-label"], Xa = {
|
|
|
3118
3115
|
"white-space": "nowrap"
|
|
3119
3116
|
},
|
|
3120
3117
|
"data-test": "artifact-card-title"
|
|
3121
|
-
},
|
|
3118
|
+
}, yo = {
|
|
3122
3119
|
class: "kvc-chip",
|
|
3123
3120
|
"data-test": "artifact-card-format"
|
|
3124
|
-
},
|
|
3121
|
+
}, bo = {
|
|
3125
3122
|
class: "kvc-muted",
|
|
3126
3123
|
"data-test": "artifact-card-version"
|
|
3127
|
-
},
|
|
3124
|
+
}, xo = /* @__PURE__ */ c({
|
|
3128
3125
|
__name: "ArtifactCard",
|
|
3129
3126
|
props: {
|
|
3130
3127
|
id: {},
|
|
@@ -3135,14 +3132,14 @@ var Ya = ["aria-label"], Xa = {
|
|
|
3135
3132
|
emits: ["open"],
|
|
3136
3133
|
setup(e, { emit: t }) {
|
|
3137
3134
|
let n = e, r = t, o = K();
|
|
3138
|
-
return (e, t) => (_(), i("div",
|
|
3135
|
+
return (e, t) => (_(), i("div", _o, [
|
|
3139
3136
|
s(D(Ce), {
|
|
3140
3137
|
size: 16,
|
|
3141
3138
|
"aria-hidden": "true"
|
|
3142
3139
|
}),
|
|
3143
|
-
a("span",
|
|
3144
|
-
a("span",
|
|
3145
|
-
a("span",
|
|
3140
|
+
a("span", vo, E(n.title), 1),
|
|
3141
|
+
a("span", yo, E(D(o).t(`kvcoder.ui.artifacts.format.${n.format}`)), 1),
|
|
3142
|
+
a("span", bo, E(D(o).t("kvcoder.ui.artifacts.version", { version: n.version })), 1),
|
|
3146
3143
|
a("button", {
|
|
3147
3144
|
type: "button",
|
|
3148
3145
|
class: "kvc-button",
|
|
@@ -3151,24 +3148,39 @@ var Ya = ["aria-label"], Xa = {
|
|
|
3151
3148
|
}, E(D(o).t("kvcoder.ui.artifacts.open")), 1)
|
|
3152
3149
|
]));
|
|
3153
3150
|
}
|
|
3154
|
-
})
|
|
3151
|
+
}), So = 160, Co = /^error ([A-Za-z0-9_/-]+): ?(.*)/;
|
|
3152
|
+
function wo(e) {
|
|
3153
|
+
let t = (e.split("\n", 1)[0] ?? "").trim();
|
|
3154
|
+
return t.length > So ? `${t.slice(0, So)}…` : t;
|
|
3155
|
+
}
|
|
3156
|
+
function To(e) {
|
|
3157
|
+
if (e.startsWith("denied by the user")) return { kind: "denied" };
|
|
3158
|
+
let t = Co.exec(e);
|
|
3159
|
+
return t?.[1] === "VALIDATION_FAILED" ? { kind: "invalid" } : t === null ? /\[exit code \d+\]\s*$/.test(e) ? { kind: "command" } : {
|
|
3160
|
+
kind: "error",
|
|
3161
|
+
message: wo(e)
|
|
3162
|
+
} : {
|
|
3163
|
+
kind: "error",
|
|
3164
|
+
message: wo(t[2] ?? "")
|
|
3165
|
+
};
|
|
3166
|
+
}
|
|
3155
3167
|
//#endregion
|
|
3156
3168
|
//#region web/src/call-results.ts
|
|
3157
|
-
function
|
|
3169
|
+
function Eo(e) {
|
|
3158
3170
|
let { replacements: t, firstChangedLine: n } = q(e);
|
|
3159
3171
|
return typeof t == "number" && typeof n == "number" ? {
|
|
3160
3172
|
replacements: t,
|
|
3161
3173
|
firstChangedLine: n
|
|
3162
3174
|
} : void 0;
|
|
3163
3175
|
}
|
|
3164
|
-
function
|
|
3176
|
+
function Do(e) {
|
|
3165
3177
|
let { fromLine: t, content: n } = q(e);
|
|
3166
3178
|
return typeof t == "number" && typeof n == "string" ? {
|
|
3167
3179
|
fromLine: t,
|
|
3168
3180
|
content: n
|
|
3169
3181
|
} : void 0;
|
|
3170
3182
|
}
|
|
3171
|
-
function
|
|
3183
|
+
function Oo(e) {
|
|
3172
3184
|
let { name: t, kind: n, bytes: r } = q(e);
|
|
3173
3185
|
return typeof t == "string" && (n === "file" || n === "folder") && typeof r == "number" ? [{
|
|
3174
3186
|
name: t,
|
|
@@ -3176,11 +3188,11 @@ function xo(e) {
|
|
|
3176
3188
|
bytes: r
|
|
3177
3189
|
}] : [];
|
|
3178
3190
|
}
|
|
3179
|
-
function
|
|
3191
|
+
function ko(e) {
|
|
3180
3192
|
let t = q(e).entries;
|
|
3181
|
-
return Array.isArray(t) ? t.flatMap(
|
|
3193
|
+
return Array.isArray(t) ? t.flatMap(Oo) : void 0;
|
|
3182
3194
|
}
|
|
3183
|
-
function
|
|
3195
|
+
function Ao(e) {
|
|
3184
3196
|
let { path: t, matches: n } = q(e);
|
|
3185
3197
|
return typeof t != "string" || !Array.isArray(n) ? [] : [{
|
|
3186
3198
|
path: t,
|
|
@@ -3193,17 +3205,17 @@ function Co(e) {
|
|
|
3193
3205
|
})
|
|
3194
3206
|
}];
|
|
3195
3207
|
}
|
|
3196
|
-
var
|
|
3208
|
+
var jo = [
|
|
3197
3209
|
"running",
|
|
3198
3210
|
"succeeded",
|
|
3199
3211
|
"failed",
|
|
3200
3212
|
"cancelled",
|
|
3201
3213
|
"interrupted"
|
|
3202
3214
|
];
|
|
3203
|
-
function
|
|
3204
|
-
return
|
|
3215
|
+
function Mo(e, t) {
|
|
3216
|
+
return jo.some((e) => e === t) ? e(`kvcoder.ui.jobs.status.${t}`) : t;
|
|
3205
3217
|
}
|
|
3206
|
-
function
|
|
3218
|
+
function No(e) {
|
|
3207
3219
|
let { kind: t, call: n, status: r, startedAt: i, endedAt: a, exitCode: o, output: s, problem: c } = q(e);
|
|
3208
3220
|
if (typeof n != "string" || typeof r != "string") return;
|
|
3209
3221
|
let l = typeof i == "string" && typeof a == "string" ? Date.parse(a) - Date.parse(i) : NaN;
|
|
@@ -3217,36 +3229,36 @@ function Eo(e) {
|
|
|
3217
3229
|
...c === void 0 ? {} : { problem: c }
|
|
3218
3230
|
};
|
|
3219
3231
|
}
|
|
3220
|
-
function
|
|
3232
|
+
function Po(e) {
|
|
3221
3233
|
let t = q(e).files;
|
|
3222
|
-
return Array.isArray(t) ? t.flatMap(
|
|
3234
|
+
return Array.isArray(t) ? t.flatMap(Ao) : void 0;
|
|
3223
3235
|
}
|
|
3224
3236
|
//#endregion
|
|
3225
3237
|
//#region web/src/edit-diff.ts
|
|
3226
|
-
var
|
|
3227
|
-
function
|
|
3238
|
+
var Fo = 3;
|
|
3239
|
+
function Io(e) {
|
|
3228
3240
|
if (e === "") return [];
|
|
3229
3241
|
let t = e.split("\n");
|
|
3230
3242
|
return e.endsWith("\n") ? t.slice(0, -1) : t;
|
|
3231
3243
|
}
|
|
3232
|
-
function
|
|
3244
|
+
function Lo(e, t) {
|
|
3233
3245
|
let n = 0;
|
|
3234
3246
|
for (; n < e.length && n < t.length && e[n] === t[n];) n += 1;
|
|
3235
3247
|
return n;
|
|
3236
3248
|
}
|
|
3237
|
-
function
|
|
3238
|
-
let n =
|
|
3249
|
+
function Ro(e, t) {
|
|
3250
|
+
let n = Io(e), r = Io(t), i = Lo(n, r), a = Lo(n.slice(i).reverse(), r.slice(i).reverse()), o = (e, t) => t.map((t) => ({
|
|
3239
3251
|
kind: e,
|
|
3240
3252
|
text: t
|
|
3241
3253
|
}));
|
|
3242
3254
|
return [
|
|
3243
|
-
...o("context", n.slice(Math.max(i -
|
|
3255
|
+
...o("context", n.slice(Math.max(i - Fo, 0), i)),
|
|
3244
3256
|
...o("removed", n.slice(i, n.length - a)),
|
|
3245
3257
|
...o("added", r.slice(i, r.length - a)),
|
|
3246
|
-
...o("context", n.slice(n.length - a, n.length - a +
|
|
3258
|
+
...o("context", n.slice(n.length - a, n.length - a + Fo))
|
|
3247
3259
|
];
|
|
3248
3260
|
}
|
|
3249
|
-
function
|
|
3261
|
+
function zo(e) {
|
|
3250
3262
|
return {
|
|
3251
3263
|
added: e.filter((e) => e.kind === "added").length,
|
|
3252
3264
|
removed: e.filter((e) => e.kind === "removed").length
|
|
@@ -3254,7 +3266,7 @@ function Mo(e) {
|
|
|
3254
3266
|
}
|
|
3255
3267
|
//#endregion
|
|
3256
3268
|
//#region web/src/call-summary.ts
|
|
3257
|
-
function
|
|
3269
|
+
function Bo(e) {
|
|
3258
3270
|
if (e !== void 0 && /^\s*[[{]/.test(e)) try {
|
|
3259
3271
|
return JSON.parse(e);
|
|
3260
3272
|
} catch (e) {
|
|
@@ -3262,12 +3274,12 @@ function No(e) {
|
|
|
3262
3274
|
throw e;
|
|
3263
3275
|
}
|
|
3264
3276
|
}
|
|
3265
|
-
var
|
|
3266
|
-
function
|
|
3267
|
-
return t <
|
|
3277
|
+
var Vo = 1024;
|
|
3278
|
+
function Ho(e, t) {
|
|
3279
|
+
return t < Vo ? e("kvcoder.ui.call.bytes", { count: t }) : t < Vo * Vo ? e("kvcoder.ui.call.kilobytes", { count: (t / Vo).toFixed(1) }) : e("kvcoder.ui.call.megabytes", { count: (t / (Vo * Vo)).toFixed(1) });
|
|
3268
3280
|
}
|
|
3269
3281
|
var Q = (e) => typeof e == "string" && e !== "" ? e : void 0;
|
|
3270
|
-
function
|
|
3282
|
+
function Uo(e) {
|
|
3271
3283
|
let t = e.edits;
|
|
3272
3284
|
return Array.isArray(t) ? t.flatMap((e) => {
|
|
3273
3285
|
let { oldText: t, newText: n } = q(e);
|
|
@@ -3277,28 +3289,28 @@ function Io(e) {
|
|
|
3277
3289
|
}] : [];
|
|
3278
3290
|
}) : [];
|
|
3279
3291
|
}
|
|
3280
|
-
function
|
|
3281
|
-
let t =
|
|
3292
|
+
function Wo(e) {
|
|
3293
|
+
let t = Uo(e).map((e) => zo(Ro(e.oldText, e.newText)));
|
|
3282
3294
|
return `+${t.reduce((e, t) => e + t.added, 0)} −${t.reduce((e, t) => e + t.removed, 0)}`;
|
|
3283
3295
|
}
|
|
3284
|
-
function
|
|
3285
|
-
if (typeof t.bytes == "number" && typeof t.created == "boolean") return e(t.created ? "kvcoder.ui.call.created" : "kvcoder.ui.call.replaced", { size:
|
|
3296
|
+
function Go(e, t) {
|
|
3297
|
+
if (typeof t.bytes == "number" && typeof t.created == "boolean") return e(t.created ? "kvcoder.ui.call.created" : "kvcoder.ui.call.replaced", { size: Ho(e, t.bytes) });
|
|
3286
3298
|
}
|
|
3287
|
-
function
|
|
3299
|
+
function Ko(e, t) {
|
|
3288
3300
|
let { fromLine: n, totalLines: r, content: i } = t;
|
|
3289
3301
|
if (typeof n != "number" || typeof r != "number" || typeof i != "string") return;
|
|
3290
|
-
let a =
|
|
3302
|
+
let a = Io(i).length;
|
|
3291
3303
|
return a === 0 ? void 0 : e("kvcoder.ui.call.lines", {
|
|
3292
3304
|
from: n,
|
|
3293
3305
|
to: n + a - 1,
|
|
3294
3306
|
total: r
|
|
3295
3307
|
});
|
|
3296
3308
|
}
|
|
3297
|
-
function
|
|
3309
|
+
function qo(e, t) {
|
|
3298
3310
|
let n = t.entries;
|
|
3299
3311
|
if (Array.isArray(n)) return e(t.truncated === !0 ? "kvcoder.ui.call.entriesFirst" : "kvcoder.ui.call.entries", { count: n.length });
|
|
3300
3312
|
}
|
|
3301
|
-
function
|
|
3313
|
+
function Jo(e, t) {
|
|
3302
3314
|
let n = t.files;
|
|
3303
3315
|
if (!Array.isArray(n)) return;
|
|
3304
3316
|
let r = n.reduce((e, t) => {
|
|
@@ -3310,7 +3322,7 @@ function Vo(e, t) {
|
|
|
3310
3322
|
files: n.length
|
|
3311
3323
|
});
|
|
3312
3324
|
}
|
|
3313
|
-
var
|
|
3325
|
+
var Yo = (e, t, n) => Array.isArray(n) ? e(t, { count: n.length }) : void 0;
|
|
3314
3326
|
function $(e, t, n) {
|
|
3315
3327
|
return {
|
|
3316
3328
|
...e === void 0 ? {} : { words: e },
|
|
@@ -3318,87 +3330,87 @@ function $(e, t, n) {
|
|
|
3318
3330
|
...n === void 0 ? {} : { outcome: n }
|
|
3319
3331
|
};
|
|
3320
3332
|
}
|
|
3321
|
-
function
|
|
3333
|
+
function Xo(e, t, n, r) {
|
|
3322
3334
|
let i = r === void 0 ? void 0 : q(r), a = Q(n.path);
|
|
3323
|
-
if (t === "edit") return $(e("kvcoder.ui.call.edit"), a, i === void 0 ? void 0 :
|
|
3324
|
-
if (t === "write") return $(e("kvcoder.ui.call.write"), a, i === void 0 ? void 0 :
|
|
3325
|
-
if (t === "read") return $(e("kvcoder.ui.call.read"), a, i === void 0 ? void 0 :
|
|
3326
|
-
if (t === "list") return $(e("kvcoder.ui.call.list"), a ?? ".", i === void 0 ? void 0 :
|
|
3327
|
-
if (t === "search") return $(e("kvcoder.ui.call.search"), Q(n.pattern), i === void 0 ? void 0 :
|
|
3335
|
+
if (t === "edit") return $(e("kvcoder.ui.call.edit"), a, i === void 0 ? void 0 : Wo(n));
|
|
3336
|
+
if (t === "write") return $(e("kvcoder.ui.call.write"), a, i === void 0 ? void 0 : Go(e, i));
|
|
3337
|
+
if (t === "read") return $(e("kvcoder.ui.call.read"), a, i === void 0 ? void 0 : Ko(e, i));
|
|
3338
|
+
if (t === "list") return $(e("kvcoder.ui.call.list"), a ?? ".", i === void 0 ? void 0 : qo(e, i));
|
|
3339
|
+
if (t === "search") return $(e("kvcoder.ui.call.search"), Q(n.pattern), i === void 0 ? void 0 : Jo(e, i));
|
|
3328
3340
|
}
|
|
3329
|
-
function
|
|
3341
|
+
function Zo(e, t, n, r) {
|
|
3330
3342
|
let i = Q(n.server), a = [i, Q(n.tool)].filter((e) => e !== void 0).join(" · ");
|
|
3331
3343
|
if (t === "call") return $(void 0, a === "" ? void 0 : a);
|
|
3332
3344
|
if (t === "run") {
|
|
3333
3345
|
let e = n.steps;
|
|
3334
3346
|
return $(void 0, [i, (Array.isArray(e) ? e.flatMap((e) => Q(q(e).tool) === void 0 ? [] : [String(q(e).tool)]) : []).join(", ")].filter((e) => e !== void 0 && e !== "").join(" · "));
|
|
3335
3347
|
}
|
|
3336
|
-
if (t === "tools") return $(e("kvcoder.ui.call.tools"), a === "" ? void 0 : a,
|
|
3348
|
+
if (t === "tools") return $(e("kvcoder.ui.call.tools"), a === "" ? void 0 : a, Yo(e, "kvcoder.ui.call.toolCount", q(r).tools));
|
|
3337
3349
|
}
|
|
3338
|
-
function
|
|
3339
|
-
if (t === "list") return $(e("kvcoder.ui.call.backgroundRuns"), void 0,
|
|
3350
|
+
function Qo(e, t, n, r) {
|
|
3351
|
+
if (t === "list") return $(e("kvcoder.ui.call.backgroundRuns"), void 0, Yo(e, "kvcoder.ui.call.runCount", r));
|
|
3340
3352
|
if (t === "output" || t === "wait") {
|
|
3341
|
-
let i =
|
|
3342
|
-
return $(e(`kvcoder.ui.call.${t}`), Q(n.id), i === void 0 ? void 0 :
|
|
3353
|
+
let i = No(r);
|
|
3354
|
+
return $(e(`kvcoder.ui.call.${t}`), Q(n.id), i === void 0 ? void 0 : Mo(e, i.status));
|
|
3343
3355
|
}
|
|
3344
3356
|
if (t === "stop") return $(e("kvcoder.ui.call.stop"), Q(n.id));
|
|
3345
3357
|
}
|
|
3346
|
-
function
|
|
3358
|
+
function $o(e, t, n, r) {
|
|
3347
3359
|
let i = Q(q(r).progress), a = n.steps, o = Array.isArray(a) ? a.flatMap((e) => Q(q(e).id) === void 0 ? [] : [String(q(e).id)]).join(", ") : void 0;
|
|
3348
3360
|
return t === "set" ? $(e("kvcoder.ui.call.mapSet"), Q(n.goal), i) : t === "update" ? $(e("kvcoder.ui.call.mapUpdate"), o === "" ? void 0 : o, i) : t === "note" ? $(e("kvcoder.ui.call.mapNote"), Q(n.text)) : t === "get" ? $(e("kvcoder.ui.call.mapGet"), void 0, i) : void 0;
|
|
3349
3361
|
}
|
|
3350
|
-
function
|
|
3362
|
+
function es(e, t, n) {
|
|
3351
3363
|
let { connector: r, command: i } = t, a = t.fields ?? {};
|
|
3352
3364
|
if (r !== void 0 && i !== void 0) {
|
|
3353
3365
|
if (t.line !== void 0) return { subject: `$ ${t.line}` };
|
|
3354
|
-
if (r === "fs") return
|
|
3355
|
-
if (r === "mcp") return
|
|
3356
|
-
if (r === "background") return
|
|
3357
|
-
if (r === "execution-map") return
|
|
3366
|
+
if (r === "fs") return Xo(e, i, a, n);
|
|
3367
|
+
if (r === "mcp") return Zo(e, i, a, n);
|
|
3368
|
+
if (r === "background") return Qo(e, i, a, n);
|
|
3369
|
+
if (r === "execution-map") return $o(e, i, a, n);
|
|
3358
3370
|
if (r === "delegate" && i === "run") return $(e("kvcoder.ui.call.delegate"), [Q(a.worker), Q(a.title)].filter((e) => e !== void 0).join(" · "));
|
|
3359
3371
|
if (r === "artifact" && i === "get") return $(e("kvcoder.ui.call.readArtifact"), Q(a.id));
|
|
3360
3372
|
}
|
|
3361
3373
|
}
|
|
3362
3374
|
//#endregion
|
|
3363
3375
|
//#region web/src/field-rows.ts
|
|
3364
|
-
var
|
|
3365
|
-
function
|
|
3376
|
+
var ts = "—", ns = (e) => e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean", rs = (e) => e === null ? ts : String(e);
|
|
3377
|
+
function is(e) {
|
|
3366
3378
|
return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
|
|
3367
3379
|
}
|
|
3368
|
-
function
|
|
3369
|
-
let t =
|
|
3380
|
+
function as(e) {
|
|
3381
|
+
let t = is(e);
|
|
3370
3382
|
if (t === void 0) return;
|
|
3371
3383
|
let n = {};
|
|
3372
3384
|
for (let [e, r] of Object.entries(t)) {
|
|
3373
|
-
if (!
|
|
3385
|
+
if (!ns(r)) return;
|
|
3374
3386
|
n[e] = r;
|
|
3375
3387
|
}
|
|
3376
3388
|
return n;
|
|
3377
3389
|
}
|
|
3378
|
-
function
|
|
3390
|
+
function os(e) {
|
|
3379
3391
|
let t = [...new Set(e.flatMap((e) => Object.keys(e)))];
|
|
3380
3392
|
return {
|
|
3381
3393
|
kind: "table",
|
|
3382
3394
|
columns: t,
|
|
3383
|
-
rows: e.map((e) => t.map((t) => t in e ?
|
|
3395
|
+
rows: e.map((e) => t.map((t) => t in e ? rs(e[t] ?? null) : ""))
|
|
3384
3396
|
};
|
|
3385
3397
|
}
|
|
3386
|
-
function
|
|
3398
|
+
function ss(e) {
|
|
3387
3399
|
if (e.length === 0) return { kind: "empty" };
|
|
3388
|
-
if (e.every(
|
|
3400
|
+
if (e.every(ns)) return {
|
|
3389
3401
|
kind: "items",
|
|
3390
|
-
items: e.map(
|
|
3402
|
+
items: e.map(rs)
|
|
3391
3403
|
};
|
|
3392
|
-
let t = e.map(
|
|
3393
|
-
return t.length === e.length ?
|
|
3404
|
+
let t = e.map(as).filter((e) => e !== void 0);
|
|
3405
|
+
return t.length === e.length ? os(t) : {
|
|
3394
3406
|
kind: "rows",
|
|
3395
3407
|
rows: e.map((e, t) => ({
|
|
3396
3408
|
name: String(t + 1),
|
|
3397
|
-
value:
|
|
3409
|
+
value: cs(e)
|
|
3398
3410
|
}))
|
|
3399
3411
|
};
|
|
3400
3412
|
}
|
|
3401
|
-
function
|
|
3413
|
+
function cs(e) {
|
|
3402
3414
|
if (typeof e == "string") return e.includes("\n") ? {
|
|
3403
3415
|
kind: "block",
|
|
3404
3416
|
text: e
|
|
@@ -3410,27 +3422,27 @@ function ts(e) {
|
|
|
3410
3422
|
kind: "text",
|
|
3411
3423
|
text: String(e)
|
|
3412
3424
|
};
|
|
3413
|
-
if (Array.isArray(e)) return
|
|
3414
|
-
let t =
|
|
3425
|
+
if (Array.isArray(e)) return ss(e);
|
|
3426
|
+
let t = is(e);
|
|
3415
3427
|
return t === void 0 || Object.keys(t).length === 0 ? { kind: "empty" } : {
|
|
3416
3428
|
kind: "rows",
|
|
3417
|
-
rows:
|
|
3429
|
+
rows: ls(t)
|
|
3418
3430
|
};
|
|
3419
3431
|
}
|
|
3420
|
-
function
|
|
3432
|
+
function ls(e) {
|
|
3421
3433
|
return Object.entries(e).map(([e, t]) => ({
|
|
3422
3434
|
name: e,
|
|
3423
|
-
value:
|
|
3435
|
+
value: cs(t)
|
|
3424
3436
|
}));
|
|
3425
3437
|
}
|
|
3426
|
-
function
|
|
3438
|
+
function us(e, t) {
|
|
3427
3439
|
return t || e.length <= 12 ? e : e.slice(0, 12);
|
|
3428
3440
|
}
|
|
3429
|
-
var
|
|
3441
|
+
var ds = (e) => Io(e).map((e) => ({ text: e })), fs = (e, t) => Io(e).map((e, n) => ({
|
|
3430
3442
|
text: e,
|
|
3431
3443
|
number: t + n
|
|
3432
3444
|
}));
|
|
3433
|
-
function
|
|
3445
|
+
function ps(e, t) {
|
|
3434
3446
|
return t || e.length <= 17 ? e : [
|
|
3435
3447
|
...e.slice(0, 12),
|
|
3436
3448
|
"⋯",
|
|
@@ -3439,7 +3451,7 @@ function os(e, t) {
|
|
|
3439
3451
|
}
|
|
3440
3452
|
//#endregion
|
|
3441
3453
|
//#region web/src/FoldButton.vue?vue&type=script&setup=true&lang.ts
|
|
3442
|
-
var
|
|
3454
|
+
var ms = ["aria-expanded"], hs = /* @__PURE__ */ c({
|
|
3443
3455
|
__name: "FoldButton",
|
|
3444
3456
|
props: {
|
|
3445
3457
|
count: {},
|
|
@@ -3456,119 +3468,119 @@ var ss = ["aria-expanded"], cs = /* @__PURE__ */ c({
|
|
|
3456
3468
|
"aria-expanded": n.open,
|
|
3457
3469
|
"data-test": "show-all",
|
|
3458
3470
|
onClick: t[0] ||= (e) => a("toggle")
|
|
3459
|
-
}, E(n.open ? D(o).t("kvcoder.ui.call.showFewer") : D(o).t("kvcoder.ui.call.showAll", { count: n.count })), 9,
|
|
3471
|
+
}, E(n.open ? D(o).t("kvcoder.ui.call.showFewer") : D(o).t("kvcoder.ui.call.showAll", { count: n.count })), 9, ms)) : r("v-if", !0);
|
|
3460
3472
|
}
|
|
3461
|
-
}),
|
|
3473
|
+
}), gs = { class: "kvc-code-lines" }, _s = ["dir", "data-kind"], vs = {
|
|
3462
3474
|
key: 0,
|
|
3463
3475
|
class: "kvc-line-number",
|
|
3464
3476
|
"data-test": "call-line-number"
|
|
3465
|
-
},
|
|
3477
|
+
}, ys = {
|
|
3466
3478
|
key: 1,
|
|
3467
3479
|
class: "kvc-line-mark",
|
|
3468
3480
|
"aria-hidden": "true"
|
|
3469
|
-
},
|
|
3481
|
+
}, bs = {
|
|
3470
3482
|
class: "kvc-line-text",
|
|
3471
3483
|
dir: "auto",
|
|
3472
3484
|
"data-test": "call-line-text"
|
|
3473
|
-
},
|
|
3485
|
+
}, xs = /* @__PURE__ */ c({
|
|
3474
3486
|
__name: "FoldedLines",
|
|
3475
3487
|
props: { lines: {} },
|
|
3476
3488
|
setup(n) {
|
|
3477
|
-
let o = n, c = y(!1), l = t(() =>
|
|
3489
|
+
let o = n, c = y(!1), l = t(() => us(o.lines, c.value)), u = t(() => o.lines.some((e) => e.number !== void 0)), d = t(() => o.lines.some((e) => e.kind !== void 0)), f = {
|
|
3478
3490
|
context: " ",
|
|
3479
3491
|
removed: "−",
|
|
3480
3492
|
added: "+"
|
|
3481
3493
|
};
|
|
3482
|
-
return (t, n) => (_(), i("div",
|
|
3494
|
+
return (t, n) => (_(), i("div", gs, [(_(!0), i(e, null, b(l.value, (e, t) => (_(), i("div", {
|
|
3483
3495
|
key: t,
|
|
3484
3496
|
class: "kvc-code-line",
|
|
3485
3497
|
dir: u.value || d.value ? "ltr" : void 0,
|
|
3486
3498
|
"data-kind": e.kind,
|
|
3487
3499
|
"data-test": "call-line-row"
|
|
3488
3500
|
}, [
|
|
3489
|
-
u.value ? (_(), i("span",
|
|
3490
|
-
d.value ? (_(), i("span",
|
|
3491
|
-
a("span",
|
|
3492
|
-
], 8,
|
|
3501
|
+
u.value ? (_(), i("span", vs, E(e.number), 1)) : r("v-if", !0),
|
|
3502
|
+
d.value ? (_(), i("span", ys, E(f[e.kind ?? "context"]), 1)) : r("v-if", !0),
|
|
3503
|
+
a("span", bs, [s(Y, { text: e.text }, null, 8, ["text"])])
|
|
3504
|
+
], 8, _s))), 128)), s(hs, {
|
|
3493
3505
|
count: o.lines.length,
|
|
3494
3506
|
open: c.value,
|
|
3495
3507
|
onToggle: n[0] ||= (e) => c.value = !c.value
|
|
3496
3508
|
}, null, 8, ["count", "open"])]));
|
|
3497
3509
|
}
|
|
3498
|
-
}),
|
|
3510
|
+
}), Ss = {
|
|
3499
3511
|
key: 0,
|
|
3500
3512
|
dir: "auto",
|
|
3501
3513
|
"data-test": "field-text"
|
|
3502
|
-
},
|
|
3514
|
+
}, Cs = {
|
|
3503
3515
|
key: 1,
|
|
3504
3516
|
class: "kvc-muted",
|
|
3505
3517
|
"data-test": "field-empty"
|
|
3506
|
-
},
|
|
3518
|
+
}, ws = {
|
|
3507
3519
|
key: 3,
|
|
3508
3520
|
class: "kvc-field-table"
|
|
3509
|
-
},
|
|
3521
|
+
}, Ts = { "data-test": "field-table" }, Es = {
|
|
3510
3522
|
key: 4,
|
|
3511
3523
|
class: "kvc-field-items",
|
|
3512
3524
|
"data-test": "field-items"
|
|
3513
|
-
},
|
|
3525
|
+
}, Ds = {
|
|
3514
3526
|
key: 5,
|
|
3515
3527
|
class: "kvc-fields",
|
|
3516
3528
|
"data-test": "call-fields"
|
|
3517
|
-
},
|
|
3529
|
+
}, Os = ["data-name"], ks = {
|
|
3518
3530
|
class: "kvc-muted",
|
|
3519
3531
|
dir: "ltr"
|
|
3520
|
-
},
|
|
3532
|
+
}, As = { "data-test": "field-value" }, js = /* @__PURE__ */ c({
|
|
3521
3533
|
__name: "FieldsView",
|
|
3522
3534
|
props: { value: {} },
|
|
3523
3535
|
setup(r) {
|
|
3524
|
-
let o = r, c = y(!1), l = t(() => o.value.kind === "table" ?
|
|
3536
|
+
let o = r, c = y(!1), l = t(() => o.value.kind === "table" ? us(o.value.rows, c.value) : []), u = t(() => o.value.kind === "items" ? us(o.value.items, c.value) : []);
|
|
3525
3537
|
return (t, r) => {
|
|
3526
3538
|
let d = S("FieldsView", !0);
|
|
3527
|
-
return o.value.kind === "text" ? (_(), i("span",
|
|
3539
|
+
return o.value.kind === "text" ? (_(), i("span", Ss, [s(Y, { text: o.value.text }, null, 8, ["text"])])) : o.value.kind === "empty" ? (_(), i("span", Cs, "—")) : o.value.kind === "block" ? (_(), n(xs, {
|
|
3528
3540
|
key: 2,
|
|
3529
3541
|
class: "kvc-field-block",
|
|
3530
|
-
lines: D(
|
|
3542
|
+
lines: D(ds)(o.value.text),
|
|
3531
3543
|
"data-test": "field-block"
|
|
3532
|
-
}, null, 8, ["lines"])) : o.value.kind === "table" ? (_(), i("div",
|
|
3544
|
+
}, null, 8, ["lines"])) : o.value.kind === "table" ? (_(), i("div", ws, [a("table", Ts, [a("thead", null, [a("tr", null, [(_(!0), i(e, null, b(o.value.columns, (e) => (_(), i("th", {
|
|
3533
3545
|
key: e,
|
|
3534
3546
|
scope: "col",
|
|
3535
3547
|
dir: "ltr"
|
|
3536
3548
|
}, E(e), 1))), 128))])]), a("tbody", null, [(_(!0), i(e, null, b(l.value, (t, n) => (_(), i("tr", { key: n }, [(_(!0), i(e, null, b(t, (e, t) => (_(), i("td", {
|
|
3537
3549
|
key: t,
|
|
3538
3550
|
dir: "auto"
|
|
3539
|
-
}, [s(Y, { text: e }, null, 8, ["text"])]))), 128))]))), 128))])]), s(
|
|
3551
|
+
}, [s(Y, { text: e }, null, 8, ["text"])]))), 128))]))), 128))])]), s(hs, {
|
|
3540
3552
|
count: o.value.rows.length,
|
|
3541
3553
|
open: c.value,
|
|
3542
3554
|
onToggle: r[0] ||= (e) => c.value = !c.value
|
|
3543
|
-
}, null, 8, ["count", "open"])])) : o.value.kind === "items" ? (_(), i("div",
|
|
3555
|
+
}, null, 8, ["count", "open"])])) : o.value.kind === "items" ? (_(), i("div", Es, [(_(!0), i(e, null, b(u.value, (e, t) => (_(), i("div", {
|
|
3544
3556
|
key: t,
|
|
3545
3557
|
dir: "auto"
|
|
3546
|
-
}, [s(Y, { text: e }, null, 8, ["text"])]))), 128)), s(
|
|
3558
|
+
}, [s(Y, { text: e }, null, 8, ["text"])]))), 128)), s(hs, {
|
|
3547
3559
|
count: o.value.items.length,
|
|
3548
3560
|
open: c.value,
|
|
3549
3561
|
onToggle: r[1] ||= (e) => c.value = !c.value
|
|
3550
|
-
}, null, 8, ["count", "open"])])) : (_(), i("dl",
|
|
3562
|
+
}, null, 8, ["count", "open"])])) : (_(), i("dl", Ds, [(_(!0), i(e, null, b(o.value.rows, (e) => (_(), i("div", {
|
|
3551
3563
|
key: e.name,
|
|
3552
3564
|
class: "kvc-field-row",
|
|
3553
3565
|
"data-name": e.name,
|
|
3554
3566
|
"data-test": "field-row"
|
|
3555
|
-
}, [a("dt",
|
|
3567
|
+
}, [a("dt", ks, E(e.name), 1), a("dd", As, [s(d, { value: e.value }, null, 8, ["value"])])], 8, Os))), 128))]));
|
|
3556
3568
|
};
|
|
3557
3569
|
}
|
|
3558
|
-
}),
|
|
3570
|
+
}), Ms = ["aria-label"], Ns = ["aria-label"], Ps = /* @__PURE__ */ c({
|
|
3559
3571
|
__name: "CallRequest",
|
|
3560
3572
|
props: { view: {} },
|
|
3561
3573
|
setup(a) {
|
|
3562
|
-
let o = a, c = K(), l = t(() =>
|
|
3563
|
-
return (t, a) => l.value === "edit" ? (_(!0), i(e, { key: 0 }, b(d.value, (e, t) => (_(), n(
|
|
3574
|
+
let o = a, c = K(), l = t(() => ha(o.view)), u = t(() => o.view.fields ?? {}), d = t(() => Uo(u.value).map((e) => Ro(e.oldText, e.newText))), f = t(() => typeof u.value.content == "string" ? u.value.content : ""), p = t(() => typeof u.value.task == "string" ? u.value.task : ""), m = t(() => l.value === "mcp-call" ? q(u.value.arguments) : l.value === "fields" ? u.value : {});
|
|
3575
|
+
return (t, a) => l.value === "edit" ? (_(!0), i(e, { key: 0 }, b(d.value, (e, t) => (_(), n(xs, {
|
|
3564
3576
|
key: t,
|
|
3565
3577
|
class: "kvc-block",
|
|
3566
3578
|
lines: e,
|
|
3567
3579
|
"data-test": "call-diff"
|
|
3568
|
-
}, null, 8, ["lines"]))), 128)) : l.value === "write" ? (_(), n(
|
|
3580
|
+
}, null, 8, ["lines"]))), 128)) : l.value === "write" ? (_(), n(xs, {
|
|
3569
3581
|
key: 1,
|
|
3570
3582
|
class: "kvc-block",
|
|
3571
|
-
lines: D(
|
|
3583
|
+
lines: D(fs)(f.value, 1),
|
|
3572
3584
|
"data-test": "call-content"
|
|
3573
3585
|
}, null, 8, ["lines"])) : l.value === "line" ? (_(), i("pre", {
|
|
3574
3586
|
key: 2,
|
|
@@ -3576,10 +3588,10 @@ var ss = ["aria-expanded"], cs = /* @__PURE__ */ c({
|
|
|
3576
3588
|
dir: "ltr",
|
|
3577
3589
|
"aria-label": D(c).t("kvcoder.ui.command"),
|
|
3578
3590
|
"data-test": "call-payload"
|
|
3579
|
-
}, "$ " + E(o.view.line), 9,
|
|
3591
|
+
}, "$ " + E(o.view.line), 9, Ms)) : l.value === "delegate" ? (_(), n(xs, {
|
|
3580
3592
|
key: 3,
|
|
3581
3593
|
class: "kvc-block kvc-prose-lines",
|
|
3582
|
-
lines: D(
|
|
3594
|
+
lines: D(ds)(p.value),
|
|
3583
3595
|
"aria-label": D(c).t("kvcoder.ui.call.task"),
|
|
3584
3596
|
"data-test": "call-task"
|
|
3585
3597
|
}, null, 8, ["lines", "aria-label"])) : Object.keys(m.value).length > 0 ? (_(), i("div", {
|
|
@@ -3587,19 +3599,19 @@ var ss = ["aria-expanded"], cs = /* @__PURE__ */ c({
|
|
|
3587
3599
|
class: "kvc-block",
|
|
3588
3600
|
"aria-label": D(c).t("kvcoder.ui.call.payload"),
|
|
3589
3601
|
"data-test": "call-payload-fields"
|
|
3590
|
-
}, [s(
|
|
3602
|
+
}, [s(js, { value: D(cs)(m.value) }, null, 8, ["value"])], 8, Ns)) : r("v-if", !0);
|
|
3591
3603
|
}
|
|
3592
|
-
}),
|
|
3604
|
+
}), Fs = { class: "kvc-output-block" }, Is = ["aria-label"], Ls = /* @__PURE__ */ c({
|
|
3593
3605
|
__name: "FoldedOutput",
|
|
3594
3606
|
props: { output: {} },
|
|
3595
3607
|
setup(e) {
|
|
3596
|
-
let n = e, r = K(), o = y(!1), c = t(() => n.output.split("\n")), l = t(() =>
|
|
3597
|
-
return (e, t) => (_(), i("div",
|
|
3608
|
+
let n = e, r = K(), o = y(!1), c = t(() => n.output.split("\n")), l = t(() => ps(c.value, o.value).join("\n"));
|
|
3609
|
+
return (e, t) => (_(), i("div", Fs, [a("pre", {
|
|
3598
3610
|
class: "kvc-output",
|
|
3599
3611
|
dir: "auto",
|
|
3600
3612
|
"aria-label": D(r).t("kvcoder.ui.output"),
|
|
3601
3613
|
"data-test": "call-output"
|
|
3602
|
-
}, [s(Y, { text: l.value }, null, 8, ["text"])], 8,
|
|
3614
|
+
}, [s(Y, { text: l.value }, null, 8, ["text"])], 8, Is), s(hs, {
|
|
3603
3615
|
count: c.value.length,
|
|
3604
3616
|
open: o.value,
|
|
3605
3617
|
over: D(12) + D(5),
|
|
@@ -3613,7 +3625,7 @@ var ss = ["aria-expanded"], cs = /* @__PURE__ */ c({
|
|
|
3613
3625
|
});
|
|
3614
3626
|
//#endregion
|
|
3615
3627
|
//#region web/src/durations.ts
|
|
3616
|
-
function
|
|
3628
|
+
function Rs(e, t) {
|
|
3617
3629
|
if (t < 1e3) return e("kvcoder.ui.milliseconds", { count: Math.round(t) });
|
|
3618
3630
|
if (t < 1e4) return e("kvcoder.ui.seconds", { count: (t / 1e3).toFixed(1) });
|
|
3619
3631
|
let n = Math.round(t / 1e3);
|
|
@@ -3624,21 +3636,21 @@ function js(e, t) {
|
|
|
3624
3636
|
}
|
|
3625
3637
|
//#endregion
|
|
3626
3638
|
//#region web/src/RunOutput.vue?vue&type=script&setup=true&lang.ts
|
|
3627
|
-
var
|
|
3639
|
+
var zs = {
|
|
3628
3640
|
class: "kvc-block kvc-run-row",
|
|
3629
3641
|
"data-test": "run-row"
|
|
3630
|
-
},
|
|
3642
|
+
}, Bs = {
|
|
3631
3643
|
class: "kvc-run-call",
|
|
3632
3644
|
dir: "auto",
|
|
3633
3645
|
"data-test": "run-call"
|
|
3634
|
-
},
|
|
3646
|
+
}, Vs = {
|
|
3635
3647
|
class: "kvc-chip",
|
|
3636
3648
|
"data-test": "run-status"
|
|
3637
|
-
},
|
|
3649
|
+
}, Hs = {
|
|
3638
3650
|
key: 0,
|
|
3639
3651
|
class: "kvc-muted",
|
|
3640
3652
|
"data-test": "run-time"
|
|
3641
|
-
},
|
|
3653
|
+
}, Us = ["aria-label"], Ws = ["aria-label"], Gs = ["aria-label"], Ks = ["aria-label"], qs = /* @__PURE__ */ c({
|
|
3642
3654
|
__name: "RunOutput",
|
|
3643
3655
|
props: { run: {} },
|
|
3644
3656
|
setup(c) {
|
|
@@ -3648,59 +3660,59 @@ var Ms = {
|
|
|
3648
3660
|
params: { text: f.value ?? "" }
|
|
3649
3661
|
}));
|
|
3650
3662
|
return (t, c) => (_(), i(e, null, [
|
|
3651
|
-
a("div",
|
|
3652
|
-
a("span",
|
|
3653
|
-
a("span",
|
|
3654
|
-
l.run.ranMs === void 0 ? r("v-if", !0) : (_(), i("span",
|
|
3663
|
+
a("div", zs, [
|
|
3664
|
+
a("span", Bs, E(l.run.call), 1),
|
|
3665
|
+
a("span", Vs, [o(E(D(Mo)(D(u).t, l.run.status)), 1), l.run.exitCode === void 0 ? r("v-if", !0) : (_(), i(e, { key: 0 }, [o(" · " + E(D(u).t("kvcoder.ui.exitCode", { code: l.run.exitCode })), 1)], 64))]),
|
|
3666
|
+
l.run.ranMs === void 0 ? r("v-if", !0) : (_(), i("span", Hs, E(D(Rs)(D(u).t, l.run.ranMs)), 1))
|
|
3655
3667
|
]),
|
|
3656
3668
|
p.value === void 0 ? l.run.problem === void 0 ? r("v-if", !0) : (_(), i("div", {
|
|
3657
3669
|
key: 1,
|
|
3658
3670
|
class: "kvc-block kvc-error",
|
|
3659
3671
|
"aria-label": D(u).t("kvcoder.ui.call.error"),
|
|
3660
3672
|
"data-test": "run-problem"
|
|
3661
|
-
}, [s(
|
|
3673
|
+
}, [s(js, { value: D(cs)(l.run.problem) }, null, 8, ["value"])], 8, Ws)) : (_(), i("pre", {
|
|
3662
3674
|
key: 0,
|
|
3663
3675
|
class: "kvc-block kvc-error",
|
|
3664
3676
|
dir: "auto",
|
|
3665
3677
|
"aria-label": D(u).t("kvcoder.ui.call.error"),
|
|
3666
3678
|
"data-test": "run-problem"
|
|
3667
|
-
}, [s(Y, { text: p.value }, null, 8, ["text"])], 8,
|
|
3679
|
+
}, [s(Y, { text: p.value }, null, 8, ["text"])], 8, Us)),
|
|
3668
3680
|
f.value === void 0 && l.run.output !== void 0 ? (_(), i("div", {
|
|
3669
3681
|
key: 2,
|
|
3670
3682
|
class: "kvc-block",
|
|
3671
3683
|
"aria-label": D(u).t("kvcoder.ui.output"),
|
|
3672
3684
|
"data-test": "call-result-fields"
|
|
3673
|
-
}, [s(
|
|
3685
|
+
}, [s(js, { value: D(cs)(l.run.output) }, null, 8, ["value"])], 8, Gs)) : l.run.answer && f.value ? (_(), i("div", {
|
|
3674
3686
|
key: 3,
|
|
3675
3687
|
class: "kvc-block",
|
|
3676
3688
|
"aria-label": D(u).t("kvcoder.ui.call.answer"),
|
|
3677
3689
|
"data-test": "call-answer"
|
|
3678
|
-
}, [(_(), n(C(D(u).View), { view: m.value }, null, 8, ["view"]))], 8,
|
|
3690
|
+
}, [(_(), n(C(D(u).View), { view: m.value }, null, 8, ["view"]))], 8, Ks)) : f.value ? (_(), n(Ls, {
|
|
3679
3691
|
key: 4,
|
|
3680
3692
|
output: f.value
|
|
3681
3693
|
}, null, 8, ["output"])) : r("v-if", !0)
|
|
3682
3694
|
], 64));
|
|
3683
3695
|
}
|
|
3684
|
-
}),
|
|
3696
|
+
}), Js = {
|
|
3685
3697
|
key: 0,
|
|
3686
3698
|
class: "kvc-muted kvc-call-parts",
|
|
3687
3699
|
"data-test": "call-replacements"
|
|
3688
|
-
},
|
|
3700
|
+
}, Ys = {
|
|
3689
3701
|
key: 2,
|
|
3690
3702
|
class: "kvc-block kvc-entries",
|
|
3691
3703
|
"data-test": "call-entries"
|
|
3692
|
-
},
|
|
3704
|
+
}, Xs = ["data-kind"], Zs = {
|
|
3693
3705
|
class: "kvc-mono",
|
|
3694
3706
|
dir: "auto",
|
|
3695
3707
|
"data-test": "call-entry-name"
|
|
3696
|
-
},
|
|
3708
|
+
}, Qs = {
|
|
3697
3709
|
key: 0,
|
|
3698
3710
|
class: "kvc-muted",
|
|
3699
3711
|
"data-test": "call-entry-size"
|
|
3700
|
-
},
|
|
3712
|
+
}, $s = {
|
|
3701
3713
|
class: "kvc-mono kvc-file-path",
|
|
3702
3714
|
"data-test": "call-file-path"
|
|
3703
|
-
},
|
|
3715
|
+
}, ec = ["aria-label"], tc = ["aria-label"], nc = /* @__PURE__ */ c({
|
|
3704
3716
|
__name: "CallResult",
|
|
3705
3717
|
props: {
|
|
3706
3718
|
view: {},
|
|
@@ -3708,7 +3720,7 @@ var Ms = {
|
|
|
3708
3720
|
result: {}
|
|
3709
3721
|
},
|
|
3710
3722
|
setup(o) {
|
|
3711
|
-
let c = o, l = K(), u = t(() =>
|
|
3723
|
+
let c = o, l = K(), u = t(() => ha(c.view)), d = t(() => u.value === "edit" ? Eo(c.result) : void 0), f = t(() => u.value === "read" ? Do(c.result) : void 0), p = t(() => u.value === "list" ? ko(c.result) : void 0), m = t(() => u.value === "search" ? Po(c.result) : void 0), h = t(() => u.value === "run-output" ? No(c.result) : void 0), g = y(!1), v = t(() => us(p.value ?? [], g.value)), x = t(() => ({
|
|
3712
3724
|
type: "markdown",
|
|
3713
3725
|
text: "kvcoder.markdown",
|
|
3714
3726
|
params: { text: c.output }
|
|
@@ -3718,25 +3730,25 @@ var Ms = {
|
|
|
3718
3730
|
class: "kvc-block",
|
|
3719
3731
|
"aria-label": D(l).t("kvcoder.ui.call.answer"),
|
|
3720
3732
|
"data-test": "call-answer"
|
|
3721
|
-
}, [(_(), n(C(D(l).View), { view: x.value }, null, 8, ["view"]))], 8,
|
|
3733
|
+
}, [(_(), n(C(D(l).View), { view: x.value }, null, 8, ["view"]))], 8, ec)) : S.value ? (_(), i("div", {
|
|
3722
3734
|
key: 7,
|
|
3723
3735
|
class: "kvc-block",
|
|
3724
3736
|
"aria-label": D(l).t("kvcoder.ui.output"),
|
|
3725
3737
|
"data-test": "call-result-fields"
|
|
3726
|
-
}, [s(
|
|
3738
|
+
}, [s(js, { value: D(cs)(c.result) }, null, 8, ["value"])], 8, tc)) : c.output === "" ? r("v-if", !0) : (_(), n(Ls, {
|
|
3727
3739
|
key: 8,
|
|
3728
3740
|
output: c.output
|
|
3729
|
-
}, null, 8, ["output"])) : (_(), n(
|
|
3741
|
+
}, null, 8, ["output"])) : (_(), n(qs, {
|
|
3730
3742
|
key: 5,
|
|
3731
3743
|
run: h.value
|
|
3732
3744
|
}, null, 8, ["run"])) : (_(!0), i(e, { key: 3 }, b(m.value, (e) => (_(), i("div", {
|
|
3733
3745
|
key: e.path,
|
|
3734
3746
|
class: "kvc-block",
|
|
3735
3747
|
"data-test": "call-file"
|
|
3736
|
-
}, [a("div",
|
|
3748
|
+
}, [a("div", $s, E(e.path), 1), s(xs, { lines: e.matches.map((e) => ({
|
|
3737
3749
|
text: e.text,
|
|
3738
3750
|
number: e.line
|
|
3739
|
-
})) }, null, 8, ["lines"])]))), 128)) : (_(), i("div",
|
|
3751
|
+
})) }, null, 8, ["lines"])]))), 128)) : (_(), i("div", Ys, [(_(!0), i(e, null, b(v.value, (e) => (_(), i("div", {
|
|
3740
3752
|
key: e.name,
|
|
3741
3753
|
class: "kvc-entry",
|
|
3742
3754
|
"data-kind": e.kind,
|
|
@@ -3746,40 +3758,40 @@ var Ms = {
|
|
|
3746
3758
|
size: 14,
|
|
3747
3759
|
"aria-hidden": "true"
|
|
3748
3760
|
})),
|
|
3749
|
-
a("span",
|
|
3750
|
-
e.kind === "file" ? (_(), i("span",
|
|
3751
|
-
], 8,
|
|
3761
|
+
a("span", Zs, E(e.name), 1),
|
|
3762
|
+
e.kind === "file" ? (_(), i("span", Qs, E(D(Ho)(D(l).t, e.bytes)), 1)) : r("v-if", !0)
|
|
3763
|
+
], 8, Xs))), 128)), s(hs, {
|
|
3752
3764
|
count: p.value.length,
|
|
3753
3765
|
open: g.value,
|
|
3754
3766
|
onToggle: o[0] ||= (e) => g.value = !g.value
|
|
3755
|
-
}, null, 8, ["count", "open"])])) : (_(), n(
|
|
3767
|
+
}, null, 8, ["count", "open"])])) : (_(), n(xs, {
|
|
3756
3768
|
key: 1,
|
|
3757
3769
|
class: "kvc-block",
|
|
3758
|
-
lines: D(
|
|
3770
|
+
lines: D(fs)(f.value.content, f.value.fromLine),
|
|
3759
3771
|
"data-test": "call-content"
|
|
3760
|
-
}, null, 8, ["lines"])) : (_(), i("p",
|
|
3772
|
+
}, null, 8, ["lines"])) : (_(), i("p", Js, E(D(l).t("kvcoder.ui.call.replacements", {
|
|
3761
3773
|
count: d.value.replacements,
|
|
3762
3774
|
line: d.value.firstChangedLine
|
|
3763
3775
|
})), 1));
|
|
3764
3776
|
}
|
|
3765
|
-
}),
|
|
3777
|
+
}), rc = {
|
|
3766
3778
|
key: 0,
|
|
3767
3779
|
class: "kvc-summary",
|
|
3768
3780
|
"data-test": "call-summary"
|
|
3769
|
-
},
|
|
3781
|
+
}, ic = {
|
|
3770
3782
|
key: 0,
|
|
3771
3783
|
"data-test": "call-words"
|
|
3772
|
-
},
|
|
3784
|
+
}, ac = {
|
|
3773
3785
|
key: 1,
|
|
3774
3786
|
class: "kvc-mono",
|
|
3775
3787
|
"data-test": "call-subject"
|
|
3776
|
-
},
|
|
3788
|
+
}, oc = ["dir"], sc = {
|
|
3777
3789
|
key: 1,
|
|
3778
3790
|
class: "kvc-muted",
|
|
3779
3791
|
dir: "ltr",
|
|
3780
3792
|
style: { "align-self": "flex-start" },
|
|
3781
3793
|
"data-test": "call-label"
|
|
3782
|
-
},
|
|
3794
|
+
}, cc = /* @__PURE__ */ c({
|
|
3783
3795
|
__name: "CallSummaryLine",
|
|
3784
3796
|
props: {
|
|
3785
3797
|
view: {},
|
|
@@ -3787,46 +3799,50 @@ var Ms = {
|
|
|
3787
3799
|
whole: { type: Boolean }
|
|
3788
3800
|
},
|
|
3789
3801
|
setup(e) {
|
|
3790
|
-
let n = e, a = K(), o = t(() =>
|
|
3791
|
-
return (e, t) => o.value === void 0 ? n.view.label ? (_(), i("span",
|
|
3792
|
-
o.value.words ? (_(), i("span",
|
|
3793
|
-
c.value ? (_(), i("span",
|
|
3802
|
+
let n = e, a = K(), o = t(() => es(a.t, n.view, n.result)), s = t(() => /\p{L}/u.test(o.value?.outcome ?? "") ? void 0 : "ltr"), c = t(() => o.value?.subject === void 0 || n.whole === !0 ? o.value?.subject : ga(o.value.subject));
|
|
3803
|
+
return (e, t) => o.value === void 0 ? n.view.label ? (_(), i("span", sc, E(n.view.label), 1)) : r("v-if", !0) : (_(), i("span", rc, [
|
|
3804
|
+
o.value.words ? (_(), i("span", ic, E(o.value.words), 1)) : r("v-if", !0),
|
|
3805
|
+
c.value ? (_(), i("span", ac, E(c.value), 1)) : r("v-if", !0),
|
|
3794
3806
|
o.value.outcome ? (_(), i("span", {
|
|
3795
3807
|
key: 2,
|
|
3796
3808
|
class: "kvc-muted",
|
|
3797
3809
|
dir: s.value,
|
|
3798
3810
|
"data-test": "call-outcome"
|
|
3799
|
-
}, E(o.value.outcome), 9,
|
|
3811
|
+
}, E(o.value.outcome), 9, oc)) : r("v-if", !0)
|
|
3800
3812
|
]));
|
|
3801
3813
|
}
|
|
3802
|
-
}),
|
|
3814
|
+
}), lc = ["aria-expanded", "disabled"], uc = ["aria-label"], dc = { class: "kvc-lines" }, fc = {
|
|
3803
3815
|
key: 0,
|
|
3804
3816
|
style: { "font-weight": "600" },
|
|
3805
3817
|
"data-test": "call-description"
|
|
3806
|
-
},
|
|
3818
|
+
}, pc = {
|
|
3807
3819
|
key: 1,
|
|
3808
3820
|
class: "kvc-oneline",
|
|
3809
3821
|
"data-test": "call-line"
|
|
3810
|
-
},
|
|
3822
|
+
}, mc = { class: "kvc-mono" }, hc = {
|
|
3811
3823
|
key: 2,
|
|
3812
3824
|
class: "kvc-chip kvc-warn",
|
|
3813
3825
|
"data-test": "call-risky"
|
|
3814
|
-
},
|
|
3826
|
+
}, gc = {
|
|
3815
3827
|
key: 3,
|
|
3816
3828
|
class: "kvc-chip",
|
|
3817
3829
|
"data-test": "call-background"
|
|
3818
|
-
},
|
|
3830
|
+
}, _c = {
|
|
3819
3831
|
key: 4,
|
|
3832
|
+
class: "kvc-chip",
|
|
3833
|
+
"data-test": "call-not-run"
|
|
3834
|
+
}, vc = {
|
|
3835
|
+
key: 5,
|
|
3820
3836
|
class: "kvc-chip kvc-danger",
|
|
3821
3837
|
"data-test": "call-failed"
|
|
3822
|
-
},
|
|
3838
|
+
}, yc = {
|
|
3823
3839
|
class: "kvc-muted",
|
|
3824
3840
|
"data-test": "call-time"
|
|
3825
|
-
},
|
|
3841
|
+
}, bc = {
|
|
3826
3842
|
key: 0,
|
|
3827
3843
|
class: "kvc-muted kvc-call-parts",
|
|
3828
3844
|
"data-test": "call-parts"
|
|
3829
|
-
},
|
|
3845
|
+
}, xc = ["aria-expanded"], Sc = ["aria-label"], Cc = /* @__PURE__ */ c({
|
|
3830
3846
|
__name: "CallCard",
|
|
3831
3847
|
props: {
|
|
3832
3848
|
view: {},
|
|
@@ -3836,16 +3852,19 @@ var Ms = {
|
|
|
3836
3852
|
running: { type: Boolean }
|
|
3837
3853
|
},
|
|
3838
3854
|
setup(o) {
|
|
3839
|
-
let c = o, l = K(), u = t(() =>
|
|
3855
|
+
let c = o, l = K(), u = t(() => ha(c.view)), d = y(c.output !== void 0 && c.failed !== !0 && (u.value === "edit" || u.value === "write")), p = y(!1), m = t(() => c.failed === !0 && c.output !== void 0 ? To(c.output) : void 0), h = t(() => m.value?.kind === "invalid"), g = t(() => {
|
|
3856
|
+
let e = m.value;
|
|
3857
|
+
return e === void 0 ? "" : e.kind === "error" ? e.message : l.t(`kvcoder.ui.failure.${e.kind}`);
|
|
3858
|
+
}), v = t(() => c.failed === !0 ? void 0 : Bo(c.output)), b = t(() => c.failed === !0 && u.value !== "line"), x = t(() => c.durationMs === void 0 ? "" : Rs(l.t, (c.view.writtenMs ?? 0) + c.durationMs)), S = t(() => {
|
|
3840
3859
|
if (c.durationMs === void 0) return "";
|
|
3841
|
-
let e =
|
|
3860
|
+
let e = Rs(l.t, c.durationMs);
|
|
3842
3861
|
return c.view.writtenMs === void 0 ? l.t("kvcoder.ui.callRan", { ran: e }) : l.t("kvcoder.ui.callParts", {
|
|
3843
|
-
written:
|
|
3862
|
+
written: Rs(l.t, c.view.writtenMs),
|
|
3844
3863
|
ran: e
|
|
3845
3864
|
});
|
|
3846
3865
|
});
|
|
3847
3866
|
return (t, o) => (_(), i("div", {
|
|
3848
|
-
class: f(["kvc-card", { "kvc-failed": c.failed }]),
|
|
3867
|
+
class: f(["kvc-card", { "kvc-failed": c.failed && !h.value }]),
|
|
3849
3868
|
"data-test": "call-card"
|
|
3850
3869
|
}, [a("button", {
|
|
3851
3870
|
type: "button",
|
|
@@ -3862,95 +3881,106 @@ var Ms = {
|
|
|
3862
3881
|
key: 0,
|
|
3863
3882
|
class: "kvc-spin",
|
|
3864
3883
|
"aria-label": D(l).t("kvcoder.ui.running")
|
|
3865
|
-
}, null, 8,
|
|
3884
|
+
}, null, 8, uc)) : (_(), n(C(d.value ? D(U) : D(le)), {
|
|
3866
3885
|
key: 1,
|
|
3867
3886
|
size: 16,
|
|
3868
3887
|
"aria-hidden": "true"
|
|
3869
3888
|
})),
|
|
3870
|
-
a("span",
|
|
3871
|
-
view: c.view,
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
], 64)) : r("v-if", !0)], 2)
|
|
3889
|
+
a("span", dc, [
|
|
3890
|
+
c.view.description ? (_(), i("span", fc, E(c.view.description), 1)) : c.view.connector === void 0 && c.view.line ? (_(), i("span", pc, [a("span", mc, E(D(ga)(c.view.line)), 1)])) : r("v-if", !0),
|
|
3891
|
+
s(cc, {
|
|
3892
|
+
view: c.view,
|
|
3893
|
+
result: v.value
|
|
3894
|
+
}, null, 8, ["view", "result"]),
|
|
3895
|
+
g.value === "" ? r("v-if", !0) : (_(), i("span", {
|
|
3896
|
+
key: 2,
|
|
3897
|
+
class: f(["kvc-oneline", h.value ? "kvc-muted" : "kvc-danger"]),
|
|
3898
|
+
dir: "auto",
|
|
3899
|
+
"data-test": "call-reason"
|
|
3900
|
+
}, E(g.value), 3))
|
|
3901
|
+
]),
|
|
3902
|
+
c.view.risky ? (_(), i("span", hc, E(D(l).t("kvcoder.ui.call.risky")), 1)) : r("v-if", !0),
|
|
3903
|
+
c.view.background ? (_(), i("span", gc, E(D(l).t("kvcoder.ui.jobs.background")), 1)) : r("v-if", !0),
|
|
3904
|
+
h.value ? (_(), i("span", _c, E(D(l).t("kvcoder.ui.callNotRun")), 1)) : c.failed ? (_(), i("span", vc, E(D(l).t("kvcoder.ui.callFailed")), 1)) : r("v-if", !0),
|
|
3905
|
+
a("span", yc, E(x.value), 1)
|
|
3906
|
+
], 8, lc), d.value && c.output !== void 0 ? (_(), i(e, { key: 0 }, [S.value === "" ? r("v-if", !0) : (_(), i("p", bc, E(S.value), 1)), b.value ? (_(), i(e, { key: 1 }, [a("button", {
|
|
3907
|
+
type: "button",
|
|
3908
|
+
class: "kvc-text-button kvc-fold",
|
|
3909
|
+
"aria-expanded": p.value,
|
|
3910
|
+
"data-test": "call-details",
|
|
3911
|
+
onClick: o[1] ||= (e) => p.value = !p.value
|
|
3912
|
+
}, E(D(l).t(p.value ? "kvcoder.ui.call.hideDetails" : "kvcoder.ui.call.showDetails")), 9, xc), p.value ? (_(), i(e, { key: 0 }, [a("pre", {
|
|
3913
|
+
class: "kvc-block kvc-error",
|
|
3914
|
+
dir: "auto",
|
|
3915
|
+
"aria-label": D(l).t("kvcoder.ui.call.error"),
|
|
3916
|
+
"data-test": "call-error"
|
|
3917
|
+
}, [s(Y, { text: c.output }, null, 8, ["text"])], 8, Sc), s(Ps, { view: c.view }, null, 8, ["view"])], 64)) : r("v-if", !0)], 64)) : (_(), i(e, { key: 2 }, [s(Ps, { view: c.view }, null, 8, ["view"]), s(nc, {
|
|
3918
|
+
view: c.view,
|
|
3919
|
+
output: c.output,
|
|
3920
|
+
result: v.value
|
|
3921
|
+
}, null, 8, [
|
|
3922
|
+
"view",
|
|
3923
|
+
"output",
|
|
3924
|
+
"result"
|
|
3925
|
+
])], 64))], 64)) : r("v-if", !0)], 2));
|
|
3899
3926
|
}
|
|
3900
|
-
}),
|
|
3927
|
+
}), wc = {
|
|
3901
3928
|
key: 0,
|
|
3902
3929
|
class: "kvc-card",
|
|
3903
3930
|
"data-test": "background-result"
|
|
3904
|
-
},
|
|
3931
|
+
}, Tc = { class: "kvc-card-row" }, Ec = {
|
|
3905
3932
|
style: {
|
|
3906
3933
|
flex: "1 1 auto",
|
|
3907
3934
|
"min-inline-size": "0"
|
|
3908
3935
|
},
|
|
3909
3936
|
"data-test": "background-title"
|
|
3910
|
-
},
|
|
3937
|
+
}, Dc = {
|
|
3911
3938
|
key: 0,
|
|
3912
3939
|
class: "kvc-muted",
|
|
3913
3940
|
"data-test": "background-time"
|
|
3914
|
-
},
|
|
3941
|
+
}, Oc = { class: "kvc-output" }, kc = {
|
|
3915
3942
|
key: 1,
|
|
3916
3943
|
class: "kvc-card",
|
|
3917
3944
|
"data-test": "kvcoder-hint"
|
|
3918
|
-
},
|
|
3945
|
+
}, Ac = { class: "kvc-card-row" }, jc = { class: "kvc-card-body kvc-muted" }, Mc = {
|
|
3919
3946
|
key: 0,
|
|
3920
3947
|
style: {
|
|
3921
3948
|
display: "flex",
|
|
3922
3949
|
gap: "6px",
|
|
3923
3950
|
"margin-block-start": "6px"
|
|
3924
3951
|
}
|
|
3925
|
-
},
|
|
3952
|
+
}, Nc = ["src", "alt"], Pc = {
|
|
3926
3953
|
key: 1,
|
|
3927
3954
|
class: "kvc-muted",
|
|
3928
3955
|
style: { display: "block" },
|
|
3929
3956
|
"data-test": "queued"
|
|
3930
|
-
},
|
|
3957
|
+
}, Fc = {
|
|
3931
3958
|
key: 3,
|
|
3932
3959
|
class: "kvc-answer",
|
|
3933
3960
|
"data-test": "assistant-message"
|
|
3934
|
-
},
|
|
3961
|
+
}, Ic = {
|
|
3935
3962
|
key: 0,
|
|
3936
3963
|
"data-test": "thinking"
|
|
3937
|
-
},
|
|
3964
|
+
}, Lc = { class: "kvc-muted" }, Rc = {
|
|
3938
3965
|
class: "kvc-muted",
|
|
3939
3966
|
style: { "white-space": "pre-wrap" }
|
|
3940
|
-
},
|
|
3941
|
-
key:
|
|
3967
|
+
}, zc = {
|
|
3968
|
+
key: 6,
|
|
3969
|
+
"data-test": "extension-card"
|
|
3970
|
+
}, Bc = {
|
|
3971
|
+
key: 8,
|
|
3942
3972
|
class: "kvc-notice",
|
|
3943
3973
|
"data-test": "notice"
|
|
3944
|
-
},
|
|
3945
|
-
key:
|
|
3974
|
+
}, Vc = {
|
|
3975
|
+
key: 9,
|
|
3946
3976
|
class: "kvc-card kvc-card-row",
|
|
3947
3977
|
role: "note",
|
|
3948
3978
|
"data-test": "note"
|
|
3949
|
-
},
|
|
3950
|
-
key:
|
|
3979
|
+
}, Hc = {
|
|
3980
|
+
key: 10,
|
|
3951
3981
|
class: "kvc-card",
|
|
3952
3982
|
"data-test": "summary"
|
|
3953
|
-
},
|
|
3983
|
+
}, Uc = { class: "kvc-card-row" }, Wc = { class: "kvc-card-body" }, Gc = /* @__PURE__ */ c({
|
|
3954
3984
|
__name: "MessageItem",
|
|
3955
3985
|
props: {
|
|
3956
3986
|
message: {},
|
|
@@ -3959,58 +3989,58 @@ var Ms = {
|
|
|
3959
3989
|
},
|
|
3960
3990
|
emits: ["openArtifact"],
|
|
3961
3991
|
setup(c, { emit: l }) {
|
|
3962
|
-
let u = c, d = l, p = K(), m = t(() =>
|
|
3963
|
-
let e = u.message.source?.kind === "subagent" ? "kvcoder.ui.helperFinished" : "kvcoder.ui.backgroundFinished", t = (u.message.source?.kind === "subagent" ? u.finishedRuns?.get(u.message.source.sessionId)?.title : void 0) ??
|
|
3992
|
+
let u = c, d = l, p = K(), m = t(() => Ma(u.message.content.content)), h = t(() => Na(u.message)), g = t(() => Ia(u.message, u.calls)), v = t(() => Ha(u.message)), y = t(() => Wa(u.message)), x = t(() => Xa(u.message)), S = t(() => {
|
|
3993
|
+
let e = u.message.source?.kind === "subagent" ? "kvcoder.ui.helperFinished" : "kvcoder.ui.backgroundFinished", t = (u.message.source?.kind === "subagent" ? u.finishedRuns?.get(u.message.source.sessionId)?.title : void 0) ?? Ya(u.message);
|
|
3964
3994
|
return t === void 0 ? p.t(e) : p.t(`${e}Named`, { name: rt(t) });
|
|
3965
|
-
}),
|
|
3966
|
-
let e = u.finishedRuns?.get(
|
|
3967
|
-
return e === void 0 ? void 0 :
|
|
3968
|
-
}),
|
|
3995
|
+
}), w = t(() => {
|
|
3996
|
+
let e = u.finishedRuns?.get(qa(u.message) ?? "");
|
|
3997
|
+
return e === void 0 ? void 0 : Rs(p.t, e.ranMs);
|
|
3998
|
+
}), T = t(() => za(u.message, u.calls)), O = t(() => {
|
|
3969
3999
|
let e = q(u.message.content.params), t = typeof e.code == "string" ? e.code : void 0, n = Object.fromEntries(Object.entries(Ye(e.details)).map(([e, t]) => [e, rt(t)])), r = t === void 0 ? {} : { error: p.t(Ke(t), n) }, i = $e(e.details), a = String(u.message.content.code);
|
|
3970
4000
|
return p.t(`kvcoder.notices.${i === void 0 || a !== "STEP_FAILED" ? a : "STEP_FAILED_REASON"}`, {
|
|
3971
4001
|
...e,
|
|
3972
4002
|
...r,
|
|
3973
4003
|
...i === void 0 ? {} : { reason: rt(i) }
|
|
3974
4004
|
});
|
|
3975
|
-
}),
|
|
4005
|
+
}), k = t(() => {
|
|
3976
4006
|
let e = u.message.content.params;
|
|
3977
4007
|
return p.t(String(u.message.content.key), typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : {});
|
|
3978
|
-
}),
|
|
4008
|
+
}), A = (e) => `/api/files/${encodeURIComponent(e)}?workspaceId=${encodeURIComponent(p.workspace.value.id)}`, j = (e) => ({
|
|
3979
4009
|
type: "markdown",
|
|
3980
4010
|
text: "kvcoder.markdown",
|
|
3981
4011
|
params: { text: e }
|
|
3982
4012
|
});
|
|
3983
|
-
return (t, c) => D(
|
|
4013
|
+
return (t, c) => D(Va)(u.message) ? (_(), i("div", wc, [a("details", null, [a("summary", Tc, [
|
|
3984
4014
|
s(D(oe), {
|
|
3985
4015
|
size: 16,
|
|
3986
4016
|
"aria-hidden": "true"
|
|
3987
4017
|
}),
|
|
3988
|
-
a("span",
|
|
3989
|
-
|
|
3990
|
-
]), a("pre",
|
|
4018
|
+
a("span", Ec, E(S.value), 1),
|
|
4019
|
+
w.value === void 0 ? r("v-if", !0) : (_(), i("span", Dc, E(w.value), 1))
|
|
4020
|
+
]), a("pre", Oc, E(m.value), 1)])])) : D(Ba)(u.message) ? (_(), i("div", kc, [a("details", null, [a("summary", Ac, [s(D(xe), {
|
|
3991
4021
|
size: 16,
|
|
3992
4022
|
"aria-hidden": "true"
|
|
3993
|
-
}), o(E(D(p).t("kvcoder.ui.toModel")), 1)]), a("div",
|
|
4023
|
+
}), o(E(D(p).t("kvcoder.ui.toModel")), 1)]), a("div", jc, E(m.value), 1)])])) : u.message.kind === "user" ? (_(), i("div", {
|
|
3994
4024
|
key: 2,
|
|
3995
4025
|
dir: "auto",
|
|
3996
4026
|
class: f(["kvc-user", { "kvc-queued": u.message.queued }]),
|
|
3997
4027
|
"data-test": "user-message"
|
|
3998
4028
|
}, [
|
|
3999
|
-
a("span", null, E(D(
|
|
4000
|
-
u.message.fileIds ? (_(), i("span",
|
|
4029
|
+
a("span", null, E(D(Ka)(m.value, D(p).t("kvcoder.ui.attachedFiles"))), 1),
|
|
4030
|
+
u.message.fileIds ? (_(), i("span", Mc, [(_(!0), i(e, null, b(u.message.fileIds, (e) => (_(), i("img", {
|
|
4001
4031
|
key: e,
|
|
4002
|
-
src:
|
|
4032
|
+
src: A(e),
|
|
4003
4033
|
alt: D(p).t("kvcoder.ui.attachment"),
|
|
4004
4034
|
style: {
|
|
4005
4035
|
"block-size": "48px",
|
|
4006
4036
|
"border-radius": "6px"
|
|
4007
4037
|
}
|
|
4008
|
-
}, null, 8,
|
|
4009
|
-
u.message.queued ? (_(), i("span",
|
|
4010
|
-
], 2)) : u.message.kind === "assistant" && (h.value !== "" || m.value !== "") ? (_(), i("div",
|
|
4038
|
+
}, null, 8, Nc))), 128))])) : r("v-if", !0),
|
|
4039
|
+
u.message.queued ? (_(), i("span", Pc, E(D(p).t("kvcoder.ui.queued")), 1)) : r("v-if", !0)
|
|
4040
|
+
], 2)) : u.message.kind === "assistant" && (h.value !== "" || m.value !== "") ? (_(), i("div", Fc, [h.value === "" ? r("v-if", !0) : (_(), i("details", Ic, [a("summary", Lc, E(D(p).t("kvcoder.ui.thought")), 1), a("p", Rc, E(h.value), 1)])), m.value === "" ? r("v-if", !0) : (_(), n(C(D(p).View), {
|
|
4011
4041
|
key: 1,
|
|
4012
|
-
view:
|
|
4013
|
-
}, null, 8, ["view"]))])) : u.message.kind === "toolResult" && v.value !== void 0 ? (_(), n(
|
|
4042
|
+
view: j(m.value)
|
|
4043
|
+
}, null, 8, ["view"]))])) : u.message.kind === "toolResult" && v.value !== void 0 ? (_(), n(xo, {
|
|
4014
4044
|
key: 4,
|
|
4015
4045
|
id: v.value.id,
|
|
4016
4046
|
title: v.value.title,
|
|
@@ -4022,7 +4052,7 @@ var Ms = {
|
|
|
4022
4052
|
"title",
|
|
4023
4053
|
"format",
|
|
4024
4054
|
"version"
|
|
4025
|
-
])) :
|
|
4055
|
+
])) : T.value === void 0 ? y.value === void 0 ? u.message.kind === "toolResult" ? (_(), i(e, { key: 7 }, [s(Cc, {
|
|
4026
4056
|
view: g.value,
|
|
4027
4057
|
failed: g.value.failed,
|
|
4028
4058
|
"duration-ms": g.value.durationMs,
|
|
@@ -4032,49 +4062,53 @@ var Ms = {
|
|
|
4032
4062
|
"failed",
|
|
4033
4063
|
"duration-ms",
|
|
4034
4064
|
"output"
|
|
4035
|
-
]),
|
|
4065
|
+
]), x.value === void 0 ? r("v-if", !0) : (_(), n(Ci, {
|
|
4036
4066
|
key: 0,
|
|
4037
4067
|
"session-id": u.message.sessionId,
|
|
4038
|
-
"run-id":
|
|
4039
|
-
}, null, 8, ["session-id", "run-id"]))], 64)) : u.message.kind === "notice" ? (_(), i("div",
|
|
4068
|
+
"run-id": x.value
|
|
4069
|
+
}, null, 8, ["session-id", "run-id"]))], 64)) : u.message.kind === "notice" ? (_(), i("div", Bc, E(O.value), 1)) : u.message.kind === "note" ? (_(), i("div", Vc, [s(D(Se), {
|
|
4040
4070
|
size: 18,
|
|
4041
4071
|
"aria-hidden": "true"
|
|
4042
|
-
}), o(E(
|
|
4072
|
+
}), o(E(k.value), 1)])) : u.message.kind === "summary" ? (_(), i("details", Hc, [a("summary", Uc, [s(D(Ee), {
|
|
4043
4073
|
size: 16,
|
|
4044
4074
|
"aria-hidden": "true"
|
|
4045
|
-
}), o(E(D(p).t("kvcoder.ui.summarized")), 1)]), a("div",
|
|
4075
|
+
}), o(E(D(p).t("kvcoder.ui.summarized")), 1)]), a("div", Wc, [(_(), n(C(D(p).View), { view: j(String(u.message.content.text ?? "")) }, null, 8, ["view"]))])])) : r("v-if", !0) : (_(), i("div", zc, [(_(), n(C(D(p).View), { view: {
|
|
4076
|
+
type: "custom",
|
|
4077
|
+
component: y.value.component,
|
|
4078
|
+
props: y.value.props
|
|
4079
|
+
} }, null, 8, ["view"]))])) : (_(), n(go, {
|
|
4046
4080
|
key: 5,
|
|
4047
|
-
answered:
|
|
4081
|
+
answered: T.value
|
|
4048
4082
|
}, null, 8, ["answered"]));
|
|
4049
4083
|
}
|
|
4050
|
-
}),
|
|
4084
|
+
}), Kc = {
|
|
4051
4085
|
class: "kvc-card kvc-ask",
|
|
4052
4086
|
"data-test": "approvals-card"
|
|
4053
|
-
},
|
|
4087
|
+
}, qc = {
|
|
4054
4088
|
class: "kvc-card-row",
|
|
4055
4089
|
style: { "font-weight": "600" }
|
|
4056
|
-
},
|
|
4090
|
+
}, Jc = ["data-test"], Yc = { class: "kvc-card-row" }, Xc = { class: "kvc-lines" }, Zc = {
|
|
4057
4091
|
key: 0,
|
|
4058
4092
|
style: { "font-weight": "600" },
|
|
4059
4093
|
"data-test": "call-description"
|
|
4060
|
-
},
|
|
4094
|
+
}, Qc = {
|
|
4061
4095
|
key: 2,
|
|
4062
4096
|
dir: "ltr",
|
|
4063
4097
|
style: { "align-self": "flex-start" },
|
|
4064
4098
|
"data-test": "call-subject"
|
|
4065
|
-
},
|
|
4099
|
+
}, $c = {
|
|
4066
4100
|
key: 3,
|
|
4067
4101
|
class: "kvc-chip",
|
|
4068
4102
|
style: { "align-self": "flex-start" },
|
|
4069
4103
|
"data-test": "call-background"
|
|
4070
|
-
},
|
|
4104
|
+
}, el = {
|
|
4071
4105
|
class: "kvc-card-row kvc-actions",
|
|
4072
4106
|
"data-test": "decision-actions"
|
|
4073
|
-
},
|
|
4107
|
+
}, tl = ["onClick"], nl = ["onClick"], rl = {
|
|
4074
4108
|
key: 0,
|
|
4075
4109
|
class: "kvc-card-row kvc-actions",
|
|
4076
4110
|
style: { "border-block-start": "1px solid var(--kv-color-border)" }
|
|
4077
|
-
},
|
|
4111
|
+
}, il = /* @__PURE__ */ c({
|
|
4078
4112
|
__name: "ApprovalsCard",
|
|
4079
4113
|
props: { approvals: {} },
|
|
4080
4114
|
emits: ["decide"],
|
|
@@ -4083,8 +4117,8 @@ var Ms = {
|
|
|
4083
4117
|
approvals: [...e],
|
|
4084
4118
|
confirmed: t
|
|
4085
4119
|
});
|
|
4086
|
-
return (t, c) => (_(), i("section",
|
|
4087
|
-
a("div",
|
|
4120
|
+
return (t, c) => (_(), i("section", Kc, [
|
|
4121
|
+
a("div", qc, [s(D(Oe), {
|
|
4088
4122
|
size: 18,
|
|
4089
4123
|
"aria-hidden": "true"
|
|
4090
4124
|
}), o(E(D(d).t("kvcoder.ui.allowCommands", { count: l.approvals.length })), 1)]),
|
|
@@ -4093,32 +4127,32 @@ var Ms = {
|
|
|
4093
4127
|
class: "kvc-approval",
|
|
4094
4128
|
"data-test": `approval-${e.questionId}`
|
|
4095
4129
|
}, [
|
|
4096
|
-
a("div",
|
|
4097
|
-
e.view.description ? (_(), i("span",
|
|
4098
|
-
e.view.connector === void 0 ? e.view.line ? (_(), i("span",
|
|
4130
|
+
a("div", Yc, [a("span", Xc, [
|
|
4131
|
+
e.view.description ? (_(), i("span", Zc, E(e.view.description), 1)) : r("v-if", !0),
|
|
4132
|
+
e.view.connector === void 0 ? e.view.line ? (_(), i("span", Qc, [a("span", { class: f(["kvc-mono", { "kvc-muted": e.view.description }]) }, E(e.view.line), 3)])) : r("v-if", !0) : (_(), n(cc, {
|
|
4099
4133
|
key: 1,
|
|
4100
4134
|
view: e.view,
|
|
4101
4135
|
whole: ""
|
|
4102
4136
|
}, null, 8, ["view"])),
|
|
4103
|
-
e.view.background ? (_(), i("span",
|
|
4137
|
+
e.view.background ? (_(), i("span", $c, E(D(d).t("kvcoder.ui.jobs.inBackground")), 1)) : r("v-if", !0)
|
|
4104
4138
|
])]),
|
|
4105
|
-
D(
|
|
4139
|
+
D(ha)(e.view) === "line" ? r("v-if", !0) : (_(), n(Ps, {
|
|
4106
4140
|
key: 0,
|
|
4107
4141
|
view: e.view
|
|
4108
4142
|
}, null, 8, ["view"])),
|
|
4109
|
-
a("div",
|
|
4143
|
+
a("div", el, [a("button", {
|
|
4110
4144
|
type: "button",
|
|
4111
4145
|
class: "kvc-button",
|
|
4112
4146
|
"data-test": "deny",
|
|
4113
4147
|
onClick: (t) => p([e], !1)
|
|
4114
|
-
}, E(D(d).t("kvcoder.ui.deny")), 9,
|
|
4148
|
+
}, E(D(d).t("kvcoder.ui.deny")), 9, tl), a("button", {
|
|
4115
4149
|
type: "button",
|
|
4116
4150
|
class: "kvc-button kvc-primary",
|
|
4117
4151
|
"data-test": "allow",
|
|
4118
4152
|
onClick: (t) => p([e], !0)
|
|
4119
|
-
}, E(D(d).t("kvcoder.ui.allow")), 9,
|
|
4120
|
-
], 8,
|
|
4121
|
-
l.approvals.length > 1 ? (_(), i("div",
|
|
4153
|
+
}, E(D(d).t("kvcoder.ui.allow")), 9, nl)])
|
|
4154
|
+
], 8, Jc))), 128)),
|
|
4155
|
+
l.approvals.length > 1 ? (_(), i("div", rl, [a("button", {
|
|
4122
4156
|
type: "button",
|
|
4123
4157
|
class: "kvc-button",
|
|
4124
4158
|
"data-test": "deny-all",
|
|
@@ -4131,13 +4165,13 @@ var Ms = {
|
|
|
4131
4165
|
}, E(D(d).t("kvcoder.ui.allowAll")), 1)])) : r("v-if", !0)
|
|
4132
4166
|
]));
|
|
4133
4167
|
}
|
|
4134
|
-
}),
|
|
4135
|
-
function
|
|
4136
|
-
let t =
|
|
4137
|
-
return t === void 0 && (t = v(/* @__PURE__ */ new Map()),
|
|
4168
|
+
}), al = /* @__PURE__ */ new Map();
|
|
4169
|
+
function ol(e) {
|
|
4170
|
+
let t = al.get(e);
|
|
4171
|
+
return t === void 0 && (t = v(/* @__PURE__ */ new Map()), al.set(e, t)), t;
|
|
4138
4172
|
}
|
|
4139
|
-
function
|
|
4140
|
-
let r =
|
|
4173
|
+
function sl(e, t, n) {
|
|
4174
|
+
let r = ol(e), i = r.get(t);
|
|
4141
4175
|
return i === void 0 ? (i = v({
|
|
4142
4176
|
text: "",
|
|
4143
4177
|
selected: [],
|
|
@@ -4148,55 +4182,55 @@ function Zc(e, t, n) {
|
|
|
4148
4182
|
owner: n
|
|
4149
4183
|
}), r.set(t, i)) : n !== void 0 && i.owner === void 0 && (i.owner = n), i;
|
|
4150
4184
|
}
|
|
4151
|
-
var
|
|
4152
|
-
function
|
|
4185
|
+
var cl = (e, t, n) => ol(e).get(t) === n, ll = (e) => new Set([...ol(e)].filter(([, e]) => e.settled).map(([e]) => e));
|
|
4186
|
+
function ul(e) {
|
|
4153
4187
|
e.text = "", e.selected = [], e.other = "", e.error = void 0, e.sending = !1, e.settled = !0;
|
|
4154
4188
|
}
|
|
4155
|
-
function
|
|
4156
|
-
let r =
|
|
4189
|
+
function dl(e, t, n) {
|
|
4190
|
+
let r = ol(e);
|
|
4157
4191
|
for (let [e, i] of r) {
|
|
4158
4192
|
if (i.owner?.sessionId !== t) continue;
|
|
4159
4193
|
let a = n.find((e) => e.id === i.owner?.turnId && e.sessionId === t);
|
|
4160
|
-
a !== void 0 && (a.outcome === void 0 && a.endedAt === void 0 && a.pending.some((t) => t.questionId === e) || (
|
|
4194
|
+
a !== void 0 && (a.outcome === void 0 && a.endedAt === void 0 && a.pending.some((t) => t.questionId === e) || (ul(i), r.delete(e)));
|
|
4161
4195
|
}
|
|
4162
4196
|
}
|
|
4163
4197
|
//#endregion
|
|
4164
4198
|
//#region web/src/QuestionCard.vue?vue&type=script&setup=true&lang.ts
|
|
4165
|
-
var
|
|
4199
|
+
var fl = ["aria-label", "aria-busy"], pl = {
|
|
4166
4200
|
class: "kvc-card-row",
|
|
4167
4201
|
style: { "font-weight": "600" }
|
|
4168
|
-
},
|
|
4202
|
+
}, ml = { dir: "auto" }, hl = { class: "kvc-card-body" }, gl = {
|
|
4169
4203
|
key: 0,
|
|
4170
4204
|
role: "status",
|
|
4171
4205
|
"data-test": "answer-sending"
|
|
4172
|
-
},
|
|
4206
|
+
}, _l = {
|
|
4173
4207
|
key: 1,
|
|
4174
4208
|
role: "alert",
|
|
4175
4209
|
"data-test": "answer-error"
|
|
4176
|
-
},
|
|
4210
|
+
}, vl = [
|
|
4177
4211
|
"disabled",
|
|
4178
4212
|
"placeholder",
|
|
4179
4213
|
"aria-label"
|
|
4180
|
-
],
|
|
4214
|
+
], yl = { class: "kvc-actions" }, bl = ["disabled"], xl = ["disabled"], Sl = ["data-test"], Cl = [
|
|
4181
4215
|
"type",
|
|
4182
4216
|
"checked",
|
|
4183
4217
|
"disabled",
|
|
4184
4218
|
"name",
|
|
4185
4219
|
"onChange"
|
|
4186
|
-
],
|
|
4220
|
+
], wl = { style: {
|
|
4187
4221
|
display: "flex",
|
|
4188
4222
|
"flex-direction": "column"
|
|
4189
|
-
} },
|
|
4223
|
+
} }, Tl = { style: { "font-weight": "500" } }, El = {
|
|
4190
4224
|
key: 0,
|
|
4191
4225
|
class: "kvc-muted"
|
|
4192
|
-
},
|
|
4226
|
+
}, Dl = [
|
|
4193
4227
|
"disabled",
|
|
4194
4228
|
"placeholder",
|
|
4195
4229
|
"aria-label"
|
|
4196
|
-
],
|
|
4230
|
+
], Ol = { class: "kvc-actions" }, kl = ["disabled"], Al = ["disabled"], jl = {
|
|
4197
4231
|
key: 4,
|
|
4198
4232
|
class: "kvc-actions"
|
|
4199
|
-
},
|
|
4233
|
+
}, Ml = ["disabled"], Nl = ["disabled"], Pl = /* @__PURE__ */ c({
|
|
4200
4234
|
__name: "QuestionCard",
|
|
4201
4235
|
props: {
|
|
4202
4236
|
questionId: {},
|
|
@@ -4205,7 +4239,7 @@ var nl = ["aria-label", "aria-busy"], rl = {
|
|
|
4205
4239
|
},
|
|
4206
4240
|
emits: ["answer"],
|
|
4207
4241
|
setup(n, { emit: o }) {
|
|
4208
|
-
let c = n, l = o, u = K(), d = t(() => String(c.question.kind ?? "text")), p = t(() => String(c.question.prompt ?? "")), m = t(() =>
|
|
4242
|
+
let c = n, l = o, u = K(), d = t(() => String(c.question.kind ?? "text")), p = t(() => String(c.question.prompt ?? "")), m = t(() => Za(c.question)), h = t(() => c.question.multiple === !0), g = t(() => c.question.other === !0), v = t(() => sl(u.workspace.value.id, c.questionId, c.owner)), y = t(() => Je(u.t, v.value.error));
|
|
4209
4243
|
function x(e) {
|
|
4210
4244
|
!v.value.sending && !v.value.settled && l("answer", {
|
|
4211
4245
|
questionId: c.questionId,
|
|
@@ -4228,12 +4262,12 @@ var nl = ["aria-label", "aria-busy"], rl = {
|
|
|
4228
4262
|
"data-test": "question-card",
|
|
4229
4263
|
"aria-label": p.value,
|
|
4230
4264
|
"aria-busy": v.value.sending
|
|
4231
|
-
}, [a("div",
|
|
4265
|
+
}, [a("div", pl, [s(D(de), {
|
|
4232
4266
|
size: 18,
|
|
4233
4267
|
"aria-hidden": "true"
|
|
4234
|
-
}), a("span",
|
|
4235
|
-
v.value.sending ? (_(), i("p",
|
|
4236
|
-
v.value.error === void 0 ? r("v-if", !0) : (_(), i("p",
|
|
4268
|
+
}), a("span", ml, E(p.value), 1)]), a("div", hl, [
|
|
4269
|
+
v.value.sending ? (_(), i("p", gl, E(D(u).t("kvcoder.ui.answerSending")), 1)) : r("v-if", !0),
|
|
4270
|
+
v.value.error === void 0 ? r("v-if", !0) : (_(), i("p", _l, E(D(u).t("kvcoder.ui.answerFailed", { error: y.value })), 1)),
|
|
4237
4271
|
d.value === "text" ? (_(), i(e, { key: 2 }, [M(a("input", {
|
|
4238
4272
|
"onUpdate:modelValue": n[0] ||= (e) => v.value.text = e,
|
|
4239
4273
|
disabled: v.value.sending,
|
|
@@ -4243,19 +4277,19 @@ var nl = ["aria-label", "aria-busy"], rl = {
|
|
|
4243
4277
|
"aria-label": p.value,
|
|
4244
4278
|
"data-test": "answer-text",
|
|
4245
4279
|
onKeydown: n[1] ||= N(P((e) => x({ text: v.value.text }), ["prevent"]), ["enter"])
|
|
4246
|
-
}, null, 40,
|
|
4280
|
+
}, null, 40, vl), [[k, v.value.text]]), a("div", yl, [a("button", {
|
|
4247
4281
|
type: "button",
|
|
4248
4282
|
disabled: v.value.sending,
|
|
4249
4283
|
class: "kvc-button",
|
|
4250
4284
|
"data-test": "skip",
|
|
4251
4285
|
onClick: n[2] ||= (e) => x({ dismissed: !0 })
|
|
4252
|
-
}, E(D(u).t("kvcoder.ui.skip")), 9,
|
|
4286
|
+
}, E(D(u).t("kvcoder.ui.skip")), 9, bl), a("button", {
|
|
4253
4287
|
type: "button",
|
|
4254
4288
|
disabled: v.value.sending,
|
|
4255
4289
|
class: "kvc-button kvc-primary",
|
|
4256
4290
|
"data-test": "answer",
|
|
4257
4291
|
onClick: n[3] ||= (e) => x({ text: v.value.text })
|
|
4258
|
-
}, E(D(u).t(v.value.error === void 0 ? "kvcoder.ui.answer" : "kvcoder.ui.tryAgain")), 9,
|
|
4292
|
+
}, E(D(u).t(v.value.error === void 0 ? "kvcoder.ui.answer" : "kvcoder.ui.tryAgain")), 9, xl)])], 64)) : d.value === "choice" ? (_(), i(e, { key: 3 }, [
|
|
4259
4293
|
(_(!0), i(e, null, b(m.value, (e) => (_(), i("label", {
|
|
4260
4294
|
key: e.id,
|
|
4261
4295
|
class: "kvc-option",
|
|
@@ -4266,7 +4300,7 @@ var nl = ["aria-label", "aria-busy"], rl = {
|
|
|
4266
4300
|
disabled: v.value.sending,
|
|
4267
4301
|
name: c.questionId,
|
|
4268
4302
|
onChange: (t) => S(e.id)
|
|
4269
|
-
}, null, 40,
|
|
4303
|
+
}, null, 40, Cl), a("span", wl, [a("span", Tl, E(e.label), 1), e.description ? (_(), i("span", El, E(e.description), 1)) : r("v-if", !0)])], 8, Sl))), 128)),
|
|
4270
4304
|
g.value ? M((_(), i("input", {
|
|
4271
4305
|
key: 0,
|
|
4272
4306
|
"onUpdate:modelValue": n[4] ||= (e) => v.value.other = e,
|
|
@@ -4275,36 +4309,36 @@ var nl = ["aria-label", "aria-busy"], rl = {
|
|
|
4275
4309
|
placeholder: D(u).t("kvcoder.ui.other"),
|
|
4276
4310
|
"aria-label": D(u).t("kvcoder.ui.other"),
|
|
4277
4311
|
"data-test": "answer-other"
|
|
4278
|
-
}, null, 8,
|
|
4279
|
-
a("div",
|
|
4312
|
+
}, null, 8, Dl)), [[k, v.value.other]]) : r("v-if", !0),
|
|
4313
|
+
a("div", Ol, [a("button", {
|
|
4280
4314
|
type: "button",
|
|
4281
4315
|
disabled: v.value.sending,
|
|
4282
4316
|
class: "kvc-button",
|
|
4283
4317
|
"data-test": "skip",
|
|
4284
4318
|
onClick: n[5] ||= (e) => x({ dismissed: !0 })
|
|
4285
|
-
}, E(D(u).t("kvcoder.ui.skip")), 9,
|
|
4319
|
+
}, E(D(u).t("kvcoder.ui.skip")), 9, kl), a("button", {
|
|
4286
4320
|
type: "button",
|
|
4287
4321
|
class: "kvc-button kvc-primary",
|
|
4288
4322
|
disabled: v.value.sending || v.value.selected.length === 0 && v.value.other.trim() === "",
|
|
4289
4323
|
"data-test": "answer",
|
|
4290
4324
|
onClick: C
|
|
4291
|
-
}, E(D(u).t(v.value.error === void 0 ? "kvcoder.ui.answer" : "kvcoder.ui.tryAgain")), 9,
|
|
4292
|
-
], 64)) : (_(), i("div",
|
|
4325
|
+
}, E(D(u).t(v.value.error === void 0 ? "kvcoder.ui.answer" : "kvcoder.ui.tryAgain")), 9, Al)])
|
|
4326
|
+
], 64)) : (_(), i("div", jl, [a("button", {
|
|
4293
4327
|
type: "button",
|
|
4294
4328
|
disabled: v.value.sending,
|
|
4295
4329
|
class: "kvc-button",
|
|
4296
4330
|
"data-test": "answer-no",
|
|
4297
4331
|
onClick: n[6] ||= (e) => x({ confirmed: !1 })
|
|
4298
|
-
}, E(D(u).t("kvcoder.ui.no")), 9,
|
|
4332
|
+
}, E(D(u).t("kvcoder.ui.no")), 9, Ml), a("button", {
|
|
4299
4333
|
type: "button",
|
|
4300
4334
|
disabled: v.value.sending,
|
|
4301
4335
|
class: f(["kvc-button kvc-primary", { "kvc-danger": c.question.danger === !0 }]),
|
|
4302
4336
|
"data-test": "answer-yes",
|
|
4303
4337
|
onClick: n[7] ||= (e) => x({ confirmed: !0 })
|
|
4304
|
-
}, E(D(u).t("kvcoder.ui.yes")), 11,
|
|
4305
|
-
])], 8,
|
|
4338
|
+
}, E(D(u).t("kvcoder.ui.yes")), 11, Nl)]))
|
|
4339
|
+
])], 8, fl));
|
|
4306
4340
|
}
|
|
4307
|
-
}),
|
|
4341
|
+
}), Fl = /* @__PURE__ */ c({
|
|
4308
4342
|
__name: "PendingCards",
|
|
4309
4343
|
props: {
|
|
4310
4344
|
pending: {},
|
|
@@ -4318,9 +4352,9 @@ var nl = ["aria-label", "aria-busy"], rl = {
|
|
|
4318
4352
|
question: q(e.question)
|
|
4319
4353
|
}))), d = t(() => s.pending.filter((e) => e.kind === "approval" && l(e)).map((e) => ({
|
|
4320
4354
|
questionId: String(e.questionId),
|
|
4321
|
-
view:
|
|
4355
|
+
view: pa(q(e.question))
|
|
4322
4356
|
})));
|
|
4323
|
-
return (t, a) => (_(), i(e, null, [(_(!0), i(e, null, b(u.value, (e) => (_(), n(
|
|
4357
|
+
return (t, a) => (_(), i(e, null, [(_(!0), i(e, null, b(u.value, (e) => (_(), n(Pl, {
|
|
4324
4358
|
key: e.questionId,
|
|
4325
4359
|
"question-id": e.questionId,
|
|
4326
4360
|
question: e.question,
|
|
@@ -4330,7 +4364,7 @@ var nl = ["aria-label", "aria-busy"], rl = {
|
|
|
4330
4364
|
"question-id",
|
|
4331
4365
|
"question",
|
|
4332
4366
|
"owner"
|
|
4333
|
-
]))), 128)), d.value.length > 0 ? (_(), n(
|
|
4367
|
+
]))), 128)), d.value.length > 0 ? (_(), n(il, {
|
|
4334
4368
|
key: 0,
|
|
4335
4369
|
approvals: d.value,
|
|
4336
4370
|
onDecide: a[1] ||= (e) => c("decide", {
|
|
@@ -4342,12 +4376,12 @@ var nl = ["aria-label", "aria-busy"], rl = {
|
|
|
4342
4376
|
});
|
|
4343
4377
|
//#endregion
|
|
4344
4378
|
//#region web/src/use-model-groups.ts
|
|
4345
|
-
function
|
|
4379
|
+
function Il(e, t, n) {
|
|
4346
4380
|
let r = y([]);
|
|
4347
4381
|
return h(async () => {
|
|
4348
4382
|
try {
|
|
4349
4383
|
let [n, i] = await Promise.all([e.exec("kvai.provider.list", {}), e.exec("kvai.model.list", {})]);
|
|
4350
|
-
r.value =
|
|
4384
|
+
r.value = Mr(n, i, t());
|
|
4351
4385
|
} catch (e) {
|
|
4352
4386
|
n(e);
|
|
4353
4387
|
}
|
|
@@ -4355,15 +4389,15 @@ function El(e, t, n) {
|
|
|
4355
4389
|
}
|
|
4356
4390
|
//#endregion
|
|
4357
4391
|
//#region web/src/RecoveryActions.vue?vue&type=script&setup=true&lang.ts
|
|
4358
|
-
var
|
|
4392
|
+
var Ll = {
|
|
4359
4393
|
class: "kvc-recovery",
|
|
4360
4394
|
"data-test": "recovery"
|
|
4361
|
-
},
|
|
4395
|
+
}, Rl = ["disabled"], zl = { class: "kvc-recovery-picker" }, Bl = /* @__PURE__ */ c({
|
|
4362
4396
|
__name: "RecoveryActions",
|
|
4363
4397
|
props: { sessionId: {} },
|
|
4364
4398
|
emits: ["sent"],
|
|
4365
4399
|
setup(e, { emit: t }) {
|
|
4366
|
-
let n = e, r = t, c = K(), l =
|
|
4400
|
+
let n = e, r = t, c = K(), l = Il(c, () => null, (e) => J(c, e));
|
|
4367
4401
|
async function u() {
|
|
4368
4402
|
await c.exec("kvcoder.turn.retry", { sessionId: n.sessionId }), r("sent");
|
|
4369
4403
|
}
|
|
@@ -4384,9 +4418,9 @@ var Dl = {
|
|
|
4384
4418
|
await c.exec("kvcoder.session.configure", {
|
|
4385
4419
|
sessionId: n.sessionId,
|
|
4386
4420
|
model: e
|
|
4387
|
-
}), await
|
|
4421
|
+
}), await Qr(c, e), await u();
|
|
4388
4422
|
});
|
|
4389
|
-
return (e, t) => (_(), i("div",
|
|
4423
|
+
return (e, t) => (_(), i("div", Ll, [a("button", {
|
|
4390
4424
|
type: "button",
|
|
4391
4425
|
class: "kvc-button",
|
|
4392
4426
|
disabled: d.value,
|
|
@@ -4395,34 +4429,34 @@ var Dl = {
|
|
|
4395
4429
|
}, [s(D(Te), {
|
|
4396
4430
|
size: 14,
|
|
4397
4431
|
"aria-hidden": "true"
|
|
4398
|
-
}), o(E(D(c).t("kvcoder.ui.retry")), 1)], 8,
|
|
4432
|
+
}), o(E(D(c).t("kvcoder.ui.retry")), 1)], 8, Rl), a("div", zl, [s(Xr, {
|
|
4399
4433
|
groups: D(l),
|
|
4400
4434
|
current: null,
|
|
4401
4435
|
empty: D(c).t("kvcoder.ui.chooseAnotherModel"),
|
|
4402
4436
|
onPick: m
|
|
4403
4437
|
}, null, 8, ["groups", "empty"])])]));
|
|
4404
4438
|
}
|
|
4405
|
-
}),
|
|
4439
|
+
}), Vl = {
|
|
4406
4440
|
class: "kvc-column",
|
|
4407
4441
|
"data-test": "prompt-tab"
|
|
4408
|
-
},
|
|
4442
|
+
}, Hl = { style: {
|
|
4409
4443
|
display: "flex",
|
|
4410
4444
|
"align-items": "center",
|
|
4411
4445
|
gap: "10px"
|
|
4412
|
-
} },
|
|
4446
|
+
} }, Ul = { style: { flex: "1 1 auto" } }, Wl = {
|
|
4413
4447
|
key: 0,
|
|
4414
4448
|
style: {
|
|
4415
4449
|
margin: "0",
|
|
4416
4450
|
"padding-inline-start": "20px"
|
|
4417
4451
|
}
|
|
4418
|
-
},
|
|
4452
|
+
}, Gl = {
|
|
4419
4453
|
key: 0,
|
|
4420
4454
|
class: "kvc-chip kvc-warn"
|
|
4421
|
-
},
|
|
4455
|
+
}, Kl = {
|
|
4422
4456
|
key: 1,
|
|
4423
4457
|
class: "kvc-prompt",
|
|
4424
4458
|
"data-test": "prompt-text"
|
|
4425
|
-
},
|
|
4459
|
+
}, ql = /* @__PURE__ */ c({
|
|
4426
4460
|
__name: "PromptTab",
|
|
4427
4461
|
props: { sessionId: {} },
|
|
4428
4462
|
emits: ["back"],
|
|
@@ -4438,8 +4472,8 @@ var Dl = {
|
|
|
4438
4472
|
async function f() {
|
|
4439
4473
|
d.value !== null && (await navigator.clipboard.writeText(d.value.prompt), u.toast("kvcoder.ui.copied", {}, "success"));
|
|
4440
4474
|
}
|
|
4441
|
-
return (t, n) => (_(), i("div",
|
|
4442
|
-
a("div",
|
|
4475
|
+
return (t, n) => (_(), i("div", Vl, [
|
|
4476
|
+
a("div", Hl, [
|
|
4443
4477
|
a("button", {
|
|
4444
4478
|
type: "button",
|
|
4445
4479
|
class: "kvc-button",
|
|
@@ -4450,15 +4484,15 @@ var Dl = {
|
|
|
4450
4484
|
class: "kvc-flip",
|
|
4451
4485
|
"aria-hidden": "true"
|
|
4452
4486
|
}), o(E(D(u).t("kvcoder.ui.showChat")), 1)]),
|
|
4453
|
-
a("strong",
|
|
4487
|
+
a("strong", Ul, E(D(u).t("kvcoder.ui.promptTitle")), 1),
|
|
4454
4488
|
a("button", {
|
|
4455
4489
|
type: "button",
|
|
4456
4490
|
class: "kvc-button",
|
|
4457
4491
|
"data-test": "copy-prompt",
|
|
4458
4492
|
onClick: f
|
|
4459
|
-
}, [s(D(
|
|
4493
|
+
}, [s(D(he), { size: 16 }), o(E(D(u).t("kvcoder.ui.copy")), 1)])
|
|
4460
4494
|
]),
|
|
4461
|
-
d.value ? (_(), i("ul",
|
|
4495
|
+
d.value ? (_(), i("ul", Wl, [(_(!0), i(e, null, b(d.value.sections, (e) => (_(), i("li", {
|
|
4462
4496
|
key: `${e.owner}/${e.id}`,
|
|
4463
4497
|
class: "kvc-muted",
|
|
4464
4498
|
"data-test": "prompt-section"
|
|
@@ -4467,14 +4501,14 @@ var Dl = {
|
|
|
4467
4501
|
owner: e.owner,
|
|
4468
4502
|
reach: D(u).t(`kvcoder.ui.reach.${e.reach}`),
|
|
4469
4503
|
size: e.size
|
|
4470
|
-
})) + " ", 1), e.included ? r("v-if", !0) : (_(), i("span",
|
|
4471
|
-
d.value ? (_(), i("pre",
|
|
4504
|
+
})) + " ", 1), e.included ? r("v-if", !0) : (_(), i("span", Gl, E(D(u).t("kvcoder.ui.leftOut")), 1))]))), 128))])) : r("v-if", !0),
|
|
4505
|
+
d.value ? (_(), i("pre", Kl, E(d.value.prompt), 1)) : r("v-if", !0)
|
|
4472
4506
|
]));
|
|
4473
4507
|
}
|
|
4474
4508
|
});
|
|
4475
4509
|
//#endregion
|
|
4476
4510
|
//#region web/src/use-session-actions.ts
|
|
4477
|
-
function
|
|
4511
|
+
function Jl(e, t, n) {
|
|
4478
4512
|
let r = T();
|
|
4479
4513
|
async function i(t) {
|
|
4480
4514
|
try {
|
|
@@ -4507,7 +4541,7 @@ function Rl(e, t, n) {
|
|
|
4507
4541
|
await e.exec("kvcoder.session.configure", {
|
|
4508
4542
|
sessionId: t(),
|
|
4509
4543
|
...n
|
|
4510
|
-
}), n.model !== void 0 && await
|
|
4544
|
+
}), n.model !== void 0 && await Qr(e, n.model);
|
|
4511
4545
|
}),
|
|
4512
4546
|
rename: (n) => a("rename", async () => {
|
|
4513
4547
|
n.trim() !== "" && await e.exec("kvcoder.session.rename", {
|
|
@@ -4537,13 +4571,13 @@ function Rl(e, t, n) {
|
|
|
4537
4571
|
}
|
|
4538
4572
|
//#endregion
|
|
4539
4573
|
//#region web/src/SessionModel.vue
|
|
4540
|
-
var
|
|
4574
|
+
var Yl = /* @__PURE__ */ c({
|
|
4541
4575
|
__name: "SessionModel",
|
|
4542
4576
|
props: { session: {} },
|
|
4543
4577
|
emits: ["changed"],
|
|
4544
4578
|
setup(e, { emit: t }) {
|
|
4545
|
-
let r = e, i = t, a = K(), o =
|
|
4546
|
-
return (e, t) => (_(), n(
|
|
4579
|
+
let r = e, i = t, a = K(), o = Il(a, () => r.session.model, (e) => J(a, e)), s = Jl(a, () => r.session.id, () => i("changed"));
|
|
4580
|
+
return (e, t) => (_(), n(Zr, {
|
|
4547
4581
|
groups: D(o),
|
|
4548
4582
|
model: r.session.model ?? null,
|
|
4549
4583
|
thinking: r.session.thinking,
|
|
@@ -4555,32 +4589,32 @@ var zl = /* @__PURE__ */ c({
|
|
|
4555
4589
|
"thinking"
|
|
4556
4590
|
]));
|
|
4557
4591
|
}
|
|
4558
|
-
}),
|
|
4592
|
+
}), Xl = ["aria-label"], Zl = { class: "kvc-card-row" }, Ql = {
|
|
4559
4593
|
key: 0,
|
|
4560
4594
|
class: "kvc-chip kvc-mono",
|
|
4561
4595
|
"data-test": "subagent-worker"
|
|
4562
|
-
},
|
|
4596
|
+
}, $l = { class: "kvc-lines" }, eu = {
|
|
4563
4597
|
style: { "font-weight": "600" },
|
|
4564
4598
|
"data-test": "subagent-title"
|
|
4565
|
-
},
|
|
4599
|
+
}, tu = {
|
|
4566
4600
|
key: 0,
|
|
4567
4601
|
class: "kvc-muted kvc-oneline",
|
|
4568
4602
|
dir: "auto",
|
|
4569
4603
|
"data-test": "subagent-task"
|
|
4570
|
-
},
|
|
4604
|
+
}, nu = {
|
|
4571
4605
|
key: 1,
|
|
4572
4606
|
class: "kvc-spin"
|
|
4573
|
-
},
|
|
4607
|
+
}, ru = {
|
|
4574
4608
|
key: 0,
|
|
4575
4609
|
class: "kvc-card-body"
|
|
4576
|
-
},
|
|
4610
|
+
}, iu = {
|
|
4577
4611
|
key: 0,
|
|
4578
4612
|
class: "kvc-muted",
|
|
4579
4613
|
style: {
|
|
4580
4614
|
margin: "0",
|
|
4581
4615
|
"white-space": "pre-wrap"
|
|
4582
4616
|
}
|
|
4583
|
-
},
|
|
4617
|
+
}, au = /* @__PURE__ */ c({
|
|
4584
4618
|
__name: "SubagentCard",
|
|
4585
4619
|
props: {
|
|
4586
4620
|
child: {},
|
|
@@ -4594,16 +4628,16 @@ var zl = /* @__PURE__ */ c({
|
|
|
4594
4628
|
class: "kvc-card",
|
|
4595
4629
|
"data-test": "subagent-card",
|
|
4596
4630
|
"aria-label": D(Ge)(D(l).t, o.child.session.title)
|
|
4597
|
-
}, [a("div",
|
|
4631
|
+
}, [a("div", Zl, [
|
|
4598
4632
|
s(D(se), {
|
|
4599
4633
|
size: 18,
|
|
4600
4634
|
"aria-hidden": "true"
|
|
4601
4635
|
}),
|
|
4602
|
-
o.child.session.worker === void 0 ? r("v-if", !0) : (_(), i("span",
|
|
4603
|
-
a("span",
|
|
4604
|
-
o.child.session.status === "running" ? (_(), i("span",
|
|
4636
|
+
o.child.session.worker === void 0 ? r("v-if", !0) : (_(), i("span", Ql, E(o.child.session.worker), 1)),
|
|
4637
|
+
a("span", $l, [a("span", eu, E(D(Ge)(D(l).t, o.child.session.title)), 1), u.value ? (_(), i("span", tu, E(u.value), 1)) : r("v-if", !0)]),
|
|
4638
|
+
o.child.session.status === "running" ? (_(), i("span", nu)) : r("v-if", !0),
|
|
4605
4639
|
a("span", { class: f(["kvc-chip", { "kvc-warn": o.child.session.status === "waiting" }]) }, E(d.value), 3)
|
|
4606
|
-
]), o.child.live.text !== "" || (o.child.turn?.pending.length ?? 0) > 0 ? (_(), i("div",
|
|
4640
|
+
]), o.child.live.text !== "" || (o.child.turn?.pending.length ?? 0) > 0 ? (_(), i("div", ru, [o.child.live.text === "" ? r("v-if", !0) : (_(), i("p", iu, E(o.child.live.text), 1)), s(Fl, {
|
|
4607
4641
|
owner: o.child.turn === void 0 ? void 0 : {
|
|
4608
4642
|
sessionId: o.child.session.id,
|
|
4609
4643
|
turnId: o.child.turn.id
|
|
@@ -4616,22 +4650,22 @@ var zl = /* @__PURE__ */ c({
|
|
|
4616
4650
|
"owner",
|
|
4617
4651
|
"pending",
|
|
4618
4652
|
"hidden"
|
|
4619
|
-
])])) : r("v-if", !0)], 8,
|
|
4653
|
+
])])) : r("v-if", !0)], 8, Xl));
|
|
4620
4654
|
}
|
|
4621
|
-
}),
|
|
4655
|
+
}), ou = ["aria-label"], su = { class: "kvc-card-row" }, cu = {
|
|
4622
4656
|
class: "kvc-chip kvc-mono",
|
|
4623
4657
|
"data-test": "worker-card-name"
|
|
4624
|
-
},
|
|
4658
|
+
}, lu = {
|
|
4625
4659
|
style: {
|
|
4626
4660
|
flex: "1 1 auto",
|
|
4627
4661
|
"font-weight": "500"
|
|
4628
4662
|
},
|
|
4629
4663
|
dir: "auto",
|
|
4630
4664
|
"data-test": "worker-card-call"
|
|
4631
|
-
},
|
|
4665
|
+
}, uu = {
|
|
4632
4666
|
class: "kvc-chip",
|
|
4633
4667
|
"data-test": "worker-card-time"
|
|
4634
|
-
},
|
|
4668
|
+
}, du = ["disabled"], fu = /* @__PURE__ */ c({
|
|
4635
4669
|
__name: "WorkerCard",
|
|
4636
4670
|
props: {
|
|
4637
4671
|
sessionId: {},
|
|
@@ -4667,25 +4701,25 @@ var zl = /* @__PURE__ */ c({
|
|
|
4667
4701
|
class: "kvc-card",
|
|
4668
4702
|
"data-test": "worker-card",
|
|
4669
4703
|
"aria-label": o.value.title
|
|
4670
|
-
}, [a("div",
|
|
4704
|
+
}, [a("div", su, [
|
|
4671
4705
|
s(D(se), {
|
|
4672
4706
|
size: 18,
|
|
4673
4707
|
"aria-hidden": "true"
|
|
4674
4708
|
}),
|
|
4675
|
-
a("span",
|
|
4676
|
-
a("span",
|
|
4709
|
+
a("span", cu, E(o.value.title), 1),
|
|
4710
|
+
a("span", lu, E(o.value.call), 1),
|
|
4677
4711
|
t[0] ||= a("span", { class: "kvc-spin" }, null, -1),
|
|
4678
|
-
a("span",
|
|
4712
|
+
a("span", uu, E(D(n).t("kvcoder.ui.jobs.status.running")) + " · " + E(D(Ti)(D(n).t, c.value - Date.parse(o.value.startedAt))), 1),
|
|
4679
4713
|
a("button", {
|
|
4680
4714
|
type: "button",
|
|
4681
4715
|
class: "kvc-button",
|
|
4682
4716
|
disabled: l.value,
|
|
4683
4717
|
"data-test": "worker-card-stop",
|
|
4684
4718
|
onClick: d
|
|
4685
|
-
}, E(D(n).t("kvcoder.ui.jobs.stop")), 9,
|
|
4686
|
-
])], 8,
|
|
4719
|
+
}, E(D(n).t("kvcoder.ui.jobs.stop")), 9, du)
|
|
4720
|
+
])], 8, ou));
|
|
4687
4721
|
}
|
|
4688
|
-
}),
|
|
4722
|
+
}), pu = (e) => {
|
|
4689
4723
|
let t = e.view.description ?? e.view.line;
|
|
4690
4724
|
return {
|
|
4691
4725
|
name: "run",
|
|
@@ -4694,8 +4728,8 @@ var zl = /* @__PURE__ */ c({
|
|
|
4694
4728
|
complete: !0
|
|
4695
4729
|
};
|
|
4696
4730
|
};
|
|
4697
|
-
function
|
|
4698
|
-
let i = t(() =>
|
|
4731
|
+
function mu(e, n, r) {
|
|
4732
|
+
let i = t(() => ll(e.workspace.value.id)), a = /* @__PURE__ */ new Map(), o = 0, s = !1;
|
|
4699
4733
|
A([
|
|
4700
4734
|
() => e.workspace.value.id,
|
|
4701
4735
|
() => r()?.sessionId,
|
|
@@ -4708,7 +4742,7 @@ function iu(e, n, r) {
|
|
|
4708
4742
|
async function c(t, r) {
|
|
4709
4743
|
let i = e.workspace.value.id, c = o, l = () => !s && o === c && e.workspace.value.id === i, u = t.map((e) => ({
|
|
4710
4744
|
item: e,
|
|
4711
|
-
draft:
|
|
4745
|
+
draft: sl(i, e.questionId, r)
|
|
4712
4746
|
}));
|
|
4713
4747
|
if (u.some(({ draft: e }) => e.sending)) return;
|
|
4714
4748
|
let d = u.filter(({ draft: e }) => !e.settled);
|
|
@@ -4716,18 +4750,18 @@ function iu(e, n, r) {
|
|
|
4716
4750
|
let f = null;
|
|
4717
4751
|
for (let [t, { item: n, draft: r }] of d.entries()) {
|
|
4718
4752
|
if (!l()) {
|
|
4719
|
-
for (let e of d.slice(t))
|
|
4753
|
+
for (let e of d.slice(t)) cl(i, e.item.questionId, e.draft) && (e.draft.sending = !1);
|
|
4720
4754
|
return;
|
|
4721
4755
|
}
|
|
4722
|
-
if (
|
|
4723
|
-
f = (await e.exec("kvcoder.question.answer", n)).jobId ?? f,
|
|
4756
|
+
if (cl(i, n.questionId, r)) try {
|
|
4757
|
+
f = (await e.exec("kvcoder.question.answer", n)).jobId ?? f, cl(i, n.questionId, r) && ul(r);
|
|
4724
4758
|
} catch (o) {
|
|
4725
4759
|
if (qe(o)?.code === "kvcoder/QUESTION_NOT_FOUND") {
|
|
4726
|
-
|
|
4760
|
+
cl(i, n.questionId, r) && (r.sending = !1);
|
|
4727
4761
|
continue;
|
|
4728
4762
|
}
|
|
4729
|
-
for (let e of d.slice(t))
|
|
4730
|
-
l() &&
|
|
4763
|
+
for (let e of d.slice(t)) cl(i, e.item.questionId, e.draft) && (e.draft.sending = !1, e.draft === r && (e.draft.error = o)), a.delete(e.item.questionId);
|
|
4764
|
+
l() && cl(i, n.questionId, r) && J(e, o);
|
|
4731
4765
|
return;
|
|
4732
4766
|
}
|
|
4733
4767
|
}
|
|
@@ -4741,7 +4775,7 @@ function iu(e, n, r) {
|
|
|
4741
4775
|
hidden: i,
|
|
4742
4776
|
answer: (e) => c([e]),
|
|
4743
4777
|
decide: ({ approvals: e, confirmed: t, owner: n }) => {
|
|
4744
|
-
if (t) for (let t of e) a.set(t.questionId,
|
|
4778
|
+
if (t) for (let t of e) a.set(t.questionId, pu(t));
|
|
4745
4779
|
return c(e.map((e) => ({
|
|
4746
4780
|
questionId: e.questionId,
|
|
4747
4781
|
answer: { confirmed: t }
|
|
@@ -4751,8 +4785,8 @@ function iu(e, n, r) {
|
|
|
4751
4785
|
}
|
|
4752
4786
|
//#endregion
|
|
4753
4787
|
//#region web/src/use-artifacts.ts
|
|
4754
|
-
var
|
|
4755
|
-
function
|
|
4788
|
+
var hu = (e) => `${e.version} ${e.updatedAt}`;
|
|
4789
|
+
function gu(e, t, n, r) {
|
|
4756
4790
|
let i = y([]), a = y(void 0), o = y(void 0), s = y(!1), c = y(void 0), l = /* @__PURE__ */ new Map(), u, d = !1, f = 0, p = !1;
|
|
4757
4791
|
function g(e) {
|
|
4758
4792
|
u = e, d = !1, l.clear(), c.value = void 0, i.value = [], a.value = void 0, o.value = void 0, s.value = !1;
|
|
@@ -4789,7 +4823,7 @@ function ou(e, t, n, r) {
|
|
|
4789
4823
|
if (p || m !== f || t() !== n || u !== n) return;
|
|
4790
4824
|
if (i.value = h, !d) {
|
|
4791
4825
|
d = !0;
|
|
4792
|
-
for (let e of h) l.set(e.id,
|
|
4826
|
+
for (let e of h) l.set(e.id, hu(e));
|
|
4793
4827
|
if (h.length === 0) {
|
|
4794
4828
|
a.value = void 0, o.value = void 0, s.value = !1;
|
|
4795
4829
|
return;
|
|
@@ -4800,8 +4834,8 @@ function ou(e, t, n, r) {
|
|
|
4800
4834
|
t !== void 0 && await _(n, t);
|
|
4801
4835
|
return;
|
|
4802
4836
|
}
|
|
4803
|
-
let v = h.filter((e) => l.get(e.id) !==
|
|
4804
|
-
for (let e of h) l.set(e.id,
|
|
4837
|
+
let v = h.filter((e) => l.get(e.id) !== hu(e));
|
|
4838
|
+
for (let e of h) l.set(e.id, hu(e));
|
|
4805
4839
|
if (v.length > 0) {
|
|
4806
4840
|
let e = [...v].sort((e, t) => e.updatedAt < t.updatedAt ? 1 : e.updatedAt > t.updatedAt ? -1 : 0)[0];
|
|
4807
4841
|
e !== void 0 && (a.value = e.id, s.value = !0, c.value = {
|
|
@@ -4869,7 +4903,7 @@ function ou(e, t, n, r) {
|
|
|
4869
4903
|
}
|
|
4870
4904
|
//#endregion
|
|
4871
4905
|
//#region web/src/conversation-streams.ts
|
|
4872
|
-
function
|
|
4906
|
+
function _u(e, t, n, r, i) {
|
|
4873
4907
|
let a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new WeakMap(), s = (e) => e.current() && a.get(e.target) === e, c = (e, t) => {
|
|
4874
4908
|
s(e) && i(t);
|
|
4875
4909
|
};
|
|
@@ -4884,17 +4918,17 @@ function su(e, t, n, r, i) {
|
|
|
4884
4918
|
let i = !1, u = !1;
|
|
4885
4919
|
try {
|
|
4886
4920
|
e.follow(r.jobId).catch((e) => c(r, e));
|
|
4887
|
-
for await (let t of e.stream(r.jobId)) if (!r.current() || !s(r) && a.has(r.target) || (t.type === "problem" && t.problem.code === "kvwebui/OFFLINE" && (u = !0),
|
|
4921
|
+
for await (let t of e.stream(r.jobId)) if (!r.current() || !s(r) && a.has(r.target) || (t.type === "problem" && t.problem.code === "kvwebui/OFFLINE" && (u = !0), xa(s(r) ? r.target : _a(), t).kind !== "none" && await l(r), !r.current() || !s(r) && a.has(r.target))) break;
|
|
4888
4922
|
i = !u;
|
|
4889
4923
|
} catch (e) {
|
|
4890
4924
|
c(r, e);
|
|
4891
4925
|
} finally {
|
|
4892
|
-
s(r) && (a.delete(r.target), i && o.set(r.target, r.jobId), Object.assign(r.target,
|
|
4926
|
+
s(r) && (a.delete(r.target), i && o.set(r.target, r.jobId), Object.assign(r.target, _a()), r.target === t && (n.value = !1)), i && await l(r);
|
|
4893
4927
|
}
|
|
4894
4928
|
}
|
|
4895
4929
|
function d(e, r, i, c = []) {
|
|
4896
4930
|
let l = a.get(e);
|
|
4897
|
-
if (l !== void 0 && l.jobId === r && s(l) || (l !== void 0 && a.delete(e), o.get(e) === r && r !== void 0) || (o.delete(e), Object.assign(e,
|
|
4931
|
+
if (l !== void 0 && l.jobId === r && s(l) || (l !== void 0 && a.delete(e), o.get(e) === r && r !== void 0) || (o.delete(e), Object.assign(e, _a()), e === t && (n.value = !1), r === void 0 || !i())) return;
|
|
4898
4932
|
let d = {
|
|
4899
4933
|
jobId: r,
|
|
4900
4934
|
target: e,
|
|
@@ -4921,27 +4955,27 @@ function su(e, t, n, r, i) {
|
|
|
4921
4955
|
}
|
|
4922
4956
|
//#endregion
|
|
4923
4957
|
//#region web/src/use-conversation.ts
|
|
4924
|
-
var
|
|
4925
|
-
function
|
|
4926
|
-
let i = T(null), a = T([]), o = T(0), s = T([]), c = T(null), l = T(void 0), u = T(!1), d = v(
|
|
4958
|
+
var vu = 5e3, yu = 200;
|
|
4959
|
+
function bu(e, t, n, r = () => !1) {
|
|
4960
|
+
let i = T(null), a = T([]), o = T(0), s = T([]), c = T(null), l = T(void 0), u = T(!1), d = v(_a()), f = w(/* @__PURE__ */ new Map()), p, m, h, _ = !1, y = !1, b = (n) => !_ && p === n && t() === n.sessionId && e.workspace.value.id === n.workspaceId, x = _u(e, d, u, () => N(), n), S = (e) => e.filter((e) => e.queued !== !0);
|
|
4927
4961
|
async function C(t, n, r) {
|
|
4928
4962
|
if (!r()) return;
|
|
4929
4963
|
let i = await e.exec("kvcoder.message.list", {
|
|
4930
4964
|
sessionId: t,
|
|
4931
|
-
limit:
|
|
4965
|
+
limit: yu
|
|
4932
4966
|
});
|
|
4933
4967
|
r() && (a.value = i.messages, o.value = i.omitted, h = n, y = !1);
|
|
4934
4968
|
}
|
|
4935
4969
|
async function E(t, n, i, s) {
|
|
4936
4970
|
let c = await e.exec("kvcoder.message.list", {
|
|
4937
4971
|
sessionId: t,
|
|
4938
|
-
limit:
|
|
4972
|
+
limit: yu,
|
|
4939
4973
|
afterSeq: i
|
|
4940
4974
|
});
|
|
4941
4975
|
if (!s()) return;
|
|
4942
4976
|
let l = S(c.messages);
|
|
4943
4977
|
if (l[0] !== void 0 && l[0].seq !== i + 1) return C(t, n, s);
|
|
4944
|
-
let u = S(a.value), d = u.at(-1)?.seq ?? i, f = [...u, ...l.filter((e) => (e.seq ?? d) > d)], p = y || r() ? 0 : Math.max(f.length -
|
|
4978
|
+
let u = S(a.value), d = u.at(-1)?.seq ?? i, f = [...u, ...l.filter((e) => (e.seq ?? d) > d)], p = y || r() ? 0 : Math.max(f.length - yu, 0);
|
|
4945
4979
|
a.value = [...f.slice(p), ...c.messages.filter((e) => e.queued === !0)], o.value += p;
|
|
4946
4980
|
}
|
|
4947
4981
|
async function D() {
|
|
@@ -4949,7 +4983,7 @@ function uu(e, t, n, r = () => !1) {
|
|
|
4949
4983
|
if (t === void 0 || n === void 0) return;
|
|
4950
4984
|
let r = await e.exec("kvcoder.message.list", {
|
|
4951
4985
|
sessionId: t.sessionId,
|
|
4952
|
-
limit:
|
|
4986
|
+
limit: yu,
|
|
4953
4987
|
beforeSeq: n
|
|
4954
4988
|
});
|
|
4955
4989
|
b(t) && S(a.value)[0]?.seq === n && (a.value = [...r.messages, ...a.value], o.value = r.omitted, y = !0);
|
|
@@ -4984,9 +5018,9 @@ function uu(e, t, n, r = () => !1) {
|
|
|
4984
5018
|
let o = {
|
|
4985
5019
|
session: i,
|
|
4986
5020
|
turn: a?.sessionId === n ? a : void 0,
|
|
4987
|
-
live: f.get(n)?.live ?? v(
|
|
5021
|
+
live: f.get(n)?.live ?? v(_a())
|
|
4988
5022
|
};
|
|
4989
|
-
|
|
5023
|
+
dl(t.workspaceId, n, o.turn === void 0 ? [] : [o.turn]), f.set(n, o), x.update(o.live, i.status === "running" ? i.stepJobId : void 0, () => b(t));
|
|
4990
5024
|
}
|
|
4991
5025
|
}
|
|
4992
5026
|
async function M(t = [], n) {
|
|
@@ -5005,7 +5039,7 @@ function uu(e, t, n, r = () => !1) {
|
|
|
5005
5039
|
e.exec("kvcoder.context.get", { sessionId: r.sessionId })
|
|
5006
5040
|
]);
|
|
5007
5041
|
if (!o() || a.id !== r.sessionId || (i.value !== null && i.value.status !== a.status && e.refresh(), !o())) return;
|
|
5008
|
-
i.value = a, s.value = l, c.value = u,
|
|
5042
|
+
i.value = a, s.value = l, c.value = u, dl(r.workspaceId, a.id, l);
|
|
5009
5043
|
let f = a.status === "running" ? a.stepJobId : void 0;
|
|
5010
5044
|
x.update(d, f, () => b(r), n === void 0 || n === f ? t : []);
|
|
5011
5045
|
let p = j(r, a.status === "waiting" ? l[0] : void 0, o);
|
|
@@ -5025,7 +5059,7 @@ function uu(e, t, n, r = () => !1) {
|
|
|
5025
5059
|
e !== void 0 && !x.busy() && N().catch((t) => {
|
|
5026
5060
|
b(e) && n(t);
|
|
5027
5061
|
});
|
|
5028
|
-
},
|
|
5062
|
+
}, vu);
|
|
5029
5063
|
return g(() => {
|
|
5030
5064
|
_ = !0, p = void 0, m = void 0, x.clear(), clearInterval(F);
|
|
5031
5065
|
}), A([t, () => e.workspace.value.id], () => {
|
|
@@ -5033,7 +5067,7 @@ function uu(e, t, n, r = () => !1) {
|
|
|
5033
5067
|
p = r === void 0 ? void 0 : {
|
|
5034
5068
|
workspaceId: e.workspace.value.id,
|
|
5035
5069
|
sessionId: r
|
|
5036
|
-
}, m = void 0, h = void 0, x.clear(), i.value = null, a.value = [], o.value = 0, s.value = [], c.value = null, l.value = void 0, f.clear(), Object.assign(d,
|
|
5070
|
+
}, m = void 0, h = void 0, x.clear(), i.value = null, a.value = [], o.value = 0, s.value = [], c.value = null, l.value = void 0, f.clear(), Object.assign(d, _a());
|
|
5037
5071
|
let u = p;
|
|
5038
5072
|
u !== void 0 && N().catch((e) => {
|
|
5039
5073
|
b(u) && n(e);
|
|
@@ -5059,7 +5093,7 @@ function uu(e, t, n, r = () => !1) {
|
|
|
5059
5093
|
}
|
|
5060
5094
|
//#endregion
|
|
5061
5095
|
//#region web/src/use-execution-map.ts
|
|
5062
|
-
function
|
|
5096
|
+
function xu(e, n, r, i, a) {
|
|
5063
5097
|
let o = y(null), s = y(!1), c, l, u, d = 0, f = !1;
|
|
5064
5098
|
async function p() {
|
|
5065
5099
|
let t = n();
|
|
@@ -5105,15 +5139,15 @@ function du(e, n, r, i, a) {
|
|
|
5105
5139
|
}
|
|
5106
5140
|
//#endregion
|
|
5107
5141
|
//#region web/src/use-follow-latest.ts
|
|
5108
|
-
var
|
|
5109
|
-
function
|
|
5142
|
+
var Su = 80;
|
|
5143
|
+
function Cu(e, t, n) {
|
|
5110
5144
|
let r = y(!1);
|
|
5111
5145
|
function i() {
|
|
5112
5146
|
e.value !== null && (e.value.scrollTop = e.value.scrollHeight);
|
|
5113
5147
|
}
|
|
5114
5148
|
function a() {
|
|
5115
5149
|
let t = e.value;
|
|
5116
|
-
t !== null && (r.value = t.scrollHeight - t.clientHeight - t.scrollTop >
|
|
5150
|
+
t !== null && (r.value = t.scrollHeight - t.clientHeight - t.scrollTop > Su);
|
|
5117
5151
|
}
|
|
5118
5152
|
function o() {
|
|
5119
5153
|
r.value = !1, i();
|
|
@@ -5130,7 +5164,7 @@ function pu(e, t, n) {
|
|
|
5130
5164
|
}
|
|
5131
5165
|
//#endregion
|
|
5132
5166
|
//#region web/src/use-finished-runs.ts
|
|
5133
|
-
function
|
|
5167
|
+
function wu(e, t, n, r) {
|
|
5134
5168
|
let i = y(/* @__PURE__ */ new Map());
|
|
5135
5169
|
async function a(n) {
|
|
5136
5170
|
try {
|
|
@@ -5144,13 +5178,13 @@ function mu(e, t, n, r) {
|
|
|
5144
5178
|
r(e);
|
|
5145
5179
|
}
|
|
5146
5180
|
}
|
|
5147
|
-
return A(() => [t(), n.value.flatMap((e) =>
|
|
5181
|
+
return A(() => [t(), n.value.flatMap((e) => qa(e) ?? []).join(" ")], ([e, t], n) => {
|
|
5148
5182
|
e !== n?.[0] && (i.value = /* @__PURE__ */ new Map()), e !== void 0 && t !== "" && a(e);
|
|
5149
5183
|
}, { immediate: !0 }), i;
|
|
5150
5184
|
}
|
|
5151
5185
|
//#endregion
|
|
5152
5186
|
//#region web/src/use-slash-commands.ts
|
|
5153
|
-
function
|
|
5187
|
+
function Tu(e) {
|
|
5154
5188
|
let t = T([]);
|
|
5155
5189
|
return h(async () => {
|
|
5156
5190
|
try {
|
|
@@ -5162,7 +5196,7 @@ function hu(e) {
|
|
|
5162
5196
|
}
|
|
5163
5197
|
//#endregion
|
|
5164
5198
|
//#region web/src/use-workspace-session.ts
|
|
5165
|
-
function
|
|
5199
|
+
function Eu(e, n, r) {
|
|
5166
5200
|
let i = T(e.workspace.value.id);
|
|
5167
5201
|
async function a(t) {
|
|
5168
5202
|
let n;
|
|
@@ -5173,51 +5207,64 @@ function gu(e, n, r) {
|
|
|
5173
5207
|
}
|
|
5174
5208
|
e.workspace.value.id === t && (n === void 0 ? e.navigate("kvcoder.chat") : e.navigate("kvcoder.session", { sessionId: n }));
|
|
5175
5209
|
}
|
|
5176
|
-
|
|
5210
|
+
A(n, () => {
|
|
5177
5211
|
i.value = e.workspace.value.id;
|
|
5178
5212
|
}), A(() => e.workspace.value.id, (e) => {
|
|
5179
5213
|
n() === void 0 ? i.value = e : a(e);
|
|
5180
|
-
})
|
|
5214
|
+
});
|
|
5215
|
+
let o;
|
|
5216
|
+
function s(t) {
|
|
5217
|
+
let i = n();
|
|
5218
|
+
if (i === void 0 || qe(t)?.code !== "kvcoder/SESSION_NOT_FOUND") {
|
|
5219
|
+
r(t);
|
|
5220
|
+
return;
|
|
5221
|
+
}
|
|
5222
|
+
o !== i && (o = i, e.toast("kvcoder.ui.chatNotHere"), a(e.workspace.value.id));
|
|
5223
|
+
}
|
|
5224
|
+
return {
|
|
5225
|
+
id: t(() => i.value === e.workspace.value.id ? n() : void 0),
|
|
5226
|
+
failed: s
|
|
5227
|
+
};
|
|
5181
5228
|
}
|
|
5182
5229
|
//#endregion
|
|
5183
5230
|
//#region web/src/ConversationView.vue?vue&type=script&setup=true&lang.ts
|
|
5184
|
-
var
|
|
5231
|
+
var Du = { class: "kvc-workspace" }, Ou = { class: "kvc-stage" }, ku = {
|
|
5185
5232
|
class: "kvc-conversation",
|
|
5186
5233
|
"data-test": "conversation"
|
|
5187
|
-
},
|
|
5234
|
+
}, Au = {
|
|
5188
5235
|
key: 0,
|
|
5189
5236
|
class: "kvc-start",
|
|
5190
5237
|
role: "alert",
|
|
5191
5238
|
"data-test": "load-failure"
|
|
5192
|
-
},
|
|
5239
|
+
}, ju = { class: "kvc-start-note" }, Mu = {
|
|
5193
5240
|
class: "kvc-actions",
|
|
5194
5241
|
style: { "justify-content": "center" }
|
|
5195
|
-
},
|
|
5242
|
+
}, Nu = {
|
|
5196
5243
|
key: 1,
|
|
5197
5244
|
class: "kvc-scrollport"
|
|
5198
|
-
},
|
|
5245
|
+
}, Pu = {
|
|
5199
5246
|
key: 1,
|
|
5200
5247
|
class: "kvc-column"
|
|
5201
|
-
},
|
|
5248
|
+
}, Fu = {
|
|
5202
5249
|
key: 0,
|
|
5203
5250
|
class: "kvc-actions",
|
|
5204
5251
|
style: { "justify-content": "center" }
|
|
5205
|
-
},
|
|
5252
|
+
}, Iu = ["title"], Lu = {
|
|
5206
5253
|
key: 1,
|
|
5207
5254
|
class: "kvc-notice",
|
|
5208
5255
|
"data-test": "map-remaining"
|
|
5209
|
-
},
|
|
5256
|
+
}, Ru = {
|
|
5210
5257
|
key: 3,
|
|
5211
5258
|
class: "kvc-notice",
|
|
5212
5259
|
"data-test": "summarizing"
|
|
5213
|
-
},
|
|
5260
|
+
}, zu = {
|
|
5214
5261
|
key: 4,
|
|
5215
5262
|
class: "kvc-answer",
|
|
5216
5263
|
"data-test": "live-answer"
|
|
5217
|
-
},
|
|
5264
|
+
}, Bu = ["open"], Vu = { class: "kvc-muted" }, Hu = {
|
|
5218
5265
|
class: "kvc-muted",
|
|
5219
5266
|
style: { "white-space": "pre-wrap" }
|
|
5220
|
-
},
|
|
5267
|
+
}, Uu = {
|
|
5221
5268
|
key: 7,
|
|
5222
5269
|
class: "kvc-muted",
|
|
5223
5270
|
style: {
|
|
@@ -5225,20 +5272,20 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
|
|
|
5225
5272
|
margin: "0"
|
|
5226
5273
|
},
|
|
5227
5274
|
"data-test": "waiting-hint"
|
|
5228
|
-
},
|
|
5275
|
+
}, Wu = /* @__PURE__ */ c({
|
|
5229
5276
|
__name: "ConversationView",
|
|
5230
5277
|
props: { sessionId: {} },
|
|
5231
5278
|
setup(c) {
|
|
5232
|
-
let l = c, u = K(), f =
|
|
5279
|
+
let l = c, u = K(), { id: f, failed: p } = Eu(u, () => l.sessionId, (e) => J(u, e)), m = y("chat"), h = y(!1), g = bu(u, () => f.value, p, () => h.value), { session: v, messages: x, omitted: S, turns: w, live: T, children: k } = g, M = gu(u, () => f.value, () => v.value?.updatedAt, p), N = xu(u, () => f.value, () => v.value?.updatedAt, M, p), P = t(() => N.shown.value || M.open.value && M.shown.value !== void 0), F = t(() => v.value?.status === "idle" ? N.counts.value?.left ?? 0 : 0), I = t(() => Pa(x.value)), L = wu(u, () => f.value, x, p), ee = /* @__PURE__ */ new Set([
|
|
5233
5280
|
"STEP_FAILED",
|
|
5234
5281
|
"REPLY_LOST",
|
|
5235
5282
|
"REPLY_INCOMPLETE",
|
|
5236
5283
|
"INTERRUPTED"
|
|
5237
|
-
]), R = t(() =>
|
|
5284
|
+
]), R = t(() => v.value?.status === "running"), z = t(() => R.value && w.value[0]?.outcome === void 0 ? w.value[0]?.startedAt : void 0), B = t(() => v.value?.status === "waiting" ? w.value[0]?.pending ?? [] : []), V = t(() => {
|
|
5238
5285
|
let e = /* @__PURE__ */ new Map();
|
|
5239
|
-
for (let t of
|
|
5286
|
+
for (let t of x.value) (t.kind === "assistant" || t.kind === "toolResult") && t.turnId !== void 0 && e.set(t.turnId, t.id);
|
|
5240
5287
|
let t = /* @__PURE__ */ new Map();
|
|
5241
|
-
for (let n of
|
|
5288
|
+
for (let n of w.value) {
|
|
5242
5289
|
let r = e.get(n.id);
|
|
5243
5290
|
r !== void 0 && n.outcome !== void 0 && t.set(r, {
|
|
5244
5291
|
text: ot(u.t, n.usage, n.durationMs),
|
|
@@ -5257,77 +5304,81 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
|
|
|
5257
5304
|
sendId: n
|
|
5258
5305
|
});
|
|
5259
5306
|
}) && f.value === t) try {
|
|
5260
|
-
G.resume(), await
|
|
5307
|
+
G.resume(), await g.refresh();
|
|
5261
5308
|
} catch (e) {
|
|
5262
5309
|
J(u, e);
|
|
5263
5310
|
}
|
|
5264
5311
|
}
|
|
5265
|
-
let ne = t(() =>
|
|
5266
|
-
async function
|
|
5267
|
-
let e = f.value, t =
|
|
5268
|
-
if (e !== void 0 &&
|
|
5269
|
-
|
|
5312
|
+
let ne = t(() => v.value?.status === "running" || v.value?.status === "waiting"), H = y(), ie = y();
|
|
5313
|
+
async function ae() {
|
|
5314
|
+
let e = f.value, t = w.value[0]?.id;
|
|
5315
|
+
if (e !== void 0 && H.value !== e) {
|
|
5316
|
+
H.value = e, ie.value = void 0;
|
|
5270
5317
|
try {
|
|
5271
5318
|
await u.exec("kvcoder.turn.cancel", {
|
|
5272
5319
|
sessionId: e,
|
|
5273
5320
|
...t === void 0 ? {} : { turnId: t }
|
|
5274
|
-
}), f.value === e && await
|
|
5321
|
+
}), f.value === e && await g.refresh();
|
|
5275
5322
|
} catch (t) {
|
|
5276
|
-
f.value === e && (
|
|
5323
|
+
f.value === e && (ie.value = {
|
|
5277
5324
|
sessionId: e,
|
|
5278
5325
|
error: t
|
|
5279
5326
|
});
|
|
5280
5327
|
} finally {
|
|
5281
|
-
|
|
5328
|
+
H.value === e && (H.value = void 0);
|
|
5282
5329
|
}
|
|
5283
5330
|
}
|
|
5284
5331
|
}
|
|
5285
|
-
let
|
|
5286
|
-
...
|
|
5332
|
+
let oe = y(0), se = t(() => [
|
|
5333
|
+
...de.value.some((e) => e.kind !== "subagent" && e.kind !== "worker") ? [u.t("kvcoder.ui.messageDismisses")] : [],
|
|
5287
5334
|
u.t("kvcoder.ui.stopEnds"),
|
|
5288
|
-
...
|
|
5289
|
-
].join(" ")),
|
|
5290
|
-
sessionId:
|
|
5291
|
-
turnId:
|
|
5292
|
-
}, U =
|
|
5293
|
-
let t =
|
|
5335
|
+
...oe.value > 0 ? [u.t("kvcoder.ui.stopKeepsBackground")] : []
|
|
5336
|
+
].join(" ")), ce = () => v.value === null || w.value[0] === void 0 ? void 0 : {
|
|
5337
|
+
sessionId: v.value.id,
|
|
5338
|
+
turnId: w.value[0].id
|
|
5339
|
+
}, U = mu(u, (e) => g.refresh(e), ce), le = t(() => new Map(B.value.flatMap((e) => {
|
|
5340
|
+
let t = I.value.get(e.toolCallId)?.fields?.task;
|
|
5294
5341
|
return typeof e.childSessionId == "string" && typeof t == "string" ? [[e.childSessionId, t]] : [];
|
|
5295
|
-
}))),
|
|
5296
|
-
let e =
|
|
5297
|
-
return
|
|
5298
|
-
}),
|
|
5299
|
-
|
|
5342
|
+
}))), ue = t(() => B.value.flatMap((e) => e.kind === "worker" && e.runId !== void 0 ? [e.runId] : [])), de = t(() => B.value.filter((e) => e.questionId === null || !U.hidden.value.has(String(e.questionId)))), fe = t(() => {
|
|
5343
|
+
let e = x.value.at(-1);
|
|
5344
|
+
return v.value?.status === "idle" && e?.kind === "notice" && ee.has(String(e.content.code));
|
|
5345
|
+
}), pe = Tu(u), W = Jl(u, () => f.value ?? "", () => g.refresh());
|
|
5346
|
+
A(() => g.loadFailure.value, (e) => {
|
|
5347
|
+
qe(e)?.code === "kvcoder/SESSION_NOT_FOUND" && p(e);
|
|
5348
|
+
});
|
|
5349
|
+
let me = t(() => {
|
|
5350
|
+
let e = qe(g.loadFailure.value);
|
|
5300
5351
|
return e === void 0 ? u.t("kvcoder.ui.failed") : u.t(Ke(e.code), e.params);
|
|
5301
|
-
}),
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5352
|
+
}), he = O("list"), G = Cu(he, () => [
|
|
5353
|
+
x.value,
|
|
5354
|
+
T.text,
|
|
5355
|
+
T.thinking,
|
|
5356
|
+
T.calls.length,
|
|
5357
|
+
T.summarizing,
|
|
5307
5358
|
R.value,
|
|
5308
|
-
|
|
5309
|
-
|
|
5359
|
+
B.value,
|
|
5360
|
+
k.size,
|
|
5310
5361
|
U.hidden.value,
|
|
5311
5362
|
W.working.value
|
|
5312
5363
|
], () => f.value);
|
|
5313
|
-
A(G.away, (e) =>
|
|
5314
|
-
async function
|
|
5315
|
-
let e =
|
|
5364
|
+
A(G.away, (e) => h.value = e);
|
|
5365
|
+
async function ge() {
|
|
5366
|
+
let e = he.value, t = e === null ? 0 : e.scrollHeight - e.scrollTop;
|
|
5316
5367
|
try {
|
|
5317
|
-
await
|
|
5368
|
+
await g.showEarlier(), await d(), e !== null && (e.scrollTop = e.scrollHeight - t);
|
|
5318
5369
|
} catch (e) {
|
|
5319
5370
|
J(u, e);
|
|
5320
5371
|
}
|
|
5321
5372
|
}
|
|
5322
|
-
async function
|
|
5373
|
+
async function _e() {
|
|
5323
5374
|
try {
|
|
5324
|
-
await
|
|
5375
|
+
await g.showLatest();
|
|
5325
5376
|
} catch (e) {
|
|
5326
5377
|
J(u, e);
|
|
5327
5378
|
}
|
|
5328
5379
|
G.resume();
|
|
5329
5380
|
}
|
|
5330
|
-
async function
|
|
5381
|
+
async function ve() {
|
|
5331
5382
|
if (f.value !== void 0) try {
|
|
5332
5383
|
let { fileId: e } = await u.exec("kvcoder.session.export", { sessionId: f.value });
|
|
5333
5384
|
window.location.assign(`/api/files/${encodeURIComponent(e)}?workspaceId=${encodeURIComponent(u.workspace.value.id)}`);
|
|
@@ -5335,44 +5386,44 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
|
|
|
5335
5386
|
J(u, e);
|
|
5336
5387
|
}
|
|
5337
5388
|
}
|
|
5338
|
-
let
|
|
5339
|
-
async function
|
|
5389
|
+
let ye = () => x.value.at(-1)?.kind === "notice" && x.value.at(-1)?.content.code === "SUMMARY_FAILED";
|
|
5390
|
+
async function be() {
|
|
5340
5391
|
return (await u.exec("kernel.settings.list", {})).find((e) => e.key === "kvcoder.compactKeep")?.value ?? null;
|
|
5341
5392
|
}
|
|
5342
|
-
async function
|
|
5393
|
+
async function xe() {
|
|
5343
5394
|
let e = await W.compact();
|
|
5344
|
-
e === !0 ? u.toast("kvcoder.ui.summarized", {}, "success") : e === !1 && !
|
|
5395
|
+
e === !0 ? u.toast("kvcoder.ui.summarized", {}, "success") : e === !1 && !ye() && u.toast("kvcoder.ui.nothingToSummarize", { count: await be() });
|
|
5345
5396
|
}
|
|
5346
|
-
function
|
|
5397
|
+
function Se(e, t) {
|
|
5347
5398
|
if (e === "new") return u.navigate("kvcoder.chat");
|
|
5348
|
-
if (e === "prompt") return void (
|
|
5399
|
+
if (e === "prompt") return void (m.value = m.value === "prompt" ? "chat" : "prompt");
|
|
5349
5400
|
if (e === "delete") return void W.remove();
|
|
5350
|
-
W.working.value === void 0 && (
|
|
5401
|
+
W.working.value === void 0 && (m.value = "chat", e === "rename" ? W.rename(t) : e === "compact" ? xe() : e === "export" ? W.exportFile() : W.fork());
|
|
5351
5402
|
}
|
|
5352
|
-
async function
|
|
5353
|
-
W.working.value === void 0 && (
|
|
5403
|
+
async function Ce(e, t) {
|
|
5404
|
+
W.working.value === void 0 && (m.value = "chat", await W.runRegistered(e, t) && e.message !== void 0 && await te({
|
|
5354
5405
|
text: t === "" ? u.t(e.message) : t,
|
|
5355
5406
|
fileIds: []
|
|
5356
5407
|
}));
|
|
5357
5408
|
}
|
|
5358
|
-
let
|
|
5359
|
-
return (t, c) => (_(), i("div",
|
|
5409
|
+
let we = (e) => e.id;
|
|
5410
|
+
return (t, c) => (_(), i("div", Du, [D(v) && D(f) !== void 0 ? (_(), n(sa, {
|
|
5360
5411
|
key: 0,
|
|
5361
|
-
session: D(
|
|
5362
|
-
tab:
|
|
5363
|
-
turns: D(
|
|
5364
|
-
context: D(
|
|
5365
|
-
"running-since":
|
|
5366
|
-
artifacts: D(
|
|
5367
|
-
"artifacts-open": D(
|
|
5368
|
-
map: D(
|
|
5369
|
-
"map-open": D(
|
|
5412
|
+
session: D(v),
|
|
5413
|
+
tab: m.value,
|
|
5414
|
+
turns: D(w).length,
|
|
5415
|
+
context: D(g).context.value,
|
|
5416
|
+
"running-since": z.value,
|
|
5417
|
+
artifacts: D(M).list.value.length,
|
|
5418
|
+
"artifacts-open": D(M).open.value && !D(N).shown.value,
|
|
5419
|
+
map: D(N).counts.value,
|
|
5420
|
+
"map-open": D(N).shown.value,
|
|
5370
5421
|
working: D(W).working.value !== void 0,
|
|
5371
|
-
onTab: c[0] ||= (e) =>
|
|
5372
|
-
onAction:
|
|
5373
|
-
onToggleArtifacts: c[1] ||= (e) => D(
|
|
5374
|
-
onToggleMap: c[2] ||= (e) => D(
|
|
5375
|
-
onBackgroundRunning: c[3] ||= (e) =>
|
|
5422
|
+
onTab: c[0] ||= (e) => m.value = e,
|
|
5423
|
+
onAction: Se,
|
|
5424
|
+
onToggleArtifacts: c[1] ||= (e) => D(N).toggleArtifacts(),
|
|
5425
|
+
onToggleMap: c[2] ||= (e) => D(N).toggle(),
|
|
5426
|
+
onBackgroundRunning: c[3] ||= (e) => oe.value = e
|
|
5376
5427
|
}, null, 8, [
|
|
5377
5428
|
"session",
|
|
5378
5429
|
"tab",
|
|
@@ -5384,84 +5435,84 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
|
|
|
5384
5435
|
"map",
|
|
5385
5436
|
"map-open",
|
|
5386
5437
|
"working"
|
|
5387
|
-
])) : r("v-if", !0), a("div",
|
|
5438
|
+
])) : r("v-if", !0), a("div", Ou, [a("section", ku, [l.sessionId === void 0 ? (_(), n(di, {
|
|
5388
5439
|
key: 0,
|
|
5389
|
-
registered: D(
|
|
5390
|
-
}, null, 8, ["registered"])) : D(
|
|
5440
|
+
registered: D(pe)
|
|
5441
|
+
}, null, 8, ["registered"])) : D(v) && D(f) !== void 0 ? (_(), i(e, { key: 1 }, [D(g).loadFailure.value === void 0 ? (_(), i("div", Nu, [a("div", {
|
|
5391
5442
|
ref_key: "list",
|
|
5392
|
-
ref:
|
|
5443
|
+
ref: he,
|
|
5393
5444
|
class: "kvc-scroll",
|
|
5394
5445
|
onScroll: c[10] ||= (...e) => D(G).onScroll && D(G).onScroll(...e)
|
|
5395
|
-
}, [
|
|
5446
|
+
}, [m.value === "prompt" ? (_(), n(ql, {
|
|
5396
5447
|
key: 0,
|
|
5397
|
-
"session-id": D(
|
|
5398
|
-
onBack: c[6] ||= (e) =>
|
|
5399
|
-
}, null, 8, ["session-id"])) : (_(), i("div",
|
|
5400
|
-
D(
|
|
5448
|
+
"session-id": D(v).id,
|
|
5449
|
+
onBack: c[6] ||= (e) => m.value = "chat"
|
|
5450
|
+
}, null, 8, ["session-id"])) : (_(), i("div", Pu, [
|
|
5451
|
+
D(S) > 0 ? (_(), i("div", Fu, [a("button", {
|
|
5401
5452
|
type: "button",
|
|
5402
5453
|
class: "kvc-button",
|
|
5403
5454
|
"data-test": "show-earlier",
|
|
5404
|
-
onClick:
|
|
5405
|
-
}, E(D(u).t("kvcoder.ui.showEarlier", { count: Math.min(D(
|
|
5455
|
+
onClick: ge
|
|
5456
|
+
}, E(D(u).t("kvcoder.ui.showEarlier", { count: Math.min(D(S), 200) })), 1), a("button", {
|
|
5406
5457
|
type: "button",
|
|
5407
5458
|
class: "kvc-button",
|
|
5408
5459
|
"data-test": "earlier",
|
|
5409
|
-
onClick:
|
|
5410
|
-
}, E(D(u).t("kvcoder.ui.earlierMessages", { count: D(
|
|
5411
|
-
(_(!0), i(e, null, b(D(
|
|
5460
|
+
onClick: ve
|
|
5461
|
+
}, E(D(u).t("kvcoder.ui.earlierMessages", { count: D(S) })), 1)])) : r("v-if", !0),
|
|
5462
|
+
(_(!0), i(e, null, b(D(x), (t) => (_(), i(e, { key: we(t) }, [s(Gc, {
|
|
5412
5463
|
message: t,
|
|
5413
|
-
calls:
|
|
5414
|
-
"finished-runs": D(
|
|
5415
|
-
onOpenArtifact: c[7] ||= (e) => D(
|
|
5464
|
+
calls: I.value,
|
|
5465
|
+
"finished-runs": D(L),
|
|
5466
|
+
onOpenArtifact: c[7] ||= (e) => D(N).selectArtifact(e)
|
|
5416
5467
|
}, null, 8, [
|
|
5417
5468
|
"message",
|
|
5418
5469
|
"calls",
|
|
5419
5470
|
"finished-runs"
|
|
5420
|
-
]),
|
|
5471
|
+
]), V.value.has(t.id) ? (_(), i("span", {
|
|
5421
5472
|
key: 0,
|
|
5422
5473
|
class: "kvc-muted",
|
|
5423
|
-
title:
|
|
5474
|
+
title: V.value.get(t.id)?.tokens,
|
|
5424
5475
|
"data-test": "turn-totals"
|
|
5425
|
-
}, E(
|
|
5426
|
-
|
|
5476
|
+
}, E(V.value.get(t.id)?.text), 9, Iu)) : r("v-if", !0)], 64))), 128)),
|
|
5477
|
+
F.value > 0 ? (_(), i("div", Lu, [o(E(D(u).t("kvcoder.ui.map.remaining", { count: F.value })) + " ", 1), a("button", {
|
|
5427
5478
|
type: "button",
|
|
5428
5479
|
class: "kvc-link-button",
|
|
5429
5480
|
"data-test": "map-show",
|
|
5430
|
-
onClick: c[8] ||= (e) => D(
|
|
5481
|
+
onClick: c[8] ||= (e) => D(N).shown.value = !0
|
|
5431
5482
|
}, E(D(u).t("kvcoder.ui.map.show")), 1)])) : r("v-if", !0),
|
|
5432
|
-
|
|
5483
|
+
fe.value ? (_(), n(Bl, {
|
|
5433
5484
|
key: 2,
|
|
5434
|
-
"session-id": D(
|
|
5485
|
+
"session-id": D(v).id,
|
|
5435
5486
|
onSent: c[9] ||= (e) => {
|
|
5436
|
-
D(G).resume(), D(
|
|
5487
|
+
D(G).resume(), D(g).refresh();
|
|
5437
5488
|
}
|
|
5438
5489
|
}, null, 8, ["session-id"])) : r("v-if", !0),
|
|
5439
|
-
D(
|
|
5440
|
-
R.value && (D(
|
|
5490
|
+
D(T).summarizing ? (_(), i("div", Ru, E(D(u).t("kvcoder.ui.summarizing")), 1)) : r("v-if", !0),
|
|
5491
|
+
R.value && (D(T).text !== "" || D(T).thinking !== "") ? (_(), i("div", zu, [D(T).thinking === "" ? r("v-if", !0) : (_(), i("details", {
|
|
5441
5492
|
key: 0,
|
|
5442
|
-
open: D(
|
|
5493
|
+
open: D(T).text === "" && D(T).calls.length === 0,
|
|
5443
5494
|
"data-test": "live-thinking"
|
|
5444
|
-
}, [a("summary",
|
|
5495
|
+
}, [a("summary", Vu, E(D(u).t("kvcoder.ui.thinkingNow")), 1), a("p", Hu, E(D(T).thinking), 1)], 8, Bu)), D(T).text === "" ? r("v-if", !0) : (_(), n(C(D(u).View), {
|
|
5445
5496
|
key: 1,
|
|
5446
5497
|
view: {
|
|
5447
5498
|
type: "markdown",
|
|
5448
5499
|
text: "kvcoder.markdown",
|
|
5449
|
-
params: { text: D(
|
|
5500
|
+
params: { text: D(T).text }
|
|
5450
5501
|
}
|
|
5451
5502
|
}, null, 8, ["view"]))])) : r("v-if", !0),
|
|
5452
|
-
R.value ? (_(), n(
|
|
5503
|
+
R.value ? (_(), n(Aa, {
|
|
5453
5504
|
key: 5,
|
|
5454
|
-
live: D(
|
|
5455
|
-
turn: D(
|
|
5505
|
+
live: D(T),
|
|
5506
|
+
turn: D(w)[0]
|
|
5456
5507
|
}, null, 8, ["live", "turn"])) : r("v-if", !0),
|
|
5457
|
-
D(W).working.value ? (_(), n(
|
|
5508
|
+
D(W).working.value ? (_(), n(_i, {
|
|
5458
5509
|
key: 6,
|
|
5459
5510
|
working: D(W).working.value
|
|
5460
5511
|
}, null, 8, ["working"])) : r("v-if", !0),
|
|
5461
|
-
(_(!0), i(e, null, b(D(
|
|
5512
|
+
(_(!0), i(e, null, b(D(k), ([e, t]) => (_(), n(au, {
|
|
5462
5513
|
key: e,
|
|
5463
5514
|
child: t,
|
|
5464
|
-
task:
|
|
5515
|
+
task: le.value.get(e),
|
|
5465
5516
|
hidden: D(U).hidden.value,
|
|
5466
5517
|
onAnswer: D(U).answer,
|
|
5467
5518
|
onDecide: D(U).decide
|
|
@@ -5472,14 +5523,14 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
|
|
|
5472
5523
|
"onAnswer",
|
|
5473
5524
|
"onDecide"
|
|
5474
5525
|
]))), 128)),
|
|
5475
|
-
(_(!0), i(e, null, b(
|
|
5526
|
+
(_(!0), i(e, null, b(ue.value, (e) => (_(), n(fu, {
|
|
5476
5527
|
key: e,
|
|
5477
|
-
"session-id": D(
|
|
5528
|
+
"session-id": D(v).id,
|
|
5478
5529
|
"run-id": e
|
|
5479
5530
|
}, null, 8, ["session-id", "run-id"]))), 128)),
|
|
5480
|
-
s(
|
|
5481
|
-
owner:
|
|
5482
|
-
pending:
|
|
5531
|
+
s(Fl, {
|
|
5532
|
+
owner: ce(),
|
|
5533
|
+
pending: B.value,
|
|
5483
5534
|
hidden: D(U).hidden.value,
|
|
5484
5535
|
onAnswer: D(U).answer,
|
|
5485
5536
|
onDecide: D(U).decide
|
|
@@ -5490,43 +5541,43 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
|
|
|
5490
5541
|
"onAnswer",
|
|
5491
5542
|
"onDecide"
|
|
5492
5543
|
]),
|
|
5493
|
-
|
|
5544
|
+
B.value.length > 0 ? (_(), i("p", Uu, E(se.value), 1)) : r("v-if", !0)
|
|
5494
5545
|
]))], 544), D(G).away.value ? (_(), i("button", {
|
|
5495
5546
|
key: 0,
|
|
5496
5547
|
type: "button",
|
|
5497
5548
|
class: "kvc-button kvc-jump",
|
|
5498
5549
|
"data-test": "jump-to-latest",
|
|
5499
|
-
onClick:
|
|
5550
|
+
onClick: _e
|
|
5500
5551
|
}, [s(D(re), {
|
|
5501
5552
|
size: 16,
|
|
5502
5553
|
"aria-hidden": "true"
|
|
5503
|
-
}), o(E(D(u).t("kvcoder.ui.jumpToLatest")), 1)])) : r("v-if", !0)])) : (_(), i("div",
|
|
5554
|
+
}), o(E(D(u).t("kvcoder.ui.jumpToLatest")), 1)])) : r("v-if", !0)])) : (_(), i("div", Au, [a("p", ju, E(D(u).t("kvcoder.ui.loadFailed", { error: me.value })), 1), a("div", Mu, [a("button", {
|
|
5504
5555
|
type: "button",
|
|
5505
5556
|
class: "kvc-button kvc-primary",
|
|
5506
5557
|
"data-test": "load-again",
|
|
5507
|
-
onClick: c[4] ||= (e) => D(
|
|
5558
|
+
onClick: c[4] ||= (e) => D(g).refresh()
|
|
5508
5559
|
}, E(D(u).t("kvcoder.ui.tryAgain")), 1), a("button", {
|
|
5509
5560
|
type: "button",
|
|
5510
5561
|
class: "kvc-button",
|
|
5511
5562
|
"data-test": "load-export",
|
|
5512
5563
|
onClick: c[5] ||= (e) => D(W).exportFile()
|
|
5513
5564
|
}, E(D(u).t("kvcoder.ui.export")), 1)])])), s(kr, {
|
|
5514
|
-
"session-id": D(
|
|
5565
|
+
"session-id": D(v).id,
|
|
5515
5566
|
stoppable: ne.value,
|
|
5516
|
-
stopping:
|
|
5517
|
-
"stop-error":
|
|
5567
|
+
stopping: H.value === D(v).id,
|
|
5568
|
+
"stop-error": ie.value?.sessionId === D(v).id ? ie.value.error : void 0,
|
|
5518
5569
|
placeholder: D(u).t("kvcoder.ui.placeholder"),
|
|
5519
5570
|
blocked: D(W).working.value !== void 0,
|
|
5520
5571
|
commands: "run",
|
|
5521
|
-
registered: D(
|
|
5572
|
+
registered: D(pe),
|
|
5522
5573
|
onSend: te,
|
|
5523
|
-
onStop:
|
|
5524
|
-
onCommand:
|
|
5525
|
-
onRegistered:
|
|
5574
|
+
onStop: ae,
|
|
5575
|
+
onCommand: Se,
|
|
5576
|
+
onRegistered: Ce
|
|
5526
5577
|
}, {
|
|
5527
|
-
controls: j(() => [s(
|
|
5528
|
-
session: D(
|
|
5529
|
-
onChanged: c[11] ||= (e) => D(
|
|
5578
|
+
controls: j(() => [s(Yl, {
|
|
5579
|
+
session: D(v),
|
|
5580
|
+
onChanged: c[11] ||= (e) => D(g).refresh()
|
|
5530
5581
|
}, null, 8, ["session"])]),
|
|
5531
5582
|
_: 1
|
|
5532
5583
|
}, 8, [
|
|
@@ -5537,16 +5588,16 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
|
|
|
5537
5588
|
"placeholder",
|
|
5538
5589
|
"blocked",
|
|
5539
5590
|
"registered"
|
|
5540
|
-
])], 64)) : r("v-if", !0)]),
|
|
5591
|
+
])], 64)) : r("v-if", !0)]), P.value ? (_(), n($n, {
|
|
5541
5592
|
key: 0,
|
|
5542
|
-
list: D(
|
|
5543
|
-
shown: D(
|
|
5544
|
-
content: D(
|
|
5545
|
-
map: D(
|
|
5546
|
-
"map-shown": D(
|
|
5547
|
-
onSelect: c[12] ||= (e) => D(
|
|
5548
|
-
onSelectMap: c[13] ||= (e) => D(
|
|
5549
|
-
onClose: c[14] ||= (e) => D(
|
|
5593
|
+
list: D(M).list.value,
|
|
5594
|
+
shown: D(M).shown.value,
|
|
5595
|
+
content: D(M).content.value,
|
|
5596
|
+
map: D(N).map.value,
|
|
5597
|
+
"map-shown": D(N).shown.value,
|
|
5598
|
+
onSelect: c[12] ||= (e) => D(N).selectArtifact(e),
|
|
5599
|
+
onSelectMap: c[13] ||= (e) => D(N).shown.value = !0,
|
|
5600
|
+
onClose: c[14] ||= (e) => D(N).close()
|
|
5550
5601
|
}, null, 8, [
|
|
5551
5602
|
"list",
|
|
5552
5603
|
"shown",
|
|
@@ -5555,13 +5606,13 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
|
|
|
5555
5606
|
"map-shown"
|
|
5556
5607
|
])) : r("v-if", !0)])]));
|
|
5557
5608
|
}
|
|
5558
|
-
}),
|
|
5609
|
+
}), Gu = /* @__PURE__ */ c({
|
|
5559
5610
|
__name: "conversation",
|
|
5560
5611
|
props: { sessionId: {} },
|
|
5561
5612
|
setup(e) {
|
|
5562
5613
|
let t = e;
|
|
5563
|
-
return (e, r) => (_(), n(
|
|
5614
|
+
return (e, r) => (_(), n(Wu, { "session-id": t.sessionId }, null, 8, ["session-id"]));
|
|
5564
5615
|
}
|
|
5565
5616
|
});
|
|
5566
5617
|
//#endregion
|
|
5567
|
-
export {
|
|
5618
|
+
export { Gu as default };
|