@gobing-ai/knowledge-kit 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/board/collect/index.js +744 -1107
  3. package/dist/board/daily-voice/index.js +741 -107
  4. package/dist/board/itc/index.js +32 -6
  5. package/dist/index.js +1793 -103
  6. package/package.json +1 -1
  7. package/plugins/ingestions/horizon-ingest/dist/index.js +24 -1
  8. package/plugins/ingestions/horizon-ingest/src/index.ts +34 -0
  9. package/plugins/kk/config.example.yaml +8 -0
  10. package/plugins/kk/decisions/extract/ai-news.yaml +7 -1
  11. package/plugins/kk/plugin.json +1 -1
  12. package/plugins/kk/publish-presets/daily-ai-voice.json +123 -0
  13. package/plugins/kk/schedules/kk-daily-publish3-cn-peak.cron.tmpl +20 -0
  14. package/plugins/kk/schedules/kk-daily-publish3-overseas.cron.tmpl +17 -0
  15. package/plugins/kk/scripts/daily-stages.ts +664 -83
  16. package/plugins/kk/scripts/kk-workflow-stages.ts +11 -1
  17. package/plugins/kk/scripts/topic-boundary.json +18 -83
  18. package/plugins/kk/workflows/kk-collect.yaml +2 -0
  19. package/plugins/kk/workflows/kk-daily-ai-voice2.yaml +82 -8
  20. package/plugins/kk/workflows/kk-daily-ai-voice3.yaml +842 -0
  21. package/plugins/kk/workflows/kk-daily-publish3.yaml +282 -0
  22. package/plugins/publishings/podcast-pub/README.md +65 -0
  23. package/plugins/publishings/podcast-pub/dist/index.js +1709 -274
  24. package/plugins/publishings/podcast-pub/plugin.json +1 -1
  25. package/plugins/publishings/podcast-pub/src/backfill.ts +465 -0
  26. package/plugins/publishings/podcast-pub/src/index.ts +211 -34
  27. package/plugins/publishings/podcast-pub/src/microfeed-client.ts +32 -3
  28. package/plugins/publishings/podcast-pub/src/seo.ts +1081 -0
  29. package/plugins/publishings/podcast-pub/src/show-notes.ts +71 -6
  30. package/plugins/publishings/surfdash-pub/dist/index.js +66 -5
  31. package/plugins/publishings/surfdash-pub/src/index.ts +94 -10
  32. package/plugins/publishings/wechatmp-pub/dist/index.js +54 -30
  33. package/plugins/publishings/wechatmp-pub/dist/profile-check.js +8 -3
  34. package/plugins/publishings/wechatmp-pub/src/enrich.ts +58 -38
  35. package/plugins/publishings/wechatmp-pub/src/flow.ts +18 -1
  36. package/plugins/publishings/wechatmp-pub/src/profile-check.ts +7 -1
@@ -43,6 +43,14 @@ function storeSelectionsQueryString(query) {
43
43
  }
44
44
  return params.toString();
45
45
  }
46
+ function storeChannelsQueryString(query) {
47
+ const params = new URLSearchParams({
48
+ from: String(query.fromMs),
49
+ until: String(query.untilMs),
50
+ page: String(query.page)
51
+ });
52
+ return params.toString();
53
+ }
46
54
  var DEFAULT_READER_ORIGIN = "http://127.0.0.1:4340";
47
55
  function readerOriginFrom(search, defaultOrigin = DEFAULT_READER_ORIGIN) {
48
56
  const override = new URLSearchParams(search).get("kkApi");
@@ -73,6 +81,19 @@ function isLoopbackHttpOrigin(origin) {
73
81
  return false;
74
82
  return url.hostname === "127.0.0.1" || url.hostname === "localhost" || url.hostname === "[::1]";
75
83
  }
84
+ function isHttpOrigin(origin) {
85
+ let url;
86
+ try {
87
+ url = new URL(origin);
88
+ } catch {
89
+ return false;
90
+ }
91
+ if (url.protocol !== "http:" && url.protocol !== "https:")
92
+ return false;
93
+ if (url.username !== "" || url.password !== "")
94
+ return false;
95
+ return url.pathname === "/" && url.search === "" && url.hash === "";
96
+ }
76
97
  function origin(base) {
77
98
  return base.replace(/\/+$/, "");
78
99
  }
@@ -96,16 +117,20 @@ function parseSpurDbRows(pageData) {
96
117
  });
97
118
  }
98
119
  function createBoardClient(options) {
99
- if (!isLoopbackHttpOrigin(options.readerOrigin)) {
120
+ const reader = origin(options.readerOrigin);
121
+ const board = origin(options.boardOrigin);
122
+ const isNativeSpur = reader === board;
123
+ if (!isHttpOrigin(options.boardOrigin)) {
124
+ throw new Error(`board origin must be an http origin, got '${options.boardOrigin}'`);
125
+ }
126
+ if (!isNativeSpur && !isLoopbackHttpOrigin(options.readerOrigin)) {
100
127
  throw new Error(`reader origin must be loopback http, got '${options.readerOrigin}'`);
101
128
  }
102
- if (!isLoopbackHttpOrigin(options.boardOrigin)) {
103
- throw new Error(`board origin must be loopback http, got '${options.boardOrigin}'`);
129
+ const aggregateReader = origin(options.aggregateReaderOrigin ?? DEFAULT_READER_ORIGIN);
130
+ if (!isLoopbackHttpOrigin(options.aggregateReaderOrigin ?? DEFAULT_READER_ORIGIN)) {
131
+ throw new Error(`aggregate reader origin must be loopback http, got '${options.aggregateReaderOrigin}'`);
104
132
  }
105
- const reader = origin(options.readerOrigin);
106
- const board = origin(options.boardOrigin);
107
133
  const doFetch = options.fetchImpl ?? fetch;
108
- const isNativeSpur = reader === board;
109
134
  async function getJson(url) {
110
135
  const response = await doFetch(url, { headers: { accept: "application/json" } });
111
136
  if (!response.ok) {
@@ -499,6 +524,7 @@ function createBoardClient(options) {
499
524
  return getJson(path);
500
525
  },
501
526
  storeSelections: (query = {}) => isNativeSpur ? nativeStoreSelections(query) : getJson(`${reader}/api/workflows/kk-collect/store/selections?${storeSelectionsQueryString(query)}`),
527
+ storeChannels: (query) => getJson(`${aggregateReader}/api/workflows/kk-collect/store/channels?${storeChannelsQueryString(query)}`),
502
528
  runDetail: (runId) => getJson(`${board}/api/runs/${encodeURIComponent(runId)}`),
503
529
  progress: (runId) => getJson(`${board}/api/runs/${encodeURIComponent(runId)}/progress`)
504
530
  };
@@ -954,8 +980,186 @@ function mergeRunPages(existing, page) {
954
980
  return { runs: merged, count: merged.length, nextCursor: page.nextCursor, hasMore: page.hasMore };
955
981
  }
956
982
 
983
+ // ../board/src/shared/channel-yield.tsx
984
+ import { jsx, jsxs } from "react/jsx-runtime";
985
+ function localDayKey(ms, timeZone) {
986
+ return new Intl.DateTimeFormat("en-CA", {
987
+ timeZone,
988
+ year: "numeric",
989
+ month: "2-digit",
990
+ day: "2-digit"
991
+ }).format(ms);
992
+ }
993
+ function isLocalMidnight(ms, timeZone) {
994
+ return new Intl.DateTimeFormat("en-GB", {
995
+ timeZone,
996
+ hour: "2-digit",
997
+ minute: "2-digit",
998
+ second: "2-digit",
999
+ hour12: false
1000
+ }).format(ms) === "00:00:00";
1001
+ }
1002
+ function isPartialDay(day, data) {
1003
+ const fromDay = localDayKey(data.fromMs, data.timeZone);
1004
+ const untilDay = localDayKey(Math.max(data.fromMs, data.untilMs - 1), data.timeZone);
1005
+ if (day === fromDay && !isLocalMidnight(data.fromMs, data.timeZone))
1006
+ return true;
1007
+ if (day === untilDay && !isLocalMidnight(data.untilMs, data.timeZone))
1008
+ return true;
1009
+ return false;
1010
+ }
1011
+ function lastPositiveLabel(at) {
1012
+ return at === null ? "unknown" : `${new Date(at).toLocaleString()} (${new Date(at).toISOString()})`;
1013
+ }
1014
+ function ChannelYieldTable({ data }) {
1015
+ const { sources, byDay, bySource } = data;
1016
+ if (byDay.length === 0) {
1017
+ return /* @__PURE__ */ jsx("p", {
1018
+ className: "kk-board-state",
1019
+ children: "No new items in this range."
1020
+ });
1021
+ }
1022
+ const grandTotal = sources.reduce((sum, source) => sum + (bySource[source] ?? 0), 0);
1023
+ return /* @__PURE__ */ jsxs("table", {
1024
+ className: "kk-table kk-channel-yield-table",
1025
+ children: [
1026
+ /* @__PURE__ */ jsx("thead", {
1027
+ children: /* @__PURE__ */ jsxs("tr", {
1028
+ children: [
1029
+ /* @__PURE__ */ jsx("th", {
1030
+ scope: "col",
1031
+ children: "Day"
1032
+ }),
1033
+ sources.map((source) => /* @__PURE__ */ jsx("th", {
1034
+ scope: "col",
1035
+ children: source
1036
+ }, source)),
1037
+ /* @__PURE__ */ jsx("th", {
1038
+ scope: "col",
1039
+ children: "Total"
1040
+ })
1041
+ ]
1042
+ })
1043
+ }),
1044
+ /* @__PURE__ */ jsxs("tbody", {
1045
+ children: [
1046
+ byDay.map((day) => /* @__PURE__ */ jsxs("tr", {
1047
+ children: [
1048
+ /* @__PURE__ */ jsxs("td", {
1049
+ children: [
1050
+ day.day,
1051
+ isPartialDay(day.day, data) ? " (partial)" : ""
1052
+ ]
1053
+ }),
1054
+ sources.map((source) => /* @__PURE__ */ jsx("td", {
1055
+ children: day.sources[source] ?? 0
1056
+ }, source)),
1057
+ /* @__PURE__ */ jsx("td", {
1058
+ children: day.total
1059
+ })
1060
+ ]
1061
+ }, day.day)),
1062
+ /* @__PURE__ */ jsxs("tr", {
1063
+ className: "kk-table-total",
1064
+ children: [
1065
+ /* @__PURE__ */ jsx("td", {
1066
+ children: "Total"
1067
+ }),
1068
+ sources.map((source) => /* @__PURE__ */ jsx("td", {
1069
+ children: bySource[source] ?? 0
1070
+ }, source)),
1071
+ /* @__PURE__ */ jsx("td", {
1072
+ children: grandTotal
1073
+ })
1074
+ ]
1075
+ })
1076
+ ]
1077
+ })
1078
+ ]
1079
+ });
1080
+ }
1081
+ function PluginRunTable({ data }) {
1082
+ const { plugins, runsByDay, lastPositiveAt } = data;
1083
+ if (runsByDay.length === 0) {
1084
+ return /* @__PURE__ */ jsx("p", {
1085
+ className: "kk-board-state",
1086
+ children: "No collection ticks in this range."
1087
+ });
1088
+ }
1089
+ return /* @__PURE__ */ jsxs("div", {
1090
+ className: "kk-plugin-run",
1091
+ children: [
1092
+ /* @__PURE__ */ jsxs("table", {
1093
+ className: "kk-table kk-plugin-run-table",
1094
+ children: [
1095
+ /* @__PURE__ */ jsx("caption", {
1096
+ className: "kk-plugin-run-caption",
1097
+ children: "Zero recorded contributions — plugin invocation health unknown."
1098
+ }),
1099
+ /* @__PURE__ */ jsx("thead", {
1100
+ children: /* @__PURE__ */ jsxs("tr", {
1101
+ children: [
1102
+ /* @__PURE__ */ jsx("th", {
1103
+ scope: "col",
1104
+ children: "Day"
1105
+ }),
1106
+ /* @__PURE__ */ jsx("th", {
1107
+ scope: "col",
1108
+ children: "Runs"
1109
+ }),
1110
+ plugins.map((plugin) => /* @__PURE__ */ jsx("th", {
1111
+ scope: "col",
1112
+ children: plugin
1113
+ }, plugin))
1114
+ ]
1115
+ })
1116
+ }),
1117
+ /* @__PURE__ */ jsx("tbody", {
1118
+ children: runsByDay.map((day) => {
1119
+ const pluginCounts = day.plugins;
1120
+ return /* @__PURE__ */ jsxs("tr", {
1121
+ children: [
1122
+ /* @__PURE__ */ jsx("td", {
1123
+ children: day.day
1124
+ }),
1125
+ /* @__PURE__ */ jsx("td", {
1126
+ children: day.runs
1127
+ }),
1128
+ pluginCounts === null ? /* @__PURE__ */ jsx("td", {
1129
+ colSpan: plugins.length,
1130
+ className: "kk-board-state",
1131
+ children: "unknown"
1132
+ }) : plugins.map((plugin) => /* @__PURE__ */ jsx("td", {
1133
+ children: pluginCounts[plugin] ?? 0
1134
+ }, plugin))
1135
+ ]
1136
+ }, day.day);
1137
+ })
1138
+ })
1139
+ ]
1140
+ }),
1141
+ /* @__PURE__ */ jsx("dl", {
1142
+ className: "kk-board-facts",
1143
+ children: plugins.map((plugin) => /* @__PURE__ */ jsxs("div", {
1144
+ children: [
1145
+ /* @__PURE__ */ jsxs("dt", {
1146
+ children: [
1147
+ "Last positive ",
1148
+ plugin
1149
+ ]
1150
+ }),
1151
+ /* @__PURE__ */ jsx("dd", {
1152
+ children: lastPositiveLabel(lastPositiveAt[plugin] ?? null)
1153
+ })
1154
+ ]
1155
+ }, plugin))
1156
+ })
1157
+ ]
1158
+ });
1159
+ }
1160
+
957
1161
  // ../board/src/collect/panels.tsx
958
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
1162
+ import { jsx as jsx2, jsxs as jsxs2, Fragment } from "react/jsx-runtime";
959
1163
  function cadenceBadge(cadence) {
960
1164
  switch (cadence?.state) {
961
1165
  case "on schedule":
@@ -971,8 +1175,8 @@ function cadenceBadge(cadence) {
971
1175
  function StoreState({ diagnostics }) {
972
1176
  if (diagnostics.length === 0)
973
1177
  return null;
974
- return /* @__PURE__ */ jsx(Fragment, {
975
- children: dedupeDiagnostics(diagnostics).map((diagnostic) => /* @__PURE__ */ jsx("p", {
1178
+ return /* @__PURE__ */ jsx2(Fragment, {
1179
+ children: dedupeDiagnostics(diagnostics).map((diagnostic) => /* @__PURE__ */ jsx2("p", {
976
1180
  role: "status",
977
1181
  className: "kk-board-diagnostic",
978
1182
  children: diagnosticLine(diagnostic)
@@ -982,793 +1186,156 @@ function StoreState({ diagnostics }) {
982
1186
  function storeCellText(status) {
983
1187
  return status === "running" ? "in progress" : "no store row";
984
1188
  }
985
- function Sparkline({ data, color = "var(--color-spur-accent)" }) {
986
- if (data.length < 2)
987
- return null;
988
- const min = Math.min(...data);
989
- const max = Math.max(...data);
990
- const range = max - min || 1;
991
- const width = 72;
992
- const height = 28;
993
- const padding = 2;
994
- const points = data.map((val, idx) => {
995
- const x = idx / (data.length - 1) * (width - padding * 2) + padding;
996
- const y = height - padding - (val - min) / range * (height - padding * 2);
997
- return `${x.toFixed(1)},${y.toFixed(1)}`;
998
- });
999
- const pathD = `M ${points.join(" L ")}`;
1000
- return /* @__PURE__ */ jsx("svg", {
1001
- className: "kk-sparkline-svg",
1002
- viewBox: `0 0 ${width} ${height}`,
1003
- "aria-hidden": "true",
1004
- children: /* @__PURE__ */ jsx("path", {
1005
- d: pathD,
1006
- fill: "none",
1007
- stroke: color,
1008
- strokeWidth: "1.75",
1009
- strokeLinecap: "round",
1010
- strokeLinejoin: "round"
1011
- })
1012
- });
1013
- }
1014
- var TIME_RANGES = ["1h", "4h", "24h", "7d", "30d", "All"];
1189
+ var TIME_RANGES = ["24h", "7d", "14d", "30d", "All"];
1015
1190
  function SummaryPanel({
1016
- runs,
1017
- overview,
1018
- now,
1019
- timeRange = "24h",
1191
+ channels,
1192
+ timeRange = "14d",
1020
1193
  onTimeRangeChange,
1021
- onInspectRun
1194
+ channelsPage = 1,
1195
+ onChannelsPageChange
1022
1196
  }) {
1023
- const page = runs.slice(0, MAX_OVERVIEW_RUNS);
1024
- const storeState = overview === null ? "loading" : overview.availability;
1025
- const counts = overview !== null && storeState === "available" ? bannerCounts(page, overview.rows) : null;
1026
- const cadence = overview === null ? null : cadenceState(overview.lastStoredAt, now);
1027
- let totalInserted = 0;
1028
- let totalUpdated = 0;
1029
- let totalLabelRows = 0;
1030
- let totalLabeledItems = 0;
1031
- let totalYieldSelected = 0;
1032
- let totalYieldPublished = 0;
1033
- let totalYieldDropped = 0;
1034
- const sourceTotals = new Map;
1035
- const insertedTrend = [];
1036
- const yieldTrend = [];
1037
- if (overview !== null && storeState === "available") {
1038
- for (const run of page) {
1039
- const row = overview.rows[run.id];
1040
- if (row) {
1041
- totalInserted += row.inserted;
1042
- totalUpdated += row.updated;
1043
- totalLabelRows += row.labelRows;
1044
- totalLabeledItems += row.labeledItems;
1045
- totalYieldSelected += row.yield.selected;
1046
- totalYieldPublished += row.yield.published;
1047
- totalYieldDropped += row.yield.dropped;
1048
- insertedTrend.push(row.inserted + row.updated);
1049
- yieldTrend.push(row.yield.selected);
1050
- for (const [source, count] of Object.entries(row.sourceCounts)) {
1051
- sourceTotals.set(source, (sourceTotals.get(source) ?? 0) + count);
1052
- }
1053
- }
1054
- }
1055
- }
1056
- const totalCollected = totalInserted + totalUpdated;
1057
- const completedRuns = page.filter((r) => r.status === "done").length;
1058
- const failedRuns = page.filter((r) => r.status === "failed").length;
1059
- const successRate = page.length > 0 ? Math.round(completedRuns / page.length * 100) : 100;
1060
- const totalSelections = totalYieldSelected + totalYieldPublished + totalYieldDropped;
1061
- const yieldRate = totalCollected > 0 ? Math.round(totalSelections / totalCollected * 100) : 0;
1062
- const sortedSources = [...sourceTotals.entries()].sort((a, b) => b[1] - a[1]);
1063
- const chartRuns = page.slice(0, 16).reverse();
1064
- return /* @__PURE__ */ jsxs("section", {
1197
+ const totalPages = channels === null ? 1 : Math.max(1, Math.ceil(channels.totalDays / channels.pageSize));
1198
+ const showPager = channels !== null && channels.availability === "available" && channels.totalDays > channels.pageSize;
1199
+ return /* @__PURE__ */ jsxs2("section", {
1065
1200
  className: "kk-card kk-collect-overview",
1066
1201
  children: [
1067
- /* @__PURE__ */ jsxs("div", {
1202
+ /* @__PURE__ */ jsxs2("div", {
1068
1203
  className: "kk-summary-topbar",
1069
1204
  children: [
1070
- /* @__PURE__ */ jsxs("div", {
1205
+ /* @__PURE__ */ jsx2("div", {
1071
1206
  className: "kk-summary-topbar-left",
1072
- children: [
1073
- /* @__PURE__ */ jsx("div", {
1074
- className: "kk-time-pills",
1075
- children: TIME_RANGES.map((range) => /* @__PURE__ */ jsx("button", {
1076
- type: "button",
1077
- className: `kk-time-pill ${timeRange === range ? "active" : ""}`,
1078
- onClick: () => onTimeRangeChange?.(range),
1079
- children: range
1080
- }, range))
1081
- }),
1082
- /* @__PURE__ */ jsxs("span", {
1083
- className: `kk-badge ${cadenceBadge(cadence)}`,
1084
- children: [
1085
- "● ",
1086
- cadence?.state ?? "cadence: pending"
1087
- ]
1088
- }),
1089
- counts !== null && counts.failed + counts.doneWithoutRow > 0 ? /* @__PURE__ */ jsxs("span", {
1090
- className: "kk-badge kk-badge-warning",
1091
- children: [
1092
- counts.failed + counts.doneWithoutRow,
1093
- " needs attention"
1094
- ]
1095
- }) : null
1096
- ]
1207
+ children: /* @__PURE__ */ jsx2("div", {
1208
+ className: "kk-time-pills",
1209
+ children: TIME_RANGES.map((range) => /* @__PURE__ */ jsx2("button", {
1210
+ type: "button",
1211
+ className: `kk-time-pill ${timeRange === range ? "active" : ""}`,
1212
+ onClick: () => onTimeRangeChange?.(range),
1213
+ children: range
1214
+ }, range))
1215
+ })
1097
1216
  }),
1098
- /* @__PURE__ */ jsxs("div", {
1217
+ /* @__PURE__ */ jsx2("div", {
1099
1218
  className: "kk-summary-kpi-footer",
1100
- children: [
1101
- /* @__PURE__ */ jsx("span", {
1102
- children: cadence?.detail ?? "The store has not answered yet."
1103
- }),
1104
- overview?.lastStoredAt ? /* @__PURE__ */ jsxs("span", {
1105
- children: [
1106
- "· Last store: ",
1107
- formatTimestamp(overview.lastStoredAt)
1108
- ]
1109
- }) : null
1110
- ]
1219
+ children: channels === null ? /* @__PURE__ */ jsx2("span", {
1220
+ children: "The channel-yield aggregate has not loaded yet."
1221
+ }) : channels.availability === "unavailable" ? /* @__PURE__ */ jsx2("span", {
1222
+ children: "The store could not be read; no counts are shown."
1223
+ }) : /* @__PURE__ */ jsxs2("span", {
1224
+ children: [
1225
+ channels.totalDays,
1226
+ " day",
1227
+ channels.totalDays === 1 ? "" : "s",
1228
+ " · time zone",
1229
+ " ",
1230
+ channels.timeZone
1231
+ ]
1232
+ })
1111
1233
  })
1112
1234
  ]
1113
1235
  }),
1114
- overview !== null && overview.availability === "unavailable" ? /* @__PURE__ */ jsxs(Fragment, {
1236
+ channels !== null && channels.availability === "unavailable" ? /* @__PURE__ */ jsxs2(Fragment, {
1115
1237
  children: [
1116
- /* @__PURE__ */ jsx("p", {
1117
- children: "The store could not be read for this page; no counts are shown."
1238
+ /* @__PURE__ */ jsx2("p", {
1239
+ children: "The store could not be read for this range; no counts are shown."
1118
1240
  }),
1119
- /* @__PURE__ */ jsx(StoreState, {
1120
- diagnostics: overview.diagnostics
1241
+ /* @__PURE__ */ jsx2(StoreState, {
1242
+ diagnostics: channels.diagnostics
1121
1243
  })
1122
1244
  ]
1123
1245
  }) : null,
1124
- overview === null ? /* @__PURE__ */ jsx("p", {
1125
- children: "The store overview has not loaded yet."
1246
+ channels !== null && channels.availability === "available" && channels.diagnostics.length > 0 ? /* @__PURE__ */ jsx2(StoreState, {
1247
+ diagnostics: channels.diagnostics
1126
1248
  }) : null,
1127
- /* @__PURE__ */ jsxs("div", {
1128
- className: "kk-summary-kpis",
1129
- children: [
1130
- /* @__PURE__ */ jsxs("div", {
1131
- className: "kk-summary-kpi-card",
1132
- children: [
1133
- /* @__PURE__ */ jsxs("div", {
1134
- className: "kk-summary-kpi-header",
1135
- children: [
1136
- /* @__PURE__ */ jsx("span", {
1137
- className: "kk-stat-label",
1138
- children: "Total Ingested Items"
1139
- }),
1140
- /* @__PURE__ */ jsxs("span", {
1141
- className: "kk-badge kk-badge-success",
1142
- children: [
1143
- "+",
1144
- totalInserted,
1145
- " new"
1146
- ]
1147
- })
1148
- ]
1149
- }),
1150
- /* @__PURE__ */ jsxs("div", {
1151
- className: "kk-summary-kpi-body",
1152
- children: [
1153
- /* @__PURE__ */ jsx("span", {
1154
- className: "kk-summary-kpi-val",
1155
- children: totalCollected.toLocaleString()
1156
- }),
1157
- /* @__PURE__ */ jsx(Sparkline, {
1158
- data: insertedTrend.length >= 2 ? insertedTrend : [2, 5, 4, 8, 7, 10]
1159
- })
1160
- ]
1161
- }),
1162
- /* @__PURE__ */ jsx("div", {
1163
- className: "kk-summary-kpi-footer",
1164
- children: /* @__PURE__ */ jsxs("span", {
1165
- children: [
1166
- totalInserted,
1167
- " inserted · ",
1168
- totalUpdated,
1169
- " updated"
1170
- ]
1171
- })
1172
- })
1173
- ]
1174
- }),
1175
- /* @__PURE__ */ jsxs("div", {
1176
- className: "kk-summary-kpi-card",
1177
- children: [
1178
- /* @__PURE__ */ jsxs("div", {
1179
- className: "kk-summary-kpi-header",
1180
- children: [
1181
- /* @__PURE__ */ jsx("span", {
1182
- className: "kk-stat-label",
1183
- children: "Ingestion Success Rate"
1184
- }),
1185
- /* @__PURE__ */ jsxs("span", {
1186
- className: "kk-badge kk-badge-running",
1187
- children: [
1188
- completedRuns,
1189
- " completed"
1190
- ]
1191
- })
1192
- ]
1193
- }),
1194
- /* @__PURE__ */ jsxs("div", {
1195
- className: "kk-summary-kpi-body",
1196
- children: [
1197
- /* @__PURE__ */ jsxs("span", {
1198
- className: "kk-summary-kpi-val",
1199
- children: [
1200
- successRate,
1201
- "%"
1202
- ]
1203
- }),
1204
- /* @__PURE__ */ jsx(Sparkline, {
1205
- data: [95, 98, 97, 100, 99, successRate],
1206
- color: "var(--color-spur-success)"
1207
- })
1208
- ]
1209
- }),
1210
- /* @__PURE__ */ jsx("div", {
1211
- className: "kk-summary-kpi-footer",
1212
- children: /* @__PURE__ */ jsxs("span", {
1213
- children: [
1214
- completedRuns,
1215
- " ok / ",
1216
- failedRuns,
1217
- " failed runs"
1218
- ]
1219
- })
1220
- })
1221
- ]
1222
- }),
1223
- /* @__PURE__ */ jsxs("div", {
1224
- className: "kk-summary-kpi-card",
1225
- children: [
1226
- /* @__PURE__ */ jsxs("div", {
1227
- className: "kk-summary-kpi-header",
1228
- children: [
1229
- /* @__PURE__ */ jsx("span", {
1230
- className: "kk-stat-label",
1231
- children: "Label Decisions"
1232
- }),
1233
- /* @__PURE__ */ jsxs("span", {
1234
- className: "kk-badge kk-badge-neutral",
1235
- children: [
1236
- totalLabeledItems,
1237
- " items"
1238
- ]
1239
- })
1240
- ]
1241
- }),
1242
- /* @__PURE__ */ jsxs("div", {
1243
- className: "kk-summary-kpi-body",
1244
- children: [
1245
- /* @__PURE__ */ jsx("span", {
1246
- className: "kk-summary-kpi-val",
1247
- children: totalLabelRows.toLocaleString()
1248
- }),
1249
- /* @__PURE__ */ jsx(Sparkline, {
1250
- data: [120, 140, 135, 180, 190, 210],
1251
- color: "#a855f7"
1252
- })
1253
- ]
1254
- }),
1255
- /* @__PURE__ */ jsx("div", {
1256
- className: "kk-summary-kpi-footer",
1257
- children: /* @__PURE__ */ jsxs("span", {
1258
- children: [
1259
- "Evaluated across ",
1260
- totalLabeledItems,
1261
- " distinct items"
1262
- ]
1263
- })
1264
- })
1265
- ]
1266
- }),
1267
- /* @__PURE__ */ jsxs("div", {
1268
- className: "kk-summary-kpi-card",
1269
- children: [
1270
- /* @__PURE__ */ jsxs("div", {
1271
- className: "kk-summary-kpi-header",
1272
- children: [
1273
- /* @__PURE__ */ jsx("span", {
1274
- className: "kk-stat-label",
1275
- children: "Selection Yield"
1276
- }),
1277
- /* @__PURE__ */ jsxs("span", {
1278
- className: "kk-badge kk-badge-success",
1279
- children: [
1280
- yieldRate,
1281
- "% yield"
1282
- ]
1283
- })
1284
- ]
1285
- }),
1286
- /* @__PURE__ */ jsxs("div", {
1287
- className: "kk-summary-kpi-body",
1288
- children: [
1289
- /* @__PURE__ */ jsx("span", {
1290
- className: "kk-summary-kpi-val",
1291
- children: totalYieldSelected.toLocaleString()
1292
- }),
1293
- /* @__PURE__ */ jsx(Sparkline, {
1294
- data: yieldTrend.length >= 2 ? yieldTrend : [3, 4, 2, 5, 4, 6],
1295
- color: "#06b6d4"
1296
- })
1297
- ]
1298
- }),
1299
- /* @__PURE__ */ jsx("div", {
1300
- className: "kk-summary-kpi-footer",
1301
- children: /* @__PURE__ */ jsxs("span", {
1302
- children: [
1303
- totalYieldSelected,
1304
- " selected · ",
1305
- totalYieldPublished,
1306
- " published"
1307
- ]
1308
- })
1309
- })
1310
- ]
1311
- })
1312
- ]
1313
- }),
1314
- /* @__PURE__ */ jsxs("div", {
1315
- className: "kk-summary-charts",
1316
- children: [
1317
- /* @__PURE__ */ jsxs("div", {
1318
- className: "kk-chart-card",
1319
- children: [
1320
- /* @__PURE__ */ jsx("div", {
1321
- className: "kk-chart-header",
1322
- children: /* @__PURE__ */ jsxs("div", {
1323
- children: [
1324
- /* @__PURE__ */ jsx("h3", {
1325
- className: "kk-chart-title",
1326
- children: "Ingestion Volume Over Time"
1327
- }),
1328
- /* @__PURE__ */ jsx("span", {
1329
- className: "kk-chart-subtitle",
1330
- children: "Distribution stacked by source per collection run"
1331
- })
1332
- ]
1333
- })
1334
- }),
1335
- /* @__PURE__ */ jsx("div", {
1336
- className: "kk-chart-svg-wrap",
1337
- children: /* @__PURE__ */ jsxs("svg", {
1338
- role: "img",
1339
- "aria-label": "Ingestion Volume Over Time",
1340
- width: "100%",
1341
- height: "160",
1342
- viewBox: "0 0 460 160",
1343
- preserveAspectRatio: "none",
1344
- children: [
1345
- /* @__PURE__ */ jsx("title", {
1346
- children: "Ingestion Volume Over Time"
1347
- }),
1348
- /* @__PURE__ */ jsx("line", {
1349
- x1: "10",
1350
- y1: "130",
1351
- x2: "450",
1352
- y2: "130",
1353
- stroke: "var(--color-spur-border)",
1354
- strokeWidth: "1"
1355
- }),
1356
- /* @__PURE__ */ jsx("line", {
1357
- x1: "10",
1358
- y1: "80",
1359
- x2: "450",
1360
- y2: "80",
1361
- stroke: "var(--color-spur-border)",
1362
- strokeWidth: "1",
1363
- strokeDasharray: "3 3"
1364
- }),
1365
- /* @__PURE__ */ jsx("line", {
1366
- x1: "10",
1367
- y1: "30",
1368
- x2: "450",
1369
- y2: "30",
1370
- stroke: "var(--color-spur-border)",
1371
- strokeWidth: "1",
1372
- strokeDasharray: "3 3"
1373
- }),
1374
- chartRuns.map((run, i) => {
1375
- const row = overview?.rows[run.id];
1376
- const count = row ? row.inserted + row.updated : 0;
1377
- const barHeight = Math.min(110, Math.max(4, count * 6));
1378
- const x = 20 + i * 27;
1379
- const y = 130 - barHeight;
1380
- return /* @__PURE__ */ jsx("g", {
1381
- children: /* @__PURE__ */ jsx("rect", {
1382
- x,
1383
- y,
1384
- width: "18",
1385
- height: barHeight,
1386
- rx: "3",
1387
- fill: run.status === "failed" ? "var(--color-spur-error)" : "var(--color-spur-accent)",
1388
- opacity: 0.85,
1389
- children: /* @__PURE__ */ jsx("title", {
1390
- children: `${run.id}: ${count} items (${run.status})`
1391
- })
1392
- })
1393
- }, run.id);
1394
- }),
1395
- chartRuns.length === 0 ? /* @__PURE__ */ jsx("text", {
1396
- x: "230",
1397
- y: "85",
1398
- textAnchor: "middle",
1399
- fill: "var(--color-spur-text-muted)",
1400
- fontSize: "13",
1401
- children: "No runs recorded in this time range"
1402
- }) : null
1403
- ]
1404
- })
1405
- }),
1406
- /* @__PURE__ */ jsxs("div", {
1407
- className: "kk-chart-legend",
1408
- children: [
1409
- /* @__PURE__ */ jsxs("span", {
1410
- className: "kk-chart-legend-item",
1411
- children: [
1412
- /* @__PURE__ */ jsx("span", {
1413
- className: "kk-chart-legend-dot",
1414
- style: { background: "var(--color-spur-accent)" }
1415
- }),
1416
- "Ingested Items"
1417
- ]
1418
- }),
1419
- /* @__PURE__ */ jsxs("span", {
1420
- className: "kk-chart-legend-item",
1421
- children: [
1422
- /* @__PURE__ */ jsx("span", {
1423
- className: "kk-chart-legend-dot",
1424
- style: { background: "var(--color-spur-error)" }
1425
- }),
1426
- "Failed Run"
1427
- ]
1428
- })
1429
- ]
1430
- })
1431
- ]
1432
- }),
1433
- /* @__PURE__ */ jsxs("div", {
1434
- className: "kk-chart-card",
1435
- children: [
1436
- /* @__PURE__ */ jsx("div", {
1437
- className: "kk-chart-header",
1438
- children: /* @__PURE__ */ jsxs("div", {
1439
- children: [
1440
- /* @__PURE__ */ jsx("h3", {
1441
- className: "kk-chart-title",
1442
- children: "Decision Volume & Selection Activity"
1443
- }),
1444
- /* @__PURE__ */ jsx("span", {
1445
- className: "kk-chart-subtitle",
1446
- children: "Labeled items volume with selection yield overlay"
1447
- })
1448
- ]
1449
- })
1450
- }),
1451
- /* @__PURE__ */ jsx("div", {
1452
- className: "kk-chart-svg-wrap",
1453
- children: /* @__PURE__ */ jsxs("svg", {
1454
- role: "img",
1455
- "aria-label": "Decision Volume and Selection Activity",
1456
- width: "100%",
1457
- height: "160",
1458
- viewBox: "0 0 460 160",
1459
- preserveAspectRatio: "none",
1460
- children: [
1461
- /* @__PURE__ */ jsx("title", {
1462
- children: "Decision Volume and Selection Activity"
1463
- }),
1464
- /* @__PURE__ */ jsx("line", {
1465
- x1: "10",
1466
- y1: "130",
1467
- x2: "450",
1468
- y2: "130",
1469
- stroke: "var(--color-spur-border)",
1470
- strokeWidth: "1"
1471
- }),
1472
- /* @__PURE__ */ jsx("line", {
1473
- x1: "10",
1474
- y1: "80",
1475
- x2: "450",
1476
- y2: "80",
1477
- stroke: "var(--color-spur-border)",
1478
- strokeWidth: "1",
1479
- strokeDasharray: "3 3"
1480
- }),
1481
- /* @__PURE__ */ jsx("line", {
1482
- x1: "10",
1483
- y1: "30",
1484
- x2: "450",
1485
- y2: "30",
1486
- stroke: "var(--color-spur-border)",
1487
- strokeWidth: "1",
1488
- strokeDasharray: "3 3"
1489
- }),
1490
- chartRuns.map((run, i) => {
1491
- const row = overview?.rows[run.id];
1492
- const labeled = row?.labeledItems ?? 0;
1493
- const barHeight = Math.min(100, Math.max(3, labeled * 5));
1494
- const x = 20 + i * 27;
1495
- const y = 130 - barHeight;
1496
- return /* @__PURE__ */ jsx("rect", {
1497
- x,
1498
- y,
1499
- width: "18",
1500
- height: barHeight,
1501
- rx: "3",
1502
- fill: "#a855f7",
1503
- opacity: 0.8,
1504
- children: /* @__PURE__ */ jsx("title", {
1505
- children: `${run.id}: ${labeled} labeled`
1506
- })
1507
- }, run.id);
1508
- }),
1509
- chartRuns.length === 0 ? /* @__PURE__ */ jsx("text", {
1510
- x: "230",
1511
- y: "85",
1512
- textAnchor: "middle",
1513
- fill: "var(--color-spur-text-muted)",
1514
- fontSize: "13",
1515
- children: "No runs recorded in this time range"
1516
- }) : null,
1517
- chartRuns.length > 1 ? /* @__PURE__ */ jsx("polyline", {
1518
- fill: "none",
1519
- stroke: "var(--color-spur-success)",
1520
- strokeWidth: "2",
1521
- points: chartRuns.map((run, i) => {
1522
- const row = overview?.rows[run.id];
1523
- const sel = row?.yield.selected ?? 0;
1524
- const py = 120 - Math.min(90, sel * 12);
1525
- const px = 29 + i * 27;
1526
- return `${px},${py}`;
1527
- }).join(" ")
1528
- }) : null
1529
- ]
1530
- })
1531
- }),
1532
- /* @__PURE__ */ jsxs("div", {
1533
- className: "kk-chart-legend",
1534
- children: [
1535
- /* @__PURE__ */ jsxs("span", {
1536
- className: "kk-chart-legend-item",
1537
- children: [
1538
- /* @__PURE__ */ jsx("span", {
1539
- className: "kk-chart-legend-dot",
1540
- style: { background: "#a855f7" }
1541
- }),
1542
- "Labeled Items"
1543
- ]
1544
- }),
1545
- /* @__PURE__ */ jsxs("span", {
1546
- className: "kk-chart-legend-item",
1547
- children: [
1548
- /* @__PURE__ */ jsx("span", {
1549
- className: "kk-chart-legend-dot",
1550
- style: { background: "var(--color-spur-success)" }
1551
- }),
1552
- "Selection Yield"
1553
- ]
1554
- })
1555
- ]
1556
- })
1557
- ]
1558
- })
1559
- ]
1560
- }),
1561
- /* @__PURE__ */ jsxs("div", {
1249
+ channels === null ? /* @__PURE__ */ jsx2("p", {
1250
+ children: "The channel-yield aggregate has not loaded yet."
1251
+ }) : null,
1252
+ /* @__PURE__ */ jsxs2("div", {
1562
1253
  className: "kk-summary-grids",
1563
1254
  children: [
1564
- /* @__PURE__ */ jsxs("div", {
1255
+ /* @__PURE__ */ jsxs2("div", {
1565
1256
  className: "kk-card",
1566
1257
  children: [
1567
- /* @__PURE__ */ jsxs("div", {
1258
+ /* @__PURE__ */ jsxs2("div", {
1568
1259
  className: "kk-card-header",
1569
1260
  children: [
1570
- /* @__PURE__ */ jsx("h2", {
1571
- children: "Top Ingestion Sources"
1261
+ /* @__PURE__ */ jsx2("h2", {
1262
+ children: "New items by day and source"
1572
1263
  }),
1573
- /* @__PURE__ */ jsxs("span", {
1264
+ /* @__PURE__ */ jsxs2("span", {
1574
1265
  className: "kk-stat-sub",
1575
1266
  children: [
1576
- sortedSources.length,
1577
- " tracked sources"
1267
+ channels?.sources.length ?? 0,
1268
+ " sources"
1578
1269
  ]
1579
1270
  })
1580
1271
  ]
1581
1272
  }),
1582
- /* @__PURE__ */ jsx("div", {
1273
+ /* @__PURE__ */ jsx2("div", {
1583
1274
  className: "kk-table-container",
1584
- children: /* @__PURE__ */ jsxs("table", {
1585
- className: "kk-table",
1586
- children: [
1587
- /* @__PURE__ */ jsx("thead", {
1588
- children: /* @__PURE__ */ jsxs("tr", {
1589
- children: [
1590
- /* @__PURE__ */ jsx("th", {
1591
- scope: "col",
1592
- children: "Source"
1593
- }),
1594
- /* @__PURE__ */ jsx("th", {
1595
- scope: "col",
1596
- children: "Items"
1597
- }),
1598
- /* @__PURE__ */ jsx("th", {
1599
- scope: "col",
1600
- children: "Share"
1601
- }),
1602
- /* @__PURE__ */ jsx("th", {
1603
- scope: "col",
1604
- children: "Status"
1605
- })
1606
- ]
1607
- })
1608
- }),
1609
- /* @__PURE__ */ jsx("tbody", {
1610
- children: sortedSources.length === 0 ? /* @__PURE__ */ jsx("tr", {
1611
- children: /* @__PURE__ */ jsx("td", {
1612
- colSpan: 4,
1613
- className: "kk-board-state",
1614
- children: "No source telemetry recorded yet."
1615
- })
1616
- }) : sortedSources.map(([source, count]) => {
1617
- const share = totalCollected > 0 ? Math.round(count / totalCollected * 100) : 0;
1618
- return /* @__PURE__ */ jsxs("tr", {
1619
- children: [
1620
- /* @__PURE__ */ jsx("td", {
1621
- children: /* @__PURE__ */ jsx("strong", {
1622
- children: source
1623
- })
1624
- }),
1625
- /* @__PURE__ */ jsx("td", {
1626
- children: count
1627
- }),
1628
- /* @__PURE__ */ jsx("td", {
1629
- children: /* @__PURE__ */ jsxs("span", {
1630
- style: {
1631
- display: "inline-flex",
1632
- alignItems: "center",
1633
- gap: "0.5rem"
1634
- },
1635
- children: [
1636
- /* @__PURE__ */ jsx("span", {
1637
- className: "kk-collect-bar",
1638
- style: { width: "5rem" },
1639
- children: /* @__PURE__ */ jsx("span", {
1640
- className: "kk-collect-bar-seg",
1641
- style: { width: `${Math.max(10, share)}%` }
1642
- })
1643
- }),
1644
- /* @__PURE__ */ jsxs("span", {
1645
- className: "kk-stat-sub",
1646
- children: [
1647
- share,
1648
- "%"
1649
- ]
1650
- })
1651
- ]
1652
- })
1653
- }),
1654
- /* @__PURE__ */ jsx("td", {
1655
- children: /* @__PURE__ */ jsx("span", {
1656
- className: "kk-badge kk-badge-success",
1657
- children: "Active"
1658
- })
1659
- })
1660
- ]
1661
- }, source);
1662
- })
1663
- })
1664
- ]
1665
- })
1275
+ children: channels !== null && channels.availability === "available" ? /* @__PURE__ */ jsx2(ChannelYieldTable, {
1276
+ data: channels
1277
+ }) : null
1666
1278
  })
1667
1279
  ]
1668
1280
  }),
1669
- /* @__PURE__ */ jsxs("div", {
1281
+ /* @__PURE__ */ jsxs2("div", {
1670
1282
  className: "kk-card",
1671
1283
  children: [
1672
- /* @__PURE__ */ jsxs("div", {
1284
+ /* @__PURE__ */ jsxs2("div", {
1673
1285
  className: "kk-card-header",
1674
1286
  children: [
1675
- /* @__PURE__ */ jsx("h2", {
1676
- children: "Recent Collection Runs & Health"
1287
+ /* @__PURE__ */ jsx2("h2", {
1288
+ children: "Collection ticks and plugin contributions"
1677
1289
  }),
1678
- /* @__PURE__ */ jsxs("span", {
1290
+ /* @__PURE__ */ jsxs2("span", {
1679
1291
  className: "kk-stat-sub",
1680
1292
  children: [
1681
- "Last ",
1682
- Math.min(5, page.length),
1683
- " runs"
1293
+ channels?.plugins.length ?? 0,
1294
+ " plugins"
1684
1295
  ]
1685
1296
  })
1686
1297
  ]
1687
1298
  }),
1688
- /* @__PURE__ */ jsx("div", {
1299
+ /* @__PURE__ */ jsx2("div", {
1689
1300
  className: "kk-table-container",
1690
- children: /* @__PURE__ */ jsxs("table", {
1691
- className: "kk-table",
1692
- children: [
1693
- /* @__PURE__ */ jsx("thead", {
1694
- children: /* @__PURE__ */ jsxs("tr", {
1695
- children: [
1696
- /* @__PURE__ */ jsx("th", {
1697
- scope: "col",
1698
- children: "Run ID"
1699
- }),
1700
- /* @__PURE__ */ jsx("th", {
1701
- scope: "col",
1702
- children: "Status"
1703
- }),
1704
- /* @__PURE__ */ jsx("th", {
1705
- scope: "col",
1706
- children: "Items"
1707
- }),
1708
- /* @__PURE__ */ jsx("th", {
1709
- scope: "col",
1710
- children: "Yield"
1711
- }),
1712
- /* @__PURE__ */ jsx("th", {
1713
- scope: "col",
1714
- children: "Action"
1715
- })
1716
- ]
1717
- })
1718
- }),
1719
- /* @__PURE__ */ jsx("tbody", {
1720
- children: page.slice(0, 5).map((run) => {
1721
- const row = overview?.rows[run.id];
1722
- const itemsCount = row ? row.inserted + row.updated : "—";
1723
- const yieldCount = row ? row.yield.selected : "—";
1724
- return /* @__PURE__ */ jsxs("tr", {
1725
- children: [
1726
- /* @__PURE__ */ jsxs("td", {
1727
- children: [
1728
- /* @__PURE__ */ jsx("button", {
1729
- type: "button",
1730
- className: "kk-collect-run-link",
1731
- onClick: () => onInspectRun?.(run.id),
1732
- title: `Inspect run ${run.id}`,
1733
- children: run.id
1734
- }),
1735
- /* @__PURE__ */ jsx("div", {
1736
- className: "kk-stat-sub",
1737
- children: formatTimestamp(run.startedAt)
1738
- })
1739
- ]
1740
- }),
1741
- /* @__PURE__ */ jsx("td", {
1742
- children: /* @__PURE__ */ jsx("span", {
1743
- className: `kk-badge ${run.status === "done" ? "kk-badge-success" : run.status === "failed" ? "kk-badge-failed" : "kk-badge-running"}`,
1744
- children: run.status
1745
- })
1746
- }),
1747
- /* @__PURE__ */ jsx("td", {
1748
- children: itemsCount
1749
- }),
1750
- /* @__PURE__ */ jsx("td", {
1751
- children: yieldCount
1752
- }),
1753
- /* @__PURE__ */ jsx("td", {
1754
- children: /* @__PURE__ */ jsx("button", {
1755
- type: "button",
1756
- className: "kk-table-btn",
1757
- onClick: () => onInspectRun?.(run.id),
1758
- children: "Inspect"
1759
- })
1760
- })
1761
- ]
1762
- }, run.id);
1763
- })
1764
- })
1765
- ]
1766
- })
1301
+ children: channels !== null && channels.availability === "available" ? /* @__PURE__ */ jsx2(PluginRunTable, {
1302
+ data: channels
1303
+ }) : null
1767
1304
  })
1768
1305
  ]
1769
1306
  })
1770
1307
  ]
1771
- })
1308
+ }),
1309
+ showPager ? /* @__PURE__ */ jsxs2("div", {
1310
+ className: "kk-collect-pager",
1311
+ children: [
1312
+ /* @__PURE__ */ jsx2("button", {
1313
+ type: "button",
1314
+ className: "kk-table-btn",
1315
+ onClick: () => onChannelsPageChange?.(-1),
1316
+ disabled: channelsPage <= 1,
1317
+ children: "Previous"
1318
+ }),
1319
+ /* @__PURE__ */ jsxs2("span", {
1320
+ children: [
1321
+ "Page ",
1322
+ channelsPage,
1323
+ " of ",
1324
+ totalPages,
1325
+ " · ",
1326
+ channels?.totalDays ?? 0,
1327
+ " days"
1328
+ ]
1329
+ }),
1330
+ /* @__PURE__ */ jsx2("button", {
1331
+ type: "button",
1332
+ className: "kk-table-btn",
1333
+ onClick: () => onChannelsPageChange?.(1),
1334
+ disabled: channelsPage >= totalPages,
1335
+ children: "Next"
1336
+ })
1337
+ ]
1338
+ }) : null
1772
1339
  ]
1773
1340
  });
1774
1341
  }
@@ -1796,44 +1363,44 @@ function RunDetailsPanel({
1796
1363
  filtered = filtered.filter((r) => r.id.toLowerCase().includes(q) || r.status.toLowerCase().includes(q));
1797
1364
  }
1798
1365
  const filteredRuns = filtered.slice(0, MAX_OVERVIEW_RUNS);
1799
- return /* @__PURE__ */ jsxs("section", {
1366
+ return /* @__PURE__ */ jsxs2("section", {
1800
1367
  className: "kk-card kk-collect-overview",
1801
1368
  children: [
1802
- /* @__PURE__ */ jsxs("div", {
1369
+ /* @__PURE__ */ jsxs2("div", {
1803
1370
  className: "kk-collect-banner",
1804
1371
  children: [
1805
- /* @__PURE__ */ jsxs("div", {
1372
+ /* @__PURE__ */ jsxs2("div", {
1806
1373
  className: "kk-collect-banner-cell",
1807
1374
  children: [
1808
- /* @__PURE__ */ jsx("span", {
1375
+ /* @__PURE__ */ jsx2("span", {
1809
1376
  className: "kk-stat-label",
1810
1377
  children: "Collection cadence"
1811
1378
  }),
1812
- /* @__PURE__ */ jsx("span", {
1379
+ /* @__PURE__ */ jsx2("span", {
1813
1380
  className: "kk-collect-banner-value",
1814
- children: /* @__PURE__ */ jsx("span", {
1381
+ children: /* @__PURE__ */ jsx2("span", {
1815
1382
  className: `kk-badge ${cadenceBadge(cadence)}`,
1816
1383
  children: cadence?.state ?? "unknown"
1817
1384
  })
1818
1385
  }),
1819
- /* @__PURE__ */ jsx("span", {
1386
+ /* @__PURE__ */ jsx2("span", {
1820
1387
  className: "kk-stat-sub",
1821
1388
  children: cadence?.detail ?? "The store has not answered yet."
1822
1389
  })
1823
1390
  ]
1824
1391
  }),
1825
- counts === null ? null : /* @__PURE__ */ jsxs("div", {
1392
+ counts === null ? null : /* @__PURE__ */ jsxs2("div", {
1826
1393
  className: "kk-collect-banner-cell",
1827
1394
  children: [
1828
- /* @__PURE__ */ jsx("span", {
1395
+ /* @__PURE__ */ jsx2("span", {
1829
1396
  className: "kk-stat-label",
1830
1397
  children: "Needs attention"
1831
1398
  }),
1832
- /* @__PURE__ */ jsx("span", {
1399
+ /* @__PURE__ */ jsx2("span", {
1833
1400
  className: "kk-stat-value",
1834
1401
  children: counts.failed + counts.doneWithoutRow
1835
1402
  }),
1836
- /* @__PURE__ */ jsxs("span", {
1403
+ /* @__PURE__ */ jsxs2("span", {
1837
1404
  className: "kk-stat-sub",
1838
1405
  children: [
1839
1406
  counts.failed,
@@ -1849,23 +1416,23 @@ function RunDetailsPanel({
1849
1416
  })
1850
1417
  ]
1851
1418
  }),
1852
- overview !== null && overview.availability === "unavailable" ? /* @__PURE__ */ jsxs(Fragment, {
1419
+ overview !== null && overview.availability === "unavailable" ? /* @__PURE__ */ jsxs2(Fragment, {
1853
1420
  children: [
1854
- /* @__PURE__ */ jsx("p", {
1421
+ /* @__PURE__ */ jsx2("p", {
1855
1422
  children: "The store could not be read for this page; no counts are shown."
1856
1423
  }),
1857
- /* @__PURE__ */ jsx(StoreState, {
1424
+ /* @__PURE__ */ jsx2(StoreState, {
1858
1425
  diagnostics: overview.diagnostics
1859
1426
  })
1860
1427
  ]
1861
1428
  }) : null,
1862
- overview === null ? /* @__PURE__ */ jsx("p", {
1429
+ overview === null ? /* @__PURE__ */ jsx2("p", {
1863
1430
  children: "The store overview has not loaded yet."
1864
1431
  }) : null,
1865
- /* @__PURE__ */ jsxs("div", {
1432
+ /* @__PURE__ */ jsxs2("div", {
1866
1433
  className: "kk-table-toolbar",
1867
1434
  children: [
1868
- /* @__PURE__ */ jsx("input", {
1435
+ /* @__PURE__ */ jsx2("input", {
1869
1436
  type: "text",
1870
1437
  className: "kk-board-run-filter-input",
1871
1438
  placeholder: "Search runs by ID or status...",
@@ -1873,11 +1440,11 @@ function RunDetailsPanel({
1873
1440
  onChange: (e) => onSearchChange?.(e.target.value),
1874
1441
  "aria-label": "Search runs"
1875
1442
  }),
1876
- /* @__PURE__ */ jsx("div", {
1443
+ /* @__PURE__ */ jsx2("div", {
1877
1444
  className: "kk-time-pills",
1878
1445
  role: "radiogroup",
1879
1446
  "aria-label": "Filter runs by status",
1880
- children: ["all", "done", "failed", "running"].map((s) => /* @__PURE__ */ jsx("button", {
1447
+ children: ["all", "done", "failed", "running"].map((s) => /* @__PURE__ */ jsx2("button", {
1881
1448
  type: "button",
1882
1449
  className: `kk-time-pill ${statusFilter === s ? "active" : ""}`,
1883
1450
  onClick: () => onStatusFilterChange?.(s),
@@ -1886,74 +1453,74 @@ function RunDetailsPanel({
1886
1453
  })
1887
1454
  ]
1888
1455
  }),
1889
- /* @__PURE__ */ jsx("div", {
1456
+ /* @__PURE__ */ jsx2("div", {
1890
1457
  className: "kk-table-container",
1891
- children: /* @__PURE__ */ jsxs("table", {
1458
+ children: /* @__PURE__ */ jsxs2("table", {
1892
1459
  className: "kk-table kk-collect-table",
1893
1460
  children: [
1894
- /* @__PURE__ */ jsx("thead", {
1895
- children: /* @__PURE__ */ jsxs("tr", {
1461
+ /* @__PURE__ */ jsx2("thead", {
1462
+ children: /* @__PURE__ */ jsxs2("tr", {
1896
1463
  children: [
1897
- /* @__PURE__ */ jsx("th", {
1464
+ /* @__PURE__ */ jsx2("th", {
1898
1465
  scope: "col",
1899
1466
  children: "Run"
1900
1467
  }),
1901
- /* @__PURE__ */ jsx("th", {
1468
+ /* @__PURE__ */ jsx2("th", {
1902
1469
  scope: "col",
1903
1470
  children: "Started"
1904
1471
  }),
1905
- /* @__PURE__ */ jsx("th", {
1472
+ /* @__PURE__ */ jsx2("th", {
1906
1473
  scope: "col",
1907
1474
  children: "Duration"
1908
1475
  }),
1909
- /* @__PURE__ */ jsx("th", {
1476
+ /* @__PURE__ */ jsx2("th", {
1910
1477
  scope: "col",
1911
1478
  children: "Status"
1912
1479
  }),
1913
- /* @__PURE__ */ jsx("th", {
1480
+ /* @__PURE__ */ jsx2("th", {
1914
1481
  scope: "col",
1915
1482
  children: "Collected"
1916
1483
  }),
1917
- /* @__PURE__ */ jsx("th", {
1484
+ /* @__PURE__ */ jsx2("th", {
1918
1485
  scope: "col",
1919
1486
  children: "Inserted"
1920
1487
  }),
1921
- /* @__PURE__ */ jsx("th", {
1488
+ /* @__PURE__ */ jsx2("th", {
1922
1489
  scope: "col",
1923
1490
  children: "Updated"
1924
1491
  }),
1925
- /* @__PURE__ */ jsx("th", {
1492
+ /* @__PURE__ */ jsx2("th", {
1926
1493
  scope: "col",
1927
1494
  children: "Label rows"
1928
1495
  }),
1929
- /* @__PURE__ */ jsx("th", {
1496
+ /* @__PURE__ */ jsx2("th", {
1930
1497
  scope: "col",
1931
1498
  children: "Fallback"
1932
1499
  }),
1933
- /* @__PURE__ */ jsx("th", {
1500
+ /* @__PURE__ */ jsx2("th", {
1934
1501
  scope: "col",
1935
1502
  children: "Yield"
1936
1503
  }),
1937
- /* @__PURE__ */ jsx("th", {
1504
+ /* @__PURE__ */ jsx2("th", {
1938
1505
  scope: "col",
1939
1506
  children: "Action"
1940
1507
  })
1941
1508
  ]
1942
1509
  })
1943
1510
  }),
1944
- /* @__PURE__ */ jsx("tbody", {
1945
- children: filteredRuns.length === 0 ? /* @__PURE__ */ jsx("tr", {
1946
- children: /* @__PURE__ */ jsx("td", {
1511
+ /* @__PURE__ */ jsx2("tbody", {
1512
+ children: filteredRuns.length === 0 ? /* @__PURE__ */ jsx2("tr", {
1513
+ children: /* @__PURE__ */ jsx2("td", {
1947
1514
  colSpan: 11,
1948
1515
  className: "kk-board-empty",
1949
1516
  children: "No runs match your filter."
1950
1517
  })
1951
1518
  }) : filteredRuns.map((run) => {
1952
1519
  const row = overview?.rows[run.id] ?? null;
1953
- return /* @__PURE__ */ jsxs("tr", {
1520
+ return /* @__PURE__ */ jsxs2("tr", {
1954
1521
  children: [
1955
- /* @__PURE__ */ jsx("td", {
1956
- children: /* @__PURE__ */ jsx("a", {
1522
+ /* @__PURE__ */ jsx2("td", {
1523
+ children: /* @__PURE__ */ jsx2("a", {
1957
1524
  href: runHref ? runHref(run.id) : `#run-${run.id}`,
1958
1525
  className: "kk-collect-run-link",
1959
1526
  onClick: (e) => {
@@ -1965,31 +1532,31 @@ function RunDetailsPanel({
1965
1532
  children: run.id
1966
1533
  })
1967
1534
  }),
1968
- /* @__PURE__ */ jsx("td", {
1535
+ /* @__PURE__ */ jsx2("td", {
1969
1536
  children: formatTimestamp(run.startedAt)
1970
1537
  }),
1971
- /* @__PURE__ */ jsx("td", {
1538
+ /* @__PURE__ */ jsx2("td", {
1972
1539
  children: runDuration(run.startedAt, run.completedAt)
1973
1540
  }),
1974
- /* @__PURE__ */ jsx("td", {
1975
- children: /* @__PURE__ */ jsx("span", {
1541
+ /* @__PURE__ */ jsx2("td", {
1542
+ children: /* @__PURE__ */ jsx2("span", {
1976
1543
  className: `kk-badge ${run.status === "done" ? "kk-badge-success" : run.status === "failed" ? "kk-badge-failed" : "kk-badge-running"}`,
1977
1544
  children: run.status
1978
1545
  })
1979
1546
  }),
1980
- storeState !== "available" ? /* @__PURE__ */ jsx("td", {
1547
+ storeState !== "available" ? /* @__PURE__ */ jsx2("td", {
1981
1548
  colSpan: 6,
1982
1549
  className: "kk-collect-nostore",
1983
1550
  children: storeState === "loading" ? "store not loaded yet" : "store unavailable"
1984
- }) : row === null ? /* @__PURE__ */ jsx("td", {
1551
+ }) : row === null ? /* @__PURE__ */ jsx2("td", {
1985
1552
  colSpan: 6,
1986
1553
  className: "kk-collect-nostore",
1987
1554
  children: storeCellText(run.status)
1988
- }) : /* @__PURE__ */ jsx(StoredCells, {
1555
+ }) : /* @__PURE__ */ jsx2(StoredCells, {
1989
1556
  row
1990
1557
  }),
1991
- /* @__PURE__ */ jsx("td", {
1992
- children: /* @__PURE__ */ jsx("button", {
1558
+ /* @__PURE__ */ jsx2("td", {
1559
+ children: /* @__PURE__ */ jsx2("button", {
1993
1560
  type: "button",
1994
1561
  className: "kk-table-btn",
1995
1562
  onClick: () => onInspectRun?.(run.id),
@@ -2008,42 +1575,42 @@ function RunDetailsPanel({
2008
1575
  }
2009
1576
  function StoredCells({ row }) {
2010
1577
  const segments = sourceSegments(row.sourceCounts);
2011
- return /* @__PURE__ */ jsxs(Fragment, {
1578
+ return /* @__PURE__ */ jsxs2(Fragment, {
2012
1579
  children: [
2013
- /* @__PURE__ */ jsx("td", {
2014
- children: segments.length === 0 ? /* @__PURE__ */ jsx("span", {
1580
+ /* @__PURE__ */ jsx2("td", {
1581
+ children: segments.length === 0 ? /* @__PURE__ */ jsx2("span", {
2015
1582
  className: "kk-board-state",
2016
1583
  children: "no sources recorded"
2017
- }) : /* @__PURE__ */ jsxs(Fragment, {
1584
+ }) : /* @__PURE__ */ jsxs2(Fragment, {
2018
1585
  children: [
2019
- /* @__PURE__ */ jsx("span", {
1586
+ /* @__PURE__ */ jsx2("span", {
2020
1587
  className: "kk-collect-bar",
2021
1588
  "aria-hidden": "true",
2022
- children: segments.map((segment, index) => /* @__PURE__ */ jsx("span", {
1589
+ children: segments.map((segment, index) => /* @__PURE__ */ jsx2("span", {
2023
1590
  className: `kk-collect-bar-seg kk-collect-bar-seg-${index % 3}`,
2024
1591
  style: { width: `${segment.share * 100}%` }
2025
1592
  }, segment.source))
2026
1593
  }),
2027
- /* @__PURE__ */ jsx("span", {
1594
+ /* @__PURE__ */ jsx2("span", {
2028
1595
  className: "kk-collect-bar-total",
2029
1596
  children: segments.map((segment) => `${segment.source} ${segment.count}`).join(" · ")
2030
1597
  })
2031
1598
  ]
2032
1599
  })
2033
1600
  }),
2034
- /* @__PURE__ */ jsx("td", {
1601
+ /* @__PURE__ */ jsx2("td", {
2035
1602
  children: row.inserted
2036
1603
  }),
2037
- /* @__PURE__ */ jsx("td", {
1604
+ /* @__PURE__ */ jsx2("td", {
2038
1605
  children: row.updated
2039
1606
  }),
2040
- /* @__PURE__ */ jsx("td", {
1607
+ /* @__PURE__ */ jsx2("td", {
2041
1608
  children: row.labelRows
2042
1609
  }),
2043
- /* @__PURE__ */ jsx("td", {
1610
+ /* @__PURE__ */ jsx2("td", {
2044
1611
  children: fallbackShare(row)
2045
1612
  }),
2046
- /* @__PURE__ */ jsxs("td", {
1613
+ /* @__PURE__ */ jsxs2("td", {
2047
1614
  children: [
2048
1615
  row.yield.selected,
2049
1616
  " selected · ",
@@ -2069,45 +1636,45 @@ function RunDetailModal({
2069
1636
  onClose
2070
1637
  }) {
2071
1638
  const cards = storeRun !== null && storeRun.availability === "available" ? funnelCards(storeRun.row, results) : [];
2072
- return /* @__PURE__ */ jsxs("div", {
1639
+ return /* @__PURE__ */ jsxs2("div", {
2073
1640
  className: "kk-modal-backdrop",
2074
1641
  role: "presentation",
2075
1642
  children: [
2076
- /* @__PURE__ */ jsx("button", {
1643
+ /* @__PURE__ */ jsx2("button", {
2077
1644
  type: "button",
2078
1645
  className: "kk-modal-dismiss-backdrop",
2079
1646
  onClick: onClose,
2080
1647
  "aria-label": "Close modal dialog",
2081
1648
  tabIndex: -1
2082
1649
  }),
2083
- /* @__PURE__ */ jsxs("div", {
1650
+ /* @__PURE__ */ jsxs2("div", {
2084
1651
  className: "kk-modal-card",
2085
1652
  role: "dialog",
2086
1653
  "aria-modal": "true",
2087
1654
  "aria-labelledby": "kk-run-modal-title",
2088
1655
  children: [
2089
- /* @__PURE__ */ jsxs("div", {
1656
+ /* @__PURE__ */ jsxs2("div", {
2090
1657
  className: "kk-modal-header",
2091
1658
  children: [
2092
- /* @__PURE__ */ jsxs("div", {
1659
+ /* @__PURE__ */ jsxs2("div", {
2093
1660
  className: "kk-modal-header-left",
2094
1661
  children: [
2095
- /* @__PURE__ */ jsxs("h2", {
1662
+ /* @__PURE__ */ jsxs2("h2", {
2096
1663
  id: "kk-run-modal-title",
2097
1664
  children: [
2098
1665
  "Run Details: ",
2099
- /* @__PURE__ */ jsx("code", {
1666
+ /* @__PURE__ */ jsx2("code", {
2100
1667
  children: runId
2101
1668
  })
2102
1669
  ]
2103
1670
  }),
2104
- results ? /* @__PURE__ */ jsx("span", {
1671
+ results ? /* @__PURE__ */ jsx2("span", {
2105
1672
  className: `kk-badge ${results.availability === "available" ? "kk-badge-success" : "kk-badge-neutral"}`,
2106
1673
  children: results.availability
2107
1674
  }) : null
2108
1675
  ]
2109
1676
  }),
2110
- /* @__PURE__ */ jsx("button", {
1677
+ /* @__PURE__ */ jsx2("button", {
2111
1678
  type: "button",
2112
1679
  className: "kk-modal-close",
2113
1680
  onClick: onClose,
@@ -2116,74 +1683,74 @@ function RunDetailModal({
2116
1683
  })
2117
1684
  ]
2118
1685
  }),
2119
- /* @__PURE__ */ jsxs("div", {
1686
+ /* @__PURE__ */ jsxs2("div", {
2120
1687
  className: "kk-modal-body",
2121
1688
  children: [
2122
- cards.length > 0 ? /* @__PURE__ */ jsx("div", {
1689
+ cards.length > 0 ? /* @__PURE__ */ jsx2("div", {
2123
1690
  className: "kk-stat-grid kk-collect-funnel",
2124
- children: cards.map((card) => /* @__PURE__ */ jsxs("div", {
1691
+ children: cards.map((card) => /* @__PURE__ */ jsxs2("div", {
2125
1692
  className: "kk-stat-card",
2126
1693
  children: [
2127
- /* @__PURE__ */ jsx("span", {
1694
+ /* @__PURE__ */ jsx2("span", {
2128
1695
  className: "kk-stat-label",
2129
1696
  children: card.title
2130
1697
  }),
2131
- /* @__PURE__ */ jsx("span", {
1698
+ /* @__PURE__ */ jsx2("span", {
2132
1699
  className: "kk-stat-value",
2133
1700
  children: card.value
2134
1701
  }),
2135
- /* @__PURE__ */ jsx("span", {
1702
+ /* @__PURE__ */ jsx2("span", {
2136
1703
  className: "kk-stat-sub",
2137
1704
  children: card.unit
2138
1705
  }),
2139
- /* @__PURE__ */ jsx("span", {
1706
+ /* @__PURE__ */ jsx2("span", {
2140
1707
  className: "kk-stat-sub",
2141
1708
  children: card.detail
2142
1709
  })
2143
1710
  ]
2144
1711
  }, card.title))
2145
1712
  }) : null,
2146
- storeRun === null ? /* @__PURE__ */ jsx("p", {
1713
+ storeRun === null ? /* @__PURE__ */ jsx2("p", {
2147
1714
  children: "The store has not answered for this run yet."
2148
1715
  }) : null,
2149
- storeRun !== null && storeRun.availability === "unavailable" ? /* @__PURE__ */ jsxs(Fragment, {
1716
+ storeRun !== null && storeRun.availability === "unavailable" ? /* @__PURE__ */ jsxs2(Fragment, {
2150
1717
  children: [
2151
- /* @__PURE__ */ jsx("p", {
1718
+ /* @__PURE__ */ jsx2("p", {
2152
1719
  children: "The store could not be read for this run; no counts are shown."
2153
1720
  }),
2154
- /* @__PURE__ */ jsx(StoreState, {
1721
+ /* @__PURE__ */ jsx2(StoreState, {
2155
1722
  diagnostics: storeRun.diagnostics
2156
1723
  })
2157
1724
  ]
2158
1725
  }) : null,
2159
- storeRun !== null && storeRun.row === null && storeRun.availability === "available" ? /* @__PURE__ */ jsx("p", {
1726
+ storeRun !== null && storeRun.row === null && storeRun.availability === "available" ? /* @__PURE__ */ jsx2("p", {
2160
1727
  children: "This run wrote no store row."
2161
1728
  }) : null,
2162
- storeRun !== null && storeRun.row !== null ? /* @__PURE__ */ jsx(LabelQuality, {
1729
+ storeRun !== null && storeRun.row !== null ? /* @__PURE__ */ jsx2(LabelQuality, {
2163
1730
  quality: storeRun.labelQuality,
2164
1731
  diagnostics: storeRun.diagnostics,
2165
1732
  showEffective,
2166
1733
  onToggle: onToggleQuality
2167
1734
  }) : null,
2168
- facts.length > 0 ? /* @__PURE__ */ jsxs("div", {
1735
+ facts.length > 0 ? /* @__PURE__ */ jsxs2("div", {
2169
1736
  children: [
2170
- /* @__PURE__ */ jsx("h3", {
1737
+ /* @__PURE__ */ jsx2("h3", {
2171
1738
  className: "kk-chart-title",
2172
1739
  style: { marginBottom: "0.5rem" },
2173
1740
  children: "Core Facts"
2174
1741
  }),
2175
- /* @__PURE__ */ jsx("dl", {
1742
+ /* @__PURE__ */ jsx2("dl", {
2176
1743
  className: "kk-board-facts",
2177
- children: facts.map((fact) => /* @__PURE__ */ jsxs("div", {
1744
+ children: facts.map((fact) => /* @__PURE__ */ jsxs2("div", {
2178
1745
  children: [
2179
- /* @__PURE__ */ jsx("dt", {
1746
+ /* @__PURE__ */ jsx2("dt", {
2180
1747
  children: fact.label
2181
1748
  }),
2182
- /* @__PURE__ */ jsxs("dd", {
1749
+ /* @__PURE__ */ jsxs2("dd", {
2183
1750
  children: [
2184
1751
  fact.value,
2185
1752
  " ",
2186
- /* @__PURE__ */ jsx("span", {
1753
+ /* @__PURE__ */ jsx2("span", {
2187
1754
  className: "kk-board-state",
2188
1755
  children: fact.availability
2189
1756
  })
@@ -2194,47 +1761,47 @@ function RunDetailModal({
2194
1761
  })
2195
1762
  ]
2196
1763
  }) : null,
2197
- /* @__PURE__ */ jsxs("div", {
1764
+ /* @__PURE__ */ jsxs2("div", {
2198
1765
  children: [
2199
- /* @__PURE__ */ jsx("h3", {
1766
+ /* @__PURE__ */ jsx2("h3", {
2200
1767
  className: "kk-chart-title",
2201
1768
  style: { marginBottom: "0.5rem" },
2202
1769
  children: "Artifact Evidence"
2203
1770
  }),
2204
- /* @__PURE__ */ jsx(ArtifactRows, {
1771
+ /* @__PURE__ */ jsx2(ArtifactRows, {
2205
1772
  artifacts
2206
1773
  })
2207
1774
  ]
2208
1775
  }),
2209
- /* @__PURE__ */ jsxs("div", {
1776
+ /* @__PURE__ */ jsxs2("div", {
2210
1777
  children: [
2211
- /* @__PURE__ */ jsx("h3", {
1778
+ /* @__PURE__ */ jsx2("h3", {
2212
1779
  className: "kk-chart-title",
2213
1780
  style: { marginBottom: "0.5rem" },
2214
1781
  children: "Workflow Configuration"
2215
1782
  }),
2216
- /* @__PURE__ */ jsx(ConfigPanel, {
1783
+ /* @__PURE__ */ jsx2(ConfigPanel, {
2217
1784
  config: config ?? null
2218
1785
  })
2219
1786
  ]
2220
1787
  }),
2221
- /* @__PURE__ */ jsxs("div", {
1788
+ /* @__PURE__ */ jsxs2("div", {
2222
1789
  children: [
2223
- /* @__PURE__ */ jsx("h3", {
1790
+ /* @__PURE__ */ jsx2("h3", {
2224
1791
  className: "kk-chart-title",
2225
1792
  style: { marginBottom: "0.5rem" },
2226
1793
  children: "Progress & Attempts"
2227
1794
  }),
2228
- /* @__PURE__ */ jsx(ProgressPanel, {
1795
+ /* @__PURE__ */ jsx2(ProgressPanel, {
2229
1796
  steps: steps ?? []
2230
1797
  })
2231
1798
  ]
2232
1799
  })
2233
1800
  ]
2234
1801
  }),
2235
- /* @__PURE__ */ jsx("div", {
1802
+ /* @__PURE__ */ jsx2("div", {
2236
1803
  className: "kk-modal-footer",
2237
- children: /* @__PURE__ */ jsx("button", {
1804
+ children: /* @__PURE__ */ jsx2("button", {
2238
1805
  type: "button",
2239
1806
  className: "kk-btn-action",
2240
1807
  onClick: onClose,
@@ -2252,38 +1819,38 @@ function LabelQuality({
2252
1819
  showEffective,
2253
1820
  onToggle
2254
1821
  }) {
2255
- return /* @__PURE__ */ jsxs("section", {
1822
+ return /* @__PURE__ */ jsxs2("section", {
2256
1823
  className: "kk-card kk-collect-quality",
2257
1824
  children: [
2258
- /* @__PURE__ */ jsxs("div", {
1825
+ /* @__PURE__ */ jsxs2("div", {
2259
1826
  className: "kk-card-header",
2260
1827
  children: [
2261
- /* @__PURE__ */ jsx("h2", {
1828
+ /* @__PURE__ */ jsx2("h2", {
2262
1829
  children: "Label quality"
2263
1830
  }),
2264
- /* @__PURE__ */ jsx("button", {
1831
+ /* @__PURE__ */ jsx2("button", {
2265
1832
  type: "button",
2266
1833
  onClick: onToggle,
2267
1834
  children: showEffective ? "Show this run" : "Show effective labels"
2268
1835
  })
2269
1836
  ]
2270
1837
  }),
2271
- quality.length === 0 ? /* @__PURE__ */ jsx("p", {
1838
+ quality.length === 0 ? /* @__PURE__ */ jsx2("p", {
2272
1839
  children: "No label decisions recorded for this run."
2273
1840
  }) : null,
2274
- quality.map((entry) => /* @__PURE__ */ jsxs("div", {
1841
+ quality.map((entry) => /* @__PURE__ */ jsxs2("div", {
2275
1842
  className: "kk-collect-quality-block",
2276
1843
  children: [
2277
- /* @__PURE__ */ jsx("h3", {
1844
+ /* @__PURE__ */ jsx2("h3", {
2278
1845
  children: entry.decisionId
2279
1846
  }),
2280
- /* @__PURE__ */ jsx(QualityTable, {
1847
+ /* @__PURE__ */ jsx2(QualityTable, {
2281
1848
  entry,
2282
1849
  showEffective
2283
1850
  })
2284
1851
  ]
2285
1852
  }, entry.decisionId)),
2286
- /* @__PURE__ */ jsx(StoreState, {
1853
+ /* @__PURE__ */ jsx2(StoreState, {
2287
1854
  diagnostics
2288
1855
  })
2289
1856
  ]
@@ -2295,33 +1862,33 @@ function QualityTable({
2295
1862
  }) {
2296
1863
  if (showEffective) {
2297
1864
  if (entry.effective.length === 0)
2298
- return /* @__PURE__ */ jsx("p", {
1865
+ return /* @__PURE__ */ jsx2("p", {
2299
1866
  children: "Effective label distribution unavailable."
2300
1867
  });
2301
- return /* @__PURE__ */ jsxs("table", {
1868
+ return /* @__PURE__ */ jsxs2("table", {
2302
1869
  className: "kk-table",
2303
1870
  children: [
2304
- /* @__PURE__ */ jsx("thead", {
2305
- children: /* @__PURE__ */ jsxs("tr", {
1871
+ /* @__PURE__ */ jsx2("thead", {
1872
+ children: /* @__PURE__ */ jsxs2("tr", {
2306
1873
  children: [
2307
- /* @__PURE__ */ jsx("th", {
1874
+ /* @__PURE__ */ jsx2("th", {
2308
1875
  scope: "col",
2309
1876
  children: "Value"
2310
1877
  }),
2311
- /* @__PURE__ */ jsx("th", {
1878
+ /* @__PURE__ */ jsx2("th", {
2312
1879
  scope: "col",
2313
1880
  children: "Items"
2314
1881
  })
2315
1882
  ]
2316
1883
  })
2317
1884
  }),
2318
- /* @__PURE__ */ jsx("tbody", {
2319
- children: entry.effective.map((value) => /* @__PURE__ */ jsxs("tr", {
1885
+ /* @__PURE__ */ jsx2("tbody", {
1886
+ children: entry.effective.map((value) => /* @__PURE__ */ jsxs2("tr", {
2320
1887
  children: [
2321
- /* @__PURE__ */ jsx("td", {
1888
+ /* @__PURE__ */ jsx2("td", {
2322
1889
  children: value.value
2323
1890
  }),
2324
- /* @__PURE__ */ jsx("td", {
1891
+ /* @__PURE__ */ jsx2("td", {
2325
1892
  children: value.count
2326
1893
  })
2327
1894
  ]
@@ -2330,51 +1897,51 @@ function QualityTable({
2330
1897
  ]
2331
1898
  });
2332
1899
  }
2333
- return /* @__PURE__ */ jsxs("table", {
1900
+ return /* @__PURE__ */ jsxs2("table", {
2334
1901
  className: "kk-table",
2335
1902
  children: [
2336
- /* @__PURE__ */ jsx("thead", {
2337
- children: /* @__PURE__ */ jsxs("tr", {
1903
+ /* @__PURE__ */ jsx2("thead", {
1904
+ children: /* @__PURE__ */ jsxs2("tr", {
2338
1905
  children: [
2339
- /* @__PURE__ */ jsx("th", {
1906
+ /* @__PURE__ */ jsx2("th", {
2340
1907
  scope: "col",
2341
1908
  children: "Value"
2342
1909
  }),
2343
- /* @__PURE__ */ jsx("th", {
1910
+ /* @__PURE__ */ jsx2("th", {
2344
1911
  scope: "col",
2345
1912
  children: "HIGH"
2346
1913
  }),
2347
- /* @__PURE__ */ jsx("th", {
1914
+ /* @__PURE__ */ jsx2("th", {
2348
1915
  scope: "col",
2349
1916
  children: "MEDIUM"
2350
1917
  }),
2351
- /* @__PURE__ */ jsx("th", {
1918
+ /* @__PURE__ */ jsx2("th", {
2352
1919
  scope: "col",
2353
1920
  children: "LOW"
2354
1921
  }),
2355
- /* @__PURE__ */ jsx("th", {
1922
+ /* @__PURE__ */ jsx2("th", {
2356
1923
  scope: "col",
2357
1924
  children: "none"
2358
1925
  })
2359
1926
  ]
2360
1927
  })
2361
1928
  }),
2362
- /* @__PURE__ */ jsx("tbody", {
2363
- children: entry.run.map((row) => /* @__PURE__ */ jsxs("tr", {
1929
+ /* @__PURE__ */ jsx2("tbody", {
1930
+ children: entry.run.map((row) => /* @__PURE__ */ jsxs2("tr", {
2364
1931
  children: [
2365
- /* @__PURE__ */ jsx("td", {
1932
+ /* @__PURE__ */ jsx2("td", {
2366
1933
  children: row.value
2367
1934
  }),
2368
- /* @__PURE__ */ jsx("td", {
1935
+ /* @__PURE__ */ jsx2("td", {
2369
1936
  children: row.HIGH
2370
1937
  }),
2371
- /* @__PURE__ */ jsx("td", {
1938
+ /* @__PURE__ */ jsx2("td", {
2372
1939
  children: row.MEDIUM
2373
1940
  }),
2374
- /* @__PURE__ */ jsx("td", {
1941
+ /* @__PURE__ */ jsx2("td", {
2375
1942
  children: row.LOW
2376
1943
  }),
2377
- /* @__PURE__ */ jsx("td", {
1944
+ /* @__PURE__ */ jsx2("td", {
2378
1945
  children: row.none
2379
1946
  })
2380
1947
  ]
@@ -2385,19 +1952,19 @@ function QualityTable({
2385
1952
  }
2386
1953
  function ArtifactRows({ artifacts }) {
2387
1954
  if (artifacts.length === 0)
2388
- return /* @__PURE__ */ jsx("p", {
1955
+ return /* @__PURE__ */ jsx2("p", {
2389
1956
  children: "No artifact evidence for the selected run."
2390
1957
  });
2391
- return /* @__PURE__ */ jsx("ul", {
1958
+ return /* @__PURE__ */ jsx2("ul", {
2392
1959
  className: "kk-board-artifacts",
2393
- children: artifacts.map((artifact) => /* @__PURE__ */ jsx("li", {
2394
- children: artifact.href === null ? /* @__PURE__ */ jsxs("span", {
1960
+ children: artifacts.map((artifact) => /* @__PURE__ */ jsx2("li", {
1961
+ children: artifact.href === null ? /* @__PURE__ */ jsxs2("span", {
2395
1962
  children: [
2396
1963
  artifact.label,
2397
1964
  " — ",
2398
1965
  artifact.state
2399
1966
  ]
2400
- }) : /* @__PURE__ */ jsxs("a", {
1967
+ }) : /* @__PURE__ */ jsxs2("a", {
2401
1968
  href: artifact.href,
2402
1969
  children: [
2403
1970
  artifact.label,
@@ -2415,20 +1982,20 @@ function FilterSelect({
2415
1982
  options,
2416
1983
  onChange
2417
1984
  }) {
2418
- return /* @__PURE__ */ jsxs("label", {
1985
+ return /* @__PURE__ */ jsxs2("label", {
2419
1986
  className: "kk-collect-filter",
2420
1987
  children: [
2421
1988
  label,
2422
- /* @__PURE__ */ jsxs("select", {
1989
+ /* @__PURE__ */ jsxs2("select", {
2423
1990
  name,
2424
1991
  value: value ?? "",
2425
1992
  onChange,
2426
1993
  children: [
2427
- /* @__PURE__ */ jsx("option", {
1994
+ /* @__PURE__ */ jsx2("option", {
2428
1995
  value: "",
2429
1996
  children: "All"
2430
1997
  }),
2431
- options.map((option) => /* @__PURE__ */ jsx("option", {
1998
+ options.map((option) => /* @__PURE__ */ jsx2("option", {
2432
1999
  value: option,
2433
2000
  children: option
2434
2001
  }, option))
@@ -2453,17 +2020,17 @@ function ItemsPanel({
2453
2020
  const storeState = current === null ? "loading" : current.availability === "available" ? "available" : "unavailable";
2454
2021
  const page = storeState === "available" ? current : null;
2455
2022
  const count = page === null ? null : pager(page.page, page.total, page.pageSize);
2456
- return /* @__PURE__ */ jsxs("section", {
2023
+ return /* @__PURE__ */ jsxs2("section", {
2457
2024
  className: "kk-card kk-collect-items",
2458
2025
  children: [
2459
- /* @__PURE__ */ jsxs("div", {
2026
+ /* @__PURE__ */ jsxs2("div", {
2460
2027
  className: "kk-collect-filters",
2461
2028
  children: [
2462
- onSearchChange ? /* @__PURE__ */ jsxs("label", {
2029
+ onSearchChange ? /* @__PURE__ */ jsxs2("label", {
2463
2030
  className: "kk-collect-filter",
2464
2031
  children: [
2465
2032
  "Search",
2466
- /* @__PURE__ */ jsx("input", {
2033
+ /* @__PURE__ */ jsx2("input", {
2467
2034
  type: "text",
2468
2035
  className: "kk-search-input",
2469
2036
  placeholder: "Title or URL...",
@@ -2473,20 +2040,20 @@ function ItemsPanel({
2473
2040
  })
2474
2041
  ]
2475
2042
  }) : null,
2476
- runs && runs.length > 0 ? /* @__PURE__ */ jsxs("label", {
2043
+ runs && runs.length > 0 ? /* @__PURE__ */ jsxs2("label", {
2477
2044
  className: "kk-collect-filter",
2478
2045
  children: [
2479
2046
  "Run",
2480
- /* @__PURE__ */ jsxs("select", {
2047
+ /* @__PURE__ */ jsxs2("select", {
2481
2048
  name: "run",
2482
2049
  value: runId ?? "",
2483
2050
  onChange: (e) => onRunChange?.(e.target.value === "" ? undefined : e.target.value),
2484
2051
  children: [
2485
- /* @__PURE__ */ jsx("option", {
2052
+ /* @__PURE__ */ jsx2("option", {
2486
2053
  value: "",
2487
2054
  children: "All Runs"
2488
2055
  }),
2489
- runs.map((r) => /* @__PURE__ */ jsxs("option", {
2056
+ runs.map((r) => /* @__PURE__ */ jsxs2("option", {
2490
2057
  value: r.id,
2491
2058
  children: [
2492
2059
  r.id.length > 18 ? `${r.id.slice(0, 8)}...${r.id.slice(-6)}` : r.id,
@@ -2499,35 +2066,35 @@ function ItemsPanel({
2499
2066
  })
2500
2067
  ]
2501
2068
  }) : null,
2502
- /* @__PURE__ */ jsx(FilterSelect, {
2069
+ /* @__PURE__ */ jsx2(FilterSelect, {
2503
2070
  label: "Source",
2504
2071
  name: "source",
2505
2072
  value: filters.source,
2506
2073
  options: page?.sources ?? [],
2507
2074
  onChange: onFilterChange
2508
2075
  }),
2509
- /* @__PURE__ */ jsx(FilterSelect, {
2076
+ /* @__PURE__ */ jsx2(FilterSelect, {
2510
2077
  label: "Seen",
2511
2078
  name: "seen",
2512
2079
  value: filters.seen,
2513
2080
  options: ["new", "reseen"],
2514
2081
  onChange: onFilterChange
2515
2082
  }),
2516
- /* @__PURE__ */ jsx(FilterSelect, {
2083
+ /* @__PURE__ */ jsx2(FilterSelect, {
2517
2084
  label: "Decision",
2518
2085
  name: "decision",
2519
2086
  value: filters.decision,
2520
2087
  options: quality.map((entry) => entry.decisionId),
2521
2088
  onChange: onFilterChange
2522
2089
  }),
2523
- /* @__PURE__ */ jsx(FilterSelect, {
2090
+ /* @__PURE__ */ jsx2(FilterSelect, {
2524
2091
  label: "Value",
2525
2092
  name: "value",
2526
2093
  value: filters.value,
2527
2094
  options: decisionValues(quality, filters.decision ?? ""),
2528
2095
  onChange: onFilterChange
2529
2096
  }),
2530
- /* @__PURE__ */ jsx(FilterSelect, {
2097
+ /* @__PURE__ */ jsx2(FilterSelect, {
2531
2098
  label: "Selection",
2532
2099
  name: "selection",
2533
2100
  value: filters.selection,
@@ -2536,66 +2103,66 @@ function ItemsPanel({
2536
2103
  })
2537
2104
  ]
2538
2105
  }),
2539
- runId === null && items === null ? /* @__PURE__ */ jsx("p", {
2106
+ runId === null && items === null ? /* @__PURE__ */ jsx2("p", {
2540
2107
  children: "Select a run to browse its items."
2541
2108
  }) : null,
2542
- runId !== null && storeState === "loading" ? /* @__PURE__ */ jsx("p", {
2109
+ runId !== null && storeState === "loading" ? /* @__PURE__ */ jsx2("p", {
2543
2110
  children: "The items page has not loaded yet."
2544
2111
  }) : null,
2545
- storeState === "unavailable" ? /* @__PURE__ */ jsxs(Fragment, {
2112
+ storeState === "unavailable" ? /* @__PURE__ */ jsxs2(Fragment, {
2546
2113
  children: [
2547
- /* @__PURE__ */ jsx("p", {
2114
+ /* @__PURE__ */ jsx2("p", {
2548
2115
  children: "The store could not be read for this run; no items are shown."
2549
2116
  }),
2550
- /* @__PURE__ */ jsx(StoreState, {
2117
+ /* @__PURE__ */ jsx2(StoreState, {
2551
2118
  diagnostics: current?.diagnostics ?? []
2552
2119
  })
2553
2120
  ]
2554
2121
  }) : null,
2555
- page !== null && page.items.length === 0 ? /* @__PURE__ */ jsx("p", {
2122
+ page !== null && page.items.length === 0 ? /* @__PURE__ */ jsx2("p", {
2556
2123
  children: "No items match these filters."
2557
2124
  }) : null,
2558
- page === null || page.items.length === 0 ? null : /* @__PURE__ */ jsx("div", {
2125
+ page === null || page.items.length === 0 ? null : /* @__PURE__ */ jsx2("div", {
2559
2126
  className: "kk-table-container",
2560
- children: /* @__PURE__ */ jsxs("table", {
2127
+ children: /* @__PURE__ */ jsxs2("table", {
2561
2128
  className: "kk-table kk-collect-items-table",
2562
2129
  children: [
2563
- /* @__PURE__ */ jsx("thead", {
2564
- children: /* @__PURE__ */ jsxs("tr", {
2130
+ /* @__PURE__ */ jsx2("thead", {
2131
+ children: /* @__PURE__ */ jsxs2("tr", {
2565
2132
  children: [
2566
- /* @__PURE__ */ jsx("th", {
2133
+ /* @__PURE__ */ jsx2("th", {
2567
2134
  scope: "col",
2568
2135
  children: "Title"
2569
2136
  }),
2570
- /* @__PURE__ */ jsx("th", {
2137
+ /* @__PURE__ */ jsx2("th", {
2571
2138
  scope: "col",
2572
2139
  children: "Source"
2573
2140
  }),
2574
- /* @__PURE__ */ jsx("th", {
2141
+ /* @__PURE__ */ jsx2("th", {
2575
2142
  scope: "col",
2576
2143
  children: "Seen"
2577
2144
  }),
2578
- /* @__PURE__ */ jsx("th", {
2145
+ /* @__PURE__ */ jsx2("th", {
2579
2146
  scope: "col",
2580
2147
  children: "Story"
2581
2148
  }),
2582
- /* @__PURE__ */ jsx("th", {
2149
+ /* @__PURE__ */ jsx2("th", {
2583
2150
  scope: "col",
2584
2151
  children: "Labels"
2585
2152
  }),
2586
- /* @__PURE__ */ jsx("th", {
2153
+ /* @__PURE__ */ jsx2("th", {
2587
2154
  scope: "col",
2588
2155
  children: "Selection"
2589
2156
  }),
2590
- /* @__PURE__ */ jsx("th", {
2157
+ /* @__PURE__ */ jsx2("th", {
2591
2158
  scope: "col",
2592
2159
  children: "Action"
2593
2160
  })
2594
2161
  ]
2595
2162
  })
2596
2163
  }),
2597
- /* @__PURE__ */ jsx("tbody", {
2598
- children: page.items.map((item) => /* @__PURE__ */ jsx(ItemRow, {
2164
+ /* @__PURE__ */ jsx2("tbody", {
2165
+ children: page.items.map((item) => /* @__PURE__ */ jsx2(ItemRow, {
2599
2166
  item,
2600
2167
  onInspect: onInspectItem
2601
2168
  }, item.id))
@@ -2603,17 +2170,17 @@ function ItemsPanel({
2603
2170
  ]
2604
2171
  })
2605
2172
  }),
2606
- count === null ? null : /* @__PURE__ */ jsxs("div", {
2173
+ count === null ? null : /* @__PURE__ */ jsxs2("div", {
2607
2174
  className: "kk-collect-pager",
2608
2175
  children: [
2609
- /* @__PURE__ */ jsx("button", {
2176
+ /* @__PURE__ */ jsx2("button", {
2610
2177
  type: "button",
2611
2178
  name: "previous",
2612
2179
  disabled: count.page <= 1,
2613
2180
  onClick: onPageChange,
2614
2181
  children: "Previous"
2615
2182
  }),
2616
- /* @__PURE__ */ jsxs("span", {
2183
+ /* @__PURE__ */ jsxs2("span", {
2617
2184
  children: [
2618
2185
  "Page ",
2619
2186
  count.page,
@@ -2624,7 +2191,7 @@ function ItemsPanel({
2624
2191
  " items"
2625
2192
  ]
2626
2193
  }),
2627
- /* @__PURE__ */ jsx("button", {
2194
+ /* @__PURE__ */ jsx2("button", {
2628
2195
  type: "button",
2629
2196
  name: "next",
2630
2197
  disabled: count.page >= count.pages,
@@ -2639,26 +2206,26 @@ function ItemsPanel({
2639
2206
  function ItemRow({ item, onInspect }) {
2640
2207
  const labels = Object.entries(item.labels);
2641
2208
  const details = item.labelDetails ?? {};
2642
- return /* @__PURE__ */ jsxs("tr", {
2209
+ return /* @__PURE__ */ jsxs2("tr", {
2643
2210
  children: [
2644
- /* @__PURE__ */ jsxs("td", {
2211
+ /* @__PURE__ */ jsxs2("td", {
2645
2212
  children: [
2646
- /* @__PURE__ */ jsx("div", {
2647
- children: item.url === null ? item.title : /* @__PURE__ */ jsx("a", {
2213
+ /* @__PURE__ */ jsx2("div", {
2214
+ children: item.url === null ? item.title : /* @__PURE__ */ jsx2("a", {
2648
2215
  href: item.url,
2649
2216
  target: "_blank",
2650
2217
  rel: "noreferrer",
2651
2218
  children: item.title
2652
2219
  })
2653
2220
  }),
2654
- /* @__PURE__ */ jsxs("div", {
2221
+ /* @__PURE__ */ jsxs2("div", {
2655
2222
  style: { marginTop: "0.25rem", display: "flex", gap: "0.25rem" },
2656
2223
  children: [
2657
- item.domain ? /* @__PURE__ */ jsx("span", {
2224
+ item.domain ? /* @__PURE__ */ jsx2("span", {
2658
2225
  className: "kk-domain-pill",
2659
2226
  children: item.domain
2660
2227
  }) : null,
2661
- item.lang ? /* @__PURE__ */ jsx("span", {
2228
+ item.lang ? /* @__PURE__ */ jsx2("span", {
2662
2229
  className: "kk-domain-pill",
2663
2230
  children: item.lang
2664
2231
  }) : null
@@ -2666,34 +2233,34 @@ function ItemRow({ item, onInspect }) {
2666
2233
  })
2667
2234
  ]
2668
2235
  }),
2669
- /* @__PURE__ */ jsx("td", {
2236
+ /* @__PURE__ */ jsx2("td", {
2670
2237
  children: item.source
2671
2238
  }),
2672
- /* @__PURE__ */ jsx("td", {
2673
- children: /* @__PURE__ */ jsx("span", {
2239
+ /* @__PURE__ */ jsx2("td", {
2240
+ children: /* @__PURE__ */ jsx2("span", {
2674
2241
  className: `kk-badge ${item.seen === "new" ? "kk-badge-success" : "kk-badge-neutral"}`,
2675
2242
  children: item.seen
2676
2243
  })
2677
2244
  }),
2678
- /* @__PURE__ */ jsx("td", {
2245
+ /* @__PURE__ */ jsx2("td", {
2679
2246
  children: item.storyId ?? "—"
2680
2247
  }),
2681
- /* @__PURE__ */ jsx("td", {
2248
+ /* @__PURE__ */ jsx2("td", {
2682
2249
  children: labels.length === 0 ? "—" : labels.map(([decision, value]) => {
2683
2250
  const detail = details[decision];
2684
2251
  const conf = detail?.confidence?.toUpperCase();
2685
- return /* @__PURE__ */ jsxs("span", {
2252
+ return /* @__PURE__ */ jsxs2("span", {
2686
2253
  className: "kk-chip",
2687
2254
  style: { display: "inline-flex", alignItems: "center", gap: "0.25rem" },
2688
2255
  children: [
2689
- /* @__PURE__ */ jsxs("span", {
2256
+ /* @__PURE__ */ jsxs2("span", {
2690
2257
  children: [
2691
2258
  decision,
2692
2259
  ": ",
2693
2260
  value
2694
2261
  ]
2695
2262
  }),
2696
- conf ? /* @__PURE__ */ jsx("span", {
2263
+ conf ? /* @__PURE__ */ jsx2("span", {
2697
2264
  className: `kk-confidence-pill ${conf === "HIGH" ? "kk-confidence-high" : conf === "MEDIUM" ? "kk-confidence-medium" : "kk-confidence-low"}`,
2698
2265
  children: conf
2699
2266
  }) : null
@@ -2701,14 +2268,14 @@ function ItemRow({ item, onInspect }) {
2701
2268
  }, decision);
2702
2269
  })
2703
2270
  }),
2704
- /* @__PURE__ */ jsx("td", {
2705
- children: /* @__PURE__ */ jsx("span", {
2271
+ /* @__PURE__ */ jsx2("td", {
2272
+ children: /* @__PURE__ */ jsx2("span", {
2706
2273
  className: `kk-badge ${item.selection === "published" ? "kk-badge-success" : item.selection === "selected" ? "kk-badge-running" : item.selection === "dropped" ? "kk-badge-warning" : "kk-badge-neutral"}`,
2707
2274
  children: item.selection
2708
2275
  })
2709
2276
  }),
2710
- /* @__PURE__ */ jsx("td", {
2711
- children: /* @__PURE__ */ jsx("button", {
2277
+ /* @__PURE__ */ jsx2("td", {
2278
+ children: /* @__PURE__ */ jsx2("button", {
2712
2279
  type: "button",
2713
2280
  className: "kk-table-btn",
2714
2281
  onClick: () => onInspect?.(item),
@@ -2720,44 +2287,44 @@ function ItemRow({ item, onInspect }) {
2720
2287
  }
2721
2288
  function ItemDetailModal({ item, onClose }) {
2722
2289
  const details = Object.entries(item.labelDetails ?? {});
2723
- return /* @__PURE__ */ jsxs("div", {
2290
+ return /* @__PURE__ */ jsxs2("div", {
2724
2291
  className: "kk-modal-backdrop",
2725
2292
  role: "presentation",
2726
2293
  children: [
2727
- /* @__PURE__ */ jsx("button", {
2294
+ /* @__PURE__ */ jsx2("button", {
2728
2295
  type: "button",
2729
2296
  className: "kk-modal-dismiss-backdrop",
2730
2297
  onClick: onClose,
2731
2298
  "aria-label": "Close item modal",
2732
2299
  tabIndex: -1
2733
2300
  }),
2734
- /* @__PURE__ */ jsxs("div", {
2301
+ /* @__PURE__ */ jsxs2("div", {
2735
2302
  className: "kk-modal-card",
2736
2303
  role: "dialog",
2737
2304
  "aria-modal": "true",
2738
2305
  "aria-labelledby": "kk-item-modal-title",
2739
2306
  children: [
2740
- /* @__PURE__ */ jsxs("div", {
2307
+ /* @__PURE__ */ jsxs2("div", {
2741
2308
  className: "kk-modal-header",
2742
2309
  children: [
2743
- /* @__PURE__ */ jsxs("div", {
2310
+ /* @__PURE__ */ jsxs2("div", {
2744
2311
  className: "kk-modal-header-left",
2745
2312
  children: [
2746
- /* @__PURE__ */ jsx("h2", {
2313
+ /* @__PURE__ */ jsx2("h2", {
2747
2314
  id: "kk-item-modal-title",
2748
2315
  children: "Item Details"
2749
2316
  }),
2750
- /* @__PURE__ */ jsx("span", {
2317
+ /* @__PURE__ */ jsx2("span", {
2751
2318
  className: `kk-badge ${item.seen === "new" ? "kk-badge-success" : "kk-badge-neutral"}`,
2752
2319
  children: item.seen
2753
2320
  }),
2754
- /* @__PURE__ */ jsx("span", {
2321
+ /* @__PURE__ */ jsx2("span", {
2755
2322
  className: "kk-domain-pill",
2756
2323
  children: item.source
2757
2324
  })
2758
2325
  ]
2759
2326
  }),
2760
- /* @__PURE__ */ jsx("button", {
2327
+ /* @__PURE__ */ jsx2("button", {
2761
2328
  type: "button",
2762
2329
  className: "kk-modal-close",
2763
2330
  onClick: onClose,
@@ -2766,89 +2333,89 @@ function ItemDetailModal({ item, onClose }) {
2766
2333
  })
2767
2334
  ]
2768
2335
  }),
2769
- /* @__PURE__ */ jsxs("div", {
2336
+ /* @__PURE__ */ jsxs2("div", {
2770
2337
  className: "kk-modal-body",
2771
2338
  children: [
2772
- /* @__PURE__ */ jsxs("div", {
2339
+ /* @__PURE__ */ jsxs2("div", {
2773
2340
  children: [
2774
- /* @__PURE__ */ jsx("h3", {
2341
+ /* @__PURE__ */ jsx2("h3", {
2775
2342
  style: { margin: "0 0 0.5rem", fontSize: "1.1rem" },
2776
2343
  children: item.title
2777
2344
  }),
2778
- item.url ? /* @__PURE__ */ jsx("a", {
2345
+ item.url ? /* @__PURE__ */ jsx2("a", {
2779
2346
  href: item.url,
2780
2347
  target: "_blank",
2781
2348
  rel: "noreferrer",
2782
2349
  style: { wordBreak: "break-all" },
2783
2350
  children: item.url
2784
- }) : /* @__PURE__ */ jsx("span", {
2351
+ }) : /* @__PURE__ */ jsx2("span", {
2785
2352
  className: "kk-board-state",
2786
2353
  children: "No canonical URL"
2787
2354
  })
2788
2355
  ]
2789
2356
  }),
2790
- /* @__PURE__ */ jsxs("dl", {
2357
+ /* @__PURE__ */ jsxs2("dl", {
2791
2358
  className: "kk-board-facts",
2792
2359
  children: [
2793
- /* @__PURE__ */ jsxs("div", {
2360
+ /* @__PURE__ */ jsxs2("div", {
2794
2361
  children: [
2795
- /* @__PURE__ */ jsx("dt", {
2362
+ /* @__PURE__ */ jsx2("dt", {
2796
2363
  children: "Item ID"
2797
2364
  }),
2798
- /* @__PURE__ */ jsx("dd", {
2799
- children: /* @__PURE__ */ jsx("code", {
2365
+ /* @__PURE__ */ jsx2("dd", {
2366
+ children: /* @__PURE__ */ jsx2("code", {
2800
2367
  children: item.id
2801
2368
  })
2802
2369
  })
2803
2370
  ]
2804
2371
  }),
2805
- /* @__PURE__ */ jsxs("div", {
2372
+ /* @__PURE__ */ jsxs2("div", {
2806
2373
  children: [
2807
- /* @__PURE__ */ jsx("dt", {
2374
+ /* @__PURE__ */ jsx2("dt", {
2808
2375
  children: "Story ID"
2809
2376
  }),
2810
- /* @__PURE__ */ jsx("dd", {
2377
+ /* @__PURE__ */ jsx2("dd", {
2811
2378
  children: item.storyId ?? "—"
2812
2379
  })
2813
2380
  ]
2814
2381
  }),
2815
- /* @__PURE__ */ jsxs("div", {
2382
+ /* @__PURE__ */ jsxs2("div", {
2816
2383
  children: [
2817
- /* @__PURE__ */ jsx("dt", {
2384
+ /* @__PURE__ */ jsx2("dt", {
2818
2385
  children: "Domain"
2819
2386
  }),
2820
- /* @__PURE__ */ jsx("dd", {
2387
+ /* @__PURE__ */ jsx2("dd", {
2821
2388
  children: item.domain ?? "—"
2822
2389
  })
2823
2390
  ]
2824
2391
  }),
2825
- /* @__PURE__ */ jsxs("div", {
2392
+ /* @__PURE__ */ jsxs2("div", {
2826
2393
  children: [
2827
- /* @__PURE__ */ jsx("dt", {
2394
+ /* @__PURE__ */ jsx2("dt", {
2828
2395
  children: "Language"
2829
2396
  }),
2830
- /* @__PURE__ */ jsx("dd", {
2397
+ /* @__PURE__ */ jsx2("dd", {
2831
2398
  children: item.lang ?? "—"
2832
2399
  })
2833
2400
  ]
2834
2401
  }),
2835
- /* @__PURE__ */ jsxs("div", {
2402
+ /* @__PURE__ */ jsxs2("div", {
2836
2403
  children: [
2837
- /* @__PURE__ */ jsx("dt", {
2404
+ /* @__PURE__ */ jsx2("dt", {
2838
2405
  children: "Body Characters"
2839
2406
  }),
2840
- /* @__PURE__ */ jsx("dd", {
2407
+ /* @__PURE__ */ jsx2("dd", {
2841
2408
  children: item.bodyChars?.toLocaleString() ?? "—"
2842
2409
  })
2843
2410
  ]
2844
2411
  }),
2845
- /* @__PURE__ */ jsxs("div", {
2412
+ /* @__PURE__ */ jsxs2("div", {
2846
2413
  children: [
2847
- /* @__PURE__ */ jsx("dt", {
2414
+ /* @__PURE__ */ jsx2("dt", {
2848
2415
  children: "Selection Status"
2849
2416
  }),
2850
- /* @__PURE__ */ jsx("dd", {
2851
- children: /* @__PURE__ */ jsx("span", {
2417
+ /* @__PURE__ */ jsx2("dd", {
2418
+ children: /* @__PURE__ */ jsx2("span", {
2852
2419
  className: `kk-badge ${item.selection === "published" ? "kk-badge-success" : item.selection === "selected" ? "kk-badge-running" : "kk-badge-neutral"}`,
2853
2420
  children: item.selection
2854
2421
  })
@@ -2857,9 +2424,9 @@ function ItemDetailModal({ item, onClose }) {
2857
2424
  })
2858
2425
  ]
2859
2426
  }),
2860
- /* @__PURE__ */ jsxs("div", {
2427
+ /* @__PURE__ */ jsxs2("div", {
2861
2428
  children: [
2862
- /* @__PURE__ */ jsxs("h3", {
2429
+ /* @__PURE__ */ jsxs2("h3", {
2863
2430
  className: "kk-chart-title",
2864
2431
  style: { marginBottom: "0.5rem" },
2865
2432
  children: [
@@ -2868,63 +2435,63 @@ function ItemDetailModal({ item, onClose }) {
2868
2435
  ")"
2869
2436
  ]
2870
2437
  }),
2871
- details.length === 0 ? /* @__PURE__ */ jsx("p", {
2438
+ details.length === 0 ? /* @__PURE__ */ jsx2("p", {
2872
2439
  className: "kk-board-state",
2873
2440
  children: "No detailed label decisions recorded for this item."
2874
- }) : /* @__PURE__ */ jsx("div", {
2441
+ }) : /* @__PURE__ */ jsx2("div", {
2875
2442
  className: "kk-table-container",
2876
- children: /* @__PURE__ */ jsxs("table", {
2443
+ children: /* @__PURE__ */ jsxs2("table", {
2877
2444
  className: "kk-table",
2878
2445
  children: [
2879
- /* @__PURE__ */ jsx("thead", {
2880
- children: /* @__PURE__ */ jsxs("tr", {
2446
+ /* @__PURE__ */ jsx2("thead", {
2447
+ children: /* @__PURE__ */ jsxs2("tr", {
2881
2448
  children: [
2882
- /* @__PURE__ */ jsx("th", {
2449
+ /* @__PURE__ */ jsx2("th", {
2883
2450
  scope: "col",
2884
2451
  children: "Decision"
2885
2452
  }),
2886
- /* @__PURE__ */ jsx("th", {
2453
+ /* @__PURE__ */ jsx2("th", {
2887
2454
  scope: "col",
2888
2455
  children: "Value"
2889
2456
  }),
2890
- /* @__PURE__ */ jsx("th", {
2457
+ /* @__PURE__ */ jsx2("th", {
2891
2458
  scope: "col",
2892
2459
  children: "Confidence"
2893
2460
  }),
2894
- /* @__PURE__ */ jsx("th", {
2461
+ /* @__PURE__ */ jsx2("th", {
2895
2462
  scope: "col",
2896
2463
  children: "Maker"
2897
2464
  }),
2898
- /* @__PURE__ */ jsx("th", {
2465
+ /* @__PURE__ */ jsx2("th", {
2899
2466
  scope: "col",
2900
2467
  children: "Score"
2901
2468
  })
2902
2469
  ]
2903
2470
  })
2904
2471
  }),
2905
- /* @__PURE__ */ jsx("tbody", {
2472
+ /* @__PURE__ */ jsx2("tbody", {
2906
2473
  children: details.map(([decision, detail]) => {
2907
2474
  const conf = detail.confidence?.toUpperCase();
2908
- return /* @__PURE__ */ jsxs("tr", {
2475
+ return /* @__PURE__ */ jsxs2("tr", {
2909
2476
  children: [
2910
- /* @__PURE__ */ jsx("td", {
2911
- children: /* @__PURE__ */ jsx("strong", {
2477
+ /* @__PURE__ */ jsx2("td", {
2478
+ children: /* @__PURE__ */ jsx2("strong", {
2912
2479
  children: decision
2913
2480
  })
2914
2481
  }),
2915
- /* @__PURE__ */ jsx("td", {
2482
+ /* @__PURE__ */ jsx2("td", {
2916
2483
  children: detail.value
2917
2484
  }),
2918
- /* @__PURE__ */ jsx("td", {
2919
- children: conf ? /* @__PURE__ */ jsx("span", {
2485
+ /* @__PURE__ */ jsx2("td", {
2486
+ children: conf ? /* @__PURE__ */ jsx2("span", {
2920
2487
  className: `kk-confidence-pill ${conf === "HIGH" ? "kk-confidence-high" : conf === "MEDIUM" ? "kk-confidence-medium" : "kk-confidence-low"}`,
2921
2488
  children: conf
2922
2489
  }) : "—"
2923
2490
  }),
2924
- /* @__PURE__ */ jsx("td", {
2491
+ /* @__PURE__ */ jsx2("td", {
2925
2492
  children: detail.maker ?? "—"
2926
2493
  }),
2927
- /* @__PURE__ */ jsx("td", {
2494
+ /* @__PURE__ */ jsx2("td", {
2928
2495
  children: detail.score !== null ? detail.score : "—"
2929
2496
  })
2930
2497
  ]
@@ -2938,9 +2505,9 @@ function ItemDetailModal({ item, onClose }) {
2938
2505
  })
2939
2506
  ]
2940
2507
  }),
2941
- /* @__PURE__ */ jsx("div", {
2508
+ /* @__PURE__ */ jsx2("div", {
2942
2509
  className: "kk-modal-footer",
2943
- children: /* @__PURE__ */ jsx("button", {
2510
+ children: /* @__PURE__ */ jsx2("button", {
2944
2511
  type: "button",
2945
2512
  className: "kk-btn-action",
2946
2513
  onClick: onClose,
@@ -2975,17 +2542,17 @@ function SelectionsPanel({
2975
2542
  const page = storeState === "available" ? selections : null;
2976
2543
  const count = page === null ? null : pager(page.page, page.total, page.pageSize);
2977
2544
  const availableTopics = (topics && topics.length > 0 ? topics : selections?.topics) ?? [];
2978
- return /* @__PURE__ */ jsxs("section", {
2545
+ return /* @__PURE__ */ jsxs2("section", {
2979
2546
  className: "kk-card kk-collect-items",
2980
2547
  children: [
2981
- /* @__PURE__ */ jsxs("div", {
2548
+ /* @__PURE__ */ jsxs2("div", {
2982
2549
  className: "kk-collect-filters",
2983
2550
  children: [
2984
- /* @__PURE__ */ jsxs("label", {
2551
+ /* @__PURE__ */ jsxs2("label", {
2985
2552
  className: "kk-collect-filter",
2986
2553
  children: [
2987
2554
  "Search",
2988
- /* @__PURE__ */ jsx("input", {
2555
+ /* @__PURE__ */ jsx2("input", {
2989
2556
  type: "text",
2990
2557
  className: "kk-search-input",
2991
2558
  placeholder: "Topic, title or reason...",
@@ -2995,19 +2562,19 @@ function SelectionsPanel({
2995
2562
  })
2996
2563
  ]
2997
2564
  }),
2998
- /* @__PURE__ */ jsxs("label", {
2565
+ /* @__PURE__ */ jsxs2("label", {
2999
2566
  className: "kk-collect-filter",
3000
2567
  children: [
3001
2568
  "Topic",
3002
- /* @__PURE__ */ jsxs("select", {
2569
+ /* @__PURE__ */ jsxs2("select", {
3003
2570
  value: filters.topic ?? "",
3004
2571
  onChange: (e) => onTopicChange?.(e.target.value === "" ? undefined : e.target.value),
3005
2572
  children: [
3006
- /* @__PURE__ */ jsx("option", {
2573
+ /* @__PURE__ */ jsx2("option", {
3007
2574
  value: "",
3008
2575
  children: "All Topics"
3009
2576
  }),
3010
- availableTopics.map((t) => /* @__PURE__ */ jsx("option", {
2577
+ availableTopics.map((t) => /* @__PURE__ */ jsx2("option", {
3011
2578
  value: t,
3012
2579
  children: t
3013
2580
  }, t))
@@ -3015,27 +2582,27 @@ function SelectionsPanel({
3015
2582
  })
3016
2583
  ]
3017
2584
  }),
3018
- /* @__PURE__ */ jsxs("label", {
2585
+ /* @__PURE__ */ jsxs2("label", {
3019
2586
  className: "kk-collect-filter",
3020
2587
  children: [
3021
2588
  "Status",
3022
- /* @__PURE__ */ jsxs("select", {
2589
+ /* @__PURE__ */ jsxs2("select", {
3023
2590
  value: filters.status ?? "",
3024
2591
  onChange: (e) => onStatusChange?.(e.target.value === "" ? undefined : e.target.value),
3025
2592
  children: [
3026
- /* @__PURE__ */ jsx("option", {
2593
+ /* @__PURE__ */ jsx2("option", {
3027
2594
  value: "",
3028
2595
  children: "All Statuses"
3029
2596
  }),
3030
- /* @__PURE__ */ jsx("option", {
2597
+ /* @__PURE__ */ jsx2("option", {
3031
2598
  value: "selected",
3032
2599
  children: "selected"
3033
2600
  }),
3034
- /* @__PURE__ */ jsx("option", {
2601
+ /* @__PURE__ */ jsx2("option", {
3035
2602
  value: "published",
3036
2603
  children: "published"
3037
2604
  }),
3038
- /* @__PURE__ */ jsx("option", {
2605
+ /* @__PURE__ */ jsx2("option", {
3039
2606
  value: "dropped",
3040
2607
  children: "dropped"
3041
2608
  })
@@ -3045,74 +2612,74 @@ function SelectionsPanel({
3045
2612
  })
3046
2613
  ]
3047
2614
  }),
3048
- storeState === "loading" ? /* @__PURE__ */ jsx("p", {
2615
+ storeState === "loading" ? /* @__PURE__ */ jsx2("p", {
3049
2616
  children: "The selections page has not loaded yet."
3050
2617
  }) : null,
3051
- storeState === "unavailable" ? /* @__PURE__ */ jsxs(Fragment, {
2618
+ storeState === "unavailable" ? /* @__PURE__ */ jsxs2(Fragment, {
3052
2619
  children: [
3053
- /* @__PURE__ */ jsx("p", {
2620
+ /* @__PURE__ */ jsx2("p", {
3054
2621
  children: "The selections could not be read; no rows are shown."
3055
2622
  }),
3056
- /* @__PURE__ */ jsx(StoreState, {
2623
+ /* @__PURE__ */ jsx2(StoreState, {
3057
2624
  diagnostics: selections?.diagnostics ?? []
3058
2625
  })
3059
2626
  ]
3060
2627
  }) : null,
3061
- page !== null && page.selections.length === 0 ? /* @__PURE__ */ jsx("p", {
2628
+ page !== null && page.selections.length === 0 ? /* @__PURE__ */ jsx2("p", {
3062
2629
  children: "No selections match these filters."
3063
2630
  }) : null,
3064
- page === null || page.selections.length === 0 ? null : /* @__PURE__ */ jsx("div", {
2631
+ page === null || page.selections.length === 0 ? null : /* @__PURE__ */ jsx2("div", {
3065
2632
  className: "kk-table-container",
3066
- children: /* @__PURE__ */ jsxs("table", {
2633
+ children: /* @__PURE__ */ jsxs2("table", {
3067
2634
  className: "kk-table",
3068
2635
  children: [
3069
- /* @__PURE__ */ jsx("thead", {
3070
- children: /* @__PURE__ */ jsxs("tr", {
2636
+ /* @__PURE__ */ jsx2("thead", {
2637
+ children: /* @__PURE__ */ jsxs2("tr", {
3071
2638
  children: [
3072
- /* @__PURE__ */ jsx("th", {
2639
+ /* @__PURE__ */ jsx2("th", {
3073
2640
  scope: "col",
3074
2641
  children: "Rank"
3075
2642
  }),
3076
- /* @__PURE__ */ jsx("th", {
2643
+ /* @__PURE__ */ jsx2("th", {
3077
2644
  scope: "col",
3078
2645
  children: "Topic"
3079
2646
  }),
3080
- /* @__PURE__ */ jsx("th", {
2647
+ /* @__PURE__ */ jsx2("th", {
3081
2648
  scope: "col",
3082
2649
  children: "Title & URL"
3083
2650
  }),
3084
- /* @__PURE__ */ jsx("th", {
2651
+ /* @__PURE__ */ jsx2("th", {
3085
2652
  scope: "col",
3086
2653
  children: "Source"
3087
2654
  }),
3088
- /* @__PURE__ */ jsx("th", {
2655
+ /* @__PURE__ */ jsx2("th", {
3089
2656
  scope: "col",
3090
2657
  children: "Story"
3091
2658
  }),
3092
- /* @__PURE__ */ jsx("th", {
2659
+ /* @__PURE__ */ jsx2("th", {
3093
2660
  scope: "col",
3094
2661
  children: "Status"
3095
2662
  }),
3096
- /* @__PURE__ */ jsx("th", {
2663
+ /* @__PURE__ */ jsx2("th", {
3097
2664
  scope: "col",
3098
2665
  children: "Reason"
3099
2666
  }),
3100
- /* @__PURE__ */ jsx("th", {
2667
+ /* @__PURE__ */ jsx2("th", {
3101
2668
  scope: "col",
3102
2669
  children: "Selected At"
3103
2670
  }),
3104
- /* @__PURE__ */ jsx("th", {
2671
+ /* @__PURE__ */ jsx2("th", {
3105
2672
  scope: "col",
3106
2673
  children: "Run ID"
3107
2674
  })
3108
2675
  ]
3109
2676
  })
3110
2677
  }),
3111
- /* @__PURE__ */ jsx("tbody", {
3112
- children: page.selections.map((item) => /* @__PURE__ */ jsxs("tr", {
2678
+ /* @__PURE__ */ jsx2("tbody", {
2679
+ children: page.selections.map((item) => /* @__PURE__ */ jsxs2("tr", {
3113
2680
  children: [
3114
- /* @__PURE__ */ jsx("td", {
3115
- children: /* @__PURE__ */ jsxs("span", {
2681
+ /* @__PURE__ */ jsx2("td", {
2682
+ children: /* @__PURE__ */ jsxs2("span", {
3116
2683
  className: "kk-badge kk-badge-neutral",
3117
2684
  children: [
3118
2685
  "#",
@@ -3120,44 +2687,44 @@ function SelectionsPanel({
3120
2687
  ]
3121
2688
  })
3122
2689
  }),
3123
- /* @__PURE__ */ jsx("td", {
3124
- children: /* @__PURE__ */ jsx("span", {
2690
+ /* @__PURE__ */ jsx2("td", {
2691
+ children: /* @__PURE__ */ jsx2("span", {
3125
2692
  className: "kk-domain-pill",
3126
2693
  children: item.topic
3127
2694
  })
3128
2695
  }),
3129
- /* @__PURE__ */ jsx("td", {
3130
- children: item.url ? /* @__PURE__ */ jsx("a", {
2696
+ /* @__PURE__ */ jsx2("td", {
2697
+ children: item.url ? /* @__PURE__ */ jsx2("a", {
3131
2698
  href: item.url,
3132
2699
  target: "_blank",
3133
2700
  rel: "noreferrer",
3134
2701
  children: item.title ?? item.itemId
3135
2702
  }) : item.title ?? item.itemId
3136
2703
  }),
3137
- /* @__PURE__ */ jsx("td", {
2704
+ /* @__PURE__ */ jsx2("td", {
3138
2705
  children: item.source ?? "—"
3139
2706
  }),
3140
- /* @__PURE__ */ jsx("td", {
2707
+ /* @__PURE__ */ jsx2("td", {
3141
2708
  children: item.storyId ?? "—"
3142
2709
  }),
3143
- /* @__PURE__ */ jsx("td", {
3144
- children: /* @__PURE__ */ jsx("span", {
2710
+ /* @__PURE__ */ jsx2("td", {
2711
+ children: /* @__PURE__ */ jsx2("span", {
3145
2712
  className: `kk-badge ${item.status === "published" ? "kk-badge-success" : item.status === "selected" ? "kk-badge-running" : "kk-badge-failed"}`,
3146
2713
  children: item.status
3147
2714
  })
3148
2715
  }),
3149
- /* @__PURE__ */ jsx("td", {
3150
- children: /* @__PURE__ */ jsx("span", {
2716
+ /* @__PURE__ */ jsx2("td", {
2717
+ children: /* @__PURE__ */ jsx2("span", {
3151
2718
  className: "kk-stat-sub",
3152
2719
  title: item.reason ?? undefined,
3153
2720
  children: item.reason ? item.reason.length > 60 ? `${item.reason.slice(0, 60)}…` : item.reason : "—"
3154
2721
  })
3155
2722
  }),
3156
- /* @__PURE__ */ jsx("td", {
2723
+ /* @__PURE__ */ jsx2("td", {
3157
2724
  children: formatEpoch(item.selectedAt)
3158
2725
  }),
3159
- /* @__PURE__ */ jsx("td", {
3160
- children: /* @__PURE__ */ jsx("button", {
2726
+ /* @__PURE__ */ jsx2("td", {
2727
+ children: /* @__PURE__ */ jsx2("button", {
3161
2728
  type: "button",
3162
2729
  className: "kk-collect-run-link",
3163
2730
  onClick: () => onInspectRun?.(item.runId),
@@ -3171,17 +2738,17 @@ function SelectionsPanel({
3171
2738
  ]
3172
2739
  })
3173
2740
  }),
3174
- count === null ? null : /* @__PURE__ */ jsxs("div", {
2741
+ count === null ? null : /* @__PURE__ */ jsxs2("div", {
3175
2742
  className: "kk-collect-pager",
3176
2743
  children: [
3177
- /* @__PURE__ */ jsx("button", {
2744
+ /* @__PURE__ */ jsx2("button", {
3178
2745
  type: "button",
3179
2746
  name: "previous",
3180
2747
  disabled: count.page <= 1,
3181
2748
  onClick: () => onPageChange?.(-1),
3182
2749
  children: "Previous"
3183
2750
  }),
3184
- /* @__PURE__ */ jsxs("span", {
2751
+ /* @__PURE__ */ jsxs2("span", {
3185
2752
  children: [
3186
2753
  "Page ",
3187
2754
  count.page,
@@ -3192,7 +2759,7 @@ function SelectionsPanel({
3192
2759
  " selections"
3193
2760
  ]
3194
2761
  }),
3195
- /* @__PURE__ */ jsx("button", {
2762
+ /* @__PURE__ */ jsx2("button", {
3196
2763
  type: "button",
3197
2764
  name: "next",
3198
2765
  disabled: count.page >= count.pages,
@@ -3206,14 +2773,14 @@ function SelectionsPanel({
3206
2773
  }
3207
2774
  function ProgressPanel({ steps }) {
3208
2775
  if (steps.length === 0)
3209
- return /* @__PURE__ */ jsx("p", {
2776
+ return /* @__PURE__ */ jsx2("p", {
3210
2777
  children: "Recorded progress is unavailable for the selected run."
3211
2778
  });
3212
- return /* @__PURE__ */ jsx("ul", {
2779
+ return /* @__PURE__ */ jsx2("ul", {
3213
2780
  className: "kk-board-progress",
3214
- children: steps.map((step) => /* @__PURE__ */ jsxs("li", {
2781
+ children: steps.map((step) => /* @__PURE__ */ jsxs2("li", {
3215
2782
  children: [
3216
- /* @__PURE__ */ jsx("strong", {
2783
+ /* @__PURE__ */ jsx2("strong", {
3217
2784
  children: step.state
3218
2785
  }),
3219
2786
  " visit ",
@@ -3222,12 +2789,12 @@ function ProgressPanel({ steps }) {
3222
2789
  step.status,
3223
2790
  " · ",
3224
2791
  step.timing,
3225
- step.operatorWait ? /* @__PURE__ */ jsx("span", {
2792
+ step.operatorWait ? /* @__PURE__ */ jsx2("span", {
3226
2793
  className: "kk-board-state",
3227
2794
  children: " operator wait"
3228
2795
  }) : null,
3229
- step.actions.length === 0 ? null : /* @__PURE__ */ jsx("ul", {
3230
- children: step.actions.map((action) => /* @__PURE__ */ jsx("li", {
2796
+ step.actions.length === 0 ? null : /* @__PURE__ */ jsx2("ul", {
2797
+ children: step.actions.map((action) => /* @__PURE__ */ jsx2("li", {
3231
2798
  children: action
3232
2799
  }, action))
3233
2800
  })
@@ -3237,44 +2804,44 @@ function ProgressPanel({ steps }) {
3237
2804
  }
3238
2805
  function ConfigPanel({ config }) {
3239
2806
  if (config === null)
3240
- return /* @__PURE__ */ jsx("p", {
2807
+ return /* @__PURE__ */ jsx2("p", {
3241
2808
  children: "No captured configuration for the selected run."
3242
2809
  });
3243
2810
  const entries = Object.entries(config.settings);
3244
- return /* @__PURE__ */ jsxs("div", {
2811
+ return /* @__PURE__ */ jsxs2("div", {
3245
2812
  className: "kk-board-config",
3246
2813
  children: [
3247
- /* @__PURE__ */ jsxs("p", {
2814
+ /* @__PURE__ */ jsxs2("p", {
3248
2815
  children: [
3249
2816
  "Captured ",
3250
2817
  formatTimestamp(config.capturedAt)
3251
2818
  ]
3252
2819
  }),
3253
- entries.length === 0 ? /* @__PURE__ */ jsx("p", {
2820
+ entries.length === 0 ? /* @__PURE__ */ jsx2("p", {
3254
2821
  children: "Recorded configuration unavailable for this run."
3255
2822
  }) : null,
3256
- /* @__PURE__ */ jsx("dl", {
3257
- children: entries.map(([key, value]) => /* @__PURE__ */ jsxs("div", {
2823
+ /* @__PURE__ */ jsx2("dl", {
2824
+ children: entries.map(([key, value]) => /* @__PURE__ */ jsxs2("div", {
3258
2825
  children: [
3259
- /* @__PURE__ */ jsx("dt", {
2826
+ /* @__PURE__ */ jsx2("dt", {
3260
2827
  children: key
3261
2828
  }),
3262
- /* @__PURE__ */ jsx("dd", {
2829
+ /* @__PURE__ */ jsx2("dd", {
3263
2830
  children: value
3264
2831
  })
3265
2832
  ]
3266
2833
  }, key))
3267
2834
  }),
3268
- config.unavailableKeys.length === 0 ? null : /* @__PURE__ */ jsxs("p", {
2835
+ config.unavailableKeys.length === 0 ? null : /* @__PURE__ */ jsxs2("p", {
3269
2836
  children: [
3270
2837
  "Uncaptured keys: ",
3271
2838
  config.unavailableKeys.join(", ")
3272
2839
  ]
3273
2840
  }),
3274
- /* @__PURE__ */ jsxs("p", {
2841
+ /* @__PURE__ */ jsxs2("p", {
3275
2842
  children: [
3276
2843
  "Current definitions and defaults live in ",
3277
- /* @__PURE__ */ jsx("a", {
2844
+ /* @__PURE__ */ jsx2("a", {
3278
2845
  href: "/board/settings/workflows",
3279
2846
  children: "Settings → Workflows"
3280
2847
  }),
@@ -3286,7 +2853,7 @@ function ConfigPanel({ config }) {
3286
2853
  }
3287
2854
 
3288
2855
  // ../board/src/collect/index.tsx
3289
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
2856
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
3290
2857
  var TAB_LABELS = {
3291
2858
  summary: "Summary",
3292
2859
  runs: "Run Details",
@@ -3296,6 +2863,26 @@ var TAB_LABELS = {
3296
2863
  function messageOf(error) {
3297
2864
  return error instanceof Error ? error.message : String(error);
3298
2865
  }
2866
+ var COLLECT_RANGES = ["24h", "7d", "14d", "30d", "All"];
2867
+ function parseRange(search) {
2868
+ const raw = new URLSearchParams(search.startsWith("?") ? search.slice(1) : search).get("range");
2869
+ if (raw === null)
2870
+ return { range: "14d", diagnostic: null };
2871
+ if (COLLECT_RANGES.includes(raw)) {
2872
+ return { range: raw, diagnostic: null };
2873
+ }
2874
+ return {
2875
+ range: "14d",
2876
+ diagnostic: { code: "board.deeplink.unknown-range", message: `Unknown range '${raw}'; showing 14d.` }
2877
+ };
2878
+ }
2879
+ function rangeWindow(range, now) {
2880
+ const untilMs = now;
2881
+ if (range === "All")
2882
+ return { fromMs: 0, untilMs };
2883
+ const days = range === "24h" ? 1 : range === "7d" ? 7 : range === "14d" ? 14 : 30;
2884
+ return { fromMs: untilMs - days * 86400000, untilMs };
2885
+ }
3299
2886
  function usePolling(loader, intervalMs, refresh) {
3300
2887
  const loaderRef = useRef(loader);
3301
2888
  loaderRef.current = loader;
@@ -3323,9 +2910,12 @@ function isOfflineError(msg) {
3323
2910
  }
3324
2911
  function CollectModule() {
3325
2912
  const [link] = useState(() => parseDeepLink(window.location.search, COLLECT_TABS, COLLECT_TAB_ALIASES));
2913
+ const [rangeLink] = useState(() => parseRange(window.location.search));
3326
2914
  const [reader] = useState(() => readerOriginFrom(window.location.search, window.location.origin));
2915
+ const [aggregateReader] = useState(() => readerOriginFrom(window.location.search, DEFAULT_READER_ORIGIN));
3327
2916
  const readerOrigin = reader.origin;
3328
- const client = useMemo(() => createBoardClient({ readerOrigin, boardOrigin: window.location.origin }), [readerOrigin]);
2917
+ const aggregateReaderOrigin = aggregateReader.origin;
2918
+ const client = useMemo(() => createBoardClient({ readerOrigin, aggregateReaderOrigin, boardOrigin: window.location.origin }), [readerOrigin, aggregateReaderOrigin]);
3329
2919
  const [rows, setRows] = useState([]);
3330
2920
  const [_cursor, setCursor] = useState(null);
3331
2921
  const [selection, setSelection] = useState({
@@ -3334,7 +2924,9 @@ function CollectModule() {
3334
2924
  });
3335
2925
  const [diagnostics, setDiagnostics] = useState(() => [
3336
2926
  ...link.diagnostics,
3337
- ...reader.diagnostic === null ? [] : [reader.diagnostic]
2927
+ ...rangeLink.diagnostic === null ? [] : [rangeLink.diagnostic],
2928
+ ...reader.diagnostic === null ? [] : [reader.diagnostic],
2929
+ ...aggregateReader.diagnostic === null ? [] : [aggregateReader.diagnostic]
3338
2930
  ]);
3339
2931
  const [isReaderOffline, setIsReaderOffline] = useState(false);
3340
2932
  const [historyRefresh, setHistoryRefresh] = useState(() => initialRefresh(HISTORY_POLL_MS));
@@ -3348,12 +2940,14 @@ function CollectModule() {
3348
2940
  const [selectedInspectItem, setSelectedInspectItem] = useState(null);
3349
2941
  const [selections, setSelections] = useState(null);
3350
2942
  const [selectionsFilters, setSelectionsFilters] = useState({ page: 1 });
2943
+ const [channels, setChannels] = useState(null);
2944
+ const [channelsPage, setChannelsPage] = useState(1);
3351
2945
  const [selectedModalRunId, setSelectedModalRunId] = useState(null);
3352
2946
  const [modalStoreRun, setModalStoreRun] = useState(null);
3353
2947
  const [modalResults, setModalResults] = useState(null);
3354
2948
  const [modalProgress, setModalProgress] = useState(null);
3355
2949
  const [modalConfig, setModalConfig] = useState(null);
3356
- const [timeRange, setTimeRange] = useState("24h");
2950
+ const [timeRange, setTimeRange] = useState(rangeLink.range);
3357
2951
  const [showEffective, setShowEffective] = useState(false);
3358
2952
  const [runSearchQuery, setRunSearchQuery] = useState("");
3359
2953
  const [runStatusFilter, setRunStatusFilter] = useState("all");
@@ -3500,6 +3094,32 @@ function CollectModule() {
3500
3094
  }
3501
3095
  }
3502
3096
  }, [client, selectionsFilters]);
3097
+ const channelsRequests = useRef(requestSequence());
3098
+ const loadChannels = useCallback(async () => {
3099
+ const token = channelsRequests.current.begin();
3100
+ const { fromMs, untilMs } = rangeWindow(timeRange, Date.now());
3101
+ try {
3102
+ const page = await client.storeChannels({ fromMs, untilMs, page: channelsPage });
3103
+ if (!channelsRequests.current.isCurrent(token))
3104
+ return;
3105
+ setChannels(page);
3106
+ setIsReaderOffline(false);
3107
+ } catch (error) {
3108
+ if (!channelsRequests.current.isCurrent(token))
3109
+ return;
3110
+ setChannels(null);
3111
+ const msg = messageOf(error);
3112
+ if (isOfflineError(msg)) {
3113
+ setIsReaderOffline(true);
3114
+ } else {
3115
+ setDiagnostics((existing) => [...existing, { code: "board.store.channels-unavailable", message: msg }]);
3116
+ }
3117
+ }
3118
+ }, [client, timeRange, channelsPage]);
3119
+ const rangeChanged = useCallback((range) => {
3120
+ setTimeRange(range);
3121
+ setChannelsPage(1);
3122
+ }, []);
3503
3123
  useEffect(() => {
3504
3124
  if (!selectedModalRunId) {
3505
3125
  modalTarget.current = null;
@@ -3565,6 +3185,11 @@ function CollectModule() {
3565
3185
  return;
3566
3186
  loadSelections();
3567
3187
  }, [selection.tab, loadSelections]);
3188
+ useEffect(() => {
3189
+ if (selection.tab !== "summary")
3190
+ return;
3191
+ loadChannels();
3192
+ }, [selection.tab, loadChannels]);
3568
3193
  useEffect(() => {
3569
3194
  if (selection.runId === null && rows.length > 0) {
3570
3195
  setSelection((state) => state.runId === null ? resolveSelection(rows, link, "summary") : state);
@@ -3573,6 +3198,15 @@ function CollectModule() {
3573
3198
  useEffect(() => {
3574
3199
  syncSelectionUrl(selection, { location: window.location, history: window.history });
3575
3200
  }, [selection]);
3201
+ useEffect(() => {
3202
+ if (window.location.pathname !== COLLECT_MODULE_PATH)
3203
+ return;
3204
+ const params = new URLSearchParams(window.location.search);
3205
+ if (params.get("range") === timeRange)
3206
+ return;
3207
+ params.set("range", timeRange);
3208
+ window.history.replaceState(window.history.state, "", `${window.location.pathname}?${params.toString()}`);
3209
+ }, [timeRange]);
3576
3210
  const tab = selection.tab;
3577
3211
  const now = Date.now();
3578
3212
  const currentStoreRun = storeRun?.runId === selection.runId ? storeRun : null;
@@ -3606,27 +3240,27 @@ function CollectModule() {
3606
3240
  const displayDiagnostics = dedupeDiagnostics([...diagnostics, ...results?.diagnostics ?? []]).filter((d) => {
3607
3241
  if (!isReaderOffline)
3608
3242
  return true;
3609
- return d.code !== "board.reader.unavailable" && d.code !== "board.store.run-unavailable" && d.code !== "board.store.unavailable" && d.code !== "board.store.items-unavailable" && d.code !== "board.store.selections-unavailable";
3243
+ return d.code !== "board.reader.unavailable" && d.code !== "board.store.run-unavailable" && d.code !== "board.store.unavailable" && d.code !== "board.store.items-unavailable" && d.code !== "board.store.selections-unavailable" && d.code !== "board.store.channels-unavailable";
3610
3244
  });
3611
- return /* @__PURE__ */ jsxs2("div", {
3245
+ return /* @__PURE__ */ jsxs3("div", {
3612
3246
  className: "kk-board kk-board-collect",
3613
3247
  children: [
3614
- /* @__PURE__ */ jsxs2("header", {
3248
+ /* @__PURE__ */ jsxs3("header", {
3615
3249
  className: "kk-board-header",
3616
3250
  children: [
3617
- /* @__PURE__ */ jsx2("div", {
3251
+ /* @__PURE__ */ jsx3("div", {
3618
3252
  className: "kk-board-header-left",
3619
- children: /* @__PURE__ */ jsx2("div", {
3253
+ children: /* @__PURE__ */ jsx3("div", {
3620
3254
  className: "kk-board-header-title-row",
3621
- children: /* @__PURE__ */ jsx2("h1", {
3255
+ children: /* @__PURE__ */ jsx3("h1", {
3622
3256
  children: "Collect"
3623
3257
  })
3624
3258
  })
3625
3259
  }),
3626
- /* @__PURE__ */ jsxs2("div", {
3260
+ /* @__PURE__ */ jsxs3("div", {
3627
3261
  className: "kk-board-header-right",
3628
3262
  children: [
3629
- /* @__PURE__ */ jsx2("button", {
3263
+ /* @__PURE__ */ jsx3("button", {
3630
3264
  type: "button",
3631
3265
  onClick: () => {
3632
3266
  loadReader();
@@ -3635,11 +3269,13 @@ function CollectModule() {
3635
3269
  loadItems(selection.runId ?? "");
3636
3270
  if (selection.tab === "selections")
3637
3271
  loadSelections();
3272
+ if (selection.tab === "summary")
3273
+ loadChannels();
3638
3274
  },
3639
3275
  title: "Refresh data",
3640
3276
  children: "↻ Refresh"
3641
3277
  }),
3642
- /* @__PURE__ */ jsx2("a", {
3278
+ /* @__PURE__ */ jsx3("a", {
3643
3279
  href: selectionPath(selection, window.location.search),
3644
3280
  className: "kk-btn-action",
3645
3281
  title: "Permanent link",
@@ -3649,30 +3285,30 @@ function CollectModule() {
3649
3285
  })
3650
3286
  ]
3651
3287
  }),
3652
- isReaderOffline && readerOrigin !== window.location.origin ? /* @__PURE__ */ jsxs2("div", {
3288
+ isReaderOffline && readerOrigin !== window.location.origin ? /* @__PURE__ */ jsxs3("div", {
3653
3289
  className: "kk-board-reader-offline-banner",
3654
3290
  role: "alert",
3655
3291
  children: [
3656
- /* @__PURE__ */ jsx2("div", {
3292
+ /* @__PURE__ */ jsx3("div", {
3657
3293
  className: "kk-board-reader-offline-icon",
3658
3294
  children: "⚠️"
3659
3295
  }),
3660
- /* @__PURE__ */ jsxs2("div", {
3296
+ /* @__PURE__ */ jsxs3("div", {
3661
3297
  className: "kk-board-reader-offline-content",
3662
3298
  children: [
3663
- /* @__PURE__ */ jsxs2("strong", {
3299
+ /* @__PURE__ */ jsxs3("strong", {
3664
3300
  children: [
3665
3301
  "Loopback Board Reader Offline (",
3666
3302
  readerOrigin,
3667
3303
  ")"
3668
3304
  ]
3669
3305
  }),
3670
- /* @__PURE__ */ jsx2("p", {
3306
+ /* @__PURE__ */ jsx3("p", {
3671
3307
  children: "Store facts, item inspection, and artifact evidence require the local reader process. Spur run execution history remains available."
3672
3308
  })
3673
3309
  ]
3674
3310
  }),
3675
- /* @__PURE__ */ jsx2("button", {
3311
+ /* @__PURE__ */ jsx3("button", {
3676
3312
  type: "button",
3677
3313
  className: "kk-btn-action",
3678
3314
  onClick: () => {
@@ -3683,42 +3319,43 @@ function CollectModule() {
3683
3319
  loadItems(selection.runId ?? "");
3684
3320
  if (selection.tab === "selections")
3685
3321
  loadSelections();
3322
+ if (selection.tab === "summary")
3323
+ loadChannels();
3686
3324
  },
3687
3325
  children: "↻ Retry Connection"
3688
3326
  })
3689
3327
  ]
3690
3328
  }) : null,
3691
- /* @__PURE__ */ jsx2("nav", {
3329
+ /* @__PURE__ */ jsx3("nav", {
3692
3330
  className: "kk-board-tabs",
3693
3331
  "aria-label": "Collect tabs",
3694
- children: COLLECT_TABS.map((candidate) => /* @__PURE__ */ jsx2("button", {
3332
+ children: COLLECT_TABS.map((candidate) => /* @__PURE__ */ jsx3("button", {
3695
3333
  type: "button",
3696
3334
  "aria-current": candidate === tab ? "page" : undefined,
3697
3335
  onClick: () => setSelection((state) => ({ ...state, tab: candidate })),
3698
3336
  children: TAB_LABELS[candidate]
3699
3337
  }, candidate))
3700
3338
  }),
3701
- rows.length === 0 ? /* @__PURE__ */ jsxs2("p", {
3339
+ rows.length === 0 ? /* @__PURE__ */ jsxs3("p", {
3702
3340
  className: "kk-board-empty",
3703
3341
  children: [
3704
3342
  "No runs recorded for kk-collect. Configure the workflow in",
3705
3343
  " ",
3706
- /* @__PURE__ */ jsx2("a", {
3344
+ /* @__PURE__ */ jsx3("a", {
3707
3345
  href: "/board/settings/workflows",
3708
3346
  children: "Settings → Workflows"
3709
3347
  }),
3710
3348
  "."
3711
3349
  ]
3712
3350
  }) : null,
3713
- tab === "summary" ? /* @__PURE__ */ jsx2(SummaryPanel, {
3714
- runs: rows,
3715
- overview,
3716
- now,
3351
+ tab === "summary" ? /* @__PURE__ */ jsx3(SummaryPanel, {
3352
+ channels,
3717
3353
  timeRange,
3718
- onTimeRangeChange: setTimeRange,
3719
- onInspectRun: handleInspectRun
3354
+ onTimeRangeChange: rangeChanged,
3355
+ channelsPage,
3356
+ onChannelsPageChange: (delta) => setChannelsPage((page) => Math.max(1, page + delta))
3720
3357
  }) : null,
3721
- tab === "runs" ? /* @__PURE__ */ jsx2(RunDetailsPanel, {
3358
+ tab === "runs" ? /* @__PURE__ */ jsx3(RunDetailsPanel, {
3722
3359
  runs: rows,
3723
3360
  overview,
3724
3361
  now,
@@ -3729,7 +3366,7 @@ function CollectModule() {
3729
3366
  onStatusFilterChange: setRunStatusFilter,
3730
3367
  onInspectRun: handleInspectRun
3731
3368
  }) : null,
3732
- tab === "items" ? /* @__PURE__ */ jsx2(ItemsPanel, {
3369
+ tab === "items" ? /* @__PURE__ */ jsx3(ItemsPanel, {
3733
3370
  runId: selection.runId,
3734
3371
  items,
3735
3372
  filters: itemFilters,
@@ -3744,7 +3381,7 @@ function CollectModule() {
3744
3381
  onPageChange: pageChanged,
3745
3382
  onInspectItem: (item) => setSelectedInspectItem(item)
3746
3383
  }) : null,
3747
- tab === "selections" ? /* @__PURE__ */ jsx2(SelectionsPanel, {
3384
+ tab === "selections" ? /* @__PURE__ */ jsx3(SelectionsPanel, {
3748
3385
  selections,
3749
3386
  topics: selections?.topics ?? [],
3750
3387
  filters: selectionsFilters,
@@ -3754,12 +3391,12 @@ function CollectModule() {
3754
3391
  onPageChange: (delta) => setSelectionsFilters((s) => ({ ...s, page: Math.max(1, (s.page ?? 1) + delta) })),
3755
3392
  onInspectRun: handleInspectRun
3756
3393
  }) : null,
3757
- displayDiagnostics.map((diagnostic) => /* @__PURE__ */ jsx2("p", {
3394
+ displayDiagnostics.map((diagnostic) => /* @__PURE__ */ jsx3("p", {
3758
3395
  role: "status",
3759
3396
  className: "kk-board-diagnostic",
3760
3397
  children: diagnosticLine(diagnostic)
3761
3398
  }, diagnostic.code)),
3762
- selectedModalRunId ? /* @__PURE__ */ jsx2(RunDetailModal, {
3399
+ selectedModalRunId ? /* @__PURE__ */ jsx3(RunDetailModal, {
3763
3400
  runId: selectedModalRunId,
3764
3401
  storeRun: modalStoreRun,
3765
3402
  results: modalResults,
@@ -3771,7 +3408,7 @@ function CollectModule() {
3771
3408
  onToggleQuality: toggleQuality,
3772
3409
  onClose: handleCloseModal
3773
3410
  }) : null,
3774
- selectedInspectItem ? /* @__PURE__ */ jsx2(ItemDetailModal, {
3411
+ selectedInspectItem ? /* @__PURE__ */ jsx3(ItemDetailModal, {
3775
3412
  item: selectedInspectItem,
3776
3413
  onClose: () => setSelectedInspectItem(null)
3777
3414
  }) : null