@kvman/kvcoder 0.1.2 → 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 (82) hide show
  1. package/dist/api.d.ts +12 -1
  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/register-settings.d.ts +2 -2
  34. package/dist/register-settings.js +2 -2
  35. package/dist/register-settings.js.map +1 -1
  36. package/dist/sessions/register-context.d.ts +3 -0
  37. package/dist/sessions/register-context.d.ts.map +1 -0
  38. package/dist/sessions/register-context.js +23 -0
  39. package/dist/sessions/register-context.js.map +1 -0
  40. package/dist/sessions/register-sessions.js +1 -1
  41. package/dist/sessions/register-sessions.js.map +1 -1
  42. package/dist/turns/compaction.d.ts +4 -0
  43. package/dist/turns/compaction.d.ts.map +1 -1
  44. package/dist/turns/compaction.js +32 -25
  45. package/dist/turns/compaction.js.map +1 -1
  46. package/dist/turns/message-stamp.d.ts +3 -0
  47. package/dist/turns/message-stamp.d.ts.map +1 -0
  48. package/dist/turns/message-stamp.js +16 -0
  49. package/dist/turns/message-stamp.js.map +1 -0
  50. package/dist/turns/model-context.d.ts.map +1 -1
  51. package/dist/turns/model-context.js +10 -2
  52. package/dist/turns/model-context.js.map +1 -1
  53. package/dist/turns/read-again.d.ts +6 -0
  54. package/dist/turns/read-again.d.ts.map +1 -0
  55. package/dist/turns/read-again.js +16 -0
  56. package/dist/turns/read-again.js.map +1 -0
  57. package/dist/turns/run-command.d.ts.map +1 -1
  58. package/dist/turns/run-command.js +4 -1
  59. package/dist/turns/run-command.js.map +1 -1
  60. package/dist/turns/sent-size.d.ts +4 -0
  61. package/dist/turns/sent-size.d.ts.map +1 -0
  62. package/dist/turns/sent-size.js +22 -0
  63. package/dist/turns/sent-size.js.map +1 -0
  64. package/dist/turns/settle-calls.d.ts +2 -2
  65. package/dist/turns/settle-calls.d.ts.map +1 -1
  66. package/dist/turns/settle-calls.js +10 -2
  67. package/dist/turns/settle-calls.js.map +1 -1
  68. package/dist/turns/step.js +2 -2
  69. package/dist/turns/step.js.map +1 -1
  70. package/dist/web/components/call.css +1 -1
  71. package/dist/web/components/call.js +30 -21
  72. package/dist/web/components/connectors.css +1 -1
  73. package/dist/web/components/conversation.css +1 -1
  74. package/dist/web/components/conversation.js +663 -555
  75. package/dist/web/components/mcp-sign-in.css +1 -1
  76. package/dist/web/components/model.css +1 -1
  77. package/dist/web/components/question.css +1 -1
  78. package/dist/web/components/sessions.css +1 -1
  79. package/docs/connectors.md +2 -2
  80. package/locales/ar.json +6 -1
  81. package/locales/en.json +6 -1
  82. package/package.json +3 -3
@@ -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,11 +859,11 @@ 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) => e.kind === "own" && "argument" in e.command, j = (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
  });
854
- async function M(e) {
866
+ async function I(e) {
855
867
  h.value = !0;
856
868
  try {
857
869
  for (let t of e) {
@@ -872,44 +884,50 @@ var xt = { class: "kvc-composer" }, St = { class: "kvc-box" }, Ct = ["aria-label
872
884
  h.value = !1;
873
885
  }
874
886
  }
875
- async function N(e) {
887
+ async function L(e) {
876
888
  let t = e.target;
877
- t instanceof HTMLInputElement && t.files !== null && (await M([...t.files]), t.value = "");
889
+ t instanceof HTMLInputElement && t.files !== null && (await I([...t.files]), t.value = "");
878
890
  }
879
- function P(e) {
891
+ function R(e) {
880
892
  let t = [...e.clipboardData?.files ?? []];
881
- t.length !== 0 && (e.preventDefault(), M(t));
893
+ t.length !== 0 && (e.preventDefault(), I(t));
882
894
  }
883
- function F() {
884
- let e = E.value[_.value], t = S.value?.argument ?? "";
885
- C.value || l.blocked === !0 || e === void 0 || k(e) && t === "" || (e.kind === "own" ? u("command", e.command.name, t) : u("registered", e.command, t), f.value = "");
895
+ function z() {
896
+ let e = M.value, t = S.value?.argument ?? "";
897
+ l.blocked === !0 || e === void 0 || P(e) && t === "" || (e.kind === "own" ? u("command", e.command.name, t) : u("registered", e.command, t), f.value = "");
886
898
  }
887
- function I() {
888
- if (S.value !== void 0) return F();
899
+ function B() {
900
+ if (S.value !== void 0) return z();
889
901
  let e = f.value.trim();
890
902
  e === "" || h.value || l.blocked === !0 || (u("send", {
891
903
  text: e,
892
904
  fileIds: p.value.map((e) => e.id)
893
905
  }), f.value = "", p.value = []);
894
906
  }
895
- function L(e) {
896
- !C.value && E.value.length > 0 && (_.value = (_.value + e + E.value.length) % E.value.length);
907
+ function V(e) {
908
+ j.value.length > 0 && (_.value = (_.value + e + j.value.length) % j.value.length);
897
909
  }
898
- function R(e) {
910
+ function H(e) {
911
+ k(e) && (_.value = j.value.indexOf(e));
912
+ }
913
+ function U(e) {
914
+ k(e) && (H(e), z());
915
+ }
916
+ function ee(e) {
899
917
  if (S.value === void 0) return !1;
900
- let t = E.value[_.value];
918
+ let t = M.value;
901
919
  if (e.key === "Escape") x.value = !0;
902
- else if (e.key === "ArrowDown") L(1);
903
- else if (e.key === "ArrowUp") L(-1);
904
- else if (e.key === "Tab" && t !== void 0 && !C.value) f.value = `/${t.command.name} `;
920
+ else if (e.key === "ArrowDown") V(1);
921
+ else if (e.key === "ArrowUp") V(-1);
922
+ else if (e.key === "Tab" && t !== void 0) f.value = `/${t.command.name} `;
905
923
  else return !1;
906
924
  return !0;
907
925
  }
908
- function z(e) {
909
- if (R(e)) return e.preventDefault();
910
- e.key !== "Enter" || e.shiftKey || e.isComposing || (e.preventDefault(), I());
926
+ function W(e) {
927
+ if (ee(e)) return e.preventDefault();
928
+ e.key !== "Enter" || e.shiftKey || e.isComposing || (e.preventDefault(), B());
911
929
  }
912
- return (t, n) => (g(), i("div", xt, [a("div", St, [
930
+ return (t, n) => (g(), i("div", St, [a("div", Ct, [
913
931
  S.value !== void 0 && !x.value ? (g(), i("div", {
914
932
  key: 0,
915
933
  class: "kvc-slash",
@@ -917,23 +935,21 @@ var xt = { class: "kvc-composer" }, St = { class: "kvc-box" }, Ct = ["aria-label
917
935
  "aria-label": T(d).t("kvcoder.ui.slash.title"),
918
936
  "data-test": "slash-list"
919
937
  }, [
920
- C.value ? (g(), i("p", wt, w(T(d).t("kvcoder.ui.slash.wait")), 1)) : r("v-if", !0),
921
- (g(!0), i(e, null, y(E.value, (t, n) => (g(), i("div", {
938
+ N.value ? (g(), i("p", Tt, w(T(d).t("kvcoder.ui.slash.wait")), 1)) : r("v-if", !0),
939
+ (g(!0), i(e, null, y(E.value, (t) => (g(), i("div", {
922
940
  key: t.command.name,
923
941
  class: "kvc-slash-row",
924
942
  role: "option",
925
- "aria-disabled": C.value,
926
- "aria-selected": !C.value && n === _.value,
927
- "data-active": !C.value && n === _.value,
943
+ "aria-disabled": !k(t),
944
+ "aria-selected": t === M.value,
945
+ "data-active": t === M.value,
928
946
  "data-test": `slash-${t.command.name}`,
929
- onMousemove: (e) => _.value = n,
930
- onClick: (e) => {
931
- _.value = n, F();
932
- }
933
- }, [a("span", Et, [a("span", Dt, [o("/" + w(t.command.name), 1), k(t) ? (g(), i(e, { key: 0 }, [o(" <" + w(T(d).t(`kvcoder.ui.slash.${t.command.name}.argument`)) + ">", 1)], 64)) : r("v-if", !0)])]), a("span", Ot, w(j(t)), 1)], 40, Tt))), 128)),
934
- E.value.length === 0 ? (g(), i("p", kt, w(T(d).t("kvcoder.ui.slash.none")), 1)) : r("v-if", !0)
935
- ], 8, Ct)) : r("v-if", !0),
936
- p.value.length > 0 ? (g(), i("div", At, [(g(!0), i(e, null, y(p.value, (e) => (g(), i("span", {
947
+ onMousemove: (e) => H(t),
948
+ onClick: (e) => U(t)
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", {
937
953
  key: e.id,
938
954
  class: "kvc-chip",
939
955
  "data-test": "attachment"
@@ -946,17 +962,17 @@ var xt = { class: "kvc-composer" }, St = { class: "kvc-box" }, Ct = ["aria-label
946
962
  },
947
963
  "aria-label": T(d).t("kvcoder.ui.removeAttachment"),
948
964
  onClick: (t) => p.value = p.value.filter((t) => t.id !== e.id)
949
- }, [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),
950
966
  A(a("textarea", {
951
967
  "onUpdate:modelValue": n[0] ||= (e) => f.value = e,
952
968
  placeholder: l.placeholder,
953
969
  "aria-label": l.placeholder,
954
970
  rows: "2",
955
971
  "data-test": "composer-text",
956
- onKeydown: z,
957
- onPaste: P
958
- }, null, 40, Mt), [[D, f.value]]),
959
- a("div", Nt, [
972
+ onKeydown: W,
973
+ onPaste: R
974
+ }, null, 40, Nt), [[D, f.value]]),
975
+ a("div", Pt, [
960
976
  a("input", {
961
977
  ref_key: "picker",
962
978
  ref: m,
@@ -964,7 +980,7 @@ var xt = { class: "kvc-composer" }, St = { class: "kvc-box" }, Ct = ["aria-label
964
980
  multiple: "",
965
981
  hidden: "",
966
982
  "data-test": "composer-files",
967
- onChange: N
983
+ onChange: L
968
984
  }, null, 544),
969
985
  a("button", {
970
986
  type: "button",
@@ -973,9 +989,9 @@ var xt = { class: "kvc-composer" }, St = { class: "kvc-box" }, Ct = ["aria-label
973
989
  title: T(d).t("kvcoder.ui.attach"),
974
990
  disabled: h.value,
975
991
  onClick: n[1] ||= (e) => m.value?.click()
976
- }, [s(T(me), { size: 16 })], 8, Pt),
992
+ }, [s(T(me), { size: 16 })], 8, Ft),
977
993
  b(t.$slots, "controls"),
978
- a("span", Ft, w(T(d).t("kvcoder.ui.enterSends")), 1),
994
+ a("span", It, w(T(d).t("kvcoder.ui.enterSends")), 1),
979
995
  l.running ? (g(), i("button", {
980
996
  key: 0,
981
997
  type: "button",
@@ -989,15 +1005,15 @@ var xt = { class: "kvc-composer" }, St = { class: "kvc-box" }, Ct = ["aria-label
989
1005
  "aria-label": T(d).t("kvcoder.ui.send"),
990
1006
  disabled: f.value.trim() === "" || h.value || l.blocked === !0,
991
1007
  "data-test": "send",
992
- onClick: I
993
- }, [s(T(G), { size: 16 })], 8, It)
1008
+ onClick: B
1009
+ }, [s(T(G), { size: 16 })], 8, Lt)
994
1010
  ])
995
1011
  ])]));
996
1012
  }
997
1013
  });
998
1014
  //#endregion
999
1015
  //#region web/src/model-groups.ts
1000
- function Rt(e, t, n) {
1016
+ function zt(e, t, n) {
1001
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();
1002
1018
  for (let e of a) {
1003
1019
  let t = o.get(e.provider) ?? {
@@ -1012,7 +1028,7 @@ function Rt(e, t, n) {
1012
1028
  }
1013
1029
  return [...o.values()].sort((e, t) => e.title.localeCompare(t.title));
1014
1030
  }
1015
- function zt(e, t) {
1031
+ function Bt(e, t) {
1016
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) => ({
1017
1033
  ...e,
1018
1034
  models: e.models.filter(r)
@@ -1023,38 +1039,38 @@ function zt(e, t) {
1023
1039
  total: e.reduce((e, t) => e + t.models.length, 0)
1024
1040
  };
1025
1041
  }
1026
- var Bt = [
1042
+ var Vt = [
1027
1043
  "off",
1028
1044
  "minimal",
1029
1045
  "low",
1030
1046
  "medium",
1031
1047
  "high"
1032
- ], Vt = { class: "kvc-picker" }, Ht = [
1048
+ ], Ht = { class: "kvc-picker" }, Ut = [
1033
1049
  "aria-expanded",
1034
1050
  "aria-label",
1035
1051
  "disabled"
1036
- ], 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 = [
1037
1053
  "placeholder",
1038
1054
  "aria-label",
1039
1055
  "onKeydown"
1040
- ], 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 = {
1041
1057
  class: "kvc-group",
1042
1058
  role: "presentation",
1043
1059
  "data-test": "model-group"
1044
- }, Zt = [
1060
+ }, Qt = [
1045
1061
  "aria-selected",
1046
1062
  "data-active",
1047
1063
  "data-test",
1048
1064
  "onClick",
1049
1065
  "onMousemove"
1050
- ], Qt = { class: "kvc-model-name" }, $t = {
1066
+ ], $t = { class: "kvc-model-name" }, en = {
1051
1067
  key: 1,
1052
1068
  class: "kvc-muted kvc-none",
1053
1069
  "data-test": "model-none"
1054
- }, en = {
1070
+ }, tn = {
1055
1071
  class: "kvc-muted kvc-count",
1056
1072
  "data-test": "model-count"
1057
- }, tn = 24, nn = /* @__PURE__ */ c({
1073
+ }, nn = 24, rn = /* @__PURE__ */ c({
1058
1074
  __name: "ModelPicker",
1059
1075
  props: {
1060
1076
  groups: {},
@@ -1065,7 +1081,7 @@ var Bt = [
1065
1081
  },
1066
1082
  emits: ["pick", "none"],
1067
1083
  setup(o, { emit: c }) {
1068
- 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) => {
1069
1085
  let t = k.value.findIndex((t) => t.id === e);
1070
1086
  return t < 0 ? -1 : t + F.value;
1071
1087
  };
@@ -1079,7 +1095,7 @@ var Bt = [
1079
1095
  function H() {
1080
1096
  let e = S.value, t = b.value?.closest(".kvc-conversation")?.getBoundingClientRect();
1081
1097
  if (e === null || t === void 0) return;
1082
- let n = e.getBoundingClientRect(), r = t.left + tn - (n.left - B), i = t.right - tn - (n.right - B), a = r > 0 ? r : i < 0 ? i : 0;
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;
1083
1099
  a !== B && (B = a, e.style.translate = `${a}px 0`);
1084
1100
  }
1085
1101
  function U() {
@@ -1094,20 +1110,20 @@ var Bt = [
1094
1110
  function G(e) {
1095
1111
  e !== void 0 && (u("pick", e), R());
1096
1112
  }
1097
- function te() {
1113
+ function K() {
1098
1114
  u("none"), R();
1099
1115
  }
1100
- function ne() {
1101
- 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);
1102
1118
  }
1103
- function q(e) {
1119
+ function re(e) {
1104
1120
  e.target instanceof Node && !b.value?.parentElement?.contains(e.target) && (m.value = !1);
1105
1121
  }
1106
1122
  return O(h, () => _.value = 0), O(m, (e) => {
1107
- 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));
1108
1124
  }), p(() => {
1109
- document.removeEventListener("pointerdown", q), cancelAnimationFrame(V);
1110
- }), (t, o) => (g(), i("div", Vt, [a("button", {
1125
+ document.removeEventListener("pointerdown", re), cancelAnimationFrame(V);
1126
+ }), (t, o) => (g(), i("div", Ht, [a("button", {
1111
1127
  ref_key: "trigger",
1112
1128
  ref: b,
1113
1129
  type: "button",
@@ -1118,10 +1134,10 @@ var Bt = [
1118
1134
  disabled: l.disabled,
1119
1135
  "data-test": "model-picker",
1120
1136
  onClick: o[0] ||= (e) => m.value ? R() : z()
1121
- }, [a("span", Ut, w(N.value), 1), s(T(re), {
1137
+ }, [a("span", Wt, w(N.value), 1), s(T(ne), {
1122
1138
  size: 16,
1123
1139
  "aria-hidden": "true"
1124
- })], 8, Ht), m.value ? (g(), i("div", {
1140
+ })], 8, Ut), m.value ? (g(), i("div", {
1125
1141
  key: 0,
1126
1142
  ref_key: "panel",
1127
1143
  ref: S,
@@ -1129,7 +1145,7 @@ var Bt = [
1129
1145
  "data-test": "model-popover",
1130
1146
  onKeydown: j(M(R, ["stop"]), ["esc"])
1131
1147
  }, [
1132
- a("label", Gt, [s(T(_e), {
1148
+ a("label", Kt, [s(T(_e), {
1133
1149
  size: 16,
1134
1150
  "aria-hidden": "true"
1135
1151
  }), A(a("input", {
@@ -1146,9 +1162,9 @@ var Bt = [
1146
1162
  onKeydown: [
1147
1163
  o[2] ||= j(M((e) => W(1), ["prevent"]), ["down"]),
1148
1164
  o[3] ||= j(M((e) => W(-1), ["prevent"]), ["up"]),
1149
- j(M(ne, ["prevent"]), ["enter"])
1165
+ j(M(te, ["prevent"]), ["enter"])
1150
1166
  ]
1151
- }, null, 40, Kt), [[D, h.value]])]),
1167
+ }, null, 40, qt), [[D, h.value]])]),
1152
1168
  a("div", {
1153
1169
  id: "kvc-models",
1154
1170
  class: "kvc-options",
@@ -1162,14 +1178,14 @@ var Bt = [
1162
1178
  "aria-selected": l.current === null,
1163
1179
  "data-active": _.value === 0,
1164
1180
  "data-test": "model-none-entry",
1165
- onClick: te,
1181
+ onClick: K,
1166
1182
  onMousemove: o[4] ||= (e) => _.value = 0
1167
- }, [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), {
1168
1184
  key: 0,
1169
1185
  size: 16,
1170
1186
  "aria-hidden": "true"
1171
- })) : r("v-if", !0)], 40, Jt)) : r("v-if", !0),
1172
- (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", {
1173
1189
  key: e.id,
1174
1190
  class: "kvc-model",
1175
1191
  role: "option",
@@ -1178,20 +1194,20 @@ var Bt = [
1178
1194
  "data-test": `model-${e.id}`,
1179
1195
  onClick: (t) => G(e.id),
1180
1196
  onMousemove: (t) => _.value = L(e.id)
1181
- }, [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), {
1182
1198
  key: 0,
1183
1199
  size: 16,
1184
1200
  "aria-hidden": "true"
1185
- })) : r("v-if", !0)], 40, Zt))), 128))], 64))), 128)),
1186
- C.value.shown === 0 ? (g(), i("p", $t, w(T(f).t("kvcoder.ui.noModels")), 1)) : r("v-if", !0)
1187
- ], 8, qt),
1188
- 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", {
1189
1205
  shown: C.value.shown,
1190
1206
  total: C.value.total
1191
1207
  })), 1)
1192
- ], 40, Wt)) : r("v-if", !0)]));
1208
+ ], 40, Gt)) : r("v-if", !0)]));
1193
1209
  }
1194
- }), rn = ["value", "aria-label"], an = ["value"], on = /* @__PURE__ */ c({
1210
+ }), an = ["value", "aria-label"], on = ["value"], sn = /* @__PURE__ */ c({
1195
1211
  __name: "ModelControls",
1196
1212
  props: {
1197
1213
  groups: {},
@@ -1201,8 +1217,8 @@ var Bt = [
1201
1217
  },
1202
1218
  emits: ["model", "thinking"],
1203
1219
  setup(t, { emit: n }) {
1204
- let r = t, o = n, c = J(), l = (e) => Bt.find((t) => e.target instanceof HTMLSelectElement && t === e.target.value) ?? "medium";
1205
- 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, {
1206
1222
  groups: r.groups,
1207
1223
  current: r.model,
1208
1224
  empty: r.empty,
@@ -1217,15 +1233,15 @@ var Bt = [
1217
1233
  "aria-label": T(c).t("kvcoder.ui.thinking"),
1218
1234
  "data-test": "thinking-picker",
1219
1235
  onChange: n[1] ||= (e) => o("thinking", l(e))
1220
- }, [(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", {
1221
1237
  key: e,
1222
1238
  value: e
1223
- }, 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));
1224
1240
  }
1225
1241
  });
1226
1242
  //#endregion
1227
1243
  //#region web/src/remember-model.ts
1228
- async function sn(e, t) {
1244
+ async function cn(e, t) {
1229
1245
  try {
1230
1246
  await e.exec("kernel.settings.set", {
1231
1247
  key: "kvai.defaultModel",
@@ -1238,15 +1254,15 @@ async function sn(e, t) {
1238
1254
  }
1239
1255
  //#endregion
1240
1256
  //#region web/src/use-chat-model.ts
1241
- function cn(e, t) {
1257
+ function ln(e, t) {
1242
1258
  let n = e.find((e) => e.key === t)?.value;
1243
1259
  return typeof n == "string" && n !== "" ? n : null;
1244
1260
  }
1245
- function ln(e) {
1261
+ function un(e) {
1246
1262
  let t = e.find((e) => e.key === "kvcoder.thinking")?.value;
1247
- return Bt.find((e) => e === t) ?? "medium";
1263
+ return Vt.find((e) => e === t) ?? "medium";
1248
1264
  }
1249
- function un(e, n) {
1265
+ function dn(e, n) {
1250
1266
  let r = v([]), i = v([]), a = v(null), o = v(null), s = v("medium"), c = v(null), l = v(!1), u = v(!1);
1251
1267
  m(async () => {
1252
1268
  try {
@@ -1255,14 +1271,14 @@ function un(e, n) {
1255
1271
  e.exec("kvai.provider.list", {}),
1256
1272
  e.exec("kvai.model.list", {})
1257
1273
  ]);
1258
- 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;
1259
1275
  } catch (e) {
1260
1276
  u.value = !0, n(e);
1261
1277
  } finally {
1262
1278
  l.value = !0;
1263
1279
  }
1264
1280
  });
1265
- 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));
1266
1282
  return {
1267
1283
  current: d,
1268
1284
  thinking: f,
@@ -1279,37 +1295,41 @@ function un(e, n) {
1279
1295
  }
1280
1296
  //#endregion
1281
1297
  //#region web/src/ChatStart.vue?vue&type=script&setup=true&lang.ts
1282
- var dn = {
1298
+ var fn = {
1283
1299
  class: "kvc-start",
1284
1300
  "data-test": "chat-start"
1285
- }, fn = {
1301
+ }, pn = {
1286
1302
  key: 0,
1287
1303
  class: "kvc-muted kvc-start-note",
1288
1304
  role: "status",
1289
1305
  "data-test": "key-needed"
1290
- }, pn = {
1306
+ }, mn = {
1291
1307
  key: 1,
1292
1308
  class: "kvc-muted kvc-start-note",
1293
1309
  role: "status",
1294
1310
  "data-test": "choose-model"
1295
- }, mn = {
1311
+ }, hn = {
1296
1312
  key: 2,
1297
1313
  class: "kvc-muted kvc-start-note"
1298
- }, hn = /* @__PURE__ */ c({
1314
+ }, gn = /* @__PURE__ */ c({
1299
1315
  __name: "ChatStart",
1300
1316
  props: { registered: {} },
1301
1317
  setup(t) {
1302
- 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));
1303
1319
  async function l(e) {
1304
- c.pickModel(e), await sn(n, e);
1320
+ c.pickModel(e), await cn(n, e);
1305
1321
  }
1306
- async function u(e) {
1322
+ async function u() {
1323
+ let { id: e } = await n.exec("kvcoder.session.create", {}), t = c.changes();
1324
+ return Object.keys(t).length > 0 && await n.exec("kvcoder.session.configure", {
1325
+ sessionId: e,
1326
+ ...t
1327
+ }), e;
1328
+ }
1329
+ async function d(e) {
1307
1330
  try {
1308
- let { id: t } = await n.exec("kvcoder.session.create", {}), r = c.changes();
1309
- Object.keys(r).length > 0 && await n.exec("kvcoder.session.configure", {
1310
- sessionId: t,
1311
- ...r
1312
- }), await n.exec("kvcoder.message.send", {
1331
+ let t = await u();
1332
+ await n.exec("kvcoder.message.send", {
1313
1333
  sessionId: t,
1314
1334
  text: e.text,
1315
1335
  ...e.fileIds.length > 0 ? { fileIds: e.fileIds } : {}
@@ -1318,20 +1338,35 @@ var dn = {
1318
1338
  X(n, e);
1319
1339
  }
1320
1340
  }
1321
- return (t, d) => (g(), i(e, null, [a("div", dn, [a("h1", null, w(T(n).t("kvcoder.ui.startHeading", { workspace: T(n).workspace.value.name })), 1), T(c).state.value === "needsKey" && T(c).provider.value ? (g(), i("p", fn, [o(w(T(n).t("kvcoder.ui.keyNeeded", { provider: T(c).provider.value.title })) + " ", 1), a("button", {
1341
+ async function f(e, t) {
1342
+ try {
1343
+ let r = await u();
1344
+ await n.exec(e.command, {
1345
+ sessionId: r,
1346
+ argument: t
1347
+ }), e.message !== void 0 && await n.exec("kvcoder.message.send", {
1348
+ sessionId: r,
1349
+ text: t === "" ? n.t(e.message) : t
1350
+ }), n.navigate("kvcoder.session", { sessionId: r });
1351
+ } catch (e) {
1352
+ X(n, e);
1353
+ }
1354
+ }
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", {
1322
1356
  type: "button",
1323
1357
  class: "kvc-link-button",
1324
1358
  "data-test": "add-key",
1325
- onClick: d[0] ||= (e) => T(n).navigate("kvai.provider", { providerId: T(c).provider.value.id })
1326
- }, w(T(n).t("kvcoder.ui.addKey")), 1)])) : T(c).state.value === "noModel" ? (g(), i("p", pn, w(T(n).t("kvcoder.ui.chooseModelHint")), 1)) : (g(), i("p", mn, w(T(n).t("kvcoder.ui.startHint")), 1))]), s(Lt, {
1359
+ onClick: u[0] ||= (e) => T(n).navigate("kvai.provider", { providerId: T(c).provider.value.id })
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, {
1327
1361
  running: !1,
1328
1362
  placeholder: T(n).t("kvcoder.ui.startPlaceholder"),
1329
1363
  blocked: T(c).state.value !== "ready",
1330
1364
  commands: "wait",
1331
1365
  registered: r.registered,
1332
- onSend: u
1366
+ onSend: d,
1367
+ onRegistered: f
1333
1368
  }, {
1334
- controls: k(() => [s(on, {
1369
+ controls: k(() => [s(sn, {
1335
1370
  groups: T(c).groups.value,
1336
1371
  model: T(c).current.value,
1337
1372
  thinking: T(c).thinking.value,
@@ -1355,23 +1390,23 @@ var dn = {
1355
1390
  });
1356
1391
  //#endregion
1357
1392
  //#region web/src/use-now.ts
1358
- function gn() {
1393
+ function _n() {
1359
1394
  let e = v(Date.now()), t;
1360
1395
  return m(() => t = setInterval(() => e.value = Date.now(), 1e3)), p(() => clearInterval(t)), e;
1361
1396
  }
1362
1397
  //#endregion
1363
1398
  //#region web/src/CommandProgress.vue?vue&type=script&setup=true&lang.ts
1364
- var _n = ["data-command"], vn = { class: "kvc-activity-text" }, yn = {
1399
+ var vn = ["data-command"], yn = { class: "kvc-activity-text" }, bn = {
1365
1400
  style: { "font-weight": "500" },
1366
1401
  "data-test": "command-title"
1367
- }, bn = {
1402
+ }, xn = {
1368
1403
  class: "kvc-muted",
1369
1404
  "data-test": "command-seconds"
1370
- }, xn = /* @__PURE__ */ c({
1405
+ }, Sn = /* @__PURE__ */ c({
1371
1406
  __name: "CommandProgress",
1372
1407
  props: { working: {} },
1373
1408
  setup(e) {
1374
- 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)));
1375
1410
  return (e, t) => (g(), i("div", {
1376
1411
  class: "kvc-activity",
1377
1412
  role: "status",
@@ -1383,19 +1418,19 @@ var _n = ["data-command"], vn = { class: "kvc-activity-text" }, yn = {
1383
1418
  class: "kvc-spin",
1384
1419
  "aria-hidden": "true"
1385
1420
  }, null, -1),
1386
- a("span", vn, [a("span", yn, w(T(r).t(`kvcoder.ui.working.${n.working.name}`)), 1)]),
1387
- a("span", bn, w(T(r).t("kvcoder.ui.seconds", { count: s.value })), 1)
1388
- ], 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));
1389
1424
  }
1390
- }), Sn = 5;
1391
- function Cn(e, t) {
1425
+ }), Cn = 5;
1426
+ function wn(e, t) {
1392
1427
  let n = Math.max(0, Math.floor(t / 1e3));
1393
1428
  return n < 60 ? e("kvcoder.ui.seconds", { count: n }) : e("kvcoder.ui.jobs.minutes", {
1394
1429
  minutes: Math.floor(n / 60),
1395
1430
  seconds: n % 60
1396
1431
  });
1397
1432
  }
1398
- function wn(e, n, r) {
1433
+ function Tn(e, n, r) {
1399
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;
1400
1435
  async function d() {
1401
1436
  for (let t of Object.keys(a.value)) {
@@ -1440,7 +1475,7 @@ function wn(e, n, r) {
1440
1475
  }
1441
1476
  return O(() => c.value.length > 0 || r.value, (e) => {
1442
1477
  clearInterval(u), u = void 0, e && (u = setInterval(() => {
1443
- s.value = Date.now(), l += 1, l % Sn === 0 && f();
1478
+ s.value = Date.now(), l += 1, l % Cn === 0 && f();
1444
1479
  }, 1e3));
1445
1480
  }, { immediate: !0 }), p(() => clearInterval(u)), {
1446
1481
  jobs: i,
@@ -1455,25 +1490,25 @@ function wn(e, n, r) {
1455
1490
  }
1456
1491
  //#endregion
1457
1492
  //#region web/src/JobItem.vue?vue&type=script&setup=true&lang.ts
1458
- 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 = {
1459
1494
  class: "kvc-job-title kvc-oneline",
1460
1495
  "data-test": "job-title"
1461
- }, On = {
1496
+ }, kn = {
1462
1497
  key: 0,
1463
1498
  class: "kvc-muted",
1464
1499
  "data-test": "job-time"
1465
- }, kn = {
1500
+ }, An = {
1466
1501
  key: 1,
1467
1502
  class: "kvc-chip",
1468
1503
  "data-test": "job-status"
1469
- }, An = {
1504
+ }, jn = {
1470
1505
  key: 0,
1471
1506
  class: "kvc-job-links"
1472
- }, 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 = {
1473
1508
  key: 1,
1474
1509
  class: "kvc-output",
1475
1510
  "data-test": "job-output"
1476
- }, In = /* @__PURE__ */ c({
1511
+ }, Ln = /* @__PURE__ */ c({
1477
1512
  __name: "JobItem",
1478
1513
  props: {
1479
1514
  job: {},
@@ -1489,51 +1524,51 @@ var Tn = ["data-test", "data-status"], En = { class: "kvc-job-head" }, Dn = {
1489
1524
  "data-test": `job-${s.job.id}`,
1490
1525
  "data-status": s.job.status
1491
1526
  }, [
1492
- 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)]))]),
1493
- 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", {
1494
1529
  key: e,
1495
1530
  href: e,
1496
1531
  target: "_blank",
1497
1532
  rel: "noopener noreferrer",
1498
1533
  class: "kvc-link kvc-mono",
1499
1534
  "data-test": "job-link"
1500
- }, w(e), 9, jn))), 128))])) : r("v-if", !0),
1501
- a("div", Mn, [a("button", {
1535
+ }, w(e), 9, Mn))), 128))])) : r("v-if", !0),
1536
+ a("div", Nn, [a("button", {
1502
1537
  type: "button",
1503
1538
  class: "kvc-button",
1504
1539
  "aria-expanded": s.logs !== void 0,
1505
1540
  "data-test": `job-logs-${s.job.id}`,
1506
1541
  onClick: n[0] ||= (e) => c("logs")
1507
- }, 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", {
1508
1543
  key: 0,
1509
1544
  type: "button",
1510
1545
  class: "kvc-button kvc-primary",
1511
1546
  disabled: s.stopping,
1512
1547
  "data-test": `job-stop-${s.job.id}`,
1513
1548
  onClick: n[1] ||= (e) => c("stop")
1514
- }, w(T(l).t("kvcoder.ui.jobs.stop")), 9, Pn)) : r("v-if", !0)]),
1515
- 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))
1516
- ], 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));
1517
1552
  }
1518
- }), Ln = {
1553
+ }), Rn = {
1519
1554
  key: 0,
1520
1555
  class: "kvc-jobs",
1521
1556
  "data-test": "jobs"
1522
- }, Rn = ["aria-expanded"], zn = ["aria-label", "onKeydown"], Bn = /* @__PURE__ */ c({
1557
+ }, zn = ["aria-expanded"], Bn = ["aria-label", "onKeydown"], Vn = /* @__PURE__ */ c({
1523
1558
  __name: "JobsChip",
1524
1559
  props: {
1525
1560
  sessionId: {},
1526
1561
  stamp: {}
1527
1562
  },
1528
1563
  setup(t) {
1529
- 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);
1530
1565
  function k() {
1531
1566
  u.value = !1, d.value?.focus();
1532
1567
  }
1533
1568
  function A(e) {
1534
1569
  e.target instanceof Node && !d.value?.parentElement?.contains(e.target) && (u.value = !1);
1535
1570
  }
1536
- 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", {
1537
1572
  ref_key: "trigger",
1538
1573
  ref: d,
1539
1574
  type: "button",
@@ -1548,18 +1583,18 @@ var Tn = ["data-test", "data-status"], En = { class: "kvc-job-head" }, Dn = {
1548
1583
  "aria-hidden": "true"
1549
1584
  }, null, -1),
1550
1585
  o(w(T(l).t("kvcoder.ui.jobs.running", { count: T(h).length })), 1),
1551
- s(T(re), {
1586
+ s(T(ne), {
1552
1587
  size: 16,
1553
1588
  "aria-hidden": "true"
1554
1589
  })
1555
- ], 8, Rn), u.value ? (g(), i("div", {
1590
+ ], 8, zn), u.value ? (g(), i("div", {
1556
1591
  key: 0,
1557
1592
  class: "kvc-popover kvc-jobs-panel",
1558
1593
  role: "dialog",
1559
1594
  "aria-label": T(l).t("kvcoder.ui.jobs.title"),
1560
1595
  "data-test": "jobs-popover",
1561
1596
  onKeydown: j(M(k, ["stop"]), ["esc"])
1562
- }, [(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, {
1563
1598
  key: e.id,
1564
1599
  job: e,
1565
1600
  now: T(x),
@@ -1574,12 +1609,12 @@ var Tn = ["data-test", "data-status"], En = { class: "kvc-job-head" }, Dn = {
1574
1609
  "stopping",
1575
1610
  "onStop",
1576
1611
  "onLogs"
1577
- ]))), 128))], 40, zn)) : r("v-if", !0)])) : r("v-if", !0);
1612
+ ]))), 128))], 40, Bn)) : r("v-if", !0)])) : r("v-if", !0);
1578
1613
  }
1579
1614
  });
1580
1615
  //#endregion
1581
1616
  //#region web/src/use-dismiss.ts
1582
- function Vn(e, t, n) {
1617
+ function Hn(e, t, n) {
1583
1618
  let r = (e) => {
1584
1619
  e.target instanceof Node && t()?.contains(e.target) !== !0 && n();
1585
1620
  }, i = (e) => {
@@ -1593,27 +1628,32 @@ function Vn(e, t, n) {
1593
1628
  }
1594
1629
  //#endregion
1595
1630
  //#region web/src/ConversationHeader.vue?vue&type=script&setup=true&lang.ts
1596
- 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 = {
1597
1632
  key: 1,
1598
1633
  "data-test": "session-title"
1599
- }, Kn = {
1634
+ }, qn = {
1600
1635
  class: "kvc-muted",
1601
1636
  "data-test": "session-totals"
1602
- }, qn = [
1637
+ }, Jn = {
1638
+ key: 2,
1639
+ class: "kvc-muted",
1640
+ "data-test": "session-context"
1641
+ }, Yn = [
1603
1642
  "aria-pressed",
1604
1643
  "aria-label",
1605
1644
  "title"
1606
- ], Jn = ["aria-label", "aria-expanded"], Yn = {
1645
+ ], Xn = ["aria-label", "aria-expanded"], Zn = {
1607
1646
  key: 0,
1608
1647
  class: "kvc-menu",
1609
1648
  role: "menu",
1610
1649
  "data-test": "chat-menu-items"
1611
- }, 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({
1612
1651
  __name: "ConversationHeader",
1613
1652
  props: {
1614
1653
  session: {},
1615
1654
  tab: {},
1616
1655
  turns: {},
1656
+ context: { default: null },
1617
1657
  runningSince: { default: void 0 },
1618
1658
  artifacts: { default: 0 },
1619
1659
  artifactsOpen: {
@@ -1631,30 +1671,34 @@ var Hn = { class: "kvc-header" }, Un = { class: "kvc-title" }, Wn = ["aria-label
1631
1671
  "toggleArtifacts"
1632
1672
  ],
1633
1673
  setup(e, { emit: n }) {
1634
- 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 }));
1635
- 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() {
1636
1676
  d.value = !1, p.value = !1;
1637
1677
  }
1638
- Vn(() => d.value || p.value, () => m.value, x);
1639
- function S(e) {
1640
- x(), e();
1678
+ Hn(() => d.value || p.value, () => m.value, S);
1679
+ function C(e) {
1680
+ S(), e();
1641
1681
  }
1642
- function C() {
1682
+ function O() {
1643
1683
  let e = f.value ?? "";
1644
1684
  f.value = null, l("action", "rename", e);
1645
1685
  }
1646
- return (e, t) => (g(), i("header", Hn, [
1647
- a("div", Un, [f.value === null ? (g(), i("strong", Gn, w(T(Pe)(T(u).t, c.session.title)), 1)) : (g(), i("form", {
1648
- key: 0,
1649
- onSubmit: M(C, ["prevent"])
1650
- }, [A(a("input", {
1651
- "onUpdate:modelValue": t[0] ||= (e) => f.value = e,
1652
- class: "kvc-field",
1653
- "aria-label": T(u).t("kvcoder.ui.rename"),
1654
- "data-test": "rename-input",
1655
- onBlur: C
1656
- }, null, 40, Wn), [[D, f.value]])], 32)), a("span", Kn, w(y.value), 1)]),
1657
- 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, {
1658
1702
  "session-id": c.session.id,
1659
1703
  stamp: c.session.updatedAt
1660
1704
  }, null, 8, ["session-id", "stamp"]),
@@ -1663,14 +1707,14 @@ var Hn = { class: "kvc-header" }, Un = { class: "kvc-title" }, Wn = ["aria-label
1663
1707
  type: "button",
1664
1708
  class: "kvc-button",
1665
1709
  "aria-pressed": c.artifactsOpen,
1666
- "aria-label": b.value,
1667
- title: b.value,
1710
+ "aria-label": x.value,
1711
+ title: x.value,
1668
1712
  "data-test": "artifacts-toggle",
1669
1713
  onClick: t[1] ||= (e) => l("toggleArtifacts")
1670
1714
  }, [s(T(pe), {
1671
1715
  size: 16,
1672
1716
  "aria-hidden": "true"
1673
- }), o(w(c.artifacts), 1)], 8, qn)) : r("v-if", !0),
1717
+ }), o(w(c.artifacts), 1)], 8, Yn)) : r("v-if", !0),
1674
1718
  a("div", {
1675
1719
  ref_key: "more",
1676
1720
  ref: m,
@@ -1685,46 +1729,46 @@ var Hn = { class: "kvc-header" }, Un = { class: "kvc-title" }, Wn = ["aria-label
1685
1729
  onClick: t[2] ||= (e) => {
1686
1730
  d.value = !d.value, p.value = !1;
1687
1731
  }
1688
- }, [s(T(ce), { size: 18 })], 8, Jn),
1689
- d.value ? (g(), i("div", Yn, [
1732
+ }, [s(T(ce), { size: 18 })], 8, Xn),
1733
+ d.value ? (g(), i("div", Zn, [
1690
1734
  a("button", {
1691
1735
  type: "button",
1692
1736
  role: "menuitem",
1693
1737
  class: "kvc-button kvc-ghost",
1694
1738
  "data-test": "menu-rename",
1695
1739
  disabled: c.working,
1696
- onClick: t[3] ||= (e) => S(() => f.value = c.session.title)
1697
- }, 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),
1698
1742
  a("button", {
1699
1743
  type: "button",
1700
1744
  role: "menuitem",
1701
1745
  class: "kvc-button kvc-ghost",
1702
1746
  "data-test": "menu-fork",
1703
1747
  disabled: c.working,
1704
- onClick: t[4] ||= (e) => S(() => l("action", "fork", ""))
1705
- }, 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),
1706
1750
  a("button", {
1707
1751
  type: "button",
1708
1752
  role: "menuitem",
1709
1753
  class: "kvc-button kvc-ghost",
1710
1754
  "data-test": "menu-export",
1711
1755
  disabled: c.working,
1712
- onClick: t[5] ||= (e) => S(() => l("action", "export", ""))
1713
- }, 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),
1714
1758
  a("button", {
1715
1759
  type: "button",
1716
1760
  role: "menuitem",
1717
1761
  class: "kvc-button kvc-ghost",
1718
1762
  "data-test": "menu-compact",
1719
1763
  disabled: c.working,
1720
- onClick: t[6] ||= (e) => S(() => l("action", "compact", ""))
1721
- }, 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),
1722
1766
  a("button", {
1723
1767
  type: "button",
1724
1768
  role: "menuitem",
1725
1769
  class: "kvc-button kvc-ghost",
1726
1770
  "data-test": "menu-prompt",
1727
- 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"))
1728
1772
  }, w(T(u).t(c.tab === "prompt" ? "kvcoder.ui.showChat" : "kvcoder.ui.showPrompt")), 1),
1729
1773
  a("button", {
1730
1774
  type: "button",
@@ -1742,7 +1786,7 @@ var Hn = { class: "kvc-header" }, Un = { class: "kvc-title" }, Wn = ["aria-label
1742
1786
  role: "alertdialog",
1743
1787
  "aria-label": T(u).t("kvcoder.ui.deleteConfirm"),
1744
1788
  "data-test": "delete-confirm"
1745
- }, [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", {
1746
1790
  type: "button",
1747
1791
  class: "kvc-button",
1748
1792
  onClick: t[9] ||= (e) => p.value = !1
@@ -1750,25 +1794,25 @@ var Hn = { class: "kvc-header" }, Un = { class: "kvc-title" }, Wn = ["aria-label
1750
1794
  type: "button",
1751
1795
  class: "kvc-button kvc-primary",
1752
1796
  "data-test": "confirm-delete",
1753
- onClick: t[10] ||= (e) => S(() => l("action", "delete", ""))
1754
- }, 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)
1755
1799
  ], 512)
1756
1800
  ]));
1757
1801
  }
1758
- }), ir = 200, ar = [
1802
+ }), or = 200, sr = [
1759
1803
  "text",
1760
1804
  "choice",
1761
1805
  "confirm"
1762
1806
  ];
1763
- function or(e) {
1807
+ function cr(e) {
1764
1808
  return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
1765
1809
  }
1766
1810
  var Z = (e) => typeof e == "string" && e.trim() !== "" ? e : void 0;
1767
- function sr(e, t) {
1811
+ function lr(e, t) {
1768
1812
  let n = Z(t.args);
1769
1813
  return Z(t.line) ?? (n === void 0 ? e : `${e} ${n}`);
1770
1814
  }
1771
- function cr(e) {
1815
+ function ur(e) {
1772
1816
  let t = Z(e.title) ?? Z(e.description), n = Z(e.command);
1773
1817
  return {
1774
1818
  ...t === void 0 ? {} : { description: t },
@@ -1778,8 +1822,8 @@ function cr(e) {
1778
1822
  }
1779
1823
  function Q(e) {
1780
1824
  let t = Z(e.connector), n = Z(e.command);
1781
- if (t === void 0) return cr(e);
1782
- 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;
1783
1827
  return {
1784
1828
  ...r === void 0 ? {} : { description: r },
1785
1829
  ...n === void 0 ? {} : { label: `${t} · ${n}` },
@@ -1791,13 +1835,13 @@ function Q(e) {
1791
1835
  } }
1792
1836
  };
1793
1837
  }
1794
- function lr(e) {
1838
+ function dr(e) {
1795
1839
  let t = e.replace(/\s+/g, " ");
1796
- return t.length > ir ? `${t.slice(0, ir)}…` : t;
1840
+ return t.length > or ? `${t.slice(0, or)}…` : t;
1797
1841
  }
1798
1842
  //#endregion
1799
1843
  //#region web/src/live-step.ts
1800
- var ur = () => ({
1844
+ var fr = () => ({
1801
1845
  text: "",
1802
1846
  thinking: "",
1803
1847
  summarizing: !1,
@@ -1805,15 +1849,15 @@ var ur = () => ({
1805
1849
  retry: null,
1806
1850
  startedAt: Date.now()
1807
1851
  });
1808
- function dr(e) {
1852
+ function pr(e) {
1809
1853
  return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
1810
1854
  }
1811
- function fr(e) {
1855
+ function mr(e) {
1812
1856
  let t = e.calls.at(-1);
1813
1857
  return t === void 0 ? e.text === "" ? e.thinking === "" ? e.retry === null ? "waiting" : "retrying" : "thinking" : "writing" : t.complete ? "running" : "preparing";
1814
1858
  }
1815
- function pr(e, t, n) {
1816
- let r = dr(t.arguments);
1859
+ function hr(e, t, n) {
1860
+ let r = pr(t.arguments);
1817
1861
  (r === void 0 || e.calls.length === 0) && e.calls.push({
1818
1862
  name: n,
1819
1863
  complete: !1
@@ -1823,10 +1867,10 @@ function pr(e, t, n) {
1823
1867
  let a = Q(r);
1824
1868
  a.description !== void 0 && (i.description = a.description), a.label !== void 0 && (i.label = a.label), i.complete = "payload" in r;
1825
1869
  }
1826
- function mr(e, t) {
1870
+ function gr(e, t) {
1827
1871
  if (t.type !== "progress") return { kind: "none" };
1828
- let n = dr(t.data);
1829
- 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 = {
1830
1874
  attempt: n.attempt,
1831
1875
  of: n.of
1832
1876
  }), n.type === "follow" && typeof n.jobId == "string" ? {
@@ -1840,30 +1884,30 @@ function mr(e, t) {
1840
1884
  }
1841
1885
  //#endregion
1842
1886
  //#region web/src/ActivityLine.vue?vue&type=script&setup=true&lang.ts
1843
- var hr = ["data-phase"], gr = { class: "kvc-activity-text" }, _r = {
1887
+ var _r = ["data-phase"], vr = { class: "kvc-activity-text" }, yr = {
1844
1888
  style: { "font-weight": "600" },
1845
1889
  "data-test": "activity-title"
1846
- }, vr = {
1890
+ }, br = {
1847
1891
  key: 0,
1848
1892
  class: "kvc-muted",
1849
1893
  dir: "ltr",
1850
1894
  "data-test": "activity-label"
1851
- }, yr = {
1895
+ }, xr = {
1852
1896
  key: 1,
1853
1897
  style: { "font-weight": "500" },
1854
1898
  "data-test": "activity-title"
1855
- }, br = {
1899
+ }, Sr = {
1856
1900
  key: 0,
1857
1901
  class: "kvc-muted",
1858
1902
  "data-test": "activity-phase"
1859
- }, xr = {
1903
+ }, Cr = {
1860
1904
  class: "kvc-muted",
1861
1905
  "data-test": "activity-seconds"
1862
- }, Sr = /* @__PURE__ */ c({
1906
+ }, wr = /* @__PURE__ */ c({
1863
1907
  __name: "ActivityLine",
1864
1908
  props: { live: {} },
1865
1909
  setup(n) {
1866
- 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)));
1867
1911
  return (t, n) => (g(), i("div", {
1868
1912
  class: "kvc-activity",
1869
1913
  role: "status",
@@ -1875,14 +1919,14 @@ var hr = ["data-phase"], gr = { class: "kvc-activity-text" }, _r = {
1875
1919
  class: "kvc-spin",
1876
1920
  "aria-hidden": "true"
1877
1921
  }, null, -1),
1878
- 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", {
1879
1923
  key: t,
1880
1924
  class: "kvc-activity-call",
1881
1925
  "data-test": "activity-call"
1882
- }, [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))]),
1883
- o.live.calls.length > 0 ? (g(), i("span", br, w(T(s).t(`kvcoder.ui.activity.${l.value}`)), 1)) : r("v-if", !0),
1884
- a("span", xr, w(T(s).t("kvcoder.ui.seconds", { count: u.value })), 1)
1885
- ], 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));
1886
1930
  }
1887
1931
  });
1888
1932
  //#endregion
@@ -1890,24 +1934,24 @@ var hr = ["data-phase"], gr = { class: "kvc-activity-text" }, _r = {
1890
1934
  function $(e) {
1891
1935
  return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
1892
1936
  }
1893
- function Cr(e) {
1937
+ function Tr(e) {
1894
1938
  return Array.isArray(e) ? e.flatMap((e) => {
1895
1939
  let t = $(e);
1896
1940
  return t === void 0 ? [] : [t];
1897
1941
  }) : [];
1898
1942
  }
1899
- function wr(e) {
1900
- 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");
1901
1945
  }
1902
- function Tr(e) {
1903
- 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");
1904
1948
  }
1905
- function Er(e) {
1949
+ function Or(e) {
1906
1950
  let t = /* @__PURE__ */ new Map();
1907
1951
  for (let n of e) {
1908
1952
  if (n.kind !== "assistant") continue;
1909
1953
  let e = typeof n.durationMs == "number" ? { writtenMs: n.durationMs } : {};
1910
- for (let r of Cr(n.content.content)) {
1954
+ for (let r of Tr(n.content.content)) {
1911
1955
  let n = $(r.arguments);
1912
1956
  r.type === "toolCall" && typeof r.id == "string" && n !== void 0 && t.set(r.id, {
1913
1957
  ...Q(n),
@@ -1917,7 +1961,7 @@ function Er(e) {
1917
1961
  }
1918
1962
  return t;
1919
1963
  }
1920
- function Dr(e, t) {
1964
+ function kr(e, t) {
1921
1965
  let { description: n, connector: r, command: i } = e;
1922
1966
  return typeof r == "string" ? {
1923
1967
  ...t,
@@ -1929,41 +1973,41 @@ function Dr(e, t) {
1929
1973
  ...Q(e)
1930
1974
  };
1931
1975
  }
1932
- function Or(e, t) {
1933
- 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]);
1934
1978
  return {
1935
- ...n === void 0 ? a : Dr(n, a),
1936
- 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,
1937
1981
  failed: e.content.isError === !0 || o !== void 0 && o !== 0,
1938
1982
  ...typeof n?.durationMs == "number" ? { durationMs: n.durationMs } : {}
1939
1983
  };
1940
1984
  }
1941
- var kr = "dismissed by the user";
1942
- function Ar(e) {
1943
- if (e === kr) return { dismissed: !0 };
1985
+ var jr = "dismissed by the user";
1986
+ function Mr(e) {
1987
+ if (e === jr) return { dismissed: !0 };
1944
1988
  try {
1945
1989
  return $(JSON.parse(e));
1946
1990
  } catch {
1947
1991
  return;
1948
1992
  }
1949
1993
  }
1950
- function jr(e, t) {
1994
+ function Nr(e, t) {
1951
1995
  if (e.kind !== "toolResult" || e.content.isError === !0) return;
1952
1996
  let n = t.get(String(e.content.toolCallId))?.ask;
1953
1997
  if (n === void 0) return;
1954
- let r = Ar(wr(e.content.content));
1998
+ let r = Mr(Er(e.content.content));
1955
1999
  return r === void 0 ? void 0 : {
1956
2000
  ...n,
1957
2001
  answer: r
1958
2002
  };
1959
2003
  }
1960
- function Mr(e) {
2004
+ function Pr(e) {
1961
2005
  return e.kind === "user" && e.source?.kind === "extension" && e.source.name === "@kvman/kvcoder";
1962
2006
  }
1963
- function Nr(e) {
2007
+ function Fr(e) {
1964
2008
  return e.kind === "user" && (e.source?.kind === "job" || e.source?.kind === "subagent");
1965
2009
  }
1966
- function Pr(e) {
2010
+ function Ir(e) {
1967
2011
  if (e.kind !== "toolResult") return;
1968
2012
  let t = $(e.content.details);
1969
2013
  if (t === void 0) return;
@@ -1979,7 +2023,7 @@ function Pr(e) {
1979
2023
  }
1980
2024
  //#endregion
1981
2025
  //#region web/src/question-options.ts
1982
- function Fr(e) {
2026
+ function Lr(e) {
1983
2027
  return (Array.isArray(e.options) ? e.options : []).map((e) => {
1984
2028
  let t = Y(e);
1985
2029
  return {
@@ -1991,56 +2035,56 @@ function Fr(e) {
1991
2035
  }
1992
2036
  //#endregion
1993
2037
  //#region web/src/AnsweredCard.vue?vue&type=script&setup=true&lang.ts
1994
- var Ir = ["aria-label"], Lr = {
2038
+ var Rr = ["aria-label"], zr = {
1995
2039
  class: "kvc-card-row",
1996
2040
  style: { "font-weight": "600" }
1997
- }, Rr = {
2041
+ }, Br = {
1998
2042
  dir: "auto",
1999
2043
  "data-test": "answered-prompt"
2000
- }, zr = { class: "kvc-card-body" }, Br = {
2044
+ }, Vr = { class: "kvc-card-body" }, Hr = {
2001
2045
  key: 0,
2002
2046
  class: "kvc-muted",
2003
2047
  "data-test": "answered-skipped"
2004
- }, Vr = ["data-chosen", "data-test"], Hr = {
2048
+ }, Ur = ["data-chosen", "data-test"], Wr = {
2005
2049
  key: 1,
2006
2050
  class: "kvc-answered-gap",
2007
2051
  "aria-hidden": "true"
2008
- }, Ur = { style: {
2052
+ }, Gr = { style: {
2009
2053
  display: "flex",
2010
2054
  "flex-direction": "column"
2011
- } }, Wr = { dir: "auto" }, Gr = {
2055
+ } }, Kr = { dir: "auto" }, qr = {
2012
2056
  key: 0,
2013
2057
  class: "kvc-muted",
2014
2058
  dir: "auto"
2015
- }, Kr = {
2059
+ }, Jr = {
2016
2060
  key: 2,
2017
2061
  class: "kvc-sr"
2018
- }, qr = {
2062
+ }, Yr = {
2019
2063
  key: 0,
2020
2064
  class: "kvc-answered-option",
2021
2065
  "data-chosen": "true",
2022
2066
  "data-test": "answered-other"
2023
- }, Jr = { style: {
2067
+ }, Xr = { style: {
2024
2068
  display: "flex",
2025
2069
  "flex-direction": "column"
2026
- } }, Yr = { class: "kvc-muted" }, Xr = {
2070
+ } }, Zr = { class: "kvc-muted" }, Qr = {
2027
2071
  dir: "auto",
2028
2072
  style: { "white-space": "pre-wrap" }
2029
- }, Zr = {
2073
+ }, $r = {
2030
2074
  key: 2,
2031
2075
  class: "kvc-chip",
2032
2076
  style: { "align-self": "flex-start" },
2033
2077
  "data-test": "answered-confirmed"
2034
- }, Qr = {
2078
+ }, ei = {
2035
2079
  key: 3,
2036
2080
  dir: "auto",
2037
2081
  style: { "white-space": "pre-wrap" },
2038
2082
  "data-test": "answered-text"
2039
- }, $r = /* @__PURE__ */ c({
2083
+ }, ti = /* @__PURE__ */ c({
2040
2084
  __name: "AnsweredCard",
2041
2085
  props: { answered: {} },
2042
2086
  setup(o) {
2043
- 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) => ({
2044
2088
  ...e,
2045
2089
  chosen: f.value.includes(e.id)
2046
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 : "");
@@ -2048,34 +2092,34 @@ var Ir = ["aria-label"], Lr = {
2048
2092
  class: "kvc-card",
2049
2093
  "data-test": "answered-card",
2050
2094
  "aria-label": u.value
2051
- }, [a("div", Lr, [s(T(ie), {
2095
+ }, [a("div", zr, [s(T(ie), {
2052
2096
  size: 18,
2053
2097
  "aria-hidden": "true",
2054
2098
  class: "kvc-ok"
2055
- }), 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", {
2056
2100
  key: e.id,
2057
2101
  class: "kvc-answered-option",
2058
2102
  "data-chosen": e.chosen,
2059
2103
  "data-test": `answered-option-${e.id}`
2060
2104
  }, [
2061
- e.chosen ? (g(), n(T(K), {
2105
+ e.chosen ? (g(), n(T(q), {
2062
2106
  key: 0,
2063
2107
  size: 16,
2064
2108
  "aria-hidden": "true",
2065
2109
  class: "kvc-ok"
2066
- })) : (g(), i("span", Hr)),
2067
- a("span", Ur, [a("span", Wr, w(e.label), 1), e.description ? (g(), i("span", Gr, w(e.description), 1)) : r("v-if", !0)]),
2068
- e.chosen ? (g(), i("span", Kr, w(T(l).t("kvcoder.ui.chosen")), 1)) : r("v-if", !0)
2069
- ], 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), {
2070
2114
  size: 16,
2071
2115
  "aria-hidden": "true",
2072
2116
  class: "kvc-ok"
2073
- }), 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));
2074
2118
  }
2075
- }), ei = {
2119
+ }), ni = {
2076
2120
  class: "kvc-card kvc-card-row",
2077
2121
  "data-test": "artifact-card"
2078
- }, ti = {
2122
+ }, ri = {
2079
2123
  style: {
2080
2124
  flex: "1 1 auto",
2081
2125
  "min-inline-size": "0",
@@ -2084,13 +2128,13 @@ var Ir = ["aria-label"], Lr = {
2084
2128
  "white-space": "nowrap"
2085
2129
  },
2086
2130
  "data-test": "artifact-card-title"
2087
- }, ni = {
2131
+ }, ii = {
2088
2132
  class: "kvc-chip",
2089
2133
  "data-test": "artifact-card-format"
2090
- }, ri = {
2134
+ }, ai = {
2091
2135
  class: "kvc-muted",
2092
2136
  "data-test": "artifact-card-version"
2093
- }, ii = /* @__PURE__ */ c({
2137
+ }, oi = /* @__PURE__ */ c({
2094
2138
  __name: "ArtifactCard",
2095
2139
  props: {
2096
2140
  id: {},
@@ -2101,14 +2145,14 @@ var Ir = ["aria-label"], Lr = {
2101
2145
  emits: ["open"],
2102
2146
  setup(e, { emit: t }) {
2103
2147
  let n = e, r = t, o = J();
2104
- return (e, t) => (g(), i("div", ei, [
2148
+ return (e, t) => (g(), i("div", ni, [
2105
2149
  s(T(pe), {
2106
2150
  size: 16,
2107
2151
  "aria-hidden": "true"
2108
2152
  }),
2109
- a("span", ti, w(n.title), 1),
2110
- a("span", ni, w(T(o).t(`kvcoder.ui.artifacts.format.${n.format}`)), 1),
2111
- 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),
2112
2156
  a("button", {
2113
2157
  type: "button",
2114
2158
  class: "kvc-button",
@@ -2120,7 +2164,7 @@ var Ir = ["aria-label"], Lr = {
2120
2164
  });
2121
2165
  //#endregion
2122
2166
  //#region web/src/durations.ts
2123
- function ai(e, t) {
2167
+ function si(e, t) {
2124
2168
  if (t < 1e3) return e("kvcoder.ui.milliseconds", { count: Math.round(t) });
2125
2169
  if (t < 1e4) return e("kvcoder.ui.seconds", { count: (t / 1e3).toFixed(1) });
2126
2170
  let n = Math.round(t / 1e3);
@@ -2131,11 +2175,11 @@ function ai(e, t) {
2131
2175
  }
2132
2176
  //#endregion
2133
2177
  //#region web/src/output-links.ts
2134
- var oi = /http:\/\/(?:127\.0\.0\.1|localhost):\d+[^\s"'`<>()[\]{}]*/g, si = /[.,;:!?]+$/;
2135
- function ci(e) {
2178
+ var ci = /http:\/\/(?:127\.0\.0\.1|localhost):\d+[^\s"'`<>()[\]{}]*/g, li = /[.,;:!?]+$/;
2179
+ function ui(e) {
2136
2180
  let t = [], n = 0;
2137
- for (let r of e.matchAll(oi)) {
2138
- let i = r[0].replace(si, "");
2181
+ for (let r of e.matchAll(ci)) {
2182
+ let i = r[0].replace(li, "");
2139
2183
  r.index > n && t.push({
2140
2184
  kind: "text",
2141
2185
  text: e.slice(n, r.index)
@@ -2149,38 +2193,47 @@ function ci(e) {
2149
2193
  text: e.slice(n)
2150
2194
  }), t;
2151
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
+ }
2152
2205
  //#endregion
2153
2206
  //#region web/src/CallCard.vue?vue&type=script&setup=true&lang.ts
2154
- 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 = {
2155
2208
  key: 0,
2156
2209
  style: { "font-weight": "600" },
2157
2210
  "data-test": "call-description"
2158
- }, pi = {
2211
+ }, gi = {
2159
2212
  key: 1,
2160
2213
  class: "kvc-oneline",
2161
2214
  "data-test": "call-line"
2162
- }, mi = { class: "kvc-mono" }, hi = {
2215
+ }, _i = { class: "kvc-mono" }, vi = {
2163
2216
  key: 2,
2164
2217
  class: "kvc-muted",
2165
2218
  dir: "ltr",
2166
2219
  style: { "align-self": "flex-start" },
2167
2220
  "data-test": "call-label"
2168
- }, gi = {
2221
+ }, yi = {
2169
2222
  key: 2,
2170
2223
  class: "kvc-chip",
2171
2224
  "data-test": "call-background"
2172
- }, _i = {
2225
+ }, bi = {
2173
2226
  key: 3,
2174
2227
  class: "kvc-chip kvc-danger",
2175
2228
  "data-test": "call-failed"
2176
- }, vi = {
2229
+ }, xi = {
2177
2230
  class: "kvc-muted",
2178
2231
  "data-test": "call-time"
2179
- }, yi = {
2232
+ }, Si = {
2180
2233
  key: 0,
2181
2234
  class: "kvc-muted kvc-call-parts",
2182
2235
  "data-test": "call-parts"
2183
- }, bi = ["aria-label"], xi = ["aria-label"], Si = ["href"], Ci = /* @__PURE__ */ c({
2236
+ }, Ci = ["aria-label"], wi = ["aria-label"], Ti = ["href"], Ei = /* @__PURE__ */ c({
2184
2237
  __name: "CallCard",
2185
2238
  props: {
2186
2239
  description: {},
@@ -2195,11 +2248,11 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
2195
2248
  background: { type: Boolean }
2196
2249
  },
2197
2250
  setup(s) {
2198
- 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(() => {
2199
2252
  if (c.durationMs === void 0) return "";
2200
- let e = ai(l.t, c.durationMs);
2253
+ let e = si(l.t, c.durationMs);
2201
2254
  return c.writtenMs === void 0 ? l.t("kvcoder.ui.callRan", { ran: e }) : l.t("kvcoder.ui.callParts", {
2202
- written: ai(l.t, c.writtenMs),
2255
+ written: si(l.t, c.writtenMs),
2203
2256
  ran: e
2204
2257
  });
2205
2258
  }), h = t(() => c.line ?? c.payload);
@@ -2221,24 +2274,24 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
2221
2274
  key: 0,
2222
2275
  class: "kvc-spin",
2223
2276
  "aria-label": T(l).t("kvcoder.ui.running")
2224
- }, 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)), {
2225
2278
  key: 1,
2226
2279
  size: 16,
2227
2280
  "aria-hidden": "true"
2228
2281
  })),
2229
- 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)]),
2230
- c.background ? (g(), i("span", gi, w(T(l).t("kvcoder.ui.jobs.background")), 1)) : r("v-if", !0),
2231
- c.failed ? (g(), i("span", _i, w(T(l).t("kvcoder.ui.callFailed")), 1)) : r("v-if", !0),
2232
- a("span", vi, w(p.value), 1)
2233
- ], 8, li), u.value && c.output !== void 0 ? (g(), i(e, { key: 0 }, [
2234
- 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)),
2235
2288
  h.value === void 0 ? r("v-if", !0) : (g(), i("pre", {
2236
2289
  key: 1,
2237
2290
  class: "kvc-output kvc-mono",
2238
2291
  dir: "ltr",
2239
2292
  "aria-label": T(l).t("kvcoder.ui.command"),
2240
2293
  "data-test": "call-payload"
2241
- }, w(h.value), 9, bi)),
2294
+ }, w(h.value), 9, Ci)),
2242
2295
  c.output === "" ? r("v-if", !0) : (g(), i("pre", {
2243
2296
  key: 2,
2244
2297
  class: "kvc-output",
@@ -2251,53 +2304,53 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
2251
2304
  target: "_blank",
2252
2305
  rel: "noopener noreferrer",
2253
2306
  class: "kvc-link"
2254
- }, 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))
2255
2308
  ], 64)) : r("v-if", !0)], 2));
2256
2309
  }
2257
- }), wi = {
2310
+ }), Di = {
2258
2311
  key: 0,
2259
2312
  class: "kvc-card",
2260
2313
  "data-test": "background-result"
2261
- }, Ti = { class: "kvc-card-row" }, Ei = { class: "kvc-output" }, Di = {
2314
+ }, Oi = { class: "kvc-card-row" }, ki = { class: "kvc-output" }, Ai = {
2262
2315
  key: 1,
2263
2316
  class: "kvc-card",
2264
2317
  "data-test": "kvcoder-hint"
2265
- }, 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 = {
2266
2319
  key: 0,
2267
2320
  style: {
2268
2321
  display: "flex",
2269
2322
  gap: "6px",
2270
2323
  "margin-block-start": "6px"
2271
2324
  }
2272
- }, ji = ["src", "alt"], Mi = {
2325
+ }, Pi = ["src", "alt"], Fi = {
2273
2326
  key: 1,
2274
2327
  class: "kvc-muted",
2275
2328
  style: { display: "block" },
2276
2329
  "data-test": "queued"
2277
- }, Ni = {
2330
+ }, Ii = {
2278
2331
  key: 3,
2279
2332
  class: "kvc-answer",
2280
2333
  "data-test": "assistant-message"
2281
- }, Pi = {
2334
+ }, Li = {
2282
2335
  key: 0,
2283
2336
  "data-test": "thinking"
2284
- }, Fi = { class: "kvc-muted" }, Ii = {
2337
+ }, Ri = { class: "kvc-muted" }, zi = {
2285
2338
  class: "kvc-muted",
2286
2339
  style: { "white-space": "pre-wrap" }
2287
- }, Li = {
2340
+ }, Bi = {
2288
2341
  key: 7,
2289
2342
  class: "kvc-notice",
2290
2343
  "data-test": "notice"
2291
- }, Ri = {
2344
+ }, Vi = {
2292
2345
  key: 8,
2293
2346
  class: "kvc-card kvc-card-row",
2294
2347
  role: "note",
2295
2348
  "data-test": "note"
2296
- }, zi = {
2349
+ }, Hi = {
2297
2350
  key: 9,
2298
2351
  class: "kvc-card",
2299
2352
  "data-test": "summary"
2300
- }, 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({
2301
2354
  __name: "MessageItem",
2302
2355
  props: {
2303
2356
  message: {},
@@ -2305,7 +2358,7 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
2305
2358
  },
2306
2359
  emits: ["openArtifact"],
2307
2360
  setup(c, { emit: l }) {
2308
- 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(() => {
2309
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);
2310
2363
  return p.t(`kvcoder.notices.${i === void 0 || a !== "STEP_FAILED" ? a : "STEP_FAILED_REASON"}`, {
2311
2364
  ...e,
@@ -2320,20 +2373,20 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
2320
2373
  text: "kvcoder.markdown",
2321
2374
  params: { text: e }
2322
2375
  });
2323
- 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), {
2324
2377
  size: 16,
2325
2378
  "aria-hidden": "true"
2326
- }), o(w(T(p).t(u.message.source?.kind === "subagent" ? "kvcoder.ui.helperFinished" : "kvcoder.ui.backgroundFinished")), 1)]), a("pre", Ei, w(m.value), 1)])])) : T(Mr)(u.message) ? (g(), i("div", Di, [a("details", null, [a("summary", Oi, [s(T(de), {
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), {
2327
2380
  size: 16,
2328
2381
  "aria-hidden": "true"
2329
- }), 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", {
2330
2383
  key: 2,
2331
2384
  dir: "auto",
2332
2385
  class: f(["kvc-user", { "kvc-queued": u.message.queued }]),
2333
2386
  "data-test": "user-message"
2334
2387
  }, [
2335
2388
  a("span", null, w(m.value), 1),
2336
- 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", {
2337
2390
  key: e,
2338
2391
  src: E(e),
2339
2392
  alt: T(p).t("kvcoder.ui.attachment"),
@@ -2341,12 +2394,12 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
2341
2394
  "block-size": "48px",
2342
2395
  "border-radius": "6px"
2343
2396
  }
2344
- }, null, 8, ji))), 128))])) : r("v-if", !0),
2345
- u.message.queued ? (g(), i("span", Mi, w(T(p).t("kvcoder.ui.queued")), 1)) : r("v-if", !0)
2346
- ], 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), {
2347
2400
  key: 1,
2348
2401
  view: D(m.value)
2349
- }, 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, {
2350
2403
  key: 4,
2351
2404
  id: v.value.id,
2352
2405
  title: v.value.title,
@@ -2358,7 +2411,7 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
2358
2411
  "title",
2359
2412
  "format",
2360
2413
  "version"
2361
- ])) : b.value === void 0 ? u.message.kind === "toolResult" ? (g(), n(Ci, {
2414
+ ])) : b.value === void 0 ? u.message.kind === "toolResult" ? (g(), n(Ei, {
2362
2415
  key: 6,
2363
2416
  description: _.value.description,
2364
2417
  label: _.value.label,
@@ -2379,54 +2432,54 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
2379
2432
  "written-ms",
2380
2433
  "output",
2381
2434
  "background"
2382
- ])) : 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), {
2383
2436
  size: 18,
2384
2437
  "aria-hidden": "true"
2385
- }), 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), {
2386
2439
  size: 16,
2387
2440
  "aria-hidden": "true"
2388
- }), 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, {
2389
2442
  key: 5,
2390
2443
  answered: b.value
2391
2444
  }, null, 8, ["answered"]));
2392
2445
  }
2393
- }), Ui = {
2446
+ }), Ki = {
2394
2447
  class: "kvc-card kvc-ask",
2395
2448
  "data-test": "approvals-card"
2396
- }, Wi = {
2449
+ }, qi = {
2397
2450
  class: "kvc-card-row",
2398
2451
  style: { "font-weight": "600" }
2399
- }, Gi = ["data-test"], Ki = { style: {
2452
+ }, Ji = ["data-test"], Yi = { style: {
2400
2453
  display: "flex",
2401
2454
  "flex-direction": "column",
2402
2455
  flex: "1 1 auto",
2403
2456
  gap: "2px",
2404
2457
  "min-inline-size": "0"
2405
- } }, qi = {
2458
+ } }, Xi = {
2406
2459
  key: 0,
2407
2460
  style: { "font-weight": "600" },
2408
2461
  "data-test": "call-description"
2409
- }, Ji = {
2462
+ }, Zi = {
2410
2463
  key: 1,
2411
2464
  class: "kvc-muted",
2412
2465
  dir: "ltr",
2413
2466
  style: { "align-self": "flex-start" },
2414
2467
  "data-test": "call-label"
2415
- }, Yi = {
2468
+ }, Qi = {
2416
2469
  key: 2,
2417
2470
  dir: "ltr",
2418
2471
  style: { "align-self": "flex-start" },
2419
2472
  "data-test": "call-subject"
2420
- }, Xi = {
2473
+ }, $i = {
2421
2474
  key: 3,
2422
2475
  class: "kvc-chip",
2423
2476
  style: { "align-self": "flex-start" },
2424
2477
  "data-test": "call-background"
2425
- }, Zi = ["onClick"], Qi = ["onClick"], $i = {
2478
+ }, ea = ["onClick"], ta = ["onClick"], na = {
2426
2479
  key: 0,
2427
2480
  class: "kvc-card-row kvc-actions",
2428
2481
  style: { "border-block-start": "1px solid var(--kv-color-border)" }
2429
- }, ea = /* @__PURE__ */ c({
2482
+ }, ra = /* @__PURE__ */ c({
2430
2483
  __name: "ApprovalsCard",
2431
2484
  props: { approvals: {} },
2432
2485
  emits: ["decide"],
@@ -2435,8 +2488,8 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
2435
2488
  approvals: [...e],
2436
2489
  confirmed: t
2437
2490
  });
2438
- return (t, n) => (g(), i("section", Ui, [
2439
- a("div", Wi, [s(T(ve), {
2491
+ return (t, n) => (g(), i("section", Ki, [
2492
+ a("div", qi, [s(T(ve), {
2440
2493
  size: 18,
2441
2494
  "aria-hidden": "true"
2442
2495
  }), o(w(T(u).t("kvcoder.ui.allowCommands", { count: c.approvals.length })), 1)]),
@@ -2446,26 +2499,26 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
2446
2499
  style: { "border-block-start": "1px solid var(--kv-color-border)" },
2447
2500
  "data-test": `approval-${e.questionId}`
2448
2501
  }, [
2449
- a("span", Ki, [
2450
- e.description ? (g(), i("span", qi, w(e.description), 1)) : r("v-if", !0),
2451
- e.label ? (g(), i("span", Ji, w(e.label), 1)) : r("v-if", !0),
2452
- e.subject ? (g(), i("span", Yi, [a("span", { class: f(["kvc-mono", { "kvc-muted": e.description }]) }, w(e.subject), 3)])) : r("v-if", !0),
2453
- 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)
2454
2507
  ]),
2455
2508
  a("button", {
2456
2509
  type: "button",
2457
2510
  class: "kvc-button",
2458
2511
  "data-test": "deny",
2459
2512
  onClick: (t) => d([e], !1)
2460
- }, w(T(u).t("kvcoder.ui.deny")), 9, Zi),
2513
+ }, w(T(u).t("kvcoder.ui.deny")), 9, ea),
2461
2514
  a("button", {
2462
2515
  type: "button",
2463
2516
  class: "kvc-button kvc-primary",
2464
2517
  "data-test": "allow",
2465
2518
  onClick: (t) => d([e], !0)
2466
- }, w(T(u).t("kvcoder.ui.allow")), 9, Qi)
2467
- ], 8, Gi))), 128)),
2468
- 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", {
2469
2522
  type: "button",
2470
2523
  class: "kvc-button",
2471
2524
  "data-test": "deny-all",
@@ -2478,24 +2531,24 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
2478
2531
  }, w(T(u).t("kvcoder.ui.allowAll")), 1)])) : r("v-if", !0)
2479
2532
  ]));
2480
2533
  }
2481
- }), ta = ["aria-label"], na = {
2534
+ }), ia = ["aria-label"], aa = {
2482
2535
  class: "kvc-card-row",
2483
2536
  style: { "font-weight": "600" }
2484
- }, 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 = [
2485
2538
  "type",
2486
2539
  "checked",
2487
2540
  "name",
2488
2541
  "onChange"
2489
- ], la = { style: {
2542
+ ], fa = { style: {
2490
2543
  display: "flex",
2491
2544
  "flex-direction": "column"
2492
- } }, ua = { style: { "font-weight": "500" } }, da = {
2545
+ } }, pa = { style: { "font-weight": "500" } }, ma = {
2493
2546
  key: 0,
2494
2547
  class: "kvc-muted"
2495
- }, fa = ["placeholder", "aria-label"], pa = { class: "kvc-actions" }, ma = ["disabled"], ha = {
2548
+ }, ha = ["placeholder", "aria-label"], ga = { class: "kvc-actions" }, _a = ["disabled"], va = {
2496
2549
  key: 2,
2497
2550
  class: "kvc-actions"
2498
- }, ga = /* @__PURE__ */ c({
2551
+ }, ya = /* @__PURE__ */ c({
2499
2552
  __name: "QuestionCard",
2500
2553
  props: {
2501
2554
  questionId: {},
@@ -2503,7 +2556,7 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
2503
2556
  },
2504
2557
  emits: ["answer"],
2505
2558
  setup(n, { emit: o }) {
2506
- 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("");
2507
2560
  function C(e) {
2508
2561
  l("answer", {
2509
2562
  questionId: c.questionId,
@@ -2524,10 +2577,10 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
2524
2577
  class: "kvc-card kvc-ask",
2525
2578
  "data-test": "question-card",
2526
2579
  "aria-label": p.value
2527
- }, [a("div", na, [s(T(ae), {
2580
+ }, [a("div", aa, [s(T(ae), {
2528
2581
  size: 18,
2529
2582
  "aria-hidden": "true"
2530
- }), 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", {
2531
2584
  "onUpdate:modelValue": n[0] ||= (e) => b.value = e,
2532
2585
  class: "kvc-field",
2533
2586
  dir: "auto",
@@ -2535,7 +2588,7 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
2535
2588
  "aria-label": p.value,
2536
2589
  "data-test": "answer-text",
2537
2590
  onKeydown: n[1] ||= j(M((e) => C({ text: b.value }), ["prevent"]), ["enter"])
2538
- }, null, 40, aa), [[D, b.value]]), a("div", oa, [a("button", {
2591
+ }, null, 40, ca), [[D, b.value]]), a("div", la, [a("button", {
2539
2592
  type: "button",
2540
2593
  class: "kvc-button",
2541
2594
  "data-test": "skip",
@@ -2555,7 +2608,7 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
2555
2608
  checked: x.value.includes(e.id),
2556
2609
  name: c.questionId,
2557
2610
  onChange: (t) => E(e.id)
2558
- }, 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)),
2559
2612
  _.value ? A((g(), i("input", {
2560
2613
  key: 0,
2561
2614
  "onUpdate:modelValue": n[4] ||= (e) => S.value = e,
@@ -2563,8 +2616,8 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
2563
2616
  placeholder: T(u).t("kvcoder.ui.other"),
2564
2617
  "aria-label": T(u).t("kvcoder.ui.other"),
2565
2618
  "data-test": "answer-other"
2566
- }, null, 8, fa)), [[D, S.value]]) : r("v-if", !0),
2567
- a("div", pa, [a("button", {
2619
+ }, null, 8, ha)), [[D, S.value]]) : r("v-if", !0),
2620
+ a("div", ga, [a("button", {
2568
2621
  type: "button",
2569
2622
  class: "kvc-button",
2570
2623
  "data-test": "skip",
@@ -2575,8 +2628,8 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
2575
2628
  disabled: x.value.length === 0 && S.value.trim() === "",
2576
2629
  "data-test": "answer",
2577
2630
  onClick: O
2578
- }, w(T(u).t("kvcoder.ui.answer")), 9, ma)])
2579
- ], 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", {
2580
2633
  type: "button",
2581
2634
  class: "kvc-button",
2582
2635
  "data-test": "answer-no",
@@ -2586,9 +2639,9 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
2586
2639
  class: f(["kvc-button kvc-primary", { "kvc-danger": c.question.danger === !0 }]),
2587
2640
  "data-test": "answer-yes",
2588
2641
  onClick: n[7] ||= (e) => C({ confirmed: !0 })
2589
- }, w(T(u).t("kvcoder.ui.yes")), 3)]))])], 8, ta));
2642
+ }, w(T(u).t("kvcoder.ui.yes")), 3)]))])], 8, ia));
2590
2643
  }
2591
- }), _a = /* @__PURE__ */ c({
2644
+ }), ba = /* @__PURE__ */ c({
2592
2645
  __name: "PendingCards",
2593
2646
  props: {
2594
2647
  pending: {},
@@ -2602,7 +2655,7 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
2602
2655
  })));
2603
2656
  function d(e) {
2604
2657
  let t = Q(e), n = Y(e.payload);
2605
- 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;
2606
2659
  }
2607
2660
  let f = t(() => s.pending.filter((e) => e.kind === "approval" && l(e)).map((e) => {
2608
2661
  let t = Y(e.question), n = Q(t), r = d(t);
@@ -2614,12 +2667,12 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
2614
2667
  ...n.background === !0 ? { background: !0 } : {}
2615
2668
  };
2616
2669
  }));
2617
- 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, {
2618
2671
  key: e.questionId,
2619
2672
  "question-id": e.questionId,
2620
2673
  question: e.question,
2621
2674
  onAnswer: a[0] ||= (e) => c("answer", e)
2622
- }, 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, {
2623
2676
  key: 0,
2624
2677
  approvals: f.value,
2625
2678
  onDecide: a[1] ||= (e) => c("decide", e)
@@ -2628,12 +2681,12 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
2628
2681
  });
2629
2682
  //#endregion
2630
2683
  //#region web/src/use-model-groups.ts
2631
- function va(e, t, n) {
2684
+ function xa(e, t, n) {
2632
2685
  let r = v([]);
2633
2686
  return m(async () => {
2634
2687
  try {
2635
2688
  let [n, i] = await Promise.all([e.exec("kvai.provider.list", {}), e.exec("kvai.model.list", {})]);
2636
- r.value = Rt(n, i, t());
2689
+ r.value = zt(n, i, t());
2637
2690
  } catch (e) {
2638
2691
  n(e);
2639
2692
  }
@@ -2641,15 +2694,15 @@ function va(e, t, n) {
2641
2694
  }
2642
2695
  //#endregion
2643
2696
  //#region web/src/RecoveryActions.vue?vue&type=script&setup=true&lang.ts
2644
- var ya = {
2697
+ var Sa = {
2645
2698
  class: "kvc-recovery",
2646
2699
  "data-test": "recovery"
2647
- }, ba = { class: "kvc-recovery-picker" }, xa = /* @__PURE__ */ c({
2700
+ }, Ca = { class: "kvc-recovery-picker" }, wa = /* @__PURE__ */ c({
2648
2701
  __name: "RecoveryActions",
2649
2702
  props: { sessionId: {} },
2650
2703
  emits: ["sent"],
2651
2704
  setup(e, { emit: t }) {
2652
- 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));
2653
2706
  async function u() {
2654
2707
  await c.exec("kvcoder.message.send", {
2655
2708
  sessionId: n.sessionId,
@@ -2667,9 +2720,9 @@ var ya = {
2667
2720
  await c.exec("kvcoder.session.configure", {
2668
2721
  sessionId: n.sessionId,
2669
2722
  model: e
2670
- }), await sn(c, e), await u();
2723
+ }), await cn(c, e), await u();
2671
2724
  });
2672
- return (e, t) => (g(), i("div", ya, [a("button", {
2725
+ return (e, t) => (g(), i("div", Sa, [a("button", {
2673
2726
  type: "button",
2674
2727
  class: "kvc-button",
2675
2728
  "data-test": "retry",
@@ -2677,34 +2730,34 @@ var ya = {
2677
2730
  }, [s(T(he), {
2678
2731
  size: 14,
2679
2732
  "aria-hidden": "true"
2680
- }), 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, {
2681
2734
  groups: T(l),
2682
2735
  current: null,
2683
2736
  empty: T(c).t("kvcoder.ui.chooseAnotherModel"),
2684
2737
  onPick: p
2685
2738
  }, null, 8, ["groups", "empty"])])]));
2686
2739
  }
2687
- }), Sa = {
2740
+ }), Ta = {
2688
2741
  class: "kvc-column",
2689
2742
  "data-test": "prompt-tab"
2690
- }, Ca = { style: {
2743
+ }, Ea = { style: {
2691
2744
  display: "flex",
2692
2745
  "align-items": "center",
2693
2746
  gap: "10px"
2694
- } }, wa = { style: { flex: "1 1 auto" } }, Ta = {
2747
+ } }, Da = { style: { flex: "1 1 auto" } }, Oa = {
2695
2748
  key: 0,
2696
2749
  style: {
2697
2750
  margin: "0",
2698
2751
  "padding-inline-start": "20px"
2699
2752
  }
2700
- }, Ea = {
2753
+ }, ka = {
2701
2754
  key: 0,
2702
2755
  class: "kvc-chip kvc-warn"
2703
- }, Da = {
2756
+ }, Aa = {
2704
2757
  key: 1,
2705
2758
  class: "kvc-prompt",
2706
2759
  "data-test": "prompt-text"
2707
- }, Oa = /* @__PURE__ */ c({
2760
+ }, ja = /* @__PURE__ */ c({
2708
2761
  __name: "PromptTab",
2709
2762
  props: { sessionId: {} },
2710
2763
  emits: ["back"],
@@ -2720,8 +2773,8 @@ var ya = {
2720
2773
  async function f() {
2721
2774
  d.value !== null && (await navigator.clipboard.writeText(d.value.prompt), u.toast("kvcoder.ui.copied", {}, "success"));
2722
2775
  }
2723
- return (t, n) => (g(), i("div", Sa, [
2724
- a("div", Ca, [
2776
+ return (t, n) => (g(), i("div", Ta, [
2777
+ a("div", Ea, [
2725
2778
  a("button", {
2726
2779
  type: "button",
2727
2780
  class: "kvc-button",
@@ -2732,7 +2785,7 @@ var ya = {
2732
2785
  class: "kvc-flip",
2733
2786
  "aria-hidden": "true"
2734
2787
  }), o(w(T(u).t("kvcoder.ui.showChat")), 1)]),
2735
- a("strong", wa, w(T(u).t("kvcoder.ui.promptTitle")), 1),
2788
+ a("strong", Da, w(T(u).t("kvcoder.ui.promptTitle")), 1),
2736
2789
  a("button", {
2737
2790
  type: "button",
2738
2791
  class: "kvc-button",
@@ -2740,7 +2793,7 @@ var ya = {
2740
2793
  onClick: f
2741
2794
  }, [s(T(se), { size: 16 }), o(w(T(u).t("kvcoder.ui.copy")), 1)])
2742
2795
  ]),
2743
- 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", {
2744
2797
  key: `${e.owner}/${e.id}`,
2745
2798
  class: "kvc-muted",
2746
2799
  "data-test": "prompt-section"
@@ -2749,14 +2802,14 @@ var ya = {
2749
2802
  owner: e.owner,
2750
2803
  reach: T(u).t(`kvcoder.ui.reach.${e.reach}`),
2751
2804
  size: e.size
2752
- })) + " ", 1), e.included ? r("v-if", !0) : (g(), i("span", Ea, w(T(u).t("kvcoder.ui.leftOut")), 1))]))), 128))])) : r("v-if", !0),
2753
- 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)
2754
2807
  ]));
2755
2808
  }
2756
2809
  });
2757
2810
  //#endregion
2758
2811
  //#region web/src/use-session-actions.ts
2759
- function ka(e, t, n) {
2812
+ function Ma(e, t, n) {
2760
2813
  let r = C();
2761
2814
  async function i(t) {
2762
2815
  try {
@@ -2789,7 +2842,7 @@ function ka(e, t, n) {
2789
2842
  await e.exec("kvcoder.session.configure", {
2790
2843
  sessionId: t(),
2791
2844
  ...n
2792
- }), n.model !== void 0 && await sn(e, n.model);
2845
+ }), n.model !== void 0 && await cn(e, n.model);
2793
2846
  }),
2794
2847
  rename: (n) => a("rename", async () => {
2795
2848
  n.trim() !== "" && await e.exec("kvcoder.session.rename", {
@@ -2819,13 +2872,13 @@ function ka(e, t, n) {
2819
2872
  }
2820
2873
  //#endregion
2821
2874
  //#region web/src/SessionModel.vue
2822
- var Aa = /* @__PURE__ */ c({
2875
+ var Na = /* @__PURE__ */ c({
2823
2876
  __name: "SessionModel",
2824
2877
  props: { session: {} },
2825
2878
  emits: ["changed"],
2826
2879
  setup(e, { emit: t }) {
2827
- 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"));
2828
- 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, {
2829
2882
  groups: T(o),
2830
2883
  model: r.session.model ?? null,
2831
2884
  thinking: r.session.thinking,
@@ -2837,27 +2890,27 @@ var Aa = /* @__PURE__ */ c({
2837
2890
  "thinking"
2838
2891
  ]));
2839
2892
  }
2840
- }), ja = ["aria-label"], Ma = { class: "kvc-card-row" }, Na = {
2893
+ }), Pa = ["aria-label"], Fa = { class: "kvc-card-row" }, Ia = {
2841
2894
  key: 0,
2842
2895
  class: "kvc-chip kvc-mono",
2843
2896
  "data-test": "subagent-worker"
2844
- }, Pa = { style: {
2897
+ }, La = { style: {
2845
2898
  flex: "1 1 auto",
2846
2899
  "font-weight": "500"
2847
- } }, Fa = {
2900
+ } }, Ra = {
2848
2901
  key: 1,
2849
2902
  class: "kvc-spin"
2850
- }, Ia = {
2903
+ }, za = {
2851
2904
  key: 0,
2852
2905
  class: "kvc-card-body"
2853
- }, La = {
2906
+ }, Ba = {
2854
2907
  key: 0,
2855
2908
  class: "kvc-muted",
2856
2909
  style: {
2857
2910
  margin: "0",
2858
2911
  "white-space": "pre-wrap"
2859
2912
  }
2860
- }, Ra = /* @__PURE__ */ c({
2913
+ }, Va = /* @__PURE__ */ c({
2861
2914
  __name: "SubagentCard",
2862
2915
  props: {
2863
2916
  child: {},
@@ -2870,36 +2923,36 @@ var Aa = /* @__PURE__ */ c({
2870
2923
  class: "kvc-card",
2871
2924
  "data-test": "subagent-card",
2872
2925
  "aria-label": T(Pe)(T(l).t, o.child.session.title)
2873
- }, [a("div", Ma, [
2874
- s(T(ne), {
2926
+ }, [a("div", Fa, [
2927
+ s(T(te), {
2875
2928
  size: 18,
2876
2929
  "aria-hidden": "true"
2877
2930
  }),
2878
- o.child.session.worker === void 0 ? r("v-if", !0) : (g(), i("span", Na, w(o.child.session.worker), 1)),
2879
- a("span", Pa, w(T(Pe)(T(l).t, o.child.session.title)), 1),
2880
- 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),
2881
2934
  a("span", { class: f(["kvc-chip", { "kvc-warn": o.child.session.status === "waiting" }]) }, w(u.value), 3)
2882
- ]), 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, {
2883
2936
  pending: o.child.turn?.pending ?? [],
2884
2937
  hidden: o.hidden,
2885
2938
  onAnswer: t[0] ||= (e) => c("answer", e),
2886
2939
  onDecide: t[1] ||= (e) => c("decide", e)
2887
- }, null, 8, ["pending", "hidden"])])) : r("v-if", !0)], 8, ja));
2940
+ }, null, 8, ["pending", "hidden"])])) : r("v-if", !0)], 8, Pa));
2888
2941
  }
2889
- }), za = ["aria-label"], Ba = { class: "kvc-card-row" }, Va = {
2942
+ }), Ha = ["aria-label"], Ua = { class: "kvc-card-row" }, Wa = {
2890
2943
  class: "kvc-chip kvc-mono",
2891
2944
  "data-test": "worker-card-name"
2892
- }, Ha = {
2945
+ }, Ga = {
2893
2946
  style: {
2894
2947
  flex: "1 1 auto",
2895
2948
  "font-weight": "500"
2896
2949
  },
2897
2950
  dir: "auto",
2898
2951
  "data-test": "worker-card-call"
2899
- }, Ua = {
2952
+ }, Ka = {
2900
2953
  class: "kvc-chip",
2901
2954
  "data-test": "worker-card-time"
2902
- }, Wa = ["disabled"], Ga = /* @__PURE__ */ c({
2955
+ }, qa = ["disabled"], Ja = /* @__PURE__ */ c({
2903
2956
  __name: "WorkerCard",
2904
2957
  props: {
2905
2958
  sessionId: {},
@@ -2935,25 +2988,25 @@ var Aa = /* @__PURE__ */ c({
2935
2988
  class: "kvc-card",
2936
2989
  "data-test": "worker-card",
2937
2990
  "aria-label": o.value.title
2938
- }, [a("div", Ba, [
2939
- s(T(ne), {
2991
+ }, [a("div", Ua, [
2992
+ s(T(te), {
2940
2993
  size: 18,
2941
2994
  "aria-hidden": "true"
2942
2995
  }),
2943
- a("span", Va, w(o.value.title), 1),
2944
- 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),
2945
2998
  t[0] ||= a("span", { class: "kvc-spin" }, null, -1),
2946
- 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),
2947
3000
  a("button", {
2948
3001
  type: "button",
2949
3002
  class: "kvc-button",
2950
3003
  disabled: l.value,
2951
3004
  "data-test": "worker-card-stop",
2952
3005
  onClick: d
2953
- }, w(T(n).t("kvcoder.ui.jobs.stop")), 9, Wa)
2954
- ])], 8, za));
3006
+ }, w(T(n).t("kvcoder.ui.jobs.stop")), 9, qa)
3007
+ ])], 8, Ha));
2955
3008
  }
2956
- }), Ka = (e) => {
3009
+ }), Ya = (e) => {
2957
3010
  let t = e.description ?? e.subject;
2958
3011
  return {
2959
3012
  name: "run",
@@ -2962,7 +3015,7 @@ var Aa = /* @__PURE__ */ c({
2962
3015
  complete: !0
2963
3016
  };
2964
3017
  };
2965
- function qa(e, t) {
3018
+ function Xa(e, t) {
2966
3019
  let n = v(/* @__PURE__ */ new Set()), r = /* @__PURE__ */ new Map();
2967
3020
  function i(e) {
2968
3021
  for (let { questionId: t } of e) n.value.delete(t), r.delete(t);
@@ -2984,7 +3037,7 @@ function qa(e, t) {
2984
3037
  hidden: n,
2985
3038
  answer: (e) => a([e]),
2986
3039
  decide: ({ approvals: e, confirmed: t }) => {
2987
- 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));
2988
3041
  return a(e.map((e) => ({
2989
3042
  questionId: e.questionId,
2990
3043
  answer: { confirmed: t }
@@ -2994,7 +3047,7 @@ function qa(e, t) {
2994
3047
  }
2995
3048
  //#endregion
2996
3049
  //#region web/src/use-artifacts.ts
2997
- function Ja(e, t, n, r) {
3050
+ function Za(e, t, n, r) {
2998
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;
2999
3052
  function h(e) {
3000
3053
  l = e, u = !1, c.clear(), i.value = [], a.value = void 0, o.value = void 0, s.value = !1;
@@ -3107,109 +3160,138 @@ function Ja(e, t, n, r) {
3107
3160
  }
3108
3161
  //#endregion
3109
3162
  //#region web/src/use-conversation.ts
3110
- var Ya = 5e3;
3111
- function Xa(e, t, n) {
3112
- 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;
3113
- 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) {
3114
3167
  let n = (t?.pending ?? []).flatMap((e) => e.childSessionId === null ? [] : [e.childSessionId]);
3115
- 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);
3116
3169
  for (let t of n) {
3117
3170
  let [n, [r]] = await Promise.all([e.exec("kvcoder.session.get", { sessionId: t }), e.exec("kvcoder.turn.list", {
3118
3171
  sessionId: t,
3119
3172
  limit: 1
3120
3173
  })]);
3121
- l.set(t, {
3174
+ f.set(t, {
3122
3175
  session: n,
3123
3176
  turn: r,
3124
- live: l.get(t)?.live ?? _(ur())
3177
+ live: f.get(t)?.live ?? _(fr())
3125
3178
  });
3126
3179
  }
3127
3180
  }
3128
- 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() {
3129
3212
  let n = t();
3130
3213
  if (n === void 0) return;
3131
- let [s, c, l] = await Promise.all([
3214
+ let [i, a, c] = await Promise.all([
3132
3215
  e.exec("kvcoder.session.get", { sessionId: n }),
3133
- e.exec("kvcoder.message.list", {
3134
- sessionId: n,
3135
- limit: 200
3136
- }),
3137
3216
  e.exec("kvcoder.turn.list", {
3138
3217
  sessionId: n,
3139
3218
  limit: 50
3140
- })
3219
+ }),
3220
+ e.exec("kvcoder.context.get", { sessionId: n })
3141
3221
  ]);
3142
- 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);
3143
3223
  }
3144
- async function m(t, r, i, a = []) {
3224
+ async function T(t, r, i, a = []) {
3145
3225
  let o = t, s = a;
3146
- for (; o !== void 0 && !d && !u.has(o);) {
3147
- 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) => ({
3148
3228
  ...e,
3149
3229
  complete: !0,
3150
3230
  carried: !0
3151
3231
  })), s = [], e.follow(o).catch(n);
3152
3232
  let t;
3153
3233
  for await (let i of e.stream(o)) {
3154
- let e = mr(r, i);
3155
- 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);
3156
3236
  }
3157
- u.delete(o);
3237
+ p.delete(o);
3158
3238
  let a = await i();
3159
3239
  o = t ?? (a === o ? void 0 : a);
3160
3240
  }
3161
- Object.assign(r, ur());
3241
+ Object.assign(r, fr());
3162
3242
  }
3163
- async function g(e, t = []) {
3164
- s.value = !0;
3243
+ async function E(e, t = []) {
3244
+ u.value = !0;
3165
3245
  try {
3166
- 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);
3167
3247
  } finally {
3168
- s.value = u.size > 0;
3248
+ u.value = p.size > 0;
3169
3249
  }
3170
3250
  }
3171
- async function v(t, n) {
3172
- await p();
3173
- let r = l.get(t);
3174
- 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 () => {
3175
3255
  let n = await e.exec("kvcoder.session.get", { sessionId: t });
3176
3256
  return n.status === "running" ? n.stepJobId : void 0;
3177
- }), await y());
3257
+ }), await k());
3178
3258
  }
3179
- async function y(e = []) {
3180
- await p();
3259
+ async function k(e = []) {
3260
+ await w();
3181
3261
  let t = r.value;
3182
- t?.status === "running" && t.stepJobId !== void 0 && g(t.stepJobId, e).catch(n);
3183
- 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);
3184
3264
  }
3185
- let b = setInterval(() => {
3186
- u.size === 0 && t() !== void 0 && y().catch(n);
3187
- }, Ya);
3265
+ let A = setInterval(() => {
3266
+ p.size === 0 && t() !== void 0 && k().catch(n);
3267
+ }, Qa);
3188
3268
  return h(() => {
3189
- d = !0, clearInterval(b);
3190
- }), 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 }), {
3191
3271
  session: r,
3192
3272
  messages: i,
3193
3273
  omitted: a,
3194
3274
  turns: o,
3195
- live: c,
3196
- streaming: s,
3197
- children: l,
3198
- refresh: y,
3199
- stream: g
3275
+ context: s,
3276
+ loadFailure: c,
3277
+ live: d,
3278
+ streaming: u,
3279
+ children: f,
3280
+ refresh: k,
3281
+ stream: E
3200
3282
  };
3201
3283
  }
3202
3284
  //#endregion
3203
3285
  //#region web/src/use-follow-latest.ts
3204
- var Za = 80;
3205
- function Qa(e, t, n) {
3286
+ var to = 80;
3287
+ function no(e, t, n) {
3206
3288
  let r = v(!1);
3207
3289
  function i() {
3208
3290
  e.value !== null && (e.value.scrollTop = e.value.scrollHeight);
3209
3291
  }
3210
3292
  function a() {
3211
3293
  let t = e.value;
3212
- t !== null && (r.value = t.scrollHeight - t.clientHeight - t.scrollTop > Za);
3294
+ t !== null && (r.value = t.scrollHeight - t.clientHeight - t.scrollTop > to);
3213
3295
  }
3214
3296
  function o() {
3215
3297
  r.value = !1, i();
@@ -3226,7 +3308,7 @@ function Qa(e, t, n) {
3226
3308
  }
3227
3309
  //#endregion
3228
3310
  //#region web/src/use-slash-commands.ts
3229
- function $a(e) {
3311
+ function ro(e) {
3230
3312
  let t = C([]);
3231
3313
  return m(async () => {
3232
3314
  try {
@@ -3238,7 +3320,7 @@ function $a(e) {
3238
3320
  }
3239
3321
  //#endregion
3240
3322
  //#region web/src/use-workspace-session.ts
3241
- function eo(e, n, r) {
3323
+ function io(e, n, r) {
3242
3324
  let i = C(e.workspace.value.id);
3243
3325
  async function a(t) {
3244
3326
  let n;
@@ -3257,39 +3339,50 @@ function eo(e, n, r) {
3257
3339
  }
3258
3340
  //#endregion
3259
3341
  //#region web/src/ConversationView.vue?vue&type=script&setup=true&lang.ts
3260
- var to = { class: "kvc-workspace" }, no = { class: "kvc-stage" }, ro = {
3342
+ var ao = { class: "kvc-workspace" }, oo = { class: "kvc-stage" }, so = {
3261
3343
  class: "kvc-conversation",
3262
3344
  "data-test": "conversation"
3263
- }, 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 = {
3264
3357
  key: 1,
3265
3358
  class: "kvc-column"
3266
- }, oo = {
3359
+ }, mo = {
3267
3360
  key: 0,
3268
3361
  class: "kvc-muted",
3269
3362
  "data-test": "turn-totals"
3270
- }, so = {
3363
+ }, ho = {
3271
3364
  key: 2,
3272
3365
  class: "kvc-notice",
3273
3366
  "data-test": "summarizing"
3274
- }, co = {
3367
+ }, go = {
3275
3368
  key: 3,
3276
3369
  class: "kvc-answer",
3277
3370
  "data-test": "live-answer"
3278
- }, lo = ["open"], uo = { class: "kvc-muted" }, fo = {
3371
+ }, _o = ["open"], vo = { class: "kvc-muted" }, yo = {
3279
3372
  class: "kvc-muted",
3280
3373
  style: { "white-space": "pre-wrap" }
3281
- }, po = {
3374
+ }, bo = {
3282
3375
  key: 6,
3283
3376
  class: "kvc-muted",
3284
3377
  style: {
3285
3378
  "text-align": "center",
3286
3379
  margin: "0"
3287
3380
  }
3288
- }, mo = /* @__PURE__ */ c({
3381
+ }, xo = /* @__PURE__ */ c({
3289
3382
  __name: "ConversationView",
3290
3383
  props: { sessionId: {} },
3291
3384
  setup(c) {
3292
- let l = c, u = J(), d = eo(u, () => l.sessionId, (e) => X(u, e)), f = v("chat"), p = Xa(u, () => d.value, (e) => X(u, e)), { session: m, messages: h, omitted: _, turns: b, live: S, children: C } = p, D = Ja(u, () => d.value, () => m.value?.updatedAt, (e) => X(u, e)), O = t(() => D.open.value && D.shown.value !== void 0), A = t(() => Er(h.value)), j = /* @__PURE__ */ new Set([
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([
3293
3386
  "STEP_FAILED",
3294
3387
  "REPLY_LOST",
3295
3388
  "INTERRUPTED"
@@ -3309,7 +3402,7 @@ var to = { class: "kvc-workspace" }, no = { class: "kvc-stage" }, ro = {
3309
3402
  sessionId: d.value,
3310
3403
  text: e.text,
3311
3404
  ...e.fileIds.length > 0 ? { fileIds: e.fileIds } : {}
3312
- }), G.resume(), await p.refresh();
3405
+ }), K.resume(), await p.refresh();
3313
3406
  } catch (e) {
3314
3407
  X(u, e);
3315
3408
  }
@@ -3321,10 +3414,13 @@ var to = { class: "kvc-workspace" }, no = { class: "kvc-stage" }, ro = {
3321
3414
  X(u, e);
3322
3415
  }
3323
3416
  }
3324
- let R = qa(u, (e) => p.refresh(e)), z = t(() => P.value.flatMap((e) => e.kind === "worker" && e.runId !== void 0 ? [e.runId] : [])), B = t(() => P.value.filter((e) => e.questionId === null || !R.hidden.value.has(String(e.questionId)))), V = t(() => {
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(() => {
3325
3418
  let e = h.value.at(-1);
3326
3419
  return m.value?.status === "idle" && e?.kind === "notice" && j.has(String(e.content.code));
3327
- }), 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, () => [
3328
3424
  h.value,
3329
3425
  S.text,
3330
3426
  S.thinking,
@@ -3344,60 +3440,62 @@ var to = { class: "kvc-workspace" }, no = { class: "kvc-stage" }, ro = {
3344
3440
  X(u, e);
3345
3441
  }
3346
3442
  }
3347
- let ne = () => h.value.at(-1)?.kind === "notice" && h.value.at(-1)?.content.code === "SUMMARY_FAILED";
3348
- async function K() {
3443
+ let q = () => h.value.at(-1)?.kind === "notice" && h.value.at(-1)?.content.code === "SUMMARY_FAILED";
3444
+ async function ne() {
3349
3445
  return (await u.exec("kernel.settings.list", {})).find((e) => e.key === "kvcoder.compactKeep")?.value ?? null;
3350
3446
  }
3351
3447
  async function re() {
3352
3448
  let e = await U.compact();
3353
- e === !0 ? u.toast("kvcoder.ui.summarized", {}, "success") : e === !1 && !ne() && u.toast("kvcoder.ui.nothingToSummarize", { count: await K() });
3449
+ e === !0 ? u.toast("kvcoder.ui.summarized", {}, "success") : e === !1 && !q() && u.toast("kvcoder.ui.nothingToSummarize", { count: await ne() });
3354
3450
  }
3355
- function q(e, t) {
3451
+ function ie(e, t) {
3356
3452
  if (e === "new") return u.navigate("kvcoder.chat");
3357
3453
  if (e === "prompt") return void (f.value = f.value === "prompt" ? "chat" : "prompt");
3358
3454
  if (e === "delete") return void U.remove();
3359
3455
  U.working.value === void 0 && (f.value = "chat", e === "rename" ? U.rename(t) : e === "compact" ? re() : e === "export" ? U.exportFile() : U.fork());
3360
3456
  }
3361
- async function ie(e, t) {
3457
+ async function ae(e, t) {
3362
3458
  U.working.value === void 0 && (f.value = "chat", await U.runRegistered(e, t) && e.message !== void 0 && await I({
3363
3459
  text: t === "" ? u.t(e.message) : t,
3364
3460
  fileIds: []
3365
3461
  }));
3366
3462
  }
3367
- let ae = (e) => e.id;
3368
- 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, {
3369
3465
  key: 0,
3370
3466
  session: T(m),
3371
3467
  tab: f.value,
3372
3468
  turns: T(b).length,
3469
+ context: T(p).context.value,
3373
3470
  "running-since": N.value,
3374
3471
  artifacts: T(D).list.value.length,
3375
3472
  "artifacts-open": T(D).open.value,
3376
3473
  working: T(U).working.value !== void 0,
3377
3474
  onTab: c[0] ||= (e) => f.value = e,
3378
- onAction: q,
3475
+ onAction: ie,
3379
3476
  onToggleArtifacts: c[1] ||= (e) => T(D).toggle()
3380
3477
  }, null, 8, [
3381
3478
  "session",
3382
3479
  "tab",
3383
3480
  "turns",
3481
+ "context",
3384
3482
  "running-since",
3385
3483
  "artifacts",
3386
3484
  "artifacts-open",
3387
3485
  "working"
3388
- ])) : 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, {
3389
3487
  key: 0,
3390
3488
  registered: T(H)
3391
- }, 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", {
3392
3490
  ref_key: "list",
3393
- ref: W,
3491
+ ref: G,
3394
3492
  class: "kvc-scroll",
3395
- onScroll: c[5] ||= (...e) => T(G).onScroll && T(G).onScroll(...e)
3396
- }, [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, {
3397
3495
  key: 0,
3398
3496
  "session-id": T(m).id,
3399
- onBack: c[2] ||= (e) => f.value = "chat"
3400
- }, 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, [
3401
3499
  T(_) > 0 ? (g(), i("button", {
3402
3500
  key: 0,
3403
3501
  type: "button",
@@ -3406,24 +3504,24 @@ var to = { class: "kvc-workspace" }, no = { class: "kvc-stage" }, ro = {
3406
3504
  "data-test": "earlier",
3407
3505
  onClick: te
3408
3506
  }, w(T(u).t("kvcoder.ui.earlierMessages", { count: T(_) })), 1)) : r("v-if", !0),
3409
- (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, {
3410
3508
  message: t,
3411
3509
  calls: A.value,
3412
- onOpenArtifact: c[3] ||= (e) => T(D).openArtifact(e)
3413
- }, null, 8, ["message", "calls"]), F.value.has(t.id) ? (g(), i("span", oo, w(F.value.get(t.id)), 1)) : r("v-if", !0)], 64))), 128)),
3414
- V.value ? (g(), n(xa, {
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, {
3415
3513
  key: 1,
3416
3514
  "session-id": T(m).id,
3417
- onSent: c[4] ||= (e) => {
3418
- T(G).resume(), T(p).refresh();
3515
+ onSent: c[6] ||= (e) => {
3516
+ T(K).resume(), T(p).refresh();
3419
3517
  }
3420
3518
  }, null, 8, ["session-id"])) : r("v-if", !0),
3421
- T(S).summarizing ? (g(), i("div", so, w(T(u).t("kvcoder.ui.summarizing")), 1)) : r("v-if", !0),
3422
- M.value && (T(S).text !== "" || T(S).thinking !== "") ? (g(), i("div", co, [T(S).thinking === "" ? r("v-if", !0) : (g(), i("details", {
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", {
3423
3521
  key: 0,
3424
3522
  open: T(S).text === "" && T(S).calls.length === 0,
3425
3523
  "data-test": "live-thinking"
3426
- }, [a("summary", uo, w(T(u).t("kvcoder.ui.thinkingNow")), 1), a("p", fo, w(T(S).thinking), 1)], 8, lo)), T(S).text === "" ? r("v-if", !0) : (g(), n(x(T(u).View), {
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), {
3427
3525
  key: 1,
3428
3526
  view: {
3429
3527
  type: "markdown",
@@ -3431,15 +3529,15 @@ var to = { class: "kvc-workspace" }, no = { class: "kvc-stage" }, ro = {
3431
3529
  params: { text: T(S).text }
3432
3530
  }
3433
3531
  }, null, 8, ["view"]))])) : r("v-if", !0),
3434
- M.value ? (g(), n(Sr, {
3532
+ M.value ? (g(), n(wr, {
3435
3533
  key: 4,
3436
3534
  live: T(S)
3437
3535
  }, null, 8, ["live"])) : r("v-if", !0),
3438
- T(U).working.value ? (g(), n(xn, {
3536
+ T(U).working.value ? (g(), n(Sn, {
3439
3537
  key: 5,
3440
3538
  working: T(U).working.value
3441
3539
  }, null, 8, ["working"])) : r("v-if", !0),
3442
- (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, {
3443
3541
  key: e,
3444
3542
  child: t,
3445
3543
  hidden: T(R).hidden.value,
@@ -3451,12 +3549,12 @@ var to = { class: "kvc-workspace" }, no = { class: "kvc-stage" }, ro = {
3451
3549
  "onAnswer",
3452
3550
  "onDecide"
3453
3551
  ]))), 128)),
3454
- (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, {
3455
3553
  key: e,
3456
3554
  "session-id": T(m).id,
3457
3555
  "run-id": e
3458
3556
  }, null, 8, ["session-id", "run-id"]))), 128)),
3459
- s(_a, {
3557
+ s(ba, {
3460
3558
  pending: P.value,
3461
3559
  hidden: T(R).hidden.value,
3462
3560
  onAnswer: T(R).answer,
@@ -3467,17 +3565,27 @@ var to = { class: "kvc-workspace" }, no = { class: "kvc-stage" }, ro = {
3467
3565
  "onAnswer",
3468
3566
  "onDecide"
3469
3567
  ]),
3470
- B.value.some((e) => e.kind !== "subagent" && e.kind !== "worker") ? (g(), i("p", po, w(T(u).t("kvcoder.ui.messageDismisses")), 1)) : r("v-if", !0)
3471
- ]))], 544), T(G).away.value ? (g(), i("button", {
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", {
3472
3570
  key: 0,
3473
3571
  type: "button",
3474
3572
  class: "kvc-button kvc-jump",
3475
3573
  "data-test": "jump-to-latest",
3476
- onClick: c[6] ||= (...e) => T(G).resume && T(G).resume(...e)
3574
+ onClick: c[8] ||= (...e) => T(K).resume && T(K).resume(...e)
3477
3575
  }, [s(T(ee), {
3478
3576
  size: 16,
3479
3577
  "aria-hidden": "true"
3480
- }), 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, {
3481
3589
  running: M.value,
3482
3590
  placeholder: T(u).t("kvcoder.ui.placeholder"),
3483
3591
  blocked: T(U).working.value !== void 0,
@@ -3485,12 +3593,12 @@ var to = { class: "kvc-workspace" }, no = { class: "kvc-stage" }, ro = {
3485
3593
  registered: T(H),
3486
3594
  onSend: I,
3487
3595
  onStop: L,
3488
- onCommand: q,
3489
- onRegistered: ie
3596
+ onCommand: ie,
3597
+ onRegistered: ae
3490
3598
  }, {
3491
- controls: k(() => [s(Aa, {
3599
+ controls: k(() => [s(Na, {
3492
3600
  session: T(m),
3493
- onChanged: c[7] ||= (e) => T(p).refresh()
3601
+ onChanged: c[9] ||= (e) => T(p).refresh()
3494
3602
  }, null, 8, ["session"])]),
3495
3603
  _: 1
3496
3604
  }, 8, [
@@ -3498,26 +3606,26 @@ var to = { class: "kvc-workspace" }, no = { class: "kvc-stage" }, ro = {
3498
3606
  "placeholder",
3499
3607
  "blocked",
3500
3608
  "registered"
3501
- ])], 64)) : r("v-if", !0)]), O.value ? (g(), n(_t, {
3609
+ ])], 64)) : r("v-if", !0)]), O.value ? (g(), n(vt, {
3502
3610
  key: 0,
3503
3611
  list: T(D).list.value,
3504
3612
  shown: T(D).shown.value,
3505
3613
  content: T(D).content.value,
3506
- onSelect: c[8] ||= (e) => T(D).select(e),
3507
- onClose: c[9] ||= (e) => T(D).close()
3614
+ onSelect: c[10] ||= (e) => T(D).select(e),
3615
+ onClose: c[11] ||= (e) => T(D).close()
3508
3616
  }, null, 8, [
3509
3617
  "list",
3510
3618
  "shown",
3511
3619
  "content"
3512
3620
  ])) : r("v-if", !0)])]));
3513
3621
  }
3514
- }), ho = /* @__PURE__ */ c({
3622
+ }), So = /* @__PURE__ */ c({
3515
3623
  __name: "conversation",
3516
3624
  props: { sessionId: {} },
3517
3625
  setup(e) {
3518
3626
  let t = e;
3519
- 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"]));
3520
3628
  }
3521
3629
  });
3522
3630
  //#endregion
3523
- export { ho as default };
3631
+ export { So as default };