@debugkit/dashboard 0.5.0 → 0.6.1

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 (45) hide show
  1. package/.env.example +3 -0
  2. package/dist/client/assets/_authed-BN39b-7H.js +1 -0
  3. package/dist/client/assets/_authed-CspAf0jN.js +7 -0
  4. package/dist/client/assets/{charts-C0zeGTzu.js → charts-XyOWJI9T.js} +6 -6
  5. package/dist/client/assets/index-Bfb2UOzB.js +10 -0
  6. package/dist/client/assets/invite._token-B4HN51-h.js +1 -0
  7. package/dist/client/assets/issues._fingerprint-BV1QrETY.js +1 -0
  8. package/dist/client/assets/login-COlvJ5Je.js +1 -0
  9. package/dist/client/assets/{preload-helper-CDziuvpw.js → preload-helper-Dscj_TcA.js} +1 -1
  10. package/dist/client/assets/settings-Dl4EWeWC.js +1 -0
  11. package/dist/client/assets/styles-DztngwT9.css +2 -0
  12. package/dist/client/assets/team-7Zekz_Er.js +1 -0
  13. package/dist/client/assets/{ui-BiRMJGWB.js → ui-C0HGOza2.js} +1 -1
  14. package/dist/server/assets/{_authed-CuDay0Tl.js → _authed-C-sIPXSO.js} +1 -1
  15. package/dist/server/assets/{_authed-DODQ_Iys.js → _authed-CrjuC0O3.js} +31 -18
  16. package/dist/server/assets/{_tanstack-start-manifest_v-BBxgjm04.js → _tanstack-start-manifest_v-CqaE4wze.js} +19 -7
  17. package/dist/server/assets/{demo-hrRBo9_U.js → demo-BsMMDk_F.js} +2 -2
  18. package/dist/server/assets/{dynamodb-DyPK9SVV.js → dynamodb-Zkk1-mgz.js} +93 -2
  19. package/dist/server/assets/{firestore-B2xzpzYA.js → firestore-C52q_vwM.js} +43 -2
  20. package/dist/server/assets/{fns-DPsnK0zS.js → fns-DwGaMi8S.js} +30 -2
  21. package/dist/server/assets/fns-mbUIXXep.js +529 -0
  22. package/dist/server/assets/invite._token-xnpnkdRv.js +136 -0
  23. package/dist/server/assets/{issues._fingerprint-CZCZDm7t.js → issues._fingerprint-e7ubdJf0.js} +2 -2
  24. package/dist/server/assets/{login-D-UG6SFw.js → login-EopnOJXA.js} +2 -2
  25. package/dist/server/assets/{memory-Do0CDoAX.js → memory-BssaqdZm.js} +30 -0
  26. package/dist/server/assets/{queries-CxHrgTdM.js → queries-BJxX3Kjp.js} +744 -30
  27. package/dist/server/assets/{router-CIIGBCmL.js → router-G99085_Q.js} +98 -45
  28. package/dist/server/assets/{settings-BHfngShx.js → settings-CaJN69N6.js} +2 -2
  29. package/dist/server/assets/src-D83GYTrp.js +9 -0
  30. package/dist/server/assets/team-B1UcM1jA.js +255 -0
  31. package/dist/server/server.js +42 -14
  32. package/handler.mjs +95 -0
  33. package/lambda.mjs +61 -0
  34. package/package.json +16 -7
  35. package/server.mjs +4 -39
  36. package/dist/client/assets/_authed-DTn7rMla.js +0 -1
  37. package/dist/client/assets/_authed-Dc7covsB.js +0 -7
  38. package/dist/client/assets/index-D12jr1bm.js +0 -10
  39. package/dist/client/assets/issues._fingerprint-C6ryZvIu.js +0 -1
  40. package/dist/client/assets/login-oLP1Yyz3.js +0 -1
  41. package/dist/client/assets/settings-9oQsCwdV.js +0 -1
  42. package/dist/client/assets/styles-DBg7wMRg.css +0 -2
  43. package/dist/server/assets/fns-hk_OJe6M.js +0 -250
  44. package/dist/server/assets/src-D9VHcuh4.js +0 -491
  45. package/dist/server/assets/src-JXktBs5H.js +0 -4
@@ -1,14 +1,13 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D8jQpDG7.js";
2
- import { a as getSettings, i as getSessionUser, n as getLoginInfo, r as getOverview, t as getIssueDetail } from "./fns-DPsnK0zS.js";
2
+ import { a as getOverview, c as getTeam, i as getLoginInfo, n as getInvite, o as getSessionUser, r as getIssueDetail, s as getSettings } from "./fns-DwGaMi8S.js";
3
3
  import { r as rangeSearch } from "./range-picker-0zbSGr3Z.js";
4
- import { n as ingest, r as parseIngestKeys, t as CORS_HEADERS } from "./src-D9VHcuh4.js";
5
- import { a as authorizeApi, b as getStore, n as buildIssueDetail, r as buildSummary, t as SUMMARY_FIELDS, x as config, y as getLocalWriteStore } from "./queries-CxHrgTdM.js";
4
+ import { A as getLocalWriteStore, M as config, _ as CORS_HEADERS, a as authorizeApi, j as getStore, n as buildIssueDetail, r as buildSummary, t as SUMMARY_FIELDS, v as ingest, y as parseIngestKeys } from "./queries-BJxX3Kjp.js";
6
5
  import { HeadContent, Outlet, Scripts, createFileRoute, createRootRoute, createRouter, lazyRouteComponent, notFound, redirect } from "@tanstack/react-router";
7
6
  import { jsx, jsxs } from "react/jsx-runtime";
8
7
  // src/styles.css?url
9
- var styles_default = "/assets/styles-DBg7wMRg.css";
8
+ var styles_default = "/assets/styles-DztngwT9.css";
10
9
  // src/routes/__root.tsx
11
- var Route$8 = createRootRoute({
10
+ var Route$10 = createRootRoute({
12
11
  head: () => ({
13
12
  meta: [
14
13
  { charSet: "utf-8" },
@@ -43,27 +42,27 @@ function RootDocument({ children }) {
43
42
  });
44
43
  }
45
44
  // src/routes/_authed.tsx
46
- var $$splitComponentImporter$4 = () => import("./_authed-DODQ_Iys.js");
47
- var Route$7 = createFileRoute("/_authed")({
45
+ var $$splitComponentImporter$6 = () => import("./_authed-CrjuC0O3.js");
46
+ var Route$9 = createFileRoute("/_authed")({
48
47
  beforeLoad: async () => {
49
48
  const user = await getSessionUser();
50
49
  if (!user) throw redirect({ to: "/login" });
51
50
  return { user };
52
51
  },
53
- component: lazyRouteComponent($$splitComponentImporter$4, "component")
52
+ component: lazyRouteComponent($$splitComponentImporter$6, "component")
54
53
  });
55
54
  // src/routes/login.tsx
56
- var $$splitComponentImporter$3 = () => import("./login-D-UG6SFw.js");
57
- var Route$6 = createFileRoute("/login")({
55
+ var $$splitComponentImporter$5 = () => import("./login-EopnOJXA.js");
56
+ var Route$8 = createFileRoute("/login")({
58
57
  beforeLoad: async () => {
59
58
  if (await getSessionUser()) throw redirect({ to: "/" });
60
59
  },
61
60
  loader: () => getLoginInfo(),
62
- component: lazyRouteComponent($$splitComponentImporter$3, "component")
61
+ component: lazyRouteComponent($$splitComponentImporter$5, "component")
63
62
  });
64
63
  // src/routes/_authed/index.tsx
65
- var $$splitComponentImporter$2 = () => import("./_authed-CuDay0Tl.js");
66
- var Route$5 = createFileRoute("/_authed/")({
64
+ var $$splitComponentImporter$4 = () => import("./_authed-C-sIPXSO.js");
65
+ var Route$7 = createFileRoute("/_authed/")({
67
66
  validateSearch: (s) => ({
68
67
  app: typeof s.app === "string" ? s.app : void 0,
69
68
  flow: typeof s.flow === "string" ? s.flow : void 0,
@@ -77,15 +76,21 @@ var Route$5 = createFileRoute("/_authed/")({
77
76
  to: search.to
78
77
  }),
79
78
  loader: ({ deps }) => getOverview({ data: deps }),
80
- component: lazyRouteComponent($$splitComponentImporter$2, "component")
79
+ component: lazyRouteComponent($$splitComponentImporter$4, "component")
81
80
  });
82
81
  // src/routes/_authed/settings.tsx
83
- var $$splitComponentImporter$1 = () => import("./settings-BHfngShx.js");
84
- var Route$4 = createFileRoute("/_authed/settings")({
82
+ var $$splitComponentImporter$3 = () => import("./settings-CaJN69N6.js");
83
+ var Route$6 = createFileRoute("/_authed/settings")({
85
84
  validateSearch: (s) => ({ app: typeof s.app === "string" ? s.app : void 0 }),
86
85
  loaderDeps: ({ search }) => ({ app: search.app }),
87
86
  loader: ({ deps }) => getSettings({ data: deps }),
88
- component: lazyRouteComponent($$splitComponentImporter$1, "component")
87
+ component: lazyRouteComponent($$splitComponentImporter$3, "component")
88
+ });
89
+ // src/routes/_authed/team.tsx
90
+ var $$splitComponentImporter$2 = () => import("./team-B1UcM1jA.js");
91
+ var Route$5 = createFileRoute("/_authed/team")({
92
+ loader: () => getTeam(),
93
+ component: lazyRouteComponent($$splitComponentImporter$2, "component")
89
94
  });
90
95
  // src/routes/api/ingest.ts
91
96
  /**
@@ -93,7 +98,7 @@ var Route$4 = createFileRoute("/_authed/settings")({
93
98
  * Point the SDK at http://localhost:4400/api/ingest with ingestKey "pk_local".
94
99
  * In production, events go to the ingest function in your own cloud instead.
95
100
  */
96
- var Route$3 = createFileRoute("/api/ingest")({ server: { handlers: {
101
+ var Route$4 = createFileRoute("/api/ingest")({ server: { handlers: {
97
102
  OPTIONS: async () => new Response(null, {
98
103
  status: 204,
99
104
  headers: CORS_HEADERS
@@ -119,8 +124,8 @@ var Route$3 = createFileRoute("/api/ingest")({ server: { handlers: {
119
124
  } } });
120
125
  // src/routes/api/summary.ts
121
126
  /** GET /api/summary?app=<id> — the overview as JSON, for agents and scripts. */
122
- var Route$2 = createFileRoute("/api/summary")({ server: { handlers: { GET: async ({ request }) => {
123
- if (!authorizeApi(request)) return Response.json({ error: "unauthorized" }, { status: 401 });
127
+ var Route$3 = createFileRoute("/api/summary")({ server: { handlers: { GET: async ({ request }) => {
128
+ if (!await authorizeApi(request)) return Response.json({ error: "unauthorized" }, { status: 401 });
124
129
  const q = new URL(request.url).searchParams;
125
130
  const app = q.get("app") ?? void 0;
126
131
  const range = {
@@ -139,8 +144,14 @@ var Route$2 = createFileRoute("/api/summary")({ server: { handlers: { GET: async
139
144
  _severityThresholds24h: config().severity
140
145
  });
141
146
  } } } });
147
+ // src/routes/invite.$token.tsx
148
+ var $$splitComponentImporter$1 = () => import("./invite._token-xnpnkdRv.js");
149
+ var Route$2 = createFileRoute("/invite/$token")({
150
+ loader: ({ params }) => getInvite({ data: { token: params.token } }),
151
+ component: lazyRouteComponent($$splitComponentImporter$1, "component")
152
+ });
142
153
  // src/routes/_authed/issues.$fingerprint.tsx
143
- var $$splitComponentImporter = () => import("./issues._fingerprint-CZCZDm7t.js");
154
+ var $$splitComponentImporter = () => import("./issues._fingerprint-e7ubdJf0.js");
144
155
  var Route$1 = createFileRoute("/_authed/issues/$fingerprint")({
145
156
  validateSearch: (s) => ({
146
157
  app: typeof s.app === "string" ? s.app : "",
@@ -166,7 +177,7 @@ var Route$1 = createFileRoute("/_authed/issues/$fingerprint")({
166
177
  // src/routes/api/issues/$fingerprint.ts
167
178
  /** GET /api/issues/<fingerprint>?app=<id> — one issue with breakdowns, sample stack, breadcrumbs and hints. */
168
179
  var Route = createFileRoute("/api/issues/$fingerprint")({ server: { handlers: { GET: async ({ request, params }) => {
169
- if (!authorizeApi(request)) return Response.json({ error: "unauthorized" }, { status: 401 });
180
+ if (!await authorizeApi(request)) return Response.json({ error: "unauthorized" }, { status: 401 });
170
181
  const q = new URL(request.url).searchParams;
171
182
  const app = q.get("app");
172
183
  if (!app) return Response.json({ error: "app query param required" }, { status: 400 });
@@ -184,34 +195,44 @@ var Route = createFileRoute("/api/issues/$fingerprint")({ server: { handlers: {
184
195
  return Response.json(detail);
185
196
  } } } });
186
197
  // src/routeTree.gen.ts
187
- var AuthedRoute = Route$7.update({
198
+ var AuthedRoute = Route$9.update({
188
199
  id: "/_authed",
189
- getParentRoute: () => Route$8
200
+ getParentRoute: () => Route$10
190
201
  });
191
- var LoginRoute = Route$6.update({
202
+ var LoginRoute = Route$8.update({
192
203
  id: "/login",
193
204
  path: "/login",
194
- getParentRoute: () => Route$8
205
+ getParentRoute: () => Route$10
195
206
  });
196
- var AuthedIndexRoute = Route$5.update({
207
+ var AuthedIndexRoute = Route$7.update({
197
208
  id: "/",
198
209
  path: "/",
199
210
  getParentRoute: () => AuthedRoute
200
211
  });
201
- var AuthedSettingsRoute = Route$4.update({
212
+ var AuthedSettingsRoute = Route$6.update({
202
213
  id: "/settings",
203
214
  path: "/settings",
204
215
  getParentRoute: () => AuthedRoute
205
216
  });
206
- var ApiIngestRoute = Route$3.update({
217
+ var AuthedTeamRoute = Route$5.update({
218
+ id: "/team",
219
+ path: "/team",
220
+ getParentRoute: () => AuthedRoute
221
+ });
222
+ var ApiIngestRoute = Route$4.update({
207
223
  id: "/api/ingest",
208
224
  path: "/api/ingest",
209
- getParentRoute: () => Route$8
225
+ getParentRoute: () => Route$10
210
226
  });
211
- var ApiSummaryRoute = Route$2.update({
227
+ var ApiSummaryRoute = Route$3.update({
212
228
  id: "/api/summary",
213
229
  path: "/api/summary",
214
- getParentRoute: () => Route$8
230
+ getParentRoute: () => Route$10
231
+ });
232
+ var InviteTokenRoute = Route$2.update({
233
+ id: "/invite/$token",
234
+ path: "/invite/$token",
235
+ getParentRoute: () => Route$10
215
236
  });
216
237
  var AuthedIssuesFingerprintRoute = Route$1.update({
217
238
  id: "/issues/$fingerprint",
@@ -221,10 +242,11 @@ var AuthedIssuesFingerprintRoute = Route$1.update({
221
242
  var ApiIssuesFingerprintRoute = Route.update({
222
243
  id: "/api/issues/$fingerprint",
223
244
  path: "/api/issues/$fingerprint",
224
- getParentRoute: () => Route$8
245
+ getParentRoute: () => Route$10
225
246
  });
226
247
  var AuthedRouteChildren = {
227
248
  AuthedSettingsRoute,
249
+ AuthedTeamRoute,
228
250
  AuthedIndexRoute,
229
251
  AuthedIssuesFingerprintRoute
230
252
  };
@@ -233,30 +255,61 @@ var rootRouteChildren = {
233
255
  LoginRoute,
234
256
  ApiIngestRoute,
235
257
  ApiSummaryRoute,
258
+ InviteTokenRoute,
236
259
  ApiIssuesFingerprintRoute
237
260
  };
238
- var routeTree = Route$8._addFileChildren(rootRouteChildren)._addFileTypes();
261
+ var routeTree = Route$10._addFileChildren(rootRouteChildren)._addFileTypes();
262
+ // src/server/errors.ts
263
+ /** Firestore answers FAILED_PRECONDITION while an index deBug needs is missing or still building. */
264
+ function isIndexError(message) {
265
+ return /FAILED_PRECONDITION|requires an index|index is currently building/i.test(message);
266
+ }
239
267
  // src/router.tsx
240
268
  var router_exports = /* @__PURE__ */ __exportAll({ getRouter: () => getRouter });
269
+ function ErrorPage({ error }) {
270
+ const message = error instanceof Error ? error.message : String(error);
271
+ if (isIndexError(message)) {
272
+ const building = /currently building/i.test(message);
273
+ return /* @__PURE__ */ jsxs("div", {
274
+ className: "mx-auto max-w-xl p-8",
275
+ children: [
276
+ /* @__PURE__ */ jsx("h1", {
277
+ className: "text-lg font-semibold",
278
+ children: building ? "Firestore is still building deBug's indexes" : "Firestore is missing an index deBug needs"
279
+ }),
280
+ /* @__PURE__ */ jsx("p", {
281
+ className: "mt-2 text-sm text-muted",
282
+ children: building ? "This takes a few minutes after setup or an upgrade. Reload the page shortly." : "Usually this means deBug was upgraded but its indexes weren't. Run npx debugkit deploy-dashboard (or npx debugkit init) to add them; your other indexes are left alone."
283
+ }),
284
+ /* @__PURE__ */ jsx("button", {
285
+ className: "mt-4 rounded-md border border-line px-3 py-1.5 text-sm hover:bg-panel-2",
286
+ onClick: () => window.location.reload(),
287
+ children: "Reload"
288
+ })
289
+ ]
290
+ });
291
+ }
292
+ return /* @__PURE__ */ jsxs("div", {
293
+ className: "mx-auto max-w-xl p-8",
294
+ children: [/* @__PURE__ */ jsx("h1", {
295
+ className: "text-lg font-semibold",
296
+ children: "Something went wrong"
297
+ }), /* @__PURE__ */ jsx("pre", {
298
+ className: "mt-3 overflow-auto rounded-md bg-panel-2 p-3 text-xs",
299
+ children: message
300
+ })]
301
+ });
302
+ }
241
303
  function getRouter() {
242
304
  return createRouter({
243
305
  routeTree,
244
306
  scrollRestoration: true,
245
307
  defaultPreload: "intent",
246
- defaultErrorComponent: ({ error }) => /* @__PURE__ */ jsxs("div", {
247
- className: "mx-auto max-w-xl p-8",
248
- children: [/* @__PURE__ */ jsx("h1", {
249
- className: "text-lg font-semibold",
250
- children: "Something went wrong"
251
- }), /* @__PURE__ */ jsx("pre", {
252
- className: "mt-3 overflow-auto rounded-md bg-panel-2 p-3 text-xs",
253
- children: error instanceof Error ? error.message : String(error)
254
- })]
255
- }),
308
+ defaultErrorComponent: ErrorPage,
256
309
  defaultNotFoundComponent: () => /* @__PURE__ */ jsx("div", {
257
310
  className: "p-8 text-muted",
258
311
  children: "Not found."
259
312
  })
260
313
  });
261
314
  }
262
- export { Route$6 as a, getRouter, Route$5 as i, Route$1 as n, Route$7 as o, Route$4 as r, router_exports as t };
315
+ export { Route$6 as a, Route$9 as c, getRouter, Route$5 as i, Route$1 as n, Route$7 as o, Route$2 as r, Route$8 as s, router_exports as t };
@@ -1,6 +1,6 @@
1
1
  import { t as Card } from "./ui-BJokJdYa.js";
2
- import { c as restampExisting, d as sendTestAlert, l as saveAppSettings, u as saveRetention } from "./fns-DPsnK0zS.js";
3
- import { r as Route } from "./router-CIIGBCmL.js";
2
+ import { _ as sendTestAlert, g as saveRetention, h as saveAppSettings, m as restampExisting } from "./fns-DwGaMi8S.js";
3
+ import { a as Route } from "./router-G99085_Q.js";
4
4
  import { useState } from "react";
5
5
  import { useNavigate, useRouter } from "@tanstack/react-router";
6
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -0,0 +1,9 @@
1
+ import "./memory-BssaqdZm.js";
2
+ // ../../packages/adapters/src/index.ts
3
+ var MAX_RETENTION_DAYS = 3650;
4
+ var TEAM_ROLES = [
5
+ "owner",
6
+ "admin",
7
+ "member"
8
+ ];
9
+ export { TEAM_ROLES as n, MAX_RETENTION_DAYS as t };
@@ -0,0 +1,255 @@
1
+ import { c as timeAgo, t as Card } from "./ui-BJokJdYa.js";
2
+ import { l as inviteToTeam, p as removeFromTeam, t as cancelInvite, v as setMemberRole } from "./fns-DwGaMi8S.js";
3
+ import { i as Route } from "./router-G99085_Q.js";
4
+ import { useState } from "react";
5
+ import { useRouter } from "@tanstack/react-router";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ // src/routes/_authed/team.tsx?tsr-split=component
8
+ var ROLE_HELP = {
9
+ owner: "everything, including owners",
10
+ admin: "settings and the team, except owners",
11
+ member: "sees everything, changes issue status"
12
+ };
13
+ function TeamPage() {
14
+ const team = Route.useLoaderData();
15
+ const router = useRouter();
16
+ const [role, setRole] = useState("member");
17
+ const [email, setEmail] = useState("");
18
+ const [link, setLink] = useState(null);
19
+ const [status, setStatus] = useState(null);
20
+ const [busy, setBusy] = useState(false);
21
+ const canInvite = team.canManage && team.canWrite;
22
+ const act = async (fn, done) => {
23
+ setBusy(true);
24
+ setStatus(null);
25
+ const out = await fn().catch((e) => ({
26
+ ok: false,
27
+ error: e.message
28
+ }));
29
+ setBusy(false);
30
+ if (!out.ok) return setStatus({
31
+ tone: "error",
32
+ text: out.error ?? "That didn't work."
33
+ });
34
+ setStatus({
35
+ tone: "ok",
36
+ text: done
37
+ });
38
+ await router.invalidate();
39
+ };
40
+ const invite = async (e) => {
41
+ e.preventDefault();
42
+ setBusy(true);
43
+ setStatus(null);
44
+ setLink(null);
45
+ const out = await inviteToTeam({ data: {
46
+ role,
47
+ email: email.trim() || void 0
48
+ } }).catch((err) => ({
49
+ ok: false,
50
+ error: err.message
51
+ }));
52
+ setBusy(false);
53
+ if (!out.ok) return setStatus({
54
+ tone: "error",
55
+ text: out.error
56
+ });
57
+ setLink({
58
+ url: `${window.location.origin}/invite/${out.token}`,
59
+ expiresAt: out.expiresAt,
60
+ email: email.trim() || void 0
61
+ });
62
+ setEmail("");
63
+ await router.invalidate();
64
+ };
65
+ return /* @__PURE__ */ jsxs("main", {
66
+ className: "mx-auto max-w-3xl space-y-5 px-4 py-6 sm:px-6",
67
+ children: [
68
+ /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h1", {
69
+ className: "text-xl font-semibold",
70
+ children: "Team"
71
+ }), /* @__PURE__ */ jsx("p", {
72
+ className: "mt-1 text-sm text-muted",
73
+ children: "Everyone who can sign in to this dashboard. Invite people with a link; nothing is emailed."
74
+ })] }),
75
+ canInvite && /* @__PURE__ */ jsxs(Card, {
76
+ title: "Invite someone",
77
+ subtitle: "The link works once and expires in 7 days.",
78
+ children: [
79
+ /* @__PURE__ */ jsxs("form", {
80
+ onSubmit: invite,
81
+ className: "flex flex-wrap items-end gap-3",
82
+ children: [
83
+ /* @__PURE__ */ jsxs("label", {
84
+ className: "min-w-0 flex-1 text-sm",
85
+ children: [/* @__PURE__ */ jsx("span", {
86
+ className: "font-medium",
87
+ children: "Email (optional)"
88
+ }), /* @__PURE__ */ jsx("input", {
89
+ type: "email",
90
+ value: email,
91
+ onChange: (e) => setEmail(e.target.value),
92
+ placeholder: "Only this person can use the link",
93
+ className: "mt-1 w-full rounded-md border border-line bg-bg px-3 py-2 text-sm outline-none focus:border-accent"
94
+ })]
95
+ }),
96
+ /* @__PURE__ */ jsxs("label", {
97
+ className: "text-sm",
98
+ children: [/* @__PURE__ */ jsx("span", {
99
+ className: "font-medium",
100
+ children: "Role"
101
+ }), /* @__PURE__ */ jsx("select", {
102
+ value: role,
103
+ onChange: (e) => setRole(e.target.value),
104
+ className: "mt-1 block rounded-md border border-line bg-bg px-3 py-2 text-sm",
105
+ children: (team.me.role === "owner" ? [
106
+ "member",
107
+ "admin",
108
+ "owner"
109
+ ] : ["member", "admin"]).map((r) => /* @__PURE__ */ jsx("option", {
110
+ value: r,
111
+ children: r
112
+ }, r))
113
+ })]
114
+ }),
115
+ /* @__PURE__ */ jsx("button", {
116
+ disabled: busy,
117
+ className: "rounded-md bg-ink px-3 py-2 text-sm font-medium text-bg disabled:opacity-60",
118
+ children: "Create invite link"
119
+ })
120
+ ]
121
+ }),
122
+ /* @__PURE__ */ jsxs("p", {
123
+ className: "mt-2 text-xs text-muted",
124
+ children: [
125
+ role,
126
+ ": ",
127
+ ROLE_HELP[role],
128
+ "."
129
+ ]
130
+ }),
131
+ link && /* @__PURE__ */ jsxs("div", {
132
+ className: "mt-4 rounded-md border border-accent bg-accent-soft p-3 text-sm",
133
+ children: [/* @__PURE__ */ jsxs("p", {
134
+ className: "font-medium",
135
+ children: [
136
+ "Send this link",
137
+ link.email ? ` to ${link.email}` : "",
138
+ ". It's shown only now."
139
+ ]
140
+ }), /* @__PURE__ */ jsxs("div", {
141
+ className: "mt-2 flex min-w-0 gap-2",
142
+ children: [/* @__PURE__ */ jsx("input", {
143
+ readOnly: true,
144
+ value: link.url,
145
+ "aria-label": "Invite link",
146
+ onFocus: (e) => e.currentTarget.select(),
147
+ className: "min-w-0 flex-1 rounded-md border border-line bg-bg px-2 py-1.5 font-mono text-xs"
148
+ }), /* @__PURE__ */ jsx("button", {
149
+ type: "button",
150
+ className: "rounded-md border border-line bg-bg px-2.5 py-1 text-xs hover:bg-panel-2",
151
+ onClick: () => navigator.clipboard?.writeText(link.url).then(() => setStatus({
152
+ tone: "ok",
153
+ text: "Link copied."
154
+ })),
155
+ children: "Copy"
156
+ })]
157
+ })]
158
+ })
159
+ ]
160
+ }),
161
+ team.note && /* @__PURE__ */ jsx("p", {
162
+ className: "text-sm text-muted",
163
+ children: team.note
164
+ }),
165
+ status && /* @__PURE__ */ jsx("p", {
166
+ role: status.tone === "error" ? "alert" : "status",
167
+ className: `text-sm ${status.tone === "error" ? "text-sev-critical" : "text-ink"}`,
168
+ children: status.text
169
+ }),
170
+ /* @__PURE__ */ jsx(Card, {
171
+ title: "Members",
172
+ subtitle: `${team.members.length} ${team.members.length === 1 ? "person" : "people"}`,
173
+ children: /* @__PURE__ */ jsx("ul", {
174
+ className: "divide-y divide-line",
175
+ children: team.members.map((m) => {
176
+ const me = m.email === team.me.email;
177
+ const editable = canInvite && m.source === "team" && !me && (team.me.role === "owner" || m.role !== "owner");
178
+ return /* @__PURE__ */ jsxs("li", {
179
+ className: "flex flex-wrap items-center justify-between gap-2 py-3",
180
+ children: [/* @__PURE__ */ jsxs("div", {
181
+ className: "min-w-0",
182
+ children: [/* @__PURE__ */ jsxs("p", {
183
+ className: "truncate text-sm font-medium",
184
+ children: [
185
+ m.name ? `${m.name} · ` : "",
186
+ m.email,
187
+ me ? " (you)" : ""
188
+ ]
189
+ }), /* @__PURE__ */ jsx("p", {
190
+ className: "text-xs text-muted",
191
+ children: m.source === "env" ? "Set up with npx debugkit init" : `Joined ${m.createdAt ? timeAgo(m.createdAt) : ""}${m.invitedBy ? `, invited by ${m.invitedBy}` : ""}`
192
+ })]
193
+ }), /* @__PURE__ */ jsxs("div", {
194
+ className: "flex items-center gap-2",
195
+ children: [editable ? /* @__PURE__ */ jsx("select", {
196
+ "aria-label": `Role for ${m.email}`,
197
+ value: m.role,
198
+ disabled: busy,
199
+ className: "rounded-md border border-line bg-bg px-2 py-1 text-sm",
200
+ onChange: (e) => act(() => setMemberRole({ data: {
201
+ email: m.email,
202
+ role: e.target.value
203
+ } }), `${m.email} is now ${e.target.value}.`),
204
+ children: (team.me.role === "owner" ? [
205
+ "member",
206
+ "admin",
207
+ "owner"
208
+ ] : ["member", "admin"]).map((r) => /* @__PURE__ */ jsx("option", {
209
+ value: r,
210
+ children: r
211
+ }, r))
212
+ }) : /* @__PURE__ */ jsx("span", {
213
+ className: "rounded-full border border-line px-2 py-0.5 text-xs",
214
+ children: m.role
215
+ }), editable && /* @__PURE__ */ jsx("button", {
216
+ disabled: busy,
217
+ className: "rounded-md border border-line px-2.5 py-1 text-xs text-sev-critical hover:bg-panel-2",
218
+ onClick: () => confirm(`Remove ${m.email}? They're signed out right away.`) && act(() => removeFromTeam({ data: { email: m.email } }), `${m.email} no longer has access.`),
219
+ children: "Remove"
220
+ })]
221
+ })]
222
+ }, m.email);
223
+ })
224
+ })
225
+ }),
226
+ team.invites.length > 0 && /* @__PURE__ */ jsx(Card, {
227
+ title: "Pending invites",
228
+ children: /* @__PURE__ */ jsx("ul", {
229
+ className: "divide-y divide-line",
230
+ children: team.invites.map((i) => /* @__PURE__ */ jsxs("li", {
231
+ className: "flex flex-wrap items-center justify-between gap-2 py-3 text-sm",
232
+ children: [/* @__PURE__ */ jsxs("span", {
233
+ className: "min-w-0",
234
+ children: [
235
+ /* @__PURE__ */ jsx("b", { children: i.role }),
236
+ " ",
237
+ i.email ? `for ${i.email}` : "for anyone with the link",
238
+ " · by ",
239
+ i.invitedBy,
240
+ " · expires ",
241
+ new Date(i.expiresAt).toLocaleDateString()
242
+ ]
243
+ }), canInvite && (team.me.role === "owner" || i.role !== "owner") && /* @__PURE__ */ jsx("button", {
244
+ disabled: busy,
245
+ className: "rounded-md border border-line px-2.5 py-1 text-xs hover:bg-panel-2",
246
+ onClick: () => act(() => cancelInvite({ data: { id: i.id } }), "Invite cancelled."),
247
+ children: "Cancel"
248
+ })]
249
+ }, i.id))
250
+ })
251
+ })
252
+ ]
253
+ });
254
+ }
255
+ export { TeamPage as component };
@@ -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-BBxgjm04.js");
4488
+ const { tsrStartManifest } = await import("./assets/_tanstack-start-manifest_v-CqaE4wze.js");
4489
4489
  const startManifest = tsrStartManifest();
4490
4490
  let routes = startManifest.routes;
4491
4491
  routes[rootRouteId];
@@ -4508,51 +4508,79 @@ async function getStartManifest(matchedRoutes) {
4508
4508
  var manifest = {
4509
4509
  "0c2f8fcb35c5e356e4a58fce376bb16efb0e006f519592fdd5f120fa868720cd": {
4510
4510
  functionName: "saveRetention_createServerFn_handler",
4511
- importer: () => import("./assets/fns-hk_OJe6M.js")
4511
+ importer: () => import("./assets/fns-mbUIXXep.js")
4512
+ },
4513
+ "0dcf3aa141898f7bb0cefed3e6129613f6226a680cc800b8cb18d2c60b7706fa": {
4514
+ functionName: "inviteToTeam_createServerFn_handler",
4515
+ importer: () => import("./assets/fns-mbUIXXep.js")
4512
4516
  },
4513
4517
  "1edaae661b4968edee65ebb4a946e246107684704b784b6359bf9af2dfaae23f": {
4514
4518
  functionName: "getSessionUser_createServerFn_handler",
4515
- importer: () => import("./assets/fns-hk_OJe6M.js")
4519
+ importer: () => import("./assets/fns-mbUIXXep.js")
4520
+ },
4521
+ "2598559c204c178bf26b98a0f3ae20e519cec3b9013f9d9b02ce14b170ada220": {
4522
+ functionName: "joinTeam_createServerFn_handler",
4523
+ importer: () => import("./assets/fns-mbUIXXep.js")
4524
+ },
4525
+ "2727b9721f5d291dbb62652d2de5cff55fd7871756147d8ce441b03a7a494617": {
4526
+ functionName: "removeFromTeam_createServerFn_handler",
4527
+ importer: () => import("./assets/fns-mbUIXXep.js")
4528
+ },
4529
+ "51bfd02b4d1772943ec480c2dcd7b445826bcfa7d494453d269cc82644ea2a42": {
4530
+ functionName: "setMemberRole_createServerFn_handler",
4531
+ importer: () => import("./assets/fns-mbUIXXep.js")
4516
4532
  },
4517
4533
  "7028d75aed3e58a91f5f26a3821d0cec6bb478a913058f5aa73cbfb64bbc41d3": {
4518
4534
  functionName: "sendTestAlert_createServerFn_handler",
4519
- importer: () => import("./assets/fns-hk_OJe6M.js")
4535
+ importer: () => import("./assets/fns-mbUIXXep.js")
4520
4536
  },
4521
4537
  "86933afdbcaa1be4a0aa07c4f8e690fdd684edbeab02a49ffdb73e85cadf9933": {
4522
4538
  functionName: "getIssueDetail_createServerFn_handler",
4523
- importer: () => import("./assets/fns-hk_OJe6M.js")
4539
+ importer: () => import("./assets/fns-mbUIXXep.js")
4540
+ },
4541
+ "8e8646e3fd8b630ba5696313fb01543dc62410ff8fa9b1eea9763286d32c8927": {
4542
+ functionName: "getInvite_createServerFn_handler",
4543
+ importer: () => import("./assets/fns-mbUIXXep.js")
4544
+ },
4545
+ "8ff7e08627330b1c64257ee12b7ed04815853cb3735a9324805c0bcf149bae9f": {
4546
+ functionName: "getTeam_createServerFn_handler",
4547
+ importer: () => import("./assets/fns-mbUIXXep.js")
4524
4548
  },
4525
4549
  "9354c2231554471ec5cde4e9a07b2e32662a8ce0bf29b09b5b930359d374f862": {
4526
4550
  functionName: "getOverview_createServerFn_handler",
4527
- importer: () => import("./assets/fns-hk_OJe6M.js")
4551
+ importer: () => import("./assets/fns-mbUIXXep.js")
4528
4552
  },
4529
4553
  "949e1fa91e479f6ad9193caee7087c38ca21191786f4b2c082ea643cbd30dec1": {
4530
4554
  functionName: "getLoginInfo_createServerFn_handler",
4531
- importer: () => import("./assets/fns-hk_OJe6M.js")
4555
+ importer: () => import("./assets/fns-mbUIXXep.js")
4532
4556
  },
4533
4557
  "950c0a9412e17ae8308bccd862dee5faea0375153c5ce59491a033dbcb7e7181": {
4534
4558
  functionName: "saveAppSettings_createServerFn_handler",
4535
- importer: () => import("./assets/fns-hk_OJe6M.js")
4559
+ importer: () => import("./assets/fns-mbUIXXep.js")
4536
4560
  },
4537
4561
  "a1b47d616a31acc3132c1bb8258bde961d9c419ff91b2ce1d6479ebb9760b393": {
4538
4562
  functionName: "restampExisting_createServerFn_handler",
4539
- importer: () => import("./assets/fns-hk_OJe6M.js")
4563
+ importer: () => import("./assets/fns-mbUIXXep.js")
4540
4564
  },
4541
4565
  "a9edf8f42685a06ce282bb7c9f888e3ae39636f350a90750c31a47b27de7dca8": {
4542
4566
  functionName: "login_createServerFn_handler",
4543
- importer: () => import("./assets/fns-hk_OJe6M.js")
4567
+ importer: () => import("./assets/fns-mbUIXXep.js")
4568
+ },
4569
+ "b4629be951e5766734fb72f9e1400c19f585a4381d9172539b2512ae5056f4e8": {
4570
+ functionName: "cancelInvite_createServerFn_handler",
4571
+ importer: () => import("./assets/fns-mbUIXXep.js")
4544
4572
  },
4545
4573
  "c263ee8bf14396211aeb95bc2b2aec914480b38cc99a9024c1319f932f590f2f": {
4546
4574
  functionName: "updateIssueStatus_createServerFn_handler",
4547
- importer: () => import("./assets/fns-hk_OJe6M.js")
4575
+ importer: () => import("./assets/fns-mbUIXXep.js")
4548
4576
  },
4549
4577
  "e97a9c2b8715ff5e25a9629262b594fb42f11853d6eea78b87305fd0b5155d4d": {
4550
4578
  functionName: "getSettings_createServerFn_handler",
4551
- importer: () => import("./assets/fns-hk_OJe6M.js")
4579
+ importer: () => import("./assets/fns-mbUIXXep.js")
4552
4580
  },
4553
4581
  "fd40d9026eb7d8fb5ab200daaed9a58f1d7b4eaf5b1ccab3e4cef9b0fedd9bc4": {
4554
4582
  functionName: "logout_createServerFn_handler",
4555
- importer: () => import("./assets/fns-hk_OJe6M.js")
4583
+ importer: () => import("./assets/fns-mbUIXXep.js")
4556
4584
  }
4557
4585
  };
4558
4586
  async function getServerFnById(id, access) {
@@ -7284,7 +7312,7 @@ var getBaseManifest = getProdBaseManifest;
7284
7312
  var createEarlyHintsForRequest = createEarlyHintsCollector;
7285
7313
  async function loadEntries() {
7286
7314
  const [routerEntry, startEntry, pluginAdapters] = await Promise.all([
7287
- import("./assets/router-CIIGBCmL.js").then((n) => n.t),
7315
+ import("./assets/router-G99085_Q.js").then((n) => n.t),
7288
7316
  import("./assets/start-t09PGpZL.js"),
7289
7317
  import("./assets/empty-plugin-adapters-BsRz-CQL.js")
7290
7318
  ]);