@debugkit/dashboard 0.8.0 → 0.10.0

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 (79) hide show
  1. package/dist/client/assets/_authed-3se5Egqg.js +1 -0
  2. package/dist/client/assets/_authed-BfFWbTOO.js +1 -0
  3. package/dist/client/assets/app-code-BKWbvUMR.js +1 -0
  4. package/dist/client/assets/closed-issues-Cl-8l4oR.js +1 -0
  5. package/dist/client/assets/{copy-button-ORgLIh59.js → copy-button-BwRd5q7l.js} +1 -1
  6. package/dist/client/assets/customers-Cf-R8BOg.js +1 -0
  7. package/dist/client/assets/empty-state-njgr1sWu.js +7 -0
  8. package/dist/client/assets/endpoints-BMqAUNyE.js +1 -0
  9. package/dist/client/assets/events._eventId-CVRZJ-bU.js +2 -0
  10. package/dist/client/assets/exchange-view-DVwSLcXF.js +2 -0
  11. package/dist/client/assets/index-DEnCDILF.js +10 -0
  12. package/dist/client/assets/{invite._token-CxXek2SP.js → invite._token-CKAfd5iB.js} +1 -1
  13. package/dist/client/assets/issues._fingerprint-Cm72LNM_.js +55 -0
  14. package/dist/client/assets/login-BTxOhEbN.js +1 -0
  15. package/dist/client/assets/request-panel-DmtFRF8Z.js +1 -0
  16. package/dist/client/assets/services._service-CU1a45f3.js +1 -0
  17. package/dist/client/assets/{sessions._sessionId-3wNImMqM.js → sessions._sessionId-LRo3QNQP.js} +1 -1
  18. package/dist/client/assets/settings-Ctzvl2LL.js +1 -0
  19. package/dist/client/assets/src-BiKxgjA_.js +3 -0
  20. package/dist/client/assets/styles-Tcq0pvWj.css +2 -0
  21. package/dist/client/assets/{team-Bud2-07A.js → team-xlrjhEGp.js} +1 -1
  22. package/dist/client/assets/{timeline-BSDhQPpY.js → timeline-WXE49N62.js} +1 -1
  23. package/dist/client/assets/ui-DRjjeSWy.js +1 -0
  24. package/dist/client/assets/version-banner-BYe4PVzv.js +1 -0
  25. package/dist/server/assets/_authed-Bn-IktVS.js +120 -0
  26. package/dist/server/assets/_authed-RXh7GpoE.js +252 -0
  27. package/dist/server/assets/_tanstack-start-manifest_v-C4dQ3MxD.js +122 -0
  28. package/dist/server/assets/app-code-BQL_FcSx.js +212 -0
  29. package/dist/server/assets/app-name-BcbY1BZN.js +11 -0
  30. package/dist/server/assets/closed-issues-o9U80FXv.js +45 -0
  31. package/dist/server/assets/config-Bp8m0B8q.js +57 -0
  32. package/dist/server/assets/{customers-CvSLt_xV.js → customers-CD84Bz4P.js} +11 -6
  33. package/dist/server/assets/{demo-BRTkdmQJ.js → demo-D-o8m75S.js} +225 -8
  34. package/dist/server/assets/{dynamodb-B0V3ZO20.js → dynamodb-CcH0cp7R.js} +55 -2
  35. package/dist/server/assets/empty-state-wz34oAi8.js +163 -0
  36. package/dist/server/assets/endpoints-8N389Poe.js +248 -0
  37. package/dist/server/assets/{endpoints-mPQXpH8C.js → endpoints-C0Cxc_-x.js} +38 -36
  38. package/dist/server/assets/{events._eventId-pkQBQ9sL.js → events._eventId-BOHkNO5W.js} +90 -351
  39. package/dist/server/assets/exchange-view-DzoSBt_R.js +112 -0
  40. package/dist/server/assets/{firestore-Jd-LeWZI.js → firestore-DyvYMiz3.js} +13 -2
  41. package/dist/server/assets/{fns-Di0vMpkQ.js → fns-BcVGbSID.js} +22 -7
  42. package/dist/server/assets/fns-DE03YExD.js +831 -0
  43. package/dist/server/assets/{invite._token-LwWF5YxP.js → invite._token-DhlACkIe.js} +3 -3
  44. package/dist/server/assets/{issues._fingerprint-DAA0QCuA.js → issues._fingerprint-BBd-_Nn5.js} +400 -28
  45. package/dist/server/assets/{login-DqjCU4DJ.js → login-CbfdHJvg.js} +3 -3
  46. package/dist/server/assets/{memory-aqsrtEUn.js → memory-CZBUh1Zc.js} +129 -5
  47. package/dist/server/assets/{errors-C2KEDL7l.js → queries-wha4cZbw.js} +1442 -129
  48. package/dist/server/assets/request-panel-DpCSwl2q.js +162 -0
  49. package/dist/server/assets/{router-C0Dauj2C.js → router-BXkzR89j.js} +197 -91
  50. package/dist/server/assets/services._service-DWjFFGON.js +309 -0
  51. package/dist/server/assets/{sessions._sessionId-D7JPV0M4.js → sessions._sessionId-DDspiPTe.js} +2 -2
  52. package/dist/server/assets/{settings-Drjd64d7.js → settings-DCLIaZ_p.js} +201 -24
  53. package/dist/server/assets/{src-C4fNgijW.js → src-B2GKPQyN.js} +1 -1
  54. package/dist/server/assets/{team-D7iXYnSE.js → team-jd_TmWP4.js} +3 -3
  55. package/dist/server/assets/ui-C3pl0edn.js +302 -0
  56. package/dist/server/assets/version-banner-BX34ijG5.js +106 -0
  57. package/dist/server/assets/versions-YI_zK1ql.js +58 -0
  58. package/dist/server/assets/warm-C3GbXP1_.js +16 -0
  59. package/dist/server/server.js +40 -28
  60. package/package.json +4 -4
  61. package/dist/client/assets/_authed-CNObwuZh.js +0 -7
  62. package/dist/client/assets/_authed-CuP-He8G.js +0 -1
  63. package/dist/client/assets/charts-CUvev8lV.js +0 -55
  64. package/dist/client/assets/customers-DTMEprFQ.js +0 -1
  65. package/dist/client/assets/endpoints-lMSO2CdM.js +0 -1
  66. package/dist/client/assets/events._eventId-bWag-i8J.js +0 -3
  67. package/dist/client/assets/index-BNpacHyi.js +0 -10
  68. package/dist/client/assets/issues._fingerprint-BQr85TVY.js +0 -1
  69. package/dist/client/assets/login-Dlk3GyyC.js +0 -1
  70. package/dist/client/assets/settings-CzbEYB7k.js +0 -1
  71. package/dist/client/assets/src-Dq5mIUf0.js +0 -3
  72. package/dist/client/assets/styles-DPsgRH7g.css +0 -2
  73. package/dist/client/assets/ui-CEv2y56s.js +0 -1
  74. package/dist/server/assets/_authed-DkkRwdZl.js +0 -87
  75. package/dist/server/assets/_authed-DsB8kjZB.js +0 -902
  76. package/dist/server/assets/_tanstack-start-manifest_v-D1_ErrJK.js +0 -97
  77. package/dist/server/assets/charts-DzTVqJ8z.js +0 -238
  78. package/dist/server/assets/fns-B3PHbFwV.js +0 -1295
  79. package/dist/server/assets/ui-B_XHlLUQ.js +0 -193
@@ -0,0 +1,302 @@
1
+ import { h as SEVERITY_INFO } from "./memory-CZBUh1Zc.js";
2
+ import { t as appLabel } from "./app-name-BcbY1BZN.js";
3
+ import { Link } from "@tanstack/react-router";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ // src/components/ui.tsx
6
+ /** An app picker's options: each app by its display name from Settings, its id as the value. */
7
+ function AppOptions({ apps, names }) {
8
+ return /* @__PURE__ */ jsx(Fragment, { children: apps.map((a) => /* @__PURE__ */ jsx("option", {
9
+ value: a,
10
+ children: appLabel(a, names[a])
11
+ }, a)) });
12
+ }
13
+ function Logo() {
14
+ return /* @__PURE__ */ jsxs("span", {
15
+ className: "inline-flex items-center gap-2 font-semibold tracking-tight",
16
+ children: [/* @__PURE__ */ jsx("span", {
17
+ className: "grid h-7 w-7 place-items-center rounded-md bg-sev-critical text-[11px] font-bold text-white",
18
+ children: "dB"
19
+ }), /* @__PURE__ */ jsxs("span", { children: ["de", /* @__PURE__ */ jsx("span", {
20
+ className: "text-sev-critical",
21
+ children: "Bug"
22
+ })] })]
23
+ });
24
+ }
25
+ /** Full class names (not built from parts) so Tailwind keeps them. */
26
+ var TONE = {
27
+ critical: {
28
+ surface: "bg-level-critical-bg text-level-critical-fg border-level-critical-edge",
29
+ edge: "border-level-critical-edge",
30
+ text: "text-level-critical-fg"
31
+ },
32
+ high: {
33
+ surface: "bg-level-high-bg text-level-high-fg border-level-high-edge",
34
+ edge: "border-level-high-edge",
35
+ text: "text-level-high-fg"
36
+ },
37
+ medium: {
38
+ surface: "bg-level-medium-bg text-level-medium-fg border-level-medium-edge",
39
+ edge: "border-level-medium-edge",
40
+ text: "text-level-medium-fg"
41
+ },
42
+ low: {
43
+ surface: "bg-level-low-bg text-level-low-fg border-level-low-edge",
44
+ edge: "border-level-low-edge",
45
+ text: "text-level-low-fg"
46
+ },
47
+ healthy: {
48
+ surface: "bg-level-healthy-bg text-level-healthy-fg border-level-healthy-edge",
49
+ edge: "border-level-healthy-edge",
50
+ text: "text-level-healthy-fg"
51
+ }
52
+ };
53
+ /** A level's classes: `surface` fills a box (background, text, edge), `edge` and `text` colour one part. */
54
+ var toneClass = (level, part) => TONE[level][part];
55
+ /** An issue's level, in words and colour. */
56
+ function LevelBadge({ level }) {
57
+ return /* @__PURE__ */ jsx("span", {
58
+ className: `inline-flex items-center rounded-full border px-2 py-0.5 text-[11px] font-semibold ${TONE[level].surface}`,
59
+ title: SEVERITY_INFO[level].description,
60
+ children: SEVERITY_INFO[level].name
61
+ });
62
+ }
63
+ /**
64
+ * A row in a list ranked by level: a coloured block with the level in words (and, say, the
65
+ * customers affected), then the row's content. The block sits on top at phone width.
66
+ */
67
+ function LevelRow({ level, aside, children }) {
68
+ return /* @__PURE__ */ jsxs("div", {
69
+ className: `flex flex-col overflow-hidden rounded-xl border bg-panel sm:flex-row ${TONE[level].edge}`,
70
+ children: [/* @__PURE__ */ jsxs("div", {
71
+ className: `flex shrink-0 flex-row items-center justify-between gap-2 px-3 py-2 sm:w-28 sm:flex-col sm:justify-center sm:py-3 sm:text-center ${TONE[level].surface}`,
72
+ children: [/* @__PURE__ */ jsx("strong", {
73
+ className: "text-sm",
74
+ children: levelName(level)
75
+ }), aside && /* @__PURE__ */ jsx("span", {
76
+ className: "text-xs",
77
+ children: aside
78
+ })]
79
+ }), /* @__PURE__ */ jsx("div", {
80
+ className: "min-w-0 flex-1 p-3 sm:p-4",
81
+ children
82
+ })]
83
+ });
84
+ }
85
+ /** A level's name, healthy included. */
86
+ var levelName = (level) => level === "healthy" ? "Healthy" : SEVERITY_INFO[level].name;
87
+ /**
88
+ * A box on the health wall: the whole box in its level's colour, so the wall reads at a glance.
89
+ * The whole box is a link one level down, and looks it (arrow, lift on hover, focus ring). A
90
+ * critical one still failing in the last hour pulses; any still failing says so.
91
+ */
92
+ function HealthBox({ level, name, side, outage, headline, measure, live, lastFailure, link, big, now }) {
93
+ return /* @__PURE__ */ jsxs(Link, {
94
+ ...link,
95
+ style: { "--alarm": `var(--level-${level}-edge)` },
96
+ "aria-label": `${name}${side ? `, ${side}` : ""}: ${levelName(level)}. ${outage ? `${outage}. ` : ""}${headline ? `${headline}. ` : ""}${measure}.${live ? " Still happening." : ""}`,
97
+ className: `group relative flex h-full flex-col gap-1.5 rounded-xl border-2 p-4 pr-10 transition hover:-translate-y-0.5 hover:shadow-lg hover:brightness-110 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent ${TONE[level].surface} ${live && level === "critical" ? "level-alarm" : ""}`,
98
+ children: [
99
+ /* @__PURE__ */ jsxs("span", {
100
+ className: "flex flex-wrap items-center gap-2 text-[11px] font-bold uppercase tracking-wide",
101
+ children: [
102
+ levelName(level),
103
+ live && /* @__PURE__ */ jsxs("span", {
104
+ className: "inline-flex items-center gap-1 normal-case",
105
+ children: [/* @__PURE__ */ jsxs("span", {
106
+ className: "relative flex h-2 w-2",
107
+ "aria-hidden": true,
108
+ children: [/* @__PURE__ */ jsx("span", { className: "absolute inline-flex h-full w-full rounded-full bg-current opacity-75 motion-safe:animate-ping" }), /* @__PURE__ */ jsx("span", { className: "relative inline-flex h-2 w-2 rounded-full bg-current" })]
109
+ }), "Still happening"]
110
+ }),
111
+ side && /* @__PURE__ */ jsx("span", {
112
+ className: "rounded-full border border-current px-1.5 py-px normal-case opacity-90",
113
+ children: side
114
+ })
115
+ ]
116
+ }),
117
+ /* @__PURE__ */ jsx("strong", {
118
+ className: `break-words leading-tight ${big ? "text-2xl" : "text-lg"}`,
119
+ children: name
120
+ }),
121
+ outage && /* @__PURE__ */ jsx("span", {
122
+ className: "break-words text-sm font-semibold",
123
+ children: outage
124
+ }),
125
+ headline && /* @__PURE__ */ jsx("span", {
126
+ className: `break-words font-mono ${big ? "text-sm" : "line-clamp-2 text-xs"}`,
127
+ children: headline
128
+ }),
129
+ /* @__PURE__ */ jsxs("span", {
130
+ className: "tabular mt-auto pt-1 text-xs opacity-90",
131
+ children: [measure, lastFailure && level !== "healthy" ? ` · last ${timeAgo(lastFailure, now)}` : ""]
132
+ }),
133
+ /* @__PURE__ */ jsx("span", {
134
+ "aria-hidden": true,
135
+ className: "absolute right-3 top-1/2 -translate-y-1/2 text-xl opacity-60 transition group-hover:translate-x-0.5 group-hover:opacity-100",
136
+ children: "→"
137
+ })
138
+ ]
139
+ });
140
+ }
141
+ function Card({ title, subtitle, children, right }) {
142
+ return /* @__PURE__ */ jsxs("section", {
143
+ className: "min-w-0 rounded-xl border border-line bg-panel p-4 sm:p-5",
144
+ children: [/* @__PURE__ */ jsxs("div", {
145
+ className: "mb-3 flex items-start justify-between gap-3",
146
+ children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h2", {
147
+ className: "text-sm font-semibold",
148
+ children: title
149
+ }), subtitle && /* @__PURE__ */ jsx("p", {
150
+ className: "mt-0.5 text-xs text-muted",
151
+ children: subtitle
152
+ })] }), right]
153
+ }), children]
154
+ });
155
+ }
156
+ function Stat({ label, value, hint, tone }) {
157
+ return /* @__PURE__ */ jsxs("div", {
158
+ className: "rounded-xl border border-line bg-panel p-4",
159
+ children: [
160
+ /* @__PURE__ */ jsx("div", {
161
+ className: "text-xs text-muted",
162
+ children: label
163
+ }),
164
+ /* @__PURE__ */ jsx("div", {
165
+ className: `tabular mt-1 text-2xl font-semibold ${tone === "critical" ? "text-sev-critical" : tone === "high" ? "text-sev-high" : "text-ink"}`,
166
+ children: value
167
+ }),
168
+ hint && /* @__PURE__ */ jsx("div", {
169
+ className: "mt-1 text-xs text-muted",
170
+ children: hint
171
+ })
172
+ ]
173
+ });
174
+ }
175
+ /** Collapsible table with the exact numbers behind a chart. */
176
+ function DataTable({ columns, rows }) {
177
+ return /* @__PURE__ */ jsxs("details", {
178
+ className: "mt-3 text-xs",
179
+ children: [/* @__PURE__ */ jsx("summary", {
180
+ className: "cursor-pointer text-muted hover:text-ink",
181
+ children: "View data"
182
+ }), /* @__PURE__ */ jsx("div", {
183
+ className: "mt-2 max-h-64 overflow-auto rounded-md border border-line",
184
+ children: /* @__PURE__ */ jsxs("table", {
185
+ className: "tabular w-full text-left",
186
+ children: [/* @__PURE__ */ jsx("thead", {
187
+ className: "sticky top-0 bg-panel-2",
188
+ children: /* @__PURE__ */ jsx("tr", { children: columns.map((c) => /* @__PURE__ */ jsx("th", {
189
+ className: "px-2 py-1 font-medium",
190
+ children: c
191
+ }, c)) })
192
+ }), /* @__PURE__ */ jsx("tbody", { children: rows.map((r, i) => /* @__PURE__ */ jsx("tr", {
193
+ className: "border-t border-line",
194
+ children: r.map((v, j) => /* @__PURE__ */ jsx("td", {
195
+ className: "px-2 py-1",
196
+ children: v
197
+ }, j))
198
+ }, i)) })]
199
+ })
200
+ })]
201
+ });
202
+ }
203
+ /**
204
+ * Horizontal share bars — used for small categorical breakdowns where a full chart is overkill.
205
+ * With onSelect, each row is a button that toggles a filter; `selected` marks the active one.
206
+ */
207
+ function ShareBars({ rows, total, onSelect, selected }) {
208
+ const sum = total ?? rows.reduce((a, r) => a + r.value, 0);
209
+ if (!rows.length) return /* @__PURE__ */ jsx("p", {
210
+ className: "text-xs text-muted",
211
+ children: "No data."
212
+ });
213
+ return /* @__PURE__ */ jsx("ul", {
214
+ className: "space-y-2",
215
+ children: rows.map((r) => {
216
+ const share = sum ? r.value / sum : 0;
217
+ const on = selected === r.key;
218
+ const body = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
219
+ className: "flex justify-between gap-2 text-xs",
220
+ children: [/* @__PURE__ */ jsx("span", {
221
+ className: `truncate ${on ? "font-semibold text-accent" : ""}`,
222
+ title: r.label ? r.key : void 0,
223
+ children: r.label ?? r.key
224
+ }), /* @__PURE__ */ jsxs("span", {
225
+ className: "tabular shrink-0 text-muted",
226
+ children: [
227
+ r.value.toLocaleString(),
228
+ " · ",
229
+ Math.round(share * 100),
230
+ "%"
231
+ ]
232
+ })]
233
+ }), /* @__PURE__ */ jsx("div", {
234
+ className: "mt-1 h-1.5 rounded-full bg-panel-2",
235
+ children: /* @__PURE__ */ jsx("div", {
236
+ className: `h-1.5 rounded-full ${on ? "bg-accent" : "bg-[var(--chart-errors)]"}`,
237
+ style: { width: `${Math.max(2, share * 100)}%` }
238
+ })
239
+ })] });
240
+ return /* @__PURE__ */ jsx("li", { children: onSelect ? /* @__PURE__ */ jsx("button", {
241
+ type: "button",
242
+ "aria-pressed": on,
243
+ onClick: () => onSelect(r.key),
244
+ className: "-mx-1 block w-[calc(100%+0.5rem)] rounded px-1 py-0.5 text-left hover:bg-panel-2",
245
+ children: body
246
+ }) : body }, r.key);
247
+ })
248
+ });
249
+ }
250
+ /** A small chip under an issue's title. */
251
+ var CHIP = "mt-1 mr-1 inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide";
252
+ function timeAgo(iso, now = Date.now()) {
253
+ const s = Math.max(0, Math.round((now - Date.parse(iso)) / 1e3));
254
+ if (s < 60) return `${s}s ago`;
255
+ if (s < 3600) return `${Math.round(s / 60)}m ago`;
256
+ if (s < 86400) return `${Math.round(s / 3600)}h ago`;
257
+ return `${Math.round(s / 86400)}d ago`;
258
+ }
259
+ /** Small labels under an issue: regressed, new in the latest release, resolved, ignored. */
260
+ function IssueLabels({ issue }) {
261
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
262
+ issue.test && /* @__PURE__ */ jsx("span", {
263
+ className: `${CHIP} border border-line text-muted`,
264
+ title: "Made on purpose to test deBug (tag test=true). Never counted.",
265
+ children: "Test error"
266
+ }),
267
+ issue.status === "regressed" && /* @__PURE__ */ jsxs("span", {
268
+ className: `${CHIP} bg-sev-critical text-white`,
269
+ children: ["Regressed", issue.resolvedIn ? ` after ${issue.resolvedIn}` : ""]
270
+ }),
271
+ issue.newInLatest && /* @__PURE__ */ jsxs("span", {
272
+ className: `${CHIP} bg-accent-soft text-accent`,
273
+ children: ["New in ", issue.firstVersion]
274
+ }),
275
+ issue.status === "resolved" && /* @__PURE__ */ jsxs("span", {
276
+ className: `${CHIP} border border-line text-muted`,
277
+ children: ["Resolved", issue.resolvedIn ? ` in ${issue.resolvedIn}` : ""]
278
+ }),
279
+ issue.status === "ignored" && /* @__PURE__ */ jsx("span", {
280
+ className: `${CHIP} border border-line text-muted`,
281
+ children: "Ignored"
282
+ })
283
+ ] });
284
+ }
285
+ /** Label/value rows; empty values are left out. */
286
+ function Facts({ rows, mono }) {
287
+ const shown = rows.filter(([, v]) => v !== void 0 && v !== "");
288
+ return /* @__PURE__ */ jsx("dl", {
289
+ className: "grid grid-cols-[minmax(6rem,auto)_1fr] gap-x-4 gap-y-1.5 text-sm",
290
+ children: shown.map(([k, v]) => /* @__PURE__ */ jsxs("div", {
291
+ className: "contents",
292
+ children: [/* @__PURE__ */ jsx("dt", {
293
+ className: `text-muted ${mono ? "break-all font-mono text-xs" : ""}`,
294
+ children: k
295
+ }), /* @__PURE__ */ jsx("dd", {
296
+ className: `min-w-0 break-words ${mono ? "font-mono text-xs" : ""}`,
297
+ children: v
298
+ })]
299
+ }, k))
300
+ });
301
+ }
302
+ export { HealthBox as a, LevelRow as c, Stat as d, levelName as f, Facts as i, Logo as l, toneClass as m, Card as n, IssueLabels as o, timeAgo as p, DataTable as r, LevelBadge as s, AppOptions as t, ShareBars as u };
@@ -0,0 +1,106 @@
1
+ import { m as getVersionStatus } from "./fns-BcVGbSID.js";
2
+ import { t as CopyButton } from "./copy-button-D3RddzTw.js";
3
+ import { useEffect, useState } from "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ // src/lib/version-text.ts
6
+ var NAME = {
7
+ sdk: "your app's SDK",
8
+ ingest: "ingest",
9
+ dashboard: "this dashboard"
10
+ };
11
+ /** "ingest is 0.7.2", "ingest predates version tracking". */
12
+ function partText(p) {
13
+ return p.version ? `${NAME[p.part]} is ${p.version}` : `${NAME[p.part]} predates version tracking`;
14
+ }
15
+ /** The headline: "Your app sends SDK 0.9.0, but ingest is 0.7.2 and this dashboard is 0.7.2." */
16
+ function bannerText(s) {
17
+ const sdk = s.parts.find((p) => p.part === "sdk");
18
+ return `${sdk?.version && sdk.version === s.newest ? `Your app sends SDK ${sdk.version}, but ` : `deBug is out of step: `}${s.behind.filter((p) => p.part !== "sdk").map(partText).join(" and ")}. Newer data and pages won't show until you run:`;
19
+ }
20
+ // src/components/version-banner.tsx
21
+ var DISMISSED = "debugkit.versionBanner.dismissed";
22
+ /** What the banner was dismissed for: the versions behind, so the next release shows it again. */
23
+ var signature = (s) => `${s.newest}|${s.behind.map((p) => `${p.part}@${p.version ?? "?"}`).join(",")}`;
24
+ /**
25
+ * Across the top of every page when part of the project's deBug is a minor version or more behind
26
+ * the rest. Dismissed per browser for these versions; it comes back when they change.
27
+ */
28
+ function VersionBanner() {
29
+ const status = useVersionStatus();
30
+ const [dismissed, setDismissed] = useState(void 0);
31
+ useEffect(() => {
32
+ try {
33
+ setDismissed(localStorage.getItem(DISMISSED));
34
+ } catch {
35
+ setDismissed(null);
36
+ }
37
+ }, []);
38
+ if (!status || status.level !== "banner" || dismissed === void 0) return null;
39
+ const sig = signature(status);
40
+ if (dismissed === sig) return null;
41
+ return /* @__PURE__ */ jsx("div", {
42
+ role: "status",
43
+ className: "border-b border-sev-medium/40 bg-sev-medium/10",
44
+ children: /* @__PURE__ */ jsxs("div", {
45
+ className: "mx-auto flex max-w-7xl flex-wrap items-center gap-x-3 gap-y-2 px-4 py-2.5 text-sm sm:px-6",
46
+ children: [
47
+ /* @__PURE__ */ jsx("span", {
48
+ className: "min-w-0 flex-1 basis-64",
49
+ children: bannerText(status)
50
+ }),
51
+ /* @__PURE__ */ jsx(UpgradeCommand, { status }),
52
+ /* @__PURE__ */ jsx("button", {
53
+ type: "button",
54
+ className: "ml-auto text-xs text-muted hover:text-ink",
55
+ onClick: () => {
56
+ setDismissed(sig);
57
+ try {
58
+ localStorage.setItem(DISMISSED, sig);
59
+ } catch {}
60
+ },
61
+ children: "Dismiss"
62
+ })
63
+ ]
64
+ })
65
+ });
66
+ }
67
+ /** The upgrade command with a copy button, and the --env hint when the dashboard doesn't know its environment. */
68
+ function UpgradeCommand({ status }) {
69
+ return /* @__PURE__ */ jsxs("span", {
70
+ className: "flex flex-wrap items-center gap-2",
71
+ children: [
72
+ /* @__PURE__ */ jsx("code", {
73
+ className: "break-all rounded bg-panel-2 px-2 py-1 font-mono text-xs",
74
+ children: status.command
75
+ }),
76
+ /* @__PURE__ */ jsx(CopyButton, {
77
+ text: status.command,
78
+ label: "Copy",
79
+ ariaLabel: "Copy the upgrade command"
80
+ }),
81
+ !status.environment && /* @__PURE__ */ jsx("span", {
82
+ className: "text-xs text-muted",
83
+ children: "Add --env <name> if you set up environments."
84
+ })
85
+ ]
86
+ });
87
+ }
88
+ /** One read per page load, shared by the banner and Settings. */
89
+ var pending;
90
+ /**
91
+ * The project's version status, read in the browser after the page renders: no page waits on it,
92
+ * and the banner and Settings share one request. undefined until it arrives.
93
+ */
94
+ function useVersionStatus() {
95
+ const [status, setStatus] = useState(void 0);
96
+ useEffect(() => {
97
+ let live = true;
98
+ pending ??= getVersionStatus().catch(() => null);
99
+ pending.then((s) => live && setStatus(s));
100
+ return () => {
101
+ live = false;
102
+ };
103
+ }, []);
104
+ return status;
105
+ }
106
+ export { partText as i, VersionBanner as n, useVersionStatus as r, UpgradeCommand as t };
@@ -0,0 +1,58 @@
1
+ import { a as parseVersion, r as compareVersions } from "./memory-CZBUh1Zc.js";
2
+ import "./src-B2GKPQyN.js";
3
+ // package.json
4
+ var version = "0.10.0";
5
+ // src/server/versions.ts
6
+ /**
7
+ * How far apart two versions are: "minor" when they differ in major or minor, "patch" when only
8
+ * below that, undefined when the same. A part that doesn't say its version (an ingest from before
9
+ * tracking) counts as a minor gap: it's at least that old.
10
+ */
11
+ function gap(a, b) {
12
+ const pa = parseVersion(a);
13
+ const pb = parseVersion(b);
14
+ if (!pa || !pb) return pa || pb ? "minor" : void 0;
15
+ if (pa.major !== pb.major || pa.minor !== pb.minor) return "minor";
16
+ return compareVersions(a, b) !== 0 ? "patch" : void 0;
17
+ }
18
+ /**
19
+ * The project's versions from each app's record: the newest SDK across apps, and the ingest that
20
+ * wrote last (one ingest serves all of a project's apps; a quiet app's record can be older). No
21
+ * ingest version at all means the ingest predates version tracking.
22
+ */
23
+ function versionStatus(records, dashboard, environment) {
24
+ const sdk = records.flatMap((r) => r.sdk ? [r.sdk] : []).sort((a, b) => compareVersions(b.version, a.version))[0];
25
+ const ingest = records.flatMap((r) => r.ingest ? [r.ingest] : []).sort((a, b) => b.at.localeCompare(a.at))[0];
26
+ const parts = [
27
+ {
28
+ part: "sdk",
29
+ version: sdk?.version,
30
+ at: sdk?.seenAt
31
+ },
32
+ {
33
+ part: "ingest",
34
+ version: ingest?.version,
35
+ at: ingest?.at
36
+ },
37
+ {
38
+ part: "dashboard",
39
+ version: dashboard
40
+ }
41
+ ];
42
+ const newest = parts.filter((p) => p.version && parseVersion(p.version)).map((p) => p.version).sort((a, b) => compareVersions(b, a))[0];
43
+ const tracked = records.length > 0;
44
+ const behind = parts.filter((p) => p.part === "ingest" ? tracked && gap(p.version, newest) : p.version && gap(p.version, newest)).sort((a, b) => compareVersions(a.version, b.version));
45
+ return {
46
+ parts,
47
+ newest,
48
+ behind,
49
+ level: behind.some((p) => p.part !== "sdk" && gap(p.version, newest) === "minor") ? "banner" : behind.length ? "note" : "none",
50
+ command: `npx debugkit upgrade${environment ? ` --env ${environment}` : ""}`,
51
+ environment
52
+ };
53
+ }
54
+ async function buildVersionStatus(store, environment) {
55
+ const apps = await store.listApps();
56
+ return versionStatus(await Promise.all(apps.map((a) => store.getVersions(a).catch(() => ({})))), version, environment);
57
+ }
58
+ export { version as n, buildVersionStatus as t };
@@ -0,0 +1,16 @@
1
+ import { t as config } from "./config-Bp8m0B8q.js";
2
+ import { t as buildEndpoints } from "./endpoints-8N389Poe.js";
3
+ import { r as buildSummary } from "./queries-wha4cZbw.js";
4
+ // src/server/warm.ts
5
+ /**
6
+ * Fills the store cache with what the home page reads (the summary and the endpoints for the
7
+ * first app, over the default period), in the background as the server starts. Nothing waits on
8
+ * it and a failure is ignored: the page reads for itself.
9
+ */
10
+ async function warmUp(store, now = Date.now()) {
11
+ const app = (await store.listApps())[0];
12
+ if (!app) return;
13
+ const opts = { retentionDays: config().retentionDays };
14
+ await Promise.all([buildEndpoints(store, app, now, opts), buildSummary(store, app, config().severity, now, opts)]);
15
+ }
16
+ export { warmUp };
@@ -4485,7 +4485,7 @@ var HEADERS = { TSS_SHELL: "X-TSS_SHELL" };
4485
4485
  * the dev styles URL for route-scoped CSS collection.
4486
4486
  */
4487
4487
  async function getStartManifest(matchedRoutes) {
4488
- const { tsrStartManifest } = await import("./assets/_tanstack-start-manifest_v-D1_ErrJK.js");
4488
+ const { tsrStartManifest } = await import("./assets/_tanstack-start-manifest_v-C4dQ3MxD.js");
4489
4489
  const startManifest = tsrStartManifest();
4490
4490
  let routes = startManifest.routes;
4491
4491
  routes[rootRouteId];
@@ -4508,95 +4508,107 @@ async function getStartManifest(matchedRoutes) {
4508
4508
  var manifest = {
4509
4509
  "0c2f8fcb35c5e356e4a58fce376bb16efb0e006f519592fdd5f120fa868720cd": {
4510
4510
  functionName: "saveRetention_createServerFn_handler",
4511
- importer: () => import("./assets/fns-B3PHbFwV.js")
4511
+ importer: () => import("./assets/fns-DE03YExD.js")
4512
4512
  },
4513
4513
  "0dcf3aa141898f7bb0cefed3e6129613f6226a680cc800b8cb18d2c60b7706fa": {
4514
4514
  functionName: "inviteToTeam_createServerFn_handler",
4515
- importer: () => import("./assets/fns-B3PHbFwV.js")
4515
+ importer: () => import("./assets/fns-DE03YExD.js")
4516
4516
  },
4517
4517
  "1edaae661b4968edee65ebb4a946e246107684704b784b6359bf9af2dfaae23f": {
4518
4518
  functionName: "getSessionUser_createServerFn_handler",
4519
- importer: () => import("./assets/fns-B3PHbFwV.js")
4519
+ importer: () => import("./assets/fns-DE03YExD.js")
4520
4520
  },
4521
4521
  "2598559c204c178bf26b98a0f3ae20e519cec3b9013f9d9b02ce14b170ada220": {
4522
4522
  functionName: "joinTeam_createServerFn_handler",
4523
- importer: () => import("./assets/fns-B3PHbFwV.js")
4523
+ importer: () => import("./assets/fns-DE03YExD.js")
4524
4524
  },
4525
4525
  "2727b9721f5d291dbb62652d2de5cff55fd7871756147d8ce441b03a7a494617": {
4526
4526
  functionName: "removeFromTeam_createServerFn_handler",
4527
- importer: () => import("./assets/fns-B3PHbFwV.js")
4527
+ importer: () => import("./assets/fns-DE03YExD.js")
4528
+ },
4529
+ "4f05eccbec2dfe6e5477f43b46368306bcb812e59bc1084627f631905366e1cf": {
4530
+ functionName: "refreshData_createServerFn_handler",
4531
+ importer: () => import("./assets/fns-DE03YExD.js")
4528
4532
  },
4529
4533
  "51bfd02b4d1772943ec480c2dcd7b445826bcfa7d494453d269cc82644ea2a42": {
4530
4534
  functionName: "setMemberRole_createServerFn_handler",
4531
- importer: () => import("./assets/fns-B3PHbFwV.js")
4535
+ importer: () => import("./assets/fns-DE03YExD.js")
4532
4536
  },
4533
4537
  "54a67fa946c48ef3e3aaa27c8b323c380b12a14879a00a9567f52e31c358a0ed": {
4534
4538
  functionName: "findCustomer_createServerFn_handler",
4535
- importer: () => import("./assets/fns-B3PHbFwV.js")
4539
+ importer: () => import("./assets/fns-DE03YExD.js")
4536
4540
  },
4537
4541
  "7028d75aed3e58a91f5f26a3821d0cec6bb478a913058f5aa73cbfb64bbc41d3": {
4538
4542
  functionName: "sendTestAlert_createServerFn_handler",
4539
- importer: () => import("./assets/fns-B3PHbFwV.js")
4543
+ importer: () => import("./assets/fns-DE03YExD.js")
4540
4544
  },
4541
4545
  "86933afdbcaa1be4a0aa07c4f8e690fdd684edbeab02a49ffdb73e85cadf9933": {
4542
4546
  functionName: "getIssueDetail_createServerFn_handler",
4543
- importer: () => import("./assets/fns-B3PHbFwV.js")
4547
+ importer: () => import("./assets/fns-DE03YExD.js")
4544
4548
  },
4545
4549
  "8ade0e7bba4102fdb7cbe0494762fbb0d01a480c84a69f325fc76686a0dc0237": {
4546
4550
  functionName: "getEndpoints_createServerFn_handler",
4547
- importer: () => import("./assets/fns-B3PHbFwV.js")
4551
+ importer: () => import("./assets/fns-DE03YExD.js")
4548
4552
  },
4549
4553
  "8e8646e3fd8b630ba5696313fb01543dc62410ff8fa9b1eea9763286d32c8927": {
4550
4554
  functionName: "getInvite_createServerFn_handler",
4551
- importer: () => import("./assets/fns-B3PHbFwV.js")
4555
+ importer: () => import("./assets/fns-DE03YExD.js")
4552
4556
  },
4553
4557
  "8fc5d548afdc47f30ea4f9fab6f96cf926fd407c0b80ea68c796b6de7e606a4e": {
4554
4558
  functionName: "getEventDetail_createServerFn_handler",
4555
- importer: () => import("./assets/fns-B3PHbFwV.js")
4559
+ importer: () => import("./assets/fns-DE03YExD.js")
4556
4560
  },
4557
4561
  "8ff7e08627330b1c64257ee12b7ed04815853cb3735a9324805c0bcf149bae9f": {
4558
4562
  functionName: "getTeam_createServerFn_handler",
4559
- importer: () => import("./assets/fns-B3PHbFwV.js")
4560
- },
4561
- "9354c2231554471ec5cde4e9a07b2e32662a8ce0bf29b09b5b930359d374f862": {
4562
- functionName: "getOverview_createServerFn_handler",
4563
- importer: () => import("./assets/fns-B3PHbFwV.js")
4563
+ importer: () => import("./assets/fns-DE03YExD.js")
4564
4564
  },
4565
4565
  "949e1fa91e479f6ad9193caee7087c38ca21191786f4b2c082ea643cbd30dec1": {
4566
4566
  functionName: "getLoginInfo_createServerFn_handler",
4567
- importer: () => import("./assets/fns-B3PHbFwV.js")
4567
+ importer: () => import("./assets/fns-DE03YExD.js")
4568
4568
  },
4569
4569
  "950c0a9412e17ae8308bccd862dee5faea0375153c5ce59491a033dbcb7e7181": {
4570
4570
  functionName: "saveAppSettings_createServerFn_handler",
4571
- importer: () => import("./assets/fns-B3PHbFwV.js")
4571
+ importer: () => import("./assets/fns-DE03YExD.js")
4572
4572
  },
4573
4573
  "a1b47d616a31acc3132c1bb8258bde961d9c419ff91b2ce1d6479ebb9760b393": {
4574
4574
  functionName: "restampExisting_createServerFn_handler",
4575
- importer: () => import("./assets/fns-B3PHbFwV.js")
4575
+ importer: () => import("./assets/fns-DE03YExD.js")
4576
4576
  },
4577
4577
  "a4d3bc63ce8ef43aeb81dfb47c631fe47d634d298109d6b5865742aff7363696": {
4578
4578
  functionName: "getSessionDetail_createServerFn_handler",
4579
- importer: () => import("./assets/fns-B3PHbFwV.js")
4579
+ importer: () => import("./assets/fns-DE03YExD.js")
4580
4580
  },
4581
4581
  "a9edf8f42685a06ce282bb7c9f888e3ae39636f350a90750c31a47b27de7dca8": {
4582
4582
  functionName: "login_createServerFn_handler",
4583
- importer: () => import("./assets/fns-B3PHbFwV.js")
4583
+ importer: () => import("./assets/fns-DE03YExD.js")
4584
4584
  },
4585
4585
  "b4629be951e5766734fb72f9e1400c19f585a4381d9172539b2512ae5056f4e8": {
4586
4586
  functionName: "cancelInvite_createServerFn_handler",
4587
- importer: () => import("./assets/fns-B3PHbFwV.js")
4587
+ importer: () => import("./assets/fns-DE03YExD.js")
4588
+ },
4589
+ "c070aa6e848a86610db68e1835bacf10a87e00e6d58cbf8df2b533e14fe95b7b": {
4590
+ functionName: "getAppCode_createServerFn_handler",
4591
+ importer: () => import("./assets/fns-DE03YExD.js")
4588
4592
  },
4589
4593
  "c263ee8bf14396211aeb95bc2b2aec914480b38cc99a9024c1319f932f590f2f": {
4590
4594
  functionName: "updateIssueStatus_createServerFn_handler",
4591
- importer: () => import("./assets/fns-B3PHbFwV.js")
4595
+ importer: () => import("./assets/fns-DE03YExD.js")
4596
+ },
4597
+ "c63a8340378de7fe78e1e8ba9aaeaa87b401e3838b3e5bfa029f155bcb39b2d2": {
4598
+ functionName: "getVersionStatus_createServerFn_handler",
4599
+ importer: () => import("./assets/fns-DE03YExD.js")
4600
+ },
4601
+ "e4bd743644d2eb6b2abc17f991555672e3e18eef87fa6328ad519266e5340ee2": {
4602
+ functionName: "getHealth_createServerFn_handler",
4603
+ importer: () => import("./assets/fns-DE03YExD.js")
4592
4604
  },
4593
4605
  "e97a9c2b8715ff5e25a9629262b594fb42f11853d6eea78b87305fd0b5155d4d": {
4594
4606
  functionName: "getSettings_createServerFn_handler",
4595
- importer: () => import("./assets/fns-B3PHbFwV.js")
4607
+ importer: () => import("./assets/fns-DE03YExD.js")
4596
4608
  },
4597
4609
  "fd40d9026eb7d8fb5ab200daaed9a58f1d7b4eaf5b1ccab3e4cef9b0fedd9bc4": {
4598
4610
  functionName: "logout_createServerFn_handler",
4599
- importer: () => import("./assets/fns-B3PHbFwV.js")
4611
+ importer: () => import("./assets/fns-DE03YExD.js")
4600
4612
  }
4601
4613
  };
4602
4614
  async function getServerFnById(id, access) {
@@ -7328,7 +7340,7 @@ var getBaseManifest = getProdBaseManifest;
7328
7340
  var createEarlyHintsForRequest = createEarlyHintsCollector;
7329
7341
  async function loadEntries() {
7330
7342
  const [routerEntry, startEntry, pluginAdapters] = await Promise.all([
7331
- import("./assets/router-C0Dauj2C.js").then((n) => n.t),
7343
+ import("./assets/router-BXkzR89j.js").then((n) => n.t),
7332
7344
  import("./assets/start-t09PGpZL.js"),
7333
7345
  import("./assets/empty-plugin-adapters-BsRz-CQL.js")
7334
7346
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@debugkit/dashboard",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "description": "The self-hosted deBug dashboard. Run it with npx debugkit dashboard, or npx @debugkit/dashboard with your own settings.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -28,9 +28,9 @@
28
28
  "tailwindcss": "^4.3.5",
29
29
  "vite": "^8.3.7",
30
30
  "@tanstack/react-start": "^1.169.5",
31
- "@debugkit/ingest": "0.8.0",
32
- "@debugkit/schema": "0.8.0",
33
- "@debugkit/adapters": "0.8.0"
31
+ "@debugkit/adapters": "0.10.0",
32
+ "@debugkit/schema": "0.10.0",
33
+ "@debugkit/ingest": "0.10.0"
34
34
  },
35
35
  "engines": {
36
36
  "node": ">=20.12"