@lunora/studio 1.0.0-alpha.53 → 1.0.0-alpha.54

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 (80) hide show
  1. package/dist/index.d.ts +671 -777
  2. package/dist/index.js +1 -1
  3. package/dist/mount.d.ts +10 -10
  4. package/dist/packem_chunks/FileBrowser.js +1 -1
  5. package/dist/packem_chunks/LogsPanel.js +90 -51
  6. package/dist/packem_chunks/MetricsPanel.js +1 -1
  7. package/dist/packem_chunks/SettingsPanel.js +1 -1
  8. package/dist/packem_chunks/TableEditor.js +1 -1
  9. package/dist/packem_chunks/log-drains-panel.js +1 -1
  10. package/dist/packem_shared/{GlobalDataBrowser-f5Ll2AQK.js → GlobalDataBrowser-D8h1fTL1.js} +1 -1
  11. package/dist/packem_shared/app.d-__J6S7he.d.ts +254 -0
  12. package/dist/packem_shared/{cf-links-BZfRdxSE.js → cf-links-SIbyi4Y1.js} +1 -1
  13. package/dist/standalone/{chunk-C4QK2DJN.js → chunk-2MYDFHDZ.js} +1 -1
  14. package/dist/standalone/{chunk-VY6AI3RI.js → chunk-3HKJ6FSC.js} +1 -1
  15. package/dist/standalone/{chunk-SDQE2IUJ.js → chunk-3W4CSGDO.js} +1 -1
  16. package/dist/standalone/{chunk-ZQQ3MFEQ.js → chunk-4F72YCTU.js} +1 -1
  17. package/dist/standalone/{chunk-CODD62OJ.js → chunk-4YHXOOK7.js} +1 -1
  18. package/dist/standalone/{chunk-R2MAZ2OH.js → chunk-5AXARNJ2.js} +1 -1
  19. package/dist/standalone/{chunk-IZN4TYMN.js → chunk-5IGHDPEP.js} +1 -1
  20. package/dist/standalone/{chunk-OETK333R.js → chunk-6CNL7BUU.js} +1 -1
  21. package/dist/standalone/{chunk-FFVSSWU2.js → chunk-6PXHT2QI.js} +1 -1
  22. package/dist/standalone/{chunk-NXAKNU3L.js → chunk-777XYTDZ.js} +1 -1
  23. package/dist/standalone/{chunk-JPILGFXT.js → chunk-7YGTGBP7.js} +1 -1
  24. package/dist/standalone/{chunk-HZKFL2M7.js → chunk-ASLE5VQE.js} +1 -1
  25. package/dist/standalone/{chunk-5JB7FDCA.js → chunk-B6DIQBOK.js} +1 -1
  26. package/dist/standalone/{chunk-A3ZJACVT.js → chunk-BR7WLG6X.js} +1 -1
  27. package/dist/standalone/{chunk-TO6D2PJC.js → chunk-CHNXZYAC.js} +1 -1
  28. package/dist/standalone/{chunk-WUFVFVHJ.js → chunk-D73WYMRU.js} +1 -1
  29. package/dist/standalone/{chunk-SXAFEREK.js → chunk-EXE42KMM.js} +1 -1
  30. package/dist/standalone/{chunk-LUP4YTBS.js → chunk-FDWXYXOM.js} +1 -1
  31. package/dist/standalone/{chunk-AITOCPML.js → chunk-FQUNSQLG.js} +1 -1
  32. package/dist/standalone/{chunk-MDTNVR3G.js → chunk-GRBWXZE4.js} +1 -1
  33. package/dist/standalone/{chunk-PWKD5FTM.js → chunk-GVFODXW2.js} +1 -1
  34. package/dist/standalone/{chunk-IEKK5GO6.js → chunk-H5X5TIWZ.js} +1 -1
  35. package/dist/standalone/{chunk-CRY26DNY.js → chunk-HFSJCS2N.js} +1 -1
  36. package/dist/standalone/{chunk-W6JKUZKD.js → chunk-HI373BLB.js} +1 -1
  37. package/dist/standalone/{chunk-IC7XYSER.js → chunk-IDAIBUKJ.js} +1 -1
  38. package/dist/standalone/{chunk-7KSXHCUD.js → chunk-IDK76JPE.js} +1 -1
  39. package/dist/standalone/{chunk-YFZ27MEC.js → chunk-JFT5OIL2.js} +1 -1
  40. package/dist/standalone/{chunk-GPQX3AEO.js → chunk-JGCZJNMT.js} +1 -1
  41. package/dist/standalone/{chunk-3XBP6RRG.js → chunk-JZ4X6QMK.js} +1 -1
  42. package/dist/standalone/{chunk-WXUUGXDV.js → chunk-K53QX72G.js} +1 -1
  43. package/dist/standalone/{chunk-ISOUWAPB.js → chunk-LVDKJBWU.js} +1 -1
  44. package/dist/standalone/{chunk-3C3CU2DS.js → chunk-MN4QBJWN.js} +1 -1
  45. package/dist/standalone/{chunk-ZVT4GJEI.js → chunk-NBLGUSJW.js} +1 -1
  46. package/dist/standalone/{chunk-TC4KPQJ7.js → chunk-NEQV5EQC.js} +2 -2
  47. package/dist/standalone/{chunk-CZGILAZI.js → chunk-NP7AR65U.js} +1 -1
  48. package/dist/standalone/{chunk-ALL4U2C5.js → chunk-NWVHLLPB.js} +1 -1
  49. package/dist/standalone/{chunk-XXXNY3DK.js → chunk-NYK3PFSC.js} +1 -1
  50. package/dist/standalone/{chunk-HRHG4HOZ.js → chunk-ONCMJKJS.js} +1 -1
  51. package/dist/standalone/chunk-OXHHSUXO.js +1 -0
  52. package/dist/standalone/{chunk-USYCKPUK.js → chunk-PQKG5GKG.js} +1 -1
  53. package/dist/standalone/{chunk-LAK5VSPI.js → chunk-QVIPA6UJ.js} +1 -1
  54. package/dist/standalone/{chunk-S7RKDQPS.js → chunk-R2SUQVIO.js} +1 -1
  55. package/dist/standalone/{chunk-I7Y7ST5Y.js → chunk-REQTQOBK.js} +1 -1
  56. package/dist/standalone/{chunk-7N5KFSSB.js → chunk-RHYLU4OZ.js} +1 -1
  57. package/dist/standalone/{chunk-LOYE7OU2.js → chunk-S2G7OH5T.js} +1 -1
  58. package/dist/standalone/{chunk-3MAQAOUA.js → chunk-SCH473C7.js} +1 -1
  59. package/dist/standalone/{chunk-X4QFAAZ5.js → chunk-SWMBBYJU.js} +1 -1
  60. package/dist/standalone/{chunk-75LPCQ77.js → chunk-SXATIQAK.js} +1 -1
  61. package/dist/standalone/{chunk-6TMEOFZC.js → chunk-TYMKCYYT.js} +1 -1
  62. package/dist/standalone/{chunk-T7FHIJ2T.js → chunk-V7RQA6NY.js} +1 -1
  63. package/dist/standalone/chunk-VXM5H542.js +4 -0
  64. package/dist/standalone/chunk-W3XY7KL4.js +1 -0
  65. package/dist/standalone/{chunk-43F677PE.js → chunk-WAVZATY2.js} +1 -1
  66. package/dist/standalone/{chunk-DMFVDMUJ.js → chunk-WCB3KG7C.js} +1 -1
  67. package/dist/standalone/{chunk-3GVA2ROQ.js → chunk-WM2MP5ZK.js} +1 -1
  68. package/dist/standalone/{chunk-EEWKIQUE.js → chunk-WOYQG5AM.js} +1 -1
  69. package/dist/standalone/{chunk-JM7XBQVK.js → chunk-XCNYUUD6.js} +1 -1
  70. package/dist/standalone/{chunk-XXAW7V4T.js → chunk-ZSUTV374.js} +1 -1
  71. package/dist/standalone/{chunk-22C6COGE.js → chunk-ZXLEXF4X.js} +2 -2
  72. package/dist/standalone/studio.js +1 -1
  73. package/dist/styles.css +2 -2
  74. package/package.json +8 -8
  75. package/dist/packem_shared/app.d-CGdOmLTm.d.ts +0 -300
  76. package/dist/standalone/chunk-KJJ3WM6H.js +0 -4
  77. package/dist/standalone/chunk-LT7IG26L.js +0 -1
  78. package/dist/standalone/chunk-WI7GWFEG.js +0 -1
  79. /package/dist/standalone/{chunk-ITQKVEP7.js → chunk-5XO36X4C.js} +0 -0
  80. /package/dist/standalone/{chunk-TQ36RWOP.js → chunk-IYHPYY4A.js} +0 -0
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ export { default as ApiTab } from './packem_chunks/ApiTab.js';
14
14
  export { default as OpenRpcReferencePanel } from './packem_shared/OpenRpcReferencePanel-CWaf0ZtX.js';
15
15
  export { DataBrowser } from './packem_shared/DataBrowser-C8hejnub.js';
16
16
  export { DataFilters, toFilterClauses } from './packem_shared/DataFilters-B1Q7mrt7.js';
17
- export { GlobalDataBrowser } from './packem_shared/GlobalDataBrowser-f5Ll2AQK.js';
17
+ export { GlobalDataBrowser } from './packem_shared/GlobalDataBrowser-D8h1fTL1.js';
18
18
  export { TableEditor } from './packem_chunks/TableEditor.js';
19
19
  export { ExportImportPanel } from './packem_chunks/ExportImportPanel.js';
20
20
  export { MigrationsPanel } from './packem_chunks/MigrationsPanel.js';
package/dist/mount.d.ts CHANGED
@@ -1,21 +1,21 @@
1
1
  import { Root } from 'react-dom/client';
2
- import { S as StudioAppProps } from "./packem_shared/app.d-CGdOmLTm.js";
2
+ import { S as StudioAppProps } from "./packem_shared/app.d-__J6S7he.js";
3
3
  import '@lunora/client';
4
4
  import 'react';
5
5
  import '@lingui/core';
6
6
  interface MountStudioOptions extends StudioAppProps {
7
7
  /**
8
- * The container to mount into. Accepts an element or a selector; defaults to
9
- * `#root`. Throws if the selector matches nothing so misconfiguration fails
10
- * loudly rather than silently rendering nowhere.
11
- */
8
+ * The container to mount into. Accepts an element or a selector; defaults to
9
+ * `#root`. Throws if the selector matches nothing so misconfiguration fails
10
+ * loudly rather than silently rendering nowhere.
11
+ */
12
12
  readonly container?: Element | string;
13
13
  }
14
14
  /**
15
- * Mount the batteries-included {@link StudioApp} into the DOM and return the
16
- * React root (call `.unmount()` to tear it down). This is the entry the
17
- * standalone app's `main.tsx` and the `@lunora/vite` dev route both call — it
18
- * keeps the host HTML to a single `<div id="root">` plus one script.
19
- */
15
+ * Mount the batteries-included {@link StudioApp} into the DOM and return the
16
+ * React root (call `.unmount()` to tear it down). This is the entry the
17
+ * standalone app's `main.tsx` and the `@lunora/vite` dev route both call — it
18
+ * keeps the host HTML to a single `<div id="root">` plus one script.
19
+ */
20
20
  declare const mountStudio: (options?: MountStudioOptions) => Root;
21
21
  export { MountStudioOptions, mountStudio };
@@ -13,7 +13,7 @@ import { ConfirmButton } from '../packem_shared/ConfirmButton-C2eVi2Qv.js';
13
13
  import { B as Badge } from '../packem_shared/badge-B2PKA1-5.js';
14
14
  import { jsxDEV, Fragment } from 'react/jsx-dev-runtime';
15
15
  import { I as Input } from '../packem_shared/input-XH4r1Pt1.js';
16
- import { d as CLOUDFLARE_R2_URL } from '../packem_shared/cf-links-BZfRdxSE.js';
16
+ import { d as CLOUDFLARE_R2_URL } from '../packem_shared/cf-links-SIbyi4Y1.js';
17
17
  import { useLunora } from '@lunora/react';
18
18
  import { useAutoRefresh } from '../packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js';
19
19
  import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-DNeyYtUN.js';
@@ -11,12 +11,29 @@ import { u as useAdminQuery } from '../packem_shared/use-admin-query-BGJ010yZ.js
11
11
  import useDebounced from '../packem_shared/useDebounced-Dxncpg6z.js';
12
12
  import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
13
13
  import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-DNeyYtUN.js';
14
- import { a as CLOUDFLARE_OBSERVABILITY_URL } from '../packem_shared/cf-links-BZfRdxSE.js';
14
+ import { b as CLOUDFLARE_OBSERVABILITY_URL } from '../packem_shared/cf-links-SIbyi4Y1.js';
15
15
  import { r as recordShard } from '../packem_shared/shard-history-AxiJ1WPP.js';
16
16
  import { c as cn } from '../packem_shared/utils-B05Dmz_H.js';
17
17
  import { f as flooredRectObserver } from '../packem_shared/virtual-rect-CVMUskSm.js';
18
18
  import { jsxDEV } from 'react/jsx-dev-runtime';
19
19
 
20
+ const stringifyFieldValue = (value) => {
21
+ if (typeof value === "string") {
22
+ return value;
23
+ }
24
+ try {
25
+ return JSON.stringify(value) ?? String(value);
26
+ } catch {
27
+ return String(value);
28
+ }
29
+ };
30
+ const formatLogFields = (fields) => {
31
+ if (typeof fields !== "object" || fields === null || Array.isArray(fields)) {
32
+ return "";
33
+ }
34
+ return Object.entries(fields).map(([key, value]) => `${key}=${stringifyFieldValue(value)}`).join(" ");
35
+ };
36
+
20
37
  const SCROLL_HEIGHT = 400;
21
38
  const ROW_HEIGHT = 36;
22
39
  const SCROLL_STYLE = {
@@ -40,7 +57,7 @@ const OUTCOME_VARIANT = {
40
57
  ok: "secondary"
41
58
  };
42
59
  const LogRow = (t0) => {
43
- const $ = c(21);
60
+ const $ = c(26);
44
61
  const {
45
62
  entry,
46
63
  index,
@@ -61,90 +78,112 @@ const LogRow = (t0) => {
61
78
  }
62
79
  const style = t2;
63
80
  let t3;
64
- if ($[2] !== entry.timestamp) {
65
- t3 = new Date(entry.timestamp).toLocaleString();
66
- $[2] = entry.timestamp;
81
+ if ($[2] !== entry.fields) {
82
+ t3 = formatLogFields(entry.fields);
83
+ $[2] = entry.fields;
67
84
  $[3] = t3;
68
85
  } else {
69
86
  t3 = $[3];
70
87
  }
88
+ const fields = t3;
71
89
  let t4;
72
- if ($[4] !== t3) {
73
- t4 = /* @__PURE__ */ jsxDEV("span", {
74
- className: "w-44 shrink-0 tabular-nums text-muted-foreground",
75
- role: "gridcell",
76
- children: t3
77
- }, void 0, false);
78
- $[4] = t3;
90
+ if ($[4] !== entry.timestamp) {
91
+ t4 = new Date(entry.timestamp).toLocaleString();
92
+ $[4] = entry.timestamp;
79
93
  $[5] = t4;
80
94
  } else {
81
95
  t4 = $[5];
82
96
  }
83
- const t5 = LEVEL_VARIANT[entry.level];
84
- let t6;
85
- if ($[6] !== entry.level || $[7] !== t5) {
86
- t6 = /* @__PURE__ */ jsxDEV("span", {
87
- className: "w-20 shrink-0",
97
+ let t5;
98
+ if ($[6] !== t4) {
99
+ t5 = /* @__PURE__ */ jsxDEV("span", {
100
+ className: "w-44 shrink-0 tabular-nums text-muted-foreground",
88
101
  role: "gridcell",
89
- children: /* @__PURE__ */ jsxDEV(Badge, {
90
- variant: t5,
91
- children: entry.level
92
- }, void 0, false)
102
+ children: t4
93
103
  }, void 0, false);
94
- $[6] = entry.level;
104
+ $[6] = t4;
95
105
  $[7] = t5;
96
- $[8] = t6;
97
106
  } else {
98
- t6 = $[8];
107
+ t5 = $[7];
99
108
  }
100
- const t7 = entry.functionPath ?? "—";
101
- let t8;
102
- if ($[9] !== t7) {
103
- t8 = /* @__PURE__ */ jsxDEV("span", {
104
- className: "w-48 shrink-0 truncate text-muted-foreground",
109
+ const t6 = LEVEL_VARIANT[entry.level];
110
+ let t7;
111
+ if ($[8] !== entry.level || $[9] !== t6) {
112
+ t7 = /* @__PURE__ */ jsxDEV("span", {
113
+ className: "w-20 shrink-0",
105
114
  role: "gridcell",
106
- children: t7
115
+ children: /* @__PURE__ */ jsxDEV(Badge, {
116
+ variant: t6,
117
+ children: entry.level
118
+ }, void 0, false)
107
119
  }, void 0, false);
108
- $[9] = t7;
109
- $[10] = t8;
120
+ $[8] = entry.level;
121
+ $[9] = t6;
122
+ $[10] = t7;
110
123
  } else {
111
- t8 = $[10];
124
+ t7 = $[10];
112
125
  }
126
+ const t8 = entry.functionPath ?? "—";
113
127
  let t9;
114
- if ($[11] !== entry.message) {
128
+ if ($[11] !== t8) {
115
129
  t9 = /* @__PURE__ */ jsxDEV("span", {
116
- className: "flex-1 truncate",
130
+ className: "w-48 shrink-0 truncate text-muted-foreground",
117
131
  role: "gridcell",
118
- children: entry.message
132
+ children: t8
119
133
  }, void 0, false);
120
- $[11] = entry.message;
134
+ $[11] = t8;
121
135
  $[12] = t9;
122
136
  } else {
123
137
  t9 = $[12];
124
138
  }
125
139
  let t10;
126
- if ($[13] !== index || $[14] !== measureRef || $[15] !== style || $[16] !== t4 || $[17] !== t6 || $[18] !== t8 || $[19] !== t9) {
127
- t10 = /* @__PURE__ */ jsxDEV("div", {
140
+ if ($[13] !== fields) {
141
+ t10 = fields === "" ? null : /* @__PURE__ */ jsxDEV("span", {
142
+ className: "ml-2 text-muted-foreground",
143
+ "data-testid": "lg-fields",
144
+ children: fields
145
+ }, void 0, false);
146
+ $[13] = fields;
147
+ $[14] = t10;
148
+ } else {
149
+ t10 = $[14];
150
+ }
151
+ let t11;
152
+ if ($[15] !== entry.message || $[16] !== t10) {
153
+ t11 = /* @__PURE__ */ jsxDEV("span", {
154
+ className: "flex-1 truncate",
155
+ role: "gridcell",
156
+ children: [entry.message, t10]
157
+ }, void 0, true);
158
+ $[15] = entry.message;
159
+ $[16] = t10;
160
+ $[17] = t11;
161
+ } else {
162
+ t11 = $[17];
163
+ }
164
+ let t12;
165
+ if ($[18] !== index || $[19] !== measureRef || $[20] !== style || $[21] !== t11 || $[22] !== t5 || $[23] !== t7 || $[24] !== t9) {
166
+ t12 = /* @__PURE__ */ jsxDEV("div", {
128
167
  className: "flex items-center border-b border-border px-3 py-1.5 font-mono text-xs hover:bg-muted/50",
129
168
  "data-index": index,
130
169
  "data-testid": "lg-row",
131
170
  ref: measureRef,
132
171
  role: "row",
133
172
  style,
134
- children: [t4, t6, t8, t9]
173
+ children: [t5, t7, t9, t11]
135
174
  }, void 0, true);
136
- $[13] = index;
137
- $[14] = measureRef;
138
- $[15] = style;
139
- $[16] = t4;
140
- $[17] = t6;
141
- $[18] = t8;
142
- $[19] = t9;
143
- $[20] = t10;
175
+ $[18] = index;
176
+ $[19] = measureRef;
177
+ $[20] = style;
178
+ $[21] = t11;
179
+ $[22] = t5;
180
+ $[23] = t7;
181
+ $[24] = t9;
182
+ $[25] = t12;
144
183
  } else {
145
- t10 = $[20];
184
+ t12 = $[25];
146
185
  }
147
- return t10;
186
+ return t12;
148
187
  };
149
188
  const tablesLabel = (tables) => tables.length === 0 ? "—" : tables.join(", ");
150
189
  const RequestRow = (t0) => {
@@ -357,7 +396,7 @@ const filterLogs = (entries, criteria) => {
357
396
  if (pathNeedle !== "" && !(entry.functionPath ?? "").toLowerCase().includes(pathNeedle)) {
358
397
  return false;
359
398
  }
360
- return needle === "" || entry.message.toLowerCase().includes(needle);
399
+ return needle === "" || entry.message.toLowerCase().includes(needle) || formatLogFields(entry.fields).toLowerCase().includes(needle);
361
400
  });
362
401
  };
363
402
  const NO_PATH_KEY = "—";
@@ -10,7 +10,7 @@ import { u as useAdminQuery } from '../packem_shared/use-admin-query-BGJ010yZ.js
10
10
  import useDebounced from '../packem_shared/useDebounced-Dxncpg6z.js';
11
11
  import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
12
12
  import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-DNeyYtUN.js';
13
- import { c as CLOUDFLARE_DURABLE_OBJECTS_URL } from '../packem_shared/cf-links-BZfRdxSE.js';
13
+ import { c as CLOUDFLARE_DURABLE_OBJECTS_URL } from '../packem_shared/cf-links-SIbyi4Y1.js';
14
14
  import { k as formatBytes, f as fireAndForget, c as callOptions, e as errorMessage, a as adminRef } from '../packem_shared/internal-zwBoOv24.js';
15
15
  import { r as recordShard, l as loadRecentShards } from '../packem_shared/shard-history-AxiJ1WPP.js';
16
16
  import { aggregateMetrics, computeLatencyPercentiles, enrichQueryStats, shardsToAggregate } from '../packem_shared/aggregateMetrics-D4nUHEKU.js';
@@ -7,7 +7,7 @@ import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as Table
7
7
  import { u as useAdminQuery } from '../packem_shared/use-admin-query-BGJ010yZ.js';
8
8
  import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
9
9
  import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-DNeyYtUN.js';
10
- import { b as CLOUDFLARE_WORKERS_URL } from '../packem_shared/cf-links-BZfRdxSE.js';
10
+ import { a as CLOUDFLARE_WORKERS_URL } from '../packem_shared/cf-links-SIbyi4Y1.js';
11
11
  import { jsxDEV } from 'react/jsx-dev-runtime';
12
12
 
13
13
  const KIND_VARIANT = {
@@ -8,7 +8,7 @@ import { s as searchToDataView, d as dataViewToSearch } from '../packem_shared/d
8
8
  import { f as fireAndForget } from '../packem_shared/internal-zwBoOv24.js';
9
9
  import { l as loadJsonArray, s as saveJson } from '../packem_shared/browser-storage-L4gOP5gJ.js';
10
10
  import { DataBrowser } from '../packem_shared/DataBrowser-C8hejnub.js';
11
- import { GlobalDataBrowser } from '../packem_shared/GlobalDataBrowser-f5Ll2AQK.js';
11
+ import { GlobalDataBrowser } from '../packem_shared/GlobalDataBrowser-D8h1fTL1.js';
12
12
  import { jsxDEV } from 'react/jsx-dev-runtime';
13
13
 
14
14
  const STORAGE_KEY = "lunora-studio-saved-queries";
@@ -4,7 +4,7 @@ import { B as Button } from '../packem_shared/button-BhsN2uZH.js';
4
4
  import { C as Card, a as CardContent } from '../packem_shared/card-DURq3ElK.js';
5
5
  import { I as Input } from '../packem_shared/input-XH4r1Pt1.js';
6
6
  import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
7
- import { a as CLOUDFLARE_OBSERVABILITY_URL } from '../packem_shared/cf-links-BZfRdxSE.js';
7
+ import { b as CLOUDFLARE_OBSERVABILITY_URL } from '../packem_shared/cf-links-SIbyi4Y1.js';
8
8
  import { f as fireAndForget, e as errorMessage, g as copyToClipboard } from '../packem_shared/internal-zwBoOv24.js';
9
9
  import { jsxDEV } from 'react/jsx-dev-runtime';
10
10
 
@@ -5,7 +5,7 @@ import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as Table
5
5
  import { a as useClientQuery } from './use-admin-query-BGJ010yZ.js';
6
6
  import { useAutoRefresh } from './DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js';
7
7
  import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
8
- import { C as CLOUDFLARE_D1_URL } from './cf-links-BZfRdxSE.js';
8
+ import { C as CLOUDFLARE_D1_URL } from './cf-links-SIbyi4Y1.js';
9
9
  import { u as useFacets, T as TableListSidebar, G as GridPagination, D as DataFacets } from './table-list-sidebar-huX4VmgI.js';
10
10
  import { G as GridContainer, C as CellValue } from './data-grid-C9I16KWr.js';
11
11
  import { jsxDEV } from 'react/jsx-dev-runtime';
@@ -0,0 +1,254 @@
1
+ import { CronJobInfo, ScheduleRecord, LunoraClient } from '@lunora/client';
2
+ import { ReactElement } from 'react';
3
+ import { I18n } from '@lingui/core';
4
+ interface CronTriggersPanelProps {
5
+ /**
6
+ * Load the code-defined cron triggers. Defaults to `client.getCronJobs`,
7
+ * which hits the worker's admin-gated `/_lunora/admin/cron-jobs` endpoint —
8
+ * so the panel works out of the box under `<LunoraProvider>`, provided the
9
+ * worker is built with a `cronJobs` map and `adminToken`. Override it to
10
+ * source triggers from elsewhere (e.g. tests).
11
+ */
12
+ readonly loadCronJobs?: () => Promise<CronJobInfo[]>;
13
+ /**
14
+ * Manually fire one cron job by name. Defaults to `client.runCronJob`, which
15
+ * hits the admin-gated `POST /_lunora/admin/cron-jobs/run` endpoint (the same
16
+ * dispatch the scheduled trigger runs). When a custom {@link CronTriggersPanelProps.loadCronJobs}
17
+ * is supplied without a `runCronJob`, the "Run now" control is hidden — useful
18
+ * for a read-only view.
19
+ */
20
+ readonly runCronJob?: (name: string) => Promise<{
21
+ name: string;
22
+ ran: boolean;
23
+ }>;
24
+ }
25
+ interface ScheduledJobsProps {
26
+ /**
27
+ * Cancel a pending job by id. Defaults to `client.cancelScheduledJob` when
28
+ * {@link ScheduledJobsProps.loadJobs} is also left to the client. When a
29
+ * custom `loadJobs` is supplied without a `cancelJob`, the cancel control is
30
+ * hidden — useful for a read-only view.
31
+ */
32
+ readonly cancelJob?: (id: string) => Promise<{
33
+ cancelled: boolean;
34
+ }>;
35
+ /**
36
+ * Load the pending scheduled jobs. Defaults to `client.listScheduledJobs`,
37
+ * which hits the worker's admin-gated `/_lunora/admin/scheduled` endpoint —
38
+ * so the panel works out of the box under `&lt;LunoraProvider>`, provided the
39
+ * worker is built with a `schedulerDO` namespace and `adminToken`. Override
40
+ * it to source jobs from elsewhere.
41
+ */
42
+ readonly loadJobs?: () => Promise<ScheduleRecord[]>;
43
+ }
44
+ /**
45
+ * View — and cancel — the functions queued via `runAfter` / `runAt` on the
46
+ * scheduler. Cron *triggers* are static wrangler config and don't appear here;
47
+ * this lists the dynamic, in-flight schedule only.
48
+ *
49
+ * Works out of the box under `&lt;LunoraProvider>` via the client's scheduler
50
+ * admin methods; pass {@link ScheduledJobsProps.loadJobs} /
51
+ * {@link ScheduledJobsProps.cancelJob} to override the transport.
52
+ */
53
+ declare const ScheduledJobs: ({ cancelJob, loadJobs }?: ScheduledJobsProps) => ReactElement;
54
+ interface SchedulePanelProps {
55
+ /** Override how the Cron triggers sub-view loads triggers; see {@link CronTriggersPanel}. */
56
+ readonly loadCronJobs?: CronTriggersPanelProps["loadCronJobs"];
57
+ /** Override how the Scheduled jobs sub-view cancels a job; see {@link ScheduledJobs}. */
58
+ readonly scheduledCancel?: ScheduledJobsProps["cancelJob"];
59
+ /** Override how the Scheduled jobs sub-view loads jobs; see {@link ScheduledJobs}. */
60
+ readonly scheduledLoad?: ScheduledJobsProps["loadJobs"];
61
+ }
62
+ /** Which client method a {@link FunctionDescriptor} is invoked through. */
63
+ type FunctionKind = "action" | "mutation" | "query";
64
+ /**
65
+ * One argument of a registered function, derived from its `v.*` validator by the
66
+ * worker's `/_lunora/admin/functions` endpoint. A compact signature shape.
67
+ */
68
+ interface FunctionArgumentDescriptor {
69
+ /** Element validator kind for an `array` arg (one level), e.g. `string`. */
70
+ element?: string;
71
+ /** The (optional-unwrapped) validator kind, e.g. `string`, `id`, `object`. */
72
+ kind: string;
73
+ /** The argument name. */
74
+ name: string;
75
+ /** True when the arg is wrapped in `v.optional(...)`. */
76
+ optional: boolean;
77
+ /** Target table for an `id` arg (`v.id("table")`). */
78
+ table?: string;
79
+ }
80
+ /**
81
+ * Runtime descriptor for a registered Lunora function. The function's `kind` is
82
+ * a compile-time-only phantom on `FunctionReference`, so the runner needs it
83
+ * spelled out here to know which client method to call. `args` carries the
84
+ * function's argument signature (absent on responses from an older worker).
85
+ */
86
+ interface FunctionDescriptor {
87
+ args?: FunctionArgumentDescriptor[];
88
+ kind: FunctionKind;
89
+ /** The `&lt;file>:&lt;function>` identifier, e.g. `messages:list`. */
90
+ path: string;
91
+ }
92
+ /** Outcome of a single `FunctionRunner` invocation. */
93
+ type RunStatus = "error" | "idle" | "running" | "success";
94
+ /** Identifier for each built-in studio tab. */
95
+ type StudioTab = "agents" | "analytics" | "api" | "audit" | "authConfig" | "authSessions" | "containers" | "dashboards" | "data" | "drains" | "export" | "fanout" | "files" | "flags" | "functions" | "health" | "home" | "insights" | "issues" | "kv" | "logs" | "mail" | "metrics" | "migrations" | "organizations" | "payments" | "permissions" | "pitr" | "queues" | "realtime" | "rls" | "schedule" | "schema" | "security" | "settings" | "sql" | "storageRules" | "users" | "vectors" | "workflows";
96
+ interface StudioProps {
97
+ /**
98
+ * URL path prefix the studio is mounted under, passed to the router as its
99
+ * `basepath`. Defaults to `/` (mounted at the origin root). The `@lunora/vite`
100
+ * dev route serves the studio under `/__lunora`, so it sets this — without
101
+ * it the router treats `/__lunora` as unknown and bounces to `/data`, escaping
102
+ * the mount.
103
+ */
104
+ readonly basePath?: string;
105
+ /**
106
+ * App-owned top-bar + sidebar-footer chrome (theme toggle, admin-token
107
+ * popover, rules banner). The batteries-included `StudioApp` supplies
108
+ * this; composing `&lt;Studio>` bare omits those affordances. See {@link StudioChrome}.
109
+ */
110
+ readonly chrome?: StudioChrome;
111
+ /**
112
+ * Make the data tab editable (insert/edit/delete rows). Off by default so
113
+ * the studio is read-only unless the host opts in; see {@link TableEditor}.
114
+ */
115
+ readonly dataEditable?: boolean;
116
+ /**
117
+ * Functions exposed in the runner tab. The runner tab only appears when at
118
+ * least one descriptor is supplied (a query/mutation/action's `kind` is
119
+ * compile-time-only, so it must be named here).
120
+ */
121
+ readonly functions?: FunctionDescriptor[];
122
+ /** Reuse an existing Lingui instance (wins over `locale`). */
123
+ readonly i18n?: I18n;
124
+ /** Shard key every shard-scoped panel targets on first load. */
125
+ readonly initialShardKey?: string;
126
+ /** Active locale for the studio's own UI strings. Defaults to `en`. */
127
+ readonly locale?: string;
128
+ /**
129
+ * Inline OpenAPI 3.1 document rendered by the API tab's reference sub-view.
130
+ * Thread the generated `_generated/openapi.json` here to render it
131
+ * without a round-trip. When omitted the reference fetches the worker's
132
+ * admin-gated `GET /_lunora/admin/openapi` endpoint via the client.
133
+ */
134
+ readonly openApiSpec?: unknown;
135
+ /**
136
+ * Inline OpenRPC 1.x document rendered by the API tab's reference sub-view
137
+ * when the OpenRPC format is selected. Thread the generated
138
+ * `_generated/openrpc.json` here to render it without a round-trip. When
139
+ * omitted the OpenRPC view fetches the worker's admin-gated
140
+ * `GET /_lunora/admin/openrpc` endpoint via the client.
141
+ */
142
+ readonly openRpcSpec?: unknown;
143
+ /**
144
+ * Allow the function runner to execute a function AS a chosen authenticated
145
+ * identity (the "Run as identity" tool), so an operator can test auth + RLS
146
+ * behavior. Security-sensitive: it forges identity on an admin-gated RPC, so
147
+ * the host MUST set this only on a trusted loopback-dev gate (the same gate
148
+ * as `dataEditable`) — never in a production/static deploy. Off by default;
149
+ * see {@link FunctionRunner}.
150
+ */
151
+ readonly runAsIdentity?: boolean;
152
+ /**
153
+ * Override how the schedule tab cancels a job. Defaults to the client's
154
+ * scheduler admin endpoint; see {@link SchedulePanel}.
155
+ */
156
+ readonly scheduledCancel?: SchedulePanelProps["scheduledCancel"];
157
+ /**
158
+ * Override how the schedule tab's Cron triggers sub-view loads triggers.
159
+ * Defaults to the client's `/_lunora/admin/cron-jobs` endpoint; see
160
+ * {@link SchedulePanel}.
161
+ */
162
+ readonly scheduledCron?: SchedulePanelProps["loadCronJobs"];
163
+ /**
164
+ * Override how the schedule tab loads jobs. Defaults to the client's
165
+ * scheduler admin endpoint, so the tab works without extra wiring.
166
+ */
167
+ readonly scheduledLoad?: SchedulePanelProps["scheduledLoad"];
168
+ /**
169
+ * Enable the visual schema editor overlay on the schema diagram (add table /
170
+ * column / index, written back to `lunora/schema.ts` + codegen). Off by default
171
+ * so the diagram stays read-only unless a host opts in. Like {@link
172
+ * StudioProps.dataEditable}, only the loopback-only dev hosts set this — the
173
+ * write path needs the project's filesystem + toolchain, so a static deploy
174
+ * leaves it off.
175
+ */
176
+ readonly schemaEditable?: boolean;
177
+ }
178
+ /**
179
+ * Top-bar + sidebar-footer chrome the `StudioApp` owns (theme + admin
180
+ * token state, the rules banner) but which renders *inside* the router-owned
181
+ * {@link StudioLayout} (the header and sidebar footer). The layout is a route
182
+ * component with no props, so it reads this from context rather than threading
183
+ * it through the router. Absent (composing `&lt;Studio>` bare) the layout simply
184
+ * omits those affordances.
185
+ */
186
+ interface StudioChrome {
187
+ readonly clearToken: () => void;
188
+ readonly onTokenChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
189
+ readonly rulesInstalled?: boolean;
190
+ readonly token: string;
191
+ }
192
+ /**
193
+ * The composable studio. {@link StudioShell} reads its strings from `useT`,
194
+ * which needs a `StudioI18nProvider` above it.
195
+ *
196
+ * When an `i18n` instance or a `locale` is supplied, this owns a provider so the
197
+ * studio localises itself standalone. When neither is given it renders the
198
+ * shell bare and inherits whatever provider is already in scope — the host app's
199
+ * (`StudioApp` owns one for the top bar too) or the shared default — instead
200
+ * of nesting a second, redundant provider.
201
+ */
202
+ declare const Studio: ({ basePath, chrome, dataEditable, functions, i18n, initialShardKey, locale, openApiSpec, openRpcSpec, runAsIdentity, schemaEditable, scheduledCancel, scheduledCron, scheduledLoad }: StudioProps) => ReactElement;
203
+ interface StudioAppProps {
204
+ /**
205
+ * Admin bearer token to send with every admin request. When omitted the app
206
+ * renders a small prompt so an operator can paste it at runtime — handy in
207
+ * dev where you don't want to bake the token into a bundle.
208
+ */
209
+ readonly adminToken?: string;
210
+ /**
211
+ * URL path prefix the studio is mounted under (router `basepath`). Defaults
212
+ * to `/`. The `@lunora/vite` dev route sets `/__lunora`. Forwarded to the
213
+ * composed {@link Studio}.
214
+ */
215
+ readonly basePath?: string;
216
+ /**
217
+ * Base URL of the Lunora worker the studio talks to. Defaults to the
218
+ * current origin, which is correct when the studio is served from the
219
+ * same worker (the `@lunora/vite` dev route) or proxied to it.
220
+ */
221
+ readonly baseUrl?: string;
222
+ /**
223
+ * Inject a pre-built client instead of constructing one from `baseUrl` +
224
+ * the admin token. Used by the dev mock harness (and embeddings that own
225
+ * the client) so the chrome renders against a supplied client; when set,
226
+ * `baseUrl`/`adminToken` are ignored and this client is never closed here.
227
+ */
228
+ readonly client?: LunoraClient;
229
+ /** UI language for the studio's own strings. Defaults to `en`. */
230
+ readonly locale?: string;
231
+ /**
232
+ * Whether the project's Lunora agent skills ("rules") are installed. When
233
+ * explicitly `false`, the studio shows a one-line banner pointing at
234
+ * `lunora rules install`. The loopback dev hosts inject this; a static deploy
235
+ * leaves it unset (no banner).
236
+ */
237
+ readonly rulesInstalled?: boolean;
238
+ /** Forwarded to the composed {@link Studio} (functions, initialShardKey, scheduled overrides). */
239
+ readonly studio?: Omit<StudioProps, "children" | "chrome" | "i18n" | "locale">;
240
+ }
241
+ /**
242
+ * A fully self-contained studio page: it constructs a {@link LunoraClient}
243
+ * pointed at the worker, wires it through a `&lt;LunoraProvider>`, manages the
244
+ * admin token + theme, and renders the composed {@link Studio} — handing it the
245
+ * top-bar/sidebar {@link StudioChrome} (theme toggle, admin-token popover, rules
246
+ * banner) so those affordances render inside the sidebar shell.
247
+ *
248
+ * Mount this directly (the standalone app and the `@lunora/vite` dev route both
249
+ * do) when you want the batteries-included page rather than composing panels
250
+ * yourself. For embedding into an existing admin UI, use the individual panels
251
+ * or `&lt;Studio>` under your own provider instead.
252
+ */
253
+ declare const StudioApp: ({ adminToken, basePath, baseUrl, client: injectedClient, rulesInstalled, studio, locale }?: StudioAppProps) => ReactElement;
254
+ export { FunctionDescriptor as F, RunStatus as R, StudioAppProps as S, FunctionKind as a, ScheduledJobs as b, ScheduledJobsProps as c, Studio as d, StudioApp as e, StudioProps as f, StudioTab as g };
@@ -5,4 +5,4 @@ const CLOUDFLARE_R2_URL = `${CLOUDFLARE_DASH}/r2`;
5
5
  const CLOUDFLARE_D1_URL = `${CLOUDFLARE_DASH}/workers/d1`;
6
6
  const CLOUDFLARE_DURABLE_OBJECTS_URL = `${CLOUDFLARE_DASH}/workers/durable-objects`;
7
7
 
8
- export { CLOUDFLARE_D1_URL as C, CLOUDFLARE_OBSERVABILITY_URL as a, CLOUDFLARE_WORKERS_URL as b, CLOUDFLARE_DURABLE_OBJECTS_URL as c, CLOUDFLARE_R2_URL as d };
8
+ export { CLOUDFLARE_D1_URL as C, CLOUDFLARE_WORKERS_URL as a, CLOUDFLARE_OBSERVABILITY_URL as b, CLOUDFLARE_DURABLE_OBJECTS_URL as c, CLOUDFLARE_R2_URL as d };