@kvman/kvcoder 0.1.7 → 0.1.8

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.
@@ -2966,13 +2966,15 @@ function La(e) {
2966
2966
  }
2967
2967
  }
2968
2968
  function Ra(e, t) {
2969
- if (e.kind !== "toolResult" || e.content.isError === !0) return;
2969
+ if (e.kind !== "toolResult") return;
2970
2970
  let n = t.get(String(e.content.toolCallId))?.ask;
2971
2971
  if (n === void 0) return;
2972
- let r = La(ja(e.content.content));
2973
- return r === void 0 ? void 0 : {
2972
+ let r = ja(e.content.content);
2973
+ if (e.content.isError === !0 && r !== Ia) return;
2974
+ let i = La(r);
2975
+ return i === void 0 ? void 0 : {
2974
2976
  ...n,
2975
- answer: r
2977
+ answer: i
2976
2978
  };
2977
2979
  }
2978
2980
  function za(e) {
@@ -3151,24 +3153,39 @@ var Ya = ["aria-label"], Xa = {
3151
3153
  }, E(D(o).t("kvcoder.ui.artifacts.open")), 1)
3152
3154
  ]));
3153
3155
  }
3154
- });
3156
+ }), yo = 160, bo = /^error ([A-Za-z0-9_/-]+): ?(.*)/;
3157
+ function xo(e) {
3158
+ let t = (e.split("\n", 1)[0] ?? "").trim();
3159
+ return t.length > yo ? `${t.slice(0, yo)}…` : t;
3160
+ }
3161
+ function So(e) {
3162
+ if (e.startsWith("denied by the user")) return { kind: "denied" };
3163
+ let t = bo.exec(e);
3164
+ return t?.[1] === "VALIDATION_FAILED" ? { kind: "invalid" } : t === null ? /\[exit code \d+\]\s*$/.test(e) ? { kind: "command" } : {
3165
+ kind: "error",
3166
+ message: xo(e)
3167
+ } : {
3168
+ kind: "error",
3169
+ message: xo(t[2] ?? "")
3170
+ };
3171
+ }
3155
3172
  //#endregion
3156
3173
  //#region web/src/call-results.ts
3157
- function yo(e) {
3174
+ function Co(e) {
3158
3175
  let { replacements: t, firstChangedLine: n } = q(e);
3159
3176
  return typeof t == "number" && typeof n == "number" ? {
3160
3177
  replacements: t,
3161
3178
  firstChangedLine: n
3162
3179
  } : void 0;
3163
3180
  }
3164
- function bo(e) {
3181
+ function wo(e) {
3165
3182
  let { fromLine: t, content: n } = q(e);
3166
3183
  return typeof t == "number" && typeof n == "string" ? {
3167
3184
  fromLine: t,
3168
3185
  content: n
3169
3186
  } : void 0;
3170
3187
  }
3171
- function xo(e) {
3188
+ function To(e) {
3172
3189
  let { name: t, kind: n, bytes: r } = q(e);
3173
3190
  return typeof t == "string" && (n === "file" || n === "folder") && typeof r == "number" ? [{
3174
3191
  name: t,
@@ -3176,11 +3193,11 @@ function xo(e) {
3176
3193
  bytes: r
3177
3194
  }] : [];
3178
3195
  }
3179
- function So(e) {
3196
+ function Eo(e) {
3180
3197
  let t = q(e).entries;
3181
- return Array.isArray(t) ? t.flatMap(xo) : void 0;
3198
+ return Array.isArray(t) ? t.flatMap(To) : void 0;
3182
3199
  }
3183
- function Co(e) {
3200
+ function Do(e) {
3184
3201
  let { path: t, matches: n } = q(e);
3185
3202
  return typeof t != "string" || !Array.isArray(n) ? [] : [{
3186
3203
  path: t,
@@ -3193,17 +3210,17 @@ function Co(e) {
3193
3210
  })
3194
3211
  }];
3195
3212
  }
3196
- var wo = [
3213
+ var Oo = [
3197
3214
  "running",
3198
3215
  "succeeded",
3199
3216
  "failed",
3200
3217
  "cancelled",
3201
3218
  "interrupted"
3202
3219
  ];
3203
- function To(e, t) {
3204
- return wo.some((e) => e === t) ? e(`kvcoder.ui.jobs.status.${t}`) : t;
3220
+ function ko(e, t) {
3221
+ return Oo.some((e) => e === t) ? e(`kvcoder.ui.jobs.status.${t}`) : t;
3205
3222
  }
3206
- function Eo(e) {
3223
+ function Ao(e) {
3207
3224
  let { kind: t, call: n, status: r, startedAt: i, endedAt: a, exitCode: o, output: s, problem: c } = q(e);
3208
3225
  if (typeof n != "string" || typeof r != "string") return;
3209
3226
  let l = typeof i == "string" && typeof a == "string" ? Date.parse(a) - Date.parse(i) : NaN;
@@ -3217,36 +3234,36 @@ function Eo(e) {
3217
3234
  ...c === void 0 ? {} : { problem: c }
3218
3235
  };
3219
3236
  }
3220
- function Do(e) {
3237
+ function jo(e) {
3221
3238
  let t = q(e).files;
3222
- return Array.isArray(t) ? t.flatMap(Co) : void 0;
3239
+ return Array.isArray(t) ? t.flatMap(Do) : void 0;
3223
3240
  }
3224
3241
  //#endregion
3225
3242
  //#region web/src/edit-diff.ts
3226
- var Oo = 3;
3227
- function ko(e) {
3243
+ var Mo = 3;
3244
+ function No(e) {
3228
3245
  if (e === "") return [];
3229
3246
  let t = e.split("\n");
3230
3247
  return e.endsWith("\n") ? t.slice(0, -1) : t;
3231
3248
  }
3232
- function Ao(e, t) {
3249
+ function Po(e, t) {
3233
3250
  let n = 0;
3234
3251
  for (; n < e.length && n < t.length && e[n] === t[n];) n += 1;
3235
3252
  return n;
3236
3253
  }
3237
- function jo(e, t) {
3238
- let n = ko(e), r = ko(t), i = Ao(n, r), a = Ao(n.slice(i).reverse(), r.slice(i).reverse()), o = (e, t) => t.map((t) => ({
3254
+ function Fo(e, t) {
3255
+ let n = No(e), r = No(t), i = Po(n, r), a = Po(n.slice(i).reverse(), r.slice(i).reverse()), o = (e, t) => t.map((t) => ({
3239
3256
  kind: e,
3240
3257
  text: t
3241
3258
  }));
3242
3259
  return [
3243
- ...o("context", n.slice(Math.max(i - Oo, 0), i)),
3260
+ ...o("context", n.slice(Math.max(i - Mo, 0), i)),
3244
3261
  ...o("removed", n.slice(i, n.length - a)),
3245
3262
  ...o("added", r.slice(i, r.length - a)),
3246
- ...o("context", n.slice(n.length - a, n.length - a + Oo))
3263
+ ...o("context", n.slice(n.length - a, n.length - a + Mo))
3247
3264
  ];
3248
3265
  }
3249
- function Mo(e) {
3266
+ function Io(e) {
3250
3267
  return {
3251
3268
  added: e.filter((e) => e.kind === "added").length,
3252
3269
  removed: e.filter((e) => e.kind === "removed").length
@@ -3254,7 +3271,7 @@ function Mo(e) {
3254
3271
  }
3255
3272
  //#endregion
3256
3273
  //#region web/src/call-summary.ts
3257
- function No(e) {
3274
+ function Lo(e) {
3258
3275
  if (e !== void 0 && /^\s*[[{]/.test(e)) try {
3259
3276
  return JSON.parse(e);
3260
3277
  } catch (e) {
@@ -3262,12 +3279,12 @@ function No(e) {
3262
3279
  throw e;
3263
3280
  }
3264
3281
  }
3265
- var Po = 1024;
3266
- function Fo(e, t) {
3267
- return t < Po ? e("kvcoder.ui.call.bytes", { count: t }) : t < Po * Po ? e("kvcoder.ui.call.kilobytes", { count: (t / Po).toFixed(1) }) : e("kvcoder.ui.call.megabytes", { count: (t / (Po * Po)).toFixed(1) });
3282
+ var Ro = 1024;
3283
+ function zo(e, t) {
3284
+ return t < Ro ? e("kvcoder.ui.call.bytes", { count: t }) : t < Ro * Ro ? e("kvcoder.ui.call.kilobytes", { count: (t / Ro).toFixed(1) }) : e("kvcoder.ui.call.megabytes", { count: (t / (Ro * Ro)).toFixed(1) });
3268
3285
  }
3269
3286
  var Q = (e) => typeof e == "string" && e !== "" ? e : void 0;
3270
- function Io(e) {
3287
+ function Bo(e) {
3271
3288
  let t = e.edits;
3272
3289
  return Array.isArray(t) ? t.flatMap((e) => {
3273
3290
  let { oldText: t, newText: n } = q(e);
@@ -3277,28 +3294,28 @@ function Io(e) {
3277
3294
  }] : [];
3278
3295
  }) : [];
3279
3296
  }
3280
- function Lo(e) {
3281
- let t = Io(e).map((e) => Mo(jo(e.oldText, e.newText)));
3297
+ function Vo(e) {
3298
+ let t = Bo(e).map((e) => Io(Fo(e.oldText, e.newText)));
3282
3299
  return `+${t.reduce((e, t) => e + t.added, 0)} −${t.reduce((e, t) => e + t.removed, 0)}`;
3283
3300
  }
3284
- function Ro(e, t) {
3285
- if (typeof t.bytes == "number" && typeof t.created == "boolean") return e(t.created ? "kvcoder.ui.call.created" : "kvcoder.ui.call.replaced", { size: Fo(e, t.bytes) });
3301
+ function Ho(e, t) {
3302
+ if (typeof t.bytes == "number" && typeof t.created == "boolean") return e(t.created ? "kvcoder.ui.call.created" : "kvcoder.ui.call.replaced", { size: zo(e, t.bytes) });
3286
3303
  }
3287
- function zo(e, t) {
3304
+ function Uo(e, t) {
3288
3305
  let { fromLine: n, totalLines: r, content: i } = t;
3289
3306
  if (typeof n != "number" || typeof r != "number" || typeof i != "string") return;
3290
- let a = ko(i).length;
3307
+ let a = No(i).length;
3291
3308
  return a === 0 ? void 0 : e("kvcoder.ui.call.lines", {
3292
3309
  from: n,
3293
3310
  to: n + a - 1,
3294
3311
  total: r
3295
3312
  });
3296
3313
  }
3297
- function Bo(e, t) {
3314
+ function Wo(e, t) {
3298
3315
  let n = t.entries;
3299
3316
  if (Array.isArray(n)) return e(t.truncated === !0 ? "kvcoder.ui.call.entriesFirst" : "kvcoder.ui.call.entries", { count: n.length });
3300
3317
  }
3301
- function Vo(e, t) {
3318
+ function Go(e, t) {
3302
3319
  let n = t.files;
3303
3320
  if (!Array.isArray(n)) return;
3304
3321
  let r = n.reduce((e, t) => {
@@ -3310,7 +3327,7 @@ function Vo(e, t) {
3310
3327
  files: n.length
3311
3328
  });
3312
3329
  }
3313
- var Ho = (e, t, n) => Array.isArray(n) ? e(t, { count: n.length }) : void 0;
3330
+ var Ko = (e, t, n) => Array.isArray(n) ? e(t, { count: n.length }) : void 0;
3314
3331
  function $(e, t, n) {
3315
3332
  return {
3316
3333
  ...e === void 0 ? {} : { words: e },
@@ -3318,87 +3335,87 @@ function $(e, t, n) {
3318
3335
  ...n === void 0 ? {} : { outcome: n }
3319
3336
  };
3320
3337
  }
3321
- function Uo(e, t, n, r) {
3338
+ function qo(e, t, n, r) {
3322
3339
  let i = r === void 0 ? void 0 : q(r), a = Q(n.path);
3323
- if (t === "edit") return $(e("kvcoder.ui.call.edit"), a, i === void 0 ? void 0 : Lo(n));
3324
- if (t === "write") return $(e("kvcoder.ui.call.write"), a, i === void 0 ? void 0 : Ro(e, i));
3325
- if (t === "read") return $(e("kvcoder.ui.call.read"), a, i === void 0 ? void 0 : zo(e, i));
3326
- if (t === "list") return $(e("kvcoder.ui.call.list"), a ?? ".", i === void 0 ? void 0 : Bo(e, i));
3327
- if (t === "search") return $(e("kvcoder.ui.call.search"), Q(n.pattern), i === void 0 ? void 0 : Vo(e, i));
3340
+ if (t === "edit") return $(e("kvcoder.ui.call.edit"), a, i === void 0 ? void 0 : Vo(n));
3341
+ if (t === "write") return $(e("kvcoder.ui.call.write"), a, i === void 0 ? void 0 : Ho(e, i));
3342
+ if (t === "read") return $(e("kvcoder.ui.call.read"), a, i === void 0 ? void 0 : Uo(e, i));
3343
+ if (t === "list") return $(e("kvcoder.ui.call.list"), a ?? ".", i === void 0 ? void 0 : Wo(e, i));
3344
+ if (t === "search") return $(e("kvcoder.ui.call.search"), Q(n.pattern), i === void 0 ? void 0 : Go(e, i));
3328
3345
  }
3329
- function Wo(e, t, n, r) {
3346
+ function Jo(e, t, n, r) {
3330
3347
  let i = Q(n.server), a = [i, Q(n.tool)].filter((e) => e !== void 0).join(" · ");
3331
3348
  if (t === "call") return $(void 0, a === "" ? void 0 : a);
3332
3349
  if (t === "run") {
3333
3350
  let e = n.steps;
3334
3351
  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(" · "));
3335
3352
  }
3336
- if (t === "tools") return $(e("kvcoder.ui.call.tools"), a === "" ? void 0 : a, Ho(e, "kvcoder.ui.call.toolCount", q(r).tools));
3353
+ if (t === "tools") return $(e("kvcoder.ui.call.tools"), a === "" ? void 0 : a, Ko(e, "kvcoder.ui.call.toolCount", q(r).tools));
3337
3354
  }
3338
- function Go(e, t, n, r) {
3339
- if (t === "list") return $(e("kvcoder.ui.call.backgroundRuns"), void 0, Ho(e, "kvcoder.ui.call.runCount", r));
3355
+ function Yo(e, t, n, r) {
3356
+ if (t === "list") return $(e("kvcoder.ui.call.backgroundRuns"), void 0, Ko(e, "kvcoder.ui.call.runCount", r));
3340
3357
  if (t === "output" || t === "wait") {
3341
- let i = Eo(r);
3342
- return $(e(`kvcoder.ui.call.${t}`), Q(n.id), i === void 0 ? void 0 : To(e, i.status));
3358
+ let i = Ao(r);
3359
+ return $(e(`kvcoder.ui.call.${t}`), Q(n.id), i === void 0 ? void 0 : ko(e, i.status));
3343
3360
  }
3344
3361
  if (t === "stop") return $(e("kvcoder.ui.call.stop"), Q(n.id));
3345
3362
  }
3346
- function Ko(e, t, n, r) {
3363
+ function Xo(e, t, n, r) {
3347
3364
  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;
3348
3365
  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;
3349
3366
  }
3350
- function qo(e, t, n) {
3367
+ function Zo(e, t, n) {
3351
3368
  let { connector: r, command: i } = t, a = t.fields ?? {};
3352
3369
  if (r !== void 0 && i !== void 0) {
3353
3370
  if (t.line !== void 0) return { subject: `$ ${t.line}` };
3354
- if (r === "fs") return Uo(e, i, a, n);
3355
- if (r === "mcp") return Wo(e, i, a, n);
3356
- if (r === "background") return Go(e, i, a, n);
3357
- if (r === "execution-map") return Ko(e, i, a, n);
3371
+ if (r === "fs") return qo(e, i, a, n);
3372
+ if (r === "mcp") return Jo(e, i, a, n);
3373
+ if (r === "background") return Yo(e, i, a, n);
3374
+ if (r === "execution-map") return Xo(e, i, a, n);
3358
3375
  if (r === "delegate" && i === "run") return $(e("kvcoder.ui.call.delegate"), [Q(a.worker), Q(a.title)].filter((e) => e !== void 0).join(" · "));
3359
3376
  if (r === "artifact" && i === "get") return $(e("kvcoder.ui.call.readArtifact"), Q(a.id));
3360
3377
  }
3361
3378
  }
3362
3379
  //#endregion
3363
3380
  //#region web/src/field-rows.ts
3364
- var Jo = "—", Yo = (e) => e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean", Xo = (e) => e === null ? Jo : String(e);
3365
- function Zo(e) {
3381
+ var Qo = "—", $o = (e) => e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean", es = (e) => e === null ? Qo : String(e);
3382
+ function ts(e) {
3366
3383
  return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
3367
3384
  }
3368
- function Qo(e) {
3369
- let t = Zo(e);
3385
+ function ns(e) {
3386
+ let t = ts(e);
3370
3387
  if (t === void 0) return;
3371
3388
  let n = {};
3372
3389
  for (let [e, r] of Object.entries(t)) {
3373
- if (!Yo(r)) return;
3390
+ if (!$o(r)) return;
3374
3391
  n[e] = r;
3375
3392
  }
3376
3393
  return n;
3377
3394
  }
3378
- function $o(e) {
3395
+ function rs(e) {
3379
3396
  let t = [...new Set(e.flatMap((e) => Object.keys(e)))];
3380
3397
  return {
3381
3398
  kind: "table",
3382
3399
  columns: t,
3383
- rows: e.map((e) => t.map((t) => t in e ? Xo(e[t] ?? null) : ""))
3400
+ rows: e.map((e) => t.map((t) => t in e ? es(e[t] ?? null) : ""))
3384
3401
  };
3385
3402
  }
3386
- function es(e) {
3403
+ function is(e) {
3387
3404
  if (e.length === 0) return { kind: "empty" };
3388
- if (e.every(Yo)) return {
3405
+ if (e.every($o)) return {
3389
3406
  kind: "items",
3390
- items: e.map(Xo)
3407
+ items: e.map(es)
3391
3408
  };
3392
- let t = e.map(Qo).filter((e) => e !== void 0);
3393
- return t.length === e.length ? $o(t) : {
3409
+ let t = e.map(ns).filter((e) => e !== void 0);
3410
+ return t.length === e.length ? rs(t) : {
3394
3411
  kind: "rows",
3395
3412
  rows: e.map((e, t) => ({
3396
3413
  name: String(t + 1),
3397
- value: ts(e)
3414
+ value: as(e)
3398
3415
  }))
3399
3416
  };
3400
3417
  }
3401
- function ts(e) {
3418
+ function as(e) {
3402
3419
  if (typeof e == "string") return e.includes("\n") ? {
3403
3420
  kind: "block",
3404
3421
  text: e
@@ -3410,27 +3427,27 @@ function ts(e) {
3410
3427
  kind: "text",
3411
3428
  text: String(e)
3412
3429
  };
3413
- if (Array.isArray(e)) return es(e);
3414
- let t = Zo(e);
3430
+ if (Array.isArray(e)) return is(e);
3431
+ let t = ts(e);
3415
3432
  return t === void 0 || Object.keys(t).length === 0 ? { kind: "empty" } : {
3416
3433
  kind: "rows",
3417
- rows: ns(t)
3434
+ rows: os(t)
3418
3435
  };
3419
3436
  }
3420
- function ns(e) {
3437
+ function os(e) {
3421
3438
  return Object.entries(e).map(([e, t]) => ({
3422
3439
  name: e,
3423
- value: ts(t)
3440
+ value: as(t)
3424
3441
  }));
3425
3442
  }
3426
- function rs(e, t) {
3443
+ function ss(e, t) {
3427
3444
  return t || e.length <= 12 ? e : e.slice(0, 12);
3428
3445
  }
3429
- var is = (e) => ko(e).map((e) => ({ text: e })), as = (e, t) => ko(e).map((e, n) => ({
3446
+ var cs = (e) => No(e).map((e) => ({ text: e })), ls = (e, t) => No(e).map((e, n) => ({
3430
3447
  text: e,
3431
3448
  number: t + n
3432
3449
  }));
3433
- function os(e, t) {
3450
+ function us(e, t) {
3434
3451
  return t || e.length <= 17 ? e : [
3435
3452
  ...e.slice(0, 12),
3436
3453
  "⋯",
@@ -3439,7 +3456,7 @@ function os(e, t) {
3439
3456
  }
3440
3457
  //#endregion
3441
3458
  //#region web/src/FoldButton.vue?vue&type=script&setup=true&lang.ts
3442
- var ss = ["aria-expanded"], cs = /* @__PURE__ */ c({
3459
+ var ds = ["aria-expanded"], fs = /* @__PURE__ */ c({
3443
3460
  __name: "FoldButton",
3444
3461
  props: {
3445
3462
  count: {},
@@ -3456,119 +3473,119 @@ var ss = ["aria-expanded"], cs = /* @__PURE__ */ c({
3456
3473
  "aria-expanded": n.open,
3457
3474
  "data-test": "show-all",
3458
3475
  onClick: t[0] ||= (e) => a("toggle")
3459
- }, E(n.open ? D(o).t("kvcoder.ui.call.showFewer") : D(o).t("kvcoder.ui.call.showAll", { count: n.count })), 9, ss)) : r("v-if", !0);
3476
+ }, E(n.open ? D(o).t("kvcoder.ui.call.showFewer") : D(o).t("kvcoder.ui.call.showAll", { count: n.count })), 9, ds)) : r("v-if", !0);
3460
3477
  }
3461
- }), ls = { class: "kvc-code-lines" }, us = ["dir", "data-kind"], ds = {
3478
+ }), ps = { class: "kvc-code-lines" }, ms = ["dir", "data-kind"], hs = {
3462
3479
  key: 0,
3463
3480
  class: "kvc-line-number",
3464
3481
  "data-test": "call-line-number"
3465
- }, fs = {
3482
+ }, gs = {
3466
3483
  key: 1,
3467
3484
  class: "kvc-line-mark",
3468
3485
  "aria-hidden": "true"
3469
- }, ps = {
3486
+ }, _s = {
3470
3487
  class: "kvc-line-text",
3471
3488
  dir: "auto",
3472
3489
  "data-test": "call-line-text"
3473
- }, ms = /* @__PURE__ */ c({
3490
+ }, vs = /* @__PURE__ */ c({
3474
3491
  __name: "FoldedLines",
3475
3492
  props: { lines: {} },
3476
3493
  setup(n) {
3477
- let o = n, c = y(!1), l = t(() => rs(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 = {
3494
+ let o = n, c = y(!1), l = t(() => ss(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 = {
3478
3495
  context: " ",
3479
3496
  removed: "−",
3480
3497
  added: "+"
3481
3498
  };
3482
- return (t, n) => (_(), i("div", ls, [(_(!0), i(e, null, b(l.value, (e, t) => (_(), i("div", {
3499
+ return (t, n) => (_(), i("div", ps, [(_(!0), i(e, null, b(l.value, (e, t) => (_(), i("div", {
3483
3500
  key: t,
3484
3501
  class: "kvc-code-line",
3485
3502
  dir: u.value || d.value ? "ltr" : void 0,
3486
3503
  "data-kind": e.kind,
3487
3504
  "data-test": "call-line-row"
3488
3505
  }, [
3489
- u.value ? (_(), i("span", ds, E(e.number), 1)) : r("v-if", !0),
3490
- d.value ? (_(), i("span", fs, E(f[e.kind ?? "context"]), 1)) : r("v-if", !0),
3491
- a("span", ps, [s(Y, { text: e.text }, null, 8, ["text"])])
3492
- ], 8, us))), 128)), s(cs, {
3506
+ u.value ? (_(), i("span", hs, E(e.number), 1)) : r("v-if", !0),
3507
+ d.value ? (_(), i("span", gs, E(f[e.kind ?? "context"]), 1)) : r("v-if", !0),
3508
+ a("span", _s, [s(Y, { text: e.text }, null, 8, ["text"])])
3509
+ ], 8, ms))), 128)), s(fs, {
3493
3510
  count: o.lines.length,
3494
3511
  open: c.value,
3495
3512
  onToggle: n[0] ||= (e) => c.value = !c.value
3496
3513
  }, null, 8, ["count", "open"])]));
3497
3514
  }
3498
- }), hs = {
3515
+ }), ys = {
3499
3516
  key: 0,
3500
3517
  dir: "auto",
3501
3518
  "data-test": "field-text"
3502
- }, gs = {
3519
+ }, bs = {
3503
3520
  key: 1,
3504
3521
  class: "kvc-muted",
3505
3522
  "data-test": "field-empty"
3506
- }, _s = {
3523
+ }, xs = {
3507
3524
  key: 3,
3508
3525
  class: "kvc-field-table"
3509
- }, vs = { "data-test": "field-table" }, ys = {
3526
+ }, Ss = { "data-test": "field-table" }, Cs = {
3510
3527
  key: 4,
3511
3528
  class: "kvc-field-items",
3512
3529
  "data-test": "field-items"
3513
- }, bs = {
3530
+ }, ws = {
3514
3531
  key: 5,
3515
3532
  class: "kvc-fields",
3516
3533
  "data-test": "call-fields"
3517
- }, xs = ["data-name"], Ss = {
3534
+ }, Ts = ["data-name"], Es = {
3518
3535
  class: "kvc-muted",
3519
3536
  dir: "ltr"
3520
- }, Cs = { "data-test": "field-value" }, ws = /* @__PURE__ */ c({
3537
+ }, Ds = { "data-test": "field-value" }, Os = /* @__PURE__ */ c({
3521
3538
  __name: "FieldsView",
3522
3539
  props: { value: {} },
3523
3540
  setup(r) {
3524
- let o = r, c = y(!1), l = t(() => o.value.kind === "table" ? rs(o.value.rows, c.value) : []), u = t(() => o.value.kind === "items" ? rs(o.value.items, c.value) : []);
3541
+ let o = r, c = y(!1), l = t(() => o.value.kind === "table" ? ss(o.value.rows, c.value) : []), u = t(() => o.value.kind === "items" ? ss(o.value.items, c.value) : []);
3525
3542
  return (t, r) => {
3526
3543
  let d = S("FieldsView", !0);
3527
- return o.value.kind === "text" ? (_(), i("span", hs, [s(Y, { text: o.value.text }, null, 8, ["text"])])) : o.value.kind === "empty" ? (_(), i("span", gs, "—")) : o.value.kind === "block" ? (_(), n(ms, {
3544
+ return o.value.kind === "text" ? (_(), i("span", ys, [s(Y, { text: o.value.text }, null, 8, ["text"])])) : o.value.kind === "empty" ? (_(), i("span", bs, "—")) : o.value.kind === "block" ? (_(), n(vs, {
3528
3545
  key: 2,
3529
3546
  class: "kvc-field-block",
3530
- lines: D(is)(o.value.text),
3547
+ lines: D(cs)(o.value.text),
3531
3548
  "data-test": "field-block"
3532
- }, null, 8, ["lines"])) : o.value.kind === "table" ? (_(), i("div", _s, [a("table", vs, [a("thead", null, [a("tr", null, [(_(!0), i(e, null, b(o.value.columns, (e) => (_(), i("th", {
3549
+ }, null, 8, ["lines"])) : o.value.kind === "table" ? (_(), i("div", xs, [a("table", Ss, [a("thead", null, [a("tr", null, [(_(!0), i(e, null, b(o.value.columns, (e) => (_(), i("th", {
3533
3550
  key: e,
3534
3551
  scope: "col",
3535
3552
  dir: "ltr"
3536
3553
  }, 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", {
3537
3554
  key: t,
3538
3555
  dir: "auto"
3539
- }, [s(Y, { text: e }, null, 8, ["text"])]))), 128))]))), 128))])]), s(cs, {
3556
+ }, [s(Y, { text: e }, null, 8, ["text"])]))), 128))]))), 128))])]), s(fs, {
3540
3557
  count: o.value.rows.length,
3541
3558
  open: c.value,
3542
3559
  onToggle: r[0] ||= (e) => c.value = !c.value
3543
- }, null, 8, ["count", "open"])])) : o.value.kind === "items" ? (_(), i("div", ys, [(_(!0), i(e, null, b(u.value, (e, t) => (_(), i("div", {
3560
+ }, null, 8, ["count", "open"])])) : o.value.kind === "items" ? (_(), i("div", Cs, [(_(!0), i(e, null, b(u.value, (e, t) => (_(), i("div", {
3544
3561
  key: t,
3545
3562
  dir: "auto"
3546
- }, [s(Y, { text: e }, null, 8, ["text"])]))), 128)), s(cs, {
3563
+ }, [s(Y, { text: e }, null, 8, ["text"])]))), 128)), s(fs, {
3547
3564
  count: o.value.items.length,
3548
3565
  open: c.value,
3549
3566
  onToggle: r[1] ||= (e) => c.value = !c.value
3550
- }, null, 8, ["count", "open"])])) : (_(), i("dl", bs, [(_(!0), i(e, null, b(o.value.rows, (e) => (_(), i("div", {
3567
+ }, null, 8, ["count", "open"])])) : (_(), i("dl", ws, [(_(!0), i(e, null, b(o.value.rows, (e) => (_(), i("div", {
3551
3568
  key: e.name,
3552
3569
  class: "kvc-field-row",
3553
3570
  "data-name": e.name,
3554
3571
  "data-test": "field-row"
3555
- }, [a("dt", Ss, E(e.name), 1), a("dd", Cs, [s(d, { value: e.value }, null, 8, ["value"])])], 8, xs))), 128))]));
3572
+ }, [a("dt", Es, E(e.name), 1), a("dd", Ds, [s(d, { value: e.value }, null, 8, ["value"])])], 8, Ts))), 128))]));
3556
3573
  };
3557
3574
  }
3558
- }), Ts = ["aria-label"], Es = ["aria-label"], Ds = /* @__PURE__ */ c({
3575
+ }), ks = ["aria-label"], As = ["aria-label"], js = /* @__PURE__ */ c({
3559
3576
  __name: "CallRequest",
3560
3577
  props: { view: {} },
3561
3578
  setup(a) {
3562
- let o = a, c = K(), l = t(() => ma(o.view)), u = t(() => o.view.fields ?? {}), d = t(() => Io(u.value).map((e) => jo(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 : {});
3563
- return (t, a) => l.value === "edit" ? (_(!0), i(e, { key: 0 }, b(d.value, (e, t) => (_(), n(ms, {
3579
+ let o = a, c = K(), l = t(() => ma(o.view)), u = t(() => o.view.fields ?? {}), d = t(() => Bo(u.value).map((e) => Fo(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 : {});
3580
+ return (t, a) => l.value === "edit" ? (_(!0), i(e, { key: 0 }, b(d.value, (e, t) => (_(), n(vs, {
3564
3581
  key: t,
3565
3582
  class: "kvc-block",
3566
3583
  lines: e,
3567
3584
  "data-test": "call-diff"
3568
- }, null, 8, ["lines"]))), 128)) : l.value === "write" ? (_(), n(ms, {
3585
+ }, null, 8, ["lines"]))), 128)) : l.value === "write" ? (_(), n(vs, {
3569
3586
  key: 1,
3570
3587
  class: "kvc-block",
3571
- lines: D(as)(f.value, 1),
3588
+ lines: D(ls)(f.value, 1),
3572
3589
  "data-test": "call-content"
3573
3590
  }, null, 8, ["lines"])) : l.value === "line" ? (_(), i("pre", {
3574
3591
  key: 2,
@@ -3576,10 +3593,10 @@ var ss = ["aria-expanded"], cs = /* @__PURE__ */ c({
3576
3593
  dir: "ltr",
3577
3594
  "aria-label": D(c).t("kvcoder.ui.command"),
3578
3595
  "data-test": "call-payload"
3579
- }, "$ " + E(o.view.line), 9, Ts)) : l.value === "delegate" ? (_(), n(ms, {
3596
+ }, "$ " + E(o.view.line), 9, ks)) : l.value === "delegate" ? (_(), n(vs, {
3580
3597
  key: 3,
3581
3598
  class: "kvc-block kvc-prose-lines",
3582
- lines: D(is)(p.value),
3599
+ lines: D(cs)(p.value),
3583
3600
  "aria-label": D(c).t("kvcoder.ui.call.task"),
3584
3601
  "data-test": "call-task"
3585
3602
  }, null, 8, ["lines", "aria-label"])) : Object.keys(m.value).length > 0 ? (_(), i("div", {
@@ -3587,19 +3604,19 @@ var ss = ["aria-expanded"], cs = /* @__PURE__ */ c({
3587
3604
  class: "kvc-block",
3588
3605
  "aria-label": D(c).t("kvcoder.ui.call.payload"),
3589
3606
  "data-test": "call-payload-fields"
3590
- }, [s(ws, { value: D(ts)(m.value) }, null, 8, ["value"])], 8, Es)) : r("v-if", !0);
3607
+ }, [s(Os, { value: D(as)(m.value) }, null, 8, ["value"])], 8, As)) : r("v-if", !0);
3591
3608
  }
3592
- }), Os = { class: "kvc-output-block" }, ks = ["aria-label"], As = /* @__PURE__ */ c({
3609
+ }), Ms = { class: "kvc-output-block" }, Ns = ["aria-label"], Ps = /* @__PURE__ */ c({
3593
3610
  __name: "FoldedOutput",
3594
3611
  props: { output: {} },
3595
3612
  setup(e) {
3596
- let n = e, r = K(), o = y(!1), c = t(() => n.output.split("\n")), l = t(() => os(c.value, o.value).join("\n"));
3597
- return (e, t) => (_(), i("div", Os, [a("pre", {
3613
+ let n = e, r = K(), o = y(!1), c = t(() => n.output.split("\n")), l = t(() => us(c.value, o.value).join("\n"));
3614
+ return (e, t) => (_(), i("div", Ms, [a("pre", {
3598
3615
  class: "kvc-output",
3599
3616
  dir: "auto",
3600
3617
  "aria-label": D(r).t("kvcoder.ui.output"),
3601
3618
  "data-test": "call-output"
3602
- }, [s(Y, { text: l.value }, null, 8, ["text"])], 8, ks), s(cs, {
3619
+ }, [s(Y, { text: l.value }, null, 8, ["text"])], 8, Ns), s(fs, {
3603
3620
  count: c.value.length,
3604
3621
  open: o.value,
3605
3622
  over: D(12) + D(5),
@@ -3613,7 +3630,7 @@ var ss = ["aria-expanded"], cs = /* @__PURE__ */ c({
3613
3630
  });
3614
3631
  //#endregion
3615
3632
  //#region web/src/durations.ts
3616
- function js(e, t) {
3633
+ function Fs(e, t) {
3617
3634
  if (t < 1e3) return e("kvcoder.ui.milliseconds", { count: Math.round(t) });
3618
3635
  if (t < 1e4) return e("kvcoder.ui.seconds", { count: (t / 1e3).toFixed(1) });
3619
3636
  let n = Math.round(t / 1e3);
@@ -3624,21 +3641,21 @@ function js(e, t) {
3624
3641
  }
3625
3642
  //#endregion
3626
3643
  //#region web/src/RunOutput.vue?vue&type=script&setup=true&lang.ts
3627
- var Ms = {
3644
+ var Is = {
3628
3645
  class: "kvc-block kvc-run-row",
3629
3646
  "data-test": "run-row"
3630
- }, Ns = {
3647
+ }, Ls = {
3631
3648
  class: "kvc-run-call",
3632
3649
  dir: "auto",
3633
3650
  "data-test": "run-call"
3634
- }, Ps = {
3651
+ }, Rs = {
3635
3652
  class: "kvc-chip",
3636
3653
  "data-test": "run-status"
3637
- }, Fs = {
3654
+ }, zs = {
3638
3655
  key: 0,
3639
3656
  class: "kvc-muted",
3640
3657
  "data-test": "run-time"
3641
- }, Is = ["aria-label"], Ls = ["aria-label"], Rs = ["aria-label"], zs = ["aria-label"], Bs = /* @__PURE__ */ c({
3658
+ }, Bs = ["aria-label"], Vs = ["aria-label"], Hs = ["aria-label"], Us = ["aria-label"], Ws = /* @__PURE__ */ c({
3642
3659
  __name: "RunOutput",
3643
3660
  props: { run: {} },
3644
3661
  setup(c) {
@@ -3648,59 +3665,59 @@ var Ms = {
3648
3665
  params: { text: f.value ?? "" }
3649
3666
  }));
3650
3667
  return (t, c) => (_(), i(e, null, [
3651
- a("div", Ms, [
3652
- a("span", Ns, E(l.run.call), 1),
3653
- a("span", Ps, [o(E(D(To)(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))]),
3654
- l.run.ranMs === void 0 ? r("v-if", !0) : (_(), i("span", Fs, E(D(js)(D(u).t, l.run.ranMs)), 1))
3668
+ a("div", Is, [
3669
+ a("span", Ls, E(l.run.call), 1),
3670
+ a("span", Rs, [o(E(D(ko)(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))]),
3671
+ l.run.ranMs === void 0 ? r("v-if", !0) : (_(), i("span", zs, E(D(Fs)(D(u).t, l.run.ranMs)), 1))
3655
3672
  ]),
3656
3673
  p.value === void 0 ? l.run.problem === void 0 ? r("v-if", !0) : (_(), i("div", {
3657
3674
  key: 1,
3658
3675
  class: "kvc-block kvc-error",
3659
3676
  "aria-label": D(u).t("kvcoder.ui.call.error"),
3660
3677
  "data-test": "run-problem"
3661
- }, [s(ws, { value: D(ts)(l.run.problem) }, null, 8, ["value"])], 8, Ls)) : (_(), i("pre", {
3678
+ }, [s(Os, { value: D(as)(l.run.problem) }, null, 8, ["value"])], 8, Vs)) : (_(), i("pre", {
3662
3679
  key: 0,
3663
3680
  class: "kvc-block kvc-error",
3664
3681
  dir: "auto",
3665
3682
  "aria-label": D(u).t("kvcoder.ui.call.error"),
3666
3683
  "data-test": "run-problem"
3667
- }, [s(Y, { text: p.value }, null, 8, ["text"])], 8, Is)),
3684
+ }, [s(Y, { text: p.value }, null, 8, ["text"])], 8, Bs)),
3668
3685
  f.value === void 0 && l.run.output !== void 0 ? (_(), i("div", {
3669
3686
  key: 2,
3670
3687
  class: "kvc-block",
3671
3688
  "aria-label": D(u).t("kvcoder.ui.output"),
3672
3689
  "data-test": "call-result-fields"
3673
- }, [s(ws, { value: D(ts)(l.run.output) }, null, 8, ["value"])], 8, Rs)) : l.run.answer && f.value ? (_(), i("div", {
3690
+ }, [s(Os, { value: D(as)(l.run.output) }, null, 8, ["value"])], 8, Hs)) : l.run.answer && f.value ? (_(), i("div", {
3674
3691
  key: 3,
3675
3692
  class: "kvc-block",
3676
3693
  "aria-label": D(u).t("kvcoder.ui.call.answer"),
3677
3694
  "data-test": "call-answer"
3678
- }, [(_(), n(C(D(u).View), { view: m.value }, null, 8, ["view"]))], 8, zs)) : f.value ? (_(), n(As, {
3695
+ }, [(_(), n(C(D(u).View), { view: m.value }, null, 8, ["view"]))], 8, Us)) : f.value ? (_(), n(Ps, {
3679
3696
  key: 4,
3680
3697
  output: f.value
3681
3698
  }, null, 8, ["output"])) : r("v-if", !0)
3682
3699
  ], 64));
3683
3700
  }
3684
- }), Vs = {
3701
+ }), Gs = {
3685
3702
  key: 0,
3686
3703
  class: "kvc-muted kvc-call-parts",
3687
3704
  "data-test": "call-replacements"
3688
- }, Hs = {
3705
+ }, Ks = {
3689
3706
  key: 2,
3690
3707
  class: "kvc-block kvc-entries",
3691
3708
  "data-test": "call-entries"
3692
- }, Us = ["data-kind"], Ws = {
3709
+ }, qs = ["data-kind"], Js = {
3693
3710
  class: "kvc-mono",
3694
3711
  dir: "auto",
3695
3712
  "data-test": "call-entry-name"
3696
- }, Gs = {
3713
+ }, Ys = {
3697
3714
  key: 0,
3698
3715
  class: "kvc-muted",
3699
3716
  "data-test": "call-entry-size"
3700
- }, Ks = {
3717
+ }, Xs = {
3701
3718
  class: "kvc-mono kvc-file-path",
3702
3719
  "data-test": "call-file-path"
3703
- }, qs = ["aria-label"], Js = ["aria-label"], Ys = /* @__PURE__ */ c({
3720
+ }, Zs = ["aria-label"], Qs = ["aria-label"], $s = /* @__PURE__ */ c({
3704
3721
  __name: "CallResult",
3705
3722
  props: {
3706
3723
  view: {},
@@ -3708,7 +3725,7 @@ var Ms = {
3708
3725
  result: {}
3709
3726
  },
3710
3727
  setup(o) {
3711
- let c = o, l = K(), u = t(() => ma(c.view)), d = t(() => u.value === "edit" ? yo(c.result) : void 0), f = t(() => u.value === "read" ? bo(c.result) : void 0), p = t(() => u.value === "list" ? So(c.result) : void 0), m = t(() => u.value === "search" ? Do(c.result) : void 0), h = t(() => u.value === "run-output" ? Eo(c.result) : void 0), g = y(!1), v = t(() => rs(p.value ?? [], g.value)), x = t(() => ({
3728
+ let c = o, l = K(), u = t(() => ma(c.view)), d = t(() => u.value === "edit" ? Co(c.result) : void 0), f = t(() => u.value === "read" ? wo(c.result) : void 0), p = t(() => u.value === "list" ? Eo(c.result) : void 0), m = t(() => u.value === "search" ? jo(c.result) : void 0), h = t(() => u.value === "run-output" ? Ao(c.result) : void 0), g = y(!1), v = t(() => ss(p.value ?? [], g.value)), x = t(() => ({
3712
3729
  type: "markdown",
3713
3730
  text: "kvcoder.markdown",
3714
3731
  params: { text: c.output }
@@ -3718,25 +3735,25 @@ var Ms = {
3718
3735
  class: "kvc-block",
3719
3736
  "aria-label": D(l).t("kvcoder.ui.call.answer"),
3720
3737
  "data-test": "call-answer"
3721
- }, [(_(), n(C(D(l).View), { view: x.value }, null, 8, ["view"]))], 8, qs)) : S.value ? (_(), i("div", {
3738
+ }, [(_(), n(C(D(l).View), { view: x.value }, null, 8, ["view"]))], 8, Zs)) : S.value ? (_(), i("div", {
3722
3739
  key: 7,
3723
3740
  class: "kvc-block",
3724
3741
  "aria-label": D(l).t("kvcoder.ui.output"),
3725
3742
  "data-test": "call-result-fields"
3726
- }, [s(ws, { value: D(ts)(c.result) }, null, 8, ["value"])], 8, Js)) : c.output === "" ? r("v-if", !0) : (_(), n(As, {
3743
+ }, [s(Os, { value: D(as)(c.result) }, null, 8, ["value"])], 8, Qs)) : c.output === "" ? r("v-if", !0) : (_(), n(Ps, {
3727
3744
  key: 8,
3728
3745
  output: c.output
3729
- }, null, 8, ["output"])) : (_(), n(Bs, {
3746
+ }, null, 8, ["output"])) : (_(), n(Ws, {
3730
3747
  key: 5,
3731
3748
  run: h.value
3732
3749
  }, null, 8, ["run"])) : (_(!0), i(e, { key: 3 }, b(m.value, (e) => (_(), i("div", {
3733
3750
  key: e.path,
3734
3751
  class: "kvc-block",
3735
3752
  "data-test": "call-file"
3736
- }, [a("div", Ks, E(e.path), 1), s(ms, { lines: e.matches.map((e) => ({
3753
+ }, [a("div", Xs, E(e.path), 1), s(vs, { lines: e.matches.map((e) => ({
3737
3754
  text: e.text,
3738
3755
  number: e.line
3739
- })) }, null, 8, ["lines"])]))), 128)) : (_(), i("div", Hs, [(_(!0), i(e, null, b(v.value, (e) => (_(), i("div", {
3756
+ })) }, null, 8, ["lines"])]))), 128)) : (_(), i("div", Ks, [(_(!0), i(e, null, b(v.value, (e) => (_(), i("div", {
3740
3757
  key: e.name,
3741
3758
  class: "kvc-entry",
3742
3759
  "data-kind": e.kind,
@@ -3746,40 +3763,40 @@ var Ms = {
3746
3763
  size: 14,
3747
3764
  "aria-hidden": "true"
3748
3765
  })),
3749
- a("span", Ws, E(e.name), 1),
3750
- e.kind === "file" ? (_(), i("span", Gs, E(D(Fo)(D(l).t, e.bytes)), 1)) : r("v-if", !0)
3751
- ], 8, Us))), 128)), s(cs, {
3766
+ a("span", Js, E(e.name), 1),
3767
+ e.kind === "file" ? (_(), i("span", Ys, E(D(zo)(D(l).t, e.bytes)), 1)) : r("v-if", !0)
3768
+ ], 8, qs))), 128)), s(fs, {
3752
3769
  count: p.value.length,
3753
3770
  open: g.value,
3754
3771
  onToggle: o[0] ||= (e) => g.value = !g.value
3755
- }, null, 8, ["count", "open"])])) : (_(), n(ms, {
3772
+ }, null, 8, ["count", "open"])])) : (_(), n(vs, {
3756
3773
  key: 1,
3757
3774
  class: "kvc-block",
3758
- lines: D(as)(f.value.content, f.value.fromLine),
3775
+ lines: D(ls)(f.value.content, f.value.fromLine),
3759
3776
  "data-test": "call-content"
3760
- }, null, 8, ["lines"])) : (_(), i("p", Vs, E(D(l).t("kvcoder.ui.call.replacements", {
3777
+ }, null, 8, ["lines"])) : (_(), i("p", Gs, E(D(l).t("kvcoder.ui.call.replacements", {
3761
3778
  count: d.value.replacements,
3762
3779
  line: d.value.firstChangedLine
3763
3780
  })), 1));
3764
3781
  }
3765
- }), Xs = {
3782
+ }), ec = {
3766
3783
  key: 0,
3767
3784
  class: "kvc-summary",
3768
3785
  "data-test": "call-summary"
3769
- }, Zs = {
3786
+ }, tc = {
3770
3787
  key: 0,
3771
3788
  "data-test": "call-words"
3772
- }, Qs = {
3789
+ }, nc = {
3773
3790
  key: 1,
3774
3791
  class: "kvc-mono",
3775
3792
  "data-test": "call-subject"
3776
- }, $s = ["dir"], ec = {
3793
+ }, rc = ["dir"], ic = {
3777
3794
  key: 1,
3778
3795
  class: "kvc-muted",
3779
3796
  dir: "ltr",
3780
3797
  style: { "align-self": "flex-start" },
3781
3798
  "data-test": "call-label"
3782
- }, tc = /* @__PURE__ */ c({
3799
+ }, ac = /* @__PURE__ */ c({
3783
3800
  __name: "CallSummaryLine",
3784
3801
  props: {
3785
3802
  view: {},
@@ -3787,46 +3804,50 @@ var Ms = {
3787
3804
  whole: { type: Boolean }
3788
3805
  },
3789
3806
  setup(e) {
3790
- let n = e, a = K(), o = t(() => qo(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 : ha(o.value.subject));
3791
- return (e, t) => o.value === void 0 ? n.view.label ? (_(), i("span", ec, E(n.view.label), 1)) : r("v-if", !0) : (_(), i("span", Xs, [
3792
- o.value.words ? (_(), i("span", Zs, E(o.value.words), 1)) : r("v-if", !0),
3793
- c.value ? (_(), i("span", Qs, E(c.value), 1)) : r("v-if", !0),
3807
+ let n = e, a = K(), o = t(() => Zo(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 : ha(o.value.subject));
3808
+ return (e, t) => o.value === void 0 ? n.view.label ? (_(), i("span", ic, E(n.view.label), 1)) : r("v-if", !0) : (_(), i("span", ec, [
3809
+ o.value.words ? (_(), i("span", tc, E(o.value.words), 1)) : r("v-if", !0),
3810
+ c.value ? (_(), i("span", nc, E(c.value), 1)) : r("v-if", !0),
3794
3811
  o.value.outcome ? (_(), i("span", {
3795
3812
  key: 2,
3796
3813
  class: "kvc-muted",
3797
3814
  dir: s.value,
3798
3815
  "data-test": "call-outcome"
3799
- }, E(o.value.outcome), 9, $s)) : r("v-if", !0)
3816
+ }, E(o.value.outcome), 9, rc)) : r("v-if", !0)
3800
3817
  ]));
3801
3818
  }
3802
- }), nc = ["aria-expanded", "disabled"], rc = ["aria-label"], ic = { class: "kvc-lines" }, ac = {
3819
+ }), oc = ["aria-expanded", "disabled"], sc = ["aria-label"], cc = { class: "kvc-lines" }, lc = {
3803
3820
  key: 0,
3804
3821
  style: { "font-weight": "600" },
3805
3822
  "data-test": "call-description"
3806
- }, oc = {
3823
+ }, uc = {
3807
3824
  key: 1,
3808
3825
  class: "kvc-oneline",
3809
3826
  "data-test": "call-line"
3810
- }, sc = { class: "kvc-mono" }, cc = {
3827
+ }, dc = { class: "kvc-mono" }, fc = {
3811
3828
  key: 2,
3812
3829
  class: "kvc-chip kvc-warn",
3813
3830
  "data-test": "call-risky"
3814
- }, lc = {
3831
+ }, pc = {
3815
3832
  key: 3,
3816
3833
  class: "kvc-chip",
3817
3834
  "data-test": "call-background"
3818
- }, uc = {
3835
+ }, mc = {
3819
3836
  key: 4,
3837
+ class: "kvc-chip",
3838
+ "data-test": "call-not-run"
3839
+ }, hc = {
3840
+ key: 5,
3820
3841
  class: "kvc-chip kvc-danger",
3821
3842
  "data-test": "call-failed"
3822
- }, dc = {
3843
+ }, gc = {
3823
3844
  class: "kvc-muted",
3824
3845
  "data-test": "call-time"
3825
- }, fc = {
3846
+ }, _c = {
3826
3847
  key: 0,
3827
3848
  class: "kvc-muted kvc-call-parts",
3828
3849
  "data-test": "call-parts"
3829
- }, pc = ["aria-label"], mc = /* @__PURE__ */ c({
3850
+ }, vc = ["aria-expanded"], yc = ["aria-label"], bc = /* @__PURE__ */ c({
3830
3851
  __name: "CallCard",
3831
3852
  props: {
3832
3853
  view: {},
@@ -3836,16 +3857,19 @@ var Ms = {
3836
3857
  running: { type: Boolean }
3837
3858
  },
3838
3859
  setup(o) {
3839
- let c = o, l = K(), u = t(() => ma(c.view)), d = y(c.output !== void 0 && (c.failed === !0 || u.value === "edit" || u.value === "write")), p = t(() => c.failed === !0 ? void 0 : No(c.output)), m = t(() => c.failed === !0 && u.value !== "line"), h = t(() => c.durationMs === void 0 ? "" : js(l.t, (c.view.writtenMs ?? 0) + c.durationMs)), g = t(() => {
3860
+ let c = o, l = K(), u = t(() => ma(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 ? So(c.output) : void 0), h = t(() => m.value?.kind === "invalid"), g = t(() => {
3861
+ let e = m.value;
3862
+ return e === void 0 ? "" : e.kind === "error" ? e.message : l.t(`kvcoder.ui.failure.${e.kind}`);
3863
+ }), v = t(() => c.failed === !0 ? void 0 : Lo(c.output)), b = t(() => c.failed === !0 && u.value !== "line"), x = t(() => c.durationMs === void 0 ? "" : Fs(l.t, (c.view.writtenMs ?? 0) + c.durationMs)), S = t(() => {
3840
3864
  if (c.durationMs === void 0) return "";
3841
- let e = js(l.t, c.durationMs);
3865
+ let e = Fs(l.t, c.durationMs);
3842
3866
  return c.view.writtenMs === void 0 ? l.t("kvcoder.ui.callRan", { ran: e }) : l.t("kvcoder.ui.callParts", {
3843
- written: js(l.t, c.view.writtenMs),
3867
+ written: Fs(l.t, c.view.writtenMs),
3844
3868
  ran: e
3845
3869
  });
3846
3870
  });
3847
3871
  return (t, o) => (_(), i("div", {
3848
- class: f(["kvc-card", { "kvc-failed": c.failed }]),
3872
+ class: f(["kvc-card", { "kvc-failed": c.failed && !h.value }]),
3849
3873
  "data-test": "call-card"
3850
3874
  }, [a("button", {
3851
3875
  type: "button",
@@ -3862,95 +3886,103 @@ var Ms = {
3862
3886
  key: 0,
3863
3887
  class: "kvc-spin",
3864
3888
  "aria-label": D(l).t("kvcoder.ui.running")
3865
- }, null, 8, rc)) : (_(), n(C(d.value ? D(ce) : D(le)), {
3889
+ }, null, 8, sc)) : (_(), n(C(d.value ? D(ce) : D(le)), {
3866
3890
  key: 1,
3867
3891
  size: 16,
3868
3892
  "aria-hidden": "true"
3869
3893
  })),
3870
- a("span", ic, [c.view.description ? (_(), i("span", ac, E(c.view.description), 1)) : c.view.connector === void 0 && c.view.line ? (_(), i("span", oc, [a("span", sc, E(D(ha)(c.view.line)), 1)])) : r("v-if", !0), s(tc, {
3871
- view: c.view,
3872
- result: p.value
3873
- }, null, 8, ["view", "result"])]),
3874
- c.view.risky ? (_(), i("span", cc, E(D(l).t("kvcoder.ui.call.risky")), 1)) : r("v-if", !0),
3875
- c.view.background ? (_(), i("span", lc, E(D(l).t("kvcoder.ui.jobs.background")), 1)) : r("v-if", !0),
3876
- c.failed ? (_(), i("span", uc, E(D(l).t("kvcoder.ui.callFailed")), 1)) : r("v-if", !0),
3877
- a("span", dc, E(h.value), 1)
3878
- ], 8, nc), d.value && c.output !== void 0 ? (_(), i(e, { key: 0 }, [
3879
- g.value === "" ? r("v-if", !0) : (_(), i("p", fc, E(g.value), 1)),
3880
- m.value ? (_(), i("pre", {
3881
- key: 1,
3882
- class: "kvc-block kvc-error",
3883
- dir: "auto",
3884
- "aria-label": D(l).t("kvcoder.ui.call.error"),
3885
- "data-test": "call-error"
3886
- }, [s(Y, { text: c.output }, null, 8, ["text"])], 8, pc)) : r("v-if", !0),
3887
- s(Ds, { view: c.view }, null, 8, ["view"]),
3888
- m.value ? r("v-if", !0) : (_(), n(Ys, {
3889
- key: 2,
3890
- view: c.view,
3891
- output: c.output,
3892
- result: p.value
3893
- }, null, 8, [
3894
- "view",
3895
- "output",
3896
- "result"
3897
- ]))
3898
- ], 64)) : r("v-if", !0)], 2));
3894
+ a("span", cc, [
3895
+ c.view.description ? (_(), i("span", lc, E(c.view.description), 1)) : c.view.connector === void 0 && c.view.line ? (_(), i("span", uc, [a("span", dc, E(D(ha)(c.view.line)), 1)])) : r("v-if", !0),
3896
+ s(ac, {
3897
+ view: c.view,
3898
+ result: v.value
3899
+ }, null, 8, ["view", "result"]),
3900
+ g.value === "" ? r("v-if", !0) : (_(), i("span", {
3901
+ key: 2,
3902
+ class: f(["kvc-oneline", h.value ? "kvc-muted" : "kvc-danger"]),
3903
+ dir: "auto",
3904
+ "data-test": "call-reason"
3905
+ }, E(g.value), 3))
3906
+ ]),
3907
+ c.view.risky ? (_(), i("span", fc, E(D(l).t("kvcoder.ui.call.risky")), 1)) : r("v-if", !0),
3908
+ c.view.background ? (_(), i("span", pc, E(D(l).t("kvcoder.ui.jobs.background")), 1)) : r("v-if", !0),
3909
+ h.value ? (_(), i("span", mc, E(D(l).t("kvcoder.ui.callNotRun")), 1)) : c.failed ? (_(), i("span", hc, E(D(l).t("kvcoder.ui.callFailed")), 1)) : r("v-if", !0),
3910
+ a("span", gc, E(x.value), 1)
3911
+ ], 8, oc), d.value && c.output !== void 0 ? (_(), i(e, { key: 0 }, [S.value === "" ? r("v-if", !0) : (_(), i("p", _c, E(S.value), 1)), b.value ? (_(), i(e, { key: 1 }, [a("button", {
3912
+ type: "button",
3913
+ class: "kvc-text-button kvc-fold",
3914
+ "aria-expanded": p.value,
3915
+ "data-test": "call-details",
3916
+ onClick: o[1] ||= (e) => p.value = !p.value
3917
+ }, E(D(l).t(p.value ? "kvcoder.ui.call.hideDetails" : "kvcoder.ui.call.showDetails")), 9, vc), p.value ? (_(), i(e, { key: 0 }, [a("pre", {
3918
+ class: "kvc-block kvc-error",
3919
+ dir: "auto",
3920
+ "aria-label": D(l).t("kvcoder.ui.call.error"),
3921
+ "data-test": "call-error"
3922
+ }, [s(Y, { text: c.output }, null, 8, ["text"])], 8, yc), s(js, { view: c.view }, null, 8, ["view"])], 64)) : r("v-if", !0)], 64)) : (_(), i(e, { key: 2 }, [s(js, { view: c.view }, null, 8, ["view"]), s($s, {
3923
+ view: c.view,
3924
+ output: c.output,
3925
+ result: v.value
3926
+ }, null, 8, [
3927
+ "view",
3928
+ "output",
3929
+ "result"
3930
+ ])], 64))], 64)) : r("v-if", !0)], 2));
3899
3931
  }
3900
- }), hc = {
3932
+ }), xc = {
3901
3933
  key: 0,
3902
3934
  class: "kvc-card",
3903
3935
  "data-test": "background-result"
3904
- }, gc = { class: "kvc-card-row" }, _c = {
3936
+ }, Sc = { class: "kvc-card-row" }, Cc = {
3905
3937
  style: {
3906
3938
  flex: "1 1 auto",
3907
3939
  "min-inline-size": "0"
3908
3940
  },
3909
3941
  "data-test": "background-title"
3910
- }, vc = {
3942
+ }, wc = {
3911
3943
  key: 0,
3912
3944
  class: "kvc-muted",
3913
3945
  "data-test": "background-time"
3914
- }, yc = { class: "kvc-output" }, bc = {
3946
+ }, Tc = { class: "kvc-output" }, Ec = {
3915
3947
  key: 1,
3916
3948
  class: "kvc-card",
3917
3949
  "data-test": "kvcoder-hint"
3918
- }, xc = { class: "kvc-card-row" }, Sc = { class: "kvc-card-body kvc-muted" }, Cc = {
3950
+ }, Dc = { class: "kvc-card-row" }, Oc = { class: "kvc-card-body kvc-muted" }, kc = {
3919
3951
  key: 0,
3920
3952
  style: {
3921
3953
  display: "flex",
3922
3954
  gap: "6px",
3923
3955
  "margin-block-start": "6px"
3924
3956
  }
3925
- }, wc = ["src", "alt"], Tc = {
3957
+ }, Ac = ["src", "alt"], jc = {
3926
3958
  key: 1,
3927
3959
  class: "kvc-muted",
3928
3960
  style: { display: "block" },
3929
3961
  "data-test": "queued"
3930
- }, Ec = {
3962
+ }, Mc = {
3931
3963
  key: 3,
3932
3964
  class: "kvc-answer",
3933
3965
  "data-test": "assistant-message"
3934
- }, Dc = {
3966
+ }, Nc = {
3935
3967
  key: 0,
3936
3968
  "data-test": "thinking"
3937
- }, Oc = { class: "kvc-muted" }, kc = {
3969
+ }, Pc = { class: "kvc-muted" }, Fc = {
3938
3970
  class: "kvc-muted",
3939
3971
  style: { "white-space": "pre-wrap" }
3940
- }, Ac = {
3972
+ }, Ic = {
3941
3973
  key: 7,
3942
3974
  class: "kvc-notice",
3943
3975
  "data-test": "notice"
3944
- }, jc = {
3976
+ }, Lc = {
3945
3977
  key: 8,
3946
3978
  class: "kvc-card kvc-card-row",
3947
3979
  role: "note",
3948
3980
  "data-test": "note"
3949
- }, Mc = {
3981
+ }, Rc = {
3950
3982
  key: 9,
3951
3983
  class: "kvc-card",
3952
3984
  "data-test": "summary"
3953
- }, Nc = { class: "kvc-card-row" }, Pc = { class: "kvc-card-body" }, Fc = /* @__PURE__ */ c({
3985
+ }, zc = { class: "kvc-card-row" }, Bc = { class: "kvc-card-body" }, Vc = /* @__PURE__ */ c({
3954
3986
  __name: "MessageItem",
3955
3987
  props: {
3956
3988
  message: {},
@@ -3964,7 +3996,7 @@ var Ms = {
3964
3996
  return t === void 0 ? p.t(e) : p.t(`${e}Named`, { name: rt(t) });
3965
3997
  }), S = t(() => {
3966
3998
  let e = u.finishedRuns?.get(Wa(u.message) ?? "");
3967
- return e === void 0 ? void 0 : js(p.t, e.ranMs);
3999
+ return e === void 0 ? void 0 : Fs(p.t, e.ranMs);
3968
4000
  }), w = t(() => Ra(u.message, u.calls)), T = t(() => {
3969
4001
  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);
3970
4002
  return p.t(`kvcoder.notices.${i === void 0 || a !== "STEP_FAILED" ? a : "STEP_FAILED_REASON"}`, {
@@ -3980,24 +4012,24 @@ var Ms = {
3980
4012
  text: "kvcoder.markdown",
3981
4013
  params: { text: e }
3982
4014
  });
3983
- return (t, c) => D(Ba)(u.message) ? (_(), i("div", hc, [a("details", null, [a("summary", gc, [
4015
+ return (t, c) => D(Ba)(u.message) ? (_(), i("div", xc, [a("details", null, [a("summary", Sc, [
3984
4016
  s(D(oe), {
3985
4017
  size: 16,
3986
4018
  "aria-hidden": "true"
3987
4019
  }),
3988
- a("span", _c, E(x.value), 1),
3989
- S.value === void 0 ? r("v-if", !0) : (_(), i("span", vc, E(S.value), 1))
3990
- ]), a("pre", yc, E(m.value), 1)])])) : D(za)(u.message) ? (_(), i("div", bc, [a("details", null, [a("summary", xc, [s(D(xe), {
4020
+ a("span", Cc, E(x.value), 1),
4021
+ S.value === void 0 ? r("v-if", !0) : (_(), i("span", wc, E(S.value), 1))
4022
+ ]), a("pre", Tc, E(m.value), 1)])])) : D(za)(u.message) ? (_(), i("div", Ec, [a("details", null, [a("summary", Dc, [s(D(xe), {
3991
4023
  size: 16,
3992
4024
  "aria-hidden": "true"
3993
- }), o(E(D(p).t("kvcoder.ui.toModel")), 1)]), a("div", Sc, E(m.value), 1)])])) : u.message.kind === "user" ? (_(), i("div", {
4025
+ }), o(E(D(p).t("kvcoder.ui.toModel")), 1)]), a("div", Oc, E(m.value), 1)])])) : u.message.kind === "user" ? (_(), i("div", {
3994
4026
  key: 2,
3995
4027
  dir: "auto",
3996
4028
  class: f(["kvc-user", { "kvc-queued": u.message.queued }]),
3997
4029
  "data-test": "user-message"
3998
4030
  }, [
3999
4031
  a("span", null, E(D(Ua)(m.value, D(p).t("kvcoder.ui.attachedFiles"))), 1),
4000
- u.message.fileIds ? (_(), i("span", Cc, [(_(!0), i(e, null, b(u.message.fileIds, (e) => (_(), i("img", {
4032
+ u.message.fileIds ? (_(), i("span", kc, [(_(!0), i(e, null, b(u.message.fileIds, (e) => (_(), i("img", {
4001
4033
  key: e,
4002
4034
  src: k(e),
4003
4035
  alt: D(p).t("kvcoder.ui.attachment"),
@@ -4005,9 +4037,9 @@ var Ms = {
4005
4037
  "block-size": "48px",
4006
4038
  "border-radius": "6px"
4007
4039
  }
4008
- }, null, 8, wc))), 128))])) : r("v-if", !0),
4009
- u.message.queued ? (_(), i("span", Tc, E(D(p).t("kvcoder.ui.queued")), 1)) : r("v-if", !0)
4010
- ], 2)) : u.message.kind === "assistant" && (h.value !== "" || m.value !== "") ? (_(), i("div", Ec, [h.value === "" ? r("v-if", !0) : (_(), i("details", Dc, [a("summary", Oc, E(D(p).t("kvcoder.ui.thought")), 1), a("p", kc, E(h.value), 1)])), m.value === "" ? r("v-if", !0) : (_(), n(C(D(p).View), {
4040
+ }, null, 8, Ac))), 128))])) : r("v-if", !0),
4041
+ u.message.queued ? (_(), i("span", jc, E(D(p).t("kvcoder.ui.queued")), 1)) : r("v-if", !0)
4042
+ ], 2)) : u.message.kind === "assistant" && (h.value !== "" || m.value !== "") ? (_(), i("div", Mc, [h.value === "" ? r("v-if", !0) : (_(), i("details", Nc, [a("summary", Pc, E(D(p).t("kvcoder.ui.thought")), 1), a("p", Fc, E(h.value), 1)])), m.value === "" ? r("v-if", !0) : (_(), n(C(D(p).View), {
4011
4043
  key: 1,
4012
4044
  view: A(m.value)
4013
4045
  }, null, 8, ["view"]))])) : u.message.kind === "toolResult" && v.value !== void 0 ? (_(), n(vo, {
@@ -4022,7 +4054,7 @@ var Ms = {
4022
4054
  "title",
4023
4055
  "format",
4024
4056
  "version"
4025
- ])) : w.value === void 0 ? u.message.kind === "toolResult" ? (_(), i(e, { key: 6 }, [s(mc, {
4057
+ ])) : w.value === void 0 ? u.message.kind === "toolResult" ? (_(), i(e, { key: 6 }, [s(bc, {
4026
4058
  view: g.value,
4027
4059
  failed: g.value.failed,
4028
4060
  "duration-ms": g.value.durationMs,
@@ -4036,45 +4068,45 @@ var Ms = {
4036
4068
  key: 0,
4037
4069
  "session-id": u.message.sessionId,
4038
4070
  "run-id": y.value
4039
- }, null, 8, ["session-id", "run-id"]))], 64)) : u.message.kind === "notice" ? (_(), i("div", Ac, E(T.value), 1)) : u.message.kind === "note" ? (_(), i("div", jc, [s(D(Se), {
4071
+ }, null, 8, ["session-id", "run-id"]))], 64)) : u.message.kind === "notice" ? (_(), i("div", Ic, E(T.value), 1)) : u.message.kind === "note" ? (_(), i("div", Lc, [s(D(Se), {
4040
4072
  size: 18,
4041
4073
  "aria-hidden": "true"
4042
- }), o(E(O.value), 1)])) : u.message.kind === "summary" ? (_(), i("details", Mc, [a("summary", Nc, [s(D(Ee), {
4074
+ }), o(E(O.value), 1)])) : u.message.kind === "summary" ? (_(), i("details", Rc, [a("summary", zc, [s(D(Ee), {
4043
4075
  size: 16,
4044
4076
  "aria-hidden": "true"
4045
- }), o(E(D(p).t("kvcoder.ui.summarized")), 1)]), a("div", Pc, [(_(), n(C(D(p).View), { view: A(String(u.message.content.text ?? "")) }, null, 8, ["view"]))])])) : r("v-if", !0) : (_(), n(po, {
4077
+ }), o(E(D(p).t("kvcoder.ui.summarized")), 1)]), a("div", Bc, [(_(), n(C(D(p).View), { view: A(String(u.message.content.text ?? "")) }, null, 8, ["view"]))])])) : r("v-if", !0) : (_(), n(po, {
4046
4078
  key: 5,
4047
4079
  answered: w.value
4048
4080
  }, null, 8, ["answered"]));
4049
4081
  }
4050
- }), Ic = {
4082
+ }), Hc = {
4051
4083
  class: "kvc-card kvc-ask",
4052
4084
  "data-test": "approvals-card"
4053
- }, Lc = {
4085
+ }, Uc = {
4054
4086
  class: "kvc-card-row",
4055
4087
  style: { "font-weight": "600" }
4056
- }, Rc = ["data-test"], zc = { class: "kvc-card-row" }, Bc = { class: "kvc-lines" }, Vc = {
4088
+ }, Wc = ["data-test"], Gc = { class: "kvc-card-row" }, Kc = { class: "kvc-lines" }, qc = {
4057
4089
  key: 0,
4058
4090
  style: { "font-weight": "600" },
4059
4091
  "data-test": "call-description"
4060
- }, Hc = {
4092
+ }, Jc = {
4061
4093
  key: 2,
4062
4094
  dir: "ltr",
4063
4095
  style: { "align-self": "flex-start" },
4064
4096
  "data-test": "call-subject"
4065
- }, Uc = {
4097
+ }, Yc = {
4066
4098
  key: 3,
4067
4099
  class: "kvc-chip",
4068
4100
  style: { "align-self": "flex-start" },
4069
4101
  "data-test": "call-background"
4070
- }, Wc = {
4102
+ }, Xc = {
4071
4103
  class: "kvc-card-row kvc-actions",
4072
4104
  "data-test": "decision-actions"
4073
- }, Gc = ["onClick"], Kc = ["onClick"], qc = {
4105
+ }, Zc = ["onClick"], Qc = ["onClick"], $c = {
4074
4106
  key: 0,
4075
4107
  class: "kvc-card-row kvc-actions",
4076
4108
  style: { "border-block-start": "1px solid var(--kv-color-border)" }
4077
- }, Jc = /* @__PURE__ */ c({
4109
+ }, el = /* @__PURE__ */ c({
4078
4110
  __name: "ApprovalsCard",
4079
4111
  props: { approvals: {} },
4080
4112
  emits: ["decide"],
@@ -4083,8 +4115,8 @@ var Ms = {
4083
4115
  approvals: [...e],
4084
4116
  confirmed: t
4085
4117
  });
4086
- return (t, c) => (_(), i("section", Ic, [
4087
- a("div", Lc, [s(D(Oe), {
4118
+ return (t, c) => (_(), i("section", Hc, [
4119
+ a("div", Uc, [s(D(Oe), {
4088
4120
  size: 18,
4089
4121
  "aria-hidden": "true"
4090
4122
  }), o(E(D(d).t("kvcoder.ui.allowCommands", { count: l.approvals.length })), 1)]),
@@ -4093,32 +4125,32 @@ var Ms = {
4093
4125
  class: "kvc-approval",
4094
4126
  "data-test": `approval-${e.questionId}`
4095
4127
  }, [
4096
- a("div", zc, [a("span", Bc, [
4097
- e.view.description ? (_(), i("span", Vc, E(e.view.description), 1)) : r("v-if", !0),
4098
- e.view.connector === void 0 ? e.view.line ? (_(), i("span", Hc, [a("span", { class: f(["kvc-mono", { "kvc-muted": e.view.description }]) }, E(e.view.line), 3)])) : r("v-if", !0) : (_(), n(tc, {
4128
+ a("div", Gc, [a("span", Kc, [
4129
+ e.view.description ? (_(), i("span", qc, E(e.view.description), 1)) : r("v-if", !0),
4130
+ e.view.connector === void 0 ? e.view.line ? (_(), i("span", Jc, [a("span", { class: f(["kvc-mono", { "kvc-muted": e.view.description }]) }, E(e.view.line), 3)])) : r("v-if", !0) : (_(), n(ac, {
4099
4131
  key: 1,
4100
4132
  view: e.view,
4101
4133
  whole: ""
4102
4134
  }, null, 8, ["view"])),
4103
- e.view.background ? (_(), i("span", Uc, E(D(d).t("kvcoder.ui.jobs.inBackground")), 1)) : r("v-if", !0)
4135
+ e.view.background ? (_(), i("span", Yc, E(D(d).t("kvcoder.ui.jobs.inBackground")), 1)) : r("v-if", !0)
4104
4136
  ])]),
4105
- D(ma)(e.view) === "line" ? r("v-if", !0) : (_(), n(Ds, {
4137
+ D(ma)(e.view) === "line" ? r("v-if", !0) : (_(), n(js, {
4106
4138
  key: 0,
4107
4139
  view: e.view
4108
4140
  }, null, 8, ["view"])),
4109
- a("div", Wc, [a("button", {
4141
+ a("div", Xc, [a("button", {
4110
4142
  type: "button",
4111
4143
  class: "kvc-button",
4112
4144
  "data-test": "deny",
4113
4145
  onClick: (t) => p([e], !1)
4114
- }, E(D(d).t("kvcoder.ui.deny")), 9, Gc), a("button", {
4146
+ }, E(D(d).t("kvcoder.ui.deny")), 9, Zc), a("button", {
4115
4147
  type: "button",
4116
4148
  class: "kvc-button kvc-primary",
4117
4149
  "data-test": "allow",
4118
4150
  onClick: (t) => p([e], !0)
4119
- }, E(D(d).t("kvcoder.ui.allow")), 9, Kc)])
4120
- ], 8, Rc))), 128)),
4121
- l.approvals.length > 1 ? (_(), i("div", qc, [a("button", {
4151
+ }, E(D(d).t("kvcoder.ui.allow")), 9, Qc)])
4152
+ ], 8, Wc))), 128)),
4153
+ l.approvals.length > 1 ? (_(), i("div", $c, [a("button", {
4122
4154
  type: "button",
4123
4155
  class: "kvc-button",
4124
4156
  "data-test": "deny-all",
@@ -4131,13 +4163,13 @@ var Ms = {
4131
4163
  }, E(D(d).t("kvcoder.ui.allowAll")), 1)])) : r("v-if", !0)
4132
4164
  ]));
4133
4165
  }
4134
- }), Yc = /* @__PURE__ */ new Map();
4135
- function Xc(e) {
4136
- let t = Yc.get(e);
4137
- return t === void 0 && (t = v(/* @__PURE__ */ new Map()), Yc.set(e, t)), t;
4166
+ }), tl = /* @__PURE__ */ new Map();
4167
+ function nl(e) {
4168
+ let t = tl.get(e);
4169
+ return t === void 0 && (t = v(/* @__PURE__ */ new Map()), tl.set(e, t)), t;
4138
4170
  }
4139
- function Zc(e, t, n) {
4140
- let r = Xc(e), i = r.get(t);
4171
+ function rl(e, t, n) {
4172
+ let r = nl(e), i = r.get(t);
4141
4173
  return i === void 0 ? (i = v({
4142
4174
  text: "",
4143
4175
  selected: [],
@@ -4148,55 +4180,55 @@ function Zc(e, t, n) {
4148
4180
  owner: n
4149
4181
  }), r.set(t, i)) : n !== void 0 && i.owner === void 0 && (i.owner = n), i;
4150
4182
  }
4151
- var Qc = (e, t, n) => Xc(e).get(t) === n, $c = (e) => new Set([...Xc(e)].filter(([, e]) => e.settled).map(([e]) => e));
4152
- function el(e) {
4183
+ var il = (e, t, n) => nl(e).get(t) === n, al = (e) => new Set([...nl(e)].filter(([, e]) => e.settled).map(([e]) => e));
4184
+ function ol(e) {
4153
4185
  e.text = "", e.selected = [], e.other = "", e.error = void 0, e.sending = !1, e.settled = !0;
4154
4186
  }
4155
- function tl(e, t, n) {
4156
- let r = Xc(e);
4187
+ function sl(e, t, n) {
4188
+ let r = nl(e);
4157
4189
  for (let [e, i] of r) {
4158
4190
  if (i.owner?.sessionId !== t) continue;
4159
4191
  let a = n.find((e) => e.id === i.owner?.turnId && e.sessionId === t);
4160
- a !== void 0 && (a.outcome === void 0 && a.endedAt === void 0 && a.pending.some((t) => t.questionId === e) || (el(i), r.delete(e)));
4192
+ a !== void 0 && (a.outcome === void 0 && a.endedAt === void 0 && a.pending.some((t) => t.questionId === e) || (ol(i), r.delete(e)));
4161
4193
  }
4162
4194
  }
4163
4195
  //#endregion
4164
4196
  //#region web/src/QuestionCard.vue?vue&type=script&setup=true&lang.ts
4165
- var nl = ["aria-label", "aria-busy"], rl = {
4197
+ var cl = ["aria-label", "aria-busy"], ll = {
4166
4198
  class: "kvc-card-row",
4167
4199
  style: { "font-weight": "600" }
4168
- }, il = { dir: "auto" }, al = { class: "kvc-card-body" }, ol = {
4200
+ }, ul = { dir: "auto" }, dl = { class: "kvc-card-body" }, fl = {
4169
4201
  key: 0,
4170
4202
  role: "status",
4171
4203
  "data-test": "answer-sending"
4172
- }, sl = {
4204
+ }, pl = {
4173
4205
  key: 1,
4174
4206
  role: "alert",
4175
4207
  "data-test": "answer-error"
4176
- }, cl = [
4208
+ }, ml = [
4177
4209
  "disabled",
4178
4210
  "placeholder",
4179
4211
  "aria-label"
4180
- ], ll = { class: "kvc-actions" }, ul = ["disabled"], dl = ["disabled"], fl = ["data-test"], pl = [
4212
+ ], hl = { class: "kvc-actions" }, gl = ["disabled"], _l = ["disabled"], vl = ["data-test"], yl = [
4181
4213
  "type",
4182
4214
  "checked",
4183
4215
  "disabled",
4184
4216
  "name",
4185
4217
  "onChange"
4186
- ], ml = { style: {
4218
+ ], bl = { style: {
4187
4219
  display: "flex",
4188
4220
  "flex-direction": "column"
4189
- } }, hl = { style: { "font-weight": "500" } }, gl = {
4221
+ } }, xl = { style: { "font-weight": "500" } }, Sl = {
4190
4222
  key: 0,
4191
4223
  class: "kvc-muted"
4192
- }, _l = [
4224
+ }, Cl = [
4193
4225
  "disabled",
4194
4226
  "placeholder",
4195
4227
  "aria-label"
4196
- ], vl = { class: "kvc-actions" }, yl = ["disabled"], bl = ["disabled"], xl = {
4228
+ ], wl = { class: "kvc-actions" }, Tl = ["disabled"], El = ["disabled"], Dl = {
4197
4229
  key: 4,
4198
4230
  class: "kvc-actions"
4199
- }, Sl = ["disabled"], Cl = ["disabled"], wl = /* @__PURE__ */ c({
4231
+ }, Ol = ["disabled"], kl = ["disabled"], Al = /* @__PURE__ */ c({
4200
4232
  __name: "QuestionCard",
4201
4233
  props: {
4202
4234
  questionId: {},
@@ -4205,7 +4237,7 @@ var nl = ["aria-label", "aria-busy"], rl = {
4205
4237
  },
4206
4238
  emits: ["answer"],
4207
4239
  setup(n, { emit: o }) {
4208
- let c = n, l = o, u = K(), d = t(() => String(c.question.kind ?? "text")), p = t(() => String(c.question.prompt ?? "")), m = t(() => Ja(c.question)), h = t(() => c.question.multiple === !0), g = t(() => c.question.other === !0), v = t(() => Zc(u.workspace.value.id, c.questionId, c.owner)), y = t(() => Je(u.t, v.value.error));
4240
+ let c = n, l = o, u = K(), d = t(() => String(c.question.kind ?? "text")), p = t(() => String(c.question.prompt ?? "")), m = t(() => Ja(c.question)), h = t(() => c.question.multiple === !0), g = t(() => c.question.other === !0), v = t(() => rl(u.workspace.value.id, c.questionId, c.owner)), y = t(() => Je(u.t, v.value.error));
4209
4241
  function x(e) {
4210
4242
  !v.value.sending && !v.value.settled && l("answer", {
4211
4243
  questionId: c.questionId,
@@ -4228,12 +4260,12 @@ var nl = ["aria-label", "aria-busy"], rl = {
4228
4260
  "data-test": "question-card",
4229
4261
  "aria-label": p.value,
4230
4262
  "aria-busy": v.value.sending
4231
- }, [a("div", rl, [s(D(de), {
4263
+ }, [a("div", ll, [s(D(de), {
4232
4264
  size: 18,
4233
4265
  "aria-hidden": "true"
4234
- }), a("span", il, E(p.value), 1)]), a("div", al, [
4235
- v.value.sending ? (_(), i("p", ol, E(D(u).t("kvcoder.ui.answerSending")), 1)) : r("v-if", !0),
4236
- v.value.error === void 0 ? r("v-if", !0) : (_(), i("p", sl, E(D(u).t("kvcoder.ui.answerFailed", { error: y.value })), 1)),
4266
+ }), a("span", ul, E(p.value), 1)]), a("div", dl, [
4267
+ v.value.sending ? (_(), i("p", fl, E(D(u).t("kvcoder.ui.answerSending")), 1)) : r("v-if", !0),
4268
+ v.value.error === void 0 ? r("v-if", !0) : (_(), i("p", pl, E(D(u).t("kvcoder.ui.answerFailed", { error: y.value })), 1)),
4237
4269
  d.value === "text" ? (_(), i(e, { key: 2 }, [M(a("input", {
4238
4270
  "onUpdate:modelValue": n[0] ||= (e) => v.value.text = e,
4239
4271
  disabled: v.value.sending,
@@ -4243,19 +4275,19 @@ var nl = ["aria-label", "aria-busy"], rl = {
4243
4275
  "aria-label": p.value,
4244
4276
  "data-test": "answer-text",
4245
4277
  onKeydown: n[1] ||= N(P((e) => x({ text: v.value.text }), ["prevent"]), ["enter"])
4246
- }, null, 40, cl), [[k, v.value.text]]), a("div", ll, [a("button", {
4278
+ }, null, 40, ml), [[k, v.value.text]]), a("div", hl, [a("button", {
4247
4279
  type: "button",
4248
4280
  disabled: v.value.sending,
4249
4281
  class: "kvc-button",
4250
4282
  "data-test": "skip",
4251
4283
  onClick: n[2] ||= (e) => x({ dismissed: !0 })
4252
- }, E(D(u).t("kvcoder.ui.skip")), 9, ul), a("button", {
4284
+ }, E(D(u).t("kvcoder.ui.skip")), 9, gl), a("button", {
4253
4285
  type: "button",
4254
4286
  disabled: v.value.sending,
4255
4287
  class: "kvc-button kvc-primary",
4256
4288
  "data-test": "answer",
4257
4289
  onClick: n[3] ||= (e) => x({ text: v.value.text })
4258
- }, 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 }, [
4290
+ }, E(D(u).t(v.value.error === void 0 ? "kvcoder.ui.answer" : "kvcoder.ui.tryAgain")), 9, _l)])], 64)) : d.value === "choice" ? (_(), i(e, { key: 3 }, [
4259
4291
  (_(!0), i(e, null, b(m.value, (e) => (_(), i("label", {
4260
4292
  key: e.id,
4261
4293
  class: "kvc-option",
@@ -4266,7 +4298,7 @@ var nl = ["aria-label", "aria-busy"], rl = {
4266
4298
  disabled: v.value.sending,
4267
4299
  name: c.questionId,
4268
4300
  onChange: (t) => S(e.id)
4269
- }, null, 40, pl), a("span", ml, [a("span", hl, E(e.label), 1), e.description ? (_(), i("span", gl, E(e.description), 1)) : r("v-if", !0)])], 8, fl))), 128)),
4301
+ }, null, 40, yl), a("span", bl, [a("span", xl, E(e.label), 1), e.description ? (_(), i("span", Sl, E(e.description), 1)) : r("v-if", !0)])], 8, vl))), 128)),
4270
4302
  g.value ? M((_(), i("input", {
4271
4303
  key: 0,
4272
4304
  "onUpdate:modelValue": n[4] ||= (e) => v.value.other = e,
@@ -4275,36 +4307,36 @@ var nl = ["aria-label", "aria-busy"], rl = {
4275
4307
  placeholder: D(u).t("kvcoder.ui.other"),
4276
4308
  "aria-label": D(u).t("kvcoder.ui.other"),
4277
4309
  "data-test": "answer-other"
4278
- }, null, 8, _l)), [[k, v.value.other]]) : r("v-if", !0),
4279
- a("div", vl, [a("button", {
4310
+ }, null, 8, Cl)), [[k, v.value.other]]) : r("v-if", !0),
4311
+ a("div", wl, [a("button", {
4280
4312
  type: "button",
4281
4313
  disabled: v.value.sending,
4282
4314
  class: "kvc-button",
4283
4315
  "data-test": "skip",
4284
4316
  onClick: n[5] ||= (e) => x({ dismissed: !0 })
4285
- }, E(D(u).t("kvcoder.ui.skip")), 9, yl), a("button", {
4317
+ }, E(D(u).t("kvcoder.ui.skip")), 9, Tl), a("button", {
4286
4318
  type: "button",
4287
4319
  class: "kvc-button kvc-primary",
4288
4320
  disabled: v.value.sending || v.value.selected.length === 0 && v.value.other.trim() === "",
4289
4321
  "data-test": "answer",
4290
4322
  onClick: C
4291
- }, E(D(u).t(v.value.error === void 0 ? "kvcoder.ui.answer" : "kvcoder.ui.tryAgain")), 9, bl)])
4292
- ], 64)) : (_(), i("div", xl, [a("button", {
4323
+ }, E(D(u).t(v.value.error === void 0 ? "kvcoder.ui.answer" : "kvcoder.ui.tryAgain")), 9, El)])
4324
+ ], 64)) : (_(), i("div", Dl, [a("button", {
4293
4325
  type: "button",
4294
4326
  disabled: v.value.sending,
4295
4327
  class: "kvc-button",
4296
4328
  "data-test": "answer-no",
4297
4329
  onClick: n[6] ||= (e) => x({ confirmed: !1 })
4298
- }, E(D(u).t("kvcoder.ui.no")), 9, Sl), a("button", {
4330
+ }, E(D(u).t("kvcoder.ui.no")), 9, Ol), a("button", {
4299
4331
  type: "button",
4300
4332
  disabled: v.value.sending,
4301
4333
  class: f(["kvc-button kvc-primary", { "kvc-danger": c.question.danger === !0 }]),
4302
4334
  "data-test": "answer-yes",
4303
4335
  onClick: n[7] ||= (e) => x({ confirmed: !0 })
4304
- }, E(D(u).t("kvcoder.ui.yes")), 11, Cl)]))
4305
- ])], 8, nl));
4336
+ }, E(D(u).t("kvcoder.ui.yes")), 11, kl)]))
4337
+ ])], 8, cl));
4306
4338
  }
4307
- }), Tl = /* @__PURE__ */ c({
4339
+ }), jl = /* @__PURE__ */ c({
4308
4340
  __name: "PendingCards",
4309
4341
  props: {
4310
4342
  pending: {},
@@ -4320,7 +4352,7 @@ var nl = ["aria-label", "aria-busy"], rl = {
4320
4352
  questionId: String(e.questionId),
4321
4353
  view: fa(q(e.question))
4322
4354
  })));
4323
- return (t, a) => (_(), i(e, null, [(_(!0), i(e, null, b(u.value, (e) => (_(), n(wl, {
4355
+ return (t, a) => (_(), i(e, null, [(_(!0), i(e, null, b(u.value, (e) => (_(), n(Al, {
4324
4356
  key: e.questionId,
4325
4357
  "question-id": e.questionId,
4326
4358
  question: e.question,
@@ -4330,7 +4362,7 @@ var nl = ["aria-label", "aria-busy"], rl = {
4330
4362
  "question-id",
4331
4363
  "question",
4332
4364
  "owner"
4333
- ]))), 128)), d.value.length > 0 ? (_(), n(Jc, {
4365
+ ]))), 128)), d.value.length > 0 ? (_(), n(el, {
4334
4366
  key: 0,
4335
4367
  approvals: d.value,
4336
4368
  onDecide: a[1] ||= (e) => c("decide", {
@@ -4342,7 +4374,7 @@ var nl = ["aria-label", "aria-busy"], rl = {
4342
4374
  });
4343
4375
  //#endregion
4344
4376
  //#region web/src/use-model-groups.ts
4345
- function El(e, t, n) {
4377
+ function Ml(e, t, n) {
4346
4378
  let r = y([]);
4347
4379
  return h(async () => {
4348
4380
  try {
@@ -4355,15 +4387,15 @@ function El(e, t, n) {
4355
4387
  }
4356
4388
  //#endregion
4357
4389
  //#region web/src/RecoveryActions.vue?vue&type=script&setup=true&lang.ts
4358
- var Dl = {
4390
+ var Nl = {
4359
4391
  class: "kvc-recovery",
4360
4392
  "data-test": "recovery"
4361
- }, Ol = ["disabled"], kl = { class: "kvc-recovery-picker" }, Al = /* @__PURE__ */ c({
4393
+ }, Pl = ["disabled"], Fl = { class: "kvc-recovery-picker" }, Il = /* @__PURE__ */ c({
4362
4394
  __name: "RecoveryActions",
4363
4395
  props: { sessionId: {} },
4364
4396
  emits: ["sent"],
4365
4397
  setup(e, { emit: t }) {
4366
- let n = e, r = t, c = K(), l = El(c, () => null, (e) => J(c, e));
4398
+ let n = e, r = t, c = K(), l = Ml(c, () => null, (e) => J(c, e));
4367
4399
  async function u() {
4368
4400
  await c.exec("kvcoder.turn.retry", { sessionId: n.sessionId }), r("sent");
4369
4401
  }
@@ -4386,7 +4418,7 @@ var Dl = {
4386
4418
  model: e
4387
4419
  }), await ni(c, e), await u();
4388
4420
  });
4389
- return (e, t) => (_(), i("div", Dl, [a("button", {
4421
+ return (e, t) => (_(), i("div", Nl, [a("button", {
4390
4422
  type: "button",
4391
4423
  class: "kvc-button",
4392
4424
  disabled: d.value,
@@ -4395,34 +4427,34 @@ var Dl = {
4395
4427
  }, [s(D(Te), {
4396
4428
  size: 14,
4397
4429
  "aria-hidden": "true"
4398
- }), o(E(D(c).t("kvcoder.ui.retry")), 1)], 8, Ol), a("div", kl, [s(ei, {
4430
+ }), o(E(D(c).t("kvcoder.ui.retry")), 1)], 8, Pl), a("div", Fl, [s(ei, {
4399
4431
  groups: D(l),
4400
4432
  current: null,
4401
4433
  empty: D(c).t("kvcoder.ui.chooseAnotherModel"),
4402
4434
  onPick: m
4403
4435
  }, null, 8, ["groups", "empty"])])]));
4404
4436
  }
4405
- }), jl = {
4437
+ }), Ll = {
4406
4438
  class: "kvc-column",
4407
4439
  "data-test": "prompt-tab"
4408
- }, Ml = { style: {
4440
+ }, Rl = { style: {
4409
4441
  display: "flex",
4410
4442
  "align-items": "center",
4411
4443
  gap: "10px"
4412
- } }, Nl = { style: { flex: "1 1 auto" } }, Pl = {
4444
+ } }, zl = { style: { flex: "1 1 auto" } }, Bl = {
4413
4445
  key: 0,
4414
4446
  style: {
4415
4447
  margin: "0",
4416
4448
  "padding-inline-start": "20px"
4417
4449
  }
4418
- }, Fl = {
4450
+ }, Vl = {
4419
4451
  key: 0,
4420
4452
  class: "kvc-chip kvc-warn"
4421
- }, Il = {
4453
+ }, Hl = {
4422
4454
  key: 1,
4423
4455
  class: "kvc-prompt",
4424
4456
  "data-test": "prompt-text"
4425
- }, Ll = /* @__PURE__ */ c({
4457
+ }, Ul = /* @__PURE__ */ c({
4426
4458
  __name: "PromptTab",
4427
4459
  props: { sessionId: {} },
4428
4460
  emits: ["back"],
@@ -4438,8 +4470,8 @@ var Dl = {
4438
4470
  async function f() {
4439
4471
  d.value !== null && (await navigator.clipboard.writeText(d.value.prompt), u.toast("kvcoder.ui.copied", {}, "success"));
4440
4472
  }
4441
- return (t, n) => (_(), i("div", jl, [
4442
- a("div", Ml, [
4473
+ return (t, n) => (_(), i("div", Ll, [
4474
+ a("div", Rl, [
4443
4475
  a("button", {
4444
4476
  type: "button",
4445
4477
  class: "kvc-button",
@@ -4450,7 +4482,7 @@ var Dl = {
4450
4482
  class: "kvc-flip",
4451
4483
  "aria-hidden": "true"
4452
4484
  }), o(E(D(u).t("kvcoder.ui.showChat")), 1)]),
4453
- a("strong", Nl, E(D(u).t("kvcoder.ui.promptTitle")), 1),
4485
+ a("strong", zl, E(D(u).t("kvcoder.ui.promptTitle")), 1),
4454
4486
  a("button", {
4455
4487
  type: "button",
4456
4488
  class: "kvc-button",
@@ -4458,7 +4490,7 @@ var Dl = {
4458
4490
  onClick: f
4459
4491
  }, [s(D(G), { size: 16 }), o(E(D(u).t("kvcoder.ui.copy")), 1)])
4460
4492
  ]),
4461
- d.value ? (_(), i("ul", Pl, [(_(!0), i(e, null, b(d.value.sections, (e) => (_(), i("li", {
4493
+ d.value ? (_(), i("ul", Bl, [(_(!0), i(e, null, b(d.value.sections, (e) => (_(), i("li", {
4462
4494
  key: `${e.owner}/${e.id}`,
4463
4495
  class: "kvc-muted",
4464
4496
  "data-test": "prompt-section"
@@ -4467,14 +4499,14 @@ var Dl = {
4467
4499
  owner: e.owner,
4468
4500
  reach: D(u).t(`kvcoder.ui.reach.${e.reach}`),
4469
4501
  size: e.size
4470
- })) + " ", 1), e.included ? r("v-if", !0) : (_(), i("span", Fl, E(D(u).t("kvcoder.ui.leftOut")), 1))]))), 128))])) : r("v-if", !0),
4471
- d.value ? (_(), i("pre", Il, E(d.value.prompt), 1)) : r("v-if", !0)
4502
+ })) + " ", 1), e.included ? r("v-if", !0) : (_(), i("span", Vl, E(D(u).t("kvcoder.ui.leftOut")), 1))]))), 128))])) : r("v-if", !0),
4503
+ d.value ? (_(), i("pre", Hl, E(d.value.prompt), 1)) : r("v-if", !0)
4472
4504
  ]));
4473
4505
  }
4474
4506
  });
4475
4507
  //#endregion
4476
4508
  //#region web/src/use-session-actions.ts
4477
- function Rl(e, t, n) {
4509
+ function Wl(e, t, n) {
4478
4510
  let r = T();
4479
4511
  async function i(t) {
4480
4512
  try {
@@ -4537,12 +4569,12 @@ function Rl(e, t, n) {
4537
4569
  }
4538
4570
  //#endregion
4539
4571
  //#region web/src/SessionModel.vue
4540
- var zl = /* @__PURE__ */ c({
4572
+ var Gl = /* @__PURE__ */ c({
4541
4573
  __name: "SessionModel",
4542
4574
  props: { session: {} },
4543
4575
  emits: ["changed"],
4544
4576
  setup(e, { emit: t }) {
4545
- let r = e, i = t, a = K(), o = El(a, () => r.session.model, (e) => J(a, e)), s = Rl(a, () => r.session.id, () => i("changed"));
4577
+ let r = e, i = t, a = K(), o = Ml(a, () => r.session.model, (e) => J(a, e)), s = Wl(a, () => r.session.id, () => i("changed"));
4546
4578
  return (e, t) => (_(), n(ti, {
4547
4579
  groups: D(o),
4548
4580
  model: r.session.model ?? null,
@@ -4555,32 +4587,32 @@ var zl = /* @__PURE__ */ c({
4555
4587
  "thinking"
4556
4588
  ]));
4557
4589
  }
4558
- }), Bl = ["aria-label"], Vl = { class: "kvc-card-row" }, Hl = {
4590
+ }), Kl = ["aria-label"], ql = { class: "kvc-card-row" }, Jl = {
4559
4591
  key: 0,
4560
4592
  class: "kvc-chip kvc-mono",
4561
4593
  "data-test": "subagent-worker"
4562
- }, Ul = { class: "kvc-lines" }, Wl = {
4594
+ }, Yl = { class: "kvc-lines" }, Xl = {
4563
4595
  style: { "font-weight": "600" },
4564
4596
  "data-test": "subagent-title"
4565
- }, Gl = {
4597
+ }, Zl = {
4566
4598
  key: 0,
4567
4599
  class: "kvc-muted kvc-oneline",
4568
4600
  dir: "auto",
4569
4601
  "data-test": "subagent-task"
4570
- }, Kl = {
4602
+ }, Ql = {
4571
4603
  key: 1,
4572
4604
  class: "kvc-spin"
4573
- }, ql = {
4605
+ }, $l = {
4574
4606
  key: 0,
4575
4607
  class: "kvc-card-body"
4576
- }, Jl = {
4608
+ }, eu = {
4577
4609
  key: 0,
4578
4610
  class: "kvc-muted",
4579
4611
  style: {
4580
4612
  margin: "0",
4581
4613
  "white-space": "pre-wrap"
4582
4614
  }
4583
- }, Yl = /* @__PURE__ */ c({
4615
+ }, tu = /* @__PURE__ */ c({
4584
4616
  __name: "SubagentCard",
4585
4617
  props: {
4586
4618
  child: {},
@@ -4594,16 +4626,16 @@ var zl = /* @__PURE__ */ c({
4594
4626
  class: "kvc-card",
4595
4627
  "data-test": "subagent-card",
4596
4628
  "aria-label": D(Ge)(D(l).t, o.child.session.title)
4597
- }, [a("div", Vl, [
4629
+ }, [a("div", ql, [
4598
4630
  s(D(se), {
4599
4631
  size: 18,
4600
4632
  "aria-hidden": "true"
4601
4633
  }),
4602
- o.child.session.worker === void 0 ? r("v-if", !0) : (_(), i("span", Hl, E(o.child.session.worker), 1)),
4603
- a("span", Ul, [a("span", Wl, E(D(Ge)(D(l).t, o.child.session.title)), 1), u.value ? (_(), i("span", Gl, E(u.value), 1)) : r("v-if", !0)]),
4604
- o.child.session.status === "running" ? (_(), i("span", Kl)) : r("v-if", !0),
4634
+ o.child.session.worker === void 0 ? r("v-if", !0) : (_(), i("span", Jl, E(o.child.session.worker), 1)),
4635
+ a("span", Yl, [a("span", Xl, E(D(Ge)(D(l).t, o.child.session.title)), 1), u.value ? (_(), i("span", Zl, E(u.value), 1)) : r("v-if", !0)]),
4636
+ o.child.session.status === "running" ? (_(), i("span", Ql)) : r("v-if", !0),
4605
4637
  a("span", { class: f(["kvc-chip", { "kvc-warn": o.child.session.status === "waiting" }]) }, E(d.value), 3)
4606
- ]), o.child.live.text !== "" || (o.child.turn?.pending.length ?? 0) > 0 ? (_(), i("div", ql, [o.child.live.text === "" ? r("v-if", !0) : (_(), i("p", Jl, E(o.child.live.text), 1)), s(Tl, {
4638
+ ]), o.child.live.text !== "" || (o.child.turn?.pending.length ?? 0) > 0 ? (_(), i("div", $l, [o.child.live.text === "" ? r("v-if", !0) : (_(), i("p", eu, E(o.child.live.text), 1)), s(jl, {
4607
4639
  owner: o.child.turn === void 0 ? void 0 : {
4608
4640
  sessionId: o.child.session.id,
4609
4641
  turnId: o.child.turn.id
@@ -4616,22 +4648,22 @@ var zl = /* @__PURE__ */ c({
4616
4648
  "owner",
4617
4649
  "pending",
4618
4650
  "hidden"
4619
- ])])) : r("v-if", !0)], 8, Bl));
4651
+ ])])) : r("v-if", !0)], 8, Kl));
4620
4652
  }
4621
- }), Xl = ["aria-label"], Zl = { class: "kvc-card-row" }, Ql = {
4653
+ }), nu = ["aria-label"], ru = { class: "kvc-card-row" }, iu = {
4622
4654
  class: "kvc-chip kvc-mono",
4623
4655
  "data-test": "worker-card-name"
4624
- }, $l = {
4656
+ }, au = {
4625
4657
  style: {
4626
4658
  flex: "1 1 auto",
4627
4659
  "font-weight": "500"
4628
4660
  },
4629
4661
  dir: "auto",
4630
4662
  "data-test": "worker-card-call"
4631
- }, eu = {
4663
+ }, ou = {
4632
4664
  class: "kvc-chip",
4633
4665
  "data-test": "worker-card-time"
4634
- }, tu = ["disabled"], nu = /* @__PURE__ */ c({
4666
+ }, su = ["disabled"], cu = /* @__PURE__ */ c({
4635
4667
  __name: "WorkerCard",
4636
4668
  props: {
4637
4669
  sessionId: {},
@@ -4667,25 +4699,25 @@ var zl = /* @__PURE__ */ c({
4667
4699
  class: "kvc-card",
4668
4700
  "data-test": "worker-card",
4669
4701
  "aria-label": o.value.title
4670
- }, [a("div", Zl, [
4702
+ }, [a("div", ru, [
4671
4703
  s(D(se), {
4672
4704
  size: 18,
4673
4705
  "aria-hidden": "true"
4674
4706
  }),
4675
- a("span", Ql, E(o.value.title), 1),
4676
- a("span", $l, E(o.value.call), 1),
4707
+ a("span", iu, E(o.value.title), 1),
4708
+ a("span", au, E(o.value.call), 1),
4677
4709
  t[0] ||= a("span", { class: "kvc-spin" }, null, -1),
4678
- a("span", eu, E(D(n).t("kvcoder.ui.jobs.status.running")) + " · " + E(D(wi)(D(n).t, c.value - Date.parse(o.value.startedAt))), 1),
4710
+ a("span", ou, E(D(n).t("kvcoder.ui.jobs.status.running")) + " · " + E(D(wi)(D(n).t, c.value - Date.parse(o.value.startedAt))), 1),
4679
4711
  a("button", {
4680
4712
  type: "button",
4681
4713
  class: "kvc-button",
4682
4714
  disabled: l.value,
4683
4715
  "data-test": "worker-card-stop",
4684
4716
  onClick: d
4685
- }, E(D(n).t("kvcoder.ui.jobs.stop")), 9, tu)
4686
- ])], 8, Xl));
4717
+ }, E(D(n).t("kvcoder.ui.jobs.stop")), 9, su)
4718
+ ])], 8, nu));
4687
4719
  }
4688
- }), ru = (e) => {
4720
+ }), lu = (e) => {
4689
4721
  let t = e.view.description ?? e.view.line;
4690
4722
  return {
4691
4723
  name: "run",
@@ -4694,8 +4726,8 @@ var zl = /* @__PURE__ */ c({
4694
4726
  complete: !0
4695
4727
  };
4696
4728
  };
4697
- function iu(e, n, r) {
4698
- let i = t(() => $c(e.workspace.value.id)), a = /* @__PURE__ */ new Map(), o = 0, s = !1;
4729
+ function uu(e, n, r) {
4730
+ let i = t(() => al(e.workspace.value.id)), a = /* @__PURE__ */ new Map(), o = 0, s = !1;
4699
4731
  A([
4700
4732
  () => e.workspace.value.id,
4701
4733
  () => r()?.sessionId,
@@ -4708,7 +4740,7 @@ function iu(e, n, r) {
4708
4740
  async function c(t, r) {
4709
4741
  let i = e.workspace.value.id, c = o, l = () => !s && o === c && e.workspace.value.id === i, u = t.map((e) => ({
4710
4742
  item: e,
4711
- draft: Zc(i, e.questionId, r)
4743
+ draft: rl(i, e.questionId, r)
4712
4744
  }));
4713
4745
  if (u.some(({ draft: e }) => e.sending)) return;
4714
4746
  let d = u.filter(({ draft: e }) => !e.settled);
@@ -4716,18 +4748,18 @@ function iu(e, n, r) {
4716
4748
  let f = null;
4717
4749
  for (let [t, { item: n, draft: r }] of d.entries()) {
4718
4750
  if (!l()) {
4719
- for (let e of d.slice(t)) Qc(i, e.item.questionId, e.draft) && (e.draft.sending = !1);
4751
+ for (let e of d.slice(t)) il(i, e.item.questionId, e.draft) && (e.draft.sending = !1);
4720
4752
  return;
4721
4753
  }
4722
- if (Qc(i, n.questionId, r)) try {
4723
- f = (await e.exec("kvcoder.question.answer", n)).jobId ?? f, Qc(i, n.questionId, r) && el(r);
4754
+ if (il(i, n.questionId, r)) try {
4755
+ f = (await e.exec("kvcoder.question.answer", n)).jobId ?? f, il(i, n.questionId, r) && ol(r);
4724
4756
  } catch (o) {
4725
4757
  if (qe(o)?.code === "kvcoder/QUESTION_NOT_FOUND") {
4726
- Qc(i, n.questionId, r) && (r.sending = !1);
4758
+ il(i, n.questionId, r) && (r.sending = !1);
4727
4759
  continue;
4728
4760
  }
4729
- for (let e of d.slice(t)) Qc(i, e.item.questionId, e.draft) && (e.draft.sending = !1, e.draft === r && (e.draft.error = o)), a.delete(e.item.questionId);
4730
- l() && Qc(i, n.questionId, r) && J(e, o);
4761
+ for (let e of d.slice(t)) il(i, e.item.questionId, e.draft) && (e.draft.sending = !1, e.draft === r && (e.draft.error = o)), a.delete(e.item.questionId);
4762
+ l() && il(i, n.questionId, r) && J(e, o);
4731
4763
  return;
4732
4764
  }
4733
4765
  }
@@ -4741,7 +4773,7 @@ function iu(e, n, r) {
4741
4773
  hidden: i,
4742
4774
  answer: (e) => c([e]),
4743
4775
  decide: ({ approvals: e, confirmed: t, owner: n }) => {
4744
- if (t) for (let t of e) a.set(t.questionId, ru(t));
4776
+ if (t) for (let t of e) a.set(t.questionId, lu(t));
4745
4777
  return c(e.map((e) => ({
4746
4778
  questionId: e.questionId,
4747
4779
  answer: { confirmed: t }
@@ -4751,8 +4783,8 @@ function iu(e, n, r) {
4751
4783
  }
4752
4784
  //#endregion
4753
4785
  //#region web/src/use-artifacts.ts
4754
- var au = (e) => `${e.version} ${e.updatedAt}`;
4755
- function ou(e, t, n, r) {
4786
+ var du = (e) => `${e.version} ${e.updatedAt}`;
4787
+ function fu(e, t, n, r) {
4756
4788
  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;
4757
4789
  function g(e) {
4758
4790
  u = e, d = !1, l.clear(), c.value = void 0, i.value = [], a.value = void 0, o.value = void 0, s.value = !1;
@@ -4789,7 +4821,7 @@ function ou(e, t, n, r) {
4789
4821
  if (p || m !== f || t() !== n || u !== n) return;
4790
4822
  if (i.value = h, !d) {
4791
4823
  d = !0;
4792
- for (let e of h) l.set(e.id, au(e));
4824
+ for (let e of h) l.set(e.id, du(e));
4793
4825
  if (h.length === 0) {
4794
4826
  a.value = void 0, o.value = void 0, s.value = !1;
4795
4827
  return;
@@ -4800,8 +4832,8 @@ function ou(e, t, n, r) {
4800
4832
  t !== void 0 && await _(n, t);
4801
4833
  return;
4802
4834
  }
4803
- let v = h.filter((e) => l.get(e.id) !== au(e));
4804
- for (let e of h) l.set(e.id, au(e));
4835
+ let v = h.filter((e) => l.get(e.id) !== du(e));
4836
+ for (let e of h) l.set(e.id, du(e));
4805
4837
  if (v.length > 0) {
4806
4838
  let e = [...v].sort((e, t) => e.updatedAt < t.updatedAt ? 1 : e.updatedAt > t.updatedAt ? -1 : 0)[0];
4807
4839
  e !== void 0 && (a.value = e.id, s.value = !0, c.value = {
@@ -4869,7 +4901,7 @@ function ou(e, t, n, r) {
4869
4901
  }
4870
4902
  //#endregion
4871
4903
  //#region web/src/conversation-streams.ts
4872
- function su(e, t, n, r, i) {
4904
+ function pu(e, t, n, r, i) {
4873
4905
  let a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new WeakMap(), s = (e) => e.current() && a.get(e.target) === e, c = (e, t) => {
4874
4906
  s(e) && i(t);
4875
4907
  };
@@ -4921,27 +4953,27 @@ function su(e, t, n, r, i) {
4921
4953
  }
4922
4954
  //#endregion
4923
4955
  //#region web/src/use-conversation.ts
4924
- var cu = 5e3, lu = 200;
4925
- function uu(e, t, n, r = () => !1) {
4926
- let i = T(null), a = T([]), o = T(0), s = T([]), c = T(null), l = T(void 0), u = T(!1), d = v(ga()), 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 = su(e, d, u, () => N(), n), S = (e) => e.filter((e) => e.queued !== !0);
4956
+ var mu = 5e3, hu = 200;
4957
+ function gu(e, t, n, r = () => !1) {
4958
+ let i = T(null), a = T([]), o = T(0), s = T([]), c = T(null), l = T(void 0), u = T(!1), d = v(ga()), 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 = pu(e, d, u, () => N(), n), S = (e) => e.filter((e) => e.queued !== !0);
4927
4959
  async function C(t, n, r) {
4928
4960
  if (!r()) return;
4929
4961
  let i = await e.exec("kvcoder.message.list", {
4930
4962
  sessionId: t,
4931
- limit: lu
4963
+ limit: hu
4932
4964
  });
4933
4965
  r() && (a.value = i.messages, o.value = i.omitted, h = n, y = !1);
4934
4966
  }
4935
4967
  async function E(t, n, i, s) {
4936
4968
  let c = await e.exec("kvcoder.message.list", {
4937
4969
  sessionId: t,
4938
- limit: lu,
4970
+ limit: hu,
4939
4971
  afterSeq: i
4940
4972
  });
4941
4973
  if (!s()) return;
4942
4974
  let l = S(c.messages);
4943
4975
  if (l[0] !== void 0 && l[0].seq !== i + 1) return C(t, n, s);
4944
- 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 - lu, 0);
4976
+ 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 - hu, 0);
4945
4977
  a.value = [...f.slice(p), ...c.messages.filter((e) => e.queued === !0)], o.value += p;
4946
4978
  }
4947
4979
  async function D() {
@@ -4949,7 +4981,7 @@ function uu(e, t, n, r = () => !1) {
4949
4981
  if (t === void 0 || n === void 0) return;
4950
4982
  let r = await e.exec("kvcoder.message.list", {
4951
4983
  sessionId: t.sessionId,
4952
- limit: lu,
4984
+ limit: hu,
4953
4985
  beforeSeq: n
4954
4986
  });
4955
4987
  b(t) && S(a.value)[0]?.seq === n && (a.value = [...r.messages, ...a.value], o.value = r.omitted, y = !0);
@@ -4986,7 +5018,7 @@ function uu(e, t, n, r = () => !1) {
4986
5018
  turn: a?.sessionId === n ? a : void 0,
4987
5019
  live: f.get(n)?.live ?? v(ga())
4988
5020
  };
4989
- tl(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));
5021
+ sl(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));
4990
5022
  }
4991
5023
  }
4992
5024
  async function M(t = [], n) {
@@ -5005,7 +5037,7 @@ function uu(e, t, n, r = () => !1) {
5005
5037
  e.exec("kvcoder.context.get", { sessionId: r.sessionId })
5006
5038
  ]);
5007
5039
  if (!o() || a.id !== r.sessionId || (i.value !== null && i.value.status !== a.status && e.refresh(), !o())) return;
5008
- i.value = a, s.value = l, c.value = u, tl(r.workspaceId, a.id, l);
5040
+ i.value = a, s.value = l, c.value = u, sl(r.workspaceId, a.id, l);
5009
5041
  let f = a.status === "running" ? a.stepJobId : void 0;
5010
5042
  x.update(d, f, () => b(r), n === void 0 || n === f ? t : []);
5011
5043
  let p = j(r, a.status === "waiting" ? l[0] : void 0, o);
@@ -5025,7 +5057,7 @@ function uu(e, t, n, r = () => !1) {
5025
5057
  e !== void 0 && !x.busy() && N().catch((t) => {
5026
5058
  b(e) && n(t);
5027
5059
  });
5028
- }, cu);
5060
+ }, mu);
5029
5061
  return g(() => {
5030
5062
  _ = !0, p = void 0, m = void 0, x.clear(), clearInterval(F);
5031
5063
  }), A([t, () => e.workspace.value.id], () => {
@@ -5059,7 +5091,7 @@ function uu(e, t, n, r = () => !1) {
5059
5091
  }
5060
5092
  //#endregion
5061
5093
  //#region web/src/use-execution-map.ts
5062
- function du(e, n, r, i, a) {
5094
+ function _u(e, n, r, i, a) {
5063
5095
  let o = y(null), s = y(!1), c, l, u, d = 0, f = !1;
5064
5096
  async function p() {
5065
5097
  let t = n();
@@ -5105,15 +5137,15 @@ function du(e, n, r, i, a) {
5105
5137
  }
5106
5138
  //#endregion
5107
5139
  //#region web/src/use-follow-latest.ts
5108
- var fu = 80;
5109
- function pu(e, t, n) {
5140
+ var vu = 80;
5141
+ function yu(e, t, n) {
5110
5142
  let r = y(!1);
5111
5143
  function i() {
5112
5144
  e.value !== null && (e.value.scrollTop = e.value.scrollHeight);
5113
5145
  }
5114
5146
  function a() {
5115
5147
  let t = e.value;
5116
- t !== null && (r.value = t.scrollHeight - t.clientHeight - t.scrollTop > fu);
5148
+ t !== null && (r.value = t.scrollHeight - t.clientHeight - t.scrollTop > vu);
5117
5149
  }
5118
5150
  function o() {
5119
5151
  r.value = !1, i();
@@ -5130,7 +5162,7 @@ function pu(e, t, n) {
5130
5162
  }
5131
5163
  //#endregion
5132
5164
  //#region web/src/use-finished-runs.ts
5133
- function mu(e, t, n, r) {
5165
+ function bu(e, t, n, r) {
5134
5166
  let i = y(/* @__PURE__ */ new Map());
5135
5167
  async function a(n) {
5136
5168
  try {
@@ -5150,7 +5182,7 @@ function mu(e, t, n, r) {
5150
5182
  }
5151
5183
  //#endregion
5152
5184
  //#region web/src/use-slash-commands.ts
5153
- function hu(e) {
5185
+ function xu(e) {
5154
5186
  let t = T([]);
5155
5187
  return h(async () => {
5156
5188
  try {
@@ -5162,7 +5194,7 @@ function hu(e) {
5162
5194
  }
5163
5195
  //#endregion
5164
5196
  //#region web/src/use-workspace-session.ts
5165
- function gu(e, n, r) {
5197
+ function Su(e, n, r) {
5166
5198
  let i = T(e.workspace.value.id);
5167
5199
  async function a(t) {
5168
5200
  let n;
@@ -5181,43 +5213,43 @@ function gu(e, n, r) {
5181
5213
  }
5182
5214
  //#endregion
5183
5215
  //#region web/src/ConversationView.vue?vue&type=script&setup=true&lang.ts
5184
- var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
5216
+ var Cu = { class: "kvc-workspace" }, wu = { class: "kvc-stage" }, Tu = {
5185
5217
  class: "kvc-conversation",
5186
5218
  "data-test": "conversation"
5187
- }, bu = {
5219
+ }, Eu = {
5188
5220
  key: 0,
5189
5221
  class: "kvc-start",
5190
5222
  role: "alert",
5191
5223
  "data-test": "load-failure"
5192
- }, xu = { class: "kvc-start-note" }, Su = {
5224
+ }, Du = { class: "kvc-start-note" }, Ou = {
5193
5225
  class: "kvc-actions",
5194
5226
  style: { "justify-content": "center" }
5195
- }, Cu = {
5227
+ }, ku = {
5196
5228
  key: 1,
5197
5229
  class: "kvc-scrollport"
5198
- }, wu = {
5230
+ }, Au = {
5199
5231
  key: 1,
5200
5232
  class: "kvc-column"
5201
- }, Tu = {
5233
+ }, ju = {
5202
5234
  key: 0,
5203
5235
  class: "kvc-actions",
5204
5236
  style: { "justify-content": "center" }
5205
- }, Eu = ["title"], Du = {
5237
+ }, Mu = ["title"], Nu = {
5206
5238
  key: 1,
5207
5239
  class: "kvc-notice",
5208
5240
  "data-test": "map-remaining"
5209
- }, Ou = {
5241
+ }, Pu = {
5210
5242
  key: 3,
5211
5243
  class: "kvc-notice",
5212
5244
  "data-test": "summarizing"
5213
- }, ku = {
5245
+ }, Fu = {
5214
5246
  key: 4,
5215
5247
  class: "kvc-answer",
5216
5248
  "data-test": "live-answer"
5217
- }, Au = ["open"], ju = { class: "kvc-muted" }, Mu = {
5249
+ }, Iu = ["open"], Lu = { class: "kvc-muted" }, Ru = {
5218
5250
  class: "kvc-muted",
5219
5251
  style: { "white-space": "pre-wrap" }
5220
- }, Nu = {
5252
+ }, zu = {
5221
5253
  key: 7,
5222
5254
  class: "kvc-muted",
5223
5255
  style: {
@@ -5225,11 +5257,11 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
5225
5257
  margin: "0"
5226
5258
  },
5227
5259
  "data-test": "waiting-hint"
5228
- }, Pu = /* @__PURE__ */ c({
5260
+ }, Bu = /* @__PURE__ */ c({
5229
5261
  __name: "ConversationView",
5230
5262
  props: { sessionId: {} },
5231
5263
  setup(c) {
5232
- let l = c, u = K(), f = gu(u, () => l.sessionId, (e) => J(u, e)), p = y("chat"), m = y(!1), h = uu(u, () => f.value, (e) => J(u, e), () => m.value), { session: g, messages: v, omitted: x, turns: S, live: w, children: T } = h, k = ou(u, () => f.value, () => g.value?.updatedAt, (e) => J(u, e)), M = du(u, () => f.value, () => g.value?.updatedAt, k, (e) => J(u, e)), N = t(() => M.shown.value || k.open.value && k.shown.value !== void 0), P = t(() => g.value?.status === "idle" ? M.counts.value?.left ?? 0 : 0), F = t(() => Na(v.value)), I = mu(u, () => f.value, v, (e) => J(u, e)), L = /* @__PURE__ */ new Set([
5264
+ let l = c, u = K(), f = Su(u, () => l.sessionId, (e) => J(u, e)), p = y("chat"), m = y(!1), h = gu(u, () => f.value, (e) => J(u, e), () => m.value), { session: g, messages: v, omitted: x, turns: S, live: w, children: T } = h, k = fu(u, () => f.value, () => g.value?.updatedAt, (e) => J(u, e)), M = _u(u, () => f.value, () => g.value?.updatedAt, k, (e) => J(u, e)), N = t(() => M.shown.value || k.open.value && k.shown.value !== void 0), P = t(() => g.value?.status === "idle" ? M.counts.value?.left ?? 0 : 0), F = t(() => Na(v.value)), I = bu(u, () => f.value, v, (e) => J(u, e)), L = /* @__PURE__ */ new Set([
5233
5265
  "STEP_FAILED",
5234
5266
  "REPLY_LOST",
5235
5267
  "REPLY_INCOMPLETE",
@@ -5289,16 +5321,16 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
5289
5321
  ].join(" ")), se = () => g.value === null || S.value[0] === void 0 ? void 0 : {
5290
5322
  sessionId: g.value.id,
5291
5323
  turnId: S.value[0].id
5292
- }, U = iu(u, (e) => h.refresh(e), se), ce = t(() => new Map(z.value.flatMap((e) => {
5324
+ }, U = uu(u, (e) => h.refresh(e), se), ce = t(() => new Map(z.value.flatMap((e) => {
5293
5325
  let t = F.value.get(e.toolCallId)?.fields?.task;
5294
5326
  return typeof e.childSessionId == "string" && typeof t == "string" ? [[e.childSessionId, t]] : [];
5295
5327
  }))), le = t(() => z.value.flatMap((e) => e.kind === "worker" && e.runId !== void 0 ? [e.runId] : [])), ue = t(() => z.value.filter((e) => e.questionId === null || !U.hidden.value.has(String(e.questionId)))), de = t(() => {
5296
5328
  let e = v.value.at(-1);
5297
5329
  return g.value?.status === "idle" && e?.kind === "notice" && L.has(String(e.content.code));
5298
- }), fe = hu(u), W = Rl(u, () => f.value ?? "", () => h.refresh()), pe = t(() => {
5330
+ }), fe = xu(u), W = Wl(u, () => f.value ?? "", () => h.refresh()), pe = t(() => {
5299
5331
  let e = qe(h.loadFailure.value);
5300
5332
  return e === void 0 ? u.t("kvcoder.ui.failed") : u.t(Ke(e.code), e.params);
5301
- }), me = O("list"), G = pu(me, () => [
5333
+ }), me = O("list"), G = yu(me, () => [
5302
5334
  v.value,
5303
5335
  w.text,
5304
5336
  w.thinking,
@@ -5356,7 +5388,7 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
5356
5388
  }));
5357
5389
  }
5358
5390
  let Ce = (e) => e.id;
5359
- return (t, c) => (_(), i("div", _u, [D(g) && D(f) !== void 0 ? (_(), n(oa, {
5391
+ return (t, c) => (_(), i("div", Cu, [D(g) && D(f) !== void 0 ? (_(), n(oa, {
5360
5392
  key: 0,
5361
5393
  session: D(g),
5362
5394
  tab: p.value,
@@ -5384,20 +5416,20 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
5384
5416
  "map",
5385
5417
  "map-open",
5386
5418
  "working"
5387
- ])) : r("v-if", !0), a("div", vu, [a("section", yu, [l.sessionId === void 0 ? (_(), n(ui, {
5419
+ ])) : r("v-if", !0), a("div", wu, [a("section", Tu, [l.sessionId === void 0 ? (_(), n(ui, {
5388
5420
  key: 0,
5389
5421
  registered: D(fe)
5390
- }, null, 8, ["registered"])) : D(g) && D(f) !== void 0 ? (_(), i(e, { key: 1 }, [D(h).loadFailure.value === void 0 ? (_(), i("div", Cu, [a("div", {
5422
+ }, null, 8, ["registered"])) : D(g) && D(f) !== void 0 ? (_(), i(e, { key: 1 }, [D(h).loadFailure.value === void 0 ? (_(), i("div", ku, [a("div", {
5391
5423
  ref_key: "list",
5392
5424
  ref: me,
5393
5425
  class: "kvc-scroll",
5394
5426
  onScroll: c[10] ||= (...e) => D(G).onScroll && D(G).onScroll(...e)
5395
- }, [p.value === "prompt" ? (_(), n(Ll, {
5427
+ }, [p.value === "prompt" ? (_(), n(Ul, {
5396
5428
  key: 0,
5397
5429
  "session-id": D(g).id,
5398
5430
  onBack: c[6] ||= (e) => p.value = "chat"
5399
- }, null, 8, ["session-id"])) : (_(), i("div", wu, [
5400
- D(x) > 0 ? (_(), i("div", Tu, [a("button", {
5431
+ }, null, 8, ["session-id"])) : (_(), i("div", Au, [
5432
+ D(x) > 0 ? (_(), i("div", ju, [a("button", {
5401
5433
  type: "button",
5402
5434
  class: "kvc-button",
5403
5435
  "data-test": "show-earlier",
@@ -5408,7 +5440,7 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
5408
5440
  "data-test": "earlier",
5409
5441
  onClick: _e
5410
5442
  }, E(D(u).t("kvcoder.ui.earlierMessages", { count: D(x) })), 1)])) : r("v-if", !0),
5411
- (_(!0), i(e, null, b(D(v), (t) => (_(), i(e, { key: Ce(t) }, [s(Fc, {
5443
+ (_(!0), i(e, null, b(D(v), (t) => (_(), i(e, { key: Ce(t) }, [s(Vc, {
5412
5444
  message: t,
5413
5445
  calls: F.value,
5414
5446
  "finished-runs": D(I),
@@ -5422,26 +5454,26 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
5422
5454
  class: "kvc-muted",
5423
5455
  title: B.value.get(t.id)?.tokens,
5424
5456
  "data-test": "turn-totals"
5425
- }, E(B.value.get(t.id)?.text), 9, Eu)) : r("v-if", !0)], 64))), 128)),
5426
- P.value > 0 ? (_(), i("div", Du, [o(E(D(u).t("kvcoder.ui.map.remaining", { count: P.value })) + " ", 1), a("button", {
5457
+ }, E(B.value.get(t.id)?.text), 9, Mu)) : r("v-if", !0)], 64))), 128)),
5458
+ P.value > 0 ? (_(), i("div", Nu, [o(E(D(u).t("kvcoder.ui.map.remaining", { count: P.value })) + " ", 1), a("button", {
5427
5459
  type: "button",
5428
5460
  class: "kvc-link-button",
5429
5461
  "data-test": "map-show",
5430
5462
  onClick: c[8] ||= (e) => D(M).shown.value = !0
5431
5463
  }, E(D(u).t("kvcoder.ui.map.show")), 1)])) : r("v-if", !0),
5432
- de.value ? (_(), n(Al, {
5464
+ de.value ? (_(), n(Il, {
5433
5465
  key: 2,
5434
5466
  "session-id": D(g).id,
5435
5467
  onSent: c[9] ||= (e) => {
5436
5468
  D(G).resume(), D(h).refresh();
5437
5469
  }
5438
5470
  }, null, 8, ["session-id"])) : r("v-if", !0),
5439
- D(w).summarizing ? (_(), i("div", Ou, E(D(u).t("kvcoder.ui.summarizing")), 1)) : r("v-if", !0),
5440
- R.value && (D(w).text !== "" || D(w).thinking !== "") ? (_(), i("div", ku, [D(w).thinking === "" ? r("v-if", !0) : (_(), i("details", {
5471
+ D(w).summarizing ? (_(), i("div", Pu, E(D(u).t("kvcoder.ui.summarizing")), 1)) : r("v-if", !0),
5472
+ R.value && (D(w).text !== "" || D(w).thinking !== "") ? (_(), i("div", Fu, [D(w).thinking === "" ? r("v-if", !0) : (_(), i("details", {
5441
5473
  key: 0,
5442
5474
  open: D(w).text === "" && D(w).calls.length === 0,
5443
5475
  "data-test": "live-thinking"
5444
- }, [a("summary", ju, E(D(u).t("kvcoder.ui.thinkingNow")), 1), a("p", Mu, E(D(w).thinking), 1)], 8, Au)), D(w).text === "" ? r("v-if", !0) : (_(), n(C(D(u).View), {
5476
+ }, [a("summary", Lu, E(D(u).t("kvcoder.ui.thinkingNow")), 1), a("p", Ru, E(D(w).thinking), 1)], 8, Iu)), D(w).text === "" ? r("v-if", !0) : (_(), n(C(D(u).View), {
5445
5477
  key: 1,
5446
5478
  view: {
5447
5479
  type: "markdown",
@@ -5458,7 +5490,7 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
5458
5490
  key: 6,
5459
5491
  working: D(W).working.value
5460
5492
  }, null, 8, ["working"])) : r("v-if", !0),
5461
- (_(!0), i(e, null, b(D(T), ([e, t]) => (_(), n(Yl, {
5493
+ (_(!0), i(e, null, b(D(T), ([e, t]) => (_(), n(tu, {
5462
5494
  key: e,
5463
5495
  child: t,
5464
5496
  task: ce.value.get(e),
@@ -5472,12 +5504,12 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
5472
5504
  "onAnswer",
5473
5505
  "onDecide"
5474
5506
  ]))), 128)),
5475
- (_(!0), i(e, null, b(le.value, (e) => (_(), n(nu, {
5507
+ (_(!0), i(e, null, b(le.value, (e) => (_(), n(cu, {
5476
5508
  key: e,
5477
5509
  "session-id": D(g).id,
5478
5510
  "run-id": e
5479
5511
  }, null, 8, ["session-id", "run-id"]))), 128)),
5480
- s(Tl, {
5512
+ s(jl, {
5481
5513
  owner: se(),
5482
5514
  pending: z.value,
5483
5515
  hidden: D(U).hidden.value,
@@ -5490,7 +5522,7 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
5490
5522
  "onAnswer",
5491
5523
  "onDecide"
5492
5524
  ]),
5493
- z.value.length > 0 ? (_(), i("p", Nu, E(oe.value), 1)) : r("v-if", !0)
5525
+ z.value.length > 0 ? (_(), i("p", zu, E(oe.value), 1)) : r("v-if", !0)
5494
5526
  ]))], 544), D(G).away.value ? (_(), i("button", {
5495
5527
  key: 0,
5496
5528
  type: "button",
@@ -5500,7 +5532,7 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
5500
5532
  }, [s(D(re), {
5501
5533
  size: 16,
5502
5534
  "aria-hidden": "true"
5503
- }), o(E(D(u).t("kvcoder.ui.jumpToLatest")), 1)])) : r("v-if", !0)])) : (_(), i("div", bu, [a("p", xu, E(D(u).t("kvcoder.ui.loadFailed", { error: pe.value })), 1), a("div", Su, [a("button", {
5535
+ }), o(E(D(u).t("kvcoder.ui.jumpToLatest")), 1)])) : r("v-if", !0)])) : (_(), i("div", Eu, [a("p", Du, E(D(u).t("kvcoder.ui.loadFailed", { error: pe.value })), 1), a("div", Ou, [a("button", {
5504
5536
  type: "button",
5505
5537
  class: "kvc-button kvc-primary",
5506
5538
  "data-test": "load-again",
@@ -5524,7 +5556,7 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
5524
5556
  onCommand: xe,
5525
5557
  onRegistered: Se
5526
5558
  }, {
5527
- controls: j(() => [s(zl, {
5559
+ controls: j(() => [s(Gl, {
5528
5560
  session: D(g),
5529
5561
  onChanged: c[11] ||= (e) => D(h).refresh()
5530
5562
  }, null, 8, ["session"])]),
@@ -5555,13 +5587,13 @@ var _u = { class: "kvc-workspace" }, vu = { class: "kvc-stage" }, yu = {
5555
5587
  "map-shown"
5556
5588
  ])) : r("v-if", !0)])]));
5557
5589
  }
5558
- }), Fu = /* @__PURE__ */ c({
5590
+ }), Vu = /* @__PURE__ */ c({
5559
5591
  __name: "conversation",
5560
5592
  props: { sessionId: {} },
5561
5593
  setup(e) {
5562
5594
  let t = e;
5563
- return (e, r) => (_(), n(Pu, { "session-id": t.sessionId }, null, 8, ["session-id"]));
5595
+ return (e, r) => (_(), n(Bu, { "session-id": t.sessionId }, null, 8, ["session-id"]));
5564
5596
  }
5565
5597
  });
5566
5598
  //#endregion
5567
- export { Fu as default };
5599
+ export { Vu as default };