@debugkit/dashboard 0.9.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-BJkvWYRY.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-DiDJMnQu.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-B0NxM46y.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-BRuVQ2bU.js → team-xlrjhEGp.js} +1 -1
  22. package/dist/client/assets/{timeline-BIGo9MCA.js → timeline-WXE49N62.js} +1 -1
  23. package/dist/client/assets/ui-DRjjeSWy.js +1 -0
  24. package/dist/client/assets/{version-banner-VFvyqbPh.js → version-banner-BYe4PVzv.js} +1 -1
  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-827fC5I3.js → customers-CD84Bz4P.js} +11 -6
  33. package/dist/server/assets/{demo-DDNiXCgj.js → demo-D-o8m75S.js} +222 -6
  34. package/dist/server/assets/{dynamodb-Cd4blXkh.js → dynamodb-CcH0cp7R.js} +2 -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-_T0NSOyA.js → endpoints-C0Cxc_-x.js} +38 -36
  38. package/dist/server/assets/{events._eventId-Dcsu4oVO.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-c8Sz2Q4O.js → firestore-DyvYMiz3.js} +2 -2
  41. package/dist/server/assets/{fns-BiUOnY1_.js → fns-BcVGbSID.js} +20 -7
  42. package/dist/server/assets/fns-DE03YExD.js +831 -0
  43. package/dist/server/assets/{invite._token-7DjEeeaD.js → invite._token-DhlACkIe.js} +3 -3
  44. package/dist/server/assets/{issues._fingerprint-vc9r3jgg.js → issues._fingerprint-BBd-_Nn5.js} +400 -28
  45. package/dist/server/assets/{login-CwKAx9Bj.js → login-CbfdHJvg.js} +3 -3
  46. package/dist/server/assets/{memory-Bv4C8uyK.js → memory-CZBUh1Zc.js} +75 -3
  47. package/dist/server/assets/{errors-Po4Tt5zd.js → queries-wha4cZbw.js} +1394 -128
  48. package/dist/server/assets/request-panel-DpCSwl2q.js +162 -0
  49. package/dist/server/assets/{router-Dk3XHn7B.js → router-BXkzR89j.js} +195 -91
  50. package/dist/server/assets/services._service-DWjFFGON.js +309 -0
  51. package/dist/server/assets/{sessions._sessionId-BvXxK9qF.js → sessions._sessionId-DDspiPTe.js} +2 -2
  52. package/dist/server/assets/{settings-B9NLQjl1.js → settings-DCLIaZ_p.js} +146 -25
  53. package/dist/server/assets/{src-oWPSAvXv.js → src-B2GKPQyN.js} +1 -1
  54. package/dist/server/assets/{team-Bsm2wFG0.js → team-jd_TmWP4.js} +3 -3
  55. package/dist/server/assets/ui-C3pl0edn.js +302 -0
  56. package/dist/server/assets/{version-banner-nf-yZurq.js → version-banner-BX34ijG5.js} +1 -1
  57. package/dist/server/assets/{versions-BOlL8jam.js → versions-YI_zK1ql.js} +3 -3
  58. package/dist/server/assets/warm-C3GbXP1_.js +16 -0
  59. package/dist/server/server.js +37 -29
  60. package/package.json +4 -4
  61. package/dist/client/assets/_authed-C29P68T-.js +0 -1
  62. package/dist/client/assets/_authed-D-dYbHoP.js +0 -7
  63. package/dist/client/assets/charts--S1o8iId.js +0 -55
  64. package/dist/client/assets/customers-Cwx5qEO1.js +0 -1
  65. package/dist/client/assets/endpoints-zz1TotR2.js +0 -1
  66. package/dist/client/assets/events._eventId-Bx6TfUjv.js +0 -3
  67. package/dist/client/assets/index-COHr_cc3.js +0 -10
  68. package/dist/client/assets/issues._fingerprint-Cv522h2j.js +0 -1
  69. package/dist/client/assets/login-CKkpc0t5.js +0 -1
  70. package/dist/client/assets/settings-CIlF10MI.js +0 -1
  71. package/dist/client/assets/src-BKSiJUs3.js +0 -3
  72. package/dist/client/assets/styles-GAsMUS4-.css +0 -2
  73. package/dist/client/assets/ui-CaEZB1j2.js +0 -1
  74. package/dist/server/assets/_authed-BJWDiF9i.js +0 -92
  75. package/dist/server/assets/_authed-X9u_5JUy.js +0 -902
  76. package/dist/server/assets/_tanstack-start-manifest_v-C6vaeBdY.js +0 -90
  77. package/dist/server/assets/charts-DzTVqJ8z.js +0 -238
  78. package/dist/server/assets/fns-CVbk8Gf9.js +0 -1310
  79. package/dist/server/assets/ui-SAkSlP7f.js +0 -193
@@ -1,6 +1,6 @@
1
- import { a as Logo } from "./ui-SAkSlP7f.js";
2
- import { h as joinTeam } from "./fns-BiUOnY1_.js";
3
- import { a as Route } from "./router-Dk3XHn7B.js";
1
+ import { l as Logo } from "./ui-C3pl0edn.js";
2
+ import { g as joinTeam } from "./fns-BcVGbSID.js";
3
+ import { o as Route } from "./router-BXkzR89j.js";
4
4
  import { useState } from "react";
5
5
  import { Link, useRouter } from "@tanstack/react-router";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,12 +1,180 @@
1
- import { n as HourlyChart, r as TrendChart } from "./charts-DzTVqJ8z.js";
2
1
  import { n as RetentionNote, t as RangePicker } from "./range-picker-0zbSGr3Z.js";
3
- import { c as Stat, l as timeAgo, n as DataTable, o as SeverityBadge, r as IssueLabels, s as ShareBars, t as Card } from "./ui-SAkSlP7f.js";
2
+ import { d as Stat, n as Card, o as IssueLabels, p as timeAgo, r as DataTable, s as LevelBadge, u as ShareBars } from "./ui-C3pl0edn.js";
4
3
  import { t as CopyButton } from "./copy-button-D3RddzTw.js";
5
- import { w as updateIssueStatus } from "./fns-BiUOnY1_.js";
6
- import { r as Route } from "./router-Dk3XHn7B.js";
7
- import { useState } from "react";
4
+ import { t as RequestPanel } from "./request-panel-DpCSwl2q.js";
5
+ import { E as updateIssueStatus } from "./fns-BcVGbSID.js";
6
+ import { i as Route } from "./router-BXkzR89j.js";
7
+ import { useEffect, useState } from "react";
8
8
  import { Link, useRouter } from "@tanstack/react-router";
9
- import { jsx, jsxs } from "react/jsx-runtime";
9
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
+ import { Area, AreaChart, Bar, BarChart, CartesianGrid, ReferenceLine, ResponsiveContainer, Tooltip, XAxis, YAxis } from "recharts";
11
+ // src/components/charts.tsx
12
+ var axis = {
13
+ stroke: "var(--muted)",
14
+ fontSize: 11,
15
+ tickLine: false,
16
+ axisLine: false
17
+ };
18
+ var tooltipStyle = {
19
+ contentStyle: {
20
+ background: "var(--panel)",
21
+ border: "1px solid var(--border)",
22
+ borderRadius: 8,
23
+ fontSize: 12,
24
+ color: "var(--text)"
25
+ },
26
+ labelStyle: { color: "var(--muted)" },
27
+ cursor: { fill: "var(--panel-2)" }
28
+ };
29
+ /** Recharts measures the DOM, so render a same-size placeholder during SSR. */
30
+ function ClientOnly({ height, children }) {
31
+ const [ready, setReady] = useState(false);
32
+ useEffect(() => setReady(true), []);
33
+ return /* @__PURE__ */ jsx("div", {
34
+ style: { height },
35
+ children: ready ? children : null
36
+ });
37
+ }
38
+ /** "13 Nov" for a day, "14:00" for an hour bucket ("YYYY-MM-DDTHH"). */
39
+ var shortDay = (d) => d.length === 13 ? `${d.slice(11)}:00` : (/* @__PURE__ */ new Date(`${d}T00:00:00Z`)).toLocaleDateString(void 0, {
40
+ month: "short",
41
+ day: "numeric",
42
+ timeZone: "UTC"
43
+ });
44
+ function TrendChart({ data, markers = [] }) {
45
+ const days = data.map((d) => d.day);
46
+ const snapped = markers.map((m) => ({
47
+ ...m,
48
+ x: [...days].reverse().find((d) => d <= m.day)
49
+ })).filter((m) => !!m.x);
50
+ return /* @__PURE__ */ jsx(ClientOnly, {
51
+ height: 220,
52
+ children: /* @__PURE__ */ jsx(ResponsiveContainer, {
53
+ width: "100%",
54
+ height: "100%",
55
+ children: /* @__PURE__ */ jsxs(AreaChart, {
56
+ data,
57
+ margin: {
58
+ top: 8,
59
+ right: 8,
60
+ bottom: 0,
61
+ left: -16
62
+ },
63
+ accessibilityLayer: true,
64
+ children: [
65
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", {
66
+ id: "errFill",
67
+ x1: "0",
68
+ y1: "0",
69
+ x2: "0",
70
+ y2: "1",
71
+ children: [/* @__PURE__ */ jsx("stop", {
72
+ offset: "0%",
73
+ stopColor: "var(--chart-errors)",
74
+ stopOpacity: .35
75
+ }), /* @__PURE__ */ jsx("stop", {
76
+ offset: "100%",
77
+ stopColor: "var(--chart-errors)",
78
+ stopOpacity: 0
79
+ })]
80
+ }) }),
81
+ /* @__PURE__ */ jsx(CartesianGrid, {
82
+ vertical: false,
83
+ stroke: "var(--chart-grid)"
84
+ }),
85
+ /* @__PURE__ */ jsx(XAxis, {
86
+ dataKey: "day",
87
+ tickFormatter: shortDay,
88
+ ...axis,
89
+ minTickGap: 16
90
+ }),
91
+ /* @__PURE__ */ jsx(YAxis, {
92
+ allowDecimals: false,
93
+ ...axis
94
+ }),
95
+ /* @__PURE__ */ jsx(Tooltip, {
96
+ ...tooltipStyle,
97
+ labelFormatter: (d) => shortDay(String(d))
98
+ }),
99
+ /* @__PURE__ */ jsx(Area, {
100
+ type: "monotone",
101
+ dataKey: "errors",
102
+ name: "Errors",
103
+ stroke: "var(--chart-errors)",
104
+ strokeWidth: 2,
105
+ fill: "url(#errFill)"
106
+ }),
107
+ snapped.map((m) => /* @__PURE__ */ jsx(ReferenceLine, {
108
+ x: m.x,
109
+ stroke: "var(--chart-events)",
110
+ strokeDasharray: "3 3",
111
+ label: {
112
+ value: m.label,
113
+ position: "insideTopLeft",
114
+ fontSize: 10,
115
+ fill: "var(--chart-events)"
116
+ }
117
+ }, `${m.label}${m.day}`))
118
+ ]
119
+ })
120
+ })
121
+ });
122
+ }
123
+ function HourlyChart({ data }) {
124
+ const label = (h) => (/* @__PURE__ */ new Date(`${h}:00:00Z`)).toLocaleString(void 0, {
125
+ hour: "2-digit",
126
+ day: "numeric",
127
+ month: "short"
128
+ });
129
+ return /* @__PURE__ */ jsx(ClientOnly, {
130
+ height: 180,
131
+ children: /* @__PURE__ */ jsx(ResponsiveContainer, {
132
+ width: "100%",
133
+ height: "100%",
134
+ children: /* @__PURE__ */ jsxs(BarChart, {
135
+ data,
136
+ margin: {
137
+ top: 8,
138
+ right: 8,
139
+ bottom: 0,
140
+ left: -16
141
+ },
142
+ accessibilityLayer: true,
143
+ children: [
144
+ /* @__PURE__ */ jsx(CartesianGrid, {
145
+ vertical: false,
146
+ stroke: "var(--chart-grid)"
147
+ }),
148
+ /* @__PURE__ */ jsx(XAxis, {
149
+ dataKey: "hour",
150
+ tickFormatter: (h) => (/* @__PURE__ */ new Date(`${h}:00:00Z`)).toLocaleTimeString(void 0, { hour: "2-digit" }),
151
+ ...axis,
152
+ minTickGap: 24
153
+ }),
154
+ /* @__PURE__ */ jsx(YAxis, {
155
+ allowDecimals: false,
156
+ ...axis
157
+ }),
158
+ /* @__PURE__ */ jsx(Tooltip, {
159
+ ...tooltipStyle,
160
+ labelFormatter: (h) => label(String(h)),
161
+ formatter: (v) => [v, "Occurrences"]
162
+ }),
163
+ /* @__PURE__ */ jsx(Bar, {
164
+ dataKey: "count",
165
+ fill: "var(--chart-errors)",
166
+ radius: [
167
+ 3,
168
+ 3,
169
+ 0,
170
+ 0
171
+ ]
172
+ })
173
+ ]
174
+ })
175
+ })
176
+ });
177
+ }
10
178
  // src/routes/_authed/issues.$fingerprint.tsx?tsr-split=component
11
179
  function IssuePage() {
12
180
  const d = Route.useLoaderData();
@@ -16,21 +184,53 @@ function IssuePage() {
16
184
  const navigate = Route.useNavigate();
17
185
  const search = Route.useSearch();
18
186
  const { range } = d;
187
+ const keep = {
188
+ app: d.app,
189
+ range: search.range,
190
+ from: search.from,
191
+ to: search.to
192
+ };
19
193
  return /* @__PURE__ */ jsxs("main", {
20
194
  className: "mx-auto max-w-7xl space-y-5 px-4 py-6 sm:px-6",
21
195
  children: [
22
196
  /* @__PURE__ */ jsxs("div", {
23
197
  className: "flex flex-wrap items-center justify-between gap-3",
24
- children: [/* @__PURE__ */ jsx(Link, {
25
- to: "/",
26
- search: {
27
- app: d.app,
28
- range: search.range,
29
- from: search.from,
30
- to: search.to
31
- },
32
- className: "text-sm text-muted hover:text-ink",
33
- children: "← Overview"
198
+ children: [/* @__PURE__ */ jsxs("nav", {
199
+ "aria-label": "Breadcrumb",
200
+ className: "text-sm text-muted",
201
+ children: [
202
+ /* @__PURE__ */ jsx(Link, {
203
+ to: "/",
204
+ search: keep,
205
+ className: "hover:text-ink hover:underline",
206
+ children: "Health"
207
+ }),
208
+ d.area && /* @__PURE__ */ jsx("span", {
209
+ "aria-hidden": true,
210
+ children: " › "
211
+ }),
212
+ d.area?.kind === "tests" ? /* @__PURE__ */ jsx(Link, {
213
+ to: "/app-code",
214
+ search: {
215
+ ...keep,
216
+ tests: true
217
+ },
218
+ hash: "test-errors",
219
+ className: "hover:text-ink hover:underline",
220
+ children: "Test errors"
221
+ }) : d.area?.kind === "app" ? /* @__PURE__ */ jsx(Link, {
222
+ to: "/app-code",
223
+ search: keep,
224
+ className: "hover:text-ink hover:underline",
225
+ children: "App code"
226
+ }) : d.area ? /* @__PURE__ */ jsx(Link, {
227
+ to: "/services/$service",
228
+ params: { service: d.area.name },
229
+ search: keep,
230
+ className: "hover:text-ink hover:underline",
231
+ children: d.area.name
232
+ }) : null
233
+ ]
34
234
  }), /* @__PURE__ */ jsx(RangePicker, {
35
235
  value: range,
36
236
  today: (/* @__PURE__ */ new Date()).toISOString().slice(0, 10),
@@ -48,7 +248,7 @@ function IssuePage() {
48
248
  /* @__PURE__ */ jsxs("div", {
49
249
  className: "flex flex-wrap items-center gap-2 text-xs text-muted",
50
250
  children: [
51
- /* @__PURE__ */ jsx(SeverityBadge, { severity: issue.severity }),
251
+ /* @__PURE__ */ jsx(LevelBadge, { level: issue.severity }),
52
252
  issue.flow && /* @__PURE__ */ jsx("span", {
53
253
  className: "rounded bg-panel-2 px-1.5 py-0.5 font-mono",
54
254
  children: issue.flow
@@ -69,19 +269,57 @@ function IssuePage() {
69
269
  className: "mt-1 font-mono text-sm text-muted",
70
270
  children: issue.culprit
71
271
  }),
272
+ d.backend && /* @__PURE__ */ jsxs("p", {
273
+ className: "mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 rounded-lg border border-line bg-panel-2 px-3 py-2 text-sm",
274
+ children: [/* @__PURE__ */ jsxs("span", { children: [
275
+ /* @__PURE__ */ jsxs("span", {
276
+ className: "text-muted",
277
+ children: [
278
+ d.backend.service ? `The ${d.backend.service} service` : "The server",
279
+ " answered",
280
+ d.backend.status ? ` ${d.backend.status}` : "",
281
+ ": "
282
+ ]
283
+ }),
284
+ d.backend.message && /* @__PURE__ */ jsx("strong", { children: d.backend.message }),
285
+ d.backend.code && /* @__PURE__ */ jsxs("span", {
286
+ className: "font-mono",
287
+ children: [" · code ", d.backend.code]
288
+ }),
289
+ d.backend.codes.length > 1 && /* @__PURE__ */ jsxs("span", {
290
+ className: "text-muted",
291
+ children: [
292
+ " (",
293
+ d.backend.codes.map((c) => `${c.key} × ${c.count}`).join(", "),
294
+ ")"
295
+ ]
296
+ })
297
+ ] }), d.backend.traceId && /* @__PURE__ */ jsxs("span", {
298
+ className: "flex items-center gap-1.5 text-xs",
299
+ children: [
300
+ /* @__PURE__ */ jsx("span", {
301
+ className: "text-muted",
302
+ children: "trace"
303
+ }),
304
+ /* @__PURE__ */ jsx("span", {
305
+ className: "break-all font-mono",
306
+ children: d.backend.traceId
307
+ }),
308
+ /* @__PURE__ */ jsx(CopyButton, {
309
+ text: d.backend.traceId,
310
+ label: "Copy",
311
+ ariaLabel: "Copy trace id"
312
+ })
313
+ ]
314
+ })]
315
+ }),
72
316
  /* @__PURE__ */ jsx(IssueLabels, { issue }),
73
317
  issue.incidentTitle && /* @__PURE__ */ jsxs("p", {
74
318
  className: "mt-2 text-sm text-muted",
75
- children: [
76
- "Part of an incident:",
77
- " ",
78
- /* @__PURE__ */ jsx(Link, {
79
- to: "/",
80
- search: { app: d.app },
81
- className: "font-medium text-ink hover:text-accent",
82
- children: issue.incidentTitle
83
- })
84
- ]
319
+ children: ["Part of an incident: ", /* @__PURE__ */ jsx("span", {
320
+ className: "font-medium text-ink",
321
+ children: issue.incidentTitle
322
+ })]
85
323
  })
86
324
  ] }),
87
325
  /* @__PURE__ */ jsx(IssueActions, {
@@ -115,6 +353,87 @@ function IssuePage() {
115
353
  })
116
354
  ]
117
355
  }),
356
+ d.calls && !d.bursts && /* @__PURE__ */ jsx(CallCard, {
357
+ calls: d.calls,
358
+ app: d.app,
359
+ fingerprint: issue.fingerprint,
360
+ search
361
+ }),
362
+ d.bursts && d.bursts.length > 0 && /* @__PURE__ */ jsx(Card, {
363
+ title: "When phones went offline",
364
+ subtitle: `Requests that never left the phone, grouped per phone. Not counted against any endpoint or owner.${d.burstsCapped ? " From the newest occurrences only." : ""}`,
365
+ children: /* @__PURE__ */ jsx("ol", {
366
+ className: "space-y-3",
367
+ children: d.bursts.map((b) => /* @__PURE__ */ jsxs("li", {
368
+ className: "text-sm",
369
+ children: [
370
+ /* @__PURE__ */ jsxs("p", {
371
+ className: "font-medium",
372
+ children: [
373
+ new Date(b.start).toLocaleString(),
374
+ " · ",
375
+ b.failures,
376
+ " call",
377
+ b.failures === 1 ? "" : "s",
378
+ " never sent",
379
+ b.airplaneMode && /* @__PURE__ */ jsx("span", {
380
+ className: "ml-2 rounded bg-panel-2 px-1.5 py-0.5 text-xs text-muted",
381
+ children: "airplane mode on"
382
+ })
383
+ ]
384
+ }),
385
+ /* @__PURE__ */ jsx("p", {
386
+ className: "text-xs text-muted",
387
+ children: [
388
+ b.device,
389
+ b.os,
390
+ b.appVersion && `app ${b.appVersion}`
391
+ ].filter(Boolean).join(" · ")
392
+ }),
393
+ /* @__PURE__ */ jsx("ul", {
394
+ className: "mt-1 flex flex-wrap gap-x-3 gap-y-0.5 font-mono text-xs text-muted",
395
+ children: b.calls.map((c) => /* @__PURE__ */ jsxs("li", {
396
+ className: "break-all",
397
+ children: [c.call, c.count > 1 ? ` ×${c.count}` : ""]
398
+ }, c.call))
399
+ })
400
+ ]
401
+ }, `${b.phone}${b.start}`))
402
+ })
403
+ }),
404
+ d.findings.length > 0 && /* @__PURE__ */ jsx(Card, {
405
+ title: "What the trail shows",
406
+ subtitle: "Patterns deBug found in what customers did before the error, and what to do about each.",
407
+ children: /* @__PURE__ */ jsx("ol", {
408
+ className: "space-y-3",
409
+ children: d.findings.map((f) => /* @__PURE__ */ jsxs("li", {
410
+ className: "text-sm",
411
+ children: [
412
+ /* @__PURE__ */ jsx("p", {
413
+ className: "font-medium",
414
+ children: f.why
415
+ }),
416
+ /* @__PURE__ */ jsx("p", {
417
+ className: "mt-0.5",
418
+ children: f.fix
419
+ }),
420
+ /* @__PURE__ */ jsxs("details", {
421
+ className: "mt-1 text-xs text-muted",
422
+ children: [/* @__PURE__ */ jsxs("summary", {
423
+ className: "cursor-pointer hover:text-ink",
424
+ children: [f.of > 1 ? f.seen === f.of ? `Every time: all ${f.of} recent occurrences` : `In ${f.seen} of ${f.of} recent occurrences` : "In the latest occurrence", " · show what it read"]
425
+ }), /* @__PURE__ */ jsx("ul", {
426
+ className: "mt-1 space-y-0.5 font-mono",
427
+ children: f.evidence.map((e, i) => /* @__PURE__ */ jsx("li", {
428
+ className: "break-words",
429
+ children: e
430
+ }, i))
431
+ })]
432
+ })
433
+ ]
434
+ }, f.id))
435
+ })
436
+ }),
118
437
  issue.explanation && /* @__PURE__ */ jsxs("div", {
119
438
  className: "grid gap-5 lg:grid-cols-2",
120
439
  children: [/* @__PURE__ */ jsx(Card, {
@@ -153,7 +472,7 @@ function IssuePage() {
153
472
  className: "mt-3 text-sm",
154
473
  children: [/* @__PURE__ */ jsx("span", {
155
474
  className: "font-medium",
156
- children: "Suggested fix: "
475
+ children: "General advice: "
157
476
  }), plain(issue.explanation.technical.fix)]
158
477
  })
159
478
  ]
@@ -472,4 +791,57 @@ function IssueActions({ app, issue, canChange, links }) {
472
791
  }
473
792
  /** Explanations mark code with backticks for Markdown; on the page they read as plain text. */
474
793
  var plain = (s) => s.replaceAll("`", "");
794
+ /** "18 Nov, 14:05 UTC": the same on the server and in the browser. */
795
+ var utc = (iso) => `${new Date(iso).toLocaleString("en-GB", {
796
+ day: "numeric",
797
+ month: "short",
798
+ hour: "2-digit",
799
+ minute: "2-digit",
800
+ timeZone: "UTC"
801
+ })} UTC`;
802
+ /**
803
+ * The call that failed, up front: the newest occurrence's request and response. When that one got
804
+ * no answer (an outage), the last answer the server gave comes next, so both are on the page.
805
+ */
806
+ function CallCard({ calls, app, fingerprint, search }) {
807
+ const open = (c) => /* @__PURE__ */ jsx(Link, {
808
+ to: "/events/$eventId",
809
+ params: { eventId: c.eventId },
810
+ search: {
811
+ app,
812
+ issue: fingerprint,
813
+ range: search.range,
814
+ from: search.from,
815
+ to: search.to
816
+ },
817
+ className: "whitespace-nowrap text-xs text-accent hover:underline",
818
+ children: "That occurrence →"
819
+ });
820
+ const { latest, lastAnswer } = calls;
821
+ if (!latest) return /* @__PURE__ */ jsx(Card, {
822
+ title: "The call that failed",
823
+ subtitle: "A call failed, but the app recorded nothing about it: no request, and no failed call in the steps before the error.",
824
+ children: /* @__PURE__ */ jsx("p", {
825
+ className: "text-sm text-muted",
826
+ children: "Apps built with the SDK's network capture record every failed call, with its request and response."
827
+ })
828
+ });
829
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Card, {
830
+ title: "The call that failed",
831
+ subtitle: `What the app sent and what the server answered, newest: ${utc(latest.ts)}.`,
832
+ right: open(latest),
833
+ children: /* @__PURE__ */ jsx(RequestPanel, {
834
+ call: latest.api,
835
+ exchange: latest.exchange
836
+ })
837
+ }), lastAnswer && /* @__PURE__ */ jsx(Card, {
838
+ title: "The last time the server answered",
839
+ subtitle: `${utc(lastAnswer.ts)}. The newest call got no answer; this is what the server said before.`,
840
+ right: open(lastAnswer),
841
+ children: /* @__PURE__ */ jsx(RequestPanel, {
842
+ call: lastAnswer.api,
843
+ exchange: lastAnswer.exchange
844
+ })
845
+ })] });
846
+ }
475
847
  export { IssuePage as component };
@@ -1,6 +1,6 @@
1
- import { a as Logo } from "./ui-SAkSlP7f.js";
2
- import { g as login } from "./fns-BiUOnY1_.js";
3
- import { _ as Route } from "./router-Dk3XHn7B.js";
1
+ import { l as Logo } from "./ui-C3pl0edn.js";
2
+ import { _ as login } from "./fns-BcVGbSID.js";
3
+ import { p as Route } from "./router-BXkzR89j.js";
4
4
  import { useState } from "react";
5
5
  import { useRouter } from "@tanstack/react-router";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -3675,7 +3675,7 @@ var CATEGORY_INFO = {
3675
3675
  },
3676
3676
  client_request: {
3677
3677
  name: "Request rejected",
3678
- description: "The server refused the request as invalid (4xx): the app sent something the server didn't accept."
3678
+ description: "The server refused the request (4xx, not a sign-in or rate limit). Its own message, when it gives one, says why."
3679
3679
  },
3680
3680
  auth: {
3681
3681
  name: "Sign-in problem",
@@ -3786,6 +3786,8 @@ var CAUSE_INFO = {
3786
3786
  description: "Every occurrence is on the same device model, so it's probably specific to that phone."
3787
3787
  }
3788
3788
  };
3789
+ // ../../packages/schema/src/hosts.ts
3790
+ var HOST_KINDS = ["ours", "upstream"];
3789
3791
  /** Split a URL into host (lowercase, no scheme or port), path, and query/hash. */
3790
3792
  function parts(s) {
3791
3793
  const bare = s.trim().replace(/^[a-z]+:\/\//i, "");
@@ -3798,6 +3800,11 @@ function parts(s) {
3798
3800
  suffix
3799
3801
  };
3800
3802
  }
3803
+ /** "https://API.example.com:443/v1/?x" → "api.example.com". Empty for a path with no host ("/v1/me"). */
3804
+ function hostOf(url) {
3805
+ const { host } = parts(url);
3806
+ return host.includes(".") || host === "localhost" ? host : "";
3807
+ }
3801
3808
  /** "https://API.example.com:443/v1/?x" → "api.example.com/v1". Lowercases the host only. */
3802
3809
  function normaliseHostMatch(s) {
3803
3810
  const { host, path } = parts(s);
@@ -3830,6 +3837,17 @@ function nameUrlsIn(text, hosts) {
3830
3837
  if (!hosts?.length) return text;
3831
3838
  return text.replace(URL_IN_TEXT, (u) => nameUrl(u, hosts));
3832
3839
  }
3840
+ /** Whose service a host is: as set, or from its owner (a third party is upstream; the backend team's or infrastructure is ours). */
3841
+ function hostKindOf(h) {
3842
+ if (!h) return void 0;
3843
+ if (h.kind) return h.kind;
3844
+ if (h.owner === "third_party") return "upstream";
3845
+ return h.owner === "backend" || h.owner === "infrastructure" ? "ours" : void 0;
3846
+ }
3847
+ /** "Cell C service", "Third-party service" or "Our backend". */
3848
+ function hostKindLabel(kind, provider) {
3849
+ return kind === "ours" ? "Our backend" : `${provider?.trim() || "Third-party"} service`;
3850
+ }
3833
3851
  /** Owners a host can be given: "unknown" is what leaving it unset means. */
3834
3852
  var OWNER_SET = new Set(OWNERS.filter((o) => o !== "unknown"));
3835
3853
  /** A dotted host name, optionally with a path. Ports are dropped by normaliseHostMatch. */
@@ -3848,17 +3866,46 @@ function validHostNames(x) {
3848
3866
  if (!match || match.length > 200 || !MATCH.test(match)) return `"${String(r.match ?? "")}" isn't a host name, like api.example.com or api.example.com/payments`;
3849
3867
  if (!name || name.length > 60) return `Give ${match} a name of up to 60 characters`;
3850
3868
  if (r.owner !== void 0 && r.owner !== "" && !OWNER_SET.has(String(r.owner))) return `Unknown owner "${String(r.owner)}"`;
3869
+ const kind = r.kind === void 0 || r.kind === "" ? void 0 : String(r.kind);
3870
+ if (kind !== void 0 && !HOST_KINDS.includes(kind)) return `Unknown kind "${kind}": use ours or upstream`;
3871
+ const provider = kind === "upstream" && typeof r.provider === "string" ? r.provider.trim() : "";
3872
+ if (provider.length > 40) return `Give ${match}'s upstream a name of up to 40 characters`;
3851
3873
  if (seen.has(match)) return `${match} is listed twice`;
3852
3874
  seen.add(match);
3853
3875
  out.push({
3854
3876
  match,
3855
3877
  name,
3856
- ...r.owner ? { owner: r.owner } : {}
3878
+ ...r.owner ? { owner: r.owner } : {},
3879
+ ...kind ? { kind } : {},
3880
+ ...provider ? { provider } : {}
3857
3881
  });
3858
3882
  }
3859
3883
  return out;
3860
3884
  }
3861
3885
  // ../../packages/schema/src/core.ts
3886
+ /** What the SDK puts in place of a secret it redacted, in headers, bodies and queries. */
3887
+ var REDACTED = "[redacted]";
3888
+ /**
3889
+ * Errors and events an app makes on purpose (a dev tools "Error testing" screen, `npx debugkit
3890
+ * test`) carry this tag as "true". They get their own issues, stay out of every count and rate,
3891
+ * and are hidden unless asked for (ABA-133).
3892
+ */
3893
+ var TEST_TAG = "test";
3894
+ /** Whether an error or event was made on purpose to test deBug. */
3895
+ var isTestEvent = (e) => e?.tags?.[TEST_TAG] === "true";
3896
+ /**
3897
+ * The one issue that collects every request that never left the phone (ABA-132). Not a problem
3898
+ * with any endpoint or owner, so it stays out of their counts and is folded away on Health.
3899
+ */
3900
+ var OFFLINE_FINGERPRINT = "offline";
3901
+ /** The offline issue's title. */
3902
+ var OFFLINE_TITLE = "Phone offline: requests never left the phone";
3903
+ /** Whether an issue is the offline one. */
3904
+ var isOfflineIssue = (i) => i?.fingerprint === OFFLINE_FINGERPRINT;
3905
+ /** Tag the React Native SDK sets on Android: "true" when airplane mode was on at the time. */
3906
+ var AIRPLANE_TAG = "network.airplaneMode";
3907
+ /** Whether an issue is made of test errors: its newest occurrence carries the tag. */
3908
+ var isTestIssue = (i) => isTestEvent(i?.lastEvent?.event);
3862
3909
  /** The most of a failed call's captured body kept, in characters (16 KB). */
3863
3910
  var MAX_CAPTURED_BODY = 16384;
3864
3911
  /** "2.10.0" sorts after "2.9.1"; pre-release and build suffixes compare as text. */
@@ -3927,6 +3974,25 @@ var SEVERITY_ORDER = {
3927
3974
  medium: 1,
3928
3975
  low: 0
3929
3976
  };
3977
+ /** How each severity level reads in the dashboard: always in words, never by colour alone. */
3978
+ var SEVERITY_INFO = {
3979
+ critical: {
3980
+ name: "Critical",
3981
+ description: "Customers are blocked, or the app closes, for many of them. Act now."
3982
+ },
3983
+ high: {
3984
+ name: "High",
3985
+ description: "Customers are blocked, or many have a degraded experience."
3986
+ },
3987
+ medium: {
3988
+ name: "Medium",
3989
+ description: "A few customers have a degraded experience, or a silent failure is frequent."
3990
+ },
3991
+ low: {
3992
+ name: "Low",
3993
+ description: "A one-off, or silent and rare."
3994
+ }
3995
+ };
3930
3996
  var V8 = /^\s*at (?:(.+?) \()?(.+?):(\d+):(\d+)\)?\s*$/;
3931
3997
  var GECKO = /^\s*(.*?)@(.+?):(\d+):(\d+)\s*$/;
3932
3998
  var NOT_IN_APP = [
@@ -3964,6 +4030,12 @@ function parseStack(stack) {
3964
4030
  }
3965
4031
  return markLibraryFrames(frames);
3966
4032
  }
4033
+ /** Personal data in free text: an email address, or a run of 7+ digits (phone numbers, ids). */
4034
+ var PERSONAL_TEXT = /[^\s@<>"']+@[^\s@<>"']+\.[^\s@<>"']+|\+?\d(?:[\s().-]?\d){6,}/g;
4035
+ /** Phone numbers and email addresses masked: for text a backend or an app wrote about a user. */
4036
+ function maskPersonal(text) {
4037
+ return text.replace(PERSONAL_TEXT, "•••");
4038
+ }
3967
4039
  // ../../packages/schema/src/index.ts
3968
4040
  /** Dotted, lowercase identifier for a part of the app, e.g. "auth.login". */
3969
4041
  var Flow = stringType().min(1).max(64).regex(/^[a-z0-9_]+(\.[a-z0-9_]+)*$/, "flow must be dotted lowercase, e.g. auth.login");
@@ -4404,4 +4476,4 @@ var MemoryStore = class {
4404
4476
  return this.events.filter((e) => e.app === app && e.fingerprint === fp).sort((a, b) => b.event.ts.localeCompare(a.event.ts)).slice(0, limit);
4405
4477
  }
4406
4478
  };
4407
- export { CAUSE_INFO as C, cleanFnName as D, OWNER_INFO as E, markLibraryFrames as O, CATEGORY_INFO as S, OWNERS as T, severityFromCount as _, parseVersion as a, normaliseHostMatch as b, rollupId as c, SEVERITY_ORDER as d, compareVersions$1 as f, releaseKey as g, percentileMs as h, mergeVersions as i, Envelope as l, parseStack as m, memory_exports as n, versionKey as o, isRegression as p, compareVersions as r, coalesceRollups as s, MemoryStore as t, DEFAULT_SEVERITY_THRESHOLDS as u, hostNameFor as v, IMPACT_INFO as w, validHostNames as x, nameUrlsIn as y };
4479
+ export { hostNameFor as A, OWNER_INFO as B, maskPersonal as C, severityFromCount as D, releaseKey as E, validHostNames as F, markLibraryFrames as H, CATEGORY_INFO as I, CAUSE_INFO as L, nameUrl as M, nameUrlsIn as N, hostKindLabel as O, normaliseHostMatch as P, IMPACT_INFO as R, isTestIssue as S, percentileMs as T, cleanFnName as V, TEST_TAG as _, parseVersion as a, isRegression as b, rollupId as c, DEFAULT_SEVERITY_THRESHOLDS as d, OFFLINE_FINGERPRINT as f, SEVERITY_ORDER as g, SEVERITY_INFO as h, mergeVersions as i, hostOf as j, hostKindOf as k, Envelope as l, REDACTED as m, memory_exports as n, versionKey as o, OFFLINE_TITLE as p, compareVersions as r, coalesceRollups as s, MemoryStore as t, AIRPLANE_TAG as u, compareVersions$1 as v, parseStack as w, isTestEvent as x, isOfflineIssue as y, OWNERS as z };