@kvman/kvcoder 0.1.8 → 0.1.10

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.
Files changed (61) hide show
  1. package/dist/api.d.ts +38 -0
  2. package/dist/api.d.ts.map +1 -1
  3. package/dist/connectors/artifact.d.ts.map +1 -1
  4. package/dist/connectors/artifact.js +3 -1
  5. package/dist/connectors/artifact.js.map +1 -1
  6. package/dist/connectors/execution-map.d.ts +1 -1
  7. package/dist/connectors/execution-map.d.ts.map +1 -1
  8. package/dist/connectors/execution-map.js +1 -1
  9. package/dist/connectors/execution-map.js.map +1 -1
  10. package/dist/prompt/build-prompt.d.ts +6 -1
  11. package/dist/prompt/build-prompt.d.ts.map +1 -1
  12. package/dist/prompt/build-prompt.js +2 -2
  13. package/dist/prompt/build-prompt.js.map +1 -1
  14. package/dist/prompt/session-grants.d.ts +2 -0
  15. package/dist/prompt/session-grants.d.ts.map +1 -1
  16. package/dist/prompt/session-prompt.d.ts.map +1 -1
  17. package/dist/prompt/session-prompt.js +9 -4
  18. package/dist/prompt/session-prompt.js.map +1 -1
  19. package/dist/prompt/working-method.d.ts +6 -4
  20. package/dist/prompt/working-method.d.ts.map +1 -1
  21. package/dist/prompt/working-method.js +26 -11
  22. package/dist/prompt/working-method.js.map +1 -1
  23. package/dist/register-settings.d.ts +15 -1
  24. package/dist/register-settings.d.ts.map +1 -1
  25. package/dist/register-settings.js +19 -2
  26. package/dist/register-settings.js.map +1 -1
  27. package/dist/registry/register-connectors.d.ts +2 -0
  28. package/dist/registry/register-connectors.d.ts.map +1 -1
  29. package/dist/registry/register-connectors.js +15 -11
  30. package/dist/registry/register-connectors.js.map +1 -1
  31. package/dist/schemas/registry.d.ts +9 -1
  32. package/dist/schemas/registry.d.ts.map +1 -1
  33. package/dist/schemas/registry.js +6 -2
  34. package/dist/schemas/registry.js.map +1 -1
  35. package/dist/store/collections.d.ts +4 -0
  36. package/dist/store/collections.d.ts.map +1 -1
  37. package/dist/turns/read-only.d.ts +7 -2
  38. package/dist/turns/read-only.d.ts.map +1 -1
  39. package/dist/turns/read-only.js +7 -4
  40. package/dist/turns/read-only.js.map +1 -1
  41. package/dist/turns/run-calls.js +1 -1
  42. package/dist/turns/run-calls.js.map +1 -1
  43. package/dist/turns/run-command.d.ts +2 -0
  44. package/dist/turns/run-command.d.ts.map +1 -1
  45. package/dist/turns/run-command.js +4 -2
  46. package/dist/turns/run-command.js.map +1 -1
  47. package/dist/web/components/approval.css +1 -1
  48. package/dist/web/components/approval.js +18 -31
  49. package/dist/web/components/call.css +1 -1
  50. package/dist/web/components/connectors.css +1 -1
  51. package/dist/web/components/conversation.css +1 -1
  52. package/dist/web/components/conversation.js +898 -879
  53. package/dist/web/components/mcp-sign-in.css +1 -1
  54. package/dist/web/components/model.css +1 -1
  55. package/dist/web/components/question.css +1 -1
  56. package/dist/web/components/sessions.css +1 -1
  57. package/docs/connectors.md +12 -0
  58. package/docs/sections.md +2 -0
  59. package/locales/ar.json +8 -1
  60. package/locales/en.json +8 -1
  61. package/package.json +4 -4
@@ -16,7 +16,7 @@ var F = {
16
16
  function L(e) {
17
17
  return e != null;
18
18
  }
19
- function R(e, t = {}) {
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 ee = (e) => {
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(), te = /* @__PURE__ */ Symbol("lucide-icons");
57
- function ne() {
58
- return u(te, {});
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 V = ({ name: e, iconNode: t, "icon-node": n, icon: r = {
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 = "" } = ne(), C = z(i) || z(a) || i === !0 || a === !0 || b === !0, w = z(o) || z(s) || o === !0 || s === !0 || x === !0;
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 = []] = R(r, {
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 || ee(h),
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(V, {
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
- }), U = H({
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
- }), ce = H({
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
- }), W = H({
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
- }), pe = H({
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
- }), G = H({
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
- }), he = H({
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(ce), {
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(U), {
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: pe,
1120
+ todo: W,
1121
1121
  done: ue,
1122
- failed: W,
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), R = t(() => ({
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(G), {
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: R.value
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 R(e) {
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 ee() {
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 ee();
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 te(e) {
1693
+ function V(e) {
1694
1694
  w(e) && (h.value = T.value.indexOf(e));
1695
1695
  }
1696
- function ne(e) {
1697
- w(e) && (te(e), ee());
1696
+ function te(e) {
1697
+ w(e) && (V(e), R());
1698
1698
  }
1699
- function V(e) {
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 (V(e)) return e.preventDefault();
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) => te(t),
1731
- onClick: (e) => ne(t)
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: R
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
- class: "kvc-muted kvc-start-note",
1800
- "data-test": "approval-note"
1801
- }, jr = {
1802
- key: 0,
1803
- "data-test": "approval-loading"
1804
- }, Mr = { "data-test": "approval-failed" }, Nr = ["data-mode"], Pr = { "data-test": "approval-limits" }, Fr = /* @__PURE__ */ c({
1805
- __name: "ApprovalNote",
1806
- props: {
1807
- withLink: { type: Boolean },
1808
- refreshKey: {}
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-text-button",
1837
- "data-test": "approval-retry",
1838
- onClick: u[0] ||= (e) => void f()
1839
- }, E(D(n).t("kvcoder.ui.tryAgain")), 1)], 64)) : (_(), i(e, { key: 2 }, [
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 Ir(e, t, n) {
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 Lr(e, t) {
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 Rr = [
1844
+ var Pr = [
1884
1845
  "off",
1885
1846
  "minimal",
1886
1847
  "low",
1887
1848
  "medium",
1888
1849
  "high"
1889
- ], zr = { class: "kvc-picker" }, Br = [
1850
+ ], Fr = { class: "kvc-picker" }, Ir = [
1890
1851
  "aria-expanded",
1891
1852
  "aria-label",
1892
1853
  "disabled"
1893
- ], Vr = { class: "kvc-picker-label" }, Hr = ["onKeydown"], Ur = { class: "kvc-search" }, Wr = [
1854
+ ], Lr = { class: "kvc-picker-label" }, Rr = ["onKeydown"], zr = { class: "kvc-search" }, Br = [
1894
1855
  "placeholder",
1895
1856
  "aria-label",
1896
1857
  "onKeydown"
1897
- ], Gr = ["aria-label"], Kr = ["aria-selected", "data-active"], qr = { class: "kvc-model-name" }, Jr = {
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
- }, Yr = [
1862
+ }, Gr = [
1902
1863
  "aria-selected",
1903
1864
  "data-active",
1904
1865
  "data-test",
1905
1866
  "onClick",
1906
1867
  "onMousemove"
1907
- ], Xr = { class: "kvc-model-name" }, Zr = {
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
- }, Qr = {
1872
+ }, Jr = {
1912
1873
  class: "kvc-muted kvc-count",
1913
1874
  "data-test": "model-count"
1914
- }, $r = 24, ei = /* @__PURE__ */ c({
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(() => Lr(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) => {
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 R() {
1890
+ function ee() {
1930
1891
  p.value = !1, v.value?.focus();
1931
1892
  }
1932
- async function ee() {
1933
- h.value = "", g.value = Math.max(L(l.current ?? ""), 0), z = 0, p.value = !0, await d(), te(), x.value?.focus(), V();
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 te() {
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 + $r - (n.left - z), i = t.right - $r - (n.right - z), a = r > 0 ? r : i < 0 ? i : 0;
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 ne() {
1943
- te(), B = requestAnimationFrame(ne);
1903
+ function te() {
1904
+ V(), B = requestAnimationFrame(te);
1944
1905
  }
1945
- function V() {
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(), V());
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), R());
1913
+ e !== void 0 && (u("pick", e), ee());
1953
1914
  }
1954
1915
  function ie() {
1955
- u("none"), R();
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(ne)) : (document.removeEventListener("pointerdown", oe), cancelAnimationFrame(B));
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", zr, [a("button", {
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 ? R() : ee()
1978
- }, [a("span", Vr, E(T.value), 1), s(D(ce), {
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, Br), p.value ? (_(), i("div", {
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(R, ["stop"]), ["esc"])
1948
+ onKeydown: N(P(ee, ["stop"]), ["esc"])
1988
1949
  }, [
1989
- a("label", Ur, [s(D(De), {
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, Wr), [[k, h.value]])]),
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", qr, E(l.none), 1), l.current === null ? (_(), n(D(U), {
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, Kr)) : r("v-if", !0),
2029
- (_(!0), i(e, null, b(C.value.groups, (t) => (_(), i(e, { key: t.provider }, [a("div", Jr, E(t.title), 1), (_(!0), i(e, null, b(t.models, (e) => (_(), i("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", Xr, E(e.name), 1), e.id === l.current ? (_(), n(D(U), {
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, Yr))), 128))], 64))), 128)),
2043
- C.value.shown === 0 ? (_(), i("p", Zr, E(D(f).t("kvcoder.ui.noModels")), 1)) : r("v-if", !0)
2044
- ], 8, Gr),
2045
- a("p", Qr, E(D(f).t("kvcoder.ui.modelsCount", {
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, Hr)) : r("v-if", !0)]));
2010
+ ], 40, Rr)) : r("v-if", !0)]));
2050
2011
  }
2051
- }), ti = /* @__PURE__ */ c({
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(() => Rr.map((e) => ({
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 = Rr.find((t) => t === e);
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(ei, {
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 ni(e, t) {
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 Rr.find((e) => e === t) ?? "medium";
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 d = t(() => o.value ?? a.value), f = t(() => c.value ?? s.value), p = t(() => Ir(r.value, i.value, d.value)), m = t(() => r.value.find((e) => e.id === i.value.find((e) => e.id === d.value)?.provider));
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
- current: d,
2133
- thinking: f,
2134
- groups: p,
2135
- provider: m,
2136
- state: t(() => l.value ? u.value ? "ready" : d.value === null ? "noModel" : m.value?.status === "needsKey" ? "needsKey" : "ready" : "loading"),
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
- class: "kvc-muted kvc-start-note",
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": "choose-model"
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
- }, ui = /* @__PURE__ */ c({
2143
+ }, di = /* @__PURE__ */ c({
2164
2144
  __name: "ChatStart",
2165
2145
  props: { registered: {} },
2166
2146
  setup(t) {
2167
- let n = K(), r = t, c = ai(n, (e) => J(n, e));
2168
- async function l(e) {
2169
- c.pickModel(e), await ni(n, e);
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 u(e) {
2172
- let t = e?.createdChat ?? (await n.exec("kvcoder.session.create", {})).id;
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 r = c.changes();
2175
- return Object.keys(r).length > 0 && await n.exec("kvcoder.session.configure", {
2154
+ let n = u.changes();
2155
+ return Object.keys(n).length > 0 && await c.exec("kvcoder.session.configure", {
2176
2156
  sessionId: t,
2177
- ...r
2157
+ ...n
2178
2158
  }), t;
2179
2159
  }
2180
- async function d(e) {
2181
- let t = ir(n.workspace.value.id), r;
2182
- await or(t, e, async (i) => {
2183
- r = await u(t), await n.exec("kvcoder.message.send", {
2184
- sessionId: r,
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: i
2167
+ sendId: r
2188
2168
  });
2189
- }) && r !== void 0 ? n.navigate("kvcoder.session", { sessionId: r }) : qe(t.error)?.code === "kvcoder/SESSION_NOT_FOUND" && (t.createdChat = void 0);
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 f(e, t) {
2171
+ async function m(e, t) {
2192
2172
  try {
2193
- let r = await u();
2194
- await n.exec(e.command, {
2195
- sessionId: r,
2173
+ let n = await f();
2174
+ await c.exec(e.command, {
2175
+ sessionId: n,
2196
2176
  argument: t
2197
- }), e.message !== void 0 && await n.exec("kvcoder.message.send", {
2198
- sessionId: r,
2199
- text: t === "" ? n.t(e.message) : t
2200
- }), n.navigate("kvcoder.session", { sessionId: r });
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(n, e);
2182
+ J(c, e);
2203
2183
  }
2204
2184
  }
2205
- return (t, u) => (_(), i(e, null, [a("div", oi, [
2206
- a("h1", null, E(D(n).t("kvcoder.ui.startHeading", { workspace: D(n).workspace.value.name })), 1),
2207
- D(c).state.value === "needsKey" && D(c).provider.value ? (_(), i("p", si, [o(E(D(n).t("kvcoder.ui.keyNeeded", { provider: D(c).provider.value.title })) + " ", 1), a("button", {
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: u[0] ||= (e) => D(n).navigate("kvai.provider", { providerId: D(c).provider.value.id })
2212
- }, E(D(n).t("kvcoder.ui.addKey")), 1)])) : D(c).state.value === "noModel" ? (_(), i("p", ci, E(D(n).t("kvcoder.ui.chooseModelHint")), 1)) : (_(), i("p", li, E(D(n).t("kvcoder.ui.startHint")), 1)),
2213
- s(Fr, { "with-link": "" })
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(n).t("kvcoder.ui.startPlaceholder"),
2217
- blocked: D(c).state.value !== "ready",
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: r.registered,
2220
- onSend: d,
2221
- onRegistered: f
2202
+ registered: l.registered,
2203
+ onSend: p,
2204
+ onRegistered: m
2222
2205
  }, {
2223
- controls: j(() => [s(ti, {
2224
- groups: D(c).groups.value,
2225
- model: D(c).current.value,
2226
- thinking: D(c).thinking.value,
2227
- empty: D(c).state.value === "loading" ? "" : D(n).t("kvcoder.ui.chooseModel"),
2228
- onModel: l,
2229
- onThinking: D(c).pickThinking
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 di() {
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 fi = ["data-command"], pi = { class: "kvc-activity-text" }, mi = {
2236
+ var pi = ["data-command"], mi = { class: "kvc-activity-text" }, hi = {
2254
2237
  style: { "font-weight": "500" },
2255
2238
  "data-test": "command-title"
2256
- }, hi = {
2239
+ }, gi = {
2257
2240
  class: "kvc-muted",
2258
2241
  "data-test": "command-seconds"
2259
- }, gi = /* @__PURE__ */ c({
2242
+ }, _i = /* @__PURE__ */ c({
2260
2243
  __name: "CommandProgress",
2261
2244
  props: { working: {} },
2262
2245
  setup(e) {
2263
- let n = e, r = K(), o = di(), s = t(() => Math.max(0, Math.floor((o.value - n.working.startedAt) / 1e3)));
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", pi, [a("span", mi, E(D(r).t(`kvcoder.ui.working.${n.working.name}`)), 1)]),
2276
- a("span", hi, E(D(r).t("kvcoder.ui.seconds", { count: s.value })), 1)
2277
- ], 8, fi));
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
- }), _i = ["data-state"], vi = { style: { flex: "1 1 auto" } }, yi = {
2262
+ }), vi = ["data-state"], yi = { style: { flex: "1 1 auto" } }, bi = {
2280
2263
  key: 0,
2281
2264
  "data-test": "staging-changed"
2282
- }, bi = {
2265
+ }, xi = {
2283
2266
  key: 1,
2284
2267
  "data-test": "staging-head-moved"
2285
- }, xi = ["disabled"], Si = /* @__PURE__ */ c({
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", vi, [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", yi, E(D(c).t("kvcoder.ui.staging.changed", { paths: l.value.paths })), 1)) : r("v-if", !0), l.value.headMoved ? (_(), i("span", bi, E(D(c).t("kvcoder.ui.staging.headMoved")), 1)) : r("v-if", !0)], 64))]),
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, xi)) : r("v-if", !0)
2341
- ], 8, _i));
2323
+ }, E(D(c).t("kvcoder.ui.staging.restore")), 9, Si)) : r("v-if", !0)
2324
+ ], 8, vi));
2342
2325
  }
2343
- }), Ci = 5;
2344
- function wi(e, t) {
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 Ti(e, n, r) {
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 % Ci === 0 && f();
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 Ei = ["data-test", "data-status"], Di = { class: "kvc-job-head" }, Oi = {
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
- }, ki = {
2397
+ }, Ai = {
2415
2398
  key: 0,
2416
2399
  class: "kvc-muted",
2417
2400
  "data-test": "job-time"
2418
- }, Ai = {
2401
+ }, ji = {
2419
2402
  key: 1,
2420
2403
  class: "kvc-chip",
2421
2404
  "data-test": "job-status"
2422
- }, ji = {
2405
+ }, Mi = {
2423
2406
  key: 0,
2424
2407
  class: "kvc-job-links"
2425
- }, Mi = ["href"], Ni = { class: "kvc-actions" }, Pi = ["aria-expanded", "data-test"], Fi = ["disabled", "data-test"], Ii = {
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
- }, Li = /* @__PURE__ */ c({
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", Di, [a("span", Oi, E(c.job.title), 1), c.job.status === "running" ? (_(), i("span", ki, E(D(wi)(D(u).t, c.now - Date.parse(c.job.startedAt))), 1)) : (_(), i("span", Ai, [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)]))]),
2447
- c.job.links.length > 0 ? (_(), i("div", ji, [(_(!0), i(e, null, b(c.job.links, (e) => (_(), i("a", {
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, Mi))), 128))])) : r("v-if", !0),
2455
- a("div", Ni, [a("button", {
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, Pi), c.job.status === "running" ? (_(), i("button", {
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, Fi)) : r("v-if", !0)]),
2469
- c.job.staging === void 0 ? r("v-if", !0) : (_(), n(Si, {
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", Ii, E(c.logs === "" ? D(u).t("kvcoder.ui.jobs.noOutput") : c.logs), 1))
2480
- ], 8, Ei));
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
- }), Ri = {
2465
+ }), zi = {
2483
2466
  key: 0,
2484
2467
  class: "kvc-jobs",
2485
2468
  "data-test": "jobs"
2486
- }, zi = ["aria-expanded"], Bi = ["aria-label", "onKeydown"], Vi = /* @__PURE__ */ c({
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 } = Ti(d, () => l.sessionId, f);
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", Ri, [a("button", {
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(ce), {
2499
+ s(D(U), {
2517
2500
  size: 16,
2518
2501
  "aria-hidden": "true"
2519
2502
  })
2520
- ], 8, zi), f.value ? (_(), i("div", {
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(Li, {
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, Bi)) : r("v-if", !0)])) : r("v-if", !0);
2527
+ ]))), 128))], 40, Vi)) : r("v-if", !0)])) : r("v-if", !0);
2545
2528
  }
2546
- }), Hi = { class: "kvc-header" }, Ui = { class: "kvc-title" }, Wi = ["aria-label"], Gi = {
2529
+ }), Ui = { class: "kvc-header" }, Wi = { class: "kvc-title" }, Gi = ["aria-label"], Ki = {
2547
2530
  key: 1,
2548
2531
  "data-test": "session-title"
2549
- }, Ki = { class: "kvc-muted kvc-header-stats" }, qi = ["title"], Ji = ["title", "aria-label"], Yi = [
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
- ], Xi = [
2536
+ ], Zi = [
2554
2537
  "aria-pressed",
2555
2538
  "aria-label",
2556
2539
  "title"
2557
- ], Zi = ["aria-label", "aria-expanded"], Qi = {
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
- }, $i = ["disabled"], ea = ["disabled"], ta = ["disabled"], na = ["disabled"], ra = ["aria-label"], ia = { style: { padding: "6px" } }, aa = { class: "kvc-actions" }, oa = /* @__PURE__ */ c({
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 = di(), 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 }));
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", Hi, [
2606
- a("div", Ui, [p.value === null ? (_(), i("strong", Gi, E(D(Ge)(D(d).t, l.session.title)), 1)) : (_(), i("form", {
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, Wi), [[k, p.value]])], 32)), a("span", Ki, [a("span", {
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, qi), S.value === void 0 ? r("v-if", !0) : (_(), i(e, { key: 0 }, [n[13] ||= o(" · ", -1), a("span", {
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, Ji)], 64))])]),
2623
- s(Vi, {
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, Yi)),
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, Xi)) : r("v-if", !0),
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(he), { size: 18 })], 8, Zi),
2669
- f.value ? (_(), i("div", Qi, [
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, $i),
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, ea),
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, ta),
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, na),
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", ia, E(D(d).t("kvcoder.ui.deleteConfirm")), 1), a("div", aa, [a("button", {
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, ra)) : r("v-if", !0)
2717
+ }, E(D(d).t("kvcoder.ui.delete")), 1)])], 8, ia)) : r("v-if", !0)
2735
2718
  ], 512)
2736
2719
  ]));
2737
2720
  }
2738
- }), sa = 200, ca = [
2721
+ }), ca = 200, la = [
2739
2722
  "text",
2740
2723
  "choice",
2741
2724
  "confirm"
2742
2725
  ];
2743
- function la(e) {
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 ua(e, t) {
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 da(e) {
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 fa(e) {
2742
+ function pa(e) {
2760
2743
  let t = X(e.connector), n = X(e.command);
2761
- if (t === void 0) return da(e);
2762
- let r = X(e.description), i = la(typeof e.payload == "string" ? void 0 : e.payload) ?? {}, a = t === "ask" ? ca.find((e) => e === n) : void 0;
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: ua(t, i) } : {},
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 pa = [
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 > sa ? `${t.slice(0, sa)}…` : t;
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 ga = () => ({
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 _a(e) {
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 va(e) {
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 ya(e, t, n) {
2812
- let r = _a(t.arguments);
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 = fa(r);
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 ba(e, t) {
2805
+ function xa(e, t) {
2823
2806
  if (t.type !== "progress") return { kind: "none" };
2824
- let n = _a(t.data);
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" && ya(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, {
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 xa = ["data-phase"], Sa = { class: "kvc-activity-text" }, Ca = {
2827
+ var Sa = ["data-phase"], Ca = { class: "kvc-activity-text" }, wa = {
2845
2828
  style: { "font-weight": "600" },
2846
2829
  "data-test": "activity-title"
2847
- }, wa = {
2830
+ }, Ta = {
2848
2831
  key: 0,
2849
2832
  class: "kvc-muted",
2850
2833
  dir: "ltr",
2851
2834
  "data-test": "activity-label"
2852
- }, Ta = {
2835
+ }, Ea = {
2853
2836
  key: 1,
2854
2837
  style: { "font-weight": "500" },
2855
2838
  "data-test": "activity-title"
2856
- }, Ea = {
2839
+ }, Da = {
2857
2840
  key: 0,
2858
2841
  class: "kvc-muted",
2859
2842
  "data-test": "activity-phase"
2860
- }, Da = {
2843
+ }, Oa = {
2861
2844
  key: 1,
2862
2845
  class: "kvc-muted",
2863
2846
  "data-test": "activity-turn"
2864
- }, Oa = {
2847
+ }, ka = {
2865
2848
  class: "kvc-muted",
2866
2849
  "data-test": "activity-seconds"
2867
- }, ka = /* @__PURE__ */ c({
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 = di(), l = t(() => va(o.live)), u = t(() => {
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", Sa, [o.live.calls.length > 0 ? (_(!0), i(e, { key: 0 }, b(o.live.calls, (e, t) => (_(), i("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", Ca, E(e.description ?? D(s).t("kvcoder.ui.activity.preparing")), 1), e.label ? (_(), i("span", wa, E(e.label), 1)) : r("v-if", !0)]))), 128)) : (_(), i("span", Ta, E(D(s).t(`kvcoder.ui.activity.${l.value}`, o.live.retry ?? {})), 1))]),
2896
- o.live.calls.length > 0 ? (_(), i("span", Ea, E(D(s).t(`kvcoder.ui.activity.${l.value}`)), 1)) : r("v-if", !0),
2897
- u.value ? (_(), i("span", Da, E(u.value), 1)) : r("v-if", !0),
2898
- a("span", Oa, E(D(s).t("kvcoder.ui.seconds", { count: d.value })), 1)
2899
- ], 8, xa));
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 Aa(e) {
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 Aa(e.content.content).flatMap((e) => e.type === "thinking" && typeof e.thinking == "string" ? [e.thinking] : []).join("\n");
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 Aa(n.content.content)) {
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
- ...fa(n),
2910
+ ...pa(n),
2928
2911
  ...e
2929
2912
  });
2930
2913
  }
2931
2914
  }
2932
2915
  return t;
2933
2916
  }
2934
- function Pa(e, t) {
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,46 +2927,46 @@ function Pa(e, t) {
2944
2927
  ...e.background === !0 ? { background: !0 } : {}
2945
2928
  } : {
2946
2929
  ...t,
2947
- ...fa(e)
2930
+ ...pa(e)
2948
2931
  };
2949
2932
  }
2950
- function Fa(e, t) {
2951
- let n = Z(e.content.details), r = ja(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]);
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 : Pa(n, 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 Ia = "dismissed by the user";
2960
- function La(e) {
2961
- if (e === Ia) return { dismissed: !0 };
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 Ra(e, t) {
2951
+ function za(e, t) {
2969
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 = ja(e.content.content);
2973
- if (e.content.isError === !0 && r !== Ia) return;
2974
- let i = La(r);
2955
+ let r = Ma(e.content.content);
2956
+ if (e.content.isError === !0 && r !== La) return;
2957
+ let i = Ra(r);
2975
2958
  return i === void 0 ? void 0 : {
2976
2959
  ...n,
2977
2960
  answer: i
2978
2961
  };
2979
2962
  }
2980
- function za(e) {
2963
+ function Ba(e) {
2981
2964
  return e.kind === "user" && e.source?.kind === "extension" && e.source.name === "@kvman/kvcoder";
2982
2965
  }
2983
- function Ba(e) {
2966
+ function Va(e) {
2984
2967
  return e.kind === "user" && (e.source?.kind === "job" || e.source?.kind === "subagent");
2985
2968
  }
2986
- function Va(e) {
2969
+ function Ha(e) {
2987
2970
  if (e.kind !== "toolResult") return;
2988
2971
  let t = Z(e.content.details);
2989
2972
  if (t === void 0) return;
@@ -2997,25 +2980,37 @@ function Va(e) {
2997
2980
  version: o
2998
2981
  };
2999
2982
  }
3000
- var Ha = /\n\nAttached files:\n((?:- .+\n?)+)$/;
3001
- function Ua(e, t) {
3002
- return e.replace(Ha, (e, n) => `\n\n${t}\n${n}`);
3003
- }
2983
+ var Ua = (e) => typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
3004
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) {
3005
3000
  if (e.kind === "user") return e.source?.kind === "job" ? e.source.jobId : e.source?.kind === "subagent" ? e.source.sessionId : void 0;
3006
3001
  }
3007
- var Ga = /^The background call `([\s\S]*?)` \(job [^)\n]+\) finished:\n/;
3008
- function Ka(e) {
3009
- let t = Ga.exec(ja(e.content.content))?.[1]?.trim();
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();
3010
3005
  return t === void 0 || t === "" ? void 0 : t;
3011
3006
  }
3012
- function qa(e) {
3007
+ function Xa(e) {
3013
3008
  let t = Z(Z(e.content.details)?.staging)?.runId;
3014
3009
  return typeof t == "string" ? t : void 0;
3015
3010
  }
3016
3011
  //#endregion
3017
3012
  //#region web/src/question-options.ts
3018
- function Ja(e) {
3013
+ function Za(e) {
3019
3014
  return (Array.isArray(e.options) ? e.options : []).map((e) => {
3020
3015
  let t = q(e);
3021
3016
  return {
@@ -3027,56 +3022,56 @@ function Ja(e) {
3027
3022
  }
3028
3023
  //#endregion
3029
3024
  //#region web/src/AnsweredCard.vue?vue&type=script&setup=true&lang.ts
3030
- var Ya = ["aria-label"], Xa = {
3025
+ var Qa = ["aria-label"], $a = {
3031
3026
  class: "kvc-card-row",
3032
3027
  style: { "font-weight": "600" }
3033
- }, Za = {
3028
+ }, eo = {
3034
3029
  dir: "auto",
3035
3030
  "data-test": "answered-prompt"
3036
- }, Qa = { class: "kvc-card-body" }, $a = {
3031
+ }, to = { class: "kvc-card-body" }, no = {
3037
3032
  key: 0,
3038
3033
  class: "kvc-muted",
3039
3034
  "data-test": "answered-skipped"
3040
- }, eo = ["data-chosen", "data-test"], to = {
3035
+ }, ro = ["data-chosen", "data-test"], io = {
3041
3036
  key: 1,
3042
3037
  class: "kvc-answered-gap",
3043
3038
  "aria-hidden": "true"
3044
- }, no = { style: {
3039
+ }, ao = { style: {
3045
3040
  display: "flex",
3046
3041
  "flex-direction": "column"
3047
- } }, ro = { dir: "auto" }, io = {
3042
+ } }, oo = { dir: "auto" }, so = {
3048
3043
  key: 0,
3049
3044
  class: "kvc-muted",
3050
3045
  dir: "auto"
3051
- }, ao = {
3046
+ }, co = {
3052
3047
  key: 2,
3053
3048
  class: "kvc-sr"
3054
- }, oo = {
3049
+ }, lo = {
3055
3050
  key: 0,
3056
3051
  class: "kvc-answered-option",
3057
3052
  "data-chosen": "true",
3058
3053
  "data-test": "answered-other"
3059
- }, so = { style: {
3054
+ }, uo = { style: {
3060
3055
  display: "flex",
3061
3056
  "flex-direction": "column"
3062
- } }, co = { class: "kvc-muted" }, lo = {
3057
+ } }, fo = { class: "kvc-muted" }, po = {
3063
3058
  dir: "auto",
3064
3059
  style: { "white-space": "pre-wrap" }
3065
- }, uo = {
3060
+ }, mo = {
3066
3061
  key: 2,
3067
3062
  class: "kvc-chip",
3068
3063
  style: { "align-self": "flex-start" },
3069
3064
  "data-test": "answered-confirmed"
3070
- }, fo = {
3065
+ }, ho = {
3071
3066
  key: 3,
3072
3067
  dir: "auto",
3073
3068
  style: { "white-space": "pre-wrap" },
3074
3069
  "data-test": "answered-text"
3075
- }, po = /* @__PURE__ */ c({
3070
+ }, go = /* @__PURE__ */ c({
3076
3071
  __name: "AnsweredCard",
3077
3072
  props: { answered: {} },
3078
3073
  setup(o) {
3079
- 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(() => Ja(c.answered.question).map((e) => ({
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) => ({
3080
3075
  ...e,
3081
3076
  chosen: f.value.includes(e.id)
3082
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 : "");
@@ -3084,34 +3079,34 @@ var Ya = ["aria-label"], Xa = {
3084
3079
  class: "kvc-card",
3085
3080
  "data-test": "answered-card",
3086
3081
  "aria-label": u.value
3087
- }, [a("div", Xa, [s(D(ue), {
3082
+ }, [a("div", $a, [s(D(ue), {
3088
3083
  size: 18,
3089
3084
  "aria-hidden": "true",
3090
3085
  class: "kvc-ok"
3091
- }), a("span", Za, E(u.value), 1)]), a("div", Qa, [d.value ? (_(), i("span", $a, 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", {
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", {
3092
3087
  key: e.id,
3093
3088
  class: "kvc-answered-option",
3094
3089
  "data-chosen": e.chosen,
3095
3090
  "data-test": `answered-option-${e.id}`
3096
3091
  }, [
3097
- e.chosen ? (_(), n(D(U), {
3092
+ e.chosen ? (_(), n(D(ce), {
3098
3093
  key: 0,
3099
3094
  size: 16,
3100
3095
  "aria-hidden": "true",
3101
3096
  class: "kvc-ok"
3102
- })) : (_(), i("span", to)),
3103
- a("span", no, [a("span", ro, E(e.label), 1), e.description ? (_(), i("span", io, E(e.description), 1)) : r("v-if", !0)]),
3104
- e.chosen ? (_(), i("span", ao, E(D(l).t("kvcoder.ui.chosen")), 1)) : r("v-if", !0)
3105
- ], 8, eo))), 128)), m.value === "" ? r("v-if", !0) : (_(), i("div", oo, [s(D(U), {
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), {
3106
3101
  size: 16,
3107
3102
  "aria-hidden": "true",
3108
3103
  class: "kvc-ok"
3109
- }), a("span", so, [a("span", co, E(D(l).t("kvcoder.ui.other")), 1), a("span", lo, E(m.value), 1)])]))], 64)) : c.answered.kind === "confirm" ? (_(), i("span", uo, E(D(l).t(c.answered.answer.confirmed === !0 ? "kvcoder.ui.yes" : "kvcoder.ui.no")), 1)) : (_(), i("span", fo, E(h.value), 1))])], 8, Ya));
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));
3110
3105
  }
3111
- }), mo = {
3106
+ }), _o = {
3112
3107
  class: "kvc-card kvc-card-row",
3113
3108
  "data-test": "artifact-card"
3114
- }, ho = {
3109
+ }, vo = {
3115
3110
  style: {
3116
3111
  flex: "1 1 auto",
3117
3112
  "min-inline-size": "0",
@@ -3120,13 +3115,13 @@ var Ya = ["aria-label"], Xa = {
3120
3115
  "white-space": "nowrap"
3121
3116
  },
3122
3117
  "data-test": "artifact-card-title"
3123
- }, go = {
3118
+ }, yo = {
3124
3119
  class: "kvc-chip",
3125
3120
  "data-test": "artifact-card-format"
3126
- }, _o = {
3121
+ }, bo = {
3127
3122
  class: "kvc-muted",
3128
3123
  "data-test": "artifact-card-version"
3129
- }, vo = /* @__PURE__ */ c({
3124
+ }, xo = /* @__PURE__ */ c({
3130
3125
  __name: "ArtifactCard",
3131
3126
  props: {
3132
3127
  id: {},
@@ -3137,14 +3132,14 @@ var Ya = ["aria-label"], Xa = {
3137
3132
  emits: ["open"],
3138
3133
  setup(e, { emit: t }) {
3139
3134
  let n = e, r = t, o = K();
3140
- return (e, t) => (_(), i("div", mo, [
3135
+ return (e, t) => (_(), i("div", _o, [
3141
3136
  s(D(Ce), {
3142
3137
  size: 16,
3143
3138
  "aria-hidden": "true"
3144
3139
  }),
3145
- a("span", ho, E(n.title), 1),
3146
- a("span", go, E(D(o).t(`kvcoder.ui.artifacts.format.${n.format}`)), 1),
3147
- a("span", _o, E(D(o).t("kvcoder.ui.artifacts.version", { version: n.version })), 1),
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),
3148
3143
  a("button", {
3149
3144
  type: "button",
3150
3145
  class: "kvc-button",
@@ -3153,39 +3148,39 @@ var Ya = ["aria-label"], Xa = {
3153
3148
  }, E(D(o).t("kvcoder.ui.artifacts.open")), 1)
3154
3149
  ]));
3155
3150
  }
3156
- }), yo = 160, bo = /^error ([A-Za-z0-9_/-]+): ?(.*)/;
3157
- function xo(e) {
3151
+ }), So = 160, Co = /^error ([A-Za-z0-9_/-]+): ?(.*)/;
3152
+ function wo(e) {
3158
3153
  let t = (e.split("\n", 1)[0] ?? "").trim();
3159
- return t.length > yo ? `${t.slice(0, yo)}…` : t;
3154
+ return t.length > So ? `${t.slice(0, So)}…` : t;
3160
3155
  }
3161
- function So(e) {
3156
+ function To(e) {
3162
3157
  if (e.startsWith("denied by the user")) return { kind: "denied" };
3163
- let t = bo.exec(e);
3158
+ let t = Co.exec(e);
3164
3159
  return t?.[1] === "VALIDATION_FAILED" ? { kind: "invalid" } : t === null ? /\[exit code \d+\]\s*$/.test(e) ? { kind: "command" } : {
3165
3160
  kind: "error",
3166
- message: xo(e)
3161
+ message: wo(e)
3167
3162
  } : {
3168
3163
  kind: "error",
3169
- message: xo(t[2] ?? "")
3164
+ message: wo(t[2] ?? "")
3170
3165
  };
3171
3166
  }
3172
3167
  //#endregion
3173
3168
  //#region web/src/call-results.ts
3174
- function Co(e) {
3169
+ function Eo(e) {
3175
3170
  let { replacements: t, firstChangedLine: n } = q(e);
3176
3171
  return typeof t == "number" && typeof n == "number" ? {
3177
3172
  replacements: t,
3178
3173
  firstChangedLine: n
3179
3174
  } : void 0;
3180
3175
  }
3181
- function wo(e) {
3176
+ function Do(e) {
3182
3177
  let { fromLine: t, content: n } = q(e);
3183
3178
  return typeof t == "number" && typeof n == "string" ? {
3184
3179
  fromLine: t,
3185
3180
  content: n
3186
3181
  } : void 0;
3187
3182
  }
3188
- function To(e) {
3183
+ function Oo(e) {
3189
3184
  let { name: t, kind: n, bytes: r } = q(e);
3190
3185
  return typeof t == "string" && (n === "file" || n === "folder") && typeof r == "number" ? [{
3191
3186
  name: t,
@@ -3193,11 +3188,11 @@ function To(e) {
3193
3188
  bytes: r
3194
3189
  }] : [];
3195
3190
  }
3196
- function Eo(e) {
3191
+ function ko(e) {
3197
3192
  let t = q(e).entries;
3198
- return Array.isArray(t) ? t.flatMap(To) : void 0;
3193
+ return Array.isArray(t) ? t.flatMap(Oo) : void 0;
3199
3194
  }
3200
- function Do(e) {
3195
+ function Ao(e) {
3201
3196
  let { path: t, matches: n } = q(e);
3202
3197
  return typeof t != "string" || !Array.isArray(n) ? [] : [{
3203
3198
  path: t,
@@ -3210,17 +3205,17 @@ function Do(e) {
3210
3205
  })
3211
3206
  }];
3212
3207
  }
3213
- var Oo = [
3208
+ var jo = [
3214
3209
  "running",
3215
3210
  "succeeded",
3216
3211
  "failed",
3217
3212
  "cancelled",
3218
3213
  "interrupted"
3219
3214
  ];
3220
- function ko(e, t) {
3221
- return Oo.some((e) => e === t) ? e(`kvcoder.ui.jobs.status.${t}`) : t;
3215
+ function Mo(e, t) {
3216
+ return jo.some((e) => e === t) ? e(`kvcoder.ui.jobs.status.${t}`) : t;
3222
3217
  }
3223
- function Ao(e) {
3218
+ function No(e) {
3224
3219
  let { kind: t, call: n, status: r, startedAt: i, endedAt: a, exitCode: o, output: s, problem: c } = q(e);
3225
3220
  if (typeof n != "string" || typeof r != "string") return;
3226
3221
  let l = typeof i == "string" && typeof a == "string" ? Date.parse(a) - Date.parse(i) : NaN;
@@ -3234,36 +3229,36 @@ function Ao(e) {
3234
3229
  ...c === void 0 ? {} : { problem: c }
3235
3230
  };
3236
3231
  }
3237
- function jo(e) {
3232
+ function Po(e) {
3238
3233
  let t = q(e).files;
3239
- return Array.isArray(t) ? t.flatMap(Do) : void 0;
3234
+ return Array.isArray(t) ? t.flatMap(Ao) : void 0;
3240
3235
  }
3241
3236
  //#endregion
3242
3237
  //#region web/src/edit-diff.ts
3243
- var Mo = 3;
3244
- function No(e) {
3238
+ var Fo = 3;
3239
+ function Io(e) {
3245
3240
  if (e === "") return [];
3246
3241
  let t = e.split("\n");
3247
3242
  return e.endsWith("\n") ? t.slice(0, -1) : t;
3248
3243
  }
3249
- function Po(e, t) {
3244
+ function Lo(e, t) {
3250
3245
  let n = 0;
3251
3246
  for (; n < e.length && n < t.length && e[n] === t[n];) n += 1;
3252
3247
  return n;
3253
3248
  }
3254
- function Fo(e, t) {
3255
- let n = No(e), r = No(t), i = Po(n, r), a = Po(n.slice(i).reverse(), r.slice(i).reverse()), o = (e, t) => t.map((t) => ({
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) => ({
3256
3251
  kind: e,
3257
3252
  text: t
3258
3253
  }));
3259
3254
  return [
3260
- ...o("context", n.slice(Math.max(i - Mo, 0), i)),
3255
+ ...o("context", n.slice(Math.max(i - Fo, 0), i)),
3261
3256
  ...o("removed", n.slice(i, n.length - a)),
3262
3257
  ...o("added", r.slice(i, r.length - a)),
3263
- ...o("context", n.slice(n.length - a, n.length - a + Mo))
3258
+ ...o("context", n.slice(n.length - a, n.length - a + Fo))
3264
3259
  ];
3265
3260
  }
3266
- function Io(e) {
3261
+ function zo(e) {
3267
3262
  return {
3268
3263
  added: e.filter((e) => e.kind === "added").length,
3269
3264
  removed: e.filter((e) => e.kind === "removed").length
@@ -3271,7 +3266,7 @@ function Io(e) {
3271
3266
  }
3272
3267
  //#endregion
3273
3268
  //#region web/src/call-summary.ts
3274
- function Lo(e) {
3269
+ function Bo(e) {
3275
3270
  if (e !== void 0 && /^\s*[[{]/.test(e)) try {
3276
3271
  return JSON.parse(e);
3277
3272
  } catch (e) {
@@ -3279,12 +3274,12 @@ function Lo(e) {
3279
3274
  throw e;
3280
3275
  }
3281
3276
  }
3282
- var Ro = 1024;
3283
- function zo(e, t) {
3284
- return t < Ro ? e("kvcoder.ui.call.bytes", { count: t }) : t < Ro * Ro ? e("kvcoder.ui.call.kilobytes", { count: (t / Ro).toFixed(1) }) : e("kvcoder.ui.call.megabytes", { count: (t / (Ro * Ro)).toFixed(1) });
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) });
3285
3280
  }
3286
3281
  var Q = (e) => typeof e == "string" && e !== "" ? e : void 0;
3287
- function Bo(e) {
3282
+ function Uo(e) {
3288
3283
  let t = e.edits;
3289
3284
  return Array.isArray(t) ? t.flatMap((e) => {
3290
3285
  let { oldText: t, newText: n } = q(e);
@@ -3294,28 +3289,28 @@ function Bo(e) {
3294
3289
  }] : [];
3295
3290
  }) : [];
3296
3291
  }
3297
- function Vo(e) {
3298
- let t = Bo(e).map((e) => Io(Fo(e.oldText, e.newText)));
3292
+ function Wo(e) {
3293
+ let t = Uo(e).map((e) => zo(Ro(e.oldText, e.newText)));
3299
3294
  return `+${t.reduce((e, t) => e + t.added, 0)} −${t.reduce((e, t) => e + t.removed, 0)}`;
3300
3295
  }
3301
- function Ho(e, t) {
3302
- if (typeof t.bytes == "number" && typeof t.created == "boolean") return e(t.created ? "kvcoder.ui.call.created" : "kvcoder.ui.call.replaced", { size: zo(e, t.bytes) });
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) });
3303
3298
  }
3304
- function Uo(e, t) {
3299
+ function Ko(e, t) {
3305
3300
  let { fromLine: n, totalLines: r, content: i } = t;
3306
3301
  if (typeof n != "number" || typeof r != "number" || typeof i != "string") return;
3307
- let a = No(i).length;
3302
+ let a = Io(i).length;
3308
3303
  return a === 0 ? void 0 : e("kvcoder.ui.call.lines", {
3309
3304
  from: n,
3310
3305
  to: n + a - 1,
3311
3306
  total: r
3312
3307
  });
3313
3308
  }
3314
- function Wo(e, t) {
3309
+ function qo(e, t) {
3315
3310
  let n = t.entries;
3316
3311
  if (Array.isArray(n)) return e(t.truncated === !0 ? "kvcoder.ui.call.entriesFirst" : "kvcoder.ui.call.entries", { count: n.length });
3317
3312
  }
3318
- function Go(e, t) {
3313
+ function Jo(e, t) {
3319
3314
  let n = t.files;
3320
3315
  if (!Array.isArray(n)) return;
3321
3316
  let r = n.reduce((e, t) => {
@@ -3327,7 +3322,7 @@ function Go(e, t) {
3327
3322
  files: n.length
3328
3323
  });
3329
3324
  }
3330
- var Ko = (e, t, n) => Array.isArray(n) ? e(t, { count: n.length }) : void 0;
3325
+ var Yo = (e, t, n) => Array.isArray(n) ? e(t, { count: n.length }) : void 0;
3331
3326
  function $(e, t, n) {
3332
3327
  return {
3333
3328
  ...e === void 0 ? {} : { words: e },
@@ -3335,87 +3330,87 @@ function $(e, t, n) {
3335
3330
  ...n === void 0 ? {} : { outcome: n }
3336
3331
  };
3337
3332
  }
3338
- function qo(e, t, n, r) {
3333
+ function Xo(e, t, n, r) {
3339
3334
  let i = r === void 0 ? void 0 : q(r), a = Q(n.path);
3340
- if (t === "edit") return $(e("kvcoder.ui.call.edit"), a, i === void 0 ? void 0 : Vo(n));
3341
- if (t === "write") return $(e("kvcoder.ui.call.write"), a, i === void 0 ? void 0 : Ho(e, i));
3342
- if (t === "read") return $(e("kvcoder.ui.call.read"), a, i === void 0 ? void 0 : Uo(e, i));
3343
- if (t === "list") return $(e("kvcoder.ui.call.list"), a ?? ".", i === void 0 ? void 0 : Wo(e, i));
3344
- if (t === "search") return $(e("kvcoder.ui.call.search"), Q(n.pattern), i === void 0 ? void 0 : Go(e, i));
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));
3345
3340
  }
3346
- function Jo(e, t, n, r) {
3341
+ function Zo(e, t, n, r) {
3347
3342
  let i = Q(n.server), a = [i, Q(n.tool)].filter((e) => e !== void 0).join(" · ");
3348
3343
  if (t === "call") return $(void 0, a === "" ? void 0 : a);
3349
3344
  if (t === "run") {
3350
3345
  let e = n.steps;
3351
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(" · "));
3352
3347
  }
3353
- if (t === "tools") return $(e("kvcoder.ui.call.tools"), a === "" ? void 0 : a, Ko(e, "kvcoder.ui.call.toolCount", q(r).tools));
3348
+ if (t === "tools") return $(e("kvcoder.ui.call.tools"), a === "" ? void 0 : a, Yo(e, "kvcoder.ui.call.toolCount", q(r).tools));
3354
3349
  }
3355
- function Yo(e, t, n, r) {
3356
- if (t === "list") return $(e("kvcoder.ui.call.backgroundRuns"), void 0, Ko(e, "kvcoder.ui.call.runCount", r));
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));
3357
3352
  if (t === "output" || t === "wait") {
3358
- let i = Ao(r);
3359
- return $(e(`kvcoder.ui.call.${t}`), Q(n.id), i === void 0 ? void 0 : ko(e, i.status));
3353
+ let i = No(r);
3354
+ return $(e(`kvcoder.ui.call.${t}`), Q(n.id), i === void 0 ? void 0 : Mo(e, i.status));
3360
3355
  }
3361
3356
  if (t === "stop") return $(e("kvcoder.ui.call.stop"), Q(n.id));
3362
3357
  }
3363
- function Xo(e, t, n, r) {
3358
+ function $o(e, t, n, r) {
3364
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;
3365
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;
3366
3361
  }
3367
- function Zo(e, t, n) {
3362
+ function es(e, t, n) {
3368
3363
  let { connector: r, command: i } = t, a = t.fields ?? {};
3369
3364
  if (r !== void 0 && i !== void 0) {
3370
3365
  if (t.line !== void 0) return { subject: `$ ${t.line}` };
3371
- if (r === "fs") return qo(e, i, a, n);
3372
- if (r === "mcp") return Jo(e, i, a, n);
3373
- if (r === "background") return Yo(e, i, a, n);
3374
- if (r === "execution-map") return Xo(e, i, a, n);
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);
3375
3370
  if (r === "delegate" && i === "run") return $(e("kvcoder.ui.call.delegate"), [Q(a.worker), Q(a.title)].filter((e) => e !== void 0).join(" · "));
3376
3371
  if (r === "artifact" && i === "get") return $(e("kvcoder.ui.call.readArtifact"), Q(a.id));
3377
3372
  }
3378
3373
  }
3379
3374
  //#endregion
3380
3375
  //#region web/src/field-rows.ts
3381
- var Qo = "—", $o = (e) => e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean", es = (e) => e === null ? Qo : String(e);
3382
- function ts(e) {
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) {
3383
3378
  return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
3384
3379
  }
3385
- function ns(e) {
3386
- let t = ts(e);
3380
+ function as(e) {
3381
+ let t = is(e);
3387
3382
  if (t === void 0) return;
3388
3383
  let n = {};
3389
3384
  for (let [e, r] of Object.entries(t)) {
3390
- if (!$o(r)) return;
3385
+ if (!ns(r)) return;
3391
3386
  n[e] = r;
3392
3387
  }
3393
3388
  return n;
3394
3389
  }
3395
- function rs(e) {
3390
+ function os(e) {
3396
3391
  let t = [...new Set(e.flatMap((e) => Object.keys(e)))];
3397
3392
  return {
3398
3393
  kind: "table",
3399
3394
  columns: t,
3400
- rows: e.map((e) => t.map((t) => t in e ? es(e[t] ?? null) : ""))
3395
+ rows: e.map((e) => t.map((t) => t in e ? rs(e[t] ?? null) : ""))
3401
3396
  };
3402
3397
  }
3403
- function is(e) {
3398
+ function ss(e) {
3404
3399
  if (e.length === 0) return { kind: "empty" };
3405
- if (e.every($o)) return {
3400
+ if (e.every(ns)) return {
3406
3401
  kind: "items",
3407
- items: e.map(es)
3402
+ items: e.map(rs)
3408
3403
  };
3409
- let t = e.map(ns).filter((e) => e !== void 0);
3410
- return t.length === e.length ? rs(t) : {
3404
+ let t = e.map(as).filter((e) => e !== void 0);
3405
+ return t.length === e.length ? os(t) : {
3411
3406
  kind: "rows",
3412
3407
  rows: e.map((e, t) => ({
3413
3408
  name: String(t + 1),
3414
- value: as(e)
3409
+ value: cs(e)
3415
3410
  }))
3416
3411
  };
3417
3412
  }
3418
- function as(e) {
3413
+ function cs(e) {
3419
3414
  if (typeof e == "string") return e.includes("\n") ? {
3420
3415
  kind: "block",
3421
3416
  text: e
@@ -3427,27 +3422,27 @@ function as(e) {
3427
3422
  kind: "text",
3428
3423
  text: String(e)
3429
3424
  };
3430
- if (Array.isArray(e)) return is(e);
3431
- let t = ts(e);
3425
+ if (Array.isArray(e)) return ss(e);
3426
+ let t = is(e);
3432
3427
  return t === void 0 || Object.keys(t).length === 0 ? { kind: "empty" } : {
3433
3428
  kind: "rows",
3434
- rows: os(t)
3429
+ rows: ls(t)
3435
3430
  };
3436
3431
  }
3437
- function os(e) {
3432
+ function ls(e) {
3438
3433
  return Object.entries(e).map(([e, t]) => ({
3439
3434
  name: e,
3440
- value: as(t)
3435
+ value: cs(t)
3441
3436
  }));
3442
3437
  }
3443
- function ss(e, t) {
3438
+ function us(e, t) {
3444
3439
  return t || e.length <= 12 ? e : e.slice(0, 12);
3445
3440
  }
3446
- var cs = (e) => No(e).map((e) => ({ text: e })), ls = (e, t) => No(e).map((e, n) => ({
3441
+ var ds = (e) => Io(e).map((e) => ({ text: e })), fs = (e, t) => Io(e).map((e, n) => ({
3447
3442
  text: e,
3448
3443
  number: t + n
3449
3444
  }));
3450
- function us(e, t) {
3445
+ function ps(e, t) {
3451
3446
  return t || e.length <= 17 ? e : [
3452
3447
  ...e.slice(0, 12),
3453
3448
  "⋯",
@@ -3456,7 +3451,7 @@ function us(e, t) {
3456
3451
  }
3457
3452
  //#endregion
3458
3453
  //#region web/src/FoldButton.vue?vue&type=script&setup=true&lang.ts
3459
- var ds = ["aria-expanded"], fs = /* @__PURE__ */ c({
3454
+ var ms = ["aria-expanded"], hs = /* @__PURE__ */ c({
3460
3455
  __name: "FoldButton",
3461
3456
  props: {
3462
3457
  count: {},
@@ -3473,119 +3468,119 @@ var ds = ["aria-expanded"], fs = /* @__PURE__ */ c({
3473
3468
  "aria-expanded": n.open,
3474
3469
  "data-test": "show-all",
3475
3470
  onClick: t[0] ||= (e) => a("toggle")
3476
- }, E(n.open ? D(o).t("kvcoder.ui.call.showFewer") : D(o).t("kvcoder.ui.call.showAll", { count: n.count })), 9, ds)) : r("v-if", !0);
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);
3477
3472
  }
3478
- }), ps = { class: "kvc-code-lines" }, ms = ["dir", "data-kind"], hs = {
3473
+ }), gs = { class: "kvc-code-lines" }, _s = ["dir", "data-kind"], vs = {
3479
3474
  key: 0,
3480
3475
  class: "kvc-line-number",
3481
3476
  "data-test": "call-line-number"
3482
- }, gs = {
3477
+ }, ys = {
3483
3478
  key: 1,
3484
3479
  class: "kvc-line-mark",
3485
3480
  "aria-hidden": "true"
3486
- }, _s = {
3481
+ }, bs = {
3487
3482
  class: "kvc-line-text",
3488
3483
  dir: "auto",
3489
3484
  "data-test": "call-line-text"
3490
- }, vs = /* @__PURE__ */ c({
3485
+ }, xs = /* @__PURE__ */ c({
3491
3486
  __name: "FoldedLines",
3492
3487
  props: { lines: {} },
3493
3488
  setup(n) {
3494
- let o = n, c = y(!1), l = t(() => ss(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 = {
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 = {
3495
3490
  context: " ",
3496
3491
  removed: "−",
3497
3492
  added: "+"
3498
3493
  };
3499
- return (t, n) => (_(), i("div", ps, [(_(!0), i(e, null, b(l.value, (e, t) => (_(), i("div", {
3494
+ return (t, n) => (_(), i("div", gs, [(_(!0), i(e, null, b(l.value, (e, t) => (_(), i("div", {
3500
3495
  key: t,
3501
3496
  class: "kvc-code-line",
3502
3497
  dir: u.value || d.value ? "ltr" : void 0,
3503
3498
  "data-kind": e.kind,
3504
3499
  "data-test": "call-line-row"
3505
3500
  }, [
3506
- u.value ? (_(), i("span", hs, E(e.number), 1)) : r("v-if", !0),
3507
- d.value ? (_(), i("span", gs, E(f[e.kind ?? "context"]), 1)) : r("v-if", !0),
3508
- a("span", _s, [s(Y, { text: e.text }, null, 8, ["text"])])
3509
- ], 8, ms))), 128)), s(fs, {
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, {
3510
3505
  count: o.lines.length,
3511
3506
  open: c.value,
3512
3507
  onToggle: n[0] ||= (e) => c.value = !c.value
3513
3508
  }, null, 8, ["count", "open"])]));
3514
3509
  }
3515
- }), ys = {
3510
+ }), Ss = {
3516
3511
  key: 0,
3517
3512
  dir: "auto",
3518
3513
  "data-test": "field-text"
3519
- }, bs = {
3514
+ }, Cs = {
3520
3515
  key: 1,
3521
3516
  class: "kvc-muted",
3522
3517
  "data-test": "field-empty"
3523
- }, xs = {
3518
+ }, ws = {
3524
3519
  key: 3,
3525
3520
  class: "kvc-field-table"
3526
- }, Ss = { "data-test": "field-table" }, Cs = {
3521
+ }, Ts = { "data-test": "field-table" }, Es = {
3527
3522
  key: 4,
3528
3523
  class: "kvc-field-items",
3529
3524
  "data-test": "field-items"
3530
- }, ws = {
3525
+ }, Ds = {
3531
3526
  key: 5,
3532
3527
  class: "kvc-fields",
3533
3528
  "data-test": "call-fields"
3534
- }, Ts = ["data-name"], Es = {
3529
+ }, Os = ["data-name"], ks = {
3535
3530
  class: "kvc-muted",
3536
3531
  dir: "ltr"
3537
- }, Ds = { "data-test": "field-value" }, Os = /* @__PURE__ */ c({
3532
+ }, As = { "data-test": "field-value" }, js = /* @__PURE__ */ c({
3538
3533
  __name: "FieldsView",
3539
3534
  props: { value: {} },
3540
3535
  setup(r) {
3541
- let o = r, c = y(!1), l = t(() => o.value.kind === "table" ? ss(o.value.rows, c.value) : []), u = t(() => o.value.kind === "items" ? ss(o.value.items, c.value) : []);
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) : []);
3542
3537
  return (t, r) => {
3543
3538
  let d = S("FieldsView", !0);
3544
- return o.value.kind === "text" ? (_(), i("span", ys, [s(Y, { text: o.value.text }, null, 8, ["text"])])) : o.value.kind === "empty" ? (_(), i("span", bs, "—")) : o.value.kind === "block" ? (_(), n(vs, {
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, {
3545
3540
  key: 2,
3546
3541
  class: "kvc-field-block",
3547
- lines: D(cs)(o.value.text),
3542
+ lines: D(ds)(o.value.text),
3548
3543
  "data-test": "field-block"
3549
- }, null, 8, ["lines"])) : o.value.kind === "table" ? (_(), i("div", xs, [a("table", Ss, [a("thead", null, [a("tr", null, [(_(!0), i(e, null, b(o.value.columns, (e) => (_(), i("th", {
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", {
3550
3545
  key: e,
3551
3546
  scope: "col",
3552
3547
  dir: "ltr"
3553
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", {
3554
3549
  key: t,
3555
3550
  dir: "auto"
3556
- }, [s(Y, { text: e }, null, 8, ["text"])]))), 128))]))), 128))])]), s(fs, {
3551
+ }, [s(Y, { text: e }, null, 8, ["text"])]))), 128))]))), 128))])]), s(hs, {
3557
3552
  count: o.value.rows.length,
3558
3553
  open: c.value,
3559
3554
  onToggle: r[0] ||= (e) => c.value = !c.value
3560
- }, null, 8, ["count", "open"])])) : o.value.kind === "items" ? (_(), i("div", Cs, [(_(!0), i(e, null, b(u.value, (e, t) => (_(), 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", {
3561
3556
  key: t,
3562
3557
  dir: "auto"
3563
- }, [s(Y, { text: e }, null, 8, ["text"])]))), 128)), s(fs, {
3558
+ }, [s(Y, { text: e }, null, 8, ["text"])]))), 128)), s(hs, {
3564
3559
  count: o.value.items.length,
3565
3560
  open: c.value,
3566
3561
  onToggle: r[1] ||= (e) => c.value = !c.value
3567
- }, null, 8, ["count", "open"])])) : (_(), i("dl", ws, [(_(!0), i(e, null, b(o.value.rows, (e) => (_(), i("div", {
3562
+ }, null, 8, ["count", "open"])])) : (_(), i("dl", Ds, [(_(!0), i(e, null, b(o.value.rows, (e) => (_(), i("div", {
3568
3563
  key: e.name,
3569
3564
  class: "kvc-field-row",
3570
3565
  "data-name": e.name,
3571
3566
  "data-test": "field-row"
3572
- }, [a("dt", Es, E(e.name), 1), a("dd", Ds, [s(d, { value: e.value }, null, 8, ["value"])])], 8, Ts))), 128))]));
3567
+ }, [a("dt", ks, E(e.name), 1), a("dd", As, [s(d, { value: e.value }, null, 8, ["value"])])], 8, Os))), 128))]));
3573
3568
  };
3574
3569
  }
3575
- }), ks = ["aria-label"], As = ["aria-label"], js = /* @__PURE__ */ c({
3570
+ }), Ms = ["aria-label"], Ns = ["aria-label"], Ps = /* @__PURE__ */ c({
3576
3571
  __name: "CallRequest",
3577
3572
  props: { view: {} },
3578
3573
  setup(a) {
3579
- let o = a, c = K(), l = t(() => ma(o.view)), u = t(() => o.view.fields ?? {}), d = t(() => Bo(u.value).map((e) => Fo(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 : {});
3580
- return (t, a) => l.value === "edit" ? (_(!0), i(e, { key: 0 }, b(d.value, (e, t) => (_(), n(vs, {
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, {
3581
3576
  key: t,
3582
3577
  class: "kvc-block",
3583
3578
  lines: e,
3584
3579
  "data-test": "call-diff"
3585
- }, null, 8, ["lines"]))), 128)) : l.value === "write" ? (_(), n(vs, {
3580
+ }, null, 8, ["lines"]))), 128)) : l.value === "write" ? (_(), n(xs, {
3586
3581
  key: 1,
3587
3582
  class: "kvc-block",
3588
- lines: D(ls)(f.value, 1),
3583
+ lines: D(fs)(f.value, 1),
3589
3584
  "data-test": "call-content"
3590
3585
  }, null, 8, ["lines"])) : l.value === "line" ? (_(), i("pre", {
3591
3586
  key: 2,
@@ -3593,10 +3588,10 @@ var ds = ["aria-expanded"], fs = /* @__PURE__ */ c({
3593
3588
  dir: "ltr",
3594
3589
  "aria-label": D(c).t("kvcoder.ui.command"),
3595
3590
  "data-test": "call-payload"
3596
- }, "$ " + E(o.view.line), 9, ks)) : l.value === "delegate" ? (_(), n(vs, {
3591
+ }, "$ " + E(o.view.line), 9, Ms)) : l.value === "delegate" ? (_(), n(xs, {
3597
3592
  key: 3,
3598
3593
  class: "kvc-block kvc-prose-lines",
3599
- lines: D(cs)(p.value),
3594
+ lines: D(ds)(p.value),
3600
3595
  "aria-label": D(c).t("kvcoder.ui.call.task"),
3601
3596
  "data-test": "call-task"
3602
3597
  }, null, 8, ["lines", "aria-label"])) : Object.keys(m.value).length > 0 ? (_(), i("div", {
@@ -3604,19 +3599,19 @@ var ds = ["aria-expanded"], fs = /* @__PURE__ */ c({
3604
3599
  class: "kvc-block",
3605
3600
  "aria-label": D(c).t("kvcoder.ui.call.payload"),
3606
3601
  "data-test": "call-payload-fields"
3607
- }, [s(Os, { value: D(as)(m.value) }, null, 8, ["value"])], 8, As)) : r("v-if", !0);
3602
+ }, [s(js, { value: D(cs)(m.value) }, null, 8, ["value"])], 8, Ns)) : r("v-if", !0);
3608
3603
  }
3609
- }), Ms = { class: "kvc-output-block" }, Ns = ["aria-label"], Ps = /* @__PURE__ */ c({
3604
+ }), Fs = { class: "kvc-output-block" }, Is = ["aria-label"], Ls = /* @__PURE__ */ c({
3610
3605
  __name: "FoldedOutput",
3611
3606
  props: { output: {} },
3612
3607
  setup(e) {
3613
- let n = e, r = K(), o = y(!1), c = t(() => n.output.split("\n")), l = t(() => us(c.value, o.value).join("\n"));
3614
- return (e, t) => (_(), i("div", Ms, [a("pre", {
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", {
3615
3610
  class: "kvc-output",
3616
3611
  dir: "auto",
3617
3612
  "aria-label": D(r).t("kvcoder.ui.output"),
3618
3613
  "data-test": "call-output"
3619
- }, [s(Y, { text: l.value }, null, 8, ["text"])], 8, Ns), s(fs, {
3614
+ }, [s(Y, { text: l.value }, null, 8, ["text"])], 8, Is), s(hs, {
3620
3615
  count: c.value.length,
3621
3616
  open: o.value,
3622
3617
  over: D(12) + D(5),
@@ -3630,7 +3625,7 @@ var ds = ["aria-expanded"], fs = /* @__PURE__ */ c({
3630
3625
  });
3631
3626
  //#endregion
3632
3627
  //#region web/src/durations.ts
3633
- function Fs(e, t) {
3628
+ function Rs(e, t) {
3634
3629
  if (t < 1e3) return e("kvcoder.ui.milliseconds", { count: Math.round(t) });
3635
3630
  if (t < 1e4) return e("kvcoder.ui.seconds", { count: (t / 1e3).toFixed(1) });
3636
3631
  let n = Math.round(t / 1e3);
@@ -3641,21 +3636,21 @@ function Fs(e, t) {
3641
3636
  }
3642
3637
  //#endregion
3643
3638
  //#region web/src/RunOutput.vue?vue&type=script&setup=true&lang.ts
3644
- var Is = {
3639
+ var zs = {
3645
3640
  class: "kvc-block kvc-run-row",
3646
3641
  "data-test": "run-row"
3647
- }, Ls = {
3642
+ }, Bs = {
3648
3643
  class: "kvc-run-call",
3649
3644
  dir: "auto",
3650
3645
  "data-test": "run-call"
3651
- }, Rs = {
3646
+ }, Vs = {
3652
3647
  class: "kvc-chip",
3653
3648
  "data-test": "run-status"
3654
- }, zs = {
3649
+ }, Hs = {
3655
3650
  key: 0,
3656
3651
  class: "kvc-muted",
3657
3652
  "data-test": "run-time"
3658
- }, Bs = ["aria-label"], Vs = ["aria-label"], Hs = ["aria-label"], Us = ["aria-label"], Ws = /* @__PURE__ */ c({
3653
+ }, Us = ["aria-label"], Ws = ["aria-label"], Gs = ["aria-label"], Ks = ["aria-label"], qs = /* @__PURE__ */ c({
3659
3654
  __name: "RunOutput",
3660
3655
  props: { run: {} },
3661
3656
  setup(c) {
@@ -3665,59 +3660,59 @@ var Is = {
3665
3660
  params: { text: f.value ?? "" }
3666
3661
  }));
3667
3662
  return (t, c) => (_(), i(e, null, [
3668
- a("div", Is, [
3669
- a("span", Ls, E(l.run.call), 1),
3670
- a("span", Rs, [o(E(D(ko)(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))]),
3671
- l.run.ranMs === void 0 ? r("v-if", !0) : (_(), i("span", zs, E(D(Fs)(D(u).t, l.run.ranMs)), 1))
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))
3672
3667
  ]),
3673
3668
  p.value === void 0 ? l.run.problem === void 0 ? r("v-if", !0) : (_(), i("div", {
3674
3669
  key: 1,
3675
3670
  class: "kvc-block kvc-error",
3676
3671
  "aria-label": D(u).t("kvcoder.ui.call.error"),
3677
3672
  "data-test": "run-problem"
3678
- }, [s(Os, { value: D(as)(l.run.problem) }, null, 8, ["value"])], 8, Vs)) : (_(), i("pre", {
3673
+ }, [s(js, { value: D(cs)(l.run.problem) }, null, 8, ["value"])], 8, Ws)) : (_(), i("pre", {
3679
3674
  key: 0,
3680
3675
  class: "kvc-block kvc-error",
3681
3676
  dir: "auto",
3682
3677
  "aria-label": D(u).t("kvcoder.ui.call.error"),
3683
3678
  "data-test": "run-problem"
3684
- }, [s(Y, { text: p.value }, null, 8, ["text"])], 8, Bs)),
3679
+ }, [s(Y, { text: p.value }, null, 8, ["text"])], 8, Us)),
3685
3680
  f.value === void 0 && l.run.output !== void 0 ? (_(), i("div", {
3686
3681
  key: 2,
3687
3682
  class: "kvc-block",
3688
3683
  "aria-label": D(u).t("kvcoder.ui.output"),
3689
3684
  "data-test": "call-result-fields"
3690
- }, [s(Os, { value: D(as)(l.run.output) }, null, 8, ["value"])], 8, Hs)) : l.run.answer && f.value ? (_(), i("div", {
3685
+ }, [s(js, { value: D(cs)(l.run.output) }, null, 8, ["value"])], 8, Gs)) : l.run.answer && f.value ? (_(), i("div", {
3691
3686
  key: 3,
3692
3687
  class: "kvc-block",
3693
3688
  "aria-label": D(u).t("kvcoder.ui.call.answer"),
3694
3689
  "data-test": "call-answer"
3695
- }, [(_(), n(C(D(u).View), { view: m.value }, null, 8, ["view"]))], 8, Us)) : f.value ? (_(), n(Ps, {
3690
+ }, [(_(), n(C(D(u).View), { view: m.value }, null, 8, ["view"]))], 8, Ks)) : f.value ? (_(), n(Ls, {
3696
3691
  key: 4,
3697
3692
  output: f.value
3698
3693
  }, null, 8, ["output"])) : r("v-if", !0)
3699
3694
  ], 64));
3700
3695
  }
3701
- }), Gs = {
3696
+ }), Js = {
3702
3697
  key: 0,
3703
3698
  class: "kvc-muted kvc-call-parts",
3704
3699
  "data-test": "call-replacements"
3705
- }, Ks = {
3700
+ }, Ys = {
3706
3701
  key: 2,
3707
3702
  class: "kvc-block kvc-entries",
3708
3703
  "data-test": "call-entries"
3709
- }, qs = ["data-kind"], Js = {
3704
+ }, Xs = ["data-kind"], Zs = {
3710
3705
  class: "kvc-mono",
3711
3706
  dir: "auto",
3712
3707
  "data-test": "call-entry-name"
3713
- }, Ys = {
3708
+ }, Qs = {
3714
3709
  key: 0,
3715
3710
  class: "kvc-muted",
3716
3711
  "data-test": "call-entry-size"
3717
- }, Xs = {
3712
+ }, $s = {
3718
3713
  class: "kvc-mono kvc-file-path",
3719
3714
  "data-test": "call-file-path"
3720
- }, Zs = ["aria-label"], Qs = ["aria-label"], $s = /* @__PURE__ */ c({
3715
+ }, ec = ["aria-label"], tc = ["aria-label"], nc = /* @__PURE__ */ c({
3721
3716
  __name: "CallResult",
3722
3717
  props: {
3723
3718
  view: {},
@@ -3725,7 +3720,7 @@ var Is = {
3725
3720
  result: {}
3726
3721
  },
3727
3722
  setup(o) {
3728
- let c = o, l = K(), u = t(() => ma(c.view)), d = t(() => u.value === "edit" ? Co(c.result) : void 0), f = t(() => u.value === "read" ? wo(c.result) : void 0), p = t(() => u.value === "list" ? Eo(c.result) : void 0), m = t(() => u.value === "search" ? jo(c.result) : void 0), h = t(() => u.value === "run-output" ? Ao(c.result) : void 0), g = y(!1), v = t(() => ss(p.value ?? [], g.value)), x = 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(() => ({
3729
3724
  type: "markdown",
3730
3725
  text: "kvcoder.markdown",
3731
3726
  params: { text: c.output }
@@ -3735,25 +3730,25 @@ var Is = {
3735
3730
  class: "kvc-block",
3736
3731
  "aria-label": D(l).t("kvcoder.ui.call.answer"),
3737
3732
  "data-test": "call-answer"
3738
- }, [(_(), n(C(D(l).View), { view: x.value }, null, 8, ["view"]))], 8, Zs)) : S.value ? (_(), i("div", {
3733
+ }, [(_(), n(C(D(l).View), { view: x.value }, null, 8, ["view"]))], 8, ec)) : S.value ? (_(), i("div", {
3739
3734
  key: 7,
3740
3735
  class: "kvc-block",
3741
3736
  "aria-label": D(l).t("kvcoder.ui.output"),
3742
3737
  "data-test": "call-result-fields"
3743
- }, [s(Os, { value: D(as)(c.result) }, null, 8, ["value"])], 8, Qs)) : c.output === "" ? r("v-if", !0) : (_(), n(Ps, {
3738
+ }, [s(js, { value: D(cs)(c.result) }, null, 8, ["value"])], 8, tc)) : c.output === "" ? r("v-if", !0) : (_(), n(Ls, {
3744
3739
  key: 8,
3745
3740
  output: c.output
3746
- }, null, 8, ["output"])) : (_(), n(Ws, {
3741
+ }, null, 8, ["output"])) : (_(), n(qs, {
3747
3742
  key: 5,
3748
3743
  run: h.value
3749
3744
  }, null, 8, ["run"])) : (_(!0), i(e, { key: 3 }, b(m.value, (e) => (_(), i("div", {
3750
3745
  key: e.path,
3751
3746
  class: "kvc-block",
3752
3747
  "data-test": "call-file"
3753
- }, [a("div", Xs, E(e.path), 1), s(vs, { lines: e.matches.map((e) => ({
3748
+ }, [a("div", $s, E(e.path), 1), s(xs, { lines: e.matches.map((e) => ({
3754
3749
  text: e.text,
3755
3750
  number: e.line
3756
- })) }, null, 8, ["lines"])]))), 128)) : (_(), i("div", Ks, [(_(!0), i(e, null, b(v.value, (e) => (_(), i("div", {
3751
+ })) }, null, 8, ["lines"])]))), 128)) : (_(), i("div", Ys, [(_(!0), i(e, null, b(v.value, (e) => (_(), i("div", {
3757
3752
  key: e.name,
3758
3753
  class: "kvc-entry",
3759
3754
  "data-kind": e.kind,
@@ -3763,40 +3758,40 @@ var Is = {
3763
3758
  size: 14,
3764
3759
  "aria-hidden": "true"
3765
3760
  })),
3766
- a("span", Js, E(e.name), 1),
3767
- e.kind === "file" ? (_(), i("span", Ys, E(D(zo)(D(l).t, e.bytes)), 1)) : r("v-if", !0)
3768
- ], 8, qs))), 128)), s(fs, {
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, {
3769
3764
  count: p.value.length,
3770
3765
  open: g.value,
3771
3766
  onToggle: o[0] ||= (e) => g.value = !g.value
3772
- }, null, 8, ["count", "open"])])) : (_(), n(vs, {
3767
+ }, null, 8, ["count", "open"])])) : (_(), n(xs, {
3773
3768
  key: 1,
3774
3769
  class: "kvc-block",
3775
- lines: D(ls)(f.value.content, f.value.fromLine),
3770
+ lines: D(fs)(f.value.content, f.value.fromLine),
3776
3771
  "data-test": "call-content"
3777
- }, null, 8, ["lines"])) : (_(), i("p", Gs, E(D(l).t("kvcoder.ui.call.replacements", {
3772
+ }, null, 8, ["lines"])) : (_(), i("p", Js, E(D(l).t("kvcoder.ui.call.replacements", {
3778
3773
  count: d.value.replacements,
3779
3774
  line: d.value.firstChangedLine
3780
3775
  })), 1));
3781
3776
  }
3782
- }), ec = {
3777
+ }), rc = {
3783
3778
  key: 0,
3784
3779
  class: "kvc-summary",
3785
3780
  "data-test": "call-summary"
3786
- }, tc = {
3781
+ }, ic = {
3787
3782
  key: 0,
3788
3783
  "data-test": "call-words"
3789
- }, nc = {
3784
+ }, ac = {
3790
3785
  key: 1,
3791
3786
  class: "kvc-mono",
3792
3787
  "data-test": "call-subject"
3793
- }, rc = ["dir"], ic = {
3788
+ }, oc = ["dir"], sc = {
3794
3789
  key: 1,
3795
3790
  class: "kvc-muted",
3796
3791
  dir: "ltr",
3797
3792
  style: { "align-self": "flex-start" },
3798
3793
  "data-test": "call-label"
3799
- }, ac = /* @__PURE__ */ c({
3794
+ }, cc = /* @__PURE__ */ c({
3800
3795
  __name: "CallSummaryLine",
3801
3796
  props: {
3802
3797
  view: {},
@@ -3804,50 +3799,50 @@ var Is = {
3804
3799
  whole: { type: Boolean }
3805
3800
  },
3806
3801
  setup(e) {
3807
- let n = e, a = K(), o = t(() => Zo(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 : ha(o.value.subject));
3808
- return (e, t) => o.value === void 0 ? n.view.label ? (_(), i("span", ic, E(n.view.label), 1)) : r("v-if", !0) : (_(), i("span", ec, [
3809
- o.value.words ? (_(), i("span", tc, E(o.value.words), 1)) : r("v-if", !0),
3810
- c.value ? (_(), i("span", nc, E(c.value), 1)) : r("v-if", !0),
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),
3811
3806
  o.value.outcome ? (_(), i("span", {
3812
3807
  key: 2,
3813
3808
  class: "kvc-muted",
3814
3809
  dir: s.value,
3815
3810
  "data-test": "call-outcome"
3816
- }, E(o.value.outcome), 9, rc)) : r("v-if", !0)
3811
+ }, E(o.value.outcome), 9, oc)) : r("v-if", !0)
3817
3812
  ]));
3818
3813
  }
3819
- }), oc = ["aria-expanded", "disabled"], sc = ["aria-label"], cc = { class: "kvc-lines" }, lc = {
3814
+ }), lc = ["aria-expanded", "disabled"], uc = ["aria-label"], dc = { class: "kvc-lines" }, fc = {
3820
3815
  key: 0,
3821
3816
  style: { "font-weight": "600" },
3822
3817
  "data-test": "call-description"
3823
- }, uc = {
3818
+ }, pc = {
3824
3819
  key: 1,
3825
3820
  class: "kvc-oneline",
3826
3821
  "data-test": "call-line"
3827
- }, dc = { class: "kvc-mono" }, fc = {
3822
+ }, mc = { class: "kvc-mono" }, hc = {
3828
3823
  key: 2,
3829
3824
  class: "kvc-chip kvc-warn",
3830
3825
  "data-test": "call-risky"
3831
- }, pc = {
3826
+ }, gc = {
3832
3827
  key: 3,
3833
3828
  class: "kvc-chip",
3834
3829
  "data-test": "call-background"
3835
- }, mc = {
3830
+ }, _c = {
3836
3831
  key: 4,
3837
3832
  class: "kvc-chip",
3838
3833
  "data-test": "call-not-run"
3839
- }, hc = {
3834
+ }, vc = {
3840
3835
  key: 5,
3841
3836
  class: "kvc-chip kvc-danger",
3842
3837
  "data-test": "call-failed"
3843
- }, gc = {
3838
+ }, yc = {
3844
3839
  class: "kvc-muted",
3845
3840
  "data-test": "call-time"
3846
- }, _c = {
3841
+ }, bc = {
3847
3842
  key: 0,
3848
3843
  class: "kvc-muted kvc-call-parts",
3849
3844
  "data-test": "call-parts"
3850
- }, vc = ["aria-expanded"], yc = ["aria-label"], bc = /* @__PURE__ */ c({
3845
+ }, xc = ["aria-expanded"], Sc = ["aria-label"], Cc = /* @__PURE__ */ c({
3851
3846
  __name: "CallCard",
3852
3847
  props: {
3853
3848
  view: {},
@@ -3857,14 +3852,14 @@ var Is = {
3857
3852
  running: { type: Boolean }
3858
3853
  },
3859
3854
  setup(o) {
3860
- let c = o, l = K(), u = t(() => ma(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 ? So(c.output) : void 0), h = t(() => m.value?.kind === "invalid"), g = 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(() => {
3861
3856
  let e = m.value;
3862
3857
  return e === void 0 ? "" : e.kind === "error" ? e.message : l.t(`kvcoder.ui.failure.${e.kind}`);
3863
- }), v = t(() => c.failed === !0 ? void 0 : Lo(c.output)), b = t(() => c.failed === !0 && u.value !== "line"), x = t(() => c.durationMs === void 0 ? "" : Fs(l.t, (c.view.writtenMs ?? 0) + c.durationMs)), S = t(() => {
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(() => {
3864
3859
  if (c.durationMs === void 0) return "";
3865
- let e = Fs(l.t, c.durationMs);
3860
+ let e = Rs(l.t, c.durationMs);
3866
3861
  return c.view.writtenMs === void 0 ? l.t("kvcoder.ui.callRan", { ran: e }) : l.t("kvcoder.ui.callParts", {
3867
- written: Fs(l.t, c.view.writtenMs),
3862
+ written: Rs(l.t, c.view.writtenMs),
3868
3863
  ran: e
3869
3864
  });
3870
3865
  });
@@ -3886,14 +3881,14 @@ var Is = {
3886
3881
  key: 0,
3887
3882
  class: "kvc-spin",
3888
3883
  "aria-label": D(l).t("kvcoder.ui.running")
3889
- }, null, 8, sc)) : (_(), n(C(d.value ? D(ce) : D(le)), {
3884
+ }, null, 8, uc)) : (_(), n(C(d.value ? D(U) : D(le)), {
3890
3885
  key: 1,
3891
3886
  size: 16,
3892
3887
  "aria-hidden": "true"
3893
3888
  })),
3894
- a("span", cc, [
3895
- c.view.description ? (_(), i("span", lc, E(c.view.description), 1)) : c.view.connector === void 0 && c.view.line ? (_(), i("span", uc, [a("span", dc, E(D(ha)(c.view.line)), 1)])) : r("v-if", !0),
3896
- s(ac, {
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, {
3897
3892
  view: c.view,
3898
3893
  result: v.value
3899
3894
  }, null, 8, ["view", "result"]),
@@ -3904,22 +3899,22 @@ var Is = {
3904
3899
  "data-test": "call-reason"
3905
3900
  }, E(g.value), 3))
3906
3901
  ]),
3907
- c.view.risky ? (_(), i("span", fc, E(D(l).t("kvcoder.ui.call.risky")), 1)) : r("v-if", !0),
3908
- c.view.background ? (_(), i("span", pc, E(D(l).t("kvcoder.ui.jobs.background")), 1)) : r("v-if", !0),
3909
- h.value ? (_(), i("span", mc, E(D(l).t("kvcoder.ui.callNotRun")), 1)) : c.failed ? (_(), i("span", hc, E(D(l).t("kvcoder.ui.callFailed")), 1)) : r("v-if", !0),
3910
- a("span", gc, E(x.value), 1)
3911
- ], 8, oc), d.value && c.output !== void 0 ? (_(), i(e, { key: 0 }, [S.value === "" ? r("v-if", !0) : (_(), i("p", _c, E(S.value), 1)), b.value ? (_(), i(e, { key: 1 }, [a("button", {
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", {
3912
3907
  type: "button",
3913
3908
  class: "kvc-text-button kvc-fold",
3914
3909
  "aria-expanded": p.value,
3915
3910
  "data-test": "call-details",
3916
3911
  onClick: o[1] ||= (e) => p.value = !p.value
3917
- }, E(D(l).t(p.value ? "kvcoder.ui.call.hideDetails" : "kvcoder.ui.call.showDetails")), 9, vc), p.value ? (_(), i(e, { key: 0 }, [a("pre", {
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", {
3918
3913
  class: "kvc-block kvc-error",
3919
3914
  dir: "auto",
3920
3915
  "aria-label": D(l).t("kvcoder.ui.call.error"),
3921
3916
  "data-test": "call-error"
3922
- }, [s(Y, { text: c.output }, null, 8, ["text"])], 8, yc), s(js, { view: c.view }, null, 8, ["view"])], 64)) : r("v-if", !0)], 64)) : (_(), i(e, { key: 2 }, [s(js, { view: c.view }, null, 8, ["view"]), s($s, {
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, {
3923
3918
  view: c.view,
3924
3919
  output: c.output,
3925
3920
  result: v.value
@@ -3929,60 +3924,63 @@ var Is = {
3929
3924
  "result"
3930
3925
  ])], 64))], 64)) : r("v-if", !0)], 2));
3931
3926
  }
3932
- }), xc = {
3927
+ }), wc = {
3933
3928
  key: 0,
3934
3929
  class: "kvc-card",
3935
3930
  "data-test": "background-result"
3936
- }, Sc = { class: "kvc-card-row" }, Cc = {
3931
+ }, Tc = { class: "kvc-card-row" }, Ec = {
3937
3932
  style: {
3938
3933
  flex: "1 1 auto",
3939
3934
  "min-inline-size": "0"
3940
3935
  },
3941
3936
  "data-test": "background-title"
3942
- }, wc = {
3937
+ }, Dc = {
3943
3938
  key: 0,
3944
3939
  class: "kvc-muted",
3945
3940
  "data-test": "background-time"
3946
- }, Tc = { class: "kvc-output" }, Ec = {
3941
+ }, Oc = { class: "kvc-output" }, kc = {
3947
3942
  key: 1,
3948
3943
  class: "kvc-card",
3949
3944
  "data-test": "kvcoder-hint"
3950
- }, Dc = { class: "kvc-card-row" }, Oc = { class: "kvc-card-body kvc-muted" }, kc = {
3945
+ }, Ac = { class: "kvc-card-row" }, jc = { class: "kvc-card-body kvc-muted" }, Mc = {
3951
3946
  key: 0,
3952
3947
  style: {
3953
3948
  display: "flex",
3954
3949
  gap: "6px",
3955
3950
  "margin-block-start": "6px"
3956
3951
  }
3957
- }, Ac = ["src", "alt"], jc = {
3952
+ }, Nc = ["src", "alt"], Pc = {
3958
3953
  key: 1,
3959
3954
  class: "kvc-muted",
3960
3955
  style: { display: "block" },
3961
3956
  "data-test": "queued"
3962
- }, Mc = {
3957
+ }, Fc = {
3963
3958
  key: 3,
3964
3959
  class: "kvc-answer",
3965
3960
  "data-test": "assistant-message"
3966
- }, Nc = {
3961
+ }, Ic = {
3967
3962
  key: 0,
3968
3963
  "data-test": "thinking"
3969
- }, Pc = { class: "kvc-muted" }, Fc = {
3964
+ }, Lc = { class: "kvc-muted" }, Rc = {
3970
3965
  class: "kvc-muted",
3971
3966
  style: { "white-space": "pre-wrap" }
3972
- }, Ic = {
3973
- key: 7,
3967
+ }, zc = {
3968
+ key: 6,
3969
+ "data-test": "extension-card"
3970
+ }, Bc = {
3971
+ key: 8,
3974
3972
  class: "kvc-notice",
3975
3973
  "data-test": "notice"
3976
- }, Lc = {
3977
- key: 8,
3974
+ }, Vc = {
3975
+ key: 9,
3978
3976
  class: "kvc-card kvc-card-row",
3979
3977
  role: "note",
3980
3978
  "data-test": "note"
3981
- }, Rc = {
3982
- key: 9,
3979
+ }, Hc = {
3980
+ key: 10,
3983
3981
  class: "kvc-card",
3984
3982
  "data-test": "summary"
3985
- }, zc = { class: "kvc-card-row" }, Bc = { class: "kvc-card-body" }, Vc = /* @__PURE__ */ c({
3983
+ }, Uc = { class: "kvc-card-row" }, Wc = { class: "kvc-card-body" }, Gc = /* @__PURE__ */ c({
3986
3984
  __name: "MessageItem",
3987
3985
  props: {
3988
3986
  message: {},
@@ -3991,58 +3989,58 @@ var Is = {
3991
3989
  },
3992
3990
  emits: ["openArtifact"],
3993
3991
  setup(c, { emit: l }) {
3994
- let u = c, d = l, p = K(), m = t(() => ja(u.message.content.content)), h = t(() => Ma(u.message)), g = t(() => Fa(u.message, u.calls)), v = t(() => Va(u.message)), y = t(() => qa(u.message)), x = t(() => {
3995
- 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) ?? Ka(u.message);
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);
3996
3994
  return t === void 0 ? p.t(e) : p.t(`${e}Named`, { name: rt(t) });
3997
- }), S = t(() => {
3998
- let e = u.finishedRuns?.get(Wa(u.message) ?? "");
3999
- return e === void 0 ? void 0 : Fs(p.t, e.ranMs);
4000
- }), w = t(() => Ra(u.message, u.calls)), T = t(() => {
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(() => {
4001
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);
4002
4000
  return p.t(`kvcoder.notices.${i === void 0 || a !== "STEP_FAILED" ? a : "STEP_FAILED_REASON"}`, {
4003
4001
  ...e,
4004
4002
  ...r,
4005
4003
  ...i === void 0 ? {} : { reason: rt(i) }
4006
4004
  });
4007
- }), O = t(() => {
4005
+ }), k = t(() => {
4008
4006
  let e = u.message.content.params;
4009
4007
  return p.t(String(u.message.content.key), typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : {});
4010
- }), k = (e) => `/api/files/${encodeURIComponent(e)}?workspaceId=${encodeURIComponent(p.workspace.value.id)}`, A = (e) => ({
4008
+ }), A = (e) => `/api/files/${encodeURIComponent(e)}?workspaceId=${encodeURIComponent(p.workspace.value.id)}`, j = (e) => ({
4011
4009
  type: "markdown",
4012
4010
  text: "kvcoder.markdown",
4013
4011
  params: { text: e }
4014
4012
  });
4015
- return (t, c) => D(Ba)(u.message) ? (_(), i("div", xc, [a("details", null, [a("summary", Sc, [
4013
+ return (t, c) => D(Va)(u.message) ? (_(), i("div", wc, [a("details", null, [a("summary", Tc, [
4016
4014
  s(D(oe), {
4017
4015
  size: 16,
4018
4016
  "aria-hidden": "true"
4019
4017
  }),
4020
- a("span", Cc, E(x.value), 1),
4021
- S.value === void 0 ? r("v-if", !0) : (_(), i("span", wc, E(S.value), 1))
4022
- ]), a("pre", Tc, E(m.value), 1)])])) : D(za)(u.message) ? (_(), i("div", Ec, [a("details", null, [a("summary", Dc, [s(D(xe), {
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), {
4023
4021
  size: 16,
4024
4022
  "aria-hidden": "true"
4025
- }), o(E(D(p).t("kvcoder.ui.toModel")), 1)]), a("div", Oc, E(m.value), 1)])])) : u.message.kind === "user" ? (_(), i("div", {
4023
+ }), o(E(D(p).t("kvcoder.ui.toModel")), 1)]), a("div", jc, E(m.value), 1)])])) : u.message.kind === "user" ? (_(), i("div", {
4026
4024
  key: 2,
4027
4025
  dir: "auto",
4028
4026
  class: f(["kvc-user", { "kvc-queued": u.message.queued }]),
4029
4027
  "data-test": "user-message"
4030
4028
  }, [
4031
- a("span", null, E(D(Ua)(m.value, D(p).t("kvcoder.ui.attachedFiles"))), 1),
4032
- u.message.fileIds ? (_(), i("span", kc, [(_(!0), i(e, null, b(u.message.fileIds, (e) => (_(), i("img", {
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", {
4033
4031
  key: e,
4034
- src: k(e),
4032
+ src: A(e),
4035
4033
  alt: D(p).t("kvcoder.ui.attachment"),
4036
4034
  style: {
4037
4035
  "block-size": "48px",
4038
4036
  "border-radius": "6px"
4039
4037
  }
4040
- }, null, 8, Ac))), 128))])) : r("v-if", !0),
4041
- u.message.queued ? (_(), i("span", jc, E(D(p).t("kvcoder.ui.queued")), 1)) : r("v-if", !0)
4042
- ], 2)) : u.message.kind === "assistant" && (h.value !== "" || m.value !== "") ? (_(), i("div", Mc, [h.value === "" ? r("v-if", !0) : (_(), i("details", Nc, [a("summary", Pc, E(D(p).t("kvcoder.ui.thought")), 1), a("p", Fc, E(h.value), 1)])), m.value === "" ? r("v-if", !0) : (_(), n(C(D(p).View), {
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), {
4043
4041
  key: 1,
4044
- view: A(m.value)
4045
- }, null, 8, ["view"]))])) : u.message.kind === "toolResult" && v.value !== void 0 ? (_(), n(vo, {
4042
+ view: j(m.value)
4043
+ }, null, 8, ["view"]))])) : u.message.kind === "toolResult" && v.value !== void 0 ? (_(), n(xo, {
4046
4044
  key: 4,
4047
4045
  id: v.value.id,
4048
4046
  title: v.value.title,
@@ -4054,7 +4052,7 @@ var Is = {
4054
4052
  "title",
4055
4053
  "format",
4056
4054
  "version"
4057
- ])) : w.value === void 0 ? u.message.kind === "toolResult" ? (_(), i(e, { key: 6 }, [s(bc, {
4055
+ ])) : T.value === void 0 ? y.value === void 0 ? u.message.kind === "toolResult" ? (_(), i(e, { key: 7 }, [s(Cc, {
4058
4056
  view: g.value,
4059
4057
  failed: g.value.failed,
4060
4058
  "duration-ms": g.value.durationMs,
@@ -4064,49 +4062,53 @@ var Is = {
4064
4062
  "failed",
4065
4063
  "duration-ms",
4066
4064
  "output"
4067
- ]), y.value === void 0 ? r("v-if", !0) : (_(), n(Si, {
4065
+ ]), x.value === void 0 ? r("v-if", !0) : (_(), n(Ci, {
4068
4066
  key: 0,
4069
4067
  "session-id": u.message.sessionId,
4070
- "run-id": y.value
4071
- }, null, 8, ["session-id", "run-id"]))], 64)) : u.message.kind === "notice" ? (_(), i("div", Ic, E(T.value), 1)) : u.message.kind === "note" ? (_(), i("div", Lc, [s(D(Se), {
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), {
4072
4070
  size: 18,
4073
4071
  "aria-hidden": "true"
4074
- }), o(E(O.value), 1)])) : u.message.kind === "summary" ? (_(), i("details", Rc, [a("summary", zc, [s(D(Ee), {
4072
+ }), o(E(k.value), 1)])) : u.message.kind === "summary" ? (_(), i("details", Hc, [a("summary", Uc, [s(D(Ee), {
4075
4073
  size: 16,
4076
4074
  "aria-hidden": "true"
4077
- }), o(E(D(p).t("kvcoder.ui.summarized")), 1)]), a("div", Bc, [(_(), n(C(D(p).View), { view: A(String(u.message.content.text ?? "")) }, null, 8, ["view"]))])])) : r("v-if", !0) : (_(), n(po, {
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, {
4078
4080
  key: 5,
4079
- answered: w.value
4081
+ answered: T.value
4080
4082
  }, null, 8, ["answered"]));
4081
4083
  }
4082
- }), Hc = {
4084
+ }), Kc = {
4083
4085
  class: "kvc-card kvc-ask",
4084
4086
  "data-test": "approvals-card"
4085
- }, Uc = {
4087
+ }, qc = {
4086
4088
  class: "kvc-card-row",
4087
4089
  style: { "font-weight": "600" }
4088
- }, Wc = ["data-test"], Gc = { class: "kvc-card-row" }, Kc = { class: "kvc-lines" }, qc = {
4090
+ }, Jc = ["data-test"], Yc = { class: "kvc-card-row" }, Xc = { class: "kvc-lines" }, Zc = {
4089
4091
  key: 0,
4090
4092
  style: { "font-weight": "600" },
4091
4093
  "data-test": "call-description"
4092
- }, Jc = {
4094
+ }, Qc = {
4093
4095
  key: 2,
4094
4096
  dir: "ltr",
4095
4097
  style: { "align-self": "flex-start" },
4096
4098
  "data-test": "call-subject"
4097
- }, Yc = {
4099
+ }, $c = {
4098
4100
  key: 3,
4099
4101
  class: "kvc-chip",
4100
4102
  style: { "align-self": "flex-start" },
4101
4103
  "data-test": "call-background"
4102
- }, Xc = {
4104
+ }, el = {
4103
4105
  class: "kvc-card-row kvc-actions",
4104
4106
  "data-test": "decision-actions"
4105
- }, Zc = ["onClick"], Qc = ["onClick"], $c = {
4107
+ }, tl = ["onClick"], nl = ["onClick"], rl = {
4106
4108
  key: 0,
4107
4109
  class: "kvc-card-row kvc-actions",
4108
4110
  style: { "border-block-start": "1px solid var(--kv-color-border)" }
4109
- }, el = /* @__PURE__ */ c({
4111
+ }, il = /* @__PURE__ */ c({
4110
4112
  __name: "ApprovalsCard",
4111
4113
  props: { approvals: {} },
4112
4114
  emits: ["decide"],
@@ -4115,8 +4117,8 @@ var Is = {
4115
4117
  approvals: [...e],
4116
4118
  confirmed: t
4117
4119
  });
4118
- return (t, c) => (_(), i("section", Hc, [
4119
- a("div", Uc, [s(D(Oe), {
4120
+ return (t, c) => (_(), i("section", Kc, [
4121
+ a("div", qc, [s(D(Oe), {
4120
4122
  size: 18,
4121
4123
  "aria-hidden": "true"
4122
4124
  }), o(E(D(d).t("kvcoder.ui.allowCommands", { count: l.approvals.length })), 1)]),
@@ -4125,32 +4127,32 @@ var Is = {
4125
4127
  class: "kvc-approval",
4126
4128
  "data-test": `approval-${e.questionId}`
4127
4129
  }, [
4128
- a("div", Gc, [a("span", Kc, [
4129
- e.view.description ? (_(), i("span", qc, E(e.view.description), 1)) : r("v-if", !0),
4130
- e.view.connector === void 0 ? e.view.line ? (_(), i("span", Jc, [a("span", { class: f(["kvc-mono", { "kvc-muted": e.view.description }]) }, E(e.view.line), 3)])) : r("v-if", !0) : (_(), n(ac, {
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, {
4131
4133
  key: 1,
4132
4134
  view: e.view,
4133
4135
  whole: ""
4134
4136
  }, null, 8, ["view"])),
4135
- e.view.background ? (_(), i("span", Yc, E(D(d).t("kvcoder.ui.jobs.inBackground")), 1)) : r("v-if", !0)
4137
+ e.view.background ? (_(), i("span", $c, E(D(d).t("kvcoder.ui.jobs.inBackground")), 1)) : r("v-if", !0)
4136
4138
  ])]),
4137
- D(ma)(e.view) === "line" ? r("v-if", !0) : (_(), n(js, {
4139
+ D(ha)(e.view) === "line" ? r("v-if", !0) : (_(), n(Ps, {
4138
4140
  key: 0,
4139
4141
  view: e.view
4140
4142
  }, null, 8, ["view"])),
4141
- a("div", Xc, [a("button", {
4143
+ a("div", el, [a("button", {
4142
4144
  type: "button",
4143
4145
  class: "kvc-button",
4144
4146
  "data-test": "deny",
4145
4147
  onClick: (t) => p([e], !1)
4146
- }, E(D(d).t("kvcoder.ui.deny")), 9, Zc), a("button", {
4148
+ }, E(D(d).t("kvcoder.ui.deny")), 9, tl), a("button", {
4147
4149
  type: "button",
4148
4150
  class: "kvc-button kvc-primary",
4149
4151
  "data-test": "allow",
4150
4152
  onClick: (t) => p([e], !0)
4151
- }, E(D(d).t("kvcoder.ui.allow")), 9, Qc)])
4152
- ], 8, Wc))), 128)),
4153
- l.approvals.length > 1 ? (_(), i("div", $c, [a("button", {
4153
+ }, E(D(d).t("kvcoder.ui.allow")), 9, nl)])
4154
+ ], 8, Jc))), 128)),
4155
+ l.approvals.length > 1 ? (_(), i("div", rl, [a("button", {
4154
4156
  type: "button",
4155
4157
  class: "kvc-button",
4156
4158
  "data-test": "deny-all",
@@ -4163,13 +4165,13 @@ var Is = {
4163
4165
  }, E(D(d).t("kvcoder.ui.allowAll")), 1)])) : r("v-if", !0)
4164
4166
  ]));
4165
4167
  }
4166
- }), tl = /* @__PURE__ */ new Map();
4167
- function nl(e) {
4168
- let t = tl.get(e);
4169
- return t === void 0 && (t = v(/* @__PURE__ */ new Map()), tl.set(e, t)), t;
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;
4170
4172
  }
4171
- function rl(e, t, n) {
4172
- let r = nl(e), i = r.get(t);
4173
+ function sl(e, t, n) {
4174
+ let r = ol(e), i = r.get(t);
4173
4175
  return i === void 0 ? (i = v({
4174
4176
  text: "",
4175
4177
  selected: [],
@@ -4180,55 +4182,55 @@ function rl(e, t, n) {
4180
4182
  owner: n
4181
4183
  }), r.set(t, i)) : n !== void 0 && i.owner === void 0 && (i.owner = n), i;
4182
4184
  }
4183
- var il = (e, t, n) => nl(e).get(t) === n, al = (e) => new Set([...nl(e)].filter(([, e]) => e.settled).map(([e]) => e));
4184
- function ol(e) {
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) {
4185
4187
  e.text = "", e.selected = [], e.other = "", e.error = void 0, e.sending = !1, e.settled = !0;
4186
4188
  }
4187
- function sl(e, t, n) {
4188
- let r = nl(e);
4189
+ function dl(e, t, n) {
4190
+ let r = ol(e);
4189
4191
  for (let [e, i] of r) {
4190
4192
  if (i.owner?.sessionId !== t) continue;
4191
4193
  let a = n.find((e) => e.id === i.owner?.turnId && e.sessionId === t);
4192
- a !== void 0 && (a.outcome === void 0 && a.endedAt === void 0 && a.pending.some((t) => t.questionId === e) || (ol(i), r.delete(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)));
4193
4195
  }
4194
4196
  }
4195
4197
  //#endregion
4196
4198
  //#region web/src/QuestionCard.vue?vue&type=script&setup=true&lang.ts
4197
- var cl = ["aria-label", "aria-busy"], ll = {
4199
+ var fl = ["aria-label", "aria-busy"], pl = {
4198
4200
  class: "kvc-card-row",
4199
4201
  style: { "font-weight": "600" }
4200
- }, ul = { dir: "auto" }, dl = { class: "kvc-card-body" }, fl = {
4202
+ }, ml = { dir: "auto" }, hl = { class: "kvc-card-body" }, gl = {
4201
4203
  key: 0,
4202
4204
  role: "status",
4203
4205
  "data-test": "answer-sending"
4204
- }, pl = {
4206
+ }, _l = {
4205
4207
  key: 1,
4206
4208
  role: "alert",
4207
4209
  "data-test": "answer-error"
4208
- }, ml = [
4210
+ }, vl = [
4209
4211
  "disabled",
4210
4212
  "placeholder",
4211
4213
  "aria-label"
4212
- ], hl = { class: "kvc-actions" }, gl = ["disabled"], _l = ["disabled"], vl = ["data-test"], yl = [
4214
+ ], yl = { class: "kvc-actions" }, bl = ["disabled"], xl = ["disabled"], Sl = ["data-test"], Cl = [
4213
4215
  "type",
4214
4216
  "checked",
4215
4217
  "disabled",
4216
4218
  "name",
4217
4219
  "onChange"
4218
- ], bl = { style: {
4220
+ ], wl = { style: {
4219
4221
  display: "flex",
4220
4222
  "flex-direction": "column"
4221
- } }, xl = { style: { "font-weight": "500" } }, Sl = {
4223
+ } }, Tl = { style: { "font-weight": "500" } }, El = {
4222
4224
  key: 0,
4223
4225
  class: "kvc-muted"
4224
- }, Cl = [
4226
+ }, Dl = [
4225
4227
  "disabled",
4226
4228
  "placeholder",
4227
4229
  "aria-label"
4228
- ], wl = { class: "kvc-actions" }, Tl = ["disabled"], El = ["disabled"], Dl = {
4230
+ ], Ol = { class: "kvc-actions" }, kl = ["disabled"], Al = ["disabled"], jl = {
4229
4231
  key: 4,
4230
4232
  class: "kvc-actions"
4231
- }, Ol = ["disabled"], kl = ["disabled"], Al = /* @__PURE__ */ c({
4233
+ }, Ml = ["disabled"], Nl = ["disabled"], Pl = /* @__PURE__ */ c({
4232
4234
  __name: "QuestionCard",
4233
4235
  props: {
4234
4236
  questionId: {},
@@ -4237,7 +4239,7 @@ var cl = ["aria-label", "aria-busy"], ll = {
4237
4239
  },
4238
4240
  emits: ["answer"],
4239
4241
  setup(n, { emit: o }) {
4240
- let c = n, l = o, u = K(), d = t(() => String(c.question.kind ?? "text")), p = t(() => String(c.question.prompt ?? "")), m = t(() => Ja(c.question)), h = t(() => c.question.multiple === !0), g = t(() => c.question.other === !0), v = t(() => rl(u.workspace.value.id, c.questionId, c.owner)), y = t(() => Je(u.t, v.value.error));
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));
4241
4243
  function x(e) {
4242
4244
  !v.value.sending && !v.value.settled && l("answer", {
4243
4245
  questionId: c.questionId,
@@ -4260,12 +4262,12 @@ var cl = ["aria-label", "aria-busy"], ll = {
4260
4262
  "data-test": "question-card",
4261
4263
  "aria-label": p.value,
4262
4264
  "aria-busy": v.value.sending
4263
- }, [a("div", ll, [s(D(de), {
4265
+ }, [a("div", pl, [s(D(de), {
4264
4266
  size: 18,
4265
4267
  "aria-hidden": "true"
4266
- }), a("span", ul, E(p.value), 1)]), a("div", dl, [
4267
- v.value.sending ? (_(), i("p", fl, E(D(u).t("kvcoder.ui.answerSending")), 1)) : r("v-if", !0),
4268
- v.value.error === void 0 ? r("v-if", !0) : (_(), i("p", pl, E(D(u).t("kvcoder.ui.answerFailed", { error: y.value })), 1)),
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)),
4269
4271
  d.value === "text" ? (_(), i(e, { key: 2 }, [M(a("input", {
4270
4272
  "onUpdate:modelValue": n[0] ||= (e) => v.value.text = e,
4271
4273
  disabled: v.value.sending,
@@ -4275,19 +4277,19 @@ var cl = ["aria-label", "aria-busy"], ll = {
4275
4277
  "aria-label": p.value,
4276
4278
  "data-test": "answer-text",
4277
4279
  onKeydown: n[1] ||= N(P((e) => x({ text: v.value.text }), ["prevent"]), ["enter"])
4278
- }, null, 40, ml), [[k, v.value.text]]), a("div", hl, [a("button", {
4280
+ }, null, 40, vl), [[k, v.value.text]]), a("div", yl, [a("button", {
4279
4281
  type: "button",
4280
4282
  disabled: v.value.sending,
4281
4283
  class: "kvc-button",
4282
4284
  "data-test": "skip",
4283
4285
  onClick: n[2] ||= (e) => x({ dismissed: !0 })
4284
- }, E(D(u).t("kvcoder.ui.skip")), 9, gl), a("button", {
4286
+ }, E(D(u).t("kvcoder.ui.skip")), 9, bl), a("button", {
4285
4287
  type: "button",
4286
4288
  disabled: v.value.sending,
4287
4289
  class: "kvc-button kvc-primary",
4288
4290
  "data-test": "answer",
4289
4291
  onClick: n[3] ||= (e) => x({ text: v.value.text })
4290
- }, E(D(u).t(v.value.error === void 0 ? "kvcoder.ui.answer" : "kvcoder.ui.tryAgain")), 9, _l)])], 64)) : d.value === "choice" ? (_(), i(e, { key: 3 }, [
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 }, [
4291
4293
  (_(!0), i(e, null, b(m.value, (e) => (_(), i("label", {
4292
4294
  key: e.id,
4293
4295
  class: "kvc-option",
@@ -4298,7 +4300,7 @@ var cl = ["aria-label", "aria-busy"], ll = {
4298
4300
  disabled: v.value.sending,
4299
4301
  name: c.questionId,
4300
4302
  onChange: (t) => S(e.id)
4301
- }, null, 40, yl), a("span", bl, [a("span", xl, E(e.label), 1), e.description ? (_(), i("span", Sl, E(e.description), 1)) : r("v-if", !0)])], 8, vl))), 128)),
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)),
4302
4304
  g.value ? M((_(), i("input", {
4303
4305
  key: 0,
4304
4306
  "onUpdate:modelValue": n[4] ||= (e) => v.value.other = e,
@@ -4307,36 +4309,36 @@ var cl = ["aria-label", "aria-busy"], ll = {
4307
4309
  placeholder: D(u).t("kvcoder.ui.other"),
4308
4310
  "aria-label": D(u).t("kvcoder.ui.other"),
4309
4311
  "data-test": "answer-other"
4310
- }, null, 8, Cl)), [[k, v.value.other]]) : r("v-if", !0),
4311
- a("div", wl, [a("button", {
4312
+ }, null, 8, Dl)), [[k, v.value.other]]) : r("v-if", !0),
4313
+ a("div", Ol, [a("button", {
4312
4314
  type: "button",
4313
4315
  disabled: v.value.sending,
4314
4316
  class: "kvc-button",
4315
4317
  "data-test": "skip",
4316
4318
  onClick: n[5] ||= (e) => x({ dismissed: !0 })
4317
- }, E(D(u).t("kvcoder.ui.skip")), 9, Tl), a("button", {
4319
+ }, E(D(u).t("kvcoder.ui.skip")), 9, kl), a("button", {
4318
4320
  type: "button",
4319
4321
  class: "kvc-button kvc-primary",
4320
4322
  disabled: v.value.sending || v.value.selected.length === 0 && v.value.other.trim() === "",
4321
4323
  "data-test": "answer",
4322
4324
  onClick: C
4323
- }, E(D(u).t(v.value.error === void 0 ? "kvcoder.ui.answer" : "kvcoder.ui.tryAgain")), 9, El)])
4324
- ], 64)) : (_(), i("div", Dl, [a("button", {
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", {
4325
4327
  type: "button",
4326
4328
  disabled: v.value.sending,
4327
4329
  class: "kvc-button",
4328
4330
  "data-test": "answer-no",
4329
4331
  onClick: n[6] ||= (e) => x({ confirmed: !1 })
4330
- }, E(D(u).t("kvcoder.ui.no")), 9, Ol), a("button", {
4332
+ }, E(D(u).t("kvcoder.ui.no")), 9, Ml), a("button", {
4331
4333
  type: "button",
4332
4334
  disabled: v.value.sending,
4333
4335
  class: f(["kvc-button kvc-primary", { "kvc-danger": c.question.danger === !0 }]),
4334
4336
  "data-test": "answer-yes",
4335
4337
  onClick: n[7] ||= (e) => x({ confirmed: !0 })
4336
- }, E(D(u).t("kvcoder.ui.yes")), 11, kl)]))
4337
- ])], 8, cl));
4338
+ }, E(D(u).t("kvcoder.ui.yes")), 11, Nl)]))
4339
+ ])], 8, fl));
4338
4340
  }
4339
- }), jl = /* @__PURE__ */ c({
4341
+ }), Fl = /* @__PURE__ */ c({
4340
4342
  __name: "PendingCards",
4341
4343
  props: {
4342
4344
  pending: {},
@@ -4350,9 +4352,9 @@ var cl = ["aria-label", "aria-busy"], ll = {
4350
4352
  question: q(e.question)
4351
4353
  }))), d = t(() => s.pending.filter((e) => e.kind === "approval" && l(e)).map((e) => ({
4352
4354
  questionId: String(e.questionId),
4353
- view: fa(q(e.question))
4355
+ view: pa(q(e.question))
4354
4356
  })));
4355
- return (t, a) => (_(), i(e, null, [(_(!0), i(e, null, b(u.value, (e) => (_(), n(Al, {
4357
+ return (t, a) => (_(), i(e, null, [(_(!0), i(e, null, b(u.value, (e) => (_(), n(Pl, {
4356
4358
  key: e.questionId,
4357
4359
  "question-id": e.questionId,
4358
4360
  question: e.question,
@@ -4362,7 +4364,7 @@ var cl = ["aria-label", "aria-busy"], ll = {
4362
4364
  "question-id",
4363
4365
  "question",
4364
4366
  "owner"
4365
- ]))), 128)), d.value.length > 0 ? (_(), n(el, {
4367
+ ]))), 128)), d.value.length > 0 ? (_(), n(il, {
4366
4368
  key: 0,
4367
4369
  approvals: d.value,
4368
4370
  onDecide: a[1] ||= (e) => c("decide", {
@@ -4374,12 +4376,12 @@ var cl = ["aria-label", "aria-busy"], ll = {
4374
4376
  });
4375
4377
  //#endregion
4376
4378
  //#region web/src/use-model-groups.ts
4377
- function Ml(e, t, n) {
4379
+ function Il(e, t, n) {
4378
4380
  let r = y([]);
4379
4381
  return h(async () => {
4380
4382
  try {
4381
4383
  let [n, i] = await Promise.all([e.exec("kvai.provider.list", {}), e.exec("kvai.model.list", {})]);
4382
- r.value = Ir(n, i, t());
4384
+ r.value = Mr(n, i, t());
4383
4385
  } catch (e) {
4384
4386
  n(e);
4385
4387
  }
@@ -4387,15 +4389,15 @@ function Ml(e, t, n) {
4387
4389
  }
4388
4390
  //#endregion
4389
4391
  //#region web/src/RecoveryActions.vue?vue&type=script&setup=true&lang.ts
4390
- var Nl = {
4392
+ var Ll = {
4391
4393
  class: "kvc-recovery",
4392
4394
  "data-test": "recovery"
4393
- }, Pl = ["disabled"], Fl = { class: "kvc-recovery-picker" }, Il = /* @__PURE__ */ c({
4395
+ }, Rl = ["disabled"], zl = { class: "kvc-recovery-picker" }, Bl = /* @__PURE__ */ c({
4394
4396
  __name: "RecoveryActions",
4395
4397
  props: { sessionId: {} },
4396
4398
  emits: ["sent"],
4397
4399
  setup(e, { emit: t }) {
4398
- let n = e, r = t, c = K(), l = Ml(c, () => null, (e) => J(c, e));
4400
+ let n = e, r = t, c = K(), l = Il(c, () => null, (e) => J(c, e));
4399
4401
  async function u() {
4400
4402
  await c.exec("kvcoder.turn.retry", { sessionId: n.sessionId }), r("sent");
4401
4403
  }
@@ -4416,9 +4418,9 @@ var Nl = {
4416
4418
  await c.exec("kvcoder.session.configure", {
4417
4419
  sessionId: n.sessionId,
4418
4420
  model: e
4419
- }), await ni(c, e), await u();
4421
+ }), await Qr(c, e), await u();
4420
4422
  });
4421
- return (e, t) => (_(), i("div", Nl, [a("button", {
4423
+ return (e, t) => (_(), i("div", Ll, [a("button", {
4422
4424
  type: "button",
4423
4425
  class: "kvc-button",
4424
4426
  disabled: d.value,
@@ -4427,34 +4429,34 @@ var Nl = {
4427
4429
  }, [s(D(Te), {
4428
4430
  size: 14,
4429
4431
  "aria-hidden": "true"
4430
- }), o(E(D(c).t("kvcoder.ui.retry")), 1)], 8, Pl), a("div", Fl, [s(ei, {
4432
+ }), o(E(D(c).t("kvcoder.ui.retry")), 1)], 8, Rl), a("div", zl, [s(Xr, {
4431
4433
  groups: D(l),
4432
4434
  current: null,
4433
4435
  empty: D(c).t("kvcoder.ui.chooseAnotherModel"),
4434
4436
  onPick: m
4435
4437
  }, null, 8, ["groups", "empty"])])]));
4436
4438
  }
4437
- }), Ll = {
4439
+ }), Vl = {
4438
4440
  class: "kvc-column",
4439
4441
  "data-test": "prompt-tab"
4440
- }, Rl = { style: {
4442
+ }, Hl = { style: {
4441
4443
  display: "flex",
4442
4444
  "align-items": "center",
4443
4445
  gap: "10px"
4444
- } }, zl = { style: { flex: "1 1 auto" } }, Bl = {
4446
+ } }, Ul = { style: { flex: "1 1 auto" } }, Wl = {
4445
4447
  key: 0,
4446
4448
  style: {
4447
4449
  margin: "0",
4448
4450
  "padding-inline-start": "20px"
4449
4451
  }
4450
- }, Vl = {
4452
+ }, Gl = {
4451
4453
  key: 0,
4452
4454
  class: "kvc-chip kvc-warn"
4453
- }, Hl = {
4455
+ }, Kl = {
4454
4456
  key: 1,
4455
4457
  class: "kvc-prompt",
4456
4458
  "data-test": "prompt-text"
4457
- }, Ul = /* @__PURE__ */ c({
4459
+ }, ql = /* @__PURE__ */ c({
4458
4460
  __name: "PromptTab",
4459
4461
  props: { sessionId: {} },
4460
4462
  emits: ["back"],
@@ -4470,8 +4472,8 @@ var Nl = {
4470
4472
  async function f() {
4471
4473
  d.value !== null && (await navigator.clipboard.writeText(d.value.prompt), u.toast("kvcoder.ui.copied", {}, "success"));
4472
4474
  }
4473
- return (t, n) => (_(), i("div", Ll, [
4474
- a("div", Rl, [
4475
+ return (t, n) => (_(), i("div", Vl, [
4476
+ a("div", Hl, [
4475
4477
  a("button", {
4476
4478
  type: "button",
4477
4479
  class: "kvc-button",
@@ -4482,15 +4484,15 @@ var Nl = {
4482
4484
  class: "kvc-flip",
4483
4485
  "aria-hidden": "true"
4484
4486
  }), o(E(D(u).t("kvcoder.ui.showChat")), 1)]),
4485
- a("strong", zl, E(D(u).t("kvcoder.ui.promptTitle")), 1),
4487
+ a("strong", Ul, E(D(u).t("kvcoder.ui.promptTitle")), 1),
4486
4488
  a("button", {
4487
4489
  type: "button",
4488
4490
  class: "kvc-button",
4489
4491
  "data-test": "copy-prompt",
4490
4492
  onClick: f
4491
- }, [s(D(G), { size: 16 }), o(E(D(u).t("kvcoder.ui.copy")), 1)])
4493
+ }, [s(D(he), { size: 16 }), o(E(D(u).t("kvcoder.ui.copy")), 1)])
4492
4494
  ]),
4493
- d.value ? (_(), i("ul", Bl, [(_(!0), i(e, null, b(d.value.sections, (e) => (_(), i("li", {
4495
+ d.value ? (_(), i("ul", Wl, [(_(!0), i(e, null, b(d.value.sections, (e) => (_(), i("li", {
4494
4496
  key: `${e.owner}/${e.id}`,
4495
4497
  class: "kvc-muted",
4496
4498
  "data-test": "prompt-section"
@@ -4499,14 +4501,14 @@ var Nl = {
4499
4501
  owner: e.owner,
4500
4502
  reach: D(u).t(`kvcoder.ui.reach.${e.reach}`),
4501
4503
  size: e.size
4502
- })) + " ", 1), e.included ? r("v-if", !0) : (_(), i("span", Vl, E(D(u).t("kvcoder.ui.leftOut")), 1))]))), 128))])) : r("v-if", !0),
4503
- d.value ? (_(), i("pre", Hl, E(d.value.prompt), 1)) : r("v-if", !0)
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)
4504
4506
  ]));
4505
4507
  }
4506
4508
  });
4507
4509
  //#endregion
4508
4510
  //#region web/src/use-session-actions.ts
4509
- function Wl(e, t, n) {
4511
+ function Jl(e, t, n) {
4510
4512
  let r = T();
4511
4513
  async function i(t) {
4512
4514
  try {
@@ -4539,7 +4541,7 @@ function Wl(e, t, n) {
4539
4541
  await e.exec("kvcoder.session.configure", {
4540
4542
  sessionId: t(),
4541
4543
  ...n
4542
- }), n.model !== void 0 && await ni(e, n.model);
4544
+ }), n.model !== void 0 && await Qr(e, n.model);
4543
4545
  }),
4544
4546
  rename: (n) => a("rename", async () => {
4545
4547
  n.trim() !== "" && await e.exec("kvcoder.session.rename", {
@@ -4569,13 +4571,13 @@ function Wl(e, t, n) {
4569
4571
  }
4570
4572
  //#endregion
4571
4573
  //#region web/src/SessionModel.vue
4572
- var Gl = /* @__PURE__ */ c({
4574
+ var Yl = /* @__PURE__ */ c({
4573
4575
  __name: "SessionModel",
4574
4576
  props: { session: {} },
4575
4577
  emits: ["changed"],
4576
4578
  setup(e, { emit: t }) {
4577
- let r = e, i = t, a = K(), o = Ml(a, () => r.session.model, (e) => J(a, e)), s = Wl(a, () => r.session.id, () => i("changed"));
4578
- return (e, t) => (_(), n(ti, {
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, {
4579
4581
  groups: D(o),
4580
4582
  model: r.session.model ?? null,
4581
4583
  thinking: r.session.thinking,
@@ -4587,32 +4589,32 @@ var Gl = /* @__PURE__ */ c({
4587
4589
  "thinking"
4588
4590
  ]));
4589
4591
  }
4590
- }), Kl = ["aria-label"], ql = { class: "kvc-card-row" }, Jl = {
4592
+ }), Xl = ["aria-label"], Zl = { class: "kvc-card-row" }, Ql = {
4591
4593
  key: 0,
4592
4594
  class: "kvc-chip kvc-mono",
4593
4595
  "data-test": "subagent-worker"
4594
- }, Yl = { class: "kvc-lines" }, Xl = {
4596
+ }, $l = { class: "kvc-lines" }, eu = {
4595
4597
  style: { "font-weight": "600" },
4596
4598
  "data-test": "subagent-title"
4597
- }, Zl = {
4599
+ }, tu = {
4598
4600
  key: 0,
4599
4601
  class: "kvc-muted kvc-oneline",
4600
4602
  dir: "auto",
4601
4603
  "data-test": "subagent-task"
4602
- }, Ql = {
4604
+ }, nu = {
4603
4605
  key: 1,
4604
4606
  class: "kvc-spin"
4605
- }, $l = {
4607
+ }, ru = {
4606
4608
  key: 0,
4607
4609
  class: "kvc-card-body"
4608
- }, eu = {
4610
+ }, iu = {
4609
4611
  key: 0,
4610
4612
  class: "kvc-muted",
4611
4613
  style: {
4612
4614
  margin: "0",
4613
4615
  "white-space": "pre-wrap"
4614
4616
  }
4615
- }, tu = /* @__PURE__ */ c({
4617
+ }, au = /* @__PURE__ */ c({
4616
4618
  __name: "SubagentCard",
4617
4619
  props: {
4618
4620
  child: {},
@@ -4626,16 +4628,16 @@ var Gl = /* @__PURE__ */ c({
4626
4628
  class: "kvc-card",
4627
4629
  "data-test": "subagent-card",
4628
4630
  "aria-label": D(Ge)(D(l).t, o.child.session.title)
4629
- }, [a("div", ql, [
4631
+ }, [a("div", Zl, [
4630
4632
  s(D(se), {
4631
4633
  size: 18,
4632
4634
  "aria-hidden": "true"
4633
4635
  }),
4634
- o.child.session.worker === void 0 ? r("v-if", !0) : (_(), i("span", Jl, E(o.child.session.worker), 1)),
4635
- a("span", Yl, [a("span", Xl, E(D(Ge)(D(l).t, o.child.session.title)), 1), u.value ? (_(), i("span", Zl, E(u.value), 1)) : r("v-if", !0)]),
4636
- o.child.session.status === "running" ? (_(), i("span", Ql)) : r("v-if", !0),
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),
4637
4639
  a("span", { class: f(["kvc-chip", { "kvc-warn": o.child.session.status === "waiting" }]) }, E(d.value), 3)
4638
- ]), o.child.live.text !== "" || (o.child.turn?.pending.length ?? 0) > 0 ? (_(), i("div", $l, [o.child.live.text === "" ? r("v-if", !0) : (_(), i("p", eu, E(o.child.live.text), 1)), s(jl, {
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, {
4639
4641
  owner: o.child.turn === void 0 ? void 0 : {
4640
4642
  sessionId: o.child.session.id,
4641
4643
  turnId: o.child.turn.id
@@ -4648,22 +4650,22 @@ var Gl = /* @__PURE__ */ c({
4648
4650
  "owner",
4649
4651
  "pending",
4650
4652
  "hidden"
4651
- ])])) : r("v-if", !0)], 8, Kl));
4653
+ ])])) : r("v-if", !0)], 8, Xl));
4652
4654
  }
4653
- }), nu = ["aria-label"], ru = { class: "kvc-card-row" }, iu = {
4655
+ }), ou = ["aria-label"], su = { class: "kvc-card-row" }, cu = {
4654
4656
  class: "kvc-chip kvc-mono",
4655
4657
  "data-test": "worker-card-name"
4656
- }, au = {
4658
+ }, lu = {
4657
4659
  style: {
4658
4660
  flex: "1 1 auto",
4659
4661
  "font-weight": "500"
4660
4662
  },
4661
4663
  dir: "auto",
4662
4664
  "data-test": "worker-card-call"
4663
- }, ou = {
4665
+ }, uu = {
4664
4666
  class: "kvc-chip",
4665
4667
  "data-test": "worker-card-time"
4666
- }, su = ["disabled"], cu = /* @__PURE__ */ c({
4668
+ }, du = ["disabled"], fu = /* @__PURE__ */ c({
4667
4669
  __name: "WorkerCard",
4668
4670
  props: {
4669
4671
  sessionId: {},
@@ -4699,25 +4701,25 @@ var Gl = /* @__PURE__ */ c({
4699
4701
  class: "kvc-card",
4700
4702
  "data-test": "worker-card",
4701
4703
  "aria-label": o.value.title
4702
- }, [a("div", ru, [
4704
+ }, [a("div", su, [
4703
4705
  s(D(se), {
4704
4706
  size: 18,
4705
4707
  "aria-hidden": "true"
4706
4708
  }),
4707
- a("span", iu, E(o.value.title), 1),
4708
- a("span", au, E(o.value.call), 1),
4709
+ a("span", cu, E(o.value.title), 1),
4710
+ a("span", lu, E(o.value.call), 1),
4709
4711
  t[0] ||= a("span", { class: "kvc-spin" }, null, -1),
4710
- a("span", ou, E(D(n).t("kvcoder.ui.jobs.status.running")) + " · " + E(D(wi)(D(n).t, c.value - Date.parse(o.value.startedAt))), 1),
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),
4711
4713
  a("button", {
4712
4714
  type: "button",
4713
4715
  class: "kvc-button",
4714
4716
  disabled: l.value,
4715
4717
  "data-test": "worker-card-stop",
4716
4718
  onClick: d
4717
- }, E(D(n).t("kvcoder.ui.jobs.stop")), 9, su)
4718
- ])], 8, nu));
4719
+ }, E(D(n).t("kvcoder.ui.jobs.stop")), 9, du)
4720
+ ])], 8, ou));
4719
4721
  }
4720
- }), lu = (e) => {
4722
+ }), pu = (e) => {
4721
4723
  let t = e.view.description ?? e.view.line;
4722
4724
  return {
4723
4725
  name: "run",
@@ -4726,8 +4728,8 @@ var Gl = /* @__PURE__ */ c({
4726
4728
  complete: !0
4727
4729
  };
4728
4730
  };
4729
- function uu(e, n, r) {
4730
- let i = t(() => al(e.workspace.value.id)), a = /* @__PURE__ */ new Map(), o = 0, s = !1;
4731
+ function mu(e, n, r) {
4732
+ let i = t(() => ll(e.workspace.value.id)), a = /* @__PURE__ */ new Map(), o = 0, s = !1;
4731
4733
  A([
4732
4734
  () => e.workspace.value.id,
4733
4735
  () => r()?.sessionId,
@@ -4740,7 +4742,7 @@ function uu(e, n, r) {
4740
4742
  async function c(t, r) {
4741
4743
  let i = e.workspace.value.id, c = o, l = () => !s && o === c && e.workspace.value.id === i, u = t.map((e) => ({
4742
4744
  item: e,
4743
- draft: rl(i, e.questionId, r)
4745
+ draft: sl(i, e.questionId, r)
4744
4746
  }));
4745
4747
  if (u.some(({ draft: e }) => e.sending)) return;
4746
4748
  let d = u.filter(({ draft: e }) => !e.settled);
@@ -4748,18 +4750,18 @@ function uu(e, n, r) {
4748
4750
  let f = null;
4749
4751
  for (let [t, { item: n, draft: r }] of d.entries()) {
4750
4752
  if (!l()) {
4751
- for (let e of d.slice(t)) il(i, e.item.questionId, e.draft) && (e.draft.sending = !1);
4753
+ for (let e of d.slice(t)) cl(i, e.item.questionId, e.draft) && (e.draft.sending = !1);
4752
4754
  return;
4753
4755
  }
4754
- if (il(i, n.questionId, r)) try {
4755
- f = (await e.exec("kvcoder.question.answer", n)).jobId ?? f, il(i, n.questionId, r) && ol(r);
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);
4756
4758
  } catch (o) {
4757
4759
  if (qe(o)?.code === "kvcoder/QUESTION_NOT_FOUND") {
4758
- il(i, n.questionId, r) && (r.sending = !1);
4760
+ cl(i, n.questionId, r) && (r.sending = !1);
4759
4761
  continue;
4760
4762
  }
4761
- for (let e of d.slice(t)) il(i, e.item.questionId, e.draft) && (e.draft.sending = !1, e.draft === r && (e.draft.error = o)), a.delete(e.item.questionId);
4762
- l() && il(i, n.questionId, r) && J(e, o);
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);
4763
4765
  return;
4764
4766
  }
4765
4767
  }
@@ -4773,7 +4775,7 @@ function uu(e, n, r) {
4773
4775
  hidden: i,
4774
4776
  answer: (e) => c([e]),
4775
4777
  decide: ({ approvals: e, confirmed: t, owner: n }) => {
4776
- if (t) for (let t of e) a.set(t.questionId, lu(t));
4778
+ if (t) for (let t of e) a.set(t.questionId, pu(t));
4777
4779
  return c(e.map((e) => ({
4778
4780
  questionId: e.questionId,
4779
4781
  answer: { confirmed: t }
@@ -4783,8 +4785,8 @@ function uu(e, n, r) {
4783
4785
  }
4784
4786
  //#endregion
4785
4787
  //#region web/src/use-artifacts.ts
4786
- var du = (e) => `${e.version} ${e.updatedAt}`;
4787
- function fu(e, t, n, r) {
4788
+ var hu = (e) => `${e.version} ${e.updatedAt}`;
4789
+ function gu(e, t, n, r) {
4788
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;
4789
4791
  function g(e) {
4790
4792
  u = e, d = !1, l.clear(), c.value = void 0, i.value = [], a.value = void 0, o.value = void 0, s.value = !1;
@@ -4821,7 +4823,7 @@ function fu(e, t, n, r) {
4821
4823
  if (p || m !== f || t() !== n || u !== n) return;
4822
4824
  if (i.value = h, !d) {
4823
4825
  d = !0;
4824
- for (let e of h) l.set(e.id, du(e));
4826
+ for (let e of h) l.set(e.id, hu(e));
4825
4827
  if (h.length === 0) {
4826
4828
  a.value = void 0, o.value = void 0, s.value = !1;
4827
4829
  return;
@@ -4832,8 +4834,8 @@ function fu(e, t, n, r) {
4832
4834
  t !== void 0 && await _(n, t);
4833
4835
  return;
4834
4836
  }
4835
- let v = h.filter((e) => l.get(e.id) !== du(e));
4836
- for (let e of h) l.set(e.id, du(e));
4837
+ let v = h.filter((e) => l.get(e.id) !== hu(e));
4838
+ for (let e of h) l.set(e.id, hu(e));
4837
4839
  if (v.length > 0) {
4838
4840
  let e = [...v].sort((e, t) => e.updatedAt < t.updatedAt ? 1 : e.updatedAt > t.updatedAt ? -1 : 0)[0];
4839
4841
  e !== void 0 && (a.value = e.id, s.value = !0, c.value = {
@@ -4901,7 +4903,7 @@ function fu(e, t, n, r) {
4901
4903
  }
4902
4904
  //#endregion
4903
4905
  //#region web/src/conversation-streams.ts
4904
- function pu(e, t, n, r, i) {
4906
+ function _u(e, t, n, r, i) {
4905
4907
  let a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new WeakMap(), s = (e) => e.current() && a.get(e.target) === e, c = (e, t) => {
4906
4908
  s(e) && i(t);
4907
4909
  };
@@ -4916,17 +4918,17 @@ function pu(e, t, n, r, i) {
4916
4918
  let i = !1, u = !1;
4917
4919
  try {
4918
4920
  e.follow(r.jobId).catch((e) => c(r, e));
4919
- 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), ba(s(r) ? r.target : ga(), t).kind !== "none" && await l(r), !r.current() || !s(r) && a.has(r.target))) break;
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;
4920
4922
  i = !u;
4921
4923
  } catch (e) {
4922
4924
  c(r, e);
4923
4925
  } finally {
4924
- s(r) && (a.delete(r.target), i && o.set(r.target, r.jobId), Object.assign(r.target, ga()), r.target === t && (n.value = !1)), i && await l(r);
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);
4925
4927
  }
4926
4928
  }
4927
4929
  function d(e, r, i, c = []) {
4928
4930
  let l = a.get(e);
4929
- 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, ga()), e === t && (n.value = !1), r === void 0 || !i())) return;
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;
4930
4932
  let d = {
4931
4933
  jobId: r,
4932
4934
  target: e,
@@ -4953,27 +4955,27 @@ function pu(e, t, n, r, i) {
4953
4955
  }
4954
4956
  //#endregion
4955
4957
  //#region web/src/use-conversation.ts
4956
- var mu = 5e3, hu = 200;
4957
- function gu(e, t, n, r = () => !1) {
4958
- let i = T(null), a = T([]), o = T(0), s = T([]), c = T(null), l = T(void 0), u = T(!1), d = v(ga()), 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 = pu(e, d, u, () => N(), n), S = (e) => e.filter((e) => e.queued !== !0);
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);
4959
4961
  async function C(t, n, r) {
4960
4962
  if (!r()) return;
4961
4963
  let i = await e.exec("kvcoder.message.list", {
4962
4964
  sessionId: t,
4963
- limit: hu
4965
+ limit: yu
4964
4966
  });
4965
4967
  r() && (a.value = i.messages, o.value = i.omitted, h = n, y = !1);
4966
4968
  }
4967
4969
  async function E(t, n, i, s) {
4968
4970
  let c = await e.exec("kvcoder.message.list", {
4969
4971
  sessionId: t,
4970
- limit: hu,
4972
+ limit: yu,
4971
4973
  afterSeq: i
4972
4974
  });
4973
4975
  if (!s()) return;
4974
4976
  let l = S(c.messages);
4975
4977
  if (l[0] !== void 0 && l[0].seq !== i + 1) return C(t, n, s);
4976
- 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 - hu, 0);
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);
4977
4979
  a.value = [...f.slice(p), ...c.messages.filter((e) => e.queued === !0)], o.value += p;
4978
4980
  }
4979
4981
  async function D() {
@@ -4981,7 +4983,7 @@ function gu(e, t, n, r = () => !1) {
4981
4983
  if (t === void 0 || n === void 0) return;
4982
4984
  let r = await e.exec("kvcoder.message.list", {
4983
4985
  sessionId: t.sessionId,
4984
- limit: hu,
4986
+ limit: yu,
4985
4987
  beforeSeq: n
4986
4988
  });
4987
4989
  b(t) && S(a.value)[0]?.seq === n && (a.value = [...r.messages, ...a.value], o.value = r.omitted, y = !0);
@@ -5016,9 +5018,9 @@ function gu(e, t, n, r = () => !1) {
5016
5018
  let o = {
5017
5019
  session: i,
5018
5020
  turn: a?.sessionId === n ? a : void 0,
5019
- live: f.get(n)?.live ?? v(ga())
5021
+ live: f.get(n)?.live ?? v(_a())
5020
5022
  };
5021
- sl(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));
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));
5022
5024
  }
5023
5025
  }
5024
5026
  async function M(t = [], n) {
@@ -5037,7 +5039,7 @@ function gu(e, t, n, r = () => !1) {
5037
5039
  e.exec("kvcoder.context.get", { sessionId: r.sessionId })
5038
5040
  ]);
5039
5041
  if (!o() || a.id !== r.sessionId || (i.value !== null && i.value.status !== a.status && e.refresh(), !o())) return;
5040
- i.value = a, s.value = l, c.value = u, sl(r.workspaceId, a.id, l);
5042
+ i.value = a, s.value = l, c.value = u, dl(r.workspaceId, a.id, l);
5041
5043
  let f = a.status === "running" ? a.stepJobId : void 0;
5042
5044
  x.update(d, f, () => b(r), n === void 0 || n === f ? t : []);
5043
5045
  let p = j(r, a.status === "waiting" ? l[0] : void 0, o);
@@ -5057,7 +5059,7 @@ function gu(e, t, n, r = () => !1) {
5057
5059
  e !== void 0 && !x.busy() && N().catch((t) => {
5058
5060
  b(e) && n(t);
5059
5061
  });
5060
- }, mu);
5062
+ }, vu);
5061
5063
  return g(() => {
5062
5064
  _ = !0, p = void 0, m = void 0, x.clear(), clearInterval(F);
5063
5065
  }), A([t, () => e.workspace.value.id], () => {
@@ -5065,7 +5067,7 @@ function gu(e, t, n, r = () => !1) {
5065
5067
  p = r === void 0 ? void 0 : {
5066
5068
  workspaceId: e.workspace.value.id,
5067
5069
  sessionId: r
5068
- }, 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, ga());
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());
5069
5071
  let u = p;
5070
5072
  u !== void 0 && N().catch((e) => {
5071
5073
  b(u) && n(e);
@@ -5091,7 +5093,7 @@ function gu(e, t, n, r = () => !1) {
5091
5093
  }
5092
5094
  //#endregion
5093
5095
  //#region web/src/use-execution-map.ts
5094
- function _u(e, n, r, i, a) {
5096
+ function xu(e, n, r, i, a) {
5095
5097
  let o = y(null), s = y(!1), c, l, u, d = 0, f = !1;
5096
5098
  async function p() {
5097
5099
  let t = n();
@@ -5137,15 +5139,15 @@ function _u(e, n, r, i, a) {
5137
5139
  }
5138
5140
  //#endregion
5139
5141
  //#region web/src/use-follow-latest.ts
5140
- var vu = 80;
5141
- function yu(e, t, n) {
5142
+ var Su = 80;
5143
+ function Cu(e, t, n) {
5142
5144
  let r = y(!1);
5143
5145
  function i() {
5144
5146
  e.value !== null && (e.value.scrollTop = e.value.scrollHeight);
5145
5147
  }
5146
5148
  function a() {
5147
5149
  let t = e.value;
5148
- t !== null && (r.value = t.scrollHeight - t.clientHeight - t.scrollTop > vu);
5150
+ t !== null && (r.value = t.scrollHeight - t.clientHeight - t.scrollTop > Su);
5149
5151
  }
5150
5152
  function o() {
5151
5153
  r.value = !1, i();
@@ -5162,7 +5164,7 @@ function yu(e, t, n) {
5162
5164
  }
5163
5165
  //#endregion
5164
5166
  //#region web/src/use-finished-runs.ts
5165
- function bu(e, t, n, r) {
5167
+ function wu(e, t, n, r) {
5166
5168
  let i = y(/* @__PURE__ */ new Map());
5167
5169
  async function a(n) {
5168
5170
  try {
@@ -5176,13 +5178,13 @@ function bu(e, t, n, r) {
5176
5178
  r(e);
5177
5179
  }
5178
5180
  }
5179
- return A(() => [t(), n.value.flatMap((e) => Wa(e) ?? []).join(" ")], ([e, t], n) => {
5181
+ return A(() => [t(), n.value.flatMap((e) => qa(e) ?? []).join(" ")], ([e, t], n) => {
5180
5182
  e !== n?.[0] && (i.value = /* @__PURE__ */ new Map()), e !== void 0 && t !== "" && a(e);
5181
5183
  }, { immediate: !0 }), i;
5182
5184
  }
5183
5185
  //#endregion
5184
5186
  //#region web/src/use-slash-commands.ts
5185
- function xu(e) {
5187
+ function Tu(e) {
5186
5188
  let t = T([]);
5187
5189
  return h(async () => {
5188
5190
  try {
@@ -5194,7 +5196,7 @@ function xu(e) {
5194
5196
  }
5195
5197
  //#endregion
5196
5198
  //#region web/src/use-workspace-session.ts
5197
- function Su(e, n, r) {
5199
+ function Eu(e, n, r) {
5198
5200
  let i = T(e.workspace.value.id);
5199
5201
  async function a(t) {
5200
5202
  let n;
@@ -5205,51 +5207,64 @@ function Su(e, n, r) {
5205
5207
  }
5206
5208
  e.workspace.value.id === t && (n === void 0 ? e.navigate("kvcoder.chat") : e.navigate("kvcoder.session", { sessionId: n }));
5207
5209
  }
5208
- return A(n, () => {
5210
+ A(n, () => {
5209
5211
  i.value = e.workspace.value.id;
5210
5212
  }), A(() => e.workspace.value.id, (e) => {
5211
5213
  n() === void 0 ? i.value = e : a(e);
5212
- }), t(() => i.value === e.workspace.value.id ? n() : void 0);
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
+ };
5213
5228
  }
5214
5229
  //#endregion
5215
5230
  //#region web/src/ConversationView.vue?vue&type=script&setup=true&lang.ts
5216
- var Cu = { class: "kvc-workspace" }, wu = { class: "kvc-stage" }, Tu = {
5231
+ var Du = { class: "kvc-workspace" }, Ou = { class: "kvc-stage" }, ku = {
5217
5232
  class: "kvc-conversation",
5218
5233
  "data-test": "conversation"
5219
- }, Eu = {
5234
+ }, Au = {
5220
5235
  key: 0,
5221
5236
  class: "kvc-start",
5222
5237
  role: "alert",
5223
5238
  "data-test": "load-failure"
5224
- }, Du = { class: "kvc-start-note" }, Ou = {
5239
+ }, ju = { class: "kvc-start-note" }, Mu = {
5225
5240
  class: "kvc-actions",
5226
5241
  style: { "justify-content": "center" }
5227
- }, ku = {
5242
+ }, Nu = {
5228
5243
  key: 1,
5229
5244
  class: "kvc-scrollport"
5230
- }, Au = {
5245
+ }, Pu = {
5231
5246
  key: 1,
5232
5247
  class: "kvc-column"
5233
- }, ju = {
5248
+ }, Fu = {
5234
5249
  key: 0,
5235
5250
  class: "kvc-actions",
5236
5251
  style: { "justify-content": "center" }
5237
- }, Mu = ["title"], Nu = {
5252
+ }, Iu = ["title"], Lu = {
5238
5253
  key: 1,
5239
5254
  class: "kvc-notice",
5240
5255
  "data-test": "map-remaining"
5241
- }, Pu = {
5256
+ }, Ru = {
5242
5257
  key: 3,
5243
5258
  class: "kvc-notice",
5244
5259
  "data-test": "summarizing"
5245
- }, Fu = {
5260
+ }, zu = {
5246
5261
  key: 4,
5247
5262
  class: "kvc-answer",
5248
5263
  "data-test": "live-answer"
5249
- }, Iu = ["open"], Lu = { class: "kvc-muted" }, Ru = {
5264
+ }, Bu = ["open"], Vu = { class: "kvc-muted" }, Hu = {
5250
5265
  class: "kvc-muted",
5251
5266
  style: { "white-space": "pre-wrap" }
5252
- }, zu = {
5267
+ }, Uu = {
5253
5268
  key: 7,
5254
5269
  class: "kvc-muted",
5255
5270
  style: {
@@ -5257,20 +5272,20 @@ var Cu = { class: "kvc-workspace" }, wu = { class: "kvc-stage" }, Tu = {
5257
5272
  margin: "0"
5258
5273
  },
5259
5274
  "data-test": "waiting-hint"
5260
- }, Bu = /* @__PURE__ */ c({
5275
+ }, Wu = /* @__PURE__ */ c({
5261
5276
  __name: "ConversationView",
5262
5277
  props: { sessionId: {} },
5263
5278
  setup(c) {
5264
- let l = c, u = K(), f = Su(u, () => l.sessionId, (e) => J(u, e)), p = y("chat"), m = y(!1), h = gu(u, () => f.value, (e) => J(u, e), () => m.value), { session: g, messages: v, omitted: x, turns: S, live: w, children: T } = h, k = fu(u, () => f.value, () => g.value?.updatedAt, (e) => J(u, e)), M = _u(u, () => f.value, () => g.value?.updatedAt, k, (e) => J(u, e)), N = t(() => M.shown.value || k.open.value && k.shown.value !== void 0), P = t(() => g.value?.status === "idle" ? M.counts.value?.left ?? 0 : 0), F = t(() => Na(v.value)), I = bu(u, () => f.value, v, (e) => J(u, e)), L = /* @__PURE__ */ new Set([
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([
5265
5280
  "STEP_FAILED",
5266
5281
  "REPLY_LOST",
5267
5282
  "REPLY_INCOMPLETE",
5268
5283
  "INTERRUPTED"
5269
- ]), R = t(() => g.value?.status === "running"), ee = t(() => R.value && S.value[0]?.outcome === void 0 ? S.value[0]?.startedAt : void 0), z = t(() => g.value?.status === "waiting" ? S.value[0]?.pending ?? [] : []), B = 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(() => {
5270
5285
  let e = /* @__PURE__ */ new Map();
5271
- for (let t of v.value) (t.kind === "assistant" || t.kind === "toolResult") && t.turnId !== void 0 && e.set(t.turnId, t.id);
5286
+ for (let t of x.value) (t.kind === "assistant" || t.kind === "toolResult") && t.turnId !== void 0 && e.set(t.turnId, t.id);
5272
5287
  let t = /* @__PURE__ */ new Map();
5273
- for (let n of S.value) {
5288
+ for (let n of w.value) {
5274
5289
  let r = e.get(n.id);
5275
5290
  r !== void 0 && n.outcome !== void 0 && t.set(r, {
5276
5291
  text: ot(u.t, n.usage, n.durationMs),
@@ -5289,77 +5304,81 @@ var Cu = { class: "kvc-workspace" }, wu = { class: "kvc-stage" }, Tu = {
5289
5304
  sendId: n
5290
5305
  });
5291
5306
  }) && f.value === t) try {
5292
- G.resume(), await h.refresh();
5307
+ G.resume(), await g.refresh();
5293
5308
  } catch (e) {
5294
5309
  J(u, e);
5295
5310
  }
5296
5311
  }
5297
- let ne = t(() => g.value?.status === "running" || g.value?.status === "waiting"), V = y(), H = y();
5298
- async function ie() {
5299
- let e = f.value, t = S.value[0]?.id;
5300
- if (e !== void 0 && V.value !== e) {
5301
- V.value = e, H.value = void 0;
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;
5302
5317
  try {
5303
5318
  await u.exec("kvcoder.turn.cancel", {
5304
5319
  sessionId: e,
5305
5320
  ...t === void 0 ? {} : { turnId: t }
5306
- }), f.value === e && await h.refresh();
5321
+ }), f.value === e && await g.refresh();
5307
5322
  } catch (t) {
5308
- f.value === e && (H.value = {
5323
+ f.value === e && (ie.value = {
5309
5324
  sessionId: e,
5310
5325
  error: t
5311
5326
  });
5312
5327
  } finally {
5313
- V.value === e && (V.value = void 0);
5328
+ H.value === e && (H.value = void 0);
5314
5329
  }
5315
5330
  }
5316
5331
  }
5317
- let ae = y(0), oe = t(() => [
5318
- ...ue.value.some((e) => e.kind !== "subagent" && e.kind !== "worker") ? [u.t("kvcoder.ui.messageDismisses")] : [],
5332
+ let oe = y(0), se = t(() => [
5333
+ ...de.value.some((e) => e.kind !== "subagent" && e.kind !== "worker") ? [u.t("kvcoder.ui.messageDismisses")] : [],
5319
5334
  u.t("kvcoder.ui.stopEnds"),
5320
- ...ae.value > 0 ? [u.t("kvcoder.ui.stopKeepsBackground")] : []
5321
- ].join(" ")), se = () => g.value === null || S.value[0] === void 0 ? void 0 : {
5322
- sessionId: g.value.id,
5323
- turnId: S.value[0].id
5324
- }, U = uu(u, (e) => h.refresh(e), se), ce = t(() => new Map(z.value.flatMap((e) => {
5325
- let t = F.value.get(e.toolCallId)?.fields?.task;
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;
5326
5341
  return typeof e.childSessionId == "string" && typeof t == "string" ? [[e.childSessionId, t]] : [];
5327
- }))), le = t(() => z.value.flatMap((e) => e.kind === "worker" && e.runId !== void 0 ? [e.runId] : [])), ue = t(() => z.value.filter((e) => e.questionId === null || !U.hidden.value.has(String(e.questionId)))), de = t(() => {
5328
- let e = v.value.at(-1);
5329
- return g.value?.status === "idle" && e?.kind === "notice" && L.has(String(e.content.code));
5330
- }), fe = xu(u), W = Wl(u, () => f.value ?? "", () => h.refresh()), pe = t(() => {
5331
- let e = qe(h.loadFailure.value);
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);
5332
5351
  return e === void 0 ? u.t("kvcoder.ui.failed") : u.t(Ke(e.code), e.params);
5333
- }), me = O("list"), G = yu(me, () => [
5334
- v.value,
5335
- w.text,
5336
- w.thinking,
5337
- w.calls.length,
5338
- w.summarizing,
5352
+ }), he = O("list"), G = Cu(he, () => [
5353
+ x.value,
5354
+ T.text,
5355
+ T.thinking,
5356
+ T.calls.length,
5357
+ T.summarizing,
5339
5358
  R.value,
5340
- z.value,
5341
- T.size,
5359
+ B.value,
5360
+ k.size,
5342
5361
  U.hidden.value,
5343
5362
  W.working.value
5344
5363
  ], () => f.value);
5345
- A(G.away, (e) => m.value = e);
5346
- async function he() {
5347
- let e = me.value, t = e === null ? 0 : e.scrollHeight - e.scrollTop;
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;
5348
5367
  try {
5349
- await h.showEarlier(), await d(), e !== null && (e.scrollTop = e.scrollHeight - t);
5368
+ await g.showEarlier(), await d(), e !== null && (e.scrollTop = e.scrollHeight - t);
5350
5369
  } catch (e) {
5351
5370
  J(u, e);
5352
5371
  }
5353
5372
  }
5354
- async function ge() {
5373
+ async function _e() {
5355
5374
  try {
5356
- await h.showLatest();
5375
+ await g.showLatest();
5357
5376
  } catch (e) {
5358
5377
  J(u, e);
5359
5378
  }
5360
5379
  G.resume();
5361
5380
  }
5362
- async function _e() {
5381
+ async function ve() {
5363
5382
  if (f.value !== void 0) try {
5364
5383
  let { fileId: e } = await u.exec("kvcoder.session.export", { sessionId: f.value });
5365
5384
  window.location.assign(`/api/files/${encodeURIComponent(e)}?workspaceId=${encodeURIComponent(u.workspace.value.id)}`);
@@ -5367,44 +5386,44 @@ var Cu = { class: "kvc-workspace" }, wu = { class: "kvc-stage" }, Tu = {
5367
5386
  J(u, e);
5368
5387
  }
5369
5388
  }
5370
- let ve = () => v.value.at(-1)?.kind === "notice" && v.value.at(-1)?.content.code === "SUMMARY_FAILED";
5371
- async function ye() {
5389
+ let ye = () => x.value.at(-1)?.kind === "notice" && x.value.at(-1)?.content.code === "SUMMARY_FAILED";
5390
+ async function be() {
5372
5391
  return (await u.exec("kernel.settings.list", {})).find((e) => e.key === "kvcoder.compactKeep")?.value ?? null;
5373
5392
  }
5374
- async function be() {
5393
+ async function xe() {
5375
5394
  let e = await W.compact();
5376
- e === !0 ? u.toast("kvcoder.ui.summarized", {}, "success") : e === !1 && !ve() && u.toast("kvcoder.ui.nothingToSummarize", { count: await ye() });
5395
+ e === !0 ? u.toast("kvcoder.ui.summarized", {}, "success") : e === !1 && !ye() && u.toast("kvcoder.ui.nothingToSummarize", { count: await be() });
5377
5396
  }
5378
- function xe(e, t) {
5397
+ function Se(e, t) {
5379
5398
  if (e === "new") return u.navigate("kvcoder.chat");
5380
- if (e === "prompt") return void (p.value = p.value === "prompt" ? "chat" : "prompt");
5399
+ if (e === "prompt") return void (m.value = m.value === "prompt" ? "chat" : "prompt");
5381
5400
  if (e === "delete") return void W.remove();
5382
- W.working.value === void 0 && (p.value = "chat", e === "rename" ? W.rename(t) : e === "compact" ? be() : e === "export" ? W.exportFile() : W.fork());
5401
+ W.working.value === void 0 && (m.value = "chat", e === "rename" ? W.rename(t) : e === "compact" ? xe() : e === "export" ? W.exportFile() : W.fork());
5383
5402
  }
5384
- async function Se(e, t) {
5385
- W.working.value === void 0 && (p.value = "chat", await W.runRegistered(e, t) && e.message !== void 0 && await te({
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({
5386
5405
  text: t === "" ? u.t(e.message) : t,
5387
5406
  fileIds: []
5388
5407
  }));
5389
5408
  }
5390
- let Ce = (e) => e.id;
5391
- return (t, c) => (_(), i("div", Cu, [D(g) && D(f) !== void 0 ? (_(), n(oa, {
5409
+ let we = (e) => e.id;
5410
+ return (t, c) => (_(), i("div", Du, [D(v) && D(f) !== void 0 ? (_(), n(sa, {
5392
5411
  key: 0,
5393
- session: D(g),
5394
- tab: p.value,
5395
- turns: D(S).length,
5396
- context: D(h).context.value,
5397
- "running-since": ee.value,
5398
- artifacts: D(k).list.value.length,
5399
- "artifacts-open": D(k).open.value && !D(M).shown.value,
5400
- map: D(M).counts.value,
5401
- "map-open": D(M).shown.value,
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,
5402
5421
  working: D(W).working.value !== void 0,
5403
- onTab: c[0] ||= (e) => p.value = e,
5404
- onAction: xe,
5405
- onToggleArtifacts: c[1] ||= (e) => D(M).toggleArtifacts(),
5406
- onToggleMap: c[2] ||= (e) => D(M).toggle(),
5407
- onBackgroundRunning: c[3] ||= (e) => ae.value = 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
5408
5427
  }, null, 8, [
5409
5428
  "session",
5410
5429
  "tab",
@@ -5416,84 +5435,84 @@ var Cu = { class: "kvc-workspace" }, wu = { class: "kvc-stage" }, Tu = {
5416
5435
  "map",
5417
5436
  "map-open",
5418
5437
  "working"
5419
- ])) : r("v-if", !0), a("div", wu, [a("section", Tu, [l.sessionId === void 0 ? (_(), n(ui, {
5438
+ ])) : r("v-if", !0), a("div", Ou, [a("section", ku, [l.sessionId === void 0 ? (_(), n(di, {
5420
5439
  key: 0,
5421
- registered: D(fe)
5422
- }, null, 8, ["registered"])) : D(g) && D(f) !== void 0 ? (_(), i(e, { key: 1 }, [D(h).loadFailure.value === void 0 ? (_(), i("div", ku, [a("div", {
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", {
5423
5442
  ref_key: "list",
5424
- ref: me,
5443
+ ref: he,
5425
5444
  class: "kvc-scroll",
5426
5445
  onScroll: c[10] ||= (...e) => D(G).onScroll && D(G).onScroll(...e)
5427
- }, [p.value === "prompt" ? (_(), n(Ul, {
5446
+ }, [m.value === "prompt" ? (_(), n(ql, {
5428
5447
  key: 0,
5429
- "session-id": D(g).id,
5430
- onBack: c[6] ||= (e) => p.value = "chat"
5431
- }, null, 8, ["session-id"])) : (_(), i("div", Au, [
5432
- D(x) > 0 ? (_(), i("div", ju, [a("button", {
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", {
5433
5452
  type: "button",
5434
5453
  class: "kvc-button",
5435
5454
  "data-test": "show-earlier",
5436
- onClick: he
5437
- }, E(D(u).t("kvcoder.ui.showEarlier", { count: Math.min(D(x), 200) })), 1), a("button", {
5455
+ onClick: ge
5456
+ }, E(D(u).t("kvcoder.ui.showEarlier", { count: Math.min(D(S), 200) })), 1), a("button", {
5438
5457
  type: "button",
5439
5458
  class: "kvc-button",
5440
5459
  "data-test": "earlier",
5441
- onClick: _e
5442
- }, E(D(u).t("kvcoder.ui.earlierMessages", { count: D(x) })), 1)])) : r("v-if", !0),
5443
- (_(!0), i(e, null, b(D(v), (t) => (_(), i(e, { key: Ce(t) }, [s(Vc, {
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, {
5444
5463
  message: t,
5445
- calls: F.value,
5446
- "finished-runs": D(I),
5447
- onOpenArtifact: c[7] ||= (e) => D(M).selectArtifact(e)
5464
+ calls: I.value,
5465
+ "finished-runs": D(L),
5466
+ onOpenArtifact: c[7] ||= (e) => D(N).selectArtifact(e)
5448
5467
  }, null, 8, [
5449
5468
  "message",
5450
5469
  "calls",
5451
5470
  "finished-runs"
5452
- ]), B.value.has(t.id) ? (_(), i("span", {
5471
+ ]), V.value.has(t.id) ? (_(), i("span", {
5453
5472
  key: 0,
5454
5473
  class: "kvc-muted",
5455
- title: B.value.get(t.id)?.tokens,
5474
+ title: V.value.get(t.id)?.tokens,
5456
5475
  "data-test": "turn-totals"
5457
- }, E(B.value.get(t.id)?.text), 9, Mu)) : r("v-if", !0)], 64))), 128)),
5458
- P.value > 0 ? (_(), i("div", Nu, [o(E(D(u).t("kvcoder.ui.map.remaining", { count: P.value })) + " ", 1), a("button", {
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", {
5459
5478
  type: "button",
5460
5479
  class: "kvc-link-button",
5461
5480
  "data-test": "map-show",
5462
- onClick: c[8] ||= (e) => D(M).shown.value = !0
5481
+ onClick: c[8] ||= (e) => D(N).shown.value = !0
5463
5482
  }, E(D(u).t("kvcoder.ui.map.show")), 1)])) : r("v-if", !0),
5464
- de.value ? (_(), n(Il, {
5483
+ fe.value ? (_(), n(Bl, {
5465
5484
  key: 2,
5466
- "session-id": D(g).id,
5485
+ "session-id": D(v).id,
5467
5486
  onSent: c[9] ||= (e) => {
5468
- D(G).resume(), D(h).refresh();
5487
+ D(G).resume(), D(g).refresh();
5469
5488
  }
5470
5489
  }, null, 8, ["session-id"])) : r("v-if", !0),
5471
- D(w).summarizing ? (_(), i("div", Pu, E(D(u).t("kvcoder.ui.summarizing")), 1)) : r("v-if", !0),
5472
- R.value && (D(w).text !== "" || D(w).thinking !== "") ? (_(), i("div", Fu, [D(w).thinking === "" ? r("v-if", !0) : (_(), i("details", {
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", {
5473
5492
  key: 0,
5474
- open: D(w).text === "" && D(w).calls.length === 0,
5493
+ open: D(T).text === "" && D(T).calls.length === 0,
5475
5494
  "data-test": "live-thinking"
5476
- }, [a("summary", Lu, E(D(u).t("kvcoder.ui.thinkingNow")), 1), a("p", Ru, E(D(w).thinking), 1)], 8, Iu)), D(w).text === "" ? r("v-if", !0) : (_(), n(C(D(u).View), {
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), {
5477
5496
  key: 1,
5478
5497
  view: {
5479
5498
  type: "markdown",
5480
5499
  text: "kvcoder.markdown",
5481
- params: { text: D(w).text }
5500
+ params: { text: D(T).text }
5482
5501
  }
5483
5502
  }, null, 8, ["view"]))])) : r("v-if", !0),
5484
- R.value ? (_(), n(ka, {
5503
+ R.value ? (_(), n(Aa, {
5485
5504
  key: 5,
5486
- live: D(w),
5487
- turn: D(S)[0]
5505
+ live: D(T),
5506
+ turn: D(w)[0]
5488
5507
  }, null, 8, ["live", "turn"])) : r("v-if", !0),
5489
- D(W).working.value ? (_(), n(gi, {
5508
+ D(W).working.value ? (_(), n(_i, {
5490
5509
  key: 6,
5491
5510
  working: D(W).working.value
5492
5511
  }, null, 8, ["working"])) : r("v-if", !0),
5493
- (_(!0), i(e, null, b(D(T), ([e, t]) => (_(), n(tu, {
5512
+ (_(!0), i(e, null, b(D(k), ([e, t]) => (_(), n(au, {
5494
5513
  key: e,
5495
5514
  child: t,
5496
- task: ce.value.get(e),
5515
+ task: le.value.get(e),
5497
5516
  hidden: D(U).hidden.value,
5498
5517
  onAnswer: D(U).answer,
5499
5518
  onDecide: D(U).decide
@@ -5504,14 +5523,14 @@ var Cu = { class: "kvc-workspace" }, wu = { class: "kvc-stage" }, Tu = {
5504
5523
  "onAnswer",
5505
5524
  "onDecide"
5506
5525
  ]))), 128)),
5507
- (_(!0), i(e, null, b(le.value, (e) => (_(), n(cu, {
5526
+ (_(!0), i(e, null, b(ue.value, (e) => (_(), n(fu, {
5508
5527
  key: e,
5509
- "session-id": D(g).id,
5528
+ "session-id": D(v).id,
5510
5529
  "run-id": e
5511
5530
  }, null, 8, ["session-id", "run-id"]))), 128)),
5512
- s(jl, {
5513
- owner: se(),
5514
- pending: z.value,
5531
+ s(Fl, {
5532
+ owner: ce(),
5533
+ pending: B.value,
5515
5534
  hidden: D(U).hidden.value,
5516
5535
  onAnswer: D(U).answer,
5517
5536
  onDecide: D(U).decide
@@ -5522,43 +5541,43 @@ var Cu = { class: "kvc-workspace" }, wu = { class: "kvc-stage" }, Tu = {
5522
5541
  "onAnswer",
5523
5542
  "onDecide"
5524
5543
  ]),
5525
- z.value.length > 0 ? (_(), i("p", zu, E(oe.value), 1)) : r("v-if", !0)
5544
+ B.value.length > 0 ? (_(), i("p", Uu, E(se.value), 1)) : r("v-if", !0)
5526
5545
  ]))], 544), D(G).away.value ? (_(), i("button", {
5527
5546
  key: 0,
5528
5547
  type: "button",
5529
5548
  class: "kvc-button kvc-jump",
5530
5549
  "data-test": "jump-to-latest",
5531
- onClick: ge
5550
+ onClick: _e
5532
5551
  }, [s(D(re), {
5533
5552
  size: 16,
5534
5553
  "aria-hidden": "true"
5535
- }), o(E(D(u).t("kvcoder.ui.jumpToLatest")), 1)])) : r("v-if", !0)])) : (_(), i("div", Eu, [a("p", Du, E(D(u).t("kvcoder.ui.loadFailed", { error: pe.value })), 1), a("div", Ou, [a("button", {
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", {
5536
5555
  type: "button",
5537
5556
  class: "kvc-button kvc-primary",
5538
5557
  "data-test": "load-again",
5539
- onClick: c[4] ||= (e) => D(h).refresh()
5558
+ onClick: c[4] ||= (e) => D(g).refresh()
5540
5559
  }, E(D(u).t("kvcoder.ui.tryAgain")), 1), a("button", {
5541
5560
  type: "button",
5542
5561
  class: "kvc-button",
5543
5562
  "data-test": "load-export",
5544
5563
  onClick: c[5] ||= (e) => D(W).exportFile()
5545
5564
  }, E(D(u).t("kvcoder.ui.export")), 1)])])), s(kr, {
5546
- "session-id": D(g).id,
5565
+ "session-id": D(v).id,
5547
5566
  stoppable: ne.value,
5548
- stopping: V.value === D(g).id,
5549
- "stop-error": H.value?.sessionId === D(g).id ? H.value.error : void 0,
5567
+ stopping: H.value === D(v).id,
5568
+ "stop-error": ie.value?.sessionId === D(v).id ? ie.value.error : void 0,
5550
5569
  placeholder: D(u).t("kvcoder.ui.placeholder"),
5551
5570
  blocked: D(W).working.value !== void 0,
5552
5571
  commands: "run",
5553
- registered: D(fe),
5572
+ registered: D(pe),
5554
5573
  onSend: te,
5555
- onStop: ie,
5556
- onCommand: xe,
5557
- onRegistered: Se
5574
+ onStop: ae,
5575
+ onCommand: Se,
5576
+ onRegistered: Ce
5558
5577
  }, {
5559
- controls: j(() => [s(Gl, {
5560
- session: D(g),
5561
- onChanged: c[11] ||= (e) => D(h).refresh()
5578
+ controls: j(() => [s(Yl, {
5579
+ session: D(v),
5580
+ onChanged: c[11] ||= (e) => D(g).refresh()
5562
5581
  }, null, 8, ["session"])]),
5563
5582
  _: 1
5564
5583
  }, 8, [
@@ -5569,16 +5588,16 @@ var Cu = { class: "kvc-workspace" }, wu = { class: "kvc-stage" }, Tu = {
5569
5588
  "placeholder",
5570
5589
  "blocked",
5571
5590
  "registered"
5572
- ])], 64)) : r("v-if", !0)]), N.value ? (_(), n($n, {
5591
+ ])], 64)) : r("v-if", !0)]), P.value ? (_(), n($n, {
5573
5592
  key: 0,
5574
- list: D(k).list.value,
5575
- shown: D(k).shown.value,
5576
- content: D(k).content.value,
5577
- map: D(M).map.value,
5578
- "map-shown": D(M).shown.value,
5579
- onSelect: c[12] ||= (e) => D(M).selectArtifact(e),
5580
- onSelectMap: c[13] ||= (e) => D(M).shown.value = !0,
5581
- onClose: c[14] ||= (e) => D(M).close()
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()
5582
5601
  }, null, 8, [
5583
5602
  "list",
5584
5603
  "shown",
@@ -5587,13 +5606,13 @@ var Cu = { class: "kvc-workspace" }, wu = { class: "kvc-stage" }, Tu = {
5587
5606
  "map-shown"
5588
5607
  ])) : r("v-if", !0)])]));
5589
5608
  }
5590
- }), Vu = /* @__PURE__ */ c({
5609
+ }), Gu = /* @__PURE__ */ c({
5591
5610
  __name: "conversation",
5592
5611
  props: { sessionId: {} },
5593
5612
  setup(e) {
5594
5613
  let t = e;
5595
- return (e, r) => (_(), n(Bu, { "session-id": t.sessionId }, null, 8, ["session-id"]));
5614
+ return (e, r) => (_(), n(Wu, { "session-id": t.sessionId }, null, 8, ["session-id"]));
5596
5615
  }
5597
5616
  });
5598
5617
  //#endregion
5599
- export { Vu as default };
5618
+ export { Gu as default };