@kvman/kvcoder 0.1.22 → 0.1.23

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.
@@ -4784,38 +4784,50 @@ var tl = ["aria-label"], nl = {
4784
4784
  }, jl = {
4785
4785
  class: "kvc-muted",
4786
4786
  "data-test": "artifact-card-version"
4787
- }, Ml = /* @__PURE__ */ c({
4787
+ }, Ml = ["href"], Nl = /* @__PURE__ */ c({
4788
4788
  __name: "ArtifactCard",
4789
4789
  props: {
4790
4790
  id: {},
4791
4791
  title: {},
4792
4792
  format: {},
4793
- version: {}
4793
+ version: {},
4794
+ address: {}
4794
4795
  },
4795
4796
  emits: ["open"],
4796
4797
  setup(e, { emit: t }) {
4797
- let n = e, r = t, o = q();
4798
+ let n = e, r = t, c = q();
4798
4799
  return (e, t) => (y(), i("div", Ol, [
4799
4800
  s(k(ke), {
4800
4801
  size: 16,
4801
4802
  "aria-hidden": "true"
4802
4803
  }),
4803
4804
  a("span", kl, O(n.title), 1),
4804
- a("span", Al, O(k(o).t(`kvcoder.ui.artifacts.format.${n.format}`)), 1),
4805
- a("span", jl, O(k(o).t("kvcoder.ui.artifacts.version", { version: n.version })), 1),
4806
- a("button", {
4805
+ a("span", Al, O(k(c).t(`kvcoder.ui.artifacts.format.${n.format}`)), 1),
4806
+ a("span", jl, O(k(c).t("kvcoder.ui.artifacts.version", { version: n.version })), 1),
4807
+ n.address === void 0 ? (y(), i("button", {
4808
+ key: 1,
4807
4809
  type: "button",
4808
4810
  class: "kvc-button",
4809
4811
  "data-test": "artifact-open",
4810
4812
  onClick: t[0] ||= (e) => r("open", n.id)
4811
- }, O(k(o).t("kvcoder.ui.artifacts.open")), 1)
4813
+ }, O(k(c).t("kvcoder.ui.artifacts.open")), 1)) : (y(), i("a", {
4814
+ key: 0,
4815
+ href: n.address,
4816
+ target: "_blank",
4817
+ rel: "noopener noreferrer",
4818
+ class: "kvc-button",
4819
+ "data-test": "artifact-open"
4820
+ }, [o(O(k(c).t("kvcoder.ui.artifacts.open")), 1), s(k(xe), {
4821
+ size: 14,
4822
+ "aria-hidden": "true"
4823
+ })], 8, Ml))
4812
4824
  ]));
4813
4825
  }
4814
- }), Nl = {
4826
+ }), Pl = {
4815
4827
  key: 0,
4816
4828
  class: "kvc-card-row kvc-file-actions",
4817
4829
  "data-test": "file-actions"
4818
- }, Pl = ["title"], Fl = /* @__PURE__ */ c({
4830
+ }, Fl = ["title"], Il = /* @__PURE__ */ c({
4819
4831
  __name: "CallFileActions",
4820
4832
  props: {
4821
4833
  view: {},
@@ -4837,7 +4849,7 @@ var tl = ["aria-label"], nl = {
4837
4849
  }
4838
4850
  }
4839
4851
  }
4840
- return (e, t) => d.value ? (y(), i("div", Nl, [c.value ? (y(), i("button", {
4852
+ return (e, t) => d.value ? (y(), i("div", Pl, [c.value ? (y(), i("button", {
4841
4853
  key: 0,
4842
4854
  type: "button",
4843
4855
  class: "kvc-link-button kvc-mono kvc-oneline",
@@ -4845,7 +4857,7 @@ var tl = ["aria-label"], nl = {
4845
4857
  title: c.value.path,
4846
4858
  "data-test": "open-file",
4847
4859
  onClick: t[0] ||= (e) => k(a).host.openFile(f(c.value.path), c.value.line)
4848
- }, O(c.value.path), 9, Pl)) : r("v-if", !0), u.value ? (y(), i("button", {
4860
+ }, O(c.value.path), 9, Fl)) : r("v-if", !0), u.value ? (y(), i("button", {
4849
4861
  key: 1,
4850
4862
  type: "button",
4851
4863
  class: "kvc-button",
@@ -4856,30 +4868,30 @@ var tl = ["aria-label"], nl = {
4856
4868
  "aria-hidden": "true"
4857
4869
  }), o(O(k(a).t("kvcoder.ui.host.openDiff")), 1)])) : r("v-if", !0)])) : r("v-if", !0);
4858
4870
  }
4859
- }), Il = 3;
4860
- function Ll(e) {
4871
+ }), Ll = 3;
4872
+ function Rl(e) {
4861
4873
  if (e === "") return [];
4862
4874
  let t = e.split("\n");
4863
4875
  return e.endsWith("\n") ? t.slice(0, -1) : t;
4864
4876
  }
4865
- function Rl(e, t) {
4877
+ function zl(e, t) {
4866
4878
  let n = 0;
4867
4879
  for (; n < e.length && n < t.length && e[n] === t[n];) n += 1;
4868
4880
  return n;
4869
4881
  }
4870
- function zl(e, t) {
4871
- let n = Ll(e), r = Ll(t), i = Rl(n, r), a = Rl(n.slice(i).reverse(), r.slice(i).reverse()), o = (e, t) => t.map((t) => ({
4882
+ function Bl(e, t) {
4883
+ let n = Rl(e), r = Rl(t), i = zl(n, r), a = zl(n.slice(i).reverse(), r.slice(i).reverse()), o = (e, t) => t.map((t) => ({
4872
4884
  kind: e,
4873
4885
  text: t
4874
4886
  }));
4875
4887
  return [
4876
- ...o("context", n.slice(Math.max(i - Il, 0), i)),
4888
+ ...o("context", n.slice(Math.max(i - Ll, 0), i)),
4877
4889
  ...o("removed", n.slice(i, n.length - a)),
4878
4890
  ...o("added", r.slice(i, r.length - a)),
4879
- ...o("context", n.slice(n.length - a, n.length - a + Il))
4891
+ ...o("context", n.slice(n.length - a, n.length - a + Ll))
4880
4892
  ];
4881
4893
  }
4882
- function Bl(e) {
4894
+ function Vl(e) {
4883
4895
  return {
4884
4896
  added: e.filter((e) => e.kind === "added").length,
4885
4897
  removed: e.filter((e) => e.kind === "removed").length
@@ -4887,7 +4899,7 @@ function Bl(e) {
4887
4899
  }
4888
4900
  //#endregion
4889
4901
  //#region web/src/mcp-steps.ts
4890
- function Vl(e) {
4902
+ function Hl(e) {
4891
4903
  let t = e.steps;
4892
4904
  return Array.isArray(t) ? t.map((e, t) => {
4893
4905
  let { tool: n, arguments: r } = J(e), i = `${t + 1}.`;
@@ -4903,7 +4915,7 @@ function Vl(e) {
4903
4915
  }
4904
4916
  //#endregion
4905
4917
  //#region web/src/call-summary.ts
4906
- function Hl(e) {
4918
+ function Ul(e) {
4907
4919
  if (e !== void 0 && /^\s*[[{]/.test(e)) try {
4908
4920
  return JSON.parse(e);
4909
4921
  } catch (e) {
@@ -4911,12 +4923,12 @@ function Hl(e) {
4911
4923
  throw e;
4912
4924
  }
4913
4925
  }
4914
- var Ul = 1024;
4915
- function Wl(e, t) {
4916
- return t < Ul ? e("kvcoder.ui.call.bytes", { count: t }) : t < Ul * Ul ? e("kvcoder.ui.call.kilobytes", { count: (t / Ul).toFixed(1) }) : e("kvcoder.ui.call.megabytes", { count: (t / (Ul * Ul)).toFixed(1) });
4926
+ var Wl = 1024;
4927
+ function Gl(e, t) {
4928
+ return t < Wl ? e("kvcoder.ui.call.bytes", { count: t }) : t < Wl * Wl ? e("kvcoder.ui.call.kilobytes", { count: (t / Wl).toFixed(1) }) : e("kvcoder.ui.call.megabytes", { count: (t / (Wl * Wl)).toFixed(1) });
4917
4929
  }
4918
4930
  var Q = (e) => typeof e == "string" && e !== "" ? e : void 0;
4919
- function Gl(e) {
4931
+ function Kl(e) {
4920
4932
  let t = e.edits;
4921
4933
  return Array.isArray(t) ? t.flatMap((e) => {
4922
4934
  let { oldText: t, newText: n } = J(e);
@@ -4926,32 +4938,32 @@ function Gl(e) {
4926
4938
  }] : [];
4927
4939
  }) : [];
4928
4940
  }
4929
- function Kl(e) {
4930
- let t = Gl(e).map((e) => Bl(zl(e.oldText, e.newText)));
4941
+ function ql(e) {
4942
+ let t = Kl(e).map((e) => Vl(Bl(e.oldText, e.newText)));
4931
4943
  return `+${t.reduce((e, t) => e + t.added, 0)} −${t.reduce((e, t) => e + t.removed, 0)}`;
4932
4944
  }
4933
- function ql(e, t) {
4934
- if (typeof t.bytes == "number" && typeof t.created == "boolean") return e(t.created ? "kvcoder.ui.call.created" : "kvcoder.ui.call.replaced", { size: Wl(e, t.bytes) });
4935
- }
4936
4945
  function Jl(e, t) {
4946
+ if (typeof t.bytes == "number" && typeof t.created == "boolean") return e(t.created ? "kvcoder.ui.call.created" : "kvcoder.ui.call.replaced", { size: Gl(e, t.bytes) });
4947
+ }
4948
+ function Yl(e, t) {
4937
4949
  let { fromLine: n, totalLines: r, content: i } = t;
4938
4950
  if (typeof n != "number" || typeof r != "number" || typeof i != "string") return;
4939
- let a = Ll(i).length;
4951
+ let a = Rl(i).length;
4940
4952
  return a === 0 ? void 0 : e("kvcoder.ui.call.lines", {
4941
4953
  from: n,
4942
4954
  to: n + a - 1,
4943
4955
  total: r
4944
4956
  });
4945
4957
  }
4946
- function Yl(e, t) {
4958
+ function Xl(e, t) {
4947
4959
  let n = t.entries;
4948
4960
  if (Array.isArray(n)) return e(t.truncated === !0 ? "kvcoder.ui.call.entriesFirst" : "kvcoder.ui.call.entries", { count: n.length });
4949
4961
  }
4950
- function Xl(e, t) {
4962
+ function Zl(e, t) {
4951
4963
  let n = t.paths;
4952
4964
  if (Array.isArray(n)) return e(t.truncated === !0 ? "kvcoder.ui.call.filesFirst" : "kvcoder.ui.call.files", { count: n.length });
4953
4965
  }
4954
- function Zl(e, t) {
4966
+ function Ql(e, t) {
4955
4967
  let n = Yt(t);
4956
4968
  if (n === void 0) return;
4957
4969
  let r = n.reduce((e, t) => e + t.count, 0);
@@ -4960,7 +4972,7 @@ function Zl(e, t) {
4960
4972
  files: e("kvcoder.ui.call.files", { count: n.length })
4961
4973
  });
4962
4974
  }
4963
- var Ql = (e, t, n) => Array.isArray(n) ? e(t, { count: n.length }) : void 0;
4975
+ var $l = (e, t, n) => Array.isArray(n) ? e(t, { count: n.length }) : void 0;
4964
4976
  function $(e, t, n) {
4965
4977
  return {
4966
4978
  ...e === void 0 ? {} : { words: e },
@@ -4968,7 +4980,7 @@ function $(e, t, n) {
4968
4980
  ...n === void 0 ? {} : { outcome: n }
4969
4981
  };
4970
4982
  }
4971
- function $l(e) {
4983
+ function eu(e) {
4972
4984
  let t = e.files;
4973
4985
  if (!Array.isArray(t)) return;
4974
4986
  let n = t.flatMap((e) => {
@@ -4977,43 +4989,43 @@ function $l(e) {
4977
4989
  });
4978
4990
  return n.length === 0 ? void 0 : n.join(", ");
4979
4991
  }
4980
- function eu(e, t, n, r) {
4992
+ function tu(e, t, n, r) {
4981
4993
  let i = r === void 0 ? void 0 : J(r), a = Q(n.path);
4982
- if (t === "edit") return $(e("kvcoder.ui.call.edit"), a, i === void 0 ? void 0 : Kl(n));
4983
- if (t === "write") return $(e("kvcoder.ui.call.write"), a, i === void 0 ? void 0 : ql(e, i));
4984
- if (t === "read") return $(e("kvcoder.ui.call.read"), a, i === void 0 ? void 0 : Jl(e, i));
4985
- if (t === "read-files") return $(e("kvcoder.ui.call.read"), $l(n), i === void 0 ? void 0 : Ql(e, "kvcoder.ui.call.files", i.files));
4986
- if (t === "list") return $(e("kvcoder.ui.call.list"), a ?? ".", i === void 0 ? void 0 : Yl(e, i));
4987
- if (t === "find") return $(e("kvcoder.ui.call.find"), Q(n.pattern), i === void 0 ? void 0 : Xl(e, i));
4988
- if (t === "search") return $(e("kvcoder.ui.call.search"), Q(n.pattern), i === void 0 ? void 0 : Zl(e, i));
4994
+ if (t === "edit") return $(e("kvcoder.ui.call.edit"), a, i === void 0 ? void 0 : ql(n));
4995
+ if (t === "write") return $(e("kvcoder.ui.call.write"), a, i === void 0 ? void 0 : Jl(e, i));
4996
+ if (t === "read") return $(e("kvcoder.ui.call.read"), a, i === void 0 ? void 0 : Yl(e, i));
4997
+ if (t === "read-files") return $(e("kvcoder.ui.call.read"), eu(n), i === void 0 ? void 0 : $l(e, "kvcoder.ui.call.files", i.files));
4998
+ if (t === "list") return $(e("kvcoder.ui.call.list"), a ?? ".", i === void 0 ? void 0 : Xl(e, i));
4999
+ if (t === "find") return $(e("kvcoder.ui.call.find"), Q(n.pattern), i === void 0 ? void 0 : Zl(e, i));
5000
+ if (t === "search") return $(e("kvcoder.ui.call.search"), Q(n.pattern), i === void 0 ? void 0 : Ql(e, i));
4989
5001
  }
4990
- function tu(e, t, n, r) {
5002
+ function nu(e, t, n, r) {
4991
5003
  let i = Q(n.server), a = [i, Q(n.tool)].filter((e) => e !== void 0).join(" · ");
4992
5004
  if (t === "call") return $(void 0, a === "" ? void 0 : a);
4993
- if (t === "run") return $(void 0, [i, Vl(n).flatMap((e) => e.tool === void 0 ? [] : [e.tool]).join(", ")].filter((e) => e !== void 0 && e !== "").join(" · "));
4994
- if (t === "tools") return $(e("kvcoder.ui.call.tools"), a === "" ? void 0 : a, Ql(e, "kvcoder.ui.call.toolCount", J(r).tools));
5005
+ if (t === "run") return $(void 0, [i, Hl(n).flatMap((e) => e.tool === void 0 ? [] : [e.tool]).join(", ")].filter((e) => e !== void 0 && e !== "").join(" · "));
5006
+ if (t === "tools") return $(e("kvcoder.ui.call.tools"), a === "" ? void 0 : a, $l(e, "kvcoder.ui.call.toolCount", J(r).tools));
4995
5007
  }
4996
- function nu(e, t, n, r) {
4997
- if (t === "list") return $(e("kvcoder.ui.call.backgroundRuns"), void 0, Ql(e, "kvcoder.ui.call.runCount", r));
5008
+ function ru(e, t, n, r) {
5009
+ if (t === "list") return $(e("kvcoder.ui.call.backgroundRuns"), void 0, $l(e, "kvcoder.ui.call.runCount", r));
4998
5010
  if (t === "output" || t === "wait") {
4999
5011
  let i = Jt(r);
5000
5012
  return $(e(`kvcoder.ui.call.${t}`), Q(n.id), i === void 0 ? void 0 : qt(e, i.status));
5001
5013
  }
5002
5014
  if (t === "stop") return $(e("kvcoder.ui.call.stop"), Q(n.id));
5003
5015
  }
5004
- function ru(e, t, n, r) {
5016
+ function iu(e, t, n, r) {
5005
5017
  let i = Q(J(r).progress), a = n.steps, o = Array.isArray(a) ? a.flatMap((e) => Q(J(e).id) === void 0 ? [] : [String(J(e).id)]).join(", ") : void 0;
5006
5018
  return t === "set" ? $(e("kvcoder.ui.call.mapSet"), Q(n.goal), i) : t === "detail" ? $(e("kvcoder.ui.call.mapDetail"), Q(n.id), i) : t === "update" ? $(e("kvcoder.ui.call.mapUpdate"), o === "" ? void 0 : o, i) : t === "note" ? $(e("kvcoder.ui.call.mapNote"), Q(n.text)) : t === "get" ? $(e("kvcoder.ui.call.mapGet"), void 0, i) : void 0;
5007
5019
  }
5008
- function iu(e, t, n) {
5020
+ function au(e, t, n) {
5009
5021
  let { connector: r, command: i } = t, a = t.fields ?? {};
5010
5022
  if (r !== void 0 && i !== void 0) {
5011
5023
  if (t.line !== void 0) return { subject: `$ ${t.line}` };
5012
5024
  if (i === "help") return $(e("kvcoder.ui.call.help"), [r, Q(a.command)].filter((e) => e !== void 0).join(" "));
5013
- if (r === "fs") return eu(e, i, a, n);
5014
- if (r === "mcp") return tu(e, i, a, n);
5015
- if (r === "background") return nu(e, i, a, n);
5016
- if (r === "execution-map") return ru(e, i, a, n);
5025
+ if (r === "fs") return tu(e, i, a, n);
5026
+ if (r === "mcp") return nu(e, i, a, n);
5027
+ if (r === "background") return ru(e, i, a, n);
5028
+ if (r === "execution-map") return iu(e, i, a, n);
5017
5029
  if (r === "delegate" && i === "run") return $(e("kvcoder.ui.call.delegate"), [Q(a.worker), Q(a.title)].filter((e) => e !== void 0).join(" · "));
5018
5030
  if (r === "artifact" && i === "get") return $(e("kvcoder.ui.call.readArtifact"), Q(a.id));
5019
5031
  if (r === "web" && i === "fetch") return $(e("kvcoder.ui.call.fetch"), Q(a.url));
@@ -5022,44 +5034,44 @@ function iu(e, t, n) {
5022
5034
  }
5023
5035
  //#endregion
5024
5036
  //#region web/src/field-rows.ts
5025
- var au = "—", ou = (e) => e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean", su = (e) => e === null ? au : String(e);
5026
- function cu(e) {
5037
+ var ou = "—", su = (e) => e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean", cu = (e) => e === null ? ou : String(e);
5038
+ function lu(e) {
5027
5039
  return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
5028
5040
  }
5029
- function lu(e) {
5030
- let t = cu(e);
5041
+ function uu(e) {
5042
+ let t = lu(e);
5031
5043
  if (t === void 0) return;
5032
5044
  let n = {};
5033
5045
  for (let [e, r] of Object.entries(t)) {
5034
- if (!ou(r)) return;
5046
+ if (!su(r)) return;
5035
5047
  n[e] = r;
5036
5048
  }
5037
5049
  return n;
5038
5050
  }
5039
- function uu(e) {
5051
+ function du(e) {
5040
5052
  let t = [...new Set(e.flatMap((e) => Object.keys(e)))];
5041
5053
  return {
5042
5054
  kind: "table",
5043
5055
  columns: t,
5044
- rows: e.map((e) => t.map((t) => t in e ? su(e[t] ?? null) : ""))
5056
+ rows: e.map((e) => t.map((t) => t in e ? cu(e[t] ?? null) : ""))
5045
5057
  };
5046
5058
  }
5047
- function du(e) {
5059
+ function fu(e) {
5048
5060
  if (e.length === 0) return { kind: "empty" };
5049
- if (e.every(ou)) return {
5061
+ if (e.every(su)) return {
5050
5062
  kind: "items",
5051
- items: e.map(su)
5063
+ items: e.map(cu)
5052
5064
  };
5053
- let t = e.map(lu).filter((e) => e !== void 0);
5054
- return t.length === e.length ? uu(t) : {
5065
+ let t = e.map(uu).filter((e) => e !== void 0);
5066
+ return t.length === e.length ? du(t) : {
5055
5067
  kind: "rows",
5056
5068
  rows: e.map((e, t) => ({
5057
5069
  name: String(t + 1),
5058
- value: fu(e)
5070
+ value: pu(e)
5059
5071
  }))
5060
5072
  };
5061
5073
  }
5062
- function fu(e) {
5074
+ function pu(e) {
5063
5075
  if (typeof e == "string") return e.includes("\n") ? {
5064
5076
  kind: "block",
5065
5077
  text: e
@@ -5071,27 +5083,27 @@ function fu(e) {
5071
5083
  kind: "text",
5072
5084
  text: String(e)
5073
5085
  };
5074
- if (Array.isArray(e)) return du(e);
5075
- let t = cu(e);
5086
+ if (Array.isArray(e)) return fu(e);
5087
+ let t = lu(e);
5076
5088
  return t === void 0 || Object.keys(t).length === 0 ? { kind: "empty" } : {
5077
5089
  kind: "rows",
5078
- rows: pu(t)
5090
+ rows: mu(t)
5079
5091
  };
5080
5092
  }
5081
- function pu(e) {
5093
+ function mu(e) {
5082
5094
  return Object.entries(e).map(([e, t]) => ({
5083
5095
  name: e,
5084
- value: fu(t)
5096
+ value: pu(t)
5085
5097
  }));
5086
5098
  }
5087
- function mu(e, t) {
5099
+ function hu(e, t) {
5088
5100
  return t || e.length <= 12 ? e : e.slice(0, 12);
5089
5101
  }
5090
- var hu = (e) => Ll(e).map((e) => ({ text: e })), gu = (e, t) => Ll(e).map((e, n) => ({
5102
+ var gu = (e) => Rl(e).map((e) => ({ text: e })), _u = (e, t) => Rl(e).map((e, n) => ({
5091
5103
  text: e,
5092
5104
  number: t + n
5093
5105
  }));
5094
- function _u(e, t) {
5106
+ function vu(e, t) {
5095
5107
  return t || e.length <= 17 ? e : [
5096
5108
  ...e.slice(0, 12),
5097
5109
  "⋯",
@@ -5100,7 +5112,7 @@ function _u(e, t) {
5100
5112
  }
5101
5113
  //#endregion
5102
5114
  //#region web/src/FoldButton.vue?vue&type=script&setup=true&lang.ts
5103
- var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
5115
+ var yu = ["aria-expanded"], bu = /* @__PURE__ */ c({
5104
5116
  __name: "FoldButton",
5105
5117
  props: {
5106
5118
  count: {},
@@ -5117,123 +5129,123 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
5117
5129
  "aria-expanded": n.open,
5118
5130
  "data-test": "show-all",
5119
5131
  onClick: t[0] ||= (e) => a("toggle")
5120
- }, O(n.open ? k(o).t("kvcoder.ui.call.showFewer") : k(o).t("kvcoder.ui.call.showAll", { count: n.count })), 9, vu)) : r("v-if", !0);
5132
+ }, O(n.open ? k(o).t("kvcoder.ui.call.showFewer") : k(o).t("kvcoder.ui.call.showAll", { count: n.count })), 9, yu)) : r("v-if", !0);
5121
5133
  }
5122
- }), bu = { class: "kvc-code-lines" }, xu = ["dir", "data-kind"], Su = {
5134
+ }), xu = { class: "kvc-code-lines" }, Su = ["dir", "data-kind"], Cu = {
5123
5135
  key: 0,
5124
5136
  class: "kvc-line-number",
5125
5137
  "data-test": "call-line-number"
5126
- }, Cu = {
5138
+ }, wu = {
5127
5139
  key: 1,
5128
5140
  class: "kvc-line-mark",
5129
5141
  "aria-hidden": "true"
5130
- }, wu = {
5142
+ }, Tu = {
5131
5143
  class: "kvc-line-text",
5132
5144
  dir: "auto",
5133
5145
  "data-test": "call-line-text"
5134
- }, Tu = /* @__PURE__ */ c({
5146
+ }, Eu = /* @__PURE__ */ c({
5135
5147
  __name: "FoldedLines",
5136
5148
  props: { lines: {} },
5137
5149
  setup(n) {
5138
- let o = n, c = x(!1), l = t(() => mu(o.lines, c.value)), u = t(() => o.lines.some((e) => e.number !== void 0)), d = t(() => o.lines.some((e) => e.kind !== void 0)), f = {
5150
+ let o = n, c = x(!1), l = t(() => hu(o.lines, c.value)), u = t(() => o.lines.some((e) => e.number !== void 0)), d = t(() => o.lines.some((e) => e.kind !== void 0)), f = {
5139
5151
  context: " ",
5140
5152
  removed: "−",
5141
5153
  added: "+"
5142
5154
  };
5143
- return (t, n) => (y(), i("div", bu, [(y(!0), i(e, null, S(l.value, (e, t) => (y(), i("div", {
5155
+ return (t, n) => (y(), i("div", xu, [(y(!0), i(e, null, S(l.value, (e, t) => (y(), i("div", {
5144
5156
  key: t,
5145
5157
  class: "kvc-code-line",
5146
5158
  dir: u.value || d.value ? "ltr" : void 0,
5147
5159
  "data-kind": e.kind,
5148
5160
  "data-test": "call-line-row"
5149
5161
  }, [
5150
- u.value ? (y(), i("span", Su, O(e.number), 1)) : r("v-if", !0),
5151
- d.value ? (y(), i("span", Cu, O(f[e.kind ?? "context"]), 1)) : r("v-if", !0),
5152
- a("span", wu, [s(X, { text: e.text }, null, 8, ["text"])])
5153
- ], 8, xu))), 128)), s(yu, {
5162
+ u.value ? (y(), i("span", Cu, O(e.number), 1)) : r("v-if", !0),
5163
+ d.value ? (y(), i("span", wu, O(f[e.kind ?? "context"]), 1)) : r("v-if", !0),
5164
+ a("span", Tu, [s(X, { text: e.text }, null, 8, ["text"])])
5165
+ ], 8, Su))), 128)), s(bu, {
5154
5166
  count: o.lines.length,
5155
5167
  open: c.value,
5156
5168
  onToggle: n[0] ||= (e) => c.value = !c.value
5157
5169
  }, null, 8, ["count", "open"])]));
5158
5170
  }
5159
- }), Eu = {
5171
+ }), Du = {
5160
5172
  key: 0,
5161
5173
  dir: "auto",
5162
5174
  "data-test": "field-text"
5163
- }, Du = {
5175
+ }, Ou = {
5164
5176
  key: 1,
5165
5177
  class: "kvc-muted",
5166
5178
  "data-test": "field-empty"
5167
- }, Ou = {
5179
+ }, ku = {
5168
5180
  key: 3,
5169
5181
  class: "kvc-field-table"
5170
- }, ku = { "data-test": "field-table" }, Au = {
5182
+ }, Au = { "data-test": "field-table" }, ju = {
5171
5183
  key: 4,
5172
5184
  class: "kvc-field-items",
5173
5185
  "data-test": "field-items"
5174
- }, ju = {
5186
+ }, Mu = {
5175
5187
  key: 5,
5176
5188
  class: "kvc-fields",
5177
5189
  "data-test": "call-fields"
5178
- }, Mu = ["data-name"], Nu = {
5190
+ }, Nu = ["data-name"], Pu = {
5179
5191
  class: "kvc-muted",
5180
5192
  dir: "ltr"
5181
- }, Pu = { "data-test": "field-value" }, Fu = /* @__PURE__ */ c({
5193
+ }, Fu = { "data-test": "field-value" }, Iu = /* @__PURE__ */ c({
5182
5194
  __name: "FieldsView",
5183
5195
  props: { value: {} },
5184
5196
  setup(r) {
5185
- let o = r, c = x(!1), l = t(() => o.value.kind === "table" ? mu(o.value.rows, c.value) : []), u = t(() => o.value.kind === "items" ? mu(o.value.items, c.value) : []);
5197
+ let o = r, c = x(!1), l = t(() => o.value.kind === "table" ? hu(o.value.rows, c.value) : []), u = t(() => o.value.kind === "items" ? hu(o.value.items, c.value) : []);
5186
5198
  return (t, r) => {
5187
5199
  let d = w("FieldsView", !0);
5188
- return o.value.kind === "text" ? (y(), i("span", Eu, [s(X, { text: o.value.text }, null, 8, ["text"])])) : o.value.kind === "empty" ? (y(), i("span", Du, "—")) : o.value.kind === "block" ? (y(), n(Tu, {
5200
+ return o.value.kind === "text" ? (y(), i("span", Du, [s(X, { text: o.value.text }, null, 8, ["text"])])) : o.value.kind === "empty" ? (y(), i("span", Ou, "—")) : o.value.kind === "block" ? (y(), n(Eu, {
5189
5201
  key: 2,
5190
5202
  class: "kvc-field-block",
5191
- lines: k(hu)(o.value.text),
5203
+ lines: k(gu)(o.value.text),
5192
5204
  "data-test": "field-block"
5193
- }, null, 8, ["lines"])) : o.value.kind === "table" ? (y(), i("div", Ou, [a("table", ku, [a("thead", null, [a("tr", null, [(y(!0), i(e, null, S(o.value.columns, (e) => (y(), i("th", {
5205
+ }, null, 8, ["lines"])) : o.value.kind === "table" ? (y(), i("div", ku, [a("table", Au, [a("thead", null, [a("tr", null, [(y(!0), i(e, null, S(o.value.columns, (e) => (y(), i("th", {
5194
5206
  key: e,
5195
5207
  scope: "col",
5196
5208
  dir: "ltr"
5197
5209
  }, O(e), 1))), 128))])]), a("tbody", null, [(y(!0), i(e, null, S(l.value, (t, n) => (y(), i("tr", { key: n }, [(y(!0), i(e, null, S(t, (e, t) => (y(), i("td", {
5198
5210
  key: t,
5199
5211
  dir: "auto"
5200
- }, [s(X, { text: e }, null, 8, ["text"])]))), 128))]))), 128))])]), s(yu, {
5212
+ }, [s(X, { text: e }, null, 8, ["text"])]))), 128))]))), 128))])]), s(bu, {
5201
5213
  count: o.value.rows.length,
5202
5214
  open: c.value,
5203
5215
  onToggle: r[0] ||= (e) => c.value = !c.value
5204
- }, null, 8, ["count", "open"])])) : o.value.kind === "items" ? (y(), i("div", Au, [(y(!0), i(e, null, S(u.value, (e, t) => (y(), i("div", {
5216
+ }, null, 8, ["count", "open"])])) : o.value.kind === "items" ? (y(), i("div", ju, [(y(!0), i(e, null, S(u.value, (e, t) => (y(), i("div", {
5205
5217
  key: t,
5206
5218
  dir: "auto"
5207
- }, [s(X, { text: e }, null, 8, ["text"])]))), 128)), s(yu, {
5219
+ }, [s(X, { text: e }, null, 8, ["text"])]))), 128)), s(bu, {
5208
5220
  count: o.value.items.length,
5209
5221
  open: c.value,
5210
5222
  onToggle: r[1] ||= (e) => c.value = !c.value
5211
- }, null, 8, ["count", "open"])])) : (y(), i("dl", ju, [(y(!0), i(e, null, S(o.value.rows, (e) => (y(), i("div", {
5223
+ }, null, 8, ["count", "open"])])) : (y(), i("dl", Mu, [(y(!0), i(e, null, S(o.value.rows, (e) => (y(), i("div", {
5212
5224
  key: e.name,
5213
5225
  class: "kvc-field-row",
5214
5226
  "data-name": e.name,
5215
5227
  "data-test": "field-row"
5216
- }, [a("dt", Nu, O(e.name), 1), a("dd", Pu, [s(d, { value: e.value }, null, 8, ["value"])])], 8, Mu))), 128))]));
5228
+ }, [a("dt", Pu, O(e.name), 1), a("dd", Fu, [s(d, { value: e.value }, null, 8, ["value"])])], 8, Nu))), 128))]));
5217
5229
  };
5218
5230
  }
5219
- }), Iu = ["aria-label"], Lu = ["aria-label"], Ru = {
5231
+ }), Lu = ["aria-label"], Ru = ["aria-label"], zu = {
5220
5232
  class: "kvc-mono",
5221
5233
  dir: "ltr",
5222
5234
  "data-test": "call-step-tool"
5223
- }, zu = { class: "kvc-step-arguments" }, Bu = ["aria-label"], Vu = /* @__PURE__ */ c({
5235
+ }, Bu = { class: "kvc-step-arguments" }, Vu = ["aria-label"], Hu = /* @__PURE__ */ c({
5224
5236
  __name: "CallRequest",
5225
5237
  props: { view: {} },
5226
5238
  setup(o) {
5227
- let c = o, l = q(), u = t(() => an(c.view)), d = t(() => c.view.fields ?? {}), f = t(() => Gl(d.value).map((e) => zl(e.oldText, e.newText))), p = t(() => typeof d.value.content == "string" ? d.value.content : ""), m = t(() => typeof d.value.goal == "string" ? d.value.goal : typeof d.value.task == "string" ? d.value.task : ""), h = t(() => u.value === "mcp-run" ? Vl(d.value) : []), g = t(() => u.value === "mcp-call" ? J(d.value.arguments) : u.value === "fields" ? d.value : {});
5228
- return (t, o) => u.value === "edit" ? (y(!0), i(e, { key: 0 }, S(f.value, (e, t) => (y(), n(Tu, {
5239
+ let c = o, l = q(), u = t(() => an(c.view)), d = t(() => c.view.fields ?? {}), f = t(() => Kl(d.value).map((e) => Bl(e.oldText, e.newText))), p = t(() => typeof d.value.content == "string" ? d.value.content : ""), m = t(() => typeof d.value.goal == "string" ? d.value.goal : typeof d.value.task == "string" ? d.value.task : ""), h = t(() => u.value === "mcp-run" ? Hl(d.value) : []), g = t(() => u.value === "mcp-call" ? J(d.value.arguments) : u.value === "fields" ? d.value : {});
5240
+ return (t, o) => u.value === "edit" ? (y(!0), i(e, { key: 0 }, S(f.value, (e, t) => (y(), n(Eu, {
5229
5241
  key: t,
5230
5242
  class: "kvc-block",
5231
5243
  lines: e,
5232
5244
  "data-test": "call-diff"
5233
- }, null, 8, ["lines"]))), 128)) : u.value === "write" ? (y(), n(Tu, {
5245
+ }, null, 8, ["lines"]))), 128)) : u.value === "write" ? (y(), n(Eu, {
5234
5246
  key: 1,
5235
5247
  class: "kvc-block",
5236
- lines: k(gu)(p.value, 1),
5248
+ lines: k(_u)(p.value, 1),
5237
5249
  "data-test": "call-content"
5238
5250
  }, null, 8, ["lines"])) : u.value === "line" ? (y(), i("pre", {
5239
5251
  key: 2,
@@ -5241,7 +5253,7 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
5241
5253
  dir: "ltr",
5242
5254
  "aria-label": k(l).t("kvcoder.ui.command"),
5243
5255
  "data-test": "call-payload"
5244
- }, "$ " + O(c.view.line), 9, Iu)) : h.value.length > 0 ? (y(), i("ol", {
5256
+ }, "$ " + O(c.view.line), 9, Lu)) : h.value.length > 0 ? (y(), i("ol", {
5245
5257
  key: 3,
5246
5258
  class: "kvc-block kvc-steps",
5247
5259
  "aria-label": k(l).t("kvcoder.ui.call.payload"),
@@ -5249,10 +5261,10 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
5249
5261
  }, [(y(!0), i(e, null, S(h.value, (e, t) => (y(), i("li", {
5250
5262
  key: t,
5251
5263
  "data-test": "call-step"
5252
- }, [a("span", Ru, O(e.label), 1), a("div", zu, [s(Fu, { value: k(fu)(e.arguments) }, null, 8, ["value"])])]))), 128))], 8, Lu)) : u.value === "delegate" ? (y(), n(Tu, {
5264
+ }, [a("span", zu, O(e.label), 1), a("div", Bu, [s(Iu, { value: k(pu)(e.arguments) }, null, 8, ["value"])])]))), 128))], 8, Ru)) : u.value === "delegate" ? (y(), n(Eu, {
5253
5265
  key: 4,
5254
5266
  class: "kvc-block kvc-prose-lines",
5255
- lines: k(hu)(m.value),
5267
+ lines: k(gu)(m.value),
5256
5268
  "aria-label": k(l).t("kvcoder.ui.call.task"),
5257
5269
  "data-test": "call-task"
5258
5270
  }, null, 8, ["lines", "aria-label"])) : Object.keys(g.value).length > 0 ? (y(), i("div", {
@@ -5260,19 +5272,19 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
5260
5272
  class: "kvc-block",
5261
5273
  "aria-label": k(l).t("kvcoder.ui.call.payload"),
5262
5274
  "data-test": "call-payload-fields"
5263
- }, [s(Fu, { value: k(fu)(g.value) }, null, 8, ["value"])], 8, Bu)) : r("v-if", !0);
5275
+ }, [s(Iu, { value: k(pu)(g.value) }, null, 8, ["value"])], 8, Vu)) : r("v-if", !0);
5264
5276
  }
5265
- }), Hu = { class: "kvc-output-block" }, Uu = ["aria-label"], Wu = /* @__PURE__ */ c({
5277
+ }), Uu = { class: "kvc-output-block" }, Wu = ["aria-label"], Gu = /* @__PURE__ */ c({
5266
5278
  __name: "FoldedOutput",
5267
5279
  props: { output: {} },
5268
5280
  setup(e) {
5269
- let n = e, r = q(), o = x(!1), c = t(() => n.output.split("\n")), l = t(() => _u(c.value, o.value).join("\n"));
5270
- return (e, t) => (y(), i("div", Hu, [a("pre", {
5281
+ let n = e, r = q(), o = x(!1), c = t(() => n.output.split("\n")), l = t(() => vu(c.value, o.value).join("\n"));
5282
+ return (e, t) => (y(), i("div", Uu, [a("pre", {
5271
5283
  class: "kvc-output",
5272
5284
  dir: "auto",
5273
5285
  "aria-label": k(r).t("kvcoder.ui.output"),
5274
5286
  "data-test": "call-output"
5275
- }, [s(X, { text: l.value }, null, 8, ["text"])], 8, Uu), s(yu, {
5287
+ }, [s(X, { text: l.value }, null, 8, ["text"])], 8, Wu), s(bu, {
5276
5288
  count: c.value.length,
5277
5289
  open: o.value,
5278
5290
  over: k(12) + k(5),
@@ -5283,11 +5295,11 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
5283
5295
  "over"
5284
5296
  ])]));
5285
5297
  }
5286
- }), Gu = {
5298
+ }), Ku = {
5287
5299
  key: 1,
5288
5300
  class: "kvc-mono",
5289
5301
  dir: "auto"
5290
- }, Ku = /* @__PURE__ */ c({
5302
+ }, qu = /* @__PURE__ */ c({
5291
5303
  __name: "HostPath",
5292
5304
  props: {
5293
5305
  path: {},
@@ -5303,23 +5315,23 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
5303
5315
  dir: "auto",
5304
5316
  "data-test": "host-path",
5305
5317
  onClick: r[0] ||= (e) => k(n).host.openFile(k(cn)(k(n).workspace.value.path, t.path), t.line)
5306
- }, O(t.label ?? t.path), 1)) : (y(), i("span", Gu, O(t.label ?? t.path), 1));
5318
+ }, O(t.label ?? t.path), 1)) : (y(), i("span", Ku, O(t.label ?? t.path), 1));
5307
5319
  }
5308
- }), qu = {
5320
+ }), Ju = {
5309
5321
  class: "kvc-block kvc-run-row",
5310
5322
  "data-test": "run-row"
5311
- }, Ju = {
5323
+ }, Yu = {
5312
5324
  class: "kvc-run-call",
5313
5325
  dir: "auto",
5314
5326
  "data-test": "run-call"
5315
- }, Yu = {
5327
+ }, Xu = {
5316
5328
  class: "kvc-chip",
5317
5329
  "data-test": "run-status"
5318
- }, Xu = {
5330
+ }, Zu = {
5319
5331
  key: 0,
5320
5332
  class: "kvc-muted",
5321
5333
  "data-test": "run-time"
5322
- }, Zu = ["aria-label"], Qu = ["aria-label"], $u = ["aria-label"], ed = ["aria-label"], td = /* @__PURE__ */ c({
5334
+ }, Qu = ["aria-label"], $u = ["aria-label"], ed = ["aria-label"], td = ["aria-label"], nd = /* @__PURE__ */ c({
5323
5335
  __name: "RunOutput",
5324
5336
  props: { run: {} },
5325
5337
  setup(c) {
@@ -5329,79 +5341,79 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
5329
5341
  params: { text: f.value ?? "" }
5330
5342
  }));
5331
5343
  return (t, c) => (y(), i(e, null, [
5332
- a("div", qu, [
5333
- a("span", Ju, O(l.run.call), 1),
5334
- a("span", Yu, [o(O(k(qt)(k(u).t, l.run.status)), 1), l.run.exitCode === void 0 ? r("v-if", !0) : (y(), i(e, { key: 0 }, [o(" · " + O(k(u).t("kvcoder.ui.exitCode", { code: l.run.exitCode })), 1)], 64))]),
5335
- l.run.ranMs === void 0 ? r("v-if", !0) : (y(), i("span", Xu, O(k(it)(k(u).t, l.run.ranMs)), 1))
5344
+ a("div", Ju, [
5345
+ a("span", Yu, O(l.run.call), 1),
5346
+ a("span", Xu, [o(O(k(qt)(k(u).t, l.run.status)), 1), l.run.exitCode === void 0 ? r("v-if", !0) : (y(), i(e, { key: 0 }, [o(" · " + O(k(u).t("kvcoder.ui.exitCode", { code: l.run.exitCode })), 1)], 64))]),
5347
+ l.run.ranMs === void 0 ? r("v-if", !0) : (y(), i("span", Zu, O(k(it)(k(u).t, l.run.ranMs)), 1))
5336
5348
  ]),
5337
5349
  p.value === void 0 ? l.run.problem === void 0 ? r("v-if", !0) : (y(), i("div", {
5338
5350
  key: 1,
5339
5351
  class: "kvc-block kvc-error",
5340
5352
  "aria-label": k(u).t("kvcoder.ui.call.error"),
5341
5353
  "data-test": "run-problem"
5342
- }, [s(Fu, { value: k(fu)(l.run.problem) }, null, 8, ["value"])], 8, Qu)) : (y(), i("pre", {
5354
+ }, [s(Iu, { value: k(pu)(l.run.problem) }, null, 8, ["value"])], 8, $u)) : (y(), i("pre", {
5343
5355
  key: 0,
5344
5356
  class: "kvc-block kvc-error",
5345
5357
  dir: "auto",
5346
5358
  "aria-label": k(u).t("kvcoder.ui.call.error"),
5347
5359
  "data-test": "run-problem"
5348
- }, [s(X, { text: p.value }, null, 8, ["text"])], 8, Zu)),
5360
+ }, [s(X, { text: p.value }, null, 8, ["text"])], 8, Qu)),
5349
5361
  f.value === void 0 && l.run.output !== void 0 ? (y(), i("div", {
5350
5362
  key: 2,
5351
5363
  class: "kvc-block",
5352
5364
  "aria-label": k(u).t("kvcoder.ui.output"),
5353
5365
  "data-test": "call-result-fields"
5354
- }, [s(Fu, { value: k(fu)(l.run.output) }, null, 8, ["value"])], 8, $u)) : l.run.answer && f.value ? (y(), i("div", {
5366
+ }, [s(Iu, { value: k(pu)(l.run.output) }, null, 8, ["value"])], 8, ed)) : l.run.answer && f.value ? (y(), i("div", {
5355
5367
  key: 3,
5356
5368
  class: "kvc-block",
5357
5369
  "aria-label": k(u).t("kvcoder.ui.call.answer"),
5358
5370
  "data-test": "call-answer"
5359
- }, [(y(), n(T(k(u).View), { view: m.value }, null, 8, ["view"]))], 8, ed)) : f.value ? (y(), n(Wu, {
5371
+ }, [(y(), n(T(k(u).View), { view: m.value }, null, 8, ["view"]))], 8, td)) : f.value ? (y(), n(Gu, {
5360
5372
  key: 4,
5361
5373
  output: f.value
5362
5374
  }, null, 8, ["output"])) : r("v-if", !0)
5363
5375
  ], 64));
5364
5376
  }
5365
- }), nd = {
5377
+ }), rd = {
5366
5378
  key: 0,
5367
5379
  class: "kvc-muted kvc-call-parts",
5368
5380
  "data-test": "call-replacements"
5369
- }, rd = {
5381
+ }, id = {
5370
5382
  key: 2,
5371
5383
  class: "kvc-block kvc-entries",
5372
5384
  "data-test": "call-entries"
5373
- }, id = ["data-kind"], ad = {
5385
+ }, ad = ["data-kind"], od = {
5374
5386
  key: 0,
5375
5387
  "data-test": "call-entry-name"
5376
- }, od = {
5388
+ }, sd = {
5377
5389
  key: 1,
5378
5390
  class: "kvc-mono",
5379
5391
  dir: "auto",
5380
5392
  "data-test": "call-entry-name"
5381
- }, sd = {
5393
+ }, cd = {
5382
5394
  key: 2,
5383
5395
  class: "kvc-muted",
5384
5396
  "data-test": "call-entry-size"
5385
- }, cd = {
5397
+ }, ld = {
5386
5398
  key: 3,
5387
5399
  class: "kvc-block kvc-entries",
5388
5400
  "data-test": "call-paths"
5389
- }, ld = {
5401
+ }, ud = {
5390
5402
  class: "kvc-file-path",
5391
5403
  "data-test": "call-file-path"
5392
- }, ud = {
5404
+ }, dd = {
5393
5405
  key: 1,
5394
5406
  class: "kvc-muted kvc-call-parts",
5395
5407
  "data-test": "call-file-count"
5396
- }, dd = {
5408
+ }, fd = {
5397
5409
  class: "kvc-file-path",
5398
5410
  "data-test": "call-file-path"
5399
- }, fd = {
5411
+ }, pd = {
5400
5412
  key: 1,
5401
5413
  class: "kvc-muted kvc-call-parts",
5402
5414
  dir: "auto",
5403
5415
  "data-test": "call-read-file-note"
5404
- }, pd = ["aria-label"], md = ["aria-label"], hd = /* @__PURE__ */ c({
5416
+ }, md = ["aria-label"], hd = ["aria-label"], gd = /* @__PURE__ */ c({
5405
5417
  __name: "CallResult",
5406
5418
  props: {
5407
5419
  view: {},
@@ -5409,7 +5421,7 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
5409
5421
  result: {}
5410
5422
  },
5411
5423
  setup(o) {
5412
- let c = o, l = q(), u = t(() => an(c.view)), d = t(() => u.value === "edit" ? Rt(c.result) : void 0), f = t(() => u.value === "read" ? zt(c.result) : void 0), p = t(() => u.value === "read-files" ? Vt(c.result) : void 0), m = (e) => e.error ?? l.t(e.state === "notRead" ? "kvcoder.ui.call.fileNotRead" : "kvcoder.ui.call.fileUnchanged"), h = t(() => u.value === "list" ? Ut(c.result) : void 0), g = t(() => u.value === "search" ? Yt(c.result) : void 0), _ = t(() => u.value === "find" ? Wt(c.result) : void 0), v = x(!1), b = t(() => mu(_.value ?? [], v.value)), C = t(() => u.value === "run-output" ? Jt(c.result) : void 0), w = x(!1), E = t(() => mu(h.value ?? [], w.value)), D = t(() => ({
5424
+ let c = o, l = q(), u = t(() => an(c.view)), d = t(() => u.value === "edit" ? Rt(c.result) : void 0), f = t(() => u.value === "read" ? zt(c.result) : void 0), p = t(() => u.value === "read-files" ? Vt(c.result) : void 0), m = (e) => e.error ?? l.t(e.state === "notRead" ? "kvcoder.ui.call.fileNotRead" : "kvcoder.ui.call.fileUnchanged"), h = t(() => u.value === "list" ? Ut(c.result) : void 0), g = t(() => u.value === "search" ? Yt(c.result) : void 0), _ = t(() => u.value === "find" ? Wt(c.result) : void 0), v = x(!1), b = t(() => hu(_.value ?? [], v.value)), C = t(() => u.value === "run-output" ? Jt(c.result) : void 0), w = x(!1), E = t(() => hu(h.value ?? [], w.value)), D = t(() => ({
5413
5425
  type: "markdown",
5414
5426
  text: "kvcoder.markdown",
5415
5427
  params: { text: c.output }
@@ -5419,52 +5431,52 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
5419
5431
  class: "kvc-block",
5420
5432
  "aria-label": k(l).t("kvcoder.ui.call.answer"),
5421
5433
  "data-test": "call-answer"
5422
- }, [(y(), n(T(k(l).View), { view: D.value }, null, 8, ["view"]))], 8, pd)) : M.value ? (y(), i("div", {
5434
+ }, [(y(), n(T(k(l).View), { view: D.value }, null, 8, ["view"]))], 8, md)) : M.value ? (y(), i("div", {
5423
5435
  key: 9,
5424
5436
  class: "kvc-block",
5425
5437
  "aria-label": k(l).t("kvcoder.ui.output"),
5426
5438
  "data-test": "call-result-fields"
5427
- }, [s(Fu, { value: k(fu)(c.result) }, null, 8, ["value"])], 8, md)) : c.output === "" ? r("v-if", !0) : (y(), n(Wu, {
5439
+ }, [s(Iu, { value: k(pu)(c.result) }, null, 8, ["value"])], 8, hd)) : c.output === "" ? r("v-if", !0) : (y(), n(Gu, {
5428
5440
  key: 10,
5429
5441
  output: c.output
5430
- }, null, 8, ["output"])) : (y(), n(td, {
5442
+ }, null, 8, ["output"])) : (y(), n(nd, {
5431
5443
  key: 7,
5432
5444
  run: C.value
5433
5445
  }, null, 8, ["run"])) : (y(!0), i(e, { key: 5 }, S(p.value, (e, t) => (y(), i("div", {
5434
5446
  key: `${t}:${e.path}`,
5435
5447
  class: "kvc-block",
5436
5448
  "data-test": "call-read-file"
5437
- }, [a("div", dd, [s(Ku, {
5449
+ }, [a("div", fd, [s(qu, {
5438
5450
  path: e.path,
5439
5451
  line: e.read?.fromLine
5440
- }, null, 8, ["path", "line"])]), e.read === void 0 ? (y(), i("p", fd, O(m(e)), 1)) : (y(), n(Tu, {
5452
+ }, null, 8, ["path", "line"])]), e.read === void 0 ? (y(), i("p", pd, O(m(e)), 1)) : (y(), n(Eu, {
5441
5453
  key: 0,
5442
- lines: k(gu)(e.read.content, e.read.fromLine)
5454
+ lines: k(_u)(e.read.content, e.read.fromLine)
5443
5455
  }, null, 8, ["lines"]))]))), 128)) : (y(!0), i(e, { key: 4 }, S(g.value, (e) => (y(), i("div", {
5444
5456
  key: e.path,
5445
5457
  class: "kvc-block",
5446
5458
  "data-test": "call-file"
5447
- }, [a("div", ld, [s(Ku, {
5459
+ }, [a("div", ud, [s(qu, {
5448
5460
  path: e.path,
5449
5461
  line: e.matches.find((e) => !e.context)?.line
5450
- }, null, 8, ["path", "line"])]), e.matches.length > 0 ? (y(), n(Tu, {
5462
+ }, null, 8, ["path", "line"])]), e.matches.length > 0 ? (y(), n(Eu, {
5451
5463
  key: 0,
5452
5464
  lines: e.matches.map((e) => ({
5453
5465
  text: e.text,
5454
5466
  number: e.line
5455
5467
  }))
5456
- }, null, 8, ["lines"])) : (y(), i("p", ud, O(k(l).t("kvcoder.ui.call.matchCount", { count: e.count })), 1))]))), 128)) : (y(), i("div", cd, [(y(!0), i(e, null, S(b.value, (e) => (y(), i("div", {
5468
+ }, null, 8, ["lines"])) : (y(), i("p", dd, O(k(l).t("kvcoder.ui.call.matchCount", { count: e.count })), 1))]))), 128)) : (y(), i("div", ld, [(y(!0), i(e, null, S(b.value, (e) => (y(), i("div", {
5457
5469
  key: e,
5458
5470
  class: "kvc-entry",
5459
5471
  "data-test": "call-path"
5460
5472
  }, [s(k(Ce), {
5461
5473
  size: 14,
5462
5474
  "aria-hidden": "true"
5463
- }), s(Ku, { path: e }, null, 8, ["path"])]))), 128)), s(yu, {
5475
+ }), s(qu, { path: e }, null, 8, ["path"])]))), 128)), s(bu, {
5464
5476
  count: _.value.length,
5465
5477
  open: v.value,
5466
5478
  onToggle: o[1] ||= (e) => v.value = !v.value
5467
- }, null, 8, ["count", "open"])])) : (y(), i("div", rd, [(y(!0), i(e, null, S(E.value, (e) => (y(), i("div", {
5479
+ }, null, 8, ["count", "open"])])) : (y(), i("div", id, [(y(!0), i(e, null, S(E.value, (e) => (y(), i("div", {
5468
5480
  key: e.name,
5469
5481
  class: "kvc-entry",
5470
5482
  "data-kind": e.kind,
@@ -5474,43 +5486,43 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
5474
5486
  size: 14,
5475
5487
  "aria-hidden": "true"
5476
5488
  })),
5477
- e.kind === "file" ? (y(), i("span", ad, [s(Ku, {
5489
+ e.kind === "file" ? (y(), i("span", od, [s(qu, {
5478
5490
  path: j(e.name),
5479
5491
  label: e.name
5480
- }, null, 8, ["path", "label"])])) : (y(), i("span", od, O(e.name), 1)),
5481
- e.kind === "file" ? (y(), i("span", sd, O(k(Wl)(k(l).t, e.bytes)), 1)) : r("v-if", !0)
5482
- ], 8, id))), 128)), s(yu, {
5492
+ }, null, 8, ["path", "label"])])) : (y(), i("span", sd, O(e.name), 1)),
5493
+ e.kind === "file" ? (y(), i("span", cd, O(k(Gl)(k(l).t, e.bytes)), 1)) : r("v-if", !0)
5494
+ ], 8, ad))), 128)), s(bu, {
5483
5495
  count: h.value.length,
5484
5496
  open: w.value,
5485
5497
  onToggle: o[0] ||= (e) => w.value = !w.value
5486
- }, null, 8, ["count", "open"])])) : (y(), n(Tu, {
5498
+ }, null, 8, ["count", "open"])])) : (y(), n(Eu, {
5487
5499
  key: 1,
5488
5500
  class: "kvc-block",
5489
- lines: k(gu)(f.value.content, f.value.fromLine),
5501
+ lines: k(_u)(f.value.content, f.value.fromLine),
5490
5502
  "data-test": "call-content"
5491
- }, null, 8, ["lines"])) : (y(), i("p", nd, O(k(l).t("kvcoder.ui.call.replacements", {
5503
+ }, null, 8, ["lines"])) : (y(), i("p", rd, O(k(l).t("kvcoder.ui.call.replacements", {
5492
5504
  count: d.value.replacements,
5493
5505
  line: d.value.firstChangedLine
5494
5506
  })), 1));
5495
5507
  }
5496
- }), gd = {
5508
+ }), _d = {
5497
5509
  key: 0,
5498
5510
  class: "kvc-summary",
5499
5511
  "data-test": "call-summary"
5500
- }, _d = {
5512
+ }, vd = {
5501
5513
  key: 0,
5502
5514
  "data-test": "call-words"
5503
- }, vd = {
5515
+ }, yd = {
5504
5516
  key: 1,
5505
5517
  class: "kvc-mono",
5506
5518
  "data-test": "call-subject"
5507
- }, yd = ["dir"], bd = {
5519
+ }, bd = ["dir"], xd = {
5508
5520
  key: 1,
5509
5521
  class: "kvc-muted",
5510
5522
  dir: "ltr",
5511
5523
  style: { "align-self": "flex-start" },
5512
5524
  "data-test": "call-label"
5513
- }, xd = /* @__PURE__ */ c({
5525
+ }, Sd = /* @__PURE__ */ c({
5514
5526
  __name: "CallSummaryLine",
5515
5527
  props: {
5516
5528
  view: {},
@@ -5518,58 +5530,58 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
5518
5530
  whole: { type: Boolean }
5519
5531
  },
5520
5532
  setup(e) {
5521
- let n = e, a = q(), o = t(() => iu(a.t, n.view, n.result)), s = t(() => /\p{L}/u.test(o.value?.outcome ?? "") ? void 0 : "ltr"), c = t(() => o.value?.subject === void 0 || n.whole === !0 ? o.value?.subject : on(o.value.subject));
5522
- return (e, t) => o.value === void 0 ? n.view.label ? (y(), i("span", bd, O(n.view.label), 1)) : r("v-if", !0) : (y(), i("span", gd, [
5523
- o.value.words ? (y(), i("span", _d, O(o.value.words), 1)) : r("v-if", !0),
5524
- c.value ? (y(), i("span", vd, O(c.value), 1)) : r("v-if", !0),
5533
+ let n = e, a = q(), o = t(() => au(a.t, n.view, n.result)), s = t(() => /\p{L}/u.test(o.value?.outcome ?? "") ? void 0 : "ltr"), c = t(() => o.value?.subject === void 0 || n.whole === !0 ? o.value?.subject : on(o.value.subject));
5534
+ return (e, t) => o.value === void 0 ? n.view.label ? (y(), i("span", xd, O(n.view.label), 1)) : r("v-if", !0) : (y(), i("span", _d, [
5535
+ o.value.words ? (y(), i("span", vd, O(o.value.words), 1)) : r("v-if", !0),
5536
+ c.value ? (y(), i("span", yd, O(c.value), 1)) : r("v-if", !0),
5525
5537
  o.value.outcome ? (y(), i("span", {
5526
5538
  key: 2,
5527
5539
  class: "kvc-muted",
5528
5540
  dir: s.value,
5529
5541
  "data-test": "call-outcome"
5530
- }, O(o.value.outcome), 9, yd)) : r("v-if", !0)
5542
+ }, O(o.value.outcome), 9, bd)) : r("v-if", !0)
5531
5543
  ]));
5532
5544
  }
5533
- }), Sd = ["aria-expanded", "disabled"], Cd = ["aria-label"], wd = { class: "kvc-lines" }, Td = {
5545
+ }), Cd = ["aria-expanded", "disabled"], wd = ["aria-label"], Td = { class: "kvc-lines" }, Ed = {
5534
5546
  key: 0,
5535
5547
  style: { "font-weight": "600" },
5536
5548
  "data-test": "call-description"
5537
- }, Ed = {
5549
+ }, Dd = {
5538
5550
  key: 1,
5539
5551
  class: "kvc-oneline",
5540
5552
  "data-test": "call-line"
5541
- }, Dd = { class: "kvc-mono" }, Od = {
5553
+ }, Od = { class: "kvc-mono" }, kd = {
5542
5554
  key: 2,
5543
5555
  class: "kvc-chip kvc-warn",
5544
5556
  "data-test": "call-risky"
5545
- }, kd = {
5557
+ }, Ad = {
5546
5558
  key: 3,
5547
5559
  class: "kvc-chip",
5548
5560
  "data-test": "call-background"
5549
- }, Ad = {
5561
+ }, jd = {
5550
5562
  key: 4,
5551
5563
  class: "kvc-chip",
5552
5564
  "data-test": "call-not-run"
5553
- }, jd = {
5565
+ }, Md = {
5554
5566
  key: 5,
5555
5567
  class: "kvc-muted",
5556
5568
  "data-test": "call-exit"
5557
- }, Md = {
5569
+ }, Nd = {
5558
5570
  key: 6,
5559
5571
  class: "kvc-chip kvc-danger",
5560
5572
  "data-test": "call-failed"
5561
- }, Nd = {
5573
+ }, Pd = {
5562
5574
  class: "kvc-muted",
5563
5575
  "data-test": "call-time"
5564
- }, Pd = {
5576
+ }, Fd = {
5565
5577
  key: 0,
5566
5578
  class: "kvc-muted kvc-call-parts",
5567
5579
  "data-test": "call-parts"
5568
- }, Fd = ["aria-expanded"], Id = ["aria-label"], Ld = {
5580
+ }, Id = ["aria-expanded"], Ld = ["aria-label"], Rd = {
5569
5581
  key: 0,
5570
5582
  class: "kvc-result-images",
5571
5583
  "data-test": "call-images"
5572
- }, Rd = ["href", "title"], zd = ["src", "alt"], Bd = /* @__PURE__ */ c({
5584
+ }, zd = ["href", "title"], Bd = ["src", "alt"], Vd = /* @__PURE__ */ c({
5573
5585
  __name: "CallCard",
5574
5586
  props: {
5575
5587
  view: {},
@@ -5584,7 +5596,7 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
5584
5596
  let c = o, l = q(), u = t(() => an(c.view)), d = x(!1), f = x(!1), p = t(() => c.failed === !0 && c.exited === void 0 && c.output !== void 0 ? tc(c.output) : void 0), h = t(() => p.value?.kind === "invalid"), g = t(() => {
5585
5597
  let e = p.value;
5586
5598
  return e === void 0 ? "" : e.kind === "error" ? e.message : l.t(`kvcoder.ui.failure.${e.kind}`);
5587
- }), _ = t(() => c.failed === !0 ? void 0 : Hl(c.output)), v = t(() => c.failed === !0 && u.value !== "line"), b = t(() => c.durationMs === void 0 ? "" : it(l.t, (c.view.writtenMs ?? 0) + c.durationMs)), C = t(() => {
5599
+ }), _ = t(() => c.failed === !0 ? void 0 : Ul(c.output)), v = t(() => c.failed === !0 && u.value !== "line"), b = t(() => c.durationMs === void 0 ? "" : it(l.t, (c.view.writtenMs ?? 0) + c.durationMs)), C = t(() => {
5588
5600
  if (c.durationMs === void 0) return "";
5589
5601
  let e = it(l.t, c.durationMs);
5590
5602
  return c.view.writtenMs === void 0 ? l.t("kvcoder.ui.callRan", { ran: e }) : l.t("kvcoder.ui.callParts", {
@@ -5611,14 +5623,14 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
5611
5623
  key: 0,
5612
5624
  class: "kvc-spin",
5613
5625
  "aria-label": k(l).t("kvcoder.ui.running")
5614
- }, null, 8, Cd)) : (y(), n(T(d.value ? k(fe) : k(W)), {
5626
+ }, null, 8, wd)) : (y(), n(T(d.value ? k(fe) : k(W)), {
5615
5627
  key: 1,
5616
5628
  size: 16,
5617
5629
  "aria-hidden": "true"
5618
5630
  })),
5619
- a("span", wd, [
5620
- c.view.description ? (y(), i("span", Td, O(c.view.description), 1)) : c.view.connector === void 0 && c.view.line ? (y(), i("span", Ed, [a("span", Dd, O(k(on)(c.view.line)), 1)])) : r("v-if", !0),
5621
- s(xd, {
5631
+ a("span", Td, [
5632
+ c.view.description ? (y(), i("span", Ed, O(c.view.description), 1)) : c.view.connector === void 0 && c.view.line ? (y(), i("span", Dd, [a("span", Od, O(k(on)(c.view.line)), 1)])) : r("v-if", !0),
5633
+ s(Sd, {
5622
5634
  view: c.view,
5623
5635
  result: _.value
5624
5636
  }, null, 8, ["view", "result"]),
@@ -5629,12 +5641,12 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
5629
5641
  "data-test": "call-reason"
5630
5642
  }, O(g.value), 3))
5631
5643
  ]),
5632
- c.view.risky ? (y(), i("span", Od, O(k(l).t("kvcoder.ui.call.risky")), 1)) : r("v-if", !0),
5633
- c.view.background ? (y(), i("span", kd, O(k(l).t("kvcoder.ui.jobs.background")), 1)) : r("v-if", !0),
5634
- h.value ? (y(), i("span", Ad, O(k(l).t("kvcoder.ui.callNotRun")), 1)) : c.exited === void 0 ? c.failed ? (y(), i("span", Md, O(k(l).t("kvcoder.ui.callFailed")), 1)) : r("v-if", !0) : (y(), i("span", jd, O(k(l).t("kvcoder.ui.call.exit", { code: c.exited })), 1)),
5635
- a("span", Nd, O(b.value), 1)
5636
- ], 8, Sd),
5637
- s(Fl, {
5644
+ c.view.risky ? (y(), i("span", kd, O(k(l).t("kvcoder.ui.call.risky")), 1)) : r("v-if", !0),
5645
+ c.view.background ? (y(), i("span", Ad, O(k(l).t("kvcoder.ui.jobs.background")), 1)) : r("v-if", !0),
5646
+ h.value ? (y(), i("span", jd, O(k(l).t("kvcoder.ui.callNotRun")), 1)) : c.exited === void 0 ? c.failed ? (y(), i("span", Nd, O(k(l).t("kvcoder.ui.callFailed")), 1)) : r("v-if", !0) : (y(), i("span", Md, O(k(l).t("kvcoder.ui.call.exit", { code: c.exited })), 1)),
5647
+ a("span", Pd, O(b.value), 1)
5648
+ ], 8, Cd),
5649
+ s(Il, {
5638
5650
  view: c.view,
5639
5651
  result: _.value,
5640
5652
  ran: c.output !== void 0 && c.failed !== !0 && c.running !== !0
@@ -5643,20 +5655,20 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
5643
5655
  "result",
5644
5656
  "ran"
5645
5657
  ]),
5646
- d.value && c.output !== void 0 ? (y(), i(e, { key: 0 }, [C.value === "" ? r("v-if", !0) : (y(), i("p", Pd, O(C.value), 1)), v.value ? (y(), i(e, { key: 1 }, [a("button", {
5658
+ d.value && c.output !== void 0 ? (y(), i(e, { key: 0 }, [C.value === "" ? r("v-if", !0) : (y(), i("p", Fd, O(C.value), 1)), v.value ? (y(), i(e, { key: 1 }, [a("button", {
5647
5659
  type: "button",
5648
5660
  class: "kvc-text-button kvc-fold",
5649
5661
  "aria-expanded": f.value,
5650
5662
  "data-test": "call-details",
5651
5663
  onClick: o[1] ||= (e) => f.value = !f.value
5652
- }, O(k(l).t(f.value ? "kvcoder.ui.call.hideDetails" : "kvcoder.ui.call.showDetails")), 9, Fd), f.value ? (y(), i(e, { key: 0 }, [a("pre", {
5664
+ }, O(k(l).t(f.value ? "kvcoder.ui.call.hideDetails" : "kvcoder.ui.call.showDetails")), 9, Id), f.value ? (y(), i(e, { key: 0 }, [a("pre", {
5653
5665
  class: "kvc-block kvc-error",
5654
5666
  dir: "auto",
5655
5667
  "aria-label": k(l).t("kvcoder.ui.call.error"),
5656
5668
  "data-test": "call-error"
5657
- }, [s(X, { text: c.output }, null, 8, ["text"])], 8, Id), s(Vu, { view: c.view }, null, 8, ["view"])], 64)) : r("v-if", !0)], 64)) : (y(), i(e, { key: 2 }, [
5658
- s(Vu, { view: c.view }, null, 8, ["view"]),
5659
- s(hd, {
5669
+ }, [s(X, { text: c.output }, null, 8, ["text"])], 8, Ld), s(Hu, { view: c.view }, null, 8, ["view"])], 64)) : r("v-if", !0)], 64)) : (y(), i(e, { key: 2 }, [
5670
+ s(Hu, { view: c.view }, null, 8, ["view"]),
5671
+ s(gd, {
5660
5672
  view: c.view,
5661
5673
  output: c.output,
5662
5674
  result: _.value
@@ -5665,7 +5677,7 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
5665
5677
  "output",
5666
5678
  "result"
5667
5679
  ]),
5668
- (c.images ?? []).length > 0 ? (y(), i("div", Ld, [(y(!0), i(e, null, S(c.images, (e) => (y(), i("a", {
5680
+ (c.images ?? []).length > 0 ? (y(), i("div", Rd, [(y(!0), i(e, null, S(c.images, (e) => (y(), i("a", {
5669
5681
  key: e.fileId,
5670
5682
  href: e.url,
5671
5683
  target: "_blank",
@@ -5676,52 +5688,52 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
5676
5688
  src: e.url,
5677
5689
  alt: e.name,
5678
5690
  loading: "lazy"
5679
- }, null, 8, zd)], 8, Rd))), 128))])) : r("v-if", !0)
5691
+ }, null, 8, Bd)], 8, zd))), 128))])) : r("v-if", !0)
5680
5692
  ], 64))], 64)) : r("v-if", !0)
5681
5693
  ], 2));
5682
5694
  }
5683
- }), Vd = {
5695
+ }), Hd = {
5684
5696
  key: 1,
5685
5697
  class: "kvc-card",
5686
5698
  "data-test": "kvcoder-hint"
5687
- }, Hd = { class: "kvc-card-row" }, Ud = { class: "kvc-card-body kvc-muted" }, Wd = {
5699
+ }, Ud = { class: "kvc-card-row" }, Wd = { class: "kvc-card-body kvc-muted" }, Gd = {
5688
5700
  key: 0,
5689
5701
  style: {
5690
5702
  display: "flex",
5691
5703
  gap: "6px",
5692
5704
  "margin-block-start": "6px"
5693
5705
  }
5694
- }, Gd = ["src", "alt"], Kd = {
5706
+ }, Kd = ["src", "alt"], qd = {
5695
5707
  key: 1,
5696
5708
  class: "kvc-muted",
5697
5709
  style: { display: "block" },
5698
5710
  "data-test": "queued"
5699
- }, qd = {
5711
+ }, Jd = {
5700
5712
  key: 3,
5701
5713
  class: "kvc-message-actions"
5702
- }, Jd = ["data-final"], Yd = {
5714
+ }, Yd = ["data-final"], Xd = {
5703
5715
  key: 0,
5704
5716
  "data-test": "thinking"
5705
- }, Xd = { class: "kvc-muted" }, Zd = {
5717
+ }, Zd = { class: "kvc-muted" }, Qd = {
5706
5718
  class: "kvc-muted",
5707
5719
  style: { "white-space": "pre-wrap" }
5708
- }, Qd = {
5720
+ }, $d = {
5709
5721
  key: 7,
5710
5722
  "data-test": "extension-card"
5711
- }, $d = {
5723
+ }, ef = {
5712
5724
  key: 9,
5713
5725
  class: "kvc-notice",
5714
5726
  "data-test": "notice"
5715
- }, ef = {
5727
+ }, tf = {
5716
5728
  key: 10,
5717
5729
  class: "kvc-card kvc-card-row",
5718
5730
  role: "note",
5719
5731
  "data-test": "note"
5720
- }, tf = {
5732
+ }, nf = {
5721
5733
  key: 11,
5722
5734
  class: "kvc-card",
5723
5735
  "data-test": "summary"
5724
- }, nf = { class: "kvc-card-row" }, rf = { class: "kvc-card-body" }, af = /* @__PURE__ */ c({
5736
+ }, rf = { class: "kvc-card-row" }, af = { class: "kvc-card-body" }, of = /* @__PURE__ */ c({
5725
5737
  __name: "MessageItem",
5726
5738
  props: {
5727
5739
  message: {},
@@ -5732,20 +5744,24 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
5732
5744
  },
5733
5745
  emits: ["openArtifact", "rewound"],
5734
5746
  setup(c, { emit: l }) {
5735
- let u = c, d = l, f = x(), p = t(() => u.message.source?.kind === "user" && Gs(g.value).trim() !== ""), h = q(), g = t(() => Z(u.message.content.content)), _ = t(() => Ds(u.message)), v = t(() => As(u.message, u.calls)), b = t(() => Ls(u.message)), C = t(() => Bs(u.message)), w = t(() => zs(u.message).map((e) => ({
5747
+ let u = c, d = l, f = x(), p = t(() => u.message.source?.kind === "user" && Gs(g.value).trim() !== ""), h = q(), g = t(() => Z(u.message.content.content)), _ = t(() => Ds(u.message)), v = t(() => As(u.message, u.calls)), b = t(() => Ls(u.message)), C = t(() => {
5748
+ if (b.value?.format !== "url") return;
5749
+ let e = u.calls.get(String(u.message.content.toolCallId))?.fields?.content;
5750
+ return typeof e == "string" ? rt(e, window.location) : void 0;
5751
+ }), w = t(() => Bs(u.message)), E = t(() => zs(u.message).map((e) => ({
5736
5752
  ...e,
5737
- url: M(e.fileId)
5738
- }))), E = t(() => Zs(u.message)), D = t(() => Ps(u.message, u.calls)), A = t(() => {
5753
+ url: N(e.fileId)
5754
+ }))), D = t(() => Zs(u.message)), A = t(() => Ps(u.message, u.calls)), j = t(() => {
5739
5755
  let e = J(u.message.content.params), t = typeof e.code == "string" ? e.code : void 0, n = Object.fromEntries(Object.entries(dt(e.details)).map(([e, t]) => [e, yt(t)])), r = t === void 0 ? {} : { error: h.t(ct(t), n) }, i = ht(e.details), a = String(u.message.content.code);
5740
5756
  return h.t(`kvcoder.notices.${i === void 0 || a !== "STEP_FAILED" ? a : "STEP_FAILED_REASON"}`, {
5741
5757
  ...e,
5742
5758
  ...r,
5743
5759
  ...i === void 0 ? {} : { reason: yt(i) }
5744
5760
  });
5745
- }), j = t(() => {
5761
+ }), M = t(() => {
5746
5762
  let e = u.message.content.params;
5747
5763
  return h.t(String(u.message.content.key), typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : {});
5748
- }), M = (e) => `/api/files/${encodeURIComponent(e)}?workspaceId=${encodeURIComponent(h.workspace.value.id)}`, N = (e) => ({
5764
+ }), N = (e) => `/api/files/${encodeURIComponent(e)}?workspaceId=${encodeURIComponent(h.workspace.value.id)}`, P = (e) => ({
5749
5765
  type: "markdown",
5750
5766
  text: "kvcoder.markdown",
5751
5767
  params: { text: e }
@@ -5754,10 +5770,10 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
5754
5770
  key: 0,
5755
5771
  message: u.message,
5756
5772
  "finished-runs": u.finishedRuns
5757
- }, null, 8, ["message", "finished-runs"])) : k(Fs)(u.message) ? (y(), i("div", Vd, [a("details", null, [a("summary", Hd, [s(k(Ee), {
5773
+ }, null, 8, ["message", "finished-runs"])) : k(Fs)(u.message) ? (y(), i("div", Hd, [a("details", null, [a("summary", Ud, [s(k(Ee), {
5758
5774
  size: 16,
5759
5775
  "aria-hidden": "true"
5760
- }), o(O(k(h).t("kvcoder.ui.toModel")), 1)]), a("div", Ud, O(g.value), 1)])])) : u.message.kind === "user" && f.value === "edit" ? (y(), n(Bc, {
5776
+ }), o(O(k(h).t("kvcoder.ui.toModel")), 1)]), a("div", Wd, O(g.value), 1)])])) : u.message.kind === "user" && f.value === "edit" ? (y(), n(Bc, {
5761
5777
  key: 2,
5762
5778
  message: u.message,
5763
5779
  onCancel: c[0] ||= (e) => f.value = void 0,
@@ -5771,23 +5787,23 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
5771
5787
  "data-test": "user-message"
5772
5788
  }, [
5773
5789
  a("span", null, O(k(Us)(g.value, k(h).t("kvcoder.ui.attachedFiles"))), 1),
5774
- u.message.fileIds ? (y(), i("span", Wd, [(y(!0), i(e, null, S(u.message.fileIds, (e) => (y(), i("img", {
5790
+ u.message.fileIds ? (y(), i("span", Gd, [(y(!0), i(e, null, S(u.message.fileIds, (e) => (y(), i("img", {
5775
5791
  key: e,
5776
- src: M(e),
5792
+ src: N(e),
5777
5793
  alt: k(h).t("kvcoder.ui.attachment"),
5778
5794
  style: {
5779
5795
  "block-size": "48px",
5780
5796
  "border-radius": "6px"
5781
5797
  }
5782
- }, null, 8, Gd))), 128))])) : r("v-if", !0),
5783
- u.message.queued ? (y(), i("span", Kd, O(k(h).t("kvcoder.ui.queued")), 1)) : f.value === "undo" ? (y(), n(Gc, {
5798
+ }, null, 8, Kd))), 128))])) : r("v-if", !0),
5799
+ u.message.queued ? (y(), i("span", qd, O(k(h).t("kvcoder.ui.queued")), 1)) : f.value === "undo" ? (y(), n(Gc, {
5784
5800
  key: 2,
5785
5801
  message: u.message,
5786
5802
  onCancel: c[2] ||= (e) => f.value = void 0,
5787
5803
  onDone: c[3] ||= (e, t) => {
5788
5804
  f.value = void 0, d("rewound", t, e);
5789
5805
  }
5790
- }, null, 8, ["message"])) : u.rewind?.edit || u.rewind?.undo || p.value ? (y(), i("span", qd, [
5806
+ }, null, 8, ["message"])) : u.rewind?.edit || u.rewind?.undo || p.value ? (y(), i("span", Jd, [
5791
5807
  u.rewind?.edit ? (y(), i("button", {
5792
5808
  key: 0,
5793
5809
  type: "button",
@@ -5812,28 +5828,30 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
5812
5828
  class: m(["kvc-answer", { "kvc-final": u.final === !0 && g.value !== "" }]),
5813
5829
  "data-final": u.final === !0 && g.value !== "" ? "true" : void 0,
5814
5830
  "data-test": "assistant-message"
5815
- }, [_.value === "" ? r("v-if", !0) : (y(), i("details", Yd, [a("summary", Xd, O(k(h).t("kvcoder.ui.thought")), 1), a("p", Zd, O(_.value), 1)])), g.value === "" ? r("v-if", !0) : (y(), n(T(k(h).View), {
5831
+ }, [_.value === "" ? r("v-if", !0) : (y(), i("details", Xd, [a("summary", Zd, O(k(h).t("kvcoder.ui.thought")), 1), a("p", Qd, O(_.value), 1)])), g.value === "" ? r("v-if", !0) : (y(), n(T(k(h).View), {
5816
5832
  key: 1,
5817
- view: N(g.value)
5818
- }, null, 8, ["view"]))], 10, Jd)) : u.message.kind === "toolResult" && b.value !== void 0 ? (y(), n(Ml, {
5833
+ view: P(g.value)
5834
+ }, null, 8, ["view"]))], 10, Yd)) : u.message.kind === "toolResult" && b.value !== void 0 ? (y(), n(Nl, {
5819
5835
  key: 5,
5820
5836
  id: b.value.id,
5821
5837
  title: b.value.title,
5822
5838
  format: b.value.format,
5823
5839
  version: b.value.version,
5840
+ address: C.value,
5824
5841
  onOpen: c[6] ||= (e) => d("openArtifact", e)
5825
5842
  }, null, 8, [
5826
5843
  "id",
5827
5844
  "title",
5828
5845
  "format",
5829
- "version"
5830
- ])) : D.value === void 0 ? C.value === void 0 ? u.message.kind === "toolResult" ? (y(), i(e, { key: 8 }, [s(Bd, {
5846
+ "version",
5847
+ "address"
5848
+ ])) : A.value === void 0 ? w.value === void 0 ? u.message.kind === "toolResult" ? (y(), i(e, { key: 8 }, [s(Vd, {
5831
5849
  view: v.value,
5832
5850
  failed: v.value.failed,
5833
5851
  "duration-ms": v.value.durationMs,
5834
5852
  output: v.value.output,
5835
5853
  exited: k(js)(v.value) ? v.value.exitCode : void 0,
5836
- images: w.value
5854
+ images: E.value
5837
5855
  }, null, 8, [
5838
5856
  "view",
5839
5857
  "failed",
@@ -5841,41 +5859,41 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
5841
5859
  "output",
5842
5860
  "exited",
5843
5861
  "images"
5844
- ]), E.value === void 0 ? r("v-if", !0) : (y(), n(go, {
5862
+ ]), D.value === void 0 ? r("v-if", !0) : (y(), n(go, {
5845
5863
  key: 0,
5846
5864
  "session-id": u.message.sessionId,
5847
- "run-id": E.value
5848
- }, null, 8, ["session-id", "run-id"]))], 64)) : u.message.kind === "notice" ? (y(), i("div", $d, O(A.value), 1)) : u.message.kind === "note" ? (y(), i("div", ef, [s(k(Oe), {
5865
+ "run-id": D.value
5866
+ }, null, 8, ["session-id", "run-id"]))], 64)) : u.message.kind === "notice" ? (y(), i("div", ef, O(j.value), 1)) : u.message.kind === "note" ? (y(), i("div", tf, [s(k(Oe), {
5849
5867
  size: 18,
5850
5868
  "aria-hidden": "true"
5851
- }), o(O(j.value), 1)])) : u.message.kind === "summary" ? (y(), i("details", tf, [a("summary", nf, [s(k(Ie), {
5869
+ }), o(O(M.value), 1)])) : u.message.kind === "summary" ? (y(), i("details", nf, [a("summary", rf, [s(k(Ie), {
5852
5870
  size: 16,
5853
5871
  "aria-hidden": "true"
5854
- }), o(O(k(h).t("kvcoder.ui.summarized")), 1)]), a("div", rf, [(y(), n(T(k(h).View), { view: N(String(u.message.content.text ?? "")) }, null, 8, ["view"]))])])) : r("v-if", !0) : (y(), i("div", Qd, [(y(), n(T(k(h).View), { view: {
5872
+ }), o(O(k(h).t("kvcoder.ui.summarized")), 1)]), a("div", af, [(y(), n(T(k(h).View), { view: P(String(u.message.content.text ?? "")) }, null, 8, ["view"]))])])) : r("v-if", !0) : (y(), i("div", $d, [(y(), n(T(k(h).View), { view: {
5855
5873
  type: "custom",
5856
- component: C.value.component,
5857
- props: C.value.props
5874
+ component: w.value.component,
5875
+ props: w.value.props
5858
5876
  } }, null, 8, ["view"]))])) : (y(), n(xl, {
5859
5877
  key: 6,
5860
- answered: D.value
5878
+ answered: A.value
5861
5879
  }, null, 8, ["answered"]));
5862
5880
  }
5863
- }), of = ["aria-expanded"], sf = { class: "kvc-oneline kvc-fold-words" }, cf = {
5881
+ }), sf = ["aria-expanded"], cf = { class: "kvc-oneline kvc-fold-words" }, lf = {
5864
5882
  class: "kvc-muted",
5865
5883
  dir: "auto",
5866
5884
  "data-test": "call-fold-headline"
5867
- }, lf = { "data-test": "call-fold-words" }, uf = {
5885
+ }, uf = { "data-test": "call-fold-words" }, df = {
5868
5886
  key: 1,
5869
5887
  class: "kvc-fold-failed",
5870
5888
  "data-test": "call-fold-failed"
5871
- }, df = {
5889
+ }, ff = {
5872
5890
  class: "kvc-muted",
5873
5891
  "data-test": "call-fold-time"
5874
- }, ff = {
5892
+ }, pf = {
5875
5893
  key: 0,
5876
5894
  class: "kvc-fold-body",
5877
5895
  "data-test": "call-fold-body"
5878
- }, pf = /* @__PURE__ */ c({
5896
+ }, mf = /* @__PURE__ */ c({
5879
5897
  __name: "CallFold",
5880
5898
  props: {
5881
5899
  messages: {},
@@ -5906,13 +5924,13 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
5906
5924
  size: 16,
5907
5925
  "aria-hidden": "true"
5908
5926
  })),
5909
- a("span", sf, [
5910
- s.headline === void 0 ? r("v-if", !0) : (y(), i(e, { key: 0 }, [a("span", cf, O(s.headline), 1), o[1] ||= a("span", { class: "kvc-muted" }, " · ", -1)], 64)),
5911
- a("span", lf, O(u.value.words), 1),
5912
- u.value.failed === void 0 ? r("v-if", !0) : (y(), i("span", uf, " · " + O(u.value.failed), 1))
5927
+ a("span", cf, [
5928
+ s.headline === void 0 ? r("v-if", !0) : (y(), i(e, { key: 0 }, [a("span", lf, O(s.headline), 1), o[1] ||= a("span", { class: "kvc-muted" }, " · ", -1)], 64)),
5929
+ a("span", uf, O(u.value.words), 1),
5930
+ u.value.failed === void 0 ? r("v-if", !0) : (y(), i("span", df, " · " + O(u.value.failed), 1))
5913
5931
  ]),
5914
- a("span", df, O(k(it)(k(c).t, l.value.ms)), 1)
5915
- ], 8, of), f.value ? (y(), i("div", ff, [(y(!0), i(e, null, S(s.messages, (e) => (y(), n(af, {
5932
+ a("span", ff, O(k(it)(k(c).t, l.value.ms)), 1)
5933
+ ], 8, sf), f.value ? (y(), i("div", pf, [(y(!0), i(e, null, S(s.messages, (e) => (y(), n(of, {
5916
5934
  key: e.id,
5917
5935
  message: e,
5918
5936
  calls: s.calls,
@@ -5923,50 +5941,50 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
5923
5941
  "finished-runs"
5924
5942
  ]))), 128))])) : r("v-if", !0)], 2));
5925
5943
  }
5926
- }), mf = {
5944
+ }), hf = {
5927
5945
  class: "kvc-card kvc-ask",
5928
5946
  "data-test": "approvals-card"
5929
- }, hf = {
5947
+ }, gf = {
5930
5948
  class: "kvc-card-row",
5931
5949
  style: { "font-weight": "600" }
5932
- }, gf = ["data-test"], _f = { class: "kvc-card-row" }, vf = { class: "kvc-lines" }, yf = {
5950
+ }, _f = ["data-test"], vf = { class: "kvc-card-row" }, yf = { class: "kvc-lines" }, bf = {
5933
5951
  key: 0,
5934
5952
  style: { "font-weight": "600" },
5935
5953
  "data-test": "call-description"
5936
- }, bf = {
5954
+ }, xf = {
5937
5955
  key: 2,
5938
5956
  dir: "ltr",
5939
5957
  style: { "align-self": "flex-start" },
5940
5958
  "data-test": "call-subject"
5941
- }, xf = {
5959
+ }, Sf = {
5942
5960
  key: 3,
5943
5961
  class: "kvc-chip",
5944
5962
  style: { "align-self": "flex-start" },
5945
5963
  "data-test": "call-background"
5946
- }, Sf = {
5964
+ }, Cf = {
5947
5965
  class: "kvc-card-row kvc-always",
5948
5966
  "data-test": "always"
5949
- }, Cf = ["aria-expanded", "onClick"], wf = ["for"], Tf = [
5967
+ }, wf = ["aria-expanded", "onClick"], Tf = ["for"], Ef = [
5950
5968
  "id",
5951
5969
  "value",
5952
5970
  "onInput"
5953
- ], Ef = ["disabled", "onClick"], Df = ["onClick"], Of = {
5971
+ ], Df = ["disabled", "onClick"], Of = ["onClick"], kf = {
5954
5972
  key: 1,
5955
5973
  class: "kvc-card-row kvc-reason",
5956
5974
  "data-test": "deny-reason"
5957
- }, kf = [
5975
+ }, Af = [
5958
5976
  "value",
5959
5977
  "aria-label",
5960
5978
  "placeholder",
5961
5979
  "onInput"
5962
- ], Af = ["onClick"], jf = {
5980
+ ], jf = ["onClick"], Mf = {
5963
5981
  class: "kvc-card-row kvc-actions",
5964
5982
  "data-test": "decision-actions"
5965
- }, Mf = ["onClick"], Nf = ["onClick"], Pf = {
5983
+ }, Nf = ["onClick"], Pf = ["onClick"], Ff = {
5966
5984
  key: 0,
5967
5985
  class: "kvc-card-row kvc-actions",
5968
5986
  style: { "border-block-start": "1px solid var(--kv-color-border)" }
5969
- }, Ff = /* @__PURE__ */ c({
5987
+ }, If = /* @__PURE__ */ c({
5970
5988
  __name: "ApprovalsCard",
5971
5989
  props: { approvals: {} },
5972
5990
  emits: ["decide"],
@@ -6003,8 +6021,8 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
6003
6021
  ...t === "" ? {} : { reason: t }
6004
6022
  });
6005
6023
  }
6006
- return (t, c) => (y(), i("section", mf, [
6007
- a("div", hf, [s(k(Re), {
6024
+ return (t, c) => (y(), i("section", hf, [
6025
+ a("div", gf, [s(k(Re), {
6008
6026
  size: 18,
6009
6027
  "aria-hidden": "true"
6010
6028
  }), o(O(k(d).t("kvcoder.ui.allowCommands", { count: l.approvals.length })), 1)]),
@@ -6013,34 +6031,34 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
6013
6031
  class: "kvc-approval",
6014
6032
  "data-test": `approval-${t.questionId}`
6015
6033
  }, [
6016
- a("div", _f, [a("span", vf, [
6017
- t.view.description ? (y(), i("span", yf, O(t.view.description), 1)) : r("v-if", !0),
6018
- t.view.connector === void 0 ? t.view.line ? (y(), i("span", bf, [a("span", { class: m(["kvc-mono", { "kvc-muted": t.view.description }]) }, O(t.view.line), 3)])) : r("v-if", !0) : (y(), n(xd, {
6034
+ a("div", vf, [a("span", yf, [
6035
+ t.view.description ? (y(), i("span", bf, O(t.view.description), 1)) : r("v-if", !0),
6036
+ t.view.connector === void 0 ? t.view.line ? (y(), i("span", xf, [a("span", { class: m(["kvc-mono", { "kvc-muted": t.view.description }]) }, O(t.view.line), 3)])) : r("v-if", !0) : (y(), n(Sd, {
6019
6037
  key: 1,
6020
6038
  view: t.view,
6021
6039
  whole: ""
6022
6040
  }, null, 8, ["view"])),
6023
- t.view.background ? (y(), i("span", xf, O(k(d).t("kvcoder.ui.jobs.inBackground")), 1)) : r("v-if", !0)
6041
+ t.view.background ? (y(), i("span", Sf, O(k(d).t("kvcoder.ui.jobs.inBackground")), 1)) : r("v-if", !0)
6024
6042
  ])]),
6025
- s(Fl, {
6043
+ s(Il, {
6026
6044
  view: t.view,
6027
6045
  pending: ""
6028
6046
  }, null, 8, ["view"]),
6029
- k(an)(t.view) === "line" ? r("v-if", !0) : (y(), n(Vu, {
6047
+ k(an)(t.view) === "line" ? r("v-if", !0) : (y(), n(Hu, {
6030
6048
  key: 0,
6031
6049
  view: t.view
6032
6050
  }, null, 8, ["view"])),
6033
- a("div", Sf, [a("button", {
6051
+ a("div", Cf, [a("button", {
6034
6052
  type: "button",
6035
6053
  class: "kvc-link-button",
6036
6054
  "aria-expanded": v.has(t.questionId),
6037
6055
  "data-test": "deny-why",
6038
6056
  onClick: (e) => v.has(t.questionId) ? v.delete(t.questionId) : v.set(t.questionId, "")
6039
- }, O(k(d).t("kvcoder.ui.approval.denyWhy")), 9, Cf), h(t.view) === "line" ? (y(), i(e, { key: 0 }, [
6057
+ }, O(k(d).t("kvcoder.ui.approval.denyWhy")), 9, wf), h(t.view) === "line" ? (y(), i(e, { key: 0 }, [
6040
6058
  a("label", {
6041
6059
  class: "kvc-muted",
6042
6060
  for: `always-${t.questionId}`
6043
- }, O(k(d).t("kvcoder.ui.approval.alwaysLine")), 9, wf),
6061
+ }, O(k(d).t("kvcoder.ui.approval.alwaysLine")), 9, Tf),
6044
6062
  a("input", {
6045
6063
  id: `always-${t.questionId}`,
6046
6064
  value: x(t),
@@ -6048,22 +6066,22 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
6048
6066
  dir: "ltr",
6049
6067
  "data-test": "always-prefix",
6050
6068
  onInput: (e) => _.set(t.questionId, e.target.value)
6051
- }, null, 40, Tf),
6069
+ }, null, 40, Ef),
6052
6070
  a("button", {
6053
6071
  type: "button",
6054
6072
  class: "kvc-button",
6055
6073
  disabled: x(t).trim() === "",
6056
6074
  "data-test": "always-allow",
6057
6075
  onClick: (e) => C(t)
6058
- }, O(k(d).t("kvcoder.ui.approval.always")), 9, Ef)
6076
+ }, O(k(d).t("kvcoder.ui.approval.always")), 9, Df)
6059
6077
  ], 64)) : h(t.view) === "files" ? (y(), i("button", {
6060
6078
  key: 1,
6061
6079
  type: "button",
6062
6080
  class: "kvc-button",
6063
6081
  "data-test": "always-allow",
6064
6082
  onClick: (e) => C(t)
6065
- }, O(k(d).t("kvcoder.ui.approval.alwaysFiles")), 9, Df)) : r("v-if", !0)]),
6066
- v.has(t.questionId) ? (y(), i("div", Of, [a("textarea", {
6083
+ }, O(k(d).t("kvcoder.ui.approval.alwaysFiles")), 9, Of)) : r("v-if", !0)]),
6084
+ v.has(t.questionId) ? (y(), i("div", kf, [a("textarea", {
6067
6085
  value: v.get(t.questionId),
6068
6086
  class: "kvc-field",
6069
6087
  rows: "2",
@@ -6072,25 +6090,25 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
6072
6090
  placeholder: k(d).t("kvcoder.ui.approval.reason"),
6073
6091
  "data-test": "deny-reason-text",
6074
6092
  onInput: (e) => v.set(t.questionId, e.target.value)
6075
- }, null, 40, kf), a("button", {
6093
+ }, null, 40, Af), a("button", {
6076
6094
  type: "button",
6077
6095
  class: "kvc-button",
6078
6096
  "data-test": "deny-reason-send",
6079
6097
  onClick: (e) => w(t)
6080
- }, O(k(d).t("kvcoder.ui.deny")), 9, Af)])) : r("v-if", !0),
6081
- a("div", jf, [a("button", {
6098
+ }, O(k(d).t("kvcoder.ui.deny")), 9, jf)])) : r("v-if", !0),
6099
+ a("div", Mf, [a("button", {
6082
6100
  type: "button",
6083
6101
  class: "kvc-button",
6084
6102
  "data-test": "deny",
6085
6103
  onClick: (e) => f([t], !1)
6086
- }, O(k(d).t("kvcoder.ui.deny")), 9, Mf), a("button", {
6104
+ }, O(k(d).t("kvcoder.ui.deny")), 9, Nf), a("button", {
6087
6105
  type: "button",
6088
6106
  class: "kvc-button kvc-primary",
6089
6107
  "data-test": "allow",
6090
6108
  onClick: (e) => f([t], !0)
6091
- }, O(k(d).t("kvcoder.ui.allow")), 9, Nf)])
6092
- ], 8, gf))), 128)),
6093
- l.approvals.length > 1 ? (y(), i("div", Pf, [a("button", {
6109
+ }, O(k(d).t("kvcoder.ui.allow")), 9, Pf)])
6110
+ ], 8, _f))), 128)),
6111
+ l.approvals.length > 1 ? (y(), i("div", Ff, [a("button", {
6094
6112
  type: "button",
6095
6113
  class: "kvc-button",
6096
6114
  "data-test": "deny-all",
@@ -6103,13 +6121,13 @@ var vu = ["aria-expanded"], yu = /* @__PURE__ */ c({
6103
6121
  }, O(k(d).t("kvcoder.ui.allowAll")), 1)])) : r("v-if", !0)
6104
6122
  ]));
6105
6123
  }
6106
- }), If = /* @__PURE__ */ new Map();
6107
- function Lf(e) {
6108
- let t = If.get(e);
6109
- return t === void 0 && (t = b(/* @__PURE__ */ new Map()), If.set(e, t)), t;
6124
+ }), Lf = /* @__PURE__ */ new Map();
6125
+ function Rf(e) {
6126
+ let t = Lf.get(e);
6127
+ return t === void 0 && (t = b(/* @__PURE__ */ new Map()), Lf.set(e, t)), t;
6110
6128
  }
6111
- function Rf(e, t, n) {
6112
- let r = Lf(e), i = r.get(t);
6129
+ function zf(e, t, n) {
6130
+ let r = Rf(e), i = r.get(t);
6113
6131
  return i === void 0 ? (i = b({
6114
6132
  text: "",
6115
6133
  selected: [],
@@ -6120,55 +6138,55 @@ function Rf(e, t, n) {
6120
6138
  owner: n
6121
6139
  }), r.set(t, i)) : n !== void 0 && i.owner === void 0 && (i.owner = n), i;
6122
6140
  }
6123
- var zf = (e, t, n) => Lf(e).get(t) === n, Bf = (e) => new Set([...Lf(e)].filter(([, e]) => e.settled).map(([e]) => e));
6124
- function Vf(e) {
6141
+ var Bf = (e, t, n) => Rf(e).get(t) === n, Vf = (e) => new Set([...Rf(e)].filter(([, e]) => e.settled).map(([e]) => e));
6142
+ function Hf(e) {
6125
6143
  e.text = "", e.selected = [], e.other = "", e.error = void 0, e.sending = !1, e.settled = !0;
6126
6144
  }
6127
- function Hf(e, t, n) {
6128
- let r = Lf(e);
6145
+ function Uf(e, t, n) {
6146
+ let r = Rf(e);
6129
6147
  for (let [e, i] of r) {
6130
6148
  if (i.owner?.sessionId !== t) continue;
6131
6149
  let a = n.find((e) => e.id === i.owner?.turnId && e.sessionId === t);
6132
- a !== void 0 && (a.outcome === void 0 && a.endedAt === void 0 && a.pending.some((t) => t.questionId === e) || (Vf(i), r.delete(e)));
6150
+ a !== void 0 && (a.outcome === void 0 && a.endedAt === void 0 && a.pending.some((t) => t.questionId === e) || (Hf(i), r.delete(e)));
6133
6151
  }
6134
6152
  }
6135
6153
  //#endregion
6136
6154
  //#region web/src/QuestionCard.vue?vue&type=script&setup=true&lang.ts
6137
- var Uf = ["aria-label", "aria-busy"], Wf = {
6155
+ var Wf = ["aria-label", "aria-busy"], Gf = {
6138
6156
  class: "kvc-card-row",
6139
6157
  style: { "font-weight": "600" }
6140
- }, Gf = { dir: "auto" }, Kf = { class: "kvc-card-body" }, qf = {
6158
+ }, Kf = { dir: "auto" }, qf = { class: "kvc-card-body" }, Jf = {
6141
6159
  key: 0,
6142
6160
  role: "status",
6143
6161
  "data-test": "answer-sending"
6144
- }, Jf = {
6162
+ }, Yf = {
6145
6163
  key: 1,
6146
6164
  role: "alert",
6147
6165
  "data-test": "answer-error"
6148
- }, Yf = [
6166
+ }, Xf = [
6149
6167
  "disabled",
6150
6168
  "placeholder",
6151
6169
  "aria-label"
6152
- ], Xf = { class: "kvc-actions" }, Zf = ["disabled"], Qf = ["disabled"], $f = ["data-test"], ep = [
6170
+ ], Zf = { class: "kvc-actions" }, Qf = ["disabled"], $f = ["disabled"], ep = ["data-test"], tp = [
6153
6171
  "type",
6154
6172
  "checked",
6155
6173
  "disabled",
6156
6174
  "name",
6157
6175
  "onChange"
6158
- ], tp = { style: {
6176
+ ], np = { style: {
6159
6177
  display: "flex",
6160
6178
  "flex-direction": "column"
6161
- } }, np = { style: { "font-weight": "500" } }, rp = {
6179
+ } }, rp = { style: { "font-weight": "500" } }, ip = {
6162
6180
  key: 0,
6163
6181
  class: "kvc-muted"
6164
- }, ip = [
6182
+ }, ap = [
6165
6183
  "disabled",
6166
6184
  "placeholder",
6167
6185
  "aria-label"
6168
- ], ap = { class: "kvc-actions" }, op = ["disabled"], sp = ["disabled"], cp = {
6186
+ ], op = { class: "kvc-actions" }, sp = ["disabled"], cp = ["disabled"], lp = {
6169
6187
  key: 4,
6170
6188
  class: "kvc-actions"
6171
- }, lp = ["disabled"], up = ["disabled"], dp = /* @__PURE__ */ c({
6189
+ }, up = ["disabled"], dp = ["disabled"], fp = /* @__PURE__ */ c({
6172
6190
  __name: "QuestionCard",
6173
6191
  props: {
6174
6192
  questionId: {},
@@ -6177,7 +6195,7 @@ var Uf = ["aria-label", "aria-busy"], Wf = {
6177
6195
  },
6178
6196
  emits: ["answer"],
6179
6197
  setup(n, { emit: o }) {
6180
- let c = n, l = o, u = q(), d = t(() => String(c.question.kind ?? "text")), f = t(() => String(c.question.prompt ?? "")), p = t(() => el(c.question)), h = t(() => c.question.multiple === !0), g = t(() => c.question.other === !0), _ = t(() => Rf(u.workspace.value.id, c.questionId, c.owner)), v = t(() => ut(u.t, _.value.error));
6198
+ let c = n, l = o, u = q(), d = t(() => String(c.question.kind ?? "text")), f = t(() => String(c.question.prompt ?? "")), p = t(() => el(c.question)), h = t(() => c.question.multiple === !0), g = t(() => c.question.other === !0), _ = t(() => zf(u.workspace.value.id, c.questionId, c.owner)), v = t(() => ut(u.t, _.value.error));
6181
6199
  function b(e) {
6182
6200
  !_.value.sending && !_.value.settled && l("answer", {
6183
6201
  questionId: c.questionId,
@@ -6200,12 +6218,12 @@ var Uf = ["aria-label", "aria-busy"], Wf = {
6200
6218
  "data-test": "question-card",
6201
6219
  "aria-label": f.value,
6202
6220
  "aria-busy": _.value.sending
6203
- }, [a("div", Wf, [s(k(me), {
6221
+ }, [a("div", Gf, [s(k(me), {
6204
6222
  size: 18,
6205
6223
  "aria-hidden": "true"
6206
- }), a("span", Gf, O(f.value), 1)]), a("div", Kf, [
6207
- _.value.sending ? (y(), i("p", qf, O(k(u).t("kvcoder.ui.answerSending")), 1)) : r("v-if", !0),
6208
- _.value.error === void 0 ? r("v-if", !0) : (y(), i("p", Jf, O(k(u).t("kvcoder.ui.answerFailed", { error: v.value })), 1)),
6224
+ }), a("span", Kf, O(f.value), 1)]), a("div", qf, [
6225
+ _.value.sending ? (y(), i("p", Jf, O(k(u).t("kvcoder.ui.answerSending")), 1)) : r("v-if", !0),
6226
+ _.value.error === void 0 ? r("v-if", !0) : (y(), i("p", Yf, O(k(u).t("kvcoder.ui.answerFailed", { error: v.value })), 1)),
6209
6227
  d.value === "text" ? (y(), i(e, { key: 2 }, [I(a("input", {
6210
6228
  "onUpdate:modelValue": n[0] ||= (e) => _.value.text = e,
6211
6229
  disabled: _.value.sending,
@@ -6215,19 +6233,19 @@ var Uf = ["aria-label", "aria-busy"], Wf = {
6215
6233
  "aria-label": f.value,
6216
6234
  "data-test": "answer-text",
6217
6235
  onKeydown: n[1] ||= L(R((e) => b({ text: _.value.text }), ["prevent"]), ["enter"])
6218
- }, null, 40, Yf), [[N, _.value.text]]), a("div", Xf, [a("button", {
6236
+ }, null, 40, Xf), [[N, _.value.text]]), a("div", Zf, [a("button", {
6219
6237
  type: "button",
6220
6238
  disabled: _.value.sending,
6221
6239
  class: "kvc-button",
6222
6240
  "data-test": "skip",
6223
6241
  onClick: n[2] ||= (e) => b({ dismissed: !0 })
6224
- }, O(k(u).t("kvcoder.ui.skip")), 9, Zf), a("button", {
6242
+ }, O(k(u).t("kvcoder.ui.skip")), 9, Qf), a("button", {
6225
6243
  type: "button",
6226
6244
  disabled: _.value.sending,
6227
6245
  class: "kvc-button kvc-primary",
6228
6246
  "data-test": "answer",
6229
6247
  onClick: n[3] ||= (e) => b({ text: _.value.text })
6230
- }, O(k(u).t(_.value.error === void 0 ? "kvcoder.ui.answer" : "kvcoder.ui.tryAgain")), 9, Qf)])], 64)) : d.value === "choice" ? (y(), i(e, { key: 3 }, [
6248
+ }, O(k(u).t(_.value.error === void 0 ? "kvcoder.ui.answer" : "kvcoder.ui.tryAgain")), 9, $f)])], 64)) : d.value === "choice" ? (y(), i(e, { key: 3 }, [
6231
6249
  (y(!0), i(e, null, S(p.value, (e) => (y(), i("label", {
6232
6250
  key: e.id,
6233
6251
  class: "kvc-option",
@@ -6238,7 +6256,7 @@ var Uf = ["aria-label", "aria-busy"], Wf = {
6238
6256
  disabled: _.value.sending,
6239
6257
  name: c.questionId,
6240
6258
  onChange: (t) => x(e.id)
6241
- }, null, 40, ep), a("span", tp, [a("span", np, O(e.label), 1), e.description ? (y(), i("span", rp, O(e.description), 1)) : r("v-if", !0)])], 8, $f))), 128)),
6259
+ }, null, 40, tp), a("span", np, [a("span", rp, O(e.label), 1), e.description ? (y(), i("span", ip, O(e.description), 1)) : r("v-if", !0)])], 8, ep))), 128)),
6242
6260
  g.value ? I((y(), i("input", {
6243
6261
  key: 0,
6244
6262
  "onUpdate:modelValue": n[4] ||= (e) => _.value.other = e,
@@ -6247,37 +6265,37 @@ var Uf = ["aria-label", "aria-busy"], Wf = {
6247
6265
  placeholder: k(u).t("kvcoder.ui.other"),
6248
6266
  "aria-label": k(u).t("kvcoder.ui.other"),
6249
6267
  "data-test": "answer-other"
6250
- }, null, 8, ip)), [[N, _.value.other]]) : r("v-if", !0),
6251
- a("div", ap, [a("button", {
6268
+ }, null, 8, ap)), [[N, _.value.other]]) : r("v-if", !0),
6269
+ a("div", op, [a("button", {
6252
6270
  type: "button",
6253
6271
  disabled: _.value.sending,
6254
6272
  class: "kvc-button",
6255
6273
  "data-test": "skip",
6256
6274
  onClick: n[5] ||= (e) => b({ dismissed: !0 })
6257
- }, O(k(u).t("kvcoder.ui.skip")), 9, op), a("button", {
6275
+ }, O(k(u).t("kvcoder.ui.skip")), 9, sp), a("button", {
6258
6276
  type: "button",
6259
6277
  class: "kvc-button kvc-primary",
6260
6278
  disabled: _.value.sending || _.value.selected.length === 0 && _.value.other.trim() === "",
6261
6279
  "data-test": "answer",
6262
6280
  onClick: C
6263
- }, O(k(u).t(_.value.error === void 0 ? "kvcoder.ui.answer" : "kvcoder.ui.tryAgain")), 9, sp)])
6264
- ], 64)) : (y(), i("div", cp, [a("button", {
6281
+ }, O(k(u).t(_.value.error === void 0 ? "kvcoder.ui.answer" : "kvcoder.ui.tryAgain")), 9, cp)])
6282
+ ], 64)) : (y(), i("div", lp, [a("button", {
6265
6283
  type: "button",
6266
6284
  disabled: _.value.sending,
6267
6285
  class: "kvc-button",
6268
6286
  "data-test": "answer-no",
6269
6287
  onClick: n[6] ||= (e) => b({ confirmed: !1 })
6270
- }, O(k(u).t("kvcoder.ui.no")), 9, lp), a("button", {
6288
+ }, O(k(u).t("kvcoder.ui.no")), 9, up), a("button", {
6271
6289
  type: "button",
6272
6290
  disabled: _.value.sending,
6273
6291
  class: m(["kvc-button kvc-primary", { "kvc-danger": c.question.danger === !0 }]),
6274
6292
  "data-test": "answer-yes",
6275
6293
  onClick: n[7] ||= (e) => b({ confirmed: !0 })
6276
- }, O(k(u).t("kvcoder.ui.yes")), 11, up)]))
6277
- ])], 8, Uf));
6294
+ }, O(k(u).t("kvcoder.ui.yes")), 11, dp)]))
6295
+ ])], 8, Wf));
6278
6296
  }
6279
- }), fp = 6e4;
6280
- function pp() {
6297
+ }), pp = 6e4;
6298
+ function mp() {
6281
6299
  let e = x(0), t = x(!1), n = x(0), r = x(0), i = x(void 0), a = D(void 0), o, s, c = [], l, u = 0, d = () => {
6282
6300
  for (let e of c) clearInterval(e);
6283
6301
  c = [], cancelAnimationFrame(u);
@@ -6309,7 +6327,7 @@ function pp() {
6309
6327
  url: URL.createObjectURL(c)
6310
6328
  }, t.value = !1, f();
6311
6329
  }), s.start(), t.value = !0, r.value = 0, p(e), c.push(setInterval(() => {
6312
- r.value = Date.now() - o, r.value >= fp && _();
6330
+ r.value = Date.now() - o, r.value >= pp && _();
6313
6331
  }, 200));
6314
6332
  }
6315
6333
  async function h() {
@@ -6361,32 +6379,32 @@ function pp() {
6361
6379
  }
6362
6380
  //#endregion
6363
6381
  //#region web/src/RecordLine.vue?vue&type=script&setup=true&lang.ts
6364
- var mp = ["data-test"], hp = {
6382
+ var hp = ["data-test"], gp = {
6365
6383
  class: "kvc-record-text",
6366
6384
  dir: "auto",
6367
6385
  "data-test": "record-text"
6368
- }, gp = {
6386
+ }, _p = {
6369
6387
  key: 0,
6370
6388
  "data-test": "record-stress"
6371
- }, _p = ["title"], vp = { class: "kvc-record-controls" }, yp = {
6389
+ }, vp = ["title"], yp = { class: "kvc-record-controls" }, bp = {
6372
6390
  key: 0,
6373
6391
  class: "kvc-muted",
6374
6392
  "data-test": "record-seconds"
6375
- }, bp = {
6393
+ }, xp = {
6376
6394
  key: 2,
6377
6395
  class: "kvc-record-countdown",
6378
6396
  role: "status",
6379
6397
  "data-test": "record-countdown"
6380
- }, xp = {
6398
+ }, Sp = {
6381
6399
  class: "kvc-record-meter",
6382
6400
  "aria-hidden": "true"
6383
- }, Sp = {
6401
+ }, Cp = {
6384
6402
  role: "status",
6385
6403
  "data-test": "record-time"
6386
- }, Cp = {
6404
+ }, wp = {
6387
6405
  class: "kvc-chip",
6388
6406
  "data-test": "record-take"
6389
- }, wp = ["disabled"], Tp = ["disabled"], Ep = ["disabled"], Dp = /* @__PURE__ */ c({
6407
+ }, Tp = ["disabled"], Ep = ["disabled"], Dp = ["disabled"], Op = /* @__PURE__ */ c({
6390
6408
  __name: "RecordLine",
6391
6409
  props: {
6392
6410
  number: {},
@@ -6399,7 +6417,7 @@ var mp = ["data-test"], hp = {
6399
6417
  },
6400
6418
  emits: ["take", "trouble"],
6401
6419
  setup(n, { emit: c }) {
6402
- let l = n, u = c, d = q(), f = pp(), p = t(() => Jc(l.text, l.stress, l.pauses)), m = x(null), g = x(null);
6420
+ let l = n, u = c, d = q(), f = mp(), p = t(() => Jc(l.text, l.stress, l.pauses)), m = x(null), g = x(null);
6403
6421
  P(f.take, (e) => u("take", e)), P(f.trouble, (e) => {
6404
6422
  e !== void 0 && u("trouble", e);
6405
6423
  });
@@ -6414,14 +6432,14 @@ var mp = ["data-test"], hp = {
6414
6432
  class: "kvc-record-line",
6415
6433
  "data-test": `record-line-${l.number}`
6416
6434
  }, [
6417
- a("p", hp, [(y(!0), i(e, null, S(p.value, (t, n) => (y(), i(e, { key: n }, [t.stress ? (y(), i("strong", gp, O(t.text), 1)) : (y(), i(e, { key: 1 }, [o(O(t.text), 1)], 64)), t.pause ? (y(), i("span", {
6435
+ a("p", gp, [(y(!0), i(e, null, S(p.value, (t, n) => (y(), i(e, { key: n }, [t.stress ? (y(), i("strong", _p, O(t.text), 1)) : (y(), i(e, { key: 1 }, [o(O(t.text), 1)], 64)), t.pause ? (y(), i("span", {
6418
6436
  key: 2,
6419
6437
  class: "kvc-record-pause",
6420
6438
  title: k(d).t("kvcoder.ui.record.pause"),
6421
6439
  "data-test": "record-pause"
6422
- }, "|", 8, _p)) : r("v-if", !0)], 64))), 128))]),
6423
- a("div", vp, [
6424
- l.seconds === void 0 ? r("v-if", !0) : (y(), i("span", yp, O(k(d).t("kvcoder.ui.record.about", { count: l.seconds })), 1)),
6440
+ }, "|", 8, vp)) : r("v-if", !0)], 64))), 128))]),
6441
+ a("div", yp, [
6442
+ l.seconds === void 0 ? r("v-if", !0) : (y(), i("span", bp, O(k(d).t("kvcoder.ui.record.about", { count: l.seconds })), 1)),
6425
6443
  l.example === void 0 ? r("v-if", !0) : (y(), i("button", {
6426
6444
  key: 1,
6427
6445
  type: "button",
@@ -6432,9 +6450,9 @@ var mp = ["data-test"], hp = {
6432
6450
  size: 16,
6433
6451
  "aria-hidden": "true"
6434
6452
  }), o(O(k(d).t("kvcoder.ui.record.example")), 1)])),
6435
- k(f).countdown.value > 0 ? (y(), i("span", bp, O(k(f).countdown.value), 1)) : k(f).recording.value ? (y(), i(e, { key: 3 }, [
6436
- a("span", xp, [a("span", { style: h({ inlineSize: `${Math.round(k(f).level.value * 100)}%` }) }, null, 4)]),
6437
- a("span", Sp, O(k(d).t("kvcoder.ui.record.recording", { time: k(Yc)(k(f).elapsedMs.value) })), 1),
6453
+ k(f).countdown.value > 0 ? (y(), i("span", xp, O(k(f).countdown.value), 1)) : k(f).recording.value ? (y(), i(e, { key: 3 }, [
6454
+ a("span", Sp, [a("span", { style: h({ inlineSize: `${Math.round(k(f).level.value * 100)}%` }) }, null, 4)]),
6455
+ a("span", Cp, O(k(d).t("kvcoder.ui.record.recording", { time: k(Yc)(k(f).elapsedMs.value) })), 1),
6438
6456
  a("button", {
6439
6457
  type: "button",
6440
6458
  class: "kvc-button",
@@ -6462,8 +6480,8 @@ var mp = ["data-test"], hp = {
6462
6480
  class: "kvc-danger"
6463
6481
  }),
6464
6482
  o(O(k(d).t("kvcoder.ui.record.record")), 1)
6465
- ], 8, Tp)) : (y(), i(e, { key: 4 }, [
6466
- a("span", Cp, O(k(d).t("kvcoder.ui.record.take", { time: k(Yc)(k(f).take.value.durationMs) })), 1),
6483
+ ], 8, Ep)) : (y(), i(e, { key: 4 }, [
6484
+ a("span", wp, O(k(d).t("kvcoder.ui.record.take", { time: k(Yc)(k(f).take.value.durationMs) })), 1),
6467
6485
  a("button", {
6468
6486
  type: "button",
6469
6487
  class: "kvc-button kvc-ghost",
@@ -6482,7 +6500,7 @@ var mp = ["data-test"], hp = {
6482
6500
  }, [s(k(Pe), {
6483
6501
  size: 16,
6484
6502
  "aria-hidden": "true"
6485
- }), o(O(k(d).t("kvcoder.ui.record.again")), 1)], 8, wp)
6503
+ }), o(O(k(d).t("kvcoder.ui.record.again")), 1)], 8, Tp)
6486
6504
  ], 64)),
6487
6505
  a("button", {
6488
6506
  type: "button",
@@ -6493,7 +6511,7 @@ var mp = ["data-test"], hp = {
6493
6511
  }, [s(k(He), {
6494
6512
  size: 16,
6495
6513
  "aria-hidden": "true"
6496
- }), o(O(k(d).t("kvcoder.ui.record.upload")), 1)], 8, Ep),
6514
+ }), o(O(k(d).t("kvcoder.ui.record.upload")), 1)], 8, Dp),
6497
6515
  a("input", {
6498
6516
  ref_key: "picker",
6499
6517
  ref: m,
@@ -6509,30 +6527,30 @@ var mp = ["data-test"], hp = {
6509
6527
  ref: g,
6510
6528
  hidden: ""
6511
6529
  }, null, 512)
6512
- ], 8, mp));
6530
+ ], 8, hp));
6513
6531
  }
6514
- }), Op = ["aria-label", "aria-busy"], kp = {
6532
+ }), kp = ["aria-label", "aria-busy"], Ap = {
6515
6533
  class: "kvc-card-row",
6516
6534
  style: { "font-weight": "600" }
6517
- }, Ap = { dir: "auto" }, jp = { class: "kvc-card-body" }, Mp = {
6535
+ }, jp = { dir: "auto" }, Mp = { class: "kvc-card-body" }, Np = {
6518
6536
  key: 0,
6519
6537
  class: "kvc-muted",
6520
6538
  dir: "auto",
6521
6539
  "data-test": "record-how"
6522
- }, Np = { key: 0 }, Pp = { key: 1 }, Fp = {
6540
+ }, Pp = { key: 0 }, Fp = { key: 1 }, Ip = {
6523
6541
  key: 1,
6524
6542
  role: "alert",
6525
6543
  class: "kvc-record-trouble",
6526
6544
  "data-test": "record-trouble"
6527
- }, Ip = { class: "kvc-record-lines" }, Lp = {
6545
+ }, Lp = { class: "kvc-record-lines" }, Rp = {
6528
6546
  key: 2,
6529
6547
  role: "status",
6530
6548
  "data-test": "answer-sending"
6531
- }, Rp = {
6549
+ }, zp = {
6532
6550
  key: 3,
6533
6551
  role: "alert",
6534
6552
  "data-test": "answer-error"
6535
- }, zp = { class: "kvc-actions" }, Bp = ["disabled"], Vp = ["disabled"], Hp = /* @__PURE__ */ c({
6553
+ }, Bp = { class: "kvc-actions" }, Vp = ["disabled"], Hp = ["disabled"], Up = /* @__PURE__ */ c({
6536
6554
  __name: "RecordCard",
6537
6555
  props: {
6538
6556
  questionId: {},
@@ -6541,7 +6559,7 @@ var mp = ["data-test"], hp = {
6541
6559
  },
6542
6560
  emits: ["answer"],
6543
6561
  setup(o, { emit: c }) {
6544
- let l = o, u = c, d = q(), p = t(() => Rf(d.workspace.value.id, l.questionId, l.owner)), m = t(() => ut(d.t, p.value.error)), h = t(() => String(l.question.prompt ?? "")), g = (e) => typeof e == "string" && e !== "" ? e : void 0, _ = (e) => Array.isArray(e) ? e.filter((e) => typeof e == "string") : [], v = t(() => Array.isArray(l.question.exampleFileIds) ? l.question.exampleFileIds : []), C = t(() => (Array.isArray(l.question.lines) ? l.question.lines : []).map((e, t) => {
6562
+ let l = o, u = c, d = q(), p = t(() => zf(d.workspace.value.id, l.questionId, l.owner)), m = t(() => ut(d.t, p.value.error)), h = t(() => String(l.question.prompt ?? "")), g = (e) => typeof e == "string" && e !== "" ? e : void 0, _ = (e) => Array.isArray(e) ? e.filter((e) => typeof e == "string") : [], v = t(() => Array.isArray(l.question.exampleFileIds) ? l.question.exampleFileIds : []), C = t(() => (Array.isArray(l.question.lines) ? l.question.lines : []).map((e, t) => {
6545
6563
  let n = J(e), r = g(v.value[t]);
6546
6564
  return {
6547
6565
  text: String(n.text ?? ""),
@@ -6605,18 +6623,18 @@ var mp = ["data-test"], hp = {
6605
6623
  "data-test": "record-card",
6606
6624
  "aria-label": h.value,
6607
6625
  "aria-busy": A.value
6608
- }, [a("div", kp, [s(k(K), {
6626
+ }, [a("div", Ap, [s(k(K), {
6609
6627
  size: 18,
6610
6628
  "aria-hidden": "true"
6611
- }), a("span", Ap, O(h.value), 1)]), a("div", jp, [
6612
- l.question.tone !== void 0 || l.question.pace !== void 0 ? (y(), i("p", Mp, [g(l.question.tone) ? (y(), i("span", Np, O(k(d).t("kvcoder.ui.record.tone", { tone: String(l.question.tone) })), 1)) : r("v-if", !0), g(l.question.pace) ? (y(), i("span", Pp, " · " + O(k(d).t("kvcoder.ui.record.pace", { pace: String(l.question.pace) })), 1)) : r("v-if", !0)])) : r("v-if", !0),
6613
- T.value === void 0 ? r("v-if", !0) : (y(), i("div", Fp, [a("span", null, O(k(d).t(T.value === "refused" ? "kvcoder.ui.record.refused" : "kvcoder.ui.record.unavailable")), 1), a("button", {
6629
+ }), a("span", jp, O(h.value), 1)]), a("div", Mp, [
6630
+ l.question.tone !== void 0 || l.question.pace !== void 0 ? (y(), i("p", Np, [g(l.question.tone) ? (y(), i("span", Pp, O(k(d).t("kvcoder.ui.record.tone", { tone: String(l.question.tone) })), 1)) : r("v-if", !0), g(l.question.pace) ? (y(), i("span", Fp, " · " + O(k(d).t("kvcoder.ui.record.pace", { pace: String(l.question.pace) })), 1)) : r("v-if", !0)])) : r("v-if", !0),
6631
+ T.value === void 0 ? r("v-if", !0) : (y(), i("div", Ip, [a("span", null, O(k(d).t(T.value === "refused" ? "kvcoder.ui.record.refused" : "kvcoder.ui.record.unavailable")), 1), a("button", {
6614
6632
  type: "button",
6615
6633
  class: "kvc-text-button",
6616
6634
  "data-test": "record-browser",
6617
6635
  onClick: M
6618
6636
  }, O(k(d).t("kvcoder.ui.record.openInBrowser")), 1)])),
6619
- a("ol", Ip, [(y(!0), i(e, null, S(C.value, (e, t) => (y(), n(Dp, f({
6637
+ a("ol", Lp, [(y(!0), i(e, null, S(C.value, (e, t) => (y(), n(Op, f({
6620
6638
  key: t,
6621
6639
  number: t + 1
6622
6640
  }, { ref_for: !0 }, e, {
@@ -6628,24 +6646,24 @@ var mp = ["data-test"], hp = {
6628
6646
  "disabled",
6629
6647
  "onTake"
6630
6648
  ]))), 128))]),
6631
- p.value.sending ? (y(), i("p", Lp, O(k(d).t("kvcoder.ui.answerSending")), 1)) : r("v-if", !0),
6632
- p.value.error === void 0 ? r("v-if", !0) : (y(), i("p", Rp, O(k(d).t("kvcoder.ui.answerFailed", { error: m.value })), 1)),
6633
- a("div", zp, [a("button", {
6649
+ p.value.sending ? (y(), i("p", Rp, O(k(d).t("kvcoder.ui.answerSending")), 1)) : r("v-if", !0),
6650
+ p.value.error === void 0 ? r("v-if", !0) : (y(), i("p", zp, O(k(d).t("kvcoder.ui.answerFailed", { error: m.value })), 1)),
6651
+ a("div", Bp, [a("button", {
6634
6652
  type: "button",
6635
6653
  disabled: A.value,
6636
6654
  class: "kvc-button",
6637
6655
  "data-test": "skip",
6638
6656
  onClick: F
6639
- }, O(k(d).t("kvcoder.ui.skip")), 9, Bp), a("button", {
6657
+ }, O(k(d).t("kvcoder.ui.skip")), 9, Vp), a("button", {
6640
6658
  type: "button",
6641
6659
  disabled: !D.value || A.value,
6642
6660
  class: "kvc-button kvc-primary",
6643
6661
  "data-test": "record-use",
6644
6662
  onClick: P
6645
- }, O(k(d).t("kvcoder.ui.record.use")), 9, Vp)])
6646
- ])], 8, Op));
6663
+ }, O(k(d).t("kvcoder.ui.record.use")), 9, Hp)])
6664
+ ])], 8, kp));
6647
6665
  }
6648
- }), Up = /* @__PURE__ */ c({
6666
+ }), Wp = /* @__PURE__ */ c({
6649
6667
  __name: "PendingCards",
6650
6668
  props: {
6651
6669
  pending: {},
@@ -6661,7 +6679,7 @@ var mp = ["data-test"], hp = {
6661
6679
  questionId: String(e.questionId),
6662
6680
  view: nn(J(e.question))
6663
6681
  })));
6664
- return (t, a) => (y(), i(e, null, [(y(!0), i(e, null, S(u.value, (t) => (y(), i(e, { key: t.questionId }, [t.question.kind === "record" ? (y(), n(Hp, {
6682
+ return (t, a) => (y(), i(e, null, [(y(!0), i(e, null, S(u.value, (t) => (y(), i(e, { key: t.questionId }, [t.question.kind === "record" ? (y(), n(Up, {
6665
6683
  key: 0,
6666
6684
  "question-id": t.questionId,
6667
6685
  question: t.question,
@@ -6671,7 +6689,7 @@ var mp = ["data-test"], hp = {
6671
6689
  "question-id",
6672
6690
  "question",
6673
6691
  "owner"
6674
- ])) : (y(), n(dp, {
6692
+ ])) : (y(), n(fp, {
6675
6693
  key: 1,
6676
6694
  "question-id": t.questionId,
6677
6695
  question: t.question,
@@ -6681,7 +6699,7 @@ var mp = ["data-test"], hp = {
6681
6699
  "question-id",
6682
6700
  "question",
6683
6701
  "owner"
6684
- ]))], 64))), 128)), d.value.length > 0 ? (y(), n(Ff, {
6702
+ ]))], 64))), 128)), d.value.length > 0 ? (y(), n(If, {
6685
6703
  key: 0,
6686
6704
  approvals: d.value,
6687
6705
  onDecide: a[2] ||= (e) => c("decide", {
@@ -6693,7 +6711,7 @@ var mp = ["data-test"], hp = {
6693
6711
  });
6694
6712
  //#endregion
6695
6713
  //#region web/src/use-model-groups.ts
6696
- function Wp(e, t, n) {
6714
+ function Gp(e, t, n) {
6697
6715
  let r = x([]);
6698
6716
  return _(async () => {
6699
6717
  try {
@@ -6706,10 +6724,10 @@ function Wp(e, t, n) {
6706
6724
  }
6707
6725
  //#endregion
6708
6726
  //#region web/src/RecoveryActions.vue?vue&type=script&setup=true&lang.ts
6709
- var Gp = {
6727
+ var Kp = {
6710
6728
  class: "kvc-recovery",
6711
6729
  "data-test": "recovery"
6712
- }, Kp = ["disabled"], qp = { class: "kvc-recovery-picker" }, Jp = ["disabled"], Yp = /* @__PURE__ */ c({
6730
+ }, qp = ["disabled"], Jp = { class: "kvc-recovery-picker" }, Yp = ["disabled"], Xp = /* @__PURE__ */ c({
6713
6731
  __name: "RecoveryActions",
6714
6732
  props: {
6715
6733
  sessionId: {},
@@ -6717,7 +6735,7 @@ var Gp = {
6717
6735
  },
6718
6736
  emits: ["sent"],
6719
6737
  setup(e, { emit: n }) {
6720
- let c = e, l = n, u = q(), d = Wp(u, () => null, (e) => Y(u, e));
6738
+ let c = e, l = n, u = q(), d = Gp(u, () => null, (e) => Y(u, e));
6721
6739
  async function f() {
6722
6740
  await u.exec("kvcoder.turn.retry", { sessionId: c.sessionId }), l("sent");
6723
6741
  }
@@ -6744,7 +6762,7 @@ var Gp = {
6744
6762
  model: e
6745
6763
  }), await Wa(u, e), await f();
6746
6764
  });
6747
- return (e, t) => (y(), i("div", Gp, [
6765
+ return (e, t) => (y(), i("div", Kp, [
6748
6766
  g.value ? r("v-if", !0) : (y(), i("button", {
6749
6767
  key: 0,
6750
6768
  type: "button",
@@ -6755,8 +6773,8 @@ var Gp = {
6755
6773
  }, [s(k(Fe), {
6756
6774
  size: 14,
6757
6775
  "aria-hidden": "true"
6758
- }), o(O(k(u).t("kvcoder.ui.retry")), 1)], 8, Kp)),
6759
- a("div", qp, [s(Ba, {
6776
+ }), o(O(k(u).t("kvcoder.ui.retry")), 1)], 8, qp)),
6777
+ a("div", Jp, [s(Ba, {
6760
6778
  groups: k(d),
6761
6779
  current: null,
6762
6780
  empty: k(u).t("kvcoder.ui.chooseAnotherModel"),
@@ -6772,30 +6790,30 @@ var Gp = {
6772
6790
  }, [s(k(Fe), {
6773
6791
  size: 14,
6774
6792
  "aria-hidden": "true"
6775
- }), o(O(k(u).t("kvcoder.ui.retry")), 1)], 8, Jp)) : r("v-if", !0)
6793
+ }), o(O(k(u).t("kvcoder.ui.retry")), 1)], 8, Yp)) : r("v-if", !0)
6776
6794
  ]));
6777
6795
  }
6778
- }), Xp = {
6796
+ }), Zp = {
6779
6797
  class: "kvc-column",
6780
6798
  "data-test": "prompt-tab"
6781
- }, Zp = { style: {
6799
+ }, Qp = { style: {
6782
6800
  display: "flex",
6783
6801
  "align-items": "center",
6784
6802
  gap: "10px"
6785
- } }, Qp = { style: { flex: "1 1 auto" } }, $p = {
6803
+ } }, $p = { style: { flex: "1 1 auto" } }, em = {
6786
6804
  key: 0,
6787
6805
  style: {
6788
6806
  margin: "0",
6789
6807
  "padding-inline-start": "20px"
6790
6808
  }
6791
- }, em = {
6809
+ }, tm = {
6792
6810
  key: 0,
6793
6811
  class: "kvc-chip kvc-warn"
6794
- }, tm = {
6812
+ }, nm = {
6795
6813
  key: 1,
6796
6814
  class: "kvc-prompt",
6797
6815
  "data-test": "prompt-text"
6798
- }, nm = /* @__PURE__ */ c({
6816
+ }, rm = /* @__PURE__ */ c({
6799
6817
  __name: "PromptTab",
6800
6818
  props: { sessionId: {} },
6801
6819
  emits: ["back"],
@@ -6811,8 +6829,8 @@ var Gp = {
6811
6829
  async function f() {
6812
6830
  d.value !== null && (await navigator.clipboard.writeText(d.value.prompt), u.toast("kvcoder.ui.copied", {}, "success"));
6813
6831
  }
6814
- return (t, n) => (y(), i("div", Xp, [
6815
- a("div", Zp, [
6832
+ return (t, n) => (y(), i("div", Zp, [
6833
+ a("div", Qp, [
6816
6834
  a("button", {
6817
6835
  type: "button",
6818
6836
  class: "kvc-button",
@@ -6823,7 +6841,7 @@ var Gp = {
6823
6841
  class: "kvc-flip",
6824
6842
  "aria-hidden": "true"
6825
6843
  }), o(O(k(u).t("kvcoder.ui.showChat")), 1)]),
6826
- a("strong", Qp, O(k(u).t("kvcoder.ui.promptTitle")), 1),
6844
+ a("strong", $p, O(k(u).t("kvcoder.ui.promptTitle")), 1),
6827
6845
  a("button", {
6828
6846
  type: "button",
6829
6847
  class: "kvc-button",
@@ -6831,7 +6849,7 @@ var Gp = {
6831
6849
  onClick: f
6832
6850
  }, [s(k(ye), { size: 16 }), o(O(k(u).t("kvcoder.ui.copy")), 1)])
6833
6851
  ]),
6834
- d.value ? (y(), i("ul", $p, [(y(!0), i(e, null, S(d.value.sections, (e) => (y(), i("li", {
6852
+ d.value ? (y(), i("ul", em, [(y(!0), i(e, null, S(d.value.sections, (e) => (y(), i("li", {
6835
6853
  key: `${e.owner}/${e.id}`,
6836
6854
  class: "kvc-muted",
6837
6855
  "data-test": "prompt-section"
@@ -6840,14 +6858,14 @@ var Gp = {
6840
6858
  owner: e.owner,
6841
6859
  reach: k(u).t(`kvcoder.ui.reach.${e.reach}`),
6842
6860
  size: e.size
6843
- })) + " ", 1), e.included ? r("v-if", !0) : (y(), i("span", em, O(k(u).t("kvcoder.ui.leftOut")), 1))]))), 128))])) : r("v-if", !0),
6844
- d.value ? (y(), i("pre", tm, O(d.value.prompt), 1)) : r("v-if", !0)
6861
+ })) + " ", 1), e.included ? r("v-if", !0) : (y(), i("span", tm, O(k(u).t("kvcoder.ui.leftOut")), 1))]))), 128))])) : r("v-if", !0),
6862
+ d.value ? (y(), i("pre", nm, O(d.value.prompt), 1)) : r("v-if", !0)
6845
6863
  ]));
6846
6864
  }
6847
6865
  });
6848
6866
  //#endregion
6849
6867
  //#region web/src/use-session-actions.ts
6850
- function rm(e, t, n) {
6868
+ function im(e, t, n) {
6851
6869
  let r = D();
6852
6870
  async function i(t) {
6853
6871
  try {
@@ -6910,12 +6928,12 @@ function rm(e, t, n) {
6910
6928
  }
6911
6929
  //#endregion
6912
6930
  //#region web/src/SessionModel.vue
6913
- var im = /* @__PURE__ */ c({
6931
+ var am = /* @__PURE__ */ c({
6914
6932
  __name: "SessionModel",
6915
6933
  props: { session: {} },
6916
6934
  emits: ["changed"],
6917
6935
  setup(e, { emit: t }) {
6918
- let r = e, i = t, a = q(), o = Wp(a, () => r.session.model, (e) => Y(a, e)), s = rm(a, () => r.session.id, () => i("changed"));
6936
+ let r = e, i = t, a = q(), o = Gp(a, () => r.session.model, (e) => Y(a, e)), s = im(a, () => r.session.id, () => i("changed"));
6919
6937
  return (e, t) => (y(), n(Ua, {
6920
6938
  groups: k(o),
6921
6939
  model: r.session.model ?? null,
@@ -6931,52 +6949,52 @@ var im = /* @__PURE__ */ c({
6931
6949
  "decides"
6932
6950
  ]));
6933
6951
  }
6934
- }), am = ["aria-label"], om = { class: "kvc-card-row" }, sm = {
6952
+ }), om = ["aria-label"], sm = { class: "kvc-card-row" }, cm = {
6935
6953
  key: 0,
6936
6954
  class: "kvc-chip kvc-mono",
6937
6955
  "data-test": "subagent-worker"
6938
- }, cm = { class: "kvc-lines" }, lm = {
6956
+ }, lm = { class: "kvc-lines" }, um = {
6939
6957
  style: { "font-weight": "600" },
6940
6958
  "data-test": "subagent-title"
6941
- }, um = {
6959
+ }, dm = {
6942
6960
  key: 0,
6943
6961
  class: "kvc-muted kvc-oneline",
6944
6962
  dir: "auto",
6945
6963
  "data-test": "subagent-task"
6946
- }, dm = {
6964
+ }, fm = {
6947
6965
  key: 1,
6948
6966
  class: "kvc-spin"
6949
- }, fm = {
6967
+ }, pm = {
6950
6968
  key: 0,
6951
6969
  class: "kvc-card-row kvc-muted",
6952
6970
  "data-test": "subagent-progress"
6953
- }, pm = {
6971
+ }, mm = {
6954
6972
  key: 0,
6955
6973
  class: "kvc-oneline",
6956
6974
  dir: "auto",
6957
6975
  style: { "font-weight": "600" },
6958
6976
  "data-test": "subagent-headline"
6959
- }, mm = {
6977
+ }, hm = {
6960
6978
  key: 1,
6961
6979
  "data-test": "subagent-step"
6962
- }, hm = {
6980
+ }, gm = {
6963
6981
  key: 2,
6964
6982
  "data-test": "subagent-elapsed"
6965
- }, gm = {
6983
+ }, _m = {
6966
6984
  key: 3,
6967
6985
  class: "kvc-mono kvc-oneline",
6968
6986
  "data-test": "subagent-call"
6969
- }, _m = {
6987
+ }, vm = {
6970
6988
  key: 1,
6971
6989
  class: "kvc-card-body"
6972
- }, vm = {
6990
+ }, ym = {
6973
6991
  key: 0,
6974
6992
  class: "kvc-muted",
6975
6993
  style: {
6976
6994
  margin: "0",
6977
6995
  "white-space": "pre-wrap"
6978
6996
  }
6979
- }, ym = /* @__PURE__ */ c({
6997
+ }, bm = /* @__PURE__ */ c({
6980
6998
  __name: "SubagentCard",
6981
6999
  props: {
6982
7000
  child: {},
@@ -7007,23 +7025,23 @@ var im = /* @__PURE__ */ c({
7007
7025
  "data-test": "subagent-card",
7008
7026
  "aria-label": k(st)(k(l).t, o.child.session.title)
7009
7027
  }, [
7010
- a("div", om, [
7028
+ a("div", sm, [
7011
7029
  s(k(ue), {
7012
7030
  size: 18,
7013
7031
  "aria-hidden": "true"
7014
7032
  }),
7015
- o.child.session.worker === void 0 ? r("v-if", !0) : (y(), i("span", sm, O(o.child.session.worker), 1)),
7016
- a("span", cm, [a("span", lm, O(k(st)(k(l).t, o.child.session.title)), 1), u.value ? (y(), i("span", um, O(u.value), 1)) : r("v-if", !0)]),
7017
- f.value ? (y(), i("span", dm)) : r("v-if", !0),
7033
+ o.child.session.worker === void 0 ? r("v-if", !0) : (y(), i("span", cm, O(o.child.session.worker), 1)),
7034
+ a("span", lm, [a("span", um, O(k(st)(k(l).t, o.child.session.title)), 1), u.value ? (y(), i("span", dm, O(u.value), 1)) : r("v-if", !0)]),
7035
+ f.value ? (y(), i("span", fm)) : r("v-if", !0),
7018
7036
  a("span", { class: m(["kvc-chip", { "kvc-warn": o.child.session.status === "waiting" }]) }, O(d.value), 3)
7019
7037
  ]),
7020
- f.value && (p.value !== void 0 || b.value !== void 0) ? (y(), i("div", fm, [
7021
- p.value === void 0 ? r("v-if", !0) : (y(), i("span", pm, O(p.value), 1)),
7022
- b.value === void 0 ? r("v-if", !0) : (y(), i("span", mm, O(b.value), 1)),
7023
- v.value === void 0 ? r("v-if", !0) : (y(), i("span", hm, O(v.value), 1)),
7024
- S.value === void 0 ? r("v-if", !0) : (y(), i("span", gm, O(S.value), 1))
7038
+ f.value && (p.value !== void 0 || b.value !== void 0) ? (y(), i("div", pm, [
7039
+ p.value === void 0 ? r("v-if", !0) : (y(), i("span", mm, O(p.value), 1)),
7040
+ b.value === void 0 ? r("v-if", !0) : (y(), i("span", hm, O(b.value), 1)),
7041
+ v.value === void 0 ? r("v-if", !0) : (y(), i("span", gm, O(v.value), 1)),
7042
+ S.value === void 0 ? r("v-if", !0) : (y(), i("span", _m, O(S.value), 1))
7025
7043
  ])) : r("v-if", !0),
7026
- o.child.live.text !== "" || (o.child.turn?.pending.length ?? 0) > 0 ? (y(), i("div", _m, [o.child.live.text === "" ? r("v-if", !0) : (y(), i("p", vm, O(o.child.live.text), 1)), s(Up, {
7044
+ o.child.live.text !== "" || (o.child.turn?.pending.length ?? 0) > 0 ? (y(), i("div", vm, [o.child.live.text === "" ? r("v-if", !0) : (y(), i("p", ym, O(o.child.live.text), 1)), s(Wp, {
7027
7045
  owner: o.child.turn === void 0 ? void 0 : {
7028
7046
  sessionId: o.child.session.id,
7029
7047
  turnId: o.child.turn.id
@@ -7037,22 +7055,22 @@ var im = /* @__PURE__ */ c({
7037
7055
  "pending",
7038
7056
  "hidden"
7039
7057
  ])])) : r("v-if", !0)
7040
- ], 8, am));
7058
+ ], 8, om));
7041
7059
  }
7042
- }), bm = ["aria-label"], xm = { class: "kvc-card-row" }, Sm = {
7060
+ }), xm = ["aria-label"], Sm = { class: "kvc-card-row" }, Cm = {
7043
7061
  class: "kvc-chip kvc-mono",
7044
7062
  "data-test": "worker-card-name"
7045
- }, Cm = {
7063
+ }, wm = {
7046
7064
  style: {
7047
7065
  flex: "1 1 auto",
7048
7066
  "font-weight": "500"
7049
7067
  },
7050
7068
  dir: "auto",
7051
7069
  "data-test": "worker-card-call"
7052
- }, wm = {
7070
+ }, Tm = {
7053
7071
  class: "kvc-chip",
7054
7072
  "data-test": "worker-card-time"
7055
- }, Tm = ["disabled"], Em = /* @__PURE__ */ c({
7073
+ }, Em = ["disabled"], Dm = /* @__PURE__ */ c({
7056
7074
  __name: "WorkerCard",
7057
7075
  props: {
7058
7076
  sessionId: {},
@@ -7088,25 +7106,25 @@ var im = /* @__PURE__ */ c({
7088
7106
  class: "kvc-card",
7089
7107
  "data-test": "worker-card",
7090
7108
  "aria-label": o.value.title
7091
- }, [a("div", xm, [
7109
+ }, [a("div", Sm, [
7092
7110
  s(k(ue), {
7093
7111
  size: 18,
7094
7112
  "aria-hidden": "true"
7095
7113
  }),
7096
- a("span", Sm, O(o.value.title), 1),
7097
- a("span", Cm, O(o.value.call), 1),
7114
+ a("span", Cm, O(o.value.title), 1),
7115
+ a("span", wm, O(o.value.call), 1),
7098
7116
  t[0] ||= a("span", { class: "kvc-spin" }, null, -1),
7099
- a("span", wm, O(k(n).t("kvcoder.ui.jobs.status.running")) + " · " + O(k(vo)(k(n).t, c.value - Date.parse(o.value.startedAt))), 1),
7117
+ a("span", Tm, O(k(n).t("kvcoder.ui.jobs.status.running")) + " · " + O(k(vo)(k(n).t, c.value - Date.parse(o.value.startedAt))), 1),
7100
7118
  a("button", {
7101
7119
  type: "button",
7102
7120
  class: "kvc-button",
7103
7121
  disabled: l.value,
7104
7122
  "data-test": "worker-card-stop",
7105
7123
  onClick: d
7106
- }, O(k(n).t("kvcoder.ui.jobs.stop")), 9, Tm)
7107
- ])], 8, bm));
7124
+ }, O(k(n).t("kvcoder.ui.jobs.stop")), 9, Em)
7125
+ ])], 8, xm));
7108
7126
  }
7109
- }), Dm = (e) => {
7127
+ }), Om = (e) => {
7110
7128
  let t = e.view.description ?? e.view.line;
7111
7129
  return {
7112
7130
  name: "run",
@@ -7115,8 +7133,8 @@ var im = /* @__PURE__ */ c({
7115
7133
  complete: !0
7116
7134
  };
7117
7135
  };
7118
- function Om(e, n, r) {
7119
- let i = t(() => Bf(e.workspace.value.id)), a = /* @__PURE__ */ new Map(), o = 0, s = !1;
7136
+ function km(e, n, r) {
7137
+ let i = t(() => Vf(e.workspace.value.id)), a = /* @__PURE__ */ new Map(), o = 0, s = !1;
7120
7138
  P([
7121
7139
  () => e.workspace.value.id,
7122
7140
  () => r()?.sessionId,
@@ -7129,7 +7147,7 @@ function Om(e, n, r) {
7129
7147
  async function c(t, r) {
7130
7148
  let i = e.workspace.value.id, c = o, l = () => !s && o === c && e.workspace.value.id === i, u = t.map((e) => ({
7131
7149
  item: e,
7132
- draft: Rf(i, e.questionId, r)
7150
+ draft: zf(i, e.questionId, r)
7133
7151
  }));
7134
7152
  if (u.some(({ draft: e }) => e.sending)) return;
7135
7153
  let d = u.filter(({ draft: e }) => !e.settled);
@@ -7137,18 +7155,18 @@ function Om(e, n, r) {
7137
7155
  let f = null;
7138
7156
  for (let [t, { item: n, draft: r }] of d.entries()) {
7139
7157
  if (!l()) {
7140
- for (let e of d.slice(t)) zf(i, e.item.questionId, e.draft) && (e.draft.sending = !1);
7158
+ for (let e of d.slice(t)) Bf(i, e.item.questionId, e.draft) && (e.draft.sending = !1);
7141
7159
  return;
7142
7160
  }
7143
- if (zf(i, n.questionId, r)) try {
7144
- f = (await e.exec("kvcoder.question.answer", n)).jobId ?? f, zf(i, n.questionId, r) && Vf(r);
7161
+ if (Bf(i, n.questionId, r)) try {
7162
+ f = (await e.exec("kvcoder.question.answer", n)).jobId ?? f, Bf(i, n.questionId, r) && Hf(r);
7145
7163
  } catch (o) {
7146
7164
  if (lt(o)?.code === "kvcoder/QUESTION_NOT_FOUND") {
7147
- zf(i, n.questionId, r) && (r.sending = !1);
7165
+ Bf(i, n.questionId, r) && (r.sending = !1);
7148
7166
  continue;
7149
7167
  }
7150
- for (let e of d.slice(t)) zf(i, e.item.questionId, e.draft) && (e.draft.sending = !1, e.draft === r && (e.draft.error = o)), a.delete(e.item.questionId);
7151
- l() && zf(i, n.questionId, r) && Y(e, o);
7168
+ for (let e of d.slice(t)) Bf(i, e.item.questionId, e.draft) && (e.draft.sending = !1, e.draft === r && (e.draft.error = o)), a.delete(e.item.questionId);
7169
+ l() && Bf(i, n.questionId, r) && Y(e, o);
7152
7170
  return;
7153
7171
  }
7154
7172
  }
@@ -7162,7 +7180,7 @@ function Om(e, n, r) {
7162
7180
  hidden: i,
7163
7181
  answer: (e) => c([e]),
7164
7182
  decide: ({ approvals: e, confirmed: t, owner: n, remember: r, reason: i }) => {
7165
- if (t) for (let t of e) a.set(t.questionId, Dm(t));
7183
+ if (t) for (let t of e) a.set(t.questionId, Om(t));
7166
7184
  let o = {
7167
7185
  ...r === void 0 ? {} : { remember: r },
7168
7186
  ...i === void 0 ? {} : { reason: i }
@@ -7177,8 +7195,8 @@ function Om(e, n, r) {
7177
7195
  }
7178
7196
  //#endregion
7179
7197
  //#region web/src/use-artifacts.ts
7180
- var km = (e) => `${e.version} ${e.updatedAt}`;
7181
- function Am(e, t, n, r) {
7198
+ var Am = (e) => `${e.version} ${e.updatedAt}`;
7199
+ function jm(e, t, n, r) {
7182
7200
  let i = x([]), a = x(void 0), o = x(void 0), s = x(!1), c = x(void 0), l = /* @__PURE__ */ new Map(), u, d = !1, f = 0, p = !1;
7183
7201
  function m(e) {
7184
7202
  u = e, d = !1, l.clear(), c.value = void 0, i.value = [], a.value = void 0, o.value = void 0, s.value = !1;
@@ -7215,7 +7233,7 @@ function Am(e, t, n, r) {
7215
7233
  if (p || g !== f || t() !== n || u !== n) return;
7216
7234
  if (i.value = _, !d) {
7217
7235
  d = !0;
7218
- for (let e of _) l.set(e.id, km(e));
7236
+ for (let e of _) l.set(e.id, Am(e));
7219
7237
  if (_.length === 0) {
7220
7238
  a.value = void 0, o.value = void 0, s.value = !1;
7221
7239
  return;
@@ -7226,8 +7244,8 @@ function Am(e, t, n, r) {
7226
7244
  t !== void 0 && await h(n, t);
7227
7245
  return;
7228
7246
  }
7229
- let v = _.filter((e) => l.get(e.id) !== km(e));
7230
- for (let e of _) l.set(e.id, km(e));
7247
+ let v = _.filter((e) => l.get(e.id) !== Am(e));
7248
+ for (let e of _) l.set(e.id, Am(e));
7231
7249
  if (v.length > 0) {
7232
7250
  let e = [...v].sort((e, t) => e.updatedAt < t.updatedAt ? 1 : e.updatedAt > t.updatedAt ? -1 : 0)[0];
7233
7251
  e !== void 0 && (a.value = e.id, s.value = !0, c.value = {
@@ -7296,7 +7314,7 @@ function Am(e, t, n, r) {
7296
7314
  }
7297
7315
  //#endregion
7298
7316
  //#region web/src/use-changes.ts
7299
- function jm(e, t, n, r) {
7317
+ function Mm(e, t, n, r) {
7300
7318
  let i = x(0), a = x(!1), o = x("turn"), s = D(void 0), c = 0;
7301
7319
  async function l() {
7302
7320
  let n = t(), l = c += 1;
@@ -7329,7 +7347,7 @@ function jm(e, t, n, r) {
7329
7347
  reload: l
7330
7348
  };
7331
7349
  }
7332
- function Mm(e, t, n) {
7350
+ function Nm(e, t, n) {
7333
7351
  return P(t.shown, (t) => {
7334
7352
  t && (e.shown.value = !1);
7335
7353
  }), P(n.surfaced, (t) => {
@@ -7345,7 +7363,7 @@ function Mm(e, t, n) {
7345
7363
  }
7346
7364
  //#endregion
7347
7365
  //#region web/src/use-story.ts
7348
- function Nm(e, n, r, i, a) {
7366
+ function Pm(e, n, r, i, a) {
7349
7367
  let o = t(() => oc(n.value, r.value)), s = t(() => {
7350
7368
  let t = /* @__PURE__ */ new Map();
7351
7369
  for (let e of n.value) (e.kind === "assistant" || e.kind === "toolResult") && e.turnId !== void 0 && t.set(e.turnId, e.id);
@@ -7373,7 +7391,7 @@ function Nm(e, n, r, i, a) {
7373
7391
  }
7374
7392
  //#endregion
7375
7393
  //#region web/src/use-command-owners.ts
7376
- function Pm(e) {
7394
+ function Fm(e) {
7377
7395
  let t = /* @__PURE__ */ new Map();
7378
7396
  return _(async () => {
7379
7397
  try {
@@ -7388,7 +7406,7 @@ function Pm(e) {
7388
7406
  }
7389
7407
  //#endregion
7390
7408
  //#region web/src/conversation-streams.ts
7391
- function Fm(e, t, n, r, i, a = () => void 0) {
7409
+ function Im(e, t, n, r, i, a = () => void 0) {
7392
7410
  let o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new WeakMap(), c = (e) => e.current() && o.get(e.target) === e, l = (e, t) => {
7393
7411
  c(e) && i(t);
7394
7412
  };
@@ -7440,7 +7458,7 @@ function Fm(e, t, n, r, i, a = () => void 0) {
7440
7458
  }
7441
7459
  //#endregion
7442
7460
  //#region web/src/waiting-helpers.ts
7443
- async function Im(e, t, n = /* @__PURE__ */ new Map()) {
7461
+ async function Lm(e, t, n = /* @__PURE__ */ new Map()) {
7444
7462
  let r = (await e.exec("kvcoder.job.list", { sessionId: t })).filter((e) => e.kind === "subagent" && (e.status === "waiting" || e.status === "running")), i = await Promise.all(r.map(async (r) => {
7445
7463
  let [i, [a]] = await Promise.all([e.exec("kvcoder.session.get", { sessionId: r.id }), e.exec("kvcoder.turn.list", {
7446
7464
  sessionId: r.id,
@@ -7459,27 +7477,27 @@ async function Im(e, t, n = /* @__PURE__ */ new Map()) {
7459
7477
  }
7460
7478
  //#endregion
7461
7479
  //#region web/src/use-conversation.ts
7462
- var Lm = 5e3, Rm = 200;
7463
- function zm(e, t, n, r = () => !1) {
7464
- let i = D(null), a = D([]), o = D(0), s = D([]), c = D(null), l = D(void 0), u = D(!1), d = b(os()), f = E(/* @__PURE__ */ new Map()), p = E(/* @__PURE__ */ new Map()), m, h, g, _ = !1, y = !1, x = (n) => !_ && m === n && t() === n.sessionId && e.workspace.value.id === n.workspaceId, S = Fm(e, d, u, () => F(), n, Pm(e)), C = (e) => e.filter((e) => e.queued !== !0);
7480
+ var Rm = 5e3, zm = 200;
7481
+ function Bm(e, t, n, r = () => !1) {
7482
+ let i = D(null), a = D([]), o = D(0), s = D([]), c = D(null), l = D(void 0), u = D(!1), d = b(os()), f = E(/* @__PURE__ */ new Map()), p = E(/* @__PURE__ */ new Map()), m, h, g, _ = !1, y = !1, x = (n) => !_ && m === n && t() === n.sessionId && e.workspace.value.id === n.workspaceId, S = Im(e, d, u, () => F(), n, Fm(e)), C = (e) => e.filter((e) => e.queued !== !0);
7465
7483
  async function w(t, n, r) {
7466
7484
  if (!r()) return;
7467
7485
  let i = await e.exec("kvcoder.message.list", {
7468
7486
  sessionId: t,
7469
- limit: Rm
7487
+ limit: zm
7470
7488
  });
7471
7489
  r() && (a.value = i.messages, o.value = i.omitted, g = n, y = !1);
7472
7490
  }
7473
7491
  async function T(t, n, i, s) {
7474
7492
  let c = await e.exec("kvcoder.message.list", {
7475
7493
  sessionId: t,
7476
- limit: Rm,
7494
+ limit: zm,
7477
7495
  afterSeq: i
7478
7496
  });
7479
7497
  if (!s()) return;
7480
7498
  let l = C(c.messages);
7481
7499
  if (l[0] !== void 0 && l[0].seq !== i + 1) return w(t, n, s);
7482
- let u = C(a.value), d = u.at(-1)?.seq ?? i, f = [...u, ...l.filter((e) => (e.seq ?? d) > d)], p = y || r() ? 0 : Math.max(f.length - Rm, 0);
7500
+ let u = C(a.value), d = u.at(-1)?.seq ?? i, f = [...u, ...l.filter((e) => (e.seq ?? d) > d)], p = y || r() ? 0 : Math.max(f.length - zm, 0);
7483
7501
  a.value = [...f.slice(p), ...c.messages.filter((e) => e.queued === !0)], o.value += p;
7484
7502
  }
7485
7503
  async function O() {
@@ -7487,7 +7505,7 @@ function zm(e, t, n, r = () => !1) {
7487
7505
  if (t === void 0 || n === void 0) return;
7488
7506
  let r = await e.exec("kvcoder.message.list", {
7489
7507
  sessionId: t.sessionId,
7490
- limit: Rm,
7508
+ limit: zm,
7491
7509
  beforeSeq: n
7492
7510
  });
7493
7511
  x(t) && C(a.value)[0]?.seq === n && (a.value = [...r.messages, ...a.value], o.value = r.omitted, y = !0);
@@ -7532,14 +7550,14 @@ function zm(e, t, n, r = () => !1) {
7532
7550
  turn: a?.sessionId === n ? a : void 0,
7533
7551
  live: f.get(n)?.live ?? b(os())
7534
7552
  };
7535
- Hf(t.workspaceId, n, o.turn === void 0 ? [] : [o.turn]), f.set(n, o), S.update(o.live, i.status === "running" ? i.stepJobId : void 0, () => x(t));
7553
+ Uf(t.workspaceId, n, o.turn === void 0 ? [] : [o.turn]), f.set(n, o), S.update(o.live, i.status === "running" ? i.stepJobId : void 0, () => x(t));
7536
7554
  }
7537
7555
  }
7538
7556
  async function M(t, n) {
7539
- let r = await Im(e, t.sessionId, p);
7557
+ let r = await Lm(e, t.sessionId, p);
7540
7558
  if (n()) {
7541
7559
  p.clear();
7542
- for (let [e, n] of r) Hf(t.workspaceId, e, n.child.turn === void 0 ? [] : [n.child.turn]), p.set(e, n);
7560
+ for (let [e, n] of r) Uf(t.workspaceId, e, n.child.turn === void 0 ? [] : [n.child.turn]), p.set(e, n);
7543
7561
  S.retain(/* @__PURE__ */ new Set([
7544
7562
  d,
7545
7563
  ...[...f.values()].map((e) => e.live),
@@ -7564,7 +7582,7 @@ function zm(e, t, n, r = () => !1) {
7564
7582
  e.exec("kvcoder.context.get", { sessionId: r.sessionId })
7565
7583
  ]);
7566
7584
  if (!o() || a.id !== r.sessionId || (i.value !== null && i.value.status !== a.status && e.refresh(), !o())) return;
7567
- i.value = a, s.value = l, c.value = u, Hf(r.workspaceId, a.id, l);
7585
+ i.value = a, s.value = l, c.value = u, Uf(r.workspaceId, a.id, l);
7568
7586
  let f = a.status === "running" ? a.stepJobId : void 0;
7569
7587
  S.update(d, f, () => x(r), n === void 0 || n === f ? t : []);
7570
7588
  let p = j(r, a.status === "waiting" ? l[0] : void 0, o);
@@ -7591,7 +7609,7 @@ function zm(e, t, n, r = () => !1) {
7591
7609
  e !== void 0 && !S.busy() && F().catch((t) => {
7592
7610
  x(e) && n(t);
7593
7611
  });
7594
- }, Lm);
7612
+ }, Rm);
7595
7613
  return v(() => {
7596
7614
  _ = !0, m = void 0, h = void 0, S.clear(), clearInterval(R);
7597
7615
  }), P([t, () => e.workspace.value.id], () => {
@@ -7627,7 +7645,7 @@ function zm(e, t, n, r = () => !1) {
7627
7645
  }
7628
7646
  //#endregion
7629
7647
  //#region web/src/use-execution-map.ts
7630
- function Bm(e, n, r, i, a) {
7648
+ function Vm(e, n, r, i, a) {
7631
7649
  let o = x(null), s = x(!1), c, l, u, d = 0, f = !1;
7632
7650
  async function p() {
7633
7651
  let t = n();
@@ -7673,15 +7691,15 @@ function Bm(e, n, r, i, a) {
7673
7691
  }
7674
7692
  //#endregion
7675
7693
  //#region web/src/use-follow-latest.ts
7676
- var Vm = 80;
7677
- function Hm(e, t, n) {
7694
+ var Hm = 80;
7695
+ function Um(e, t, n) {
7678
7696
  let r = x(!1);
7679
7697
  function i() {
7680
7698
  e.value !== null && (e.value.scrollTop = e.value.scrollHeight);
7681
7699
  }
7682
7700
  function a() {
7683
7701
  let t = e.value;
7684
- t !== null && (r.value = t.scrollHeight - t.clientHeight - t.scrollTop > Vm);
7702
+ t !== null && (r.value = t.scrollHeight - t.clientHeight - t.scrollTop > Hm);
7685
7703
  }
7686
7704
  function o() {
7687
7705
  r.value = !1, i();
@@ -7698,7 +7716,7 @@ function Hm(e, t, n) {
7698
7716
  }
7699
7717
  //#endregion
7700
7718
  //#region web/src/use-finished-runs.ts
7701
- function Um(e, t, n, r) {
7719
+ function Wm(e, t, n, r) {
7702
7720
  let i = x(/* @__PURE__ */ new Map());
7703
7721
  async function a(n) {
7704
7722
  try {
@@ -7719,7 +7737,7 @@ function Um(e, t, n, r) {
7719
7737
  }
7720
7738
  //#endregion
7721
7739
  //#region web/src/use-slash-commands.ts
7722
- function Wm(e) {
7740
+ function Gm(e) {
7723
7741
  let t = D([]);
7724
7742
  return _(async () => {
7725
7743
  try {
@@ -7731,7 +7749,7 @@ function Wm(e) {
7731
7749
  }
7732
7750
  //#endregion
7733
7751
  //#region web/src/use-workspace-session.ts
7734
- function Gm(e, n, r) {
7752
+ function Km(e, n, r) {
7735
7753
  let i = D(e.workspace.value.id);
7736
7754
  async function a(t) {
7737
7755
  let n;
@@ -7763,49 +7781,49 @@ function Gm(e, n, r) {
7763
7781
  }
7764
7782
  //#endregion
7765
7783
  //#region web/src/ConversationView.vue?vue&type=script&setup=true&lang.ts
7766
- var Km = { class: "kvc-workspace" }, qm = {
7784
+ var qm = { class: "kvc-workspace" }, Jm = {
7767
7785
  class: "kvc-topline",
7768
7786
  "data-test": "topline"
7769
- }, Jm = {
7787
+ }, Ym = {
7770
7788
  key: 1,
7771
7789
  class: "kvc-new-chat"
7772
- }, Ym = ["aria-label", "title"], Xm = { class: "kvc-stage" }, Zm = {
7790
+ }, Xm = ["aria-label", "title"], Zm = { class: "kvc-stage" }, Qm = {
7773
7791
  class: "kvc-conversation",
7774
7792
  "data-test": "conversation"
7775
- }, Qm = {
7793
+ }, $m = {
7776
7794
  key: 0,
7777
7795
  class: "kvc-start",
7778
7796
  role: "alert",
7779
7797
  "data-test": "load-failure"
7780
- }, $m = { class: "kvc-start-note" }, eh = {
7798
+ }, eh = { class: "kvc-start-note" }, th = {
7781
7799
  class: "kvc-actions",
7782
7800
  style: { "justify-content": "center" }
7783
- }, th = {
7801
+ }, nh = {
7784
7802
  key: 1,
7785
7803
  class: "kvc-scrollport"
7786
- }, nh = {
7804
+ }, rh = {
7787
7805
  key: 1,
7788
7806
  class: "kvc-column"
7789
- }, rh = {
7807
+ }, ih = {
7790
7808
  key: 0,
7791
7809
  class: "kvc-actions",
7792
7810
  style: { "justify-content": "center" }
7793
- }, ih = ["title"], ah = {
7811
+ }, ah = ["title"], oh = {
7794
7812
  key: 2,
7795
7813
  class: "kvc-notice",
7796
7814
  "data-test": "map-remaining"
7797
- }, oh = {
7815
+ }, sh = {
7798
7816
  key: 4,
7799
7817
  class: "kvc-notice",
7800
7818
  "data-test": "summarizing"
7801
- }, sh = {
7819
+ }, ch = {
7802
7820
  key: 5,
7803
7821
  class: "kvc-answer",
7804
7822
  "data-test": "live-answer"
7805
- }, ch = ["open"], lh = { class: "kvc-muted" }, uh = {
7823
+ }, lh = ["open"], uh = { class: "kvc-muted" }, dh = {
7806
7824
  class: "kvc-muted",
7807
7825
  style: { "white-space": "pre-wrap" }
7808
- }, dh = {
7826
+ }, fh = {
7809
7827
  key: 8,
7810
7828
  class: "kvc-muted",
7811
7829
  style: {
@@ -7813,19 +7831,19 @@ var Km = { class: "kvc-workspace" }, qm = {
7813
7831
  margin: "0"
7814
7832
  },
7815
7833
  "data-test": "waiting-hint"
7816
- }, fh = {
7834
+ }, ph = {
7817
7835
  key: 0,
7818
7836
  class: "kvc-notice",
7819
7837
  "data-test": "background-decision"
7820
- }, ph = /* @__PURE__ */ c({
7838
+ }, mh = /* @__PURE__ */ c({
7821
7839
  __name: "ConversationView",
7822
7840
  props: { sessionId: {} },
7823
7841
  setup(c) {
7824
- let l = c, u = q(), { id: d, failed: f } = Gm(u, () => l.sessionId, (e) => Y(u, e)), m = x("chat"), h = x(!1), _ = zm(u, () => d.value, f, () => h.value), { session: v, messages: b, omitted: C, turns: w, live: E, children: D, helpers: A } = _, M = Am(u, () => d.value, () => v.value?.updatedAt, f), N = Bm(u, () => d.value, () => v.value?.updatedAt, M, f), I = jm(u, () => d.value, () => v.value?.updatedAt, f), { toggleChanges: L, closePanel: R } = Mm(I, N, M), z = t(() => I.shown.value || N.shown.value || M.open.value && M.shown.value !== void 0), ee = t(() => v.value?.status === "idle" ? N.counts.value?.left ?? 0 : 0), B = t(() => Os(b.value)), te = t(() => Ws(b.value)), ne = t(() => Ni(b.value));
7842
+ let l = c, u = q(), { id: d, failed: f } = Km(u, () => l.sessionId, (e) => Y(u, e)), m = x("chat"), h = x(!1), _ = Bm(u, () => d.value, f, () => h.value), { session: v, messages: b, omitted: C, turns: w, live: E, children: D, helpers: A } = _, M = jm(u, () => d.value, () => v.value?.updatedAt, f), N = Vm(u, () => d.value, () => v.value?.updatedAt, M, f), I = Mm(u, () => d.value, () => v.value?.updatedAt, f), { toggleChanges: L, closePanel: R } = Nm(I, N, M), z = t(() => I.shown.value || N.shown.value || M.open.value && M.shown.value !== void 0), ee = t(() => v.value?.status === "idle" ? N.counts.value?.left ?? 0 : 0), B = t(() => Os(b.value)), te = t(() => Ws(b.value)), ne = t(() => Ni(b.value));
7825
7843
  async function V(e, t) {
7826
7844
  t !== void 0 && d.value !== void 0 && Fi(Vi(u.workspace.value.id, d.value), t), e.length > 0 && u.toast("kvcoder.ui.rewind.left", { count: e.length }), Ae.resume(), await _.reloadAll().catch((e) => Y(u, e));
7827
7845
  }
7828
- let { rows: re, rowKey: ie, rowTotals: ae, runningTurnId: oe, finalAnswers: H } = Nm(u.t, b, B, w, v), ce = t(() => Es(E.thinking, b.value, oe.value)), le = t(() => N.map.value?.steps.find((e) => e.status === "doing")?.title), ue = Um(u, () => d.value, b, f), de = /* @__PURE__ */ new Set([
7846
+ let { rows: re, rowKey: ie, rowTotals: ae, runningTurnId: oe, finalAnswers: H } = Pm(u.t, b, B, w, v), ce = t(() => Es(E.thinking, b.value, oe.value)), le = t(() => N.map.value?.steps.find((e) => e.status === "doing")?.title), ue = Wm(u, () => d.value, b, f), de = /* @__PURE__ */ new Set([
7829
7847
  "STEP_FAILED",
7830
7848
  "REPLY_LOST",
7831
7849
  "REPLY_INCOMPLETE",
@@ -7875,7 +7893,7 @@ var Km = { class: "kvc-workspace" }, qm = {
7875
7893
  ].join(" ")), xe = () => v.value === null || w.value[0] === void 0 ? void 0 : {
7876
7894
  sessionId: v.value.id,
7877
7895
  turnId: w.value[0].id
7878
- }, G = Om(u, (e) => _.refresh(e), xe), Se = t(() => new Map(W.value.flatMap((e) => {
7896
+ }, G = km(u, (e) => _.refresh(e), xe), Se = t(() => new Map(W.value.flatMap((e) => {
7879
7897
  let t = B.value.get(e.toolCallId)?.fields?.goal ?? B.value.get(e.toolCallId)?.fields?.task;
7880
7898
  return typeof e.childSessionId == "string" && typeof t == "string" ? [[e.childSessionId, t]] : [];
7881
7899
  }))), Ce = t(() => W.value.flatMap((e) => e.kind === "worker" && e.runId !== void 0 ? [e.runId] : [])), we = t(() => W.value.filter((e) => e.questionId === null || !G.hidden.value.has(String(e.questionId)))), Te = t(() => {
@@ -7884,14 +7902,14 @@ var Km = { class: "kvc-workspace" }, qm = {
7884
7902
  }), Ee = t(() => {
7885
7903
  let e = J(b.value.at(-1)?.content.params);
7886
7904
  return typeof e.code == "string" ? e.code : void 0;
7887
- }), De = Wm(u), K = rm(u, () => d.value ?? "", () => _.refresh());
7905
+ }), De = Gm(u), K = im(u, () => d.value ?? "", () => _.refresh());
7888
7906
  P(() => _.loadFailure.value, (e) => {
7889
7907
  lt(e)?.code === "kvcoder/SESSION_NOT_FOUND" && f(e);
7890
7908
  });
7891
7909
  let Oe = t(() => {
7892
7910
  let e = lt(_.loadFailure.value);
7893
7911
  return e === void 0 ? u.t("kvcoder.ui.failed") : u.t(ct(e.code), e.params);
7894
- }), ke = j("list"), Ae = Hm(ke, () => [
7912
+ }), ke = j("list"), Ae = Um(ke, () => [
7895
7913
  b.value,
7896
7914
  E.text,
7897
7915
  E.thinking,
@@ -7949,7 +7967,7 @@ var Km = { class: "kvc-workspace" }, qm = {
7949
7967
  fileIds: []
7950
7968
  }));
7951
7969
  }
7952
- return (t, c) => (y(), i("div", Km, [a("div", qm, [
7970
+ return (t, c) => (y(), i("div", qm, [a("div", Jm, [
7953
7971
  s(ki, { "session-id": k(d) }, null, 8, ["session-id"]),
7954
7972
  k(v) && k(d) !== void 0 ? (y(), n(as, {
7955
7973
  key: 0,
@@ -7986,7 +8004,7 @@ var Km = { class: "kvc-workspace" }, qm = {
7986
8004
  "working",
7987
8005
  "onToggleChanges"
7988
8006
  ])) : r("v-if", !0),
7989
- k(d) !== void 0 && !k(u).host.embedded ? (y(), i("div", Jm, [a("button", {
8007
+ k(d) !== void 0 && !k(u).host.embedded ? (y(), i("div", Ym, [a("button", {
7990
8008
  type: "button",
7991
8009
  class: "kvc-button kvc-ghost",
7992
8010
  "aria-label": k(u).t("kvcoder.ui.newChat"),
@@ -7996,21 +8014,21 @@ var Km = { class: "kvc-workspace" }, qm = {
7996
8014
  }, [s(k(Me), {
7997
8015
  size: 18,
7998
8016
  "aria-hidden": "true"
7999
- })], 8, Ym)])) : r("v-if", !0)
8000
- ]), a("div", Xm, [a("section", Zm, [l.sessionId === void 0 ? (y(), n(ro, {
8017
+ })], 8, Xm)])) : r("v-if", !0)
8018
+ ]), a("div", Zm, [a("section", Qm, [l.sessionId === void 0 ? (y(), n(ro, {
8001
8019
  key: 0,
8002
8020
  registered: k(De)
8003
- }, null, 8, ["registered"])) : k(v) && k(d) !== void 0 ? (y(), i(e, { key: 1 }, [k(_).loadFailure.value === void 0 ? (y(), i("div", th, [a("div", {
8021
+ }, null, 8, ["registered"])) : k(v) && k(d) !== void 0 ? (y(), i(e, { key: 1 }, [k(_).loadFailure.value === void 0 ? (y(), i("div", nh, [a("div", {
8004
8022
  ref_key: "list",
8005
8023
  ref: ke,
8006
8024
  class: "kvc-scroll",
8007
8025
  onScroll: c[12] ||= (...e) => k(Ae).onScroll && k(Ae).onScroll(...e)
8008
- }, [m.value === "prompt" ? (y(), n(nm, {
8026
+ }, [m.value === "prompt" ? (y(), n(rm, {
8009
8027
  key: 0,
8010
8028
  "session-id": k(v).id,
8011
8029
  onBack: c[7] ||= (e) => m.value = "chat"
8012
- }, null, 8, ["session-id"])) : (y(), i("div", nh, [
8013
- k(C) > 0 ? (y(), i("div", rh, [a("button", {
8030
+ }, null, 8, ["session-id"])) : (y(), i("div", rh, [
8031
+ k(C) > 0 ? (y(), i("div", ih, [a("button", {
8014
8032
  type: "button",
8015
8033
  class: "kvc-button",
8016
8034
  "data-test": "show-earlier",
@@ -8021,7 +8039,7 @@ var Km = { class: "kvc-workspace" }, qm = {
8021
8039
  "data-test": "earlier",
8022
8040
  onClick: Pe
8023
8041
  }, O(k(u).t("kvcoder.ui.earlierMessages", { count: k(C) })), 1)])) : r("v-if", !0),
8024
- (y(!0), i(e, null, S(k(re), (t) => (y(), i(e, { key: k(ie)(t) }, [t.kind === "fold" ? (y(), n(pf, {
8042
+ (y(!0), i(e, null, S(k(re), (t) => (y(), i(e, { key: k(ie)(t) }, [t.kind === "fold" ? (y(), n(mf, {
8025
8043
  key: 0,
8026
8044
  messages: t.messages,
8027
8045
  headline: t.headline,
@@ -8034,7 +8052,7 @@ var Km = { class: "kvc-workspace" }, qm = {
8034
8052
  "calls",
8035
8053
  "finished-runs",
8036
8054
  "running"
8037
- ])) : (y(), n(af, {
8055
+ ])) : (y(), n(of, {
8038
8056
  key: 1,
8039
8057
  message: t.message,
8040
8058
  calls: B.value,
@@ -8054,9 +8072,9 @@ var Km = { class: "kvc-workspace" }, qm = {
8054
8072
  class: "kvc-muted",
8055
8073
  title: k(ae)(t)?.tokens,
8056
8074
  "data-test": "turn-totals"
8057
- }, O(k(ae)(t)?.text), 9, ih))], 64))), 128)),
8075
+ }, O(k(ae)(t)?.text), 9, ah))], 64))), 128)),
8058
8076
  k(v).waitingOn === "person" ? (y(), n(_a, { key: 1 })) : r("v-if", !0),
8059
- ee.value > 0 ? (y(), i("div", ah, [
8077
+ ee.value > 0 ? (y(), i("div", oh, [
8060
8078
  o(O(k(u).t("kvcoder.ui.map.remaining", { count: ee.value })) + " ", 1),
8061
8079
  a("button", {
8062
8080
  type: "button",
@@ -8075,7 +8093,7 @@ var Km = { class: "kvc-workspace" }, qm = {
8075
8093
  })
8076
8094
  }, O(k(u).t("kvcoder.ui.map.continue")), 1)
8077
8095
  ])) : r("v-if", !0),
8078
- Te.value ? (y(), n(Yp, {
8096
+ Te.value ? (y(), n(Xp, {
8079
8097
  key: 3,
8080
8098
  "session-id": k(v).id,
8081
8099
  "failed-with": Ee.value,
@@ -8083,12 +8101,12 @@ var Km = { class: "kvc-workspace" }, qm = {
8083
8101
  k(Ae).resume(), k(_).refresh();
8084
8102
  }
8085
8103
  }, null, 8, ["session-id", "failed-with"])) : r("v-if", !0),
8086
- k(E).summarizing ? (y(), i("div", oh, O(k(u).t("kvcoder.ui.summarizing")), 1)) : r("v-if", !0),
8087
- U.value && (k(E).text !== "" || k(E).thinking !== "") ? (y(), i("div", sh, [k(E).thinking === "" ? r("v-if", !0) : (y(), i("details", {
8104
+ k(E).summarizing ? (y(), i("div", sh, O(k(u).t("kvcoder.ui.summarizing")), 1)) : r("v-if", !0),
8105
+ U.value && (k(E).text !== "" || k(E).thinking !== "") ? (y(), i("div", ch, [k(E).thinking === "" ? r("v-if", !0) : (y(), i("details", {
8088
8106
  key: 0,
8089
8107
  open: k(E).text === "" && k(E).calls.length === 0,
8090
8108
  "data-test": "live-thinking"
8091
- }, [a("summary", lh, O(k(u).t("kvcoder.ui.thinkingNow")), 1), a("p", uh, O(k(E).thinking), 1)], 8, ch)), k(E).text === "" ? r("v-if", !0) : (y(), n(T(k(u).View), {
8109
+ }, [a("summary", uh, O(k(u).t("kvcoder.ui.thinkingNow")), 1), a("p", dh, O(k(E).thinking), 1)], 8, lh)), k(E).text === "" ? r("v-if", !0) : (y(), n(T(k(u).View), {
8092
8110
  key: 1,
8093
8111
  view: {
8094
8112
  type: "markdown",
@@ -8112,7 +8130,7 @@ var Km = { class: "kvc-workspace" }, qm = {
8112
8130
  key: 7,
8113
8131
  working: k(K).working.value
8114
8132
  }, null, 8, ["working"])) : r("v-if", !0),
8115
- (y(!0), i(e, null, S(k(D), ([e, t]) => (y(), n(ym, {
8133
+ (y(!0), i(e, null, S(k(D), ([e, t]) => (y(), n(bm, {
8116
8134
  key: e,
8117
8135
  child: t,
8118
8136
  task: Se.value.get(e),
@@ -8126,12 +8144,12 @@ var Km = { class: "kvc-workspace" }, qm = {
8126
8144
  "onAnswer",
8127
8145
  "onDecide"
8128
8146
  ]))), 128)),
8129
- (y(!0), i(e, null, S(Ce.value, (e) => (y(), n(Em, {
8147
+ (y(!0), i(e, null, S(Ce.value, (e) => (y(), n(Dm, {
8130
8148
  key: e,
8131
8149
  "session-id": k(v).id,
8132
8150
  "run-id": e
8133
8151
  }, null, 8, ["session-id", "run-id"]))), 128)),
8134
- s(Up, {
8152
+ s(Wp, {
8135
8153
  owner: xe(),
8136
8154
  pending: W.value,
8137
8155
  hidden: k(G).hidden.value,
@@ -8144,8 +8162,8 @@ var Km = { class: "kvc-workspace" }, qm = {
8144
8162
  "onAnswer",
8145
8163
  "onDecide"
8146
8164
  ]),
8147
- W.value.length > 0 ? (y(), i("p", dh, O(be.value), 1)) : r("v-if", !0),
8148
- k(A).size > 0 ? (y(), i(e, { key: 9 }, [[...k(A).values()].some((e) => e.child.session.status === "waiting") ? (y(), i("p", fh, O(k(u).t("kvcoder.ui.backgroundDecision")), 1)) : r("v-if", !0), (y(!0), i(e, null, S(k(A), ([e, t]) => (y(), n(ym, {
8165
+ W.value.length > 0 ? (y(), i("p", fh, O(be.value), 1)) : r("v-if", !0),
8166
+ k(A).size > 0 ? (y(), i(e, { key: 9 }, [[...k(A).values()].some((e) => e.child.session.status === "waiting") ? (y(), i("p", ph, O(k(u).t("kvcoder.ui.backgroundDecision")), 1)) : r("v-if", !0), (y(!0), i(e, null, S(k(A), ([e, t]) => (y(), n(bm, {
8149
8167
  key: e,
8150
8168
  child: t.child,
8151
8169
  task: t.child.session.run?.goal ?? t.call,
@@ -8168,7 +8186,7 @@ var Km = { class: "kvc-workspace" }, qm = {
8168
8186
  }, [s(k(se), {
8169
8187
  size: 16,
8170
8188
  "aria-hidden": "true"
8171
- }), o(O(k(u).t("kvcoder.ui.jumpToLatest")), 1)])) : r("v-if", !0)])) : (y(), i("div", Qm, [a("p", $m, O(k(u).t("kvcoder.ui.loadFailed", { error: Oe.value })), 1), a("div", eh, [a("button", {
8189
+ }), o(O(k(u).t("kvcoder.ui.jumpToLatest")), 1)])) : r("v-if", !0)])) : (y(), i("div", $m, [a("p", eh, O(k(u).t("kvcoder.ui.loadFailed", { error: Oe.value })), 1), a("div", th, [a("button", {
8172
8190
  type: "button",
8173
8191
  class: "kvc-button kvc-primary",
8174
8192
  "data-test": "load-again",
@@ -8193,7 +8211,7 @@ var Km = { class: "kvc-workspace" }, qm = {
8193
8211
  onCommand: Re,
8194
8212
  onRegistered: ze
8195
8213
  }, {
8196
- controls: F(() => [s(im, {
8214
+ controls: F(() => [s(am, {
8197
8215
  session: k(v),
8198
8216
  onChanged: c[13] ||= (e) => k(_).refresh()
8199
8217
  }, null, 8, ["session"])]),
@@ -8249,13 +8267,13 @@ var Km = { class: "kvc-workspace" }, qm = {
8249
8267
  "onClose"
8250
8268
  ])) : r("v-if", !0)])]));
8251
8269
  }
8252
- }), mh = /* @__PURE__ */ c({
8270
+ }), hh = /* @__PURE__ */ c({
8253
8271
  __name: "conversation",
8254
8272
  props: { sessionId: {} },
8255
8273
  setup(e) {
8256
8274
  let t = e;
8257
- return (e, r) => (y(), n(ph, { "session-id": t.sessionId }, null, 8, ["session-id"]));
8275
+ return (e, r) => (y(), n(mh, { "session-id": t.sessionId }, null, 8, ["session-id"]));
8258
8276
  }
8259
8277
  });
8260
8278
  //#endregion
8261
- export { mh as default };
8279
+ export { hh as default };