@tgoliveira/outpost 1.1.0 → 1.2.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 (166) hide show
  1. package/dist/adapters/drizzle/index.cjs +57 -0
  2. package/dist/adapters/drizzle/index.cjs.map +1 -1
  3. package/dist/adapters/drizzle/index.d.cts +165 -3
  4. package/dist/adapters/drizzle/index.d.ts +165 -3
  5. package/dist/adapters/drizzle/index.js +57 -2
  6. package/dist/adapters/drizzle/index.js.map +1 -1
  7. package/dist/admin/index.cjs +585 -0
  8. package/dist/admin/index.cjs.map +1 -0
  9. package/dist/admin/index.d.cts +116 -0
  10. package/dist/admin/index.d.ts +116 -0
  11. package/dist/admin/index.js +582 -0
  12. package/dist/admin/index.js.map +1 -0
  13. package/dist/config-override-repository-BHIGX3DJ.d.cts +14 -0
  14. package/dist/config-override-repository-BHIGX3DJ.d.ts +14 -0
  15. package/dist/http/index.d.cts +3 -3
  16. package/dist/http/index.d.ts +3 -3
  17. package/dist/{index-Dmt-aLH2.d.cts → index-BO0GiZmP.d.cts} +1 -1
  18. package/dist/{index-CVUvaJms.d.ts → index-c6caPsUG.d.ts} +1 -1
  19. package/dist/index.d.cts +5 -5
  20. package/dist/index.d.ts +5 -5
  21. package/dist/modules/ui/index.cjs +775 -0
  22. package/dist/modules/ui/index.cjs.map +1 -0
  23. package/dist/modules/ui/index.d.cts +17 -0
  24. package/dist/modules/ui/index.d.ts +17 -0
  25. package/dist/modules/ui/index.js +718 -0
  26. package/dist/modules/ui/index.js.map +1 -0
  27. package/dist/modules/ui/layouts/page-shell.cjs +58 -0
  28. package/dist/modules/ui/layouts/page-shell.cjs.map +1 -0
  29. package/dist/modules/ui/layouts/page-shell.d.cts +13 -0
  30. package/dist/modules/ui/layouts/page-shell.d.ts +13 -0
  31. package/dist/modules/ui/layouts/page-shell.js +32 -0
  32. package/dist/modules/ui/layouts/page-shell.js.map +1 -0
  33. package/dist/modules/ui/lib/cn.cjs +33 -0
  34. package/dist/modules/ui/lib/cn.cjs.map +1 -0
  35. package/dist/modules/ui/lib/cn.d.cts +3 -0
  36. package/dist/modules/ui/lib/cn.d.ts +3 -0
  37. package/dist/modules/ui/lib/cn.js +8 -0
  38. package/dist/modules/ui/lib/cn.js.map +1 -0
  39. package/dist/modules/ui/lib/main-content.cjs +31 -0
  40. package/dist/modules/ui/lib/main-content.cjs.map +1 -0
  41. package/dist/modules/ui/lib/main-content.d.cts +3 -0
  42. package/dist/modules/ui/lib/main-content.d.ts +3 -0
  43. package/dist/modules/ui/lib/main-content.js +6 -0
  44. package/dist/modules/ui/lib/main-content.js.map +1 -0
  45. package/dist/modules/ui/outpost-ui-provider.cjs +52 -0
  46. package/dist/modules/ui/outpost-ui-provider.cjs.map +1 -0
  47. package/dist/modules/ui/outpost-ui-provider.d.cts +15 -0
  48. package/dist/modules/ui/outpost-ui-provider.d.ts +15 -0
  49. package/dist/modules/ui/outpost-ui-provider.js +27 -0
  50. package/dist/modules/ui/outpost-ui-provider.js.map +1 -0
  51. package/dist/modules/ui/pages/admin/admin-config-page.cjs +429 -0
  52. package/dist/modules/ui/pages/admin/admin-config-page.cjs.map +1 -0
  53. package/dist/modules/ui/pages/admin/admin-config-page.d.cts +8 -0
  54. package/dist/modules/ui/pages/admin/admin-config-page.d.ts +8 -0
  55. package/dist/modules/ui/pages/admin/admin-config-page.js +395 -0
  56. package/dist/modules/ui/pages/admin/admin-config-page.js.map +1 -0
  57. package/dist/modules/ui/pages/admin/admin-observability-page.cjs +344 -0
  58. package/dist/modules/ui/pages/admin/admin-observability-page.cjs.map +1 -0
  59. package/dist/modules/ui/pages/admin/admin-observability-page.d.cts +8 -0
  60. package/dist/modules/ui/pages/admin/admin-observability-page.d.ts +8 -0
  61. package/dist/modules/ui/pages/admin/admin-observability-page.js +310 -0
  62. package/dist/modules/ui/pages/admin/admin-observability-page.js.map +1 -0
  63. package/dist/modules/ui/pages/admin/admin-panel-page.cjs +160 -0
  64. package/dist/modules/ui/pages/admin/admin-panel-page.cjs.map +1 -0
  65. package/dist/modules/ui/pages/admin/admin-panel-page.d.cts +9 -0
  66. package/dist/modules/ui/pages/admin/admin-panel-page.d.ts +9 -0
  67. package/dist/modules/ui/pages/admin/admin-panel-page.js +126 -0
  68. package/dist/modules/ui/pages/admin/admin-panel-page.js.map +1 -0
  69. package/dist/modules/ui/pages/admin/admin-queue-page.cjs +398 -0
  70. package/dist/modules/ui/pages/admin/admin-queue-page.cjs.map +1 -0
  71. package/dist/modules/ui/pages/admin/admin-queue-page.d.cts +8 -0
  72. package/dist/modules/ui/pages/admin/admin-queue-page.d.ts +8 -0
  73. package/dist/modules/ui/pages/admin/admin-queue-page.js +364 -0
  74. package/dist/modules/ui/pages/admin/admin-queue-page.js.map +1 -0
  75. package/dist/modules/ui/pages/index.cjs +742 -0
  76. package/dist/modules/ui/pages/index.cjs.map +1 -0
  77. package/dist/modules/ui/pages/index.d.cts +6 -0
  78. package/dist/modules/ui/pages/index.d.ts +6 -0
  79. package/dist/modules/ui/pages/index.js +702 -0
  80. package/dist/modules/ui/pages/index.js.map +1 -0
  81. package/dist/modules/ui/pages/types.cjs +38 -0
  82. package/dist/modules/ui/pages/types.cjs.map +1 -0
  83. package/dist/modules/ui/pages/types.d.cts +9 -0
  84. package/dist/modules/ui/pages/types.d.ts +9 -0
  85. package/dist/modules/ui/pages/types.js +12 -0
  86. package/dist/modules/ui/pages/types.js.map +1 -0
  87. package/dist/modules/ui/pages/use-page-ui.cjs +55 -0
  88. package/dist/modules/ui/pages/use-page-ui.cjs.map +1 -0
  89. package/dist/modules/ui/pages/use-page-ui.d.cts +6 -0
  90. package/dist/modules/ui/pages/use-page-ui.d.ts +6 -0
  91. package/dist/modules/ui/pages/use-page-ui.js +29 -0
  92. package/dist/modules/ui/pages/use-page-ui.js.map +1 -0
  93. package/dist/modules/ui/primitives/alert.cjs +63 -0
  94. package/dist/modules/ui/primitives/alert.cjs.map +1 -0
  95. package/dist/modules/ui/primitives/alert.d.cts +10 -0
  96. package/dist/modules/ui/primitives/alert.d.ts +10 -0
  97. package/dist/modules/ui/primitives/alert.js +36 -0
  98. package/dist/modules/ui/primitives/alert.js.map +1 -0
  99. package/dist/modules/ui/primitives/badge.cjs +60 -0
  100. package/dist/modules/ui/primitives/badge.cjs.map +1 -0
  101. package/dist/modules/ui/primitives/badge.d.cts +9 -0
  102. package/dist/modules/ui/primitives/badge.d.ts +9 -0
  103. package/dist/modules/ui/primitives/badge.js +33 -0
  104. package/dist/modules/ui/primitives/badge.js.map +1 -0
  105. package/dist/modules/ui/primitives/button.cjs +61 -0
  106. package/dist/modules/ui/primitives/button.cjs.map +1 -0
  107. package/dist/modules/ui/primitives/button.d.cts +9 -0
  108. package/dist/modules/ui/primitives/button.d.ts +9 -0
  109. package/dist/modules/ui/primitives/button.js +37 -0
  110. package/dist/modules/ui/primitives/button.js.map +1 -0
  111. package/dist/modules/ui/primitives/card.cjs +71 -0
  112. package/dist/modules/ui/primitives/card.cjs.map +1 -0
  113. package/dist/modules/ui/primitives/card.d.cts +11 -0
  114. package/dist/modules/ui/primitives/card.d.ts +11 -0
  115. package/dist/modules/ui/primitives/card.js +41 -0
  116. package/dist/modules/ui/primitives/card.js.map +1 -0
  117. package/dist/modules/ui/primitives/empty-state.cjs +37 -0
  118. package/dist/modules/ui/primitives/empty-state.cjs.map +1 -0
  119. package/dist/modules/ui/primitives/empty-state.d.cts +9 -0
  120. package/dist/modules/ui/primitives/empty-state.d.ts +9 -0
  121. package/dist/modules/ui/primitives/empty-state.js +12 -0
  122. package/dist/modules/ui/primitives/empty-state.js.map +1 -0
  123. package/dist/modules/ui/primitives/input.cjs +55 -0
  124. package/dist/modules/ui/primitives/input.cjs.map +1 -0
  125. package/dist/modules/ui/primitives/input.d.cts +6 -0
  126. package/dist/modules/ui/primitives/input.d.ts +6 -0
  127. package/dist/modules/ui/primitives/input.js +30 -0
  128. package/dist/modules/ui/primitives/input.js.map +1 -0
  129. package/dist/modules/ui/primitives/loading-state.cjs +55 -0
  130. package/dist/modules/ui/primitives/loading-state.cjs.map +1 -0
  131. package/dist/modules/ui/primitives/loading-state.d.cts +8 -0
  132. package/dist/modules/ui/primitives/loading-state.d.ts +8 -0
  133. package/dist/modules/ui/primitives/loading-state.js +30 -0
  134. package/dist/modules/ui/primitives/loading-state.js.map +1 -0
  135. package/dist/modules/ui/primitives/page-header.cjs +40 -0
  136. package/dist/modules/ui/primitives/page-header.cjs.map +1 -0
  137. package/dist/modules/ui/primitives/page-header.d.cts +10 -0
  138. package/dist/modules/ui/primitives/page-header.d.ts +10 -0
  139. package/dist/modules/ui/primitives/page-header.js +15 -0
  140. package/dist/modules/ui/primitives/page-header.js.map +1 -0
  141. package/dist/{outpost-client-ymTJISpu.d.ts → outpost-client-BItbgqIo.d.ts} +2 -2
  142. package/dist/{outpost-client-yUijE00q.d.cts → outpost-client-BlVf4gjo.d.cts} +2 -2
  143. package/dist/react/client.cjs +14 -0
  144. package/dist/react/client.cjs.map +1 -0
  145. package/dist/react/client.d.cts +5 -0
  146. package/dist/react/client.d.ts +5 -0
  147. package/dist/react/client.js +11 -0
  148. package/dist/react/client.js.map +1 -0
  149. package/dist/react/index.cjs +776 -0
  150. package/dist/react/index.cjs.map +1 -0
  151. package/dist/react/index.d.cts +17 -0
  152. package/dist/react/index.d.ts +17 -0
  153. package/dist/react/index.js +720 -0
  154. package/dist/react/index.js.map +1 -0
  155. package/dist/{repositories-DhUe8f2R.d.cts → repositories-CHIOFGn3.d.cts} +2 -0
  156. package/dist/{repositories-Bck6wJNS.d.ts → repositories-WyhvxzyY.d.ts} +2 -0
  157. package/dist/testing/index.cjs +41 -0
  158. package/dist/testing/index.cjs.map +1 -1
  159. package/dist/testing/index.d.cts +13 -3
  160. package/dist/testing/index.d.ts +13 -3
  161. package/dist/testing/index.js +41 -1
  162. package/dist/testing/index.js.map +1 -1
  163. package/dist/workers/index.d.cts +2 -2
  164. package/dist/workers/index.d.ts +2 -2
  165. package/package.json +45 -3
  166. package/styles.css +4 -0
@@ -0,0 +1,718 @@
1
+ // src/modules/ui/outpost-ui-provider.tsx
2
+ import { createContext, useContext } from "react";
3
+
4
+ // src/modules/ui/pages/types.ts
5
+ var DEFAULT_OUTPOST_PATHS = {
6
+ adminPanel: "/admin"
7
+ };
8
+ function resolveOutpostPaths(overrides) {
9
+ return { ...DEFAULT_OUTPOST_PATHS, ...overrides };
10
+ }
11
+
12
+ // src/modules/ui/outpost-ui-provider.tsx
13
+ import { jsx } from "react/jsx-runtime";
14
+ var OutpostUiContext = createContext(null);
15
+ function OutpostUIProvider({ children, paths }) {
16
+ return /* @__PURE__ */ jsx(OutpostUiContext.Provider, { value: { paths: resolveOutpostPaths(paths) }, children });
17
+ }
18
+ function useOutpostUi() {
19
+ return useContext(OutpostUiContext);
20
+ }
21
+
22
+ // src/modules/ui/lib/cn.ts
23
+ function cn(...classes) {
24
+ return classes.filter(Boolean).join(" ");
25
+ }
26
+
27
+ // src/modules/ui/lib/main-content.ts
28
+ var MAIN_CONTENT_ID = "outpost-main-content";
29
+
30
+ // src/modules/ui/layouts/page-shell.tsx
31
+ import { jsx as jsx2 } from "react/jsx-runtime";
32
+ var widthClass = {
33
+ narrow: "max-w-md",
34
+ medium: "max-w-xl",
35
+ wide: "max-w-6xl"
36
+ };
37
+ function PageShell({ children, width = "wide", className }) {
38
+ return /* @__PURE__ */ jsx2(
39
+ "main",
40
+ {
41
+ id: MAIN_CONTENT_ID,
42
+ tabIndex: -1,
43
+ className: cn("mx-auto px-4 py-8 md:py-10", widthClass[width], className),
44
+ children
45
+ }
46
+ );
47
+ }
48
+
49
+ // src/modules/ui/primitives/button.tsx
50
+ import { forwardRef } from "react";
51
+ import { jsx as jsx3 } from "react/jsx-runtime";
52
+ var Button = forwardRef(function Button2({ variant = "primary", className, children, ...props }, ref) {
53
+ const variants = {
54
+ primary: "bg-[var(--primary)] text-white hover:bg-[var(--primary-hover)]",
55
+ secondary: "border border-[var(--border)] bg-[var(--card)] text-[var(--foreground)] hover:bg-[var(--card-muted)]",
56
+ danger: "bg-[var(--danger)] text-white hover:bg-red-800"
57
+ };
58
+ return /* @__PURE__ */ jsx3(
59
+ "button",
60
+ {
61
+ ref,
62
+ className: cn(
63
+ "min-h-11 rounded-[var(--radius)] px-4 py-2.5 text-sm font-medium transition-colors",
64
+ "disabled:cursor-not-allowed disabled:opacity-50",
65
+ variants[variant],
66
+ className
67
+ ),
68
+ ...props,
69
+ children
70
+ }
71
+ );
72
+ });
73
+
74
+ // src/modules/ui/primitives/alert.tsx
75
+ import { jsx as jsx4, jsxs } from "react/jsx-runtime";
76
+ var variantStyles = {
77
+ info: "border-[var(--info-muted)] bg-[var(--info-muted)] text-[var(--info)]",
78
+ success: "border-[var(--success-muted)] bg-[var(--success-muted)] text-[var(--success)]",
79
+ warning: "border-[var(--warning-muted)] bg-[var(--warning-muted)] text-[var(--warning)]",
80
+ danger: "border-[var(--danger-muted)] bg-[var(--danger-muted)] text-[var(--danger)]",
81
+ muted: "border-[var(--border)] bg-[var(--card-muted)] text-[var(--muted)]"
82
+ };
83
+ function Alert({ variant = "muted", title, className, children, ...props }) {
84
+ return /* @__PURE__ */ jsxs(
85
+ "div",
86
+ {
87
+ role: "status",
88
+ className: cn(
89
+ "rounded-[var(--radius)] border px-4 py-3 text-sm leading-relaxed",
90
+ variantStyles[variant],
91
+ className
92
+ ),
93
+ ...props,
94
+ children: [
95
+ title && /* @__PURE__ */ jsx4("p", { className: "mb-1 font-medium", children: title }),
96
+ children
97
+ ]
98
+ }
99
+ );
100
+ }
101
+
102
+ // src/modules/ui/primitives/badge.tsx
103
+ import { jsx as jsx5 } from "react/jsx-runtime";
104
+ var styles = {
105
+ default: "bg-[var(--accent-muted)] text-[var(--foreground)]",
106
+ success: "bg-[var(--success-muted)] text-[var(--success)]",
107
+ info: "bg-[var(--info-muted)] text-[var(--info)]",
108
+ danger: "bg-[var(--danger-muted)] text-[var(--danger)]",
109
+ muted: "bg-[var(--card-muted)] text-[var(--muted)]",
110
+ warning: "bg-[var(--warning-muted)] text-[var(--warning)]"
111
+ };
112
+ function Badge({ variant = "default", className, children, ...props }) {
113
+ return /* @__PURE__ */ jsx5(
114
+ "span",
115
+ {
116
+ className: cn(
117
+ "inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium",
118
+ styles[variant],
119
+ className
120
+ ),
121
+ ...props,
122
+ children
123
+ }
124
+ );
125
+ }
126
+
127
+ // src/modules/ui/primitives/card.tsx
128
+ import { jsx as jsx6 } from "react/jsx-runtime";
129
+ function Card({ className, muted, children, ...props }) {
130
+ return /* @__PURE__ */ jsx6(
131
+ "div",
132
+ {
133
+ className: cn(
134
+ "rounded-[var(--radius)] border border-[var(--border)] p-5 shadow-[var(--shadow-sm)]",
135
+ muted ? "bg-[var(--card-muted)]" : "bg-[var(--card)]",
136
+ className
137
+ ),
138
+ ...props,
139
+ children
140
+ }
141
+ );
142
+ }
143
+ function CardHeader({ className, children, ...props }) {
144
+ return /* @__PURE__ */ jsx6("div", { className: cn("mb-4 space-y-1", className), ...props, children });
145
+ }
146
+ function CardTitle({ className, children, ...props }) {
147
+ return /* @__PURE__ */ jsx6("h2", { className: cn("text-lg font-medium text-[var(--foreground)]", className), ...props, children });
148
+ }
149
+ function CardDescription({
150
+ className,
151
+ children,
152
+ ...props
153
+ }) {
154
+ return /* @__PURE__ */ jsx6("p", { className: cn("text-sm leading-relaxed text-[var(--muted)]", className), ...props, children });
155
+ }
156
+
157
+ // src/modules/ui/primitives/page-header.tsx
158
+ import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
159
+ function PageHeader({ title, description, action }) {
160
+ return /* @__PURE__ */ jsxs2("div", { className: "mb-8 flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between", children: [
161
+ /* @__PURE__ */ jsxs2("div", { className: "space-y-2", children: [
162
+ /* @__PURE__ */ jsx7("h1", { className: "text-2xl font-semibold tracking-tight text-[var(--foreground)]", children: title }),
163
+ description && /* @__PURE__ */ jsx7("p", { className: "max-w-prose text-sm leading-relaxed text-[var(--muted)]", children: description })
164
+ ] }),
165
+ action && /* @__PURE__ */ jsx7("div", { className: "shrink-0", children: action })
166
+ ] });
167
+ }
168
+
169
+ // src/modules/ui/primitives/loading-state.tsx
170
+ import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
171
+ function LoadingState({ label = "Loading" }) {
172
+ return /* @__PURE__ */ jsxs3(
173
+ "div",
174
+ {
175
+ className: "flex flex-col items-center justify-center gap-3 py-16 text-center",
176
+ role: "status",
177
+ "aria-live": "polite",
178
+ "aria-busy": "true",
179
+ children: [
180
+ /* @__PURE__ */ jsx8(
181
+ "div",
182
+ {
183
+ className: "h-8 w-8 animate-pulse rounded-full border-2 border-[var(--border)] border-t-[var(--primary)]",
184
+ "aria-hidden": "true"
185
+ }
186
+ ),
187
+ /* @__PURE__ */ jsxs3("p", { className: "text-sm text-[var(--muted)]", children: [
188
+ label,
189
+ "\u2026"
190
+ ] })
191
+ ]
192
+ }
193
+ );
194
+ }
195
+
196
+ // src/modules/ui/primitives/empty-state.tsx
197
+ import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
198
+ function EmptyState({ title, description }) {
199
+ return /* @__PURE__ */ jsxs4("div", { className: "py-8 text-center", children: [
200
+ /* @__PURE__ */ jsx9("p", { className: "text-sm font-medium text-[var(--foreground)]", children: title }),
201
+ description && /* @__PURE__ */ jsx9("p", { className: "mt-1 text-sm text-[var(--muted)]", children: description })
202
+ ] });
203
+ }
204
+
205
+ // src/modules/ui/primitives/input.tsx
206
+ import { forwardRef as forwardRef2 } from "react";
207
+ import { jsx as jsx10 } from "react/jsx-runtime";
208
+ var Input = forwardRef2(
209
+ function Input2({ className, ...props }, ref) {
210
+ return /* @__PURE__ */ jsx10(
211
+ "input",
212
+ {
213
+ ref,
214
+ className: cn(
215
+ "w-full rounded-[var(--radius)] border border-[var(--border)] bg-[var(--card)] px-3 py-2 text-sm text-[var(--foreground)]",
216
+ "placeholder:text-[var(--muted)] focus:outline-none focus:ring-2 focus:ring-[var(--primary)]",
217
+ className
218
+ ),
219
+ ...props
220
+ }
221
+ );
222
+ }
223
+ );
224
+
225
+ // src/modules/ui/pages/admin/admin-panel-page.tsx
226
+ import Link from "next/link";
227
+
228
+ // src/modules/ui/pages/use-page-ui.ts
229
+ function useUiPaths(overrides) {
230
+ const ui = useOutpostUi();
231
+ return resolveOutpostPaths({ ...ui?.paths, ...overrides });
232
+ }
233
+
234
+ // src/modules/ui/pages/admin/admin-panel-page.tsx
235
+ import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
236
+ var SECTIONS = [
237
+ {
238
+ key: "adminQueue",
239
+ label: "Email Queue",
240
+ description: "Inspect queued messages and run the send worker manually.",
241
+ suffix: "/queue"
242
+ },
243
+ {
244
+ key: "adminConfig",
245
+ label: "Configuration",
246
+ description: "View and override vault/env settings. Admin overrides win over env.local.",
247
+ suffix: "/config"
248
+ },
249
+ {
250
+ key: "adminObservability",
251
+ label: "Observability",
252
+ description: "Queue depth, worker activity, and OpenTelemetry metric catalog.",
253
+ suffix: "/observability"
254
+ }
255
+ ];
256
+ function AdminPanelPage({ paths }) {
257
+ const resolved = useUiPaths(paths);
258
+ const base = resolved.adminPanel;
259
+ return /* @__PURE__ */ jsxs5(PageShell, { width: "wide", children: [
260
+ /* @__PURE__ */ jsxs5("div", { className: "mb-8", children: [
261
+ /* @__PURE__ */ jsx11("h1", { className: "text-2xl font-semibold text-[var(--foreground)]", children: "Outpost Admin" }),
262
+ /* @__PURE__ */ jsx11("p", { className: "mt-1 text-sm text-[var(--muted)]", children: "Operate the transactional email outbox \u2014 queue, configuration, and observability." })
263
+ ] }),
264
+ /* @__PURE__ */ jsx11("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: SECTIONS.map((section) => /* @__PURE__ */ jsx11(Link, { href: `${base}${section.suffix}`, className: "block", children: /* @__PURE__ */ jsx11(Card, { className: "h-full cursor-pointer transition-shadow hover:shadow-md", children: /* @__PURE__ */ jsxs5(CardHeader, { children: [
265
+ /* @__PURE__ */ jsx11(CardTitle, { className: "text-base", children: section.label }),
266
+ /* @__PURE__ */ jsx11(CardDescription, { className: "text-sm", children: section.description })
267
+ ] }) }) }, section.key)) })
268
+ ] });
269
+ }
270
+
271
+ // src/modules/ui/pages/admin/admin-queue-page.tsx
272
+ import { useState, useEffect, useCallback } from "react";
273
+ import Link2 from "next/link";
274
+ import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
275
+ function stateBadge(state) {
276
+ if (state === "queued") return /* @__PURE__ */ jsx12(Badge, { variant: "info", children: "queued" });
277
+ if (state === "sending") return /* @__PURE__ */ jsx12(Badge, { variant: "warning", children: "sending" });
278
+ if (state === "failed") return /* @__PURE__ */ jsx12(Badge, { variant: "danger", children: "failed" });
279
+ return /* @__PURE__ */ jsx12(Badge, { variant: "muted", children: state });
280
+ }
281
+ function formatDate(d) {
282
+ if (!d) return "\u2014";
283
+ return new Date(d).toLocaleString();
284
+ }
285
+ function MessageTable({
286
+ title,
287
+ description,
288
+ rows
289
+ }) {
290
+ return /* @__PURE__ */ jsxs6(Card, { className: "overflow-hidden", children: [
291
+ /* @__PURE__ */ jsxs6(CardHeader, { children: [
292
+ /* @__PURE__ */ jsx12(CardTitle, { children: title }),
293
+ /* @__PURE__ */ jsx12(CardDescription, { children: description })
294
+ ] }),
295
+ rows.length === 0 ? /* @__PURE__ */ jsx12("div", { className: "px-6 pb-6", children: /* @__PURE__ */ jsx12(EmptyState, { title: "No messages", description: "Nothing in this bucket right now." }) }) : /* @__PURE__ */ jsx12("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs6("table", { className: "w-full text-sm", children: [
296
+ /* @__PURE__ */ jsx12("thead", { className: "border-b border-[var(--border)] bg-[var(--card-muted)]", children: /* @__PURE__ */ jsxs6("tr", { children: [
297
+ /* @__PURE__ */ jsx12("th", { className: "px-4 py-2 text-left font-medium text-[var(--muted)]", children: "State" }),
298
+ /* @__PURE__ */ jsx12("th", { className: "px-4 py-2 text-left font-medium text-[var(--muted)]", children: "Subject" }),
299
+ /* @__PURE__ */ jsx12("th", { className: "px-4 py-2 text-left font-medium text-[var(--muted)]", children: "Provider" }),
300
+ /* @__PURE__ */ jsx12("th", { className: "px-4 py-2 text-left font-medium text-[var(--muted)]", children: "Attempts" }),
301
+ /* @__PURE__ */ jsx12("th", { className: "px-4 py-2 text-left font-medium text-[var(--muted)]", children: "Next attempt" }),
302
+ /* @__PURE__ */ jsx12("th", { className: "px-4 py-2 text-left font-medium text-[var(--muted)]", children: "Created" })
303
+ ] }) }),
304
+ /* @__PURE__ */ jsx12("tbody", { className: "divide-y divide-[var(--border)]", children: rows.map((row) => /* @__PURE__ */ jsxs6("tr", { className: "hover:bg-[var(--card-muted)]", children: [
305
+ /* @__PURE__ */ jsx12("td", { className: "px-4 py-3", children: stateBadge(row.state) }),
306
+ /* @__PURE__ */ jsxs6("td", { className: "px-4 py-3", children: [
307
+ /* @__PURE__ */ jsx12("div", { className: "font-medium", children: row.subject }),
308
+ /* @__PURE__ */ jsx12("div", { className: "font-mono text-xs text-[var(--muted)]", children: row.id })
309
+ ] }),
310
+ /* @__PURE__ */ jsx12("td", { className: "px-4 py-3", children: row.provider }),
311
+ /* @__PURE__ */ jsx12("td", { className: "px-4 py-3", children: row.attempts }),
312
+ /* @__PURE__ */ jsx12("td", { className: "px-4 py-3 text-[var(--muted)]", children: formatDate(row.nextAttemptAt) }),
313
+ /* @__PURE__ */ jsx12("td", { className: "px-4 py-3 text-[var(--muted)]", children: formatDate(row.createdAt) })
314
+ ] }, row.id)) })
315
+ ] }) })
316
+ ] });
317
+ }
318
+ function AdminQueuePage({ apiBase = "/api/outpost" }) {
319
+ const resolved = useUiPaths();
320
+ const [data, setData] = useState(null);
321
+ const [isLoading, setIsLoading] = useState(true);
322
+ const [isRunningWorker, setIsRunningWorker] = useState(false);
323
+ const [error, setError] = useState("");
324
+ const [workerResult, setWorkerResult] = useState("");
325
+ const load = useCallback(async () => {
326
+ setIsLoading(true);
327
+ setError("");
328
+ try {
329
+ const res = await fetch(`${apiBase}/admin/queue`);
330
+ if (!res.ok) throw new Error("Failed to load");
331
+ setData(await res.json());
332
+ } catch {
333
+ setError("Failed to load the email queue. Please try again.");
334
+ } finally {
335
+ setIsLoading(false);
336
+ }
337
+ }, [apiBase]);
338
+ useEffect(() => {
339
+ void load();
340
+ }, [load]);
341
+ async function runWorker() {
342
+ setIsRunningWorker(true);
343
+ setError("");
344
+ setWorkerResult("");
345
+ try {
346
+ const res = await fetch(`${apiBase}/admin/worker/send`, { method: "POST" });
347
+ if (!res.ok) throw new Error("Worker run failed");
348
+ const report = await res.json();
349
+ setWorkerResult(
350
+ `Worker finished: claimed ${report.claimed ?? 0} message(s).`
351
+ );
352
+ await load();
353
+ } catch {
354
+ setError("Failed to run the send worker. Please try again.");
355
+ } finally {
356
+ setIsRunningWorker(false);
357
+ }
358
+ }
359
+ return /* @__PURE__ */ jsxs6(PageShell, { width: "wide", children: [
360
+ /* @__PURE__ */ jsxs6("div", { className: "mb-4 text-sm text-[var(--muted)]", children: [
361
+ /* @__PURE__ */ jsx12(Link2, { href: resolved.adminPanel, className: "hover:underline", children: "Admin" }),
362
+ /* @__PURE__ */ jsx12("span", { className: "mx-2", children: "/" }),
363
+ /* @__PURE__ */ jsx12("span", { className: "text-[var(--foreground)]", children: "Email Queue" })
364
+ ] }),
365
+ /* @__PURE__ */ jsx12(
366
+ PageHeader,
367
+ {
368
+ title: "Email Queue",
369
+ description: "Messages waiting to be sent. Run the send worker to process the next batch.",
370
+ action: /* @__PURE__ */ jsxs6("div", { className: "flex gap-2", children: [
371
+ /* @__PURE__ */ jsx12(Button, { variant: "secondary", onClick: load, disabled: isLoading, children: isLoading ? "Loading\u2026" : "Refresh" }),
372
+ /* @__PURE__ */ jsx12(Button, { variant: "primary", onClick: runWorker, disabled: isRunningWorker, children: isRunningWorker ? "Running\u2026" : "Run send worker" })
373
+ ] })
374
+ }
375
+ ),
376
+ error && /* @__PURE__ */ jsx12(Alert, { variant: "danger", className: "mb-4", children: error }),
377
+ workerResult && /* @__PURE__ */ jsx12(Alert, { variant: "success", className: "mb-4", children: workerResult }),
378
+ isLoading ? /* @__PURE__ */ jsx12(LoadingState, { label: "Loading queue" }) : data ? /* @__PURE__ */ jsxs6("div", { className: "space-y-6", children: [
379
+ /* @__PURE__ */ jsxs6("div", { className: "grid gap-3 sm:grid-cols-3", children: [
380
+ /* @__PURE__ */ jsxs6(Card, { muted: true, children: [
381
+ /* @__PURE__ */ jsx12("p", { className: "text-xs uppercase tracking-wide text-[var(--muted)]", children: "Queued" }),
382
+ /* @__PURE__ */ jsx12("p", { className: "mt-1 text-2xl font-semibold", children: data.counts.queued ?? 0 })
383
+ ] }),
384
+ /* @__PURE__ */ jsxs6(Card, { muted: true, children: [
385
+ /* @__PURE__ */ jsx12("p", { className: "text-xs uppercase tracking-wide text-[var(--muted)]", children: "Sending" }),
386
+ /* @__PURE__ */ jsx12("p", { className: "mt-1 text-2xl font-semibold", children: data.counts.sending ?? 0 })
387
+ ] }),
388
+ /* @__PURE__ */ jsxs6(Card, { muted: true, children: [
389
+ /* @__PURE__ */ jsx12("p", { className: "text-xs uppercase tracking-wide text-[var(--muted)]", children: "Failed (DLQ)" }),
390
+ /* @__PURE__ */ jsx12("p", { className: "mt-1 text-2xl font-semibold", children: data.counts.failed ?? 0 })
391
+ ] })
392
+ ] }),
393
+ /* @__PURE__ */ jsx12(
394
+ MessageTable,
395
+ {
396
+ title: "Queued",
397
+ description: "Persisted and waiting for the send worker.",
398
+ rows: data.queued
399
+ }
400
+ ),
401
+ /* @__PURE__ */ jsx12(
402
+ MessageTable,
403
+ {
404
+ title: "Sending",
405
+ description: "Claimed by a worker; will be reclaimed if the lease expires.",
406
+ rows: data.sending
407
+ }
408
+ ),
409
+ /* @__PURE__ */ jsx12(
410
+ MessageTable,
411
+ {
412
+ title: "Failed",
413
+ description: "Dead-lettered after retries exhausted.",
414
+ rows: data.failed
415
+ }
416
+ )
417
+ ] }) : null
418
+ ] });
419
+ }
420
+
421
+ // src/modules/ui/pages/admin/admin-config-page.tsx
422
+ import { useState as useState2, useEffect as useEffect2, useCallback as useCallback2 } from "react";
423
+ import Link3 from "next/link";
424
+ import { Fragment, jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
425
+ function sourceBadge(source) {
426
+ if (source === "admin") return /* @__PURE__ */ jsx13(Badge, { variant: "info", children: "admin" });
427
+ if (source === "env") return /* @__PURE__ */ jsx13(Badge, { variant: "default", children: "env" });
428
+ return /* @__PURE__ */ jsx13(Badge, { variant: "muted", children: "default" });
429
+ }
430
+ function valueDisplay(value, secret) {
431
+ if (value === void 0 || value === null) return "\u2014";
432
+ if (secret && typeof value === "string") return value;
433
+ return String(value);
434
+ }
435
+ function AdminConfigPage({ apiBase = "/api/outpost" }) {
436
+ const resolved = useUiPaths();
437
+ const [configKeys, setConfigKeys] = useState2([]);
438
+ const [isLoading, setIsLoading] = useState2(true);
439
+ const [error, setError] = useState2("");
440
+ const [editingKey, setEditingKey] = useState2(null);
441
+ const [editValue, setEditValue] = useState2("");
442
+ const [saving, setSaving] = useState2(false);
443
+ const load = useCallback2(async () => {
444
+ setIsLoading(true);
445
+ setError("");
446
+ try {
447
+ const res = await fetch(`${apiBase}/admin/config`);
448
+ if (!res.ok) throw new Error("Failed to load");
449
+ const data = await res.json();
450
+ setConfigKeys(data.keys ?? []);
451
+ } catch {
452
+ setError("Failed to load configuration.");
453
+ } finally {
454
+ setIsLoading(false);
455
+ }
456
+ }, [apiBase]);
457
+ useEffect2(() => {
458
+ void load();
459
+ }, [load]);
460
+ function startEdit(ck) {
461
+ setEditingKey(ck.key);
462
+ setEditValue(ck.secret ? "" : valueDisplay(ck.value));
463
+ }
464
+ function parseEditValue(raw) {
465
+ if (raw === "true") return true;
466
+ if (raw === "false") return false;
467
+ const n = Number(raw);
468
+ if (!Number.isNaN(n) && raw.trim() !== "") return n;
469
+ return raw;
470
+ }
471
+ async function saveEdit(key) {
472
+ setSaving(true);
473
+ setError("");
474
+ try {
475
+ const res = await fetch(`${apiBase}/admin/config`, {
476
+ method: "POST",
477
+ headers: { "Content-Type": "application/json" },
478
+ body: JSON.stringify({ key, value: parseEditValue(editValue) })
479
+ });
480
+ if (!res.ok) {
481
+ const data = await res.json().catch(() => ({}));
482
+ throw new Error(data.error ?? "Save failed");
483
+ }
484
+ setEditingKey(null);
485
+ await load();
486
+ } catch (e) {
487
+ setError(e instanceof Error ? e.message : "Failed to save.");
488
+ } finally {
489
+ setSaving(false);
490
+ }
491
+ }
492
+ async function resetOverride(key) {
493
+ setSaving(true);
494
+ try {
495
+ await fetch(`${apiBase}/admin/config`, {
496
+ method: "DELETE",
497
+ headers: { "Content-Type": "application/json" },
498
+ body: JSON.stringify({ key })
499
+ });
500
+ await load();
501
+ } catch {
502
+ setError("Failed to reset override.");
503
+ } finally {
504
+ setSaving(false);
505
+ }
506
+ }
507
+ return /* @__PURE__ */ jsxs7(PageShell, { width: "wide", children: [
508
+ /* @__PURE__ */ jsxs7("div", { className: "mb-4 text-sm text-[var(--muted)]", children: [
509
+ /* @__PURE__ */ jsx13(Link3, { href: resolved.adminPanel, className: "hover:underline", children: "Admin" }),
510
+ /* @__PURE__ */ jsx13("span", { className: "mx-2", children: "/" }),
511
+ /* @__PURE__ */ jsx13("span", { className: "text-[var(--foreground)]", children: "Configuration" })
512
+ ] }),
513
+ /* @__PURE__ */ jsx13(
514
+ PageHeader,
515
+ {
516
+ title: "Configuration",
517
+ description: "Priority: admin override \u2192 env.local \u2192 package default. Secrets are masked in the UI.",
518
+ action: /* @__PURE__ */ jsx13(Button, { variant: "secondary", onClick: load, disabled: isLoading, children: "Refresh" })
519
+ }
520
+ ),
521
+ error && /* @__PURE__ */ jsx13(Alert, { variant: "danger", className: "mb-4", children: error }),
522
+ isLoading ? /* @__PURE__ */ jsx13(LoadingState, { label: "Loading config" }) : /* @__PURE__ */ jsxs7(Card, { className: "overflow-hidden", children: [
523
+ /* @__PURE__ */ jsxs7(CardHeader, { children: [
524
+ /* @__PURE__ */ jsx13(CardTitle, { children: "Vault & environment settings" }),
525
+ /* @__PURE__ */ jsx13(CardDescription, { children: "Keys mirror `.env.example` and `createOutpost` options. Admin overrides persist in the database." })
526
+ ] }),
527
+ /* @__PURE__ */ jsx13("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs7("table", { className: "w-full text-sm", children: [
528
+ /* @__PURE__ */ jsx13("thead", { className: "border-b border-[var(--border)] bg-[var(--card-muted)]", children: /* @__PURE__ */ jsxs7("tr", { children: [
529
+ /* @__PURE__ */ jsx13("th", { className: "px-4 py-2 text-left font-medium text-[var(--muted)]", children: "Key" }),
530
+ /* @__PURE__ */ jsx13("th", { className: "px-4 py-2 text-left font-medium text-[var(--muted)]", children: "Source" }),
531
+ /* @__PURE__ */ jsx13("th", { className: "px-4 py-2 text-left font-medium text-[var(--muted)]", children: "Value" }),
532
+ /* @__PURE__ */ jsx13("th", { className: "px-4 py-2" })
533
+ ] }) }),
534
+ /* @__PURE__ */ jsx13("tbody", { className: "divide-y divide-[var(--border)]", children: configKeys.map((ck) => /* @__PURE__ */ jsxs7("tr", { className: "hover:bg-[var(--card-muted)]", children: [
535
+ /* @__PURE__ */ jsx13("td", { className: "px-4 py-3 font-mono text-xs", children: ck.key }),
536
+ /* @__PURE__ */ jsx13("td", { className: "px-4 py-3", children: sourceBadge(ck.source) }),
537
+ /* @__PURE__ */ jsx13("td", { className: "px-4 py-3", children: editingKey === ck.key ? /* @__PURE__ */ jsx13(
538
+ Input,
539
+ {
540
+ className: "h-7 text-xs",
541
+ type: ck.secret ? "password" : "text",
542
+ placeholder: ck.secret ? "Enter new value" : void 0,
543
+ value: editValue,
544
+ onChange: (e) => setEditValue(e.target.value),
545
+ onKeyDown: (e) => {
546
+ if (e.key === "Enter") void saveEdit(ck.key);
547
+ if (e.key === "Escape") setEditingKey(null);
548
+ },
549
+ autoFocus: true
550
+ }
551
+ ) : /* @__PURE__ */ jsx13("span", { className: "font-mono text-xs", children: valueDisplay(ck.value, ck.secret) }) }),
552
+ /* @__PURE__ */ jsx13("td", { className: "px-4 py-3 text-right", children: /* @__PURE__ */ jsx13("div", { className: "flex items-center justify-end gap-2", children: editingKey === ck.key ? /* @__PURE__ */ jsxs7(Fragment, { children: [
553
+ /* @__PURE__ */ jsx13(
554
+ Button,
555
+ {
556
+ variant: "primary",
557
+ className: "text-xs",
558
+ disabled: saving,
559
+ onClick: () => saveEdit(ck.key),
560
+ children: saving ? "Saving\u2026" : "Save"
561
+ }
562
+ ),
563
+ /* @__PURE__ */ jsx13(
564
+ Button,
565
+ {
566
+ variant: "secondary",
567
+ className: "text-xs",
568
+ onClick: () => setEditingKey(null),
569
+ children: "Cancel"
570
+ }
571
+ )
572
+ ] }) : /* @__PURE__ */ jsxs7(Fragment, { children: [
573
+ /* @__PURE__ */ jsx13(Button, { variant: "secondary", className: "text-xs", onClick: () => startEdit(ck), children: "Edit" }),
574
+ ck.source === "admin" && /* @__PURE__ */ jsx13(
575
+ Button,
576
+ {
577
+ variant: "danger",
578
+ className: "text-xs",
579
+ disabled: saving,
580
+ onClick: () => resetOverride(ck.key),
581
+ children: "Reset"
582
+ }
583
+ )
584
+ ] }) }) })
585
+ ] }, ck.key)) })
586
+ ] }) })
587
+ ] })
588
+ ] });
589
+ }
590
+
591
+ // src/modules/ui/pages/admin/admin-observability-page.tsx
592
+ import { useState as useState3, useEffect as useEffect3, useCallback as useCallback3 } from "react";
593
+ import Link4 from "next/link";
594
+ import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
595
+ function AdminObservabilityPage({ apiBase = "/api/outpost" }) {
596
+ const resolved = useUiPaths();
597
+ const [data, setData] = useState3(null);
598
+ const [isLoading, setIsLoading] = useState3(true);
599
+ const [error, setError] = useState3("");
600
+ const load = useCallback3(async () => {
601
+ setIsLoading(true);
602
+ setError("");
603
+ try {
604
+ const res = await fetch(`${apiBase}/admin/observability`);
605
+ if (!res.ok) throw new Error("Failed to load");
606
+ setData(await res.json());
607
+ } catch {
608
+ setError("Failed to load observability data.");
609
+ } finally {
610
+ setIsLoading(false);
611
+ }
612
+ }, [apiBase]);
613
+ useEffect3(() => {
614
+ void load();
615
+ }, [load]);
616
+ return /* @__PURE__ */ jsxs8(PageShell, { width: "wide", children: [
617
+ /* @__PURE__ */ jsxs8("div", { className: "mb-4 text-sm text-[var(--muted)]", children: [
618
+ /* @__PURE__ */ jsx14(Link4, { href: resolved.adminPanel, className: "hover:underline", children: "Admin" }),
619
+ /* @__PURE__ */ jsx14("span", { className: "mx-2", children: "/" }),
620
+ /* @__PURE__ */ jsx14("span", { className: "text-[var(--foreground)]", children: "Observability" })
621
+ ] }),
622
+ /* @__PURE__ */ jsx14(
623
+ PageHeader,
624
+ {
625
+ title: "Observability",
626
+ description: "Operational snapshot from the outbox. Export OpenTelemetry metrics to your collector for dashboards.",
627
+ action: /* @__PURE__ */ jsx14(Button, { variant: "secondary", onClick: load, disabled: isLoading, children: isLoading ? "Loading\u2026" : "Refresh" })
628
+ }
629
+ ),
630
+ error && /* @__PURE__ */ jsx14(Alert, { variant: "danger", className: "mb-4", children: error }),
631
+ isLoading ? /* @__PURE__ */ jsx14(LoadingState, { label: "Loading observability" }) : data ? /* @__PURE__ */ jsxs8("div", { className: "space-y-6", children: [
632
+ /* @__PURE__ */ jsxs8("div", { className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4", children: [
633
+ Object.entries(data.countsByState).map(([state, count]) => /* @__PURE__ */ jsxs8(Card, { muted: true, children: [
634
+ /* @__PURE__ */ jsx14("p", { className: "text-xs uppercase tracking-wide text-[var(--muted)]", children: state }),
635
+ /* @__PURE__ */ jsx14("p", { className: "mt-1 text-2xl font-semibold", children: count })
636
+ ] }, state)),
637
+ /* @__PURE__ */ jsxs8(Card, { muted: true, children: [
638
+ /* @__PURE__ */ jsx14("p", { className: "text-xs uppercase tracking-wide text-[var(--muted)]", children: "suppressions" }),
639
+ /* @__PURE__ */ jsx14("p", { className: "mt-1 text-2xl font-semibold", children: data.suppressionCount })
640
+ ] })
641
+ ] }),
642
+ /* @__PURE__ */ jsxs8(Card, { children: [
643
+ /* @__PURE__ */ jsxs8(CardHeader, { children: [
644
+ /* @__PURE__ */ jsx14(CardTitle, { children: "Last send worker run" }),
645
+ /* @__PURE__ */ jsx14(CardDescription, { children: 'Updated when an operator clicks "Run send worker" on the queue page or a cron invokes the worker.' })
646
+ ] }),
647
+ data.lastWorkerRun ? /* @__PURE__ */ jsxs8("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3 text-sm", children: [
648
+ /* @__PURE__ */ jsxs8("div", { children: [
649
+ /* @__PURE__ */ jsx14("p", { className: "text-[var(--muted)]", children: "At" }),
650
+ /* @__PURE__ */ jsx14("p", { children: new Date(data.lastWorkerRun.at).toLocaleString() })
651
+ ] }),
652
+ /* @__PURE__ */ jsxs8("div", { children: [
653
+ /* @__PURE__ */ jsx14("p", { className: "text-[var(--muted)]", children: "Claimed" }),
654
+ /* @__PURE__ */ jsx14("p", { children: data.lastWorkerRun.claimed })
655
+ ] }),
656
+ /* @__PURE__ */ jsxs8("div", { children: [
657
+ /* @__PURE__ */ jsx14("p", { className: "text-[var(--muted)]", children: "Sent" }),
658
+ /* @__PURE__ */ jsx14("p", { children: data.lastWorkerRun.sent })
659
+ ] }),
660
+ /* @__PURE__ */ jsxs8("div", { children: [
661
+ /* @__PURE__ */ jsx14("p", { className: "text-[var(--muted)]", children: "Retried" }),
662
+ /* @__PURE__ */ jsx14("p", { children: data.lastWorkerRun.retried })
663
+ ] }),
664
+ /* @__PURE__ */ jsxs8("div", { children: [
665
+ /* @__PURE__ */ jsx14("p", { className: "text-[var(--muted)]", children: "Rate limited" }),
666
+ /* @__PURE__ */ jsx14("p", { children: data.lastWorkerRun.rateLimited })
667
+ ] }),
668
+ /* @__PURE__ */ jsxs8("div", { children: [
669
+ /* @__PURE__ */ jsx14("p", { className: "text-[var(--muted)]", children: "Failed (DLQ)" }),
670
+ /* @__PURE__ */ jsx14("p", { children: data.lastWorkerRun.failed })
671
+ ] })
672
+ ] }) : /* @__PURE__ */ jsx14("p", { className: "text-sm text-[var(--muted)]", children: "No worker run recorded yet." })
673
+ ] }),
674
+ /* @__PURE__ */ jsxs8(Card, { className: "overflow-hidden", children: [
675
+ /* @__PURE__ */ jsxs8(CardHeader, { children: [
676
+ /* @__PURE__ */ jsx14(CardTitle, { children: "OpenTelemetry metrics" }),
677
+ /* @__PURE__ */ jsx14(CardDescription, { children: "Emitted when `OtelTelemetry` is wired. Point your SDK exporter at these names." })
678
+ ] }),
679
+ /* @__PURE__ */ jsx14("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs8("table", { className: "w-full text-sm", children: [
680
+ /* @__PURE__ */ jsx14("thead", { className: "border-b border-[var(--border)] bg-[var(--card-muted)]", children: /* @__PURE__ */ jsxs8("tr", { children: [
681
+ /* @__PURE__ */ jsx14("th", { className: "px-4 py-2 text-left font-medium text-[var(--muted)]", children: "Name" }),
682
+ /* @__PURE__ */ jsx14("th", { className: "px-4 py-2 text-left font-medium text-[var(--muted)]", children: "Type" }),
683
+ /* @__PURE__ */ jsx14("th", { className: "px-4 py-2 text-left font-medium text-[var(--muted)]", children: "Description" })
684
+ ] }) }),
685
+ /* @__PURE__ */ jsx14("tbody", { className: "divide-y divide-[var(--border)]", children: data.metrics.map((m) => /* @__PURE__ */ jsxs8("tr", { className: "hover:bg-[var(--card-muted)]", children: [
686
+ /* @__PURE__ */ jsx14("td", { className: "px-4 py-3 font-mono text-xs", children: m.name }),
687
+ /* @__PURE__ */ jsx14("td", { className: "px-4 py-3", children: /* @__PURE__ */ jsx14(Badge, { variant: m.type === "gauge" ? "info" : "default", children: m.type }) }),
688
+ /* @__PURE__ */ jsx14("td", { className: "px-4 py-3 text-[var(--muted)]", children: m.description })
689
+ ] }, m.name)) })
690
+ ] }) })
691
+ ] })
692
+ ] }) : null
693
+ ] });
694
+ }
695
+ export {
696
+ AdminConfigPage,
697
+ AdminObservabilityPage,
698
+ AdminPanelPage,
699
+ AdminQueuePage,
700
+ Alert,
701
+ Badge,
702
+ Button,
703
+ Card,
704
+ CardDescription,
705
+ CardHeader,
706
+ CardTitle,
707
+ DEFAULT_OUTPOST_PATHS,
708
+ EmptyState,
709
+ Input,
710
+ LoadingState,
711
+ OutpostUIProvider,
712
+ PageHeader,
713
+ PageShell,
714
+ resolveOutpostPaths,
715
+ useOutpostUi,
716
+ useUiPaths
717
+ };
718
+ //# sourceMappingURL=index.js.map