@kvman/kvcoder 0.1.13 → 0.1.14

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 (149) hide show
  1. package/dist/api.d.ts +40 -0
  2. package/dist/api.d.ts.map +1 -1
  3. package/dist/artifacts/delete-artifact.d.ts +9 -0
  4. package/dist/artifacts/delete-artifact.d.ts.map +1 -0
  5. package/dist/artifacts/delete-artifact.js +40 -0
  6. package/dist/artifacts/delete-artifact.js.map +1 -0
  7. package/dist/artifacts/served-artifacts.d.ts +9 -0
  8. package/dist/artifacts/served-artifacts.d.ts.map +1 -0
  9. package/dist/artifacts/served-artifacts.js +45 -0
  10. package/dist/artifacts/served-artifacts.js.map +1 -0
  11. package/dist/calls/run-tool.d.ts +7 -2
  12. package/dist/calls/run-tool.d.ts.map +1 -1
  13. package/dist/calls/run-tool.js +37 -3
  14. package/dist/calls/run-tool.js.map +1 -1
  15. package/dist/connectors/artifact.d.ts +9 -1
  16. package/dist/connectors/artifact.d.ts.map +1 -1
  17. package/dist/connectors/artifact.js +15 -3
  18. package/dist/connectors/artifact.js.map +1 -1
  19. package/dist/connectors/background.d.ts.map +1 -1
  20. package/dist/connectors/background.js +5 -2
  21. package/dist/connectors/background.js.map +1 -1
  22. package/dist/connectors/builtin-connectors.d.ts +9 -0
  23. package/dist/connectors/builtin-connectors.d.ts.map +1 -1
  24. package/dist/connectors/delegate.d.ts.map +1 -1
  25. package/dist/connectors/delegate.js +3 -1
  26. package/dist/connectors/delegate.js.map +1 -1
  27. package/dist/connectors/execution-map.d.ts +2 -1
  28. package/dist/connectors/execution-map.d.ts.map +1 -1
  29. package/dist/connectors/execution-map.js +4 -3
  30. package/dist/connectors/execution-map.js.map +1 -1
  31. package/dist/connectors/fs.d.ts.map +1 -1
  32. package/dist/connectors/fs.js +3 -11
  33. package/dist/connectors/fs.js.map +1 -1
  34. package/dist/delegate/continue-helper.d.ts +6 -3
  35. package/dist/delegate/continue-helper.d.ts.map +1 -1
  36. package/dist/delegate/continue-helper.js +14 -10
  37. package/dist/delegate/continue-helper.js.map +1 -1
  38. package/dist/delegate/workers.d.ts +1 -1
  39. package/dist/delegate/workers.d.ts.map +1 -1
  40. package/dist/delegate/workers.js +13 -2
  41. package/dist/delegate/workers.js.map +1 -1
  42. package/dist/files/file-change.d.ts.map +1 -1
  43. package/dist/files/file-change.js +5 -3
  44. package/dist/files/file-change.js.map +1 -1
  45. package/dist/files/register-changes.d.ts.map +1 -1
  46. package/dist/files/register-changes.js +9 -3
  47. package/dist/files/register-changes.js.map +1 -1
  48. package/dist/files/register-preview.d.ts +3 -0
  49. package/dist/files/register-preview.d.ts.map +1 -0
  50. package/dist/files/register-preview.js +32 -0
  51. package/dist/files/register-preview.js.map +1 -0
  52. package/dist/files/search-text.d.ts +1 -0
  53. package/dist/files/search-text.d.ts.map +1 -1
  54. package/dist/files/search-text.js +11 -7
  55. package/dist/files/search-text.js.map +1 -1
  56. package/dist/files/utf8-text.d.ts +2 -0
  57. package/dist/files/utf8-text.d.ts.map +1 -0
  58. package/dist/files/utf8-text.js +12 -0
  59. package/dist/files/utf8-text.js.map +1 -0
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.js +2 -0
  62. package/dist/index.js.map +1 -1
  63. package/dist/jobs/job-rows.d.ts +3 -4
  64. package/dist/jobs/job-rows.d.ts.map +1 -1
  65. package/dist/jobs/job-rows.js +5 -7
  66. package/dist/jobs/job-rows.js.map +1 -1
  67. package/dist/jobs/process-handlers.js +2 -2
  68. package/dist/jobs/process-handlers.js.map +1 -1
  69. package/dist/jobs/process-report.d.ts +3 -1
  70. package/dist/jobs/process-report.d.ts.map +1 -1
  71. package/dist/jobs/process-report.js +19 -7
  72. package/dist/jobs/process-report.js.map +1 -1
  73. package/dist/jobs/process-run.d.ts +10 -2
  74. package/dist/jobs/process-run.d.ts.map +1 -1
  75. package/dist/jobs/process-run.js +10 -6
  76. package/dist/jobs/process-run.js.map +1 -1
  77. package/dist/jobs/process-text.d.ts +2 -0
  78. package/dist/jobs/process-text.d.ts.map +1 -1
  79. package/dist/jobs/process-text.js +2 -0
  80. package/dist/jobs/process-text.js.map +1 -1
  81. package/dist/jobs/register-jobs.d.ts.map +1 -1
  82. package/dist/jobs/register-jobs.js +29 -1
  83. package/dist/jobs/register-jobs.js.map +1 -1
  84. package/dist/maps/map-rules.d.ts +1 -0
  85. package/dist/maps/map-rules.d.ts.map +1 -1
  86. package/dist/maps/map-rules.js +1 -1
  87. package/dist/maps/map-rules.js.map +1 -1
  88. package/dist/mcp/tools.d.ts +3 -1
  89. package/dist/mcp/tools.d.ts.map +1 -1
  90. package/dist/mcp/tools.js +19 -2
  91. package/dist/mcp/tools.js.map +1 -1
  92. package/dist/messages/receive-message.d.ts.map +1 -1
  93. package/dist/messages/receive-message.js +2 -1
  94. package/dist/messages/receive-message.js.map +1 -1
  95. package/dist/prompt/working-method.d.ts.map +1 -1
  96. package/dist/prompt/working-method.js +13 -6
  97. package/dist/prompt/working-method.js.map +1 -1
  98. package/dist/register-settings.d.ts.map +1 -1
  99. package/dist/register-settings.js +2 -0
  100. package/dist/register-settings.js.map +1 -1
  101. package/dist/schemas/records.d.ts +1 -0
  102. package/dist/schemas/records.d.ts.map +1 -1
  103. package/dist/schemas/records.js +2 -1
  104. package/dist/schemas/records.js.map +1 -1
  105. package/dist/sessions/placeholder-title.d.ts +3 -0
  106. package/dist/sessions/placeholder-title.d.ts.map +1 -0
  107. package/dist/sessions/placeholder-title.js +19 -0
  108. package/dist/sessions/placeholder-title.js.map +1 -0
  109. package/dist/sessions/register-lifecycle.d.ts.map +1 -1
  110. package/dist/sessions/register-lifecycle.js +10 -2
  111. package/dist/sessions/register-lifecycle.js.map +1 -1
  112. package/dist/store/collections.d.ts +2 -0
  113. package/dist/store/collections.d.ts.map +1 -1
  114. package/dist/turns/clear-results.d.ts.map +1 -1
  115. package/dist/turns/clear-results.js +9 -5
  116. package/dist/turns/clear-results.js.map +1 -1
  117. package/dist/turns/compaction.d.ts.map +1 -1
  118. package/dist/turns/compaction.js +2 -1
  119. package/dist/turns/compaction.js.map +1 -1
  120. package/dist/turns/helper-calls.js +1 -1
  121. package/dist/turns/helper-calls.js.map +1 -1
  122. package/dist/turns/model-retry.d.ts +1 -1
  123. package/dist/turns/model-retry.d.ts.map +1 -1
  124. package/dist/turns/model-retry.js +3 -2
  125. package/dist/turns/model-retry.js.map +1 -1
  126. package/dist/turns/run-calls.d.ts.map +1 -1
  127. package/dist/turns/run-calls.js +20 -17
  128. package/dist/turns/run-calls.js.map +1 -1
  129. package/dist/turns/step.d.ts.map +1 -1
  130. package/dist/turns/step.js +6 -3
  131. package/dist/turns/step.js.map +1 -1
  132. package/dist/ui/register-ui.js +2 -2
  133. package/dist/ui/register-ui.js.map +1 -1
  134. package/dist/web/components/approval.css +1 -1
  135. package/dist/web/components/call.css +1 -1
  136. package/dist/web/components/call.js +553 -376
  137. package/dist/web/components/connectors.css +1 -1
  138. package/dist/web/components/connectors.js +5 -6
  139. package/dist/web/components/conversation.css +1 -1
  140. package/dist/web/components/conversation.js +2230 -1797
  141. package/dist/web/components/mcp-sign-in.css +1 -1
  142. package/dist/web/components/model.css +1 -1
  143. package/dist/web/components/model.js +3 -2
  144. package/dist/web/components/preferences.css +1 -1
  145. package/dist/web/components/question.css +1 -1
  146. package/dist/web/components/sessions.css +1 -1
  147. package/locales/ar.json +36 -5
  148. package/locales/en.json +36 -5
  149. package/package.json +6 -6
@@ -67,7 +67,7 @@ var O = ({ name: e, iconNode: t, "icon-node": n, icon: r = {
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
68
  let { size: _, color: v, strokeWidth: y = 2, absoluteStrokeWidth: b = !1, nonScalingStroke: x = !1, class: E = "" } = D(), O = w(i) || w(a) || i === !0 || a === !0 || b === !0, k = w(o) || w(s) || o === !0 || s === !0 || x === !0;
69
69
  delete h.class;
70
- let A = g.default?.(), [, ee, j = []] = S(r, {
70
+ let A = g.default?.(), [, j, M = []] = S(r, {
71
71
  color: m ?? v,
72
72
  width: f ?? d ?? _,
73
73
  height: p ?? d ?? _,
@@ -78,7 +78,7 @@ var O = ({ name: e, iconNode: t, "icon-node": n, icon: r = {
78
78
  hasA11yProp: A != null && A.length > 0 || C(h),
79
79
  attributes: h
80
80
  });
81
- return l("svg", ee, [...j.map(([e, t]) => l(e, t)), ...A ?? []]);
81
+ return l("svg", j, [...M.map(([e, t]) => l(e, t)), ...A ?? []]);
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
@@ -99,14 +99,35 @@ var A = k({
99
99
  d: "m6 9 6 6 6-6",
100
100
  key: "qrunsl"
101
101
  }]]
102
- }), ee = k({
102
+ }), j = k({
103
103
  name: "chevron-right",
104
104
  size: 24,
105
105
  node: [["path", {
106
106
  d: "m9 18 6-6-6-6",
107
107
  key: "mthhwq"
108
108
  }]]
109
- }), j = k({
109
+ }), M = k({
110
+ name: "file-diff",
111
+ size: 24,
112
+ node: [
113
+ ["path", {
114
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
115
+ key: "1oefj6"
116
+ }],
117
+ ["path", {
118
+ d: "M9 10h6",
119
+ key: "9gxzsh"
120
+ }],
121
+ ["path", {
122
+ d: "M12 13V7",
123
+ key: "h0r20n"
124
+ }],
125
+ ["path", {
126
+ d: "M9 17h6",
127
+ key: "r8uit2"
128
+ }]
129
+ ]
130
+ }), ee = k({
110
131
  name: "file",
111
132
  size: 24,
112
133
  node: [["path", {
@@ -124,33 +145,33 @@ var A = k({
124
145
  key: "1kt360"
125
146
  }]]
126
147
  }), ne = 160, re = /^error ([A-Za-z0-9_/-]+): ?(.*)/;
127
- function ie(e) {
148
+ function N(e) {
128
149
  let t = (e.split("\n", 1)[0] ?? "").trim();
129
150
  return t.length > ne ? `${t.slice(0, ne)}…` : t;
130
151
  }
131
- function ae(e) {
152
+ function ie(e) {
132
153
  if (e.startsWith("denied by the user")) return { kind: "denied" };
133
154
  let t = re.exec(e);
134
155
  return t?.[1] === "VALIDATION_FAILED" ? { kind: "invalid" } : t === null ? /\[exit code \d+\]\s*$/.test(e) ? { kind: "command" } : {
135
156
  kind: "error",
136
- message: ie(e)
157
+ message: N(e)
137
158
  } : {
138
159
  kind: "error",
139
- message: ie(t[2] ?? "")
160
+ message: N(t[2] ?? "")
140
161
  };
141
162
  }
142
163
  //#endregion
143
164
  //#region web/src/durations.ts
144
- function M(e, t) {
165
+ function P(e, t) {
145
166
  if (t < 1e3) return e("kvcoder.ui.milliseconds", { count: Math.round(t) });
146
167
  if (t < 1e4) return e("kvcoder.ui.seconds", { count: (t / 1e3).toFixed(1) });
147
168
  let n = Math.round(t / 1e3);
148
169
  return n < 60 ? e("kvcoder.ui.seconds", { count: n }) : n < 3600 ? e("kvcoder.ui.minutesSeconds", {
149
170
  minutes: Math.floor(n / 60),
150
171
  seconds: n % 60
151
- }) : oe(e, n);
172
+ }) : ae(e, n);
152
173
  }
153
- function oe(e, t) {
174
+ function ae(e, t) {
154
175
  let n = Math.floor(t / 60);
155
176
  return e("kvcoder.ui.hoursMinutes", {
156
177
  hours: Math.floor(n / 60),
@@ -159,39 +180,58 @@ function oe(e, t) {
159
180
  }
160
181
  //#endregion
161
182
  //#region web/src/kvman.ts
162
- function N() {
183
+ function F() {
163
184
  let e = u("kvman");
164
185
  if (e === void 0) throw Error("kvcoder components run inside kvwebui, which provides kvman.");
165
186
  return e;
166
187
  }
167
- function P(e) {
188
+ function I(e) {
168
189
  return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : {};
169
190
  }
191
+ function oe(e) {
192
+ let t = e.indexOf("/");
193
+ return t < 0 ? `kernel.errors.${e}` : `${e.slice(0, t)}.errors.${e.slice(t + 1)}`;
194
+ }
195
+ function se(e) {
196
+ if (!(e instanceof Error) || !("problem" in e)) return;
197
+ let t = e.problem;
198
+ if (typeof t == "object" && t && "code" in t && typeof t.code == "string") return {
199
+ code: t.code,
200
+ params: ce("params" in t ? t.params : void 0)
201
+ };
202
+ }
203
+ function ce(e) {
204
+ return Object.fromEntries(Object.entries(I(e)).map(([e, t]) => [e, typeof t == "string" ? t : JSON.stringify(t)]));
205
+ }
206
+ function le(e, t) {
207
+ let n = se(t);
208
+ e.toast(n === void 0 ? "kvcoder.ui.failed" : oe(n.code), n?.params ?? {}, "error");
209
+ }
170
210
  //#endregion
171
211
  //#region web/src/call-results.ts
172
- function se(e) {
173
- let { replacements: t, firstChangedLine: n } = P(e);
212
+ function ue(e) {
213
+ let { replacements: t, firstChangedLine: n } = I(e);
174
214
  return typeof t == "number" && typeof n == "number" ? {
175
215
  replacements: t,
176
216
  firstChangedLine: n
177
217
  } : void 0;
178
218
  }
179
- function ce(e) {
180
- let { fromLine: t, content: n } = P(e);
219
+ function L(e) {
220
+ let { fromLine: t, content: n } = I(e);
181
221
  return typeof t == "number" && typeof n == "string" ? {
182
222
  fromLine: t,
183
223
  content: n
184
224
  } : void 0;
185
225
  }
186
- function le(e) {
187
- let { path: t, error: n, notRead: r, unchanged: i } = P(e);
226
+ function de(e) {
227
+ let { path: t, error: n, notRead: r, unchanged: i } = I(e);
188
228
  if (typeof t != "string") return [];
189
- let a = ce(e);
229
+ let a = L(e);
190
230
  if (a !== void 0) return [{
191
231
  path: t,
192
232
  read: a
193
233
  }];
194
- let { message: o } = P(n);
234
+ let { message: o } = I(n);
195
235
  return typeof o == "string" ? [{
196
236
  path: t,
197
237
  error: o
@@ -203,28 +243,28 @@ function le(e) {
203
243
  state: "unchanged"
204
244
  }] : [];
205
245
  }
206
- function ue(e) {
207
- let t = P(e).files;
208
- return Array.isArray(t) ? t.flatMap(le) : void 0;
246
+ function fe(e) {
247
+ let t = I(e).files;
248
+ return Array.isArray(t) ? t.flatMap(de) : void 0;
209
249
  }
210
- function de(e) {
211
- let { name: t, kind: n, bytes: r } = P(e);
250
+ function pe(e) {
251
+ let { name: t, kind: n, bytes: r } = I(e);
212
252
  return typeof t == "string" && (n === "file" || n === "folder") && typeof r == "number" ? [{
213
253
  name: t,
214
254
  kind: n,
215
255
  bytes: r
216
256
  }] : [];
217
257
  }
218
- function fe(e) {
219
- let t = P(e).entries;
220
- return Array.isArray(t) ? t.flatMap(de) : void 0;
258
+ function me(e) {
259
+ let t = I(e).entries;
260
+ return Array.isArray(t) ? t.flatMap(pe) : void 0;
221
261
  }
222
- function pe(e) {
223
- let t = P(e).paths;
262
+ function he(e) {
263
+ let t = I(e).paths;
224
264
  return Array.isArray(t) ? t.filter((e) => typeof e == "string") : void 0;
225
265
  }
226
- function me(e) {
227
- let { path: t, matches: n, count: r } = P(e);
266
+ function ge(e) {
267
+ let { path: t, matches: n, count: r } = I(e);
228
268
  if (typeof t != "string") return [];
229
269
  if (typeof r == "number") return [{
230
270
  path: t,
@@ -233,7 +273,7 @@ function me(e) {
233
273
  }];
234
274
  if (!Array.isArray(n)) return [];
235
275
  let i = n.flatMap((e) => {
236
- let { line: t, text: n, context: r } = P(e);
276
+ let { line: t, text: n, context: r } = I(e);
237
277
  return typeof t == "number" && typeof n == "string" ? [{
238
278
  line: t,
239
279
  text: n,
@@ -246,18 +286,18 @@ function me(e) {
246
286
  count: i.filter((e) => !e.context).length
247
287
  }];
248
288
  }
249
- var he = [
289
+ var _e = [
250
290
  "running",
251
291
  "succeeded",
252
292
  "failed",
253
293
  "cancelled",
254
294
  "interrupted"
255
295
  ];
256
- function F(e, t) {
257
- return he.some((e) => e === t) ? e(`kvcoder.ui.jobs.status.${t}`) : t;
296
+ function ve(e, t) {
297
+ return _e.some((e) => e === t) ? e(`kvcoder.ui.jobs.status.${t}`) : t;
258
298
  }
259
- function I(e) {
260
- let { kind: t, call: n, status: r, startedAt: i, endedAt: a, exitCode: o, output: s, problem: c } = P(e);
299
+ function ye(e) {
300
+ let { kind: t, call: n, status: r, startedAt: i, endedAt: a, exitCode: o, output: s, problem: c } = I(e);
261
301
  if (typeof n != "string" || typeof r != "string") return;
262
302
  let l = typeof i == "string" && typeof a == "string" ? Date.parse(a) - Date.parse(i) : NaN;
263
303
  return {
@@ -270,36 +310,185 @@ function I(e) {
270
310
  ...c === void 0 ? {} : { problem: c }
271
311
  };
272
312
  }
273
- function L(e) {
274
- let t = P(e).files;
275
- return Array.isArray(t) ? t.flatMap(me) : void 0;
313
+ function be(e) {
314
+ let t = I(e).files;
315
+ return Array.isArray(t) ? t.flatMap(ge) : void 0;
276
316
  }
277
317
  //#endregion
278
- //#region web/src/edit-diff.ts
279
- var R = 3;
318
+ //#region web/src/call-view.ts
319
+ var xe = 200, Se = [
320
+ "text",
321
+ "choice",
322
+ "confirm"
323
+ ];
324
+ function Ce(e) {
325
+ return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
326
+ }
327
+ var R = (e) => typeof e == "string" && e.trim() !== "" ? e : void 0;
328
+ function we(e, t) {
329
+ let n = R(t.args);
330
+ return R(t.line) ?? (n === void 0 ? e : `${e} ${n}`);
331
+ }
332
+ function Te(e) {
333
+ let t = R(e.title) ?? R(e.description), n = R(e.command);
334
+ return {
335
+ ...t === void 0 ? {} : { description: t },
336
+ ...n === void 0 ? {} : { line: n },
337
+ ...e.mode === "async" ? { background: !0 } : {}
338
+ };
339
+ }
340
+ function Ee(e) {
341
+ let t = R(e.connector), n = R(e.command);
342
+ if (t === void 0) return Te(e);
343
+ let r = R(e.description), i = Ce(typeof e.payload == "string" ? void 0 : e.payload) ?? {}, a = t === "ask" ? Se.find((e) => e === n) : void 0;
344
+ return {
345
+ ...r === void 0 ? {} : { description: r },
346
+ connector: t,
347
+ ...n === void 0 ? {} : {
348
+ command: n,
349
+ label: `${t} · ${n}`
350
+ },
351
+ ...n === "exec" ? { line: we(t, i) } : {},
352
+ fields: i,
353
+ ...i.risky === !0 ? { risky: !0 } : {},
354
+ ...i.background === !0 ? { background: !0 } : {},
355
+ ...a === void 0 ? {} : { ask: {
356
+ kind: a,
357
+ question: i
358
+ } }
359
+ };
360
+ }
361
+ var De = [
362
+ "edit",
363
+ "write",
364
+ "read",
365
+ "read-files",
366
+ "list",
367
+ "find",
368
+ "search"
369
+ ];
280
370
  function z(e) {
371
+ return e.line === void 0 ? e.connector === "fs" ? De.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";
372
+ }
373
+ function Oe(e) {
374
+ let t = e.replace(/\s+/g, " ");
375
+ return t.length > xe ? `${t.slice(0, xe)}…` : t;
376
+ }
377
+ //#endregion
378
+ //#region web/src/host-files.ts
379
+ var ke = /^(?:\/|\\\\|[A-Za-z]:[\\/])/;
380
+ function Ae(e, t) {
381
+ if (ke.test(t)) return t;
382
+ let n = t.replace(/^\.\//, "");
383
+ return `${e.replace(/[\\/]+$/, "")}/${n}`;
384
+ }
385
+ function je(e) {
386
+ return e.split(/[\\/]/).filter((e) => e !== "").at(-1) ?? e;
387
+ }
388
+ var Me = (e) => typeof e.fields?.path == "string" && e.fields.path !== "" ? e.fields.path : void 0;
389
+ function Ne(e, t) {
390
+ let n = z(e), r = Me(e);
391
+ if (r === void 0 || n !== "read" && n !== "edit" && n !== "write") return;
392
+ let i = n === "read" ? L(t)?.fromLine : n === "edit" ? ue(t)?.firstChangedLine : void 0;
393
+ return i === void 0 ? { path: r } : {
394
+ path: r,
395
+ line: i
396
+ };
397
+ }
398
+ function Pe(e) {
399
+ let t = z(e), n = Me(e);
400
+ if (n !== void 0) {
401
+ if (t === "write" && typeof e.fields?.content == "string") return {
402
+ path: n,
403
+ content: e.fields.content
404
+ };
405
+ if (t === "edit") return {
406
+ path: n,
407
+ edits: Fe(e.fields?.edits)
408
+ };
409
+ }
410
+ }
411
+ function Fe(e) {
412
+ return Array.isArray(e) ? e.flatMap((e) => {
413
+ let { oldText: t, newText: n, replaceAll: r } = I(e);
414
+ return typeof t != "string" || typeof n != "string" ? [] : [{
415
+ oldText: t,
416
+ newText: n,
417
+ ...r === !0 ? { replaceAll: !0 } : {}
418
+ }];
419
+ }) : [];
420
+ }
421
+ //#endregion
422
+ //#region web/src/CallFileActions.vue?vue&type=script&setup=true&lang.ts
423
+ var Ie = {
424
+ key: 0,
425
+ class: "kvc-card-row kvc-file-actions",
426
+ "data-test": "file-actions"
427
+ }, Le = ["title"], Re = /* @__PURE__ */ c({
428
+ __name: "CallFileActions",
429
+ props: {
430
+ view: {},
431
+ result: {},
432
+ pending: { type: Boolean },
433
+ ran: { type: Boolean }
434
+ },
435
+ setup(e) {
436
+ let n = e, a = F(), c = t(() => Ne(n.view, n.result)), l = t(() => Pe(n.view)), u = t(() => l.value !== void 0 && (n.pending === !0 || n.ran === !0)), d = t(() => a.host.embedded && (c.value !== void 0 || u.value)), p = (e) => Ae(a.workspace.value.path, e);
437
+ async function m() {
438
+ let e = l.value;
439
+ if (e !== void 0) {
440
+ if (n.pending !== !0) return a.host.openChange(p(e.path));
441
+ try {
442
+ let t = await a.exec("kvcoder.file.preview.get", e);
443
+ a.host.openDiff(a.t("kvcoder.ui.host.proposed", { name: je(e.path) }), t.path, t.after);
444
+ } catch (e) {
445
+ le(a, e);
446
+ }
447
+ }
448
+ }
449
+ return (e, t) => d.value ? (f(), i("div", Ie, [c.value ? (f(), i("button", {
450
+ key: 0,
451
+ type: "button",
452
+ class: "kvc-link-button kvc-mono kvc-oneline",
453
+ dir: "ltr",
454
+ title: c.value.path,
455
+ "data-test": "open-file",
456
+ onClick: t[0] ||= (e) => v(a).host.openFile(p(c.value.path), c.value.line)
457
+ }, _(c.value.path), 9, Le)) : r("v-if", !0), u.value ? (f(), i("button", {
458
+ key: 1,
459
+ type: "button",
460
+ class: "kvc-button",
461
+ "data-test": "open-diff",
462
+ onClick: m
463
+ }, [s(v(M), {
464
+ size: 14,
465
+ "aria-hidden": "true"
466
+ }), o(_(v(a).t("kvcoder.ui.host.openDiff")), 1)])) : r("v-if", !0)])) : r("v-if", !0);
467
+ }
468
+ }), ze = 3;
469
+ function B(e) {
281
470
  if (e === "") return [];
282
471
  let t = e.split("\n");
283
472
  return e.endsWith("\n") ? t.slice(0, -1) : t;
284
473
  }
285
- function ge(e, t) {
474
+ function Be(e, t) {
286
475
  let n = 0;
287
476
  for (; n < e.length && n < t.length && e[n] === t[n];) n += 1;
288
477
  return n;
289
478
  }
290
- function _e(e, t) {
291
- let n = z(e), r = z(t), i = ge(n, r), a = ge(n.slice(i).reverse(), r.slice(i).reverse()), o = (e, t) => t.map((t) => ({
479
+ function Ve(e, t) {
480
+ let n = B(e), r = B(t), i = Be(n, r), a = Be(n.slice(i).reverse(), r.slice(i).reverse()), o = (e, t) => t.map((t) => ({
292
481
  kind: e,
293
482
  text: t
294
483
  }));
295
484
  return [
296
- ...o("context", n.slice(Math.max(i - R, 0), i)),
485
+ ...o("context", n.slice(Math.max(i - ze, 0), i)),
297
486
  ...o("removed", n.slice(i, n.length - a)),
298
487
  ...o("added", r.slice(i, r.length - a)),
299
- ...o("context", n.slice(n.length - a, n.length - a + R))
488
+ ...o("context", n.slice(n.length - a, n.length - a + ze))
300
489
  ];
301
490
  }
302
- function ve(e) {
491
+ function He(e) {
303
492
  return {
304
493
  added: e.filter((e) => e.kind === "added").length,
305
494
  removed: e.filter((e) => e.kind === "removed").length
@@ -307,23 +496,23 @@ function ve(e) {
307
496
  }
308
497
  //#endregion
309
498
  //#region web/src/mcp-steps.ts
310
- function ye(e) {
499
+ function V(e) {
311
500
  let t = e.steps;
312
501
  return Array.isArray(t) ? t.map((e, t) => {
313
- let { tool: n, arguments: r } = P(e), i = `${t + 1}.`;
502
+ let { tool: n, arguments: r } = I(e), i = `${t + 1}.`;
314
503
  return typeof n != "string" || n.trim() === "" ? {
315
504
  label: i,
316
- arguments: P(r)
505
+ arguments: I(r)
317
506
  } : {
318
507
  label: `${i} ${n}`,
319
508
  tool: n,
320
- arguments: P(r)
509
+ arguments: I(r)
321
510
  };
322
511
  }) : [];
323
512
  }
324
513
  //#endregion
325
514
  //#region web/src/call-summary.ts
326
- function be(e) {
515
+ function Ue(e) {
327
516
  if (e !== void 0 && /^\s*[[{]/.test(e)) try {
328
517
  return JSON.parse(e);
329
518
  } catch (e) {
@@ -331,48 +520,48 @@ function be(e) {
331
520
  throw e;
332
521
  }
333
522
  }
334
- var B = 1024;
335
- function xe(e, t) {
336
- return t < B ? e("kvcoder.ui.call.bytes", { count: t }) : t < B * B ? e("kvcoder.ui.call.kilobytes", { count: (t / B).toFixed(1) }) : e("kvcoder.ui.call.megabytes", { count: (t / (B * B)).toFixed(1) });
523
+ var H = 1024;
524
+ function We(e, t) {
525
+ return t < H ? e("kvcoder.ui.call.bytes", { count: t }) : t < H * H ? e("kvcoder.ui.call.kilobytes", { count: (t / H).toFixed(1) }) : e("kvcoder.ui.call.megabytes", { count: (t / (H * H)).toFixed(1) });
337
526
  }
338
- var V = (e) => typeof e == "string" && e !== "" ? e : void 0;
339
- function Se(e) {
527
+ var U = (e) => typeof e == "string" && e !== "" ? e : void 0;
528
+ function Ge(e) {
340
529
  let t = e.edits;
341
530
  return Array.isArray(t) ? t.flatMap((e) => {
342
- let { oldText: t, newText: n } = P(e);
531
+ let { oldText: t, newText: n } = I(e);
343
532
  return typeof t == "string" && typeof n == "string" ? [{
344
533
  oldText: t,
345
534
  newText: n
346
535
  }] : [];
347
536
  }) : [];
348
537
  }
349
- function Ce(e) {
350
- let t = Se(e).map((e) => ve(_e(e.oldText, e.newText)));
538
+ function Ke(e) {
539
+ let t = Ge(e).map((e) => He(Ve(e.oldText, e.newText)));
351
540
  return `+${t.reduce((e, t) => e + t.added, 0)} −${t.reduce((e, t) => e + t.removed, 0)}`;
352
541
  }
353
- function we(e, t) {
354
- if (typeof t.bytes == "number" && typeof t.created == "boolean") return e(t.created ? "kvcoder.ui.call.created" : "kvcoder.ui.call.replaced", { size: xe(e, t.bytes) });
542
+ function qe(e, t) {
543
+ if (typeof t.bytes == "number" && typeof t.created == "boolean") return e(t.created ? "kvcoder.ui.call.created" : "kvcoder.ui.call.replaced", { size: We(e, t.bytes) });
355
544
  }
356
- function Te(e, t) {
545
+ function Je(e, t) {
357
546
  let { fromLine: n, totalLines: r, content: i } = t;
358
547
  if (typeof n != "number" || typeof r != "number" || typeof i != "string") return;
359
- let a = z(i).length;
548
+ let a = B(i).length;
360
549
  return a === 0 ? void 0 : e("kvcoder.ui.call.lines", {
361
550
  from: n,
362
551
  to: n + a - 1,
363
552
  total: r
364
553
  });
365
554
  }
366
- function Ee(e, t) {
555
+ function Ye(e, t) {
367
556
  let n = t.entries;
368
557
  if (Array.isArray(n)) return e(t.truncated === !0 ? "kvcoder.ui.call.entriesFirst" : "kvcoder.ui.call.entries", { count: n.length });
369
558
  }
370
- function De(e, t) {
559
+ function Xe(e, t) {
371
560
  let n = t.paths;
372
561
  if (Array.isArray(n)) return e(t.truncated === !0 ? "kvcoder.ui.call.filesFirst" : "kvcoder.ui.call.files", { count: n.length });
373
562
  }
374
- function Oe(e, t) {
375
- let n = L(t);
563
+ function Ze(e, t) {
564
+ let n = be(t);
376
565
  if (n === void 0) return;
377
566
  let r = n.reduce((e, t) => e + t.count, 0);
378
567
  return e("kvcoder.ui.call.matches", {
@@ -380,166 +569,106 @@ function Oe(e, t) {
380
569
  files: e("kvcoder.ui.call.files", { count: n.length })
381
570
  });
382
571
  }
383
- var H = (e, t, n) => Array.isArray(n) ? e(t, { count: n.length }) : void 0;
384
- function U(e, t, n) {
572
+ var W = (e, t, n) => Array.isArray(n) ? e(t, { count: n.length }) : void 0;
573
+ function G(e, t, n) {
385
574
  return {
386
575
  ...e === void 0 ? {} : { words: e },
387
576
  ...t === void 0 ? {} : { subject: t },
388
577
  ...n === void 0 ? {} : { outcome: n }
389
578
  };
390
579
  }
391
- function ke(e) {
580
+ function Qe(e) {
392
581
  let t = e.files;
393
582
  if (!Array.isArray(t)) return;
394
583
  let n = t.flatMap((e) => {
395
- let { path: t } = P(e);
584
+ let { path: t } = I(e);
396
585
  return typeof t == "string" ? [t] : [];
397
586
  });
398
587
  return n.length === 0 ? void 0 : n.join(", ");
399
588
  }
400
- function Ae(e, t, n, r) {
401
- let i = r === void 0 ? void 0 : P(r), a = V(n.path);
402
- if (t === "edit") return U(e("kvcoder.ui.call.edit"), a, i === void 0 ? void 0 : Ce(n));
403
- if (t === "write") return U(e("kvcoder.ui.call.write"), a, i === void 0 ? void 0 : we(e, i));
404
- if (t === "read") return U(e("kvcoder.ui.call.read"), a, i === void 0 ? void 0 : Te(e, i));
405
- if (t === "read-files") return U(e("kvcoder.ui.call.read"), ke(n), i === void 0 ? void 0 : H(e, "kvcoder.ui.call.files", i.files));
406
- if (t === "list") return U(e("kvcoder.ui.call.list"), a ?? ".", i === void 0 ? void 0 : Ee(e, i));
407
- if (t === "find") return U(e("kvcoder.ui.call.find"), V(n.pattern), i === void 0 ? void 0 : De(e, i));
408
- if (t === "search") return U(e("kvcoder.ui.call.search"), V(n.pattern), i === void 0 ? void 0 : Oe(e, i));
409
- }
410
- function je(e, t, n, r) {
411
- let i = V(n.server), a = [i, V(n.tool)].filter((e) => e !== void 0).join(" · ");
412
- if (t === "call") return U(void 0, a === "" ? void 0 : a);
413
- if (t === "run") return U(void 0, [i, ye(n).flatMap((e) => e.tool === void 0 ? [] : [e.tool]).join(", ")].filter((e) => e !== void 0 && e !== "").join(" · "));
414
- if (t === "tools") return U(e("kvcoder.ui.call.tools"), a === "" ? void 0 : a, H(e, "kvcoder.ui.call.toolCount", P(r).tools));
415
- }
416
- function Me(e, t, n, r) {
417
- if (t === "list") return U(e("kvcoder.ui.call.backgroundRuns"), void 0, H(e, "kvcoder.ui.call.runCount", r));
589
+ function $e(e, t, n, r) {
590
+ let i = r === void 0 ? void 0 : I(r), a = U(n.path);
591
+ if (t === "edit") return G(e("kvcoder.ui.call.edit"), a, i === void 0 ? void 0 : Ke(n));
592
+ if (t === "write") return G(e("kvcoder.ui.call.write"), a, i === void 0 ? void 0 : qe(e, i));
593
+ if (t === "read") return G(e("kvcoder.ui.call.read"), a, i === void 0 ? void 0 : Je(e, i));
594
+ if (t === "read-files") return G(e("kvcoder.ui.call.read"), Qe(n), i === void 0 ? void 0 : W(e, "kvcoder.ui.call.files", i.files));
595
+ if (t === "list") return G(e("kvcoder.ui.call.list"), a ?? ".", i === void 0 ? void 0 : Ye(e, i));
596
+ if (t === "find") return G(e("kvcoder.ui.call.find"), U(n.pattern), i === void 0 ? void 0 : Xe(e, i));
597
+ if (t === "search") return G(e("kvcoder.ui.call.search"), U(n.pattern), i === void 0 ? void 0 : Ze(e, i));
598
+ }
599
+ function et(e, t, n, r) {
600
+ let i = U(n.server), a = [i, U(n.tool)].filter((e) => e !== void 0).join(" · ");
601
+ if (t === "call") return G(void 0, a === "" ? void 0 : a);
602
+ if (t === "run") return G(void 0, [i, V(n).flatMap((e) => e.tool === void 0 ? [] : [e.tool]).join(", ")].filter((e) => e !== void 0 && e !== "").join(" · "));
603
+ if (t === "tools") return G(e("kvcoder.ui.call.tools"), a === "" ? void 0 : a, W(e, "kvcoder.ui.call.toolCount", I(r).tools));
604
+ }
605
+ function tt(e, t, n, r) {
606
+ if (t === "list") return G(e("kvcoder.ui.call.backgroundRuns"), void 0, W(e, "kvcoder.ui.call.runCount", r));
418
607
  if (t === "output" || t === "wait") {
419
- let i = I(r);
420
- return U(e(`kvcoder.ui.call.${t}`), V(n.id), i === void 0 ? void 0 : F(e, i.status));
608
+ let i = ye(r);
609
+ return G(e(`kvcoder.ui.call.${t}`), U(n.id), i === void 0 ? void 0 : ve(e, i.status));
421
610
  }
422
- if (t === "stop") return U(e("kvcoder.ui.call.stop"), V(n.id));
611
+ if (t === "stop") return G(e("kvcoder.ui.call.stop"), U(n.id));
423
612
  }
424
- function Ne(e, t, n, r) {
425
- let i = V(P(r).progress), a = n.steps, o = Array.isArray(a) ? a.flatMap((e) => V(P(e).id) === void 0 ? [] : [String(P(e).id)]).join(", ") : void 0;
426
- return t === "set" ? U(e("kvcoder.ui.call.mapSet"), V(n.goal), i) : t === "detail" ? U(e("kvcoder.ui.call.mapDetail"), V(n.id), i) : t === "update" ? U(e("kvcoder.ui.call.mapUpdate"), o === "" ? void 0 : o, i) : t === "note" ? U(e("kvcoder.ui.call.mapNote"), V(n.text)) : t === "get" ? U(e("kvcoder.ui.call.mapGet"), void 0, i) : void 0;
613
+ function nt(e, t, n, r) {
614
+ let i = U(I(r).progress), a = n.steps, o = Array.isArray(a) ? a.flatMap((e) => U(I(e).id) === void 0 ? [] : [String(I(e).id)]).join(", ") : void 0;
615
+ return t === "set" ? G(e("kvcoder.ui.call.mapSet"), U(n.goal), i) : t === "detail" ? G(e("kvcoder.ui.call.mapDetail"), U(n.id), i) : t === "update" ? G(e("kvcoder.ui.call.mapUpdate"), o === "" ? void 0 : o, i) : t === "note" ? G(e("kvcoder.ui.call.mapNote"), U(n.text)) : t === "get" ? G(e("kvcoder.ui.call.mapGet"), void 0, i) : void 0;
427
616
  }
428
- function Pe(e, t, n) {
617
+ function rt(e, t, n) {
429
618
  let { connector: r, command: i } = t, a = t.fields ?? {};
430
619
  if (r !== void 0 && i !== void 0) {
431
620
  if (t.line !== void 0) return { subject: `$ ${t.line}` };
432
- if (i === "help") return U(e("kvcoder.ui.call.help"), [r, V(a.command)].filter((e) => e !== void 0).join(" "));
433
- if (r === "fs") return Ae(e, i, a, n);
434
- if (r === "mcp") return je(e, i, a, n);
435
- if (r === "background") return Me(e, i, a, n);
436
- if (r === "execution-map") return Ne(e, i, a, n);
437
- if (r === "delegate" && i === "run") return U(e("kvcoder.ui.call.delegate"), [V(a.worker), V(a.title)].filter((e) => e !== void 0).join(" · "));
438
- if (r === "artifact" && i === "get") return U(e("kvcoder.ui.call.readArtifact"), V(a.id));
439
- if (r === "web" && i === "fetch") return U(e("kvcoder.ui.call.fetch"), V(a.url));
440
- if (r === "artifact" && (i === "write" || i === "edit")) return U(e(`kvcoder.ui.call.${i}Artifact`), V(a.id));
621
+ if (i === "help") return G(e("kvcoder.ui.call.help"), [r, U(a.command)].filter((e) => e !== void 0).join(" "));
622
+ if (r === "fs") return $e(e, i, a, n);
623
+ if (r === "mcp") return et(e, i, a, n);
624
+ if (r === "background") return tt(e, i, a, n);
625
+ if (r === "execution-map") return nt(e, i, a, n);
626
+ if (r === "delegate" && i === "run") return G(e("kvcoder.ui.call.delegate"), [U(a.worker), U(a.title)].filter((e) => e !== void 0).join(" · "));
627
+ if (r === "artifact" && i === "get") return G(e("kvcoder.ui.call.readArtifact"), U(a.id));
628
+ if (r === "web" && i === "fetch") return G(e("kvcoder.ui.call.fetch"), U(a.url));
629
+ if (r === "artifact" && (i === "write" || i === "edit")) return G(e(`kvcoder.ui.call.${i}Artifact`), U(a.id));
441
630
  }
442
631
  }
443
632
  //#endregion
444
- //#region web/src/call-view.ts
445
- var Fe = 200, Ie = [
446
- "text",
447
- "choice",
448
- "confirm"
449
- ];
450
- function Le(e) {
451
- return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
452
- }
453
- var W = (e) => typeof e == "string" && e.trim() !== "" ? e : void 0;
454
- function Re(e, t) {
455
- let n = W(t.args);
456
- return W(t.line) ?? (n === void 0 ? e : `${e} ${n}`);
457
- }
458
- function ze(e) {
459
- let t = W(e.title) ?? W(e.description), n = W(e.command);
460
- return {
461
- ...t === void 0 ? {} : { description: t },
462
- ...n === void 0 ? {} : { line: n },
463
- ...e.mode === "async" ? { background: !0 } : {}
464
- };
465
- }
466
- function Be(e) {
467
- let t = W(e.connector), n = W(e.command);
468
- if (t === void 0) return ze(e);
469
- let r = W(e.description), i = Le(typeof e.payload == "string" ? void 0 : e.payload) ?? {}, a = t === "ask" ? Ie.find((e) => e === n) : void 0;
470
- return {
471
- ...r === void 0 ? {} : { description: r },
472
- connector: t,
473
- ...n === void 0 ? {} : {
474
- command: n,
475
- label: `${t} · ${n}`
476
- },
477
- ...n === "exec" ? { line: Re(t, i) } : {},
478
- fields: i,
479
- ...i.risky === !0 ? { risky: !0 } : {},
480
- ...i.background === !0 ? { background: !0 } : {},
481
- ...a === void 0 ? {} : { ask: {
482
- kind: a,
483
- question: i
484
- } }
485
- };
486
- }
487
- var Ve = [
488
- "edit",
489
- "write",
490
- "read",
491
- "read-files",
492
- "list",
493
- "find",
494
- "search"
495
- ];
496
- function G(e) {
497
- return e.line === void 0 ? e.connector === "fs" ? Ve.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";
498
- }
499
- function K(e) {
500
- let t = e.replace(/\s+/g, " ");
501
- return t.length > Fe ? `${t.slice(0, Fe)}…` : t;
502
- }
503
- //#endregion
504
633
  //#region web/src/field-rows.ts
505
- var He = "—", Ue = (e) => e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean", We = (e) => e === null ? He : String(e);
506
- function Ge(e) {
634
+ var it = "—", at = (e) => e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean", ot = (e) => e === null ? it : String(e);
635
+ function st(e) {
507
636
  return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
508
637
  }
509
- function Ke(e) {
510
- let t = Ge(e);
638
+ function ct(e) {
639
+ let t = st(e);
511
640
  if (t === void 0) return;
512
641
  let n = {};
513
642
  for (let [e, r] of Object.entries(t)) {
514
- if (!Ue(r)) return;
643
+ if (!at(r)) return;
515
644
  n[e] = r;
516
645
  }
517
646
  return n;
518
647
  }
519
- function qe(e) {
648
+ function lt(e) {
520
649
  let t = [...new Set(e.flatMap((e) => Object.keys(e)))];
521
650
  return {
522
651
  kind: "table",
523
652
  columns: t,
524
- rows: e.map((e) => t.map((t) => t in e ? We(e[t] ?? null) : ""))
653
+ rows: e.map((e) => t.map((t) => t in e ? ot(e[t] ?? null) : ""))
525
654
  };
526
655
  }
527
- function Je(e) {
656
+ function ut(e) {
528
657
  if (e.length === 0) return { kind: "empty" };
529
- if (e.every(Ue)) return {
658
+ if (e.every(at)) return {
530
659
  kind: "items",
531
- items: e.map(We)
660
+ items: e.map(ot)
532
661
  };
533
- let t = e.map(Ke).filter((e) => e !== void 0);
534
- return t.length === e.length ? qe(t) : {
662
+ let t = e.map(ct).filter((e) => e !== void 0);
663
+ return t.length === e.length ? lt(t) : {
535
664
  kind: "rows",
536
665
  rows: e.map((e, t) => ({
537
666
  name: String(t + 1),
538
- value: q(e)
667
+ value: K(e)
539
668
  }))
540
669
  };
541
670
  }
542
- function q(e) {
671
+ function K(e) {
543
672
  if (typeof e == "string") return e.includes("\n") ? {
544
673
  kind: "block",
545
674
  text: e
@@ -551,27 +680,27 @@ function q(e) {
551
680
  kind: "text",
552
681
  text: String(e)
553
682
  };
554
- if (Array.isArray(e)) return Je(e);
555
- let t = Ge(e);
683
+ if (Array.isArray(e)) return ut(e);
684
+ let t = st(e);
556
685
  return t === void 0 || Object.keys(t).length === 0 ? { kind: "empty" } : {
557
686
  kind: "rows",
558
- rows: Ye(t)
687
+ rows: dt(t)
559
688
  };
560
689
  }
561
- function Ye(e) {
690
+ function dt(e) {
562
691
  return Object.entries(e).map(([e, t]) => ({
563
692
  name: e,
564
- value: q(t)
693
+ value: K(t)
565
694
  }));
566
695
  }
567
- function J(e, t) {
696
+ function q(e, t) {
568
697
  return t || e.length <= 12 ? e : e.slice(0, 12);
569
698
  }
570
- var Xe = (e) => z(e).map((e) => ({ text: e })), Y = (e, t) => z(e).map((e, n) => ({
699
+ var ft = (e) => B(e).map((e) => ({ text: e })), J = (e, t) => B(e).map((e, n) => ({
571
700
  text: e,
572
701
  number: t + n
573
702
  }));
574
- function Ze(e, t) {
703
+ function pt(e, t) {
575
704
  return t || e.length <= 17 ? e : [
576
705
  ...e.slice(0, 12),
577
706
  "⋯",
@@ -580,7 +709,7 @@ function Ze(e, t) {
580
709
  }
581
710
  //#endregion
582
711
  //#region web/src/FoldButton.vue?vue&type=script&setup=true&lang.ts
583
- var Qe = ["aria-expanded"], X = /* @__PURE__ */ c({
712
+ var mt = ["aria-expanded"], Y = /* @__PURE__ */ c({
584
713
  __name: "FoldButton",
585
714
  props: {
586
715
  count: {},
@@ -589,7 +718,7 @@ var Qe = ["aria-expanded"], X = /* @__PURE__ */ c({
589
718
  },
590
719
  emits: ["toggle"],
591
720
  setup(e, { emit: t }) {
592
- let n = e, a = t, o = N();
721
+ let n = e, a = t, o = F();
593
722
  return (e, t) => n.count > (n.over ?? v(12)) ? (f(), i("button", {
594
723
  key: 0,
595
724
  type: "button",
@@ -597,13 +726,13 @@ var Qe = ["aria-expanded"], X = /* @__PURE__ */ c({
597
726
  "aria-expanded": n.open,
598
727
  "data-test": "show-all",
599
728
  onClick: t[0] ||= (e) => a("toggle")
600
- }, _(n.open ? v(o).t("kvcoder.ui.call.showFewer") : v(o).t("kvcoder.ui.call.showAll", { count: n.count })), 9, Qe)) : r("v-if", !0);
729
+ }, _(n.open ? v(o).t("kvcoder.ui.call.showFewer") : v(o).t("kvcoder.ui.call.showAll", { count: n.count })), 9, mt)) : r("v-if", !0);
601
730
  }
602
- }), $e = /http:\/\/(?:127\.0\.0\.1|localhost):\d+[^\s"'`<>()[\]{}]*/g, et = /[.,;:!?]+$/;
603
- function tt(e) {
731
+ }), ht = /http:\/\/(?:127\.0\.0\.1|localhost):\d+[^\s"'`<>()[\]{}]*/g, gt = /[.,;:!?]+$/;
732
+ function _t(e) {
604
733
  let t = [], n = 0;
605
- for (let r of e.matchAll($e)) {
606
- let i = r[0].replace(et, "");
734
+ for (let r of e.matchAll(ht)) {
735
+ let i = r[0].replace(gt, "");
607
736
  r.index > n && t.push({
608
737
  kind: "text",
609
738
  text: e.slice(n, r.index)
@@ -619,134 +748,134 @@ function tt(e) {
619
748
  }
620
749
  //#endregion
621
750
  //#region web/src/LinkedText.vue?vue&type=script&setup=true&lang.ts
622
- var nt = ["href"], Z = /* @__PURE__ */ c({
751
+ var vt = ["href"], X = /* @__PURE__ */ c({
623
752
  __name: "LinkedText",
624
753
  props: { text: {} },
625
754
  setup(n) {
626
- let r = n, a = t(() => tt(r.text));
755
+ let r = n, a = t(() => _t(r.text));
627
756
  return (t, n) => (f(!0), i(e, null, m(a.value, (t, n) => (f(), i(e, { key: n }, [t.kind === "link" ? (f(), i("a", {
628
757
  key: 0,
629
758
  href: t.href,
630
759
  target: "_blank",
631
760
  rel: "noopener noreferrer",
632
761
  class: "kvc-link"
633
- }, _(t.href), 9, nt)) : (f(), i(e, { key: 1 }, [o(_(t.text), 1)], 64))], 64))), 128));
762
+ }, _(t.href), 9, vt)) : (f(), i(e, { key: 1 }, [o(_(t.text), 1)], 64))], 64))), 128));
634
763
  }
635
- }), rt = { class: "kvc-code-lines" }, it = ["dir", "data-kind"], at = {
764
+ }), yt = { class: "kvc-code-lines" }, bt = ["dir", "data-kind"], xt = {
636
765
  key: 0,
637
766
  class: "kvc-line-number",
638
767
  "data-test": "call-line-number"
639
- }, ot = {
768
+ }, St = {
640
769
  key: 1,
641
770
  class: "kvc-line-mark",
642
771
  "aria-hidden": "true"
643
- }, st = {
772
+ }, Ct = {
644
773
  class: "kvc-line-text",
645
774
  dir: "auto",
646
775
  "data-test": "call-line-text"
647
- }, Q = /* @__PURE__ */ c({
776
+ }, Z = /* @__PURE__ */ c({
648
777
  __name: "FoldedLines",
649
778
  props: { lines: {} },
650
779
  setup(n) {
651
- let o = n, c = p(!1), l = t(() => J(o.lines, c.value)), u = t(() => o.lines.some((e) => e.number !== void 0)), d = t(() => o.lines.some((e) => e.kind !== void 0)), h = {
780
+ let o = n, c = p(!1), l = t(() => q(o.lines, c.value)), u = t(() => o.lines.some((e) => e.number !== void 0)), d = t(() => o.lines.some((e) => e.kind !== void 0)), h = {
652
781
  context: " ",
653
782
  removed: "−",
654
783
  added: "+"
655
784
  };
656
- return (t, n) => (f(), i("div", rt, [(f(!0), i(e, null, m(l.value, (e, t) => (f(), i("div", {
785
+ return (t, n) => (f(), i("div", yt, [(f(!0), i(e, null, m(l.value, (e, t) => (f(), i("div", {
657
786
  key: t,
658
787
  class: "kvc-code-line",
659
788
  dir: u.value || d.value ? "ltr" : void 0,
660
789
  "data-kind": e.kind,
661
790
  "data-test": "call-line-row"
662
791
  }, [
663
- u.value ? (f(), i("span", at, _(e.number), 1)) : r("v-if", !0),
664
- d.value ? (f(), i("span", ot, _(h[e.kind ?? "context"]), 1)) : r("v-if", !0),
665
- a("span", st, [s(Z, { text: e.text }, null, 8, ["text"])])
666
- ], 8, it))), 128)), s(X, {
792
+ u.value ? (f(), i("span", xt, _(e.number), 1)) : r("v-if", !0),
793
+ d.value ? (f(), i("span", St, _(h[e.kind ?? "context"]), 1)) : r("v-if", !0),
794
+ a("span", Ct, [s(X, { text: e.text }, null, 8, ["text"])])
795
+ ], 8, bt))), 128)), s(Y, {
667
796
  count: o.lines.length,
668
797
  open: c.value,
669
798
  onToggle: n[0] ||= (e) => c.value = !c.value
670
799
  }, null, 8, ["count", "open"])]));
671
800
  }
672
- }), ct = {
801
+ }), wt = {
673
802
  key: 0,
674
803
  dir: "auto",
675
804
  "data-test": "field-text"
676
- }, lt = {
805
+ }, Tt = {
677
806
  key: 1,
678
807
  class: "kvc-muted",
679
808
  "data-test": "field-empty"
680
- }, ut = {
809
+ }, Et = {
681
810
  key: 3,
682
811
  class: "kvc-field-table"
683
- }, dt = { "data-test": "field-table" }, ft = {
812
+ }, Dt = { "data-test": "field-table" }, Ot = {
684
813
  key: 4,
685
814
  class: "kvc-field-items",
686
815
  "data-test": "field-items"
687
- }, pt = {
816
+ }, kt = {
688
817
  key: 5,
689
818
  class: "kvc-fields",
690
819
  "data-test": "call-fields"
691
- }, mt = ["data-name"], ht = {
820
+ }, At = ["data-name"], jt = {
692
821
  class: "kvc-muted",
693
822
  dir: "ltr"
694
- }, gt = { "data-test": "field-value" }, $ = /* @__PURE__ */ c({
823
+ }, Mt = { "data-test": "field-value" }, Q = /* @__PURE__ */ c({
695
824
  __name: "FieldsView",
696
825
  props: { value: {} },
697
826
  setup(r) {
698
- let o = r, c = p(!1), l = t(() => o.value.kind === "table" ? J(o.value.rows, c.value) : []), u = t(() => o.value.kind === "items" ? J(o.value.items, c.value) : []);
827
+ let o = r, c = p(!1), l = t(() => o.value.kind === "table" ? q(o.value.rows, c.value) : []), u = t(() => o.value.kind === "items" ? q(o.value.items, c.value) : []);
699
828
  return (t, r) => {
700
829
  let d = h("FieldsView", !0);
701
- return o.value.kind === "text" ? (f(), i("span", ct, [s(Z, { text: o.value.text }, null, 8, ["text"])])) : o.value.kind === "empty" ? (f(), i("span", lt, "—")) : o.value.kind === "block" ? (f(), n(Q, {
830
+ return o.value.kind === "text" ? (f(), i("span", wt, [s(X, { text: o.value.text }, null, 8, ["text"])])) : o.value.kind === "empty" ? (f(), i("span", Tt, "—")) : o.value.kind === "block" ? (f(), n(Z, {
702
831
  key: 2,
703
832
  class: "kvc-field-block",
704
- lines: v(Xe)(o.value.text),
833
+ lines: v(ft)(o.value.text),
705
834
  "data-test": "field-block"
706
- }, null, 8, ["lines"])) : o.value.kind === "table" ? (f(), i("div", ut, [a("table", dt, [a("thead", null, [a("tr", null, [(f(!0), i(e, null, m(o.value.columns, (e) => (f(), i("th", {
835
+ }, null, 8, ["lines"])) : o.value.kind === "table" ? (f(), i("div", Et, [a("table", Dt, [a("thead", null, [a("tr", null, [(f(!0), i(e, null, m(o.value.columns, (e) => (f(), i("th", {
707
836
  key: e,
708
837
  scope: "col",
709
838
  dir: "ltr"
710
839
  }, _(e), 1))), 128))])]), a("tbody", null, [(f(!0), i(e, null, m(l.value, (t, n) => (f(), i("tr", { key: n }, [(f(!0), i(e, null, m(t, (e, t) => (f(), i("td", {
711
840
  key: t,
712
841
  dir: "auto"
713
- }, [s(Z, { text: e }, null, 8, ["text"])]))), 128))]))), 128))])]), s(X, {
842
+ }, [s(X, { text: e }, null, 8, ["text"])]))), 128))]))), 128))])]), s(Y, {
714
843
  count: o.value.rows.length,
715
844
  open: c.value,
716
845
  onToggle: r[0] ||= (e) => c.value = !c.value
717
- }, null, 8, ["count", "open"])])) : o.value.kind === "items" ? (f(), i("div", ft, [(f(!0), i(e, null, m(u.value, (e, t) => (f(), i("div", {
846
+ }, null, 8, ["count", "open"])])) : o.value.kind === "items" ? (f(), i("div", Ot, [(f(!0), i(e, null, m(u.value, (e, t) => (f(), i("div", {
718
847
  key: t,
719
848
  dir: "auto"
720
- }, [s(Z, { text: e }, null, 8, ["text"])]))), 128)), s(X, {
849
+ }, [s(X, { text: e }, null, 8, ["text"])]))), 128)), s(Y, {
721
850
  count: o.value.items.length,
722
851
  open: c.value,
723
852
  onToggle: r[1] ||= (e) => c.value = !c.value
724
- }, null, 8, ["count", "open"])])) : (f(), i("dl", pt, [(f(!0), i(e, null, m(o.value.rows, (e) => (f(), i("div", {
853
+ }, null, 8, ["count", "open"])])) : (f(), i("dl", kt, [(f(!0), i(e, null, m(o.value.rows, (e) => (f(), i("div", {
725
854
  key: e.name,
726
855
  class: "kvc-field-row",
727
856
  "data-name": e.name,
728
857
  "data-test": "field-row"
729
- }, [a("dt", ht, _(e.name), 1), a("dd", gt, [s(d, { value: e.value }, null, 8, ["value"])])], 8, mt))), 128))]));
858
+ }, [a("dt", jt, _(e.name), 1), a("dd", Mt, [s(d, { value: e.value }, null, 8, ["value"])])], 8, At))), 128))]));
730
859
  };
731
860
  }
732
- }), _t = ["aria-label"], vt = ["aria-label"], yt = {
861
+ }), Nt = ["aria-label"], Pt = ["aria-label"], Ft = {
733
862
  class: "kvc-mono",
734
863
  dir: "ltr",
735
864
  "data-test": "call-step-tool"
736
- }, bt = { class: "kvc-step-arguments" }, xt = ["aria-label"], St = /* @__PURE__ */ c({
865
+ }, It = { class: "kvc-step-arguments" }, Lt = ["aria-label"], Rt = /* @__PURE__ */ c({
737
866
  __name: "CallRequest",
738
867
  props: { view: {} },
739
868
  setup(o) {
740
- let c = o, l = N(), u = t(() => G(c.view)), d = t(() => c.view.fields ?? {}), p = t(() => Se(d.value).map((e) => _e(e.oldText, e.newText))), h = t(() => typeof d.value.content == "string" ? d.value.content : ""), g = t(() => typeof d.value.task == "string" ? d.value.task : ""), y = t(() => u.value === "mcp-run" ? ye(d.value) : []), b = t(() => u.value === "mcp-call" ? P(d.value.arguments) : u.value === "fields" ? d.value : {});
741
- return (t, o) => u.value === "edit" ? (f(!0), i(e, { key: 0 }, m(p.value, (e, t) => (f(), n(Q, {
869
+ let c = o, l = F(), u = t(() => z(c.view)), d = t(() => c.view.fields ?? {}), p = t(() => Ge(d.value).map((e) => Ve(e.oldText, e.newText))), h = t(() => typeof d.value.content == "string" ? d.value.content : ""), g = t(() => typeof d.value.task == "string" ? d.value.task : ""), y = t(() => u.value === "mcp-run" ? V(d.value) : []), b = t(() => u.value === "mcp-call" ? I(d.value.arguments) : u.value === "fields" ? d.value : {});
870
+ return (t, o) => u.value === "edit" ? (f(!0), i(e, { key: 0 }, m(p.value, (e, t) => (f(), n(Z, {
742
871
  key: t,
743
872
  class: "kvc-block",
744
873
  lines: e,
745
874
  "data-test": "call-diff"
746
- }, null, 8, ["lines"]))), 128)) : u.value === "write" ? (f(), n(Q, {
875
+ }, null, 8, ["lines"]))), 128)) : u.value === "write" ? (f(), n(Z, {
747
876
  key: 1,
748
877
  class: "kvc-block",
749
- lines: v(Y)(h.value, 1),
878
+ lines: v(J)(h.value, 1),
750
879
  "data-test": "call-content"
751
880
  }, null, 8, ["lines"])) : u.value === "line" ? (f(), i("pre", {
752
881
  key: 2,
@@ -754,7 +883,7 @@ var nt = ["href"], Z = /* @__PURE__ */ c({
754
883
  dir: "ltr",
755
884
  "aria-label": v(l).t("kvcoder.ui.command"),
756
885
  "data-test": "call-payload"
757
- }, "$ " + _(c.view.line), 9, _t)) : y.value.length > 0 ? (f(), i("ol", {
886
+ }, "$ " + _(c.view.line), 9, Nt)) : y.value.length > 0 ? (f(), i("ol", {
758
887
  key: 3,
759
888
  class: "kvc-block kvc-steps",
760
889
  "aria-label": v(l).t("kvcoder.ui.call.payload"),
@@ -762,10 +891,10 @@ var nt = ["href"], Z = /* @__PURE__ */ c({
762
891
  }, [(f(!0), i(e, null, m(y.value, (e, t) => (f(), i("li", {
763
892
  key: t,
764
893
  "data-test": "call-step"
765
- }, [a("span", yt, _(e.label), 1), a("div", bt, [s($, { value: v(q)(e.arguments) }, null, 8, ["value"])])]))), 128))], 8, vt)) : u.value === "delegate" ? (f(), n(Q, {
894
+ }, [a("span", Ft, _(e.label), 1), a("div", It, [s(Q, { value: v(K)(e.arguments) }, null, 8, ["value"])])]))), 128))], 8, Pt)) : u.value === "delegate" ? (f(), n(Z, {
766
895
  key: 4,
767
896
  class: "kvc-block kvc-prose-lines",
768
- lines: v(Xe)(g.value),
897
+ lines: v(ft)(g.value),
769
898
  "aria-label": v(l).t("kvcoder.ui.call.task"),
770
899
  "data-test": "call-task"
771
900
  }, null, 8, ["lines", "aria-label"])) : Object.keys(b.value).length > 0 ? (f(), i("div", {
@@ -773,19 +902,19 @@ var nt = ["href"], Z = /* @__PURE__ */ c({
773
902
  class: "kvc-block",
774
903
  "aria-label": v(l).t("kvcoder.ui.call.payload"),
775
904
  "data-test": "call-payload-fields"
776
- }, [s($, { value: v(q)(b.value) }, null, 8, ["value"])], 8, xt)) : r("v-if", !0);
905
+ }, [s(Q, { value: v(K)(b.value) }, null, 8, ["value"])], 8, Lt)) : r("v-if", !0);
777
906
  }
778
- }), Ct = { class: "kvc-output-block" }, wt = ["aria-label"], Tt = /* @__PURE__ */ c({
907
+ }), zt = { class: "kvc-output-block" }, Bt = ["aria-label"], Vt = /* @__PURE__ */ c({
779
908
  __name: "FoldedOutput",
780
909
  props: { output: {} },
781
910
  setup(e) {
782
- let n = e, r = N(), o = p(!1), c = t(() => n.output.split("\n")), l = t(() => Ze(c.value, o.value).join("\n"));
783
- return (e, t) => (f(), i("div", Ct, [a("pre", {
911
+ let n = e, r = F(), o = p(!1), c = t(() => n.output.split("\n")), l = t(() => pt(c.value, o.value).join("\n"));
912
+ return (e, t) => (f(), i("div", zt, [a("pre", {
784
913
  class: "kvc-output",
785
914
  dir: "auto",
786
915
  "aria-label": v(r).t("kvcoder.ui.output"),
787
916
  "data-test": "call-output"
788
- }, [s(Z, { text: l.value }, null, 8, ["text"])], 8, wt), s(X, {
917
+ }, [s(X, { text: l.value }, null, 8, ["text"])], 8, Bt), s(Y, {
789
918
  count: c.value.length,
790
919
  open: o.value,
791
920
  over: v(12) + v(5),
@@ -796,103 +925,125 @@ var nt = ["href"], Z = /* @__PURE__ */ c({
796
925
  "over"
797
926
  ])]));
798
927
  }
799
- }), Et = {
928
+ }), Ht = {
929
+ key: 1,
930
+ class: "kvc-mono",
931
+ dir: "auto"
932
+ }, $ = /* @__PURE__ */ c({
933
+ __name: "HostPath",
934
+ props: {
935
+ path: {},
936
+ line: {},
937
+ label: {}
938
+ },
939
+ setup(e) {
940
+ let t = e, n = F();
941
+ return (e, r) => v(n).host.embedded ? (f(), i("button", {
942
+ key: 0,
943
+ type: "button",
944
+ class: "kvc-link-button kvc-mono",
945
+ dir: "auto",
946
+ "data-test": "host-path",
947
+ onClick: r[0] ||= (e) => v(n).host.openFile(v(Ae)(v(n).workspace.value.path, t.path), t.line)
948
+ }, _(t.label ?? t.path), 1)) : (f(), i("span", Ht, _(t.label ?? t.path), 1));
949
+ }
950
+ }), Ut = {
800
951
  class: "kvc-block kvc-run-row",
801
952
  "data-test": "run-row"
802
- }, Dt = {
953
+ }, Wt = {
803
954
  class: "kvc-run-call",
804
955
  dir: "auto",
805
956
  "data-test": "run-call"
806
- }, Ot = {
957
+ }, Gt = {
807
958
  class: "kvc-chip",
808
959
  "data-test": "run-status"
809
- }, kt = {
960
+ }, Kt = {
810
961
  key: 0,
811
962
  class: "kvc-muted",
812
963
  "data-test": "run-time"
813
- }, At = ["aria-label"], jt = ["aria-label"], Mt = ["aria-label"], Nt = ["aria-label"], Pt = /* @__PURE__ */ c({
964
+ }, qt = ["aria-label"], Jt = ["aria-label"], Yt = ["aria-label"], Xt = ["aria-label"], Zt = /* @__PURE__ */ c({
814
965
  __name: "RunOutput",
815
966
  props: { run: {} },
816
967
  setup(c) {
817
- let l = c, u = N(), d = (e) => typeof e == "string" ? e : void 0, p = t(() => d(l.run.output)), m = t(() => d(l.run.problem)), h = t(() => ({
968
+ let l = c, u = F(), d = (e) => typeof e == "string" ? e : void 0, p = t(() => d(l.run.output)), m = t(() => d(l.run.problem)), h = t(() => ({
818
969
  type: "markdown",
819
970
  text: "kvcoder.markdown",
820
971
  params: { text: p.value ?? "" }
821
972
  }));
822
973
  return (t, c) => (f(), i(e, null, [
823
- a("div", Et, [
824
- a("span", Dt, _(l.run.call), 1),
825
- a("span", Ot, [o(_(v(F)(v(u).t, l.run.status)), 1), l.run.exitCode === void 0 ? r("v-if", !0) : (f(), i(e, { key: 0 }, [o(" · " + _(v(u).t("kvcoder.ui.exitCode", { code: l.run.exitCode })), 1)], 64))]),
826
- l.run.ranMs === void 0 ? r("v-if", !0) : (f(), i("span", kt, _(v(M)(v(u).t, l.run.ranMs)), 1))
974
+ a("div", Ut, [
975
+ a("span", Wt, _(l.run.call), 1),
976
+ a("span", Gt, [o(_(v(ve)(v(u).t, l.run.status)), 1), l.run.exitCode === void 0 ? r("v-if", !0) : (f(), i(e, { key: 0 }, [o(" · " + _(v(u).t("kvcoder.ui.exitCode", { code: l.run.exitCode })), 1)], 64))]),
977
+ l.run.ranMs === void 0 ? r("v-if", !0) : (f(), i("span", Kt, _(v(P)(v(u).t, l.run.ranMs)), 1))
827
978
  ]),
828
979
  m.value === void 0 ? l.run.problem === void 0 ? r("v-if", !0) : (f(), i("div", {
829
980
  key: 1,
830
981
  class: "kvc-block kvc-error",
831
982
  "aria-label": v(u).t("kvcoder.ui.call.error"),
832
983
  "data-test": "run-problem"
833
- }, [s($, { value: v(q)(l.run.problem) }, null, 8, ["value"])], 8, jt)) : (f(), i("pre", {
984
+ }, [s(Q, { value: v(K)(l.run.problem) }, null, 8, ["value"])], 8, Jt)) : (f(), i("pre", {
834
985
  key: 0,
835
986
  class: "kvc-block kvc-error",
836
987
  dir: "auto",
837
988
  "aria-label": v(u).t("kvcoder.ui.call.error"),
838
989
  "data-test": "run-problem"
839
- }, [s(Z, { text: m.value }, null, 8, ["text"])], 8, At)),
990
+ }, [s(X, { text: m.value }, null, 8, ["text"])], 8, qt)),
840
991
  p.value === void 0 && l.run.output !== void 0 ? (f(), i("div", {
841
992
  key: 2,
842
993
  class: "kvc-block",
843
994
  "aria-label": v(u).t("kvcoder.ui.output"),
844
995
  "data-test": "call-result-fields"
845
- }, [s($, { value: v(q)(l.run.output) }, null, 8, ["value"])], 8, Mt)) : l.run.answer && p.value ? (f(), i("div", {
996
+ }, [s(Q, { value: v(K)(l.run.output) }, null, 8, ["value"])], 8, Yt)) : l.run.answer && p.value ? (f(), i("div", {
846
997
  key: 3,
847
998
  class: "kvc-block",
848
999
  "aria-label": v(u).t("kvcoder.ui.call.answer"),
849
1000
  "data-test": "call-answer"
850
- }, [(f(), n(g(v(u).View), { view: h.value }, null, 8, ["view"]))], 8, Nt)) : p.value ? (f(), n(Tt, {
1001
+ }, [(f(), n(g(v(u).View), { view: h.value }, null, 8, ["view"]))], 8, Xt)) : p.value ? (f(), n(Vt, {
851
1002
  key: 4,
852
1003
  output: p.value
853
1004
  }, null, 8, ["output"])) : r("v-if", !0)
854
1005
  ], 64));
855
1006
  }
856
- }), Ft = {
1007
+ }), Qt = {
857
1008
  key: 0,
858
1009
  class: "kvc-muted kvc-call-parts",
859
1010
  "data-test": "call-replacements"
860
- }, It = {
1011
+ }, $t = {
861
1012
  key: 2,
862
1013
  class: "kvc-block kvc-entries",
863
1014
  "data-test": "call-entries"
864
- }, Lt = ["data-kind"], Rt = {
1015
+ }, en = ["data-kind"], tn = {
1016
+ key: 0,
1017
+ "data-test": "call-entry-name"
1018
+ }, nn = {
1019
+ key: 1,
865
1020
  class: "kvc-mono",
866
1021
  dir: "auto",
867
1022
  "data-test": "call-entry-name"
868
- }, zt = {
869
- key: 0,
1023
+ }, rn = {
1024
+ key: 2,
870
1025
  class: "kvc-muted",
871
1026
  "data-test": "call-entry-size"
872
- }, Bt = {
1027
+ }, an = {
873
1028
  key: 3,
874
1029
  class: "kvc-block kvc-entries",
875
1030
  "data-test": "call-paths"
876
- }, Vt = {
877
- class: "kvc-mono",
878
- dir: "auto"
879
- }, Ht = {
880
- class: "kvc-mono kvc-file-path",
1031
+ }, on = {
1032
+ class: "kvc-file-path",
881
1033
  "data-test": "call-file-path"
882
- }, Ut = {
1034
+ }, sn = {
883
1035
  key: 1,
884
1036
  class: "kvc-muted kvc-call-parts",
885
1037
  "data-test": "call-file-count"
886
- }, Wt = {
887
- class: "kvc-mono kvc-file-path",
888
- dir: "auto",
1038
+ }, cn = {
1039
+ class: "kvc-file-path",
889
1040
  "data-test": "call-file-path"
890
- }, Gt = {
1041
+ }, ln = {
891
1042
  key: 1,
892
1043
  class: "kvc-muted kvc-call-parts",
893
1044
  dir: "auto",
894
1045
  "data-test": "call-read-file-note"
895
- }, Kt = ["aria-label"], qt = ["aria-label"], Jt = /* @__PURE__ */ c({
1046
+ }, un = ["aria-label"], dn = ["aria-label"], fn = /* @__PURE__ */ c({
896
1047
  __name: "CallResult",
897
1048
  props: {
898
1049
  view: {},
@@ -900,99 +1051,108 @@ var nt = ["href"], Z = /* @__PURE__ */ c({
900
1051
  result: {}
901
1052
  },
902
1053
  setup(o) {
903
- let c = o, l = N(), u = t(() => G(c.view)), d = t(() => u.value === "edit" ? se(c.result) : void 0), h = t(() => u.value === "read" ? ce(c.result) : void 0), y = t(() => u.value === "read-files" ? ue(c.result) : void 0), b = (e) => e.error ?? l.t(e.state === "notRead" ? "kvcoder.ui.call.fileNotRead" : "kvcoder.ui.call.fileUnchanged"), x = t(() => u.value === "list" ? fe(c.result) : void 0), S = t(() => u.value === "search" ? L(c.result) : void 0), C = t(() => u.value === "find" ? pe(c.result) : void 0), w = p(!1), T = t(() => J(C.value ?? [], w.value)), E = t(() => u.value === "run-output" ? I(c.result) : void 0), D = p(!1), O = t(() => J(x.value ?? [], D.value)), k = t(() => ({
1054
+ let c = o, l = F(), u = t(() => z(c.view)), d = t(() => u.value === "edit" ? ue(c.result) : void 0), h = t(() => u.value === "read" ? L(c.result) : void 0), y = t(() => u.value === "read-files" ? fe(c.result) : void 0), b = (e) => e.error ?? l.t(e.state === "notRead" ? "kvcoder.ui.call.fileNotRead" : "kvcoder.ui.call.fileUnchanged"), x = t(() => u.value === "list" ? me(c.result) : void 0), S = t(() => u.value === "search" ? be(c.result) : void 0), C = t(() => u.value === "find" ? he(c.result) : void 0), w = p(!1), T = t(() => q(C.value ?? [], w.value)), E = t(() => u.value === "run-output" ? ye(c.result) : void 0), D = p(!1), O = t(() => q(x.value ?? [], D.value)), k = t(() => ({
904
1055
  type: "markdown",
905
1056
  text: "kvcoder.markdown",
906
1057
  params: { text: c.output }
907
- })), A = t(() => u.value !== "line" && typeof c.result == "object" && c.result !== null);
908
- return (t, o) => d.value === void 0 ? h.value === void 0 ? x.value === void 0 ? C.value === void 0 ? S.value === void 0 ? y.value === void 0 ? u.value === "write" && A.value ? (f(), i(e, { key: 6 }, [], 64)) : E.value === void 0 ? u.value === "delegate" && c.output !== "" ? (f(), i("div", {
1058
+ })), A = t(() => typeof c.view.fields?.path == "string" ? c.view.fields.path.replace(/[\\/]+$/, "") : "."), j = (e) => A.value === "." || A.value === "" ? e : `${A.value}/${e}`, M = t(() => u.value !== "line" && typeof c.result == "object" && c.result !== null);
1059
+ return (t, o) => d.value === void 0 ? h.value === void 0 ? x.value === void 0 ? C.value === void 0 ? S.value === void 0 ? y.value === void 0 ? u.value === "write" && M.value ? (f(), i(e, { key: 6 }, [], 64)) : E.value === void 0 ? u.value === "delegate" && c.output !== "" ? (f(), i("div", {
909
1060
  key: 8,
910
1061
  class: "kvc-block",
911
1062
  "aria-label": v(l).t("kvcoder.ui.call.answer"),
912
1063
  "data-test": "call-answer"
913
- }, [(f(), n(g(v(l).View), { view: k.value }, null, 8, ["view"]))], 8, Kt)) : A.value ? (f(), i("div", {
1064
+ }, [(f(), n(g(v(l).View), { view: k.value }, null, 8, ["view"]))], 8, un)) : M.value ? (f(), i("div", {
914
1065
  key: 9,
915
1066
  class: "kvc-block",
916
1067
  "aria-label": v(l).t("kvcoder.ui.output"),
917
1068
  "data-test": "call-result-fields"
918
- }, [s($, { value: v(q)(c.result) }, null, 8, ["value"])], 8, qt)) : c.output === "" ? r("v-if", !0) : (f(), n(Tt, {
1069
+ }, [s(Q, { value: v(K)(c.result) }, null, 8, ["value"])], 8, dn)) : c.output === "" ? r("v-if", !0) : (f(), n(Vt, {
919
1070
  key: 10,
920
1071
  output: c.output
921
- }, null, 8, ["output"])) : (f(), n(Pt, {
1072
+ }, null, 8, ["output"])) : (f(), n(Zt, {
922
1073
  key: 7,
923
1074
  run: E.value
924
1075
  }, null, 8, ["run"])) : (f(!0), i(e, { key: 5 }, m(y.value, (e, t) => (f(), i("div", {
925
1076
  key: `${t}:${e.path}`,
926
1077
  class: "kvc-block",
927
1078
  "data-test": "call-read-file"
928
- }, [a("div", Wt, _(e.path), 1), e.read === void 0 ? (f(), i("p", Gt, _(b(e)), 1)) : (f(), n(Q, {
1079
+ }, [a("div", cn, [s($, {
1080
+ path: e.path,
1081
+ line: e.read?.fromLine
1082
+ }, null, 8, ["path", "line"])]), e.read === void 0 ? (f(), i("p", ln, _(b(e)), 1)) : (f(), n(Z, {
929
1083
  key: 0,
930
- lines: v(Y)(e.read.content, e.read.fromLine)
1084
+ lines: v(J)(e.read.content, e.read.fromLine)
931
1085
  }, null, 8, ["lines"]))]))), 128)) : (f(!0), i(e, { key: 4 }, m(S.value, (e) => (f(), i("div", {
932
1086
  key: e.path,
933
1087
  class: "kvc-block",
934
1088
  "data-test": "call-file"
935
- }, [a("div", Ht, _(e.path), 1), e.matches.length > 0 ? (f(), n(Q, {
1089
+ }, [a("div", on, [s($, {
1090
+ path: e.path,
1091
+ line: e.matches.find((e) => !e.context)?.line
1092
+ }, null, 8, ["path", "line"])]), e.matches.length > 0 ? (f(), n(Z, {
936
1093
  key: 0,
937
1094
  lines: e.matches.map((e) => ({
938
1095
  text: e.text,
939
1096
  number: e.line
940
1097
  }))
941
- }, null, 8, ["lines"])) : (f(), i("p", Ut, _(v(l).t("kvcoder.ui.call.matchCount", { count: e.count })), 1))]))), 128)) : (f(), i("div", Bt, [(f(!0), i(e, null, m(T.value, (e) => (f(), i("div", {
1098
+ }, null, 8, ["lines"])) : (f(), i("p", sn, _(v(l).t("kvcoder.ui.call.matchCount", { count: e.count })), 1))]))), 128)) : (f(), i("div", an, [(f(!0), i(e, null, m(T.value, (e) => (f(), i("div", {
942
1099
  key: e,
943
1100
  class: "kvc-entry",
944
1101
  "data-test": "call-path"
945
- }, [s(v(j), {
1102
+ }, [s(v(ee), {
946
1103
  size: 14,
947
1104
  "aria-hidden": "true"
948
- }), a("span", Vt, _(e), 1)]))), 128)), s(X, {
1105
+ }), s($, { path: e }, null, 8, ["path"])]))), 128)), s(Y, {
949
1106
  count: C.value.length,
950
1107
  open: w.value,
951
1108
  onToggle: o[1] ||= (e) => w.value = !w.value
952
- }, null, 8, ["count", "open"])])) : (f(), i("div", It, [(f(!0), i(e, null, m(O.value, (e) => (f(), i("div", {
1109
+ }, null, 8, ["count", "open"])])) : (f(), i("div", $t, [(f(!0), i(e, null, m(O.value, (e) => (f(), i("div", {
953
1110
  key: e.name,
954
1111
  class: "kvc-entry",
955
1112
  "data-kind": e.kind,
956
1113
  "data-test": "call-entry"
957
1114
  }, [
958
- (f(), n(g(e.kind === "folder" ? v(te) : v(j)), {
1115
+ (f(), n(g(e.kind === "folder" ? v(te) : v(ee)), {
959
1116
  size: 14,
960
1117
  "aria-hidden": "true"
961
1118
  })),
962
- a("span", Rt, _(e.name), 1),
963
- e.kind === "file" ? (f(), i("span", zt, _(v(xe)(v(l).t, e.bytes)), 1)) : r("v-if", !0)
964
- ], 8, Lt))), 128)), s(X, {
1119
+ e.kind === "file" ? (f(), i("span", tn, [s($, {
1120
+ path: j(e.name),
1121
+ label: e.name
1122
+ }, null, 8, ["path", "label"])])) : (f(), i("span", nn, _(e.name), 1)),
1123
+ e.kind === "file" ? (f(), i("span", rn, _(v(We)(v(l).t, e.bytes)), 1)) : r("v-if", !0)
1124
+ ], 8, en))), 128)), s(Y, {
965
1125
  count: x.value.length,
966
1126
  open: D.value,
967
1127
  onToggle: o[0] ||= (e) => D.value = !D.value
968
- }, null, 8, ["count", "open"])])) : (f(), n(Q, {
1128
+ }, null, 8, ["count", "open"])])) : (f(), n(Z, {
969
1129
  key: 1,
970
1130
  class: "kvc-block",
971
- lines: v(Y)(h.value.content, h.value.fromLine),
1131
+ lines: v(J)(h.value.content, h.value.fromLine),
972
1132
  "data-test": "call-content"
973
- }, null, 8, ["lines"])) : (f(), i("p", Ft, _(v(l).t("kvcoder.ui.call.replacements", {
1133
+ }, null, 8, ["lines"])) : (f(), i("p", Qt, _(v(l).t("kvcoder.ui.call.replacements", {
974
1134
  count: d.value.replacements,
975
1135
  line: d.value.firstChangedLine
976
1136
  })), 1));
977
1137
  }
978
- }), Yt = {
1138
+ }), pn = {
979
1139
  key: 0,
980
1140
  class: "kvc-summary",
981
1141
  "data-test": "call-summary"
982
- }, Xt = {
1142
+ }, mn = {
983
1143
  key: 0,
984
1144
  "data-test": "call-words"
985
- }, Zt = {
1145
+ }, hn = {
986
1146
  key: 1,
987
1147
  class: "kvc-mono",
988
1148
  "data-test": "call-subject"
989
- }, Qt = ["dir"], $t = {
1149
+ }, gn = ["dir"], _n = {
990
1150
  key: 1,
991
1151
  class: "kvc-muted",
992
1152
  dir: "ltr",
993
1153
  style: { "align-self": "flex-start" },
994
1154
  "data-test": "call-label"
995
- }, en = /* @__PURE__ */ c({
1155
+ }, vn = /* @__PURE__ */ c({
996
1156
  __name: "CallSummaryLine",
997
1157
  props: {
998
1158
  view: {},
@@ -1000,132 +1160,149 @@ var nt = ["href"], Z = /* @__PURE__ */ c({
1000
1160
  whole: { type: Boolean }
1001
1161
  },
1002
1162
  setup(e) {
1003
- let n = e, a = N(), o = t(() => Pe(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 : K(o.value.subject));
1004
- return (e, t) => o.value === void 0 ? n.view.label ? (f(), i("span", $t, _(n.view.label), 1)) : r("v-if", !0) : (f(), i("span", Yt, [
1005
- o.value.words ? (f(), i("span", Xt, _(o.value.words), 1)) : r("v-if", !0),
1006
- c.value ? (f(), i("span", Zt, _(c.value), 1)) : r("v-if", !0),
1163
+ let n = e, a = F(), o = t(() => rt(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 : Oe(o.value.subject));
1164
+ return (e, t) => o.value === void 0 ? n.view.label ? (f(), i("span", _n, _(n.view.label), 1)) : r("v-if", !0) : (f(), i("span", pn, [
1165
+ o.value.words ? (f(), i("span", mn, _(o.value.words), 1)) : r("v-if", !0),
1166
+ c.value ? (f(), i("span", hn, _(c.value), 1)) : r("v-if", !0),
1007
1167
  o.value.outcome ? (f(), i("span", {
1008
1168
  key: 2,
1009
1169
  class: "kvc-muted",
1010
1170
  dir: s.value,
1011
1171
  "data-test": "call-outcome"
1012
- }, _(o.value.outcome), 9, Qt)) : r("v-if", !0)
1172
+ }, _(o.value.outcome), 9, gn)) : r("v-if", !0)
1013
1173
  ]));
1014
1174
  }
1015
- }), tn = ["aria-expanded", "disabled"], nn = ["aria-label"], rn = { class: "kvc-lines" }, an = {
1175
+ }), yn = ["aria-expanded", "disabled"], bn = ["aria-label"], xn = { class: "kvc-lines" }, Sn = {
1016
1176
  key: 0,
1017
1177
  style: { "font-weight": "600" },
1018
1178
  "data-test": "call-description"
1019
- }, on = {
1179
+ }, Cn = {
1020
1180
  key: 1,
1021
1181
  class: "kvc-oneline",
1022
1182
  "data-test": "call-line"
1023
- }, sn = { class: "kvc-mono" }, cn = {
1183
+ }, wn = { class: "kvc-mono" }, Tn = {
1024
1184
  key: 2,
1025
1185
  class: "kvc-chip kvc-warn",
1026
1186
  "data-test": "call-risky"
1027
- }, ln = {
1187
+ }, En = {
1028
1188
  key: 3,
1029
1189
  class: "kvc-chip",
1030
1190
  "data-test": "call-background"
1031
- }, un = {
1191
+ }, Dn = {
1032
1192
  key: 4,
1033
1193
  class: "kvc-chip",
1034
1194
  "data-test": "call-not-run"
1035
- }, dn = {
1195
+ }, On = {
1036
1196
  key: 5,
1197
+ class: "kvc-muted",
1198
+ "data-test": "call-exit"
1199
+ }, kn = {
1200
+ key: 6,
1037
1201
  class: "kvc-chip kvc-danger",
1038
1202
  "data-test": "call-failed"
1039
- }, fn = {
1203
+ }, An = {
1040
1204
  class: "kvc-muted",
1041
1205
  "data-test": "call-time"
1042
- }, pn = {
1206
+ }, jn = {
1043
1207
  key: 0,
1044
1208
  class: "kvc-muted kvc-call-parts",
1045
1209
  "data-test": "call-parts"
1046
- }, mn = ["aria-expanded"], hn = ["aria-label"], gn = /* @__PURE__ */ c({
1210
+ }, Mn = ["aria-expanded"], Nn = ["aria-label"], Pn = /* @__PURE__ */ c({
1047
1211
  __name: "CallCard",
1048
1212
  props: {
1049
1213
  view: {},
1050
1214
  failed: { type: Boolean },
1051
1215
  durationMs: {},
1052
1216
  output: {},
1053
- running: { type: Boolean }
1217
+ running: { type: Boolean },
1218
+ exited: {}
1054
1219
  },
1055
1220
  setup(o) {
1056
- let c = o, l = N(), u = t(() => G(c.view)), m = p(!1), h = p(!1), y = t(() => c.failed === !0 && c.output !== void 0 ? ae(c.output) : void 0), b = t(() => y.value?.kind === "invalid"), x = t(() => {
1221
+ let c = o, l = F(), u = t(() => z(c.view)), m = p(!1), h = p(!1), y = t(() => c.failed === !0 && c.exited === void 0 && c.output !== void 0 ? ie(c.output) : void 0), b = t(() => y.value?.kind === "invalid"), x = t(() => {
1057
1222
  let e = y.value;
1058
1223
  return e === void 0 ? "" : e.kind === "error" ? e.message : l.t(`kvcoder.ui.failure.${e.kind}`);
1059
- }), S = t(() => c.failed === !0 ? void 0 : be(c.output)), C = t(() => c.failed === !0 && u.value !== "line"), w = t(() => c.durationMs === void 0 ? "" : M(l.t, (c.view.writtenMs ?? 0) + c.durationMs)), T = t(() => {
1224
+ }), S = t(() => c.failed === !0 ? void 0 : Ue(c.output)), C = t(() => c.failed === !0 && u.value !== "line"), w = t(() => c.durationMs === void 0 ? "" : P(l.t, (c.view.writtenMs ?? 0) + c.durationMs)), T = t(() => {
1060
1225
  if (c.durationMs === void 0) return "";
1061
- let e = M(l.t, c.durationMs);
1226
+ let e = P(l.t, c.durationMs);
1062
1227
  return c.view.writtenMs === void 0 ? l.t("kvcoder.ui.callRan", { ran: e }) : l.t("kvcoder.ui.callParts", {
1063
- written: M(l.t, c.view.writtenMs),
1228
+ written: P(l.t, c.view.writtenMs),
1064
1229
  ran: e
1065
1230
  });
1066
1231
  });
1067
1232
  return (t, o) => (f(), i("div", {
1068
- class: d(["kvc-card", { "kvc-failed": c.failed && !b.value }]),
1233
+ class: d(["kvc-card", { "kvc-failed": c.failed && !b.value && c.exited === void 0 }]),
1069
1234
  "data-test": "call-card"
1070
- }, [a("button", {
1071
- type: "button",
1072
- class: "kvc-card-row kvc-ghost kvc-button",
1073
- style: {
1074
- "inline-size": "100%",
1075
- "border-radius": "0"
1076
- },
1077
- "aria-expanded": m.value,
1078
- disabled: c.output === void 0,
1079
- onClick: o[0] ||= (e) => m.value = !m.value
1080
1235
  }, [
1081
- c.running ? (f(), i("span", {
1082
- key: 0,
1083
- class: "kvc-spin",
1084
- "aria-label": v(l).t("kvcoder.ui.running")
1085
- }, null, 8, nn)) : (f(), n(g(m.value ? v(A) : v(ee)), {
1086
- key: 1,
1087
- size: 16,
1088
- "aria-hidden": "true"
1089
- })),
1090
- a("span", rn, [
1091
- c.view.description ? (f(), i("span", an, _(c.view.description), 1)) : c.view.connector === void 0 && c.view.line ? (f(), i("span", on, [a("span", sn, _(v(K)(c.view.line)), 1)])) : r("v-if", !0),
1092
- s(en, {
1093
- view: c.view,
1094
- result: S.value
1095
- }, null, 8, ["view", "result"]),
1096
- x.value === "" ? r("v-if", !0) : (f(), i("span", {
1097
- key: 2,
1098
- class: d(["kvc-oneline", b.value ? "kvc-muted" : "kvc-danger"]),
1099
- dir: "auto",
1100
- "data-test": "call-reason"
1101
- }, _(x.value), 3))
1236
+ a("button", {
1237
+ type: "button",
1238
+ class: "kvc-card-row kvc-ghost kvc-button",
1239
+ style: {
1240
+ "inline-size": "100%",
1241
+ "border-radius": "0"
1242
+ },
1243
+ "aria-expanded": m.value,
1244
+ disabled: c.output === void 0,
1245
+ onClick: o[0] ||= (e) => m.value = !m.value
1246
+ }, [
1247
+ c.running ? (f(), i("span", {
1248
+ key: 0,
1249
+ class: "kvc-spin",
1250
+ "aria-label": v(l).t("kvcoder.ui.running")
1251
+ }, null, 8, bn)) : (f(), n(g(m.value ? v(A) : v(j)), {
1252
+ key: 1,
1253
+ size: 16,
1254
+ "aria-hidden": "true"
1255
+ })),
1256
+ a("span", xn, [
1257
+ c.view.description ? (f(), i("span", Sn, _(c.view.description), 1)) : c.view.connector === void 0 && c.view.line ? (f(), i("span", Cn, [a("span", wn, _(v(Oe)(c.view.line)), 1)])) : r("v-if", !0),
1258
+ s(vn, {
1259
+ view: c.view,
1260
+ result: S.value
1261
+ }, null, 8, ["view", "result"]),
1262
+ x.value === "" ? r("v-if", !0) : (f(), i("span", {
1263
+ key: 2,
1264
+ class: d(["kvc-oneline", b.value ? "kvc-muted" : "kvc-danger"]),
1265
+ dir: "auto",
1266
+ "data-test": "call-reason"
1267
+ }, _(x.value), 3))
1268
+ ]),
1269
+ c.view.risky ? (f(), i("span", Tn, _(v(l).t("kvcoder.ui.call.risky")), 1)) : r("v-if", !0),
1270
+ c.view.background ? (f(), i("span", En, _(v(l).t("kvcoder.ui.jobs.background")), 1)) : r("v-if", !0),
1271
+ b.value ? (f(), i("span", Dn, _(v(l).t("kvcoder.ui.callNotRun")), 1)) : c.exited === void 0 ? c.failed ? (f(), i("span", kn, _(v(l).t("kvcoder.ui.callFailed")), 1)) : r("v-if", !0) : (f(), i("span", On, _(v(l).t("kvcoder.ui.call.exit", { code: c.exited })), 1)),
1272
+ a("span", An, _(w.value), 1)
1273
+ ], 8, yn),
1274
+ s(Re, {
1275
+ view: c.view,
1276
+ result: S.value,
1277
+ ran: c.output !== void 0 && c.failed !== !0 && c.running !== !0
1278
+ }, null, 8, [
1279
+ "view",
1280
+ "result",
1281
+ "ran"
1102
1282
  ]),
1103
- c.view.risky ? (f(), i("span", cn, _(v(l).t("kvcoder.ui.call.risky")), 1)) : r("v-if", !0),
1104
- c.view.background ? (f(), i("span", ln, _(v(l).t("kvcoder.ui.jobs.background")), 1)) : r("v-if", !0),
1105
- b.value ? (f(), i("span", un, _(v(l).t("kvcoder.ui.callNotRun")), 1)) : c.failed ? (f(), i("span", dn, _(v(l).t("kvcoder.ui.callFailed")), 1)) : r("v-if", !0),
1106
- a("span", fn, _(w.value), 1)
1107
- ], 8, tn), m.value && c.output !== void 0 ? (f(), i(e, { key: 0 }, [T.value === "" ? r("v-if", !0) : (f(), i("p", pn, _(T.value), 1)), C.value ? (f(), i(e, { key: 1 }, [a("button", {
1108
- type: "button",
1109
- class: "kvc-text-button kvc-fold",
1110
- "aria-expanded": h.value,
1111
- "data-test": "call-details",
1112
- onClick: o[1] ||= (e) => h.value = !h.value
1113
- }, _(v(l).t(h.value ? "kvcoder.ui.call.hideDetails" : "kvcoder.ui.call.showDetails")), 9, mn), h.value ? (f(), i(e, { key: 0 }, [a("pre", {
1114
- class: "kvc-block kvc-error",
1115
- dir: "auto",
1116
- "aria-label": v(l).t("kvcoder.ui.call.error"),
1117
- "data-test": "call-error"
1118
- }, [s(Z, { text: c.output }, null, 8, ["text"])], 8, hn), s(St, { view: c.view }, null, 8, ["view"])], 64)) : r("v-if", !0)], 64)) : (f(), i(e, { key: 2 }, [s(St, { view: c.view }, null, 8, ["view"]), s(Jt, {
1119
- view: c.view,
1120
- output: c.output,
1121
- result: S.value
1122
- }, null, 8, [
1123
- "view",
1124
- "output",
1125
- "result"
1126
- ])], 64))], 64)) : r("v-if", !0)], 2));
1283
+ m.value && c.output !== void 0 ? (f(), i(e, { key: 0 }, [T.value === "" ? r("v-if", !0) : (f(), i("p", jn, _(T.value), 1)), C.value ? (f(), i(e, { key: 1 }, [a("button", {
1284
+ type: "button",
1285
+ class: "kvc-text-button kvc-fold",
1286
+ "aria-expanded": h.value,
1287
+ "data-test": "call-details",
1288
+ onClick: o[1] ||= (e) => h.value = !h.value
1289
+ }, _(v(l).t(h.value ? "kvcoder.ui.call.hideDetails" : "kvcoder.ui.call.showDetails")), 9, Mn), h.value ? (f(), i(e, { key: 0 }, [a("pre", {
1290
+ class: "kvc-block kvc-error",
1291
+ dir: "auto",
1292
+ "aria-label": v(l).t("kvcoder.ui.call.error"),
1293
+ "data-test": "call-error"
1294
+ }, [s(X, { text: c.output }, null, 8, ["text"])], 8, Nn), s(Rt, { view: c.view }, null, 8, ["view"])], 64)) : r("v-if", !0)], 64)) : (f(), i(e, { key: 2 }, [s(Rt, { view: c.view }, null, 8, ["view"]), s(fn, {
1295
+ view: c.view,
1296
+ output: c.output,
1297
+ result: S.value
1298
+ }, null, 8, [
1299
+ "view",
1300
+ "output",
1301
+ "result"
1302
+ ])], 64))], 64)) : r("v-if", !0)
1303
+ ], 2));
1127
1304
  }
1128
- }), _n = /* @__PURE__ */ c({
1305
+ }), Fn = /* @__PURE__ */ c({
1129
1306
  __name: "call",
1130
1307
  props: {
1131
1308
  description: {},
@@ -1141,13 +1318,13 @@ var nt = ["href"], Z = /* @__PURE__ */ c({
1141
1318
  let r = e, i = t(() => r.connector === void 0 ? {
1142
1319
  ...r.description === void 0 ? {} : { description: r.description },
1143
1320
  ...r.line === void 0 ? {} : { line: r.line }
1144
- } : Be({
1321
+ } : Ee({
1145
1322
  description: r.description,
1146
1323
  connector: r.connector,
1147
1324
  command: r.command,
1148
1325
  payload: r.payload ?? {}
1149
1326
  }));
1150
- return (e, t) => (f(), n(gn, {
1327
+ return (e, t) => (f(), n(Pn, {
1151
1328
  view: i.value,
1152
1329
  failed: r.failed,
1153
1330
  "duration-ms": r.durationMs,
@@ -1161,4 +1338,4 @@ var nt = ["href"], Z = /* @__PURE__ */ c({
1161
1338
  }
1162
1339
  });
1163
1340
  //#endregion
1164
- export { _n as default };
1341
+ export { Fn as default };