@lunora/studio 1.0.0-alpha.3 → 1.0.0-alpha.30

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 (174) hide show
  1. package/__assets__/package-og.svg +1 -1
  2. package/dist/index.d.ts +29 -18
  3. package/dist/index.js +29 -29
  4. package/dist/mount.d.ts +1 -1
  5. package/dist/mount.js +1 -1
  6. package/dist/{packem_shared/ApiTab-W3no0KOj.js → packem_chunks/ApiTab.js} +5 -5
  7. package/dist/{packem_shared/AuditPanel-Bq4o_IqT.js → packem_chunks/AuditPanel.js} +24 -36
  8. package/dist/{packem_shared/ExportImportPanel-dxY56TDF.js → packem_chunks/ExportImportPanel.js} +13 -9
  9. package/dist/{packem_shared/FileBrowser-Dhy4zES8.js → packem_chunks/FileBrowser.js} +15 -15
  10. package/dist/{packem_shared/FunctionRunner--fQJRPAD.js → packem_chunks/FunctionRunner.js} +10 -10
  11. package/dist/{packem_shared/FunctionStatsPanel-BjRUA_G3.js → packem_chunks/FunctionStatsPanel.js} +147 -204
  12. package/dist/{packem_shared/HealthPanel-PxclMWmA.js → packem_chunks/HealthPanel.js} +37 -29
  13. package/dist/{packem_shared/InsightsPanel-CWS_C-xW.js → packem_chunks/InsightsPanel.js} +107 -69
  14. package/dist/{packem_shared/LogsPanel-CTW8CFcM.js → packem_chunks/LogsPanel.js} +41 -53
  15. package/dist/{packem_shared/MailPanel-BwkvfIHF.js → packem_chunks/MailPanel.js} +37 -44
  16. package/dist/{packem_shared/MetricsPanel-BLuOhZQ4.js → packem_chunks/MetricsPanel.js} +41 -322
  17. package/dist/{packem_shared/MigrationsPanel-DT3lnwHF.js → packem_chunks/MigrationsPanel.js} +39 -46
  18. package/dist/{packem_shared/PitrPanel-CdErL7EJ.js → packem_chunks/PitrPanel.js} +9 -9
  19. package/dist/{packem_shared/SchemaViewer-LJDcmNIO.js → packem_chunks/SchemaViewer.js} +15 -15
  20. package/dist/{packem_shared/SecurityAdvisorPanel-C_ETsPih.js → packem_chunks/SecurityAdvisorPanel.js} +44 -31
  21. package/dist/packem_chunks/SettingsPanel.js +390 -0
  22. package/dist/{packem_shared/sql-editor-panel-BFRpzj6r.js → packem_chunks/SqlEditorPanel.js} +12 -252
  23. package/dist/{packem_shared/TableEditor-ChfUOZec.js → packem_chunks/TableEditor.js} +10 -68
  24. package/dist/packem_chunks/analytics-panel.js +261 -0
  25. package/dist/packem_chunks/auth-config-panel.js +179 -0
  26. package/dist/packem_chunks/auth-sessions-panel.js +175 -0
  27. package/dist/packem_chunks/dashboards-panel.js +779 -0
  28. package/dist/packem_chunks/fanout-panel.js +481 -0
  29. package/dist/packem_chunks/flags-panel.js +176 -0
  30. package/dist/packem_chunks/kv-browser.js +1896 -0
  31. package/dist/packem_chunks/log-drains-panel.js +273 -0
  32. package/dist/packem_chunks/organizations-panel.js +670 -0
  33. package/dist/packem_chunks/payments-panel.js +185 -0
  34. package/dist/packem_chunks/permissions-panel.js +804 -0
  35. package/dist/packem_chunks/queues-panel.js +147 -0
  36. package/dist/packem_chunks/rls-panel.js +313 -0
  37. package/dist/packem_chunks/schedule-panel.js +831 -0
  38. package/dist/packem_chunks/sparkline.js +79 -0
  39. package/dist/packem_chunks/storage-rules-panel.js +138 -0
  40. package/dist/packem_chunks/subscriptions-panel.js +236 -0
  41. package/dist/packem_chunks/users-panel.js +1265 -0
  42. package/dist/packem_chunks/vector-browser.js +281 -0
  43. package/dist/packem_chunks/workflows-panel.js +562 -0
  44. package/dist/packem_shared/{ADMIN_FUNCTIONS-DmBqMZ-z.js → ADMIN_FUNCTIONS-CdaxLGkE.js} +3 -0
  45. package/dist/packem_shared/{ApiDocsPanel-C5-yJ1p7.js → ApiDocsPanel-B6u_wnz-.js} +2 -2
  46. package/dist/packem_shared/{ApiReferencePanel-1vubqG5s.js → ApiReferencePanel-Drz4UO0a.js} +2 -1
  47. package/dist/packem_shared/{CommandPalette-BtgkBzZI.js → CommandPalette-B5BertvU.js} +1 -1
  48. package/dist/packem_shared/{DataBrowser-CtBe1So9.js → DataBrowser-ANTHLWWh.js} +198 -247
  49. package/dist/packem_shared/{GlobalDataBrowser-BTEmGrph.js → GlobalDataBrowser-CjgTG_wa.js} +37 -66
  50. package/dist/packem_shared/HomePanel-c2FodE9t.js +14 -0
  51. package/dist/packem_shared/{OpenRpcReferencePanel-vbcYbv3V.js → OpenRpcReferencePanel-CspFdbUT.js} +2 -1
  52. package/dist/packem_shared/{ScheduledJobs-CabfKbyM.js → ScheduledJobs-BEJXtsBn.js} +163 -60
  53. package/dist/packem_shared/Studio-CVTtA_sB.js +16 -0
  54. package/dist/packem_shared/{StudioApp-CHOZA-z-.js → StudioApp-BSYV2fz6.js} +277 -3
  55. package/dist/packem_shared/{advisor-view-CGcfMiPq.js → advisor-view-DzqyvUU3.js} +1 -1
  56. package/dist/packem_shared/{app.d-CCmwDEVs.d.ts → app.d-B6MyY_al.d.ts} +1 -1
  57. package/dist/packem_shared/{bar-chart-CzJAgqkp.js → bar-chart-Bb__F5-u.js} +1 -1
  58. package/dist/packem_shared/browser-storage-d03UsV7v.js +249 -0
  59. package/dist/packem_shared/{cf-links-2cktDedA.js → cf-links-BZfRdxSE.js} +1 -1
  60. package/dist/packem_shared/{data-grid-B5CaV3wS.js → data-grid-Dsg6nRjo.js} +1 -1
  61. package/dist/packem_shared/data-view-params-Cd6yRVbv.js +96 -0
  62. package/dist/packem_shared/{grid-features-CzUfqgsM.js → grid-features-D7nNzBYm.js} +4 -99
  63. package/dist/packem_shared/{HomePanel-Cw16stjq.js → home-panel-aOR_drVv.js} +833 -469
  64. package/dist/packem_shared/{internal-rXJEAhXS.js → internal-FcNZ3beb.js} +1 -1
  65. package/dist/packem_shared/modal-shell-hyaJvIJ6.js +100 -0
  66. package/dist/packem_shared/{reference-view-B4E49Lip.js → reference-view-Doy1XlQq.js} +4 -44
  67. package/dist/packem_shared/select-UkNYCT3s.js +273 -0
  68. package/dist/packem_shared/skeleton-CGhL0p20.js +45 -0
  69. package/dist/packem_shared/{sparkline-10dG-_f0.js → sparkline-KgMPHS4u.js} +1 -1
  70. package/dist/packem_shared/studio-dMTJ-kRR.js +3987 -0
  71. package/dist/packem_shared/{table-_RzNvy3R.js → table-DsCa9Qp9.js} +1 -1
  72. package/dist/packem_shared/{table-list-sidebar-Bg7uzbvC.js → table-list-sidebar-VMo0ftxD.js} +1 -1
  73. package/dist/packem_shared/use-admin-query-BViPA3US.js +105 -0
  74. package/dist/packem_shared/use-auth-capabilities-BHkoBnbZ.js +32 -0
  75. package/dist/standalone/chunk-2DS7JLWL.js +13 -0
  76. package/dist/standalone/chunk-2K47A3P6.js +1 -0
  77. package/dist/standalone/chunk-2NGUNNGW.js +1 -0
  78. package/dist/standalone/chunk-2PDQ4KZ6.js +1 -0
  79. package/dist/standalone/chunk-3BP4BTLR.js +4 -0
  80. package/dist/standalone/chunk-3OA7PECS.js +6 -0
  81. package/dist/standalone/chunk-4QHKBC77.js +1 -0
  82. package/dist/standalone/chunk-57LYXHXH.js +1 -0
  83. package/dist/standalone/chunk-5NSZVXCS.js +1 -0
  84. package/dist/standalone/chunk-5OIBXYZM.js +1 -0
  85. package/dist/standalone/chunk-63XKJQTQ.js +1 -0
  86. package/dist/standalone/chunk-6RC6L33K.js +4 -0
  87. package/dist/standalone/chunk-6VTGE3WJ.js +1 -0
  88. package/dist/standalone/chunk-7PBZKXYA.js +1 -0
  89. package/dist/standalone/chunk-7POIIWC5.js +3 -0
  90. package/dist/standalone/chunk-7RYIQKZA.js +1 -0
  91. package/dist/standalone/chunk-7TJJXVSE.js +1 -0
  92. package/dist/standalone/chunk-AB6QGMBF.js +1 -0
  93. package/dist/standalone/chunk-AHILM3ZP.js +1 -0
  94. package/dist/standalone/chunk-AQGOX5DK.js +1 -0
  95. package/dist/standalone/chunk-ASLGNHAX.js +1 -0
  96. package/dist/standalone/chunk-BHTPZS7L.js +4 -0
  97. package/dist/standalone/chunk-BJGBHGK3.js +1 -0
  98. package/dist/standalone/chunk-D7HKX4DI.js +1 -0
  99. package/dist/standalone/chunk-DGWTR4G7.js +1 -0
  100. package/dist/standalone/chunk-DSX53PBM.js +1 -0
  101. package/dist/standalone/chunk-DV2MNASX.js +1 -0
  102. package/dist/standalone/chunk-DWDILV2E.js +1 -0
  103. package/dist/standalone/chunk-E7AVZZKO.js +1 -0
  104. package/dist/standalone/chunk-EGJX34WM.js +1 -0
  105. package/dist/standalone/chunk-FCR3HKFV.js +1 -0
  106. package/dist/standalone/chunk-FKO3HO6I.js +4 -0
  107. package/dist/standalone/chunk-FQKNJSRA.js +76 -0
  108. package/dist/standalone/chunk-G2TFEWEQ.js +4 -0
  109. package/dist/standalone/chunk-GABMIICA.js +1 -0
  110. package/dist/standalone/chunk-GTM65MVX.js +1 -0
  111. package/dist/standalone/chunk-GZXPPJVK.js +1 -0
  112. package/dist/standalone/chunk-HFBRE65A.js +1 -0
  113. package/dist/standalone/chunk-HFMQNUBC.js +1 -0
  114. package/dist/standalone/chunk-HG7Q5B3H.js +1 -0
  115. package/dist/standalone/chunk-HTQL7AXU.js +1 -0
  116. package/dist/standalone/chunk-HV7G6DFP.js +5 -0
  117. package/dist/standalone/chunk-ITLLHEVG.js +1 -0
  118. package/dist/standalone/chunk-J6J54MBP.js +1 -0
  119. package/dist/standalone/chunk-JSEXCW5Q.js +1 -0
  120. package/dist/standalone/chunk-KEGAWN6Y.js +1 -0
  121. package/dist/standalone/chunk-KG3QTFWE.js +1 -0
  122. package/dist/standalone/chunk-KGS7KM4A.js +2 -0
  123. package/dist/standalone/chunk-KODWGUAB.js +1 -0
  124. package/dist/standalone/chunk-KZ6INM5M.js +1 -0
  125. package/dist/standalone/chunk-MGFEVTRI.js +1 -0
  126. package/dist/standalone/chunk-N2QDG3MW.js +1 -0
  127. package/dist/standalone/chunk-N4JI6VQD.js +1 -0
  128. package/dist/standalone/chunk-NNISYDNI.js +1 -0
  129. package/dist/standalone/chunk-O4PXDNR3.js +1 -0
  130. package/dist/standalone/chunk-O77VNUFD.js +1 -0
  131. package/dist/standalone/chunk-OD2POGPJ.js +1 -0
  132. package/dist/standalone/chunk-OXCK3ZUG.js +1 -0
  133. package/dist/standalone/chunk-P7DSVO4U.js +1 -0
  134. package/dist/standalone/chunk-PKAM3N5C.js +1 -0
  135. package/dist/standalone/chunk-QGXGBHQO.js +1 -0
  136. package/dist/standalone/chunk-QHA3TAEJ.js +1 -0
  137. package/dist/standalone/chunk-QQWC62X7.js +1 -0
  138. package/dist/standalone/chunk-RMYA7NAH.js +1 -0
  139. package/dist/standalone/chunk-RRCPZMC2.js +22 -0
  140. package/dist/standalone/chunk-S53RUBW5.js +1 -0
  141. package/dist/standalone/chunk-SB4GT6PK.js +1 -0
  142. package/dist/standalone/chunk-SEU5V7I6.js +1 -0
  143. package/dist/standalone/chunk-SHIOUDOT.js +1 -0
  144. package/dist/standalone/chunk-SIDRSX7Y.js +1 -0
  145. package/dist/standalone/chunk-SVR644RF.js +1 -0
  146. package/dist/standalone/chunk-TAD43CG5.js +1 -0
  147. package/dist/standalone/chunk-TBMYIZIO.js +1 -0
  148. package/dist/standalone/chunk-TICVNLPM.js +1 -0
  149. package/dist/standalone/chunk-TQ36RWOP.js +1 -0
  150. package/dist/standalone/chunk-UGMRUEBU.js +1 -0
  151. package/dist/standalone/chunk-UII66UVF.js +1 -0
  152. package/dist/standalone/chunk-VJPQUBN6.js +8 -0
  153. package/dist/standalone/chunk-VLXV72QE.js +1 -0
  154. package/dist/standalone/chunk-VMJKJWG6.js +1 -0
  155. package/dist/standalone/chunk-VPDPN5RR.js +2 -0
  156. package/dist/standalone/chunk-VSEGZA3J.js +1 -0
  157. package/dist/standalone/chunk-VXBZQIGY.js +4 -0
  158. package/dist/standalone/chunk-W7PCVQTE.js +1 -0
  159. package/dist/standalone/chunk-XLILSHPE.js +1 -0
  160. package/dist/standalone/chunk-XURNGQSS.js +1 -0
  161. package/dist/standalone/chunk-YJGANMU7.js +18 -0
  162. package/dist/standalone/chunk-YQQJ4N6U.js +1 -0
  163. package/dist/standalone/chunk-ZH7UES4T.js +2 -0
  164. package/dist/standalone/chunk-ZPUO7FNI.js +1 -0
  165. package/dist/standalone/chunk-ZQCVDXDL.js +1 -0
  166. package/dist/standalone/studio.js +104 -246
  167. package/dist/styles.css +1 -1
  168. package/package.json +13 -12
  169. package/dist/packem_shared/SettingsPanel-C0uLRf5P.js +0 -176
  170. package/dist/packem_shared/SqlEditorPanel-CguV7otm.js +0 -13
  171. package/dist/packem_shared/Studio-DFWAlcuf.js +0 -33
  172. package/dist/packem_shared/studio-Bj8psK1c.js +0 -10303
  173. package/dist/packem_shared/use-live-admin-Dq6g3daN.js +0 -73
  174. package/dist/packem_shared/use-live-shard-seed-Cuk3dnH0.js +0 -76
@@ -1,22 +1,20 @@
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 { L as LiveError } from '../packem_shared/live-status-FZ0psC1z.js';
4
+ import { ShardInput } from '../packem_shared/ShardInput-gx_DZXXn.js';
5
+ import { B as Badge } from '../packem_shared/badge-B2PKA1-5.js';
6
+ import { B as Button } from '../packem_shared/button-BhsN2uZH.js';
7
+ import { C as Card, a as CardContent } from '../packem_shared/card-DURq3ElK.js';
8
+ import { E as EmptyState } from '../packem_shared/empty-state-DY_oe0k6.js';
9
+ 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';
10
+ import { u as useAdminQuery } from '../packem_shared/use-admin-query-BViPA3US.js';
11
+ import useDebounced from '../packem_shared/useDebounced-Dxncpg6z.js';
12
+ import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
13
+ import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-CdaxLGkE.js';
14
+ import { g as formatTimestamp } from '../packem_shared/internal-FcNZ3beb.js';
15
+ import { c as cn } from '../packem_shared/utils-B05Dmz_H.js';
17
16
  import { jsxDEV } from 'react/jsx-dev-runtime';
18
17
 
19
- const GET_FUNCTION_STATS = adminRef(ADMIN_FUNCTIONS.getFunctionStats);
20
18
  const KIND_VARIANT = {
21
19
  action: "outline",
22
20
  mutation: "default",
@@ -53,218 +51,163 @@ const SORTERS = {
53
51
  slowest: (a, b) => b.maxDurationMs - a.maxDurationMs
54
52
  };
55
53
  const FunctionStatsPanel = (t0) => {
56
- const $ = c(48);
54
+ const $ = c(45);
57
55
  const {
58
56
  functions,
59
57
  initialShardKey
60
58
  } = t0;
61
- const client = useLunora();
62
59
  const t = useT();
63
60
  const [shardKey, setShardKey] = useState(initialShardKey ?? "");
64
- const [stats, setStats] = useState(null);
65
- const [error, setError] = useState(null);
66
61
  const [sortKey, setSortKey] = useState("recent");
67
- const [liveError, setLiveError] = useState(void 0);
68
- const mountedRef = useRef(true);
69
62
  let t1;
63
+ if ($[0] !== shardKey) {
64
+ t1 = shardKey.trim();
65
+ $[0] = shardKey;
66
+ $[1] = t1;
67
+ } else {
68
+ t1 = $[1];
69
+ }
70
+ const debouncedShard = useDebounced(t1, 400);
70
71
  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;
72
+ if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
73
+ t2 = {};
74
+ $[2] = t2;
81
75
  } else {
82
- t1 = $[0];
83
- t2 = $[1];
76
+ t2 = $[2];
84
77
  }
85
- useEffect(t1, t2);
86
78
  let t3;
87
- if ($[2] !== functions) {
88
- t3 = new Map((functions ?? []).map(_temp));
89
- $[2] = functions;
90
- $[3] = t3;
79
+ if ($[3] !== debouncedShard) {
80
+ t3 = {
81
+ live: true,
82
+ shardKey: debouncedShard
83
+ };
84
+ $[3] = debouncedShard;
85
+ $[4] = t3;
91
86
  } else {
92
- t3 = $[3];
87
+ t3 = $[4];
93
88
  }
94
- const kindByPath = t3;
89
+ const {
90
+ data,
91
+ error,
92
+ liveError
93
+ } = useAdminQuery(ADMIN_FUNCTIONS.getFunctionStats, t2, t3);
94
+ const stats = data?.functions ?? null;
95
95
  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;
96
+ if ($[5] !== functions) {
97
+ t4 = new Map((functions ?? []).map(_temp));
98
+ $[5] = functions;
99
+ $[6] = t4;
103
100
  } else {
104
- t4 = $[4];
101
+ t4 = $[6];
105
102
  }
106
- const applyResult = t4;
103
+ const kindByPath = t4;
107
104
  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
105
  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) => {
106
+ t5 = (event) => {
164
107
  setSortKey(event.currentTarget.dataset.sort);
165
108
  };
166
- $[10] = t9;
109
+ $[7] = t5;
167
110
  } else {
168
- t9 = $[10];
111
+ t5 = $[7];
169
112
  }
170
- const selectSort = t9;
171
- let t10;
172
- if ($[11] !== error || $[12] !== kindByPath || $[13] !== liveError || $[14] !== shardKey || $[15] !== sortKey || $[16] !== stats || $[17] !== t) {
113
+ const selectSort = t5;
114
+ let t6;
115
+ if ($[8] !== error || $[9] !== kindByPath || $[10] !== liveError || $[11] !== shardKey || $[12] !== sortKey || $[13] !== stats || $[14] !== t) {
173
116
  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;
117
+ let t7;
118
+ if ($[16] !== t) {
119
+ t7 = t("Recent");
120
+ $[16] = t;
121
+ $[17] = t7;
179
122
  } else {
180
- t11 = $[20];
123
+ t7 = $[17];
181
124
  }
182
- let t12;
183
- if ($[21] !== t11) {
184
- t12 = {
125
+ let t8;
126
+ if ($[18] !== t7) {
127
+ t8 = {
185
128
  key: "recent",
186
- label: t11
129
+ label: t7
187
130
  };
188
- $[21] = t11;
189
- $[22] = t12;
131
+ $[18] = t7;
132
+ $[19] = t8;
190
133
  } else {
191
- t12 = $[22];
134
+ t8 = $[19];
192
135
  }
193
- let t13;
194
- if ($[23] !== t) {
195
- t13 = t("Most called");
196
- $[23] = t;
197
- $[24] = t13;
136
+ let t9;
137
+ if ($[20] !== t) {
138
+ t9 = t("Most called");
139
+ $[20] = t;
140
+ $[21] = t9;
198
141
  } else {
199
- t13 = $[24];
142
+ t9 = $[21];
200
143
  }
201
- let t14;
202
- if ($[25] !== t13) {
203
- t14 = {
144
+ let t10;
145
+ if ($[22] !== t9) {
146
+ t10 = {
204
147
  key: "calls",
205
- label: t13
148
+ label: t9
206
149
  };
207
- $[25] = t13;
208
- $[26] = t14;
150
+ $[22] = t9;
151
+ $[23] = t10;
209
152
  } else {
210
- t14 = $[26];
153
+ t10 = $[23];
211
154
  }
212
- let t15;
213
- if ($[27] !== t) {
214
- t15 = t("Slowest");
215
- $[27] = t;
216
- $[28] = t15;
155
+ let t11;
156
+ if ($[24] !== t) {
157
+ t11 = t("Slowest");
158
+ $[24] = t;
159
+ $[25] = t11;
217
160
  } else {
218
- t15 = $[28];
161
+ t11 = $[25];
219
162
  }
220
- let t16;
221
- if ($[29] !== t15) {
222
- t16 = {
163
+ let t12;
164
+ if ($[26] !== t11) {
165
+ t12 = {
223
166
  key: "slowest",
224
- label: t15
167
+ label: t11
225
168
  };
226
- $[29] = t15;
227
- $[30] = t16;
169
+ $[26] = t11;
170
+ $[27] = t12;
228
171
  } else {
229
- t16 = $[30];
172
+ t12 = $[27];
230
173
  }
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;
174
+ let t13;
175
+ if ($[28] !== t10 || $[29] !== t12 || $[30] !== t8) {
176
+ t13 = [t8, t10, t12];
177
+ $[28] = t10;
178
+ $[29] = t12;
179
+ $[30] = t8;
180
+ $[31] = t13;
238
181
  } else {
239
- t17 = $[34];
182
+ t13 = $[31];
240
183
  }
241
- const sortButtons = t17;
242
- let t18;
243
- if ($[35] !== shardKey) {
244
- t18 = /* @__PURE__ */ jsxDEV(ShardInput, {
184
+ const sortButtons = t13;
185
+ let t14;
186
+ if ($[32] !== shardKey) {
187
+ t14 = /* @__PURE__ */ jsxDEV(ShardInput, {
245
188
  onChange: setShardKey,
246
189
  testId: "fs-shard-input",
247
190
  value: shardKey
248
191
  }, void 0, false);
249
- $[35] = shardKey;
250
- $[36] = t18;
192
+ $[32] = shardKey;
193
+ $[33] = t14;
251
194
  } else {
252
- t18 = $[36];
195
+ t14 = $[33];
253
196
  }
254
- let t19;
255
- if ($[37] !== liveError) {
256
- t19 = /* @__PURE__ */ jsxDEV(LiveError, {
197
+ let t15;
198
+ if ($[34] !== liveError) {
199
+ t15 = /* @__PURE__ */ jsxDEV(LiveError, {
257
200
  message: liveError,
258
201
  prefix: "fs"
259
202
  }, void 0, false);
260
- $[37] = liveError;
261
- $[38] = t19;
203
+ $[34] = liveError;
204
+ $[35] = t15;
262
205
  } else {
263
- t19 = $[38];
206
+ t15 = $[35];
264
207
  }
265
- let t20;
266
- if ($[39] !== sortButtons || $[40] !== sortKey) {
267
- t20 = /* @__PURE__ */ jsxDEV("div", {
208
+ let t16;
209
+ if ($[36] !== sortButtons || $[37] !== sortKey) {
210
+ t16 = /* @__PURE__ */ jsxDEV("div", {
268
211
  className: "ml-auto flex items-center gap-1",
269
212
  role: "group",
270
213
  children: sortButtons.map((option) => /* @__PURE__ */ jsxDEV(Button, {
@@ -277,42 +220,42 @@ const FunctionStatsPanel = (t0) => {
277
220
  children: option.label
278
221
  }, option.key, false))
279
222
  }, void 0, false);
280
- $[39] = sortButtons;
281
- $[40] = sortKey;
282
- $[41] = t20;
223
+ $[36] = sortButtons;
224
+ $[37] = sortKey;
225
+ $[38] = t16;
283
226
  } else {
284
- t20 = $[41];
227
+ t16 = $[38];
285
228
  }
286
- let t21;
287
- if ($[42] !== t18 || $[43] !== t19 || $[44] !== t20) {
288
- t21 = /* @__PURE__ */ jsxDEV("div", {
229
+ let t17;
230
+ if ($[39] !== t14 || $[40] !== t15 || $[41] !== t16) {
231
+ t17 = /* @__PURE__ */ jsxDEV("div", {
289
232
  className: "flex flex-wrap items-center gap-2",
290
- children: [t18, t19, t20]
233
+ children: [t14, t15, t16]
291
234
  }, void 0, true);
292
- $[42] = t18;
293
- $[43] = t19;
294
- $[44] = t20;
295
- $[45] = t21;
235
+ $[39] = t14;
236
+ $[40] = t15;
237
+ $[41] = t16;
238
+ $[42] = t17;
296
239
  } else {
297
- t21 = $[45];
240
+ t17 = $[42];
298
241
  }
299
- let t22;
300
- if ($[46] !== error) {
301
- t22 = error !== null && /* @__PURE__ */ jsxDEV("p", {
242
+ let t18;
243
+ if ($[43] !== error) {
244
+ t18 = error !== null && /* @__PURE__ */ jsxDEV("p", {
302
245
  className: "text-sm text-destructive",
303
246
  "data-testid": "fs-error",
304
247
  role: "alert",
305
248
  children: error
306
249
  }, void 0, false);
307
- $[46] = error;
308
- $[47] = t22;
250
+ $[43] = error;
251
+ $[44] = t18;
309
252
  } else {
310
- t22 = $[47];
253
+ t18 = $[44];
311
254
  }
312
- t10 = /* @__PURE__ */ jsxDEV("div", {
255
+ t6 = /* @__PURE__ */ jsxDEV("div", {
313
256
  className: "flex flex-col gap-4",
314
257
  "data-testid": "lunora-function-stats",
315
- children: [t21, t22, stats !== null && sorted.length === 0 && error === null && /* @__PURE__ */ jsxDEV(EmptyState, {
258
+ children: [t17, t18, stats !== null && sorted.length === 0 && error === null && /* @__PURE__ */ jsxDEV(EmptyState, {
316
259
  description: t("Per-function call counts, error rates, and latency land here after your first request."),
317
260
  icon: /* @__PURE__ */ jsxDEV("svg", {
318
261
  "aria-hidden": "true",
@@ -412,18 +355,18 @@ const FunctionStatsPanel = (t0) => {
412
355
  }, void 0, false)
413
356
  }, void 0, false)]
414
357
  }, 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;
358
+ $[8] = error;
359
+ $[9] = kindByPath;
360
+ $[10] = liveError;
361
+ $[11] = shardKey;
362
+ $[12] = sortKey;
363
+ $[13] = stats;
364
+ $[14] = t;
365
+ $[15] = t6;
423
366
  } else {
424
- t10 = $[18];
367
+ t6 = $[15];
425
368
  }
426
- return t10;
369
+ return t6;
427
370
  };
428
371
  function _temp(descriptor) {
429
372
  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-BViPA3US.js';
9
+ import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
10
+ import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-CdaxLGkE.js';
11
+ import { f as fireAndForget, g as formatTimestamp, c as callOptions, e as errorMessage, a as adminRef } from '../packem_shared/internal-FcNZ3beb.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-KgMPHS4u.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, {