@kvman/kvcoder 0.1.10 → 0.1.11

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 (171) hide show
  1. package/dist/api.d.ts +3 -2
  2. package/dist/api.d.ts.map +1 -1
  3. package/dist/calls/call-name.d.ts +8 -0
  4. package/dist/calls/call-name.d.ts.map +1 -0
  5. package/dist/calls/call-name.js +38 -0
  6. package/dist/calls/call-name.js.map +1 -0
  7. package/dist/calls/line-run.d.ts +1 -4
  8. package/dist/calls/line-run.d.ts.map +1 -1
  9. package/dist/calls/line-run.js +2 -2
  10. package/dist/calls/line-run.js.map +1 -1
  11. package/dist/calls/run-tool.d.ts +1 -6
  12. package/dist/calls/run-tool.d.ts.map +1 -1
  13. package/dist/calls/run-tool.js +3 -6
  14. package/dist/calls/run-tool.js.map +1 -1
  15. package/dist/connector-call.d.ts +1 -1
  16. package/dist/connector-call.d.ts.map +1 -1
  17. package/dist/connectors/artifact.d.ts +1 -1
  18. package/dist/connectors/artifact.d.ts.map +1 -1
  19. package/dist/connectors/artifact.js +1 -1
  20. package/dist/connectors/artifact.js.map +1 -1
  21. package/dist/connectors/background.d.ts.map +1 -1
  22. package/dist/connectors/background.js +9 -3
  23. package/dist/connectors/background.js.map +1 -1
  24. package/dist/connectors/binary.js +2 -2
  25. package/dist/connectors/binary.js.map +1 -1
  26. package/dist/connectors/builtin-connectors.d.ts +24 -2
  27. package/dist/connectors/builtin-connectors.d.ts.map +1 -1
  28. package/dist/connectors/connector-command.d.ts +0 -1
  29. package/dist/connectors/connector-command.d.ts.map +1 -1
  30. package/dist/connectors/connector-command.js +1 -1
  31. package/dist/connectors/connector-command.js.map +1 -1
  32. package/dist/connectors/delegate.d.ts +17 -0
  33. package/dist/connectors/delegate.d.ts.map +1 -1
  34. package/dist/connectors/delegate.js +28 -6
  35. package/dist/connectors/delegate.js.map +1 -1
  36. package/dist/connectors/execution-map.d.ts +14 -3
  37. package/dist/connectors/execution-map.d.ts.map +1 -1
  38. package/dist/connectors/execution-map.js +43 -12
  39. package/dist/connectors/execution-map.js.map +1 -1
  40. package/dist/connectors/shell.js +1 -1
  41. package/dist/connectors/shell.js.map +1 -1
  42. package/dist/delegate/approved-run.js +2 -2
  43. package/dist/delegate/approved-run.js.map +1 -1
  44. package/dist/delegate/continue-helper.d.ts +18 -0
  45. package/dist/delegate/continue-helper.d.ts.map +1 -0
  46. package/dist/delegate/continue-helper.js +64 -0
  47. package/dist/delegate/continue-helper.js.map +1 -0
  48. package/dist/delegate/permission.d.ts +5 -5
  49. package/dist/delegate/runs.d.ts +9 -11
  50. package/dist/delegate/runs.d.ts.map +1 -1
  51. package/dist/delegate/runs.js +13 -9
  52. package/dist/delegate/runs.js.map +1 -1
  53. package/dist/delegate/workers.d.ts +6 -0
  54. package/dist/delegate/workers.d.ts.map +1 -1
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +2 -0
  57. package/dist/index.js.map +1 -1
  58. package/dist/jobs/helper-progress.d.ts +11 -0
  59. package/dist/jobs/helper-progress.d.ts.map +1 -0
  60. package/dist/jobs/helper-progress.js +38 -0
  61. package/dist/jobs/helper-progress.js.map +1 -0
  62. package/dist/jobs/job-rows.d.ts +3 -1
  63. package/dist/jobs/job-rows.d.ts.map +1 -1
  64. package/dist/jobs/job-rows.js +46 -22
  65. package/dist/jobs/job-rows.js.map +1 -1
  66. package/dist/jobs/process-report.d.ts +1 -1
  67. package/dist/jobs/process-report.d.ts.map +1 -1
  68. package/dist/jobs/process-report.js +11 -6
  69. package/dist/jobs/process-report.js.map +1 -1
  70. package/dist/jobs/process-run.d.ts +2 -5
  71. package/dist/jobs/process-run.d.ts.map +1 -1
  72. package/dist/jobs/process-run.js +6 -5
  73. package/dist/jobs/process-run.js.map +1 -1
  74. package/dist/jobs/register-jobs.js +3 -3
  75. package/dist/jobs/register-jobs.js.map +1 -1
  76. package/dist/maps/map-rules.d.ts +4 -2
  77. package/dist/maps/map-rules.d.ts.map +1 -1
  78. package/dist/maps/map-rules.js +7 -4
  79. package/dist/maps/map-rules.js.map +1 -1
  80. package/dist/maps/map-schema.d.ts +4 -4
  81. package/dist/maps/map-schema.d.ts.map +1 -1
  82. package/dist/maps/map-schema.js +10 -3
  83. package/dist/maps/map-schema.js.map +1 -1
  84. package/dist/prompt/build-prompt.js +2 -2
  85. package/dist/prompt/build-prompt.js.map +1 -1
  86. package/dist/prompt/session-grants.d.ts +3 -3
  87. package/dist/prompt/working-method.js +12 -12
  88. package/dist/prompt/working-method.js.map +1 -1
  89. package/dist/register-settings.d.ts +4 -0
  90. package/dist/register-settings.d.ts.map +1 -1
  91. package/dist/schemas/records.d.ts +10 -6
  92. package/dist/schemas/records.d.ts.map +1 -1
  93. package/dist/schemas/records.js +7 -4
  94. package/dist/schemas/records.js.map +1 -1
  95. package/dist/sessions/new-session.d.ts.map +1 -1
  96. package/dist/sessions/new-session.js +4 -2
  97. package/dist/sessions/new-session.js.map +1 -1
  98. package/dist/sessions/register-sessions.d.ts.map +1 -1
  99. package/dist/sessions/register-sessions.js +5 -2
  100. package/dist/sessions/register-sessions.js.map +1 -1
  101. package/dist/sessions/session-view.d.ts +2 -0
  102. package/dist/sessions/session-view.d.ts.map +1 -1
  103. package/dist/store/collections.d.ts +8 -8
  104. package/dist/thinking-levels.d.ts +6 -0
  105. package/dist/thinking-levels.d.ts.map +1 -0
  106. package/dist/thinking-levels.js +13 -0
  107. package/dist/thinking-levels.js.map +1 -0
  108. package/dist/turns/cache-retention.d.ts +6 -0
  109. package/dist/turns/cache-retention.d.ts.map +1 -0
  110. package/dist/turns/cache-retention.js +7 -0
  111. package/dist/turns/cache-retention.js.map +1 -0
  112. package/dist/turns/call-results.d.ts +6 -0
  113. package/dist/turns/call-results.d.ts.map +1 -0
  114. package/dist/turns/call-results.js +21 -0
  115. package/dist/turns/call-results.js.map +1 -0
  116. package/dist/turns/child-result.d.ts.map +1 -1
  117. package/dist/turns/child-result.js +4 -2
  118. package/dist/turns/child-result.js.map +1 -1
  119. package/dist/turns/compaction.d.ts.map +1 -1
  120. package/dist/turns/compaction.js +2 -1
  121. package/dist/turns/compaction.js.map +1 -1
  122. package/dist/turns/end-turn-state.d.ts.map +1 -1
  123. package/dist/turns/end-turn-state.js +2 -0
  124. package/dist/turns/end-turn-state.js.map +1 -1
  125. package/dist/turns/ended-calls.d.ts +6 -0
  126. package/dist/turns/ended-calls.d.ts.map +1 -0
  127. package/dist/turns/ended-calls.js +43 -0
  128. package/dist/turns/ended-calls.js.map +1 -0
  129. package/dist/turns/model-context.d.ts.map +1 -1
  130. package/dist/turns/model-context.js +16 -1
  131. package/dist/turns/model-context.js.map +1 -1
  132. package/dist/turns/model-info.d.ts +4 -0
  133. package/dist/turns/model-info.d.ts.map +1 -1
  134. package/dist/turns/model-info.js +7 -1
  135. package/dist/turns/model-info.js.map +1 -1
  136. package/dist/turns/model-retry.d.ts.map +1 -1
  137. package/dist/turns/model-retry.js +5 -4
  138. package/dist/turns/model-retry.js.map +1 -1
  139. package/dist/turns/run-calls.d.ts.map +1 -1
  140. package/dist/turns/run-calls.js +21 -5
  141. package/dist/turns/run-calls.js.map +1 -1
  142. package/dist/turns/run-command.d.ts.map +1 -1
  143. package/dist/turns/run-command.js +4 -6
  144. package/dist/turns/run-command.js.map +1 -1
  145. package/dist/turns/sent-size.d.ts +6 -2
  146. package/dist/turns/sent-size.d.ts.map +1 -1
  147. package/dist/turns/sent-size.js +8 -4
  148. package/dist/turns/sent-size.js.map +1 -1
  149. package/dist/turns/settle-calls.d.ts +1 -7
  150. package/dist/turns/settle-calls.d.ts.map +1 -1
  151. package/dist/turns/settle-calls.js +2 -19
  152. package/dist/turns/settle-calls.js.map +1 -1
  153. package/dist/turns/step.d.ts.map +1 -1
  154. package/dist/turns/step.js +29 -6
  155. package/dist/turns/step.js.map +1 -1
  156. package/dist/web/components/approval.css +1 -1
  157. package/dist/web/components/call.css +1 -1
  158. package/dist/web/components/call.js +210 -183
  159. package/dist/web/components/connectors.css +1 -1
  160. package/dist/web/components/connectors.js +431 -412
  161. package/dist/web/components/conversation.css +1 -1
  162. package/dist/web/components/conversation.js +1000 -893
  163. package/dist/web/components/mcp-sign-in.css +1 -1
  164. package/dist/web/components/model.css +1 -1
  165. package/dist/web/components/model.js +2 -1
  166. package/dist/web/components/question.css +1 -1
  167. package/dist/web/components/sessions.css +1 -1
  168. package/docs/connectors.md +4 -5
  169. package/locales/ar.json +15 -4
  170. package/locales/en.json +15 -4
  171. package/package.json +137 -5
@@ -16,7 +16,7 @@ var F = {
16
16
  function L(e) {
17
17
  return e != null;
18
18
  }
19
- function ee(e, t = {}) {
19
+ function R(e, t = {}) {
20
20
  let n = t.attributeNames ?? {}, r = (e) => n[e] ?? e, i = e.size ?? e.width ?? F.width, a = e.size ?? e.height ?? F.height, o = e.aliases?.filter((e) => typeof e == "string" && e.trim() !== "").map((e) => `lucide-${e}`) ?? [], s = [...e.name ? [`lucide-${e.name}`] : [], ...o], c = t.className?.split(" ").filter(Boolean) ?? [], l = t.includeDefaultClasses === !1 ? I(...c) : I("lucide", ...s, ...c), u = t.absoluteStrokeWidth ? Number(t.strokeWidth ?? F["stroke-width"]) * Number(e.size ?? e.width ?? F.width) / Number(t.size ?? t.width ?? F.width) : t.strokeWidth ?? F["stroke-width"];
21
21
  return [
22
22
  "svg",
@@ -50,24 +50,24 @@ function ee(e, t = {}) {
50
50
  }
51
51
  //#endregion
52
52
  //#region ../../node_modules/.pnpm/@lucide+vue@1.49.0_vue@3.5.43_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/shared/src/utils/hasA11yProp.mjs
53
- var R = (e) => {
53
+ var ee = (e) => {
54
54
  for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
55
55
  return !1;
56
- }, z = (e) => e === "", B = (e) => e?.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), V = /* @__PURE__ */ Symbol("lucide-icons");
57
- function te() {
58
- return u(V, {});
56
+ }, z = (e) => e === "", te = (e) => e?.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), B = /* @__PURE__ */ Symbol("lucide-icons");
57
+ function ne() {
58
+ return u(B, {});
59
59
  }
60
60
  //#endregion
61
61
  //#region ../../node_modules/.pnpm/@lucide+vue@1.49.0_vue@3.5.43_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/Icon.mjs
62
- var ne = ({ name: e, iconNode: t, "icon-node": n, icon: r = {
63
- name: e && B(e),
62
+ var re = ({ name: e, iconNode: t, "icon-node": n, icon: r = {
63
+ name: e && te(e),
64
64
  node: t ?? n ?? [],
65
65
  size: 24,
66
66
  aliases: []
67
67
  }, absoluteStrokeWidth: i, "absolute-stroke-width": a, nonScalingStroke: o, "non-scaling-stroke": s, strokeWidth: c, "stroke-width": u, size: d, width: f = d, height: p = d, color: m, ...h }, { slots: g }) => {
68
- let { size: _, color: v, strokeWidth: y = 2, absoluteStrokeWidth: b = !1, nonScalingStroke: x = !1, class: S = "" } = te(), C = z(i) || z(a) || i === !0 || a === !0 || b === !0, w = z(o) || z(s) || o === !0 || s === !0 || x === !0;
68
+ let { size: _, color: v, strokeWidth: y = 2, absoluteStrokeWidth: b = !1, nonScalingStroke: x = !1, class: S = "" } = ne(), C = z(i) || z(a) || i === !0 || a === !0 || b === !0, w = z(o) || z(s) || o === !0 || s === !0 || x === !0;
69
69
  delete h.class;
70
- let T = g.default?.(), [, E, D = []] = ee(r, {
70
+ let T = g.default?.(), [, E, D = []] = R(r, {
71
71
  color: m ?? v,
72
72
  width: f ?? d ?? _,
73
73
  height: p ?? d ?? _,
@@ -75,24 +75,24 @@ var ne = ({ name: e, iconNode: t, "icon-node": n, icon: r = {
75
75
  absoluteStrokeWidth: C,
76
76
  nonScalingStroke: w,
77
77
  className: S,
78
- hasA11yProp: T != null && T.length > 0 || R(h),
78
+ hasA11yProp: T != null && T.length > 0 || ee(h),
79
79
  attributes: h
80
80
  });
81
81
  return l("svg", E, [...D.map(([e, t]) => l(e, t)), ...T ?? []]);
82
82
  };
83
83
  //#endregion
84
84
  //#region ../../node_modules/.pnpm/@lucide+vue@1.49.0_vue@3.5.43_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/createLucideIcon.mjs
85
- function H(e, t = []) {
85
+ function V(e, t = []) {
86
86
  let n = typeof e == "string" ? {
87
87
  name: e,
88
88
  node: t
89
89
  } : e;
90
- return (e, { slots: t }) => l(ne, {
90
+ return (e, { slots: t }) => l(re, {
91
91
  ...e,
92
92
  icon: n
93
93
  }, t.default ? { default: t.default } : void 0);
94
94
  }
95
- var re = H({
95
+ var ie = V({
96
96
  name: "arrow-down",
97
97
  size: 24,
98
98
  node: [["path", {
@@ -102,7 +102,7 @@ var re = H({
102
102
  d: "m19 12-7 7-7-7",
103
103
  key: "1idqje"
104
104
  }]]
105
- }), ie = H({
105
+ }), H = V({
106
106
  name: "arrow-left",
107
107
  size: 24,
108
108
  node: [["path", {
@@ -112,7 +112,7 @@ var re = H({
112
112
  d: "M19 12H5",
113
113
  key: "x3x0zl"
114
114
  }]]
115
- }), ae = H({
115
+ }), ae = V({
116
116
  name: "arrow-up",
117
117
  size: 24,
118
118
  node: [["path", {
@@ -122,7 +122,7 @@ var re = H({
122
122
  d: "M12 19V5",
123
123
  key: "x0mq9r"
124
124
  }]]
125
- }), oe = H({
125
+ }), oe = V({
126
126
  name: "bell-ring",
127
127
  size: 24,
128
128
  node: [
@@ -143,7 +143,7 @@ var re = H({
143
143
  key: "tap9e0"
144
144
  }]
145
145
  ]
146
- }), se = H({
146
+ }), se = V({
147
147
  name: "bot",
148
148
  size: 24,
149
149
  node: [
@@ -176,28 +176,28 @@ var re = H({
176
176
  key: "rq6x2g"
177
177
  }]
178
178
  ]
179
- }), ce = H({
179
+ }), ce = V({
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
- }), U = H({
186
+ }), le = V({
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
- }), le = H({
193
+ }), U = V({
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
- }), ue = H({
200
+ }), ue = V({
201
201
  name: "circle-check",
202
202
  size: 24,
203
203
  node: [["circle", {
@@ -210,7 +210,7 @@ var re = H({
210
210
  key: "xofnsj"
211
211
  }]],
212
212
  aliases: ["check-circle-2"]
213
- }), de = H({
213
+ }), de = V({
214
214
  name: "circle-question-mark",
215
215
  size: 24,
216
216
  node: [
@@ -230,7 +230,7 @@ var re = H({
230
230
  }]
231
231
  ],
232
232
  aliases: ["help-circle", "circle-help"]
233
- }), fe = H({
233
+ }), fe = V({
234
234
  name: "circle-slash",
235
235
  size: 24,
236
236
  node: [["circle", {
@@ -245,7 +245,7 @@ var re = H({
245
245
  y2: "9",
246
246
  key: "1dfufj"
247
247
  }]]
248
- }), pe = H({
248
+ }), pe = V({
249
249
  name: "circle-x",
250
250
  size: 24,
251
251
  node: [
@@ -265,7 +265,7 @@ var re = H({
265
265
  }]
266
266
  ],
267
267
  aliases: ["x-circle"]
268
- }), W = H({
268
+ }), me = V({
269
269
  name: "circle",
270
270
  size: 24,
271
271
  node: [["circle", {
@@ -274,7 +274,7 @@ var re = H({
274
274
  r: "10",
275
275
  key: "1mglay"
276
276
  }]]
277
- }), me = H({
277
+ }), W = V({
278
278
  name: "code",
279
279
  size: 24,
280
280
  node: [["path", {
@@ -284,7 +284,7 @@ var re = H({
284
284
  d: "m8 6-6 6 6 6",
285
285
  key: "ppft3o"
286
286
  }]]
287
- }), he = H({
287
+ }), he = V({
288
288
  name: "copy",
289
289
  size: 24,
290
290
  node: [["rect", {
@@ -299,7 +299,7 @@ var re = H({
299
299
  d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",
300
300
  key: "zix9uf"
301
301
  }]]
302
- }), G = H({
302
+ }), ge = V({
303
303
  name: "ellipsis",
304
304
  size: 24,
305
305
  node: [
@@ -323,7 +323,7 @@ var re = H({
323
323
  }]
324
324
  ],
325
325
  aliases: ["more-horizontal"]
326
- }), ge = H({
326
+ }), G = V({
327
327
  name: "external-link",
328
328
  size: 24,
329
329
  node: [
@@ -340,7 +340,7 @@ var re = H({
340
340
  key: "a6xqqp"
341
341
  }]
342
342
  ]
343
- }), _e = H({
343
+ }), _e = V({
344
344
  name: "eye",
345
345
  size: 24,
346
346
  node: [["path", {
@@ -352,7 +352,7 @@ var re = H({
352
352
  r: "3",
353
353
  key: "1v7zrd"
354
354
  }]]
355
- }), ve = H({
355
+ }), ve = V({
356
356
  name: "file",
357
357
  size: 24,
358
358
  node: [["path", {
@@ -362,14 +362,14 @@ var re = H({
362
362
  d: "M14 2v5a1 1 0 0 0 1 1h5",
363
363
  key: "wfsgrz"
364
364
  }]]
365
- }), ye = H({
365
+ }), ye = V({
366
366
  name: "folder",
367
367
  size: 24,
368
368
  node: [["path", {
369
369
  d: "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",
370
370
  key: "1kt360"
371
371
  }]]
372
- }), be = H({
372
+ }), be = V({
373
373
  name: "git-branch",
374
374
  size: 24,
375
375
  node: [
@@ -390,7 +390,7 @@ var re = H({
390
390
  key: "fqmcym"
391
391
  }]
392
392
  ]
393
- }), xe = H({
393
+ }), xe = V({
394
394
  name: "info",
395
395
  size: 24,
396
396
  node: [
@@ -409,7 +409,7 @@ var re = H({
409
409
  key: "e9boi3"
410
410
  }]
411
411
  ]
412
- }), Se = H({
412
+ }), Se = V({
413
413
  name: "notebook-text",
414
414
  size: 24,
415
415
  node: [
@@ -450,7 +450,7 @@ var re = H({
450
450
  key: "p1seyn"
451
451
  }]
452
452
  ]
453
- }), Ce = H({
453
+ }), Ce = V({
454
454
  name: "panel-right",
455
455
  size: 24,
456
456
  node: [["rect", {
@@ -464,14 +464,14 @@ var re = H({
464
464
  d: "M15 3v18",
465
465
  key: "14nvp0"
466
466
  }]]
467
- }), we = H({
467
+ }), we = V({
468
468
  name: "paperclip",
469
469
  size: 24,
470
470
  node: [["path", {
471
471
  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",
472
472
  key: "1miecu"
473
473
  }]]
474
- }), Te = H({
474
+ }), Te = V({
475
475
  name: "rotate-cw",
476
476
  size: 24,
477
477
  node: [["path", {
@@ -481,7 +481,7 @@ var re = H({
481
481
  d: "M21 3v5h-5",
482
482
  key: "1q7to0"
483
483
  }]]
484
- }), Ee = H({
484
+ }), Ee = V({
485
485
  name: "scroll-text",
486
486
  size: 24,
487
487
  node: [
@@ -502,7 +502,7 @@ var re = H({
502
502
  key: "1ph1d7"
503
503
  }]
504
504
  ]
505
- }), De = H({
505
+ }), De = V({
506
506
  name: "search",
507
507
  size: 24,
508
508
  node: [["path", {
@@ -514,7 +514,7 @@ var re = H({
514
514
  r: "8",
515
515
  key: "4ej97u"
516
516
  }]]
517
- }), Oe = H({
517
+ }), Oe = V({
518
518
  name: "shield-alert",
519
519
  size: 24,
520
520
  node: [
@@ -531,7 +531,7 @@ var re = H({
531
531
  key: "1drbdi"
532
532
  }]
533
533
  ]
534
- }), ke = H({
534
+ }), ke = V({
535
535
  name: "square",
536
536
  size: 24,
537
537
  node: [["rect", {
@@ -542,7 +542,7 @@ var re = H({
542
542
  rx: "2",
543
543
  key: "afitv7"
544
544
  }]]
545
- }), Ae = H({
545
+ }), Ae = V({
546
546
  name: "workflow",
547
547
  size: 24,
548
548
  node: [
@@ -567,7 +567,7 @@ var re = H({
567
567
  key: "1cgmvn"
568
568
  }]
569
569
  ]
570
- }), je = H({
570
+ }), je = V({
571
571
  name: "x",
572
572
  size: 24,
573
573
  node: [["path", {
@@ -765,6 +765,7 @@ function pt(e, t, n) {
765
765
  //#endregion
766
766
  //#region web/src/ChoicePicker.vue?vue&type=script&setup=true&lang.ts
767
767
  var mt = [
768
+ "disabled",
768
769
  "aria-expanded",
769
770
  "aria-label",
770
771
  "title",
@@ -782,7 +783,8 @@ var mt = [
782
783
  options: {},
783
784
  current: {},
784
785
  label: {},
785
- test: {}
786
+ test: {},
787
+ disabled: { type: Boolean }
786
788
  },
787
789
  emits: ["pick"],
788
790
  setup(o, { emit: c }) {
@@ -810,6 +812,7 @@ var mt = [
810
812
  ref: m,
811
813
  type: "button",
812
814
  class: "kvc-button",
815
+ disabled: l.disabled === !0,
813
816
  "aria-haspopup": "listbox",
814
817
  "aria-expanded": d.value,
815
818
  "aria-label": `${l.label}: ${h.value}`,
@@ -817,7 +820,7 @@ var mt = [
817
820
  "data-test": l.test,
818
821
  onClick: v,
819
822
  onKeydown: S
820
- }, [a("span", ht, E(h.value), 1), s(D(U), {
823
+ }, [a("span", ht, E(h.value), 1), s(D(le), {
821
824
  size: 16,
822
825
  "aria-hidden": "true"
823
826
  })], 40, mt), d.value ? (_(), i("div", {
@@ -1002,8 +1005,8 @@ var Bt = ["aria-label"], Vt = { class: "kvc-dialog-head" }, Ht = { class: "kvc-c
1002
1005
  "data-test": "map-detail-title"
1003
1006
  }, Gt = ["aria-label", "title"], Kt = { class: "kvc-fields" }, qt = {
1004
1007
  key: 0,
1005
- class: "kvc-field-row",
1006
- "data-test": "map-description"
1008
+ class: "kvc-field-row kvc-map-details",
1009
+ "data-test": "map-details"
1007
1010
  }, Jt = { class: "kvc-muted" }, Yt = { dir: "auto" }, Xt = {
1008
1011
  key: 1,
1009
1012
  class: "kvc-field-row",
@@ -1026,47 +1029,51 @@ var Bt = ["aria-label"], Vt = { class: "kvc-dialog-head" }, Ht = { class: "kvc-c
1026
1029
  after: {}
1027
1030
  },
1028
1031
  emits: ["close"],
1029
- setup(e, { emit: t }) {
1030
- let n = e, o = t, c = K(), l = O("dialog"), u = () => [...l.value?.querySelectorAll("button:not(:disabled), a[href]") ?? []];
1031
- function d(e) {
1032
- let t = u(), n = e.shiftKey ? t[0] : t.at(-1);
1033
- (document.activeElement === n || document.activeElement === l.value) && (e.preventDefault(), (e.shiftKey ? t.at(-1) : t[0])?.focus());
1032
+ setup(e, { emit: o }) {
1033
+ let c = e, l = o, u = K(), d = O("dialog"), f = t(() => ({
1034
+ type: "markdown",
1035
+ text: "kvcoder.markdown",
1036
+ params: { text: c.step.details ?? "" }
1037
+ })), p = () => [...d.value?.querySelectorAll("button:not(:disabled), a[href]") ?? []];
1038
+ function m(e) {
1039
+ let t = p(), n = e.shiftKey ? t[0] : t.at(-1);
1040
+ (document.activeElement === n || document.activeElement === d.value) && (e.preventDefault(), (e.shiftKey ? t.at(-1) : t[0])?.focus());
1034
1041
  }
1035
- return h(() => l.value?.focus()), (e, t) => (_(), i("div", {
1042
+ return h(() => d.value?.focus()), (e, t) => (_(), i("div", {
1036
1043
  class: "kvc-dialog-backdrop",
1037
1044
  "data-test": "map-detail-backdrop",
1038
- onClick: t[2] ||= P((e) => o("close"), ["self"])
1045
+ onClick: t[2] ||= P((e) => l("close"), ["self"])
1039
1046
  }, [a("div", {
1040
1047
  ref_key: "dialog",
1041
- ref: l,
1048
+ ref: d,
1042
1049
  class: "kvc-dialog kvc-map-dialog",
1043
1050
  role: "dialog",
1044
1051
  "aria-modal": "true",
1045
- "aria-label": n.step.title,
1052
+ "aria-label": c.step.title,
1046
1053
  tabindex: "-1",
1047
1054
  "data-test": "map-detail",
1048
- onKeydown: [t[1] ||= N(P((e) => o("close"), ["stop"]), ["esc"]), N(d, ["tab"])]
1055
+ onKeydown: [t[1] ||= N(P((e) => l("close"), ["stop"]), ["esc"]), N(m, ["tab"])]
1049
1056
  }, [a("div", Vt, [a("span", Ht, [a("span", {
1050
1057
  class: "kvc-muted",
1051
- "data-status": n.step.status,
1058
+ "data-status": c.step.status,
1052
1059
  "data-test": "map-detail-status"
1053
- }, E(D(c).t("kvcoder.ui.map.step")) + " · " + E(D(c).t(`kvcoder.ui.map.status.${n.step.status}`)), 9, Ut), a("span", Wt, E(n.step.title), 1)]), a("button", {
1060
+ }, E(D(u).t("kvcoder.ui.map.step")) + " · " + E(D(u).t(`kvcoder.ui.map.status.${c.step.status}`)), 9, Ut), a("span", Wt, E(c.step.title), 1)]), a("button", {
1054
1061
  type: "button",
1055
1062
  class: "kvc-button kvc-ghost kvc-icon-button",
1056
- "aria-label": D(c).t("kvcoder.ui.map.close"),
1057
- title: D(c).t("kvcoder.ui.map.close"),
1063
+ "aria-label": D(u).t("kvcoder.ui.map.close"),
1064
+ title: D(u).t("kvcoder.ui.map.close"),
1058
1065
  "data-test": "map-detail-close",
1059
- onClick: t[0] ||= (e) => o("close")
1066
+ onClick: t[0] ||= (e) => l("close")
1060
1067
  }, [s(D(je), {
1061
1068
  size: 18,
1062
1069
  "aria-hidden": "true"
1063
1070
  })], 8, Gt)]), a("dl", Kt, [
1064
- n.step.description === null ? r("v-if", !0) : (_(), i("div", qt, [a("dt", Jt, E(D(c).t("kvcoder.ui.map.description")), 1), a("dd", Yt, [s(Y, { text: n.step.description }, null, 8, ["text"])])])),
1065
- n.after.length > 0 ? (_(), i("div", Xt, [a("dt", Zt, E(D(c).t("kvcoder.ui.map.after")), 1), a("dd", Qt, E(n.after.join(" · ")), 1)])) : r("v-if", !0),
1066
- n.step.uses === null ? r("v-if", !0) : (_(), i("div", $t, [a("dt", en, E(D(c).t("kvcoder.ui.map.uses")), 1), a("dd", tn, E(n.step.uses), 1)])),
1067
- a("div", nn, [a("dt", rn, E(D(c).t("kvcoder.ui.map.check")), 1), a("dd", an, [s(Y, { text: n.step.check }, null, 8, ["text"])])]),
1068
- n.step.evidence === null ? r("v-if", !0) : (_(), i("div", on, [a("dt", sn, E(D(c).t("kvcoder.ui.map.evidence")), 1), a("dd", cn, [s(Y, { text: n.step.evidence }, null, 8, ["text"])])])),
1069
- n.step.note === null ? r("v-if", !0) : (_(), i("div", ln, [a("dt", un, E(D(c).t("kvcoder.ui.map.note")), 1), a("dd", dn, [s(Y, { text: n.step.note }, null, 8, ["text"])])]))
1071
+ c.step.details === null ? r("v-if", !0) : (_(), i("div", qt, [a("dt", Jt, E(D(u).t("kvcoder.ui.map.details")), 1), a("dd", Yt, [(_(), n(C(D(u).View), { view: f.value }, null, 8, ["view"]))])])),
1072
+ c.after.length > 0 ? (_(), i("div", Xt, [a("dt", Zt, E(D(u).t("kvcoder.ui.map.after")), 1), a("dd", Qt, E(c.after.join(" · ")), 1)])) : r("v-if", !0),
1073
+ c.step.uses === null ? r("v-if", !0) : (_(), i("div", $t, [a("dt", en, E(D(u).t("kvcoder.ui.map.uses")), 1), a("dd", tn, E(c.step.uses), 1)])),
1074
+ a("div", nn, [a("dt", rn, E(D(u).t("kvcoder.ui.map.check")), 1), a("dd", an, [s(Y, { text: c.step.check }, null, 8, ["text"])])]),
1075
+ c.step.evidence === null ? r("v-if", !0) : (_(), i("div", on, [a("dt", sn, E(D(u).t("kvcoder.ui.map.evidence")), 1), a("dd", cn, [s(Y, { text: c.step.evidence }, null, 8, ["text"])])])),
1076
+ c.step.note === null ? r("v-if", !0) : (_(), i("div", ln, [a("dt", un, E(D(u).t("kvcoder.ui.map.note")), 1), a("dd", dn, [s(Y, { text: c.step.note }, null, 8, ["text"])])]))
1070
1077
  ])], 40, Bt)]));
1071
1078
  }
1072
1079
  }), pn = {
@@ -1117,7 +1124,7 @@ var Bt = ["aria-label"], Vt = { class: "kvc-dialog-head" }, Ht = { class: "kvc-c
1117
1124
  e === void 0 && (S.value = void 0);
1118
1125
  });
1119
1126
  let T = {
1120
- todo: W,
1127
+ todo: me,
1121
1128
  done: ue,
1122
1129
  failed: pe,
1123
1130
  skipped: fe
@@ -1350,7 +1357,7 @@ var Mn = [
1350
1357
  J(d, e);
1351
1358
  }
1352
1359
  }
1353
- let L = t(() => x.value === "url" ? Ue(S.value, window.location) : void 0), ee = t(() => ({
1360
+ let L = t(() => x.value === "url" ? Ue(S.value, window.location) : void 0), R = t(() => ({
1354
1361
  type: "markdown",
1355
1362
  text: "kvcoder.markdown",
1356
1363
  params: { text: S.value }
@@ -1407,7 +1414,7 @@ var Mn = [
1407
1414
  title: D(d).t("kvcoder.ui.artifacts.source"),
1408
1415
  "data-test": "artifact-view-source",
1409
1416
  onClick: t[1] ||= (e) => M.value = "source"
1410
- }, [s(D(me), {
1417
+ }, [s(D(W), {
1411
1418
  size: 16,
1412
1419
  class: "kvc-tab-icon",
1413
1420
  "aria-hidden": "true"
@@ -1421,7 +1428,7 @@ var Mn = [
1421
1428
  "aria-label": D(d).t("kvcoder.ui.artifacts.openUrl"),
1422
1429
  title: D(d).t("kvcoder.ui.artifacts.openUrl"),
1423
1430
  "data-test": "artifact-open-url"
1424
- }, [s(D(ge), {
1431
+ }, [s(D(G), {
1425
1432
  size: 16,
1426
1433
  "aria-hidden": "true"
1427
1434
  })], 8, qn)) : r("v-if", !0),
@@ -1455,7 +1462,7 @@ var Mn = [
1455
1462
  map: l.map
1456
1463
  }, null, 8, ["map"])) : M.value === "source" && m.value !== void 0 ? (_(), i("pre", Zn, E(S.value), 1)) : x.value === "markdown" && m.value !== void 0 ? (_(), n(C(D(d).View), {
1457
1464
  key: 2,
1458
- view: ee.value
1465
+ view: R.value
1459
1466
  }, null, 8, ["view"])) : x.value === "html" && m.value !== void 0 ? (_(), n(ze, {
1460
1467
  key: 3,
1461
1468
  label: w.value,
@@ -1667,7 +1674,7 @@ var ur = { class: "kvc-composer" }, dr = { class: "kvc-box" }, fr = ["aria-label
1667
1674
  }
1668
1675
  await F(e);
1669
1676
  }
1670
- function ee(e) {
1677
+ function R(e) {
1671
1678
  let t = [...e.clipboardData?.files ?? []];
1672
1679
  if (t.length === 0) {
1673
1680
  e.clipboardData?.types.length === 0 && L();
@@ -1675,39 +1682,39 @@ var ur = { class: "kvc-composer" }, dr = { class: "kvc-box" }, fr = ["aria-label
1675
1682
  }
1676
1683
  e.preventDefault(), F(t);
1677
1684
  }
1678
- function R() {
1685
+ function ee() {
1679
1686
  let e = O.value, t = v.value?.argument ?? "";
1680
1687
  l.blocked === !0 || e === void 0 || N(e) && t === "" || (e.kind === "own" ? u("command", e.command.name, t) : u("registered", e.command, t), f.value.text = "");
1681
1688
  }
1682
1689
  function z() {
1683
- if (v.value !== void 0) return R();
1690
+ if (v.value !== void 0) return ee();
1684
1691
  let e = f.value.text.trim();
1685
1692
  e === "" || m.value || l.blocked === !0 || f.value.sending || u("send", {
1686
1693
  text: e,
1687
1694
  fileIds: f.value.files.map((e) => e.id)
1688
1695
  });
1689
1696
  }
1690
- function B(e) {
1697
+ function te(e) {
1691
1698
  T.value.length > 0 && (h.value = (h.value + e + T.value.length) % T.value.length);
1692
1699
  }
1693
- function V(e) {
1700
+ function B(e) {
1694
1701
  w(e) && (h.value = T.value.indexOf(e));
1695
1702
  }
1696
- function te(e) {
1697
- w(e) && (V(e), R());
1698
- }
1699
1703
  function ne(e) {
1704
+ w(e) && (B(e), ee());
1705
+ }
1706
+ function re(e) {
1700
1707
  if (v.value === void 0) return !1;
1701
1708
  let t = O.value;
1702
1709
  if (e.key === "Escape") g.value = !0;
1703
- else if (e.key === "ArrowDown") B(1);
1704
- else if (e.key === "ArrowUp") B(-1);
1710
+ else if (e.key === "ArrowDown") te(1);
1711
+ else if (e.key === "ArrowUp") te(-1);
1705
1712
  else if (e.key === "Tab" && t !== void 0) f.value.text = `/${t.command.name} `;
1706
1713
  else return !1;
1707
1714
  return !0;
1708
1715
  }
1709
- function H(e) {
1710
- if (ne(e)) return e.preventDefault();
1716
+ function V(e) {
1717
+ if (re(e)) return e.preventDefault();
1711
1718
  e.key !== "Enter" || e.shiftKey || e.isComposing || (e.preventDefault(), z());
1712
1719
  }
1713
1720
  return (t, n) => (_(), i("div", ur, [a("div", dr, [
@@ -1727,8 +1734,8 @@ var ur = { class: "kvc-composer" }, dr = { class: "kvc-box" }, fr = ["aria-label
1727
1734
  "aria-selected": t === O.value,
1728
1735
  "data-active": t === O.value,
1729
1736
  "data-test": `slash-${t.command.name}`,
1730
- onMousemove: (e) => V(t),
1731
- onClick: (e) => te(t)
1737
+ onMousemove: (e) => B(t),
1738
+ onClick: (e) => ne(t)
1732
1739
  }, [a("span", hr, [a("span", gr, [o("/" + E(t.command.name), 1), N(t) ? (_(), i(e, { key: 0 }, [o(" <" + E(D(d).t(`kvcoder.ui.slash.${t.command.name}.argument`)) + ">", 1)], 64)) : r("v-if", !0)])]), a("span", _r, E(P(t)), 1)], 40, mr))), 128)),
1733
1740
  C.value.length === 0 ? (_(), i("p", vr, E(D(d).t("kvcoder.ui.slash.none")), 1)) : r("v-if", !0)
1734
1741
  ], 8, fr)) : r("v-if", !0),
@@ -1753,8 +1760,8 @@ var ur = { class: "kvc-composer" }, dr = { class: "kvc-box" }, fr = ["aria-label
1753
1760
  "aria-label": l.placeholder,
1754
1761
  rows: "2",
1755
1762
  "data-test": "composer-text",
1756
- onKeydown: H,
1757
- onPaste: ee
1763
+ onKeydown: V,
1764
+ onPaste: R
1758
1765
  }, null, 40, Cr), [[k, f.value.text]]),
1759
1766
  a("div", wr, [
1760
1767
  a("input", {
@@ -1812,10 +1819,23 @@ var ur = { class: "kvc-composer" }, dr = { class: "kvc-box" }, fr = ["aria-label
1812
1819
  onClick: s[0] ||= (e) => D(t).navigate("kvwebui.extension", { namespace: "kvcoder" })
1813
1820
  }, E(D(t).t("kvcoder.ui.approvalLine.change")), 1)], 8, Ar));
1814
1821
  }
1815
- });
1822
+ }), Mr = [
1823
+ "off",
1824
+ "minimal",
1825
+ "low",
1826
+ "medium",
1827
+ "high",
1828
+ "xhigh",
1829
+ "max"
1830
+ ];
1831
+ function Nr(e, t) {
1832
+ if (e.includes(t)) return t;
1833
+ let n = Mr.indexOf(t);
1834
+ return Mr.slice(n + 1).find((t) => e.includes(t)) ?? Mr.slice(0, n).findLast((t) => e.includes(t)) ?? t;
1835
+ }
1816
1836
  //#endregion
1817
1837
  //#region web/src/model-groups.ts
1818
- function Mr(e, t, n) {
1838
+ function Pr(e, t, n) {
1819
1839
  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();
1820
1840
  for (let e of a) {
1821
1841
  let t = o.get(e.provider) ?? {
@@ -1825,12 +1845,13 @@ function Mr(e, t, n) {
1825
1845
  };
1826
1846
  t.models.push({
1827
1847
  id: e.id,
1828
- name: e.name
1848
+ name: e.name,
1849
+ thinkingLevels: e.thinkingLevels
1829
1850
  }), o.set(e.provider, t);
1830
1851
  }
1831
1852
  return [...o.values()].sort((e, t) => e.title.localeCompare(t.title));
1832
1853
  }
1833
- function Nr(e, t) {
1854
+ function Fr(e, t) {
1834
1855
  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) => ({
1835
1856
  ...e,
1836
1857
  models: e.models.filter(r)
@@ -1841,38 +1862,37 @@ function Nr(e, t) {
1841
1862
  total: e.reduce((e, t) => e + t.models.length, 0)
1842
1863
  };
1843
1864
  }
1844
- var Pr = [
1845
- "off",
1846
- "minimal",
1847
- "low",
1848
- "medium",
1849
- "high"
1850
- ], Fr = { class: "kvc-picker" }, Ir = [
1865
+ function Ir(e, t) {
1866
+ return e.flatMap((e) => e.models).find((e) => e.id === t)?.thinkingLevels ?? Mr;
1867
+ }
1868
+ //#endregion
1869
+ //#region web/src/ModelPicker.vue?vue&type=script&setup=true&lang.ts
1870
+ var Lr = { class: "kvc-picker" }, Rr = [
1851
1871
  "aria-expanded",
1852
1872
  "aria-label",
1853
1873
  "disabled"
1854
- ], Lr = { class: "kvc-picker-label" }, Rr = ["onKeydown"], zr = { class: "kvc-search" }, Br = [
1874
+ ], zr = { class: "kvc-picker-label" }, Br = ["onKeydown"], Vr = { class: "kvc-search" }, Hr = [
1855
1875
  "placeholder",
1856
1876
  "aria-label",
1857
1877
  "onKeydown"
1858
- ], Vr = ["aria-label"], Hr = ["aria-selected", "data-active"], Ur = { class: "kvc-model-name" }, Wr = {
1878
+ ], Ur = ["aria-label"], Wr = ["aria-selected", "data-active"], Gr = { class: "kvc-model-name" }, Kr = {
1859
1879
  class: "kvc-group",
1860
1880
  role: "presentation",
1861
1881
  "data-test": "model-group"
1862
- }, Gr = [
1882
+ }, qr = [
1863
1883
  "aria-selected",
1864
1884
  "data-active",
1865
1885
  "data-test",
1866
1886
  "onClick",
1867
1887
  "onMousemove"
1868
- ], Kr = { class: "kvc-model-name" }, qr = {
1888
+ ], Jr = { class: "kvc-model-name" }, Yr = {
1869
1889
  key: 1,
1870
1890
  class: "kvc-muted kvc-none",
1871
1891
  "data-test": "model-none"
1872
- }, Jr = {
1892
+ }, Xr = {
1873
1893
  class: "kvc-muted kvc-count",
1874
1894
  "data-test": "model-count"
1875
- }, Yr = 24, Xr = /* @__PURE__ */ c({
1895
+ }, Zr = 24, Qr = /* @__PURE__ */ c({
1876
1896
  __name: "ModelPicker",
1877
1897
  props: {
1878
1898
  groups: {},
@@ -1883,49 +1903,49 @@ var Pr = [
1883
1903
  },
1884
1904
  emits: ["pick", "none"],
1885
1905
  setup(o, { emit: c }) {
1886
- let l = o, u = c, f = K(), p = y(!1), h = y(""), g = y(0), v = O("trigger"), x = O("search"), S = O("panel"), C = t(() => Nr(l.groups, h.value)), w = t(() => C.value.groups.flatMap((e) => e.models)), T = t(() => l.groups.flatMap((e) => e.models).find((e) => e.id === l.current)?.name ?? l.current ?? l.empty ?? ""), j = t(() => l.none !== void 0 && h.value.trim() === ""), F = t(() => +!!j.value), I = t(() => w.value.length + F.value), L = (e) => {
1906
+ let l = o, u = c, f = K(), p = y(!1), h = y(""), g = y(0), v = O("trigger"), x = O("search"), S = O("panel"), C = t(() => Fr(l.groups, h.value)), w = t(() => C.value.groups.flatMap((e) => e.models)), T = t(() => l.groups.flatMap((e) => e.models).find((e) => e.id === l.current)?.name ?? l.current ?? l.empty ?? ""), j = t(() => l.none !== void 0 && h.value.trim() === ""), F = t(() => +!!j.value), I = t(() => w.value.length + F.value), L = (e) => {
1887
1907
  let t = w.value.findIndex((t) => t.id === e);
1888
1908
  return t < 0 ? -1 : t + F.value;
1889
1909
  };
1890
- function ee() {
1910
+ function R() {
1891
1911
  p.value = !1, v.value?.focus();
1892
1912
  }
1893
- async function R() {
1894
- h.value = "", g.value = Math.max(L(l.current ?? ""), 0), z = 0, p.value = !0, await d(), V(), x.value?.focus(), ne();
1913
+ async function ee() {
1914
+ h.value = "", g.value = Math.max(L(l.current ?? ""), 0), z = 0, p.value = !0, await d(), B(), x.value?.focus(), re();
1895
1915
  }
1896
- let z = 0, B = 0;
1897
- function V() {
1916
+ let z = 0, te = 0;
1917
+ function B() {
1898
1918
  let e = S.value, t = v.value?.closest(".kvc-conversation")?.getBoundingClientRect();
1899
1919
  if (e === null || t === void 0) return;
1900
- let n = e.getBoundingClientRect(), r = t.left + Yr - (n.left - z), i = t.right - Yr - (n.right - z), a = r > 0 ? r : i < 0 ? i : 0;
1920
+ let n = e.getBoundingClientRect(), r = t.left + Zr - (n.left - z), i = t.right - Zr - (n.right - z), a = r > 0 ? r : i < 0 ? i : 0;
1901
1921
  a !== z && (z = a, e.style.translate = `${a}px 0`);
1902
1922
  }
1903
- function te() {
1904
- V(), B = requestAnimationFrame(te);
1905
- }
1906
1923
  function ne() {
1924
+ B(), te = requestAnimationFrame(ne);
1925
+ }
1926
+ function re() {
1907
1927
  S.value?.querySelector("[data-active=\"true\"]")?.scrollIntoView?.({ block: "nearest" });
1908
1928
  }
1909
- async function H(e) {
1910
- I.value !== 0 && (g.value = (g.value + e + I.value) % I.value, await d(), ne());
1929
+ async function V(e) {
1930
+ I.value !== 0 && (g.value = (g.value + e + I.value) % I.value, await d(), re());
1911
1931
  }
1912
- function re(e) {
1913
- e !== void 0 && (u("pick", e), ee());
1932
+ function ie(e) {
1933
+ e !== void 0 && (u("pick", e), R());
1914
1934
  }
1915
- function ie() {
1916
- u("none"), ee();
1935
+ function H() {
1936
+ u("none"), R();
1917
1937
  }
1918
1938
  function ae() {
1919
- j.value && g.value === 0 ? ie() : re(w.value[g.value - F.value]?.id);
1939
+ j.value && g.value === 0 ? H() : ie(w.value[g.value - F.value]?.id);
1920
1940
  }
1921
1941
  function oe(e) {
1922
1942
  e.target instanceof Node && !v.value?.parentElement?.contains(e.target) && (p.value = !1);
1923
1943
  }
1924
1944
  return A(h, () => g.value = 0), A(p, (e) => {
1925
- e ? (document.addEventListener("pointerdown", oe), B = requestAnimationFrame(te)) : (document.removeEventListener("pointerdown", oe), cancelAnimationFrame(B));
1945
+ e ? (document.addEventListener("pointerdown", oe), te = requestAnimationFrame(ne)) : (document.removeEventListener("pointerdown", oe), cancelAnimationFrame(te));
1926
1946
  }), m(() => {
1927
- document.removeEventListener("pointerdown", oe), cancelAnimationFrame(B);
1928
- }), (t, o) => (_(), i("div", Fr, [a("button", {
1947
+ document.removeEventListener("pointerdown", oe), cancelAnimationFrame(te);
1948
+ }), (t, o) => (_(), i("div", Lr, [a("button", {
1929
1949
  ref_key: "trigger",
1930
1950
  ref: v,
1931
1951
  type: "button",
@@ -1935,19 +1955,19 @@ var Pr = [
1935
1955
  "aria-label": `${D(f).t("kvcoder.ui.model")}: ${T.value}`,
1936
1956
  disabled: l.disabled,
1937
1957
  "data-test": "model-picker",
1938
- onClick: o[0] ||= (e) => p.value ? ee() : R()
1939
- }, [a("span", Lr, E(T.value), 1), s(D(U), {
1958
+ onClick: o[0] ||= (e) => p.value ? R() : ee()
1959
+ }, [a("span", zr, E(T.value), 1), s(D(le), {
1940
1960
  size: 16,
1941
1961
  "aria-hidden": "true"
1942
- })], 8, Ir), p.value ? (_(), i("div", {
1962
+ })], 8, Rr), p.value ? (_(), i("div", {
1943
1963
  key: 0,
1944
1964
  ref_key: "panel",
1945
1965
  ref: S,
1946
1966
  class: "kvc-popover",
1947
1967
  "data-test": "model-popover",
1948
- onKeydown: N(P(ee, ["stop"]), ["esc"])
1968
+ onKeydown: N(P(R, ["stop"]), ["esc"])
1949
1969
  }, [
1950
- a("label", zr, [s(D(De), {
1970
+ a("label", Vr, [s(D(De), {
1951
1971
  size: 16,
1952
1972
  "aria-hidden": "true"
1953
1973
  }), M(a("input", {
@@ -1962,11 +1982,11 @@ var Pr = [
1962
1982
  "aria-label": D(f).t("kvcoder.ui.searchModels"),
1963
1983
  "data-test": "model-search",
1964
1984
  onKeydown: [
1965
- o[2] ||= N(P((e) => H(1), ["prevent"]), ["down"]),
1966
- o[3] ||= N(P((e) => H(-1), ["prevent"]), ["up"]),
1985
+ o[2] ||= N(P((e) => V(1), ["prevent"]), ["down"]),
1986
+ o[3] ||= N(P((e) => V(-1), ["prevent"]), ["up"]),
1967
1987
  N(P(ae, ["prevent"]), ["enter"])
1968
1988
  ]
1969
- }, null, 40, Br), [[k, h.value]])]),
1989
+ }, null, 40, Hr), [[k, h.value]])]),
1970
1990
  a("div", {
1971
1991
  id: "kvc-models",
1972
1992
  class: "kvc-options",
@@ -1980,36 +2000,36 @@ var Pr = [
1980
2000
  "aria-selected": l.current === null,
1981
2001
  "data-active": g.value === 0,
1982
2002
  "data-test": "model-none-entry",
1983
- onClick: ie,
2003
+ onClick: H,
1984
2004
  onMousemove: o[4] ||= (e) => g.value = 0
1985
- }, [a("span", Ur, E(l.none), 1), l.current === null ? (_(), n(D(ce), {
2005
+ }, [a("span", Gr, E(l.none), 1), l.current === null ? (_(), n(D(ce), {
1986
2006
  key: 0,
1987
2007
  size: 16,
1988
2008
  "aria-hidden": "true"
1989
- })) : r("v-if", !0)], 40, Hr)) : r("v-if", !0),
1990
- (_(!0), i(e, null, b(C.value.groups, (t) => (_(), i(e, { key: t.provider }, [a("div", Wr, E(t.title), 1), (_(!0), i(e, null, b(t.models, (e) => (_(), i("div", {
2009
+ })) : r("v-if", !0)], 40, Wr)) : r("v-if", !0),
2010
+ (_(!0), i(e, null, b(C.value.groups, (t) => (_(), i(e, { key: t.provider }, [a("div", Kr, E(t.title), 1), (_(!0), i(e, null, b(t.models, (e) => (_(), i("div", {
1991
2011
  key: e.id,
1992
2012
  class: "kvc-model",
1993
2013
  role: "option",
1994
2014
  "aria-selected": e.id === l.current,
1995
2015
  "data-active": L(e.id) === g.value,
1996
2016
  "data-test": `model-${e.id}`,
1997
- onClick: (t) => re(e.id),
2017
+ onClick: (t) => ie(e.id),
1998
2018
  onMousemove: (t) => g.value = L(e.id)
1999
- }, [a("span", Kr, E(e.name), 1), e.id === l.current ? (_(), n(D(ce), {
2019
+ }, [a("span", Jr, E(e.name), 1), e.id === l.current ? (_(), n(D(ce), {
2000
2020
  key: 0,
2001
2021
  size: 16,
2002
2022
  "aria-hidden": "true"
2003
- })) : r("v-if", !0)], 40, Gr))), 128))], 64))), 128)),
2004
- C.value.shown === 0 ? (_(), i("p", qr, E(D(f).t("kvcoder.ui.noModels")), 1)) : r("v-if", !0)
2005
- ], 8, Vr),
2006
- a("p", Jr, E(D(f).t("kvcoder.ui.modelsCount", {
2023
+ })) : r("v-if", !0)], 40, qr))), 128))], 64))), 128)),
2024
+ C.value.shown === 0 ? (_(), i("p", Yr, E(D(f).t("kvcoder.ui.noModels")), 1)) : r("v-if", !0)
2025
+ ], 8, Ur),
2026
+ a("p", Xr, E(D(f).t("kvcoder.ui.modelsCount", {
2007
2027
  shown: C.value.shown,
2008
2028
  total: C.value.total
2009
2029
  })), 1)
2010
- ], 40, Rr)) : r("v-if", !0)]));
2030
+ ], 40, Br)) : r("v-if", !0)]));
2011
2031
  }
2012
- }), Zr = /* @__PURE__ */ c({
2032
+ }), $r = /* @__PURE__ */ c({
2013
2033
  __name: "ModelControls",
2014
2034
  props: {
2015
2035
  groups: {},
@@ -2019,15 +2039,15 @@ var Pr = [
2019
2039
  },
2020
2040
  emits: ["model", "thinking"],
2021
2041
  setup(n, { emit: r }) {
2022
- let a = n, o = r, c = K(), l = t(() => Pr.map((e) => ({
2042
+ let a = n, o = r, c = K(), l = t(() => Ir(a.groups, a.model)), u = t(() => l.value.map((e) => ({
2023
2043
  id: e,
2024
2044
  label: c.t(`kvcoder.ui.thinkingLevels.${e}`)
2025
- })));
2026
- function u(e) {
2027
- let t = Pr.find((t) => t === e);
2045
+ }))), d = t(() => Nr(l.value, a.thinking)), f = t(() => l.value.some((e) => e !== "off"));
2046
+ function p(e) {
2047
+ let t = Mr.find((t) => t === e);
2028
2048
  t !== void 0 && o("thinking", t);
2029
2049
  }
2030
- return (t, n) => (_(), i(e, null, [s(Xr, {
2050
+ return (t, n) => (_(), i(e, null, [s(Qr, {
2031
2051
  groups: a.groups,
2032
2052
  current: a.model,
2033
2053
  empty: a.empty,
@@ -2039,19 +2059,21 @@ var Pr = [
2039
2059
  ]), s(yt, {
2040
2060
  test: "thinking-picker",
2041
2061
  label: D(c).t("kvcoder.ui.thinking"),
2042
- current: a.thinking,
2043
- options: l.value,
2044
- onPick: u
2062
+ current: d.value,
2063
+ options: u.value,
2064
+ disabled: !f.value,
2065
+ onPick: p
2045
2066
  }, null, 8, [
2046
2067
  "label",
2047
2068
  "current",
2048
- "options"
2069
+ "options",
2070
+ "disabled"
2049
2071
  ])], 64));
2050
2072
  }
2051
2073
  });
2052
2074
  //#endregion
2053
2075
  //#region web/src/remember-model.ts
2054
- async function Qr(e, t) {
2076
+ async function ei(e, t) {
2055
2077
  try {
2056
2078
  await e.exec("kernel.settings.set", {
2057
2079
  key: "kvai.defaultModel",
@@ -2064,30 +2086,30 @@ async function Qr(e, t) {
2064
2086
  }
2065
2087
  //#endregion
2066
2088
  //#region web/src/start-settings.ts
2067
- var $r = (e, t) => typeof e == "object" && e && !Array.isArray(e) ? e[t] : void 0, ei = (e, t) => typeof e == "string" && e !== "" ? e : t;
2068
- function ti(e) {
2089
+ var ti = (e, t) => typeof e == "object" && e && !Array.isArray(e) ? e[t] : void 0, ni = (e, t) => typeof e == "string" && e !== "" ? e : t;
2090
+ function ri(e) {
2069
2091
  let t = (t) => e.find((e) => e.key === t)?.value, n = t("kvcoder.approval"), r = t("kvwebui.nav.hidden"), i = t("kvcoder.profile");
2070
2092
  return {
2071
2093
  approval: n === "ask" || n === "auto" || n === "never" ? n : void 0,
2072
2094
  approvalHidden: Array.isArray(r) && r.includes("kvwebui.extensions"),
2073
- startHeading: ei($r(i, "startHeading"), "kvcoder.ui.startHeading"),
2074
- placeholder: ei($r(i, "placeholder"), "kvcoder.ui.startPlaceholder")
2095
+ startHeading: ni(ti(i, "startHeading"), "kvcoder.ui.startHeading"),
2096
+ placeholder: ni(ti(i, "placeholder"), "kvcoder.ui.startPlaceholder")
2075
2097
  };
2076
2098
  }
2077
- function ni(e) {
2099
+ function ii(e) {
2078
2100
  return e.workspace.value.id === "home" ? e.t("kvcoder.ui.homeWorkspace") : e.workspace.value.name;
2079
2101
  }
2080
2102
  //#endregion
2081
2103
  //#region web/src/use-chat-model.ts
2082
- function ri(e, t) {
2104
+ function ai(e, t) {
2083
2105
  let n = e.find((e) => e.key === t)?.value;
2084
2106
  return typeof n == "string" && n !== "" ? n : null;
2085
2107
  }
2086
- function ii(e) {
2108
+ function oi(e) {
2087
2109
  let t = e.find((e) => e.key === "kvcoder.thinking")?.value;
2088
- return Pr.find((e) => e === t) ?? "medium";
2110
+ return Mr.find((e) => e === t) ?? "medium";
2089
2111
  }
2090
- function ai(e, n) {
2112
+ function si(e, n) {
2091
2113
  let r = y([]), i = y([]), a = y(null), o = y(null), s = y("medium"), c = y(null), l = y(!1), u = y(!1), d = y();
2092
2114
  h(async () => {
2093
2115
  try {
@@ -2096,24 +2118,24 @@ function ai(e, n) {
2096
2118
  e.exec("kvai.provider.list", {}),
2097
2119
  e.exec("kvai.model.list", {})
2098
2120
  ]);
2099
- a.value = ri(t, "kvcoder.model") ?? ri(t, "kvai.defaultModel"), s.value = ii(t), d.value = ti(t), r.value = n, i.value = o;
2121
+ a.value = ai(t, "kvcoder.model") ?? ai(t, "kvai.defaultModel"), s.value = oi(t), d.value = ri(t), r.value = n, i.value = o;
2100
2122
  } catch (e) {
2101
- u.value = !0, d.value = ti([]), n(e);
2123
+ u.value = !0, d.value = ri([]), n(e);
2102
2124
  } finally {
2103
2125
  l.value = !0;
2104
2126
  }
2105
2127
  });
2106
- let f = t(() => o.value ?? a.value), p = t(() => c.value ?? s.value), m = t(() => Mr(r.value, i.value, f.value)), g = t(() => r.value.find((e) => e.id === i.value.find((e) => e.id === f.value)?.provider));
2128
+ let f = t(() => o.value ?? a.value), p = t(() => Pr(r.value, i.value, f.value)), m = t(() => Nr(Ir(p.value, f.value), c.value ?? s.value)), g = t(() => r.value.find((e) => e.id === i.value.find((e) => e.id === f.value)?.provider));
2107
2129
  return {
2108
2130
  start: d,
2109
2131
  current: f,
2110
- thinking: p,
2111
- groups: m,
2132
+ thinking: m,
2133
+ groups: p,
2112
2134
  provider: g,
2113
2135
  state: t(() => l.value ? u.value ? "ready" : f.value === null ? "noModel" : g.value?.status === "needsKey" ? "needsKey" : "ready" : "loading"),
2114
2136
  changes: () => ({
2115
2137
  ...o.value === null ? {} : { model: o.value },
2116
- ...c.value === null ? {} : { thinking: c.value }
2138
+ ...o.value === null && c.value === null ? {} : { thinking: m.value }
2117
2139
  }),
2118
2140
  pickModel: (e) => void (o.value = e),
2119
2141
  pickThinking: (e) => void (c.value = e)
@@ -2121,32 +2143,32 @@ function ai(e, n) {
2121
2143
  }
2122
2144
  //#endregion
2123
2145
  //#region web/src/ChatStart.vue?vue&type=script&setup=true&lang.ts
2124
- var oi = {
2146
+ var ci = {
2125
2147
  class: "kvc-start",
2126
2148
  "data-test": "chat-start"
2127
- }, si = {
2149
+ }, li = {
2128
2150
  key: 0,
2129
2151
  "data-test": "start-heading"
2130
- }, ci = {
2152
+ }, ui = {
2131
2153
  key: 1,
2132
2154
  class: "kvc-muted kvc-start-note",
2133
2155
  role: "status",
2134
2156
  "data-test": "key-needed"
2135
- }, li = {
2157
+ }, di = {
2136
2158
  key: 2,
2137
2159
  class: "kvc-muted kvc-start-note",
2138
2160
  role: "status",
2139
2161
  "data-test": "choose-model"
2140
- }, ui = {
2162
+ }, fi = {
2141
2163
  key: 3,
2142
2164
  class: "kvc-muted kvc-start-note"
2143
- }, di = /* @__PURE__ */ c({
2165
+ }, pi = /* @__PURE__ */ c({
2144
2166
  __name: "ChatStart",
2145
2167
  props: { registered: {} },
2146
2168
  setup(t) {
2147
- let c = K(), l = t, u = ai(c, (e) => J(c, e));
2169
+ let c = K(), l = t, u = si(c, (e) => J(c, e));
2148
2170
  async function d(e) {
2149
- u.pickModel(e), await Qr(c, e);
2171
+ u.pickModel(e), await ei(c, e);
2150
2172
  }
2151
2173
  async function f(e) {
2152
2174
  let t = e?.createdChat ?? (await c.exec("kvcoder.session.create", {})).id;
@@ -2182,14 +2204,14 @@ var oi = {
2182
2204
  J(c, e);
2183
2205
  }
2184
2206
  }
2185
- return (t, f) => (_(), i(e, null, [a("div", oi, [
2186
- D(u).start.value === void 0 ? r("v-if", !0) : (_(), i("h1", si, E(D(c).t(D(u).start.value.startHeading, { workspace: D(ni)(D(c)) })), 1)),
2187
- D(u).state.value === "needsKey" && D(u).provider.value ? (_(), i("p", ci, [o(E(D(c).t("kvcoder.ui.keyNeeded", { provider: D(u).provider.value.title })) + " ", 1), a("button", {
2207
+ return (t, f) => (_(), i(e, null, [a("div", ci, [
2208
+ D(u).start.value === void 0 ? r("v-if", !0) : (_(), i("h1", li, E(D(c).t(D(u).start.value.startHeading, { workspace: D(ii)(D(c)) })), 1)),
2209
+ D(u).state.value === "needsKey" && D(u).provider.value ? (_(), i("p", ui, [o(E(D(c).t("kvcoder.ui.keyNeeded", { provider: D(u).provider.value.title })) + " ", 1), a("button", {
2188
2210
  type: "button",
2189
2211
  class: "kvc-link-button",
2190
2212
  "data-test": "add-key",
2191
2213
  onClick: f[0] ||= (e) => D(c).navigate("kvai.provider", { providerId: D(u).provider.value.id })
2192
- }, E(D(c).t("kvcoder.ui.addKey")), 1)])) : D(u).state.value === "noModel" ? (_(), i("p", li, E(D(c).t("kvcoder.ui.chooseModelHint")), 1)) : (_(), i("p", ui, E(D(c).t("kvcoder.ui.startHint")), 1)),
2214
+ }, E(D(c).t("kvcoder.ui.addKey")), 1)])) : D(u).state.value === "noModel" ? (_(), i("p", di, E(D(c).t("kvcoder.ui.chooseModelHint")), 1)) : (_(), i("p", fi, E(D(c).t("kvcoder.ui.startHint")), 1)),
2193
2215
  D(u).start.value !== void 0 && !D(u).start.value.approvalHidden ? (_(), n(jr, {
2194
2216
  key: 4,
2195
2217
  mode: D(u).start.value.approval
@@ -2203,7 +2225,7 @@ var oi = {
2203
2225
  onSend: p,
2204
2226
  onRegistered: m
2205
2227
  }, {
2206
- controls: j(() => [s(Zr, {
2228
+ controls: j(() => [s($r, {
2207
2229
  groups: D(u).groups.value,
2208
2230
  model: D(u).current.value,
2209
2231
  thinking: D(u).thinking.value,
@@ -2227,23 +2249,23 @@ var oi = {
2227
2249
  });
2228
2250
  //#endregion
2229
2251
  //#region web/src/use-now.ts
2230
- function fi() {
2252
+ function mi() {
2231
2253
  let e = y(Date.now()), t;
2232
2254
  return h(() => t = setInterval(() => e.value = Date.now(), 1e3)), m(() => clearInterval(t)), e;
2233
2255
  }
2234
2256
  //#endregion
2235
2257
  //#region web/src/CommandProgress.vue?vue&type=script&setup=true&lang.ts
2236
- var pi = ["data-command"], mi = { class: "kvc-activity-text" }, hi = {
2258
+ var hi = ["data-command"], gi = { class: "kvc-activity-text" }, _i = {
2237
2259
  style: { "font-weight": "500" },
2238
2260
  "data-test": "command-title"
2239
- }, gi = {
2261
+ }, vi = {
2240
2262
  class: "kvc-muted",
2241
2263
  "data-test": "command-seconds"
2242
- }, _i = /* @__PURE__ */ c({
2264
+ }, yi = /* @__PURE__ */ c({
2243
2265
  __name: "CommandProgress",
2244
2266
  props: { working: {} },
2245
2267
  setup(e) {
2246
- let n = e, r = K(), o = fi(), s = t(() => Math.max(0, Math.floor((o.value - n.working.startedAt) / 1e3)));
2268
+ let n = e, r = K(), o = mi(), s = t(() => Math.max(0, Math.floor((o.value - n.working.startedAt) / 1e3)));
2247
2269
  return (e, t) => (_(), i("div", {
2248
2270
  class: "kvc-activity",
2249
2271
  role: "status",
@@ -2255,17 +2277,17 @@ var pi = ["data-command"], mi = { class: "kvc-activity-text" }, hi = {
2255
2277
  class: "kvc-spin",
2256
2278
  "aria-hidden": "true"
2257
2279
  }, null, -1),
2258
- a("span", mi, [a("span", hi, E(D(r).t(`kvcoder.ui.working.${n.working.name}`)), 1)]),
2259
- a("span", gi, E(D(r).t("kvcoder.ui.seconds", { count: s.value })), 1)
2260
- ], 8, pi));
2280
+ a("span", gi, [a("span", _i, E(D(r).t(`kvcoder.ui.working.${n.working.name}`)), 1)]),
2281
+ a("span", vi, E(D(r).t("kvcoder.ui.seconds", { count: s.value })), 1)
2282
+ ], 8, hi));
2261
2283
  }
2262
- }), vi = ["data-state"], yi = { style: { flex: "1 1 auto" } }, bi = {
2284
+ }), bi = ["data-state"], xi = { style: { flex: "1 1 auto" } }, Si = {
2263
2285
  key: 0,
2264
2286
  "data-test": "staging-changed"
2265
- }, xi = {
2287
+ }, Ci = {
2266
2288
  key: 1,
2267
2289
  "data-test": "staging-head-moved"
2268
- }, Si = ["disabled"], Ci = /* @__PURE__ */ c({
2290
+ }, wi = ["disabled"], Ti = /* @__PURE__ */ c({
2269
2291
  __name: "StagingNote",
2270
2292
  props: {
2271
2293
  sessionId: {},
@@ -2312,7 +2334,7 @@ var pi = ["data-command"], mi = { class: "kvc-activity-text" }, hi = {
2312
2334
  size: 18,
2313
2335
  "aria-hidden": "true"
2314
2336
  }),
2315
- a("span", yi, [l.value.state === "restored" ? (_(), i(e, { key: 0 }, [o(E(D(c).t("kvcoder.ui.staging.restored")), 1)], 64)) : (_(), i(e, { key: 1 }, [l.value.paths > 0 ? (_(), i("span", bi, E(D(c).t("kvcoder.ui.staging.changed", { paths: l.value.paths })), 1)) : r("v-if", !0), l.value.headMoved ? (_(), i("span", xi, E(D(c).t("kvcoder.ui.staging.headMoved")), 1)) : r("v-if", !0)], 64))]),
2337
+ a("span", xi, [l.value.state === "restored" ? (_(), i(e, { key: 0 }, [o(E(D(c).t("kvcoder.ui.staging.restored")), 1)], 64)) : (_(), i(e, { key: 1 }, [l.value.paths > 0 ? (_(), i("span", Si, E(D(c).t("kvcoder.ui.staging.changed", { paths: l.value.paths })), 1)) : r("v-if", !0), l.value.headMoved ? (_(), i("span", Ci, E(D(c).t("kvcoder.ui.staging.headMoved")), 1)) : r("v-if", !0)], 64))]),
2316
2338
  l.value.state === "changed" && !l.value.headMoved ? (_(), i("button", {
2317
2339
  key: 0,
2318
2340
  type: "button",
@@ -2320,19 +2342,19 @@ var pi = ["data-command"], mi = { class: "kvc-activity-text" }, hi = {
2320
2342
  disabled: u.value,
2321
2343
  "data-test": "staging-restore",
2322
2344
  onClick: d
2323
- }, E(D(c).t("kvcoder.ui.staging.restore")), 9, Si)) : r("v-if", !0)
2324
- ], 8, vi));
2345
+ }, E(D(c).t("kvcoder.ui.staging.restore")), 9, wi)) : r("v-if", !0)
2346
+ ], 8, bi));
2325
2347
  }
2326
- }), wi = 5;
2327
- function Ti(e, t) {
2348
+ }), Ei = 5;
2349
+ function Di(e, t) {
2328
2350
  let n = Math.max(0, Math.floor(t / 1e3));
2329
2351
  return n < 60 ? e("kvcoder.ui.seconds", { count: n }) : e("kvcoder.ui.jobs.minutes", {
2330
2352
  minutes: Math.floor(n / 60),
2331
2353
  seconds: n % 60
2332
2354
  });
2333
2355
  }
2334
- function Ei(e, n, r) {
2335
- let i = y([]), a = y({}), o = y(/* @__PURE__ */ new Set()), s = y(Date.now()), c = t(() => i.value.filter((e) => e.status === "running")), l = 0, u;
2356
+ function Oi(e, n, r) {
2357
+ let i = y([]), a = y({}), o = y(/* @__PURE__ */ new Set()), s = y(Date.now()), c = t(() => i.value.filter((e) => e.status === "running" || e.status === "waiting")), l = 0, u;
2336
2358
  async function d() {
2337
2359
  for (let t of Object.keys(a.value)) {
2338
2360
  let r = await e.exec("kvcoder.job.get", {
@@ -2376,7 +2398,7 @@ function Ei(e, n, r) {
2376
2398
  }
2377
2399
  return A(() => c.value.length > 0 || r.value, (e) => {
2378
2400
  clearInterval(u), u = void 0, e && (u = setInterval(() => {
2379
- s.value = Date.now(), l += 1, l % wi === 0 && f();
2401
+ s.value = Date.now(), l += 1, l % Ei === 0 && f();
2380
2402
  }, 1e3));
2381
2403
  }, { immediate: !0 }), m(() => clearInterval(u)), {
2382
2404
  jobs: i,
@@ -2391,25 +2413,25 @@ function Ei(e, n, r) {
2391
2413
  }
2392
2414
  //#endregion
2393
2415
  //#region web/src/JobItem.vue?vue&type=script&setup=true&lang.ts
2394
- var Di = ["data-test", "data-status"], Oi = { class: "kvc-job-head" }, ki = {
2416
+ var ki = ["data-test", "data-status"], Ai = { class: "kvc-job-head" }, ji = {
2395
2417
  class: "kvc-job-title kvc-oneline",
2396
2418
  "data-test": "job-title"
2397
- }, Ai = {
2419
+ }, Mi = {
2398
2420
  key: 0,
2399
2421
  class: "kvc-muted",
2400
2422
  "data-test": "job-time"
2401
- }, ji = {
2423
+ }, Ni = {
2402
2424
  key: 1,
2403
2425
  class: "kvc-chip",
2404
2426
  "data-test": "job-status"
2405
- }, Mi = {
2427
+ }, Pi = {
2406
2428
  key: 0,
2407
2429
  class: "kvc-job-links"
2408
- }, Ni = ["href"], Pi = { class: "kvc-actions" }, Fi = ["aria-expanded", "data-test"], Ii = ["disabled", "data-test"], Li = {
2430
+ }, Fi = ["href"], Ii = { class: "kvc-actions" }, Li = ["aria-expanded", "data-test"], Ri = ["disabled", "data-test"], zi = {
2409
2431
  key: 2,
2410
2432
  class: "kvc-output",
2411
2433
  "data-test": "job-output"
2412
- }, Ri = /* @__PURE__ */ c({
2434
+ }, Bi = /* @__PURE__ */ c({
2413
2435
  __name: "JobItem",
2414
2436
  props: {
2415
2437
  sessionId: {},
@@ -2426,30 +2448,30 @@ var Di = ["data-test", "data-status"], Oi = { class: "kvc-job-head" }, ki = {
2426
2448
  "data-test": `job-${c.job.id}`,
2427
2449
  "data-status": c.job.status
2428
2450
  }, [
2429
- a("div", Oi, [a("span", ki, E(c.job.title), 1), c.job.status === "running" ? (_(), i("span", Ai, E(D(Ti)(D(u).t, c.now - Date.parse(c.job.startedAt))), 1)) : (_(), i("span", ji, [o(E(D(u).t(`kvcoder.ui.jobs.status.${c.job.status}`)), 1), c.job.exitCode !== void 0 && c.job.exitCode !== 0 ? (_(), i(e, { key: 0 }, [o(" · " + E(D(u).t("kvcoder.ui.exitCode", { code: c.job.exitCode })), 1)], 64)) : r("v-if", !0)]))]),
2430
- c.job.links.length > 0 ? (_(), i("div", Mi, [(_(!0), i(e, null, b(c.job.links, (e) => (_(), i("a", {
2451
+ a("div", Ai, [a("span", ji, E(c.job.title), 1), c.job.status === "running" ? (_(), i("span", Mi, E(D(Di)(D(u).t, c.now - Date.parse(c.job.startedAt))), 1)) : (_(), i("span", Ni, [o(E(D(u).t(`kvcoder.ui.jobs.status.${c.job.status}`)), 1), c.job.exitCode !== void 0 && c.job.exitCode !== 0 ? (_(), i(e, { key: 0 }, [o(" · " + E(D(u).t("kvcoder.ui.exitCode", { code: c.job.exitCode })), 1)], 64)) : r("v-if", !0)]))]),
2452
+ c.job.links.length > 0 ? (_(), i("div", Pi, [(_(!0), i(e, null, b(c.job.links, (e) => (_(), i("a", {
2431
2453
  key: e,
2432
2454
  href: e,
2433
2455
  target: "_blank",
2434
2456
  rel: "noopener noreferrer",
2435
2457
  class: "kvc-link kvc-mono",
2436
2458
  "data-test": "job-link"
2437
- }, E(e), 9, Ni))), 128))])) : r("v-if", !0),
2438
- a("div", Pi, [a("button", {
2459
+ }, E(e), 9, Fi))), 128))])) : r("v-if", !0),
2460
+ a("div", Ii, [a("button", {
2439
2461
  type: "button",
2440
2462
  class: "kvc-button",
2441
2463
  "aria-expanded": c.logs !== void 0,
2442
2464
  "data-test": `job-logs-${c.job.id}`,
2443
2465
  onClick: s[0] ||= (e) => l("logs")
2444
- }, E(D(u).t("kvcoder.ui.jobs.logs")), 9, Fi), c.job.status === "running" ? (_(), i("button", {
2466
+ }, E(D(u).t("kvcoder.ui.jobs.logs")), 9, Li), c.job.status === "running" || c.job.status === "waiting" ? (_(), i("button", {
2445
2467
  key: 0,
2446
2468
  type: "button",
2447
2469
  class: "kvc-button kvc-primary",
2448
2470
  disabled: c.stopping,
2449
2471
  "data-test": `job-stop-${c.job.id}`,
2450
2472
  onClick: s[1] ||= (e) => l("stop")
2451
- }, E(D(u).t("kvcoder.ui.jobs.stop")), 9, Ii)) : r("v-if", !0)]),
2452
- c.job.staging === void 0 ? r("v-if", !0) : (_(), n(Ci, {
2473
+ }, E(D(u).t("kvcoder.ui.jobs.stop")), 9, Ri)) : r("v-if", !0)]),
2474
+ c.job.staging === void 0 ? r("v-if", !0) : (_(), n(Ti, {
2453
2475
  key: 1,
2454
2476
  "session-id": c.sessionId,
2455
2477
  "run-id": c.job.id,
@@ -2459,14 +2481,14 @@ var Di = ["data-test", "data-status"], Oi = { class: "kvc-job-head" }, ki = {
2459
2481
  "run-id",
2460
2482
  "staging"
2461
2483
  ])),
2462
- c.logs === void 0 ? r("v-if", !0) : (_(), i("pre", Li, E(c.logs === "" ? D(u).t("kvcoder.ui.jobs.noOutput") : c.logs), 1))
2463
- ], 8, Di));
2484
+ c.logs === void 0 ? r("v-if", !0) : (_(), i("pre", zi, E(c.logs === "" ? D(u).t("kvcoder.ui.jobs.noOutput") : c.logs), 1))
2485
+ ], 8, ki));
2464
2486
  }
2465
- }), zi = {
2487
+ }), Vi = {
2466
2488
  key: 0,
2467
2489
  class: "kvc-jobs",
2468
2490
  "data-test": "jobs"
2469
- }, Bi = ["aria-expanded"], Vi = ["aria-label", "onKeydown"], Hi = /* @__PURE__ */ c({
2491
+ }, Hi = ["aria-expanded"], Ui = ["aria-label", "onKeydown"], Wi = /* @__PURE__ */ c({
2470
2492
  __name: "JobsChip",
2471
2493
  props: {
2472
2494
  sessionId: {},
@@ -2474,14 +2496,14 @@ var Di = ["data-test", "data-status"], Oi = { class: "kvc-job-head" }, ki = {
2474
2496
  },
2475
2497
  emits: ["running"],
2476
2498
  setup(t, { emit: c }) {
2477
- let l = t, u = c, d = K(), f = y(!1), p = O("trigger"), { jobs: g, running: v, logs: x, stopping: S, now: C, load: w, toggleLogs: T, stop: k } = Ei(d, () => l.sessionId, f);
2499
+ let l = t, u = c, d = K(), f = y(!1), p = O("trigger"), { jobs: g, running: v, logs: x, stopping: S, now: C, load: w, toggleLogs: T, stop: k } = Oi(d, () => l.sessionId, f);
2478
2500
  function j() {
2479
2501
  f.value = !1, p.value?.focus();
2480
2502
  }
2481
2503
  function M(e) {
2482
2504
  e.target instanceof Node && !p.value?.parentElement?.contains(e.target) && (f.value = !1);
2483
2505
  }
2484
- return A(() => v.value.length, (e) => u("running", e), { immediate: !0 }), h(w), A(() => [l.sessionId, l.stamp], w), A(f, (e) => e ? document.addEventListener("pointerdown", M) : document.removeEventListener("pointerdown", M)), m(() => document.removeEventListener("pointerdown", M)), (t, c) => D(v).length > 0 || f.value ? (_(), i("div", zi, [a("button", {
2506
+ return A(() => v.value.length, (e) => u("running", e), { immediate: !0 }), h(w), A(() => [l.sessionId, l.stamp], w), A(f, (e) => e ? document.addEventListener("pointerdown", M) : document.removeEventListener("pointerdown", M)), m(() => document.removeEventListener("pointerdown", M)), (t, c) => D(v).length > 0 || f.value ? (_(), i("div", Vi, [a("button", {
2485
2507
  ref_key: "trigger",
2486
2508
  ref: p,
2487
2509
  type: "button",
@@ -2496,18 +2518,18 @@ var Di = ["data-test", "data-status"], Oi = { class: "kvc-job-head" }, ki = {
2496
2518
  "aria-hidden": "true"
2497
2519
  }, null, -1),
2498
2520
  o(E(D(d).t("kvcoder.ui.jobs.running", { count: D(v).length })), 1),
2499
- s(D(U), {
2521
+ s(D(le), {
2500
2522
  size: 16,
2501
2523
  "aria-hidden": "true"
2502
2524
  })
2503
- ], 8, Bi), f.value ? (_(), i("div", {
2525
+ ], 8, Hi), f.value ? (_(), i("div", {
2504
2526
  key: 0,
2505
2527
  class: "kvc-popover kvc-jobs-panel",
2506
2528
  role: "dialog",
2507
2529
  "aria-label": D(d).t("kvcoder.ui.jobs.title"),
2508
2530
  "data-test": "jobs-popover",
2509
2531
  onKeydown: N(P(j, ["stop"]), ["esc"])
2510
- }, [(_(!0), i(e, null, b(D(g), (e) => (_(), n(Ri, {
2532
+ }, [(_(!0), i(e, null, b(D(g), (e) => (_(), n(Bi, {
2511
2533
  key: e.id,
2512
2534
  "session-id": l.sessionId,
2513
2535
  job: e,
@@ -2524,25 +2546,25 @@ var Di = ["data-test", "data-status"], Oi = { class: "kvc-job-head" }, ki = {
2524
2546
  "stopping",
2525
2547
  "onStop",
2526
2548
  "onLogs"
2527
- ]))), 128))], 40, Vi)) : r("v-if", !0)])) : r("v-if", !0);
2549
+ ]))), 128))], 40, Ui)) : r("v-if", !0)])) : r("v-if", !0);
2528
2550
  }
2529
- }), Ui = { class: "kvc-header" }, Wi = { class: "kvc-title" }, Gi = ["aria-label"], Ki = {
2551
+ }), Gi = { class: "kvc-header" }, Ki = { class: "kvc-title" }, qi = ["aria-label"], Ji = {
2530
2552
  key: 1,
2531
2553
  "data-test": "session-title"
2532
- }, qi = { class: "kvc-muted kvc-header-stats" }, Ji = ["title"], Yi = ["title", "aria-label"], Xi = [
2554
+ }, Yi = { class: "kvc-muted kvc-header-stats" }, Xi = ["title"], Zi = ["title", "aria-label"], Qi = [
2533
2555
  "aria-pressed",
2534
2556
  "aria-label",
2535
2557
  "title"
2536
- ], Zi = [
2558
+ ], $i = [
2537
2559
  "aria-pressed",
2538
2560
  "aria-label",
2539
2561
  "title"
2540
- ], Qi = ["aria-label", "aria-expanded"], $i = {
2562
+ ], ea = ["aria-label", "aria-expanded"], ta = {
2541
2563
  key: 0,
2542
2564
  class: "kvc-menu",
2543
2565
  role: "menu",
2544
2566
  "data-test": "chat-menu-items"
2545
- }, ea = ["disabled"], ta = ["disabled"], na = ["disabled"], ra = ["disabled"], ia = ["aria-label"], aa = { style: { padding: "6px" } }, oa = { class: "kvc-actions" }, sa = /* @__PURE__ */ c({
2567
+ }, na = ["disabled"], ra = ["disabled"], ia = ["disabled"], aa = ["disabled"], oa = ["aria-label"], sa = { style: { padding: "6px" } }, ca = { class: "kvc-actions" }, la = /* @__PURE__ */ c({
2546
2568
  __name: "ConversationHeader",
2547
2569
  props: {
2548
2570
  session: {},
@@ -2573,7 +2595,7 @@ var Di = ["data-test", "data-status"], Oi = { class: "kvc-job-head" }, ki = {
2573
2595
  "backgroundRunning"
2574
2596
  ],
2575
2597
  setup(n, { emit: c }) {
2576
- let l = n, u = c, d = K(), f = y(!1), p = y(null), m = y(!1), h = O("more"), g = fi(), v = t(() => l.runningSince === void 0 ? 0 : Math.max(0, g.value - Date.parse(l.runningSince))), b = t(() => ot(d.t, l.session.usage, l.session.durationMs + v.value)), x = t(() => `${d.t("kvcoder.ui.turns", { count: l.turns })} · ${st(d.t, l.session.usage)} · ${ct(d.t, l.session.usageBy)}`), S = t(() => lt(d.t, l.context)), C = t(() => l.map === void 0 ? "" : d.t("kvcoder.ui.map.toggle", l.map)), w = t(() => d.t("kvcoder.ui.artifacts.toggle", { count: l.artifacts }));
2598
+ let l = n, u = c, d = K(), f = y(!1), p = y(null), m = y(!1), h = O("more"), g = mi(), v = t(() => l.runningSince === void 0 ? 0 : Math.max(0, g.value - Date.parse(l.runningSince))), b = t(() => ot(d.t, l.session.usage, l.session.durationMs + v.value)), x = t(() => `${d.t("kvcoder.ui.turns", { count: l.turns })} · ${st(d.t, l.session.usage)} · ${ct(d.t, l.session.usageBy)}`), S = t(() => lt(d.t, l.context)), C = t(() => l.map === void 0 ? "" : d.t("kvcoder.ui.map.toggle", l.map)), w = t(() => d.t("kvcoder.ui.artifacts.toggle", { count: l.artifacts }));
2577
2599
  function T() {
2578
2600
  f.value = !1, m.value = !1;
2579
2601
  }
@@ -2585,8 +2607,8 @@ var Di = ["data-test", "data-status"], Oi = { class: "kvc-job-head" }, ki = {
2585
2607
  let e = p.value ?? "";
2586
2608
  p.value = null, u("action", "rename", e);
2587
2609
  }
2588
- return (t, n) => (_(), i("header", Ui, [
2589
- a("div", Wi, [p.value === null ? (_(), i("strong", Ki, E(D(Ge)(D(d).t, l.session.title)), 1)) : (_(), i("form", {
2610
+ return (t, n) => (_(), i("header", Gi, [
2611
+ a("div", Ki, [p.value === null ? (_(), i("strong", Ji, E(D(Ge)(D(d).t, l.session.title)), 1)) : (_(), i("form", {
2590
2612
  key: 0,
2591
2613
  onSubmit: P(j, ["prevent"])
2592
2614
  }, [M(a("input", {
@@ -2595,15 +2617,15 @@ var Di = ["data-test", "data-status"], Oi = { class: "kvc-job-head" }, ki = {
2595
2617
  "aria-label": D(d).t("kvcoder.ui.rename"),
2596
2618
  "data-test": "rename-input",
2597
2619
  onBlur: j
2598
- }, null, 40, Gi), [[k, p.value]])], 32)), a("span", qi, [a("span", {
2620
+ }, null, 40, qi), [[k, p.value]])], 32)), a("span", Yi, [a("span", {
2599
2621
  title: x.value,
2600
2622
  "data-test": "session-totals"
2601
- }, E(b.value), 9, Ji), S.value === void 0 ? r("v-if", !0) : (_(), i(e, { key: 0 }, [n[13] ||= o(" · ", -1), a("span", {
2623
+ }, E(b.value), 9, Xi), S.value === void 0 ? r("v-if", !0) : (_(), i(e, { key: 0 }, [n[13] ||= o(" · ", -1), a("span", {
2602
2624
  title: S.value.full,
2603
2625
  "aria-label": S.value.full,
2604
2626
  "data-test": "session-context"
2605
- }, E(S.value.short), 9, Yi)], 64))])]),
2606
- s(Hi, {
2627
+ }, E(S.value.short), 9, Zi)], 64))])]),
2628
+ s(Wi, {
2607
2629
  "session-id": l.session.id,
2608
2630
  stamp: l.session.updatedAt,
2609
2631
  onRunning: n[1] ||= (e) => u("backgroundRunning", e)
@@ -2620,7 +2642,7 @@ var Di = ["data-test", "data-status"], Oi = { class: "kvc-job-head" }, ki = {
2620
2642
  }, [s(D(Ae), {
2621
2643
  size: 16,
2622
2644
  "aria-hidden": "true"
2623
- }), o(E(D(d).t("kvcoder.ui.map.count", l.map)), 1)], 8, Xi)),
2645
+ }), o(E(D(d).t("kvcoder.ui.map.count", l.map)), 1)], 8, Qi)),
2624
2646
  l.artifacts > 0 ? (_(), i("button", {
2625
2647
  key: 1,
2626
2648
  type: "button",
@@ -2633,7 +2655,7 @@ var Di = ["data-test", "data-status"], Oi = { class: "kvc-job-head" }, ki = {
2633
2655
  }, [s(D(Ce), {
2634
2656
  size: 16,
2635
2657
  "aria-hidden": "true"
2636
- }), o(E(l.artifacts), 1)], 8, Zi)) : r("v-if", !0),
2658
+ }), o(E(l.artifacts), 1)], 8, $i)) : r("v-if", !0),
2637
2659
  a("div", {
2638
2660
  ref_key: "more",
2639
2661
  ref: h,
@@ -2648,8 +2670,8 @@ var Di = ["data-test", "data-status"], Oi = { class: "kvc-job-head" }, ki = {
2648
2670
  onClick: n[4] ||= (e) => {
2649
2671
  f.value = !f.value, m.value = !1;
2650
2672
  }
2651
- }, [s(D(G), { size: 18 })], 8, Qi),
2652
- f.value ? (_(), i("div", $i, [
2673
+ }, [s(D(ge), { size: 18 })], 8, ea),
2674
+ f.value ? (_(), i("div", ta, [
2653
2675
  a("button", {
2654
2676
  type: "button",
2655
2677
  role: "menuitem",
@@ -2657,7 +2679,7 @@ var Di = ["data-test", "data-status"], Oi = { class: "kvc-job-head" }, ki = {
2657
2679
  "data-test": "menu-rename",
2658
2680
  disabled: l.working,
2659
2681
  onClick: n[5] ||= (e) => A(() => p.value = l.session.title)
2660
- }, E(D(d).t("kvcoder.ui.rename")), 9, ea),
2682
+ }, E(D(d).t("kvcoder.ui.rename")), 9, na),
2661
2683
  a("button", {
2662
2684
  type: "button",
2663
2685
  role: "menuitem",
@@ -2665,7 +2687,7 @@ var Di = ["data-test", "data-status"], Oi = { class: "kvc-job-head" }, ki = {
2665
2687
  "data-test": "menu-fork",
2666
2688
  disabled: l.working,
2667
2689
  onClick: n[6] ||= (e) => A(() => u("action", "fork", ""))
2668
- }, E(D(d).t("kvcoder.ui.fork")), 9, ta),
2690
+ }, E(D(d).t("kvcoder.ui.fork")), 9, ra),
2669
2691
  a("button", {
2670
2692
  type: "button",
2671
2693
  role: "menuitem",
@@ -2673,7 +2695,7 @@ var Di = ["data-test", "data-status"], Oi = { class: "kvc-job-head" }, ki = {
2673
2695
  "data-test": "menu-export",
2674
2696
  disabled: l.working,
2675
2697
  onClick: n[7] ||= (e) => A(() => u("action", "export", ""))
2676
- }, E(D(d).t("kvcoder.ui.export")), 9, na),
2698
+ }, E(D(d).t("kvcoder.ui.export")), 9, ia),
2677
2699
  a("button", {
2678
2700
  type: "button",
2679
2701
  role: "menuitem",
@@ -2681,7 +2703,7 @@ var Di = ["data-test", "data-status"], Oi = { class: "kvc-job-head" }, ki = {
2681
2703
  "data-test": "menu-compact",
2682
2704
  disabled: l.working,
2683
2705
  onClick: n[8] ||= (e) => A(() => u("action", "compact", ""))
2684
- }, E(D(d).t("kvcoder.ui.compact")), 9, ra),
2706
+ }, E(D(d).t("kvcoder.ui.compact")), 9, aa),
2685
2707
  a("button", {
2686
2708
  type: "button",
2687
2709
  role: "menuitem",
@@ -2705,7 +2727,7 @@ var Di = ["data-test", "data-status"], Oi = { class: "kvc-job-head" }, ki = {
2705
2727
  role: "alertdialog",
2706
2728
  "aria-label": D(d).t("kvcoder.ui.deleteConfirm"),
2707
2729
  "data-test": "delete-confirm"
2708
- }, [a("span", aa, E(D(d).t("kvcoder.ui.deleteConfirm")), 1), a("div", oa, [a("button", {
2730
+ }, [a("span", sa, E(D(d).t("kvcoder.ui.deleteConfirm")), 1), a("div", ca, [a("button", {
2709
2731
  type: "button",
2710
2732
  class: "kvc-button",
2711
2733
  onClick: n[11] ||= (e) => m.value = !1
@@ -2714,24 +2736,24 @@ var Di = ["data-test", "data-status"], Oi = { class: "kvc-job-head" }, ki = {
2714
2736
  class: "kvc-button kvc-primary",
2715
2737
  "data-test": "confirm-delete",
2716
2738
  onClick: n[12] ||= (e) => A(() => u("action", "delete", ""))
2717
- }, E(D(d).t("kvcoder.ui.delete")), 1)])], 8, ia)) : r("v-if", !0)
2739
+ }, E(D(d).t("kvcoder.ui.delete")), 1)])], 8, oa)) : r("v-if", !0)
2718
2740
  ], 512)
2719
2741
  ]));
2720
2742
  }
2721
- }), ca = 200, la = [
2743
+ }), ua = 200, da = [
2722
2744
  "text",
2723
2745
  "choice",
2724
2746
  "confirm"
2725
2747
  ];
2726
- function ua(e) {
2748
+ function fa(e) {
2727
2749
  return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
2728
2750
  }
2729
2751
  var X = (e) => typeof e == "string" && e.trim() !== "" ? e : void 0;
2730
- function da(e, t) {
2752
+ function pa(e, t) {
2731
2753
  let n = X(t.args);
2732
2754
  return X(t.line) ?? (n === void 0 ? e : `${e} ${n}`);
2733
2755
  }
2734
- function fa(e) {
2756
+ function ma(e) {
2735
2757
  let t = X(e.title) ?? X(e.description), n = X(e.command);
2736
2758
  return {
2737
2759
  ...t === void 0 ? {} : { description: t },
@@ -2739,10 +2761,10 @@ function fa(e) {
2739
2761
  ...e.mode === "async" ? { background: !0 } : {}
2740
2762
  };
2741
2763
  }
2742
- function pa(e) {
2764
+ function ha(e) {
2743
2765
  let t = X(e.connector), n = X(e.command);
2744
- if (t === void 0) return fa(e);
2745
- let r = X(e.description), i = ua(typeof e.payload == "string" ? void 0 : e.payload) ?? {}, a = t === "ask" ? la.find((e) => e === n) : void 0;
2766
+ if (t === void 0) return ma(e);
2767
+ let r = X(e.description), i = fa(typeof e.payload == "string" ? void 0 : e.payload) ?? {}, a = t === "ask" ? da.find((e) => e === n) : void 0;
2746
2768
  return {
2747
2769
  ...r === void 0 ? {} : { description: r },
2748
2770
  connector: t,
@@ -2750,7 +2772,7 @@ function pa(e) {
2750
2772
  command: n,
2751
2773
  label: `${t} · ${n}`
2752
2774
  },
2753
- ...n === "exec" ? { line: da(t, i) } : {},
2775
+ ...n === "exec" ? { line: pa(t, i) } : {},
2754
2776
  fields: i,
2755
2777
  ...i.risky === !0 ? { risky: !0 } : {},
2756
2778
  ...i.background === !0 ? { background: !0 } : {},
@@ -2760,23 +2782,23 @@ function pa(e) {
2760
2782
  } }
2761
2783
  };
2762
2784
  }
2763
- var ma = [
2785
+ var ga = [
2764
2786
  "edit",
2765
2787
  "write",
2766
2788
  "read",
2767
2789
  "list",
2768
2790
  "search"
2769
2791
  ];
2770
- function ha(e) {
2771
- return e.line === void 0 ? e.connector === "fs" ? ma.find((t) => t === e.command) ?? "fields" : e.connector === "mcp" && e.command === "call" ? "mcp-call" : e.connector === "background" && (e.command === "output" || e.command === "wait") ? "run-output" : e.connector === "delegate" && e.command === "run" ? "delegate" : "fields" : "line";
2792
+ function _a(e) {
2793
+ return e.line === void 0 ? e.connector === "fs" ? ga.find((t) => t === e.command) ?? "fields" : e.connector === "mcp" && e.command === "call" ? "mcp-call" : e.connector === "mcp" && e.command === "run" ? "mcp-run" : e.connector === "background" && (e.command === "output" || e.command === "wait") ? "run-output" : e.connector === "delegate" && e.command === "run" ? "delegate" : "fields" : "line";
2772
2794
  }
2773
- function ga(e) {
2795
+ function va(e) {
2774
2796
  let t = e.replace(/\s+/g, " ");
2775
- return t.length > ca ? `${t.slice(0, ca)}…` : t;
2797
+ return t.length > ua ? `${t.slice(0, ua)}…` : t;
2776
2798
  }
2777
2799
  //#endregion
2778
2800
  //#region web/src/live-step.ts
2779
- var _a = () => ({
2801
+ var ya = () => ({
2780
2802
  text: "",
2781
2803
  thinking: "",
2782
2804
  summarizing: !1,
@@ -2784,82 +2806,91 @@ var _a = () => ({
2784
2806
  retry: null,
2785
2807
  startedAt: Date.now()
2786
2808
  });
2787
- function va(e) {
2809
+ function ba(e) {
2788
2810
  return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
2789
2811
  }
2790
- function ya(e) {
2812
+ function xa(e) {
2791
2813
  let t = e.calls.at(-1);
2792
2814
  return t === void 0 ? e.text === "" ? e.thinking === "" ? e.retry === null ? "waiting" : "retrying" : "thinking" : "writing" : t.complete ? "running" : "preparing";
2793
2815
  }
2794
- function ba(e, t, n) {
2795
- let r = va(t.arguments);
2816
+ function Sa(e, t, n) {
2817
+ let r = ba(t.arguments);
2796
2818
  (r === void 0 || e.calls.length === 0) && e.calls.push({
2797
2819
  name: n,
2798
2820
  complete: !1
2799
2821
  });
2800
2822
  let i = e.calls.at(-1);
2801
2823
  if (r === void 0 || i === void 0) return;
2802
- let a = pa(r);
2824
+ let a = ha(r);
2803
2825
  a.description !== void 0 && (i.description = a.description), a.label !== void 0 && (i.label = a.label), i.complete = "payload" in r;
2804
2826
  }
2805
- function xa(e, t) {
2827
+ function Ca(e, t) {
2806
2828
  if (t.type !== "progress") return { kind: "none" };
2807
- let n = va(t.data);
2808
- 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" && ba(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" && Object.assign(e, {
2809
- text: "",
2810
- thinking: "",
2811
- calls: e.calls.filter((e) => e.carried === !0),
2812
- retry: {
2829
+ let n = ba(t.data);
2830
+ if (n === void 0) return { kind: "none" };
2831
+ if (t.source === "@kvman/kvai" && !e.summarizing) return 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" && Sa(e, n, n.name), { kind: "none" };
2832
+ if (t.source !== "@kvman/kvcoder") return { kind: "none" };
2833
+ if (n.type === "compaction" && (e.summarizing = n.state === "started"), n.type === "retry" && typeof n.attempt == "number" && typeof n.of == "number") {
2834
+ let t = {
2813
2835
  attempt: n.attempt,
2814
- of: n.of
2815
- }
2816
- }), n.type === "follow" && typeof n.jobId == "string" ? {
2836
+ of: n.of,
2837
+ seconds: typeof n.waitMs == "number" ? Math.round(n.waitMs / 1e3) : 0,
2838
+ reason: n.reason === "rateLimited" ? "rateLimited" : "unavailable"
2839
+ };
2840
+ Object.assign(e, {
2841
+ text: "",
2842
+ thinking: "",
2843
+ calls: e.calls.filter((e) => e.carried === !0),
2844
+ retry: t
2845
+ });
2846
+ }
2847
+ return n.type === "follow" && typeof n.jobId == "string" ? {
2817
2848
  kind: "follow",
2818
2849
  jobId: n.jobId
2819
2850
  } : n.type === "subagent" && typeof n.sessionId == "string" && typeof n.jobId == "string" ? {
2820
2851
  kind: "subagent",
2821
2852
  sessionId: n.sessionId,
2822
2853
  jobId: n.jobId
2823
- } : n.type === "component" ? { kind: "question" } : { kind: "none" }) : { kind: "none" };
2854
+ } : n.type === "component" ? { kind: "question" } : { kind: "none" };
2824
2855
  }
2825
2856
  //#endregion
2826
2857
  //#region web/src/ActivityLine.vue?vue&type=script&setup=true&lang.ts
2827
- var Sa = ["data-phase"], Ca = { class: "kvc-activity-text" }, wa = {
2858
+ var wa = ["data-phase"], Ta = { class: "kvc-activity-text" }, Ea = {
2828
2859
  style: { "font-weight": "600" },
2829
2860
  "data-test": "activity-title"
2830
- }, Ta = {
2861
+ }, Da = {
2831
2862
  key: 0,
2832
2863
  class: "kvc-muted",
2833
2864
  dir: "ltr",
2834
2865
  "data-test": "activity-label"
2835
- }, Ea = {
2866
+ }, Oa = {
2836
2867
  key: 1,
2837
2868
  style: { "font-weight": "500" },
2838
2869
  "data-test": "activity-title"
2839
- }, Da = {
2870
+ }, ka = {
2840
2871
  key: 0,
2841
2872
  class: "kvc-muted",
2842
2873
  "data-test": "activity-phase"
2843
- }, Oa = {
2874
+ }, Aa = {
2844
2875
  key: 1,
2845
2876
  class: "kvc-muted",
2846
2877
  "data-test": "activity-turn"
2847
- }, ka = {
2878
+ }, ja = {
2848
2879
  class: "kvc-muted",
2849
2880
  "data-test": "activity-seconds"
2850
- }, Aa = /* @__PURE__ */ c({
2881
+ }, Ma = /* @__PURE__ */ c({
2851
2882
  __name: "ActivityLine",
2852
2883
  props: {
2853
2884
  live: {},
2854
2885
  turn: {}
2855
2886
  },
2856
2887
  setup(n) {
2857
- let o = n, s = K(), c = fi(), l = t(() => ya(o.live)), u = t(() => {
2888
+ let o = n, s = K(), c = mi(), l = t(() => xa(o.live)), u = t(() => {
2858
2889
  if (o.turn !== void 0 && o.turn.steps !== 0) return o.turn.usage.cost === 0 ? s.t("kvcoder.ui.turnSteps", { steps: o.turn.steps }) : s.t("kvcoder.ui.turnSoFar", {
2859
2890
  steps: o.turn.steps,
2860
2891
  cost: it(o.turn.usage.cost)
2861
2892
  });
2862
- }), d = t(() => Math.max(0, Math.floor((c.value - o.live.startedAt) / 1e3)));
2893
+ }), d = t(() => o.live.retry !== null && l.value === "retrying" ? s.t(o.live.retry.reason === "rateLimited" ? "kvcoder.ui.activity.retryingRateLimited" : "kvcoder.ui.activity.retryingUnavailable", o.live.retry) : s.t(`kvcoder.ui.activity.${l.value}`)), f = t(() => Math.max(0, Math.floor((c.value - o.live.startedAt) / 1e3)));
2863
2894
  return (t, n) => (_(), i("div", {
2864
2895
  class: "kvc-activity",
2865
2896
  role: "status",
@@ -2871,15 +2902,15 @@ var Sa = ["data-phase"], Ca = { class: "kvc-activity-text" }, wa = {
2871
2902
  class: "kvc-spin",
2872
2903
  "aria-hidden": "true"
2873
2904
  }, null, -1),
2874
- a("span", Ca, [o.live.calls.length > 0 ? (_(!0), i(e, { key: 0 }, b(o.live.calls, (e, t) => (_(), i("span", {
2905
+ a("span", Ta, [o.live.calls.length > 0 ? (_(!0), i(e, { key: 0 }, b(o.live.calls, (e, t) => (_(), i("span", {
2875
2906
  key: t,
2876
2907
  class: "kvc-activity-call",
2877
2908
  "data-test": "activity-call"
2878
- }, [a("span", wa, E(e.description ?? D(s).t("kvcoder.ui.activity.preparing")), 1), e.label ? (_(), i("span", Ta, E(e.label), 1)) : r("v-if", !0)]))), 128)) : (_(), i("span", Ea, E(D(s).t(`kvcoder.ui.activity.${l.value}`, o.live.retry ?? {})), 1))]),
2879
- o.live.calls.length > 0 ? (_(), i("span", Da, E(D(s).t(`kvcoder.ui.activity.${l.value}`)), 1)) : r("v-if", !0),
2880
- u.value ? (_(), i("span", Oa, E(u.value), 1)) : r("v-if", !0),
2881
- a("span", ka, E(D(s).t("kvcoder.ui.seconds", { count: d.value })), 1)
2882
- ], 8, Sa));
2909
+ }, [a("span", Ea, E(e.description ?? D(s).t("kvcoder.ui.activity.preparing")), 1), e.label ? (_(), i("span", Da, E(e.label), 1)) : r("v-if", !0)]))), 128)) : (_(), i("span", Oa, E(d.value), 1))]),
2910
+ o.live.calls.length > 0 ? (_(), i("span", ka, E(D(s).t(`kvcoder.ui.activity.${l.value}`)), 1)) : r("v-if", !0),
2911
+ u.value ? (_(), i("span", Aa, E(u.value), 1)) : r("v-if", !0),
2912
+ a("span", ja, E(D(s).t("kvcoder.ui.seconds", { count: f.value })), 1)
2913
+ ], 8, wa));
2883
2914
  }
2884
2915
  });
2885
2916
  //#endregion
@@ -2887,34 +2918,34 @@ var Sa = ["data-phase"], Ca = { class: "kvc-activity-text" }, wa = {
2887
2918
  function Z(e) {
2888
2919
  return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
2889
2920
  }
2890
- function ja(e) {
2921
+ function Na(e) {
2891
2922
  return Array.isArray(e) ? e.flatMap((e) => {
2892
2923
  let t = Z(e);
2893
2924
  return t === void 0 ? [] : [t];
2894
2925
  }) : [];
2895
2926
  }
2896
- function Ma(e) {
2897
- return typeof e == "string" ? e : ja(e).flatMap((e) => e.type === "text" && typeof e.text == "string" ? [e.text] : []).join("\n");
2927
+ function Pa(e) {
2928
+ return typeof e == "string" ? e : Na(e).flatMap((e) => e.type === "text" && typeof e.text == "string" ? [e.text] : []).join("\n");
2898
2929
  }
2899
- function Na(e) {
2900
- return ja(e.content.content).flatMap((e) => e.type === "thinking" && typeof e.thinking == "string" ? [e.thinking] : []).join("\n");
2930
+ function Fa(e) {
2931
+ return Na(e.content.content).flatMap((e) => e.type === "thinking" && typeof e.thinking == "string" ? [e.thinking] : []).join("\n");
2901
2932
  }
2902
- function Pa(e) {
2933
+ function Ia(e) {
2903
2934
  let t = /* @__PURE__ */ new Map();
2904
2935
  for (let n of e) {
2905
2936
  if (n.kind !== "assistant") continue;
2906
2937
  let e = typeof n.durationMs == "number" ? { writtenMs: n.durationMs } : {};
2907
- for (let r of ja(n.content.content)) {
2938
+ for (let r of Na(n.content.content)) {
2908
2939
  let n = Z(r.arguments);
2909
2940
  r.type === "toolCall" && typeof r.id == "string" && n !== void 0 && t.set(r.id, {
2910
- ...pa(n),
2941
+ ...ha(n),
2911
2942
  ...e
2912
2943
  });
2913
2944
  }
2914
2945
  }
2915
2946
  return t;
2916
2947
  }
2917
- function Fa(e, t) {
2948
+ function La(e, t) {
2918
2949
  let { description: n, connector: r, command: i } = e;
2919
2950
  return typeof r == "string" ? {
2920
2951
  ...t,
@@ -2927,46 +2958,46 @@ function Fa(e, t) {
2927
2958
  ...e.background === !0 ? { background: !0 } : {}
2928
2959
  } : {
2929
2960
  ...t,
2930
- ...pa(e)
2961
+ ...ha(e)
2931
2962
  };
2932
2963
  }
2933
- function Ia(e, t) {
2934
- let n = Z(e.content.details), r = Ma(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]);
2964
+ function Ra(e, t) {
2965
+ let n = Z(e.content.details), r = Pa(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]);
2935
2966
  return {
2936
- ...n === void 0 ? a : Fa(n, a),
2967
+ ...n === void 0 ? a : La(n, a),
2937
2968
  output: typeof n?.output == "string" ? n.output : n === void 0 ? r.replace(/\n?\[exit code \d+\]$/, "") : r,
2938
2969
  failed: e.content.isError === !0 || o !== void 0 && o !== 0,
2939
2970
  ...typeof n?.durationMs == "number" ? { durationMs: n.durationMs } : {}
2940
2971
  };
2941
2972
  }
2942
- var La = "dismissed by the user";
2943
- function Ra(e) {
2944
- if (e === La) return { dismissed: !0 };
2973
+ var za = "dismissed by the user";
2974
+ function Ba(e) {
2975
+ if (e === za) return { dismissed: !0 };
2945
2976
  for (let t of [e, e.split("\n", 1)[0] ?? ""]) try {
2946
2977
  return Z(JSON.parse(t));
2947
2978
  } catch {
2948
2979
  continue;
2949
2980
  }
2950
2981
  }
2951
- function za(e, t) {
2982
+ function Va(e, t) {
2952
2983
  if (e.kind !== "toolResult") return;
2953
2984
  let n = t.get(String(e.content.toolCallId))?.ask;
2954
2985
  if (n === void 0) return;
2955
- let r = Ma(e.content.content);
2956
- if (e.content.isError === !0 && r !== La) return;
2957
- let i = Ra(r);
2986
+ let r = Pa(e.content.content);
2987
+ if (e.content.isError === !0 && r !== za) return;
2988
+ let i = Ba(r);
2958
2989
  return i === void 0 ? void 0 : {
2959
2990
  ...n,
2960
2991
  answer: i
2961
2992
  };
2962
2993
  }
2963
- function Ba(e) {
2994
+ function Ha(e) {
2964
2995
  return e.kind === "user" && e.source?.kind === "extension" && e.source.name === "@kvman/kvcoder";
2965
2996
  }
2966
- function Va(e) {
2997
+ function Ua(e) {
2967
2998
  return e.kind === "user" && (e.source?.kind === "job" || e.source?.kind === "subagent");
2968
2999
  }
2969
- function Ha(e) {
3000
+ function Wa(e) {
2970
3001
  if (e.kind !== "toolResult") return;
2971
3002
  let t = Z(e.content.details);
2972
3003
  if (t === void 0) return;
@@ -2980,10 +3011,10 @@ function Ha(e) {
2980
3011
  version: o
2981
3012
  };
2982
3013
  }
2983
- var Ua = (e) => typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
2984
- function Wa(e) {
3014
+ var Ga = (e) => typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
3015
+ function Ka(e) {
2985
3016
  if (e.kind !== "toolResult" || e.content.isError === !0) return;
2986
- let t = Ua(Ua(e.content.details)?.card), n = t?.component;
3017
+ let t = Ga(Ga(e.content.details)?.card), n = t?.component;
2987
3018
  if (t !== void 0 && typeof n == "string") return {
2988
3019
  component: n,
2989
3020
  props: {
@@ -2992,25 +3023,25 @@ function Wa(e) {
2992
3023
  }
2993
3024
  };
2994
3025
  }
2995
- var Ga = /\n\nAttached files:\n((?:- .+\n?)+)$/;
2996
- function Ka(e, t) {
2997
- return e.replace(Ga, (e, n) => `\n\n${t}\n${n}`);
3026
+ var qa = /\n\nAttached files:\n((?:- .+\n?)+)$/;
3027
+ function Ja(e, t) {
3028
+ return e.replace(qa, (e, n) => `\n\n${t}\n${n}`);
2998
3029
  }
2999
- function qa(e) {
3030
+ function Ya(e) {
3000
3031
  if (e.kind === "user") return e.source?.kind === "job" ? e.source.jobId : e.source?.kind === "subagent" ? e.source.sessionId : void 0;
3001
3032
  }
3002
- var Ja = /^The background call `([\s\S]*?)` \(job [^)\n]+\) finished:\n/;
3003
- function Ya(e) {
3004
- let t = Ja.exec(Ma(e.content.content))?.[1]?.trim();
3033
+ var Xa = /^The background call `([\s\S]*?)` \(job [^)\n]+\) finished:\n/;
3034
+ function Za(e) {
3035
+ let t = Xa.exec(Pa(e.content.content))?.[1]?.trim();
3005
3036
  return t === void 0 || t === "" ? void 0 : t;
3006
3037
  }
3007
- function Xa(e) {
3038
+ function Qa(e) {
3008
3039
  let t = Z(Z(e.content.details)?.staging)?.runId;
3009
3040
  return typeof t == "string" ? t : void 0;
3010
3041
  }
3011
3042
  //#endregion
3012
3043
  //#region web/src/question-options.ts
3013
- function Za(e) {
3044
+ function $a(e) {
3014
3045
  return (Array.isArray(e.options) ? e.options : []).map((e) => {
3015
3046
  let t = q(e);
3016
3047
  return {
@@ -3022,56 +3053,56 @@ function Za(e) {
3022
3053
  }
3023
3054
  //#endregion
3024
3055
  //#region web/src/AnsweredCard.vue?vue&type=script&setup=true&lang.ts
3025
- var Qa = ["aria-label"], $a = {
3056
+ var eo = ["aria-label"], to = {
3026
3057
  class: "kvc-card-row",
3027
3058
  style: { "font-weight": "600" }
3028
- }, eo = {
3059
+ }, no = {
3029
3060
  dir: "auto",
3030
3061
  "data-test": "answered-prompt"
3031
- }, to = { class: "kvc-card-body" }, no = {
3062
+ }, ro = { class: "kvc-card-body" }, io = {
3032
3063
  key: 0,
3033
3064
  class: "kvc-muted",
3034
3065
  "data-test": "answered-skipped"
3035
- }, ro = ["data-chosen", "data-test"], io = {
3066
+ }, ao = ["data-chosen", "data-test"], oo = {
3036
3067
  key: 1,
3037
3068
  class: "kvc-answered-gap",
3038
3069
  "aria-hidden": "true"
3039
- }, ao = { style: {
3070
+ }, so = { style: {
3040
3071
  display: "flex",
3041
3072
  "flex-direction": "column"
3042
- } }, oo = { dir: "auto" }, so = {
3073
+ } }, co = { dir: "auto" }, lo = {
3043
3074
  key: 0,
3044
3075
  class: "kvc-muted",
3045
3076
  dir: "auto"
3046
- }, co = {
3077
+ }, uo = {
3047
3078
  key: 2,
3048
3079
  class: "kvc-sr"
3049
- }, lo = {
3080
+ }, fo = {
3050
3081
  key: 0,
3051
3082
  class: "kvc-answered-option",
3052
3083
  "data-chosen": "true",
3053
3084
  "data-test": "answered-other"
3054
- }, uo = { style: {
3085
+ }, po = { style: {
3055
3086
  display: "flex",
3056
3087
  "flex-direction": "column"
3057
- } }, fo = { class: "kvc-muted" }, po = {
3088
+ } }, mo = { class: "kvc-muted" }, ho = {
3058
3089
  dir: "auto",
3059
3090
  style: { "white-space": "pre-wrap" }
3060
- }, mo = {
3091
+ }, go = {
3061
3092
  key: 2,
3062
3093
  class: "kvc-chip",
3063
3094
  style: { "align-self": "flex-start" },
3064
3095
  "data-test": "answered-confirmed"
3065
- }, ho = {
3096
+ }, _o = {
3066
3097
  key: 3,
3067
3098
  dir: "auto",
3068
3099
  style: { "white-space": "pre-wrap" },
3069
3100
  "data-test": "answered-text"
3070
- }, go = /* @__PURE__ */ c({
3101
+ }, vo = /* @__PURE__ */ c({
3071
3102
  __name: "AnsweredCard",
3072
3103
  props: { answered: {} },
3073
3104
  setup(o) {
3074
- let c = o, l = K(), 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(() => Za(c.answered.question).map((e) => ({
3105
+ let c = o, l = K(), 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(() => $a(c.answered.question).map((e) => ({
3075
3106
  ...e,
3076
3107
  chosen: f.value.includes(e.id)
3077
3108
  }))), m = t(() => typeof c.answered.answer.other == "string" ? c.answered.answer.other : ""), h = t(() => typeof c.answered.answer.text == "string" ? c.answered.answer.text : "");
@@ -3079,11 +3110,11 @@ var Qa = ["aria-label"], $a = {
3079
3110
  class: "kvc-card",
3080
3111
  "data-test": "answered-card",
3081
3112
  "aria-label": u.value
3082
- }, [a("div", $a, [s(D(ue), {
3113
+ }, [a("div", to, [s(D(ue), {
3083
3114
  size: 18,
3084
3115
  "aria-hidden": "true",
3085
3116
  class: "kvc-ok"
3086
- }), a("span", eo, E(u.value), 1)]), a("div", to, [d.value ? (_(), i("span", no, E(D(l).t("kvcoder.ui.skipped")), 1)) : c.answered.kind === "choice" ? (_(), i(e, { key: 1 }, [(_(!0), i(e, null, b(p.value, (e) => (_(), i("div", {
3117
+ }), a("span", no, E(u.value), 1)]), a("div", ro, [d.value ? (_(), i("span", io, E(D(l).t("kvcoder.ui.skipped")), 1)) : c.answered.kind === "choice" ? (_(), i(e, { key: 1 }, [(_(!0), i(e, null, b(p.value, (e) => (_(), i("div", {
3087
3118
  key: e.id,
3088
3119
  class: "kvc-answered-option",
3089
3120
  "data-chosen": e.chosen,
@@ -3094,19 +3125,19 @@ var Qa = ["aria-label"], $a = {
3094
3125
  size: 16,
3095
3126
  "aria-hidden": "true",
3096
3127
  class: "kvc-ok"
3097
- })) : (_(), i("span", io)),
3098
- a("span", ao, [a("span", oo, E(e.label), 1), e.description ? (_(), i("span", so, E(e.description), 1)) : r("v-if", !0)]),
3099
- e.chosen ? (_(), i("span", co, E(D(l).t("kvcoder.ui.chosen")), 1)) : r("v-if", !0)
3100
- ], 8, ro))), 128)), m.value === "" ? r("v-if", !0) : (_(), i("div", lo, [s(D(ce), {
3128
+ })) : (_(), i("span", oo)),
3129
+ a("span", so, [a("span", co, E(e.label), 1), e.description ? (_(), i("span", lo, E(e.description), 1)) : r("v-if", !0)]),
3130
+ e.chosen ? (_(), i("span", uo, E(D(l).t("kvcoder.ui.chosen")), 1)) : r("v-if", !0)
3131
+ ], 8, ao))), 128)), m.value === "" ? r("v-if", !0) : (_(), i("div", fo, [s(D(ce), {
3101
3132
  size: 16,
3102
3133
  "aria-hidden": "true",
3103
3134
  class: "kvc-ok"
3104
- }), a("span", uo, [a("span", fo, E(D(l).t("kvcoder.ui.other")), 1), a("span", po, E(m.value), 1)])]))], 64)) : c.answered.kind === "confirm" ? (_(), i("span", mo, E(D(l).t(c.answered.answer.confirmed === !0 ? "kvcoder.ui.yes" : "kvcoder.ui.no")), 1)) : (_(), i("span", ho, E(h.value), 1))])], 8, Qa));
3135
+ }), a("span", po, [a("span", mo, E(D(l).t("kvcoder.ui.other")), 1), a("span", ho, E(m.value), 1)])]))], 64)) : c.answered.kind === "confirm" ? (_(), i("span", go, E(D(l).t(c.answered.answer.confirmed === !0 ? "kvcoder.ui.yes" : "kvcoder.ui.no")), 1)) : (_(), i("span", _o, E(h.value), 1))])], 8, eo));
3105
3136
  }
3106
- }), _o = {
3137
+ }), yo = {
3107
3138
  class: "kvc-card kvc-card-row",
3108
3139
  "data-test": "artifact-card"
3109
- }, vo = {
3140
+ }, bo = {
3110
3141
  style: {
3111
3142
  flex: "1 1 auto",
3112
3143
  "min-inline-size": "0",
@@ -3115,13 +3146,13 @@ var Qa = ["aria-label"], $a = {
3115
3146
  "white-space": "nowrap"
3116
3147
  },
3117
3148
  "data-test": "artifact-card-title"
3118
- }, yo = {
3149
+ }, xo = {
3119
3150
  class: "kvc-chip",
3120
3151
  "data-test": "artifact-card-format"
3121
- }, bo = {
3152
+ }, So = {
3122
3153
  class: "kvc-muted",
3123
3154
  "data-test": "artifact-card-version"
3124
- }, xo = /* @__PURE__ */ c({
3155
+ }, Co = /* @__PURE__ */ c({
3125
3156
  __name: "ArtifactCard",
3126
3157
  props: {
3127
3158
  id: {},
@@ -3132,14 +3163,14 @@ var Qa = ["aria-label"], $a = {
3132
3163
  emits: ["open"],
3133
3164
  setup(e, { emit: t }) {
3134
3165
  let n = e, r = t, o = K();
3135
- return (e, t) => (_(), i("div", _o, [
3166
+ return (e, t) => (_(), i("div", yo, [
3136
3167
  s(D(Ce), {
3137
3168
  size: 16,
3138
3169
  "aria-hidden": "true"
3139
3170
  }),
3140
- a("span", vo, E(n.title), 1),
3141
- a("span", yo, E(D(o).t(`kvcoder.ui.artifacts.format.${n.format}`)), 1),
3142
- a("span", bo, E(D(o).t("kvcoder.ui.artifacts.version", { version: n.version })), 1),
3171
+ a("span", bo, E(n.title), 1),
3172
+ a("span", xo, E(D(o).t(`kvcoder.ui.artifacts.format.${n.format}`)), 1),
3173
+ a("span", So, E(D(o).t("kvcoder.ui.artifacts.version", { version: n.version })), 1),
3143
3174
  a("button", {
3144
3175
  type: "button",
3145
3176
  class: "kvc-button",
@@ -3148,39 +3179,39 @@ var Qa = ["aria-label"], $a = {
3148
3179
  }, E(D(o).t("kvcoder.ui.artifacts.open")), 1)
3149
3180
  ]));
3150
3181
  }
3151
- }), So = 160, Co = /^error ([A-Za-z0-9_/-]+): ?(.*)/;
3152
- function wo(e) {
3182
+ }), wo = 160, To = /^error ([A-Za-z0-9_/-]+): ?(.*)/;
3183
+ function Eo(e) {
3153
3184
  let t = (e.split("\n", 1)[0] ?? "").trim();
3154
- return t.length > So ? `${t.slice(0, So)}…` : t;
3185
+ return t.length > wo ? `${t.slice(0, wo)}…` : t;
3155
3186
  }
3156
- function To(e) {
3187
+ function Do(e) {
3157
3188
  if (e.startsWith("denied by the user")) return { kind: "denied" };
3158
- let t = Co.exec(e);
3189
+ let t = To.exec(e);
3159
3190
  return t?.[1] === "VALIDATION_FAILED" ? { kind: "invalid" } : t === null ? /\[exit code \d+\]\s*$/.test(e) ? { kind: "command" } : {
3160
3191
  kind: "error",
3161
- message: wo(e)
3192
+ message: Eo(e)
3162
3193
  } : {
3163
3194
  kind: "error",
3164
- message: wo(t[2] ?? "")
3195
+ message: Eo(t[2] ?? "")
3165
3196
  };
3166
3197
  }
3167
3198
  //#endregion
3168
3199
  //#region web/src/call-results.ts
3169
- function Eo(e) {
3200
+ function Oo(e) {
3170
3201
  let { replacements: t, firstChangedLine: n } = q(e);
3171
3202
  return typeof t == "number" && typeof n == "number" ? {
3172
3203
  replacements: t,
3173
3204
  firstChangedLine: n
3174
3205
  } : void 0;
3175
3206
  }
3176
- function Do(e) {
3207
+ function ko(e) {
3177
3208
  let { fromLine: t, content: n } = q(e);
3178
3209
  return typeof t == "number" && typeof n == "string" ? {
3179
3210
  fromLine: t,
3180
3211
  content: n
3181
3212
  } : void 0;
3182
3213
  }
3183
- function Oo(e) {
3214
+ function Ao(e) {
3184
3215
  let { name: t, kind: n, bytes: r } = q(e);
3185
3216
  return typeof t == "string" && (n === "file" || n === "folder") && typeof r == "number" ? [{
3186
3217
  name: t,
@@ -3188,11 +3219,11 @@ function Oo(e) {
3188
3219
  bytes: r
3189
3220
  }] : [];
3190
3221
  }
3191
- function ko(e) {
3222
+ function jo(e) {
3192
3223
  let t = q(e).entries;
3193
- return Array.isArray(t) ? t.flatMap(Oo) : void 0;
3224
+ return Array.isArray(t) ? t.flatMap(Ao) : void 0;
3194
3225
  }
3195
- function Ao(e) {
3226
+ function Mo(e) {
3196
3227
  let { path: t, matches: n } = q(e);
3197
3228
  return typeof t != "string" || !Array.isArray(n) ? [] : [{
3198
3229
  path: t,
@@ -3205,17 +3236,17 @@ function Ao(e) {
3205
3236
  })
3206
3237
  }];
3207
3238
  }
3208
- var jo = [
3239
+ var No = [
3209
3240
  "running",
3210
3241
  "succeeded",
3211
3242
  "failed",
3212
3243
  "cancelled",
3213
3244
  "interrupted"
3214
3245
  ];
3215
- function Mo(e, t) {
3216
- return jo.some((e) => e === t) ? e(`kvcoder.ui.jobs.status.${t}`) : t;
3246
+ function Po(e, t) {
3247
+ return No.some((e) => e === t) ? e(`kvcoder.ui.jobs.status.${t}`) : t;
3217
3248
  }
3218
- function No(e) {
3249
+ function Fo(e) {
3219
3250
  let { kind: t, call: n, status: r, startedAt: i, endedAt: a, exitCode: o, output: s, problem: c } = q(e);
3220
3251
  if (typeof n != "string" || typeof r != "string") return;
3221
3252
  let l = typeof i == "string" && typeof a == "string" ? Date.parse(a) - Date.parse(i) : NaN;
@@ -3229,44 +3260,60 @@ function No(e) {
3229
3260
  ...c === void 0 ? {} : { problem: c }
3230
3261
  };
3231
3262
  }
3232
- function Po(e) {
3263
+ function Io(e) {
3233
3264
  let t = q(e).files;
3234
- return Array.isArray(t) ? t.flatMap(Ao) : void 0;
3265
+ return Array.isArray(t) ? t.flatMap(Mo) : void 0;
3235
3266
  }
3236
3267
  //#endregion
3237
3268
  //#region web/src/edit-diff.ts
3238
- var Fo = 3;
3239
- function Io(e) {
3269
+ var Lo = 3;
3270
+ function Ro(e) {
3240
3271
  if (e === "") return [];
3241
3272
  let t = e.split("\n");
3242
3273
  return e.endsWith("\n") ? t.slice(0, -1) : t;
3243
3274
  }
3244
- function Lo(e, t) {
3275
+ function zo(e, t) {
3245
3276
  let n = 0;
3246
3277
  for (; n < e.length && n < t.length && e[n] === t[n];) n += 1;
3247
3278
  return n;
3248
3279
  }
3249
- function Ro(e, t) {
3250
- let n = Io(e), r = Io(t), i = Lo(n, r), a = Lo(n.slice(i).reverse(), r.slice(i).reverse()), o = (e, t) => t.map((t) => ({
3280
+ function Bo(e, t) {
3281
+ let n = Ro(e), r = Ro(t), i = zo(n, r), a = zo(n.slice(i).reverse(), r.slice(i).reverse()), o = (e, t) => t.map((t) => ({
3251
3282
  kind: e,
3252
3283
  text: t
3253
3284
  }));
3254
3285
  return [
3255
- ...o("context", n.slice(Math.max(i - Fo, 0), i)),
3286
+ ...o("context", n.slice(Math.max(i - Lo, 0), i)),
3256
3287
  ...o("removed", n.slice(i, n.length - a)),
3257
3288
  ...o("added", r.slice(i, r.length - a)),
3258
- ...o("context", n.slice(n.length - a, n.length - a + Fo))
3289
+ ...o("context", n.slice(n.length - a, n.length - a + Lo))
3259
3290
  ];
3260
3291
  }
3261
- function zo(e) {
3292
+ function Vo(e) {
3262
3293
  return {
3263
3294
  added: e.filter((e) => e.kind === "added").length,
3264
3295
  removed: e.filter((e) => e.kind === "removed").length
3265
3296
  };
3266
3297
  }
3267
3298
  //#endregion
3299
+ //#region web/src/mcp-steps.ts
3300
+ function Ho(e) {
3301
+ let t = e.steps;
3302
+ return Array.isArray(t) ? t.map((e, t) => {
3303
+ let { tool: n, arguments: r } = q(e), i = `${t + 1}.`;
3304
+ return typeof n != "string" || n.trim() === "" ? {
3305
+ label: i,
3306
+ arguments: q(r)
3307
+ } : {
3308
+ label: `${i} ${n}`,
3309
+ tool: n,
3310
+ arguments: q(r)
3311
+ };
3312
+ }) : [];
3313
+ }
3314
+ //#endregion
3268
3315
  //#region web/src/call-summary.ts
3269
- function Bo(e) {
3316
+ function Uo(e) {
3270
3317
  if (e !== void 0 && /^\s*[[{]/.test(e)) try {
3271
3318
  return JSON.parse(e);
3272
3319
  } catch (e) {
@@ -3274,12 +3321,12 @@ function Bo(e) {
3274
3321
  throw e;
3275
3322
  }
3276
3323
  }
3277
- var Vo = 1024;
3278
- function Ho(e, t) {
3279
- return t < Vo ? e("kvcoder.ui.call.bytes", { count: t }) : t < Vo * Vo ? e("kvcoder.ui.call.kilobytes", { count: (t / Vo).toFixed(1) }) : e("kvcoder.ui.call.megabytes", { count: (t / (Vo * Vo)).toFixed(1) });
3324
+ var Wo = 1024;
3325
+ function Go(e, t) {
3326
+ return t < Wo ? e("kvcoder.ui.call.bytes", { count: t }) : t < Wo * Wo ? e("kvcoder.ui.call.kilobytes", { count: (t / Wo).toFixed(1) }) : e("kvcoder.ui.call.megabytes", { count: (t / (Wo * Wo)).toFixed(1) });
3280
3327
  }
3281
3328
  var Q = (e) => typeof e == "string" && e !== "" ? e : void 0;
3282
- function Uo(e) {
3329
+ function Ko(e) {
3283
3330
  let t = e.edits;
3284
3331
  return Array.isArray(t) ? t.flatMap((e) => {
3285
3332
  let { oldText: t, newText: n } = q(e);
@@ -3289,28 +3336,28 @@ function Uo(e) {
3289
3336
  }] : [];
3290
3337
  }) : [];
3291
3338
  }
3292
- function Wo(e) {
3293
- let t = Uo(e).map((e) => zo(Ro(e.oldText, e.newText)));
3339
+ function qo(e) {
3340
+ let t = Ko(e).map((e) => Vo(Bo(e.oldText, e.newText)));
3294
3341
  return `+${t.reduce((e, t) => e + t.added, 0)} −${t.reduce((e, t) => e + t.removed, 0)}`;
3295
3342
  }
3296
- function Go(e, t) {
3297
- if (typeof t.bytes == "number" && typeof t.created == "boolean") return e(t.created ? "kvcoder.ui.call.created" : "kvcoder.ui.call.replaced", { size: Ho(e, t.bytes) });
3343
+ function Jo(e, t) {
3344
+ if (typeof t.bytes == "number" && typeof t.created == "boolean") return e(t.created ? "kvcoder.ui.call.created" : "kvcoder.ui.call.replaced", { size: Go(e, t.bytes) });
3298
3345
  }
3299
- function Ko(e, t) {
3346
+ function Yo(e, t) {
3300
3347
  let { fromLine: n, totalLines: r, content: i } = t;
3301
3348
  if (typeof n != "number" || typeof r != "number" || typeof i != "string") return;
3302
- let a = Io(i).length;
3349
+ let a = Ro(i).length;
3303
3350
  return a === 0 ? void 0 : e("kvcoder.ui.call.lines", {
3304
3351
  from: n,
3305
3352
  to: n + a - 1,
3306
3353
  total: r
3307
3354
  });
3308
3355
  }
3309
- function qo(e, t) {
3356
+ function Xo(e, t) {
3310
3357
  let n = t.entries;
3311
3358
  if (Array.isArray(n)) return e(t.truncated === !0 ? "kvcoder.ui.call.entriesFirst" : "kvcoder.ui.call.entries", { count: n.length });
3312
3359
  }
3313
- function Jo(e, t) {
3360
+ function Zo(e, t) {
3314
3361
  let n = t.files;
3315
3362
  if (!Array.isArray(n)) return;
3316
3363
  let r = n.reduce((e, t) => {
@@ -3322,7 +3369,7 @@ function Jo(e, t) {
3322
3369
  files: n.length
3323
3370
  });
3324
3371
  }
3325
- var Yo = (e, t, n) => Array.isArray(n) ? e(t, { count: n.length }) : void 0;
3372
+ var Qo = (e, t, n) => Array.isArray(n) ? e(t, { count: n.length }) : void 0;
3326
3373
  function $(e, t, n) {
3327
3374
  return {
3328
3375
  ...e === void 0 ? {} : { words: e },
@@ -3330,87 +3377,86 @@ function $(e, t, n) {
3330
3377
  ...n === void 0 ? {} : { outcome: n }
3331
3378
  };
3332
3379
  }
3333
- function Xo(e, t, n, r) {
3380
+ function $o(e, t, n, r) {
3334
3381
  let i = r === void 0 ? void 0 : q(r), a = Q(n.path);
3335
- if (t === "edit") return $(e("kvcoder.ui.call.edit"), a, i === void 0 ? void 0 : Wo(n));
3336
- if (t === "write") return $(e("kvcoder.ui.call.write"), a, i === void 0 ? void 0 : Go(e, i));
3337
- if (t === "read") return $(e("kvcoder.ui.call.read"), a, i === void 0 ? void 0 : Ko(e, i));
3338
- if (t === "list") return $(e("kvcoder.ui.call.list"), a ?? ".", i === void 0 ? void 0 : qo(e, i));
3339
- if (t === "search") return $(e("kvcoder.ui.call.search"), Q(n.pattern), i === void 0 ? void 0 : Jo(e, i));
3382
+ if (t === "edit") return $(e("kvcoder.ui.call.edit"), a, i === void 0 ? void 0 : qo(n));
3383
+ if (t === "write") return $(e("kvcoder.ui.call.write"), a, i === void 0 ? void 0 : Jo(e, i));
3384
+ if (t === "read") return $(e("kvcoder.ui.call.read"), a, i === void 0 ? void 0 : Yo(e, i));
3385
+ if (t === "list") return $(e("kvcoder.ui.call.list"), a ?? ".", i === void 0 ? void 0 : Xo(e, i));
3386
+ if (t === "search") return $(e("kvcoder.ui.call.search"), Q(n.pattern), i === void 0 ? void 0 : Zo(e, i));
3340
3387
  }
3341
- function Zo(e, t, n, r) {
3388
+ function es(e, t, n, r) {
3342
3389
  let i = Q(n.server), a = [i, Q(n.tool)].filter((e) => e !== void 0).join(" · ");
3343
3390
  if (t === "call") return $(void 0, a === "" ? void 0 : a);
3344
- if (t === "run") {
3345
- let e = n.steps;
3346
- return $(void 0, [i, (Array.isArray(e) ? e.flatMap((e) => Q(q(e).tool) === void 0 ? [] : [String(q(e).tool)]) : []).join(", ")].filter((e) => e !== void 0 && e !== "").join(" · "));
3347
- }
3348
- if (t === "tools") return $(e("kvcoder.ui.call.tools"), a === "" ? void 0 : a, Yo(e, "kvcoder.ui.call.toolCount", q(r).tools));
3391
+ if (t === "run") return $(void 0, [i, Ho(n).flatMap((e) => e.tool === void 0 ? [] : [e.tool]).join(", ")].filter((e) => e !== void 0 && e !== "").join(" · "));
3392
+ if (t === "tools") return $(e("kvcoder.ui.call.tools"), a === "" ? void 0 : a, Qo(e, "kvcoder.ui.call.toolCount", q(r).tools));
3349
3393
  }
3350
- function Qo(e, t, n, r) {
3351
- if (t === "list") return $(e("kvcoder.ui.call.backgroundRuns"), void 0, Yo(e, "kvcoder.ui.call.runCount", r));
3394
+ function ts(e, t, n, r) {
3395
+ if (t === "list") return $(e("kvcoder.ui.call.backgroundRuns"), void 0, Qo(e, "kvcoder.ui.call.runCount", r));
3352
3396
  if (t === "output" || t === "wait") {
3353
- let i = No(r);
3354
- return $(e(`kvcoder.ui.call.${t}`), Q(n.id), i === void 0 ? void 0 : Mo(e, i.status));
3397
+ let i = Fo(r);
3398
+ return $(e(`kvcoder.ui.call.${t}`), Q(n.id), i === void 0 ? void 0 : Po(e, i.status));
3355
3399
  }
3356
3400
  if (t === "stop") return $(e("kvcoder.ui.call.stop"), Q(n.id));
3357
3401
  }
3358
- function $o(e, t, n, r) {
3402
+ function ns(e, t, n, r) {
3359
3403
  let i = Q(q(r).progress), a = n.steps, o = Array.isArray(a) ? a.flatMap((e) => Q(q(e).id) === void 0 ? [] : [String(q(e).id)]).join(", ") : void 0;
3360
- return t === "set" ? $(e("kvcoder.ui.call.mapSet"), Q(n.goal), i) : t === "update" ? $(e("kvcoder.ui.call.mapUpdate"), o === "" ? void 0 : o, i) : t === "note" ? $(e("kvcoder.ui.call.mapNote"), Q(n.text)) : t === "get" ? $(e("kvcoder.ui.call.mapGet"), void 0, i) : void 0;
3404
+ return t === "set" ? $(e("kvcoder.ui.call.mapSet"), Q(n.goal), i) : t === "detail" ? $(e("kvcoder.ui.call.mapDetail"), Q(n.id), i) : t === "update" ? $(e("kvcoder.ui.call.mapUpdate"), o === "" ? void 0 : o, i) : t === "note" ? $(e("kvcoder.ui.call.mapNote"), Q(n.text)) : t === "get" ? $(e("kvcoder.ui.call.mapGet"), void 0, i) : void 0;
3361
3405
  }
3362
- function es(e, t, n) {
3406
+ function rs(e, t, n) {
3363
3407
  let { connector: r, command: i } = t, a = t.fields ?? {};
3364
3408
  if (r !== void 0 && i !== void 0) {
3365
3409
  if (t.line !== void 0) return { subject: `$ ${t.line}` };
3366
- if (r === "fs") return Xo(e, i, a, n);
3367
- if (r === "mcp") return Zo(e, i, a, n);
3368
- if (r === "background") return Qo(e, i, a, n);
3369
- if (r === "execution-map") return $o(e, i, a, n);
3410
+ if (i === "help") return $(e("kvcoder.ui.call.help"), [r, Q(a.command)].filter((e) => e !== void 0).join(" "));
3411
+ if (r === "fs") return $o(e, i, a, n);
3412
+ if (r === "mcp") return es(e, i, a, n);
3413
+ if (r === "background") return ts(e, i, a, n);
3414
+ if (r === "execution-map") return ns(e, i, a, n);
3370
3415
  if (r === "delegate" && i === "run") return $(e("kvcoder.ui.call.delegate"), [Q(a.worker), Q(a.title)].filter((e) => e !== void 0).join(" · "));
3371
3416
  if (r === "artifact" && i === "get") return $(e("kvcoder.ui.call.readArtifact"), Q(a.id));
3417
+ if (r === "artifact" && (i === "write" || i === "edit")) return $(e(`kvcoder.ui.call.${i}Artifact`), Q(a.id));
3372
3418
  }
3373
3419
  }
3374
3420
  //#endregion
3375
3421
  //#region web/src/field-rows.ts
3376
- var ts = "—", ns = (e) => e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean", rs = (e) => e === null ? ts : String(e);
3377
- function is(e) {
3422
+ var is = "—", as = (e) => e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean", os = (e) => e === null ? is : String(e);
3423
+ function ss(e) {
3378
3424
  return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
3379
3425
  }
3380
- function as(e) {
3381
- let t = is(e);
3426
+ function cs(e) {
3427
+ let t = ss(e);
3382
3428
  if (t === void 0) return;
3383
3429
  let n = {};
3384
3430
  for (let [e, r] of Object.entries(t)) {
3385
- if (!ns(r)) return;
3431
+ if (!as(r)) return;
3386
3432
  n[e] = r;
3387
3433
  }
3388
3434
  return n;
3389
3435
  }
3390
- function os(e) {
3436
+ function ls(e) {
3391
3437
  let t = [...new Set(e.flatMap((e) => Object.keys(e)))];
3392
3438
  return {
3393
3439
  kind: "table",
3394
3440
  columns: t,
3395
- rows: e.map((e) => t.map((t) => t in e ? rs(e[t] ?? null) : ""))
3441
+ rows: e.map((e) => t.map((t) => t in e ? os(e[t] ?? null) : ""))
3396
3442
  };
3397
3443
  }
3398
- function ss(e) {
3444
+ function us(e) {
3399
3445
  if (e.length === 0) return { kind: "empty" };
3400
- if (e.every(ns)) return {
3446
+ if (e.every(as)) return {
3401
3447
  kind: "items",
3402
- items: e.map(rs)
3448
+ items: e.map(os)
3403
3449
  };
3404
- let t = e.map(as).filter((e) => e !== void 0);
3405
- return t.length === e.length ? os(t) : {
3450
+ let t = e.map(cs).filter((e) => e !== void 0);
3451
+ return t.length === e.length ? ls(t) : {
3406
3452
  kind: "rows",
3407
3453
  rows: e.map((e, t) => ({
3408
3454
  name: String(t + 1),
3409
- value: cs(e)
3455
+ value: ds(e)
3410
3456
  }))
3411
3457
  };
3412
3458
  }
3413
- function cs(e) {
3459
+ function ds(e) {
3414
3460
  if (typeof e == "string") return e.includes("\n") ? {
3415
3461
  kind: "block",
3416
3462
  text: e
@@ -3422,27 +3468,27 @@ function cs(e) {
3422
3468
  kind: "text",
3423
3469
  text: String(e)
3424
3470
  };
3425
- if (Array.isArray(e)) return ss(e);
3426
- let t = is(e);
3471
+ if (Array.isArray(e)) return us(e);
3472
+ let t = ss(e);
3427
3473
  return t === void 0 || Object.keys(t).length === 0 ? { kind: "empty" } : {
3428
3474
  kind: "rows",
3429
- rows: ls(t)
3475
+ rows: fs(t)
3430
3476
  };
3431
3477
  }
3432
- function ls(e) {
3478
+ function fs(e) {
3433
3479
  return Object.entries(e).map(([e, t]) => ({
3434
3480
  name: e,
3435
- value: cs(t)
3481
+ value: ds(t)
3436
3482
  }));
3437
3483
  }
3438
- function us(e, t) {
3484
+ function ps(e, t) {
3439
3485
  return t || e.length <= 12 ? e : e.slice(0, 12);
3440
3486
  }
3441
- var ds = (e) => Io(e).map((e) => ({ text: e })), fs = (e, t) => Io(e).map((e, n) => ({
3487
+ var ms = (e) => Ro(e).map((e) => ({ text: e })), hs = (e, t) => Ro(e).map((e, n) => ({
3442
3488
  text: e,
3443
3489
  number: t + n
3444
3490
  }));
3445
- function ps(e, t) {
3491
+ function gs(e, t) {
3446
3492
  return t || e.length <= 17 ? e : [
3447
3493
  ...e.slice(0, 12),
3448
3494
  "⋯",
@@ -3451,7 +3497,7 @@ function ps(e, t) {
3451
3497
  }
3452
3498
  //#endregion
3453
3499
  //#region web/src/FoldButton.vue?vue&type=script&setup=true&lang.ts
3454
- var ms = ["aria-expanded"], hs = /* @__PURE__ */ c({
3500
+ var _s = ["aria-expanded"], vs = /* @__PURE__ */ c({
3455
3501
  __name: "FoldButton",
3456
3502
  props: {
3457
3503
  count: {},
@@ -3468,150 +3514,162 @@ var ms = ["aria-expanded"], hs = /* @__PURE__ */ c({
3468
3514
  "aria-expanded": n.open,
3469
3515
  "data-test": "show-all",
3470
3516
  onClick: t[0] ||= (e) => a("toggle")
3471
- }, E(n.open ? D(o).t("kvcoder.ui.call.showFewer") : D(o).t("kvcoder.ui.call.showAll", { count: n.count })), 9, ms)) : r("v-if", !0);
3517
+ }, E(n.open ? D(o).t("kvcoder.ui.call.showFewer") : D(o).t("kvcoder.ui.call.showAll", { count: n.count })), 9, _s)) : r("v-if", !0);
3472
3518
  }
3473
- }), gs = { class: "kvc-code-lines" }, _s = ["dir", "data-kind"], vs = {
3519
+ }), ys = { class: "kvc-code-lines" }, bs = ["dir", "data-kind"], xs = {
3474
3520
  key: 0,
3475
3521
  class: "kvc-line-number",
3476
3522
  "data-test": "call-line-number"
3477
- }, ys = {
3523
+ }, Ss = {
3478
3524
  key: 1,
3479
3525
  class: "kvc-line-mark",
3480
3526
  "aria-hidden": "true"
3481
- }, bs = {
3527
+ }, Cs = {
3482
3528
  class: "kvc-line-text",
3483
3529
  dir: "auto",
3484
3530
  "data-test": "call-line-text"
3485
- }, xs = /* @__PURE__ */ c({
3531
+ }, ws = /* @__PURE__ */ c({
3486
3532
  __name: "FoldedLines",
3487
3533
  props: { lines: {} },
3488
3534
  setup(n) {
3489
- let o = n, c = y(!1), l = t(() => us(o.lines, c.value)), u = t(() => o.lines.some((e) => e.number !== void 0)), d = t(() => o.lines.some((e) => e.kind !== void 0)), f = {
3535
+ let o = n, c = y(!1), l = t(() => ps(o.lines, c.value)), u = t(() => o.lines.some((e) => e.number !== void 0)), d = t(() => o.lines.some((e) => e.kind !== void 0)), f = {
3490
3536
  context: " ",
3491
3537
  removed: "−",
3492
3538
  added: "+"
3493
3539
  };
3494
- return (t, n) => (_(), i("div", gs, [(_(!0), i(e, null, b(l.value, (e, t) => (_(), i("div", {
3540
+ return (t, n) => (_(), i("div", ys, [(_(!0), i(e, null, b(l.value, (e, t) => (_(), i("div", {
3495
3541
  key: t,
3496
3542
  class: "kvc-code-line",
3497
3543
  dir: u.value || d.value ? "ltr" : void 0,
3498
3544
  "data-kind": e.kind,
3499
3545
  "data-test": "call-line-row"
3500
3546
  }, [
3501
- u.value ? (_(), i("span", vs, E(e.number), 1)) : r("v-if", !0),
3502
- d.value ? (_(), i("span", ys, E(f[e.kind ?? "context"]), 1)) : r("v-if", !0),
3503
- a("span", bs, [s(Y, { text: e.text }, null, 8, ["text"])])
3504
- ], 8, _s))), 128)), s(hs, {
3547
+ u.value ? (_(), i("span", xs, E(e.number), 1)) : r("v-if", !0),
3548
+ d.value ? (_(), i("span", Ss, E(f[e.kind ?? "context"]), 1)) : r("v-if", !0),
3549
+ a("span", Cs, [s(Y, { text: e.text }, null, 8, ["text"])])
3550
+ ], 8, bs))), 128)), s(vs, {
3505
3551
  count: o.lines.length,
3506
3552
  open: c.value,
3507
3553
  onToggle: n[0] ||= (e) => c.value = !c.value
3508
3554
  }, null, 8, ["count", "open"])]));
3509
3555
  }
3510
- }), Ss = {
3556
+ }), Ts = {
3511
3557
  key: 0,
3512
3558
  dir: "auto",
3513
3559
  "data-test": "field-text"
3514
- }, Cs = {
3560
+ }, Es = {
3515
3561
  key: 1,
3516
3562
  class: "kvc-muted",
3517
3563
  "data-test": "field-empty"
3518
- }, ws = {
3564
+ }, Ds = {
3519
3565
  key: 3,
3520
3566
  class: "kvc-field-table"
3521
- }, Ts = { "data-test": "field-table" }, Es = {
3567
+ }, Os = { "data-test": "field-table" }, ks = {
3522
3568
  key: 4,
3523
3569
  class: "kvc-field-items",
3524
3570
  "data-test": "field-items"
3525
- }, Ds = {
3571
+ }, As = {
3526
3572
  key: 5,
3527
3573
  class: "kvc-fields",
3528
3574
  "data-test": "call-fields"
3529
- }, Os = ["data-name"], ks = {
3575
+ }, js = ["data-name"], Ms = {
3530
3576
  class: "kvc-muted",
3531
3577
  dir: "ltr"
3532
- }, As = { "data-test": "field-value" }, js = /* @__PURE__ */ c({
3578
+ }, Ns = { "data-test": "field-value" }, Ps = /* @__PURE__ */ c({
3533
3579
  __name: "FieldsView",
3534
3580
  props: { value: {} },
3535
3581
  setup(r) {
3536
- let o = r, c = y(!1), l = t(() => o.value.kind === "table" ? us(o.value.rows, c.value) : []), u = t(() => o.value.kind === "items" ? us(o.value.items, c.value) : []);
3582
+ let o = r, c = y(!1), l = t(() => o.value.kind === "table" ? ps(o.value.rows, c.value) : []), u = t(() => o.value.kind === "items" ? ps(o.value.items, c.value) : []);
3537
3583
  return (t, r) => {
3538
3584
  let d = S("FieldsView", !0);
3539
- return o.value.kind === "text" ? (_(), i("span", Ss, [s(Y, { text: o.value.text }, null, 8, ["text"])])) : o.value.kind === "empty" ? (_(), i("span", Cs, "—")) : o.value.kind === "block" ? (_(), n(xs, {
3585
+ return o.value.kind === "text" ? (_(), i("span", Ts, [s(Y, { text: o.value.text }, null, 8, ["text"])])) : o.value.kind === "empty" ? (_(), i("span", Es, "—")) : o.value.kind === "block" ? (_(), n(ws, {
3540
3586
  key: 2,
3541
3587
  class: "kvc-field-block",
3542
- lines: D(ds)(o.value.text),
3588
+ lines: D(ms)(o.value.text),
3543
3589
  "data-test": "field-block"
3544
- }, null, 8, ["lines"])) : o.value.kind === "table" ? (_(), i("div", ws, [a("table", Ts, [a("thead", null, [a("tr", null, [(_(!0), i(e, null, b(o.value.columns, (e) => (_(), i("th", {
3590
+ }, null, 8, ["lines"])) : o.value.kind === "table" ? (_(), i("div", Ds, [a("table", Os, [a("thead", null, [a("tr", null, [(_(!0), i(e, null, b(o.value.columns, (e) => (_(), i("th", {
3545
3591
  key: e,
3546
3592
  scope: "col",
3547
3593
  dir: "ltr"
3548
3594
  }, E(e), 1))), 128))])]), a("tbody", null, [(_(!0), i(e, null, b(l.value, (t, n) => (_(), i("tr", { key: n }, [(_(!0), i(e, null, b(t, (e, t) => (_(), i("td", {
3549
3595
  key: t,
3550
3596
  dir: "auto"
3551
- }, [s(Y, { text: e }, null, 8, ["text"])]))), 128))]))), 128))])]), s(hs, {
3597
+ }, [s(Y, { text: e }, null, 8, ["text"])]))), 128))]))), 128))])]), s(vs, {
3552
3598
  count: o.value.rows.length,
3553
3599
  open: c.value,
3554
3600
  onToggle: r[0] ||= (e) => c.value = !c.value
3555
- }, null, 8, ["count", "open"])])) : o.value.kind === "items" ? (_(), i("div", Es, [(_(!0), i(e, null, b(u.value, (e, t) => (_(), i("div", {
3601
+ }, null, 8, ["count", "open"])])) : o.value.kind === "items" ? (_(), i("div", ks, [(_(!0), i(e, null, b(u.value, (e, t) => (_(), i("div", {
3556
3602
  key: t,
3557
3603
  dir: "auto"
3558
- }, [s(Y, { text: e }, null, 8, ["text"])]))), 128)), s(hs, {
3604
+ }, [s(Y, { text: e }, null, 8, ["text"])]))), 128)), s(vs, {
3559
3605
  count: o.value.items.length,
3560
3606
  open: c.value,
3561
3607
  onToggle: r[1] ||= (e) => c.value = !c.value
3562
- }, null, 8, ["count", "open"])])) : (_(), i("dl", Ds, [(_(!0), i(e, null, b(o.value.rows, (e) => (_(), i("div", {
3608
+ }, null, 8, ["count", "open"])])) : (_(), i("dl", As, [(_(!0), i(e, null, b(o.value.rows, (e) => (_(), i("div", {
3563
3609
  key: e.name,
3564
3610
  class: "kvc-field-row",
3565
3611
  "data-name": e.name,
3566
3612
  "data-test": "field-row"
3567
- }, [a("dt", ks, E(e.name), 1), a("dd", As, [s(d, { value: e.value }, null, 8, ["value"])])], 8, Os))), 128))]));
3613
+ }, [a("dt", Ms, E(e.name), 1), a("dd", Ns, [s(d, { value: e.value }, null, 8, ["value"])])], 8, js))), 128))]));
3568
3614
  };
3569
3615
  }
3570
- }), Ms = ["aria-label"], Ns = ["aria-label"], Ps = /* @__PURE__ */ c({
3616
+ }), Fs = ["aria-label"], Is = ["aria-label"], Ls = {
3617
+ class: "kvc-mono",
3618
+ dir: "ltr",
3619
+ "data-test": "call-step-tool"
3620
+ }, Rs = { class: "kvc-step-arguments" }, zs = ["aria-label"], Bs = /* @__PURE__ */ c({
3571
3621
  __name: "CallRequest",
3572
3622
  props: { view: {} },
3573
- setup(a) {
3574
- let o = a, c = K(), l = t(() => ha(o.view)), u = t(() => o.view.fields ?? {}), d = t(() => Uo(u.value).map((e) => Ro(e.oldText, e.newText))), f = t(() => typeof u.value.content == "string" ? u.value.content : ""), p = t(() => typeof u.value.task == "string" ? u.value.task : ""), m = t(() => l.value === "mcp-call" ? q(u.value.arguments) : l.value === "fields" ? u.value : {});
3575
- return (t, a) => l.value === "edit" ? (_(!0), i(e, { key: 0 }, b(d.value, (e, t) => (_(), n(xs, {
3623
+ setup(o) {
3624
+ let c = o, l = K(), u = t(() => _a(c.view)), d = t(() => c.view.fields ?? {}), f = t(() => Ko(d.value).map((e) => Bo(e.oldText, e.newText))), p = t(() => typeof d.value.content == "string" ? d.value.content : ""), m = t(() => typeof d.value.task == "string" ? d.value.task : ""), h = t(() => u.value === "mcp-run" ? Ho(d.value) : []), g = t(() => u.value === "mcp-call" ? q(d.value.arguments) : u.value === "fields" ? d.value : {});
3625
+ return (t, o) => u.value === "edit" ? (_(!0), i(e, { key: 0 }, b(f.value, (e, t) => (_(), n(ws, {
3576
3626
  key: t,
3577
3627
  class: "kvc-block",
3578
3628
  lines: e,
3579
3629
  "data-test": "call-diff"
3580
- }, null, 8, ["lines"]))), 128)) : l.value === "write" ? (_(), n(xs, {
3630
+ }, null, 8, ["lines"]))), 128)) : u.value === "write" ? (_(), n(ws, {
3581
3631
  key: 1,
3582
3632
  class: "kvc-block",
3583
- lines: D(fs)(f.value, 1),
3633
+ lines: D(hs)(p.value, 1),
3584
3634
  "data-test": "call-content"
3585
- }, null, 8, ["lines"])) : l.value === "line" ? (_(), i("pre", {
3635
+ }, null, 8, ["lines"])) : u.value === "line" ? (_(), i("pre", {
3586
3636
  key: 2,
3587
3637
  class: "kvc-output kvc-mono",
3588
3638
  dir: "ltr",
3589
- "aria-label": D(c).t("kvcoder.ui.command"),
3639
+ "aria-label": D(l).t("kvcoder.ui.command"),
3590
3640
  "data-test": "call-payload"
3591
- }, "$ " + E(o.view.line), 9, Ms)) : l.value === "delegate" ? (_(), n(xs, {
3641
+ }, "$ " + E(c.view.line), 9, Fs)) : h.value.length > 0 ? (_(), i("ol", {
3592
3642
  key: 3,
3643
+ class: "kvc-block kvc-steps",
3644
+ "aria-label": D(l).t("kvcoder.ui.call.payload"),
3645
+ "data-test": "call-steps"
3646
+ }, [(_(!0), i(e, null, b(h.value, (e, t) => (_(), i("li", {
3647
+ key: t,
3648
+ "data-test": "call-step"
3649
+ }, [a("span", Ls, E(e.label), 1), a("div", Rs, [s(Ps, { value: D(ds)(e.arguments) }, null, 8, ["value"])])]))), 128))], 8, Is)) : u.value === "delegate" ? (_(), n(ws, {
3650
+ key: 4,
3593
3651
  class: "kvc-block kvc-prose-lines",
3594
- lines: D(ds)(p.value),
3595
- "aria-label": D(c).t("kvcoder.ui.call.task"),
3652
+ lines: D(ms)(m.value),
3653
+ "aria-label": D(l).t("kvcoder.ui.call.task"),
3596
3654
  "data-test": "call-task"
3597
- }, null, 8, ["lines", "aria-label"])) : Object.keys(m.value).length > 0 ? (_(), i("div", {
3598
- key: 4,
3655
+ }, null, 8, ["lines", "aria-label"])) : Object.keys(g.value).length > 0 ? (_(), i("div", {
3656
+ key: 5,
3599
3657
  class: "kvc-block",
3600
- "aria-label": D(c).t("kvcoder.ui.call.payload"),
3658
+ "aria-label": D(l).t("kvcoder.ui.call.payload"),
3601
3659
  "data-test": "call-payload-fields"
3602
- }, [s(js, { value: D(cs)(m.value) }, null, 8, ["value"])], 8, Ns)) : r("v-if", !0);
3660
+ }, [s(Ps, { value: D(ds)(g.value) }, null, 8, ["value"])], 8, zs)) : r("v-if", !0);
3603
3661
  }
3604
- }), Fs = { class: "kvc-output-block" }, Is = ["aria-label"], Ls = /* @__PURE__ */ c({
3662
+ }), Vs = { class: "kvc-output-block" }, Hs = ["aria-label"], Us = /* @__PURE__ */ c({
3605
3663
  __name: "FoldedOutput",
3606
3664
  props: { output: {} },
3607
3665
  setup(e) {
3608
- let n = e, r = K(), o = y(!1), c = t(() => n.output.split("\n")), l = t(() => ps(c.value, o.value).join("\n"));
3609
- return (e, t) => (_(), i("div", Fs, [a("pre", {
3666
+ let n = e, r = K(), o = y(!1), c = t(() => n.output.split("\n")), l = t(() => gs(c.value, o.value).join("\n"));
3667
+ return (e, t) => (_(), i("div", Vs, [a("pre", {
3610
3668
  class: "kvc-output",
3611
3669
  dir: "auto",
3612
3670
  "aria-label": D(r).t("kvcoder.ui.output"),
3613
3671
  "data-test": "call-output"
3614
- }, [s(Y, { text: l.value }, null, 8, ["text"])], 8, Is), s(hs, {
3672
+ }, [s(Y, { text: l.value }, null, 8, ["text"])], 8, Hs), s(vs, {
3615
3673
  count: c.value.length,
3616
3674
  open: o.value,
3617
3675
  over: D(12) + D(5),
@@ -3625,7 +3683,7 @@ var ms = ["aria-expanded"], hs = /* @__PURE__ */ c({
3625
3683
  });
3626
3684
  //#endregion
3627
3685
  //#region web/src/durations.ts
3628
- function Rs(e, t) {
3686
+ function Ws(e, t) {
3629
3687
  if (t < 1e3) return e("kvcoder.ui.milliseconds", { count: Math.round(t) });
3630
3688
  if (t < 1e4) return e("kvcoder.ui.seconds", { count: (t / 1e3).toFixed(1) });
3631
3689
  let n = Math.round(t / 1e3);
@@ -3636,21 +3694,21 @@ function Rs(e, t) {
3636
3694
  }
3637
3695
  //#endregion
3638
3696
  //#region web/src/RunOutput.vue?vue&type=script&setup=true&lang.ts
3639
- var zs = {
3697
+ var Gs = {
3640
3698
  class: "kvc-block kvc-run-row",
3641
3699
  "data-test": "run-row"
3642
- }, Bs = {
3700
+ }, Ks = {
3643
3701
  class: "kvc-run-call",
3644
3702
  dir: "auto",
3645
3703
  "data-test": "run-call"
3646
- }, Vs = {
3704
+ }, qs = {
3647
3705
  class: "kvc-chip",
3648
3706
  "data-test": "run-status"
3649
- }, Hs = {
3707
+ }, Js = {
3650
3708
  key: 0,
3651
3709
  class: "kvc-muted",
3652
3710
  "data-test": "run-time"
3653
- }, Us = ["aria-label"], Ws = ["aria-label"], Gs = ["aria-label"], Ks = ["aria-label"], qs = /* @__PURE__ */ c({
3711
+ }, Ys = ["aria-label"], Xs = ["aria-label"], Zs = ["aria-label"], Qs = ["aria-label"], $s = /* @__PURE__ */ c({
3654
3712
  __name: "RunOutput",
3655
3713
  props: { run: {} },
3656
3714
  setup(c) {
@@ -3660,59 +3718,59 @@ var zs = {
3660
3718
  params: { text: f.value ?? "" }
3661
3719
  }));
3662
3720
  return (t, c) => (_(), i(e, null, [
3663
- a("div", zs, [
3664
- a("span", Bs, E(l.run.call), 1),
3665
- a("span", Vs, [o(E(D(Mo)(D(u).t, l.run.status)), 1), l.run.exitCode === void 0 ? r("v-if", !0) : (_(), i(e, { key: 0 }, [o(" · " + E(D(u).t("kvcoder.ui.exitCode", { code: l.run.exitCode })), 1)], 64))]),
3666
- l.run.ranMs === void 0 ? r("v-if", !0) : (_(), i("span", Hs, E(D(Rs)(D(u).t, l.run.ranMs)), 1))
3721
+ a("div", Gs, [
3722
+ a("span", Ks, E(l.run.call), 1),
3723
+ a("span", qs, [o(E(D(Po)(D(u).t, l.run.status)), 1), l.run.exitCode === void 0 ? r("v-if", !0) : (_(), i(e, { key: 0 }, [o(" · " + E(D(u).t("kvcoder.ui.exitCode", { code: l.run.exitCode })), 1)], 64))]),
3724
+ l.run.ranMs === void 0 ? r("v-if", !0) : (_(), i("span", Js, E(D(Ws)(D(u).t, l.run.ranMs)), 1))
3667
3725
  ]),
3668
3726
  p.value === void 0 ? l.run.problem === void 0 ? r("v-if", !0) : (_(), i("div", {
3669
3727
  key: 1,
3670
3728
  class: "kvc-block kvc-error",
3671
3729
  "aria-label": D(u).t("kvcoder.ui.call.error"),
3672
3730
  "data-test": "run-problem"
3673
- }, [s(js, { value: D(cs)(l.run.problem) }, null, 8, ["value"])], 8, Ws)) : (_(), i("pre", {
3731
+ }, [s(Ps, { value: D(ds)(l.run.problem) }, null, 8, ["value"])], 8, Xs)) : (_(), i("pre", {
3674
3732
  key: 0,
3675
3733
  class: "kvc-block kvc-error",
3676
3734
  dir: "auto",
3677
3735
  "aria-label": D(u).t("kvcoder.ui.call.error"),
3678
3736
  "data-test": "run-problem"
3679
- }, [s(Y, { text: p.value }, null, 8, ["text"])], 8, Us)),
3737
+ }, [s(Y, { text: p.value }, null, 8, ["text"])], 8, Ys)),
3680
3738
  f.value === void 0 && l.run.output !== void 0 ? (_(), i("div", {
3681
3739
  key: 2,
3682
3740
  class: "kvc-block",
3683
3741
  "aria-label": D(u).t("kvcoder.ui.output"),
3684
3742
  "data-test": "call-result-fields"
3685
- }, [s(js, { value: D(cs)(l.run.output) }, null, 8, ["value"])], 8, Gs)) : l.run.answer && f.value ? (_(), i("div", {
3743
+ }, [s(Ps, { value: D(ds)(l.run.output) }, null, 8, ["value"])], 8, Zs)) : l.run.answer && f.value ? (_(), i("div", {
3686
3744
  key: 3,
3687
3745
  class: "kvc-block",
3688
3746
  "aria-label": D(u).t("kvcoder.ui.call.answer"),
3689
3747
  "data-test": "call-answer"
3690
- }, [(_(), n(C(D(u).View), { view: m.value }, null, 8, ["view"]))], 8, Ks)) : f.value ? (_(), n(Ls, {
3748
+ }, [(_(), n(C(D(u).View), { view: m.value }, null, 8, ["view"]))], 8, Qs)) : f.value ? (_(), n(Us, {
3691
3749
  key: 4,
3692
3750
  output: f.value
3693
3751
  }, null, 8, ["output"])) : r("v-if", !0)
3694
3752
  ], 64));
3695
3753
  }
3696
- }), Js = {
3754
+ }), ec = {
3697
3755
  key: 0,
3698
3756
  class: "kvc-muted kvc-call-parts",
3699
3757
  "data-test": "call-replacements"
3700
- }, Ys = {
3758
+ }, tc = {
3701
3759
  key: 2,
3702
3760
  class: "kvc-block kvc-entries",
3703
3761
  "data-test": "call-entries"
3704
- }, Xs = ["data-kind"], Zs = {
3762
+ }, nc = ["data-kind"], rc = {
3705
3763
  class: "kvc-mono",
3706
3764
  dir: "auto",
3707
3765
  "data-test": "call-entry-name"
3708
- }, Qs = {
3766
+ }, ic = {
3709
3767
  key: 0,
3710
3768
  class: "kvc-muted",
3711
3769
  "data-test": "call-entry-size"
3712
- }, $s = {
3770
+ }, ac = {
3713
3771
  class: "kvc-mono kvc-file-path",
3714
3772
  "data-test": "call-file-path"
3715
- }, ec = ["aria-label"], tc = ["aria-label"], nc = /* @__PURE__ */ c({
3773
+ }, oc = ["aria-label"], sc = ["aria-label"], cc = /* @__PURE__ */ c({
3716
3774
  __name: "CallResult",
3717
3775
  props: {
3718
3776
  view: {},
@@ -3720,7 +3778,7 @@ var zs = {
3720
3778
  result: {}
3721
3779
  },
3722
3780
  setup(o) {
3723
- let c = o, l = K(), u = t(() => ha(c.view)), d = t(() => u.value === "edit" ? Eo(c.result) : void 0), f = t(() => u.value === "read" ? Do(c.result) : void 0), p = t(() => u.value === "list" ? ko(c.result) : void 0), m = t(() => u.value === "search" ? Po(c.result) : void 0), h = t(() => u.value === "run-output" ? No(c.result) : void 0), g = y(!1), v = t(() => us(p.value ?? [], g.value)), x = t(() => ({
3781
+ let c = o, l = K(), u = t(() => _a(c.view)), d = t(() => u.value === "edit" ? Oo(c.result) : void 0), f = t(() => u.value === "read" ? ko(c.result) : void 0), p = t(() => u.value === "list" ? jo(c.result) : void 0), m = t(() => u.value === "search" ? Io(c.result) : void 0), h = t(() => u.value === "run-output" ? Fo(c.result) : void 0), g = y(!1), v = t(() => ps(p.value ?? [], g.value)), x = t(() => ({
3724
3782
  type: "markdown",
3725
3783
  text: "kvcoder.markdown",
3726
3784
  params: { text: c.output }
@@ -3730,25 +3788,25 @@ var zs = {
3730
3788
  class: "kvc-block",
3731
3789
  "aria-label": D(l).t("kvcoder.ui.call.answer"),
3732
3790
  "data-test": "call-answer"
3733
- }, [(_(), n(C(D(l).View), { view: x.value }, null, 8, ["view"]))], 8, ec)) : S.value ? (_(), i("div", {
3791
+ }, [(_(), n(C(D(l).View), { view: x.value }, null, 8, ["view"]))], 8, oc)) : S.value ? (_(), i("div", {
3734
3792
  key: 7,
3735
3793
  class: "kvc-block",
3736
3794
  "aria-label": D(l).t("kvcoder.ui.output"),
3737
3795
  "data-test": "call-result-fields"
3738
- }, [s(js, { value: D(cs)(c.result) }, null, 8, ["value"])], 8, tc)) : c.output === "" ? r("v-if", !0) : (_(), n(Ls, {
3796
+ }, [s(Ps, { value: D(ds)(c.result) }, null, 8, ["value"])], 8, sc)) : c.output === "" ? r("v-if", !0) : (_(), n(Us, {
3739
3797
  key: 8,
3740
3798
  output: c.output
3741
- }, null, 8, ["output"])) : (_(), n(qs, {
3799
+ }, null, 8, ["output"])) : (_(), n($s, {
3742
3800
  key: 5,
3743
3801
  run: h.value
3744
3802
  }, null, 8, ["run"])) : (_(!0), i(e, { key: 3 }, b(m.value, (e) => (_(), i("div", {
3745
3803
  key: e.path,
3746
3804
  class: "kvc-block",
3747
3805
  "data-test": "call-file"
3748
- }, [a("div", $s, E(e.path), 1), s(xs, { lines: e.matches.map((e) => ({
3806
+ }, [a("div", ac, E(e.path), 1), s(ws, { lines: e.matches.map((e) => ({
3749
3807
  text: e.text,
3750
3808
  number: e.line
3751
- })) }, null, 8, ["lines"])]))), 128)) : (_(), i("div", Ys, [(_(!0), i(e, null, b(v.value, (e) => (_(), i("div", {
3809
+ })) }, null, 8, ["lines"])]))), 128)) : (_(), i("div", tc, [(_(!0), i(e, null, b(v.value, (e) => (_(), i("div", {
3752
3810
  key: e.name,
3753
3811
  class: "kvc-entry",
3754
3812
  "data-kind": e.kind,
@@ -3758,40 +3816,40 @@ var zs = {
3758
3816
  size: 14,
3759
3817
  "aria-hidden": "true"
3760
3818
  })),
3761
- a("span", Zs, E(e.name), 1),
3762
- e.kind === "file" ? (_(), i("span", Qs, E(D(Ho)(D(l).t, e.bytes)), 1)) : r("v-if", !0)
3763
- ], 8, Xs))), 128)), s(hs, {
3819
+ a("span", rc, E(e.name), 1),
3820
+ e.kind === "file" ? (_(), i("span", ic, E(D(Go)(D(l).t, e.bytes)), 1)) : r("v-if", !0)
3821
+ ], 8, nc))), 128)), s(vs, {
3764
3822
  count: p.value.length,
3765
3823
  open: g.value,
3766
3824
  onToggle: o[0] ||= (e) => g.value = !g.value
3767
- }, null, 8, ["count", "open"])])) : (_(), n(xs, {
3825
+ }, null, 8, ["count", "open"])])) : (_(), n(ws, {
3768
3826
  key: 1,
3769
3827
  class: "kvc-block",
3770
- lines: D(fs)(f.value.content, f.value.fromLine),
3828
+ lines: D(hs)(f.value.content, f.value.fromLine),
3771
3829
  "data-test": "call-content"
3772
- }, null, 8, ["lines"])) : (_(), i("p", Js, E(D(l).t("kvcoder.ui.call.replacements", {
3830
+ }, null, 8, ["lines"])) : (_(), i("p", ec, E(D(l).t("kvcoder.ui.call.replacements", {
3773
3831
  count: d.value.replacements,
3774
3832
  line: d.value.firstChangedLine
3775
3833
  })), 1));
3776
3834
  }
3777
- }), rc = {
3835
+ }), lc = {
3778
3836
  key: 0,
3779
3837
  class: "kvc-summary",
3780
3838
  "data-test": "call-summary"
3781
- }, ic = {
3839
+ }, uc = {
3782
3840
  key: 0,
3783
3841
  "data-test": "call-words"
3784
- }, ac = {
3842
+ }, dc = {
3785
3843
  key: 1,
3786
3844
  class: "kvc-mono",
3787
3845
  "data-test": "call-subject"
3788
- }, oc = ["dir"], sc = {
3846
+ }, fc = ["dir"], pc = {
3789
3847
  key: 1,
3790
3848
  class: "kvc-muted",
3791
3849
  dir: "ltr",
3792
3850
  style: { "align-self": "flex-start" },
3793
3851
  "data-test": "call-label"
3794
- }, cc = /* @__PURE__ */ c({
3852
+ }, mc = /* @__PURE__ */ c({
3795
3853
  __name: "CallSummaryLine",
3796
3854
  props: {
3797
3855
  view: {},
@@ -3799,50 +3857,50 @@ var zs = {
3799
3857
  whole: { type: Boolean }
3800
3858
  },
3801
3859
  setup(e) {
3802
- let n = e, a = K(), o = t(() => es(a.t, n.view, n.result)), s = t(() => /\p{L}/u.test(o.value?.outcome ?? "") ? void 0 : "ltr"), c = t(() => o.value?.subject === void 0 || n.whole === !0 ? o.value?.subject : ga(o.value.subject));
3803
- return (e, t) => o.value === void 0 ? n.view.label ? (_(), i("span", sc, E(n.view.label), 1)) : r("v-if", !0) : (_(), i("span", rc, [
3804
- o.value.words ? (_(), i("span", ic, E(o.value.words), 1)) : r("v-if", !0),
3805
- c.value ? (_(), i("span", ac, E(c.value), 1)) : r("v-if", !0),
3860
+ let n = e, a = K(), o = t(() => rs(a.t, n.view, n.result)), s = t(() => /\p{L}/u.test(o.value?.outcome ?? "") ? void 0 : "ltr"), c = t(() => o.value?.subject === void 0 || n.whole === !0 ? o.value?.subject : va(o.value.subject));
3861
+ return (e, t) => o.value === void 0 ? n.view.label ? (_(), i("span", pc, E(n.view.label), 1)) : r("v-if", !0) : (_(), i("span", lc, [
3862
+ o.value.words ? (_(), i("span", uc, E(o.value.words), 1)) : r("v-if", !0),
3863
+ c.value ? (_(), i("span", dc, E(c.value), 1)) : r("v-if", !0),
3806
3864
  o.value.outcome ? (_(), i("span", {
3807
3865
  key: 2,
3808
3866
  class: "kvc-muted",
3809
3867
  dir: s.value,
3810
3868
  "data-test": "call-outcome"
3811
- }, E(o.value.outcome), 9, oc)) : r("v-if", !0)
3869
+ }, E(o.value.outcome), 9, fc)) : r("v-if", !0)
3812
3870
  ]));
3813
3871
  }
3814
- }), lc = ["aria-expanded", "disabled"], uc = ["aria-label"], dc = { class: "kvc-lines" }, fc = {
3872
+ }), hc = ["aria-expanded", "disabled"], gc = ["aria-label"], _c = { class: "kvc-lines" }, vc = {
3815
3873
  key: 0,
3816
3874
  style: { "font-weight": "600" },
3817
3875
  "data-test": "call-description"
3818
- }, pc = {
3876
+ }, yc = {
3819
3877
  key: 1,
3820
3878
  class: "kvc-oneline",
3821
3879
  "data-test": "call-line"
3822
- }, mc = { class: "kvc-mono" }, hc = {
3880
+ }, bc = { class: "kvc-mono" }, xc = {
3823
3881
  key: 2,
3824
3882
  class: "kvc-chip kvc-warn",
3825
3883
  "data-test": "call-risky"
3826
- }, gc = {
3884
+ }, Sc = {
3827
3885
  key: 3,
3828
3886
  class: "kvc-chip",
3829
3887
  "data-test": "call-background"
3830
- }, _c = {
3888
+ }, Cc = {
3831
3889
  key: 4,
3832
3890
  class: "kvc-chip",
3833
3891
  "data-test": "call-not-run"
3834
- }, vc = {
3892
+ }, wc = {
3835
3893
  key: 5,
3836
3894
  class: "kvc-chip kvc-danger",
3837
3895
  "data-test": "call-failed"
3838
- }, yc = {
3896
+ }, Tc = {
3839
3897
  class: "kvc-muted",
3840
3898
  "data-test": "call-time"
3841
- }, bc = {
3899
+ }, Ec = {
3842
3900
  key: 0,
3843
3901
  class: "kvc-muted kvc-call-parts",
3844
3902
  "data-test": "call-parts"
3845
- }, xc = ["aria-expanded"], Sc = ["aria-label"], Cc = /* @__PURE__ */ c({
3903
+ }, Dc = ["aria-expanded"], Oc = ["aria-label"], kc = /* @__PURE__ */ c({
3846
3904
  __name: "CallCard",
3847
3905
  props: {
3848
3906
  view: {},
@@ -3852,14 +3910,14 @@ var zs = {
3852
3910
  running: { type: Boolean }
3853
3911
  },
3854
3912
  setup(o) {
3855
- let c = o, l = K(), u = t(() => ha(c.view)), d = y(c.output !== void 0 && c.failed !== !0 && (u.value === "edit" || u.value === "write")), p = y(!1), m = t(() => c.failed === !0 && c.output !== void 0 ? To(c.output) : void 0), h = t(() => m.value?.kind === "invalid"), g = t(() => {
3913
+ let c = o, l = K(), u = t(() => _a(c.view)), d = y(c.output !== void 0 && c.failed !== !0 && (u.value === "edit" || u.value === "write")), p = y(!1), m = t(() => c.failed === !0 && c.output !== void 0 ? Do(c.output) : void 0), h = t(() => m.value?.kind === "invalid"), g = t(() => {
3856
3914
  let e = m.value;
3857
3915
  return e === void 0 ? "" : e.kind === "error" ? e.message : l.t(`kvcoder.ui.failure.${e.kind}`);
3858
- }), v = t(() => c.failed === !0 ? void 0 : Bo(c.output)), b = t(() => c.failed === !0 && u.value !== "line"), x = t(() => c.durationMs === void 0 ? "" : Rs(l.t, (c.view.writtenMs ?? 0) + c.durationMs)), S = t(() => {
3916
+ }), v = t(() => c.failed === !0 ? void 0 : Uo(c.output)), b = t(() => c.failed === !0 && u.value !== "line"), x = t(() => c.durationMs === void 0 ? "" : Ws(l.t, (c.view.writtenMs ?? 0) + c.durationMs)), S = t(() => {
3859
3917
  if (c.durationMs === void 0) return "";
3860
- let e = Rs(l.t, c.durationMs);
3918
+ let e = Ws(l.t, c.durationMs);
3861
3919
  return c.view.writtenMs === void 0 ? l.t("kvcoder.ui.callRan", { ran: e }) : l.t("kvcoder.ui.callParts", {
3862
- written: Rs(l.t, c.view.writtenMs),
3920
+ written: Ws(l.t, c.view.writtenMs),
3863
3921
  ran: e
3864
3922
  });
3865
3923
  });
@@ -3881,14 +3939,14 @@ var zs = {
3881
3939
  key: 0,
3882
3940
  class: "kvc-spin",
3883
3941
  "aria-label": D(l).t("kvcoder.ui.running")
3884
- }, null, 8, uc)) : (_(), n(C(d.value ? D(U) : D(le)), {
3942
+ }, null, 8, gc)) : (_(), n(C(d.value ? D(le) : D(U)), {
3885
3943
  key: 1,
3886
3944
  size: 16,
3887
3945
  "aria-hidden": "true"
3888
3946
  })),
3889
- a("span", dc, [
3890
- c.view.description ? (_(), i("span", fc, E(c.view.description), 1)) : c.view.connector === void 0 && c.view.line ? (_(), i("span", pc, [a("span", mc, E(D(ga)(c.view.line)), 1)])) : r("v-if", !0),
3891
- s(cc, {
3947
+ a("span", _c, [
3948
+ c.view.description ? (_(), i("span", vc, E(c.view.description), 1)) : c.view.connector === void 0 && c.view.line ? (_(), i("span", yc, [a("span", bc, E(D(va)(c.view.line)), 1)])) : r("v-if", !0),
3949
+ s(mc, {
3892
3950
  view: c.view,
3893
3951
  result: v.value
3894
3952
  }, null, 8, ["view", "result"]),
@@ -3899,22 +3957,22 @@ var zs = {
3899
3957
  "data-test": "call-reason"
3900
3958
  }, E(g.value), 3))
3901
3959
  ]),
3902
- c.view.risky ? (_(), i("span", hc, E(D(l).t("kvcoder.ui.call.risky")), 1)) : r("v-if", !0),
3903
- c.view.background ? (_(), i("span", gc, E(D(l).t("kvcoder.ui.jobs.background")), 1)) : r("v-if", !0),
3904
- h.value ? (_(), i("span", _c, E(D(l).t("kvcoder.ui.callNotRun")), 1)) : c.failed ? (_(), i("span", vc, E(D(l).t("kvcoder.ui.callFailed")), 1)) : r("v-if", !0),
3905
- a("span", yc, E(x.value), 1)
3906
- ], 8, lc), d.value && c.output !== void 0 ? (_(), i(e, { key: 0 }, [S.value === "" ? r("v-if", !0) : (_(), i("p", bc, E(S.value), 1)), b.value ? (_(), i(e, { key: 1 }, [a("button", {
3960
+ c.view.risky ? (_(), i("span", xc, E(D(l).t("kvcoder.ui.call.risky")), 1)) : r("v-if", !0),
3961
+ c.view.background ? (_(), i("span", Sc, E(D(l).t("kvcoder.ui.jobs.background")), 1)) : r("v-if", !0),
3962
+ h.value ? (_(), i("span", Cc, E(D(l).t("kvcoder.ui.callNotRun")), 1)) : c.failed ? (_(), i("span", wc, E(D(l).t("kvcoder.ui.callFailed")), 1)) : r("v-if", !0),
3963
+ a("span", Tc, E(x.value), 1)
3964
+ ], 8, hc), d.value && c.output !== void 0 ? (_(), i(e, { key: 0 }, [S.value === "" ? r("v-if", !0) : (_(), i("p", Ec, E(S.value), 1)), b.value ? (_(), i(e, { key: 1 }, [a("button", {
3907
3965
  type: "button",
3908
3966
  class: "kvc-text-button kvc-fold",
3909
3967
  "aria-expanded": p.value,
3910
3968
  "data-test": "call-details",
3911
3969
  onClick: o[1] ||= (e) => p.value = !p.value
3912
- }, E(D(l).t(p.value ? "kvcoder.ui.call.hideDetails" : "kvcoder.ui.call.showDetails")), 9, xc), p.value ? (_(), i(e, { key: 0 }, [a("pre", {
3970
+ }, E(D(l).t(p.value ? "kvcoder.ui.call.hideDetails" : "kvcoder.ui.call.showDetails")), 9, Dc), p.value ? (_(), i(e, { key: 0 }, [a("pre", {
3913
3971
  class: "kvc-block kvc-error",
3914
3972
  dir: "auto",
3915
3973
  "aria-label": D(l).t("kvcoder.ui.call.error"),
3916
3974
  "data-test": "call-error"
3917
- }, [s(Y, { text: c.output }, null, 8, ["text"])], 8, Sc), s(Ps, { view: c.view }, null, 8, ["view"])], 64)) : r("v-if", !0)], 64)) : (_(), i(e, { key: 2 }, [s(Ps, { view: c.view }, null, 8, ["view"]), s(nc, {
3975
+ }, [s(Y, { text: c.output }, null, 8, ["text"])], 8, Oc), s(Bs, { view: c.view }, null, 8, ["view"])], 64)) : r("v-if", !0)], 64)) : (_(), i(e, { key: 2 }, [s(Bs, { view: c.view }, null, 8, ["view"]), s(cc, {
3918
3976
  view: c.view,
3919
3977
  output: c.output,
3920
3978
  result: v.value
@@ -3924,63 +3982,63 @@ var zs = {
3924
3982
  "result"
3925
3983
  ])], 64))], 64)) : r("v-if", !0)], 2));
3926
3984
  }
3927
- }), wc = {
3985
+ }), Ac = {
3928
3986
  key: 0,
3929
3987
  class: "kvc-card",
3930
3988
  "data-test": "background-result"
3931
- }, Tc = { class: "kvc-card-row" }, Ec = {
3989
+ }, jc = { class: "kvc-card-row" }, Mc = {
3932
3990
  style: {
3933
3991
  flex: "1 1 auto",
3934
3992
  "min-inline-size": "0"
3935
3993
  },
3936
3994
  "data-test": "background-title"
3937
- }, Dc = {
3995
+ }, Nc = {
3938
3996
  key: 0,
3939
3997
  class: "kvc-muted",
3940
3998
  "data-test": "background-time"
3941
- }, Oc = { class: "kvc-output" }, kc = {
3999
+ }, Pc = { class: "kvc-output" }, Fc = {
3942
4000
  key: 1,
3943
4001
  class: "kvc-card",
3944
4002
  "data-test": "kvcoder-hint"
3945
- }, Ac = { class: "kvc-card-row" }, jc = { class: "kvc-card-body kvc-muted" }, Mc = {
4003
+ }, Ic = { class: "kvc-card-row" }, Lc = { class: "kvc-card-body kvc-muted" }, Rc = {
3946
4004
  key: 0,
3947
4005
  style: {
3948
4006
  display: "flex",
3949
4007
  gap: "6px",
3950
4008
  "margin-block-start": "6px"
3951
4009
  }
3952
- }, Nc = ["src", "alt"], Pc = {
4010
+ }, zc = ["src", "alt"], Bc = {
3953
4011
  key: 1,
3954
4012
  class: "kvc-muted",
3955
4013
  style: { display: "block" },
3956
4014
  "data-test": "queued"
3957
- }, Fc = {
4015
+ }, Vc = {
3958
4016
  key: 3,
3959
4017
  class: "kvc-answer",
3960
4018
  "data-test": "assistant-message"
3961
- }, Ic = {
4019
+ }, Hc = {
3962
4020
  key: 0,
3963
4021
  "data-test": "thinking"
3964
- }, Lc = { class: "kvc-muted" }, Rc = {
4022
+ }, Uc = { class: "kvc-muted" }, Wc = {
3965
4023
  class: "kvc-muted",
3966
4024
  style: { "white-space": "pre-wrap" }
3967
- }, zc = {
4025
+ }, Gc = {
3968
4026
  key: 6,
3969
4027
  "data-test": "extension-card"
3970
- }, Bc = {
4028
+ }, Kc = {
3971
4029
  key: 8,
3972
4030
  class: "kvc-notice",
3973
4031
  "data-test": "notice"
3974
- }, Vc = {
4032
+ }, qc = {
3975
4033
  key: 9,
3976
4034
  class: "kvc-card kvc-card-row",
3977
4035
  role: "note",
3978
4036
  "data-test": "note"
3979
- }, Hc = {
4037
+ }, Jc = {
3980
4038
  key: 10,
3981
4039
  class: "kvc-card",
3982
4040
  "data-test": "summary"
3983
- }, Uc = { class: "kvc-card-row" }, Wc = { class: "kvc-card-body" }, Gc = /* @__PURE__ */ c({
4041
+ }, Yc = { class: "kvc-card-row" }, Xc = { class: "kvc-card-body" }, Zc = /* @__PURE__ */ c({
3984
4042
  __name: "MessageItem",
3985
4043
  props: {
3986
4044
  message: {},
@@ -3989,13 +4047,13 @@ var zs = {
3989
4047
  },
3990
4048
  emits: ["openArtifact"],
3991
4049
  setup(c, { emit: l }) {
3992
- let u = c, d = l, p = K(), m = t(() => Ma(u.message.content.content)), h = t(() => Na(u.message)), g = t(() => Ia(u.message, u.calls)), v = t(() => Ha(u.message)), y = t(() => Wa(u.message)), x = t(() => Xa(u.message)), S = t(() => {
3993
- let e = u.message.source?.kind === "subagent" ? "kvcoder.ui.helperFinished" : "kvcoder.ui.backgroundFinished", t = (u.message.source?.kind === "subagent" ? u.finishedRuns?.get(u.message.source.sessionId)?.title : void 0) ?? Ya(u.message);
4050
+ let u = c, d = l, p = K(), m = t(() => Pa(u.message.content.content)), h = t(() => Fa(u.message)), g = t(() => Ra(u.message, u.calls)), v = t(() => Wa(u.message)), y = t(() => Ka(u.message)), x = t(() => Qa(u.message)), S = t(() => {
4051
+ let e = u.message.source?.kind === "subagent" ? "kvcoder.ui.helperFinished" : "kvcoder.ui.backgroundFinished", t = (u.message.source?.kind === "subagent" ? u.finishedRuns?.get(u.message.source.sessionId)?.title : void 0) ?? Za(u.message);
3994
4052
  return t === void 0 ? p.t(e) : p.t(`${e}Named`, { name: rt(t) });
3995
4053
  }), w = t(() => {
3996
- let e = u.finishedRuns?.get(qa(u.message) ?? "");
3997
- return e === void 0 ? void 0 : Rs(p.t, e.ranMs);
3998
- }), T = t(() => za(u.message, u.calls)), O = t(() => {
4054
+ let e = u.finishedRuns?.get(Ya(u.message) ?? "");
4055
+ return e === void 0 ? void 0 : Ws(p.t, e.ranMs);
4056
+ }), T = t(() => Va(u.message, u.calls)), O = t(() => {
3999
4057
  let e = q(u.message.content.params), t = typeof e.code == "string" ? e.code : void 0, n = Object.fromEntries(Object.entries(Ye(e.details)).map(([e, t]) => [e, rt(t)])), r = t === void 0 ? {} : { error: p.t(Ke(t), n) }, i = $e(e.details), a = String(u.message.content.code);
4000
4058
  return p.t(`kvcoder.notices.${i === void 0 || a !== "STEP_FAILED" ? a : "STEP_FAILED_REASON"}`, {
4001
4059
  ...e,
@@ -4010,24 +4068,24 @@ var zs = {
4010
4068
  text: "kvcoder.markdown",
4011
4069
  params: { text: e }
4012
4070
  });
4013
- return (t, c) => D(Va)(u.message) ? (_(), i("div", wc, [a("details", null, [a("summary", Tc, [
4071
+ return (t, c) => D(Ua)(u.message) ? (_(), i("div", Ac, [a("details", null, [a("summary", jc, [
4014
4072
  s(D(oe), {
4015
4073
  size: 16,
4016
4074
  "aria-hidden": "true"
4017
4075
  }),
4018
- a("span", Ec, E(S.value), 1),
4019
- w.value === void 0 ? r("v-if", !0) : (_(), i("span", Dc, E(w.value), 1))
4020
- ]), a("pre", Oc, E(m.value), 1)])])) : D(Ba)(u.message) ? (_(), i("div", kc, [a("details", null, [a("summary", Ac, [s(D(xe), {
4076
+ a("span", Mc, E(S.value), 1),
4077
+ w.value === void 0 ? r("v-if", !0) : (_(), i("span", Nc, E(w.value), 1))
4078
+ ]), a("pre", Pc, E(m.value), 1)])])) : D(Ha)(u.message) ? (_(), i("div", Fc, [a("details", null, [a("summary", Ic, [s(D(xe), {
4021
4079
  size: 16,
4022
4080
  "aria-hidden": "true"
4023
- }), o(E(D(p).t("kvcoder.ui.toModel")), 1)]), a("div", jc, E(m.value), 1)])])) : u.message.kind === "user" ? (_(), i("div", {
4081
+ }), o(E(D(p).t("kvcoder.ui.toModel")), 1)]), a("div", Lc, E(m.value), 1)])])) : u.message.kind === "user" ? (_(), i("div", {
4024
4082
  key: 2,
4025
4083
  dir: "auto",
4026
4084
  class: f(["kvc-user", { "kvc-queued": u.message.queued }]),
4027
4085
  "data-test": "user-message"
4028
4086
  }, [
4029
- a("span", null, E(D(Ka)(m.value, D(p).t("kvcoder.ui.attachedFiles"))), 1),
4030
- u.message.fileIds ? (_(), i("span", Mc, [(_(!0), i(e, null, b(u.message.fileIds, (e) => (_(), i("img", {
4087
+ a("span", null, E(D(Ja)(m.value, D(p).t("kvcoder.ui.attachedFiles"))), 1),
4088
+ u.message.fileIds ? (_(), i("span", Rc, [(_(!0), i(e, null, b(u.message.fileIds, (e) => (_(), i("img", {
4031
4089
  key: e,
4032
4090
  src: A(e),
4033
4091
  alt: D(p).t("kvcoder.ui.attachment"),
@@ -4035,12 +4093,12 @@ var zs = {
4035
4093
  "block-size": "48px",
4036
4094
  "border-radius": "6px"
4037
4095
  }
4038
- }, null, 8, Nc))), 128))])) : r("v-if", !0),
4039
- u.message.queued ? (_(), i("span", Pc, E(D(p).t("kvcoder.ui.queued")), 1)) : r("v-if", !0)
4040
- ], 2)) : u.message.kind === "assistant" && (h.value !== "" || m.value !== "") ? (_(), i("div", Fc, [h.value === "" ? r("v-if", !0) : (_(), i("details", Ic, [a("summary", Lc, E(D(p).t("kvcoder.ui.thought")), 1), a("p", Rc, E(h.value), 1)])), m.value === "" ? r("v-if", !0) : (_(), n(C(D(p).View), {
4096
+ }, null, 8, zc))), 128))])) : r("v-if", !0),
4097
+ u.message.queued ? (_(), i("span", Bc, E(D(p).t("kvcoder.ui.queued")), 1)) : r("v-if", !0)
4098
+ ], 2)) : u.message.kind === "assistant" && (h.value !== "" || m.value !== "") ? (_(), i("div", Vc, [h.value === "" ? r("v-if", !0) : (_(), i("details", Hc, [a("summary", Uc, E(D(p).t("kvcoder.ui.thought")), 1), a("p", Wc, E(h.value), 1)])), m.value === "" ? r("v-if", !0) : (_(), n(C(D(p).View), {
4041
4099
  key: 1,
4042
4100
  view: j(m.value)
4043
- }, null, 8, ["view"]))])) : u.message.kind === "toolResult" && v.value !== void 0 ? (_(), n(xo, {
4101
+ }, null, 8, ["view"]))])) : u.message.kind === "toolResult" && v.value !== void 0 ? (_(), n(Co, {
4044
4102
  key: 4,
4045
4103
  id: v.value.id,
4046
4104
  title: v.value.title,
@@ -4052,7 +4110,7 @@ var zs = {
4052
4110
  "title",
4053
4111
  "format",
4054
4112
  "version"
4055
- ])) : T.value === void 0 ? y.value === void 0 ? u.message.kind === "toolResult" ? (_(), i(e, { key: 7 }, [s(Cc, {
4113
+ ])) : T.value === void 0 ? y.value === void 0 ? u.message.kind === "toolResult" ? (_(), i(e, { key: 7 }, [s(kc, {
4056
4114
  view: g.value,
4057
4115
  failed: g.value.failed,
4058
4116
  "duration-ms": g.value.durationMs,
@@ -4062,53 +4120,53 @@ var zs = {
4062
4120
  "failed",
4063
4121
  "duration-ms",
4064
4122
  "output"
4065
- ]), x.value === void 0 ? r("v-if", !0) : (_(), n(Ci, {
4123
+ ]), x.value === void 0 ? r("v-if", !0) : (_(), n(Ti, {
4066
4124
  key: 0,
4067
4125
  "session-id": u.message.sessionId,
4068
4126
  "run-id": x.value
4069
- }, null, 8, ["session-id", "run-id"]))], 64)) : u.message.kind === "notice" ? (_(), i("div", Bc, E(O.value), 1)) : u.message.kind === "note" ? (_(), i("div", Vc, [s(D(Se), {
4127
+ }, null, 8, ["session-id", "run-id"]))], 64)) : u.message.kind === "notice" ? (_(), i("div", Kc, E(O.value), 1)) : u.message.kind === "note" ? (_(), i("div", qc, [s(D(Se), {
4070
4128
  size: 18,
4071
4129
  "aria-hidden": "true"
4072
- }), o(E(k.value), 1)])) : u.message.kind === "summary" ? (_(), i("details", Hc, [a("summary", Uc, [s(D(Ee), {
4130
+ }), o(E(k.value), 1)])) : u.message.kind === "summary" ? (_(), i("details", Jc, [a("summary", Yc, [s(D(Ee), {
4073
4131
  size: 16,
4074
4132
  "aria-hidden": "true"
4075
- }), o(E(D(p).t("kvcoder.ui.summarized")), 1)]), a("div", Wc, [(_(), n(C(D(p).View), { view: j(String(u.message.content.text ?? "")) }, null, 8, ["view"]))])])) : r("v-if", !0) : (_(), i("div", zc, [(_(), n(C(D(p).View), { view: {
4133
+ }), o(E(D(p).t("kvcoder.ui.summarized")), 1)]), a("div", Xc, [(_(), n(C(D(p).View), { view: j(String(u.message.content.text ?? "")) }, null, 8, ["view"]))])])) : r("v-if", !0) : (_(), i("div", Gc, [(_(), n(C(D(p).View), { view: {
4076
4134
  type: "custom",
4077
4135
  component: y.value.component,
4078
4136
  props: y.value.props
4079
- } }, null, 8, ["view"]))])) : (_(), n(go, {
4137
+ } }, null, 8, ["view"]))])) : (_(), n(vo, {
4080
4138
  key: 5,
4081
4139
  answered: T.value
4082
4140
  }, null, 8, ["answered"]));
4083
4141
  }
4084
- }), Kc = {
4142
+ }), Qc = {
4085
4143
  class: "kvc-card kvc-ask",
4086
4144
  "data-test": "approvals-card"
4087
- }, qc = {
4145
+ }, $c = {
4088
4146
  class: "kvc-card-row",
4089
4147
  style: { "font-weight": "600" }
4090
- }, Jc = ["data-test"], Yc = { class: "kvc-card-row" }, Xc = { class: "kvc-lines" }, Zc = {
4148
+ }, el = ["data-test"], tl = { class: "kvc-card-row" }, nl = { class: "kvc-lines" }, rl = {
4091
4149
  key: 0,
4092
4150
  style: { "font-weight": "600" },
4093
4151
  "data-test": "call-description"
4094
- }, Qc = {
4152
+ }, il = {
4095
4153
  key: 2,
4096
4154
  dir: "ltr",
4097
4155
  style: { "align-self": "flex-start" },
4098
4156
  "data-test": "call-subject"
4099
- }, $c = {
4157
+ }, al = {
4100
4158
  key: 3,
4101
4159
  class: "kvc-chip",
4102
4160
  style: { "align-self": "flex-start" },
4103
4161
  "data-test": "call-background"
4104
- }, el = {
4162
+ }, ol = {
4105
4163
  class: "kvc-card-row kvc-actions",
4106
4164
  "data-test": "decision-actions"
4107
- }, tl = ["onClick"], nl = ["onClick"], rl = {
4165
+ }, sl = ["onClick"], cl = ["onClick"], ll = {
4108
4166
  key: 0,
4109
4167
  class: "kvc-card-row kvc-actions",
4110
4168
  style: { "border-block-start": "1px solid var(--kv-color-border)" }
4111
- }, il = /* @__PURE__ */ c({
4169
+ }, ul = /* @__PURE__ */ c({
4112
4170
  __name: "ApprovalsCard",
4113
4171
  props: { approvals: {} },
4114
4172
  emits: ["decide"],
@@ -4117,8 +4175,8 @@ var zs = {
4117
4175
  approvals: [...e],
4118
4176
  confirmed: t
4119
4177
  });
4120
- return (t, c) => (_(), i("section", Kc, [
4121
- a("div", qc, [s(D(Oe), {
4178
+ return (t, c) => (_(), i("section", Qc, [
4179
+ a("div", $c, [s(D(Oe), {
4122
4180
  size: 18,
4123
4181
  "aria-hidden": "true"
4124
4182
  }), o(E(D(d).t("kvcoder.ui.allowCommands", { count: l.approvals.length })), 1)]),
@@ -4127,32 +4185,32 @@ var zs = {
4127
4185
  class: "kvc-approval",
4128
4186
  "data-test": `approval-${e.questionId}`
4129
4187
  }, [
4130
- a("div", Yc, [a("span", Xc, [
4131
- e.view.description ? (_(), i("span", Zc, E(e.view.description), 1)) : r("v-if", !0),
4132
- e.view.connector === void 0 ? e.view.line ? (_(), i("span", Qc, [a("span", { class: f(["kvc-mono", { "kvc-muted": e.view.description }]) }, E(e.view.line), 3)])) : r("v-if", !0) : (_(), n(cc, {
4188
+ a("div", tl, [a("span", nl, [
4189
+ e.view.description ? (_(), i("span", rl, E(e.view.description), 1)) : r("v-if", !0),
4190
+ e.view.connector === void 0 ? e.view.line ? (_(), i("span", il, [a("span", { class: f(["kvc-mono", { "kvc-muted": e.view.description }]) }, E(e.view.line), 3)])) : r("v-if", !0) : (_(), n(mc, {
4133
4191
  key: 1,
4134
4192
  view: e.view,
4135
4193
  whole: ""
4136
4194
  }, null, 8, ["view"])),
4137
- e.view.background ? (_(), i("span", $c, E(D(d).t("kvcoder.ui.jobs.inBackground")), 1)) : r("v-if", !0)
4195
+ e.view.background ? (_(), i("span", al, E(D(d).t("kvcoder.ui.jobs.inBackground")), 1)) : r("v-if", !0)
4138
4196
  ])]),
4139
- D(ha)(e.view) === "line" ? r("v-if", !0) : (_(), n(Ps, {
4197
+ D(_a)(e.view) === "line" ? r("v-if", !0) : (_(), n(Bs, {
4140
4198
  key: 0,
4141
4199
  view: e.view
4142
4200
  }, null, 8, ["view"])),
4143
- a("div", el, [a("button", {
4201
+ a("div", ol, [a("button", {
4144
4202
  type: "button",
4145
4203
  class: "kvc-button",
4146
4204
  "data-test": "deny",
4147
4205
  onClick: (t) => p([e], !1)
4148
- }, E(D(d).t("kvcoder.ui.deny")), 9, tl), a("button", {
4206
+ }, E(D(d).t("kvcoder.ui.deny")), 9, sl), a("button", {
4149
4207
  type: "button",
4150
4208
  class: "kvc-button kvc-primary",
4151
4209
  "data-test": "allow",
4152
4210
  onClick: (t) => p([e], !0)
4153
- }, E(D(d).t("kvcoder.ui.allow")), 9, nl)])
4154
- ], 8, Jc))), 128)),
4155
- l.approvals.length > 1 ? (_(), i("div", rl, [a("button", {
4211
+ }, E(D(d).t("kvcoder.ui.allow")), 9, cl)])
4212
+ ], 8, el))), 128)),
4213
+ l.approvals.length > 1 ? (_(), i("div", ll, [a("button", {
4156
4214
  type: "button",
4157
4215
  class: "kvc-button",
4158
4216
  "data-test": "deny-all",
@@ -4165,13 +4223,13 @@ var zs = {
4165
4223
  }, E(D(d).t("kvcoder.ui.allowAll")), 1)])) : r("v-if", !0)
4166
4224
  ]));
4167
4225
  }
4168
- }), al = /* @__PURE__ */ new Map();
4169
- function ol(e) {
4170
- let t = al.get(e);
4171
- return t === void 0 && (t = v(/* @__PURE__ */ new Map()), al.set(e, t)), t;
4226
+ }), dl = /* @__PURE__ */ new Map();
4227
+ function fl(e) {
4228
+ let t = dl.get(e);
4229
+ return t === void 0 && (t = v(/* @__PURE__ */ new Map()), dl.set(e, t)), t;
4172
4230
  }
4173
- function sl(e, t, n) {
4174
- let r = ol(e), i = r.get(t);
4231
+ function pl(e, t, n) {
4232
+ let r = fl(e), i = r.get(t);
4175
4233
  return i === void 0 ? (i = v({
4176
4234
  text: "",
4177
4235
  selected: [],
@@ -4182,55 +4240,55 @@ function sl(e, t, n) {
4182
4240
  owner: n
4183
4241
  }), r.set(t, i)) : n !== void 0 && i.owner === void 0 && (i.owner = n), i;
4184
4242
  }
4185
- var cl = (e, t, n) => ol(e).get(t) === n, ll = (e) => new Set([...ol(e)].filter(([, e]) => e.settled).map(([e]) => e));
4186
- function ul(e) {
4243
+ var ml = (e, t, n) => fl(e).get(t) === n, hl = (e) => new Set([...fl(e)].filter(([, e]) => e.settled).map(([e]) => e));
4244
+ function gl(e) {
4187
4245
  e.text = "", e.selected = [], e.other = "", e.error = void 0, e.sending = !1, e.settled = !0;
4188
4246
  }
4189
- function dl(e, t, n) {
4190
- let r = ol(e);
4247
+ function _l(e, t, n) {
4248
+ let r = fl(e);
4191
4249
  for (let [e, i] of r) {
4192
4250
  if (i.owner?.sessionId !== t) continue;
4193
4251
  let a = n.find((e) => e.id === i.owner?.turnId && e.sessionId === t);
4194
- a !== void 0 && (a.outcome === void 0 && a.endedAt === void 0 && a.pending.some((t) => t.questionId === e) || (ul(i), r.delete(e)));
4252
+ a !== void 0 && (a.outcome === void 0 && a.endedAt === void 0 && a.pending.some((t) => t.questionId === e) || (gl(i), r.delete(e)));
4195
4253
  }
4196
4254
  }
4197
4255
  //#endregion
4198
4256
  //#region web/src/QuestionCard.vue?vue&type=script&setup=true&lang.ts
4199
- var fl = ["aria-label", "aria-busy"], pl = {
4257
+ var vl = ["aria-label", "aria-busy"], yl = {
4200
4258
  class: "kvc-card-row",
4201
4259
  style: { "font-weight": "600" }
4202
- }, ml = { dir: "auto" }, hl = { class: "kvc-card-body" }, gl = {
4260
+ }, bl = { dir: "auto" }, xl = { class: "kvc-card-body" }, Sl = {
4203
4261
  key: 0,
4204
4262
  role: "status",
4205
4263
  "data-test": "answer-sending"
4206
- }, _l = {
4264
+ }, Cl = {
4207
4265
  key: 1,
4208
4266
  role: "alert",
4209
4267
  "data-test": "answer-error"
4210
- }, vl = [
4268
+ }, wl = [
4211
4269
  "disabled",
4212
4270
  "placeholder",
4213
4271
  "aria-label"
4214
- ], yl = { class: "kvc-actions" }, bl = ["disabled"], xl = ["disabled"], Sl = ["data-test"], Cl = [
4272
+ ], Tl = { class: "kvc-actions" }, El = ["disabled"], Dl = ["disabled"], Ol = ["data-test"], kl = [
4215
4273
  "type",
4216
4274
  "checked",
4217
4275
  "disabled",
4218
4276
  "name",
4219
4277
  "onChange"
4220
- ], wl = { style: {
4278
+ ], Al = { style: {
4221
4279
  display: "flex",
4222
4280
  "flex-direction": "column"
4223
- } }, Tl = { style: { "font-weight": "500" } }, El = {
4281
+ } }, jl = { style: { "font-weight": "500" } }, Ml = {
4224
4282
  key: 0,
4225
4283
  class: "kvc-muted"
4226
- }, Dl = [
4284
+ }, Nl = [
4227
4285
  "disabled",
4228
4286
  "placeholder",
4229
4287
  "aria-label"
4230
- ], Ol = { class: "kvc-actions" }, kl = ["disabled"], Al = ["disabled"], jl = {
4288
+ ], Pl = { class: "kvc-actions" }, Fl = ["disabled"], Il = ["disabled"], Ll = {
4231
4289
  key: 4,
4232
4290
  class: "kvc-actions"
4233
- }, Ml = ["disabled"], Nl = ["disabled"], Pl = /* @__PURE__ */ c({
4291
+ }, Rl = ["disabled"], zl = ["disabled"], Bl = /* @__PURE__ */ c({
4234
4292
  __name: "QuestionCard",
4235
4293
  props: {
4236
4294
  questionId: {},
@@ -4239,7 +4297,7 @@ var fl = ["aria-label", "aria-busy"], pl = {
4239
4297
  },
4240
4298
  emits: ["answer"],
4241
4299
  setup(n, { emit: o }) {
4242
- let c = n, l = o, u = K(), d = t(() => String(c.question.kind ?? "text")), p = t(() => String(c.question.prompt ?? "")), m = t(() => Za(c.question)), h = t(() => c.question.multiple === !0), g = t(() => c.question.other === !0), v = t(() => sl(u.workspace.value.id, c.questionId, c.owner)), y = t(() => Je(u.t, v.value.error));
4300
+ let c = n, l = o, u = K(), d = t(() => String(c.question.kind ?? "text")), p = t(() => String(c.question.prompt ?? "")), m = t(() => $a(c.question)), h = t(() => c.question.multiple === !0), g = t(() => c.question.other === !0), v = t(() => pl(u.workspace.value.id, c.questionId, c.owner)), y = t(() => Je(u.t, v.value.error));
4243
4301
  function x(e) {
4244
4302
  !v.value.sending && !v.value.settled && l("answer", {
4245
4303
  questionId: c.questionId,
@@ -4262,12 +4320,12 @@ var fl = ["aria-label", "aria-busy"], pl = {
4262
4320
  "data-test": "question-card",
4263
4321
  "aria-label": p.value,
4264
4322
  "aria-busy": v.value.sending
4265
- }, [a("div", pl, [s(D(de), {
4323
+ }, [a("div", yl, [s(D(de), {
4266
4324
  size: 18,
4267
4325
  "aria-hidden": "true"
4268
- }), a("span", ml, E(p.value), 1)]), a("div", hl, [
4269
- v.value.sending ? (_(), i("p", gl, E(D(u).t("kvcoder.ui.answerSending")), 1)) : r("v-if", !0),
4270
- v.value.error === void 0 ? r("v-if", !0) : (_(), i("p", _l, E(D(u).t("kvcoder.ui.answerFailed", { error: y.value })), 1)),
4326
+ }), a("span", bl, E(p.value), 1)]), a("div", xl, [
4327
+ v.value.sending ? (_(), i("p", Sl, E(D(u).t("kvcoder.ui.answerSending")), 1)) : r("v-if", !0),
4328
+ v.value.error === void 0 ? r("v-if", !0) : (_(), i("p", Cl, E(D(u).t("kvcoder.ui.answerFailed", { error: y.value })), 1)),
4271
4329
  d.value === "text" ? (_(), i(e, { key: 2 }, [M(a("input", {
4272
4330
  "onUpdate:modelValue": n[0] ||= (e) => v.value.text = e,
4273
4331
  disabled: v.value.sending,
@@ -4277,19 +4335,19 @@ var fl = ["aria-label", "aria-busy"], pl = {
4277
4335
  "aria-label": p.value,
4278
4336
  "data-test": "answer-text",
4279
4337
  onKeydown: n[1] ||= N(P((e) => x({ text: v.value.text }), ["prevent"]), ["enter"])
4280
- }, null, 40, vl), [[k, v.value.text]]), a("div", yl, [a("button", {
4338
+ }, null, 40, wl), [[k, v.value.text]]), a("div", Tl, [a("button", {
4281
4339
  type: "button",
4282
4340
  disabled: v.value.sending,
4283
4341
  class: "kvc-button",
4284
4342
  "data-test": "skip",
4285
4343
  onClick: n[2] ||= (e) => x({ dismissed: !0 })
4286
- }, E(D(u).t("kvcoder.ui.skip")), 9, bl), a("button", {
4344
+ }, E(D(u).t("kvcoder.ui.skip")), 9, El), a("button", {
4287
4345
  type: "button",
4288
4346
  disabled: v.value.sending,
4289
4347
  class: "kvc-button kvc-primary",
4290
4348
  "data-test": "answer",
4291
4349
  onClick: n[3] ||= (e) => x({ text: v.value.text })
4292
- }, E(D(u).t(v.value.error === void 0 ? "kvcoder.ui.answer" : "kvcoder.ui.tryAgain")), 9, xl)])], 64)) : d.value === "choice" ? (_(), i(e, { key: 3 }, [
4350
+ }, E(D(u).t(v.value.error === void 0 ? "kvcoder.ui.answer" : "kvcoder.ui.tryAgain")), 9, Dl)])], 64)) : d.value === "choice" ? (_(), i(e, { key: 3 }, [
4293
4351
  (_(!0), i(e, null, b(m.value, (e) => (_(), i("label", {
4294
4352
  key: e.id,
4295
4353
  class: "kvc-option",
@@ -4300,7 +4358,7 @@ var fl = ["aria-label", "aria-busy"], pl = {
4300
4358
  disabled: v.value.sending,
4301
4359
  name: c.questionId,
4302
4360
  onChange: (t) => S(e.id)
4303
- }, null, 40, Cl), a("span", wl, [a("span", Tl, E(e.label), 1), e.description ? (_(), i("span", El, E(e.description), 1)) : r("v-if", !0)])], 8, Sl))), 128)),
4361
+ }, null, 40, kl), a("span", Al, [a("span", jl, E(e.label), 1), e.description ? (_(), i("span", Ml, E(e.description), 1)) : r("v-if", !0)])], 8, Ol))), 128)),
4304
4362
  g.value ? M((_(), i("input", {
4305
4363
  key: 0,
4306
4364
  "onUpdate:modelValue": n[4] ||= (e) => v.value.other = e,
@@ -4309,36 +4367,36 @@ var fl = ["aria-label", "aria-busy"], pl = {
4309
4367
  placeholder: D(u).t("kvcoder.ui.other"),
4310
4368
  "aria-label": D(u).t("kvcoder.ui.other"),
4311
4369
  "data-test": "answer-other"
4312
- }, null, 8, Dl)), [[k, v.value.other]]) : r("v-if", !0),
4313
- a("div", Ol, [a("button", {
4370
+ }, null, 8, Nl)), [[k, v.value.other]]) : r("v-if", !0),
4371
+ a("div", Pl, [a("button", {
4314
4372
  type: "button",
4315
4373
  disabled: v.value.sending,
4316
4374
  class: "kvc-button",
4317
4375
  "data-test": "skip",
4318
4376
  onClick: n[5] ||= (e) => x({ dismissed: !0 })
4319
- }, E(D(u).t("kvcoder.ui.skip")), 9, kl), a("button", {
4377
+ }, E(D(u).t("kvcoder.ui.skip")), 9, Fl), a("button", {
4320
4378
  type: "button",
4321
4379
  class: "kvc-button kvc-primary",
4322
4380
  disabled: v.value.sending || v.value.selected.length === 0 && v.value.other.trim() === "",
4323
4381
  "data-test": "answer",
4324
4382
  onClick: C
4325
- }, E(D(u).t(v.value.error === void 0 ? "kvcoder.ui.answer" : "kvcoder.ui.tryAgain")), 9, Al)])
4326
- ], 64)) : (_(), i("div", jl, [a("button", {
4383
+ }, E(D(u).t(v.value.error === void 0 ? "kvcoder.ui.answer" : "kvcoder.ui.tryAgain")), 9, Il)])
4384
+ ], 64)) : (_(), i("div", Ll, [a("button", {
4327
4385
  type: "button",
4328
4386
  disabled: v.value.sending,
4329
4387
  class: "kvc-button",
4330
4388
  "data-test": "answer-no",
4331
4389
  onClick: n[6] ||= (e) => x({ confirmed: !1 })
4332
- }, E(D(u).t("kvcoder.ui.no")), 9, Ml), a("button", {
4390
+ }, E(D(u).t("kvcoder.ui.no")), 9, Rl), a("button", {
4333
4391
  type: "button",
4334
4392
  disabled: v.value.sending,
4335
4393
  class: f(["kvc-button kvc-primary", { "kvc-danger": c.question.danger === !0 }]),
4336
4394
  "data-test": "answer-yes",
4337
4395
  onClick: n[7] ||= (e) => x({ confirmed: !0 })
4338
- }, E(D(u).t("kvcoder.ui.yes")), 11, Nl)]))
4339
- ])], 8, fl));
4396
+ }, E(D(u).t("kvcoder.ui.yes")), 11, zl)]))
4397
+ ])], 8, vl));
4340
4398
  }
4341
- }), Fl = /* @__PURE__ */ c({
4399
+ }), Vl = /* @__PURE__ */ c({
4342
4400
  __name: "PendingCards",
4343
4401
  props: {
4344
4402
  pending: {},
@@ -4352,9 +4410,9 @@ var fl = ["aria-label", "aria-busy"], pl = {
4352
4410
  question: q(e.question)
4353
4411
  }))), d = t(() => s.pending.filter((e) => e.kind === "approval" && l(e)).map((e) => ({
4354
4412
  questionId: String(e.questionId),
4355
- view: pa(q(e.question))
4413
+ view: ha(q(e.question))
4356
4414
  })));
4357
- return (t, a) => (_(), i(e, null, [(_(!0), i(e, null, b(u.value, (e) => (_(), n(Pl, {
4415
+ return (t, a) => (_(), i(e, null, [(_(!0), i(e, null, b(u.value, (e) => (_(), n(Bl, {
4358
4416
  key: e.questionId,
4359
4417
  "question-id": e.questionId,
4360
4418
  question: e.question,
@@ -4364,7 +4422,7 @@ var fl = ["aria-label", "aria-busy"], pl = {
4364
4422
  "question-id",
4365
4423
  "question",
4366
4424
  "owner"
4367
- ]))), 128)), d.value.length > 0 ? (_(), n(il, {
4425
+ ]))), 128)), d.value.length > 0 ? (_(), n(ul, {
4368
4426
  key: 0,
4369
4427
  approvals: d.value,
4370
4428
  onDecide: a[1] ||= (e) => c("decide", {
@@ -4376,12 +4434,12 @@ var fl = ["aria-label", "aria-busy"], pl = {
4376
4434
  });
4377
4435
  //#endregion
4378
4436
  //#region web/src/use-model-groups.ts
4379
- function Il(e, t, n) {
4437
+ function Hl(e, t, n) {
4380
4438
  let r = y([]);
4381
4439
  return h(async () => {
4382
4440
  try {
4383
4441
  let [n, i] = await Promise.all([e.exec("kvai.provider.list", {}), e.exec("kvai.model.list", {})]);
4384
- r.value = Mr(n, i, t());
4442
+ r.value = Pr(n, i, t());
4385
4443
  } catch (e) {
4386
4444
  n(e);
4387
4445
  }
@@ -4389,15 +4447,15 @@ function Il(e, t, n) {
4389
4447
  }
4390
4448
  //#endregion
4391
4449
  //#region web/src/RecoveryActions.vue?vue&type=script&setup=true&lang.ts
4392
- var Ll = {
4450
+ var Ul = {
4393
4451
  class: "kvc-recovery",
4394
4452
  "data-test": "recovery"
4395
- }, Rl = ["disabled"], zl = { class: "kvc-recovery-picker" }, Bl = /* @__PURE__ */ c({
4453
+ }, Wl = ["disabled"], Gl = { class: "kvc-recovery-picker" }, Kl = /* @__PURE__ */ c({
4396
4454
  __name: "RecoveryActions",
4397
4455
  props: { sessionId: {} },
4398
4456
  emits: ["sent"],
4399
4457
  setup(e, { emit: t }) {
4400
- let n = e, r = t, c = K(), l = Il(c, () => null, (e) => J(c, e));
4458
+ let n = e, r = t, c = K(), l = Hl(c, () => null, (e) => J(c, e));
4401
4459
  async function u() {
4402
4460
  await c.exec("kvcoder.turn.retry", { sessionId: n.sessionId }), r("sent");
4403
4461
  }
@@ -4418,9 +4476,9 @@ var Ll = {
4418
4476
  await c.exec("kvcoder.session.configure", {
4419
4477
  sessionId: n.sessionId,
4420
4478
  model: e
4421
- }), await Qr(c, e), await u();
4479
+ }), await ei(c, e), await u();
4422
4480
  });
4423
- return (e, t) => (_(), i("div", Ll, [a("button", {
4481
+ return (e, t) => (_(), i("div", Ul, [a("button", {
4424
4482
  type: "button",
4425
4483
  class: "kvc-button",
4426
4484
  disabled: d.value,
@@ -4429,34 +4487,34 @@ var Ll = {
4429
4487
  }, [s(D(Te), {
4430
4488
  size: 14,
4431
4489
  "aria-hidden": "true"
4432
- }), o(E(D(c).t("kvcoder.ui.retry")), 1)], 8, Rl), a("div", zl, [s(Xr, {
4490
+ }), o(E(D(c).t("kvcoder.ui.retry")), 1)], 8, Wl), a("div", Gl, [s(Qr, {
4433
4491
  groups: D(l),
4434
4492
  current: null,
4435
4493
  empty: D(c).t("kvcoder.ui.chooseAnotherModel"),
4436
4494
  onPick: m
4437
4495
  }, null, 8, ["groups", "empty"])])]));
4438
4496
  }
4439
- }), Vl = {
4497
+ }), ql = {
4440
4498
  class: "kvc-column",
4441
4499
  "data-test": "prompt-tab"
4442
- }, Hl = { style: {
4500
+ }, Jl = { style: {
4443
4501
  display: "flex",
4444
4502
  "align-items": "center",
4445
4503
  gap: "10px"
4446
- } }, Ul = { style: { flex: "1 1 auto" } }, Wl = {
4504
+ } }, Yl = { style: { flex: "1 1 auto" } }, Xl = {
4447
4505
  key: 0,
4448
4506
  style: {
4449
4507
  margin: "0",
4450
4508
  "padding-inline-start": "20px"
4451
4509
  }
4452
- }, Gl = {
4510
+ }, Zl = {
4453
4511
  key: 0,
4454
4512
  class: "kvc-chip kvc-warn"
4455
- }, Kl = {
4513
+ }, Ql = {
4456
4514
  key: 1,
4457
4515
  class: "kvc-prompt",
4458
4516
  "data-test": "prompt-text"
4459
- }, ql = /* @__PURE__ */ c({
4517
+ }, $l = /* @__PURE__ */ c({
4460
4518
  __name: "PromptTab",
4461
4519
  props: { sessionId: {} },
4462
4520
  emits: ["back"],
@@ -4472,19 +4530,19 @@ var Ll = {
4472
4530
  async function f() {
4473
4531
  d.value !== null && (await navigator.clipboard.writeText(d.value.prompt), u.toast("kvcoder.ui.copied", {}, "success"));
4474
4532
  }
4475
- return (t, n) => (_(), i("div", Vl, [
4476
- a("div", Hl, [
4533
+ return (t, n) => (_(), i("div", ql, [
4534
+ a("div", Jl, [
4477
4535
  a("button", {
4478
4536
  type: "button",
4479
4537
  class: "kvc-button",
4480
4538
  "data-test": "prompt-back",
4481
4539
  onClick: n[0] ||= (e) => l("back")
4482
- }, [s(D(ie), {
4540
+ }, [s(D(H), {
4483
4541
  size: 16,
4484
4542
  class: "kvc-flip",
4485
4543
  "aria-hidden": "true"
4486
4544
  }), o(E(D(u).t("kvcoder.ui.showChat")), 1)]),
4487
- a("strong", Ul, E(D(u).t("kvcoder.ui.promptTitle")), 1),
4545
+ a("strong", Yl, E(D(u).t("kvcoder.ui.promptTitle")), 1),
4488
4546
  a("button", {
4489
4547
  type: "button",
4490
4548
  class: "kvc-button",
@@ -4492,7 +4550,7 @@ var Ll = {
4492
4550
  onClick: f
4493
4551
  }, [s(D(he), { size: 16 }), o(E(D(u).t("kvcoder.ui.copy")), 1)])
4494
4552
  ]),
4495
- d.value ? (_(), i("ul", Wl, [(_(!0), i(e, null, b(d.value.sections, (e) => (_(), i("li", {
4553
+ d.value ? (_(), i("ul", Xl, [(_(!0), i(e, null, b(d.value.sections, (e) => (_(), i("li", {
4496
4554
  key: `${e.owner}/${e.id}`,
4497
4555
  class: "kvc-muted",
4498
4556
  "data-test": "prompt-section"
@@ -4501,14 +4559,14 @@ var Ll = {
4501
4559
  owner: e.owner,
4502
4560
  reach: D(u).t(`kvcoder.ui.reach.${e.reach}`),
4503
4561
  size: e.size
4504
- })) + " ", 1), e.included ? r("v-if", !0) : (_(), i("span", Gl, E(D(u).t("kvcoder.ui.leftOut")), 1))]))), 128))])) : r("v-if", !0),
4505
- d.value ? (_(), i("pre", Kl, E(d.value.prompt), 1)) : r("v-if", !0)
4562
+ })) + " ", 1), e.included ? r("v-if", !0) : (_(), i("span", Zl, E(D(u).t("kvcoder.ui.leftOut")), 1))]))), 128))])) : r("v-if", !0),
4563
+ d.value ? (_(), i("pre", Ql, E(d.value.prompt), 1)) : r("v-if", !0)
4506
4564
  ]));
4507
4565
  }
4508
4566
  });
4509
4567
  //#endregion
4510
4568
  //#region web/src/use-session-actions.ts
4511
- function Jl(e, t, n) {
4569
+ function eu(e, t, n) {
4512
4570
  let r = T();
4513
4571
  async function i(t) {
4514
4572
  try {
@@ -4541,7 +4599,7 @@ function Jl(e, t, n) {
4541
4599
  await e.exec("kvcoder.session.configure", {
4542
4600
  sessionId: t(),
4543
4601
  ...n
4544
- }), n.model !== void 0 && await Qr(e, n.model);
4602
+ }), n.model !== void 0 && await ei(e, n.model);
4545
4603
  }),
4546
4604
  rename: (n) => a("rename", async () => {
4547
4605
  n.trim() !== "" && await e.exec("kvcoder.session.rename", {
@@ -4571,13 +4629,13 @@ function Jl(e, t, n) {
4571
4629
  }
4572
4630
  //#endregion
4573
4631
  //#region web/src/SessionModel.vue
4574
- var Yl = /* @__PURE__ */ c({
4632
+ var tu = /* @__PURE__ */ c({
4575
4633
  __name: "SessionModel",
4576
4634
  props: { session: {} },
4577
4635
  emits: ["changed"],
4578
4636
  setup(e, { emit: t }) {
4579
- let r = e, i = t, a = K(), o = Il(a, () => r.session.model, (e) => J(a, e)), s = Jl(a, () => r.session.id, () => i("changed"));
4580
- return (e, t) => (_(), n(Zr, {
4637
+ let r = e, i = t, a = K(), o = Hl(a, () => r.session.model, (e) => J(a, e)), s = eu(a, () => r.session.id, () => i("changed"));
4638
+ return (e, t) => (_(), n($r, {
4581
4639
  groups: D(o),
4582
4640
  model: r.session.model ?? null,
4583
4641
  thinking: r.session.thinking,
@@ -4589,32 +4647,32 @@ var Yl = /* @__PURE__ */ c({
4589
4647
  "thinking"
4590
4648
  ]));
4591
4649
  }
4592
- }), Xl = ["aria-label"], Zl = { class: "kvc-card-row" }, Ql = {
4650
+ }), nu = ["aria-label"], ru = { class: "kvc-card-row" }, iu = {
4593
4651
  key: 0,
4594
4652
  class: "kvc-chip kvc-mono",
4595
4653
  "data-test": "subagent-worker"
4596
- }, $l = { class: "kvc-lines" }, eu = {
4654
+ }, au = { class: "kvc-lines" }, ou = {
4597
4655
  style: { "font-weight": "600" },
4598
4656
  "data-test": "subagent-title"
4599
- }, tu = {
4657
+ }, su = {
4600
4658
  key: 0,
4601
4659
  class: "kvc-muted kvc-oneline",
4602
4660
  dir: "auto",
4603
4661
  "data-test": "subagent-task"
4604
- }, nu = {
4662
+ }, cu = {
4605
4663
  key: 1,
4606
4664
  class: "kvc-spin"
4607
- }, ru = {
4665
+ }, lu = {
4608
4666
  key: 0,
4609
4667
  class: "kvc-card-body"
4610
- }, iu = {
4668
+ }, uu = {
4611
4669
  key: 0,
4612
4670
  class: "kvc-muted",
4613
4671
  style: {
4614
4672
  margin: "0",
4615
4673
  "white-space": "pre-wrap"
4616
4674
  }
4617
- }, au = /* @__PURE__ */ c({
4675
+ }, du = /* @__PURE__ */ c({
4618
4676
  __name: "SubagentCard",
4619
4677
  props: {
4620
4678
  child: {},
@@ -4628,16 +4686,16 @@ var Yl = /* @__PURE__ */ c({
4628
4686
  class: "kvc-card",
4629
4687
  "data-test": "subagent-card",
4630
4688
  "aria-label": D(Ge)(D(l).t, o.child.session.title)
4631
- }, [a("div", Zl, [
4689
+ }, [a("div", ru, [
4632
4690
  s(D(se), {
4633
4691
  size: 18,
4634
4692
  "aria-hidden": "true"
4635
4693
  }),
4636
- o.child.session.worker === void 0 ? r("v-if", !0) : (_(), i("span", Ql, E(o.child.session.worker), 1)),
4637
- a("span", $l, [a("span", eu, E(D(Ge)(D(l).t, o.child.session.title)), 1), u.value ? (_(), i("span", tu, E(u.value), 1)) : r("v-if", !0)]),
4638
- o.child.session.status === "running" ? (_(), i("span", nu)) : r("v-if", !0),
4694
+ o.child.session.worker === void 0 ? r("v-if", !0) : (_(), i("span", iu, E(o.child.session.worker), 1)),
4695
+ a("span", au, [a("span", ou, E(D(Ge)(D(l).t, o.child.session.title)), 1), u.value ? (_(), i("span", su, E(u.value), 1)) : r("v-if", !0)]),
4696
+ o.child.session.status === "running" ? (_(), i("span", cu)) : r("v-if", !0),
4639
4697
  a("span", { class: f(["kvc-chip", { "kvc-warn": o.child.session.status === "waiting" }]) }, E(d.value), 3)
4640
- ]), o.child.live.text !== "" || (o.child.turn?.pending.length ?? 0) > 0 ? (_(), i("div", ru, [o.child.live.text === "" ? r("v-if", !0) : (_(), i("p", iu, E(o.child.live.text), 1)), s(Fl, {
4698
+ ]), o.child.live.text !== "" || (o.child.turn?.pending.length ?? 0) > 0 ? (_(), i("div", lu, [o.child.live.text === "" ? r("v-if", !0) : (_(), i("p", uu, E(o.child.live.text), 1)), s(Vl, {
4641
4699
  owner: o.child.turn === void 0 ? void 0 : {
4642
4700
  sessionId: o.child.session.id,
4643
4701
  turnId: o.child.turn.id
@@ -4650,22 +4708,22 @@ var Yl = /* @__PURE__ */ c({
4650
4708
  "owner",
4651
4709
  "pending",
4652
4710
  "hidden"
4653
- ])])) : r("v-if", !0)], 8, Xl));
4711
+ ])])) : r("v-if", !0)], 8, nu));
4654
4712
  }
4655
- }), ou = ["aria-label"], su = { class: "kvc-card-row" }, cu = {
4713
+ }), fu = ["aria-label"], pu = { class: "kvc-card-row" }, mu = {
4656
4714
  class: "kvc-chip kvc-mono",
4657
4715
  "data-test": "worker-card-name"
4658
- }, lu = {
4716
+ }, hu = {
4659
4717
  style: {
4660
4718
  flex: "1 1 auto",
4661
4719
  "font-weight": "500"
4662
4720
  },
4663
4721
  dir: "auto",
4664
4722
  "data-test": "worker-card-call"
4665
- }, uu = {
4723
+ }, gu = {
4666
4724
  class: "kvc-chip",
4667
4725
  "data-test": "worker-card-time"
4668
- }, du = ["disabled"], fu = /* @__PURE__ */ c({
4726
+ }, _u = ["disabled"], vu = /* @__PURE__ */ c({
4669
4727
  __name: "WorkerCard",
4670
4728
  props: {
4671
4729
  sessionId: {},
@@ -4701,25 +4759,25 @@ var Yl = /* @__PURE__ */ c({
4701
4759
  class: "kvc-card",
4702
4760
  "data-test": "worker-card",
4703
4761
  "aria-label": o.value.title
4704
- }, [a("div", su, [
4762
+ }, [a("div", pu, [
4705
4763
  s(D(se), {
4706
4764
  size: 18,
4707
4765
  "aria-hidden": "true"
4708
4766
  }),
4709
- a("span", cu, E(o.value.title), 1),
4710
- a("span", lu, E(o.value.call), 1),
4767
+ a("span", mu, E(o.value.title), 1),
4768
+ a("span", hu, E(o.value.call), 1),
4711
4769
  t[0] ||= a("span", { class: "kvc-spin" }, null, -1),
4712
- a("span", uu, E(D(n).t("kvcoder.ui.jobs.status.running")) + " · " + E(D(Ti)(D(n).t, c.value - Date.parse(o.value.startedAt))), 1),
4770
+ a("span", gu, E(D(n).t("kvcoder.ui.jobs.status.running")) + " · " + E(D(Di)(D(n).t, c.value - Date.parse(o.value.startedAt))), 1),
4713
4771
  a("button", {
4714
4772
  type: "button",
4715
4773
  class: "kvc-button",
4716
4774
  disabled: l.value,
4717
4775
  "data-test": "worker-card-stop",
4718
4776
  onClick: d
4719
- }, E(D(n).t("kvcoder.ui.jobs.stop")), 9, du)
4720
- ])], 8, ou));
4777
+ }, E(D(n).t("kvcoder.ui.jobs.stop")), 9, _u)
4778
+ ])], 8, fu));
4721
4779
  }
4722
- }), pu = (e) => {
4780
+ }), yu = (e) => {
4723
4781
  let t = e.view.description ?? e.view.line;
4724
4782
  return {
4725
4783
  name: "run",
@@ -4728,8 +4786,8 @@ var Yl = /* @__PURE__ */ c({
4728
4786
  complete: !0
4729
4787
  };
4730
4788
  };
4731
- function mu(e, n, r) {
4732
- let i = t(() => ll(e.workspace.value.id)), a = /* @__PURE__ */ new Map(), o = 0, s = !1;
4789
+ function bu(e, n, r) {
4790
+ let i = t(() => hl(e.workspace.value.id)), a = /* @__PURE__ */ new Map(), o = 0, s = !1;
4733
4791
  A([
4734
4792
  () => e.workspace.value.id,
4735
4793
  () => r()?.sessionId,
@@ -4742,7 +4800,7 @@ function mu(e, n, r) {
4742
4800
  async function c(t, r) {
4743
4801
  let i = e.workspace.value.id, c = o, l = () => !s && o === c && e.workspace.value.id === i, u = t.map((e) => ({
4744
4802
  item: e,
4745
- draft: sl(i, e.questionId, r)
4803
+ draft: pl(i, e.questionId, r)
4746
4804
  }));
4747
4805
  if (u.some(({ draft: e }) => e.sending)) return;
4748
4806
  let d = u.filter(({ draft: e }) => !e.settled);
@@ -4750,18 +4808,18 @@ function mu(e, n, r) {
4750
4808
  let f = null;
4751
4809
  for (let [t, { item: n, draft: r }] of d.entries()) {
4752
4810
  if (!l()) {
4753
- for (let e of d.slice(t)) cl(i, e.item.questionId, e.draft) && (e.draft.sending = !1);
4811
+ for (let e of d.slice(t)) ml(i, e.item.questionId, e.draft) && (e.draft.sending = !1);
4754
4812
  return;
4755
4813
  }
4756
- if (cl(i, n.questionId, r)) try {
4757
- f = (await e.exec("kvcoder.question.answer", n)).jobId ?? f, cl(i, n.questionId, r) && ul(r);
4814
+ if (ml(i, n.questionId, r)) try {
4815
+ f = (await e.exec("kvcoder.question.answer", n)).jobId ?? f, ml(i, n.questionId, r) && gl(r);
4758
4816
  } catch (o) {
4759
4817
  if (qe(o)?.code === "kvcoder/QUESTION_NOT_FOUND") {
4760
- cl(i, n.questionId, r) && (r.sending = !1);
4818
+ ml(i, n.questionId, r) && (r.sending = !1);
4761
4819
  continue;
4762
4820
  }
4763
- for (let e of d.slice(t)) cl(i, e.item.questionId, e.draft) && (e.draft.sending = !1, e.draft === r && (e.draft.error = o)), a.delete(e.item.questionId);
4764
- l() && cl(i, n.questionId, r) && J(e, o);
4821
+ for (let e of d.slice(t)) ml(i, e.item.questionId, e.draft) && (e.draft.sending = !1, e.draft === r && (e.draft.error = o)), a.delete(e.item.questionId);
4822
+ l() && ml(i, n.questionId, r) && J(e, o);
4765
4823
  return;
4766
4824
  }
4767
4825
  }
@@ -4775,7 +4833,7 @@ function mu(e, n, r) {
4775
4833
  hidden: i,
4776
4834
  answer: (e) => c([e]),
4777
4835
  decide: ({ approvals: e, confirmed: t, owner: n }) => {
4778
- if (t) for (let t of e) a.set(t.questionId, pu(t));
4836
+ if (t) for (let t of e) a.set(t.questionId, yu(t));
4779
4837
  return c(e.map((e) => ({
4780
4838
  questionId: e.questionId,
4781
4839
  answer: { confirmed: t }
@@ -4785,8 +4843,8 @@ function mu(e, n, r) {
4785
4843
  }
4786
4844
  //#endregion
4787
4845
  //#region web/src/use-artifacts.ts
4788
- var hu = (e) => `${e.version} ${e.updatedAt}`;
4789
- function gu(e, t, n, r) {
4846
+ var xu = (e) => `${e.version} ${e.updatedAt}`;
4847
+ function Su(e, t, n, r) {
4790
4848
  let i = y([]), a = y(void 0), o = y(void 0), s = y(!1), c = y(void 0), l = /* @__PURE__ */ new Map(), u, d = !1, f = 0, p = !1;
4791
4849
  function g(e) {
4792
4850
  u = e, d = !1, l.clear(), c.value = void 0, i.value = [], a.value = void 0, o.value = void 0, s.value = !1;
@@ -4823,7 +4881,7 @@ function gu(e, t, n, r) {
4823
4881
  if (p || m !== f || t() !== n || u !== n) return;
4824
4882
  if (i.value = h, !d) {
4825
4883
  d = !0;
4826
- for (let e of h) l.set(e.id, hu(e));
4884
+ for (let e of h) l.set(e.id, xu(e));
4827
4885
  if (h.length === 0) {
4828
4886
  a.value = void 0, o.value = void 0, s.value = !1;
4829
4887
  return;
@@ -4834,8 +4892,8 @@ function gu(e, t, n, r) {
4834
4892
  t !== void 0 && await _(n, t);
4835
4893
  return;
4836
4894
  }
4837
- let v = h.filter((e) => l.get(e.id) !== hu(e));
4838
- for (let e of h) l.set(e.id, hu(e));
4895
+ let v = h.filter((e) => l.get(e.id) !== xu(e));
4896
+ for (let e of h) l.set(e.id, xu(e));
4839
4897
  if (v.length > 0) {
4840
4898
  let e = [...v].sort((e, t) => e.updatedAt < t.updatedAt ? 1 : e.updatedAt > t.updatedAt ? -1 : 0)[0];
4841
4899
  e !== void 0 && (a.value = e.id, s.value = !0, c.value = {
@@ -4903,7 +4961,7 @@ function gu(e, t, n, r) {
4903
4961
  }
4904
4962
  //#endregion
4905
4963
  //#region web/src/conversation-streams.ts
4906
- function _u(e, t, n, r, i) {
4964
+ function Cu(e, t, n, r, i) {
4907
4965
  let a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new WeakMap(), s = (e) => e.current() && a.get(e.target) === e, c = (e, t) => {
4908
4966
  s(e) && i(t);
4909
4967
  };
@@ -4918,17 +4976,17 @@ function _u(e, t, n, r, i) {
4918
4976
  let i = !1, u = !1;
4919
4977
  try {
4920
4978
  e.follow(r.jobId).catch((e) => c(r, e));
4921
- for await (let t of e.stream(r.jobId)) if (!r.current() || !s(r) && a.has(r.target) || (t.type === "problem" && t.problem.code === "kvwebui/OFFLINE" && (u = !0), xa(s(r) ? r.target : _a(), t).kind !== "none" && await l(r), !r.current() || !s(r) && a.has(r.target))) break;
4979
+ for await (let t of e.stream(r.jobId)) if (!r.current() || !s(r) && a.has(r.target) || (t.type === "problem" && t.problem.code === "kvwebui/OFFLINE" && (u = !0), Ca(s(r) ? r.target : ya(), t).kind !== "none" && await l(r), !r.current() || !s(r) && a.has(r.target))) break;
4922
4980
  i = !u;
4923
4981
  } catch (e) {
4924
4982
  c(r, e);
4925
4983
  } finally {
4926
- s(r) && (a.delete(r.target), i && o.set(r.target, r.jobId), Object.assign(r.target, _a()), r.target === t && (n.value = !1)), i && await l(r);
4984
+ s(r) && (a.delete(r.target), i && o.set(r.target, r.jobId), Object.assign(r.target, ya()), r.target === t && (n.value = !1)), i && await l(r);
4927
4985
  }
4928
4986
  }
4929
4987
  function d(e, r, i, c = []) {
4930
4988
  let l = a.get(e);
4931
- if (l !== void 0 && l.jobId === r && s(l) || (l !== void 0 && a.delete(e), o.get(e) === r && r !== void 0) || (o.delete(e), Object.assign(e, _a()), e === t && (n.value = !1), r === void 0 || !i())) return;
4989
+ if (l !== void 0 && l.jobId === r && s(l) || (l !== void 0 && a.delete(e), o.get(e) === r && r !== void 0) || (o.delete(e), Object.assign(e, ya()), e === t && (n.value = !1), r === void 0 || !i())) return;
4932
4990
  let d = {
4933
4991
  jobId: r,
4934
4992
  target: e,
@@ -4954,56 +5012,75 @@ function _u(e, t, n, r, i) {
4954
5012
  };
4955
5013
  }
4956
5014
  //#endregion
5015
+ //#region web/src/waiting-helpers.ts
5016
+ async function wu(e, t) {
5017
+ let n = (await e.exec("kvcoder.job.list", { sessionId: t })).filter((e) => e.kind === "subagent" && e.status === "waiting"), r = await Promise.all(n.map(async (n) => {
5018
+ let [r, [i]] = await Promise.all([e.exec("kvcoder.session.get", { sessionId: n.id }), e.exec("kvcoder.turn.list", {
5019
+ sessionId: n.id,
5020
+ limit: 1
5021
+ })]);
5022
+ return r.parentId === t ? [[n.id, {
5023
+ child: {
5024
+ session: r,
5025
+ turn: i?.sessionId === n.id ? i : void 0,
5026
+ live: v(ya())
5027
+ },
5028
+ call: n.call
5029
+ }]] : [];
5030
+ }));
5031
+ return new Map(r.flat());
5032
+ }
5033
+ //#endregion
4957
5034
  //#region web/src/use-conversation.ts
4958
- var vu = 5e3, yu = 200;
4959
- function bu(e, t, n, r = () => !1) {
4960
- let i = T(null), a = T([]), o = T(0), s = T([]), c = T(null), l = T(void 0), u = T(!1), d = v(_a()), f = w(/* @__PURE__ */ new Map()), p, m, h, _ = !1, y = !1, b = (n) => !_ && p === n && t() === n.sessionId && e.workspace.value.id === n.workspaceId, x = _u(e, d, u, () => N(), n), S = (e) => e.filter((e) => e.queued !== !0);
4961
- async function C(t, n, r) {
5035
+ var Tu = 5e3, Eu = 200;
5036
+ function Du(e, t, n, r = () => !1) {
5037
+ let i = T(null), a = T([]), o = T(0), s = T([]), c = T(null), l = T(void 0), u = T(!1), d = v(ya()), f = w(/* @__PURE__ */ new Map()), p = w(/* @__PURE__ */ new Map()), m, h, _, y = !1, b = !1, x = (n) => !y && m === n && t() === n.sessionId && e.workspace.value.id === n.workspaceId, S = Cu(e, d, u, () => F(), n), C = (e) => e.filter((e) => e.queued !== !0);
5038
+ async function E(t, n, r) {
4962
5039
  if (!r()) return;
4963
5040
  let i = await e.exec("kvcoder.message.list", {
4964
5041
  sessionId: t,
4965
- limit: yu
5042
+ limit: Eu
4966
5043
  });
4967
- r() && (a.value = i.messages, o.value = i.omitted, h = n, y = !1);
5044
+ r() && (a.value = i.messages, o.value = i.omitted, _ = n, b = !1);
4968
5045
  }
4969
- async function E(t, n, i, s) {
5046
+ async function D(t, n, i, s) {
4970
5047
  let c = await e.exec("kvcoder.message.list", {
4971
5048
  sessionId: t,
4972
- limit: yu,
5049
+ limit: Eu,
4973
5050
  afterSeq: i
4974
5051
  });
4975
5052
  if (!s()) return;
4976
- let l = S(c.messages);
4977
- if (l[0] !== void 0 && l[0].seq !== i + 1) return C(t, n, s);
4978
- let u = S(a.value), d = u.at(-1)?.seq ?? i, f = [...u, ...l.filter((e) => (e.seq ?? d) > d)], p = y || r() ? 0 : Math.max(f.length - yu, 0);
5053
+ let l = C(c.messages);
5054
+ if (l[0] !== void 0 && l[0].seq !== i + 1) return E(t, n, s);
5055
+ let u = C(a.value), d = u.at(-1)?.seq ?? i, f = [...u, ...l.filter((e) => (e.seq ?? d) > d)], p = b || r() ? 0 : Math.max(f.length - Eu, 0);
4979
5056
  a.value = [...f.slice(p), ...c.messages.filter((e) => e.queued === !0)], o.value += p;
4980
5057
  }
4981
- async function D() {
4982
- let t = p, n = S(a.value)[0]?.seq;
5058
+ async function O() {
5059
+ let t = m, n = C(a.value)[0]?.seq;
4983
5060
  if (t === void 0 || n === void 0) return;
4984
5061
  let r = await e.exec("kvcoder.message.list", {
4985
5062
  sessionId: t.sessionId,
4986
- limit: yu,
5063
+ limit: Eu,
4987
5064
  beforeSeq: n
4988
5065
  });
4989
- b(t) && S(a.value)[0]?.seq === n && (a.value = [...r.messages, ...a.value], o.value = r.omitted, y = !0);
5066
+ x(t) && C(a.value)[0]?.seq === n && (a.value = [...r.messages, ...a.value], o.value = r.omitted, b = !0);
4990
5067
  }
4991
- async function O() {
4992
- let e = p;
4993
- e !== void 0 && y && await C(e.sessionId, `${e.workspaceId}:${e.sessionId}`, () => b(e));
5068
+ async function k() {
5069
+ let e = m;
5070
+ e !== void 0 && b && await E(e.sessionId, `${e.workspaceId}:${e.sessionId}`, () => x(e));
4994
5071
  }
4995
- async function k(e, t) {
4996
- let n = `${e.workspaceId}:${e.sessionId}`, r = h === n ? S(a.value).at(-1)?.seq : void 0;
5072
+ async function j(e, t) {
5073
+ let n = `${e.workspaceId}:${e.sessionId}`, r = _ === n ? C(a.value).at(-1)?.seq : void 0;
4997
5074
  try {
4998
- await (r === void 0 ? C(e.sessionId, n, t) : E(e.sessionId, n, r, t)), t() && (l.value = void 0);
5075
+ await (r === void 0 ? E(e.sessionId, n, t) : D(e.sessionId, n, r, t)), t() && (l.value = void 0);
4999
5076
  } catch (e) {
5000
5077
  t() && (l.value = e);
5001
5078
  }
5002
5079
  }
5003
- async function j(t, n, r) {
5080
+ async function M(t, n, r) {
5004
5081
  let i = n?.sessionId === t.sessionId && n.outcome === void 0 && n.endedAt === void 0 ? [...new Set(n.pending.flatMap((e) => e.childSessionId === null ? [] : [e.childSessionId]))] : [];
5005
5082
  for (let e of f.keys()) i.includes(e) || f.delete(e);
5006
- x.retain(/* @__PURE__ */ new Set([d, ...[...f.values()].map((e) => e.live)]));
5083
+ S.retain(/* @__PURE__ */ new Set([d, ...[...f.values()].map((e) => e.live)]));
5007
5084
  for (let n of i) {
5008
5085
  if (!r()) return;
5009
5086
  let [i, [a]] = await Promise.all([e.exec("kvcoder.session.get", { sessionId: n }), e.exec("kvcoder.turn.list", {
@@ -5012,23 +5089,30 @@ function bu(e, t, n, r = () => !1) {
5012
5089
  })]);
5013
5090
  if (!r()) return;
5014
5091
  if (i.id !== n || i.parentId !== t.sessionId) {
5015
- f.delete(n), x.retain(/* @__PURE__ */ new Set([d, ...[...f.values()].map((e) => e.live)]));
5092
+ f.delete(n), S.retain(/* @__PURE__ */ new Set([d, ...[...f.values()].map((e) => e.live)]));
5016
5093
  continue;
5017
5094
  }
5018
5095
  let o = {
5019
5096
  session: i,
5020
5097
  turn: a?.sessionId === n ? a : void 0,
5021
- live: f.get(n)?.live ?? v(_a())
5098
+ live: f.get(n)?.live ?? v(ya())
5022
5099
  };
5023
- dl(t.workspaceId, n, o.turn === void 0 ? [] : [o.turn]), f.set(n, o), x.update(o.live, i.status === "running" ? i.stepJobId : void 0, () => b(t));
5100
+ _l(t.workspaceId, n, o.turn === void 0 ? [] : [o.turn]), f.set(n, o), S.update(o.live, i.status === "running" ? i.stepJobId : void 0, () => x(t));
5101
+ }
5102
+ }
5103
+ async function N(t, n) {
5104
+ let r = await wu(e, t.sessionId);
5105
+ if (n()) {
5106
+ p.clear();
5107
+ for (let [e, n] of r) _l(t.workspaceId, e, n.child.turn === void 0 ? [] : [n.child.turn]), p.set(e, n);
5024
5108
  }
5025
5109
  }
5026
- async function M(t = [], n) {
5027
- let r = p;
5028
- if (r === void 0 || !b(r)) return;
5110
+ async function P(t = [], n) {
5111
+ let r = m;
5112
+ if (r === void 0 || !x(r)) return;
5029
5113
  let a = {};
5030
- m = a;
5031
- let o = () => b(r) && m === a;
5114
+ h = a;
5115
+ let o = () => x(r) && h === a;
5032
5116
  try {
5033
5117
  let [a, l, u] = await Promise.all([
5034
5118
  e.exec("kvcoder.session.get", { sessionId: r.sessionId }),
@@ -5039,38 +5123,42 @@ function bu(e, t, n, r = () => !1) {
5039
5123
  e.exec("kvcoder.context.get", { sessionId: r.sessionId })
5040
5124
  ]);
5041
5125
  if (!o() || a.id !== r.sessionId || (i.value !== null && i.value.status !== a.status && e.refresh(), !o())) return;
5042
- i.value = a, s.value = l, c.value = u, dl(r.workspaceId, a.id, l);
5126
+ i.value = a, s.value = l, c.value = u, _l(r.workspaceId, a.id, l);
5043
5127
  let f = a.status === "running" ? a.stepJobId : void 0;
5044
- x.update(d, f, () => b(r), n === void 0 || n === f ? t : []);
5045
- let p = j(r, a.status === "waiting" ? l[0] : void 0, o);
5046
- await Promise.all([k(r, o), p]);
5128
+ S.update(d, f, () => x(r), n === void 0 || n === f ? t : []);
5129
+ let p = M(r, a.status === "waiting" ? l[0] : void 0, o);
5130
+ await Promise.all([
5131
+ j(r, o),
5132
+ p,
5133
+ N(r, o)
5134
+ ]);
5047
5135
  } catch (e) {
5048
5136
  if (o()) throw e;
5049
5137
  }
5050
5138
  }
5051
- async function N(e = []) {
5052
- await M(e);
5139
+ async function F(e = []) {
5140
+ await P(e);
5053
5141
  }
5054
- async function P(e, t = []) {
5055
- await M(t, e);
5142
+ async function I(e, t = []) {
5143
+ await P(t, e);
5056
5144
  }
5057
- let F = setInterval(() => {
5058
- let e = p;
5059
- e !== void 0 && !x.busy() && N().catch((t) => {
5060
- b(e) && n(t);
5145
+ let L = setInterval(() => {
5146
+ let e = m;
5147
+ e !== void 0 && !S.busy() && F().catch((t) => {
5148
+ x(e) && n(t);
5061
5149
  });
5062
- }, vu);
5150
+ }, Tu);
5063
5151
  return g(() => {
5064
- _ = !0, p = void 0, m = void 0, x.clear(), clearInterval(F);
5152
+ y = !0, m = void 0, h = void 0, S.clear(), clearInterval(L);
5065
5153
  }), A([t, () => e.workspace.value.id], () => {
5066
5154
  let r = t();
5067
- p = r === void 0 ? void 0 : {
5155
+ m = r === void 0 ? void 0 : {
5068
5156
  workspaceId: e.workspace.value.id,
5069
5157
  sessionId: r
5070
- }, m = void 0, h = void 0, x.clear(), i.value = null, a.value = [], o.value = 0, s.value = [], c.value = null, l.value = void 0, f.clear(), Object.assign(d, _a());
5071
- let u = p;
5072
- u !== void 0 && N().catch((e) => {
5073
- b(u) && n(e);
5158
+ }, h = void 0, _ = void 0, S.clear(), i.value = null, a.value = [], o.value = 0, s.value = [], c.value = null, l.value = void 0, f.clear(), p.clear(), Object.assign(d, ya());
5159
+ let u = m;
5160
+ u !== void 0 && F().catch((e) => {
5161
+ x(u) && n(e);
5074
5162
  });
5075
5163
  }, {
5076
5164
  immediate: !0,
@@ -5085,15 +5173,16 @@ function bu(e, t, n, r = () => !1) {
5085
5173
  live: d,
5086
5174
  streaming: u,
5087
5175
  children: f,
5088
- showEarlier: D,
5089
- showLatest: O,
5090
- refresh: N,
5091
- stream: P
5176
+ helpers: p,
5177
+ showEarlier: O,
5178
+ showLatest: k,
5179
+ refresh: F,
5180
+ stream: I
5092
5181
  };
5093
5182
  }
5094
5183
  //#endregion
5095
5184
  //#region web/src/use-execution-map.ts
5096
- function xu(e, n, r, i, a) {
5185
+ function Ou(e, n, r, i, a) {
5097
5186
  let o = y(null), s = y(!1), c, l, u, d = 0, f = !1;
5098
5187
  async function p() {
5099
5188
  let t = n();
@@ -5139,15 +5228,15 @@ function xu(e, n, r, i, a) {
5139
5228
  }
5140
5229
  //#endregion
5141
5230
  //#region web/src/use-follow-latest.ts
5142
- var Su = 80;
5143
- function Cu(e, t, n) {
5231
+ var ku = 80;
5232
+ function Au(e, t, n) {
5144
5233
  let r = y(!1);
5145
5234
  function i() {
5146
5235
  e.value !== null && (e.value.scrollTop = e.value.scrollHeight);
5147
5236
  }
5148
5237
  function a() {
5149
5238
  let t = e.value;
5150
- t !== null && (r.value = t.scrollHeight - t.clientHeight - t.scrollTop > Su);
5239
+ t !== null && (r.value = t.scrollHeight - t.clientHeight - t.scrollTop > ku);
5151
5240
  }
5152
5241
  function o() {
5153
5242
  r.value = !1, i();
@@ -5164,7 +5253,7 @@ function Cu(e, t, n) {
5164
5253
  }
5165
5254
  //#endregion
5166
5255
  //#region web/src/use-finished-runs.ts
5167
- function wu(e, t, n, r) {
5256
+ function ju(e, t, n, r) {
5168
5257
  let i = y(/* @__PURE__ */ new Map());
5169
5258
  async function a(n) {
5170
5259
  try {
@@ -5178,13 +5267,13 @@ function wu(e, t, n, r) {
5178
5267
  r(e);
5179
5268
  }
5180
5269
  }
5181
- return A(() => [t(), n.value.flatMap((e) => qa(e) ?? []).join(" ")], ([e, t], n) => {
5270
+ return A(() => [t(), n.value.flatMap((e) => Ya(e) ?? []).join(" ")], ([e, t], n) => {
5182
5271
  e !== n?.[0] && (i.value = /* @__PURE__ */ new Map()), e !== void 0 && t !== "" && a(e);
5183
5272
  }, { immediate: !0 }), i;
5184
5273
  }
5185
5274
  //#endregion
5186
5275
  //#region web/src/use-slash-commands.ts
5187
- function Tu(e) {
5276
+ function Mu(e) {
5188
5277
  let t = T([]);
5189
5278
  return h(async () => {
5190
5279
  try {
@@ -5196,7 +5285,7 @@ function Tu(e) {
5196
5285
  }
5197
5286
  //#endregion
5198
5287
  //#region web/src/use-workspace-session.ts
5199
- function Eu(e, n, r) {
5288
+ function Nu(e, n, r) {
5200
5289
  let i = T(e.workspace.value.id);
5201
5290
  async function a(t) {
5202
5291
  let n;
@@ -5228,43 +5317,43 @@ function Eu(e, n, r) {
5228
5317
  }
5229
5318
  //#endregion
5230
5319
  //#region web/src/ConversationView.vue?vue&type=script&setup=true&lang.ts
5231
- var Du = { class: "kvc-workspace" }, Ou = { class: "kvc-stage" }, ku = {
5320
+ var Pu = { class: "kvc-workspace" }, Fu = { class: "kvc-stage" }, Iu = {
5232
5321
  class: "kvc-conversation",
5233
5322
  "data-test": "conversation"
5234
- }, Au = {
5323
+ }, Lu = {
5235
5324
  key: 0,
5236
5325
  class: "kvc-start",
5237
5326
  role: "alert",
5238
5327
  "data-test": "load-failure"
5239
- }, ju = { class: "kvc-start-note" }, Mu = {
5328
+ }, Ru = { class: "kvc-start-note" }, zu = {
5240
5329
  class: "kvc-actions",
5241
5330
  style: { "justify-content": "center" }
5242
- }, Nu = {
5331
+ }, Bu = {
5243
5332
  key: 1,
5244
5333
  class: "kvc-scrollport"
5245
- }, Pu = {
5334
+ }, Vu = {
5246
5335
  key: 1,
5247
5336
  class: "kvc-column"
5248
- }, Fu = {
5337
+ }, Hu = {
5249
5338
  key: 0,
5250
5339
  class: "kvc-actions",
5251
5340
  style: { "justify-content": "center" }
5252
- }, Iu = ["title"], Lu = {
5341
+ }, Uu = ["title"], Wu = {
5253
5342
  key: 1,
5254
5343
  class: "kvc-notice",
5255
5344
  "data-test": "map-remaining"
5256
- }, Ru = {
5345
+ }, Gu = {
5257
5346
  key: 3,
5258
5347
  class: "kvc-notice",
5259
5348
  "data-test": "summarizing"
5260
- }, zu = {
5349
+ }, Ku = {
5261
5350
  key: 4,
5262
5351
  class: "kvc-answer",
5263
5352
  "data-test": "live-answer"
5264
- }, Bu = ["open"], Vu = { class: "kvc-muted" }, Hu = {
5353
+ }, qu = ["open"], Ju = { class: "kvc-muted" }, Yu = {
5265
5354
  class: "kvc-muted",
5266
5355
  style: { "white-space": "pre-wrap" }
5267
- }, Uu = {
5356
+ }, Xu = {
5268
5357
  key: 7,
5269
5358
  class: "kvc-muted",
5270
5359
  style: {
@@ -5272,16 +5361,19 @@ var Du = { class: "kvc-workspace" }, Ou = { class: "kvc-stage" }, ku = {
5272
5361
  margin: "0"
5273
5362
  },
5274
5363
  "data-test": "waiting-hint"
5275
- }, Wu = /* @__PURE__ */ c({
5364
+ }, Zu = {
5365
+ class: "kvc-notice",
5366
+ "data-test": "background-decision"
5367
+ }, Qu = /* @__PURE__ */ c({
5276
5368
  __name: "ConversationView",
5277
5369
  props: { sessionId: {} },
5278
5370
  setup(c) {
5279
- let l = c, u = K(), { id: f, failed: p } = Eu(u, () => l.sessionId, (e) => J(u, e)), m = y("chat"), h = y(!1), g = bu(u, () => f.value, p, () => h.value), { session: v, messages: x, omitted: S, turns: w, live: T, children: k } = g, M = gu(u, () => f.value, () => v.value?.updatedAt, p), N = xu(u, () => f.value, () => v.value?.updatedAt, M, p), P = t(() => N.shown.value || M.open.value && M.shown.value !== void 0), F = t(() => v.value?.status === "idle" ? N.counts.value?.left ?? 0 : 0), I = t(() => Pa(x.value)), L = wu(u, () => f.value, x, p), ee = /* @__PURE__ */ new Set([
5371
+ let l = c, u = K(), { id: f, failed: p } = Nu(u, () => l.sessionId, (e) => J(u, e)), m = y("chat"), h = y(!1), g = Du(u, () => f.value, p, () => h.value), { session: v, messages: x, omitted: S, turns: w, live: T, children: k, helpers: M } = g, N = Su(u, () => f.value, () => v.value?.updatedAt, p), P = Ou(u, () => f.value, () => v.value?.updatedAt, N, p), F = t(() => P.shown.value || N.open.value && N.shown.value !== void 0), I = t(() => v.value?.status === "idle" ? P.counts.value?.left ?? 0 : 0), L = t(() => Ia(x.value)), R = ju(u, () => f.value, x, p), ee = /* @__PURE__ */ new Set([
5280
5372
  "STEP_FAILED",
5281
5373
  "REPLY_LOST",
5282
5374
  "REPLY_INCOMPLETE",
5283
5375
  "INTERRUPTED"
5284
- ]), R = t(() => v.value?.status === "running"), z = t(() => R.value && w.value[0]?.outcome === void 0 ? w.value[0]?.startedAt : void 0), B = t(() => v.value?.status === "waiting" ? w.value[0]?.pending ?? [] : []), V = t(() => {
5376
+ ]), z = t(() => v.value?.status === "running"), te = t(() => z.value && w.value[0]?.outcome === void 0 ? w.value[0]?.startedAt : void 0), B = t(() => v.value?.status === "waiting" ? w.value[0]?.pending ?? [] : []), ne = t(() => {
5285
5377
  let e = /* @__PURE__ */ new Map();
5286
5378
  for (let t of x.value) (t.kind === "assistant" || t.kind === "toolResult") && t.turnId !== void 0 && e.set(t.turnId, t.id);
5287
5379
  let t = /* @__PURE__ */ new Map();
@@ -5294,7 +5386,7 @@ var Du = { class: "kvc-workspace" }, Ou = { class: "kvc-stage" }, ku = {
5294
5386
  }
5295
5387
  return t;
5296
5388
  });
5297
- async function te(e) {
5389
+ async function re(e) {
5298
5390
  let t = f.value;
5299
5391
  if (t !== void 0 && await or(ir(u.workspace.value.id, t), e, async (n) => {
5300
5392
  await u.exec("kvcoder.message.send", {
@@ -5309,18 +5401,18 @@ var Du = { class: "kvc-workspace" }, Ou = { class: "kvc-stage" }, ku = {
5309
5401
  J(u, e);
5310
5402
  }
5311
5403
  }
5312
- let ne = t(() => v.value?.status === "running" || v.value?.status === "waiting"), H = y(), ie = y();
5313
- async function ae() {
5404
+ let V = t(() => v.value?.status === "running" || v.value?.status === "waiting"), H = y(), ae = y();
5405
+ async function oe() {
5314
5406
  let e = f.value, t = w.value[0]?.id;
5315
5407
  if (e !== void 0 && H.value !== e) {
5316
- H.value = e, ie.value = void 0;
5408
+ H.value = e, ae.value = void 0;
5317
5409
  try {
5318
5410
  await u.exec("kvcoder.turn.cancel", {
5319
5411
  sessionId: e,
5320
5412
  ...t === void 0 ? {} : { turnId: t }
5321
5413
  }), f.value === e && await g.refresh();
5322
5414
  } catch (t) {
5323
- f.value === e && (ie.value = {
5415
+ f.value === e && (ae.value = {
5324
5416
  sessionId: e,
5325
5417
  error: t
5326
5418
  });
@@ -5329,48 +5421,49 @@ var Du = { class: "kvc-workspace" }, Ou = { class: "kvc-stage" }, ku = {
5329
5421
  }
5330
5422
  }
5331
5423
  }
5332
- let oe = y(0), se = t(() => [
5333
- ...de.value.some((e) => e.kind !== "subagent" && e.kind !== "worker") ? [u.t("kvcoder.ui.messageDismisses")] : [],
5424
+ let se = y(0), ce = t(() => [
5425
+ ...fe.value.some((e) => e.kind !== "subagent" && e.kind !== "worker") ? [u.t("kvcoder.ui.messageDismisses")] : [],
5334
5426
  u.t("kvcoder.ui.stopEnds"),
5335
- ...oe.value > 0 ? [u.t("kvcoder.ui.stopKeepsBackground")] : []
5336
- ].join(" ")), ce = () => v.value === null || w.value[0] === void 0 ? void 0 : {
5427
+ ...se.value > 0 ? [u.t("kvcoder.ui.stopKeepsBackground")] : []
5428
+ ].join(" ")), le = () => v.value === null || w.value[0] === void 0 ? void 0 : {
5337
5429
  sessionId: v.value.id,
5338
5430
  turnId: w.value[0].id
5339
- }, U = mu(u, (e) => g.refresh(e), ce), le = t(() => new Map(B.value.flatMap((e) => {
5340
- let t = I.value.get(e.toolCallId)?.fields?.task;
5431
+ }, U = bu(u, (e) => g.refresh(e), le), ue = t(() => new Map(B.value.flatMap((e) => {
5432
+ let t = L.value.get(e.toolCallId)?.fields?.task;
5341
5433
  return typeof e.childSessionId == "string" && typeof t == "string" ? [[e.childSessionId, t]] : [];
5342
- }))), ue = t(() => B.value.flatMap((e) => e.kind === "worker" && e.runId !== void 0 ? [e.runId] : [])), de = t(() => B.value.filter((e) => e.questionId === null || !U.hidden.value.has(String(e.questionId)))), fe = t(() => {
5434
+ }))), de = t(() => B.value.flatMap((e) => e.kind === "worker" && e.runId !== void 0 ? [e.runId] : [])), fe = t(() => B.value.filter((e) => e.questionId === null || !U.hidden.value.has(String(e.questionId)))), pe = t(() => {
5343
5435
  let e = x.value.at(-1);
5344
5436
  return v.value?.status === "idle" && e?.kind === "notice" && ee.has(String(e.content.code));
5345
- }), pe = Tu(u), W = Jl(u, () => f.value ?? "", () => g.refresh());
5437
+ }), me = Mu(u), W = eu(u, () => f.value ?? "", () => g.refresh());
5346
5438
  A(() => g.loadFailure.value, (e) => {
5347
5439
  qe(e)?.code === "kvcoder/SESSION_NOT_FOUND" && p(e);
5348
5440
  });
5349
- let me = t(() => {
5441
+ let he = t(() => {
5350
5442
  let e = qe(g.loadFailure.value);
5351
5443
  return e === void 0 ? u.t("kvcoder.ui.failed") : u.t(Ke(e.code), e.params);
5352
- }), he = O("list"), G = Cu(he, () => [
5444
+ }), ge = O("list"), G = Au(ge, () => [
5353
5445
  x.value,
5354
5446
  T.text,
5355
5447
  T.thinking,
5356
5448
  T.calls.length,
5357
5449
  T.summarizing,
5358
- R.value,
5450
+ z.value,
5359
5451
  B.value,
5360
5452
  k.size,
5453
+ M.size,
5361
5454
  U.hidden.value,
5362
5455
  W.working.value
5363
5456
  ], () => f.value);
5364
5457
  A(G.away, (e) => h.value = e);
5365
- async function ge() {
5366
- let e = he.value, t = e === null ? 0 : e.scrollHeight - e.scrollTop;
5458
+ async function _e() {
5459
+ let e = ge.value, t = e === null ? 0 : e.scrollHeight - e.scrollTop;
5367
5460
  try {
5368
5461
  await g.showEarlier(), await d(), e !== null && (e.scrollTop = e.scrollHeight - t);
5369
5462
  } catch (e) {
5370
5463
  J(u, e);
5371
5464
  }
5372
5465
  }
5373
- async function _e() {
5466
+ async function ve() {
5374
5467
  try {
5375
5468
  await g.showLatest();
5376
5469
  } catch (e) {
@@ -5378,7 +5471,7 @@ var Du = { class: "kvc-workspace" }, Ou = { class: "kvc-stage" }, ku = {
5378
5471
  }
5379
5472
  G.resume();
5380
5473
  }
5381
- async function ve() {
5474
+ async function ye() {
5382
5475
  if (f.value !== void 0) try {
5383
5476
  let { fileId: e } = await u.exec("kvcoder.session.export", { sessionId: f.value });
5384
5477
  window.location.assign(`/api/files/${encodeURIComponent(e)}?workspaceId=${encodeURIComponent(u.workspace.value.id)}`);
@@ -5386,44 +5479,44 @@ var Du = { class: "kvc-workspace" }, Ou = { class: "kvc-stage" }, ku = {
5386
5479
  J(u, e);
5387
5480
  }
5388
5481
  }
5389
- let ye = () => x.value.at(-1)?.kind === "notice" && x.value.at(-1)?.content.code === "SUMMARY_FAILED";
5390
- async function be() {
5482
+ let be = () => x.value.at(-1)?.kind === "notice" && x.value.at(-1)?.content.code === "SUMMARY_FAILED";
5483
+ async function xe() {
5391
5484
  return (await u.exec("kernel.settings.list", {})).find((e) => e.key === "kvcoder.compactKeep")?.value ?? null;
5392
5485
  }
5393
- async function xe() {
5486
+ async function Se() {
5394
5487
  let e = await W.compact();
5395
- e === !0 ? u.toast("kvcoder.ui.summarized", {}, "success") : e === !1 && !ye() && u.toast("kvcoder.ui.nothingToSummarize", { count: await be() });
5488
+ e === !0 ? u.toast("kvcoder.ui.summarized", {}, "success") : e === !1 && !be() && u.toast("kvcoder.ui.nothingToSummarize", { count: await xe() });
5396
5489
  }
5397
- function Se(e, t) {
5490
+ function Ce(e, t) {
5398
5491
  if (e === "new") return u.navigate("kvcoder.chat");
5399
5492
  if (e === "prompt") return void (m.value = m.value === "prompt" ? "chat" : "prompt");
5400
5493
  if (e === "delete") return void W.remove();
5401
- W.working.value === void 0 && (m.value = "chat", e === "rename" ? W.rename(t) : e === "compact" ? xe() : e === "export" ? W.exportFile() : W.fork());
5494
+ W.working.value === void 0 && (m.value = "chat", e === "rename" ? W.rename(t) : e === "compact" ? Se() : e === "export" ? W.exportFile() : W.fork());
5402
5495
  }
5403
- async function Ce(e, t) {
5404
- W.working.value === void 0 && (m.value = "chat", await W.runRegistered(e, t) && e.message !== void 0 && await te({
5496
+ async function we(e, t) {
5497
+ W.working.value === void 0 && (m.value = "chat", await W.runRegistered(e, t) && e.message !== void 0 && await re({
5405
5498
  text: t === "" ? u.t(e.message) : t,
5406
5499
  fileIds: []
5407
5500
  }));
5408
5501
  }
5409
- let we = (e) => e.id;
5410
- return (t, c) => (_(), i("div", Du, [D(v) && D(f) !== void 0 ? (_(), n(sa, {
5502
+ let Te = (e) => e.id;
5503
+ return (t, c) => (_(), i("div", Pu, [D(v) && D(f) !== void 0 ? (_(), n(la, {
5411
5504
  key: 0,
5412
5505
  session: D(v),
5413
5506
  tab: m.value,
5414
5507
  turns: D(w).length,
5415
5508
  context: D(g).context.value,
5416
- "running-since": z.value,
5417
- artifacts: D(M).list.value.length,
5418
- "artifacts-open": D(M).open.value && !D(N).shown.value,
5419
- map: D(N).counts.value,
5420
- "map-open": D(N).shown.value,
5509
+ "running-since": te.value,
5510
+ artifacts: D(N).list.value.length,
5511
+ "artifacts-open": D(N).open.value && !D(P).shown.value,
5512
+ map: D(P).counts.value,
5513
+ "map-open": D(P).shown.value,
5421
5514
  working: D(W).working.value !== void 0,
5422
5515
  onTab: c[0] ||= (e) => m.value = e,
5423
- onAction: Se,
5424
- onToggleArtifacts: c[1] ||= (e) => D(N).toggleArtifacts(),
5425
- onToggleMap: c[2] ||= (e) => D(N).toggle(),
5426
- onBackgroundRunning: c[3] ||= (e) => oe.value = e
5516
+ onAction: Ce,
5517
+ onToggleArtifacts: c[1] ||= (e) => D(P).toggleArtifacts(),
5518
+ onToggleMap: c[2] ||= (e) => D(P).toggle(),
5519
+ onBackgroundRunning: c[3] ||= (e) => se.value = e
5427
5520
  }, null, 8, [
5428
5521
  "session",
5429
5522
  "tab",
@@ -5435,64 +5528,64 @@ var Du = { class: "kvc-workspace" }, Ou = { class: "kvc-stage" }, ku = {
5435
5528
  "map",
5436
5529
  "map-open",
5437
5530
  "working"
5438
- ])) : r("v-if", !0), a("div", Ou, [a("section", ku, [l.sessionId === void 0 ? (_(), n(di, {
5531
+ ])) : r("v-if", !0), a("div", Fu, [a("section", Iu, [l.sessionId === void 0 ? (_(), n(pi, {
5439
5532
  key: 0,
5440
- registered: D(pe)
5441
- }, null, 8, ["registered"])) : D(v) && D(f) !== void 0 ? (_(), i(e, { key: 1 }, [D(g).loadFailure.value === void 0 ? (_(), i("div", Nu, [a("div", {
5533
+ registered: D(me)
5534
+ }, null, 8, ["registered"])) : D(v) && D(f) !== void 0 ? (_(), i(e, { key: 1 }, [D(g).loadFailure.value === void 0 ? (_(), i("div", Bu, [a("div", {
5442
5535
  ref_key: "list",
5443
- ref: he,
5536
+ ref: ge,
5444
5537
  class: "kvc-scroll",
5445
5538
  onScroll: c[10] ||= (...e) => D(G).onScroll && D(G).onScroll(...e)
5446
- }, [m.value === "prompt" ? (_(), n(ql, {
5539
+ }, [m.value === "prompt" ? (_(), n($l, {
5447
5540
  key: 0,
5448
5541
  "session-id": D(v).id,
5449
5542
  onBack: c[6] ||= (e) => m.value = "chat"
5450
- }, null, 8, ["session-id"])) : (_(), i("div", Pu, [
5451
- D(S) > 0 ? (_(), i("div", Fu, [a("button", {
5543
+ }, null, 8, ["session-id"])) : (_(), i("div", Vu, [
5544
+ D(S) > 0 ? (_(), i("div", Hu, [a("button", {
5452
5545
  type: "button",
5453
5546
  class: "kvc-button",
5454
5547
  "data-test": "show-earlier",
5455
- onClick: ge
5548
+ onClick: _e
5456
5549
  }, E(D(u).t("kvcoder.ui.showEarlier", { count: Math.min(D(S), 200) })), 1), a("button", {
5457
5550
  type: "button",
5458
5551
  class: "kvc-button",
5459
5552
  "data-test": "earlier",
5460
- onClick: ve
5553
+ onClick: ye
5461
5554
  }, E(D(u).t("kvcoder.ui.earlierMessages", { count: D(S) })), 1)])) : r("v-if", !0),
5462
- (_(!0), i(e, null, b(D(x), (t) => (_(), i(e, { key: we(t) }, [s(Gc, {
5555
+ (_(!0), i(e, null, b(D(x), (t) => (_(), i(e, { key: Te(t) }, [s(Zc, {
5463
5556
  message: t,
5464
- calls: I.value,
5465
- "finished-runs": D(L),
5466
- onOpenArtifact: c[7] ||= (e) => D(N).selectArtifact(e)
5557
+ calls: L.value,
5558
+ "finished-runs": D(R),
5559
+ onOpenArtifact: c[7] ||= (e) => D(P).selectArtifact(e)
5467
5560
  }, null, 8, [
5468
5561
  "message",
5469
5562
  "calls",
5470
5563
  "finished-runs"
5471
- ]), V.value.has(t.id) ? (_(), i("span", {
5564
+ ]), ne.value.has(t.id) ? (_(), i("span", {
5472
5565
  key: 0,
5473
5566
  class: "kvc-muted",
5474
- title: V.value.get(t.id)?.tokens,
5567
+ title: ne.value.get(t.id)?.tokens,
5475
5568
  "data-test": "turn-totals"
5476
- }, E(V.value.get(t.id)?.text), 9, Iu)) : r("v-if", !0)], 64))), 128)),
5477
- F.value > 0 ? (_(), i("div", Lu, [o(E(D(u).t("kvcoder.ui.map.remaining", { count: F.value })) + " ", 1), a("button", {
5569
+ }, E(ne.value.get(t.id)?.text), 9, Uu)) : r("v-if", !0)], 64))), 128)),
5570
+ I.value > 0 ? (_(), i("div", Wu, [o(E(D(u).t("kvcoder.ui.map.remaining", { count: I.value })) + " ", 1), a("button", {
5478
5571
  type: "button",
5479
5572
  class: "kvc-link-button",
5480
5573
  "data-test": "map-show",
5481
- onClick: c[8] ||= (e) => D(N).shown.value = !0
5574
+ onClick: c[8] ||= (e) => D(P).shown.value = !0
5482
5575
  }, E(D(u).t("kvcoder.ui.map.show")), 1)])) : r("v-if", !0),
5483
- fe.value ? (_(), n(Bl, {
5576
+ pe.value ? (_(), n(Kl, {
5484
5577
  key: 2,
5485
5578
  "session-id": D(v).id,
5486
5579
  onSent: c[9] ||= (e) => {
5487
5580
  D(G).resume(), D(g).refresh();
5488
5581
  }
5489
5582
  }, null, 8, ["session-id"])) : r("v-if", !0),
5490
- D(T).summarizing ? (_(), i("div", Ru, E(D(u).t("kvcoder.ui.summarizing")), 1)) : r("v-if", !0),
5491
- R.value && (D(T).text !== "" || D(T).thinking !== "") ? (_(), i("div", zu, [D(T).thinking === "" ? r("v-if", !0) : (_(), i("details", {
5583
+ D(T).summarizing ? (_(), i("div", Gu, E(D(u).t("kvcoder.ui.summarizing")), 1)) : r("v-if", !0),
5584
+ z.value && (D(T).text !== "" || D(T).thinking !== "") ? (_(), i("div", Ku, [D(T).thinking === "" ? r("v-if", !0) : (_(), i("details", {
5492
5585
  key: 0,
5493
5586
  open: D(T).text === "" && D(T).calls.length === 0,
5494
5587
  "data-test": "live-thinking"
5495
- }, [a("summary", Vu, E(D(u).t("kvcoder.ui.thinkingNow")), 1), a("p", Hu, E(D(T).thinking), 1)], 8, Bu)), D(T).text === "" ? r("v-if", !0) : (_(), n(C(D(u).View), {
5588
+ }, [a("summary", Ju, E(D(u).t("kvcoder.ui.thinkingNow")), 1), a("p", Yu, E(D(T).thinking), 1)], 8, qu)), D(T).text === "" ? r("v-if", !0) : (_(), n(C(D(u).View), {
5496
5589
  key: 1,
5497
5590
  view: {
5498
5591
  type: "markdown",
@@ -5500,19 +5593,19 @@ var Du = { class: "kvc-workspace" }, Ou = { class: "kvc-stage" }, ku = {
5500
5593
  params: { text: D(T).text }
5501
5594
  }
5502
5595
  }, null, 8, ["view"]))])) : r("v-if", !0),
5503
- R.value ? (_(), n(Aa, {
5596
+ z.value ? (_(), n(Ma, {
5504
5597
  key: 5,
5505
5598
  live: D(T),
5506
5599
  turn: D(w)[0]
5507
5600
  }, null, 8, ["live", "turn"])) : r("v-if", !0),
5508
- D(W).working.value ? (_(), n(_i, {
5601
+ D(W).working.value ? (_(), n(yi, {
5509
5602
  key: 6,
5510
5603
  working: D(W).working.value
5511
5604
  }, null, 8, ["working"])) : r("v-if", !0),
5512
- (_(!0), i(e, null, b(D(k), ([e, t]) => (_(), n(au, {
5605
+ (_(!0), i(e, null, b(D(k), ([e, t]) => (_(), n(du, {
5513
5606
  key: e,
5514
5607
  child: t,
5515
- task: le.value.get(e),
5608
+ task: ue.value.get(e),
5516
5609
  hidden: D(U).hidden.value,
5517
5610
  onAnswer: D(U).answer,
5518
5611
  onDecide: D(U).decide
@@ -5523,13 +5616,13 @@ var Du = { class: "kvc-workspace" }, Ou = { class: "kvc-stage" }, ku = {
5523
5616
  "onAnswer",
5524
5617
  "onDecide"
5525
5618
  ]))), 128)),
5526
- (_(!0), i(e, null, b(ue.value, (e) => (_(), n(fu, {
5619
+ (_(!0), i(e, null, b(de.value, (e) => (_(), n(vu, {
5527
5620
  key: e,
5528
5621
  "session-id": D(v).id,
5529
5622
  "run-id": e
5530
5623
  }, null, 8, ["session-id", "run-id"]))), 128)),
5531
- s(Fl, {
5532
- owner: ce(),
5624
+ s(Vl, {
5625
+ owner: le(),
5533
5626
  pending: B.value,
5534
5627
  hidden: D(U).hidden.value,
5535
5628
  onAnswer: D(U).answer,
@@ -5541,17 +5634,31 @@ var Du = { class: "kvc-workspace" }, Ou = { class: "kvc-stage" }, ku = {
5541
5634
  "onAnswer",
5542
5635
  "onDecide"
5543
5636
  ]),
5544
- B.value.length > 0 ? (_(), i("p", Uu, E(se.value), 1)) : r("v-if", !0)
5637
+ B.value.length > 0 ? (_(), i("p", Xu, E(ce.value), 1)) : r("v-if", !0),
5638
+ D(M).size > 0 ? (_(), i(e, { key: 8 }, [a("p", Zu, E(D(u).t("kvcoder.ui.backgroundDecision")), 1), (_(!0), i(e, null, b(D(M), ([e, t]) => (_(), n(du, {
5639
+ key: e,
5640
+ child: t.child,
5641
+ task: t.call,
5642
+ hidden: D(U).hidden.value,
5643
+ onAnswer: D(U).answer,
5644
+ onDecide: D(U).decide
5645
+ }, null, 8, [
5646
+ "child",
5647
+ "task",
5648
+ "hidden",
5649
+ "onAnswer",
5650
+ "onDecide"
5651
+ ]))), 128))], 64)) : r("v-if", !0)
5545
5652
  ]))], 544), D(G).away.value ? (_(), i("button", {
5546
5653
  key: 0,
5547
5654
  type: "button",
5548
5655
  class: "kvc-button kvc-jump",
5549
5656
  "data-test": "jump-to-latest",
5550
- onClick: _e
5551
- }, [s(D(re), {
5657
+ onClick: ve
5658
+ }, [s(D(ie), {
5552
5659
  size: 16,
5553
5660
  "aria-hidden": "true"
5554
- }), o(E(D(u).t("kvcoder.ui.jumpToLatest")), 1)])) : r("v-if", !0)])) : (_(), i("div", Au, [a("p", ju, E(D(u).t("kvcoder.ui.loadFailed", { error: me.value })), 1), a("div", Mu, [a("button", {
5661
+ }), o(E(D(u).t("kvcoder.ui.jumpToLatest")), 1)])) : r("v-if", !0)])) : (_(), i("div", Lu, [a("p", Ru, E(D(u).t("kvcoder.ui.loadFailed", { error: he.value })), 1), a("div", zu, [a("button", {
5555
5662
  type: "button",
5556
5663
  class: "kvc-button kvc-primary",
5557
5664
  "data-test": "load-again",
@@ -5563,19 +5670,19 @@ var Du = { class: "kvc-workspace" }, Ou = { class: "kvc-stage" }, ku = {
5563
5670
  onClick: c[5] ||= (e) => D(W).exportFile()
5564
5671
  }, E(D(u).t("kvcoder.ui.export")), 1)])])), s(kr, {
5565
5672
  "session-id": D(v).id,
5566
- stoppable: ne.value,
5673
+ stoppable: V.value,
5567
5674
  stopping: H.value === D(v).id,
5568
- "stop-error": ie.value?.sessionId === D(v).id ? ie.value.error : void 0,
5675
+ "stop-error": ae.value?.sessionId === D(v).id ? ae.value.error : void 0,
5569
5676
  placeholder: D(u).t("kvcoder.ui.placeholder"),
5570
5677
  blocked: D(W).working.value !== void 0,
5571
5678
  commands: "run",
5572
- registered: D(pe),
5573
- onSend: te,
5574
- onStop: ae,
5575
- onCommand: Se,
5576
- onRegistered: Ce
5679
+ registered: D(me),
5680
+ onSend: re,
5681
+ onStop: oe,
5682
+ onCommand: Ce,
5683
+ onRegistered: we
5577
5684
  }, {
5578
- controls: j(() => [s(Yl, {
5685
+ controls: j(() => [s(tu, {
5579
5686
  session: D(v),
5580
5687
  onChanged: c[11] ||= (e) => D(g).refresh()
5581
5688
  }, null, 8, ["session"])]),
@@ -5588,16 +5695,16 @@ var Du = { class: "kvc-workspace" }, Ou = { class: "kvc-stage" }, ku = {
5588
5695
  "placeholder",
5589
5696
  "blocked",
5590
5697
  "registered"
5591
- ])], 64)) : r("v-if", !0)]), P.value ? (_(), n($n, {
5698
+ ])], 64)) : r("v-if", !0)]), F.value ? (_(), n($n, {
5592
5699
  key: 0,
5593
- list: D(M).list.value,
5594
- shown: D(M).shown.value,
5595
- content: D(M).content.value,
5596
- map: D(N).map.value,
5597
- "map-shown": D(N).shown.value,
5598
- onSelect: c[12] ||= (e) => D(N).selectArtifact(e),
5599
- onSelectMap: c[13] ||= (e) => D(N).shown.value = !0,
5600
- onClose: c[14] ||= (e) => D(N).close()
5700
+ list: D(N).list.value,
5701
+ shown: D(N).shown.value,
5702
+ content: D(N).content.value,
5703
+ map: D(P).map.value,
5704
+ "map-shown": D(P).shown.value,
5705
+ onSelect: c[12] ||= (e) => D(P).selectArtifact(e),
5706
+ onSelectMap: c[13] ||= (e) => D(P).shown.value = !0,
5707
+ onClose: c[14] ||= (e) => D(P).close()
5601
5708
  }, null, 8, [
5602
5709
  "list",
5603
5710
  "shown",
@@ -5606,13 +5713,13 @@ var Du = { class: "kvc-workspace" }, Ou = { class: "kvc-stage" }, ku = {
5606
5713
  "map-shown"
5607
5714
  ])) : r("v-if", !0)])]));
5608
5715
  }
5609
- }), Gu = /* @__PURE__ */ c({
5716
+ }), $u = /* @__PURE__ */ c({
5610
5717
  __name: "conversation",
5611
5718
  props: { sessionId: {} },
5612
5719
  setup(e) {
5613
5720
  let t = e;
5614
- return (e, r) => (_(), n(Wu, { "session-id": t.sessionId }, null, 8, ["session-id"]));
5721
+ return (e, r) => (_(), n(Qu, { "session-id": t.sessionId }, null, 8, ["session-id"]));
5615
5722
  }
5616
5723
  });
5617
5724
  //#endregion
5618
- export { Gu as default };
5725
+ export { $u as default };