@lunora/studio 1.0.0-alpha.5 → 1.0.0-alpha.50

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 (198) hide show
  1. package/LICENSE.md +6 -0
  2. package/__assets__/package-og.svg +1 -1
  3. package/dist/index.d.ts +45 -23
  4. package/dist/index.js +31 -31
  5. package/dist/mount.d.ts +1 -1
  6. package/dist/mount.js +3 -2
  7. package/dist/{packem_shared/ApiTab-W3no0KOj.js → packem_chunks/ApiTab.js} +5 -5
  8. package/dist/{packem_shared/AuditPanel-Bq4o_IqT.js → packem_chunks/AuditPanel.js} +29 -41
  9. package/dist/{packem_shared/ExportImportPanel-dxY56TDF.js → packem_chunks/ExportImportPanel.js} +16 -11
  10. package/dist/{packem_shared/FileBrowser-Dhy4zES8.js → packem_chunks/FileBrowser.js} +55 -32
  11. package/dist/{packem_shared/FunctionRunner--fQJRPAD.js → packem_chunks/FunctionRunner.js} +15 -32
  12. package/dist/{packem_shared/FunctionStatsPanel-BjRUA_G3.js → packem_chunks/FunctionStatsPanel.js} +153 -208
  13. package/dist/{packem_shared/HealthPanel-PxclMWmA.js → packem_chunks/HealthPanel.js} +37 -29
  14. package/dist/{packem_shared/InsightsPanel-CWS_C-xW.js → packem_chunks/InsightsPanel.js} +108 -69
  15. package/dist/{packem_shared/LogsPanel-CTW8CFcM.js → packem_chunks/LogsPanel.js} +46 -58
  16. package/dist/{packem_shared/MailPanel-BwkvfIHF.js → packem_chunks/MailPanel.js} +45 -139
  17. package/dist/{packem_shared/MetricsPanel-BLuOhZQ4.js → packem_chunks/MetricsPanel.js} +41 -322
  18. package/dist/{packem_shared/MigrationsPanel-DT3lnwHF.js → packem_chunks/MigrationsPanel.js} +44 -51
  19. package/dist/{packem_shared/PitrPanel-CdErL7EJ.js → packem_chunks/PitrPanel.js} +9 -9
  20. package/dist/{packem_shared/SchemaViewer-LJDcmNIO.js → packem_chunks/SchemaViewer.js} +17 -16
  21. package/dist/{packem_shared/SecurityAdvisorPanel-C_ETsPih.js → packem_chunks/SecurityAdvisorPanel.js} +47 -31
  22. package/dist/packem_chunks/SettingsPanel.js +391 -0
  23. package/dist/{packem_shared/sql-editor-panel-BFRpzj6r.js → packem_chunks/SqlEditorPanel.js} +159 -387
  24. package/dist/{packem_shared/TableEditor-ChfUOZec.js → packem_chunks/TableEditor.js} +13 -94
  25. package/dist/packem_chunks/agents-panel.js +326 -0
  26. package/dist/packem_chunks/analytics-panel.js +261 -0
  27. package/dist/packem_chunks/auth-config-panel.js +365 -0
  28. package/dist/packem_chunks/auth-sessions-panel.js +175 -0
  29. package/dist/packem_chunks/containers-panel.js +261 -0
  30. package/dist/packem_chunks/dashboards-panel.js +781 -0
  31. package/dist/packem_chunks/fanout-panel.js +482 -0
  32. package/dist/packem_chunks/flags-panel.js +176 -0
  33. package/dist/packem_chunks/issues-panel.js +188 -0
  34. package/dist/packem_chunks/kv-browser.js +1896 -0
  35. package/dist/packem_chunks/log-drains-panel.js +273 -0
  36. package/dist/packem_chunks/organizations-panel.js +3178 -0
  37. package/dist/packem_chunks/payments-panel.js +186 -0
  38. package/dist/packem_chunks/permissions-panel.js +805 -0
  39. package/dist/packem_chunks/queues-panel.js +1075 -0
  40. package/dist/packem_chunks/rls-panel.js +315 -0
  41. package/dist/packem_chunks/schedule-panel.js +831 -0
  42. package/dist/packem_chunks/sparkline.js +79 -0
  43. package/dist/packem_chunks/storage-rules-panel.js +140 -0
  44. package/dist/packem_chunks/subscriptions-panel.js +238 -0
  45. package/dist/packem_chunks/users-panel.js +1731 -0
  46. package/dist/packem_chunks/vector-browser.js +281 -0
  47. package/dist/packem_chunks/workflows-panel.js +562 -0
  48. package/dist/packem_shared/{ADMIN_FUNCTIONS-DmBqMZ-z.js → ADMIN_FUNCTIONS-DNeyYtUN.js} +8 -0
  49. package/dist/packem_shared/{ApiDocsPanel-C5-yJ1p7.js → ApiDocsPanel-_aEZxAMX.js} +2 -2
  50. package/dist/packem_shared/{ApiReferencePanel-1vubqG5s.js → ApiReferencePanel-Dd8pcswz.js} +2 -1
  51. package/dist/packem_shared/{CommandPalette-BtgkBzZI.js → CommandPalette-BXV4eKf5.js} +1 -1
  52. package/dist/packem_shared/{DataBrowser-CtBe1So9.js → DataBrowser-C8hejnub.js} +201 -250
  53. package/dist/packem_shared/{DataFilters-FNquMaiu.js → DataFilters-B1Q7mrt7.js} +6 -2
  54. package/dist/packem_shared/{GlobalDataBrowser-BTEmGrph.js → GlobalDataBrowser-CxJxRRf2.js} +37 -66
  55. package/dist/packem_shared/HomePanel-Ye8PaqQL.js +14 -0
  56. package/dist/packem_shared/{OpenRpcReferencePanel-vbcYbv3V.js → OpenRpcReferencePanel-CWaf0ZtX.js} +2 -1
  57. package/dist/packem_shared/{ScheduledJobs-CabfKbyM.js → ScheduledJobs-dHMgnJbx.js} +163 -60
  58. package/dist/packem_shared/{ShardInput-gx_DZXXn.js → ShardInput-CZnpHILL.js} +1 -1
  59. package/dist/packem_shared/Studio-xJLTlLpf.js +16 -0
  60. package/dist/packem_shared/{StudioApp-D4azxYBu.js → StudioApp-oCQholCL.js} +6 -21
  61. package/dist/packem_shared/{advisor-view-CGcfMiPq.js → advisor-view-Cx21PS_T.js} +6 -6
  62. package/dist/packem_shared/alert-CdAET2K_.js +68 -0
  63. package/dist/packem_shared/{app.d-CCmwDEVs.d.ts → app.d-CGdOmLTm.d.ts} +1 -1
  64. package/dist/packem_shared/{bar-chart-CzJAgqkp.js → bar-chart-DSwcWIRy.js} +5 -4
  65. package/dist/packem_shared/browser-storage-L4gOP5gJ.js +105 -0
  66. package/dist/packem_shared/{cf-links-2cktDedA.js → cf-links-BZfRdxSE.js} +1 -1
  67. package/dist/packem_shared/{data-grid-B5CaV3wS.js → data-grid-C9I16KWr.js} +1 -1
  68. package/dist/packem_shared/data-view-params-Cd6yRVbv.js +96 -0
  69. package/dist/packem_shared/error-alert-vIPQoN3Y.js +114 -0
  70. package/dist/packem_shared/{grid-features-CzUfqgsM.js → grid-features-B_fZH4iQ.js} +133 -164
  71. package/dist/packem_shared/home-panel-D62G8108.js +1889 -0
  72. package/dist/packem_shared/internal-zwBoOv24.js +122 -0
  73. package/dist/packem_shared/modal-shell-hyaJvIJ6.js +100 -0
  74. package/dist/packem_shared/{reference-view-B4E49Lip.js → reference-view-DUULLuOi.js} +8 -61
  75. package/dist/packem_shared/result-chart-DZradBAS.js +119 -0
  76. package/dist/packem_shared/scroll-area-DLhcy-ml.js +93 -0
  77. package/dist/packem_shared/select-UkNYCT3s.js +273 -0
  78. package/dist/packem_shared/shard-history-AxiJ1WPP.js +16 -0
  79. package/dist/packem_shared/skeleton-CGhL0p20.js +45 -0
  80. package/dist/packem_shared/{sparkline-10dG-_f0.js → sparkline-BnA1kC9X.js} +1 -1
  81. package/dist/packem_shared/studio-WZUOecDv.js +4069 -0
  82. package/dist/packem_shared/{table-_RzNvy3R.js → table-DsCa9Qp9.js} +1 -1
  83. package/dist/packem_shared/{table-list-sidebar-Bg7uzbvC.js → table-list-sidebar-huX4VmgI.js} +19 -9
  84. package/dist/packem_shared/use-admin-query-BGJ010yZ.js +106 -0
  85. package/dist/packem_shared/use-async-submit-DGCtuDyz.js +91 -0
  86. package/dist/standalone/chunk-22C6COGE.js +13 -0
  87. package/dist/standalone/chunk-2CCWLKQW.js +1 -0
  88. package/dist/standalone/chunk-2JTPX3CV.js +1 -0
  89. package/dist/standalone/chunk-2K47A3P6.js +1 -0
  90. package/dist/standalone/chunk-2MLA6WFH.js +1 -0
  91. package/dist/standalone/chunk-2NGUNNGW.js +1 -0
  92. package/dist/standalone/chunk-3CPQ5IQU.js +1 -0
  93. package/dist/standalone/chunk-3GXGLNKW.js +1 -0
  94. package/dist/standalone/chunk-3OA7PECS.js +6 -0
  95. package/dist/standalone/chunk-4AXW2ECS.js +13 -0
  96. package/dist/standalone/chunk-4BVRLBEW.js +1 -0
  97. package/dist/standalone/chunk-4PC7IXNY.js +1 -0
  98. package/dist/standalone/chunk-4QHKBC77.js +1 -0
  99. package/dist/standalone/chunk-5OIBXYZM.js +1 -0
  100. package/dist/standalone/chunk-5OZQHQ26.js +1 -0
  101. package/dist/standalone/chunk-6RREMPQX.js +2 -0
  102. package/dist/standalone/chunk-6ZBU3JWR.js +3 -0
  103. package/dist/standalone/chunk-7LDYSHOU.js +1 -0
  104. package/dist/standalone/chunk-7TJJXVSE.js +1 -0
  105. package/dist/standalone/chunk-A2DBMISD.js +1 -0
  106. package/dist/standalone/chunk-A3ZJACVT.js +4 -0
  107. package/dist/standalone/chunk-A66LI6OV.js +4 -0
  108. package/dist/standalone/chunk-AHILM3ZP.js +1 -0
  109. package/dist/standalone/chunk-AITOCPML.js +1 -0
  110. package/dist/standalone/chunk-APSSZB6Z.js +1 -0
  111. package/dist/standalone/chunk-BGG56IF5.js +1 -0
  112. package/dist/standalone/chunk-BJGBHGK3.js +1 -0
  113. package/dist/standalone/chunk-CJXJIRSN.js +1 -0
  114. package/dist/standalone/chunk-CKSHCYGC.js +2 -0
  115. package/dist/standalone/chunk-DR6LGPXE.js +1 -0
  116. package/dist/standalone/chunk-DWDILV2E.js +1 -0
  117. package/dist/standalone/chunk-EEWKIQUE.js +1 -0
  118. package/dist/standalone/chunk-EOE5NDMK.js +1 -0
  119. package/dist/standalone/chunk-FAUN4Z72.js +1 -0
  120. package/dist/standalone/chunk-G7ZBM54M.js +1 -0
  121. package/dist/standalone/chunk-GTM65MVX.js +1 -0
  122. package/dist/standalone/chunk-HAJSYWFT.js +8 -0
  123. package/dist/standalone/chunk-HQM6MBPS.js +1 -0
  124. package/dist/standalone/chunk-HTQNZXDT.js +1 -0
  125. package/dist/standalone/chunk-HV7G6DFP.js +5 -0
  126. package/dist/standalone/chunk-IO2XEI6T.js +1 -0
  127. package/dist/standalone/chunk-ITQKVEP7.js +19 -0
  128. package/dist/standalone/chunk-IZN4TYMN.js +1 -0
  129. package/dist/standalone/chunk-J6J54MBP.js +1 -0
  130. package/dist/standalone/chunk-JM7XBQVK.js +1 -0
  131. package/dist/standalone/chunk-JPILGFXT.js +1 -0
  132. package/dist/standalone/chunk-JSEXCW5Q.js +1 -0
  133. package/dist/standalone/chunk-JUDPYSJZ.js +1 -0
  134. package/dist/standalone/chunk-K4S652EQ.js +4 -0
  135. package/dist/standalone/chunk-KEGAWN6Y.js +1 -0
  136. package/dist/standalone/chunk-KJFFID72.js +1 -0
  137. package/dist/standalone/chunk-KJJ3WM6H.js +4 -0
  138. package/dist/standalone/chunk-KZ6INM5M.js +1 -0
  139. package/dist/standalone/chunk-L7SK4ZZD.js +1 -0
  140. package/dist/standalone/chunk-LAK5VSPI.js +1 -0
  141. package/dist/standalone/chunk-LJAAZNQ6.js +1 -0
  142. package/dist/standalone/chunk-LUP4YTBS.js +1 -0
  143. package/dist/standalone/chunk-LX7KONE3.js +1 -0
  144. package/dist/standalone/chunk-MDTNVR3G.js +1 -0
  145. package/dist/standalone/chunk-NS23QR4W.js +1 -0
  146. package/dist/standalone/chunk-NW6SZZ5O.js +1 -0
  147. package/dist/standalone/chunk-O3NAGRTR.js +1 -0
  148. package/dist/standalone/chunk-P2ERTKMB.js +1 -0
  149. package/dist/standalone/chunk-PS3XCCZD.js +1 -0
  150. package/dist/standalone/chunk-QAFAJBAW.js +1 -0
  151. package/dist/standalone/chunk-RRCPZMC2.js +22 -0
  152. package/dist/standalone/chunk-RS7S7XVP.js +1 -0
  153. package/dist/standalone/chunk-S5NTGHCG.js +1 -0
  154. package/dist/standalone/chunk-S7AB7Y75.js +1 -0
  155. package/dist/standalone/chunk-SDMZKBTD.js +1 -0
  156. package/dist/standalone/chunk-SDQE2IUJ.js +1 -0
  157. package/dist/standalone/chunk-SEU5V7I6.js +1 -0
  158. package/dist/standalone/chunk-SHERR7ZP.js +1 -0
  159. package/dist/standalone/chunk-SHJUAHC6.js +1 -0
  160. package/dist/standalone/chunk-TAD43CG5.js +1 -0
  161. package/dist/standalone/chunk-TO6D2PJC.js +6 -0
  162. package/dist/standalone/chunk-TQ36RWOP.js +1 -0
  163. package/dist/standalone/chunk-TYN6SQ73.js +1 -0
  164. package/dist/standalone/chunk-U26QNHMO.js +1 -0
  165. package/dist/standalone/chunk-UK64ZSUW.js +1 -0
  166. package/dist/standalone/chunk-UTHHHJYS.js +1 -0
  167. package/dist/standalone/chunk-V43BLH4J.js +1 -0
  168. package/dist/standalone/chunk-VL23Y44O.js +4 -0
  169. package/dist/standalone/chunk-VL6HOZHF.js +1 -0
  170. package/dist/standalone/chunk-VLXV72QE.js +1 -0
  171. package/dist/standalone/chunk-W666BB6V.js +1 -0
  172. package/dist/standalone/chunk-W6JKUZKD.js +1 -0
  173. package/dist/standalone/chunk-WI7GWFEG.js +1 -0
  174. package/dist/standalone/chunk-WUFVFVHJ.js +1 -0
  175. package/dist/standalone/chunk-WVTPZ6CM.js +1 -0
  176. package/dist/standalone/chunk-X2TQRMQV.js +1 -0
  177. package/dist/standalone/chunk-X4676IX6.js +1 -0
  178. package/dist/standalone/chunk-X4QFAAZ5.js +76 -0
  179. package/dist/standalone/chunk-XJU5SRNL.js +4 -0
  180. package/dist/standalone/chunk-XNJNSCLM.js +1 -0
  181. package/dist/standalone/chunk-XWPZBZSZ.js +3 -0
  182. package/dist/standalone/chunk-YLHDKM2P.js +1 -0
  183. package/dist/standalone/chunk-ZHVTQ37P.js +1 -0
  184. package/dist/standalone/chunk-ZIGWVHCS.js +1 -0
  185. package/dist/standalone/chunk-ZPP2KOR4.js +1 -0
  186. package/dist/standalone/chunk-ZPUO7FNI.js +1 -0
  187. package/dist/standalone/studio.js +104 -246
  188. package/dist/styles.css +2 -2
  189. package/package.json +17 -15
  190. package/dist/packem_shared/HomePanel-Cw16stjq.js +0 -1273
  191. package/dist/packem_shared/SettingsPanel-C0uLRf5P.js +0 -176
  192. package/dist/packem_shared/SqlEditorPanel-CguV7otm.js +0 -13
  193. package/dist/packem_shared/Studio-BmSGSIuY.js +0 -33
  194. package/dist/packem_shared/internal-rXJEAhXS.js +0 -68
  195. package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
  196. package/dist/packem_shared/studio-H9fuQgSj.js +0 -10303
  197. package/dist/packem_shared/use-live-admin-Dq6g3daN.js +0 -73
  198. package/dist/packem_shared/use-live-shard-seed-Cuk3dnH0.js +0 -76
@@ -0,0 +1,175 @@
1
+ import { c } from 'react/compiler-runtime';
2
+ import { useLunora } from '@lunora/react';
3
+ import { B as Button } from '../packem_shared/button-BhsN2uZH.js';
4
+ import { C as Card, a as CardContent } from '../packem_shared/card-DURq3ElK.js';
5
+ import { E as EmptyState } from '../packem_shared/empty-state-DY_oe0k6.js';
6
+ import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from '../packem_shared/table-DsCa9Qp9.js';
7
+ import { a as useClientQuery } from '../packem_shared/use-admin-query-BGJ010yZ.js';
8
+ import { useAutoRefresh } from '../packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js';
9
+ import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
10
+ import { i as formatTimestamp, f as fireAndForget } from '../packem_shared/internal-zwBoOv24.js';
11
+ import { jsxDEV } from 'react/jsx-dev-runtime';
12
+
13
+ const SESSION_LIMIT = 200;
14
+ const AuthSessionsPanel = () => {
15
+ const $ = c(21);
16
+ const client = useLunora();
17
+ const t = useT();
18
+ let t0;
19
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
20
+ t0 = ["lunora-auth-sessions", SESSION_LIMIT];
21
+ $[0] = t0;
22
+ } else {
23
+ t0 = $[0];
24
+ }
25
+ let t1;
26
+ if ($[1] !== client) {
27
+ t1 = () => client.listAuthSessions({
28
+ limit: SESSION_LIMIT
29
+ });
30
+ $[1] = client;
31
+ $[2] = t1;
32
+ } else {
33
+ t1 = $[2];
34
+ }
35
+ const sessionsQuery = useClientQuery(t0, t1);
36
+ const {
37
+ error
38
+ } = sessionsQuery;
39
+ const sessions = sessionsQuery.data?.rows ?? null;
40
+ let t2;
41
+ if ($[3] !== sessionsQuery) {
42
+ t2 = () => {
43
+ sessionsQuery.refetch();
44
+ };
45
+ $[3] = sessionsQuery;
46
+ $[4] = t2;
47
+ } else {
48
+ t2 = $[4];
49
+ }
50
+ useAutoRefresh(t2, true);
51
+ let t3;
52
+ if ($[5] !== client || $[6] !== sessionsQuery) {
53
+ t3 = (sessionId) => {
54
+ fireAndForget((async () => {
55
+ await client.revokeAuthSession({
56
+ sessionId
57
+ });
58
+ sessionsQuery.refetch();
59
+ })());
60
+ };
61
+ $[5] = client;
62
+ $[6] = sessionsQuery;
63
+ $[7] = t3;
64
+ } else {
65
+ t3 = $[7];
66
+ }
67
+ const onRevoke = t3;
68
+ let t4;
69
+ if ($[8] !== error) {
70
+ t4 = error !== null && /* @__PURE__ */ jsxDEV("p", {
71
+ className: "text-sm text-destructive",
72
+ "data-testid": "auth-sessions-error",
73
+ role: "alert",
74
+ children: error
75
+ }, void 0, false);
76
+ $[8] = error;
77
+ $[9] = t4;
78
+ } else {
79
+ t4 = $[9];
80
+ }
81
+ let t5;
82
+ if ($[10] !== sessions || $[11] !== t) {
83
+ t5 = sessions !== null && sessions.length === 0 && /* @__PURE__ */ jsxDEV(EmptyState, {
84
+ testId: "auth-sessions-empty",
85
+ title: t("No active sessions.")
86
+ }, void 0, false);
87
+ $[10] = sessions;
88
+ $[11] = t;
89
+ $[12] = t5;
90
+ } else {
91
+ t5 = $[12];
92
+ }
93
+ let t6;
94
+ if ($[13] !== onRevoke || $[14] !== sessions || $[15] !== t) {
95
+ t6 = sessions !== null && sessions.length > 0 && /* @__PURE__ */ jsxDEV(Card, {
96
+ className: "overflow-hidden py-0",
97
+ children: /* @__PURE__ */ jsxDEV(CardContent, {
98
+ className: "px-0",
99
+ children: /* @__PURE__ */ jsxDEV(Table, {
100
+ "data-testid": "auth-sessions-table",
101
+ children: [/* @__PURE__ */ jsxDEV(TableHeader, {
102
+ children: /* @__PURE__ */ jsxDEV(TableRow, {
103
+ children: [/* @__PURE__ */ jsxDEV(TableHead, {
104
+ children: t("user")
105
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
106
+ children: t("expires")
107
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
108
+ children: t("ip")
109
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
110
+ children: t("user agent")
111
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
112
+ children: t("impersonated by")
113
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
114
+ "aria-label": t("Actions")
115
+ }, void 0, false)]
116
+ }, void 0, true)
117
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
118
+ children: sessions.map((session) => /* @__PURE__ */ jsxDEV(TableRow, {
119
+ "data-testid": `auth-session-${session.id}`,
120
+ children: [/* @__PURE__ */ jsxDEV(TableCell, {
121
+ className: "font-mono text-xs",
122
+ children: session.userId
123
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
124
+ className: "text-muted-foreground tabular-nums",
125
+ children: formatTimestamp(session.expiresAt)
126
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
127
+ children: session.ipAddress ?? ""
128
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
129
+ className: "max-w-40 truncate",
130
+ children: session.userAgent ?? ""
131
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
132
+ className: "font-mono text-xs",
133
+ children: session.impersonatedBy ?? ""
134
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
135
+ children: /* @__PURE__ */ jsxDEV(Button, {
136
+ "data-testid": `auth-session-revoke-${session.id}`,
137
+ onClick: () => {
138
+ onRevoke(session.id);
139
+ },
140
+ size: "xs",
141
+ type: "button",
142
+ variant: "ghost",
143
+ children: t("Revoke")
144
+ }, void 0, false)
145
+ }, void 0, false)]
146
+ }, session.id, true))
147
+ }, void 0, false)]
148
+ }, void 0, true)
149
+ }, void 0, false)
150
+ }, void 0, false);
151
+ $[13] = onRevoke;
152
+ $[14] = sessions;
153
+ $[15] = t;
154
+ $[16] = t6;
155
+ } else {
156
+ t6 = $[16];
157
+ }
158
+ let t7;
159
+ if ($[17] !== t4 || $[18] !== t5 || $[19] !== t6) {
160
+ t7 = /* @__PURE__ */ jsxDEV("div", {
161
+ className: "flex flex-col gap-4",
162
+ "data-testid": "auth-sessions",
163
+ children: [t4, t5, t6]
164
+ }, void 0, true);
165
+ $[17] = t4;
166
+ $[18] = t5;
167
+ $[19] = t6;
168
+ $[20] = t7;
169
+ } else {
170
+ t7 = $[20];
171
+ }
172
+ return t7;
173
+ };
174
+
175
+ export { AuthSessionsPanel };
@@ -0,0 +1,261 @@
1
+ import { c } from 'react/compiler-runtime';
2
+ import 'react';
3
+ import { L as LiveError } from '../packem_shared/live-status-FZ0psC1z.js';
4
+ import { B as Badge } from '../packem_shared/badge-B2PKA1-5.js';
5
+ import { C as Card, a as CardContent } from '../packem_shared/card-DURq3ElK.js';
6
+ import { E as EmptyState } from '../packem_shared/empty-state-DY_oe0k6.js';
7
+ import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from '../packem_shared/table-DsCa9Qp9.js';
8
+ import { u as useAdminQuery } from '../packem_shared/use-admin-query-BGJ010yZ.js';
9
+ import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
10
+ import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-DNeyYtUN.js';
11
+ import { jsxDEV } from 'react/jsx-dev-runtime';
12
+
13
+ const CONTAINER_LOG_PREFIX = "container:";
14
+ const EVENT_STATE = {
15
+ error: "error",
16
+ sleep: "sleeping",
17
+ start: "running",
18
+ stop: "stopped"
19
+ };
20
+ const parseContainerMessage = (message) => {
21
+ const separator = message.indexOf(":");
22
+ if (separator === -1) {
23
+ return {
24
+ event: message.trim()
25
+ };
26
+ }
27
+ const detail = message.slice(separator + 1).trim();
28
+ const event = message.slice(0, separator).trim();
29
+ return detail === "" ? {
30
+ event
31
+ } : {
32
+ detail,
33
+ event
34
+ };
35
+ };
36
+ const foldContainerInstances = (entries) => {
37
+ const latest = /* @__PURE__ */ new Map();
38
+ for (const entry of entries) {
39
+ const path = entry.functionPath ?? "";
40
+ if (!path.startsWith(CONTAINER_LOG_PREFIX)) {
41
+ continue;
42
+ }
43
+ const name = path.slice(CONTAINER_LOG_PREFIX.length);
44
+ if (name === "") {
45
+ continue;
46
+ }
47
+ const key = JSON.stringify([name, entry.instance ?? ""]);
48
+ const previous = latest.get(key);
49
+ if (previous !== void 0 && previous.timestamp >= entry.timestamp) {
50
+ continue;
51
+ }
52
+ const {
53
+ detail,
54
+ event
55
+ } = parseContainerMessage(entry.message);
56
+ latest.set(key, {
57
+ detail,
58
+ event,
59
+ exitCode: entry.exitCode,
60
+ instance: entry.instance,
61
+ level: entry.level,
62
+ name,
63
+ state: EVENT_STATE[event] ?? "unknown",
64
+ timestamp: entry.timestamp
65
+ });
66
+ }
67
+ return [...latest.values()].toSorted((a, b) => a.name.localeCompare(b.name) || (a.instance ?? "").localeCompare(b.instance ?? ""));
68
+ };
69
+
70
+ const STATE_VARIANT = {
71
+ error: "destructive",
72
+ running: "success",
73
+ sleeping: "info",
74
+ stopped: "outline",
75
+ unknown: "secondary"
76
+ };
77
+ const entriesOf = (result) => {
78
+ const {
79
+ entries
80
+ } = result ?? {};
81
+ return Array.isArray(entries) ? entries : [];
82
+ };
83
+ const ContainersPanel = () => {
84
+ const $ = c(23);
85
+ const t = useT();
86
+ let t0;
87
+ let t1;
88
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
89
+ t0 = {};
90
+ t1 = {
91
+ live: true,
92
+ shardKey: ""
93
+ };
94
+ $[0] = t0;
95
+ $[1] = t1;
96
+ } else {
97
+ t0 = $[0];
98
+ t1 = $[1];
99
+ }
100
+ const {
101
+ data,
102
+ error,
103
+ liveError
104
+ } = useAdminQuery(ADMIN_FUNCTIONS.getLogs, t0, t1);
105
+ const loaded = data !== void 0;
106
+ let t2;
107
+ if ($[2] !== data) {
108
+ t2 = foldContainerInstances(entriesOf(data));
109
+ $[2] = data;
110
+ $[3] = t2;
111
+ } else {
112
+ t2 = $[3];
113
+ }
114
+ const rows = t2;
115
+ let t3;
116
+ if ($[4] !== error) {
117
+ t3 = error !== null && /* @__PURE__ */ jsxDEV("p", {
118
+ className: "text-sm text-destructive",
119
+ "data-testid": "containers-error",
120
+ role: "alert",
121
+ children: error
122
+ }, void 0, false);
123
+ $[4] = error;
124
+ $[5] = t3;
125
+ } else {
126
+ t3 = $[5];
127
+ }
128
+ let t4;
129
+ if ($[6] !== t) {
130
+ t4 = t("Cloudflare Containers are observed from their lifecycle log stream. This shows the current state per instance — ports and health checks aren't carried in that stream.");
131
+ $[6] = t;
132
+ $[7] = t4;
133
+ } else {
134
+ t4 = $[7];
135
+ }
136
+ let t5;
137
+ if ($[8] !== t4) {
138
+ t5 = /* @__PURE__ */ jsxDEV("p", {
139
+ className: "text-sm text-muted-foreground",
140
+ children: t4
141
+ }, void 0, false);
142
+ $[8] = t4;
143
+ $[9] = t5;
144
+ } else {
145
+ t5 = $[9];
146
+ }
147
+ let t6;
148
+ if ($[10] !== liveError) {
149
+ t6 = /* @__PURE__ */ jsxDEV(LiveError, {
150
+ message: liveError,
151
+ prefix: "containers"
152
+ }, void 0, false);
153
+ $[10] = liveError;
154
+ $[11] = t6;
155
+ } else {
156
+ t6 = $[11];
157
+ }
158
+ let t7;
159
+ if ($[12] !== t5 || $[13] !== t6) {
160
+ t7 = /* @__PURE__ */ jsxDEV("div", {
161
+ className: "flex flex-wrap items-center gap-2",
162
+ children: [t5, t6]
163
+ }, void 0, true);
164
+ $[12] = t5;
165
+ $[13] = t6;
166
+ $[14] = t7;
167
+ } else {
168
+ t7 = $[14];
169
+ }
170
+ let t8;
171
+ if ($[15] !== loaded || $[16] !== rows || $[17] !== t) {
172
+ t8 = loaded && rows.length === 0 ? /* @__PURE__ */ jsxDEV(EmptyState, {
173
+ description: t("No container lifecycle activity yet. Instances declared with defineContainer show up here once they start, sleep, stop, or error."),
174
+ testId: "containers-empty",
175
+ title: t("No container activity")
176
+ }, void 0, false) : /* @__PURE__ */ jsxDEV(Card, {
177
+ className: "overflow-hidden py-0",
178
+ children: /* @__PURE__ */ jsxDEV(CardContent, {
179
+ className: "px-0",
180
+ children: /* @__PURE__ */ jsxDEV(Table, {
181
+ "data-testid": "containers-table",
182
+ children: [/* @__PURE__ */ jsxDEV(TableHeader, {
183
+ children: /* @__PURE__ */ jsxDEV(TableRow, {
184
+ children: [/* @__PURE__ */ jsxDEV(TableHead, {
185
+ children: t("Container")
186
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
187
+ children: t("Instance")
188
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
189
+ children: t("State")
190
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
191
+ children: t("Last event")
192
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
193
+ children: t("Detail")
194
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
195
+ children: t("Exit")
196
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
197
+ children: t("When")
198
+ }, void 0, false)]
199
+ }, void 0, true)
200
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
201
+ children: rows.map(_temp)
202
+ }, void 0, false)]
203
+ }, void 0, true)
204
+ }, void 0, false)
205
+ }, void 0, false);
206
+ $[15] = loaded;
207
+ $[16] = rows;
208
+ $[17] = t;
209
+ $[18] = t8;
210
+ } else {
211
+ t8 = $[18];
212
+ }
213
+ let t9;
214
+ if ($[19] !== t3 || $[20] !== t7 || $[21] !== t8) {
215
+ t9 = /* @__PURE__ */ jsxDEV("div", {
216
+ className: "flex flex-col gap-6",
217
+ "data-testid": "lunora-containers-panel",
218
+ children: [t3, t7, t8]
219
+ }, void 0, true);
220
+ $[19] = t3;
221
+ $[20] = t7;
222
+ $[21] = t8;
223
+ $[22] = t9;
224
+ } else {
225
+ t9 = $[22];
226
+ }
227
+ return t9;
228
+ };
229
+ function _temp(row) {
230
+ return /* @__PURE__ */ jsxDEV(TableRow, {
231
+ "data-testid": `containers-row-${row.name}${row.instance === void 0 ? "" : `-${row.instance}`}`,
232
+ children: [/* @__PURE__ */ jsxDEV(TableCell, {
233
+ className: "font-mono text-xs",
234
+ children: row.name
235
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
236
+ className: "max-w-40 truncate font-mono text-xs text-muted-foreground",
237
+ title: row.instance,
238
+ children: row.instance ?? "—"
239
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
240
+ children: /* @__PURE__ */ jsxDEV(Badge, {
241
+ variant: STATE_VARIANT[row.state],
242
+ children: row.state
243
+ }, void 0, false)
244
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
245
+ className: "font-mono text-xs text-muted-foreground",
246
+ children: row.event
247
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
248
+ className: "max-w-64 truncate text-xs text-muted-foreground",
249
+ title: row.detail,
250
+ children: row.detail ?? "—"
251
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
252
+ className: "font-mono text-xs tabular-nums text-muted-foreground",
253
+ children: row.exitCode ?? "—"
254
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
255
+ className: "text-xs tabular-nums text-muted-foreground",
256
+ children: new Date(row.timestamp).toLocaleString()
257
+ }, void 0, false)]
258
+ }, `${row.name}/${row.instance ?? ""}`, true);
259
+ }
260
+
261
+ export { ContainersPanel };