@kvman/kvcoder 0.1.3 → 0.1.5

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