@kvman/kvcoder 0.1.3 → 0.1.4

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