@lunora/studio 1.0.0-alpha.4 → 1.0.0-alpha.41

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 (187) hide show
  1. package/LICENSE.md +6 -0
  2. package/__assets__/package-og.svg +1 -1
  3. package/dist/index.d.ts +33 -18
  4. package/dist/index.js +29 -29
  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} +15 -15
  11. package/dist/{packem_shared/FunctionRunner--fQJRPAD.js → packem_chunks/FunctionRunner.js} +10 -10
  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} +158 -387
  24. package/dist/{packem_shared/TableEditor-ChfUOZec.js → packem_chunks/TableEditor.js} +10 -68
  25. package/dist/packem_chunks/analytics-panel.js +261 -0
  26. package/dist/packem_chunks/auth-config-panel.js +365 -0
  27. package/dist/packem_chunks/auth-sessions-panel.js +175 -0
  28. package/dist/packem_chunks/containers-panel.js +247 -0
  29. package/dist/packem_chunks/dashboards-panel.js +780 -0
  30. package/dist/packem_chunks/fanout-panel.js +482 -0
  31. package/dist/packem_chunks/flags-panel.js +176 -0
  32. package/dist/packem_chunks/kv-browser.js +1896 -0
  33. package/dist/packem_chunks/log-drains-panel.js +273 -0
  34. package/dist/packem_chunks/organizations-panel.js +3178 -0
  35. package/dist/packem_chunks/payments-panel.js +186 -0
  36. package/dist/packem_chunks/permissions-panel.js +805 -0
  37. package/dist/packem_chunks/queues-panel.js +1075 -0
  38. package/dist/packem_chunks/rls-panel.js +315 -0
  39. package/dist/packem_chunks/schedule-panel.js +831 -0
  40. package/dist/packem_chunks/sparkline.js +79 -0
  41. package/dist/packem_chunks/storage-rules-panel.js +140 -0
  42. package/dist/packem_chunks/subscriptions-panel.js +238 -0
  43. package/dist/packem_chunks/users-panel.js +1731 -0
  44. package/dist/packem_chunks/vector-browser.js +281 -0
  45. package/dist/packem_chunks/workflows-panel.js +562 -0
  46. package/dist/packem_shared/{ADMIN_FUNCTIONS-DmBqMZ-z.js → ADMIN_FUNCTIONS-BHHJi3Gb.js} +7 -0
  47. package/dist/packem_shared/{ApiDocsPanel-C5-yJ1p7.js → ApiDocsPanel-CBma-lnp.js} +2 -2
  48. package/dist/packem_shared/{ApiReferencePanel-1vubqG5s.js → ApiReferencePanel-CQM3pPN7.js} +2 -1
  49. package/dist/packem_shared/{CommandPalette-BtgkBzZI.js → CommandPalette-X2tkbyHk.js} +1 -1
  50. package/dist/packem_shared/{DataBrowser-CtBe1So9.js → DataBrowser-D2ywrdId.js} +198 -247
  51. package/dist/packem_shared/{GlobalDataBrowser-BTEmGrph.js → GlobalDataBrowser-BkTPLzAY.js} +37 -66
  52. package/dist/packem_shared/HomePanel-D1Q9LZgK.js +14 -0
  53. package/dist/packem_shared/{OpenRpcReferencePanel-vbcYbv3V.js → OpenRpcReferencePanel-Dno-hfDb.js} +2 -1
  54. package/dist/packem_shared/{ScheduledJobs-CabfKbyM.js → ScheduledJobs-Ctw4jYtU.js} +163 -60
  55. package/dist/packem_shared/Studio-lJhzDAze.js +16 -0
  56. package/dist/packem_shared/{StudioApp-CHOZA-z-.js → StudioApp-DiMkupvZ.js} +276 -11
  57. package/dist/packem_shared/{advisor-view-CGcfMiPq.js → advisor-view-BX8OhG0w.js} +6 -6
  58. package/dist/packem_shared/alert-CdAET2K_.js +68 -0
  59. package/dist/packem_shared/{app.d-CCmwDEVs.d.ts → app.d-CNLRTrWw.d.ts} +1 -1
  60. package/dist/packem_shared/{bar-chart-CzJAgqkp.js → bar-chart-DSwcWIRy.js} +5 -4
  61. package/dist/packem_shared/browser-storage-BTrX4y3B.js +215 -0
  62. package/dist/packem_shared/{cf-links-2cktDedA.js → cf-links-BZfRdxSE.js} +1 -1
  63. package/dist/packem_shared/{data-grid-B5CaV3wS.js → data-grid-CdXztApG.js} +1 -1
  64. package/dist/packem_shared/data-view-params-Cd6yRVbv.js +96 -0
  65. package/dist/packem_shared/error-alert-CXjqyGw9.js +114 -0
  66. package/dist/packem_shared/{grid-features-CzUfqgsM.js → grid-features-BF-KBDFz.js} +131 -163
  67. package/dist/packem_shared/home-panel-TFcRf9Ui.js +1889 -0
  68. package/dist/packem_shared/{internal-rXJEAhXS.js → internal-CYcbqMjX.js} +44 -3
  69. package/dist/packem_shared/modal-shell-hyaJvIJ6.js +100 -0
  70. package/dist/packem_shared/{reference-view-B4E49Lip.js → reference-view-DUiJcILV.js} +6 -45
  71. package/dist/packem_shared/scroll-area-DLhcy-ml.js +93 -0
  72. package/dist/packem_shared/select-UkNYCT3s.js +273 -0
  73. package/dist/packem_shared/skeleton-CGhL0p20.js +45 -0
  74. package/dist/packem_shared/{sparkline-10dG-_f0.js → sparkline-BnA1kC9X.js} +1 -1
  75. package/dist/packem_shared/studio-Dh9UlaF_.js +4015 -0
  76. package/dist/packem_shared/{table-_RzNvy3R.js → table-DsCa9Qp9.js} +1 -1
  77. package/dist/packem_shared/{table-list-sidebar-Bg7uzbvC.js → table-list-sidebar-UVIXQJdU.js} +1 -1
  78. package/dist/packem_shared/use-admin-query-CfHYWx5n.js +106 -0
  79. package/dist/packem_shared/use-async-submit-DJQiPc-_.js +91 -0
  80. package/dist/standalone/chunk-25AYY4H7.js +2 -0
  81. package/dist/standalone/chunk-2ANAF4ZM.js +1 -0
  82. package/dist/standalone/chunk-2K47A3P6.js +1 -0
  83. package/dist/standalone/chunk-2NGUNNGW.js +1 -0
  84. package/dist/standalone/chunk-3CJW6NWG.js +4 -0
  85. package/dist/standalone/chunk-3OA7PECS.js +6 -0
  86. package/dist/standalone/chunk-3OIHOXVV.js +1 -0
  87. package/dist/standalone/chunk-447TAUFD.js +1 -0
  88. package/dist/standalone/chunk-4QHKBC77.js +1 -0
  89. package/dist/standalone/chunk-5C4TSNE6.js +1 -0
  90. package/dist/standalone/chunk-5OIBXYZM.js +1 -0
  91. package/dist/standalone/chunk-6HSHEMZV.js +76 -0
  92. package/dist/standalone/chunk-6JIZ34MB.js +3 -0
  93. package/dist/standalone/chunk-6VO23MMW.js +4 -0
  94. package/dist/standalone/chunk-7MVSQS7B.js +1 -0
  95. package/dist/standalone/chunk-7TJJXVSE.js +1 -0
  96. package/dist/standalone/chunk-7YXOPTWI.js +1 -0
  97. package/dist/standalone/chunk-AHILM3ZP.js +1 -0
  98. package/dist/standalone/chunk-BGXOXASQ.js +1 -0
  99. package/dist/standalone/chunk-BJGBHGK3.js +1 -0
  100. package/dist/standalone/chunk-BOXSWNXZ.js +1 -0
  101. package/dist/standalone/chunk-BX5MKYOC.js +1 -0
  102. package/dist/standalone/chunk-CKSHCYGC.js +2 -0
  103. package/dist/standalone/chunk-DWDILV2E.js +1 -0
  104. package/dist/standalone/chunk-E75ANNWX.js +19 -0
  105. package/dist/standalone/chunk-EQZQOTJY.js +1 -0
  106. package/dist/standalone/chunk-GTLEWM5Y.js +1 -0
  107. package/dist/standalone/chunk-GTM65MVX.js +1 -0
  108. package/dist/standalone/chunk-GUI5GFFI.js +1 -0
  109. package/dist/standalone/chunk-HN6KJXYQ.js +1 -0
  110. package/dist/standalone/chunk-HV7G6DFP.js +5 -0
  111. package/dist/standalone/chunk-HYDJNCGW.js +1 -0
  112. package/dist/standalone/chunk-HZK5RQHG.js +1 -0
  113. package/dist/standalone/chunk-IN2SYVJB.js +1 -0
  114. package/dist/standalone/chunk-IOANPSJN.js +1 -0
  115. package/dist/standalone/chunk-ISDZPW3V.js +1 -0
  116. package/dist/standalone/chunk-IXDH4GL5.js +1 -0
  117. package/dist/standalone/chunk-J6J54MBP.js +1 -0
  118. package/dist/standalone/chunk-J73VHFCL.js +1 -0
  119. package/dist/standalone/chunk-JHKMUTIF.js +13 -0
  120. package/dist/standalone/chunk-JPRH6DPK.js +1 -0
  121. package/dist/standalone/chunk-JSEXCW5Q.js +1 -0
  122. package/dist/standalone/chunk-KA5YB3VP.js +1 -0
  123. package/dist/standalone/chunk-KBB75WNT.js +1 -0
  124. package/dist/standalone/chunk-KEGAWN6Y.js +1 -0
  125. package/dist/standalone/chunk-KJJ3WM6H.js +4 -0
  126. package/dist/standalone/chunk-KQV4NGH3.js +1 -0
  127. package/dist/standalone/chunk-KSKXW5PX.js +1 -0
  128. package/dist/standalone/chunk-KUH4P5F5.js +1 -0
  129. package/dist/standalone/chunk-KYJPPVGB.js +1 -0
  130. package/dist/standalone/chunk-KZ6INM5M.js +1 -0
  131. package/dist/standalone/chunk-L2TJVSDQ.js +1 -0
  132. package/dist/standalone/chunk-L7SK4ZZD.js +1 -0
  133. package/dist/standalone/chunk-LAK5VSPI.js +1 -0
  134. package/dist/standalone/chunk-LBN7LPVK.js +1 -0
  135. package/dist/standalone/chunk-LNZIB2MD.js +1 -0
  136. package/dist/standalone/chunk-MJWVMKQ4.js +6 -0
  137. package/dist/standalone/chunk-MLZYX5CQ.js +1 -0
  138. package/dist/standalone/chunk-N2X2OO4V.js +1 -0
  139. package/dist/standalone/chunk-NGKITPQP.js +13 -0
  140. package/dist/standalone/chunk-O3NAGRTR.js +1 -0
  141. package/dist/standalone/chunk-OZACQNKG.js +1 -0
  142. package/dist/standalone/chunk-PNDNXS5Z.js +1 -0
  143. package/dist/standalone/chunk-Q7DMUTUE.js +1 -0
  144. package/dist/standalone/chunk-QAFAJBAW.js +1 -0
  145. package/dist/standalone/chunk-QBAT52GB.js +1 -0
  146. package/dist/standalone/chunk-RHZ4M2NZ.js +1 -0
  147. package/dist/standalone/chunk-RRCPZMC2.js +22 -0
  148. package/dist/standalone/chunk-SEU5V7I6.js +1 -0
  149. package/dist/standalone/chunk-TAD43CG5.js +1 -0
  150. package/dist/standalone/chunk-TBMYIZIO.js +1 -0
  151. package/dist/standalone/chunk-TDZ44E5I.js +4 -0
  152. package/dist/standalone/chunk-THNBTMUF.js +1 -0
  153. package/dist/standalone/chunk-TIQISBGK.js +1 -0
  154. package/dist/standalone/chunk-TMYVNQ66.js +1 -0
  155. package/dist/standalone/chunk-TQ36RWOP.js +1 -0
  156. package/dist/standalone/chunk-UGUEC6BC.js +1 -0
  157. package/dist/standalone/chunk-UJB2LEI4.js +4 -0
  158. package/dist/standalone/chunk-UK64ZSUW.js +1 -0
  159. package/dist/standalone/chunk-UKDJ4H7I.js +1 -0
  160. package/dist/standalone/chunk-VLXV72QE.js +1 -0
  161. package/dist/standalone/chunk-VON7JUPG.js +1 -0
  162. package/dist/standalone/chunk-W3JK4YWR.js +1 -0
  163. package/dist/standalone/chunk-W3SHEIAL.js +3 -0
  164. package/dist/standalone/chunk-WI7GWFEG.js +1 -0
  165. package/dist/standalone/chunk-WIHXMNUY.js +1 -0
  166. package/dist/standalone/chunk-WLDVXVI2.js +1 -0
  167. package/dist/standalone/chunk-XLXNLJ4N.js +1 -0
  168. package/dist/standalone/chunk-XNJNSCLM.js +1 -0
  169. package/dist/standalone/chunk-YAECF5LW.js +1 -0
  170. package/dist/standalone/chunk-YBGC4PPD.js +1 -0
  171. package/dist/standalone/chunk-YJAPWSDC.js +4 -0
  172. package/dist/standalone/chunk-ZEJB6DXU.js +8 -0
  173. package/dist/standalone/chunk-ZFNBPAIZ.js +1 -0
  174. package/dist/standalone/chunk-ZHVTQ37P.js +1 -0
  175. package/dist/standalone/chunk-ZIGWVHCS.js +1 -0
  176. package/dist/standalone/chunk-ZPP2KOR4.js +1 -0
  177. package/dist/standalone/chunk-ZPUO7FNI.js +1 -0
  178. package/dist/standalone/studio.js +104 -246
  179. package/dist/styles.css +2 -2
  180. package/package.json +15 -13
  181. package/dist/packem_shared/HomePanel-Cw16stjq.js +0 -1273
  182. package/dist/packem_shared/SettingsPanel-C0uLRf5P.js +0 -176
  183. package/dist/packem_shared/SqlEditorPanel-CguV7otm.js +0 -13
  184. package/dist/packem_shared/Studio-DFWAlcuf.js +0 -33
  185. package/dist/packem_shared/studio-Bj8psK1c.js +0 -10303
  186. package/dist/packem_shared/use-live-admin-Dq6g3daN.js +0 -73
  187. package/dist/packem_shared/use-live-shard-seed-Cuk3dnH0.js +0 -76
@@ -1,15 +1,15 @@
1
1
  import { useLunora } from '@lunora/react';
2
2
  import { useState, useEffect } from 'react';
3
- import { ShardInput } from './ShardInput-gx_DZXXn.js';
4
- import { B as Badge } from './badge-B2PKA1-5.js';
5
- import { B as Button } from './button-BhsN2uZH.js';
6
- import { I as Input } from './input-XH4r1Pt1.js';
7
- import { L as Label } from './label-D8ykjn5J.js';
8
- import { T as Textarea } from './textarea-D3gaCU_-.js';
9
- import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
10
- import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-DmBqMZ-z.js';
11
- import { e as errorMessage, b as formatTimestamp, f as fireAndForget, a as adminRef } from './internal-rXJEAhXS.js';
12
- import { r as recordShard } from './shard-history-DyebH1R5.js';
3
+ import { ShardInput } from '../packem_shared/ShardInput-gx_DZXXn.js';
4
+ import { B as Badge } from '../packem_shared/badge-B2PKA1-5.js';
5
+ import { B as Button } from '../packem_shared/button-BhsN2uZH.js';
6
+ import { I as Input } from '../packem_shared/input-XH4r1Pt1.js';
7
+ import { L as Label } from '../packem_shared/label-D8ykjn5J.js';
8
+ import { T as Textarea } from '../packem_shared/textarea-D3gaCU_-.js';
9
+ import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
10
+ import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-BHHJi3Gb.js';
11
+ import { e as errorMessage, i as formatTimestamp, f as fireAndForget, a as adminRef } from '../packem_shared/internal-CYcbqMjX.js';
12
+ import { r as recordShard } from '../packem_shared/shard-history-DyebH1R5.js';
13
13
  import { jsxDEV } from 'react/jsx-dev-runtime';
14
14
 
15
15
  const argumentType = (argument) => {
@@ -1,22 +1,21 @@
1
1
  import { c } from 'react/compiler-runtime';
2
- import { useLunora } from '@lunora/react';
3
- import { useState, useRef, useEffect } from 'react';
4
- import { L as LiveError } from './live-status-FZ0psC1z.js';
5
- import { ShardInput } from './ShardInput-gx_DZXXn.js';
6
- import { B as Badge } from './badge-B2PKA1-5.js';
7
- import { B as Button } from './button-BhsN2uZH.js';
8
- import { C as Card, a as CardContent } from './card-DURq3ElK.js';
9
- import { E as EmptyState } from './empty-state-DY_oe0k6.js';
10
- import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from './table-_RzNvy3R.js';
11
- import { u as useLiveAdmin } from './use-live-admin-Dq6g3daN.js';
12
- import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
13
- import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-DmBqMZ-z.js';
14
- import { b as formatTimestamp, c as callOptions, e as errorMessage, a as adminRef } from './internal-rXJEAhXS.js';
15
- import { c as cn } from './utils-B05Dmz_H.js';
16
- import { u as useLiveShardSeed } from './use-live-shard-seed-Cuk3dnH0.js';
2
+ import { useState } from 'react';
3
+ import { E as ErrorAlert } from '../packem_shared/error-alert-CXjqyGw9.js';
4
+ import { L as LiveError } from '../packem_shared/live-status-FZ0psC1z.js';
5
+ import { ShardInput } from '../packem_shared/ShardInput-gx_DZXXn.js';
6
+ import { B as Badge } from '../packem_shared/badge-B2PKA1-5.js';
7
+ import { B as Button } from '../packem_shared/button-BhsN2uZH.js';
8
+ import { C as Card, a as CardContent } from '../packem_shared/card-DURq3ElK.js';
9
+ import { E as EmptyState } from '../packem_shared/empty-state-DY_oe0k6.js';
10
+ 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';
11
+ import { u as useAdminQuery } from '../packem_shared/use-admin-query-CfHYWx5n.js';
12
+ import useDebounced from '../packem_shared/useDebounced-Dxncpg6z.js';
13
+ import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
14
+ import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-BHHJi3Gb.js';
15
+ import { i as formatTimestamp } from '../packem_shared/internal-CYcbqMjX.js';
16
+ import { c as cn } from '../packem_shared/utils-B05Dmz_H.js';
17
17
  import { jsxDEV } from 'react/jsx-dev-runtime';
18
18
 
19
- const GET_FUNCTION_STATS = adminRef(ADMIN_FUNCTIONS.getFunctionStats);
20
19
  const KIND_VARIANT = {
21
20
  action: "outline",
22
21
  mutation: "default",
@@ -53,218 +52,164 @@ const SORTERS = {
53
52
  slowest: (a, b) => b.maxDurationMs - a.maxDurationMs
54
53
  };
55
54
  const FunctionStatsPanel = (t0) => {
56
- const $ = c(48);
55
+ const $ = c(47);
57
56
  const {
58
57
  functions,
59
58
  initialShardKey
60
59
  } = t0;
61
- const client = useLunora();
62
60
  const t = useT();
63
61
  const [shardKey, setShardKey] = useState(initialShardKey ?? "");
64
- const [stats, setStats] = useState(null);
65
- const [error, setError] = useState(null);
66
62
  const [sortKey, setSortKey] = useState("recent");
67
- const [liveError, setLiveError] = useState(void 0);
68
- const mountedRef = useRef(true);
69
63
  let t1;
64
+ if ($[0] !== shardKey) {
65
+ t1 = shardKey.trim();
66
+ $[0] = shardKey;
67
+ $[1] = t1;
68
+ } else {
69
+ t1 = $[1];
70
+ }
71
+ const debouncedShard = useDebounced(t1, 400);
70
72
  let t2;
71
- if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
72
- t1 = () => {
73
- mountedRef.current = true;
74
- return () => {
75
- mountedRef.current = false;
76
- };
77
- };
78
- t2 = [];
79
- $[0] = t1;
80
- $[1] = t2;
73
+ if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
74
+ t2 = {};
75
+ $[2] = t2;
81
76
  } else {
82
- t1 = $[0];
83
- t2 = $[1];
77
+ t2 = $[2];
84
78
  }
85
- useEffect(t1, t2);
86
79
  let t3;
87
- if ($[2] !== functions) {
88
- t3 = new Map((functions ?? []).map(_temp));
89
- $[2] = functions;
90
- $[3] = t3;
80
+ if ($[3] !== debouncedShard) {
81
+ t3 = {
82
+ live: true,
83
+ shardKey: debouncedShard
84
+ };
85
+ $[3] = debouncedShard;
86
+ $[4] = t3;
91
87
  } else {
92
- t3 = $[3];
88
+ t3 = $[4];
93
89
  }
94
- const kindByPath = t3;
90
+ const {
91
+ data,
92
+ error,
93
+ errorSource,
94
+ liveError
95
+ } = useAdminQuery(ADMIN_FUNCTIONS.getFunctionStats, t2, t3);
96
+ const stats = data?.functions ?? null;
95
97
  let t4;
96
- if ($[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
97
- t4 = (result) => {
98
- setError(null);
99
- setLiveError(void 0);
100
- setStats(result.functions);
101
- };
102
- $[4] = t4;
98
+ if ($[5] !== functions) {
99
+ t4 = new Map((functions ?? []).map(_temp));
100
+ $[5] = functions;
101
+ $[6] = t4;
103
102
  } else {
104
- t4 = $[4];
103
+ t4 = $[6];
105
104
  }
106
- const applyResult = t4;
105
+ const kindByPath = t4;
107
106
  let t5;
108
- if ($[5] !== client) {
109
- t5 = async (shard) => {
110
- try {
111
- const next = await client.query(GET_FUNCTION_STATS, {}, callOptions(shard));
112
- if (mountedRef.current) {
113
- applyResult(next);
114
- }
115
- } catch (t62) {
116
- const error_ = t62;
117
- if (mountedRef.current) {
118
- setStats(null);
119
- setError(errorMessage(error_));
120
- }
121
- throw error_;
122
- }
123
- };
124
- $[5] = client;
125
- $[6] = t5;
126
- } else {
127
- t5 = $[6];
128
- }
129
- const refresh = t5;
130
- const committedShard = useLiveShardSeed(shardKey, refresh);
131
- let t6;
132
107
  if ($[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
133
- t6 = {};
134
- $[7] = t6;
135
- } else {
136
- t6 = $[7];
137
- }
138
- let t7;
139
- if ($[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
140
- t7 = (next_0) => {
141
- if (mountedRef.current) {
142
- applyResult(next_0);
143
- }
144
- };
145
- $[8] = t7;
146
- } else {
147
- t7 = $[8];
148
- }
149
- let t8;
150
- if ($[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
151
- t8 = (message) => {
152
- if (mountedRef.current) {
153
- setLiveError(message);
154
- }
155
- };
156
- $[9] = t8;
157
- } else {
158
- t8 = $[9];
159
- }
160
- useLiveAdmin(ADMIN_FUNCTIONS.getFunctionStats, t6, committedShard ?? "", t7, committedShard !== void 0, t8);
161
- let t9;
162
- if ($[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
163
- t9 = (event) => {
108
+ t5 = (event) => {
164
109
  setSortKey(event.currentTarget.dataset.sort);
165
110
  };
166
- $[10] = t9;
111
+ $[7] = t5;
167
112
  } else {
168
- t9 = $[10];
113
+ t5 = $[7];
169
114
  }
170
- const selectSort = t9;
171
- let t10;
172
- if ($[11] !== error || $[12] !== kindByPath || $[13] !== liveError || $[14] !== shardKey || $[15] !== sortKey || $[16] !== stats || $[17] !== t) {
115
+ const selectSort = t5;
116
+ let t6;
117
+ if ($[8] !== error || $[9] !== errorSource || $[10] !== kindByPath || $[11] !== liveError || $[12] !== shardKey || $[13] !== sortKey || $[14] !== stats || $[15] !== t) {
173
118
  const sorted = stats === null ? [] : stats.toSorted(SORTERS[sortKey]);
174
- let t11;
175
- if ($[19] !== t) {
176
- t11 = t("Recent");
177
- $[19] = t;
178
- $[20] = t11;
119
+ let t7;
120
+ if ($[17] !== t) {
121
+ t7 = t("Recent");
122
+ $[17] = t;
123
+ $[18] = t7;
179
124
  } else {
180
- t11 = $[20];
125
+ t7 = $[18];
181
126
  }
182
- let t12;
183
- if ($[21] !== t11) {
184
- t12 = {
127
+ let t8;
128
+ if ($[19] !== t7) {
129
+ t8 = {
185
130
  key: "recent",
186
- label: t11
131
+ label: t7
187
132
  };
188
- $[21] = t11;
189
- $[22] = t12;
133
+ $[19] = t7;
134
+ $[20] = t8;
190
135
  } else {
191
- t12 = $[22];
136
+ t8 = $[20];
192
137
  }
193
- let t13;
194
- if ($[23] !== t) {
195
- t13 = t("Most called");
196
- $[23] = t;
197
- $[24] = t13;
138
+ let t9;
139
+ if ($[21] !== t) {
140
+ t9 = t("Most called");
141
+ $[21] = t;
142
+ $[22] = t9;
198
143
  } else {
199
- t13 = $[24];
144
+ t9 = $[22];
200
145
  }
201
- let t14;
202
- if ($[25] !== t13) {
203
- t14 = {
146
+ let t10;
147
+ if ($[23] !== t9) {
148
+ t10 = {
204
149
  key: "calls",
205
- label: t13
150
+ label: t9
206
151
  };
207
- $[25] = t13;
208
- $[26] = t14;
152
+ $[23] = t9;
153
+ $[24] = t10;
209
154
  } else {
210
- t14 = $[26];
155
+ t10 = $[24];
211
156
  }
212
- let t15;
213
- if ($[27] !== t) {
214
- t15 = t("Slowest");
215
- $[27] = t;
216
- $[28] = t15;
157
+ let t11;
158
+ if ($[25] !== t) {
159
+ t11 = t("Slowest");
160
+ $[25] = t;
161
+ $[26] = t11;
217
162
  } else {
218
- t15 = $[28];
163
+ t11 = $[26];
219
164
  }
220
- let t16;
221
- if ($[29] !== t15) {
222
- t16 = {
165
+ let t12;
166
+ if ($[27] !== t11) {
167
+ t12 = {
223
168
  key: "slowest",
224
- label: t15
169
+ label: t11
225
170
  };
226
- $[29] = t15;
227
- $[30] = t16;
171
+ $[27] = t11;
172
+ $[28] = t12;
228
173
  } else {
229
- t16 = $[30];
174
+ t12 = $[28];
230
175
  }
231
- let t17;
232
- if ($[31] !== t12 || $[32] !== t14 || $[33] !== t16) {
233
- t17 = [t12, t14, t16];
234
- $[31] = t12;
235
- $[32] = t14;
236
- $[33] = t16;
237
- $[34] = t17;
176
+ let t13;
177
+ if ($[29] !== t10 || $[30] !== t12 || $[31] !== t8) {
178
+ t13 = [t8, t10, t12];
179
+ $[29] = t10;
180
+ $[30] = t12;
181
+ $[31] = t8;
182
+ $[32] = t13;
238
183
  } else {
239
- t17 = $[34];
184
+ t13 = $[32];
240
185
  }
241
- const sortButtons = t17;
242
- let t18;
243
- if ($[35] !== shardKey) {
244
- t18 = /* @__PURE__ */ jsxDEV(ShardInput, {
186
+ const sortButtons = t13;
187
+ let t14;
188
+ if ($[33] !== shardKey) {
189
+ t14 = /* @__PURE__ */ jsxDEV(ShardInput, {
245
190
  onChange: setShardKey,
246
191
  testId: "fs-shard-input",
247
192
  value: shardKey
248
193
  }, void 0, false);
249
- $[35] = shardKey;
250
- $[36] = t18;
194
+ $[33] = shardKey;
195
+ $[34] = t14;
251
196
  } else {
252
- t18 = $[36];
197
+ t14 = $[34];
253
198
  }
254
- let t19;
255
- if ($[37] !== liveError) {
256
- t19 = /* @__PURE__ */ jsxDEV(LiveError, {
199
+ let t15;
200
+ if ($[35] !== liveError) {
201
+ t15 = /* @__PURE__ */ jsxDEV(LiveError, {
257
202
  message: liveError,
258
203
  prefix: "fs"
259
204
  }, void 0, false);
260
- $[37] = liveError;
261
- $[38] = t19;
205
+ $[35] = liveError;
206
+ $[36] = t15;
262
207
  } else {
263
- t19 = $[38];
208
+ t15 = $[36];
264
209
  }
265
- let t20;
266
- if ($[39] !== sortButtons || $[40] !== sortKey) {
267
- t20 = /* @__PURE__ */ jsxDEV("div", {
210
+ let t16;
211
+ if ($[37] !== sortButtons || $[38] !== sortKey) {
212
+ t16 = /* @__PURE__ */ jsxDEV("div", {
268
213
  className: "ml-auto flex items-center gap-1",
269
214
  role: "group",
270
215
  children: sortButtons.map((option) => /* @__PURE__ */ jsxDEV(Button, {
@@ -277,42 +222,41 @@ const FunctionStatsPanel = (t0) => {
277
222
  children: option.label
278
223
  }, option.key, false))
279
224
  }, void 0, false);
280
- $[39] = sortButtons;
281
- $[40] = sortKey;
282
- $[41] = t20;
225
+ $[37] = sortButtons;
226
+ $[38] = sortKey;
227
+ $[39] = t16;
283
228
  } else {
284
- t20 = $[41];
229
+ t16 = $[39];
285
230
  }
286
- let t21;
287
- if ($[42] !== t18 || $[43] !== t19 || $[44] !== t20) {
288
- t21 = /* @__PURE__ */ jsxDEV("div", {
231
+ let t17;
232
+ if ($[40] !== t14 || $[41] !== t15 || $[42] !== t16) {
233
+ t17 = /* @__PURE__ */ jsxDEV("div", {
289
234
  className: "flex flex-wrap items-center gap-2",
290
- children: [t18, t19, t20]
235
+ children: [t14, t15, t16]
291
236
  }, void 0, true);
292
- $[42] = t18;
293
- $[43] = t19;
294
- $[44] = t20;
295
- $[45] = t21;
237
+ $[40] = t14;
238
+ $[41] = t15;
239
+ $[42] = t16;
240
+ $[43] = t17;
296
241
  } else {
297
- t21 = $[45];
242
+ t17 = $[43];
298
243
  }
299
- let t22;
300
- if ($[46] !== error) {
301
- t22 = error !== null && /* @__PURE__ */ jsxDEV("p", {
302
- className: "text-sm text-destructive",
303
- "data-testid": "fs-error",
304
- role: "alert",
305
- children: error
244
+ let t18;
245
+ if ($[44] !== error || $[45] !== errorSource) {
246
+ t18 = error !== null && /* @__PURE__ */ jsxDEV(ErrorAlert, {
247
+ error: errorSource,
248
+ testId: "fs-error"
306
249
  }, void 0, false);
307
- $[46] = error;
308
- $[47] = t22;
250
+ $[44] = error;
251
+ $[45] = errorSource;
252
+ $[46] = t18;
309
253
  } else {
310
- t22 = $[47];
254
+ t18 = $[46];
311
255
  }
312
- t10 = /* @__PURE__ */ jsxDEV("div", {
256
+ t6 = /* @__PURE__ */ jsxDEV("div", {
313
257
  className: "flex flex-col gap-4",
314
258
  "data-testid": "lunora-function-stats",
315
- children: [t21, t22, stats !== null && sorted.length === 0 && error === null && /* @__PURE__ */ jsxDEV(EmptyState, {
259
+ children: [t17, t18, stats !== null && sorted.length === 0 && error === null && /* @__PURE__ */ jsxDEV(EmptyState, {
316
260
  description: t("Per-function call counts, error rates, and latency land here after your first request."),
317
261
  icon: /* @__PURE__ */ jsxDEV("svg", {
318
262
  "aria-hidden": "true",
@@ -412,18 +356,19 @@ const FunctionStatsPanel = (t0) => {
412
356
  }, void 0, false)
413
357
  }, void 0, false)]
414
358
  }, void 0, true);
415
- $[11] = error;
416
- $[12] = kindByPath;
417
- $[13] = liveError;
418
- $[14] = shardKey;
419
- $[15] = sortKey;
420
- $[16] = stats;
421
- $[17] = t;
422
- $[18] = t10;
359
+ $[8] = error;
360
+ $[9] = errorSource;
361
+ $[10] = kindByPath;
362
+ $[11] = liveError;
363
+ $[12] = shardKey;
364
+ $[13] = sortKey;
365
+ $[14] = stats;
366
+ $[15] = t;
367
+ $[16] = t6;
423
368
  } else {
424
- t10 = $[18];
369
+ t6 = $[16];
425
370
  }
426
- return t10;
371
+ return t6;
427
372
  };
428
373
  function _temp(descriptor) {
429
374
  return [descriptor.path, descriptor.kind];
@@ -1,18 +1,18 @@
1
1
  import { c } from 'react/compiler-runtime';
2
2
  import { useLunora } from '@lunora/react';
3
3
  import { useState, useRef, useEffect, useCallback, useMemo } from 'react';
4
- import ConnectionBadge from './ConnectionBadge-B2DDM2Tn.js';
5
- import { L as LiveError } from './live-status-FZ0psC1z.js';
6
- import { B as Badge } from './badge-B2PKA1-5.js';
7
- import { C as Card } from './card-DURq3ElK.js';
8
- import { u as useLiveAdmin } from './use-live-admin-Dq6g3daN.js';
9
- import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
10
- import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-DmBqMZ-z.js';
11
- import { f as fireAndForget, b as formatTimestamp, c as callOptions, e as errorMessage, a as adminRef } from './internal-rXJEAhXS.js';
12
- import { l as loadRecentShards } from './shard-history-DyebH1R5.js';
13
- import { c as cn } from './utils-B05Dmz_H.js';
14
- import { shardsToAggregate } from './aggregateMetrics-D4nUHEKU.js';
15
- import { S as Sparkline } from './sparkline-10dG-_f0.js';
4
+ import ConnectionBadge from '../packem_shared/ConnectionBadge-B2DDM2Tn.js';
5
+ import { L as LiveError } from '../packem_shared/live-status-FZ0psC1z.js';
6
+ import { B as Badge } from '../packem_shared/badge-B2PKA1-5.js';
7
+ import { C as Card } from '../packem_shared/card-DURq3ElK.js';
8
+ import { u as useAdminQuery } from '../packem_shared/use-admin-query-CfHYWx5n.js';
9
+ import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
10
+ import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-BHHJi3Gb.js';
11
+ import { f as fireAndForget, i as formatTimestamp, c as callOptions, e as errorMessage, a as adminRef } from '../packem_shared/internal-CYcbqMjX.js';
12
+ import { l as loadRecentShards } from '../packem_shared/shard-history-DyebH1R5.js';
13
+ import { c as cn } from '../packem_shared/utils-B05Dmz_H.js';
14
+ import { shardsToAggregate } from '../packem_shared/aggregateMetrics-D4nUHEKU.js';
15
+ import { S as Sparkline } from '../packem_shared/sparkline-BnA1kC9X.js';
16
16
  import { jsxDEV } from 'react/jsx-dev-runtime';
17
17
 
18
18
  const STATUS_RANK = {
@@ -333,7 +333,6 @@ const HealthPanel = ({
333
333
  const [auth, setAuth] = useState(null);
334
334
  const [scheduler, setScheduler] = useState(null);
335
335
  const [migrations, setMigrations] = useState([]);
336
- const [liveError, setLiveError] = useState(void 0);
337
336
  const [recentShards] = useState(loadRecentShards);
338
337
  const inFlightRef = useRef(false);
339
338
  const mountedRef = useRef(true);
@@ -387,10 +386,19 @@ const HealthPanel = ({
387
386
  clearTimeout(trailingTimerRef.current);
388
387
  }
389
388
  }, []);
390
- useLiveAdmin(ADMIN_FUNCTIONS.getMetrics, {}, rootShard, () => {
391
- setLiveError(void 0);
389
+ const {
390
+ data: liveMetrics,
391
+ liveError
392
+ } = useAdminQuery(ADMIN_FUNCTIONS.getMetrics, {}, {
393
+ live: true,
394
+ shardKey: rootShard
395
+ });
396
+ useEffect(() => {
397
+ if (liveMetrics === void 0) {
398
+ return;
399
+ }
392
400
  scheduleFanOut();
393
- }, true, setLiveError);
401
+ }, [liveMetrics]);
394
402
  const recentErrors = entries.filter((entry) => entry.level === "error");
395
403
  const topErrors = recentErrors.slice(0, RECENT_ERROR_LIMIT);
396
404
  const trend = requestErrorSeries(totals?.history);
@@ -398,7 +406,7 @@ const HealthPanel = ({
398
406
  const buckets = auth?.history ?? [];
399
407
  return {
400
408
  attempts: buckets.map((bucket) => bucket.attempts),
401
- failures: buckets.map((bucket_0) => bucket_0.failures)
409
+ failures: buckets.map((bucket) => bucket.failures)
402
410
  };
403
411
  }, [auth?.history]);
404
412
  const worstFunctions = functions.filter((stat) => stat.calls > 0).toSorted((a, b) => b.errors / b.calls - a.errors / a.calls || b.calls - a.calls).slice(0, TOP_FUNCTION_LIMIT);
@@ -549,25 +557,25 @@ const HealthPanel = ({
549
557
  children: t("No function activity yet.")
550
558
  }, void 0, false) : /* @__PURE__ */ jsxDEV("ul", {
551
559
  className: "divide-y divide-border",
552
- children: worstFunctions.map((stat_0) => /* @__PURE__ */ jsxDEV("li", {
560
+ children: worstFunctions.map((stat) => /* @__PURE__ */ jsxDEV("li", {
553
561
  className: "flex flex-wrap items-center justify-between gap-2 px-4 py-2 text-xs",
554
562
  "data-testid": "hl-fn-row",
555
563
  children: [/* @__PURE__ */ jsxDEV("span", {
556
564
  className: "truncate font-mono text-foreground",
557
- children: stat_0.path
565
+ children: stat.path
558
566
  }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
559
567
  className: "flex shrink-0 items-center gap-2",
560
568
  children: [/* @__PURE__ */ jsxDEV("span", {
561
569
  className: "tabular-nums text-muted-foreground",
562
570
  children: t("{count} calls", {
563
- count: stat_0.calls.toString()
571
+ count: stat.calls.toString()
564
572
  })
565
573
  }, void 0, false), /* @__PURE__ */ jsxDEV(Badge, {
566
- variant: LEVEL_VARIANT[rateLevel(stat_0.errors / stat_0.calls, REQUEST_ERROR_WARN, REQUEST_ERROR_CRIT)],
567
- children: ratePercent(stat_0.errors, stat_0.calls)
574
+ variant: LEVEL_VARIANT[rateLevel(stat.errors / stat.calls, REQUEST_ERROR_WARN, REQUEST_ERROR_CRIT)],
575
+ children: ratePercent(stat.errors, stat.calls)
568
576
  }, void 0, false)]
569
577
  }, void 0, true)]
570
- }, stat_0.path, true))
578
+ }, stat.path, true))
571
579
  }, void 0, false)]
572
580
  }, void 0, true), /* @__PURE__ */ jsxDEV(Card, {
573
581
  className: "gap-0 py-0",
@@ -592,23 +600,23 @@ const HealthPanel = ({
592
600
  children: t("No recent errors.")
593
601
  }, void 0, false), topErrors.length > 0 && /* @__PURE__ */ jsxDEV("ul", {
594
602
  className: "divide-y divide-border",
595
- children: topErrors.map((entry_0, index) => /* @__PURE__ */ jsxDEV("li", {
603
+ children: topErrors.map((entry, index) => /* @__PURE__ */ jsxDEV("li", {
596
604
  className: "flex flex-col gap-0.5 px-4 py-2 text-xs",
597
605
  "data-testid": "hl-error-row",
598
606
  children: [/* @__PURE__ */ jsxDEV("span", {
599
607
  className: "flex items-center gap-2",
600
608
  children: [/* @__PURE__ */ jsxDEV("time", {
601
609
  className: "shrink-0 text-muted-foreground",
602
- children: formatTimestamp(entry_0.timestamp)
603
- }, void 0, false), entry_0.functionPath !== void 0 && /* @__PURE__ */ jsxDEV("span", {
610
+ children: formatTimestamp(entry.timestamp)
611
+ }, void 0, false), entry.functionPath !== void 0 && /* @__PURE__ */ jsxDEV("span", {
604
612
  className: "truncate font-mono text-foreground",
605
- children: entry_0.functionPath
613
+ children: entry.functionPath
606
614
  }, void 0, false)]
607
615
  }, void 0, true), /* @__PURE__ */ jsxDEV("span", {
608
616
  className: "text-destructive",
609
- children: entry_0.message
617
+ children: entry.message
610
618
  }, void 0, false)]
611
- }, `${entry_0.timestamp.toString()}-${index.toString()}`, true))
619
+ }, `${entry.timestamp.toString()}-${index.toString()}`, true))
612
620
  }, void 0, false)]
613
621
  }, void 0, true)]
614
622
  }, void 0, true), /* @__PURE__ */ jsxDEV(Card, {