@kvman/kvcoder 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/api.d.ts +35 -1
  2. package/dist/api.d.ts.map +1 -1
  3. package/dist/connectors/delegate.d.ts.map +1 -1
  4. package/dist/connectors/delegate.js +1 -0
  5. package/dist/connectors/delegate.js.map +1 -1
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +4 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/prompt/session-prompt.d.ts +1 -1
  10. package/dist/prompt/session-prompt.d.ts.map +1 -1
  11. package/dist/prompt/session-prompt.js +17 -2
  12. package/dist/prompt/session-prompt.js.map +1 -1
  13. package/dist/register-settings.d.ts +2 -2
  14. package/dist/register-settings.js +2 -2
  15. package/dist/register-settings.js.map +1 -1
  16. package/dist/registry/register-connectors.d.ts +1 -0
  17. package/dist/registry/register-connectors.d.ts.map +1 -1
  18. package/dist/registry/register-connectors.js +32 -4
  19. package/dist/registry/register-connectors.js.map +1 -1
  20. package/dist/registry/register-slash-commands.d.ts +6 -0
  21. package/dist/registry/register-slash-commands.d.ts.map +1 -0
  22. package/dist/registry/register-slash-commands.js +85 -0
  23. package/dist/registry/register-slash-commands.js.map +1 -0
  24. package/dist/schemas/records.d.ts +1 -0
  25. package/dist/schemas/records.d.ts.map +1 -1
  26. package/dist/schemas/records.js +2 -0
  27. package/dist/schemas/records.js.map +1 -1
  28. package/dist/schemas/registry.d.ts +32 -0
  29. package/dist/schemas/registry.d.ts.map +1 -1
  30. package/dist/schemas/registry.js +9 -2
  31. package/dist/schemas/registry.js.map +1 -1
  32. package/dist/sessions/new-session.d.ts.map +1 -1
  33. package/dist/sessions/new-session.js +1 -0
  34. package/dist/sessions/new-session.js.map +1 -1
  35. package/dist/store/collections.d.ts +18 -0
  36. package/dist/store/collections.d.ts.map +1 -1
  37. package/dist/store/collections.js +5 -2
  38. package/dist/store/collections.js.map +1 -1
  39. package/dist/turns/settle-calls.d.ts +2 -2
  40. package/dist/turns/settle-calls.d.ts.map +1 -1
  41. package/dist/turns/settle-calls.js +1 -1
  42. package/dist/turns/settle-calls.js.map +1 -1
  43. package/dist/turns/start-turn.d.ts +1 -0
  44. package/dist/turns/start-turn.d.ts.map +1 -1
  45. package/dist/turns/step.js +1 -1
  46. package/dist/turns/step.js.map +1 -1
  47. package/dist/web/components/conversation.js +253 -181
  48. package/docs/connectors.md +21 -1
  49. package/locales/ar.json +5 -1
  50. package/locales/en.json +5 -1
  51. package/package.json +4 -4
@@ -53,19 +53,19 @@ function I(e, t = {}) {
53
53
  var L = (e) => {
54
54
  for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
55
55
  return !1;
56
- }, R = (e) => e === "", ee = (e) => e?.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), z = /* @__PURE__ */ Symbol("lucide-icons");
57
- function B() {
58
- return u(z, {});
56
+ }, R = (e) => e === "", z = (e) => e?.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), B = /* @__PURE__ */ Symbol("lucide-icons");
57
+ function V() {
58
+ return u(B, {});
59
59
  }
60
60
  //#endregion
61
61
  //#region ../../node_modules/.pnpm/@lucide+vue@1.49.0_vue@3.5.43_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/Icon.mjs
62
- var V = ({ name: e, iconNode: t, "icon-node": n, icon: r = {
63
- name: e && ee(e),
62
+ var H = ({ name: e, iconNode: t, "icon-node": n, icon: r = {
63
+ name: e && z(e),
64
64
  node: t ?? n ?? [],
65
65
  size: 24,
66
66
  aliases: []
67
67
  }, absoluteStrokeWidth: i, "absolute-stroke-width": a, nonScalingStroke: o, "non-scaling-stroke": s, strokeWidth: c, "stroke-width": u, size: d, width: f = d, height: p = d, color: m, ...h }, { slots: g }) => {
68
- let { size: _, color: v, strokeWidth: y = 2, absoluteStrokeWidth: b = !1, nonScalingStroke: x = !1, class: S = "" } = B(), C = R(i) || R(a) || i === !0 || a === !0 || b === !0, w = R(o) || R(s) || o === !0 || s === !0 || x === !0;
68
+ let { size: _, color: v, strokeWidth: y = 2, absoluteStrokeWidth: b = !1, nonScalingStroke: x = !1, class: S = "" } = V(), C = R(i) || R(a) || i === !0 || a === !0 || b === !0, w = R(o) || R(s) || o === !0 || s === !0 || x === !0;
69
69
  delete h.class;
70
70
  let T = g.default?.(), [, E, D = []] = I(r, {
71
71
  color: m ?? v,
@@ -82,17 +82,17 @@ var V = ({ name: e, iconNode: t, "icon-node": n, icon: r = {
82
82
  };
83
83
  //#endregion
84
84
  //#region ../../node_modules/.pnpm/@lucide+vue@1.49.0_vue@3.5.43_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/createLucideIcon.mjs
85
- function H(e, t = []) {
85
+ function U(e, t = []) {
86
86
  let n = typeof e == "string" ? {
87
87
  name: e,
88
88
  node: t
89
89
  } : e;
90
- return (e, { slots: t }) => l(V, {
90
+ return (e, { slots: t }) => l(H, {
91
91
  ...e,
92
92
  icon: n
93
93
  }, t.default ? { default: t.default } : void 0);
94
94
  }
95
- var te = H({
95
+ var ee = U({
96
96
  name: "arrow-down",
97
97
  size: 24,
98
98
  node: [["path", {
@@ -102,7 +102,7 @@ var te = H({
102
102
  d: "m19 12-7 7-7-7",
103
103
  key: "1idqje"
104
104
  }]]
105
- }), U = H({
105
+ }), W = U({
106
106
  name: "arrow-left",
107
107
  size: 24,
108
108
  node: [["path", {
@@ -112,7 +112,7 @@ var te = H({
112
112
  d: "M19 12H5",
113
113
  key: "x3x0zl"
114
114
  }]]
115
- }), W = H({
115
+ }), G = U({
116
116
  name: "arrow-up",
117
117
  size: 24,
118
118
  node: [["path", {
@@ -122,7 +122,7 @@ var te = H({
122
122
  d: "M12 19V5",
123
123
  key: "x0mq9r"
124
124
  }]]
125
- }), ne = H({
125
+ }), te = U({
126
126
  name: "bell-ring",
127
127
  size: 24,
128
128
  node: [
@@ -143,7 +143,7 @@ var te = H({
143
143
  key: "tap9e0"
144
144
  }]
145
145
  ]
146
- }), re = H({
146
+ }), ne = U({
147
147
  name: "bot",
148
148
  size: 24,
149
149
  node: [
@@ -176,28 +176,28 @@ var te = H({
176
176
  key: "rq6x2g"
177
177
  }]
178
178
  ]
179
- }), G = H({
179
+ }), K = U({
180
180
  name: "check",
181
181
  size: 24,
182
182
  node: [["path", {
183
183
  d: "M20 6 9 17l-5-5",
184
184
  key: "1gmf2c"
185
185
  }]]
186
- }), K = H({
186
+ }), re = U({
187
187
  name: "chevron-down",
188
188
  size: 24,
189
189
  node: [["path", {
190
190
  d: "m6 9 6 6 6-6",
191
191
  key: "qrunsl"
192
192
  }]]
193
- }), q = H({
193
+ }), q = U({
194
194
  name: "chevron-right",
195
195
  size: 24,
196
196
  node: [["path", {
197
197
  d: "m9 18 6-6-6-6",
198
198
  key: "mthhwq"
199
199
  }]]
200
- }), ie = H({
200
+ }), ie = U({
201
201
  name: "circle-check",
202
202
  size: 24,
203
203
  node: [["circle", {
@@ -210,7 +210,7 @@ var te = H({
210
210
  key: "xofnsj"
211
211
  }]],
212
212
  aliases: ["check-circle-2"]
213
- }), ae = H({
213
+ }), ae = U({
214
214
  name: "circle-question-mark",
215
215
  size: 24,
216
216
  node: [
@@ -230,7 +230,7 @@ var te = H({
230
230
  }]
231
231
  ],
232
232
  aliases: ["help-circle", "circle-help"]
233
- }), oe = H({
233
+ }), oe = U({
234
234
  name: "code",
235
235
  size: 24,
236
236
  node: [["path", {
@@ -240,7 +240,7 @@ var te = H({
240
240
  d: "m8 6-6 6 6 6",
241
241
  key: "ppft3o"
242
242
  }]]
243
- }), se = H({
243
+ }), se = U({
244
244
  name: "copy",
245
245
  size: 24,
246
246
  node: [["rect", {
@@ -255,7 +255,7 @@ var te = H({
255
255
  d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",
256
256
  key: "zix9uf"
257
257
  }]]
258
- }), ce = H({
258
+ }), ce = U({
259
259
  name: "ellipsis",
260
260
  size: 24,
261
261
  node: [
@@ -279,7 +279,7 @@ var te = H({
279
279
  }]
280
280
  ],
281
281
  aliases: ["more-horizontal"]
282
- }), le = H({
282
+ }), le = U({
283
283
  name: "external-link",
284
284
  size: 24,
285
285
  node: [
@@ -296,7 +296,7 @@ var te = H({
296
296
  key: "a6xqqp"
297
297
  }]
298
298
  ]
299
- }), ue = H({
299
+ }), ue = U({
300
300
  name: "eye",
301
301
  size: 24,
302
302
  node: [["path", {
@@ -308,7 +308,7 @@ var te = H({
308
308
  r: "3",
309
309
  key: "1v7zrd"
310
310
  }]]
311
- }), de = H({
311
+ }), de = U({
312
312
  name: "info",
313
313
  size: 24,
314
314
  node: [
@@ -327,7 +327,7 @@ var te = H({
327
327
  key: "e9boi3"
328
328
  }]
329
329
  ]
330
- }), fe = H({
330
+ }), fe = U({
331
331
  name: "notebook-text",
332
332
  size: 24,
333
333
  node: [
@@ -368,7 +368,7 @@ var te = H({
368
368
  key: "p1seyn"
369
369
  }]
370
370
  ]
371
- }), pe = H({
371
+ }), pe = U({
372
372
  name: "panel-right",
373
373
  size: 24,
374
374
  node: [["rect", {
@@ -382,14 +382,14 @@ var te = H({
382
382
  d: "M15 3v18",
383
383
  key: "14nvp0"
384
384
  }]]
385
- }), me = H({
385
+ }), me = U({
386
386
  name: "paperclip",
387
387
  size: 24,
388
388
  node: [["path", {
389
389
  d: "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",
390
390
  key: "1miecu"
391
391
  }]]
392
- }), he = H({
392
+ }), he = U({
393
393
  name: "rotate-cw",
394
394
  size: 24,
395
395
  node: [["path", {
@@ -399,7 +399,7 @@ var te = H({
399
399
  d: "M21 3v5h-5",
400
400
  key: "1q7to0"
401
401
  }]]
402
- }), ge = H({
402
+ }), ge = U({
403
403
  name: "scroll-text",
404
404
  size: 24,
405
405
  node: [
@@ -420,7 +420,7 @@ var te = H({
420
420
  key: "1ph1d7"
421
421
  }]
422
422
  ]
423
- }), _e = H({
423
+ }), _e = U({
424
424
  name: "search",
425
425
  size: 24,
426
426
  node: [["path", {
@@ -432,7 +432,7 @@ var te = H({
432
432
  r: "8",
433
433
  key: "4ej97u"
434
434
  }]]
435
- }), ve = H({
435
+ }), ve = U({
436
436
  name: "shield-alert",
437
437
  size: 24,
438
438
  node: [
@@ -449,7 +449,7 @@ var te = H({
449
449
  key: "1drbdi"
450
450
  }]
451
451
  ]
452
- }), ye = H({
452
+ }), ye = U({
453
453
  name: "square",
454
454
  size: 24,
455
455
  node: [["rect", {
@@ -460,7 +460,7 @@ var te = H({
460
460
  rx: "2",
461
461
  key: "afitv7"
462
462
  }]]
463
- }), be = H({
463
+ }), be = U({
464
464
  name: "x",
465
465
  size: 24,
466
466
  node: [["path", {
@@ -790,8 +790,15 @@ function yt(e) {
790
790
  named: t[2] !== void 0
791
791
  };
792
792
  }
793
- function bt(e) {
794
- return vt.filter((t) => e.named ? t.name === e.word : t.name.startsWith(e.word));
793
+ function bt(e, t) {
794
+ let n = (t) => e.named ? t === e.word : t.startsWith(e.word);
795
+ return [...vt.filter((e) => n(e.name)).map((e) => ({
796
+ kind: "own",
797
+ command: e
798
+ })), ...t.filter((e) => n(e.name)).map((e) => ({
799
+ kind: "registered",
800
+ command: e
801
+ }))];
795
802
  }
796
803
  //#endregion
797
804
  //#region web/src/MessageComposer.vue?vue&type=script&setup=true&lang.ts
@@ -830,19 +837,21 @@ var xt = { class: "kvc-composer" }, St = { class: "kvc-box" }, Ct = ["aria-label
830
837
  running: { type: Boolean },
831
838
  placeholder: {},
832
839
  blocked: { type: Boolean },
833
- commands: {}
840
+ commands: {},
841
+ registered: {}
834
842
  },
835
843
  emits: [
836
844
  "send",
837
845
  "stop",
838
- "command"
846
+ "command",
847
+ "registered"
839
848
  ],
840
849
  setup(n, { emit: c }) {
841
- let l = n, u = c, d = J(), f = v(""), p = v([]), m = v(null), h = v(!1), _ = v(0), x = v(!1), S = t(() => l.commands === void 0 ? void 0 : yt(f.value)), C = t(() => l.commands === "wait"), E = t(() => S.value === void 0 ? [] : bt(S.value));
850
+ let l = n, u = c, d = J(), f = v(""), p = v([]), m = v(null), h = v(!1), _ = v(0), x = v(!1), S = t(() => l.commands === void 0 ? void 0 : yt(f.value)), C = t(() => l.commands === "wait"), E = t(() => S.value === void 0 ? [] : bt(S.value, l.registered ?? [])), k = (e) => !C.value || e.kind === "registered", j = t(() => E.value.filter(k)), M = t(() => j.value[_.value]), N = t(() => j.value.length < E.value.length), P = (e) => e.kind === "own" && "argument" in e.command, F = (e) => d.t(e.kind === "own" ? `kvcoder.ui.slash.${e.command.name}` : e.command.description);
842
851
  O(f, () => {
843
852
  _.value = 0, x.value = !1;
844
853
  });
845
- async function k(e) {
854
+ async function I(e) {
846
855
  h.value = !0;
847
856
  try {
848
857
  for (let t of e) {
@@ -863,42 +872,48 @@ var xt = { class: "kvc-composer" }, St = { class: "kvc-box" }, Ct = ["aria-label
863
872
  h.value = !1;
864
873
  }
865
874
  }
866
- async function j(e) {
875
+ async function L(e) {
867
876
  let t = e.target;
868
- t instanceof HTMLInputElement && t.files !== null && (await k([...t.files]), t.value = "");
877
+ t instanceof HTMLInputElement && t.files !== null && (await I([...t.files]), t.value = "");
869
878
  }
870
- function M(e) {
879
+ function R(e) {
871
880
  let t = [...e.clipboardData?.files ?? []];
872
- t.length !== 0 && (e.preventDefault(), k(t));
881
+ t.length !== 0 && (e.preventDefault(), I(t));
873
882
  }
874
- function N() {
875
- let e = E.value[_.value], t = S.value?.argument ?? "";
876
- C.value || l.blocked === !0 || e === void 0 || "argument" in e && t === "" || (u("command", e.name, t), f.value = "");
883
+ function z() {
884
+ let e = M.value, t = S.value?.argument ?? "";
885
+ l.blocked === !0 || e === void 0 || P(e) && t === "" || (e.kind === "own" ? u("command", e.command.name, t) : u("registered", e.command, t), f.value = "");
877
886
  }
878
- function P() {
879
- if (S.value !== void 0) return N();
887
+ function B() {
888
+ if (S.value !== void 0) return z();
880
889
  let e = f.value.trim();
881
890
  e === "" || h.value || l.blocked === !0 || (u("send", {
882
891
  text: e,
883
892
  fileIds: p.value.map((e) => e.id)
884
893
  }), f.value = "", p.value = []);
885
894
  }
886
- function F(e) {
887
- !C.value && E.value.length > 0 && (_.value = (_.value + e + E.value.length) % E.value.length);
895
+ function V(e) {
896
+ j.value.length > 0 && (_.value = (_.value + e + j.value.length) % j.value.length);
897
+ }
898
+ function H(e) {
899
+ k(e) && (_.value = j.value.indexOf(e));
900
+ }
901
+ function U(e) {
902
+ k(e) && (H(e), z());
888
903
  }
889
- function I(e) {
904
+ function ee(e) {
890
905
  if (S.value === void 0) return !1;
891
- let t = E.value[_.value];
906
+ let t = M.value;
892
907
  if (e.key === "Escape") x.value = !0;
893
- else if (e.key === "ArrowDown") F(1);
894
- else if (e.key === "ArrowUp") F(-1);
895
- else if (e.key === "Tab" && t !== void 0 && !C.value) f.value = `/${t.name} `;
908
+ else if (e.key === "ArrowDown") V(1);
909
+ else if (e.key === "ArrowUp") V(-1);
910
+ else if (e.key === "Tab" && t !== void 0) f.value = `/${t.command.name} `;
896
911
  else return !1;
897
912
  return !0;
898
913
  }
899
- function L(e) {
900
- if (I(e)) return e.preventDefault();
901
- e.key !== "Enter" || e.shiftKey || e.isComposing || (e.preventDefault(), P());
914
+ function W(e) {
915
+ if (ee(e)) return e.preventDefault();
916
+ e.key !== "Enter" || e.shiftKey || e.isComposing || (e.preventDefault(), B());
902
917
  }
903
918
  return (t, n) => (g(), i("div", xt, [a("div", St, [
904
919
  S.value !== void 0 && !x.value ? (g(), i("div", {
@@ -908,20 +923,18 @@ var xt = { class: "kvc-composer" }, St = { class: "kvc-box" }, Ct = ["aria-label
908
923
  "aria-label": T(d).t("kvcoder.ui.slash.title"),
909
924
  "data-test": "slash-list"
910
925
  }, [
911
- C.value ? (g(), i("p", wt, w(T(d).t("kvcoder.ui.slash.wait")), 1)) : r("v-if", !0),
912
- (g(!0), i(e, null, y(E.value, (t, n) => (g(), i("div", {
913
- key: t.name,
926
+ N.value ? (g(), i("p", wt, w(T(d).t("kvcoder.ui.slash.wait")), 1)) : r("v-if", !0),
927
+ (g(!0), i(e, null, y(E.value, (t) => (g(), i("div", {
928
+ key: t.command.name,
914
929
  class: "kvc-slash-row",
915
930
  role: "option",
916
- "aria-disabled": C.value,
917
- "aria-selected": !C.value && n === _.value,
918
- "data-active": !C.value && n === _.value,
919
- "data-test": `slash-${t.name}`,
920
- onMousemove: (e) => _.value = n,
921
- onClick: (e) => {
922
- _.value = n, N();
923
- }
924
- }, [a("span", Et, [a("span", Dt, [o("/" + w(t.name), 1), "argument" in t ? (g(), i(e, { key: 0 }, [o(" <" + w(T(d).t(`kvcoder.ui.slash.${t.name}.argument`)) + ">", 1)], 64)) : r("v-if", !0)])]), a("span", Ot, w(T(d).t(`kvcoder.ui.slash.${t.name}`)), 1)], 40, Tt))), 128)),
931
+ "aria-disabled": !k(t),
932
+ "aria-selected": t === M.value,
933
+ "data-active": t === M.value,
934
+ "data-test": `slash-${t.command.name}`,
935
+ onMousemove: (e) => H(t),
936
+ onClick: (e) => U(t)
937
+ }, [a("span", Et, [a("span", Dt, [o("/" + w(t.command.name), 1), P(t) ? (g(), i(e, { key: 0 }, [o(" <" + w(T(d).t(`kvcoder.ui.slash.${t.command.name}.argument`)) + ">", 1)], 64)) : r("v-if", !0)])]), a("span", Ot, w(F(t)), 1)], 40, Tt))), 128)),
925
938
  E.value.length === 0 ? (g(), i("p", kt, w(T(d).t("kvcoder.ui.slash.none")), 1)) : r("v-if", !0)
926
939
  ], 8, Ct)) : r("v-if", !0),
927
940
  p.value.length > 0 ? (g(), i("div", At, [(g(!0), i(e, null, y(p.value, (e) => (g(), i("span", {
@@ -944,8 +957,8 @@ var xt = { class: "kvc-composer" }, St = { class: "kvc-box" }, Ct = ["aria-label
944
957
  "aria-label": l.placeholder,
945
958
  rows: "2",
946
959
  "data-test": "composer-text",
947
- onKeydown: L,
948
- onPaste: M
960
+ onKeydown: W,
961
+ onPaste: R
949
962
  }, null, 40, Mt), [[D, f.value]]),
950
963
  a("div", Nt, [
951
964
  a("input", {
@@ -955,7 +968,7 @@ var xt = { class: "kvc-composer" }, St = { class: "kvc-box" }, Ct = ["aria-label
955
968
  multiple: "",
956
969
  hidden: "",
957
970
  "data-test": "composer-files",
958
- onChange: j
971
+ onChange: L
959
972
  }, null, 544),
960
973
  a("button", {
961
974
  type: "button",
@@ -980,8 +993,8 @@ var xt = { class: "kvc-composer" }, St = { class: "kvc-box" }, Ct = ["aria-label
980
993
  "aria-label": T(d).t("kvcoder.ui.send"),
981
994
  disabled: f.value.trim() === "" || h.value || l.blocked === !0,
982
995
  "data-test": "send",
983
- onClick: P
984
- }, [s(T(W), { size: 16 })], 8, It)
996
+ onClick: B
997
+ }, [s(T(G), { size: 16 })], 8, It)
985
998
  ])
986
999
  ])]));
987
1000
  }
@@ -1063,41 +1076,41 @@ var Bt = [
1063
1076
  function R() {
1064
1077
  m.value = !1, b.value?.focus();
1065
1078
  }
1066
- async function ee() {
1067
- h.value = "", _.value = Math.max(L(l.current ?? ""), 0), z = 0, m.value = !0, await d(), V(), x.value?.focus(), te();
1079
+ async function z() {
1080
+ h.value = "", _.value = Math.max(L(l.current ?? ""), 0), B = 0, m.value = !0, await d(), H(), x.value?.focus(), ee();
1068
1081
  }
1069
- let z = 0, B = 0;
1070
- function V() {
1082
+ let B = 0, V = 0;
1083
+ function H() {
1071
1084
  let e = S.value, t = b.value?.closest(".kvc-conversation")?.getBoundingClientRect();
1072
1085
  if (e === null || t === void 0) return;
1073
- let n = e.getBoundingClientRect(), r = t.left + tn - (n.left - z), i = t.right - tn - (n.right - z), a = r > 0 ? r : i < 0 ? i : 0;
1074
- a !== z && (z = a, e.style.translate = `${a}px 0`);
1086
+ let n = e.getBoundingClientRect(), r = t.left + tn - (n.left - B), i = t.right - tn - (n.right - B), a = r > 0 ? r : i < 0 ? i : 0;
1087
+ a !== B && (B = a, e.style.translate = `${a}px 0`);
1075
1088
  }
1076
- function H() {
1077
- V(), B = requestAnimationFrame(H);
1089
+ function U() {
1090
+ H(), V = requestAnimationFrame(U);
1078
1091
  }
1079
- function te() {
1092
+ function ee() {
1080
1093
  S.value?.querySelector("[data-active=\"true\"]")?.scrollIntoView?.({ block: "nearest" });
1081
1094
  }
1082
- async function U(e) {
1083
- I.value !== 0 && (_.value = (_.value + e + I.value) % I.value, await d(), te());
1095
+ async function W(e) {
1096
+ I.value !== 0 && (_.value = (_.value + e + I.value) % I.value, await d(), ee());
1084
1097
  }
1085
- function W(e) {
1098
+ function G(e) {
1086
1099
  e !== void 0 && (u("pick", e), R());
1087
1100
  }
1088
- function ne() {
1101
+ function te() {
1089
1102
  u("none"), R();
1090
1103
  }
1091
- function re() {
1092
- P.value && _.value === 0 ? ne() : W(k.value[_.value - F.value]?.id);
1104
+ function ne() {
1105
+ P.value && _.value === 0 ? te() : G(k.value[_.value - F.value]?.id);
1093
1106
  }
1094
1107
  function q(e) {
1095
1108
  e.target instanceof Node && !b.value?.parentElement?.contains(e.target) && (m.value = !1);
1096
1109
  }
1097
1110
  return O(h, () => _.value = 0), O(m, (e) => {
1098
- e ? (document.addEventListener("pointerdown", q), B = requestAnimationFrame(H)) : (document.removeEventListener("pointerdown", q), cancelAnimationFrame(B));
1111
+ e ? (document.addEventListener("pointerdown", q), V = requestAnimationFrame(U)) : (document.removeEventListener("pointerdown", q), cancelAnimationFrame(V));
1099
1112
  }), p(() => {
1100
- document.removeEventListener("pointerdown", q), cancelAnimationFrame(B);
1113
+ document.removeEventListener("pointerdown", q), cancelAnimationFrame(V);
1101
1114
  }), (t, o) => (g(), i("div", Vt, [a("button", {
1102
1115
  ref_key: "trigger",
1103
1116
  ref: b,
@@ -1108,8 +1121,8 @@ var Bt = [
1108
1121
  "aria-label": `${T(f).t("kvcoder.ui.model")}: ${N.value}`,
1109
1122
  disabled: l.disabled,
1110
1123
  "data-test": "model-picker",
1111
- onClick: o[0] ||= (e) => m.value ? R() : ee()
1112
- }, [a("span", Ut, w(N.value), 1), s(T(K), {
1124
+ onClick: o[0] ||= (e) => m.value ? R() : z()
1125
+ }, [a("span", Ut, w(N.value), 1), s(T(re), {
1113
1126
  size: 16,
1114
1127
  "aria-hidden": "true"
1115
1128
  })], 8, Ht), m.value ? (g(), i("div", {
@@ -1135,9 +1148,9 @@ var Bt = [
1135
1148
  "aria-label": T(f).t("kvcoder.ui.searchModels"),
1136
1149
  "data-test": "model-search",
1137
1150
  onKeydown: [
1138
- o[2] ||= j(M((e) => U(1), ["prevent"]), ["down"]),
1139
- o[3] ||= j(M((e) => U(-1), ["prevent"]), ["up"]),
1140
- j(M(re, ["prevent"]), ["enter"])
1151
+ o[2] ||= j(M((e) => W(1), ["prevent"]), ["down"]),
1152
+ o[3] ||= j(M((e) => W(-1), ["prevent"]), ["up"]),
1153
+ j(M(ne, ["prevent"]), ["enter"])
1141
1154
  ]
1142
1155
  }, null, 40, Kt), [[D, h.value]])]),
1143
1156
  a("div", {
@@ -1153,9 +1166,9 @@ var Bt = [
1153
1166
  "aria-selected": l.current === null,
1154
1167
  "data-active": _.value === 0,
1155
1168
  "data-test": "model-none-entry",
1156
- onClick: ne,
1169
+ onClick: te,
1157
1170
  onMousemove: o[4] ||= (e) => _.value = 0
1158
- }, [a("span", Yt, w(l.none), 1), l.current === null ? (g(), n(T(G), {
1171
+ }, [a("span", Yt, w(l.none), 1), l.current === null ? (g(), n(T(K), {
1159
1172
  key: 0,
1160
1173
  size: 16,
1161
1174
  "aria-hidden": "true"
@@ -1167,9 +1180,9 @@ var Bt = [
1167
1180
  "aria-selected": e.id === l.current,
1168
1181
  "data-active": L(e.id) === _.value,
1169
1182
  "data-test": `model-${e.id}`,
1170
- onClick: (t) => W(e.id),
1183
+ onClick: (t) => G(e.id),
1171
1184
  onMousemove: (t) => _.value = L(e.id)
1172
- }, [a("span", Qt, w(e.name), 1), e.id === l.current ? (g(), n(T(G), {
1185
+ }, [a("span", Qt, w(e.name), 1), e.id === l.current ? (g(), n(T(K), {
1173
1186
  key: 0,
1174
1187
  size: 16,
1175
1188
  "aria-hidden": "true"
@@ -1288,18 +1301,23 @@ var dn = {
1288
1301
  class: "kvc-muted kvc-start-note"
1289
1302
  }, hn = /* @__PURE__ */ c({
1290
1303
  __name: "ChatStart",
1304
+ props: { registered: {} },
1291
1305
  setup(t) {
1292
- let n = J(), r = un(n, (e) => X(n, e));
1293
- async function c(e) {
1294
- r.pickModel(e), await sn(n, e);
1295
- }
1306
+ let n = J(), r = t, c = un(n, (e) => X(n, e));
1296
1307
  async function l(e) {
1308
+ c.pickModel(e), await sn(n, e);
1309
+ }
1310
+ async function u() {
1311
+ let { id: e } = await n.exec("kvcoder.session.create", {}), t = c.changes();
1312
+ return Object.keys(t).length > 0 && await n.exec("kvcoder.session.configure", {
1313
+ sessionId: e,
1314
+ ...t
1315
+ }), e;
1316
+ }
1317
+ async function d(e) {
1297
1318
  try {
1298
- let { id: t } = await n.exec("kvcoder.session.create", {}), i = r.changes();
1299
- Object.keys(i).length > 0 && await n.exec("kvcoder.session.configure", {
1300
- sessionId: t,
1301
- ...i
1302
- }), await n.exec("kvcoder.message.send", {
1319
+ let t = await u();
1320
+ await n.exec("kvcoder.message.send", {
1303
1321
  sessionId: t,
1304
1322
  text: e.text,
1305
1323
  ...e.fileIds.length > 0 ? { fileIds: e.fileIds } : {}
@@ -1308,25 +1326,41 @@ var dn = {
1308
1326
  X(n, e);
1309
1327
  }
1310
1328
  }
1311
- return (t, u) => (g(), i(e, null, [a("div", dn, [a("h1", null, w(T(n).t("kvcoder.ui.startHeading", { workspace: T(n).workspace.value.name })), 1), T(r).state.value === "needsKey" && T(r).provider.value ? (g(), i("p", fn, [o(w(T(n).t("kvcoder.ui.keyNeeded", { provider: T(r).provider.value.title })) + " ", 1), a("button", {
1329
+ async function f(e, t) {
1330
+ try {
1331
+ let r = await u();
1332
+ await n.exec(e.command, {
1333
+ sessionId: r,
1334
+ argument: t
1335
+ }), e.message !== void 0 && await n.exec("kvcoder.message.send", {
1336
+ sessionId: r,
1337
+ text: t === "" ? n.t(e.message) : t
1338
+ }), n.navigate("kvcoder.session", { sessionId: r });
1339
+ } catch (e) {
1340
+ X(n, e);
1341
+ }
1342
+ }
1343
+ return (t, u) => (g(), i(e, null, [a("div", dn, [a("h1", null, w(T(n).t("kvcoder.ui.startHeading", { workspace: T(n).workspace.value.name })), 1), T(c).state.value === "needsKey" && T(c).provider.value ? (g(), i("p", fn, [o(w(T(n).t("kvcoder.ui.keyNeeded", { provider: T(c).provider.value.title })) + " ", 1), a("button", {
1312
1344
  type: "button",
1313
1345
  class: "kvc-link-button",
1314
1346
  "data-test": "add-key",
1315
- onClick: u[0] ||= (e) => T(n).navigate("kvai.provider", { providerId: T(r).provider.value.id })
1316
- }, w(T(n).t("kvcoder.ui.addKey")), 1)])) : T(r).state.value === "noModel" ? (g(), i("p", pn, w(T(n).t("kvcoder.ui.chooseModelHint")), 1)) : (g(), i("p", mn, w(T(n).t("kvcoder.ui.startHint")), 1))]), s(Lt, {
1347
+ onClick: u[0] ||= (e) => T(n).navigate("kvai.provider", { providerId: T(c).provider.value.id })
1348
+ }, w(T(n).t("kvcoder.ui.addKey")), 1)])) : T(c).state.value === "noModel" ? (g(), i("p", pn, w(T(n).t("kvcoder.ui.chooseModelHint")), 1)) : (g(), i("p", mn, w(T(n).t("kvcoder.ui.startHint")), 1))]), s(Lt, {
1317
1349
  running: !1,
1318
1350
  placeholder: T(n).t("kvcoder.ui.startPlaceholder"),
1319
- blocked: T(r).state.value !== "ready",
1351
+ blocked: T(c).state.value !== "ready",
1320
1352
  commands: "wait",
1321
- onSend: l
1353
+ registered: r.registered,
1354
+ onSend: d,
1355
+ onRegistered: f
1322
1356
  }, {
1323
1357
  controls: k(() => [s(on, {
1324
- groups: T(r).groups.value,
1325
- model: T(r).current.value,
1326
- thinking: T(r).thinking.value,
1327
- empty: T(r).state.value === "loading" ? "" : T(n).t("kvcoder.ui.chooseModel"),
1328
- onModel: c,
1329
- onThinking: T(r).pickThinking
1358
+ groups: T(c).groups.value,
1359
+ model: T(c).current.value,
1360
+ thinking: T(c).thinking.value,
1361
+ empty: T(c).state.value === "loading" ? "" : T(n).t("kvcoder.ui.chooseModel"),
1362
+ onModel: l,
1363
+ onThinking: T(c).pickThinking
1330
1364
  }, null, 8, [
1331
1365
  "groups",
1332
1366
  "model",
@@ -1335,7 +1369,11 @@ var dn = {
1335
1369
  "onThinking"
1336
1370
  ])]),
1337
1371
  _: 1
1338
- }, 8, ["placeholder", "blocked"])], 64));
1372
+ }, 8, [
1373
+ "placeholder",
1374
+ "blocked",
1375
+ "registered"
1376
+ ])], 64));
1339
1377
  }
1340
1378
  });
1341
1379
  //#endregion
@@ -1533,7 +1571,7 @@ var Tn = ["data-test", "data-status"], En = { class: "kvc-job-head" }, Dn = {
1533
1571
  "aria-hidden": "true"
1534
1572
  }, null, -1),
1535
1573
  o(w(T(l).t("kvcoder.ui.jobs.running", { count: T(h).length })), 1),
1536
- s(T(K), {
1574
+ s(T(re), {
1537
1575
  size: 16,
1538
1576
  "aria-hidden": "true"
1539
1577
  })
@@ -2043,7 +2081,7 @@ var Ir = ["aria-label"], Lr = {
2043
2081
  "data-chosen": e.chosen,
2044
2082
  "data-test": `answered-option-${e.id}`
2045
2083
  }, [
2046
- e.chosen ? (g(), n(T(G), {
2084
+ e.chosen ? (g(), n(T(K), {
2047
2085
  key: 0,
2048
2086
  size: 16,
2049
2087
  "aria-hidden": "true",
@@ -2051,7 +2089,7 @@ var Ir = ["aria-label"], Lr = {
2051
2089
  })) : (g(), i("span", Hr)),
2052
2090
  a("span", Ur, [a("span", Wr, w(e.label), 1), e.description ? (g(), i("span", Gr, w(e.description), 1)) : r("v-if", !0)]),
2053
2091
  e.chosen ? (g(), i("span", Kr, w(T(l).t("kvcoder.ui.chosen")), 1)) : r("v-if", !0)
2054
- ], 8, Vr))), 128)), m.value === "" ? r("v-if", !0) : (g(), i("div", qr, [s(T(G), {
2092
+ ], 8, Vr))), 128)), m.value === "" ? r("v-if", !0) : (g(), i("div", qr, [s(T(K), {
2055
2093
  size: 16,
2056
2094
  "aria-hidden": "true",
2057
2095
  class: "kvc-ok"
@@ -2206,7 +2244,7 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
2206
2244
  key: 0,
2207
2245
  class: "kvc-spin",
2208
2246
  "aria-label": T(l).t("kvcoder.ui.running")
2209
- }, null, 8, ui)) : (g(), n(x(u.value ? T(K) : T(q)), {
2247
+ }, null, 8, ui)) : (g(), n(x(u.value ? T(re) : T(q)), {
2210
2248
  key: 1,
2211
2249
  size: 16,
2212
2250
  "aria-hidden": "true"
@@ -2305,7 +2343,7 @@ var li = ["aria-expanded", "disabled"], ui = ["aria-label"], di = { class: "kvc-
2305
2343
  text: "kvcoder.markdown",
2306
2344
  params: { text: e }
2307
2345
  });
2308
- return (t, c) => T(Nr)(u.message) ? (g(), i("div", wi, [a("details", null, [a("summary", Ti, [s(T(ne), {
2346
+ return (t, c) => T(Nr)(u.message) ? (g(), i("div", wi, [a("details", null, [a("summary", Ti, [s(T(te), {
2309
2347
  size: 16,
2310
2348
  "aria-hidden": "true"
2311
2349
  }), o(w(T(p).t(u.message.source?.kind === "subagent" ? "kvcoder.ui.helperFinished" : "kvcoder.ui.backgroundFinished")), 1)]), a("pre", Ei, w(m.value), 1)])])) : T(Mr)(u.message) ? (g(), i("div", Di, [a("details", null, [a("summary", Oi, [s(T(de), {
@@ -2712,7 +2750,7 @@ var ya = {
2712
2750
  class: "kvc-button",
2713
2751
  "data-test": "prompt-back",
2714
2752
  onClick: n[0] ||= (e) => l("back")
2715
- }, [s(T(U), {
2753
+ }, [s(T(W), {
2716
2754
  size: 16,
2717
2755
  class: "kvc-flip",
2718
2756
  "aria-hidden": "true"
@@ -2787,6 +2825,16 @@ function ka(e, t, n) {
2787
2825
  let { fileId: n } = await e.exec("kvcoder.session.export", { sessionId: t() });
2788
2826
  window.location.assign(`/api/files/${encodeURIComponent(n)}?workspaceId=${encodeURIComponent(e.workspace.value.id)}`);
2789
2827
  }),
2828
+ runRegistered: async (r, i) => {
2829
+ try {
2830
+ return await e.exec(r.command, {
2831
+ sessionId: t(),
2832
+ argument: i
2833
+ }), await n(), !0;
2834
+ } catch (t) {
2835
+ return X(e, t), !1;
2836
+ }
2837
+ },
2790
2838
  remove: () => i(async () => {
2791
2839
  await e.exec("kvcoder.session.delete", { sessionId: t() }), e.navigate("kvcoder.chat");
2792
2840
  })
@@ -2846,7 +2894,7 @@ var Aa = /* @__PURE__ */ c({
2846
2894
  "data-test": "subagent-card",
2847
2895
  "aria-label": T(Pe)(T(l).t, o.child.session.title)
2848
2896
  }, [a("div", Ma, [
2849
- s(T(re), {
2897
+ s(T(ne), {
2850
2898
  size: 18,
2851
2899
  "aria-hidden": "true"
2852
2900
  }),
@@ -2911,7 +2959,7 @@ var Aa = /* @__PURE__ */ c({
2911
2959
  "data-test": "worker-card",
2912
2960
  "aria-label": o.value.title
2913
2961
  }, [a("div", Ba, [
2914
- s(T(re), {
2962
+ s(T(ne), {
2915
2963
  size: 18,
2916
2964
  "aria-hidden": "true"
2917
2965
  }),
@@ -3200,8 +3248,20 @@ function Qa(e, t, n) {
3200
3248
  };
3201
3249
  }
3202
3250
  //#endregion
3251
+ //#region web/src/use-slash-commands.ts
3252
+ function $a(e) {
3253
+ let t = C([]);
3254
+ return m(async () => {
3255
+ try {
3256
+ t.value = await e.exec("kvcoder.slash.list", {});
3257
+ } catch (t) {
3258
+ X(e, t);
3259
+ }
3260
+ }), t;
3261
+ }
3262
+ //#endregion
3203
3263
  //#region web/src/use-workspace-session.ts
3204
- function $a(e, n, r) {
3264
+ function eo(e, n, r) {
3205
3265
  let i = C(e.workspace.value.id);
3206
3266
  async function a(t) {
3207
3267
  let n;
@@ -3220,39 +3280,39 @@ function $a(e, n, r) {
3220
3280
  }
3221
3281
  //#endregion
3222
3282
  //#region web/src/ConversationView.vue?vue&type=script&setup=true&lang.ts
3223
- var eo = { class: "kvc-workspace" }, to = { class: "kvc-stage" }, no = {
3283
+ var to = { class: "kvc-workspace" }, no = { class: "kvc-stage" }, ro = {
3224
3284
  class: "kvc-conversation",
3225
3285
  "data-test": "conversation"
3226
- }, ro = { class: "kvc-scrollport" }, io = {
3286
+ }, io = { class: "kvc-scrollport" }, ao = {
3227
3287
  key: 1,
3228
3288
  class: "kvc-column"
3229
- }, ao = {
3289
+ }, oo = {
3230
3290
  key: 0,
3231
3291
  class: "kvc-muted",
3232
3292
  "data-test": "turn-totals"
3233
- }, oo = {
3293
+ }, so = {
3234
3294
  key: 2,
3235
3295
  class: "kvc-notice",
3236
3296
  "data-test": "summarizing"
3237
- }, so = {
3297
+ }, co = {
3238
3298
  key: 3,
3239
3299
  class: "kvc-answer",
3240
3300
  "data-test": "live-answer"
3241
- }, co = ["open"], lo = { class: "kvc-muted" }, uo = {
3301
+ }, lo = ["open"], uo = { class: "kvc-muted" }, fo = {
3242
3302
  class: "kvc-muted",
3243
3303
  style: { "white-space": "pre-wrap" }
3244
- }, fo = {
3304
+ }, po = {
3245
3305
  key: 6,
3246
3306
  class: "kvc-muted",
3247
3307
  style: {
3248
3308
  "text-align": "center",
3249
3309
  margin: "0"
3250
3310
  }
3251
- }, po = /* @__PURE__ */ c({
3311
+ }, mo = /* @__PURE__ */ c({
3252
3312
  __name: "ConversationView",
3253
3313
  props: { sessionId: {} },
3254
3314
  setup(c) {
3255
- let l = c, u = J(), d = $a(u, () => l.sessionId, (e) => X(u, e)), f = v("chat"), p = Xa(u, () => d.value, (e) => X(u, e)), { session: m, messages: h, omitted: _, turns: b, live: S, children: C } = p, D = Ja(u, () => d.value, () => m.value?.updatedAt, (e) => X(u, e)), O = t(() => D.open.value && D.shown.value !== void 0), A = t(() => Er(h.value)), j = /* @__PURE__ */ new Set([
3315
+ let l = c, u = J(), d = eo(u, () => l.sessionId, (e) => X(u, e)), f = v("chat"), p = Xa(u, () => d.value, (e) => X(u, e)), { session: m, messages: h, omitted: _, turns: b, live: S, children: C } = p, D = Ja(u, () => d.value, () => m.value?.updatedAt, (e) => X(u, e)), O = t(() => D.open.value && D.shown.value !== void 0), A = t(() => Er(h.value)), j = /* @__PURE__ */ new Set([
3256
3316
  "STEP_FAILED",
3257
3317
  "REPLY_LOST",
3258
3318
  "INTERRUPTED"
@@ -3272,7 +3332,7 @@ var eo = { class: "kvc-workspace" }, to = { class: "kvc-stage" }, no = {
3272
3332
  sessionId: d.value,
3273
3333
  text: e.text,
3274
3334
  ...e.fileIds.length > 0 ? { fileIds: e.fileIds } : {}
3275
- }), U.resume(), await p.refresh();
3335
+ }), G.resume(), await p.refresh();
3276
3336
  } catch (e) {
3277
3337
  X(u, e);
3278
3338
  }
@@ -3284,10 +3344,10 @@ var eo = { class: "kvc-workspace" }, to = { class: "kvc-stage" }, no = {
3284
3344
  X(u, e);
3285
3345
  }
3286
3346
  }
3287
- let R = qa(u, (e) => p.refresh(e)), ee = t(() => P.value.flatMap((e) => e.kind === "worker" && e.runId !== void 0 ? [e.runId] : [])), z = t(() => P.value.filter((e) => e.questionId === null || !R.hidden.value.has(String(e.questionId)))), B = t(() => {
3347
+ let R = qa(u, (e) => p.refresh(e)), z = t(() => P.value.flatMap((e) => e.kind === "worker" && e.runId !== void 0 ? [e.runId] : [])), B = t(() => P.value.filter((e) => e.questionId === null || !R.hidden.value.has(String(e.questionId)))), V = t(() => {
3288
3348
  let e = h.value.at(-1);
3289
3349
  return m.value?.status === "idle" && e?.kind === "notice" && j.has(String(e.content.code));
3290
- }), V = ka(u, () => d.value ?? "", () => p.refresh()), H = E("list"), U = Qa(H, () => [
3350
+ }), H = $a(u), U = ka(u, () => d.value ?? "", () => p.refresh()), W = E("list"), G = Qa(W, () => [
3291
3351
  h.value,
3292
3352
  S.text,
3293
3353
  S.thinking,
@@ -3297,9 +3357,9 @@ var eo = { class: "kvc-workspace" }, to = { class: "kvc-stage" }, no = {
3297
3357
  P.value,
3298
3358
  C.size,
3299
3359
  R.hidden.value,
3300
- V.working.value
3360
+ U.working.value
3301
3361
  ], () => d.value);
3302
- async function W() {
3362
+ async function te() {
3303
3363
  if (d.value !== void 0) try {
3304
3364
  let { fileId: e } = await u.exec("kvcoder.session.export", { sessionId: d.value });
3305
3365
  window.location.assign(`/api/files/${encodeURIComponent(e)}?workspaceId=${encodeURIComponent(u.workspace.value.id)}`);
@@ -3308,21 +3368,27 @@ var eo = { class: "kvc-workspace" }, to = { class: "kvc-stage" }, no = {
3308
3368
  }
3309
3369
  }
3310
3370
  let ne = () => h.value.at(-1)?.kind === "notice" && h.value.at(-1)?.content.code === "SUMMARY_FAILED";
3311
- async function re() {
3371
+ async function K() {
3312
3372
  return (await u.exec("kernel.settings.list", {})).find((e) => e.key === "kvcoder.compactKeep")?.value ?? null;
3313
3373
  }
3314
- async function G() {
3315
- let e = await V.compact();
3316
- e === !0 ? u.toast("kvcoder.ui.summarized", {}, "success") : e === !1 && !ne() && u.toast("kvcoder.ui.nothingToSummarize", { count: await re() });
3374
+ async function re() {
3375
+ let e = await U.compact();
3376
+ e === !0 ? u.toast("kvcoder.ui.summarized", {}, "success") : e === !1 && !ne() && u.toast("kvcoder.ui.nothingToSummarize", { count: await K() });
3317
3377
  }
3318
- function K(e, t) {
3378
+ function q(e, t) {
3319
3379
  if (e === "new") return u.navigate("kvcoder.chat");
3320
3380
  if (e === "prompt") return void (f.value = f.value === "prompt" ? "chat" : "prompt");
3321
- if (e === "delete") return void V.remove();
3322
- V.working.value === void 0 && (f.value = "chat", e === "rename" ? V.rename(t) : e === "compact" ? G() : e === "export" ? V.exportFile() : V.fork());
3381
+ if (e === "delete") return void U.remove();
3382
+ U.working.value === void 0 && (f.value = "chat", e === "rename" ? U.rename(t) : e === "compact" ? re() : e === "export" ? U.exportFile() : U.fork());
3323
3383
  }
3324
- let q = (e) => e.id;
3325
- return (t, c) => (g(), i("div", eo, [T(m) && T(d) !== void 0 ? (g(), n(rr, {
3384
+ async function ie(e, t) {
3385
+ U.working.value === void 0 && (f.value = "chat", await U.runRegistered(e, t) && e.message !== void 0 && await I({
3386
+ text: t === "" ? u.t(e.message) : t,
3387
+ fileIds: []
3388
+ }));
3389
+ }
3390
+ let ae = (e) => e.id;
3391
+ return (t, c) => (g(), i("div", to, [T(m) && T(d) !== void 0 ? (g(), n(rr, {
3326
3392
  key: 0,
3327
3393
  session: T(m),
3328
3394
  tab: f.value,
@@ -3330,9 +3396,9 @@ var eo = { class: "kvc-workspace" }, to = { class: "kvc-stage" }, no = {
3330
3396
  "running-since": N.value,
3331
3397
  artifacts: T(D).list.value.length,
3332
3398
  "artifacts-open": T(D).open.value,
3333
- working: T(V).working.value !== void 0,
3399
+ working: T(U).working.value !== void 0,
3334
3400
  onTab: c[0] ||= (e) => f.value = e,
3335
- onAction: K,
3401
+ onAction: q,
3336
3402
  onToggleArtifacts: c[1] ||= (e) => T(D).toggle()
3337
3403
  }, null, 8, [
3338
3404
  "session",
@@ -3342,42 +3408,45 @@ var eo = { class: "kvc-workspace" }, to = { class: "kvc-stage" }, no = {
3342
3408
  "artifacts",
3343
3409
  "artifacts-open",
3344
3410
  "working"
3345
- ])) : r("v-if", !0), a("div", to, [a("section", no, [l.sessionId === void 0 ? (g(), n(hn, { key: 0 })) : T(m) && T(d) !== void 0 ? (g(), i(e, { key: 1 }, [a("div", ro, [a("div", {
3411
+ ])) : r("v-if", !0), a("div", no, [a("section", ro, [l.sessionId === void 0 ? (g(), n(hn, {
3412
+ key: 0,
3413
+ registered: T(H)
3414
+ }, null, 8, ["registered"])) : T(m) && T(d) !== void 0 ? (g(), i(e, { key: 1 }, [a("div", io, [a("div", {
3346
3415
  ref_key: "list",
3347
- ref: H,
3416
+ ref: W,
3348
3417
  class: "kvc-scroll",
3349
- onScroll: c[5] ||= (...e) => T(U).onScroll && T(U).onScroll(...e)
3418
+ onScroll: c[5] ||= (...e) => T(G).onScroll && T(G).onScroll(...e)
3350
3419
  }, [f.value === "prompt" ? (g(), n(Oa, {
3351
3420
  key: 0,
3352
3421
  "session-id": T(m).id,
3353
3422
  onBack: c[2] ||= (e) => f.value = "chat"
3354
- }, null, 8, ["session-id"])) : (g(), i("div", io, [
3423
+ }, null, 8, ["session-id"])) : (g(), i("div", ao, [
3355
3424
  T(_) > 0 ? (g(), i("button", {
3356
3425
  key: 0,
3357
3426
  type: "button",
3358
3427
  class: "kvc-button",
3359
3428
  style: { "align-self": "center" },
3360
3429
  "data-test": "earlier",
3361
- onClick: W
3430
+ onClick: te
3362
3431
  }, w(T(u).t("kvcoder.ui.earlierMessages", { count: T(_) })), 1)) : r("v-if", !0),
3363
- (g(!0), i(e, null, y(T(h), (t) => (g(), i(e, { key: q(t) }, [s(Hi, {
3432
+ (g(!0), i(e, null, y(T(h), (t) => (g(), i(e, { key: ae(t) }, [s(Hi, {
3364
3433
  message: t,
3365
3434
  calls: A.value,
3366
3435
  onOpenArtifact: c[3] ||= (e) => T(D).openArtifact(e)
3367
- }, null, 8, ["message", "calls"]), F.value.has(t.id) ? (g(), i("span", ao, w(F.value.get(t.id)), 1)) : r("v-if", !0)], 64))), 128)),
3368
- B.value ? (g(), n(xa, {
3436
+ }, null, 8, ["message", "calls"]), F.value.has(t.id) ? (g(), i("span", oo, w(F.value.get(t.id)), 1)) : r("v-if", !0)], 64))), 128)),
3437
+ V.value ? (g(), n(xa, {
3369
3438
  key: 1,
3370
3439
  "session-id": T(m).id,
3371
3440
  onSent: c[4] ||= (e) => {
3372
- T(U).resume(), T(p).refresh();
3441
+ T(G).resume(), T(p).refresh();
3373
3442
  }
3374
3443
  }, null, 8, ["session-id"])) : r("v-if", !0),
3375
- T(S).summarizing ? (g(), i("div", oo, w(T(u).t("kvcoder.ui.summarizing")), 1)) : r("v-if", !0),
3376
- M.value && (T(S).text !== "" || T(S).thinking !== "") ? (g(), i("div", so, [T(S).thinking === "" ? r("v-if", !0) : (g(), i("details", {
3444
+ T(S).summarizing ? (g(), i("div", so, w(T(u).t("kvcoder.ui.summarizing")), 1)) : r("v-if", !0),
3445
+ M.value && (T(S).text !== "" || T(S).thinking !== "") ? (g(), i("div", co, [T(S).thinking === "" ? r("v-if", !0) : (g(), i("details", {
3377
3446
  key: 0,
3378
3447
  open: T(S).text === "" && T(S).calls.length === 0,
3379
3448
  "data-test": "live-thinking"
3380
- }, [a("summary", lo, w(T(u).t("kvcoder.ui.thinkingNow")), 1), a("p", uo, w(T(S).thinking), 1)], 8, co)), T(S).text === "" ? r("v-if", !0) : (g(), n(x(T(u).View), {
3449
+ }, [a("summary", uo, w(T(u).t("kvcoder.ui.thinkingNow")), 1), a("p", fo, w(T(S).thinking), 1)], 8, lo)), T(S).text === "" ? r("v-if", !0) : (g(), n(x(T(u).View), {
3381
3450
  key: 1,
3382
3451
  view: {
3383
3452
  type: "markdown",
@@ -3389,9 +3458,9 @@ var eo = { class: "kvc-workspace" }, to = { class: "kvc-stage" }, no = {
3389
3458
  key: 4,
3390
3459
  live: T(S)
3391
3460
  }, null, 8, ["live"])) : r("v-if", !0),
3392
- T(V).working.value ? (g(), n(xn, {
3461
+ T(U).working.value ? (g(), n(xn, {
3393
3462
  key: 5,
3394
- working: T(V).working.value
3463
+ working: T(U).working.value
3395
3464
  }, null, 8, ["working"])) : r("v-if", !0),
3396
3465
  (g(!0), i(e, null, y(T(C), ([e, t]) => (g(), n(Ra, {
3397
3466
  key: e,
@@ -3405,7 +3474,7 @@ var eo = { class: "kvc-workspace" }, to = { class: "kvc-stage" }, no = {
3405
3474
  "onAnswer",
3406
3475
  "onDecide"
3407
3476
  ]))), 128)),
3408
- (g(!0), i(e, null, y(ee.value, (e) => (g(), n(Ga, {
3477
+ (g(!0), i(e, null, y(z.value, (e) => (g(), n(Ga, {
3409
3478
  key: e,
3410
3479
  "session-id": T(m).id,
3411
3480
  "run-id": e
@@ -3421,24 +3490,26 @@ var eo = { class: "kvc-workspace" }, to = { class: "kvc-stage" }, no = {
3421
3490
  "onAnswer",
3422
3491
  "onDecide"
3423
3492
  ]),
3424
- z.value.some((e) => e.kind !== "subagent" && e.kind !== "worker") ? (g(), i("p", fo, w(T(u).t("kvcoder.ui.messageDismisses")), 1)) : r("v-if", !0)
3425
- ]))], 544), T(U).away.value ? (g(), i("button", {
3493
+ B.value.some((e) => e.kind !== "subagent" && e.kind !== "worker") ? (g(), i("p", po, w(T(u).t("kvcoder.ui.messageDismisses")), 1)) : r("v-if", !0)
3494
+ ]))], 544), T(G).away.value ? (g(), i("button", {
3426
3495
  key: 0,
3427
3496
  type: "button",
3428
3497
  class: "kvc-button kvc-jump",
3429
3498
  "data-test": "jump-to-latest",
3430
- onClick: c[6] ||= (...e) => T(U).resume && T(U).resume(...e)
3431
- }, [s(T(te), {
3499
+ onClick: c[6] ||= (...e) => T(G).resume && T(G).resume(...e)
3500
+ }, [s(T(ee), {
3432
3501
  size: 16,
3433
3502
  "aria-hidden": "true"
3434
3503
  }), o(w(T(u).t("kvcoder.ui.jumpToLatest")), 1)])) : r("v-if", !0)]), s(Lt, {
3435
3504
  running: M.value,
3436
3505
  placeholder: T(u).t("kvcoder.ui.placeholder"),
3437
- blocked: T(V).working.value !== void 0,
3506
+ blocked: T(U).working.value !== void 0,
3438
3507
  commands: "run",
3508
+ registered: T(H),
3439
3509
  onSend: I,
3440
3510
  onStop: L,
3441
- onCommand: K
3511
+ onCommand: q,
3512
+ onRegistered: ie
3442
3513
  }, {
3443
3514
  controls: k(() => [s(Aa, {
3444
3515
  session: T(m),
@@ -3448,7 +3519,8 @@ var eo = { class: "kvc-workspace" }, to = { class: "kvc-stage" }, no = {
3448
3519
  }, 8, [
3449
3520
  "running",
3450
3521
  "placeholder",
3451
- "blocked"
3522
+ "blocked",
3523
+ "registered"
3452
3524
  ])], 64)) : r("v-if", !0)]), O.value ? (g(), n(_t, {
3453
3525
  key: 0,
3454
3526
  list: T(D).list.value,
@@ -3462,13 +3534,13 @@ var eo = { class: "kvc-workspace" }, to = { class: "kvc-stage" }, no = {
3462
3534
  "content"
3463
3535
  ])) : r("v-if", !0)])]));
3464
3536
  }
3465
- }), mo = /* @__PURE__ */ c({
3537
+ }), ho = /* @__PURE__ */ c({
3466
3538
  __name: "conversation",
3467
3539
  props: { sessionId: {} },
3468
3540
  setup(e) {
3469
3541
  let t = e;
3470
- return (e, r) => (g(), n(po, { "session-id": t.sessionId }, null, 8, ["session-id"]));
3542
+ return (e, r) => (g(), n(mo, { "session-id": t.sessionId }, null, 8, ["session-id"]));
3471
3543
  }
3472
3544
  });
3473
3545
  //#endregion
3474
- export { mo as default };
3546
+ export { ho as default };