@kvman/kvcoder 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) 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 +35 -20
  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/call.js +281 -251
  51. package/dist/web/components/connectors.css +1 -1
  52. package/dist/web/components/conversation.css +1 -1
  53. package/dist/web/components/conversation.js +943 -892
  54. package/dist/web/components/mcp-sign-in.css +1 -1
  55. package/dist/web/components/model.css +1 -1
  56. package/dist/web/components/question.css +1 -1
  57. package/dist/web/components/sessions.css +1 -1
  58. package/docs/connectors.md +13 -1
  59. package/docs/sections.md +2 -0
  60. package/locales/ar.json +15 -2
  61. package/locales/en.json +15 -2
  62. package/package.json +3 -3
@@ -16,7 +16,7 @@ var F = {
16
16
  function L(e) {
17
17
  return e != null;
18
18
  }
19
- function 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,44 +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) {
2969
- if (e.kind !== "toolResult" || e.content.isError === !0) return;
2951
+ function za(e, t) {
2952
+ if (e.kind !== "toolResult") return;
2970
2953
  let n = t.get(String(e.content.toolCallId))?.ask;
2971
2954
  if (n === void 0) return;
2972
- let r = La(ja(e.content.content));
2973
- return r === void 0 ? void 0 : {
2955
+ let r = Ma(e.content.content);
2956
+ if (e.content.isError === !0 && r !== La) return;
2957
+ let i = Ra(r);
2958
+ return i === void 0 ? void 0 : {
2974
2959
  ...n,
2975
- answer: r
2960
+ answer: i
2976
2961
  };
2977
2962
  }
2978
- function za(e) {
2963
+ function Ba(e) {
2979
2964
  return e.kind === "user" && e.source?.kind === "extension" && e.source.name === "@kvman/kvcoder";
2980
2965
  }
2981
- function Ba(e) {
2966
+ function Va(e) {
2982
2967
  return e.kind === "user" && (e.source?.kind === "job" || e.source?.kind === "subagent");
2983
2968
  }
2984
- function Va(e) {
2969
+ function Ha(e) {
2985
2970
  if (e.kind !== "toolResult") return;
2986
2971
  let t = Z(e.content.details);
2987
2972
  if (t === void 0) return;
@@ -2995,25 +2980,37 @@ function Va(e) {
2995
2980
  version: o
2996
2981
  };
2997
2982
  }
2998
- var Ha = /\n\nAttached files:\n((?:- .+\n?)+)$/;
2999
- function Ua(e, t) {
3000
- return e.replace(Ha, (e, n) => `\n\n${t}\n${n}`);
3001
- }
2983
+ var Ua = (e) => typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
3002
2984
  function Wa(e) {
2985
+ if (e.kind !== "toolResult" || e.content.isError === !0) return;
2986
+ let t = Ua(Ua(e.content.details)?.card), n = t?.component;
2987
+ if (t !== void 0 && typeof n == "string") return {
2988
+ component: n,
2989
+ props: {
2990
+ payload: t.payload ?? null,
2991
+ output: t.output ?? null
2992
+ }
2993
+ };
2994
+ }
2995
+ var Ga = /\n\nAttached files:\n((?:- .+\n?)+)$/;
2996
+ function Ka(e, t) {
2997
+ return e.replace(Ga, (e, n) => `\n\n${t}\n${n}`);
2998
+ }
2999
+ function qa(e) {
3003
3000
  if (e.kind === "user") return e.source?.kind === "job" ? e.source.jobId : e.source?.kind === "subagent" ? e.source.sessionId : void 0;
3004
3001
  }
3005
- var Ga = /^The background call `([\s\S]*?)` \(job [^)\n]+\) finished:\n/;
3006
- function Ka(e) {
3007
- 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();
3008
3005
  return t === void 0 || t === "" ? void 0 : t;
3009
3006
  }
3010
- function qa(e) {
3007
+ function Xa(e) {
3011
3008
  let t = Z(Z(e.content.details)?.staging)?.runId;
3012
3009
  return typeof t == "string" ? t : void 0;
3013
3010
  }
3014
3011
  //#endregion
3015
3012
  //#region web/src/question-options.ts
3016
- function Ja(e) {
3013
+ function Za(e) {
3017
3014
  return (Array.isArray(e.options) ? e.options : []).map((e) => {
3018
3015
  let t = q(e);
3019
3016
  return {
@@ -3025,56 +3022,56 @@ function Ja(e) {
3025
3022
  }
3026
3023
  //#endregion
3027
3024
  //#region web/src/AnsweredCard.vue?vue&type=script&setup=true&lang.ts
3028
- var Ya = ["aria-label"], Xa = {
3025
+ var Qa = ["aria-label"], $a = {
3029
3026
  class: "kvc-card-row",
3030
3027
  style: { "font-weight": "600" }
3031
- }, Za = {
3028
+ }, eo = {
3032
3029
  dir: "auto",
3033
3030
  "data-test": "answered-prompt"
3034
- }, Qa = { class: "kvc-card-body" }, $a = {
3031
+ }, to = { class: "kvc-card-body" }, no = {
3035
3032
  key: 0,
3036
3033
  class: "kvc-muted",
3037
3034
  "data-test": "answered-skipped"
3038
- }, eo = ["data-chosen", "data-test"], to = {
3035
+ }, ro = ["data-chosen", "data-test"], io = {
3039
3036
  key: 1,
3040
3037
  class: "kvc-answered-gap",
3041
3038
  "aria-hidden": "true"
3042
- }, no = { style: {
3039
+ }, ao = { style: {
3043
3040
  display: "flex",
3044
3041
  "flex-direction": "column"
3045
- } }, ro = { dir: "auto" }, io = {
3042
+ } }, oo = { dir: "auto" }, so = {
3046
3043
  key: 0,
3047
3044
  class: "kvc-muted",
3048
3045
  dir: "auto"
3049
- }, ao = {
3046
+ }, co = {
3050
3047
  key: 2,
3051
3048
  class: "kvc-sr"
3052
- }, oo = {
3049
+ }, lo = {
3053
3050
  key: 0,
3054
3051
  class: "kvc-answered-option",
3055
3052
  "data-chosen": "true",
3056
3053
  "data-test": "answered-other"
3057
- }, so = { style: {
3054
+ }, uo = { style: {
3058
3055
  display: "flex",
3059
3056
  "flex-direction": "column"
3060
- } }, co = { class: "kvc-muted" }, lo = {
3057
+ } }, fo = { class: "kvc-muted" }, po = {
3061
3058
  dir: "auto",
3062
3059
  style: { "white-space": "pre-wrap" }
3063
- }, uo = {
3060
+ }, mo = {
3064
3061
  key: 2,
3065
3062
  class: "kvc-chip",
3066
3063
  style: { "align-self": "flex-start" },
3067
3064
  "data-test": "answered-confirmed"
3068
- }, fo = {
3065
+ }, ho = {
3069
3066
  key: 3,
3070
3067
  dir: "auto",
3071
3068
  style: { "white-space": "pre-wrap" },
3072
3069
  "data-test": "answered-text"
3073
- }, po = /* @__PURE__ */ c({
3070
+ }, go = /* @__PURE__ */ c({
3074
3071
  __name: "AnsweredCard",
3075
3072
  props: { answered: {} },
3076
3073
  setup(o) {
3077
- let c = o, l = K(), u = t(() => String(c.answered.question.prompt ?? "")), d = t(() => c.answered.answer.dismissed === !0), f = t(() => Array.isArray(c.answered.answer.selected) ? c.answered.answer.selected : []), p = t(() => 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) => ({
3078
3075
  ...e,
3079
3076
  chosen: f.value.includes(e.id)
3080
3077
  }))), m = t(() => typeof c.answered.answer.other == "string" ? c.answered.answer.other : ""), h = t(() => typeof c.answered.answer.text == "string" ? c.answered.answer.text : "");
@@ -3082,34 +3079,34 @@ var Ya = ["aria-label"], Xa = {
3082
3079
  class: "kvc-card",
3083
3080
  "data-test": "answered-card",
3084
3081
  "aria-label": u.value
3085
- }, [a("div", Xa, [s(D(ue), {
3082
+ }, [a("div", $a, [s(D(ue), {
3086
3083
  size: 18,
3087
3084
  "aria-hidden": "true",
3088
3085
  class: "kvc-ok"
3089
- }), 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", {
3090
3087
  key: e.id,
3091
3088
  class: "kvc-answered-option",
3092
3089
  "data-chosen": e.chosen,
3093
3090
  "data-test": `answered-option-${e.id}`
3094
3091
  }, [
3095
- e.chosen ? (_(), n(D(U), {
3092
+ e.chosen ? (_(), n(D(ce), {
3096
3093
  key: 0,
3097
3094
  size: 16,
3098
3095
  "aria-hidden": "true",
3099
3096
  class: "kvc-ok"
3100
- })) : (_(), i("span", to)),
3101
- a("span", no, [a("span", ro, E(e.label), 1), e.description ? (_(), i("span", io, E(e.description), 1)) : r("v-if", !0)]),
3102
- e.chosen ? (_(), i("span", ao, E(D(l).t("kvcoder.ui.chosen")), 1)) : r("v-if", !0)
3103
- ], 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), {
3104
3101
  size: 16,
3105
3102
  "aria-hidden": "true",
3106
3103
  class: "kvc-ok"
3107
- }), 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));
3108
3105
  }
3109
- }), mo = {
3106
+ }), _o = {
3110
3107
  class: "kvc-card kvc-card-row",
3111
3108
  "data-test": "artifact-card"
3112
- }, ho = {
3109
+ }, vo = {
3113
3110
  style: {
3114
3111
  flex: "1 1 auto",
3115
3112
  "min-inline-size": "0",
@@ -3118,13 +3115,13 @@ var Ya = ["aria-label"], Xa = {
3118
3115
  "white-space": "nowrap"
3119
3116
  },
3120
3117
  "data-test": "artifact-card-title"
3121
- }, go = {
3118
+ }, yo = {
3122
3119
  class: "kvc-chip",
3123
3120
  "data-test": "artifact-card-format"
3124
- }, _o = {
3121
+ }, bo = {
3125
3122
  class: "kvc-muted",
3126
3123
  "data-test": "artifact-card-version"
3127
- }, vo = /* @__PURE__ */ c({
3124
+ }, xo = /* @__PURE__ */ c({
3128
3125
  __name: "ArtifactCard",
3129
3126
  props: {
3130
3127
  id: {},
@@ -3135,14 +3132,14 @@ var Ya = ["aria-label"], Xa = {
3135
3132
  emits: ["open"],
3136
3133
  setup(e, { emit: t }) {
3137
3134
  let n = e, r = t, o = K();
3138
- return (e, t) => (_(), i("div", mo, [
3135
+ return (e, t) => (_(), i("div", _o, [
3139
3136
  s(D(Ce), {
3140
3137
  size: 16,
3141
3138
  "aria-hidden": "true"
3142
3139
  }),
3143
- a("span", ho, E(n.title), 1),
3144
- a("span", go, E(D(o).t(`kvcoder.ui.artifacts.format.${n.format}`)), 1),
3145
- 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),
3146
3143
  a("button", {
3147
3144
  type: "button",
3148
3145
  class: "kvc-button",
@@ -3151,24 +3148,39 @@ var Ya = ["aria-label"], Xa = {
3151
3148
  }, E(D(o).t("kvcoder.ui.artifacts.open")), 1)
3152
3149
  ]));
3153
3150
  }
3154
- });
3151
+ }), So = 160, Co = /^error ([A-Za-z0-9_/-]+): ?(.*)/;
3152
+ function wo(e) {
3153
+ let t = (e.split("\n", 1)[0] ?? "").trim();
3154
+ return t.length > So ? `${t.slice(0, So)}…` : t;
3155
+ }
3156
+ function To(e) {
3157
+ if (e.startsWith("denied by the user")) return { kind: "denied" };
3158
+ let t = Co.exec(e);
3159
+ return t?.[1] === "VALIDATION_FAILED" ? { kind: "invalid" } : t === null ? /\[exit code \d+\]\s*$/.test(e) ? { kind: "command" } : {
3160
+ kind: "error",
3161
+ message: wo(e)
3162
+ } : {
3163
+ kind: "error",
3164
+ message: wo(t[2] ?? "")
3165
+ };
3166
+ }
3155
3167
  //#endregion
3156
3168
  //#region web/src/call-results.ts
3157
- function yo(e) {
3169
+ function Eo(e) {
3158
3170
  let { replacements: t, firstChangedLine: n } = q(e);
3159
3171
  return typeof t == "number" && typeof n == "number" ? {
3160
3172
  replacements: t,
3161
3173
  firstChangedLine: n
3162
3174
  } : void 0;
3163
3175
  }
3164
- function bo(e) {
3176
+ function Do(e) {
3165
3177
  let { fromLine: t, content: n } = q(e);
3166
3178
  return typeof t == "number" && typeof n == "string" ? {
3167
3179
  fromLine: t,
3168
3180
  content: n
3169
3181
  } : void 0;
3170
3182
  }
3171
- function xo(e) {
3183
+ function Oo(e) {
3172
3184
  let { name: t, kind: n, bytes: r } = q(e);
3173
3185
  return typeof t == "string" && (n === "file" || n === "folder") && typeof r == "number" ? [{
3174
3186
  name: t,
@@ -3176,11 +3188,11 @@ function xo(e) {
3176
3188
  bytes: r
3177
3189
  }] : [];
3178
3190
  }
3179
- function So(e) {
3191
+ function ko(e) {
3180
3192
  let t = q(e).entries;
3181
- return Array.isArray(t) ? t.flatMap(xo) : void 0;
3193
+ return Array.isArray(t) ? t.flatMap(Oo) : void 0;
3182
3194
  }
3183
- function Co(e) {
3195
+ function Ao(e) {
3184
3196
  let { path: t, matches: n } = q(e);
3185
3197
  return typeof t != "string" || !Array.isArray(n) ? [] : [{
3186
3198
  path: t,
@@ -3193,17 +3205,17 @@ function Co(e) {
3193
3205
  })
3194
3206
  }];
3195
3207
  }
3196
- var wo = [
3208
+ var jo = [
3197
3209
  "running",
3198
3210
  "succeeded",
3199
3211
  "failed",
3200
3212
  "cancelled",
3201
3213
  "interrupted"
3202
3214
  ];
3203
- function To(e, t) {
3204
- return wo.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;
3205
3217
  }
3206
- function Eo(e) {
3218
+ function No(e) {
3207
3219
  let { kind: t, call: n, status: r, startedAt: i, endedAt: a, exitCode: o, output: s, problem: c } = q(e);
3208
3220
  if (typeof n != "string" || typeof r != "string") return;
3209
3221
  let l = typeof i == "string" && typeof a == "string" ? Date.parse(a) - Date.parse(i) : NaN;
@@ -3217,36 +3229,36 @@ function Eo(e) {
3217
3229
  ...c === void 0 ? {} : { problem: c }
3218
3230
  };
3219
3231
  }
3220
- function Do(e) {
3232
+ function Po(e) {
3221
3233
  let t = q(e).files;
3222
- return Array.isArray(t) ? t.flatMap(Co) : void 0;
3234
+ return Array.isArray(t) ? t.flatMap(Ao) : void 0;
3223
3235
  }
3224
3236
  //#endregion
3225
3237
  //#region web/src/edit-diff.ts
3226
- var Oo = 3;
3227
- function ko(e) {
3238
+ var Fo = 3;
3239
+ function Io(e) {
3228
3240
  if (e === "") return [];
3229
3241
  let t = e.split("\n");
3230
3242
  return e.endsWith("\n") ? t.slice(0, -1) : t;
3231
3243
  }
3232
- function Ao(e, t) {
3244
+ function Lo(e, t) {
3233
3245
  let n = 0;
3234
3246
  for (; n < e.length && n < t.length && e[n] === t[n];) n += 1;
3235
3247
  return n;
3236
3248
  }
3237
- function jo(e, t) {
3238
- let n = ko(e), r = ko(t), i = Ao(n, r), a = Ao(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) => ({
3239
3251
  kind: e,
3240
3252
  text: t
3241
3253
  }));
3242
3254
  return [
3243
- ...o("context", n.slice(Math.max(i - Oo, 0), i)),
3255
+ ...o("context", n.slice(Math.max(i - Fo, 0), i)),
3244
3256
  ...o("removed", n.slice(i, n.length - a)),
3245
3257
  ...o("added", r.slice(i, r.length - a)),
3246
- ...o("context", n.slice(n.length - a, n.length - a + Oo))
3258
+ ...o("context", n.slice(n.length - a, n.length - a + Fo))
3247
3259
  ];
3248
3260
  }
3249
- function Mo(e) {
3261
+ function zo(e) {
3250
3262
  return {
3251
3263
  added: e.filter((e) => e.kind === "added").length,
3252
3264
  removed: e.filter((e) => e.kind === "removed").length
@@ -3254,7 +3266,7 @@ function Mo(e) {
3254
3266
  }
3255
3267
  //#endregion
3256
3268
  //#region web/src/call-summary.ts
3257
- function No(e) {
3269
+ function Bo(e) {
3258
3270
  if (e !== void 0 && /^\s*[[{]/.test(e)) try {
3259
3271
  return JSON.parse(e);
3260
3272
  } catch (e) {
@@ -3262,12 +3274,12 @@ function No(e) {
3262
3274
  throw e;
3263
3275
  }
3264
3276
  }
3265
- var Po = 1024;
3266
- function Fo(e, t) {
3267
- return t < Po ? e("kvcoder.ui.call.bytes", { count: t }) : t < Po * Po ? e("kvcoder.ui.call.kilobytes", { count: (t / Po).toFixed(1) }) : e("kvcoder.ui.call.megabytes", { count: (t / (Po * Po)).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) });
3268
3280
  }
3269
3281
  var Q = (e) => typeof e == "string" && e !== "" ? e : void 0;
3270
- function Io(e) {
3282
+ function Uo(e) {
3271
3283
  let t = e.edits;
3272
3284
  return Array.isArray(t) ? t.flatMap((e) => {
3273
3285
  let { oldText: t, newText: n } = q(e);
@@ -3277,28 +3289,28 @@ function Io(e) {
3277
3289
  }] : [];
3278
3290
  }) : [];
3279
3291
  }
3280
- function Lo(e) {
3281
- let t = Io(e).map((e) => Mo(jo(e.oldText, e.newText)));
3292
+ function Wo(e) {
3293
+ let t = Uo(e).map((e) => zo(Ro(e.oldText, e.newText)));
3282
3294
  return `+${t.reduce((e, t) => e + t.added, 0)} −${t.reduce((e, t) => e + t.removed, 0)}`;
3283
3295
  }
3284
- function Ro(e, t) {
3285
- if (typeof t.bytes == "number" && typeof t.created == "boolean") return e(t.created ? "kvcoder.ui.call.created" : "kvcoder.ui.call.replaced", { size: Fo(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) });
3286
3298
  }
3287
- function zo(e, t) {
3299
+ function Ko(e, t) {
3288
3300
  let { fromLine: n, totalLines: r, content: i } = t;
3289
3301
  if (typeof n != "number" || typeof r != "number" || typeof i != "string") return;
3290
- let a = ko(i).length;
3302
+ let a = Io(i).length;
3291
3303
  return a === 0 ? void 0 : e("kvcoder.ui.call.lines", {
3292
3304
  from: n,
3293
3305
  to: n + a - 1,
3294
3306
  total: r
3295
3307
  });
3296
3308
  }
3297
- function Bo(e, t) {
3309
+ function qo(e, t) {
3298
3310
  let n = t.entries;
3299
3311
  if (Array.isArray(n)) return e(t.truncated === !0 ? "kvcoder.ui.call.entriesFirst" : "kvcoder.ui.call.entries", { count: n.length });
3300
3312
  }
3301
- function Vo(e, t) {
3313
+ function Jo(e, t) {
3302
3314
  let n = t.files;
3303
3315
  if (!Array.isArray(n)) return;
3304
3316
  let r = n.reduce((e, t) => {
@@ -3310,7 +3322,7 @@ function Vo(e, t) {
3310
3322
  files: n.length
3311
3323
  });
3312
3324
  }
3313
- var Ho = (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;
3314
3326
  function $(e, t, n) {
3315
3327
  return {
3316
3328
  ...e === void 0 ? {} : { words: e },
@@ -3318,87 +3330,87 @@ function $(e, t, n) {
3318
3330
  ...n === void 0 ? {} : { outcome: n }
3319
3331
  };
3320
3332
  }
3321
- function Uo(e, t, n, r) {
3333
+ function Xo(e, t, n, r) {
3322
3334
  let i = r === void 0 ? void 0 : q(r), a = Q(n.path);
3323
- if (t === "edit") return $(e("kvcoder.ui.call.edit"), a, i === void 0 ? void 0 : Lo(n));
3324
- if (t === "write") return $(e("kvcoder.ui.call.write"), a, i === void 0 ? void 0 : Ro(e, i));
3325
- if (t === "read") return $(e("kvcoder.ui.call.read"), a, i === void 0 ? void 0 : zo(e, i));
3326
- if (t === "list") return $(e("kvcoder.ui.call.list"), a ?? ".", i === void 0 ? void 0 : Bo(e, i));
3327
- if (t === "search") return $(e("kvcoder.ui.call.search"), Q(n.pattern), i === void 0 ? void 0 : Vo(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));
3328
3340
  }
3329
- function Wo(e, t, n, r) {
3341
+ function Zo(e, t, n, r) {
3330
3342
  let i = Q(n.server), a = [i, Q(n.tool)].filter((e) => e !== void 0).join(" · ");
3331
3343
  if (t === "call") return $(void 0, a === "" ? void 0 : a);
3332
3344
  if (t === "run") {
3333
3345
  let e = n.steps;
3334
3346
  return $(void 0, [i, (Array.isArray(e) ? e.flatMap((e) => Q(q(e).tool) === void 0 ? [] : [String(q(e).tool)]) : []).join(", ")].filter((e) => e !== void 0 && e !== "").join(" · "));
3335
3347
  }
3336
- if (t === "tools") return $(e("kvcoder.ui.call.tools"), a === "" ? void 0 : a, Ho(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));
3337
3349
  }
3338
- function Go(e, t, n, r) {
3339
- if (t === "list") return $(e("kvcoder.ui.call.backgroundRuns"), void 0, Ho(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));
3340
3352
  if (t === "output" || t === "wait") {
3341
- let i = Eo(r);
3342
- return $(e(`kvcoder.ui.call.${t}`), Q(n.id), i === void 0 ? void 0 : To(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));
3343
3355
  }
3344
3356
  if (t === "stop") return $(e("kvcoder.ui.call.stop"), Q(n.id));
3345
3357
  }
3346
- function Ko(e, t, n, r) {
3358
+ function $o(e, t, n, r) {
3347
3359
  let i = Q(q(r).progress), a = n.steps, o = Array.isArray(a) ? a.flatMap((e) => Q(q(e).id) === void 0 ? [] : [String(q(e).id)]).join(", ") : void 0;
3348
3360
  return t === "set" ? $(e("kvcoder.ui.call.mapSet"), Q(n.goal), i) : t === "update" ? $(e("kvcoder.ui.call.mapUpdate"), o === "" ? void 0 : o, i) : t === "note" ? $(e("kvcoder.ui.call.mapNote"), Q(n.text)) : t === "get" ? $(e("kvcoder.ui.call.mapGet"), void 0, i) : void 0;
3349
3361
  }
3350
- function qo(e, t, n) {
3362
+ function es(e, t, n) {
3351
3363
  let { connector: r, command: i } = t, a = t.fields ?? {};
3352
3364
  if (r !== void 0 && i !== void 0) {
3353
3365
  if (t.line !== void 0) return { subject: `$ ${t.line}` };
3354
- if (r === "fs") return Uo(e, i, a, n);
3355
- if (r === "mcp") return Wo(e, i, a, n);
3356
- if (r === "background") return Go(e, i, a, n);
3357
- if (r === "execution-map") return Ko(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);
3358
3370
  if (r === "delegate" && i === "run") return $(e("kvcoder.ui.call.delegate"), [Q(a.worker), Q(a.title)].filter((e) => e !== void 0).join(" · "));
3359
3371
  if (r === "artifact" && i === "get") return $(e("kvcoder.ui.call.readArtifact"), Q(a.id));
3360
3372
  }
3361
3373
  }
3362
3374
  //#endregion
3363
3375
  //#region web/src/field-rows.ts
3364
- var Jo = "—", Yo = (e) => e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean", Xo = (e) => e === null ? Jo : String(e);
3365
- function Zo(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) {
3366
3378
  return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
3367
3379
  }
3368
- function Qo(e) {
3369
- let t = Zo(e);
3380
+ function as(e) {
3381
+ let t = is(e);
3370
3382
  if (t === void 0) return;
3371
3383
  let n = {};
3372
3384
  for (let [e, r] of Object.entries(t)) {
3373
- if (!Yo(r)) return;
3385
+ if (!ns(r)) return;
3374
3386
  n[e] = r;
3375
3387
  }
3376
3388
  return n;
3377
3389
  }
3378
- function $o(e) {
3390
+ function os(e) {
3379
3391
  let t = [...new Set(e.flatMap((e) => Object.keys(e)))];
3380
3392
  return {
3381
3393
  kind: "table",
3382
3394
  columns: t,
3383
- rows: e.map((e) => t.map((t) => t in e ? Xo(e[t] ?? null) : ""))
3395
+ rows: e.map((e) => t.map((t) => t in e ? rs(e[t] ?? null) : ""))
3384
3396
  };
3385
3397
  }
3386
- function es(e) {
3398
+ function ss(e) {
3387
3399
  if (e.length === 0) return { kind: "empty" };
3388
- if (e.every(Yo)) return {
3400
+ if (e.every(ns)) return {
3389
3401
  kind: "items",
3390
- items: e.map(Xo)
3402
+ items: e.map(rs)
3391
3403
  };
3392
- let t = e.map(Qo).filter((e) => e !== void 0);
3393
- return t.length === e.length ? $o(t) : {
3404
+ let t = e.map(as).filter((e) => e !== void 0);
3405
+ return t.length === e.length ? os(t) : {
3394
3406
  kind: "rows",
3395
3407
  rows: e.map((e, t) => ({
3396
3408
  name: String(t + 1),
3397
- value: ts(e)
3409
+ value: cs(e)
3398
3410
  }))
3399
3411
  };
3400
3412
  }
3401
- function ts(e) {
3413
+ function cs(e) {
3402
3414
  if (typeof e == "string") return e.includes("\n") ? {
3403
3415
  kind: "block",
3404
3416
  text: e
@@ -3410,27 +3422,27 @@ function ts(e) {
3410
3422
  kind: "text",
3411
3423
  text: String(e)
3412
3424
  };
3413
- if (Array.isArray(e)) return es(e);
3414
- let t = Zo(e);
3425
+ if (Array.isArray(e)) return ss(e);
3426
+ let t = is(e);
3415
3427
  return t === void 0 || Object.keys(t).length === 0 ? { kind: "empty" } : {
3416
3428
  kind: "rows",
3417
- rows: ns(t)
3429
+ rows: ls(t)
3418
3430
  };
3419
3431
  }
3420
- function ns(e) {
3432
+ function ls(e) {
3421
3433
  return Object.entries(e).map(([e, t]) => ({
3422
3434
  name: e,
3423
- value: ts(t)
3435
+ value: cs(t)
3424
3436
  }));
3425
3437
  }
3426
- function rs(e, t) {
3438
+ function us(e, t) {
3427
3439
  return t || e.length <= 12 ? e : e.slice(0, 12);
3428
3440
  }
3429
- var is = (e) => ko(e).map((e) => ({ text: e })), as = (e, t) => ko(e).map((e, n) => ({
3441
+ var ds = (e) => Io(e).map((e) => ({ text: e })), fs = (e, t) => Io(e).map((e, n) => ({
3430
3442
  text: e,
3431
3443
  number: t + n
3432
3444
  }));
3433
- function os(e, t) {
3445
+ function ps(e, t) {
3434
3446
  return t || e.length <= 17 ? e : [
3435
3447
  ...e.slice(0, 12),
3436
3448
  "⋯",
@@ -3439,7 +3451,7 @@ function os(e, t) {
3439
3451
  }
3440
3452
  //#endregion
3441
3453
  //#region web/src/FoldButton.vue?vue&type=script&setup=true&lang.ts
3442
- var ss = ["aria-expanded"], cs = /* @__PURE__ */ c({
3454
+ var ms = ["aria-expanded"], hs = /* @__PURE__ */ c({
3443
3455
  __name: "FoldButton",
3444
3456
  props: {
3445
3457
  count: {},
@@ -3456,119 +3468,119 @@ var ss = ["aria-expanded"], cs = /* @__PURE__ */ c({
3456
3468
  "aria-expanded": n.open,
3457
3469
  "data-test": "show-all",
3458
3470
  onClick: t[0] ||= (e) => a("toggle")
3459
- }, E(n.open ? D(o).t("kvcoder.ui.call.showFewer") : D(o).t("kvcoder.ui.call.showAll", { count: n.count })), 9, ss)) : 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);
3460
3472
  }
3461
- }), ls = { class: "kvc-code-lines" }, us = ["dir", "data-kind"], ds = {
3473
+ }), gs = { class: "kvc-code-lines" }, _s = ["dir", "data-kind"], vs = {
3462
3474
  key: 0,
3463
3475
  class: "kvc-line-number",
3464
3476
  "data-test": "call-line-number"
3465
- }, fs = {
3477
+ }, ys = {
3466
3478
  key: 1,
3467
3479
  class: "kvc-line-mark",
3468
3480
  "aria-hidden": "true"
3469
- }, ps = {
3481
+ }, bs = {
3470
3482
  class: "kvc-line-text",
3471
3483
  dir: "auto",
3472
3484
  "data-test": "call-line-text"
3473
- }, ms = /* @__PURE__ */ c({
3485
+ }, xs = /* @__PURE__ */ c({
3474
3486
  __name: "FoldedLines",
3475
3487
  props: { lines: {} },
3476
3488
  setup(n) {
3477
- let o = n, c = y(!1), l = t(() => rs(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 = {
3478
3490
  context: " ",
3479
3491
  removed: "−",
3480
3492
  added: "+"
3481
3493
  };
3482
- return (t, n) => (_(), i("div", ls, [(_(!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", {
3483
3495
  key: t,
3484
3496
  class: "kvc-code-line",
3485
3497
  dir: u.value || d.value ? "ltr" : void 0,
3486
3498
  "data-kind": e.kind,
3487
3499
  "data-test": "call-line-row"
3488
3500
  }, [
3489
- u.value ? (_(), i("span", ds, E(e.number), 1)) : r("v-if", !0),
3490
- d.value ? (_(), i("span", fs, E(f[e.kind ?? "context"]), 1)) : r("v-if", !0),
3491
- a("span", ps, [s(Y, { text: e.text }, null, 8, ["text"])])
3492
- ], 8, us))), 128)), s(cs, {
3501
+ u.value ? (_(), i("span", vs, E(e.number), 1)) : r("v-if", !0),
3502
+ d.value ? (_(), i("span", ys, E(f[e.kind ?? "context"]), 1)) : r("v-if", !0),
3503
+ a("span", bs, [s(Y, { text: e.text }, null, 8, ["text"])])
3504
+ ], 8, _s))), 128)), s(hs, {
3493
3505
  count: o.lines.length,
3494
3506
  open: c.value,
3495
3507
  onToggle: n[0] ||= (e) => c.value = !c.value
3496
3508
  }, null, 8, ["count", "open"])]));
3497
3509
  }
3498
- }), hs = {
3510
+ }), Ss = {
3499
3511
  key: 0,
3500
3512
  dir: "auto",
3501
3513
  "data-test": "field-text"
3502
- }, gs = {
3514
+ }, Cs = {
3503
3515
  key: 1,
3504
3516
  class: "kvc-muted",
3505
3517
  "data-test": "field-empty"
3506
- }, _s = {
3518
+ }, ws = {
3507
3519
  key: 3,
3508
3520
  class: "kvc-field-table"
3509
- }, vs = { "data-test": "field-table" }, ys = {
3521
+ }, Ts = { "data-test": "field-table" }, Es = {
3510
3522
  key: 4,
3511
3523
  class: "kvc-field-items",
3512
3524
  "data-test": "field-items"
3513
- }, bs = {
3525
+ }, Ds = {
3514
3526
  key: 5,
3515
3527
  class: "kvc-fields",
3516
3528
  "data-test": "call-fields"
3517
- }, xs = ["data-name"], Ss = {
3529
+ }, Os = ["data-name"], ks = {
3518
3530
  class: "kvc-muted",
3519
3531
  dir: "ltr"
3520
- }, Cs = { "data-test": "field-value" }, ws = /* @__PURE__ */ c({
3532
+ }, As = { "data-test": "field-value" }, js = /* @__PURE__ */ c({
3521
3533
  __name: "FieldsView",
3522
3534
  props: { value: {} },
3523
3535
  setup(r) {
3524
- let o = r, c = y(!1), l = t(() => o.value.kind === "table" ? rs(o.value.rows, c.value) : []), u = t(() => o.value.kind === "items" ? rs(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) : []);
3525
3537
  return (t, r) => {
3526
3538
  let d = S("FieldsView", !0);
3527
- return o.value.kind === "text" ? (_(), i("span", hs, [s(Y, { text: o.value.text }, null, 8, ["text"])])) : o.value.kind === "empty" ? (_(), i("span", gs, "—")) : o.value.kind === "block" ? (_(), n(ms, {
3539
+ return o.value.kind === "text" ? (_(), i("span", Ss, [s(Y, { text: o.value.text }, null, 8, ["text"])])) : o.value.kind === "empty" ? (_(), i("span", Cs, "—")) : o.value.kind === "block" ? (_(), n(xs, {
3528
3540
  key: 2,
3529
3541
  class: "kvc-field-block",
3530
- lines: D(is)(o.value.text),
3542
+ lines: D(ds)(o.value.text),
3531
3543
  "data-test": "field-block"
3532
- }, null, 8, ["lines"])) : o.value.kind === "table" ? (_(), i("div", _s, [a("table", vs, [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", {
3533
3545
  key: e,
3534
3546
  scope: "col",
3535
3547
  dir: "ltr"
3536
3548
  }, E(e), 1))), 128))])]), a("tbody", null, [(_(!0), i(e, null, b(l.value, (t, n) => (_(), i("tr", { key: n }, [(_(!0), i(e, null, b(t, (e, t) => (_(), i("td", {
3537
3549
  key: t,
3538
3550
  dir: "auto"
3539
- }, [s(Y, { text: e }, null, 8, ["text"])]))), 128))]))), 128))])]), s(cs, {
3551
+ }, [s(Y, { text: e }, null, 8, ["text"])]))), 128))]))), 128))])]), s(hs, {
3540
3552
  count: o.value.rows.length,
3541
3553
  open: c.value,
3542
3554
  onToggle: r[0] ||= (e) => c.value = !c.value
3543
- }, null, 8, ["count", "open"])])) : o.value.kind === "items" ? (_(), i("div", ys, [(_(!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", {
3544
3556
  key: t,
3545
3557
  dir: "auto"
3546
- }, [s(Y, { text: e }, null, 8, ["text"])]))), 128)), s(cs, {
3558
+ }, [s(Y, { text: e }, null, 8, ["text"])]))), 128)), s(hs, {
3547
3559
  count: o.value.items.length,
3548
3560
  open: c.value,
3549
3561
  onToggle: r[1] ||= (e) => c.value = !c.value
3550
- }, null, 8, ["count", "open"])])) : (_(), i("dl", bs, [(_(!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", {
3551
3563
  key: e.name,
3552
3564
  class: "kvc-field-row",
3553
3565
  "data-name": e.name,
3554
3566
  "data-test": "field-row"
3555
- }, [a("dt", Ss, E(e.name), 1), a("dd", Cs, [s(d, { value: e.value }, null, 8, ["value"])])], 8, xs))), 128))]));
3567
+ }, [a("dt", ks, E(e.name), 1), a("dd", As, [s(d, { value: e.value }, null, 8, ["value"])])], 8, Os))), 128))]));
3556
3568
  };
3557
3569
  }
3558
- }), Ts = ["aria-label"], Es = ["aria-label"], Ds = /* @__PURE__ */ c({
3570
+ }), Ms = ["aria-label"], Ns = ["aria-label"], Ps = /* @__PURE__ */ c({
3559
3571
  __name: "CallRequest",
3560
3572
  props: { view: {} },
3561
3573
  setup(a) {
3562
- let o = a, c = K(), l = t(() => ma(o.view)), u = t(() => o.view.fields ?? {}), d = t(() => Io(u.value).map((e) => jo(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 : {});
3563
- return (t, a) => l.value === "edit" ? (_(!0), i(e, { key: 0 }, b(d.value, (e, t) => (_(), n(ms, {
3574
+ let o = a, c = K(), l = t(() => ha(o.view)), u = t(() => o.view.fields ?? {}), d = t(() => Uo(u.value).map((e) => Ro(e.oldText, e.newText))), f = t(() => typeof u.value.content == "string" ? u.value.content : ""), p = t(() => typeof u.value.task == "string" ? u.value.task : ""), m = t(() => l.value === "mcp-call" ? q(u.value.arguments) : l.value === "fields" ? u.value : {});
3575
+ return (t, a) => l.value === "edit" ? (_(!0), i(e, { key: 0 }, b(d.value, (e, t) => (_(), n(xs, {
3564
3576
  key: t,
3565
3577
  class: "kvc-block",
3566
3578
  lines: e,
3567
3579
  "data-test": "call-diff"
3568
- }, null, 8, ["lines"]))), 128)) : l.value === "write" ? (_(), n(ms, {
3580
+ }, null, 8, ["lines"]))), 128)) : l.value === "write" ? (_(), n(xs, {
3569
3581
  key: 1,
3570
3582
  class: "kvc-block",
3571
- lines: D(as)(f.value, 1),
3583
+ lines: D(fs)(f.value, 1),
3572
3584
  "data-test": "call-content"
3573
3585
  }, null, 8, ["lines"])) : l.value === "line" ? (_(), i("pre", {
3574
3586
  key: 2,
@@ -3576,10 +3588,10 @@ var ss = ["aria-expanded"], cs = /* @__PURE__ */ c({
3576
3588
  dir: "ltr",
3577
3589
  "aria-label": D(c).t("kvcoder.ui.command"),
3578
3590
  "data-test": "call-payload"
3579
- }, "$ " + E(o.view.line), 9, Ts)) : l.value === "delegate" ? (_(), n(ms, {
3591
+ }, "$ " + E(o.view.line), 9, Ms)) : l.value === "delegate" ? (_(), n(xs, {
3580
3592
  key: 3,
3581
3593
  class: "kvc-block kvc-prose-lines",
3582
- lines: D(is)(p.value),
3594
+ lines: D(ds)(p.value),
3583
3595
  "aria-label": D(c).t("kvcoder.ui.call.task"),
3584
3596
  "data-test": "call-task"
3585
3597
  }, null, 8, ["lines", "aria-label"])) : Object.keys(m.value).length > 0 ? (_(), i("div", {
@@ -3587,19 +3599,19 @@ var ss = ["aria-expanded"], cs = /* @__PURE__ */ c({
3587
3599
  class: "kvc-block",
3588
3600
  "aria-label": D(c).t("kvcoder.ui.call.payload"),
3589
3601
  "data-test": "call-payload-fields"
3590
- }, [s(ws, { value: D(ts)(m.value) }, null, 8, ["value"])], 8, Es)) : r("v-if", !0);
3602
+ }, [s(js, { value: D(cs)(m.value) }, null, 8, ["value"])], 8, Ns)) : r("v-if", !0);
3591
3603
  }
3592
- }), Os = { class: "kvc-output-block" }, ks = ["aria-label"], As = /* @__PURE__ */ c({
3604
+ }), Fs = { class: "kvc-output-block" }, Is = ["aria-label"], Ls = /* @__PURE__ */ c({
3593
3605
  __name: "FoldedOutput",
3594
3606
  props: { output: {} },
3595
3607
  setup(e) {
3596
- let n = e, r = K(), o = y(!1), c = t(() => n.output.split("\n")), l = t(() => os(c.value, o.value).join("\n"));
3597
- return (e, t) => (_(), i("div", Os, [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", {
3598
3610
  class: "kvc-output",
3599
3611
  dir: "auto",
3600
3612
  "aria-label": D(r).t("kvcoder.ui.output"),
3601
3613
  "data-test": "call-output"
3602
- }, [s(Y, { text: l.value }, null, 8, ["text"])], 8, ks), s(cs, {
3614
+ }, [s(Y, { text: l.value }, null, 8, ["text"])], 8, Is), s(hs, {
3603
3615
  count: c.value.length,
3604
3616
  open: o.value,
3605
3617
  over: D(12) + D(5),
@@ -3613,7 +3625,7 @@ var ss = ["aria-expanded"], cs = /* @__PURE__ */ c({
3613
3625
  });
3614
3626
  //#endregion
3615
3627
  //#region web/src/durations.ts
3616
- function js(e, t) {
3628
+ function Rs(e, t) {
3617
3629
  if (t < 1e3) return e("kvcoder.ui.milliseconds", { count: Math.round(t) });
3618
3630
  if (t < 1e4) return e("kvcoder.ui.seconds", { count: (t / 1e3).toFixed(1) });
3619
3631
  let n = Math.round(t / 1e3);
@@ -3624,21 +3636,21 @@ function js(e, t) {
3624
3636
  }
3625
3637
  //#endregion
3626
3638
  //#region web/src/RunOutput.vue?vue&type=script&setup=true&lang.ts
3627
- var Ms = {
3639
+ var zs = {
3628
3640
  class: "kvc-block kvc-run-row",
3629
3641
  "data-test": "run-row"
3630
- }, Ns = {
3642
+ }, Bs = {
3631
3643
  class: "kvc-run-call",
3632
3644
  dir: "auto",
3633
3645
  "data-test": "run-call"
3634
- }, Ps = {
3646
+ }, Vs = {
3635
3647
  class: "kvc-chip",
3636
3648
  "data-test": "run-status"
3637
- }, Fs = {
3649
+ }, Hs = {
3638
3650
  key: 0,
3639
3651
  class: "kvc-muted",
3640
3652
  "data-test": "run-time"
3641
- }, Is = ["aria-label"], Ls = ["aria-label"], Rs = ["aria-label"], zs = ["aria-label"], Bs = /* @__PURE__ */ c({
3653
+ }, Us = ["aria-label"], Ws = ["aria-label"], Gs = ["aria-label"], Ks = ["aria-label"], qs = /* @__PURE__ */ c({
3642
3654
  __name: "RunOutput",
3643
3655
  props: { run: {} },
3644
3656
  setup(c) {
@@ -3648,59 +3660,59 @@ var Ms = {
3648
3660
  params: { text: f.value ?? "" }
3649
3661
  }));
3650
3662
  return (t, c) => (_(), i(e, null, [
3651
- a("div", Ms, [
3652
- a("span", Ns, E(l.run.call), 1),
3653
- a("span", Ps, [o(E(D(To)(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))]),
3654
- l.run.ranMs === void 0 ? r("v-if", !0) : (_(), i("span", Fs, E(D(js)(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))
3655
3667
  ]),
3656
3668
  p.value === void 0 ? l.run.problem === void 0 ? r("v-if", !0) : (_(), i("div", {
3657
3669
  key: 1,
3658
3670
  class: "kvc-block kvc-error",
3659
3671
  "aria-label": D(u).t("kvcoder.ui.call.error"),
3660
3672
  "data-test": "run-problem"
3661
- }, [s(ws, { value: D(ts)(l.run.problem) }, null, 8, ["value"])], 8, Ls)) : (_(), i("pre", {
3673
+ }, [s(js, { value: D(cs)(l.run.problem) }, null, 8, ["value"])], 8, Ws)) : (_(), i("pre", {
3662
3674
  key: 0,
3663
3675
  class: "kvc-block kvc-error",
3664
3676
  dir: "auto",
3665
3677
  "aria-label": D(u).t("kvcoder.ui.call.error"),
3666
3678
  "data-test": "run-problem"
3667
- }, [s(Y, { text: p.value }, null, 8, ["text"])], 8, Is)),
3679
+ }, [s(Y, { text: p.value }, null, 8, ["text"])], 8, Us)),
3668
3680
  f.value === void 0 && l.run.output !== void 0 ? (_(), i("div", {
3669
3681
  key: 2,
3670
3682
  class: "kvc-block",
3671
3683
  "aria-label": D(u).t("kvcoder.ui.output"),
3672
3684
  "data-test": "call-result-fields"
3673
- }, [s(ws, { value: D(ts)(l.run.output) }, null, 8, ["value"])], 8, Rs)) : 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", {
3674
3686
  key: 3,
3675
3687
  class: "kvc-block",
3676
3688
  "aria-label": D(u).t("kvcoder.ui.call.answer"),
3677
3689
  "data-test": "call-answer"
3678
- }, [(_(), n(C(D(u).View), { view: m.value }, null, 8, ["view"]))], 8, zs)) : f.value ? (_(), n(As, {
3690
+ }, [(_(), n(C(D(u).View), { view: m.value }, null, 8, ["view"]))], 8, Ks)) : f.value ? (_(), n(Ls, {
3679
3691
  key: 4,
3680
3692
  output: f.value
3681
3693
  }, null, 8, ["output"])) : r("v-if", !0)
3682
3694
  ], 64));
3683
3695
  }
3684
- }), Vs = {
3696
+ }), Js = {
3685
3697
  key: 0,
3686
3698
  class: "kvc-muted kvc-call-parts",
3687
3699
  "data-test": "call-replacements"
3688
- }, Hs = {
3700
+ }, Ys = {
3689
3701
  key: 2,
3690
3702
  class: "kvc-block kvc-entries",
3691
3703
  "data-test": "call-entries"
3692
- }, Us = ["data-kind"], Ws = {
3704
+ }, Xs = ["data-kind"], Zs = {
3693
3705
  class: "kvc-mono",
3694
3706
  dir: "auto",
3695
3707
  "data-test": "call-entry-name"
3696
- }, Gs = {
3708
+ }, Qs = {
3697
3709
  key: 0,
3698
3710
  class: "kvc-muted",
3699
3711
  "data-test": "call-entry-size"
3700
- }, Ks = {
3712
+ }, $s = {
3701
3713
  class: "kvc-mono kvc-file-path",
3702
3714
  "data-test": "call-file-path"
3703
- }, qs = ["aria-label"], Js = ["aria-label"], Ys = /* @__PURE__ */ c({
3715
+ }, ec = ["aria-label"], tc = ["aria-label"], nc = /* @__PURE__ */ c({
3704
3716
  __name: "CallResult",
3705
3717
  props: {
3706
3718
  view: {},
@@ -3708,7 +3720,7 @@ var Ms = {
3708
3720
  result: {}
3709
3721
  },
3710
3722
  setup(o) {
3711
- let c = o, l = K(), u = t(() => ma(c.view)), d = t(() => u.value === "edit" ? yo(c.result) : void 0), f = t(() => u.value === "read" ? bo(c.result) : void 0), p = t(() => u.value === "list" ? So(c.result) : void 0), m = t(() => u.value === "search" ? Do(c.result) : void 0), h = t(() => u.value === "run-output" ? Eo(c.result) : void 0), g = y(!1), v = t(() => rs(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(() => ({
3712
3724
  type: "markdown",
3713
3725
  text: "kvcoder.markdown",
3714
3726
  params: { text: c.output }
@@ -3718,25 +3730,25 @@ var Ms = {
3718
3730
  class: "kvc-block",
3719
3731
  "aria-label": D(l).t("kvcoder.ui.call.answer"),
3720
3732
  "data-test": "call-answer"
3721
- }, [(_(), n(C(D(l).View), { view: x.value }, null, 8, ["view"]))], 8, qs)) : S.value ? (_(), i("div", {
3733
+ }, [(_(), n(C(D(l).View), { view: x.value }, null, 8, ["view"]))], 8, ec)) : S.value ? (_(), i("div", {
3722
3734
  key: 7,
3723
3735
  class: "kvc-block",
3724
3736
  "aria-label": D(l).t("kvcoder.ui.output"),
3725
3737
  "data-test": "call-result-fields"
3726
- }, [s(ws, { value: D(ts)(c.result) }, null, 8, ["value"])], 8, Js)) : c.output === "" ? r("v-if", !0) : (_(), n(As, {
3738
+ }, [s(js, { value: D(cs)(c.result) }, null, 8, ["value"])], 8, tc)) : c.output === "" ? r("v-if", !0) : (_(), n(Ls, {
3727
3739
  key: 8,
3728
3740
  output: c.output
3729
- }, null, 8, ["output"])) : (_(), n(Bs, {
3741
+ }, null, 8, ["output"])) : (_(), n(qs, {
3730
3742
  key: 5,
3731
3743
  run: h.value
3732
3744
  }, null, 8, ["run"])) : (_(!0), i(e, { key: 3 }, b(m.value, (e) => (_(), i("div", {
3733
3745
  key: e.path,
3734
3746
  class: "kvc-block",
3735
3747
  "data-test": "call-file"
3736
- }, [a("div", Ks, E(e.path), 1), s(ms, { lines: e.matches.map((e) => ({
3748
+ }, [a("div", $s, E(e.path), 1), s(xs, { lines: e.matches.map((e) => ({
3737
3749
  text: e.text,
3738
3750
  number: e.line
3739
- })) }, null, 8, ["lines"])]))), 128)) : (_(), i("div", Hs, [(_(!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", {
3740
3752
  key: e.name,
3741
3753
  class: "kvc-entry",
3742
3754
  "data-kind": e.kind,
@@ -3746,40 +3758,40 @@ var Ms = {
3746
3758
  size: 14,
3747
3759
  "aria-hidden": "true"
3748
3760
  })),
3749
- a("span", Ws, E(e.name), 1),
3750
- e.kind === "file" ? (_(), i("span", Gs, E(D(Fo)(D(l).t, e.bytes)), 1)) : r("v-if", !0)
3751
- ], 8, Us))), 128)), s(cs, {
3761
+ a("span", Zs, E(e.name), 1),
3762
+ e.kind === "file" ? (_(), i("span", Qs, E(D(Ho)(D(l).t, e.bytes)), 1)) : r("v-if", !0)
3763
+ ], 8, Xs))), 128)), s(hs, {
3752
3764
  count: p.value.length,
3753
3765
  open: g.value,
3754
3766
  onToggle: o[0] ||= (e) => g.value = !g.value
3755
- }, null, 8, ["count", "open"])])) : (_(), n(ms, {
3767
+ }, null, 8, ["count", "open"])])) : (_(), n(xs, {
3756
3768
  key: 1,
3757
3769
  class: "kvc-block",
3758
- lines: D(as)(f.value.content, f.value.fromLine),
3770
+ lines: D(fs)(f.value.content, f.value.fromLine),
3759
3771
  "data-test": "call-content"
3760
- }, null, 8, ["lines"])) : (_(), i("p", Vs, E(D(l).t("kvcoder.ui.call.replacements", {
3772
+ }, null, 8, ["lines"])) : (_(), i("p", Js, E(D(l).t("kvcoder.ui.call.replacements", {
3761
3773
  count: d.value.replacements,
3762
3774
  line: d.value.firstChangedLine
3763
3775
  })), 1));
3764
3776
  }
3765
- }), Xs = {
3777
+ }), rc = {
3766
3778
  key: 0,
3767
3779
  class: "kvc-summary",
3768
3780
  "data-test": "call-summary"
3769
- }, Zs = {
3781
+ }, ic = {
3770
3782
  key: 0,
3771
3783
  "data-test": "call-words"
3772
- }, Qs = {
3784
+ }, ac = {
3773
3785
  key: 1,
3774
3786
  class: "kvc-mono",
3775
3787
  "data-test": "call-subject"
3776
- }, $s = ["dir"], ec = {
3788
+ }, oc = ["dir"], sc = {
3777
3789
  key: 1,
3778
3790
  class: "kvc-muted",
3779
3791
  dir: "ltr",
3780
3792
  style: { "align-self": "flex-start" },
3781
3793
  "data-test": "call-label"
3782
- }, tc = /* @__PURE__ */ c({
3794
+ }, cc = /* @__PURE__ */ c({
3783
3795
  __name: "CallSummaryLine",
3784
3796
  props: {
3785
3797
  view: {},
@@ -3787,46 +3799,50 @@ var Ms = {
3787
3799
  whole: { type: Boolean }
3788
3800
  },
3789
3801
  setup(e) {
3790
- let n = e, a = K(), o = t(() => qo(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));
3791
- return (e, t) => o.value === void 0 ? n.view.label ? (_(), i("span", ec, E(n.view.label), 1)) : r("v-if", !0) : (_(), i("span", Xs, [
3792
- o.value.words ? (_(), i("span", Zs, E(o.value.words), 1)) : r("v-if", !0),
3793
- c.value ? (_(), i("span", Qs, 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),
3794
3806
  o.value.outcome ? (_(), i("span", {
3795
3807
  key: 2,
3796
3808
  class: "kvc-muted",
3797
3809
  dir: s.value,
3798
3810
  "data-test": "call-outcome"
3799
- }, E(o.value.outcome), 9, $s)) : r("v-if", !0)
3811
+ }, E(o.value.outcome), 9, oc)) : r("v-if", !0)
3800
3812
  ]));
3801
3813
  }
3802
- }), nc = ["aria-expanded", "disabled"], rc = ["aria-label"], ic = { class: "kvc-lines" }, ac = {
3814
+ }), lc = ["aria-expanded", "disabled"], uc = ["aria-label"], dc = { class: "kvc-lines" }, fc = {
3803
3815
  key: 0,
3804
3816
  style: { "font-weight": "600" },
3805
3817
  "data-test": "call-description"
3806
- }, oc = {
3818
+ }, pc = {
3807
3819
  key: 1,
3808
3820
  class: "kvc-oneline",
3809
3821
  "data-test": "call-line"
3810
- }, sc = { class: "kvc-mono" }, cc = {
3822
+ }, mc = { class: "kvc-mono" }, hc = {
3811
3823
  key: 2,
3812
3824
  class: "kvc-chip kvc-warn",
3813
3825
  "data-test": "call-risky"
3814
- }, lc = {
3826
+ }, gc = {
3815
3827
  key: 3,
3816
3828
  class: "kvc-chip",
3817
3829
  "data-test": "call-background"
3818
- }, uc = {
3830
+ }, _c = {
3819
3831
  key: 4,
3832
+ class: "kvc-chip",
3833
+ "data-test": "call-not-run"
3834
+ }, vc = {
3835
+ key: 5,
3820
3836
  class: "kvc-chip kvc-danger",
3821
3837
  "data-test": "call-failed"
3822
- }, dc = {
3838
+ }, yc = {
3823
3839
  class: "kvc-muted",
3824
3840
  "data-test": "call-time"
3825
- }, fc = {
3841
+ }, bc = {
3826
3842
  key: 0,
3827
3843
  class: "kvc-muted kvc-call-parts",
3828
3844
  "data-test": "call-parts"
3829
- }, pc = ["aria-label"], mc = /* @__PURE__ */ c({
3845
+ }, xc = ["aria-expanded"], Sc = ["aria-label"], Cc = /* @__PURE__ */ c({
3830
3846
  __name: "CallCard",
3831
3847
  props: {
3832
3848
  view: {},
@@ -3836,16 +3852,19 @@ var Ms = {
3836
3852
  running: { type: Boolean }
3837
3853
  },
3838
3854
  setup(o) {
3839
- let c = o, l = K(), u = t(() => ma(c.view)), d = y(c.output !== void 0 && (c.failed === !0 || u.value === "edit" || u.value === "write")), p = t(() => c.failed === !0 ? void 0 : No(c.output)), m = t(() => c.failed === !0 && u.value !== "line"), h = t(() => c.durationMs === void 0 ? "" : js(l.t, (c.view.writtenMs ?? 0) + c.durationMs)), 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(() => {
3856
+ let e = m.value;
3857
+ return e === void 0 ? "" : e.kind === "error" ? e.message : l.t(`kvcoder.ui.failure.${e.kind}`);
3858
+ }), v = t(() => c.failed === !0 ? void 0 : Bo(c.output)), b = t(() => c.failed === !0 && u.value !== "line"), x = t(() => c.durationMs === void 0 ? "" : Rs(l.t, (c.view.writtenMs ?? 0) + c.durationMs)), S = t(() => {
3840
3859
  if (c.durationMs === void 0) return "";
3841
- let e = js(l.t, c.durationMs);
3860
+ let e = Rs(l.t, c.durationMs);
3842
3861
  return c.view.writtenMs === void 0 ? l.t("kvcoder.ui.callRan", { ran: e }) : l.t("kvcoder.ui.callParts", {
3843
- written: js(l.t, c.view.writtenMs),
3862
+ written: Rs(l.t, c.view.writtenMs),
3844
3863
  ran: e
3845
3864
  });
3846
3865
  });
3847
3866
  return (t, o) => (_(), i("div", {
3848
- class: f(["kvc-card", { "kvc-failed": c.failed }]),
3867
+ class: f(["kvc-card", { "kvc-failed": c.failed && !h.value }]),
3849
3868
  "data-test": "call-card"
3850
3869
  }, [a("button", {
3851
3870
  type: "button",
@@ -3862,95 +3881,106 @@ var Ms = {
3862
3881
  key: 0,
3863
3882
  class: "kvc-spin",
3864
3883
  "aria-label": D(l).t("kvcoder.ui.running")
3865
- }, null, 8, rc)) : (_(), n(C(d.value ? D(ce) : D(le)), {
3884
+ }, null, 8, uc)) : (_(), n(C(d.value ? D(U) : D(le)), {
3866
3885
  key: 1,
3867
3886
  size: 16,
3868
3887
  "aria-hidden": "true"
3869
3888
  })),
3870
- a("span", ic, [c.view.description ? (_(), i("span", ac, E(c.view.description), 1)) : c.view.connector === void 0 && c.view.line ? (_(), i("span", oc, [a("span", sc, E(D(ha)(c.view.line)), 1)])) : r("v-if", !0), s(tc, {
3871
- view: c.view,
3872
- result: p.value
3873
- }, null, 8, ["view", "result"])]),
3874
- c.view.risky ? (_(), i("span", cc, E(D(l).t("kvcoder.ui.call.risky")), 1)) : r("v-if", !0),
3875
- c.view.background ? (_(), i("span", lc, E(D(l).t("kvcoder.ui.jobs.background")), 1)) : r("v-if", !0),
3876
- c.failed ? (_(), i("span", uc, E(D(l).t("kvcoder.ui.callFailed")), 1)) : r("v-if", !0),
3877
- a("span", dc, E(h.value), 1)
3878
- ], 8, nc), d.value && c.output !== void 0 ? (_(), i(e, { key: 0 }, [
3879
- g.value === "" ? r("v-if", !0) : (_(), i("p", fc, E(g.value), 1)),
3880
- m.value ? (_(), i("pre", {
3881
- key: 1,
3882
- class: "kvc-block kvc-error",
3883
- dir: "auto",
3884
- "aria-label": D(l).t("kvcoder.ui.call.error"),
3885
- "data-test": "call-error"
3886
- }, [s(Y, { text: c.output }, null, 8, ["text"])], 8, pc)) : r("v-if", !0),
3887
- s(Ds, { view: c.view }, null, 8, ["view"]),
3888
- m.value ? r("v-if", !0) : (_(), n(Ys, {
3889
- key: 2,
3890
- view: c.view,
3891
- output: c.output,
3892
- result: p.value
3893
- }, null, 8, [
3894
- "view",
3895
- "output",
3896
- "result"
3897
- ]))
3898
- ], 64)) : r("v-if", !0)], 2));
3889
+ a("span", dc, [
3890
+ c.view.description ? (_(), i("span", fc, E(c.view.description), 1)) : c.view.connector === void 0 && c.view.line ? (_(), i("span", pc, [a("span", mc, E(D(ga)(c.view.line)), 1)])) : r("v-if", !0),
3891
+ s(cc, {
3892
+ view: c.view,
3893
+ result: v.value
3894
+ }, null, 8, ["view", "result"]),
3895
+ g.value === "" ? r("v-if", !0) : (_(), i("span", {
3896
+ key: 2,
3897
+ class: f(["kvc-oneline", h.value ? "kvc-muted" : "kvc-danger"]),
3898
+ dir: "auto",
3899
+ "data-test": "call-reason"
3900
+ }, E(g.value), 3))
3901
+ ]),
3902
+ c.view.risky ? (_(), i("span", hc, E(D(l).t("kvcoder.ui.call.risky")), 1)) : r("v-if", !0),
3903
+ c.view.background ? (_(), i("span", gc, E(D(l).t("kvcoder.ui.jobs.background")), 1)) : r("v-if", !0),
3904
+ h.value ? (_(), i("span", _c, E(D(l).t("kvcoder.ui.callNotRun")), 1)) : c.failed ? (_(), i("span", vc, E(D(l).t("kvcoder.ui.callFailed")), 1)) : r("v-if", !0),
3905
+ a("span", yc, E(x.value), 1)
3906
+ ], 8, lc), d.value && c.output !== void 0 ? (_(), i(e, { key: 0 }, [S.value === "" ? r("v-if", !0) : (_(), i("p", bc, E(S.value), 1)), b.value ? (_(), i(e, { key: 1 }, [a("button", {
3907
+ type: "button",
3908
+ class: "kvc-text-button kvc-fold",
3909
+ "aria-expanded": p.value,
3910
+ "data-test": "call-details",
3911
+ onClick: o[1] ||= (e) => p.value = !p.value
3912
+ }, E(D(l).t(p.value ? "kvcoder.ui.call.hideDetails" : "kvcoder.ui.call.showDetails")), 9, xc), p.value ? (_(), i(e, { key: 0 }, [a("pre", {
3913
+ class: "kvc-block kvc-error",
3914
+ dir: "auto",
3915
+ "aria-label": D(l).t("kvcoder.ui.call.error"),
3916
+ "data-test": "call-error"
3917
+ }, [s(Y, { text: c.output }, null, 8, ["text"])], 8, Sc), s(Ps, { view: c.view }, null, 8, ["view"])], 64)) : r("v-if", !0)], 64)) : (_(), i(e, { key: 2 }, [s(Ps, { view: c.view }, null, 8, ["view"]), s(nc, {
3918
+ view: c.view,
3919
+ output: c.output,
3920
+ result: v.value
3921
+ }, null, 8, [
3922
+ "view",
3923
+ "output",
3924
+ "result"
3925
+ ])], 64))], 64)) : r("v-if", !0)], 2));
3899
3926
  }
3900
- }), hc = {
3927
+ }), wc = {
3901
3928
  key: 0,
3902
3929
  class: "kvc-card",
3903
3930
  "data-test": "background-result"
3904
- }, gc = { class: "kvc-card-row" }, _c = {
3931
+ }, Tc = { class: "kvc-card-row" }, Ec = {
3905
3932
  style: {
3906
3933
  flex: "1 1 auto",
3907
3934
  "min-inline-size": "0"
3908
3935
  },
3909
3936
  "data-test": "background-title"
3910
- }, vc = {
3937
+ }, Dc = {
3911
3938
  key: 0,
3912
3939
  class: "kvc-muted",
3913
3940
  "data-test": "background-time"
3914
- }, yc = { class: "kvc-output" }, bc = {
3941
+ }, Oc = { class: "kvc-output" }, kc = {
3915
3942
  key: 1,
3916
3943
  class: "kvc-card",
3917
3944
  "data-test": "kvcoder-hint"
3918
- }, xc = { class: "kvc-card-row" }, Sc = { class: "kvc-card-body kvc-muted" }, Cc = {
3945
+ }, Ac = { class: "kvc-card-row" }, jc = { class: "kvc-card-body kvc-muted" }, Mc = {
3919
3946
  key: 0,
3920
3947
  style: {
3921
3948
  display: "flex",
3922
3949
  gap: "6px",
3923
3950
  "margin-block-start": "6px"
3924
3951
  }
3925
- }, wc = ["src", "alt"], Tc = {
3952
+ }, Nc = ["src", "alt"], Pc = {
3926
3953
  key: 1,
3927
3954
  class: "kvc-muted",
3928
3955
  style: { display: "block" },
3929
3956
  "data-test": "queued"
3930
- }, Ec = {
3957
+ }, Fc = {
3931
3958
  key: 3,
3932
3959
  class: "kvc-answer",
3933
3960
  "data-test": "assistant-message"
3934
- }, Dc = {
3961
+ }, Ic = {
3935
3962
  key: 0,
3936
3963
  "data-test": "thinking"
3937
- }, Oc = { class: "kvc-muted" }, kc = {
3964
+ }, Lc = { class: "kvc-muted" }, Rc = {
3938
3965
  class: "kvc-muted",
3939
3966
  style: { "white-space": "pre-wrap" }
3940
- }, Ac = {
3941
- key: 7,
3967
+ }, zc = {
3968
+ key: 6,
3969
+ "data-test": "extension-card"
3970
+ }, Bc = {
3971
+ key: 8,
3942
3972
  class: "kvc-notice",
3943
3973
  "data-test": "notice"
3944
- }, jc = {
3945
- key: 8,
3974
+ }, Vc = {
3975
+ key: 9,
3946
3976
  class: "kvc-card kvc-card-row",
3947
3977
  role: "note",
3948
3978
  "data-test": "note"
3949
- }, Mc = {
3950
- key: 9,
3979
+ }, Hc = {
3980
+ key: 10,
3951
3981
  class: "kvc-card",
3952
3982
  "data-test": "summary"
3953
- }, Nc = { class: "kvc-card-row" }, Pc = { class: "kvc-card-body" }, Fc = /* @__PURE__ */ c({
3983
+ }, Uc = { class: "kvc-card-row" }, Wc = { class: "kvc-card-body" }, Gc = /* @__PURE__ */ c({
3954
3984
  __name: "MessageItem",
3955
3985
  props: {
3956
3986
  message: {},
@@ -3959,58 +3989,58 @@ var Ms = {
3959
3989
  },
3960
3990
  emits: ["openArtifact"],
3961
3991
  setup(c, { emit: l }) {
3962
- let u = c, d = l, p = K(), m = t(() => 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(() => {
3963
- let e = u.message.source?.kind === "subagent" ? "kvcoder.ui.helperFinished" : "kvcoder.ui.backgroundFinished", t = (u.message.source?.kind === "subagent" ? u.finishedRuns?.get(u.message.source.sessionId)?.title : void 0) ?? 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);
3964
3994
  return t === void 0 ? p.t(e) : p.t(`${e}Named`, { name: rt(t) });
3965
- }), S = t(() => {
3966
- let e = u.finishedRuns?.get(Wa(u.message) ?? "");
3967
- return e === void 0 ? void 0 : js(p.t, e.ranMs);
3968
- }), 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(() => {
3969
3999
  let e = q(u.message.content.params), t = typeof e.code == "string" ? e.code : void 0, n = Object.fromEntries(Object.entries(Ye(e.details)).map(([e, t]) => [e, rt(t)])), r = t === void 0 ? {} : { error: p.t(Ke(t), n) }, i = $e(e.details), a = String(u.message.content.code);
3970
4000
  return p.t(`kvcoder.notices.${i === void 0 || a !== "STEP_FAILED" ? a : "STEP_FAILED_REASON"}`, {
3971
4001
  ...e,
3972
4002
  ...r,
3973
4003
  ...i === void 0 ? {} : { reason: rt(i) }
3974
4004
  });
3975
- }), O = t(() => {
4005
+ }), k = t(() => {
3976
4006
  let e = u.message.content.params;
3977
4007
  return p.t(String(u.message.content.key), typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : {});
3978
- }), 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) => ({
3979
4009
  type: "markdown",
3980
4010
  text: "kvcoder.markdown",
3981
4011
  params: { text: e }
3982
4012
  });
3983
- return (t, c) => D(Ba)(u.message) ? (_(), i("div", hc, [a("details", null, [a("summary", gc, [
4013
+ return (t, c) => D(Va)(u.message) ? (_(), i("div", wc, [a("details", null, [a("summary", Tc, [
3984
4014
  s(D(oe), {
3985
4015
  size: 16,
3986
4016
  "aria-hidden": "true"
3987
4017
  }),
3988
- a("span", _c, E(x.value), 1),
3989
- S.value === void 0 ? r("v-if", !0) : (_(), i("span", vc, E(S.value), 1))
3990
- ]), a("pre", yc, E(m.value), 1)])])) : D(za)(u.message) ? (_(), i("div", bc, [a("details", null, [a("summary", xc, [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), {
3991
4021
  size: 16,
3992
4022
  "aria-hidden": "true"
3993
- }), o(E(D(p).t("kvcoder.ui.toModel")), 1)]), a("div", Sc, 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", {
3994
4024
  key: 2,
3995
4025
  dir: "auto",
3996
4026
  class: f(["kvc-user", { "kvc-queued": u.message.queued }]),
3997
4027
  "data-test": "user-message"
3998
4028
  }, [
3999
- a("span", null, E(D(Ua)(m.value, D(p).t("kvcoder.ui.attachedFiles"))), 1),
4000
- u.message.fileIds ? (_(), i("span", Cc, [(_(!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", {
4001
4031
  key: e,
4002
- src: k(e),
4032
+ src: A(e),
4003
4033
  alt: D(p).t("kvcoder.ui.attachment"),
4004
4034
  style: {
4005
4035
  "block-size": "48px",
4006
4036
  "border-radius": "6px"
4007
4037
  }
4008
- }, null, 8, wc))), 128))])) : r("v-if", !0),
4009
- u.message.queued ? (_(), i("span", Tc, E(D(p).t("kvcoder.ui.queued")), 1)) : r("v-if", !0)
4010
- ], 2)) : u.message.kind === "assistant" && (h.value !== "" || m.value !== "") ? (_(), i("div", Ec, [h.value === "" ? r("v-if", !0) : (_(), i("details", Dc, [a("summary", Oc, E(D(p).t("kvcoder.ui.thought")), 1), a("p", kc, 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), {
4011
4041
  key: 1,
4012
- view: A(m.value)
4013
- }, 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, {
4014
4044
  key: 4,
4015
4045
  id: v.value.id,
4016
4046
  title: v.value.title,
@@ -4022,7 +4052,7 @@ var Ms = {
4022
4052
  "title",
4023
4053
  "format",
4024
4054
  "version"
4025
- ])) : w.value === void 0 ? u.message.kind === "toolResult" ? (_(), i(e, { key: 6 }, [s(mc, {
4055
+ ])) : T.value === void 0 ? y.value === void 0 ? u.message.kind === "toolResult" ? (_(), i(e, { key: 7 }, [s(Cc, {
4026
4056
  view: g.value,
4027
4057
  failed: g.value.failed,
4028
4058
  "duration-ms": g.value.durationMs,
@@ -4032,49 +4062,53 @@ var Ms = {
4032
4062
  "failed",
4033
4063
  "duration-ms",
4034
4064
  "output"
4035
- ]), y.value === void 0 ? r("v-if", !0) : (_(), n(Si, {
4065
+ ]), x.value === void 0 ? r("v-if", !0) : (_(), n(Ci, {
4036
4066
  key: 0,
4037
4067
  "session-id": u.message.sessionId,
4038
- "run-id": y.value
4039
- }, null, 8, ["session-id", "run-id"]))], 64)) : u.message.kind === "notice" ? (_(), i("div", Ac, E(T.value), 1)) : u.message.kind === "note" ? (_(), i("div", jc, [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), {
4040
4070
  size: 18,
4041
4071
  "aria-hidden": "true"
4042
- }), o(E(O.value), 1)])) : u.message.kind === "summary" ? (_(), i("details", Mc, [a("summary", Nc, [s(D(Ee), {
4072
+ }), o(E(k.value), 1)])) : u.message.kind === "summary" ? (_(), i("details", Hc, [a("summary", Uc, [s(D(Ee), {
4043
4073
  size: 16,
4044
4074
  "aria-hidden": "true"
4045
- }), o(E(D(p).t("kvcoder.ui.summarized")), 1)]), a("div", Pc, [(_(), 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, {
4046
4080
  key: 5,
4047
- answered: w.value
4081
+ answered: T.value
4048
4082
  }, null, 8, ["answered"]));
4049
4083
  }
4050
- }), Ic = {
4084
+ }), Kc = {
4051
4085
  class: "kvc-card kvc-ask",
4052
4086
  "data-test": "approvals-card"
4053
- }, Lc = {
4087
+ }, qc = {
4054
4088
  class: "kvc-card-row",
4055
4089
  style: { "font-weight": "600" }
4056
- }, Rc = ["data-test"], zc = { class: "kvc-card-row" }, Bc = { class: "kvc-lines" }, Vc = {
4090
+ }, Jc = ["data-test"], Yc = { class: "kvc-card-row" }, Xc = { class: "kvc-lines" }, Zc = {
4057
4091
  key: 0,
4058
4092
  style: { "font-weight": "600" },
4059
4093
  "data-test": "call-description"
4060
- }, Hc = {
4094
+ }, Qc = {
4061
4095
  key: 2,
4062
4096
  dir: "ltr",
4063
4097
  style: { "align-self": "flex-start" },
4064
4098
  "data-test": "call-subject"
4065
- }, Uc = {
4099
+ }, $c = {
4066
4100
  key: 3,
4067
4101
  class: "kvc-chip",
4068
4102
  style: { "align-self": "flex-start" },
4069
4103
  "data-test": "call-background"
4070
- }, Wc = {
4104
+ }, el = {
4071
4105
  class: "kvc-card-row kvc-actions",
4072
4106
  "data-test": "decision-actions"
4073
- }, Gc = ["onClick"], Kc = ["onClick"], qc = {
4107
+ }, tl = ["onClick"], nl = ["onClick"], rl = {
4074
4108
  key: 0,
4075
4109
  class: "kvc-card-row kvc-actions",
4076
4110
  style: { "border-block-start": "1px solid var(--kv-color-border)" }
4077
- }, Jc = /* @__PURE__ */ c({
4111
+ }, il = /* @__PURE__ */ c({
4078
4112
  __name: "ApprovalsCard",
4079
4113
  props: { approvals: {} },
4080
4114
  emits: ["decide"],
@@ -4083,8 +4117,8 @@ var Ms = {
4083
4117
  approvals: [...e],
4084
4118
  confirmed: t
4085
4119
  });
4086
- return (t, c) => (_(), i("section", Ic, [
4087
- a("div", Lc, [s(D(Oe), {
4120
+ return (t, c) => (_(), i("section", Kc, [
4121
+ a("div", qc, [s(D(Oe), {
4088
4122
  size: 18,
4089
4123
  "aria-hidden": "true"
4090
4124
  }), o(E(D(d).t("kvcoder.ui.allowCommands", { count: l.approvals.length })), 1)]),
@@ -4093,32 +4127,32 @@ var Ms = {
4093
4127
  class: "kvc-approval",
4094
4128
  "data-test": `approval-${e.questionId}`
4095
4129
  }, [
4096
- a("div", zc, [a("span", Bc, [
4097
- e.view.description ? (_(), i("span", Vc, E(e.view.description), 1)) : r("v-if", !0),
4098
- e.view.connector === void 0 ? e.view.line ? (_(), i("span", Hc, [a("span", { class: f(["kvc-mono", { "kvc-muted": e.view.description }]) }, E(e.view.line), 3)])) : r("v-if", !0) : (_(), n(tc, {
4130
+ a("div", Yc, [a("span", Xc, [
4131
+ e.view.description ? (_(), i("span", Zc, E(e.view.description), 1)) : r("v-if", !0),
4132
+ e.view.connector === void 0 ? e.view.line ? (_(), i("span", Qc, [a("span", { class: f(["kvc-mono", { "kvc-muted": e.view.description }]) }, E(e.view.line), 3)])) : r("v-if", !0) : (_(), n(cc, {
4099
4133
  key: 1,
4100
4134
  view: e.view,
4101
4135
  whole: ""
4102
4136
  }, null, 8, ["view"])),
4103
- e.view.background ? (_(), i("span", Uc, 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)
4104
4138
  ])]),
4105
- D(ma)(e.view) === "line" ? r("v-if", !0) : (_(), n(Ds, {
4139
+ D(ha)(e.view) === "line" ? r("v-if", !0) : (_(), n(Ps, {
4106
4140
  key: 0,
4107
4141
  view: e.view
4108
4142
  }, null, 8, ["view"])),
4109
- a("div", Wc, [a("button", {
4143
+ a("div", el, [a("button", {
4110
4144
  type: "button",
4111
4145
  class: "kvc-button",
4112
4146
  "data-test": "deny",
4113
4147
  onClick: (t) => p([e], !1)
4114
- }, E(D(d).t("kvcoder.ui.deny")), 9, Gc), a("button", {
4148
+ }, E(D(d).t("kvcoder.ui.deny")), 9, tl), a("button", {
4115
4149
  type: "button",
4116
4150
  class: "kvc-button kvc-primary",
4117
4151
  "data-test": "allow",
4118
4152
  onClick: (t) => p([e], !0)
4119
- }, E(D(d).t("kvcoder.ui.allow")), 9, Kc)])
4120
- ], 8, Rc))), 128)),
4121
- l.approvals.length > 1 ? (_(), i("div", qc, [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", {
4122
4156
  type: "button",
4123
4157
  class: "kvc-button",
4124
4158
  "data-test": "deny-all",
@@ -4131,13 +4165,13 @@ var Ms = {
4131
4165
  }, E(D(d).t("kvcoder.ui.allowAll")), 1)])) : r("v-if", !0)
4132
4166
  ]));
4133
4167
  }
4134
- }), Yc = /* @__PURE__ */ new Map();
4135
- function Xc(e) {
4136
- let t = Yc.get(e);
4137
- return t === void 0 && (t = v(/* @__PURE__ */ new Map()), Yc.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;
4138
4172
  }
4139
- function Zc(e, t, n) {
4140
- let r = Xc(e), i = r.get(t);
4173
+ function sl(e, t, n) {
4174
+ let r = ol(e), i = r.get(t);
4141
4175
  return i === void 0 ? (i = v({
4142
4176
  text: "",
4143
4177
  selected: [],
@@ -4148,55 +4182,55 @@ function Zc(e, t, n) {
4148
4182
  owner: n
4149
4183
  }), r.set(t, i)) : n !== void 0 && i.owner === void 0 && (i.owner = n), i;
4150
4184
  }
4151
- var Qc = (e, t, n) => Xc(e).get(t) === n, $c = (e) => new Set([...Xc(e)].filter(([, e]) => e.settled).map(([e]) => e));
4152
- function el(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) {
4153
4187
  e.text = "", e.selected = [], e.other = "", e.error = void 0, e.sending = !1, e.settled = !0;
4154
4188
  }
4155
- function tl(e, t, n) {
4156
- let r = Xc(e);
4189
+ function dl(e, t, n) {
4190
+ let r = ol(e);
4157
4191
  for (let [e, i] of r) {
4158
4192
  if (i.owner?.sessionId !== t) continue;
4159
4193
  let a = n.find((e) => e.id === i.owner?.turnId && e.sessionId === t);
4160
- a !== void 0 && (a.outcome === void 0 && a.endedAt === void 0 && a.pending.some((t) => t.questionId === e) || (el(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)));
4161
4195
  }
4162
4196
  }
4163
4197
  //#endregion
4164
4198
  //#region web/src/QuestionCard.vue?vue&type=script&setup=true&lang.ts
4165
- var nl = ["aria-label", "aria-busy"], rl = {
4199
+ var fl = ["aria-label", "aria-busy"], pl = {
4166
4200
  class: "kvc-card-row",
4167
4201
  style: { "font-weight": "600" }
4168
- }, il = { dir: "auto" }, al = { class: "kvc-card-body" }, ol = {
4202
+ }, ml = { dir: "auto" }, hl = { class: "kvc-card-body" }, gl = {
4169
4203
  key: 0,
4170
4204
  role: "status",
4171
4205
  "data-test": "answer-sending"
4172
- }, sl = {
4206
+ }, _l = {
4173
4207
  key: 1,
4174
4208
  role: "alert",
4175
4209
  "data-test": "answer-error"
4176
- }, cl = [
4210
+ }, vl = [
4177
4211
  "disabled",
4178
4212
  "placeholder",
4179
4213
  "aria-label"
4180
- ], ll = { class: "kvc-actions" }, ul = ["disabled"], dl = ["disabled"], fl = ["data-test"], pl = [
4214
+ ], yl = { class: "kvc-actions" }, bl = ["disabled"], xl = ["disabled"], Sl = ["data-test"], Cl = [
4181
4215
  "type",
4182
4216
  "checked",
4183
4217
  "disabled",
4184
4218
  "name",
4185
4219
  "onChange"
4186
- ], ml = { style: {
4220
+ ], wl = { style: {
4187
4221
  display: "flex",
4188
4222
  "flex-direction": "column"
4189
- } }, hl = { style: { "font-weight": "500" } }, gl = {
4223
+ } }, Tl = { style: { "font-weight": "500" } }, El = {
4190
4224
  key: 0,
4191
4225
  class: "kvc-muted"
4192
- }, _l = [
4226
+ }, Dl = [
4193
4227
  "disabled",
4194
4228
  "placeholder",
4195
4229
  "aria-label"
4196
- ], vl = { class: "kvc-actions" }, yl = ["disabled"], bl = ["disabled"], xl = {
4230
+ ], Ol = { class: "kvc-actions" }, kl = ["disabled"], Al = ["disabled"], jl = {
4197
4231
  key: 4,
4198
4232
  class: "kvc-actions"
4199
- }, Sl = ["disabled"], Cl = ["disabled"], wl = /* @__PURE__ */ c({
4233
+ }, Ml = ["disabled"], Nl = ["disabled"], Pl = /* @__PURE__ */ c({
4200
4234
  __name: "QuestionCard",
4201
4235
  props: {
4202
4236
  questionId: {},
@@ -4205,7 +4239,7 @@ var nl = ["aria-label", "aria-busy"], rl = {
4205
4239
  },
4206
4240
  emits: ["answer"],
4207
4241
  setup(n, { emit: o }) {
4208
- let c = n, l = o, u = K(), d = t(() => String(c.question.kind ?? "text")), p = t(() => String(c.question.prompt ?? "")), m = t(() => Ja(c.question)), h = t(() => c.question.multiple === !0), g = t(() => c.question.other === !0), v = t(() => Zc(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));
4209
4243
  function x(e) {
4210
4244
  !v.value.sending && !v.value.settled && l("answer", {
4211
4245
  questionId: c.questionId,
@@ -4228,12 +4262,12 @@ var nl = ["aria-label", "aria-busy"], rl = {
4228
4262
  "data-test": "question-card",
4229
4263
  "aria-label": p.value,
4230
4264
  "aria-busy": v.value.sending
4231
- }, [a("div", rl, [s(D(de), {
4265
+ }, [a("div", pl, [s(D(de), {
4232
4266
  size: 18,
4233
4267
  "aria-hidden": "true"
4234
- }), a("span", il, E(p.value), 1)]), a("div", al, [
4235
- v.value.sending ? (_(), i("p", ol, E(D(u).t("kvcoder.ui.answerSending")), 1)) : r("v-if", !0),
4236
- v.value.error === void 0 ? r("v-if", !0) : (_(), i("p", sl, 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)),
4237
4271
  d.value === "text" ? (_(), i(e, { key: 2 }, [M(a("input", {
4238
4272
  "onUpdate:modelValue": n[0] ||= (e) => v.value.text = e,
4239
4273
  disabled: v.value.sending,
@@ -4243,19 +4277,19 @@ var nl = ["aria-label", "aria-busy"], rl = {
4243
4277
  "aria-label": p.value,
4244
4278
  "data-test": "answer-text",
4245
4279
  onKeydown: n[1] ||= N(P((e) => x({ text: v.value.text }), ["prevent"]), ["enter"])
4246
- }, null, 40, cl), [[k, v.value.text]]), a("div", ll, [a("button", {
4280
+ }, null, 40, vl), [[k, v.value.text]]), a("div", yl, [a("button", {
4247
4281
  type: "button",
4248
4282
  disabled: v.value.sending,
4249
4283
  class: "kvc-button",
4250
4284
  "data-test": "skip",
4251
4285
  onClick: n[2] ||= (e) => x({ dismissed: !0 })
4252
- }, E(D(u).t("kvcoder.ui.skip")), 9, ul), a("button", {
4286
+ }, E(D(u).t("kvcoder.ui.skip")), 9, bl), a("button", {
4253
4287
  type: "button",
4254
4288
  disabled: v.value.sending,
4255
4289
  class: "kvc-button kvc-primary",
4256
4290
  "data-test": "answer",
4257
4291
  onClick: n[3] ||= (e) => x({ text: v.value.text })
4258
- }, E(D(u).t(v.value.error === void 0 ? "kvcoder.ui.answer" : "kvcoder.ui.tryAgain")), 9, dl)])], 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 }, [
4259
4293
  (_(!0), i(e, null, b(m.value, (e) => (_(), i("label", {
4260
4294
  key: e.id,
4261
4295
  class: "kvc-option",
@@ -4266,7 +4300,7 @@ var nl = ["aria-label", "aria-busy"], rl = {
4266
4300
  disabled: v.value.sending,
4267
4301
  name: c.questionId,
4268
4302
  onChange: (t) => S(e.id)
4269
- }, null, 40, pl), a("span", ml, [a("span", hl, E(e.label), 1), e.description ? (_(), i("span", gl, E(e.description), 1)) : r("v-if", !0)])], 8, fl))), 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)),
4270
4304
  g.value ? M((_(), i("input", {
4271
4305
  key: 0,
4272
4306
  "onUpdate:modelValue": n[4] ||= (e) => v.value.other = e,
@@ -4275,36 +4309,36 @@ var nl = ["aria-label", "aria-busy"], rl = {
4275
4309
  placeholder: D(u).t("kvcoder.ui.other"),
4276
4310
  "aria-label": D(u).t("kvcoder.ui.other"),
4277
4311
  "data-test": "answer-other"
4278
- }, null, 8, _l)), [[k, v.value.other]]) : r("v-if", !0),
4279
- a("div", vl, [a("button", {
4312
+ }, null, 8, Dl)), [[k, v.value.other]]) : r("v-if", !0),
4313
+ a("div", Ol, [a("button", {
4280
4314
  type: "button",
4281
4315
  disabled: v.value.sending,
4282
4316
  class: "kvc-button",
4283
4317
  "data-test": "skip",
4284
4318
  onClick: n[5] ||= (e) => x({ dismissed: !0 })
4285
- }, E(D(u).t("kvcoder.ui.skip")), 9, yl), a("button", {
4319
+ }, E(D(u).t("kvcoder.ui.skip")), 9, kl), a("button", {
4286
4320
  type: "button",
4287
4321
  class: "kvc-button kvc-primary",
4288
4322
  disabled: v.value.sending || v.value.selected.length === 0 && v.value.other.trim() === "",
4289
4323
  "data-test": "answer",
4290
4324
  onClick: C
4291
- }, E(D(u).t(v.value.error === void 0 ? "kvcoder.ui.answer" : "kvcoder.ui.tryAgain")), 9, bl)])
4292
- ], 64)) : (_(), i("div", xl, [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", {
4293
4327
  type: "button",
4294
4328
  disabled: v.value.sending,
4295
4329
  class: "kvc-button",
4296
4330
  "data-test": "answer-no",
4297
4331
  onClick: n[6] ||= (e) => x({ confirmed: !1 })
4298
- }, E(D(u).t("kvcoder.ui.no")), 9, Sl), a("button", {
4332
+ }, E(D(u).t("kvcoder.ui.no")), 9, Ml), a("button", {
4299
4333
  type: "button",
4300
4334
  disabled: v.value.sending,
4301
4335
  class: f(["kvc-button kvc-primary", { "kvc-danger": c.question.danger === !0 }]),
4302
4336
  "data-test": "answer-yes",
4303
4337
  onClick: n[7] ||= (e) => x({ confirmed: !0 })
4304
- }, E(D(u).t("kvcoder.ui.yes")), 11, Cl)]))
4305
- ])], 8, nl));
4338
+ }, E(D(u).t("kvcoder.ui.yes")), 11, Nl)]))
4339
+ ])], 8, fl));
4306
4340
  }
4307
- }), Tl = /* @__PURE__ */ c({
4341
+ }), Fl = /* @__PURE__ */ c({
4308
4342
  __name: "PendingCards",
4309
4343
  props: {
4310
4344
  pending: {},
@@ -4318,9 +4352,9 @@ var nl = ["aria-label", "aria-busy"], rl = {
4318
4352
  question: q(e.question)
4319
4353
  }))), d = t(() => s.pending.filter((e) => e.kind === "approval" && l(e)).map((e) => ({
4320
4354
  questionId: String(e.questionId),
4321
- view: fa(q(e.question))
4355
+ view: pa(q(e.question))
4322
4356
  })));
4323
- return (t, a) => (_(), i(e, null, [(_(!0), i(e, null, b(u.value, (e) => (_(), n(wl, {
4357
+ return (t, a) => (_(), i(e, null, [(_(!0), i(e, null, b(u.value, (e) => (_(), n(Pl, {
4324
4358
  key: e.questionId,
4325
4359
  "question-id": e.questionId,
4326
4360
  question: e.question,
@@ -4330,7 +4364,7 @@ var nl = ["aria-label", "aria-busy"], rl = {
4330
4364
  "question-id",
4331
4365
  "question",
4332
4366
  "owner"
4333
- ]))), 128)), d.value.length > 0 ? (_(), n(Jc, {
4367
+ ]))), 128)), d.value.length > 0 ? (_(), n(il, {
4334
4368
  key: 0,
4335
4369
  approvals: d.value,
4336
4370
  onDecide: a[1] ||= (e) => c("decide", {
@@ -4342,12 +4376,12 @@ var nl = ["aria-label", "aria-busy"], rl = {
4342
4376
  });
4343
4377
  //#endregion
4344
4378
  //#region web/src/use-model-groups.ts
4345
- function El(e, t, n) {
4379
+ function Il(e, t, n) {
4346
4380
  let r = y([]);
4347
4381
  return h(async () => {
4348
4382
  try {
4349
4383
  let [n, i] = await Promise.all([e.exec("kvai.provider.list", {}), e.exec("kvai.model.list", {})]);
4350
- r.value = Ir(n, i, t());
4384
+ r.value = Mr(n, i, t());
4351
4385
  } catch (e) {
4352
4386
  n(e);
4353
4387
  }
@@ -4355,15 +4389,15 @@ function El(e, t, n) {
4355
4389
  }
4356
4390
  //#endregion
4357
4391
  //#region web/src/RecoveryActions.vue?vue&type=script&setup=true&lang.ts
4358
- var Dl = {
4392
+ var Ll = {
4359
4393
  class: "kvc-recovery",
4360
4394
  "data-test": "recovery"
4361
- }, Ol = ["disabled"], kl = { class: "kvc-recovery-picker" }, Al = /* @__PURE__ */ c({
4395
+ }, Rl = ["disabled"], zl = { class: "kvc-recovery-picker" }, Bl = /* @__PURE__ */ c({
4362
4396
  __name: "RecoveryActions",
4363
4397
  props: { sessionId: {} },
4364
4398
  emits: ["sent"],
4365
4399
  setup(e, { emit: t }) {
4366
- let n = e, r = t, c = K(), l = El(c, () => null, (e) => J(c, e));
4400
+ let n = e, r = t, c = K(), l = Il(c, () => null, (e) => J(c, e));
4367
4401
  async function u() {
4368
4402
  await c.exec("kvcoder.turn.retry", { sessionId: n.sessionId }), r("sent");
4369
4403
  }
@@ -4384,9 +4418,9 @@ var Dl = {
4384
4418
  await c.exec("kvcoder.session.configure", {
4385
4419
  sessionId: n.sessionId,
4386
4420
  model: e
4387
- }), await ni(c, e), await u();
4421
+ }), await Qr(c, e), await u();
4388
4422
  });
4389
- return (e, t) => (_(), i("div", Dl, [a("button", {
4423
+ return (e, t) => (_(), i("div", Ll, [a("button", {
4390
4424
  type: "button",
4391
4425
  class: "kvc-button",
4392
4426
  disabled: d.value,
@@ -4395,34 +4429,34 @@ var Dl = {
4395
4429
  }, [s(D(Te), {
4396
4430
  size: 14,
4397
4431
  "aria-hidden": "true"
4398
- }), o(E(D(c).t("kvcoder.ui.retry")), 1)], 8, Ol), a("div", kl, [s(ei, {
4432
+ }), o(E(D(c).t("kvcoder.ui.retry")), 1)], 8, Rl), a("div", zl, [s(Xr, {
4399
4433
  groups: D(l),
4400
4434
  current: null,
4401
4435
  empty: D(c).t("kvcoder.ui.chooseAnotherModel"),
4402
4436
  onPick: m
4403
4437
  }, null, 8, ["groups", "empty"])])]));
4404
4438
  }
4405
- }), jl = {
4439
+ }), Vl = {
4406
4440
  class: "kvc-column",
4407
4441
  "data-test": "prompt-tab"
4408
- }, Ml = { style: {
4442
+ }, Hl = { style: {
4409
4443
  display: "flex",
4410
4444
  "align-items": "center",
4411
4445
  gap: "10px"
4412
- } }, Nl = { style: { flex: "1 1 auto" } }, Pl = {
4446
+ } }, Ul = { style: { flex: "1 1 auto" } }, Wl = {
4413
4447
  key: 0,
4414
4448
  style: {
4415
4449
  margin: "0",
4416
4450
  "padding-inline-start": "20px"
4417
4451
  }
4418
- }, Fl = {
4452
+ }, Gl = {
4419
4453
  key: 0,
4420
4454
  class: "kvc-chip kvc-warn"
4421
- }, Il = {
4455
+ }, Kl = {
4422
4456
  key: 1,
4423
4457
  class: "kvc-prompt",
4424
4458
  "data-test": "prompt-text"
4425
- }, Ll = /* @__PURE__ */ c({
4459
+ }, ql = /* @__PURE__ */ c({
4426
4460
  __name: "PromptTab",
4427
4461
  props: { sessionId: {} },
4428
4462
  emits: ["back"],
@@ -4438,8 +4472,8 @@ var Dl = {
4438
4472
  async function f() {
4439
4473
  d.value !== null && (await navigator.clipboard.writeText(d.value.prompt), u.toast("kvcoder.ui.copied", {}, "success"));
4440
4474
  }
4441
- return (t, n) => (_(), i("div", jl, [
4442
- a("div", Ml, [
4475
+ return (t, n) => (_(), i("div", Vl, [
4476
+ a("div", Hl, [
4443
4477
  a("button", {
4444
4478
  type: "button",
4445
4479
  class: "kvc-button",
@@ -4450,15 +4484,15 @@ var Dl = {
4450
4484
  class: "kvc-flip",
4451
4485
  "aria-hidden": "true"
4452
4486
  }), o(E(D(u).t("kvcoder.ui.showChat")), 1)]),
4453
- a("strong", Nl, E(D(u).t("kvcoder.ui.promptTitle")), 1),
4487
+ a("strong", Ul, E(D(u).t("kvcoder.ui.promptTitle")), 1),
4454
4488
  a("button", {
4455
4489
  type: "button",
4456
4490
  class: "kvc-button",
4457
4491
  "data-test": "copy-prompt",
4458
4492
  onClick: f
4459
- }, [s(D(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)])
4460
4494
  ]),
4461
- d.value ? (_(), i("ul", Pl, [(_(!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", {
4462
4496
  key: `${e.owner}/${e.id}`,
4463
4497
  class: "kvc-muted",
4464
4498
  "data-test": "prompt-section"
@@ -4467,14 +4501,14 @@ var Dl = {
4467
4501
  owner: e.owner,
4468
4502
  reach: D(u).t(`kvcoder.ui.reach.${e.reach}`),
4469
4503
  size: e.size
4470
- })) + " ", 1), e.included ? r("v-if", !0) : (_(), i("span", Fl, E(D(u).t("kvcoder.ui.leftOut")), 1))]))), 128))])) : r("v-if", !0),
4471
- d.value ? (_(), i("pre", Il, 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)
4472
4506
  ]));
4473
4507
  }
4474
4508
  });
4475
4509
  //#endregion
4476
4510
  //#region web/src/use-session-actions.ts
4477
- function Rl(e, t, n) {
4511
+ function Jl(e, t, n) {
4478
4512
  let r = T();
4479
4513
  async function i(t) {
4480
4514
  try {
@@ -4507,7 +4541,7 @@ function Rl(e, t, n) {
4507
4541
  await e.exec("kvcoder.session.configure", {
4508
4542
  sessionId: t(),
4509
4543
  ...n
4510
- }), n.model !== void 0 && await ni(e, n.model);
4544
+ }), n.model !== void 0 && await Qr(e, n.model);
4511
4545
  }),
4512
4546
  rename: (n) => a("rename", async () => {
4513
4547
  n.trim() !== "" && await e.exec("kvcoder.session.rename", {
@@ -4537,13 +4571,13 @@ function Rl(e, t, n) {
4537
4571
  }
4538
4572
  //#endregion
4539
4573
  //#region web/src/SessionModel.vue
4540
- var zl = /* @__PURE__ */ c({
4574
+ var Yl = /* @__PURE__ */ c({
4541
4575
  __name: "SessionModel",
4542
4576
  props: { session: {} },
4543
4577
  emits: ["changed"],
4544
4578
  setup(e, { emit: t }) {
4545
- let r = e, i = t, a = K(), o = El(a, () => r.session.model, (e) => J(a, e)), s = Rl(a, () => r.session.id, () => i("changed"));
4546
- 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, {
4547
4581
  groups: D(o),
4548
4582
  model: r.session.model ?? null,
4549
4583
  thinking: r.session.thinking,
@@ -4555,32 +4589,32 @@ var zl = /* @__PURE__ */ c({
4555
4589
  "thinking"
4556
4590
  ]));
4557
4591
  }
4558
- }), Bl = ["aria-label"], Vl = { class: "kvc-card-row" }, Hl = {
4592
+ }), Xl = ["aria-label"], Zl = { class: "kvc-card-row" }, Ql = {
4559
4593
  key: 0,
4560
4594
  class: "kvc-chip kvc-mono",
4561
4595
  "data-test": "subagent-worker"
4562
- }, Ul = { class: "kvc-lines" }, Wl = {
4596
+ }, $l = { class: "kvc-lines" }, eu = {
4563
4597
  style: { "font-weight": "600" },
4564
4598
  "data-test": "subagent-title"
4565
- }, Gl = {
4599
+ }, tu = {
4566
4600
  key: 0,
4567
4601
  class: "kvc-muted kvc-oneline",
4568
4602
  dir: "auto",
4569
4603
  "data-test": "subagent-task"
4570
- }, Kl = {
4604
+ }, nu = {
4571
4605
  key: 1,
4572
4606
  class: "kvc-spin"
4573
- }, ql = {
4607
+ }, ru = {
4574
4608
  key: 0,
4575
4609
  class: "kvc-card-body"
4576
- }, Jl = {
4610
+ }, iu = {
4577
4611
  key: 0,
4578
4612
  class: "kvc-muted",
4579
4613
  style: {
4580
4614
  margin: "0",
4581
4615
  "white-space": "pre-wrap"
4582
4616
  }
4583
- }, Yl = /* @__PURE__ */ c({
4617
+ }, au = /* @__PURE__ */ c({
4584
4618
  __name: "SubagentCard",
4585
4619
  props: {
4586
4620
  child: {},
@@ -4594,16 +4628,16 @@ var zl = /* @__PURE__ */ c({
4594
4628
  class: "kvc-card",
4595
4629
  "data-test": "subagent-card",
4596
4630
  "aria-label": D(Ge)(D(l).t, o.child.session.title)
4597
- }, [a("div", Vl, [
4631
+ }, [a("div", Zl, [
4598
4632
  s(D(se), {
4599
4633
  size: 18,
4600
4634
  "aria-hidden": "true"
4601
4635
  }),
4602
- o.child.session.worker === void 0 ? r("v-if", !0) : (_(), i("span", Hl, E(o.child.session.worker), 1)),
4603
- a("span", Ul, [a("span", Wl, E(D(Ge)(D(l).t, o.child.session.title)), 1), u.value ? (_(), i("span", Gl, E(u.value), 1)) : r("v-if", !0)]),
4604
- o.child.session.status === "running" ? (_(), i("span", Kl)) : 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),
4605
4639
  a("span", { class: f(["kvc-chip", { "kvc-warn": o.child.session.status === "waiting" }]) }, E(d.value), 3)
4606
- ]), o.child.live.text !== "" || (o.child.turn?.pending.length ?? 0) > 0 ? (_(), i("div", ql, [o.child.live.text === "" ? r("v-if", !0) : (_(), i("p", Jl, E(o.child.live.text), 1)), s(Tl, {
4640
+ ]), o.child.live.text !== "" || (o.child.turn?.pending.length ?? 0) > 0 ? (_(), i("div", ru, [o.child.live.text === "" ? r("v-if", !0) : (_(), i("p", iu, E(o.child.live.text), 1)), s(Fl, {
4607
4641
  owner: o.child.turn === void 0 ? void 0 : {
4608
4642
  sessionId: o.child.session.id,
4609
4643
  turnId: o.child.turn.id
@@ -4616,22 +4650,22 @@ var zl = /* @__PURE__ */ c({
4616
4650
  "owner",
4617
4651
  "pending",
4618
4652
  "hidden"
4619
- ])])) : r("v-if", !0)], 8, Bl));
4653
+ ])])) : r("v-if", !0)], 8, Xl));
4620
4654
  }
4621
- }), Xl = ["aria-label"], Zl = { class: "kvc-card-row" }, Ql = {
4655
+ }), ou = ["aria-label"], su = { class: "kvc-card-row" }, cu = {
4622
4656
  class: "kvc-chip kvc-mono",
4623
4657
  "data-test": "worker-card-name"
4624
- }, $l = {
4658
+ }, lu = {
4625
4659
  style: {
4626
4660
  flex: "1 1 auto",
4627
4661
  "font-weight": "500"
4628
4662
  },
4629
4663
  dir: "auto",
4630
4664
  "data-test": "worker-card-call"
4631
- }, eu = {
4665
+ }, uu = {
4632
4666
  class: "kvc-chip",
4633
4667
  "data-test": "worker-card-time"
4634
- }, tu = ["disabled"], nu = /* @__PURE__ */ c({
4668
+ }, du = ["disabled"], fu = /* @__PURE__ */ c({
4635
4669
  __name: "WorkerCard",
4636
4670
  props: {
4637
4671
  sessionId: {},
@@ -4667,25 +4701,25 @@ var zl = /* @__PURE__ */ c({
4667
4701
  class: "kvc-card",
4668
4702
  "data-test": "worker-card",
4669
4703
  "aria-label": o.value.title
4670
- }, [a("div", Zl, [
4704
+ }, [a("div", su, [
4671
4705
  s(D(se), {
4672
4706
  size: 18,
4673
4707
  "aria-hidden": "true"
4674
4708
  }),
4675
- a("span", Ql, E(o.value.title), 1),
4676
- a("span", $l, E(o.value.call), 1),
4709
+ a("span", cu, E(o.value.title), 1),
4710
+ a("span", lu, E(o.value.call), 1),
4677
4711
  t[0] ||= a("span", { class: "kvc-spin" }, null, -1),
4678
- a("span", eu, 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),
4679
4713
  a("button", {
4680
4714
  type: "button",
4681
4715
  class: "kvc-button",
4682
4716
  disabled: l.value,
4683
4717
  "data-test": "worker-card-stop",
4684
4718
  onClick: d
4685
- }, E(D(n).t("kvcoder.ui.jobs.stop")), 9, tu)
4686
- ])], 8, Xl));
4719
+ }, E(D(n).t("kvcoder.ui.jobs.stop")), 9, du)
4720
+ ])], 8, ou));
4687
4721
  }
4688
- }), ru = (e) => {
4722
+ }), pu = (e) => {
4689
4723
  let t = e.view.description ?? e.view.line;
4690
4724
  return {
4691
4725
  name: "run",
@@ -4694,8 +4728,8 @@ var zl = /* @__PURE__ */ c({
4694
4728
  complete: !0
4695
4729
  };
4696
4730
  };
4697
- function iu(e, n, r) {
4698
- let i = t(() => $c(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;
4699
4733
  A([
4700
4734
  () => e.workspace.value.id,
4701
4735
  () => r()?.sessionId,
@@ -4708,7 +4742,7 @@ function iu(e, n, r) {
4708
4742
  async function c(t, r) {
4709
4743
  let i = e.workspace.value.id, c = o, l = () => !s && o === c && e.workspace.value.id === i, u = t.map((e) => ({
4710
4744
  item: e,
4711
- draft: Zc(i, e.questionId, r)
4745
+ draft: sl(i, e.questionId, r)
4712
4746
  }));
4713
4747
  if (u.some(({ draft: e }) => e.sending)) return;
4714
4748
  let d = u.filter(({ draft: e }) => !e.settled);
@@ -4716,18 +4750,18 @@ function iu(e, n, r) {
4716
4750
  let f = null;
4717
4751
  for (let [t, { item: n, draft: r }] of d.entries()) {
4718
4752
  if (!l()) {
4719
- for (let e of d.slice(t)) Qc(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);
4720
4754
  return;
4721
4755
  }
4722
- if (Qc(i, n.questionId, r)) try {
4723
- f = (await e.exec("kvcoder.question.answer", n)).jobId ?? f, Qc(i, n.questionId, r) && el(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);
4724
4758
  } catch (o) {
4725
4759
  if (qe(o)?.code === "kvcoder/QUESTION_NOT_FOUND") {
4726
- Qc(i, n.questionId, r) && (r.sending = !1);
4760
+ cl(i, n.questionId, r) && (r.sending = !1);
4727
4761
  continue;
4728
4762
  }
4729
- for (let e of d.slice(t)) Qc(i, e.item.questionId, e.draft) && (e.draft.sending = !1, e.draft === r && (e.draft.error = o)), a.delete(e.item.questionId);
4730
- l() && Qc(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);
4731
4765
  return;
4732
4766
  }
4733
4767
  }
@@ -4741,7 +4775,7 @@ function iu(e, n, r) {
4741
4775
  hidden: i,
4742
4776
  answer: (e) => c([e]),
4743
4777
  decide: ({ approvals: e, confirmed: t, owner: n }) => {
4744
- if (t) for (let t of e) a.set(t.questionId, ru(t));
4778
+ if (t) for (let t of e) a.set(t.questionId, pu(t));
4745
4779
  return c(e.map((e) => ({
4746
4780
  questionId: e.questionId,
4747
4781
  answer: { confirmed: t }
@@ -4751,8 +4785,8 @@ function iu(e, n, r) {
4751
4785
  }
4752
4786
  //#endregion
4753
4787
  //#region web/src/use-artifacts.ts
4754
- var au = (e) => `${e.version} ${e.updatedAt}`;
4755
- function ou(e, t, n, r) {
4788
+ var hu = (e) => `${e.version} ${e.updatedAt}`;
4789
+ function gu(e, t, n, r) {
4756
4790
  let i = y([]), a = y(void 0), o = y(void 0), s = y(!1), c = y(void 0), l = /* @__PURE__ */ new Map(), u, d = !1, f = 0, p = !1;
4757
4791
  function g(e) {
4758
4792
  u = e, d = !1, l.clear(), c.value = void 0, i.value = [], a.value = void 0, o.value = void 0, s.value = !1;
@@ -4789,7 +4823,7 @@ function ou(e, t, n, r) {
4789
4823
  if (p || m !== f || t() !== n || u !== n) return;
4790
4824
  if (i.value = h, !d) {
4791
4825
  d = !0;
4792
- for (let e of h) l.set(e.id, au(e));
4826
+ for (let e of h) l.set(e.id, hu(e));
4793
4827
  if (h.length === 0) {
4794
4828
  a.value = void 0, o.value = void 0, s.value = !1;
4795
4829
  return;
@@ -4800,8 +4834,8 @@ function ou(e, t, n, r) {
4800
4834
  t !== void 0 && await _(n, t);
4801
4835
  return;
4802
4836
  }
4803
- let v = h.filter((e) => l.get(e.id) !== au(e));
4804
- for (let e of h) l.set(e.id, au(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));
4805
4839
  if (v.length > 0) {
4806
4840
  let e = [...v].sort((e, t) => e.updatedAt < t.updatedAt ? 1 : e.updatedAt > t.updatedAt ? -1 : 0)[0];
4807
4841
  e !== void 0 && (a.value = e.id, s.value = !0, c.value = {
@@ -4869,7 +4903,7 @@ function ou(e, t, n, r) {
4869
4903
  }
4870
4904
  //#endregion
4871
4905
  //#region web/src/conversation-streams.ts
4872
- function su(e, t, n, r, i) {
4906
+ function _u(e, t, n, r, i) {
4873
4907
  let a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new WeakMap(), s = (e) => e.current() && a.get(e.target) === e, c = (e, t) => {
4874
4908
  s(e) && i(t);
4875
4909
  };
@@ -4884,17 +4918,17 @@ function su(e, t, n, r, i) {
4884
4918
  let i = !1, u = !1;
4885
4919
  try {
4886
4920
  e.follow(r.jobId).catch((e) => c(r, e));
4887
- for await (let t of e.stream(r.jobId)) if (!r.current() || !s(r) && a.has(r.target) || (t.type === "problem" && t.problem.code === "kvwebui/OFFLINE" && (u = !0), 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;
4888
4922
  i = !u;
4889
4923
  } catch (e) {
4890
4924
  c(r, e);
4891
4925
  } finally {
4892
- s(r) && (a.delete(r.target), i && o.set(r.target, r.jobId), Object.assign(r.target, 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);
4893
4927
  }
4894
4928
  }
4895
4929
  function d(e, r, i, c = []) {
4896
4930
  let l = a.get(e);
4897
- if (l !== void 0 && l.jobId === r && s(l) || (l !== void 0 && a.delete(e), o.get(e) === r && r !== void 0) || (o.delete(e), Object.assign(e, 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;
4898
4932
  let d = {
4899
4933
  jobId: r,
4900
4934
  target: e,
@@ -4921,27 +4955,27 @@ function su(e, t, n, r, i) {
4921
4955
  }
4922
4956
  //#endregion
4923
4957
  //#region web/src/use-conversation.ts
4924
- var cu = 5e3, lu = 200;
4925
- function uu(e, t, n, r = () => !1) {
4926
- 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 = su(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);
4927
4961
  async function C(t, n, r) {
4928
4962
  if (!r()) return;
4929
4963
  let i = await e.exec("kvcoder.message.list", {
4930
4964
  sessionId: t,
4931
- limit: lu
4965
+ limit: yu
4932
4966
  });
4933
4967
  r() && (a.value = i.messages, o.value = i.omitted, h = n, y = !1);
4934
4968
  }
4935
4969
  async function E(t, n, i, s) {
4936
4970
  let c = await e.exec("kvcoder.message.list", {
4937
4971
  sessionId: t,
4938
- limit: lu,
4972
+ limit: yu,
4939
4973
  afterSeq: i
4940
4974
  });
4941
4975
  if (!s()) return;
4942
4976
  let l = S(c.messages);
4943
4977
  if (l[0] !== void 0 && l[0].seq !== i + 1) return C(t, n, s);
4944
- let u = S(a.value), d = u.at(-1)?.seq ?? i, f = [...u, ...l.filter((e) => (e.seq ?? d) > d)], p = y || r() ? 0 : Math.max(f.length - lu, 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);
4945
4979
  a.value = [...f.slice(p), ...c.messages.filter((e) => e.queued === !0)], o.value += p;
4946
4980
  }
4947
4981
  async function D() {
@@ -4949,7 +4983,7 @@ function uu(e, t, n, r = () => !1) {
4949
4983
  if (t === void 0 || n === void 0) return;
4950
4984
  let r = await e.exec("kvcoder.message.list", {
4951
4985
  sessionId: t.sessionId,
4952
- limit: lu,
4986
+ limit: yu,
4953
4987
  beforeSeq: n
4954
4988
  });
4955
4989
  b(t) && S(a.value)[0]?.seq === n && (a.value = [...r.messages, ...a.value], o.value = r.omitted, y = !0);
@@ -4984,9 +5018,9 @@ function uu(e, t, n, r = () => !1) {
4984
5018
  let o = {
4985
5019
  session: i,
4986
5020
  turn: a?.sessionId === n ? a : void 0,
4987
- live: f.get(n)?.live ?? v(ga())
5021
+ live: f.get(n)?.live ?? v(_a())
4988
5022
  };
4989
- tl(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));
4990
5024
  }
4991
5025
  }
4992
5026
  async function M(t = [], n) {
@@ -5005,7 +5039,7 @@ function uu(e, t, n, r = () => !1) {
5005
5039
  e.exec("kvcoder.context.get", { sessionId: r.sessionId })
5006
5040
  ]);
5007
5041
  if (!o() || a.id !== r.sessionId || (i.value !== null && i.value.status !== a.status && e.refresh(), !o())) return;
5008
- i.value = a, s.value = l, c.value = u, tl(r.workspaceId, a.id, l);
5042
+ i.value = a, s.value = l, c.value = u, dl(r.workspaceId, a.id, l);
5009
5043
  let f = a.status === "running" ? a.stepJobId : void 0;
5010
5044
  x.update(d, f, () => b(r), n === void 0 || n === f ? t : []);
5011
5045
  let p = j(r, a.status === "waiting" ? l[0] : void 0, o);
@@ -5025,7 +5059,7 @@ function uu(e, t, n, r = () => !1) {
5025
5059
  e !== void 0 && !x.busy() && N().catch((t) => {
5026
5060
  b(e) && n(t);
5027
5061
  });
5028
- }, cu);
5062
+ }, vu);
5029
5063
  return g(() => {
5030
5064
  _ = !0, p = void 0, m = void 0, x.clear(), clearInterval(F);
5031
5065
  }), A([t, () => e.workspace.value.id], () => {
@@ -5033,7 +5067,7 @@ function uu(e, t, n, r = () => !1) {
5033
5067
  p = r === void 0 ? void 0 : {
5034
5068
  workspaceId: e.workspace.value.id,
5035
5069
  sessionId: r
5036
- }, m = void 0, h = void 0, x.clear(), i.value = null, a.value = [], o.value = 0, s.value = [], c.value = null, l.value = void 0, f.clear(), Object.assign(d, 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());
5037
5071
  let u = p;
5038
5072
  u !== void 0 && N().catch((e) => {
5039
5073
  b(u) && n(e);
@@ -5059,7 +5093,7 @@ function uu(e, t, n, r = () => !1) {
5059
5093
  }
5060
5094
  //#endregion
5061
5095
  //#region web/src/use-execution-map.ts
5062
- function du(e, n, r, i, a) {
5096
+ function xu(e, n, r, i, a) {
5063
5097
  let o = y(null), s = y(!1), c, l, u, d = 0, f = !1;
5064
5098
  async function p() {
5065
5099
  let t = n();
@@ -5105,15 +5139,15 @@ function du(e, n, r, i, a) {
5105
5139
  }
5106
5140
  //#endregion
5107
5141
  //#region web/src/use-follow-latest.ts
5108
- var fu = 80;
5109
- function pu(e, t, n) {
5142
+ var Su = 80;
5143
+ function Cu(e, t, n) {
5110
5144
  let r = y(!1);
5111
5145
  function i() {
5112
5146
  e.value !== null && (e.value.scrollTop = e.value.scrollHeight);
5113
5147
  }
5114
5148
  function a() {
5115
5149
  let t = e.value;
5116
- t !== null && (r.value = t.scrollHeight - t.clientHeight - t.scrollTop > fu);
5150
+ t !== null && (r.value = t.scrollHeight - t.clientHeight - t.scrollTop > Su);
5117
5151
  }
5118
5152
  function o() {
5119
5153
  r.value = !1, i();
@@ -5130,7 +5164,7 @@ function pu(e, t, n) {
5130
5164
  }
5131
5165
  //#endregion
5132
5166
  //#region web/src/use-finished-runs.ts
5133
- function mu(e, t, n, r) {
5167
+ function wu(e, t, n, r) {
5134
5168
  let i = y(/* @__PURE__ */ new Map());
5135
5169
  async function a(n) {
5136
5170
  try {
@@ -5144,13 +5178,13 @@ function mu(e, t, n, r) {
5144
5178
  r(e);
5145
5179
  }
5146
5180
  }
5147
- return A(() => [t(), n.value.flatMap((e) => Wa(e) ?? []).join(" ")], ([e, t], n) => {
5181
+ return A(() => [t(), n.value.flatMap((e) => qa(e) ?? []).join(" ")], ([e, t], n) => {
5148
5182
  e !== n?.[0] && (i.value = /* @__PURE__ */ new Map()), e !== void 0 && t !== "" && a(e);
5149
5183
  }, { immediate: !0 }), i;
5150
5184
  }
5151
5185
  //#endregion
5152
5186
  //#region web/src/use-slash-commands.ts
5153
- function hu(e) {
5187
+ function Tu(e) {
5154
5188
  let t = T([]);
5155
5189
  return h(async () => {
5156
5190
  try {
@@ -5162,7 +5196,7 @@ function hu(e) {
5162
5196
  }
5163
5197
  //#endregion
5164
5198
  //#region web/src/use-workspace-session.ts
5165
- function gu(e, n, r) {
5199
+ function Eu(e, n, r) {
5166
5200
  let i = T(e.workspace.value.id);
5167
5201
  async function a(t) {
5168
5202
  let n;
@@ -5173,51 +5207,64 @@ function gu(e, n, r) {
5173
5207
  }
5174
5208
  e.workspace.value.id === t && (n === void 0 ? e.navigate("kvcoder.chat") : e.navigate("kvcoder.session", { sessionId: n }));
5175
5209
  }
5176
- return A(n, () => {
5210
+ A(n, () => {
5177
5211
  i.value = e.workspace.value.id;
5178
5212
  }), A(() => e.workspace.value.id, (e) => {
5179
5213
  n() === void 0 ? i.value = e : a(e);
5180
- }), 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
+ };
5181
5228
  }
5182
5229
  //#endregion
5183
5230
  //#region web/src/ConversationView.vue?vue&type=script&setup=true&lang.ts
5184
- var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
5231
+ var Du = { class: "kvc-workspace" }, Ou = { class: "kvc-stage" }, ku = {
5185
5232
  class: "kvc-conversation",
5186
5233
  "data-test": "conversation"
5187
- }, bu = {
5234
+ }, Au = {
5188
5235
  key: 0,
5189
5236
  class: "kvc-start",
5190
5237
  role: "alert",
5191
5238
  "data-test": "load-failure"
5192
- }, xu = { class: "kvc-start-note" }, Su = {
5239
+ }, ju = { class: "kvc-start-note" }, Mu = {
5193
5240
  class: "kvc-actions",
5194
5241
  style: { "justify-content": "center" }
5195
- }, Cu = {
5242
+ }, Nu = {
5196
5243
  key: 1,
5197
5244
  class: "kvc-scrollport"
5198
- }, wu = {
5245
+ }, Pu = {
5199
5246
  key: 1,
5200
5247
  class: "kvc-column"
5201
- }, Tu = {
5248
+ }, Fu = {
5202
5249
  key: 0,
5203
5250
  class: "kvc-actions",
5204
5251
  style: { "justify-content": "center" }
5205
- }, Eu = ["title"], Du = {
5252
+ }, Iu = ["title"], Lu = {
5206
5253
  key: 1,
5207
5254
  class: "kvc-notice",
5208
5255
  "data-test": "map-remaining"
5209
- }, Ou = {
5256
+ }, Ru = {
5210
5257
  key: 3,
5211
5258
  class: "kvc-notice",
5212
5259
  "data-test": "summarizing"
5213
- }, ku = {
5260
+ }, zu = {
5214
5261
  key: 4,
5215
5262
  class: "kvc-answer",
5216
5263
  "data-test": "live-answer"
5217
- }, Au = ["open"], ju = { class: "kvc-muted" }, Mu = {
5264
+ }, Bu = ["open"], Vu = { class: "kvc-muted" }, Hu = {
5218
5265
  class: "kvc-muted",
5219
5266
  style: { "white-space": "pre-wrap" }
5220
- }, Nu = {
5267
+ }, Uu = {
5221
5268
  key: 7,
5222
5269
  class: "kvc-muted",
5223
5270
  style: {
@@ -5225,20 +5272,20 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
5225
5272
  margin: "0"
5226
5273
  },
5227
5274
  "data-test": "waiting-hint"
5228
- }, Pu = /* @__PURE__ */ c({
5275
+ }, Wu = /* @__PURE__ */ c({
5229
5276
  __name: "ConversationView",
5230
5277
  props: { sessionId: {} },
5231
5278
  setup(c) {
5232
- let l = c, u = K(), f = gu(u, () => l.sessionId, (e) => J(u, e)), p = y("chat"), m = y(!1), h = uu(u, () => f.value, (e) => J(u, e), () => m.value), { session: g, messages: v, omitted: x, turns: S, live: w, children: T } = h, k = ou(u, () => f.value, () => g.value?.updatedAt, (e) => J(u, e)), M = du(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 = mu(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([
5233
5280
  "STEP_FAILED",
5234
5281
  "REPLY_LOST",
5235
5282
  "REPLY_INCOMPLETE",
5236
5283
  "INTERRUPTED"
5237
- ]), 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(() => {
5238
5285
  let e = /* @__PURE__ */ new Map();
5239
- 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);
5240
5287
  let t = /* @__PURE__ */ new Map();
5241
- for (let n of S.value) {
5288
+ for (let n of w.value) {
5242
5289
  let r = e.get(n.id);
5243
5290
  r !== void 0 && n.outcome !== void 0 && t.set(r, {
5244
5291
  text: ot(u.t, n.usage, n.durationMs),
@@ -5257,77 +5304,81 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
5257
5304
  sendId: n
5258
5305
  });
5259
5306
  }) && f.value === t) try {
5260
- G.resume(), await h.refresh();
5307
+ G.resume(), await g.refresh();
5261
5308
  } catch (e) {
5262
5309
  J(u, e);
5263
5310
  }
5264
5311
  }
5265
- let ne = t(() => g.value?.status === "running" || g.value?.status === "waiting"), V = y(), H = y();
5266
- async function ie() {
5267
- let e = f.value, t = S.value[0]?.id;
5268
- if (e !== void 0 && V.value !== e) {
5269
- 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;
5270
5317
  try {
5271
5318
  await u.exec("kvcoder.turn.cancel", {
5272
5319
  sessionId: e,
5273
5320
  ...t === void 0 ? {} : { turnId: t }
5274
- }), f.value === e && await h.refresh();
5321
+ }), f.value === e && await g.refresh();
5275
5322
  } catch (t) {
5276
- f.value === e && (H.value = {
5323
+ f.value === e && (ie.value = {
5277
5324
  sessionId: e,
5278
5325
  error: t
5279
5326
  });
5280
5327
  } finally {
5281
- V.value === e && (V.value = void 0);
5328
+ H.value === e && (H.value = void 0);
5282
5329
  }
5283
5330
  }
5284
5331
  }
5285
- let ae = y(0), oe = t(() => [
5286
- ...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")] : [],
5287
5334
  u.t("kvcoder.ui.stopEnds"),
5288
- ...ae.value > 0 ? [u.t("kvcoder.ui.stopKeepsBackground")] : []
5289
- ].join(" ")), se = () => g.value === null || S.value[0] === void 0 ? void 0 : {
5290
- sessionId: g.value.id,
5291
- turnId: S.value[0].id
5292
- }, U = iu(u, (e) => h.refresh(e), se), ce = t(() => new Map(z.value.flatMap((e) => {
5293
- 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;
5294
5341
  return typeof e.childSessionId == "string" && typeof t == "string" ? [[e.childSessionId, t]] : [];
5295
- }))), 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(() => {
5296
- let e = v.value.at(-1);
5297
- return g.value?.status === "idle" && e?.kind === "notice" && L.has(String(e.content.code));
5298
- }), fe = hu(u), W = Rl(u, () => f.value ?? "", () => h.refresh()), pe = t(() => {
5299
- 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);
5300
5351
  return e === void 0 ? u.t("kvcoder.ui.failed") : u.t(Ke(e.code), e.params);
5301
- }), me = O("list"), G = pu(me, () => [
5302
- v.value,
5303
- w.text,
5304
- w.thinking,
5305
- w.calls.length,
5306
- 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,
5307
5358
  R.value,
5308
- z.value,
5309
- T.size,
5359
+ B.value,
5360
+ k.size,
5310
5361
  U.hidden.value,
5311
5362
  W.working.value
5312
5363
  ], () => f.value);
5313
- A(G.away, (e) => m.value = e);
5314
- async function he() {
5315
- 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;
5316
5367
  try {
5317
- 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);
5318
5369
  } catch (e) {
5319
5370
  J(u, e);
5320
5371
  }
5321
5372
  }
5322
- async function ge() {
5373
+ async function _e() {
5323
5374
  try {
5324
- await h.showLatest();
5375
+ await g.showLatest();
5325
5376
  } catch (e) {
5326
5377
  J(u, e);
5327
5378
  }
5328
5379
  G.resume();
5329
5380
  }
5330
- async function _e() {
5381
+ async function ve() {
5331
5382
  if (f.value !== void 0) try {
5332
5383
  let { fileId: e } = await u.exec("kvcoder.session.export", { sessionId: f.value });
5333
5384
  window.location.assign(`/api/files/${encodeURIComponent(e)}?workspaceId=${encodeURIComponent(u.workspace.value.id)}`);
@@ -5335,44 +5386,44 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
5335
5386
  J(u, e);
5336
5387
  }
5337
5388
  }
5338
- let ve = () => v.value.at(-1)?.kind === "notice" && v.value.at(-1)?.content.code === "SUMMARY_FAILED";
5339
- async function ye() {
5389
+ let ye = () => x.value.at(-1)?.kind === "notice" && x.value.at(-1)?.content.code === "SUMMARY_FAILED";
5390
+ async function be() {
5340
5391
  return (await u.exec("kernel.settings.list", {})).find((e) => e.key === "kvcoder.compactKeep")?.value ?? null;
5341
5392
  }
5342
- async function be() {
5393
+ async function xe() {
5343
5394
  let e = await W.compact();
5344
- 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() });
5345
5396
  }
5346
- function xe(e, t) {
5397
+ function Se(e, t) {
5347
5398
  if (e === "new") return u.navigate("kvcoder.chat");
5348
- 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");
5349
5400
  if (e === "delete") return void W.remove();
5350
- 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());
5351
5402
  }
5352
- async function Se(e, t) {
5353
- 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({
5354
5405
  text: t === "" ? u.t(e.message) : t,
5355
5406
  fileIds: []
5356
5407
  }));
5357
5408
  }
5358
- let Ce = (e) => e.id;
5359
- return (t, c) => (_(), i("div", _u, [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, {
5360
5411
  key: 0,
5361
- session: D(g),
5362
- tab: p.value,
5363
- turns: D(S).length,
5364
- context: D(h).context.value,
5365
- "running-since": ee.value,
5366
- artifacts: D(k).list.value.length,
5367
- "artifacts-open": D(k).open.value && !D(M).shown.value,
5368
- map: D(M).counts.value,
5369
- "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,
5370
5421
  working: D(W).working.value !== void 0,
5371
- onTab: c[0] ||= (e) => p.value = e,
5372
- onAction: xe,
5373
- onToggleArtifacts: c[1] ||= (e) => D(M).toggleArtifacts(),
5374
- onToggleMap: c[2] ||= (e) => D(M).toggle(),
5375
- 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
5376
5427
  }, null, 8, [
5377
5428
  "session",
5378
5429
  "tab",
@@ -5384,84 +5435,84 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
5384
5435
  "map",
5385
5436
  "map-open",
5386
5437
  "working"
5387
- ])) : r("v-if", !0), a("div", vu, [a("section", yu, [l.sessionId === void 0 ? (_(), n(ui, {
5438
+ ])) : r("v-if", !0), a("div", Ou, [a("section", ku, [l.sessionId === void 0 ? (_(), n(di, {
5388
5439
  key: 0,
5389
- registered: D(fe)
5390
- }, null, 8, ["registered"])) : D(g) && D(f) !== void 0 ? (_(), i(e, { key: 1 }, [D(h).loadFailure.value === void 0 ? (_(), i("div", Cu, [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", {
5391
5442
  ref_key: "list",
5392
- ref: me,
5443
+ ref: he,
5393
5444
  class: "kvc-scroll",
5394
5445
  onScroll: c[10] ||= (...e) => D(G).onScroll && D(G).onScroll(...e)
5395
- }, [p.value === "prompt" ? (_(), n(Ll, {
5446
+ }, [m.value === "prompt" ? (_(), n(ql, {
5396
5447
  key: 0,
5397
- "session-id": D(g).id,
5398
- onBack: c[6] ||= (e) => p.value = "chat"
5399
- }, null, 8, ["session-id"])) : (_(), i("div", wu, [
5400
- D(x) > 0 ? (_(), i("div", Tu, [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", {
5401
5452
  type: "button",
5402
5453
  class: "kvc-button",
5403
5454
  "data-test": "show-earlier",
5404
- onClick: he
5405
- }, 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", {
5406
5457
  type: "button",
5407
5458
  class: "kvc-button",
5408
5459
  "data-test": "earlier",
5409
- onClick: _e
5410
- }, E(D(u).t("kvcoder.ui.earlierMessages", { count: D(x) })), 1)])) : r("v-if", !0),
5411
- (_(!0), i(e, null, b(D(v), (t) => (_(), i(e, { key: Ce(t) }, [s(Fc, {
5460
+ onClick: ve
5461
+ }, E(D(u).t("kvcoder.ui.earlierMessages", { count: D(S) })), 1)])) : r("v-if", !0),
5462
+ (_(!0), i(e, null, b(D(x), (t) => (_(), i(e, { key: we(t) }, [s(Gc, {
5412
5463
  message: t,
5413
- calls: F.value,
5414
- "finished-runs": D(I),
5415
- 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)
5416
5467
  }, null, 8, [
5417
5468
  "message",
5418
5469
  "calls",
5419
5470
  "finished-runs"
5420
- ]), B.value.has(t.id) ? (_(), i("span", {
5471
+ ]), V.value.has(t.id) ? (_(), i("span", {
5421
5472
  key: 0,
5422
5473
  class: "kvc-muted",
5423
- title: B.value.get(t.id)?.tokens,
5474
+ title: V.value.get(t.id)?.tokens,
5424
5475
  "data-test": "turn-totals"
5425
- }, E(B.value.get(t.id)?.text), 9, Eu)) : r("v-if", !0)], 64))), 128)),
5426
- P.value > 0 ? (_(), i("div", Du, [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", {
5427
5478
  type: "button",
5428
5479
  class: "kvc-link-button",
5429
5480
  "data-test": "map-show",
5430
- onClick: c[8] ||= (e) => D(M).shown.value = !0
5481
+ onClick: c[8] ||= (e) => D(N).shown.value = !0
5431
5482
  }, E(D(u).t("kvcoder.ui.map.show")), 1)])) : r("v-if", !0),
5432
- de.value ? (_(), n(Al, {
5483
+ fe.value ? (_(), n(Bl, {
5433
5484
  key: 2,
5434
- "session-id": D(g).id,
5485
+ "session-id": D(v).id,
5435
5486
  onSent: c[9] ||= (e) => {
5436
- D(G).resume(), D(h).refresh();
5487
+ D(G).resume(), D(g).refresh();
5437
5488
  }
5438
5489
  }, null, 8, ["session-id"])) : r("v-if", !0),
5439
- D(w).summarizing ? (_(), i("div", Ou, E(D(u).t("kvcoder.ui.summarizing")), 1)) : r("v-if", !0),
5440
- R.value && (D(w).text !== "" || D(w).thinking !== "") ? (_(), i("div", ku, [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", {
5441
5492
  key: 0,
5442
- open: D(w).text === "" && D(w).calls.length === 0,
5493
+ open: D(T).text === "" && D(T).calls.length === 0,
5443
5494
  "data-test": "live-thinking"
5444
- }, [a("summary", ju, E(D(u).t("kvcoder.ui.thinkingNow")), 1), a("p", Mu, E(D(w).thinking), 1)], 8, Au)), 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), {
5445
5496
  key: 1,
5446
5497
  view: {
5447
5498
  type: "markdown",
5448
5499
  text: "kvcoder.markdown",
5449
- params: { text: D(w).text }
5500
+ params: { text: D(T).text }
5450
5501
  }
5451
5502
  }, null, 8, ["view"]))])) : r("v-if", !0),
5452
- R.value ? (_(), n(ka, {
5503
+ R.value ? (_(), n(Aa, {
5453
5504
  key: 5,
5454
- live: D(w),
5455
- turn: D(S)[0]
5505
+ live: D(T),
5506
+ turn: D(w)[0]
5456
5507
  }, null, 8, ["live", "turn"])) : r("v-if", !0),
5457
- D(W).working.value ? (_(), n(gi, {
5508
+ D(W).working.value ? (_(), n(_i, {
5458
5509
  key: 6,
5459
5510
  working: D(W).working.value
5460
5511
  }, null, 8, ["working"])) : r("v-if", !0),
5461
- (_(!0), i(e, null, b(D(T), ([e, t]) => (_(), n(Yl, {
5512
+ (_(!0), i(e, null, b(D(k), ([e, t]) => (_(), n(au, {
5462
5513
  key: e,
5463
5514
  child: t,
5464
- task: ce.value.get(e),
5515
+ task: le.value.get(e),
5465
5516
  hidden: D(U).hidden.value,
5466
5517
  onAnswer: D(U).answer,
5467
5518
  onDecide: D(U).decide
@@ -5472,14 +5523,14 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
5472
5523
  "onAnswer",
5473
5524
  "onDecide"
5474
5525
  ]))), 128)),
5475
- (_(!0), i(e, null, b(le.value, (e) => (_(), n(nu, {
5526
+ (_(!0), i(e, null, b(ue.value, (e) => (_(), n(fu, {
5476
5527
  key: e,
5477
- "session-id": D(g).id,
5528
+ "session-id": D(v).id,
5478
5529
  "run-id": e
5479
5530
  }, null, 8, ["session-id", "run-id"]))), 128)),
5480
- s(Tl, {
5481
- owner: se(),
5482
- pending: z.value,
5531
+ s(Fl, {
5532
+ owner: ce(),
5533
+ pending: B.value,
5483
5534
  hidden: D(U).hidden.value,
5484
5535
  onAnswer: D(U).answer,
5485
5536
  onDecide: D(U).decide
@@ -5490,43 +5541,43 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
5490
5541
  "onAnswer",
5491
5542
  "onDecide"
5492
5543
  ]),
5493
- z.value.length > 0 ? (_(), i("p", Nu, E(oe.value), 1)) : r("v-if", !0)
5544
+ B.value.length > 0 ? (_(), i("p", Uu, E(se.value), 1)) : r("v-if", !0)
5494
5545
  ]))], 544), D(G).away.value ? (_(), i("button", {
5495
5546
  key: 0,
5496
5547
  type: "button",
5497
5548
  class: "kvc-button kvc-jump",
5498
5549
  "data-test": "jump-to-latest",
5499
- onClick: ge
5550
+ onClick: _e
5500
5551
  }, [s(D(re), {
5501
5552
  size: 16,
5502
5553
  "aria-hidden": "true"
5503
- }), o(E(D(u).t("kvcoder.ui.jumpToLatest")), 1)])) : r("v-if", !0)])) : (_(), i("div", bu, [a("p", xu, E(D(u).t("kvcoder.ui.loadFailed", { error: pe.value })), 1), a("div", Su, [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", {
5504
5555
  type: "button",
5505
5556
  class: "kvc-button kvc-primary",
5506
5557
  "data-test": "load-again",
5507
- onClick: c[4] ||= (e) => D(h).refresh()
5558
+ onClick: c[4] ||= (e) => D(g).refresh()
5508
5559
  }, E(D(u).t("kvcoder.ui.tryAgain")), 1), a("button", {
5509
5560
  type: "button",
5510
5561
  class: "kvc-button",
5511
5562
  "data-test": "load-export",
5512
5563
  onClick: c[5] ||= (e) => D(W).exportFile()
5513
5564
  }, E(D(u).t("kvcoder.ui.export")), 1)])])), s(kr, {
5514
- "session-id": D(g).id,
5565
+ "session-id": D(v).id,
5515
5566
  stoppable: ne.value,
5516
- stopping: V.value === D(g).id,
5517
- "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,
5518
5569
  placeholder: D(u).t("kvcoder.ui.placeholder"),
5519
5570
  blocked: D(W).working.value !== void 0,
5520
5571
  commands: "run",
5521
- registered: D(fe),
5572
+ registered: D(pe),
5522
5573
  onSend: te,
5523
- onStop: ie,
5524
- onCommand: xe,
5525
- onRegistered: Se
5574
+ onStop: ae,
5575
+ onCommand: Se,
5576
+ onRegistered: Ce
5526
5577
  }, {
5527
- controls: j(() => [s(zl, {
5528
- session: D(g),
5529
- onChanged: c[11] ||= (e) => D(h).refresh()
5578
+ controls: j(() => [s(Yl, {
5579
+ session: D(v),
5580
+ onChanged: c[11] ||= (e) => D(g).refresh()
5530
5581
  }, null, 8, ["session"])]),
5531
5582
  _: 1
5532
5583
  }, 8, [
@@ -5537,16 +5588,16 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
5537
5588
  "placeholder",
5538
5589
  "blocked",
5539
5590
  "registered"
5540
- ])], 64)) : r("v-if", !0)]), N.value ? (_(), n($n, {
5591
+ ])], 64)) : r("v-if", !0)]), P.value ? (_(), n($n, {
5541
5592
  key: 0,
5542
- list: D(k).list.value,
5543
- shown: D(k).shown.value,
5544
- content: D(k).content.value,
5545
- map: D(M).map.value,
5546
- "map-shown": D(M).shown.value,
5547
- onSelect: c[12] ||= (e) => D(M).selectArtifact(e),
5548
- onSelectMap: c[13] ||= (e) => D(M).shown.value = !0,
5549
- 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()
5550
5601
  }, null, 8, [
5551
5602
  "list",
5552
5603
  "shown",
@@ -5555,13 +5606,13 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
5555
5606
  "map-shown"
5556
5607
  ])) : r("v-if", !0)])]));
5557
5608
  }
5558
- }), Fu = /* @__PURE__ */ c({
5609
+ }), Gu = /* @__PURE__ */ c({
5559
5610
  __name: "conversation",
5560
5611
  props: { sessionId: {} },
5561
5612
  setup(e) {
5562
5613
  let t = e;
5563
- return (e, r) => (_(), n(Pu, { "session-id": t.sessionId }, null, 8, ["session-id"]));
5614
+ return (e, r) => (_(), n(Wu, { "session-id": t.sessionId }, null, 8, ["session-id"]));
5564
5615
  }
5565
5616
  });
5566
5617
  //#endregion
5567
- export { Fu as default };
5618
+ export { Gu as default };