claude-discover 1.10.13 → 1.10.15

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.
@@ -1,5 +1,5 @@
1
1
  import { r as __toESM } from "./rolldown-runtime-SbdDWaPq.js";
2
- import { A as intervalToDuration, B as startOfWeek, C as ChevronDown, D as isSameMonth, E as isToday, F as endOfMonth, G as Ki, H as addMonths, I as endOfDay, J as require_jsx_runtime, K as Qi, L as isSameDay, M as format, N as endOfWeek, O as isSameWeek, P as startOfMonth, R as addWeeks, S as ChevronRight, T as ArrowDownToLine, U as addDays, V as addHours, W as Hi, X as require_client, Y as require_compiler_runtime, Z as require_react, _ as Globe, a as ve, b as DollarSign, c as Markdown$1, d as Zap, f as WandSparkles, g as LaptopMinimal, h as MessageSquare, i as JsonView, j as getDaysInMonth, k as parse, l as defaultUrlTransform, m as OctagonX, n as w, o as rehypeHighlight, p as Terminal, q as la, r as vscodeTheme, s as remarkGfm, t as C, u as encode, v as GitBranch, w as Brain, x as Clock, y as Gauge, z as startOfDay } from "./vendors-C1ZLrYHz.js";
2
+ import { $ as require_compiler_runtime, A as X, B as DollarSign, C as addWeeks, D as addMonths, E as addHours, F as LaptopMinimal, G as Bug, H as Clock, I as Globe, J as Hi, K as Brain, L as GitBranch, M as Terminal, N as OctagonX, O as addDays, P as MessageSquare, Q as require_jsx_runtime, R as Gauge, S as isSameDay, T as startOfWeek, U as ChevronRight, V as Database, W as ChevronDown, X as Qi, Y as Ki, Z as la, _ as format, a as ve, b as endOfMonth, c as Markdown$1, d as isToday, et as require_client, f as isSameMonth, g as getDaysInMonth, h as intervalToDuration, i as JsonView, j as WandSparkles, k as Zap, l as defaultUrlTransform, m as parse, n as w, o as rehypeHighlight, p as isSameWeek, q as ArrowDownToLine, r as vscodeTheme, s as remarkGfm, t as C, tt as require_react, u as encode, v as endOfWeek, w as startOfDay, x as endOfDay, y as startOfMonth, z as FlaskConical } from "./vendors-CstdHEvv.js";
3
3
  // src/renderer/utils/colors.js
4
4
  var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
5
5
  var import_client = require_client();
@@ -75,11 +75,11 @@ function useLocalStorage(key, initial) {
75
75
  }
76
76
  function clearOutdatedLocalStorage() {
77
77
  const version = localStorage.getItem(VERSION_KEY);
78
- if (version !== "1.10.13") {
79
- const [MAJOR, MINOR, PATCH] = "1.10.13".split(".");
78
+ if (version !== "1.10.15") {
79
+ const [MAJOR, MINOR, PATCH] = "1.10.15".split(".");
80
80
  const [major, minor, patch] = (version ?? "").split(".");
81
81
  if (MAJOR !== major || MINOR !== minor) localStorage.clear();
82
- localStorage.setItem(VERSION_KEY, "1.10.13");
82
+ localStorage.setItem(VERSION_KEY, "1.10.15");
83
83
  }
84
84
  }
85
85
  // src/renderer/utils/useMouse.js
@@ -336,7 +336,7 @@ function MultiPicker(t0) {
336
336
  $[22] = anchor;
337
337
  $[23] = t15;
338
338
  } else t15 = $[23];
339
- const t16 = _temp$14;
339
+ const t16 = _temp$16;
340
340
  let t17;
341
341
  if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
342
342
  t17 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
@@ -388,133 +388,234 @@ function MultiPicker(t0) {
388
388
  } else t22 = $[36];
389
389
  return t22;
390
390
  }
391
- function _temp$14(e_3) {
391
+ function _temp$16(e_3) {
392
392
  if (e_3.shiftKey) e_3.preventDefault();
393
393
  }
394
- // src/renderer/timeline/HeatStrip.jsx
395
- var BIN_HEIGHT_PX = 4;
396
- var BIN_WIDTH_MINUTES = 5;
397
- var BIN_WIDTH_MS = BIN_WIDTH_MINUTES * 6e4;
398
- var STOPS = [
399
- [2, "rgb(128 136 147 / 0.25)"],
400
- [5, "rgb(245 158 11 / 0.70)"],
401
- [10, "rgb(239 68 68 / 0.95)"],
402
- [Infinity, "rgb(185 28 28 / 1.00)"]
403
- ];
404
- function binCosts(sessions, slotStart, binCount) {
405
- const arr = new Float64Array(binCount);
406
- for (const s of sessions) for (const { start, end, cost } of s.costSamples ?? []) {
407
- const turnEnd = Math.max(end, start + 1);
408
- const ratePerMs = cost / (turnEnd - start);
409
- const b0 = Math.max(0, Math.floor((start - slotStart) / BIN_WIDTH_MS));
410
- const b1 = Math.min(binCount - 1, Math.floor((turnEnd - slotStart) / BIN_WIDTH_MS));
411
- for (let b = b0; b <= b1; b++) {
412
- const bs = slotStart + b * BIN_WIDTH_MS;
413
- arr[b] += ratePerMs * (Math.min(turnEnd, bs + BIN_WIDTH_MS) - Math.max(start, bs));
414
- }
394
+ // src/renderer/utils/formatting.js
395
+ function fmtDuration(ms) {
396
+ if (!ms || ms < 0) return "—";
397
+ if (ms < 6e4) return `${Math.round(ms / 1e3)}s`;
398
+ const { hours = 0, minutes = 0, seconds = 0 } = intervalToDuration({
399
+ start: 0,
400
+ end: ms
401
+ });
402
+ if (!hours) return `${minutes}m ${seconds}s`;
403
+ return `${hours}h ${minutes}m`;
404
+ }
405
+ function fmtAgo(date) {
406
+ const min = Math.floor((Date.now() - new Date(date)) / 6e4);
407
+ if (min < 1) return "now";
408
+ if (min < 60) return `${min}m`;
409
+ if (min < 1440) return `${Math.floor(min / 60)}h`;
410
+ return `${Math.floor(min / 1440)}d`;
411
+ }
412
+ function fmtNum(n) {
413
+ if (n == null) return "—";
414
+ return n.toLocaleString();
415
+ }
416
+ var plural = (n, noun) => `${n} ${noun}${n === 1 ? "" : "s"}`;
417
+ function fmtToolCalls({ toolCalls, skillCalls }) {
418
+ return skillCalls ? `${fmtNum(toolCalls)}, ${fmtNum(skillCalls)} skill${skillCalls === 1 ? "" : "s"}` : fmtNum(toolCalls);
419
+ }
420
+ function fmtUSD(n) {
421
+ if (n == null) return "—";
422
+ return `$${n.toFixed(2)}`;
423
+ }
424
+ function tone(value, { warn, danger }) {
425
+ if (value >= danger) return "danger";
426
+ if (value >= warn) return "warn";
427
+ return "";
428
+ }
429
+ function fmtCompact(n) {
430
+ if (n == null) return "—";
431
+ if (n < 0) return `-${fmtCompact(-n)}`;
432
+ if (n < 100) return `${n}`;
433
+ if (n < 1e6) return `${(n / 1e3).toFixed(1)}k`;
434
+ return `${(n / 1e6).toFixed(1)}M`;
435
+ }
436
+ // src/renderer/experiments/experiments.js
437
+ var experimentLabel = (id, name) => name ? name.replace(/^claude_code_|_experiment$/g, "") : id.slice(0, 8);
438
+ var experimentText = ({ experiment, experimentName }) => experimentName ? `${experimentName} (${experiment})` : experiment;
439
+ var experimentTip = (id, name, ...more) => [
440
+ `Anthropic experiment${name ? `: ${name}` : ""}`,
441
+ id,
442
+ ...more
443
+ ].join("\n");
444
+ function experimentColor(id) {
445
+ let h = 0;
446
+ for (const c of id) h = h * 31 + c.charCodeAt(0) >>> 0;
447
+ return `hsl(${40 + h % 280} 65% 62%)`;
448
+ }
449
+ function experimentLanes(sessions) {
450
+ const byId = /* @__PURE__ */ new Map();
451
+ for (const s of sessions) {
452
+ if (!s.experiment) continue;
453
+ let lane = byId.get(s.experiment);
454
+ if (!lane) byId.set(s.experiment, lane = {
455
+ id: s.experiment,
456
+ name: null,
457
+ sessions: 0,
458
+ spans: []
459
+ });
460
+ lane.name ||= s.experimentName || null;
461
+ lane.sessions++;
462
+ lane.spans.push(...s.activityPeriods?.length ? s.activityPeriods : [{
463
+ start: s.startedAt,
464
+ end: s.lastActivityAt
465
+ }]);
415
466
  }
416
- return arr;
467
+ for (const lane of byId.values()) lane.spans = merge(lane.spans);
468
+ return [...byId.values()].sort((a, b) => a.spans[0].start - b.spans[0].start);
417
469
  }
418
- function HeatStrip(t0) {
419
- const $ = (0, import_compiler_runtime.c)(27);
420
- const { sessions, viewStart, viewEnd, width, gutter } = t0;
421
- const chartWidth = width - gutter;
422
- const slotStart = Math.floor(viewStart / BIN_WIDTH_MS) * BIN_WIDTH_MS;
423
- const binCount = Math.ceil((viewEnd - slotStart) / BIN_WIDTH_MS);
424
- const binW = BIN_WIDTH_MS / (viewEnd - viewStart) * chartWidth;
425
- const x0 = (slotStart - viewStart) / (viewEnd - viewStart) * chartWidth;
470
+ function merge(spans) {
471
+ const out = [];
472
+ for (const { start, end } of [...spans].sort((a, b) => a.start - b.start)) {
473
+ const last = out.at(-1);
474
+ if (last && start <= last.end) last.end = Math.max(last.end, end);
475
+ else out.push({
476
+ start,
477
+ end
478
+ });
479
+ }
480
+ return out;
481
+ }
482
+ // src/renderer/experiments/ExperimentBand.jsx
483
+ var LANE = 14;
484
+ var BAR = 6;
485
+ var PAD = 3;
486
+ function ExperimentBand(t0) {
487
+ const $ = (0, import_compiler_runtime.c)(28);
488
+ const { sessions, viewStart, viewEnd, width, gutter, openId, onOpen } = t0;
426
489
  let t1;
427
490
  let t2;
428
- let t3;
429
- let t4;
430
- let t5;
431
- let t6;
432
- if ($[0] !== binCount || $[1] !== binW || $[2] !== gutter || $[3] !== sessions || $[4] !== slotStart || $[5] !== width || $[6] !== x0) {
433
- const bins = binCosts(sessions, slotStart, binCount);
434
- t3 = width;
435
- t4 = BIN_HEIGHT_PX;
436
- t5 = "heat-strip";
437
- if ($[13] !== gutter) {
438
- t6 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", {
439
- x: 0,
440
- y: 0,
441
- width: gutter,
442
- height: BIN_HEIGHT_PX,
443
- className: "gantt-gutter"
444
- });
445
- $[13] = gutter;
446
- $[14] = t6;
447
- } else t6 = $[14];
448
- t1 = `translate(${gutter},0)`;
449
- let t7;
450
- if ($[15] !== binW || $[16] !== x0) {
451
- t7 = (cost, i) => {
452
- if (cost <= 0) return null;
453
- const fill = STOPS.find((t8) => {
454
- const [max] = t8;
455
- return cost < max;
456
- })[1];
457
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", {
458
- x: x0 + i * binW,
491
+ if ($[0] !== gutter || $[1] !== onOpen || $[2] !== openId || $[3] !== sessions || $[4] !== viewEnd || $[5] !== viewStart || $[6] !== width) {
492
+ t2 = Symbol.for("react.early_return_sentinel");
493
+ bb0: {
494
+ const lanes = experimentLanes(sessions);
495
+ if (!lanes.length) {
496
+ t2 = null;
497
+ break bb0;
498
+ }
499
+ let t3;
500
+ if ($[9] !== gutter || $[10] !== viewEnd || $[11] !== viewStart || $[12] !== width) {
501
+ t3 = (ts) => gutter + (ts - viewStart) / (viewEnd - viewStart) * (width - gutter);
502
+ $[9] = gutter;
503
+ $[10] = viewEnd;
504
+ $[11] = viewStart;
505
+ $[12] = width;
506
+ $[13] = t3;
507
+ } else t3 = $[13];
508
+ const xFor = t3;
509
+ const height = lanes.length * LANE + 6;
510
+ let t4;
511
+ if ($[14] !== gutter || $[15] !== height) {
512
+ t4 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", {
513
+ x: 0,
459
514
  y: 0,
460
- width: binW + .6,
461
- height: BIN_HEIGHT_PX,
462
- fill,
463
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("title", { children: `$${cost.toFixed(2)} in ${BIN_WIDTH_MINUTES}m` })
464
- }, i);
465
- };
466
- $[15] = binW;
467
- $[16] = x0;
468
- $[17] = t7;
469
- } else t7 = $[17];
470
- t2 = Array.from(bins, t7);
471
- $[0] = binCount;
472
- $[1] = binW;
473
- $[2] = gutter;
515
+ width: gutter,
516
+ height,
517
+ className: "gantt-gutter"
518
+ });
519
+ $[14] = gutter;
520
+ $[15] = height;
521
+ $[16] = t4;
522
+ } else t4 = $[16];
523
+ const t5 = height - .5;
524
+ const t6 = height - .5;
525
+ let t7;
526
+ if ($[17] !== t5 || $[18] !== t6 || $[19] !== width) {
527
+ t7 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", {
528
+ x1: 0,
529
+ x2: width,
530
+ y1: t5,
531
+ y2: t6,
532
+ className: "gantt-group-sep"
533
+ });
534
+ $[17] = t5;
535
+ $[18] = t6;
536
+ $[19] = width;
537
+ $[20] = t7;
538
+ } else t7 = $[20];
539
+ let t8;
540
+ if ($[21] !== onOpen || $[22] !== openId || $[23] !== viewEnd || $[24] !== viewStart || $[25] !== width || $[26] !== xFor) {
541
+ t8 = (lane, i) => {
542
+ const y = PAD + i * LANE;
543
+ const color = experimentColor(lane.id);
544
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", {
545
+ className: `experiment-lane${lane.id === openId ? " open" : ""}`,
546
+ fill: color,
547
+ color,
548
+ onClick: () => onOpen(lane.id),
549
+ children: [
550
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", {
551
+ x: 0,
552
+ y,
553
+ width,
554
+ height: LANE,
555
+ className: "experiment-lane-hit"
556
+ }),
557
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("title", { children: experimentTip(lane.id, lane.name, plural(lane.sessions, "session"), "Click for its details") }),
558
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FlaskConical, {
559
+ x: 8,
560
+ y: y + 2,
561
+ size: 10
562
+ }),
563
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", {
564
+ x: 22,
565
+ y: y + LANE / 2,
566
+ dominantBaseline: "central",
567
+ className: "experiment-band-label",
568
+ children: experimentLabel(lane.id, lane.name)
569
+ }),
570
+ lane.spans.map((t9) => {
571
+ const { start, end } = t9;
572
+ if (end < viewStart || start > viewEnd) return null;
573
+ const x = xFor(Math.max(start, viewStart));
574
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", {
575
+ x,
576
+ y: y + 4,
577
+ width: Math.max(2, xFor(Math.min(end, viewEnd)) - x),
578
+ height: BAR,
579
+ rx: 1
580
+ }, start);
581
+ })
582
+ ]
583
+ }, lane.id);
584
+ };
585
+ $[21] = onOpen;
586
+ $[22] = openId;
587
+ $[23] = viewEnd;
588
+ $[24] = viewStart;
589
+ $[25] = width;
590
+ $[26] = xFor;
591
+ $[27] = t8;
592
+ } else t8 = $[27];
593
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", {
594
+ width,
595
+ height,
596
+ className: "experiment-band",
597
+ children: [
598
+ t4,
599
+ t7,
600
+ lanes.map(t8)
601
+ ]
602
+ });
603
+ }
604
+ $[0] = gutter;
605
+ $[1] = onOpen;
606
+ $[2] = openId;
474
607
  $[3] = sessions;
475
- $[4] = slotStart;
476
- $[5] = width;
477
- $[6] = x0;
608
+ $[4] = viewEnd;
609
+ $[5] = viewStart;
610
+ $[6] = width;
478
611
  $[7] = t1;
479
612
  $[8] = t2;
480
- $[9] = t3;
481
- $[10] = t4;
482
- $[11] = t5;
483
- $[12] = t6;
484
613
  } else {
485
614
  t1 = $[7];
486
615
  t2 = $[8];
487
- t3 = $[9];
488
- t4 = $[10];
489
- t5 = $[11];
490
- t6 = $[12];
491
616
  }
492
- let t7;
493
- if ($[18] !== t1 || $[19] !== t2) {
494
- t7 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", {
495
- transform: t1,
496
- children: t2
497
- });
498
- $[18] = t1;
499
- $[19] = t2;
500
- $[20] = t7;
501
- } else t7 = $[20];
502
- let t8;
503
- if ($[21] !== t3 || $[22] !== t4 || $[23] !== t5 || $[24] !== t6 || $[25] !== t7) {
504
- t8 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", {
505
- width: t3,
506
- height: t4,
507
- className: t5,
508
- children: [t6, t7]
509
- });
510
- $[21] = t3;
511
- $[22] = t4;
512
- $[23] = t5;
513
- $[24] = t6;
514
- $[25] = t7;
515
- $[26] = t8;
516
- } else t8 = $[26];
517
- return t8;
617
+ if (t2 !== Symbol.for("react.early_return_sentinel")) return t2;
618
+ return t1;
518
619
  }
519
620
  // src/renderer/timeline/SourceLegend.jsx
520
621
  var sourceRank = (k) => {
@@ -545,7 +646,7 @@ function SourceLegend(t0) {
545
646
  $[5] = onToggle;
546
647
  $[6] = t2;
547
648
  } else t2 = $[6];
548
- t1 = sources.toSorted(_temp$13).map(t2);
649
+ t1 = sources.toSorted(_temp$15).map(t2);
549
650
  $[0] = filter;
550
651
  $[1] = onToggle;
551
652
  $[2] = sources;
@@ -562,7 +663,7 @@ function SourceLegend(t0) {
562
663
  } else t2 = $[8];
563
664
  return t2;
564
665
  }
565
- function _temp$13(a, b) {
666
+ function _temp$15(a, b) {
566
667
  return sourceRank(a) - sourceRank(b);
567
668
  }
568
669
  // src/renderer/timeline/TimeAxis.jsx
@@ -673,7 +774,7 @@ function WorkTimeOverlay(t0) {
673
774
  const showWorkBand = t1 === void 0 ? true : t1;
674
775
  const [workTime, setWorkTime] = (0, import_react.useState)(null);
675
776
  const [dragging, setDragging] = (0, import_react.useState)(null);
676
- const [now, setNow] = (0, import_react.useState)(_temp$12);
777
+ const [now, setNow] = (0, import_react.useState)(_temp$14);
677
778
  let t2;
678
779
  let t3;
679
780
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
@@ -947,7 +1048,7 @@ function WorkTimeOverlay(t0) {
947
1048
  } else t11 = $[51];
948
1049
  return t11;
949
1050
  }
950
- function _temp$12() {
1051
+ function _temp$14() {
951
1052
  return Date.now();
952
1053
  }
953
1054
  // src/renderer/timeline/GanttChart.jsx
@@ -1099,8 +1200,8 @@ function layoutGroups(sessions, bar, expanded) {
1099
1200
  };
1100
1201
  }
1101
1202
  function GanttChart(t0) {
1102
- const $ = (0, import_compiler_runtime.c)(82);
1103
- const { dayRange, sessions, onSelect, selectedId, dayAnchor, granularity: t1, expanded, onToggleExpanded, projects, projectFilter, onSetProjectFilter, sourceFilter, availableSources, onToggleSourceFilter } = t0;
1203
+ const $ = (0, import_compiler_runtime.c)(84);
1204
+ const { dayRange, sessions, onSelect, selectedId, dayAnchor, granularity: t1, expanded, onToggleExpanded, projects, projectFilter, onSetProjectFilter, sourceFilter, availableSources, onToggleSourceFilter, openExperiment, onOpenExperiment } = t0;
1104
1205
  const granularity = t1 === void 0 ? "day" : t1;
1105
1206
  const bar = BARS[granularity] ?? BARS.day;
1106
1207
  const containerRef = (0, import_react.useRef)(null);
@@ -1243,28 +1344,32 @@ function GanttChart(t0) {
1243
1344
  } else t10 = $[36];
1244
1345
  useMouse(containerRef, t10);
1245
1346
  let t11;
1246
- if ($[37] !== sessions || $[38] !== view.end || $[39] !== view.start || $[40] !== width) {
1247
- t11 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HeatStrip, {
1347
+ if ($[37] !== onOpenExperiment || $[38] !== openExperiment || $[39] !== sessions || $[40] !== view.end || $[41] !== view.start || $[42] !== width) {
1348
+ t11 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ExperimentBand, {
1248
1349
  sessions,
1249
1350
  viewStart: view.start,
1250
1351
  viewEnd: view.end,
1251
1352
  width,
1252
- gutter: PROJECTS_WIDTH
1253
- });
1254
- $[37] = sessions;
1255
- $[38] = view.end;
1256
- $[39] = view.start;
1257
- $[40] = width;
1258
- $[41] = t11;
1259
- } else t11 = $[41];
1353
+ gutter: PROJECTS_WIDTH,
1354
+ openId: openExperiment,
1355
+ onOpen: onOpenExperiment
1356
+ });
1357
+ $[37] = onOpenExperiment;
1358
+ $[38] = openExperiment;
1359
+ $[39] = sessions;
1360
+ $[40] = view.end;
1361
+ $[41] = view.start;
1362
+ $[42] = width;
1363
+ $[43] = t11;
1364
+ } else t11 = $[43];
1260
1365
  let t12;
1261
- if ($[42] === Symbol.for("react.memo_cache_sentinel")) {
1366
+ if ($[44] === Symbol.for("react.memo_cache_sentinel")) {
1262
1367
  t12 = { marginBottom: -28 };
1263
- $[42] = t12;
1264
- } else t12 = $[42];
1368
+ $[44] = t12;
1369
+ } else t12 = $[44];
1265
1370
  let t13;
1266
1371
  let t14;
1267
- if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
1372
+ if ($[45] === Symbol.for("react.memo_cache_sentinel")) {
1268
1373
  t13 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", {
1269
1374
  x: 0,
1270
1375
  y: 0,
@@ -1279,14 +1384,14 @@ function GanttChart(t0) {
1279
1384
  y2: HEADER_HEIGHT,
1280
1385
  className: "gantt-divider"
1281
1386
  });
1282
- $[43] = t13;
1283
- $[44] = t14;
1387
+ $[45] = t13;
1388
+ $[46] = t14;
1284
1389
  } else {
1285
- t13 = $[43];
1286
- t14 = $[44];
1390
+ t13 = $[45];
1391
+ t14 = $[46];
1287
1392
  }
1288
1393
  let t15;
1289
- if ($[45] !== width) {
1394
+ if ($[47] !== width) {
1290
1395
  t15 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", {
1291
1396
  x1: 0,
1292
1397
  x2: width,
@@ -1294,11 +1399,11 @@ function GanttChart(t0) {
1294
1399
  y2: 27.5,
1295
1400
  className: "gantt-group-sep"
1296
1401
  });
1297
- $[45] = width;
1298
- $[46] = t15;
1299
- } else t15 = $[46];
1402
+ $[47] = width;
1403
+ $[48] = t15;
1404
+ } else t15 = $[48];
1300
1405
  let t16;
1301
- if ($[47] !== ticks) {
1406
+ if ($[49] !== ticks) {
1302
1407
  t16 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", {
1303
1408
  transform: `translate(${PROJECTS_WIDTH},0)`,
1304
1409
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TimeAxis, {
@@ -1306,26 +1411,26 @@ function GanttChart(t0) {
1306
1411
  headerHeight: HEADER_HEIGHT
1307
1412
  })
1308
1413
  });
1309
- $[47] = ticks;
1310
- $[48] = t16;
1311
- } else t16 = $[48];
1414
+ $[49] = ticks;
1415
+ $[50] = t16;
1416
+ } else t16 = $[50];
1312
1417
  let t17;
1313
- if ($[49] === Symbol.for("react.memo_cache_sentinel")) {
1418
+ if ($[51] === Symbol.for("react.memo_cache_sentinel")) {
1314
1419
  t17 = {
1315
1420
  width: 208,
1316
1421
  height: HEADER_HEIGHT
1317
1422
  };
1318
- $[49] = t17;
1319
- } else t17 = $[49];
1423
+ $[51] = t17;
1424
+ } else t17 = $[51];
1320
1425
  let t18;
1321
- if ($[50] !== projectFilter || $[51] !== projects) {
1426
+ if ($[52] !== projectFilter || $[53] !== projects) {
1322
1427
  t18 = projectOptions(projects, projectFilter);
1323
- $[50] = projectFilter;
1324
- $[51] = projects;
1325
- $[52] = t18;
1326
- } else t18 = $[52];
1428
+ $[52] = projectFilter;
1429
+ $[53] = projects;
1430
+ $[54] = t18;
1431
+ } else t18 = $[54];
1327
1432
  let t19;
1328
- if ($[53] !== onSetProjectFilter || $[54] !== projectFilter || $[55] !== t18) {
1433
+ if ($[55] !== onSetProjectFilter || $[56] !== projectFilter || $[57] !== t18) {
1329
1434
  t19 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
1330
1435
  className: "gantt-project-picker",
1331
1436
  "data-no-pan": true,
@@ -1337,13 +1442,13 @@ function GanttChart(t0) {
1337
1442
  allLabel: "All projects"
1338
1443
  })
1339
1444
  });
1340
- $[53] = onSetProjectFilter;
1341
- $[54] = projectFilter;
1342
- $[55] = t18;
1343
- $[56] = t19;
1344
- } else t19 = $[56];
1445
+ $[55] = onSetProjectFilter;
1446
+ $[56] = projectFilter;
1447
+ $[57] = t18;
1448
+ $[58] = t19;
1449
+ } else t19 = $[58];
1345
1450
  let t20;
1346
- if ($[57] === Symbol.for("react.memo_cache_sentinel")) {
1451
+ if ($[59] === Symbol.for("react.memo_cache_sentinel")) {
1347
1452
  t20 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pattern", {
1348
1453
  id: "gantt-subagent-hatch",
1349
1454
  patternUnits: "userSpaceOnUse",
@@ -1359,11 +1464,11 @@ function GanttChart(t0) {
1359
1464
  strokeWidth: 3.5
1360
1465
  })
1361
1466
  }) });
1362
- $[57] = t20;
1363
- } else t20 = $[57];
1467
+ $[59] = t20;
1468
+ } else t20 = $[59];
1364
1469
  let t21;
1365
1470
  let t22;
1366
- if ($[58] !== totalHeight) {
1471
+ if ($[60] !== totalHeight) {
1367
1472
  t21 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", {
1368
1473
  x: 0,
1369
1474
  y: 0,
@@ -1378,12 +1483,12 @@ function GanttChart(t0) {
1378
1483
  y2: totalHeight,
1379
1484
  className: "gantt-divider"
1380
1485
  });
1381
- $[58] = totalHeight;
1382
- $[59] = t21;
1383
- $[60] = t22;
1486
+ $[60] = totalHeight;
1487
+ $[61] = t21;
1488
+ $[62] = t22;
1384
1489
  } else {
1385
- t21 = $[59];
1386
- t22 = $[60];
1490
+ t21 = $[61];
1491
+ t22 = $[62];
1387
1492
  }
1388
1493
  const t23 = ticks.map((tk, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", {
1389
1494
  x1: tk.x,
@@ -1393,16 +1498,16 @@ function GanttChart(t0) {
1393
1498
  className: `tick-vline ${tk.major ? "tick-major" : "tick-minor"}`
1394
1499
  }, i));
1395
1500
  let t24;
1396
- if ($[61] !== t23) {
1501
+ if ($[63] !== t23) {
1397
1502
  t24 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", {
1398
1503
  transform: `translate(${PROJECTS_WIDTH},0)`,
1399
1504
  children: t23
1400
1505
  });
1401
- $[61] = t23;
1402
- $[62] = t24;
1403
- } else t24 = $[62];
1506
+ $[63] = t23;
1507
+ $[64] = t24;
1508
+ } else t24 = $[64];
1404
1509
  let t25;
1405
- if ($[63] !== bar || $[64] !== onSelect || $[65] !== onToggleExpanded || $[66] !== selectedId || $[67] !== width || $[68] !== xFor) {
1510
+ if ($[65] !== bar || $[66] !== onSelect || $[67] !== onToggleExpanded || $[68] !== selectedId || $[69] !== width || $[70] !== xFor) {
1406
1511
  t25 = (g, gi) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { children: [
1407
1512
  gi > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", {
1408
1513
  x1: 0,
@@ -1431,7 +1536,7 @@ function GanttChart(t0) {
1431
1536
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("title", { children: g.key }), g.projectShort]
1432
1537
  })]
1433
1538
  }),
1434
- g.labels.map(_temp$11),
1539
+ g.labels.map(_temp$13),
1435
1540
  g.placed.map((t26) => {
1436
1541
  const { item, y } = t26;
1437
1542
  const color = SOURCE_COLORS[item.source] || SOURCE_COLORS.other;
@@ -1501,17 +1606,17 @@ function GanttChart(t0) {
1501
1606
  }, item.id);
1502
1607
  })
1503
1608
  ] }, g.key);
1504
- $[63] = bar;
1505
- $[64] = onSelect;
1506
- $[65] = onToggleExpanded;
1507
- $[66] = selectedId;
1508
- $[67] = width;
1509
- $[68] = xFor;
1510
- $[69] = t25;
1511
- } else t25 = $[69];
1609
+ $[65] = bar;
1610
+ $[66] = onSelect;
1611
+ $[67] = onToggleExpanded;
1612
+ $[68] = selectedId;
1613
+ $[69] = width;
1614
+ $[70] = xFor;
1615
+ $[71] = t25;
1616
+ } else t25 = $[71];
1512
1617
  const t26 = groups.map(t25);
1513
1618
  let t27;
1514
- if ($[70] !== t20 || $[71] !== t21 || $[72] !== t22 || $[73] !== t24 || $[74] !== t26 || $[75] !== totalHeight || $[76] !== width) {
1619
+ if ($[72] !== t20 || $[73] !== t21 || $[74] !== t22 || $[75] !== t24 || $[76] !== t26 || $[77] !== totalHeight || $[78] !== width) {
1515
1620
  t27 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", {
1516
1621
  width,
1517
1622
  height: totalHeight,
@@ -1523,27 +1628,27 @@ function GanttChart(t0) {
1523
1628
  t26
1524
1629
  ]
1525
1630
  });
1526
- $[70] = t20;
1527
- $[71] = t21;
1528
- $[72] = t22;
1529
- $[73] = t24;
1530
- $[74] = t26;
1531
- $[75] = totalHeight;
1532
- $[76] = width;
1533
- $[77] = t27;
1534
- } else t27 = $[77];
1631
+ $[72] = t20;
1632
+ $[73] = t21;
1633
+ $[74] = t22;
1634
+ $[75] = t24;
1635
+ $[76] = t26;
1636
+ $[77] = totalHeight;
1637
+ $[78] = width;
1638
+ $[79] = t27;
1639
+ } else t27 = $[79];
1535
1640
  let t28;
1536
- if ($[78] !== availableSources || $[79] !== onToggleSourceFilter || $[80] !== sourceFilter) {
1641
+ if ($[80] !== availableSources || $[81] !== onToggleSourceFilter || $[82] !== sourceFilter) {
1537
1642
  t28 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SourceLegend, {
1538
1643
  sources: availableSources,
1539
1644
  filter: sourceFilter,
1540
1645
  onToggle: onToggleSourceFilter
1541
1646
  });
1542
- $[78] = availableSources;
1543
- $[79] = onToggleSourceFilter;
1544
- $[80] = sourceFilter;
1545
- $[81] = t28;
1546
- } else t28 = $[81];
1647
+ $[80] = availableSources;
1648
+ $[81] = onToggleSourceFilter;
1649
+ $[82] = sourceFilter;
1650
+ $[83] = t28;
1651
+ } else t28 = $[83];
1547
1652
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
1548
1653
  className: "gantt-wrap",
1549
1654
  children: [
@@ -1581,7 +1686,7 @@ function GanttChart(t0) {
1581
1686
  ]
1582
1687
  });
1583
1688
  }
1584
- function _temp$11(l) {
1689
+ function _temp$13(l) {
1585
1690
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("text", {
1586
1691
  x: l.x,
1587
1692
  y: l.y,
@@ -1602,6 +1707,11 @@ function endOfPeriod(ts, granularity) {
1602
1707
  if (granularity === "month") return +endOfMonth(ts);
1603
1708
  return +endOfDay(ts);
1604
1709
  }
1710
+ function periodTitle(anchor, granularity) {
1711
+ if (granularity === "week") return `${format(anchor, "MMM d")} – ${format(endOfPeriod(anchor, "week"), "MMM d")}`;
1712
+ if (granularity === "month") return format(anchor, "MMMM yyyy");
1713
+ return format(anchor, "EEE, MMM d");
1714
+ }
1605
1715
  function addPeriod(ts, granularity, delta) {
1606
1716
  if (granularity === "week") return +addWeeks(ts, delta);
1607
1717
  if (granularity === "month") return +addMonths(ts, delta);
@@ -1648,11 +1758,6 @@ var RESET_LABELS = {
1648
1758
  week: "This week",
1649
1759
  month: "This month"
1650
1760
  };
1651
- function periodTitle(anchor, granularity) {
1652
- if (granularity === "week") return `${format(anchor, "MMM d")} – ${format(endOfPeriod(anchor, "week"), "MMM d")}`;
1653
- if (granularity === "month") return format(anchor, "MMMM yyyy");
1654
- return format(anchor, "EEE, MMM d");
1655
- }
1656
1761
  function Toolbar(t0) {
1657
1762
  const $ = (0, import_compiler_runtime.c)(37);
1658
1763
  const { granularity, onSetGranularity, dayAnchor, onShiftDay, onResetToday } = t0;
@@ -1808,48 +1913,6 @@ function Toolbar(t0) {
1808
1913
  } else t17 = $[36];
1809
1914
  return t17;
1810
1915
  }
1811
- // src/renderer/utils/formatting.js
1812
- function fmtDuration(ms) {
1813
- if (!ms || ms < 0) return "—";
1814
- if (ms < 6e4) return `${Math.round(ms / 1e3)}s`;
1815
- const { hours = 0, minutes = 0, seconds = 0 } = intervalToDuration({
1816
- start: 0,
1817
- end: ms
1818
- });
1819
- if (!hours) return `${minutes}m ${seconds}s`;
1820
- return `${hours}h ${minutes}m`;
1821
- }
1822
- function fmtAgo(date) {
1823
- const min = Math.floor((Date.now() - new Date(date)) / 6e4);
1824
- if (min < 1) return "now";
1825
- if (min < 60) return `${min}m`;
1826
- if (min < 1440) return `${Math.floor(min / 60)}h`;
1827
- return `${Math.floor(min / 1440)}d`;
1828
- }
1829
- function fmtNum(n) {
1830
- if (n == null) return "—";
1831
- return n.toLocaleString();
1832
- }
1833
- var plural = (n, noun) => `${n} ${noun}${n === 1 ? "" : "s"}`;
1834
- function fmtToolCalls({ toolCalls, skillCalls }) {
1835
- return skillCalls ? `${fmtNum(toolCalls)}, ${fmtNum(skillCalls)} skill${skillCalls === 1 ? "" : "s"}` : fmtNum(toolCalls);
1836
- }
1837
- function fmtUSD(n) {
1838
- if (n == null) return "—";
1839
- return `$${n.toFixed(2)}`;
1840
- }
1841
- function tone(value, { warn, danger }) {
1842
- if (value >= danger) return "danger";
1843
- if (value >= warn) return "warn";
1844
- return "";
1845
- }
1846
- function fmtCompact(n) {
1847
- if (n == null) return "—";
1848
- if (n < 0) return `-${fmtCompact(-n)}`;
1849
- if (n < 100) return `${n}`;
1850
- if (n < 1e6) return `${(n / 1e3).toFixed(1)}k`;
1851
- return `${(n / 1e6).toFixed(1)}M`;
1852
- }
1853
1916
  // src/renderer/utils/thresholds.js
1854
1917
  var HOUR = 36e5;
1855
1918
  var THRESHOLDS = {
@@ -2151,7 +2214,7 @@ function PeriodSummary(t0) {
2151
2214
  ...m,
2152
2215
  value: m[stat] || 0
2153
2216
  }));
2154
- const mixTotal = tokenMix.reduce(_temp$10, 0);
2217
+ const mixTotal = tokenMix.reduce(_temp$12, 0);
2155
2218
  let t3;
2156
2219
  if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
2157
2220
  t3 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
@@ -2279,7 +2342,7 @@ function PeriodSummary(t0) {
2279
2342
  className: "token-mix-bar",
2280
2343
  role: "img",
2281
2344
  "aria-label": tokenMix.map((m_1) => `${m_1.label} ${Math.round(m_1.value / mixTotal * 100)}%`).join(", "),
2282
- children: tokenMix.filter(_temp2$6).map((m_3) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2345
+ children: tokenMix.filter(_temp2$8).map((m_3) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2283
2346
  style: {
2284
2347
  flexGrow: m_3.value / mixTotal,
2285
2348
  background: m_3.color
@@ -2323,10 +2386,10 @@ function PeriodSummary(t0) {
2323
2386
  })]
2324
2387
  });
2325
2388
  }
2326
- function _temp2$6(m_2) {
2389
+ function _temp2$8(m_2) {
2327
2390
  return m_2.value > 0;
2328
2391
  }
2329
- function _temp$10(sum, m_0) {
2392
+ function _temp$12(sum, m_0) {
2330
2393
  return sum + m_0.value;
2331
2394
  }
2332
2395
  // src/shared/listings.js
@@ -2550,6 +2613,34 @@ function genericAttachment(att) {
2550
2613
  var renderedText = (rendered) => (rendered ?? []).map((r) => r?.content).filter((c) => typeof c === "string").join("\n").replace(/<\/?system-reminder>/g, "").trim();
2551
2614
  var attachmentView = (att, rendered) => (ATTACHMENT_RENDERERS[att?.type] ?? genericAttachment)(att, renderedText(rendered));
2552
2615
  var hasText = (view) => view.body != null && !view.raw;
2616
+ var blockView = (b) => attachmentView(b.attachment, b.rendered);
2617
+ var isCounted = (b) => b.type === "attachment" && !b.unsent && hasText(blockView(b));
2618
+ var TOOL_KINDS = {
2619
+ "System Tools": "system",
2620
+ "MCP Tools": "MCP",
2621
+ "Deferred Tools": "deferred"
2622
+ };
2623
+ var GROUP_TITLES = {
2624
+ prompt: (blocks) => blocks.every((b) => b.type === "attachment") ? "Output style" : blocks.some((b) => b.type === "attachment") ? "System Prompt (+ output style)" : "System Prompt",
2625
+ tools: (blocks) => {
2626
+ const counts = {
2627
+ system: 0,
2628
+ MCP: 0,
2629
+ deferred: 0
2630
+ };
2631
+ for (const b of blocks) counts[TOOL_KINDS[b.it?.file_path] ?? "deferred"] += b.it?.count ?? b.attachment?.addedNames?.length ?? 0;
2632
+ const listed = Object.entries(counts).filter(([, n]) => n).map(([kind, n]) => `${n} ${kind}`);
2633
+ return listed.length ? `Tools: ${listed.join(", ")}` : "Deferred tools";
2634
+ },
2635
+ mcp: () => "MCP instructions",
2636
+ memory: (blocks) => `Memory files: ${plural(blocks.length, "file")}`,
2637
+ listings: (blocks) => `Skills & agents: ${blocks.map((b) => b.it?.memory_type ?? blockView(b).title.trim()).join(", ")}`,
2638
+ context: (blocks) => {
2639
+ const sent = blocks.filter((b) => b.type === "instruction" || isCounted(b));
2640
+ return `Session context: ${[...new Set(sent.map((b) => (b.it?.file_path ?? humanize(b.attachment.type)).toLowerCase()))].join(", ")}`;
2641
+ }
2642
+ };
2643
+ var groupTitle = (key, blocks) => GROUP_TITLES[key](blocks);
2553
2644
  // src/renderer/utils/activity.js
2554
2645
  var LIVE = 6e4;
2555
2646
  var ACTIVE = 3e5;
@@ -2576,6 +2667,62 @@ var useActivity = (at) => {
2576
2667
  } else t2 = $[4];
2577
2668
  return t2;
2578
2669
  };
2670
+ // src/renderer/experiments/ExperimentTag.jsx
2671
+ function ExperimentTag(t0) {
2672
+ const $ = (0, import_compiler_runtime.c)(15);
2673
+ const { session, onOpen } = t0;
2674
+ if (!session.experiment) return null;
2675
+ let t1;
2676
+ if ($[0] !== session.experiment) {
2677
+ t1 = experimentColor(session.experiment);
2678
+ $[0] = session.experiment;
2679
+ $[1] = t1;
2680
+ } else t1 = $[1];
2681
+ let t2;
2682
+ if ($[2] !== t1) {
2683
+ t2 = { color: t1 };
2684
+ $[2] = t1;
2685
+ $[3] = t2;
2686
+ } else t2 = $[3];
2687
+ let t3;
2688
+ if ($[4] !== session.experiment || $[5] !== session.experimentName) {
2689
+ t3 = experimentTip(session.experiment, session.experimentName, "Click for its details");
2690
+ $[4] = session.experiment;
2691
+ $[5] = session.experimentName;
2692
+ $[6] = t3;
2693
+ } else t3 = $[6];
2694
+ let t4;
2695
+ if ($[7] !== onOpen || $[8] !== session.experiment) {
2696
+ t4 = (e) => {
2697
+ e.stopPropagation();
2698
+ onOpen(session.experiment);
2699
+ };
2700
+ $[7] = onOpen;
2701
+ $[8] = session.experiment;
2702
+ $[9] = t4;
2703
+ } else t4 = $[9];
2704
+ let t5;
2705
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
2706
+ t5 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FlaskConical, { size: 11 });
2707
+ $[10] = t5;
2708
+ } else t5 = $[10];
2709
+ let t6;
2710
+ if ($[11] !== t2 || $[12] !== t3 || $[13] !== t4) {
2711
+ t6 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2712
+ className: "experiment-tag",
2713
+ role: "button",
2714
+ style: t2,
2715
+ "data-tooltip-content": t3,
2716
+ onClick: t4,
2717
+ children: t5
2718
+ });
2719
+ $[11] = t2;
2720
+ $[12] = t3;
2721
+ $[13] = t4;
2722
+ $[14] = t6;
2723
+ } else t6 = $[14];
2724
+ return t6;
2725
+ }
2579
2726
  // src/renderer/sessions/SessionList.jsx
2580
2727
  var TIPS = {
2581
2728
  cache: {
@@ -2585,7 +2732,8 @@ var TIPS = {
2585
2732
  context: `Consider keeping it below ${fmtCompact(THRESHOLDS.context.warn)} tokens`,
2586
2733
  messages: `Consider sessions below ${fmtCompact(THRESHOLDS.messages.warn)} messages`,
2587
2734
  time: `Consider sessions under ${THRESHOLDS.workTime.warn / 6e4}m`,
2588
- effort: "Thinks longer and spends more output tokens than high"
2735
+ effort: "Thinks longer and spends more output tokens than high",
2736
+ debug: "Run with --debug"
2589
2737
  };
2590
2738
  var EFFORT_BADGE = {
2591
2739
  xhigh: "warn-badge",
@@ -2726,7 +2874,7 @@ var ProjectModels = (t0) => {
2726
2874
  if ($[4] !== efforts || $[5] !== models) {
2727
2875
  t2 = models?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
2728
2876
  className: "session-model",
2729
- children: [models.map(_temp$9).join(", "), efforts?.length > 0 && ` ${efforts.join(", ")}`]
2877
+ children: [models.map(_temp$11).join(", "), efforts?.length > 0 && ` ${efforts.join(", ")}`]
2730
2878
  });
2731
2879
  $[4] = efforts;
2732
2880
  $[5] = models;
@@ -2782,12 +2930,12 @@ function groupRuns(sorted) {
2782
2930
  })]);
2783
2931
  }
2784
2932
  function SessionList(t0) {
2785
- const $ = (0, import_compiler_runtime.c)(89);
2786
- const { sessions, selectedId, deepLink, onSelect } = t0;
2933
+ const $ = (0, import_compiler_runtime.c)(94);
2934
+ const { sessions, selectedId, deepLink, onSelect, onOpenExperiment } = t0;
2787
2935
  const selectedRef = (0, import_react.useRef)(null);
2788
2936
  const [sortBy, setSortBy] = useLocalStorage("session-list.sort", "time");
2789
2937
  const [filter, setFilter] = (0, import_react.useState)("");
2790
- const [expanded, setExpanded] = (0, import_react.useState)(_temp2$5);
2938
+ const [expanded, setExpanded] = (0, import_react.useState)(_temp2$7);
2791
2939
  let t1;
2792
2940
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
2793
2941
  t1 = () => {
@@ -2804,12 +2952,12 @@ function SessionList(t0) {
2804
2952
  (0, import_react.useEffect)(t1, t2);
2805
2953
  let t3;
2806
2954
  if ($[3] !== sessions) {
2807
- t3 = () => lastChange(sessions.map(_temp3$4));
2955
+ t3 = () => lastChange(sessions.map(_temp3$5));
2808
2956
  $[3] = sessions;
2809
2957
  $[4] = t3;
2810
2958
  } else t3 = $[4];
2811
2959
  const now = useClock(t3);
2812
- const labelCommand = _temp4$4;
2960
+ const labelCommand = _temp4$5;
2813
2961
  let t4;
2814
2962
  if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
2815
2963
  t4 = (s_1) => {
@@ -2859,71 +3007,85 @@ function SessionList(t0) {
2859
3007
  const sorted = t6;
2860
3008
  let t10;
2861
3009
  let t11;
3010
+ let t12;
3011
+ let t13;
2862
3012
  let t7;
2863
3013
  let t8;
2864
3014
  let t9;
2865
- if ($[13] !== deepLink || $[14] !== expanded || $[15] !== filter || $[16] !== filtered || $[17] !== now || $[18] !== onSelect || $[19] !== q || $[20] !== selectedId || $[21] !== sessions.length || $[22] !== setSortBy || $[23] !== sortBy || $[24] !== sorted) {
3015
+ if ($[13] !== deepLink || $[14] !== expanded || $[15] !== filter || $[16] !== filtered || $[17] !== now || $[18] !== onOpenExperiment || $[19] !== onSelect || $[20] !== q || $[21] !== selectedId || $[22] !== sessions.length || $[23] !== setSortBy || $[24] !== sortBy || $[25] !== sorted) {
2866
3016
  const grouped = groupRuns(sorted);
2867
3017
  const selectedRun = grouped.find((i) => i.runKey && i.session?.filePath === selectedId)?.runKey;
2868
3018
  const isOpen = (key) => expanded.get(key) ?? key === selectedRun;
2869
- let t12;
2870
- if ($[30] !== isOpen) {
2871
- t12 = (key_0) => setExpanded((prev) => new Map(prev).set(key_0, !isOpen(key_0)));
2872
- $[30] = isOpen;
2873
- $[31] = t12;
2874
- } else t12 = $[31];
2875
- const toggleRun = t12;
2876
- let t13;
2877
- if ($[32] !== isOpen) {
2878
- t13 = (i_0) => i_0.run || !i_0.runKey || isOpen(i_0.runKey);
2879
- $[32] = isOpen;
2880
- $[33] = t13;
2881
- } else t13 = $[33];
2882
- const rows = grouped.filter(t13);
2883
- t10 = "session-list";
2884
- const t14 = `filter${q ? " filter-active" : ""}`;
3019
+ let t14;
3020
+ if ($[33] !== isOpen) {
3021
+ t14 = (key_0) => setExpanded((prev) => new Map(prev).set(key_0, !isOpen(key_0)));
3022
+ $[33] = isOpen;
3023
+ $[34] = t14;
3024
+ } else t14 = $[34];
3025
+ const toggleRun = t14;
2885
3026
  let t15;
2886
- if ($[34] === Symbol.for("react.memo_cache_sentinel")) {
2887
- t15 = (e) => setFilter(e.target.value);
2888
- $[34] = t15;
2889
- } else t15 = $[34];
2890
- let t16;
2891
- if ($[35] !== filter || $[36] !== t14) {
2892
- t16 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", {
2893
- className: t14,
3027
+ if ($[35] !== isOpen) {
3028
+ t15 = (i_0) => i_0.run || !i_0.runKey || isOpen(i_0.runKey);
3029
+ $[35] = isOpen;
3030
+ $[36] = t15;
3031
+ } else t15 = $[36];
3032
+ const rows = grouped.filter(t15);
3033
+ const moveSelection = (e) => {
3034
+ const step = {
3035
+ ArrowDown: 1,
3036
+ ArrowUp: -1
3037
+ }[e.key];
3038
+ const visible = rows.flatMap(_temp7$1);
3039
+ const current = visible.findIndex((s_3) => s_3.filePath === selectedId);
3040
+ if (!step || current < 0) return;
3041
+ e.preventDefault();
3042
+ const next = visible[current + step];
3043
+ if (next) onSelect(next.filePath);
3044
+ };
3045
+ t12 = "session-list";
3046
+ const t16 = `filter${q ? " filter-active" : ""}`;
3047
+ let t17;
3048
+ if ($[37] === Symbol.for("react.memo_cache_sentinel")) {
3049
+ t17 = (e_0) => setFilter(e_0.target.value);
3050
+ $[37] = t17;
3051
+ } else t17 = $[37];
3052
+ let t18;
3053
+ if ($[38] !== filter || $[39] !== t16) {
3054
+ t18 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", {
3055
+ className: t16,
2894
3056
  placeholder: "Filter sessions…",
2895
3057
  value: filter,
2896
- onChange: t15
3058
+ onChange: t17
2897
3059
  });
2898
- $[35] = filter;
2899
- $[36] = t14;
2900
- $[37] = t16;
2901
- } else t16 = $[37];
2902
- let t17;
2903
- if ($[38] !== filter) {
2904
- t17 = filter && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
3060
+ $[38] = filter;
3061
+ $[39] = t16;
3062
+ $[40] = t18;
3063
+ } else t18 = $[40];
3064
+ let t19;
3065
+ if ($[41] !== filter) {
3066
+ t19 = filter && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
2905
3067
  type: "button",
2906
3068
  className: "filter-clear",
2907
3069
  "aria-label": "Clear filter",
2908
3070
  onClick: () => setFilter(""),
2909
3071
  children: "×"
2910
3072
  });
2911
- $[38] = filter;
2912
- $[39] = t17;
2913
- } else t17 = $[39];
2914
- let t18;
2915
- if ($[40] !== t16 || $[41] !== t17) {
2916
- t18 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3073
+ $[41] = filter;
3074
+ $[42] = t19;
3075
+ } else t19 = $[42];
3076
+ let t20;
3077
+ if ($[43] !== t18 || $[44] !== t19) {
3078
+ t20 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2917
3079
  className: "filter-wrap",
2918
- children: [t16, t17]
3080
+ children: [t18, t19]
2919
3081
  });
2920
- $[40] = t16;
2921
- $[41] = t17;
2922
- $[42] = t18;
2923
- } else t18 = $[42];
2924
- let t19;
2925
- if ($[43] !== filtered || $[44] !== q || $[45] !== sessions.length) {
2926
- t19 = q && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
3082
+ $[43] = t18;
3083
+ $[44] = t19;
3084
+ $[45] = t20;
3085
+ } else t20 = $[45];
3086
+ let t21;
3087
+ if ($[46] !== filtered || $[47] !== q || $[48] !== sessions.length) {
3088
+ t21 = q && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
2927
3089
  className: "filter-count",
2928
3090
  children: [
2929
3091
  "Filtered ",
@@ -2932,145 +3094,147 @@ function SessionList(t0) {
2932
3094
  sessions.length
2933
3095
  ]
2934
3096
  });
2935
- $[43] = filtered;
2936
- $[44] = q;
2937
- $[45] = sessions.length;
2938
- $[46] = t19;
2939
- } else t19 = $[46];
2940
- let t20;
2941
- if ($[47] === Symbol.for("react.memo_cache_sentinel")) {
2942
- t20 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
3097
+ $[46] = filtered;
3098
+ $[47] = q;
3099
+ $[48] = sessions.length;
3100
+ $[49] = t21;
3101
+ } else t21 = $[49];
3102
+ let t22;
3103
+ if ($[50] === Symbol.for("react.memo_cache_sentinel")) {
3104
+ t22 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2943
3105
  className: "sort-toggle-label",
2944
3106
  children: "Sort by:"
2945
3107
  });
2946
- $[47] = t20;
2947
- } else t20 = $[47];
2948
- const t21 = `sort-pill ${sortBy === "time" ? "active" : ""}`;
2949
- let t22;
2950
- if ($[48] !== setSortBy) {
2951
- t22 = () => setSortBy("time");
2952
- $[48] = setSortBy;
2953
- $[49] = t22;
2954
- } else t22 = $[49];
2955
- let t23;
2956
- if ($[50] !== t21 || $[51] !== t22) {
2957
- t23 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
3108
+ $[50] = t22;
3109
+ } else t22 = $[50];
3110
+ const t23 = `sort-pill ${sortBy === "time" ? "active" : ""}`;
3111
+ let t24;
3112
+ if ($[51] !== setSortBy) {
3113
+ t24 = () => setSortBy("time");
3114
+ $[51] = setSortBy;
3115
+ $[52] = t24;
3116
+ } else t24 = $[52];
3117
+ let t25;
3118
+ if ($[53] !== t23 || $[54] !== t24) {
3119
+ t25 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
2958
3120
  type: "button",
2959
- className: t21,
2960
- onClick: t22,
3121
+ className: t23,
3122
+ onClick: t24,
2961
3123
  children: "Time"
2962
3124
  });
2963
- $[50] = t21;
2964
- $[51] = t22;
2965
- $[52] = t23;
2966
- } else t23 = $[52];
2967
- const t24 = `sort-pill ${sortBy === "name" ? "active" : ""}`;
2968
- let t25;
2969
- if ($[53] !== setSortBy) {
2970
- t25 = () => setSortBy("name");
2971
- $[53] = setSortBy;
2972
- $[54] = t25;
2973
- } else t25 = $[54];
2974
- let t26;
2975
- if ($[55] !== t24 || $[56] !== t25) {
2976
- t26 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
3125
+ $[53] = t23;
3126
+ $[54] = t24;
3127
+ $[55] = t25;
3128
+ } else t25 = $[55];
3129
+ const t26 = `sort-pill ${sortBy === "name" ? "active" : ""}`;
3130
+ let t27;
3131
+ if ($[56] !== setSortBy) {
3132
+ t27 = () => setSortBy("name");
3133
+ $[56] = setSortBy;
3134
+ $[57] = t27;
3135
+ } else t27 = $[57];
3136
+ let t28;
3137
+ if ($[58] !== t26 || $[59] !== t27) {
3138
+ t28 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
2977
3139
  type: "button",
2978
- className: t24,
2979
- onClick: t25,
3140
+ className: t26,
3141
+ onClick: t27,
2980
3142
  children: "Name"
2981
3143
  });
2982
- $[55] = t24;
2983
- $[56] = t25;
2984
- $[57] = t26;
2985
- } else t26 = $[57];
2986
- const t27 = `sort-pill ${sortBy === "cost" ? "active" : ""}`;
2987
- let t28;
2988
- if ($[58] !== setSortBy) {
2989
- t28 = () => setSortBy("cost");
2990
- $[58] = setSortBy;
2991
- $[59] = t28;
2992
- } else t28 = $[59];
2993
- let t29;
2994
- if ($[60] !== t27 || $[61] !== t28) {
2995
- t29 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
3144
+ $[58] = t26;
3145
+ $[59] = t27;
3146
+ $[60] = t28;
3147
+ } else t28 = $[60];
3148
+ const t29 = `sort-pill ${sortBy === "cost" ? "active" : ""}`;
3149
+ let t30;
3150
+ if ($[61] !== setSortBy) {
3151
+ t30 = () => setSortBy("cost");
3152
+ $[61] = setSortBy;
3153
+ $[62] = t30;
3154
+ } else t30 = $[62];
3155
+ let t31;
3156
+ if ($[63] !== t29 || $[64] !== t30) {
3157
+ t31 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
2996
3158
  type: "button",
2997
- className: t27,
2998
- onClick: t28,
3159
+ className: t29,
3160
+ onClick: t30,
2999
3161
  children: "Cost"
3000
3162
  });
3001
- $[60] = t27;
3002
- $[61] = t28;
3003
- $[62] = t29;
3004
- } else t29 = $[62];
3005
- const t30 = `sort-pill ${sortBy === "tokens" ? "active" : ""}`;
3006
- let t31;
3007
- if ($[63] !== setSortBy) {
3008
- t31 = () => setSortBy("tokens");
3009
- $[63] = setSortBy;
3010
- $[64] = t31;
3011
- } else t31 = $[64];
3012
- let t32;
3013
- if ($[65] !== t30 || $[66] !== t31) {
3014
- t32 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
3163
+ $[63] = t29;
3164
+ $[64] = t30;
3165
+ $[65] = t31;
3166
+ } else t31 = $[65];
3167
+ const t32 = `sort-pill ${sortBy === "tokens" ? "active" : ""}`;
3168
+ let t33;
3169
+ if ($[66] !== setSortBy) {
3170
+ t33 = () => setSortBy("tokens");
3171
+ $[66] = setSortBy;
3172
+ $[67] = t33;
3173
+ } else t33 = $[67];
3174
+ let t34;
3175
+ if ($[68] !== t32 || $[69] !== t33) {
3176
+ t34 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
3015
3177
  type: "button",
3016
- className: t30,
3017
- onClick: t31,
3178
+ className: t32,
3179
+ onClick: t33,
3018
3180
  children: "Tokens"
3019
3181
  });
3020
- $[65] = t30;
3021
- $[66] = t31;
3022
- $[67] = t32;
3023
- } else t32 = $[67];
3024
- let t33;
3025
- if ($[68] !== t23 || $[69] !== t26 || $[70] !== t29 || $[71] !== t32) {
3026
- t33 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3182
+ $[68] = t32;
3183
+ $[69] = t33;
3184
+ $[70] = t34;
3185
+ } else t34 = $[70];
3186
+ let t35;
3187
+ if ($[71] !== t25 || $[72] !== t28 || $[73] !== t31 || $[74] !== t34) {
3188
+ t35 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3027
3189
  className: "sort-toggle",
3028
3190
  role: "group",
3029
3191
  "aria-label": "Sort sessions",
3030
3192
  children: [
3031
- t20,
3032
- t23,
3033
- t26,
3034
- t29,
3035
- t32
3193
+ t22,
3194
+ t25,
3195
+ t28,
3196
+ t31,
3197
+ t34
3036
3198
  ]
3037
3199
  });
3038
- $[68] = t23;
3039
- $[69] = t26;
3040
- $[70] = t29;
3041
- $[71] = t32;
3042
- $[72] = t33;
3043
- } else t33 = $[72];
3044
- let t34;
3045
- if ($[73] !== t19 || $[74] !== t33) {
3046
- t34 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3200
+ $[71] = t25;
3201
+ $[72] = t28;
3202
+ $[73] = t31;
3203
+ $[74] = t34;
3204
+ $[75] = t35;
3205
+ } else t35 = $[75];
3206
+ let t36;
3207
+ if ($[76] !== t21 || $[77] !== t35) {
3208
+ t36 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3047
3209
  className: "session-list-header-row",
3048
- children: [t19, t33]
3210
+ children: [t21, t35]
3049
3211
  });
3050
- $[73] = t19;
3051
- $[74] = t33;
3052
- $[75] = t34;
3053
- } else t34 = $[75];
3054
- if ($[76] !== t18 || $[77] !== t34) {
3055
- t11 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3212
+ $[76] = t21;
3213
+ $[77] = t35;
3214
+ $[78] = t36;
3215
+ } else t36 = $[78];
3216
+ if ($[79] !== t20 || $[80] !== t36) {
3217
+ t13 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3056
3218
  className: "session-list-header",
3057
- children: [t18, t34]
3219
+ children: [t20, t36]
3058
3220
  });
3059
- $[76] = t18;
3060
- $[77] = t34;
3061
- $[78] = t11;
3062
- } else t11 = $[78];
3221
+ $[79] = t20;
3222
+ $[80] = t36;
3223
+ $[81] = t13;
3224
+ } else t13 = $[81];
3063
3225
  t7 = "session-list-scroll";
3064
- if ($[79] !== sorted.length) {
3065
- t8 = sorted.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
3226
+ t8 = 0;
3227
+ t9 = moveSelection;
3228
+ if ($[82] !== sorted.length) {
3229
+ t10 = sorted.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
3066
3230
  className: "empty",
3067
3231
  children: "No sessions on this day."
3068
3232
  });
3069
- $[79] = sorted.length;
3070
- $[80] = t8;
3071
- } else t8 = $[80];
3072
- t9 = rows.map((t35, i_1) => {
3073
- const { session: s_3, run, runKey } = t35;
3233
+ $[82] = sorted.length;
3234
+ $[83] = t10;
3235
+ } else t10 = $[83];
3236
+ t11 = rows.map((t37, i_1) => {
3237
+ const { session: s_4, run, runKey } = t37;
3074
3238
  const branch = rows[i_1 + 1]?.runKey ? runKey ? "branch-below" : "branch-start" : "";
3075
3239
  if (run) {
3076
3240
  const isCollapsed = !isOpen(runKey);
@@ -3079,7 +3243,7 @@ function SessionList(t0) {
3079
3243
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
3080
3244
  type: "button",
3081
3245
  ref: hidesSelected ? selectedRef : null,
3082
- className: `session-row subagent-run ${branch} ${hidesSelected ? "selected" : ""} ${activity(Math.max(...run.map(_temp7$1)), now)}`,
3246
+ className: `session-row subagent-run ${branch} ${hidesSelected ? "selected" : ""} ${activity(Math.max(...run.map(_temp8$1)), now)}`,
3083
3247
  "aria-expanded": !isCollapsed,
3084
3248
  onClick: () => toggleRun(runKey),
3085
3249
  children: [
@@ -3103,12 +3267,12 @@ function SessionList(t0) {
3103
3267
  className: "session-time-bottom",
3104
3268
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProjectModels, {
3105
3269
  ...run[0],
3106
- models: [...new Set(run.flatMap(_temp8$1))],
3107
- efforts: [...new Set(run.flatMap(_temp9$1))]
3270
+ models: [...new Set(run.flatMap(_temp9$1))],
3271
+ efforts: [...new Set(run.flatMap(_temp10$1))]
3108
3272
  })
3109
3273
  }),
3110
3274
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RowStats, {
3111
- at: Math.max(...run.map(_temp10$1)),
3275
+ at: Math.max(...run.map(_temp11$1)),
3112
3276
  tokens: sumOf(run, "totalTokens"),
3113
3277
  cost: sumOf(run, "cost"),
3114
3278
  sortBy
@@ -3116,46 +3280,50 @@ function SessionList(t0) {
3116
3280
  ]
3117
3281
  }, runKey);
3118
3282
  }
3119
- const journal = isJournal(s_3);
3120
- const isFork = !!s_3.forkedFrom;
3121
- const linked = !!deepLink && s_3.filePath === selectedId;
3122
- const command = labelCommand(s_3);
3283
+ const journal = isJournal(s_4);
3284
+ const isFork = !!s_4.forkedFrom;
3285
+ const linked = !!deepLink && s_4.filePath === selectedId;
3286
+ const command = labelCommand(s_4);
3123
3287
  const commandName = command && (command.name || command.message);
3124
3288
  const commandArgs = command && command.args.trim();
3125
- const advice = cacheAdvice(s_3);
3126
- const topEffort = ["max", "xhigh"].find((e_0) => s_3.efforts?.includes(e_0));
3127
- const sessionName = s_3.customTitle && s_3.agentName && s_3.customTitle !== s_3.agentName ? `${s_3.customTitle} [${s_3.agentName}]` : s_3.customTitle || s_3.agentName || "";
3289
+ const advice = cacheAdvice(s_4);
3290
+ const topEffort = ["max", "xhigh"].find((e_1) => s_4.efforts?.includes(e_1));
3291
+ const sessionName = s_4.customTitle && s_4.agentName && s_4.customTitle !== s_4.agentName ? `${s_4.customTitle} [${s_4.agentName}]` : s_4.customTitle || s_4.agentName || "";
3128
3292
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3129
- ref: selectedId === s_3.filePath ? selectedRef : null,
3130
- className: `session-row ${branch} ${selectedId === s_3.filePath ? "selected" : ""} ${runKey ? "is-subagent-child" : ""} ${linked ? "deep-linked" : ""} ${activity(s_3.lastActivityAt, now)}`,
3131
- onClick: () => onSelect(selectedId === s_3.filePath ? null : s_3.filePath),
3293
+ ref: selectedId === s_4.filePath ? selectedRef : null,
3294
+ className: `session-row ${branch} ${selectedId === s_4.filePath ? "selected" : ""} ${runKey ? "is-subagent-child" : ""} ${linked ? "deep-linked" : ""} ${activity(s_4.lastActivityAt, now)}`,
3295
+ onClick: () => onSelect(selectedId === s_4.filePath ? null : s_4.filePath),
3132
3296
  children: [
3133
3297
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
3134
3298
  className: "session-label",
3135
3299
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
3136
3300
  className: "session-label-text",
3137
- children: command ? commandArgs || commandName : sessionLabel(s_3)
3301
+ children: command ? commandArgs || commandName : sessionLabel(s_4)
3138
3302
  })
3139
3303
  }),
3140
3304
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3141
3305
  className: "session-time-bottom",
3142
3306
  children: [
3307
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ExperimentTag, {
3308
+ session: s_4,
3309
+ onOpen: onOpenExperiment
3310
+ }),
3143
3311
  journal && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
3144
3312
  className: "subagent-tag",
3145
3313
  children: [
3146
3314
  "[journal: ",
3147
- s_3.workflowAgents,
3315
+ s_4.workflowAgents,
3148
3316
  " subagent",
3149
- s_3.workflowAgents === 1 ? "" : "s",
3317
+ s_4.workflowAgents === 1 ? "" : "s",
3150
3318
  "]"
3151
3319
  ]
3152
3320
  }),
3153
- s_3.worktree && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
3321
+ s_4.worktree && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
3154
3322
  className: "worktree-tag",
3155
- "data-tooltip-content": `Worktree of ${s_3.projectShort}`,
3323
+ "data-tooltip-content": `Worktree of ${s_4.projectShort}`,
3156
3324
  children: [
3157
3325
  "[",
3158
- s_3.worktree,
3326
+ s_4.worktree,
3159
3327
  "]"
3160
3328
  ]
3161
3329
  }),
@@ -3163,7 +3331,7 @@ function SessionList(t0) {
3163
3331
  className: "fork-tag",
3164
3332
  role: "img",
3165
3333
  "aria-label": "Forked",
3166
- "data-tooltip-content": `Forked from session ${s_3.forkedFrom.sessionId}`,
3334
+ "data-tooltip-content": `Forked from session ${s_4.forkedFrom.sessionId}`,
3167
3335
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(GitBranch, { size: 12 })
3168
3336
  }),
3169
3337
  sessionName && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
@@ -3174,11 +3342,11 @@ function SessionList(t0) {
3174
3342
  className: "session-command",
3175
3343
  children: commandName
3176
3344
  }),
3177
- s_3.tag && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
3345
+ s_4.tag && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
3178
3346
  className: "session-tag",
3179
- children: ["#", s_3.tag]
3347
+ children: ["#", s_4.tag]
3180
3348
  }),
3181
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProjectModels, { ...s_3 }),
3349
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProjectModels, { ...s_4 }),
3182
3350
  linked && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
3183
3351
  className: "deeplink-note",
3184
3352
  children: "opened from deep link"
@@ -3188,40 +3356,40 @@ function SessionList(t0) {
3188
3356
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3189
3357
  className: "session-row-badges",
3190
3358
  children: [
3191
- s_3.avatar && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Suspense, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Avatar, { session: s_3 }) }),
3359
+ s_4.avatar && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Suspense, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Avatar, { session: s_4 }) }),
3192
3360
  advice && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
3193
3361
  className: "warn-badge",
3194
3362
  tip: `−${advice.pct.toFixed(0)}% (${fmtUSD(advice.saving)}) ${CACHE_LABELS[advice.policy]}\n${TIPS.cache[advice.policy]}`,
3195
3363
  text: advice.policy
3196
3364
  }),
3197
- s_3.lastContextTokens > THRESHOLDS.context.danger && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
3365
+ s_4.lastContextTokens > THRESHOLDS.context.danger && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
3198
3366
  className: "danger-badge",
3199
- tip: `Context size: ${fmtCompact(s_3.lastContextTokens)} tokens\n${TIPS.context}`,
3367
+ tip: `Context size: ${fmtCompact(s_4.lastContextTokens)} tokens\n${TIPS.context}`,
3200
3368
  icon: Gauge
3201
3369
  }),
3202
- s_3.lastContextTokens > THRESHOLDS.context.warn && s_3.lastContextTokens <= THRESHOLDS.context.danger && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
3370
+ s_4.lastContextTokens > THRESHOLDS.context.warn && s_4.lastContextTokens <= THRESHOLDS.context.danger && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
3203
3371
  className: "warn-badge",
3204
- tip: `Context size: ${fmtCompact(s_3.lastContextTokens)} tokens\n${TIPS.context}`,
3372
+ tip: `Context size: ${fmtCompact(s_4.lastContextTokens)} tokens\n${TIPS.context}`,
3205
3373
  icon: Gauge
3206
3374
  }),
3207
- s_3.messageCount > THRESHOLDS.messages.danger && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
3375
+ s_4.messageCount > THRESHOLDS.messages.danger && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
3208
3376
  className: "danger-badge",
3209
- tip: `${fmtNum(s_3.messageCount)} messages\n${TIPS.messages}`,
3377
+ tip: `${fmtNum(s_4.messageCount)} messages\n${TIPS.messages}`,
3210
3378
  icon: MessageSquare
3211
3379
  }),
3212
- s_3.messageCount > THRESHOLDS.messages.warn && s_3.messageCount <= THRESHOLDS.messages.danger && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
3380
+ s_4.messageCount > THRESHOLDS.messages.warn && s_4.messageCount <= THRESHOLDS.messages.danger && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
3213
3381
  className: "warn-badge",
3214
- tip: `${fmtNum(s_3.messageCount)} messages\n${TIPS.messages}`,
3382
+ tip: `${fmtNum(s_4.messageCount)} messages\n${TIPS.messages}`,
3215
3383
  icon: MessageSquare
3216
3384
  }),
3217
- s_3.activeMs > THRESHOLDS.workTime.danger && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
3385
+ s_4.activeMs > THRESHOLDS.workTime.danger && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
3218
3386
  className: "danger-badge",
3219
- tip: `Working time: ${fmtDuration(s_3.activeMs)}\n${TIPS.time}`,
3387
+ tip: `Working time: ${fmtDuration(s_4.activeMs)}\n${TIPS.time}`,
3220
3388
  icon: Clock
3221
3389
  }),
3222
- s_3.activeMs > THRESHOLDS.workTime.warn && s_3.activeMs <= THRESHOLDS.workTime.danger && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
3390
+ s_4.activeMs > THRESHOLDS.workTime.warn && s_4.activeMs <= THRESHOLDS.workTime.danger && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
3223
3391
  className: "warn-badge",
3224
- tip: `Working time: ${fmtDuration(s_3.activeMs)}\n${TIPS.time}`,
3392
+ tip: `Working time: ${fmtDuration(s_4.activeMs)}\n${TIPS.time}`,
3225
3393
  icon: Clock
3226
3394
  }),
3227
3395
  topEffort && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
@@ -3229,104 +3397,121 @@ function SessionList(t0) {
3229
3397
  tip: `Effort: ${topEffort}\n${TIPS.effort}`,
3230
3398
  icon: Brain
3231
3399
  }),
3232
- s_3.speed === "fast" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
3233
- className: `fast-badge ${s_3.fastPricingUnknown ? "fast-badge-unknown" : ""}`,
3234
- tip: s_3.fastPricingUnknown ? "Used fast mode — cost is INACCURATE: no fast-mode price multiplier known for this model" : "Used fast mode (speed: fast)",
3400
+ s_4.speed === "fast" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
3401
+ className: `fast-badge ${s_4.fastPricingUnknown ? "fast-badge-unknown" : ""}`,
3402
+ tip: s_4.fastPricingUnknown ? "Used fast mode — cost is INACCURATE: no fast-mode price multiplier known for this model" : "Used fast mode (speed: fast)",
3235
3403
  icon: Zap
3236
3404
  }),
3237
- s_3.priceUnknown && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
3405
+ s_4.priceUnknown && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
3238
3406
  className: "danger-badge",
3239
- tip: `No price entry for ${s_3.models?.join(", ") || "this model"} — cost is missing or understated`,
3407
+ tip: `No price entry for ${s_4.models?.join(", ") || "this model"} — cost is missing or understated`,
3240
3408
  icon: DollarSign
3409
+ }),
3410
+ s_4.debug && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
3411
+ className: "debug-badge",
3412
+ tip: TIPS.debug,
3413
+ icon: Bug
3241
3414
  })
3242
3415
  ]
3243
3416
  }),
3244
3417
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RowStats, {
3245
- at: s_3.lastActivityAt,
3246
- tokens: s_3.totalTokens,
3247
- cost: s_3.cost,
3418
+ at: s_4.lastActivityAt,
3419
+ tokens: s_4.totalTokens,
3420
+ cost: s_4.cost,
3248
3421
  sortBy,
3249
3422
  toned: true
3250
3423
  })
3251
3424
  ]
3252
- }, s_3.filePath);
3425
+ }, s_4.filePath);
3253
3426
  });
3254
3427
  $[13] = deepLink;
3255
3428
  $[14] = expanded;
3256
3429
  $[15] = filter;
3257
3430
  $[16] = filtered;
3258
3431
  $[17] = now;
3259
- $[18] = onSelect;
3260
- $[19] = q;
3261
- $[20] = selectedId;
3262
- $[21] = sessions.length;
3263
- $[22] = setSortBy;
3264
- $[23] = sortBy;
3265
- $[24] = sorted;
3266
- $[25] = t10;
3267
- $[26] = t11;
3268
- $[27] = t7;
3269
- $[28] = t8;
3270
- $[29] = t9;
3432
+ $[18] = onOpenExperiment;
3433
+ $[19] = onSelect;
3434
+ $[20] = q;
3435
+ $[21] = selectedId;
3436
+ $[22] = sessions.length;
3437
+ $[23] = setSortBy;
3438
+ $[24] = sortBy;
3439
+ $[25] = sorted;
3440
+ $[26] = t10;
3441
+ $[27] = t11;
3442
+ $[28] = t12;
3443
+ $[29] = t13;
3444
+ $[30] = t7;
3445
+ $[31] = t8;
3446
+ $[32] = t9;
3271
3447
  } else {
3272
- t10 = $[25];
3273
- t11 = $[26];
3274
- t7 = $[27];
3275
- t8 = $[28];
3276
- t9 = $[29];
3448
+ t10 = $[26];
3449
+ t11 = $[27];
3450
+ t12 = $[28];
3451
+ t13 = $[29];
3452
+ t7 = $[30];
3453
+ t8 = $[31];
3454
+ t9 = $[32];
3277
3455
  }
3278
- let t12;
3279
- if ($[81] !== t7 || $[82] !== t8 || $[83] !== t9) {
3280
- t12 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3456
+ let t14;
3457
+ if ($[84] !== t10 || $[85] !== t11 || $[86] !== t7 || $[87] !== t8 || $[88] !== t9) {
3458
+ t14 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3281
3459
  className: t7,
3282
- children: [t8, t9]
3460
+ tabIndex: t8,
3461
+ onKeyDown: t9,
3462
+ children: [t10, t11]
3283
3463
  });
3284
- $[81] = t7;
3285
- $[82] = t8;
3286
- $[83] = t9;
3287
- $[84] = t12;
3288
- } else t12 = $[84];
3289
- let t13;
3290
- if ($[85] !== t10 || $[86] !== t11 || $[87] !== t12) {
3291
- t13 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3292
- className: t10,
3293
- children: [t11, t12]
3464
+ $[84] = t10;
3465
+ $[85] = t11;
3466
+ $[86] = t7;
3467
+ $[87] = t8;
3468
+ $[88] = t9;
3469
+ $[89] = t14;
3470
+ } else t14 = $[89];
3471
+ let t15;
3472
+ if ($[90] !== t12 || $[91] !== t13 || $[92] !== t14) {
3473
+ t15 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3474
+ className: t12,
3475
+ children: [t13, t14]
3294
3476
  });
3295
- $[85] = t10;
3296
- $[86] = t11;
3297
- $[87] = t12;
3298
- $[88] = t13;
3299
- } else t13 = $[88];
3300
- return t13;
3477
+ $[90] = t12;
3478
+ $[91] = t13;
3479
+ $[92] = t14;
3480
+ $[93] = t15;
3481
+ } else t15 = $[93];
3482
+ return t15;
3301
3483
  }
3302
- function _temp10$1(c_3) {
3484
+ function _temp11$1(c_3) {
3303
3485
  return c_3.lastActivityAt;
3304
3486
  }
3305
- function _temp9$1(c_2) {
3487
+ function _temp10$1(c_2) {
3306
3488
  return c_2.efforts ?? [];
3307
3489
  }
3308
- function _temp8$1(c_1) {
3490
+ function _temp9$1(c_1) {
3309
3491
  return c_1.models ?? [];
3310
3492
  }
3311
- function _temp7$1(c_0) {
3493
+ function _temp8$1(c_0) {
3312
3494
  return c_0.lastActivityAt;
3313
3495
  }
3496
+ function _temp7$1(r) {
3497
+ return r.session ?? [];
3498
+ }
3314
3499
  function _temp6$1(a_0, b_0) {
3315
3500
  return (b_0.totalTokens || 0) - (a_0.totalTokens || 0);
3316
3501
  }
3317
3502
  function _temp5$2(a, b) {
3318
3503
  return (b.cost || 0) - (a.cost || 0);
3319
3504
  }
3320
- function _temp4$4(s_0) {
3505
+ function _temp4$5(s_0) {
3321
3506
  return !(s_0.agentDescription || s_0.aiTitle || s_0.summary || s_0.firstUserPrompt) && parseCommand(s_0.firstUserCommand);
3322
3507
  }
3323
- function _temp3$4(s) {
3508
+ function _temp3$5(s) {
3324
3509
  return s.lastActivityAt;
3325
3510
  }
3326
- function _temp2$5() {
3511
+ function _temp2$7() {
3327
3512
  return /* @__PURE__ */ new Map();
3328
3513
  }
3329
- function _temp$9(m) {
3514
+ function _temp$11(m) {
3330
3515
  return m.replace(/^claude-/, "");
3331
3516
  }
3332
3517
  // src/renderer/sessions/view/transcript.js
@@ -3451,7 +3636,7 @@ var noteTurn = (it, note, uuid) => metaTurn(it, "system", [{
3451
3636
  folded: !note.level,
3452
3637
  ...note
3453
3638
  }], uuid);
3454
- function flatten(items, { loop = [], side = [], compacts = [] } = {}) {
3639
+ function flatten(items, { loop = [], side = [], compacts = [], mcp = [] } = {}) {
3455
3640
  const summarizing = [...compacts];
3456
3641
  const turns = [];
3457
3642
  const results = {};
@@ -3635,6 +3820,20 @@ function flatten(items, { loop = [], side = [], compacts = [] } = {}) {
3635
3820
  duration: elapsed(t.ts, resultTs[b.id])
3636
3821
  } : b).filter((b) => !(b.type === "tool_result" && calls.has(b.tool_use_id)));
3637
3822
  const out = turns.filter((t) => t.blocks.length > 0);
3823
+ for (let i = 0; i < out.length; i++) {
3824
+ const prompt = out[i];
3825
+ if (prompt.role !== "user" || isContextTurn(prompt)) continue;
3826
+ let next = i + 1;
3827
+ while (next < out.length && !isConversation(out[next])) next++;
3828
+ if (out[next]?.role === "user") continue;
3829
+ for (let j = i + 1; j < out.length && isContextTurn(out[j]); j++) if (out[j].role === "system") {
3830
+ const [context] = out.splice(j, 1);
3831
+ out.splice(i++, 0, {
3832
+ ...context,
3833
+ ts: prompt.ts
3834
+ });
3835
+ }
3836
+ }
3638
3837
  const slot = (turn) => {
3639
3838
  const i = out.findIndex((t) => t.ts != null && t.ts > turn.ts);
3640
3839
  i === -1 ? out.push(turn) : out.splice(i, 0, turn);
@@ -3649,6 +3848,14 @@ function flatten(items, { loop = [], side = [], compacts = [] } = {}) {
3649
3848
  ts: Date.parse(ts) - 500
3650
3849
  });
3651
3850
  }
3851
+ const abovePrompt = (turn) => {
3852
+ const i = out.findLastIndex((t) => t.ts != null && t.ts <= turn.ts && isConversation(t));
3853
+ out[i]?.role === "user" ? out.splice(i, 0, turn) : slot(turn);
3854
+ };
3855
+ for (const turn of mcp) abovePrompt(metaTurn({ timestamp: turn.startedAt }, "system", [{
3856
+ type: "mcp",
3857
+ turn
3858
+ }], `mcp-${turn.startedAt}`));
3652
3859
  const model = currentModel(out);
3653
3860
  for (const [ts, list] of Object.entries(Object.groupBy(loop, (it) => it.timestamp))) {
3654
3861
  const blocks = list.map((it) => ({
@@ -3658,13 +3865,7 @@ function flatten(items, { loop = [], side = [], compacts = [] } = {}) {
3658
3865
  model: it.model ?? model
3659
3866
  }
3660
3867
  }));
3661
- const turn = metaTurn({ timestamp: ts }, "system", blocks, `prompt-${ts}`);
3662
- const i = out.findLastIndex((t) => t.ts != null && t.ts <= turn.ts && [
3663
- "user",
3664
- "assistant",
3665
- "tool"
3666
- ].includes(t.role) && !isContextTurn(t));
3667
- out[i]?.role === "user" ? out.splice(i, 0, turn) : slot(turn);
3868
+ abovePrompt(metaTurn({ timestamp: ts }, "system", blocks, `prompt-${ts}`));
3668
3869
  }
3669
3870
  return out;
3670
3871
  }
@@ -3725,6 +3926,73 @@ function normalizeContent(content) {
3725
3926
  } : b);
3726
3927
  }
3727
3928
  var isContextTurn = (t) => t.blocks.every((b) => b.type === "attachment" && b.folded);
3929
+ var isConversation = (t) => [
3930
+ "user",
3931
+ "assistant",
3932
+ "tool"
3933
+ ].includes(t.role) && !isContextTurn(t);
3934
+ var blockTokens = (b) => b.type === "instruction" ? countTokens(b.it.content, b.it.model) : isCounted(b) ? countTokens(blockView(b).body) : 0;
3935
+ var STRIP_GROUPS = {
3936
+ "System Prompt": "prompt",
3937
+ "System Tools": "tools",
3938
+ "MCP Tools": "tools",
3939
+ "Deferred Tools": "tools",
3940
+ "MCP Instructions": "mcp",
3941
+ Skills: "listings",
3942
+ "Agent Types": "listings"
3943
+ };
3944
+ var ATTACHMENT_GROUPS = {
3945
+ output_style: "prompt",
3946
+ output_style_instructions: "prompt",
3947
+ deferred_tools_delta: "tools",
3948
+ mcp_instructions_delta: "mcp",
3949
+ instructions: "memory",
3950
+ skill_listing: "listings",
3951
+ agent_listing_delta: "listings"
3952
+ };
3953
+ var groupOf = (b) => {
3954
+ if (b.type === "mcp") return "mcp";
3955
+ if (b.type === "attachment") return ATTACHMENT_GROUPS[b.attachment.type] ?? "context";
3956
+ return STRIP_GROUPS[b.it.file_path] ?? (b.it.name ? "memory" : "context");
3957
+ };
3958
+ var GROUP_ORDER = [
3959
+ "prompt",
3960
+ "tools",
3961
+ "mcp",
3962
+ "memory",
3963
+ "listings",
3964
+ "context"
3965
+ ];
3966
+ function systemGroups(turns) {
3967
+ const blocks = turns.flatMap((t) => t.blocks);
3968
+ const rows = Object.groupBy(blocks.filter((b) => b.type === "instruction" || b.type === "mcp" || b.folded && isCounted(b)), groupOf);
3969
+ rows.context?.push(...blocks.filter((b) => b.type === "attachment" && b.folded && !isCounted(b)));
3970
+ rows.prompt?.sort((a, b) => (a.type === "attachment") - (b.type === "attachment"));
3971
+ return GROUP_ORDER.filter((key) => rows[key]).map((key) => ({
3972
+ key,
3973
+ blocks: rows[key],
3974
+ title: groupTitle(key, rows[key]),
3975
+ tokens: rows[key].reduce((sum, b) => sum + blockTokens(b), 0)
3976
+ }));
3977
+ }
3978
+ var latestServers = (turns) => [...new Map(turns.flatMap((t) => t.servers).map((s) => [s.name, s])).values()];
3979
+ function mcpGroupParts(blocks) {
3980
+ const turns = blocks.filter((b) => b.type === "mcp").map((b) => b.turn);
3981
+ const names = new Set(turns.flatMap((t) => t.servers.map((s) => s.name)));
3982
+ const listings = blocks.filter((b) => b.type !== "mcp").map((block) => ({
3983
+ block,
3984
+ sections: block.it?.items ?? blockView(block).items ?? []
3985
+ }));
3986
+ const nests = ({ sections }) => sections.length > 0 && sections.every((s) => names.has(s.name));
3987
+ return {
3988
+ turns,
3989
+ instructions: new Map(listings.filter(nests).flatMap(({ block, sections }) => sections.map((s) => [s.name, {
3990
+ content: s.content,
3991
+ model: block.it?.model
3992
+ }]))),
3993
+ rest: listings.filter((l) => !nests(l)).map((l) => l.block)
3994
+ };
3995
+ }
3728
3996
  function groupTurns(turns) {
3729
3997
  const groups = [];
3730
3998
  let cycle = null;
@@ -3844,124 +4112,23 @@ function tokenPoints(groups) {
3844
4112
  };
3845
4113
  });
3846
4114
  }
3847
- // src/renderer/ui/Divider.jsx
3848
- function Divider(t0) {
3849
- const $ = (0, import_compiler_runtime.c)(7);
3850
- const { children, onClick, title, className: t1 } = t0;
3851
- const className = t1 === void 0 ? "" : t1;
3852
- const Tag = onClick ? "button" : "div";
3853
- const t2 = onClick ? "button" : void 0;
3854
- const t3 = `divider ${className}`;
3855
- let t4;
3856
- if ($[0] !== Tag || $[1] !== children || $[2] !== onClick || $[3] !== t2 || $[4] !== t3 || $[5] !== title) {
3857
- t4 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tag, {
3858
- type: t2,
3859
- className: t3,
3860
- onClick,
3861
- "data-tooltip-content": title,
3862
- children
3863
- });
3864
- $[0] = Tag;
3865
- $[1] = children;
3866
- $[2] = onClick;
3867
- $[3] = t2;
3868
- $[4] = t3;
3869
- $[5] = title;
3870
- $[6] = t4;
3871
- } else t4 = $[6];
3872
- return t4;
3873
- }
3874
- // src/renderer/ui/LazyMount.jsx
3875
- function LazyMount(t0) {
3876
- const $ = (0, import_compiler_runtime.c)(22);
3877
- let children;
3878
- let rest;
3879
- let style;
3880
- let t1;
4115
+ // src/renderer/sessions/view/ApproxTokens.jsx
4116
+ function ApproxTokens(t0) {
4117
+ const $ = (0, import_compiler_runtime.c)(3);
4118
+ const { tokens, tip: t1 } = t0;
4119
+ const tip = t1 === void 0 ? "Approx. tokens" : t1;
3881
4120
  let t2;
3882
- let t3;
3883
- let t4;
3884
- if ($[0] !== t0) {
3885
- ({children, eager: t1, forceMount: t2, placeholderMinHeight: t3, rootRef: t4, style, ...rest} = t0);
3886
- $[0] = t0;
3887
- $[1] = children;
3888
- $[2] = rest;
3889
- $[3] = style;
3890
- $[4] = t1;
3891
- $[5] = t2;
3892
- $[6] = t3;
3893
- $[7] = t4;
3894
- } else {
3895
- children = $[1];
3896
- rest = $[2];
3897
- style = $[3];
3898
- t1 = $[4];
3899
- t2 = $[5];
3900
- t3 = $[6];
3901
- t4 = $[7];
3902
- }
3903
- const eager = t1 === void 0 ? false : t1;
3904
- const forceMount = t2 === void 0 ? false : t2;
3905
- const placeholderMinHeight = t3 === void 0 ? 120 : t3;
3906
- const rootRef = t4 === void 0 ? null : t4;
3907
- const ref = (0, import_react.useRef)(null);
3908
- const [mounted, setMounted] = (0, import_react.useState)(eager);
3909
- const render = mounted || forceMount;
3910
- let t5;
3911
- if ($[8] !== mounted || $[9] !== rootRef?.current) {
3912
- t5 = () => {
3913
- if (mounted) return;
3914
- const io = new IntersectionObserver((t6) => {
3915
- const [e] = t6;
3916
- if (e.isIntersecting) {
3917
- setMounted(true);
3918
- io.disconnect();
3919
- }
3920
- }, {
3921
- root: rootRef?.current ?? null,
3922
- rootMargin: "600px 0px"
3923
- });
3924
- io.observe(ref.current);
3925
- return () => io.disconnect();
3926
- };
3927
- $[8] = mounted;
3928
- $[9] = rootRef?.current;
3929
- $[10] = t5;
3930
- } else t5 = $[10];
3931
- let t6;
3932
- if ($[11] !== mounted || $[12] !== rootRef) {
3933
- t6 = [mounted, rootRef];
3934
- $[11] = mounted;
3935
- $[12] = rootRef;
3936
- $[13] = t6;
3937
- } else t6 = $[13];
3938
- (0, import_react.useEffect)(t5, t6);
3939
- let t7;
3940
- if ($[14] !== placeholderMinHeight || $[15] !== render || $[16] !== style) {
3941
- t7 = render ? style : {
3942
- ...style,
3943
- minHeight: placeholderMinHeight
3944
- };
3945
- $[14] = placeholderMinHeight;
3946
- $[15] = render;
3947
- $[16] = style;
3948
- $[17] = t7;
3949
- } else t7 = $[17];
3950
- const t8 = render && children;
3951
- let t9;
3952
- if ($[18] !== rest || $[19] !== t7 || $[20] !== t8) {
3953
- t9 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
3954
- ref,
3955
- style: t7,
3956
- ...rest,
3957
- children: t8
4121
+ if ($[0] !== tip || $[1] !== tokens) {
4122
+ t2 = tokens > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
4123
+ className: "instruction-tokens",
4124
+ "data-tooltip-content": tip,
4125
+ children: ["~ ", fmtCompact(tokens)]
3958
4126
  });
3959
- $[18] = rest;
3960
- $[19] = t7;
3961
- $[20] = t8;
3962
- $[21] = t9;
3963
- } else t9 = $[21];
3964
- return t9;
4127
+ $[0] = tip;
4128
+ $[1] = tokens;
4129
+ $[2] = t2;
4130
+ } else t2 = $[2];
4131
+ return t2;
3965
4132
  }
3966
4133
  // src/renderer/utils/textBlock.js
3967
4134
  var detectLang = (body, limit = 500) => {
@@ -4070,6 +4237,98 @@ function splitMarkdown(text, size = 1e4) {
4070
4237
  if (buf.length) chunks.push(buf.join("\n"));
4071
4238
  return chunks;
4072
4239
  }
4240
+ // src/renderer/ui/LazyMount.jsx
4241
+ function LazyMount(t0) {
4242
+ const $ = (0, import_compiler_runtime.c)(22);
4243
+ let children;
4244
+ let rest;
4245
+ let style;
4246
+ let t1;
4247
+ let t2;
4248
+ let t3;
4249
+ let t4;
4250
+ if ($[0] !== t0) {
4251
+ ({children, eager: t1, forceMount: t2, placeholderMinHeight: t3, rootRef: t4, style, ...rest} = t0);
4252
+ $[0] = t0;
4253
+ $[1] = children;
4254
+ $[2] = rest;
4255
+ $[3] = style;
4256
+ $[4] = t1;
4257
+ $[5] = t2;
4258
+ $[6] = t3;
4259
+ $[7] = t4;
4260
+ } else {
4261
+ children = $[1];
4262
+ rest = $[2];
4263
+ style = $[3];
4264
+ t1 = $[4];
4265
+ t2 = $[5];
4266
+ t3 = $[6];
4267
+ t4 = $[7];
4268
+ }
4269
+ const eager = t1 === void 0 ? false : t1;
4270
+ const forceMount = t2 === void 0 ? false : t2;
4271
+ const placeholderMinHeight = t3 === void 0 ? 120 : t3;
4272
+ const rootRef = t4 === void 0 ? null : t4;
4273
+ const ref = (0, import_react.useRef)(null);
4274
+ const [mounted, setMounted] = (0, import_react.useState)(eager);
4275
+ const render = mounted || forceMount;
4276
+ let t5;
4277
+ if ($[8] !== mounted || $[9] !== rootRef?.current) {
4278
+ t5 = () => {
4279
+ if (mounted) return;
4280
+ const io = new IntersectionObserver((t6) => {
4281
+ const [e] = t6;
4282
+ if (e.isIntersecting) {
4283
+ setMounted(true);
4284
+ io.disconnect();
4285
+ }
4286
+ }, {
4287
+ root: rootRef?.current ?? null,
4288
+ rootMargin: "600px 0px"
4289
+ });
4290
+ io.observe(ref.current);
4291
+ return () => io.disconnect();
4292
+ };
4293
+ $[8] = mounted;
4294
+ $[9] = rootRef?.current;
4295
+ $[10] = t5;
4296
+ } else t5 = $[10];
4297
+ let t6;
4298
+ if ($[11] !== mounted || $[12] !== rootRef) {
4299
+ t6 = [mounted, rootRef];
4300
+ $[11] = mounted;
4301
+ $[12] = rootRef;
4302
+ $[13] = t6;
4303
+ } else t6 = $[13];
4304
+ (0, import_react.useEffect)(t5, t6);
4305
+ let t7;
4306
+ if ($[14] !== placeholderMinHeight || $[15] !== render || $[16] !== style) {
4307
+ t7 = render ? style : {
4308
+ ...style,
4309
+ minHeight: placeholderMinHeight
4310
+ };
4311
+ $[14] = placeholderMinHeight;
4312
+ $[15] = render;
4313
+ $[16] = style;
4314
+ $[17] = t7;
4315
+ } else t7 = $[17];
4316
+ const t8 = render && children;
4317
+ let t9;
4318
+ if ($[18] !== rest || $[19] !== t7 || $[20] !== t8) {
4319
+ t9 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
4320
+ ref,
4321
+ style: t7,
4322
+ ...rest,
4323
+ children: t8
4324
+ });
4325
+ $[18] = rest;
4326
+ $[19] = t7;
4327
+ $[20] = t8;
4328
+ $[21] = t9;
4329
+ } else t9 = $[21];
4330
+ return t9;
4331
+ }
4073
4332
  // src/renderer/ui/OpenLink.jsx
4074
4333
  function OpenLink(t0) {
4075
4334
  const $ = (0, import_compiler_runtime.c)(13);
@@ -4133,9 +4392,9 @@ var subscribe$1 = (cb) => {
4133
4392
  return () => listeners$1.delete(cb);
4134
4393
  };
4135
4394
  function useFindActive() {
4136
- return (0, import_react.useSyncExternalStore)(subscribe$1, _temp$8);
4395
+ return (0, import_react.useSyncExternalStore)(subscribe$1, _temp$10);
4137
4396
  }
4138
- function _temp$8() {
4397
+ function _temp$10() {
4139
4398
  return active;
4140
4399
  }
4141
4400
  function closeFind() {
@@ -4221,88 +4480,483 @@ function Markdown(t0) {
4221
4480
  const ref = (0, import_react.useRef)(null);
4222
4481
  const findOpen = useFindActive();
4223
4482
  let t4;
4224
- if ($[6] !== basePath) {
4225
- t4 = buildLinkComponents(basePath);
4226
- $[6] = basePath;
4227
- $[7] = t4;
4228
- } else t4 = $[7];
4229
- const components = t4;
4483
+ if ($[6] !== basePath) {
4484
+ t4 = buildLinkComponents(basePath);
4485
+ $[6] = basePath;
4486
+ $[7] = t4;
4487
+ } else t4 = $[7];
4488
+ const components = t4;
4489
+ let t5;
4490
+ let t6;
4491
+ let t7;
4492
+ let t8;
4493
+ let t9;
4494
+ if ($[8] !== autoFence || $[9] !== className || $[10] !== components || $[11] !== findOpen || $[12] !== rest || $[13] !== text) {
4495
+ t9 = Symbol.for("react.early_return_sentinel");
4496
+ bb0: {
4497
+ let t10;
4498
+ if ($[19] !== autoFence || $[20] !== text) {
4499
+ t10 = autoFence ? fenceBlocks(fenceTags(text)) : text;
4500
+ $[19] = autoFence;
4501
+ $[20] = text;
4502
+ $[21] = t10;
4503
+ } else t10 = $[21];
4504
+ const chunks = splitMarkdown(t10);
4505
+ const cls = `markdown${className ? " " + className : ""}`;
4506
+ if (chunks.length === 1) {
4507
+ t9 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
4508
+ className: cls,
4509
+ ...rest,
4510
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Chunk, {
4511
+ text: chunks[0],
4512
+ components
4513
+ })
4514
+ });
4515
+ break bb0;
4516
+ }
4517
+ t5 = cls;
4518
+ t6 = ref;
4519
+ t7 = rest;
4520
+ t8 = chunks.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LazyMount, {
4521
+ eager: i === 0,
4522
+ forceMount: findOpen,
4523
+ rootRef: ref,
4524
+ placeholderMinHeight: 500,
4525
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Chunk, {
4526
+ text: c,
4527
+ components
4528
+ })
4529
+ }, i));
4530
+ }
4531
+ $[8] = autoFence;
4532
+ $[9] = className;
4533
+ $[10] = components;
4534
+ $[11] = findOpen;
4535
+ $[12] = rest;
4536
+ $[13] = text;
4537
+ $[14] = t5;
4538
+ $[15] = t6;
4539
+ $[16] = t7;
4540
+ $[17] = t8;
4541
+ $[18] = t9;
4542
+ } else {
4543
+ t5 = $[14];
4544
+ t6 = $[15];
4545
+ t7 = $[16];
4546
+ t8 = $[17];
4547
+ t9 = $[18];
4548
+ }
4549
+ if (t9 !== Symbol.for("react.early_return_sentinel")) return t9;
4550
+ let t10;
4551
+ if ($[22] !== t5 || $[23] !== t6 || $[24] !== t7 || $[25] !== t8) {
4552
+ t10 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
4553
+ className: t5,
4554
+ ref: t6,
4555
+ ...t7,
4556
+ children: t8
4557
+ });
4558
+ $[22] = t5;
4559
+ $[23] = t6;
4560
+ $[24] = t7;
4561
+ $[25] = t8;
4562
+ $[26] = t10;
4563
+ } else t10 = $[26];
4564
+ return t10;
4565
+ }
4566
+ // src/renderer/sessions/view/useCollapsed.js
4567
+ var ExpandAllContext = (0, import_react.createContext)(null);
4568
+ function useCollapsed(defaultOpen) {
4569
+ const $ = (0, import_compiler_runtime.c)(2);
4570
+ const expandAll = (0, import_react.useContext)(ExpandAllContext);
4571
+ const [open, setOpen] = (0, import_react.useState)(expandAll ?? defaultOpen);
4572
+ const [applied, setApplied] = (0, import_react.useState)(expandAll);
4573
+ if (applied !== expandAll) {
4574
+ setApplied(expandAll);
4575
+ if (expandAll != null) setOpen(expandAll);
4576
+ }
4577
+ let t0;
4578
+ if ($[0] !== open) {
4579
+ t0 = [open, setOpen];
4580
+ $[0] = open;
4581
+ $[1] = t0;
4582
+ } else t0 = $[1];
4583
+ return t0;
4584
+ }
4585
+ // src/renderer/sessions/view/McpConnections.jsx
4586
+ var ms = (n) => n === null ? "—" : `${fmtNum(n)}ms`;
4587
+ var RUN_WITH_DEBUG = "Run with --debug (debug: true in the Agent SDK) to see it";
4588
+ var TRANSPORT_TIP = `Transport: how this server connects (stdio, http, …). ${RUN_WITH_DEBUG}`;
4589
+ var TIME_TIP = `Connect time: how long this server took to connect. ${RUN_WITH_DEBUG}`;
4590
+ var READY_TIP = "Connect time: at most this long. It was still connecting at an earlier request and ready at this one";
4591
+ var VERSION_TIP = "The version this server reported when it connected";
4592
+ var CACHED_TIP = "Connected from a cache: the server tagged its version +cached";
4593
+ var INSTRUCTIONS_TIP = "Approx. tokens of this server's instructions. Click the row to read them";
4594
+ var label = (status) => status.replace("-", " ");
4595
+ var counts = (servers) => Object.entries(Object.groupBy(servers, (s) => s.status)).map(([status, list]) => `${list.length} ${label(status)}`).join(", ");
4596
+ function McpTitle(t0) {
4597
+ const $ = (0, import_compiler_runtime.c)(7);
4598
+ const { servers } = t0;
4599
+ let t1;
4600
+ if ($[0] !== servers) {
4601
+ t1 = servers.filter(_temp$9);
4602
+ $[0] = servers;
4603
+ $[1] = t1;
4604
+ } else t1 = $[1];
4605
+ const started = t1.length;
4606
+ let t2;
4607
+ if ($[2] !== servers) {
4608
+ t2 = counts(servers);
4609
+ $[2] = servers;
4610
+ $[3] = t2;
4611
+ } else t2 = $[3];
4612
+ const t3 = started > 0 && ` · ${started} ${started === 1 ? "process" : "processes"} started`;
4613
+ let t4;
4614
+ if ($[4] !== t2 || $[5] !== t3) {
4615
+ t4 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
4616
+ className: "mcp-title",
4617
+ children: [
4618
+ "MCP servers: ",
4619
+ t2,
4620
+ t3
4621
+ ]
4622
+ });
4623
+ $[4] = t2;
4624
+ $[5] = t3;
4625
+ $[6] = t4;
4626
+ } else t4 = $[6];
4627
+ return t4;
4628
+ }
4629
+ function _temp$9(s) {
4630
+ return s.transport === "stdio";
4631
+ }
4632
+ function McpConnections(t0) {
4633
+ const $ = (0, import_compiler_runtime.c)(10);
4634
+ const { turn, instructions } = t0;
4635
+ let t1;
4636
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
4637
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("colgroup", { children: [
4638
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("col", {}),
4639
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("col", { className: "mcp-col-transport" }),
4640
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("col", { className: "mcp-col-time" }),
4641
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("col", { className: "mcp-col-status" }),
4642
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("col", { className: "mcp-col-tokens" })
4643
+ ] });
4644
+ $[0] = t1;
4645
+ } else t1 = $[0];
4646
+ let t2;
4647
+ if ($[1] !== instructions || $[2] !== turn.debug || $[3] !== turn.servers) {
4648
+ let t3;
4649
+ if ($[5] !== instructions || $[6] !== turn.debug) {
4650
+ t3 = (s) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Server, {
4651
+ s,
4652
+ debug: turn.debug,
4653
+ instructions: instructions?.get(s.name),
4654
+ gutter: instructions?.size > 0
4655
+ }, s.name);
4656
+ $[5] = instructions;
4657
+ $[6] = turn.debug;
4658
+ $[7] = t3;
4659
+ } else t3 = $[7];
4660
+ t2 = turn.servers.map(t3);
4661
+ $[1] = instructions;
4662
+ $[2] = turn.debug;
4663
+ $[3] = turn.servers;
4664
+ $[4] = t2;
4665
+ } else t2 = $[4];
4666
+ let t3;
4667
+ if ($[8] !== t2) {
4668
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("table", {
4669
+ className: "mcp-servers",
4670
+ children: [t1, /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { children: t2 })]
4671
+ });
4672
+ $[8] = t2;
4673
+ $[9] = t3;
4674
+ } else t3 = $[9];
4675
+ return t3;
4676
+ }
4677
+ function Server(t0) {
4678
+ const $ = (0, import_compiler_runtime.c)(58);
4679
+ const { s, debug, instructions, gutter } = t0;
4680
+ const [open, setOpen] = useCollapsed(false);
4681
+ const t1 = instructions && "mcp-foldable";
4682
+ let t2;
4683
+ if ($[0] !== instructions || $[1] !== setOpen) {
4684
+ t2 = instructions && (() => setOpen(_temp2$6));
4685
+ $[0] = instructions;
4686
+ $[1] = setOpen;
4687
+ $[2] = t2;
4688
+ } else t2 = $[2];
4689
+ let t3;
4690
+ if ($[3] !== gutter || $[4] !== instructions || $[5] !== open) {
4691
+ t3 = gutter && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
4692
+ className: `mcp-chevron${instructions ? "" : " none"}`,
4693
+ "aria-expanded": open,
4694
+ "aria-label": "Instructions",
4695
+ children: open ? "▾" : "▸"
4696
+ });
4697
+ $[3] = gutter;
4698
+ $[4] = instructions;
4699
+ $[5] = open;
4700
+ $[6] = t3;
4701
+ } else t3 = $[6];
4702
+ let t4;
4703
+ if ($[7] !== s.toolCount) {
4704
+ t4 = s.toolCount != null && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
4705
+ className: "mcp-dim",
4706
+ children: [
4707
+ " (",
4708
+ plural(s.toolCount, "tool"),
4709
+ ")"
4710
+ ]
4711
+ });
4712
+ $[7] = s.toolCount;
4713
+ $[8] = t4;
4714
+ } else t4 = $[8];
4230
4715
  let t5;
4716
+ if ($[9] !== s.version) {
4717
+ t5 = s.version && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
4718
+ className: "mcp-version",
4719
+ "data-tooltip-content": VERSION_TIP,
4720
+ children: s.version
4721
+ });
4722
+ $[9] = s.version;
4723
+ $[10] = t5;
4724
+ } else t5 = $[10];
4231
4725
  let t6;
4232
- let t7;
4233
- let t8;
4234
- let t9;
4235
- if ($[8] !== autoFence || $[9] !== className || $[10] !== components || $[11] !== findOpen || $[12] !== rest || $[13] !== text) {
4236
- t9 = Symbol.for("react.early_return_sentinel");
4237
- bb0: {
4238
- let t10;
4239
- if ($[19] !== autoFence || $[20] !== text) {
4240
- t10 = autoFence ? fenceBlocks(fenceTags(text)) : text;
4241
- $[19] = autoFence;
4242
- $[20] = text;
4243
- $[21] = t10;
4244
- } else t10 = $[21];
4245
- const chunks = splitMarkdown(t10);
4246
- const cls = `markdown${className ? " " + className : ""}`;
4247
- if (chunks.length === 1) {
4248
- t9 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
4249
- className: cls,
4250
- ...rest,
4251
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Chunk, {
4252
- text: chunks[0],
4253
- components
4254
- })
4255
- });
4256
- break bb0;
4257
- }
4258
- t5 = cls;
4259
- t6 = ref;
4260
- t7 = rest;
4261
- t8 = chunks.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LazyMount, {
4262
- eager: i === 0,
4263
- forceMount: findOpen,
4264
- rootRef: ref,
4265
- placeholderMinHeight: 500,
4266
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Chunk, {
4267
- text: c,
4268
- components
4269
- })
4270
- }, i));
4271
- }
4272
- $[8] = autoFence;
4273
- $[9] = className;
4274
- $[10] = components;
4275
- $[11] = findOpen;
4276
- $[12] = rest;
4277
- $[13] = text;
4726
+ if ($[11] !== s.name || $[12] !== t3 || $[13] !== t4 || $[14] !== t5) {
4727
+ t6 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("td", { children: [
4728
+ t3,
4729
+ s.name,
4730
+ t4,
4731
+ t5
4732
+ ] });
4733
+ $[11] = s.name;
4734
+ $[12] = t3;
4735
+ $[13] = t4;
4278
4736
  $[14] = t5;
4279
4737
  $[15] = t6;
4738
+ } else t6 = $[15];
4739
+ const t7 = debug ? void 0 : TRANSPORT_TIP;
4740
+ const t8 = s.transport ?? "—";
4741
+ let t9;
4742
+ if ($[16] !== t7 || $[17] !== t8) {
4743
+ t9 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
4744
+ className: "mcp-dim",
4745
+ "data-tooltip-content": t7,
4746
+ children: t8
4747
+ });
4280
4748
  $[16] = t7;
4281
4749
  $[17] = t8;
4282
4750
  $[18] = t9;
4283
- } else {
4284
- t5 = $[14];
4285
- t6 = $[15];
4286
- t7 = $[16];
4287
- t8 = $[17];
4288
- t9 = $[18];
4289
- }
4290
- if (t9 !== Symbol.for("react.early_return_sentinel")) return t9;
4751
+ } else t9 = $[18];
4291
4752
  let t10;
4292
- if ($[22] !== t5 || $[23] !== t6 || $[24] !== t7 || $[25] !== t8) {
4293
- t10 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
4294
- className: t5,
4295
- ref: t6,
4296
- ...t7,
4297
- children: t8
4753
+ if ($[19] !== debug || $[20] !== s.cached || $[21] !== s.ms || $[22] !== s.readyWithin) {
4754
+ t10 = s.readyWithin != null ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("td", {
4755
+ className: "mcp-ms",
4756
+ "data-tooltip-content": READY_TIP,
4757
+ children: ["≤ ", ms(s.readyWithin)]
4758
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("td", {
4759
+ className: "mcp-ms",
4760
+ "data-tooltip-content": debug ? void 0 : TIME_TIP,
4761
+ children: [s.cached && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
4762
+ className: "mcp-cached",
4763
+ "data-tooltip-content": CACHED_TIP,
4764
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Database, {})
4765
+ }), ms(s.ms)]
4766
+ });
4767
+ $[19] = debug;
4768
+ $[20] = s.cached;
4769
+ $[21] = s.ms;
4770
+ $[22] = s.readyWithin;
4771
+ $[23] = t10;
4772
+ } else t10 = $[23];
4773
+ const t11 = `mcp-status ${s.status}`;
4774
+ let t12;
4775
+ if ($[24] !== s.status) {
4776
+ t12 = label(s.status);
4777
+ $[24] = s.status;
4778
+ $[25] = t12;
4779
+ } else t12 = $[25];
4780
+ let t13;
4781
+ if ($[26] !== t11 || $[27] !== t12) {
4782
+ t13 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
4783
+ className: t11,
4784
+ children: t12
4298
4785
  });
4299
- $[22] = t5;
4300
- $[23] = t6;
4301
- $[24] = t7;
4302
- $[25] = t8;
4303
- $[26] = t10;
4304
- } else t10 = $[26];
4305
- return t10;
4786
+ $[26] = t11;
4787
+ $[27] = t12;
4788
+ $[28] = t13;
4789
+ } else t13 = $[28];
4790
+ let t14;
4791
+ if ($[29] !== instructions) {
4792
+ t14 = instructions && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ApproxTokens, {
4793
+ tokens: countTokens(instructions.content, instructions.model),
4794
+ tip: INSTRUCTIONS_TIP
4795
+ });
4796
+ $[29] = instructions;
4797
+ $[30] = t14;
4798
+ } else t14 = $[30];
4799
+ let t15;
4800
+ if ($[31] !== t14) {
4801
+ t15 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
4802
+ className: "mcp-tokens",
4803
+ children: t14
4804
+ });
4805
+ $[31] = t14;
4806
+ $[32] = t15;
4807
+ } else t15 = $[32];
4808
+ let t16;
4809
+ if ($[33] !== t1 || $[34] !== t10 || $[35] !== t13 || $[36] !== t15 || $[37] !== t2 || $[38] !== t6 || $[39] !== t9) {
4810
+ t16 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tr", {
4811
+ className: t1,
4812
+ onClick: t2,
4813
+ children: [
4814
+ t6,
4815
+ t9,
4816
+ t10,
4817
+ t13,
4818
+ t15
4819
+ ]
4820
+ });
4821
+ $[33] = t1;
4822
+ $[34] = t10;
4823
+ $[35] = t13;
4824
+ $[36] = t15;
4825
+ $[37] = t2;
4826
+ $[38] = t6;
4827
+ $[39] = t9;
4828
+ $[40] = t16;
4829
+ } else t16 = $[40];
4830
+ let t17;
4831
+ if ($[41] !== s.error || $[42] !== s.status || $[43] !== s.stderr) {
4832
+ t17 = (s.error || s.stderr.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
4833
+ colSpan: 5,
4834
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
4835
+ className: `mcp-error ${s.status}`,
4836
+ children: [s.error, ...s.stderr].filter(Boolean).join("\n")
4837
+ })
4838
+ }) });
4839
+ $[41] = s.error;
4840
+ $[42] = s.status;
4841
+ $[43] = s.stderr;
4842
+ $[44] = t17;
4843
+ } else t17 = $[44];
4844
+ let t18;
4845
+ if ($[45] !== instructions || $[46] !== open) {
4846
+ t18 = open && instructions && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
4847
+ colSpan: 5,
4848
+ className: "mcp-tool",
4849
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
4850
+ className: "aux-body",
4851
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Markdown, {
4852
+ className: "block-text",
4853
+ text: instructions.content
4854
+ })
4855
+ })
4856
+ }) });
4857
+ $[45] = instructions;
4858
+ $[46] = open;
4859
+ $[47] = t18;
4860
+ } else t18 = $[47];
4861
+ let t19;
4862
+ if ($[48] !== s.groups) {
4863
+ t19 = s.groups.map(_temp3$4);
4864
+ $[48] = s.groups;
4865
+ $[49] = t19;
4866
+ } else t19 = $[49];
4867
+ let t20;
4868
+ if ($[50] !== s.tools) {
4869
+ t20 = s.tools.map(_temp4$4);
4870
+ $[50] = s.tools;
4871
+ $[51] = t20;
4872
+ } else t20 = $[51];
4873
+ let t21;
4874
+ if ($[52] !== t16 || $[53] !== t17 || $[54] !== t18 || $[55] !== t19 || $[56] !== t20) {
4875
+ t21 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
4876
+ t16,
4877
+ t17,
4878
+ t18,
4879
+ t19,
4880
+ t20
4881
+ ] });
4882
+ $[52] = t16;
4883
+ $[53] = t17;
4884
+ $[54] = t18;
4885
+ $[55] = t19;
4886
+ $[56] = t20;
4887
+ $[57] = t21;
4888
+ } else t21 = $[57];
4889
+ return t21;
4890
+ }
4891
+ function _temp4$4(t, j) {
4892
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tr", {
4893
+ className: "mcp-dim",
4894
+ children: [
4895
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("td", {
4896
+ colSpan: 2,
4897
+ className: "mcp-tool",
4898
+ children: [
4899
+ "↳ ",
4900
+ t.name,
4901
+ t.error && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
4902
+ className: "mcp-tool-error",
4903
+ children: [" · ", t.error]
4904
+ })
4905
+ ]
4906
+ }),
4907
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
4908
+ className: "mcp-ms",
4909
+ children: ms(t.ms)
4910
+ }),
4911
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { colSpan: 2 })
4912
+ ]
4913
+ }, j);
4914
+ }
4915
+ function _temp3$4(g) {
4916
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", {
4917
+ className: "mcp-dim",
4918
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("td", {
4919
+ colSpan: 5,
4920
+ className: "mcp-tool",
4921
+ children: [
4922
+ "↳ ",
4923
+ g.name,
4924
+ " (",
4925
+ plural(g.toolCount, "tool"),
4926
+ ")"
4927
+ ]
4928
+ })
4929
+ }, g.name);
4930
+ }
4931
+ function _temp2$6(v) {
4932
+ return !v;
4933
+ }
4934
+ // src/renderer/ui/Divider.jsx
4935
+ function Divider(t0) {
4936
+ const $ = (0, import_compiler_runtime.c)(7);
4937
+ const { children, onClick, title, className: t1 } = t0;
4938
+ const className = t1 === void 0 ? "" : t1;
4939
+ const Tag = onClick ? "button" : "div";
4940
+ const t2 = onClick ? "button" : void 0;
4941
+ const t3 = `divider ${className}`;
4942
+ let t4;
4943
+ if ($[0] !== Tag || $[1] !== children || $[2] !== onClick || $[3] !== t2 || $[4] !== t3 || $[5] !== title) {
4944
+ t4 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tag, {
4945
+ type: t2,
4946
+ className: t3,
4947
+ onClick,
4948
+ "data-tooltip-content": title,
4949
+ children
4950
+ });
4951
+ $[0] = Tag;
4952
+ $[1] = children;
4953
+ $[2] = onClick;
4954
+ $[3] = t2;
4955
+ $[4] = t3;
4956
+ $[5] = title;
4957
+ $[6] = t4;
4958
+ } else t4 = $[6];
4959
+ return t4;
4306
4960
  }
4307
4961
  // src/renderer/ui/ProgressBar.jsx
4308
4962
  function ProgressBar(t0) {
@@ -4365,25 +5019,7 @@ function Tip(t0) {
4365
5019
  // src/renderer/assets/claude-icon.svg
4366
5020
  var claude_icon_default = new URL("claude-icon-BqihzN4C.svg", import.meta.url).href;
4367
5021
  // src/renderer/sessions/view/ConversationView.jsx
4368
- var ExpandAllContext = import_react.createContext(null);
4369
5022
  var TranscriptFileContext = import_react.createContext(null);
4370
- function useCollapsed(defaultOpen) {
4371
- const $ = (0, import_compiler_runtime.c)(2);
4372
- const expandAll = (0, import_react.useContext)(ExpandAllContext);
4373
- const [open, setOpen] = (0, import_react.useState)(expandAll ?? defaultOpen);
4374
- const [applied, setApplied] = (0, import_react.useState)(expandAll);
4375
- if (applied !== expandAll) {
4376
- setApplied(expandAll);
4377
- if (expandAll != null) setOpen(expandAll);
4378
- }
4379
- let t0;
4380
- if ($[0] !== open) {
4381
- t0 = [open, setOpen];
4382
- $[0] = open;
4383
- $[1] = t0;
4384
- } else t0 = $[1];
4385
- return t0;
4386
- }
4387
5023
  var FILTERS = [
4388
5024
  {
4389
5025
  value: "user",
@@ -4467,7 +5103,7 @@ function ConversationView(t0) {
4467
5103
  title: branch.from,
4468
5104
  children: ["Branched from session ", branch.from.slice(0, 8)]
4469
5105
  });
4470
- const rewinds = groups.map(_temp2$4);
5106
+ const rewinds = groups.map(_temp2$5);
4471
5107
  const showSince = (since) => {
4472
5108
  const from = groups.findIndex((g_1) => g_1.turns.some((t_0) => t_0.ts >= since));
4473
5109
  [...zoomRef.current.querySelectorAll("[data-group]")].find((el) => Number(el.dataset.group) >= from)?.scrollIntoView({
@@ -4636,10 +5272,10 @@ function ConversationView(t0) {
4636
5272
  function _temp3$3(t_1) {
4637
5273
  return t_1.ts ?? 0;
4638
5274
  }
4639
- function _temp2$4(g_0) {
4640
- return g_0.turns.find(_temp$7)?.rewind;
5275
+ function _temp2$5(g_0) {
5276
+ return g_0.turns.find(_temp$8)?.rewind;
4641
5277
  }
4642
- function _temp$7(t) {
5278
+ function _temp$8(t) {
4643
5279
  return t.rewind;
4644
5280
  }
4645
5281
  function RewindDivider(t0) {
@@ -4947,21 +5583,22 @@ var AUTHORS = {
4947
5583
  }
4948
5584
  };
4949
5585
  var isFolded = (t) => t.blocks.every((b) => b.folded);
4950
- var isCounted = (b) => b.type === "attachment" && !b.unsent && hasText(attachmentView(b.attachment, b.rendered));
4951
5586
  function InputRow(t0) {
4952
- const $ = (0, import_compiler_runtime.c)(19);
5587
+ const $ = (0, import_compiler_runtime.c)(21);
4953
5588
  const { kind, turns, point, index } = t0;
4954
5589
  const [open, setOpen] = useCollapsed(false);
4955
5590
  let t1;
4956
5591
  if ($[0] !== index || $[1] !== kind || $[2] !== open || $[3] !== point || $[4] !== setOpen || $[5] !== turns) {
4957
- const msgs = turns.filter(_temp4$3);
4958
- const folded = turns.filter(isFolded).flatMap(_temp5$1);
5592
+ const groups = kind === "system" ? systemGroups(turns) : [];
5593
+ const grouped = new Set(groups.flatMap(_temp4$3));
5594
+ const msgs = turns.filter(_temp5$1);
5595
+ const folded = turns.filter(isFolded).flatMap(_temp6).filter((b) => !grouped.has(b));
4959
5596
  const counted = new Set(folded.filter(isCounted));
4960
- const ctxItems = folded.filter((b) => !counted.has(b));
5597
+ const ctxItems = folded.filter((b_0) => !counted.has(b_0));
4961
5598
  const ts = (msgs[0] ?? turns[0]).ts;
4962
5599
  const { Icon, name } = AUTHORS[kind];
4963
5600
  const count = (type, noun) => {
4964
- const n = ctxItems.filter((b_0) => b_0.type === type).length;
5601
+ const n = ctxItems.filter((b_1) => b_1.type === type).length;
4965
5602
  return n > 0 && plural(n, noun);
4966
5603
  };
4967
5604
  const t2 = [count("attachment", "attachment"), count("system", "notice")];
@@ -5011,6 +5648,12 @@ function InputRow(t0) {
5011
5648
  $[17] = t7;
5012
5649
  $[18] = t8;
5013
5650
  } else t8 = $[18];
5651
+ let t9;
5652
+ if ($[19] !== grouped) {
5653
+ t9 = (t_2) => !t_2.blocks.every((b_3) => grouped.has(b_3));
5654
+ $[19] = grouped;
5655
+ $[20] = t9;
5656
+ } else t9 = $[20];
5014
5657
  t1 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
5015
5658
  className: `msg-${kind}`,
5016
5659
  children: [
@@ -5019,13 +5662,13 @@ function InputRow(t0) {
5019
5662
  children: [
5020
5663
  t4,
5021
5664
  t5,
5022
- msgs.some(_temp6) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
5665
+ msgs.some(_temp7) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
5023
5666
  className: "msg-summary",
5024
5667
  children: "queued during the previous turn"
5025
5668
  }),
5026
5669
  ctxItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
5027
5670
  className: "msg-summary",
5028
- onClick: () => setOpen(_temp7),
5671
+ onClick: () => setOpen(_temp8),
5029
5672
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
5030
5673
  className: "aux-chevron",
5031
5674
  children: open ? "▾" : "▸"
@@ -5034,14 +5677,18 @@ function InputRow(t0) {
5034
5677
  t8
5035
5678
  ]
5036
5679
  }),
5037
- (open ? folded.length : counted.size) > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
5680
+ (groups.length > 0 || (open ? folded.length : counted.size) > 0) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
5038
5681
  className: "msg-context",
5039
- children: folded.map((b_1, i) => counted.has(b_1) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
5040
- className: "listed",
5041
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Block, { block: b_1 })
5042
- }, i) : open && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Block, { block: b_1 }, i))
5682
+ children: [
5683
+ groups.map(_temp9),
5684
+ groups.filter(_temp10).length > 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TotalTokens, { tokens: groups.reduce(_temp11, 0) }),
5685
+ folded.map((b_2, i) => counted.has(b_2) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
5686
+ className: "listed",
5687
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Block, { block: b_2 })
5688
+ }, i) : open && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Block, { block: b_2 }, i))
5689
+ ]
5043
5690
  }),
5044
- msgs.map(_temp8)
5691
+ msgs.filter(t9).map(_temp12)
5045
5692
  ]
5046
5693
  });
5047
5694
  $[0] = index;
@@ -5054,32 +5701,202 @@ function InputRow(t0) {
5054
5701
  } else t1 = $[6];
5055
5702
  return t1;
5056
5703
  }
5057
- function _temp8(t_2) {
5058
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TurnRow, { turn: t_2 }, t_2.uuid);
5704
+ function _temp12(t_3) {
5705
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TurnRow, { turn: t_3 }, t_3.uuid);
5706
+ }
5707
+ function _temp11(sum, g_1) {
5708
+ return sum + g_1.tokens;
5059
5709
  }
5060
- function _temp7(v) {
5710
+ function _temp10(g_2) {
5711
+ return g_2.tokens > 0;
5712
+ }
5713
+ function _temp9(g_0) {
5714
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SystemGroup, { group: g_0 }, g_0.key);
5715
+ }
5716
+ function _temp8(v) {
5061
5717
  return !v;
5062
5718
  }
5063
- function _temp6(t_1) {
5719
+ function _temp7(t_1) {
5064
5720
  return t_1.queued;
5065
5721
  }
5066
- function _temp5$1(t_0) {
5722
+ function _temp6(t_0) {
5067
5723
  return t_0.blocks;
5068
5724
  }
5069
- function _temp4$3(t) {
5070
- return !isFolded(t);
5725
+ function _temp5$1(t) {
5726
+ return !isFolded(t);
5727
+ }
5728
+ function _temp4$3(g) {
5729
+ return g.blocks;
5730
+ }
5731
+ function SystemGroup(t0) {
5732
+ const $ = (0, import_compiler_runtime.c)(21);
5733
+ const { group: t1 } = t0;
5734
+ const { blocks, title, tokens } = t1;
5735
+ if (blocks.length === 1) {
5736
+ const [block] = blocks;
5737
+ let t2;
5738
+ if ($[0] !== block) {
5739
+ t2 = block.type === "attachment" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
5740
+ className: "listed",
5741
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Block, { block })
5742
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Block, { block });
5743
+ $[0] = block;
5744
+ $[1] = t2;
5745
+ } else t2 = $[1];
5746
+ return t2;
5747
+ }
5748
+ if (!blocks.some(_temp13)) {
5749
+ let t2;
5750
+ if ($[2] !== blocks) {
5751
+ t2 = blocks.map(_temp14);
5752
+ $[2] = blocks;
5753
+ $[3] = t2;
5754
+ } else t2 = $[3];
5755
+ let t3;
5756
+ if ($[4] !== t2 || $[5] !== title || $[6] !== tokens) {
5757
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collapsible, {
5758
+ title,
5759
+ className: "instruction-file directive system-group",
5760
+ defaultOpen: false,
5761
+ tokens,
5762
+ children: t2
5763
+ });
5764
+ $[4] = t2;
5765
+ $[5] = title;
5766
+ $[6] = tokens;
5767
+ $[7] = t3;
5768
+ } else t3 = $[7];
5769
+ return t3;
5770
+ }
5771
+ let T0;
5772
+ let t2;
5773
+ let t3;
5774
+ let t4;
5775
+ let t5;
5776
+ if ($[8] !== blocks || $[9] !== tokens) {
5777
+ const { turns, instructions, rest } = mcpGroupParts(blocks);
5778
+ T0 = McpBlock;
5779
+ t2 = turns;
5780
+ t3 = instructions;
5781
+ t4 = tokens;
5782
+ t5 = rest.map(_temp15);
5783
+ $[8] = blocks;
5784
+ $[9] = tokens;
5785
+ $[10] = T0;
5786
+ $[11] = t2;
5787
+ $[12] = t3;
5788
+ $[13] = t4;
5789
+ $[14] = t5;
5790
+ } else {
5791
+ T0 = $[10];
5792
+ t2 = $[11];
5793
+ t3 = $[12];
5794
+ t4 = $[13];
5795
+ t5 = $[14];
5796
+ }
5797
+ let t6;
5798
+ if ($[15] !== T0 || $[16] !== t2 || $[17] !== t3 || $[18] !== t4 || $[19] !== t5) {
5799
+ t6 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(T0, {
5800
+ turns: t2,
5801
+ instructions: t3,
5802
+ tokens: t4,
5803
+ children: t5
5804
+ });
5805
+ $[15] = T0;
5806
+ $[16] = t2;
5807
+ $[17] = t3;
5808
+ $[18] = t4;
5809
+ $[19] = t5;
5810
+ $[20] = t6;
5811
+ } else t6 = $[20];
5812
+ return t6;
5813
+ }
5814
+ function _temp15(b_1, i_0) {
5815
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Block, { block: b_1 }, i_0);
5816
+ }
5817
+ function _temp14(b, i) {
5818
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Block, { block: b }, i);
5819
+ }
5820
+ function _temp13(b_0) {
5821
+ return b_0.type === "mcp";
5822
+ }
5823
+ function McpBlock(t0) {
5824
+ const $ = (0, import_compiler_runtime.c)(20);
5825
+ const { turns, instructions, tokens, speaker, children } = t0;
5826
+ let t1;
5827
+ if ($[0] !== turns) {
5828
+ t1 = latestServers(turns);
5829
+ $[0] = turns;
5830
+ $[1] = t1;
5831
+ } else t1 = $[1];
5832
+ const servers = t1;
5833
+ let t2;
5834
+ if ($[2] !== servers) {
5835
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(McpTitle, { servers });
5836
+ $[2] = servers;
5837
+ $[3] = t2;
5838
+ } else t2 = $[3];
5839
+ let t3;
5840
+ if ($[4] !== speaker || $[5] !== t2) {
5841
+ t3 = said(speaker, t2);
5842
+ $[4] = speaker;
5843
+ $[5] = t2;
5844
+ $[6] = t3;
5845
+ } else t3 = $[6];
5846
+ let t4;
5847
+ if ($[7] !== servers) {
5848
+ t4 = servers.some(_temp16);
5849
+ $[7] = servers;
5850
+ $[8] = t4;
5851
+ } else t4 = $[8];
5852
+ let t5;
5853
+ if ($[9] !== instructions || $[10] !== turns) {
5854
+ let t6;
5855
+ if ($[12] !== instructions) {
5856
+ t6 = (t, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(McpConnections, {
5857
+ turn: t,
5858
+ instructions
5859
+ }, i);
5860
+ $[12] = instructions;
5861
+ $[13] = t6;
5862
+ } else t6 = $[13];
5863
+ t5 = turns.map(t6);
5864
+ $[9] = instructions;
5865
+ $[10] = turns;
5866
+ $[11] = t5;
5867
+ } else t5 = $[11];
5868
+ let t6;
5869
+ if ($[14] !== children || $[15] !== t3 || $[16] !== t4 || $[17] !== t5 || $[18] !== tokens) {
5870
+ t6 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Collapsible, {
5871
+ title: t3,
5872
+ className: "mcp-block",
5873
+ defaultOpen: t4,
5874
+ tokens,
5875
+ children: [t5, children]
5876
+ });
5877
+ $[14] = children;
5878
+ $[15] = t3;
5879
+ $[16] = t4;
5880
+ $[17] = t5;
5881
+ $[18] = tokens;
5882
+ $[19] = t6;
5883
+ } else t6 = $[19];
5884
+ return t6;
5885
+ }
5886
+ function _temp16(s) {
5887
+ return s.status === "failed";
5071
5888
  }
5072
5889
  function AssistantCard(t0) {
5073
5890
  const $ = (0, import_compiler_runtime.c)(32);
5074
5891
  const { turns, point, index, duration, ctxLimit, showAuthor: t1 } = t0;
5075
5892
  const showAuthor = t1 === void 0 ? true : t1;
5076
5893
  const [open, setOpen] = useCollapsed(false);
5077
- const toolBlocks = turns.flatMap(_temp10);
5078
- const errorCount = toolBlocks.filter(_temp11).length;
5079
- const skillCount = toolBlocks.filter(_temp12).length;
5080
- const isAux = _temp14;
5894
+ const toolBlocks = turns.flatMap(_temp18);
5895
+ const errorCount = toolBlocks.filter(_temp19).length;
5896
+ const skillCount = toolBlocks.filter(_temp20).length;
5897
+ const isAux = _temp22;
5081
5898
  const foldable = toolBlocks.length > 0 && turns.some(isAux);
5082
- const end = turns.findLast(_temp15)?.ts ?? null;
5899
+ const end = turns.findLast(_temp23)?.ts ?? null;
5083
5900
  const [everOpen, setEverOpen] = (0, import_react.useState)(false);
5084
5901
  if (open && !everOpen) setEverOpen(true);
5085
5902
  const hidden = (t_2) => !open && foldable && isAux(t_2);
@@ -5115,7 +5932,7 @@ function AssistantCard(t0) {
5115
5932
  const parts = t5;
5116
5933
  let t6;
5117
5934
  if ($[8] !== parts) {
5118
- t6 = parts.map(_temp16);
5935
+ t6 = parts.map(_temp24);
5119
5936
  $[8] = parts;
5120
5937
  $[9] = t6;
5121
5938
  } else t6 = $[9];
@@ -5138,7 +5955,7 @@ function AssistantCard(t0) {
5138
5955
  } else t9 = $[13];
5139
5956
  const t10 = parts.length > 0 && (foldable ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
5140
5957
  className: "msg-summary",
5141
- onClick: () => setOpen(_temp17),
5958
+ onClick: () => setOpen(_temp25),
5142
5959
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
5143
5960
  className: "aux-chevron",
5144
5961
  children: open ? "▾" : "▸"
@@ -5224,31 +6041,31 @@ function AssistantCard(t0) {
5224
6041
  } else t17 = $[31];
5225
6042
  return t17;
5226
6043
  }
5227
- function _temp17(v) {
6044
+ function _temp25(v) {
5228
6045
  return !v;
5229
6046
  }
5230
- function _temp16(p, i) {
6047
+ function _temp24(p, i) {
5231
6048
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [i > 0 && ", ", p] }, i);
5232
6049
  }
5233
- function _temp15(t_1) {
6050
+ function _temp23(t_1) {
5234
6051
  return t_1.ts != null;
5235
6052
  }
5236
- function _temp14(t_0) {
5237
- return t_0.role === "system" ? isFolded(t_0) : !t_0.blocks.some(_temp13);
6053
+ function _temp22(t_0) {
6054
+ return t_0.role === "system" ? isFolded(t_0) : !t_0.blocks.some(_temp21);
5238
6055
  }
5239
- function _temp13(b_2) {
6056
+ function _temp21(b_2) {
5240
6057
  return b_2.type === "text";
5241
6058
  }
5242
- function _temp12(b_1) {
6059
+ function _temp20(b_1) {
5243
6060
  return b_1.name === "Skill";
5244
6061
  }
5245
- function _temp11(b_0) {
6062
+ function _temp19(b_0) {
5246
6063
  return b_0.result?.is_error;
5247
6064
  }
5248
- function _temp10(t) {
5249
- return t.blocks.filter(_temp9);
6065
+ function _temp18(t) {
6066
+ return t.blocks.filter(_temp17);
5250
6067
  }
5251
- function _temp9(b) {
6068
+ function _temp17(b) {
5252
6069
  return b.type === "tool_use";
5253
6070
  }
5254
6071
  function TurnRow(t0) {
@@ -5274,7 +6091,7 @@ function TurnRow(t0) {
5274
6091
  }
5275
6092
  let t3;
5276
6093
  if ($[4] !== turn.blocks) {
5277
- t3 = turn.blocks.some(_temp18);
6094
+ t3 = turn.blocks.some(_temp26);
5278
6095
  $[4] = turn.blocks;
5279
6096
  $[5] = t3;
5280
6097
  } else t3 = $[5];
@@ -5285,7 +6102,7 @@ function TurnRow(t0) {
5285
6102
  let t7;
5286
6103
  let t8;
5287
6104
  if ($[6] !== contextBlocks || $[7] !== hasError || $[8] !== hidden || $[9] !== otherBlocks || $[10] !== speaker || $[11] !== turn.blocks || $[12] !== turn.role || $[13] !== turn.ts) {
5288
- const instructions = turn.blocks.filter(_temp19);
6105
+ const instructions = turn.blocks.filter(_temp27);
5289
6106
  t8 = `turn turn-${turn.role} ${hasError ? "turn-error" : ""} ${hidden ? "turn-hidden" : ""}`;
5290
6107
  t4 = "turn-blocks";
5291
6108
  if ($[19] !== contextBlocks) {
@@ -5293,7 +6110,7 @@ function TurnRow(t0) {
5293
6110
  className: "attachment",
5294
6111
  defaultOpen: false,
5295
6112
  title: plural(contextBlocks.length, "attachment"),
5296
- children: contextBlocks.map(_temp20)
6113
+ children: contextBlocks.map(_temp28)
5297
6114
  });
5298
6115
  $[19] = contextBlocks;
5299
6116
  $[20] = t5;
@@ -5309,13 +6126,7 @@ function TurnRow(t0) {
5309
6126
  $[23] = turn.ts;
5310
6127
  $[24] = t6;
5311
6128
  } else t6 = $[24];
5312
- t7 = instructions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
5313
- className: "aux instruction-total",
5314
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ApproxTokens, {
5315
- tokens: instructions.reduce(_temp21, 0),
5316
- tip: "Approx. total tokens"
5317
- })
5318
- });
6129
+ t7 = instructions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TotalTokens, { tokens: instructions.reduce(_temp29, 0) });
5319
6130
  $[6] = contextBlocks;
5320
6131
  $[7] = hasError;
5321
6132
  $[8] = hidden;
@@ -5364,10 +6175,10 @@ function TurnRow(t0) {
5364
6175
  } else t10 = $[32];
5365
6176
  return t10;
5366
6177
  }
5367
- function _temp21(a, b_4) {
5368
- return a + countTokens(b_4.it.content, b_4.it.model);
6178
+ function _temp29(sum, b_4) {
6179
+ return sum + blockTokens(b_4);
5369
6180
  }
5370
- function _temp20(b_2, i) {
6181
+ function _temp28(b_2, i) {
5371
6182
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Attachment, {
5372
6183
  att: b_2.attachment,
5373
6184
  rendered: b_2.rendered,
@@ -5375,14 +6186,14 @@ function _temp20(b_2, i) {
5375
6186
  unsent: b_2.unsent
5376
6187
  }, i);
5377
6188
  }
5378
- function _temp19(b_1) {
6189
+ function _temp27(b_1) {
5379
6190
  return b_1.type === "instruction";
5380
6191
  }
5381
- function _temp18(b_0) {
6192
+ function _temp26(b_0) {
5382
6193
  return b_0.type === "tool_use" && b_0.result?.is_error;
5383
6194
  }
5384
6195
  function Block(t0) {
5385
- const $ = (0, import_compiler_runtime.c)(98);
6196
+ const $ = (0, import_compiler_runtime.c)(102);
5386
6197
  const { block, speaker: t1, ts: t2 } = t0;
5387
6198
  const speaker = t1 === void 0 ? null : t1;
5388
6199
  const ts = t2 === void 0 ? null : t2;
@@ -5616,7 +6427,7 @@ function Block(t0) {
5616
6427
  } else t6 = $[49];
5617
6428
  let t7;
5618
6429
  if ($[50] !== parts) {
5619
- t7 = parts.map(_temp22);
6430
+ t7 = parts.map(_temp30);
5620
6431
  $[50] = parts;
5621
6432
  $[51] = t7;
5622
6433
  } else t7 = $[51];
@@ -5656,14 +6467,13 @@ function Block(t0) {
5656
6467
  const t3 = block.it;
5657
6468
  const t4 = block.it.model;
5658
6469
  let t5;
5659
- if ($[62] !== block.it.content || $[63] !== block.it.model) {
5660
- t5 = countTokens(block.it.content, block.it.model);
5661
- $[62] = block.it.content;
5662
- $[63] = block.it.model;
5663
- $[64] = t5;
5664
- } else t5 = $[64];
6470
+ if ($[62] !== block) {
6471
+ t5 = blockTokens(block);
6472
+ $[62] = block;
6473
+ $[63] = t5;
6474
+ } else t5 = $[63];
5665
6475
  let t6;
5666
- if ($[65] !== block.it || $[66] !== speaker || $[67] !== t5) {
6476
+ if ($[64] !== block.it || $[65] !== speaker || $[66] !== t5) {
5667
6477
  t6 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InstructionFile, {
5668
6478
  it: t3,
5669
6479
  model: t4,
@@ -5671,73 +6481,92 @@ function Block(t0) {
5671
6481
  speaker,
5672
6482
  className: "directive"
5673
6483
  });
5674
- $[65] = block.it;
5675
- $[66] = speaker;
5676
- $[67] = t5;
5677
- $[68] = t6;
5678
- } else t6 = $[68];
6484
+ $[64] = block.it;
6485
+ $[65] = speaker;
6486
+ $[66] = t5;
6487
+ $[67] = t6;
6488
+ } else t6 = $[67];
5679
6489
  return t6;
5680
6490
  }
6491
+ if (block.type === "mcp") {
6492
+ let t3;
6493
+ if ($[68] !== block.turn) {
6494
+ t3 = [block.turn];
6495
+ $[68] = block.turn;
6496
+ $[69] = t3;
6497
+ } else t3 = $[69];
6498
+ let t4;
6499
+ if ($[70] !== speaker || $[71] !== t3) {
6500
+ t4 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(McpBlock, {
6501
+ turns: t3,
6502
+ speaker
6503
+ });
6504
+ $[70] = speaker;
6505
+ $[71] = t3;
6506
+ $[72] = t4;
6507
+ } else t4 = $[72];
6508
+ return t4;
6509
+ }
5681
6510
  if (block.type === "system") {
5682
6511
  const className = `system-note ${block.level ?? ""} ${block.kind ?? ""}`;
5683
6512
  if (!block.body) {
5684
6513
  let t3;
5685
- if ($[69] !== block.title || $[70] !== block.url) {
6514
+ if ($[73] !== block.title || $[74] !== block.url) {
5686
6515
  t3 = block.url ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(OpenLink, {
5687
6516
  href: block.url,
5688
6517
  children: block.title
5689
6518
  }) : block.title;
5690
- $[69] = block.title;
5691
- $[70] = block.url;
5692
- $[71] = t3;
5693
- } else t3 = $[71];
6519
+ $[73] = block.title;
6520
+ $[74] = block.url;
6521
+ $[75] = t3;
6522
+ } else t3 = $[75];
5694
6523
  let t4;
5695
- if ($[72] !== speaker || $[73] !== t3) {
6524
+ if ($[76] !== speaker || $[77] !== t3) {
5696
6525
  t4 = said(speaker, t3);
5697
- $[72] = speaker;
5698
- $[73] = t3;
5699
- $[74] = t4;
5700
- } else t4 = $[74];
6526
+ $[76] = speaker;
6527
+ $[77] = t3;
6528
+ $[78] = t4;
6529
+ } else t4 = $[78];
5701
6530
  let t5;
5702
- if ($[75] !== className || $[76] !== t4) {
6531
+ if ($[79] !== className || $[80] !== t4) {
5703
6532
  t5 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label, {
5704
6533
  title: t4,
5705
6534
  className
5706
6535
  });
5707
- $[75] = className;
5708
- $[76] = t4;
5709
- $[77] = t5;
5710
- } else t5 = $[77];
6536
+ $[79] = className;
6537
+ $[80] = t4;
6538
+ $[81] = t5;
6539
+ } else t5 = $[81];
5711
6540
  return t5;
5712
6541
  }
5713
6542
  let t3;
5714
- if ($[78] !== block.title || $[79] !== speaker) {
6543
+ if ($[82] !== block.title || $[83] !== speaker) {
5715
6544
  t3 = said(speaker, block.title);
5716
- $[78] = block.title;
5717
- $[79] = speaker;
5718
- $[80] = t3;
5719
- } else t3 = $[80];
6545
+ $[82] = block.title;
6546
+ $[83] = speaker;
6547
+ $[84] = t3;
6548
+ } else t3 = $[84];
5720
6549
  const t4 = !block.folded;
5721
6550
  let t5;
5722
- if ($[81] !== block.body) {
6551
+ if ($[85] !== block.body) {
5723
6552
  t5 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", { children: block.body });
5724
- $[81] = block.body;
5725
- $[82] = t5;
5726
- } else t5 = $[82];
6553
+ $[85] = block.body;
6554
+ $[86] = t5;
6555
+ } else t5 = $[86];
5727
6556
  let t6;
5728
- if ($[83] !== className || $[84] !== t3 || $[85] !== t4 || $[86] !== t5) {
6557
+ if ($[87] !== className || $[88] !== t3 || $[89] !== t4 || $[90] !== t5) {
5729
6558
  t6 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collapsible, {
5730
6559
  title: t3,
5731
6560
  className,
5732
6561
  defaultOpen: t4,
5733
6562
  children: t5
5734
6563
  });
5735
- $[83] = className;
5736
- $[84] = t3;
5737
- $[85] = t4;
5738
- $[86] = t5;
5739
- $[87] = t6;
5740
- } else t6 = $[87];
6564
+ $[87] = className;
6565
+ $[88] = t3;
6566
+ $[89] = t4;
6567
+ $[90] = t5;
6568
+ $[91] = t6;
6569
+ } else t6 = $[91];
5741
6570
  return t6;
5742
6571
  }
5743
6572
  if (block.type === "image") {
@@ -5745,53 +6574,53 @@ function Block(t0) {
5745
6574
  if (src && src.type === "base64") {
5746
6575
  const t3 = `data:${src.media_type};base64,${src.data}`;
5747
6576
  let t4;
5748
- if ($[88] !== t3) {
6577
+ if ($[92] !== t3) {
5749
6578
  t4 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
5750
6579
  className: "block-image",
5751
6580
  src: t3,
5752
6581
  alt: ""
5753
6582
  });
5754
- $[88] = t3;
5755
- $[89] = t4;
5756
- } else t4 = $[89];
6583
+ $[92] = t3;
6584
+ $[93] = t4;
6585
+ } else t4 = $[93];
5757
6586
  return t4;
5758
6587
  }
5759
6588
  let t3;
5760
- if ($[90] === Symbol.for("react.memo_cache_sentinel")) {
6589
+ if ($[94] === Symbol.for("react.memo_cache_sentinel")) {
5761
6590
  t3 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
5762
6591
  className: "block-aux",
5763
6592
  children: "[image]"
5764
6593
  });
5765
- $[90] = t3;
5766
- } else t3 = $[90];
6594
+ $[94] = t3;
6595
+ } else t3 = $[94];
5767
6596
  return t3;
5768
6597
  }
5769
6598
  const t3 = block.type || "block";
5770
6599
  let t4;
5771
- if ($[91] !== block) {
6600
+ if ($[95] !== block) {
5772
6601
  t4 = safeJson(block);
5773
- $[91] = block;
5774
- $[92] = t4;
5775
- } else t4 = $[92];
6602
+ $[95] = block;
6603
+ $[96] = t4;
6604
+ } else t4 = $[96];
5776
6605
  let t5;
5777
- if ($[93] !== t4) {
6606
+ if ($[97] !== t4) {
5778
6607
  t5 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", { children: t4 });
5779
- $[93] = t4;
5780
- $[94] = t5;
5781
- } else t5 = $[94];
6608
+ $[97] = t4;
6609
+ $[98] = t5;
6610
+ } else t5 = $[98];
5782
6611
  let t6;
5783
- if ($[95] !== t3 || $[96] !== t5) {
6612
+ if ($[99] !== t3 || $[100] !== t5) {
5784
6613
  t6 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collapsible, {
5785
6614
  title: t3,
5786
6615
  children: t5
5787
6616
  });
5788
- $[95] = t3;
5789
- $[96] = t5;
5790
- $[97] = t6;
5791
- } else t6 = $[97];
6617
+ $[99] = t3;
6618
+ $[100] = t5;
6619
+ $[101] = t6;
6620
+ } else t6 = $[101];
5792
6621
  return t6;
5793
6622
  }
5794
- function _temp22(p, i) {
6623
+ function _temp30(p, i) {
5795
6624
  return p.type === "text" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SavedOutputLink, { text: p.text }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", { children: p.text })] }, i) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Block, { block: p }, i);
5796
6625
  }
5797
6626
  function SavedOutputLink(t0) {
@@ -5953,7 +6782,7 @@ function Collapsible(t0) {
5953
6782
  const t3 = `aux ${className || ""}`;
5954
6783
  let t4;
5955
6784
  if ($[0] !== setOpen) {
5956
- t4 = () => setOpen(_temp23);
6785
+ t4 = () => setOpen(_temp31);
5957
6786
  $[0] = setOpen;
5958
6787
  $[1] = t4;
5959
6788
  } else t4 = $[1];
@@ -6032,26 +6861,26 @@ function Collapsible(t0) {
6032
6861
  } else t12 = $[23];
6033
6862
  return t12;
6034
6863
  }
6035
- function _temp23(v) {
6864
+ function _temp31(v) {
6036
6865
  return !v;
6037
6866
  }
6038
6867
  var fmtElapsed = (ms) => ms < 1e3 ? "<1s" : fmtDuration(ms);
6039
- var ApproxTokens = (t0) => {
6040
- const $ = (0, import_compiler_runtime.c)(3);
6041
- const { tokens, tip: t1 } = t0;
6042
- const tip = t1 === void 0 ? "Approx. tokens" : t1;
6043
- let t2;
6044
- if ($[0] !== tip || $[1] !== tokens) {
6045
- t2 = tokens > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
6046
- className: "instruction-tokens",
6047
- "data-tooltip-content": tip,
6048
- children: ["~ ", fmtCompact(tokens)]
6868
+ var TotalTokens = (t0) => {
6869
+ const $ = (0, import_compiler_runtime.c)(2);
6870
+ const { tokens } = t0;
6871
+ let t1;
6872
+ if ($[0] !== tokens) {
6873
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
6874
+ className: "aux instruction-total",
6875
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ApproxTokens, {
6876
+ tokens,
6877
+ tip: "Approx. total tokens"
6878
+ })
6049
6879
  });
6050
- $[0] = tip;
6051
- $[1] = tokens;
6052
- $[2] = t2;
6053
- } else t2 = $[2];
6054
- return t2;
6880
+ $[0] = tokens;
6881
+ $[1] = t1;
6882
+ } else t1 = $[1];
6883
+ return t1;
6055
6884
  };
6056
6885
  function JsonBlock(t0) {
6057
6886
  const $ = (0, import_compiler_runtime.c)(2);
@@ -6073,7 +6902,7 @@ function InstructionRun(t0) {
6073
6902
  const { turns, model } = t0;
6074
6903
  let t1;
6075
6904
  if ($[0] !== model || $[1] !== turns) {
6076
- const strips = turns.flatMap(_temp24).map(_temp25);
6905
+ const strips = turns.flatMap(_temp32).map(_temp33);
6077
6906
  let t2;
6078
6907
  let t3;
6079
6908
  let t4;
@@ -6133,11 +6962,11 @@ function InstructionRun(t0) {
6133
6962
  } else t1 = $[2];
6134
6963
  return t1;
6135
6964
  }
6136
- function _temp25(t0) {
6965
+ function _temp33(t0) {
6137
6966
  const { it } = t0;
6138
6967
  return it;
6139
6968
  }
6140
- function _temp24(t) {
6969
+ function _temp32(t) {
6141
6970
  return t.blocks;
6142
6971
  }
6143
6972
  function InstructionFile(t0) {
@@ -6159,7 +6988,7 @@ function InstructionFile(t0) {
6159
6988
  t10 = `aux instruction-file ${className}`;
6160
6989
  t7 = "aux-toggle";
6161
6990
  if ($[14] !== setOpen) {
6162
- t8 = () => setOpen(_temp26);
6991
+ t8 = () => setOpen(_temp34);
6163
6992
  $[14] = setOpen;
6164
6993
  $[15] = t8;
6165
6994
  } else t8 = $[15];
@@ -6272,7 +7101,7 @@ function InstructionFile(t0) {
6272
7101
  } else t15 = $[38];
6273
7102
  return t15;
6274
7103
  }
6275
- function _temp26(v) {
7104
+ function _temp34(v) {
6276
7105
  return !v;
6277
7106
  }
6278
7107
  function ItemFolds(t0) {
@@ -6463,7 +7292,7 @@ function JsonlView(t0) {
6463
7292
  value,
6464
7293
  label: labelFor(parsed)
6465
7294
  };
6466
- }).filter(_temp$6);
7295
+ }).filter(_temp$7);
6467
7296
  t9 = "jsonl-viewer";
6468
7297
  const t11 = `jsonl-viewer-search${q ? " filter-active" : ""}`;
6469
7298
  let t12;
@@ -6622,7 +7451,7 @@ function JsonlView(t0) {
6622
7451
  } else t13 = $[35];
6623
7452
  return t13;
6624
7453
  }
6625
- function _temp$6(e) {
7454
+ function _temp$7(e) {
6626
7455
  return e !== void 0;
6627
7456
  }
6628
7457
  // src/renderer/ui/Errors.jsx
@@ -6727,7 +7556,7 @@ var AppCrashed = (t0) => {
6727
7556
  if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
6728
7557
  t3 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
6729
7558
  type: "button",
6730
- onClick: _temp$5,
7559
+ onClick: _temp$6,
6731
7560
  children: "Reload"
6732
7561
  });
6733
7562
  $[4] = t3;
@@ -6786,7 +7615,7 @@ var PaneErrorBoundary = (t0) => {
6786
7615
  } else t2 = $[5];
6787
7616
  return t2;
6788
7617
  };
6789
- function _temp$5() {
7618
+ function _temp$6() {
6790
7619
  return location.reload();
6791
7620
  }
6792
7621
  // src/renderer/sessions/view/RequestsView.jsx
@@ -6861,7 +7690,7 @@ var Pane = import_react.memo(function Pane(t0) {
6861
7690
  const paths = t1;
6862
7691
  let t2;
6863
7692
  if ($[2] !== paths) {
6864
- t2 = new Set(paths.filter(_temp2$3));
7693
+ t2 = new Set(paths.filter(_temp2$4));
6865
7694
  $[2] = paths;
6866
7695
  $[3] = t2;
6867
7696
  } else t2 = $[3];
@@ -7305,7 +8134,7 @@ function _temp4$2(o_1) {
7305
8134
  function _temp3$2(r) {
7306
8135
  return r.responseHeaders?.["request-id"];
7307
8136
  }
7308
- function _temp2$3(p) {
8137
+ function _temp2$4(p) {
7309
8138
  return !p.startsWith("messages");
7310
8139
  }
7311
8140
  // src/renderer/utils/effects.js
@@ -7434,8 +8263,8 @@ function AgentOutput(t0) {
7434
8263
  }
7435
8264
  // src/renderer/sessions/SessionSummary.jsx
7436
8265
  function SessionSummary(t0) {
7437
- const $ = (0, import_compiler_runtime.c)(236);
7438
- const { meta, items, instructions, requestLog, agent, granularity: t1 } = t0;
8266
+ const $ = (0, import_compiler_runtime.c)(242);
8267
+ const { meta, items, instructions, requestLog, debugLog, agent, granularity: t1 } = t0;
7439
8268
  const timeFormat = (t1 === void 0 ? "day" : t1) === "day" ? "pp" : "MMM d, pp";
7440
8269
  const t = meta.tokens;
7441
8270
  const totalTokens = meta.totalTokens;
@@ -7468,8 +8297,8 @@ function SessionSummary(t0) {
7468
8297
  let t9;
7469
8298
  if ($[18] !== items) {
7470
8299
  const turns = items ? flatten(items) : [];
7471
- rewinds = turns.filter(_temp$4).length;
7472
- t9 = turns.filter(_temp2$2);
8300
+ rewinds = turns.filter(_temp$5).length;
8301
+ t9 = turns.filter(_temp2$3);
7473
8302
  $[18] = items;
7474
8303
  $[19] = rewinds;
7475
8304
  $[20] = t9;
@@ -8142,111 +8971,135 @@ function SessionSummary(t0) {
8142
8971
  $[188] = meta.tag;
8143
8972
  $[189] = t48;
8144
8973
  } else t48 = $[189];
8145
- const t49 = meta.gitBranch || "—";
8146
- let t50;
8147
- if ($[190] !== t49) {
8148
- t50 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
8974
+ let t49;
8975
+ if ($[190] !== meta) {
8976
+ t49 = meta.experiment && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
8977
+ label: "Anthropic experiment",
8978
+ value: experimentText(meta),
8979
+ mono: true,
8980
+ full: true,
8981
+ autoselect: true
8982
+ });
8983
+ $[190] = meta;
8984
+ $[191] = t49;
8985
+ } else t49 = $[191];
8986
+ const t50 = meta.gitBranch || "—";
8987
+ let t51;
8988
+ if ($[192] !== t50) {
8989
+ t51 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
8149
8990
  label: "Git branch",
8150
- value: t49,
8991
+ value: t50,
8151
8992
  mono: true
8152
8993
  });
8153
- $[190] = t49;
8154
- $[191] = t50;
8155
- } else t50 = $[191];
8156
- const t51 = meta.source || meta.entrypoint || "—";
8157
- let t52;
8158
- if ($[192] !== t51) {
8159
- t52 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
8994
+ $[192] = t50;
8995
+ $[193] = t51;
8996
+ } else t51 = $[193];
8997
+ const t52 = meta.source || meta.entrypoint || "—";
8998
+ let t53;
8999
+ if ($[194] !== t52) {
9000
+ t53 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
8160
9001
  label: "Source",
8161
- value: t51
9002
+ value: t52
8162
9003
  });
8163
- $[192] = t51;
8164
- $[193] = t52;
8165
- } else t52 = $[193];
8166
- let t53;
8167
- if ($[194] !== meta.hasScheduledTask) {
8168
- t53 = meta.hasScheduledTask && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
9004
+ $[194] = t52;
9005
+ $[195] = t53;
9006
+ } else t53 = $[195];
9007
+ let t54;
9008
+ if ($[196] !== meta.hasScheduledTask) {
9009
+ t54 = meta.hasScheduledTask && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
8169
9010
  label: "Scheduled",
8170
9011
  value: "yes"
8171
9012
  });
8172
- $[194] = meta.hasScheduledTask;
8173
- $[195] = t53;
8174
- } else t53 = $[195];
8175
- const t54 = meta.version || "—";
8176
- let t55;
8177
- if ($[196] !== t54) {
8178
- t55 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
9013
+ $[196] = meta.hasScheduledTask;
9014
+ $[197] = t54;
9015
+ } else t54 = $[197];
9016
+ const t55 = meta.version || "—";
9017
+ let t56;
9018
+ if ($[198] !== t55) {
9019
+ t56 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
8179
9020
  label: "CLI version",
8180
- value: t54,
9021
+ value: t55,
8181
9022
  mono: true
8182
9023
  });
8183
- $[196] = t54;
8184
- $[197] = t55;
8185
- } else t55 = $[197];
8186
- const t56 = meta.project || "—";
8187
- let t57;
8188
- if ($[198] !== t56) {
8189
- t57 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
8190
- label: "Project",
8191
- value: t56,
8192
- mono: true,
8193
- full: true,
8194
- autoselect: true
8195
- });
8196
- $[198] = t56;
8197
- $[199] = t57;
8198
- } else t57 = $[199];
9024
+ $[198] = t55;
9025
+ $[199] = t56;
9026
+ } else t56 = $[199];
9027
+ const t57 = meta.project || "—";
8199
9028
  let t58;
8200
- if ($[200] !== meta.subdir) {
8201
- t58 = meta.subdir && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
8202
- label: "Subfolder",
8203
- value: meta.subdir,
9029
+ if ($[200] !== t57) {
9030
+ t58 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
9031
+ label: "Project",
9032
+ value: t57,
8204
9033
  mono: true,
8205
9034
  full: true,
8206
9035
  autoselect: true
8207
9036
  });
8208
- $[200] = meta.subdir;
9037
+ $[200] = t57;
8209
9038
  $[201] = t58;
8210
9039
  } else t58 = $[201];
8211
9040
  let t59;
8212
- if ($[202] !== meta.worktreePath) {
8213
- t59 = meta.worktreePath && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
8214
- label: "Worktree",
8215
- value: meta.worktreePath,
9041
+ if ($[202] !== meta.subdir) {
9042
+ t59 = meta.subdir && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
9043
+ label: "Subfolder",
9044
+ value: meta.subdir,
8216
9045
  mono: true,
8217
9046
  full: true,
8218
9047
  autoselect: true
8219
9048
  });
8220
- $[202] = meta.worktreePath;
9049
+ $[202] = meta.subdir;
8221
9050
  $[203] = t59;
8222
9051
  } else t59 = $[203];
8223
9052
  let t60;
8224
- if ($[204] !== meta.filePath) {
8225
- t60 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
8226
- label: "Log file",
8227
- value: meta.filePath,
9053
+ if ($[204] !== meta.worktreePath) {
9054
+ t60 = meta.worktreePath && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
9055
+ label: "Worktree",
9056
+ value: meta.worktreePath,
8228
9057
  mono: true,
8229
9058
  full: true,
8230
9059
  autoselect: true
8231
9060
  });
8232
- $[204] = meta.filePath;
9061
+ $[204] = meta.worktreePath;
8233
9062
  $[205] = t60;
8234
9063
  } else t60 = $[205];
8235
9064
  let t61;
8236
- if ($[206] !== requestLog) {
8237
- t61 = requestLog && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
8238
- label: "Proxy log",
8239
- value: requestLog,
9065
+ if ($[206] !== meta.filePath) {
9066
+ t61 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
9067
+ label: "Log file",
9068
+ value: meta.filePath,
8240
9069
  mono: true,
8241
9070
  full: true,
8242
9071
  autoselect: true
8243
9072
  });
8244
- $[206] = requestLog;
9073
+ $[206] = meta.filePath;
8245
9074
  $[207] = t61;
8246
9075
  } else t61 = $[207];
8247
9076
  let t62;
8248
- if ($[208] !== t43 || $[209] !== t44 || $[210] !== t45 || $[211] !== t46 || $[212] !== t47 || $[213] !== t48 || $[214] !== t50 || $[215] !== t52 || $[216] !== t53 || $[217] !== t55 || $[218] !== t57 || $[219] !== t58 || $[220] !== t59 || $[221] !== t60 || $[222] !== t61) {
8249
- t62 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Section, {
9077
+ if ($[208] !== requestLog) {
9078
+ t62 = requestLog && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
9079
+ label: "Proxy log",
9080
+ value: requestLog,
9081
+ mono: true,
9082
+ full: true,
9083
+ autoselect: true
9084
+ });
9085
+ $[208] = requestLog;
9086
+ $[209] = t62;
9087
+ } else t62 = $[209];
9088
+ let t63;
9089
+ if ($[210] !== debugLog) {
9090
+ t63 = debugLog && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
9091
+ label: "Debug log",
9092
+ value: debugLog,
9093
+ mono: true,
9094
+ full: true,
9095
+ autoselect: true
9096
+ });
9097
+ $[210] = debugLog;
9098
+ $[211] = t63;
9099
+ } else t63 = $[211];
9100
+ let t64;
9101
+ if ($[212] !== t43 || $[213] !== t44 || $[214] !== t45 || $[215] !== t46 || $[216] !== t47 || $[217] !== t48 || $[218] !== t49 || $[219] !== t51 || $[220] !== t53 || $[221] !== t54 || $[222] !== t56 || $[223] !== t58 || $[224] !== t59 || $[225] !== t60 || $[226] !== t61 || $[227] !== t62 || $[228] !== t63) {
9102
+ t64 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Section, {
8250
9103
  title: "Identity",
8251
9104
  children: [
8252
9105
  t43,
@@ -8256,37 +9109,41 @@ function SessionSummary(t0) {
8256
9109
  t46,
8257
9110
  t47,
8258
9111
  t48,
8259
- t50,
8260
- t52,
9112
+ t49,
9113
+ t51,
8261
9114
  t53,
8262
- t55,
8263
- t57,
9115
+ t54,
9116
+ t56,
8264
9117
  t58,
8265
9118
  t59,
8266
9119
  t60,
8267
- t61
9120
+ t61,
9121
+ t62,
9122
+ t63
8268
9123
  ]
8269
9124
  });
8270
- $[208] = t43;
8271
- $[209] = t44;
8272
- $[210] = t45;
8273
- $[211] = t46;
8274
- $[212] = t47;
8275
- $[213] = t48;
8276
- $[214] = t50;
8277
- $[215] = t52;
8278
- $[216] = t53;
8279
- $[217] = t55;
8280
- $[218] = t57;
8281
- $[219] = t58;
8282
- $[220] = t59;
8283
- $[221] = t60;
8284
- $[222] = t61;
8285
- $[223] = t62;
8286
- } else t62 = $[223];
8287
- let t63;
8288
- if ($[224] !== t26 || $[225] !== t3 || $[226] !== t4 || $[227] !== t42 || $[228] !== t5 || $[229] !== t6 || $[230] !== t62) {
8289
- t63 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
9125
+ $[212] = t43;
9126
+ $[213] = t44;
9127
+ $[214] = t45;
9128
+ $[215] = t46;
9129
+ $[216] = t47;
9130
+ $[217] = t48;
9131
+ $[218] = t49;
9132
+ $[219] = t51;
9133
+ $[220] = t53;
9134
+ $[221] = t54;
9135
+ $[222] = t56;
9136
+ $[223] = t58;
9137
+ $[224] = t59;
9138
+ $[225] = t60;
9139
+ $[226] = t61;
9140
+ $[227] = t62;
9141
+ $[228] = t63;
9142
+ $[229] = t64;
9143
+ } else t64 = $[229];
9144
+ let t65;
9145
+ if ($[230] !== t26 || $[231] !== t3 || $[232] !== t4 || $[233] !== t42 || $[234] !== t5 || $[235] !== t6 || $[236] !== t64) {
9146
+ t65 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
8290
9147
  className: t3,
8291
9148
  children: [
8292
9149
  t4,
@@ -8294,30 +9151,30 @@ function SessionSummary(t0) {
8294
9151
  t6,
8295
9152
  t26,
8296
9153
  t42,
8297
- t62
9154
+ t64
8298
9155
  ]
8299
9156
  });
8300
- $[224] = t26;
8301
- $[225] = t3;
8302
- $[226] = t4;
8303
- $[227] = t42;
8304
- $[228] = t5;
8305
- $[229] = t6;
8306
- $[230] = t62;
8307
- $[231] = t63;
8308
- } else t63 = $[231];
8309
- let t64;
8310
- if ($[232] !== t63 || $[233] !== t7 || $[234] !== t8) {
8311
- t64 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
9157
+ $[230] = t26;
9158
+ $[231] = t3;
9159
+ $[232] = t4;
9160
+ $[233] = t42;
9161
+ $[234] = t5;
9162
+ $[235] = t6;
9163
+ $[236] = t64;
9164
+ $[237] = t65;
9165
+ } else t65 = $[237];
9166
+ let t66;
9167
+ if ($[238] !== t65 || $[239] !== t7 || $[240] !== t8) {
9168
+ t66 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
8312
9169
  className: t7,
8313
- children: [t8, t63]
9170
+ children: [t8, t65]
8314
9171
  });
8315
- $[232] = t63;
8316
- $[233] = t7;
8317
- $[234] = t8;
8318
- $[235] = t64;
8319
- } else t64 = $[235];
8320
- return t64;
9172
+ $[238] = t65;
9173
+ $[239] = t7;
9174
+ $[240] = t8;
9175
+ $[241] = t66;
9176
+ } else t66 = $[241];
9177
+ return t66;
8321
9178
  }
8322
9179
  function _temp3$1(e_0) {
8323
9180
  if (e_0.key === "Enter" && !e_0.shiftKey) {
@@ -8325,10 +9182,10 @@ function _temp3$1(e_0) {
8325
9182
  e_0.currentTarget.form.requestSubmit();
8326
9183
  }
8327
9184
  }
8328
- function _temp2$2(t_1) {
9185
+ function _temp2$3(t_1) {
8329
9186
  return t_1.role === "compact";
8330
9187
  }
8331
- function _temp$4(t_0) {
9188
+ function _temp$5(t_0) {
8332
9189
  return t_0.rewind;
8333
9190
  }
8334
9191
  function Section(t0) {
@@ -8551,6 +9408,7 @@ function renderBlock(b, model) {
8551
9408
  const body = it.error ? fence(`error: ${it.error}`) : it.items?.length ? renderItems(it, own) : fence(it.content || "");
8552
9409
  return `_${instructionTitle(it, model)}_${size(it.content, own)}${path}\n${body}`;
8553
9410
  }
9411
+ if (b.type === "mcp") return renderMcp(b.turn);
8554
9412
  return fence(safeJson(b), "json");
8555
9413
  }
8556
9414
  function renderTurn(t, seen, model) {
@@ -8586,7 +9444,19 @@ function renderTranscript(turns, { forkedFrom, forkedAt, continuesFrom }) {
8586
9444
  }
8587
9445
  return rows.filter(Boolean).join("\n\n---\n\n");
8588
9446
  }
8589
- function markdownSession(meta, items, instructions = {}, requestLog = null) {
9447
+ function renderMcp(turn) {
9448
+ const title = turn.change ? "MCP servers changed" : turn.debug ? "MCP servers connected (debug log)" : "MCP servers";
9449
+ const status = (s) => `${s.status}${s.ms === null ? "" : ` in ${s.ms}ms`}${s.readyWithin != null ? ` within ${s.readyWithin}ms of the request that found it connecting` : ""}`;
9450
+ const server = (s) => `- ${s.name}: ${[
9451
+ s.version && `version ${s.version}`,
9452
+ s.cached && "cached",
9453
+ s.transport,
9454
+ status(s),
9455
+ s.toolCount != null && plural(s.toolCount, "tool")
9456
+ ].filter(Boolean).join(", ")}${s.error ? ` (${s.error})` : ""}` + s.groups.map((g) => `\n - mounted ${g.name}: ${plural(g.toolCount, "tool")}`).join("") + s.stderr.map((line) => `\n - stderr: ${line}`).join("") + s.tools.map((t) => `\n - tool ${t.name}${t.ms === null ? "" : `: ${t.ms}ms`}${t.error ? ` (failed: ${t.error})` : ""}`).join("");
9457
+ return `_${title}_\n${turn.servers.map(server).join("\n")}`;
9458
+ }
9459
+ function markdownSession(meta, items, instructions = {}, requestLog = null, debugLog = null) {
8590
9460
  const t = meta.tokens;
8591
9461
  const stu = meta.serverToolUse;
8592
9462
  const wallDuration = meta.lastActivityAt - meta.startedAt;
@@ -8641,6 +9511,7 @@ ${compactions ? `- Compactions: ${fmtNum(compactions)}
8641
9511
  - Service tier: ${meta.serviceTier || "—"}
8642
9512
  - Speed: ${meta.speed ? meta.speed === "fast" ? meta.fastPricingUnknown ? "fast (pricing unknown)" : "fast" : meta.speed : "—"}
8643
9513
  ${meta.tag ? `- Tag: ${meta.tag}
9514
+ ` : ""}${meta.experiment ? `- Anthropic experiment: ${experimentText(meta)}
8644
9515
  ` : ""}- Git branch: ${meta.gitBranch || "—"}
8645
9516
  - Source: ${meta.source || meta.entrypoint || "—"}
8646
9517
  - Scheduled: ${meta.hasScheduledTask ? "yes" : "no"}
@@ -8648,6 +9519,7 @@ ${meta.tag ? `- Tag: ${meta.tag}
8648
9519
  - Project: ${meta.project || "—"}
8649
9520
  ${meta.subdir ? `- Subfolder: ${meta.subdir}\n` : ""}${meta.worktreePath ? `- Worktree: ${meta.worktreePath}\n` : ""}- Log file: ${meta.filePath}
8650
9521
  ${requestLog ? `- Proxy log: ${requestLog}
9522
+ ` : ""}${debugLog ? `- Debug log: ${debugLog}
8651
9523
  ` : ""}`)}
8652
9524
  </summary>
8653
9525
 
@@ -8680,8 +9552,8 @@ var EMPTY = {
8680
9552
  error: ""
8681
9553
  };
8682
9554
  function useAgent(key, meta, t0) {
8683
- const $ = (0, import_compiler_runtime.c)(21);
8684
- const { items, instructions, requestLog } = t0;
9555
+ const $ = (0, import_compiler_runtime.c)(22);
9556
+ const { items, instructions, requestLog, debugLog } = t0;
8685
9557
  let t1;
8686
9558
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
8687
9559
  t1 = {};
@@ -8719,12 +9591,12 @@ function useAgent(key, meta, t0) {
8719
9591
  }
8720
9592
  (0, import_react.useEffect)(t3, t4);
8721
9593
  let t5;
8722
- if ($[4] !== instructions || $[5] !== items || $[6] !== key || $[7] !== meta || $[8] !== requestLog) {
9594
+ if ($[4] !== debugLog || $[5] !== instructions || $[6] !== items || $[7] !== key || $[8] !== meta || $[9] !== requestLog) {
8723
9595
  t5 = async (prompt, tag) => {
8724
- patch(key, _temp$3);
9596
+ patch(key, _temp$4);
8725
9597
  let error = "";
8726
9598
  try {
8727
- const { body } = markdownSession(meta, items, instructions, requestLog);
9599
+ const { body } = markdownSession(meta, items, instructions, requestLog, debugLog);
8728
9600
  const { code } = await window.api.runAgentPrompt({
8729
9601
  id: key,
8730
9602
  prompt: `${prompt}\n\n---\n${body}`,
@@ -8741,53 +9613,54 @@ function useAgent(key, meta, t0) {
8741
9613
  error
8742
9614
  }));
8743
9615
  };
8744
- $[4] = instructions;
8745
- $[5] = items;
8746
- $[6] = key;
8747
- $[7] = meta;
8748
- $[8] = requestLog;
8749
- $[9] = t5;
8750
- } else t5 = $[9];
9616
+ $[4] = debugLog;
9617
+ $[5] = instructions;
9618
+ $[6] = items;
9619
+ $[7] = key;
9620
+ $[8] = meta;
9621
+ $[9] = requestLog;
9622
+ $[10] = t5;
9623
+ } else t5 = $[10];
8751
9624
  const run = t5;
8752
9625
  let t6;
8753
- if ($[10] !== run) {
9626
+ if ($[11] !== run) {
8754
9627
  t6 = () => run(analyzePrompt, "claude-discover:analyze");
8755
- $[10] = run;
8756
- $[11] = t6;
8757
- } else t6 = $[11];
9628
+ $[11] = run;
9629
+ $[12] = t6;
9630
+ } else t6 = $[12];
8758
9631
  const analyze = t6;
8759
9632
  let t7;
8760
- if ($[12] !== run) {
9633
+ if ($[13] !== run) {
8761
9634
  t7 = () => run(diagnosePrompt, "claude-discover:diagnose");
8762
- $[12] = run;
8763
- $[13] = t7;
8764
- } else t7 = $[13];
9635
+ $[13] = run;
9636
+ $[14] = t7;
9637
+ } else t7 = $[14];
8765
9638
  const diagnose = t7;
8766
9639
  let t8;
8767
- if ($[14] !== run) {
9640
+ if ($[15] !== run) {
8768
9641
  t8 = (question) => run(askPrompt(question), "claude-discover:ask");
8769
- $[14] = run;
8770
- $[15] = t8;
8771
- } else t8 = $[15];
9642
+ $[15] = run;
9643
+ $[16] = t8;
9644
+ } else t8 = $[16];
8772
9645
  const ask = t8;
8773
9646
  const t9 = results[key] ?? EMPTY;
8774
9647
  let t10;
8775
- if ($[16] !== analyze || $[17] !== ask || $[18] !== diagnose || $[19] !== t9) {
9648
+ if ($[17] !== analyze || $[18] !== ask || $[19] !== diagnose || $[20] !== t9) {
8776
9649
  t10 = {
8777
9650
  ...t9,
8778
9651
  analyze,
8779
9652
  diagnose,
8780
9653
  ask
8781
9654
  };
8782
- $[16] = analyze;
8783
- $[17] = ask;
8784
- $[18] = diagnose;
8785
- $[19] = t9;
8786
- $[20] = t10;
8787
- } else t10 = $[20];
9655
+ $[17] = analyze;
9656
+ $[18] = ask;
9657
+ $[19] = diagnose;
9658
+ $[20] = t9;
9659
+ $[21] = t10;
9660
+ } else t10 = $[21];
8788
9661
  return t10;
8789
9662
  }
8790
- function _temp$3() {
9663
+ function _temp$4() {
8791
9664
  return {
8792
9665
  ...EMPTY,
8793
9666
  running: true
@@ -8797,7 +9670,8 @@ function _temp$3() {
8797
9670
  var NOT_READ = {
8798
9671
  items: null,
8799
9672
  instructions: {},
8800
- requestLog: null
9673
+ requestLog: null,
9674
+ debugLog: null
8801
9675
  };
8802
9676
  var TABS = [
8803
9677
  {
@@ -8814,7 +9688,7 @@ var TABS = [
8814
9688
  }
8815
9689
  ];
8816
9690
  function Session(t0) {
8817
- const $ = (0, import_compiler_runtime.c)(60);
9691
+ const $ = (0, import_compiler_runtime.c)(61);
8818
9692
  const { meta, missing, date, granularity: t1, onShowPeriodOf } = t0;
8819
9693
  const granularity = t1 === void 0 ? "day" : t1;
8820
9694
  const [read, setRead] = (0, import_react.useState)(NOT_READ);
@@ -8830,7 +9704,7 @@ function Session(t0) {
8830
9704
  const filePath = meta?.filePath;
8831
9705
  const fileSize = meta?.fileSize;
8832
9706
  const desktop = meta?.entrypoint === "claude-desktop";
8833
- const { items, instructions, requestLog } = read;
9707
+ const { items, instructions, requestLog, debugLog } = read;
8834
9708
  const viewKey = `${filePath}|${date}|${granularity}`;
8835
9709
  const agent = useAgent(viewKey, meta, read);
8836
9710
  const [readKey, setReadKey] = (0, import_react.useState)(viewKey);
@@ -9038,26 +9912,28 @@ function Session(t0) {
9038
9912
  $[48] = t16;
9039
9913
  } else t16 = $[48];
9040
9914
  let t17;
9041
- if ($[49] !== agent || $[50] !== granularity || $[51] !== instructions || $[52] !== items || $[53] !== meta || $[54] !== requestLog || $[55] !== viewKey) {
9915
+ if ($[49] !== agent || $[50] !== debugLog || $[51] !== granularity || $[52] !== instructions || $[53] !== items || $[54] !== meta || $[55] !== requestLog || $[56] !== viewKey) {
9042
9916
  t17 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SessionSummary, {
9043
9917
  meta,
9044
9918
  items,
9045
9919
  instructions,
9046
9920
  requestLog,
9921
+ debugLog,
9047
9922
  agent,
9048
9923
  granularity
9049
9924
  }, viewKey);
9050
9925
  $[49] = agent;
9051
- $[50] = granularity;
9052
- $[51] = instructions;
9053
- $[52] = items;
9054
- $[53] = meta;
9055
- $[54] = requestLog;
9056
- $[55] = viewKey;
9057
- $[56] = t17;
9058
- } else t17 = $[56];
9926
+ $[50] = debugLog;
9927
+ $[51] = granularity;
9928
+ $[52] = instructions;
9929
+ $[53] = items;
9930
+ $[54] = meta;
9931
+ $[55] = requestLog;
9932
+ $[56] = viewKey;
9933
+ $[57] = t17;
9934
+ } else t17 = $[57];
9059
9935
  let t18;
9060
- if ($[57] !== t16 || $[58] !== t17) {
9936
+ if ($[58] !== t16 || $[59] !== t17) {
9061
9937
  t18 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
9062
9938
  className: "session-view",
9063
9939
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
@@ -9074,12 +9950,406 @@ function Session(t0) {
9074
9950
  })
9075
9951
  })
9076
9952
  });
9077
- $[57] = t16;
9078
- $[58] = t17;
9079
- $[59] = t18;
9080
- } else t18 = $[59];
9953
+ $[58] = t16;
9954
+ $[59] = t17;
9955
+ $[60] = t18;
9956
+ } else t18 = $[60];
9081
9957
  return t18;
9082
9958
  }
9959
+ // src/renderer/experiments/ExperimentDetails.jsx
9960
+ var fmtAt = (ts) => format(ts, "MMM d, HH:mm");
9961
+ var listOf = (values) => [...new Set(values.filter(Boolean))].sort().join(", ") || "—";
9962
+ var replyModels = (sessions) => [...new Set(sessions.flatMap((s) => s.models ?? []).map((m) => m.replace(/\[.*\]$/, "")))].sort();
9963
+ var isModelMap = (v) => v && typeof v === "object" && Object.values(v).every((m) => typeof m === "string" && m.startsWith("claude-"));
9964
+ function ExperimentDetails(t0) {
9965
+ const $ = (0, import_compiler_runtime.c)(84);
9966
+ const { id, sessions, anchor, granularity, onClose } = t0;
9967
+ const [cached, setCached] = (0, import_react.useState)(void 0);
9968
+ let t1;
9969
+ let t2;
9970
+ if ($[0] !== id) {
9971
+ t1 = () => {
9972
+ let cancelled = false;
9973
+ window.api.readExperiments().then((all) => {
9974
+ if (!cancelled) setCached(all[id] ?? null);
9975
+ }, () => {
9976
+ if (!cancelled) setCached(null);
9977
+ });
9978
+ return () => {
9979
+ cancelled = true;
9980
+ };
9981
+ };
9982
+ t2 = [id];
9983
+ $[0] = id;
9984
+ $[1] = t1;
9985
+ $[2] = t2;
9986
+ } else {
9987
+ t1 = $[1];
9988
+ t2 = $[2];
9989
+ }
9990
+ (0, import_react.useEffect)(t1, t2);
9991
+ let own;
9992
+ let t10;
9993
+ let t11;
9994
+ let t12;
9995
+ let t13;
9996
+ let t14;
9997
+ let t15;
9998
+ let t16;
9999
+ let t17;
10000
+ let t18;
10001
+ let t19;
10002
+ let t3;
10003
+ let t4;
10004
+ let t5;
10005
+ let t6;
10006
+ let t7;
10007
+ let t8;
10008
+ let t9;
10009
+ if ($[3] !== anchor || $[4] !== cached?.name || $[5] !== granularity || $[6] !== id || $[7] !== onClose || $[8] !== sessions) {
10010
+ let t20;
10011
+ if ($[27] !== id) {
10012
+ t20 = (s) => s.experiment === id;
10013
+ $[27] = id;
10014
+ $[28] = t20;
10015
+ } else t20 = $[28];
10016
+ own = sessions.filter(t20);
10017
+ const spans = experimentLanes(own)[0]?.spans ?? [];
10018
+ const name = own[0]?.experimentName ?? cached?.name ?? null;
10019
+ t18 = "experiment-details";
10020
+ let t21;
10021
+ if ($[29] !== id) {
10022
+ t21 = experimentColor(id);
10023
+ $[29] = id;
10024
+ $[30] = t21;
10025
+ } else t21 = $[30];
10026
+ let t22;
10027
+ if ($[31] !== t21) {
10028
+ t22 = { color: t21 };
10029
+ $[31] = t21;
10030
+ $[32] = t22;
10031
+ } else t22 = $[32];
10032
+ let t23;
10033
+ if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
10034
+ t23 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FlaskConical, { size: 15 });
10035
+ $[33] = t23;
10036
+ } else t23 = $[33];
10037
+ const t24 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("h2", {
10038
+ style: t22,
10039
+ children: [
10040
+ t23,
10041
+ " ",
10042
+ experimentLabel(id, name)
10043
+ ]
10044
+ });
10045
+ let t25;
10046
+ if ($[34] === Symbol.for("react.memo_cache_sentinel")) {
10047
+ t25 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(X, { size: 15 });
10048
+ $[34] = t25;
10049
+ } else t25 = $[34];
10050
+ let t26;
10051
+ if ($[35] !== onClose) {
10052
+ t26 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
10053
+ type: "button",
10054
+ className: "experiment-details-close",
10055
+ onClick: onClose,
10056
+ "aria-label": "Close",
10057
+ "data-tooltip-content": "Back to the session",
10058
+ children: t25
10059
+ });
10060
+ $[35] = onClose;
10061
+ $[36] = t26;
10062
+ } else t26 = $[36];
10063
+ if ($[37] !== t24 || $[38] !== t26) {
10064
+ t19 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("header", {
10065
+ className: "experiment-details-header",
10066
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
10067
+ className: "experiment-details-header-row",
10068
+ children: [t24, t26]
10069
+ })
10070
+ });
10071
+ $[37] = t24;
10072
+ $[38] = t26;
10073
+ $[39] = t19;
10074
+ } else t19 = $[39];
10075
+ t17 = "experiment-details-body";
10076
+ t15 = "experiment-details-content";
10077
+ if ($[40] === Symbol.for("react.memo_cache_sentinel")) {
10078
+ t16 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("blockquote", {
10079
+ className: "experiment-intro",
10080
+ children: "Anthropic runs A/B experiments in Claude Code: some users get different features or settings than others. Claude Code records which experiment a session was in, but not all it changes. Anthropic says it doesn't degrade its models to cope with demand. Below is what your own data shows about this one."
10081
+ });
10082
+ t5 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", { children: "Id" });
10083
+ $[40] = t16;
10084
+ $[41] = t5;
10085
+ } else {
10086
+ t16 = $[40];
10087
+ t5 = $[41];
10088
+ }
10089
+ if ($[42] !== id) {
10090
+ t6 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", {
10091
+ className: "mono selectable",
10092
+ children: id
10093
+ });
10094
+ $[42] = id;
10095
+ $[43] = t6;
10096
+ } else t6 = $[43];
10097
+ if ($[44] === Symbol.for("react.memo_cache_sentinel")) {
10098
+ t7 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", { children: "Selected period" });
10099
+ $[44] = t7;
10100
+ } else t7 = $[44];
10101
+ let t27;
10102
+ if ($[45] !== anchor || $[46] !== granularity) {
10103
+ t27 = periodTitle(anchor, granularity);
10104
+ $[45] = anchor;
10105
+ $[46] = granularity;
10106
+ $[47] = t27;
10107
+ } else t27 = $[47];
10108
+ if ($[48] !== t27) {
10109
+ t8 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", { children: t27 });
10110
+ $[48] = t27;
10111
+ $[49] = t8;
10112
+ } else t8 = $[49];
10113
+ if ($[50] === Symbol.for("react.memo_cache_sentinel")) {
10114
+ t9 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", { children: "Sessions" });
10115
+ $[50] = t9;
10116
+ } else t9 = $[50];
10117
+ t10 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", { children: own.length });
10118
+ t11 = spans.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", { children: "Active" }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("dd", { children: [
10119
+ fmtAt(spans[0].start),
10120
+ " → ",
10121
+ fmtAt(spans.at(-1).end)
10122
+ ] })] });
10123
+ if ($[51] === Symbol.for("react.memo_cache_sentinel")) {
10124
+ t12 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", { children: "Models" });
10125
+ $[51] = t12;
10126
+ } else t12 = $[51];
10127
+ t13 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", {
10128
+ className: "mono",
10129
+ children: listOf(own.flatMap(_temp$3))
10130
+ });
10131
+ if ($[52] === Symbol.for("react.memo_cache_sentinel")) {
10132
+ t14 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", { children: "CLI versions" });
10133
+ $[52] = t14;
10134
+ } else t14 = $[52];
10135
+ t3 = "mono";
10136
+ t4 = listOf(own.map(_temp2$2));
10137
+ $[3] = anchor;
10138
+ $[4] = cached?.name;
10139
+ $[5] = granularity;
10140
+ $[6] = id;
10141
+ $[7] = onClose;
10142
+ $[8] = sessions;
10143
+ $[9] = own;
10144
+ $[10] = t10;
10145
+ $[11] = t11;
10146
+ $[12] = t12;
10147
+ $[13] = t13;
10148
+ $[14] = t14;
10149
+ $[15] = t15;
10150
+ $[16] = t16;
10151
+ $[17] = t17;
10152
+ $[18] = t18;
10153
+ $[19] = t19;
10154
+ $[20] = t3;
10155
+ $[21] = t4;
10156
+ $[22] = t5;
10157
+ $[23] = t6;
10158
+ $[24] = t7;
10159
+ $[25] = t8;
10160
+ $[26] = t9;
10161
+ } else {
10162
+ own = $[9];
10163
+ t10 = $[10];
10164
+ t11 = $[11];
10165
+ t12 = $[12];
10166
+ t13 = $[13];
10167
+ t14 = $[14];
10168
+ t15 = $[15];
10169
+ t16 = $[16];
10170
+ t17 = $[17];
10171
+ t18 = $[18];
10172
+ t19 = $[19];
10173
+ t3 = $[20];
10174
+ t4 = $[21];
10175
+ t5 = $[22];
10176
+ t6 = $[23];
10177
+ t7 = $[24];
10178
+ t8 = $[25];
10179
+ t9 = $[26];
10180
+ }
10181
+ let t20;
10182
+ if ($[53] !== t3 || $[54] !== t4) {
10183
+ t20 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", {
10184
+ className: t3,
10185
+ children: t4
10186
+ });
10187
+ $[53] = t3;
10188
+ $[54] = t4;
10189
+ $[55] = t20;
10190
+ } else t20 = $[55];
10191
+ let t21;
10192
+ if ($[56] !== t10 || $[57] !== t11 || $[58] !== t12 || $[59] !== t13 || $[60] !== t14 || $[61] !== t20 || $[62] !== t5 || $[63] !== t6 || $[64] !== t7 || $[65] !== t8 || $[66] !== t9) {
10193
+ t21 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("dl", { children: [
10194
+ t5,
10195
+ t6,
10196
+ t7,
10197
+ t8,
10198
+ t9,
10199
+ t10,
10200
+ t11,
10201
+ t12,
10202
+ t13,
10203
+ t14,
10204
+ t20
10205
+ ] });
10206
+ $[56] = t10;
10207
+ $[57] = t11;
10208
+ $[58] = t12;
10209
+ $[59] = t13;
10210
+ $[60] = t14;
10211
+ $[61] = t20;
10212
+ $[62] = t5;
10213
+ $[63] = t6;
10214
+ $[64] = t7;
10215
+ $[65] = t8;
10216
+ $[66] = t9;
10217
+ $[67] = t21;
10218
+ } else t21 = $[67];
10219
+ let t22;
10220
+ if ($[68] === Symbol.for("react.memo_cache_sentinel")) {
10221
+ t22 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h4", { children: "Settings delivered with it" });
10222
+ $[68] = t22;
10223
+ } else t22 = $[68];
10224
+ let t23;
10225
+ if ($[69] !== cached || $[70] !== own) {
10226
+ t23 = cached === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
10227
+ className: "experiment-note",
10228
+ children: "Reading…"
10229
+ }) : cached ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Settings, {
10230
+ ...cached,
10231
+ sessions: own
10232
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
10233
+ className: "experiment-note",
10234
+ children: "Not cached anymore: Claude Code keeps only the experiments it's in now."
10235
+ });
10236
+ $[69] = cached;
10237
+ $[70] = own;
10238
+ $[71] = t23;
10239
+ } else t23 = $[71];
10240
+ let t24;
10241
+ if ($[72] !== t15 || $[73] !== t16 || $[74] !== t21 || $[75] !== t23) {
10242
+ t24 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
10243
+ className: t15,
10244
+ children: [
10245
+ t16,
10246
+ t21,
10247
+ t22,
10248
+ t23
10249
+ ]
10250
+ });
10251
+ $[72] = t15;
10252
+ $[73] = t16;
10253
+ $[74] = t21;
10254
+ $[75] = t23;
10255
+ $[76] = t24;
10256
+ } else t24 = $[76];
10257
+ let t25;
10258
+ if ($[77] !== t17 || $[78] !== t24) {
10259
+ t25 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
10260
+ className: t17,
10261
+ children: t24
10262
+ });
10263
+ $[77] = t17;
10264
+ $[78] = t24;
10265
+ $[79] = t25;
10266
+ } else t25 = $[79];
10267
+ let t26;
10268
+ if ($[80] !== t18 || $[81] !== t19 || $[82] !== t25) {
10269
+ t26 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
10270
+ className: t18,
10271
+ children: [t19, t25]
10272
+ });
10273
+ $[80] = t18;
10274
+ $[81] = t19;
10275
+ $[82] = t25;
10276
+ $[83] = t26;
10277
+ } else t26 = $[83];
10278
+ return t26;
10279
+ }
10280
+ function _temp2$2(s_1) {
10281
+ return s_1.version;
10282
+ }
10283
+ function _temp$3(s_0) {
10284
+ return s_0.models ?? [];
10285
+ }
10286
+ function Settings(t0) {
10287
+ const $ = (0, import_compiler_runtime.c)(8);
10288
+ const { settings, cachedAt, sessions } = t0;
10289
+ let t1;
10290
+ if ($[0] !== cachedAt || $[1] !== sessions || $[2] !== settings) {
10291
+ const entries = Object.entries(settings);
10292
+ let t2;
10293
+ if ($[4] !== cachedAt) {
10294
+ t2 = fmtAt(cachedAt);
10295
+ $[4] = cachedAt;
10296
+ $[5] = t2;
10297
+ } else t2 = $[5];
10298
+ let t3;
10299
+ if ($[6] !== t2) {
10300
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", {
10301
+ className: "experiment-note",
10302
+ children: [
10303
+ "As Claude Code last cached them, on ",
10304
+ t2,
10305
+ "."
10306
+ ]
10307
+ });
10308
+ $[6] = t2;
10309
+ $[7] = t3;
10310
+ } else t3 = $[7];
10311
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [t3, entries.length ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dl", {
10312
+ className: "experiment-settings",
10313
+ children: entries.map((t4) => {
10314
+ const [key, value] = t4;
10315
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", {
10316
+ className: "mono",
10317
+ children: key
10318
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("dd", { children: [typeof value === "string" && value.length > 80 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
10319
+ className: "selectable",
10320
+ children: value
10321
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
10322
+ className: "mono",
10323
+ children: typeof value === "string" ? value : JSON.stringify(value)
10324
+ }), isModelMap(value) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModelCheck, {
10325
+ map: value,
10326
+ sessions
10327
+ })] })] }, key);
10328
+ })
10329
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
10330
+ className: "experiment-note",
10331
+ children: "None of its own."
10332
+ })] });
10333
+ $[0] = cachedAt;
10334
+ $[1] = sessions;
10335
+ $[2] = settings;
10336
+ $[3] = t1;
10337
+ } else t1 = $[3];
10338
+ return t1;
10339
+ }
10340
+ function ModelCheck({ map, sessions }) {
10341
+ return [...new Set(Object.values(map))].map((to) => {
10342
+ const n = sessions.filter((s) => replyModels([s]).includes(to)).length;
10343
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", {
10344
+ className: "experiment-note",
10345
+ children: [
10346
+ n ? `${plural(n, "session")} of it in the selected period got replies from ${to}.` : `None of its ${plural(sessions.length, "session")} in the selected period got a reply from ${to}; the replies came from ${replyModels(sessions).join(", ")}.`,
10347
+ " ",
10348
+ "What Claude Code uses this setting for isn't documented."
10349
+ ]
10350
+ }, to);
10351
+ });
10352
+ }
9083
10353
  // src/renderer/ui/StatusSwitch.jsx
9084
10354
  function useSwitch(t0) {
9085
10355
  const $ = (0, import_compiler_runtime.c)(14);
@@ -10023,7 +11293,7 @@ function filterItems(sessions, sourceFilter, projectFilter) {
10023
11293
  };
10024
11294
  }
10025
11295
  function App() {
10026
- const $ = (0, import_compiler_runtime.c)(129);
11296
+ const $ = (0, import_compiler_runtime.c)(128);
10027
11297
  let t0;
10028
11298
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
10029
11299
  t0 = [];
@@ -10043,6 +11313,7 @@ function App() {
10043
11313
  const [anchor, setAnchor] = (0, import_react.useState)(t1);
10044
11314
  const [selectedId, setSelectedId] = (0, import_react.useState)(null);
10045
11315
  const [deepLink, setDeepLink] = (0, import_react.useState)(null);
11316
+ const [experiment, setExperiment] = (0, import_react.useState)(null);
10046
11317
  const [sourceFilter, setSourceFilter] = (0, import_react.useState)(null);
10047
11318
  let t2;
10048
11319
  if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
@@ -10234,6 +11505,7 @@ function App() {
10234
11505
  closeFind();
10235
11506
  setSelectedId(id_0);
10236
11507
  setDeepLink(link);
11508
+ setExperiment(null);
10237
11509
  };
10238
11510
  $[42] = t15;
10239
11511
  } else t15 = $[42];
@@ -10343,7 +11615,7 @@ function App() {
10343
11615
  $[65] = t25;
10344
11616
  } else t25 = $[65];
10345
11617
  let t26;
10346
- if ($[66] !== anchor || $[67] !== dayItems.availableSources || $[68] !== dayItems.past || $[69] !== dayItems.projects || $[70] !== dayRange || $[71] !== expandedProjects || $[72] !== granularity || $[73] !== projectFilter || $[74] !== setProjectFilter || $[75] !== sourceFilter || $[76] !== t23 || $[77] !== t24) {
11618
+ if ($[66] !== anchor || $[67] !== dayItems.availableSources || $[68] !== dayItems.past || $[69] !== dayItems.projects || $[70] !== dayRange || $[71] !== expandedProjects || $[72] !== experiment || $[73] !== granularity || $[74] !== projectFilter || $[75] !== setProjectFilter || $[76] !== sourceFilter || $[77] !== t23 || $[78] !== t24) {
10347
11619
  t26 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(GanttChart, {
10348
11620
  dayRange,
10349
11621
  sessions: dayItems.past,
@@ -10358,7 +11630,9 @@ function App() {
10358
11630
  onSetProjectFilter: setProjectFilter,
10359
11631
  sourceFilter,
10360
11632
  availableSources: dayItems.availableSources,
10361
- onToggleSourceFilter: t25
11633
+ onToggleSourceFilter: t25,
11634
+ openExperiment: experiment,
11635
+ onOpenExperiment: setExperiment
10362
11636
  });
10363
11637
  $[66] = anchor;
10364
11638
  $[67] = dayItems.availableSources;
@@ -10366,40 +11640,41 @@ function App() {
10366
11640
  $[69] = dayItems.projects;
10367
11641
  $[70] = dayRange;
10368
11642
  $[71] = expandedProjects;
10369
- $[72] = granularity;
10370
- $[73] = projectFilter;
10371
- $[74] = setProjectFilter;
10372
- $[75] = sourceFilter;
10373
- $[76] = t23;
10374
- $[77] = t24;
10375
- $[78] = t26;
10376
- } else t26 = $[78];
11643
+ $[72] = experiment;
11644
+ $[73] = granularity;
11645
+ $[74] = projectFilter;
11646
+ $[75] = setProjectFilter;
11647
+ $[76] = sourceFilter;
11648
+ $[77] = t23;
11649
+ $[78] = t24;
11650
+ $[79] = t26;
11651
+ } else t26 = $[79];
10377
11652
  let t27;
10378
- if ($[79] !== anchor || $[80] !== dayItems.past || $[81] !== expandedProjects || $[82] !== granularity) {
11653
+ if ($[80] !== anchor || $[81] !== dayItems.past || $[82] !== expandedProjects || $[83] !== granularity) {
10379
11654
  t27 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PeriodSummary, {
10380
11655
  sessions: dayItems.past,
10381
11656
  dayAnchor: anchor,
10382
11657
  granularity,
10383
11658
  expanded: expandedProjects
10384
11659
  });
10385
- $[79] = anchor;
10386
- $[80] = dayItems.past;
10387
- $[81] = expandedProjects;
10388
- $[82] = granularity;
10389
- $[83] = t27;
10390
- } else t27 = $[83];
11660
+ $[80] = anchor;
11661
+ $[81] = dayItems.past;
11662
+ $[82] = expandedProjects;
11663
+ $[83] = granularity;
11664
+ $[84] = t27;
11665
+ } else t27 = $[84];
10391
11666
  let t28;
10392
- if ($[84] !== t26 || $[85] !== t27) {
11667
+ if ($[85] !== t26 || $[86] !== t27) {
10393
11668
  t28 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
10394
11669
  className: "gantt-body",
10395
11670
  children: [t26, t27]
10396
11671
  });
10397
- $[84] = t26;
10398
- $[85] = t27;
10399
- $[86] = t28;
10400
- } else t28 = $[86];
11672
+ $[85] = t26;
11673
+ $[86] = t27;
11674
+ $[87] = t28;
11675
+ } else t28 = $[87];
10401
11676
  let t29;
10402
- if ($[87] !== t22 || $[88] !== t28) {
11677
+ if ($[88] !== t22 || $[89] !== t28) {
10403
11678
  t29 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Ki, {
10404
11679
  id: "gantt",
10405
11680
  defaultSize: 450,
@@ -10407,17 +11682,17 @@ function App() {
10407
11682
  className: "gantt-pane section period",
10408
11683
  children: [t22, t28]
10409
11684
  });
10410
- $[87] = t22;
10411
- $[88] = t28;
10412
- $[89] = t29;
10413
- } else t29 = $[89];
11685
+ $[88] = t22;
11686
+ $[89] = t28;
11687
+ $[90] = t29;
11688
+ } else t29 = $[90];
10414
11689
  let t30;
10415
- if ($[90] === Symbol.for("react.memo_cache_sentinel")) {
11690
+ if ($[91] === Symbol.for("react.memo_cache_sentinel")) {
10416
11691
  t30 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Qi, { className: "resize-handle resize-handle-h" });
10417
- $[90] = t30;
10418
- } else t30 = $[90];
11692
+ $[91] = t30;
11693
+ } else t30 = $[91];
10419
11694
  let t31;
10420
- if ($[91] === Symbol.for("react.memo_cache_sentinel")) {
11695
+ if ($[92] === Symbol.for("react.memo_cache_sentinel")) {
10421
11696
  t31 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("header", {
10422
11697
  className: "section-title",
10423
11698
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", {
@@ -10425,11 +11700,11 @@ function App() {
10425
11700
  children: "Sessions"
10426
11701
  })
10427
11702
  });
10428
- $[91] = t31;
10429
- } else t31 = $[91];
11703
+ $[92] = t31;
11704
+ } else t31 = $[92];
10430
11705
  const t32 = selected?.filePath ?? null;
10431
11706
  let t33;
10432
- if ($[92] !== dayItems.past || $[93] !== deepLink || $[94] !== t32) {
11707
+ if ($[93] !== dayItems.past || $[94] !== deepLink || $[95] !== t32) {
10433
11708
  t33 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Ki, {
10434
11709
  id: "list",
10435
11710
  defaultSize: 450,
@@ -10440,80 +11715,77 @@ function App() {
10440
11715
  sessions: dayItems.past,
10441
11716
  selectedId: t32,
10442
11717
  deepLink,
10443
- onSelect: selectSession
11718
+ onSelect: selectSession,
11719
+ onOpenExperiment: setExperiment
10444
11720
  })]
10445
11721
  });
10446
- $[92] = dayItems.past;
10447
- $[93] = deepLink;
10448
- $[94] = t32;
10449
- $[95] = t33;
10450
- } else t33 = $[95];
11722
+ $[93] = dayItems.past;
11723
+ $[94] = deepLink;
11724
+ $[95] = t32;
11725
+ $[96] = t33;
11726
+ } else t33 = $[96];
10451
11727
  let t34;
10452
- if ($[96] === Symbol.for("react.memo_cache_sentinel")) {
11728
+ if ($[97] === Symbol.for("react.memo_cache_sentinel")) {
10453
11729
  t34 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Qi, { className: "resize-handle resize-handle-v" });
10454
- $[96] = t34;
10455
- } else t34 = $[96];
11730
+ $[97] = t34;
11731
+ } else t34 = $[97];
10456
11732
  const t35 = selected?.filePath;
10457
11733
  let t36;
10458
- if ($[97] !== anchor || $[98] !== granularity || $[99] !== t35) {
11734
+ if ($[98] !== anchor || $[99] !== experiment || $[100] !== granularity || $[101] !== t35) {
10459
11735
  t36 = [
10460
11736
  t35,
11737
+ experiment,
10461
11738
  anchor,
10462
11739
  granularity
10463
11740
  ];
10464
- $[97] = anchor;
10465
- $[98] = granularity;
10466
- $[99] = t35;
10467
- $[100] = t36;
10468
- } else t36 = $[100];
10469
- const t37 = missing;
10470
- let t38;
10471
- if ($[101] !== anchor) {
10472
- t38 = format(anchor, "yyyy-MM-dd");
10473
- $[101] = anchor;
10474
- $[102] = t38;
10475
- } else t38 = $[102];
10476
- let t39;
10477
- if ($[103] !== granularity) {
10478
- t39 = (ts) => setAnchor(startOfPeriod(ts, granularity));
10479
- $[103] = granularity;
10480
- $[104] = t39;
10481
- } else t39 = $[104];
10482
- let t40;
10483
- if ($[105] !== granularity || $[106] !== missing || $[107] !== selected || $[108] !== t38 || $[109] !== t39) {
10484
- t40 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Session, {
11741
+ $[98] = anchor;
11742
+ $[99] = experiment;
11743
+ $[100] = granularity;
11744
+ $[101] = t35;
11745
+ $[102] = t36;
11746
+ } else t36 = $[102];
11747
+ let t37;
11748
+ if ($[103] !== anchor || $[104] !== dayItems.past || $[105] !== experiment || $[106] !== granularity || $[107] !== missing || $[108] !== selected) {
11749
+ t37 = experiment ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ExperimentDetails, {
11750
+ id: experiment,
11751
+ sessions: dayItems.past,
11752
+ anchor,
11753
+ granularity,
11754
+ onClose: () => setExperiment(null)
11755
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Session, {
10485
11756
  meta: selected,
10486
- missing: t37,
10487
- date: t38,
11757
+ missing,
11758
+ date: format(anchor, "yyyy-MM-dd"),
10488
11759
  granularity,
10489
- onShowPeriodOf: t39
10490
- });
10491
- $[105] = granularity;
10492
- $[106] = missing;
10493
- $[107] = selected;
10494
- $[108] = t38;
10495
- $[109] = t39;
10496
- $[110] = t40;
10497
- } else t40 = $[110];
10498
- let t41;
10499
- if ($[111] !== t36 || $[112] !== t40) {
10500
- t41 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Ki, {
11760
+ onShowPeriodOf: (ts) => setAnchor(startOfPeriod(ts, granularity))
11761
+ });
11762
+ $[103] = anchor;
11763
+ $[104] = dayItems.past;
11764
+ $[105] = experiment;
11765
+ $[106] = granularity;
11766
+ $[107] = missing;
11767
+ $[108] = selected;
11768
+ $[109] = t37;
11769
+ } else t37 = $[109];
11770
+ let t38;
11771
+ if ($[110] !== t36 || $[111] !== t37) {
11772
+ t38 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Ki, {
10501
11773
  id: "detail",
10502
11774
  minSize: 30,
10503
11775
  className: "body-pane",
10504
11776
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PaneErrorBoundary, {
10505
11777
  title: "Couldn't render this session",
10506
11778
  resetKeys: t36,
10507
- children: t40
11779
+ children: t37
10508
11780
  })
10509
11781
  });
10510
- $[111] = t36;
10511
- $[112] = t40;
10512
- $[113] = t41;
10513
- } else t41 = $[113];
10514
- let t42;
10515
- if ($[114] !== defaultLayout || $[115] !== onLayoutChanged || $[116] !== t33 || $[117] !== t41) {
10516
- t42 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Ki, {
11782
+ $[110] = t36;
11783
+ $[111] = t37;
11784
+ $[112] = t38;
11785
+ } else t38 = $[112];
11786
+ let t39;
11787
+ if ($[113] !== defaultLayout || $[114] !== onLayoutChanged || $[115] !== t33 || $[116] !== t38) {
11788
+ t39 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Ki, {
10517
11789
  id: "body",
10518
11790
  minSize: 20,
10519
11791
  className: "body-outer section session",
@@ -10526,19 +11798,19 @@ function App() {
10526
11798
  children: [
10527
11799
  t33,
10528
11800
  t34,
10529
- t41
11801
+ t38
10530
11802
  ]
10531
11803
  })
10532
11804
  });
10533
- $[114] = defaultLayout;
10534
- $[115] = onLayoutChanged;
10535
- $[116] = t33;
10536
- $[117] = t41;
10537
- $[118] = t42;
10538
- } else t42 = $[118];
10539
- let t43;
10540
- if ($[119] !== onRootLayoutChanged || $[120] !== rootLayout || $[121] !== t29 || $[122] !== t42) {
10541
- t43 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Hi, {
11805
+ $[113] = defaultLayout;
11806
+ $[114] = onLayoutChanged;
11807
+ $[115] = t33;
11808
+ $[116] = t38;
11809
+ $[117] = t39;
11810
+ } else t39 = $[117];
11811
+ let t40;
11812
+ if ($[118] !== onRootLayoutChanged || $[119] !== rootLayout || $[120] !== t29 || $[121] !== t39) {
11813
+ t40 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Hi, {
10542
11814
  orientation: "vertical",
10543
11815
  disableCursor: true,
10544
11816
  className: "app-main",
@@ -10547,32 +11819,32 @@ function App() {
10547
11819
  children: [
10548
11820
  t29,
10549
11821
  t30,
10550
- t42
11822
+ t39
10551
11823
  ]
10552
11824
  });
10553
- $[119] = onRootLayoutChanged;
10554
- $[120] = rootLayout;
10555
- $[121] = t29;
10556
- $[122] = t42;
10557
- $[123] = t43;
10558
- } else t43 = $[123];
10559
- let t44;
10560
- if ($[124] !== sessions.length) {
10561
- t44 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatusBar, { sessionCount: sessions.length });
10562
- $[124] = sessions.length;
10563
- $[125] = t44;
10564
- } else t44 = $[125];
10565
- let t45;
10566
- if ($[126] !== t43 || $[127] !== t44) {
10567
- t45 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
11825
+ $[118] = onRootLayoutChanged;
11826
+ $[119] = rootLayout;
11827
+ $[120] = t29;
11828
+ $[121] = t39;
11829
+ $[122] = t40;
11830
+ } else t40 = $[122];
11831
+ let t41;
11832
+ if ($[123] !== sessions.length) {
11833
+ t41 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatusBar, { sessionCount: sessions.length });
11834
+ $[123] = sessions.length;
11835
+ $[124] = t41;
11836
+ } else t41 = $[124];
11837
+ let t42;
11838
+ if ($[125] !== t40 || $[126] !== t41) {
11839
+ t42 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
10568
11840
  className: "app",
10569
- children: [t43, t44]
11841
+ children: [t40, t41]
10570
11842
  });
10571
- $[126] = t43;
10572
- $[127] = t44;
10573
- $[128] = t45;
10574
- } else t45 = $[128];
10575
- return t45;
11843
+ $[125] = t40;
11844
+ $[126] = t41;
11845
+ $[127] = t42;
11846
+ } else t42 = $[127];
11847
+ return t42;
10576
11848
  }
10577
11849
  function _temp(p) {
10578
11850
  return p?.scanning === false;