@lunora/studio 1.0.0-alpha.52 → 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.
- package/dist/index.d.ts +671 -777
- package/dist/index.js +1 -1
- package/dist/mount.d.ts +10 -10
- package/dist/packem_chunks/FileBrowser.js +1 -1
- package/dist/packem_chunks/LogsPanel.js +90 -51
- package/dist/packem_chunks/MetricsPanel.js +1 -1
- package/dist/packem_chunks/SettingsPanel.js +1 -1
- package/dist/packem_chunks/TableEditor.js +1 -1
- package/dist/packem_chunks/log-drains-panel.js +1 -1
- package/dist/packem_chunks/organizations-panel.js +240 -209
- package/dist/packem_shared/{GlobalDataBrowser-f5Ll2AQK.js → GlobalDataBrowser-D8h1fTL1.js} +1 -1
- package/dist/packem_shared/app.d-__J6S7he.d.ts +254 -0
- package/dist/packem_shared/{cf-links-BZfRdxSE.js → cf-links-SIbyi4Y1.js} +1 -1
- package/dist/standalone/{chunk-OSPEOESV.js → chunk-2MYDFHDZ.js} +1 -1
- package/dist/standalone/{chunk-G465LTLD.js → chunk-3HKJ6FSC.js} +1 -1
- package/dist/standalone/{chunk-SDQE2IUJ.js → chunk-3W4CSGDO.js} +1 -1
- package/dist/standalone/{chunk-RXVQJ4DO.js → chunk-4F72YCTU.js} +1 -1
- package/dist/standalone/{chunk-6TYT447C.js → chunk-4YHXOOK7.js} +1 -1
- package/dist/standalone/{chunk-DBLAQC32.js → chunk-5AXARNJ2.js} +1 -1
- package/dist/standalone/{chunk-IZN4TYMN.js → chunk-5IGHDPEP.js} +1 -1
- package/dist/standalone/{chunk-Q7PYLDZU.js → chunk-6CNL7BUU.js} +1 -1
- package/dist/standalone/{chunk-VLIRTNLA.js → chunk-6PXHT2QI.js} +1 -1
- package/dist/standalone/{chunk-KKJZL75J.js → chunk-777XYTDZ.js} +1 -1
- package/dist/standalone/{chunk-JPILGFXT.js → chunk-7YGTGBP7.js} +1 -1
- package/dist/standalone/{chunk-Q7TKOAGT.js → chunk-ASLE5VQE.js} +1 -1
- package/dist/standalone/{chunk-ZZMGCPXE.js → chunk-B6DIQBOK.js} +1 -1
- package/dist/standalone/{chunk-A3ZJACVT.js → chunk-BR7WLG6X.js} +1 -1
- package/dist/standalone/{chunk-TO6D2PJC.js → chunk-CHNXZYAC.js} +1 -1
- package/dist/standalone/{chunk-WUFVFVHJ.js → chunk-D73WYMRU.js} +1 -1
- package/dist/standalone/{chunk-VZFJI6XE.js → chunk-EXE42KMM.js} +1 -1
- package/dist/standalone/{chunk-LUP4YTBS.js → chunk-FDWXYXOM.js} +1 -1
- package/dist/standalone/{chunk-AITOCPML.js → chunk-FQUNSQLG.js} +1 -1
- package/dist/standalone/{chunk-MDTNVR3G.js → chunk-GRBWXZE4.js} +1 -1
- package/dist/standalone/{chunk-7SN6J4DZ.js → chunk-GVFODXW2.js} +1 -1
- package/dist/standalone/{chunk-CP2EQVLU.js → chunk-H5X5TIWZ.js} +1 -1
- package/dist/standalone/{chunk-T3UCZ5PJ.js → chunk-HFSJCS2N.js} +1 -1
- package/dist/standalone/{chunk-W6JKUZKD.js → chunk-HI373BLB.js} +1 -1
- package/dist/standalone/{chunk-ZETIKSQJ.js → chunk-IDAIBUKJ.js} +1 -1
- package/dist/standalone/{chunk-N4NG7HGI.js → chunk-IDK76JPE.js} +1 -1
- package/dist/standalone/{chunk-KDZJ5A3R.js → chunk-JFT5OIL2.js} +1 -1
- package/dist/standalone/{chunk-ZECNJ4FG.js → chunk-JGCZJNMT.js} +1 -1
- package/dist/standalone/{chunk-XOANGJJP.js → chunk-JZ4X6QMK.js} +1 -1
- package/dist/standalone/{chunk-AVONJCNY.js → chunk-K53QX72G.js} +1 -1
- package/dist/standalone/{chunk-LVH4KLXS.js → chunk-LVDKJBWU.js} +1 -1
- package/dist/standalone/{chunk-KGQGNJJ2.js → chunk-MN4QBJWN.js} +1 -1
- package/dist/standalone/{chunk-WJ6OBCUM.js → chunk-NBLGUSJW.js} +1 -1
- package/dist/standalone/{chunk-DANDBL6P.js → chunk-NEQV5EQC.js} +2 -2
- package/dist/standalone/{chunk-FJV4UNYY.js → chunk-NP7AR65U.js} +1 -1
- package/dist/standalone/{chunk-TSLR3ZU2.js → chunk-NWVHLLPB.js} +1 -1
- package/dist/standalone/{chunk-4ELN4RE4.js → chunk-NYK3PFSC.js} +1 -1
- package/dist/standalone/{chunk-BE24FXAK.js → chunk-ONCMJKJS.js} +1 -1
- package/dist/standalone/chunk-OXHHSUXO.js +1 -0
- package/dist/standalone/{chunk-UX53GWGU.js → chunk-PQKG5GKG.js} +1 -1
- package/dist/standalone/{chunk-LAK5VSPI.js → chunk-QVIPA6UJ.js} +1 -1
- package/dist/standalone/{chunk-IMZKGRPW.js → chunk-R2SUQVIO.js} +1 -1
- package/dist/standalone/{chunk-LDEVBRDZ.js → chunk-REQTQOBK.js} +1 -1
- package/dist/standalone/{chunk-E3FVNRH7.js → chunk-RHYLU4OZ.js} +1 -1
- package/dist/standalone/chunk-S2G7OH5T.js +11 -0
- package/dist/standalone/{chunk-DTPFXYHG.js → chunk-SCH473C7.js} +1 -1
- package/dist/standalone/{chunk-X4QFAAZ5.js → chunk-SWMBBYJU.js} +1 -1
- package/dist/standalone/{chunk-YA6POZJD.js → chunk-SXATIQAK.js} +1 -1
- package/dist/standalone/{chunk-VN2PDOMK.js → chunk-TYMKCYYT.js} +1 -1
- package/dist/standalone/{chunk-2ZL6MXBC.js → chunk-V7RQA6NY.js} +1 -1
- package/dist/standalone/chunk-VXM5H542.js +4 -0
- package/dist/standalone/chunk-W3XY7KL4.js +1 -0
- package/dist/standalone/{chunk-4QA5TWYJ.js → chunk-WAVZATY2.js} +1 -1
- package/dist/standalone/{chunk-FWTZYHX4.js → chunk-WCB3KG7C.js} +1 -1
- package/dist/standalone/chunk-WM2MP5ZK.js +1 -0
- package/dist/standalone/{chunk-EEWKIQUE.js → chunk-WOYQG5AM.js} +1 -1
- package/dist/standalone/{chunk-JM7XBQVK.js → chunk-XCNYUUD6.js} +1 -1
- package/dist/standalone/{chunk-ONSKQCYN.js → chunk-ZSUTV374.js} +1 -1
- package/dist/standalone/{chunk-22C6COGE.js → chunk-ZXLEXF4X.js} +2 -2
- package/dist/standalone/studio.js +1 -1
- package/dist/styles.css +2 -2
- package/package.json +8 -8
- package/dist/packem_shared/app.d-CGdOmLTm.d.ts +0 -300
- package/dist/standalone/chunk-AJ2B326V.js +0 -1
- package/dist/standalone/chunk-KJJ3WM6H.js +0 -4
- package/dist/standalone/chunk-L2YBC2BV.js +0 -11
- package/dist/standalone/chunk-VC5RNEHU.js +0 -1
- package/dist/standalone/chunk-WI7GWFEG.js +0 -1
- /package/dist/standalone/{chunk-ITQKVEP7.js → chunk-5XO36X4C.js} +0 -0
- /package/dist/standalone/{chunk-TQ36RWOP.js → chunk-IYHPYY4A.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FunctionDescriptor } from "./packem_shared/app.d-
|
|
2
|
-
export { type a as FunctionKind, type R as RunStatus, b as ScheduledJobs, type c as ScheduledJobsProps, d as Studio, e as StudioApp, type S as StudioAppProps, type f as StudioProps, type g as StudioTab } from "./packem_shared/app.d-
|
|
1
|
+
import { F as FunctionDescriptor } from "./packem_shared/app.d-__J6S7he.js";
|
|
2
|
+
export { type a as FunctionKind, type R as RunStatus, b as ScheduledJobs, type c as ScheduledJobsProps, d as Studio, e as StudioApp, type S as StudioAppProps, type f as StudioProps, type g as StudioTab } from "./packem_shared/app.d-__J6S7he.js";
|
|
3
3
|
import { ReactElement, ReactNode, ErrorInfo, Component, ChangeEvent } from 'react';
|
|
4
4
|
import { CapturedMail } from '@lunora/mail';
|
|
5
5
|
export type { CapturedMail } from '@lunora/mail';
|
|
@@ -21,17 +21,15 @@ interface CommandPaletteProps {
|
|
|
21
21
|
/** Open the command palette from anywhere (e.g. the top-bar Search button). */
|
|
22
22
|
declare const openCommandPalette: () => void;
|
|
23
23
|
/**
|
|
24
|
-
* Command palette (⌘K / Ctrl-K) — Supabase-style global search. Rendered inside
|
|
25
|
-
* the studio shell so its selection can drive the router's `useNavigate`. Opens
|
|
26
|
-
* on the keyboard shortcut or the {@link OPEN_EVENT} the top-bar Search button
|
|
27
|
-
* dispatches, filters the navigable destinations by a case-insensitive substring
|
|
28
|
-
* over their label and domain, and navigates to the chosen one. Built on the
|
|
29
|
-
* studio's Base UI dialog primitive — no `cmdk`/extra dependency — with a small
|
|
30
|
-
* arrow-key + Enter affordance over the filtered list.
|
|
31
|
-
*/
|
|
32
|
-
declare const CommandPalette: ({
|
|
33
|
-
items
|
|
34
|
-
}: CommandPaletteProps) => ReactElement;
|
|
24
|
+
* Command palette (⌘K / Ctrl-K) — Supabase-style global search. Rendered inside
|
|
25
|
+
* the studio shell so its selection can drive the router's `useNavigate`. Opens
|
|
26
|
+
* on the keyboard shortcut or the {@link OPEN_EVENT} the top-bar Search button
|
|
27
|
+
* dispatches, filters the navigable destinations by a case-insensitive substring
|
|
28
|
+
* over their label and domain, and navigates to the chosen one. Built on the
|
|
29
|
+
* studio's Base UI dialog primitive — no `cmdk`/extra dependency — with a small
|
|
30
|
+
* arrow-key + Enter affordance over the filtered list.
|
|
31
|
+
*/
|
|
32
|
+
declare const CommandPalette: ({ items }: CommandPaletteProps) => ReactElement;
|
|
35
33
|
interface ConfirmButtonProps {
|
|
36
34
|
/** Label for the initial trigger (e.g. `Delete`). */
|
|
37
35
|
readonly children: string;
|
|
@@ -45,33 +43,27 @@ interface ConfirmButtonProps {
|
|
|
45
43
|
readonly testId: string;
|
|
46
44
|
}
|
|
47
45
|
/**
|
|
48
|
-
* A destructive-action button that requires a second click to fire. The first
|
|
49
|
-
* click swaps the trigger for an inline `Confirm` / `Cancel` pair rather than a
|
|
50
|
-
* blocking `window.confirm`, so the guard is testable and non-modal. The
|
|
51
|
-
* trigger keeps its `testId` (so existing tests that click it still reach the
|
|
52
|
-
* first step); the actual action only runs on the `${testId}-confirm` click.
|
|
53
|
-
*/
|
|
54
|
-
declare const ConfirmButton: ({
|
|
55
|
-
children,
|
|
56
|
-
confirmLabel,
|
|
57
|
-
disabled,
|
|
58
|
-
onConfirm,
|
|
59
|
-
testId
|
|
60
|
-
}: ConfirmButtonProps) => ReactElement;
|
|
46
|
+
* A destructive-action button that requires a second click to fire. The first
|
|
47
|
+
* click swaps the trigger for an inline `Confirm` / `Cancel` pair rather than a
|
|
48
|
+
* blocking `window.confirm`, so the guard is testable and non-modal. The
|
|
49
|
+
* trigger keeps its `testId` (so existing tests that click it still reach the
|
|
50
|
+
* first step); the actual action only runs on the `${testId}-confirm` click.
|
|
51
|
+
*/
|
|
52
|
+
declare const ConfirmButton: ({ children, confirmLabel, disabled, onConfirm, testId }: ConfirmButtonProps) => ReactElement;
|
|
61
53
|
/**
|
|
62
|
-
* Live-socket status indicator. Reflects the client's aggregate WebSocket health
|
|
63
|
-
* so an operator can tell a healthy live channel from a silently-dropped socket
|
|
64
|
-
* (a panel showing "Live: on" while the socket is down would otherwise look
|
|
65
|
-
* identical to one that's simply idle).
|
|
66
|
-
*/
|
|
54
|
+
* Live-socket status indicator. Reflects the client's aggregate WebSocket health
|
|
55
|
+
* so an operator can tell a healthy live channel from a silently-dropped socket
|
|
56
|
+
* (a panel showing "Live: on" while the socket is down would otherwise look
|
|
57
|
+
* identical to one that's simply idle).
|
|
58
|
+
*/
|
|
67
59
|
declare const ConnectionBadge: () => ReactElement;
|
|
68
60
|
interface ErrorBoundaryProps {
|
|
69
61
|
readonly children: ReactNode;
|
|
70
62
|
/**
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
63
|
+
* Localised fallback heading. When omitted, falls back to `${label} failed`
|
|
64
|
+
* (or `Something went wrong` with no label). A class component can't use the
|
|
65
|
+
* `useT` hook, so localised text is passed in by its parents.
|
|
66
|
+
*/
|
|
75
67
|
readonly fallbackTitle?: string;
|
|
76
68
|
/** Optional label naming the boundary's region, shown in the fallback. */
|
|
77
69
|
readonly label?: string;
|
|
@@ -82,10 +74,10 @@ interface ErrorBoundaryState {
|
|
|
82
74
|
readonly error: Error | null;
|
|
83
75
|
}
|
|
84
76
|
/**
|
|
85
|
-
* Catches render/lifecycle errors in a panel so one throwing component doesn't
|
|
86
|
-
* blank the whole studio shell. Shows the error message with a "Try again"
|
|
87
|
-
* button that clears the boundary and re-renders its children.
|
|
88
|
-
*/
|
|
77
|
+
* Catches render/lifecycle errors in a panel so one throwing component doesn't
|
|
78
|
+
* blank the whole studio shell. Shows the error message with a "Try again"
|
|
79
|
+
* button that clears the boundary and re-renders its children.
|
|
80
|
+
*/
|
|
89
81
|
declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
90
82
|
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
91
83
|
override state: ErrorBoundaryState;
|
|
@@ -102,27 +94,22 @@ interface ShardInputProps {
|
|
|
102
94
|
readonly value: string;
|
|
103
95
|
}
|
|
104
96
|
/**
|
|
105
|
-
* Shard-key text field shared by every shard-scoped panel. Backed by a
|
|
106
|
-
* `<datalist>` of recently-used shard keys (see {@link loadRecentShards}) so an
|
|
107
|
-
* operator can pick a shard they've visited instead of retyping it — the closest
|
|
108
|
-
* to a shard picker possible without server-side shard enumeration, which
|
|
109
|
-
* Durable Objects don't support. Panels remain responsible for recording a shard
|
|
110
|
-
* as used (via `recordShard`) when they actually query it.
|
|
111
|
-
*/
|
|
112
|
-
declare const ShardInput: ({
|
|
113
|
-
id,
|
|
114
|
-
onChange,
|
|
115
|
-
testId,
|
|
116
|
-
value
|
|
117
|
-
}: ShardInputProps) => ReactElement;
|
|
97
|
+
* Shard-key text field shared by every shard-scoped panel. Backed by a
|
|
98
|
+
* `<datalist>` of recently-used shard keys (see {@link loadRecentShards}) so an
|
|
99
|
+
* operator can pick a shard they've visited instead of retyping it — the closest
|
|
100
|
+
* to a shard picker possible without server-side shard enumeration, which
|
|
101
|
+
* Durable Objects don't support. Panels remain responsible for recording a shard
|
|
102
|
+
* as used (via `recordShard`) when they actually query it.
|
|
103
|
+
*/
|
|
104
|
+
declare const ShardInput: ({ id, onChange, testId, value }: ShardInputProps) => ReactElement;
|
|
118
105
|
declare const ADMIN_FUNCTION_PREFIX = "__lunora_admin__:";
|
|
119
106
|
/**
|
|
120
|
-
* Fully-qualified reserved paths the studio invokes via the client. The
|
|
121
|
-
* `__lunora_admin__:` prefix is spelled out inline rather than interpolated so
|
|
122
|
-
* the values stay emittable under `--isolatedDeclarations`. Every path is
|
|
123
|
-
* intercepted by `ShardDO` before user dispatch and gated by the server's
|
|
124
|
-
* `LUNORA_ADMIN_TOKEN`.
|
|
125
|
-
*/
|
|
107
|
+
* Fully-qualified reserved paths the studio invokes via the client. The
|
|
108
|
+
* `__lunora_admin__:` prefix is spelled out inline rather than interpolated so
|
|
109
|
+
* the values stay emittable under `--isolatedDeclarations`. Every path is
|
|
110
|
+
* intercepted by `ShardDO` before user dispatch and gated by the server's
|
|
111
|
+
* `LUNORA_ADMIN_TOKEN`.
|
|
112
|
+
*/
|
|
126
113
|
declare const ADMIN_FUNCTIONS: {
|
|
127
114
|
readonly clearCapturedMail: "__lunora_admin__:clearCapturedMail";
|
|
128
115
|
readonly clearQueueMessages: "__lunora_admin__:clearQueueMessages";
|
|
@@ -175,10 +162,10 @@ declare const ADMIN_FUNCTIONS: {
|
|
|
175
162
|
/** Comparison a {@link FilterClause} applies, mirroring `@lunora/do`'s `FilterOperator`. `contains` is a substring (LIKE). */
|
|
176
163
|
type FilterOperator = "contains" | "eq" | "gt" | "gte" | "lt" | "lte" | "ne";
|
|
177
164
|
/**
|
|
178
|
-
* One structured column filter passed to `readTablePage`, mirroring `@lunora/do`'s
|
|
179
|
-
* `FilterClause`. AND-combined with the substring search and the other clauses.
|
|
180
|
-
* `value` is sent as-is and bound server-side, so it never injects SQL.
|
|
181
|
-
*/
|
|
165
|
+
* One structured column filter passed to `readTablePage`, mirroring `@lunora/do`'s
|
|
166
|
+
* `FilterClause`. AND-combined with the substring search and the other clauses.
|
|
167
|
+
* `value` is sent as-is and bound server-side, so it never injects SQL.
|
|
168
|
+
*/
|
|
182
169
|
interface FilterClause {
|
|
183
170
|
column: string;
|
|
184
171
|
operator: FilterOperator;
|
|
@@ -223,26 +210,26 @@ interface ShardMetrics {
|
|
|
223
210
|
uptimeMs: number;
|
|
224
211
|
}
|
|
225
212
|
/**
|
|
226
|
-
* One full-scan attribution entry on a {@link FunctionCallStat}, mirroring
|
|
227
|
-
* `@lunora/do`'s `FunctionScanAttribution`: how many times the function
|
|
228
|
-
* full-scanned `table`. The causal evidence behind the "missing index" insight.
|
|
229
|
-
*/
|
|
213
|
+
* One full-scan attribution entry on a {@link FunctionCallStat}, mirroring
|
|
214
|
+
* `@lunora/do`'s `FunctionScanAttribution`: how many times the function
|
|
215
|
+
* full-scanned `table`. The causal evidence behind the "missing index" insight.
|
|
216
|
+
*/
|
|
230
217
|
interface FunctionScanAttribution {
|
|
231
218
|
scans: number;
|
|
232
219
|
table: string;
|
|
233
220
|
}
|
|
234
221
|
/**
|
|
235
|
-
* Per-function execution counters returned by `__lunora_admin__:getFunctionStats`
|
|
236
|
-
* for one shard. Mirrors `@lunora/do`'s `FunctionCallStat`. Counters are
|
|
237
|
-
* per-DO-instance and reset on hibernation/restart — a "since this instance
|
|
238
|
-
* woke" readout. Durations are handler wall-clock milliseconds.
|
|
239
|
-
*
|
|
240
|
-
* `scans` / `scannedTables` carry the causal full-scan attribution (PLAN3 1.2).
|
|
241
|
-
* They're additive — a worker predating the feature reports `scans: 0` and
|
|
242
|
-
* `scannedTables: []`, so the fields are optional on the wire and the consumer
|
|
243
|
-
* defaults them. `conflicts` (OCC write-contention count, a subset of `errors`)
|
|
244
|
-
* is likewise additive and optional for the same back-compat reason.
|
|
245
|
-
*/
|
|
222
|
+
* Per-function execution counters returned by `__lunora_admin__:getFunctionStats`
|
|
223
|
+
* for one shard. Mirrors `@lunora/do`'s `FunctionCallStat`. Counters are
|
|
224
|
+
* per-DO-instance and reset on hibernation/restart — a "since this instance
|
|
225
|
+
* woke" readout. Durations are handler wall-clock milliseconds.
|
|
226
|
+
*
|
|
227
|
+
* `scans` / `scannedTables` carry the causal full-scan attribution (PLAN3 1.2).
|
|
228
|
+
* They're additive — a worker predating the feature reports `scans: 0` and
|
|
229
|
+
* `scannedTables: []`, so the fields are optional on the wire and the consumer
|
|
230
|
+
* defaults them. `conflicts` (OCC write-contention count, a subset of `errors`)
|
|
231
|
+
* is likewise additive and optional for the same back-compat reason.
|
|
232
|
+
*/
|
|
246
233
|
interface FunctionCallStat {
|
|
247
234
|
calls: number;
|
|
248
235
|
/** OCC write-conflict count — a subset of `errors`; absent on a pre-conflict-tracking worker. */
|
|
@@ -265,11 +252,11 @@ interface FunctionStatsResult {
|
|
|
265
252
|
sinceMs: number;
|
|
266
253
|
}
|
|
267
254
|
/**
|
|
268
|
-
* One declared index on a table, mirroring `@lunora/do`'s `TableIndexInfo`.
|
|
269
|
-
* `type` is the index kind; `fields` the indexed columns (sort fields for rank,
|
|
270
|
-
* text + filter fields for search, source field for vector); `unique` is set
|
|
271
|
-
* only for unique secondary indexes.
|
|
272
|
-
*/
|
|
255
|
+
* One declared index on a table, mirroring `@lunora/do`'s `TableIndexInfo`.
|
|
256
|
+
* `type` is the index kind; `fields` the indexed columns (sort fields for rank,
|
|
257
|
+
* text + filter fields for search, source field for vector); `unique` is set
|
|
258
|
+
* only for unique secondary indexes.
|
|
259
|
+
*/
|
|
273
260
|
interface TableIndexInfo {
|
|
274
261
|
fields: string[];
|
|
275
262
|
name: string;
|
|
@@ -283,14 +270,16 @@ interface TableIndexesResult {
|
|
|
283
270
|
/** Severity of a buffered log entry, mirroring `@lunora/do`'s `LogLevel`. */
|
|
284
271
|
type LogLevel = "debug" | "error" | "info" | "warn";
|
|
285
272
|
/**
|
|
286
|
-
* One buffered log line returned by `__lunora_admin__:getLogs`. `functionPath`
|
|
287
|
-
* is the RPC that produced it (when known); `timestamp` is epoch-ms.
|
|
288
|
-
* `instance`/`exitCode` are populated for container lifecycle entries
|
|
289
|
-
* (`instance` = the per-instance Durable Object id, `exitCode` = the process
|
|
290
|
-
* exit code parsed out of a `stop` event). Mirrors `@lunora/do`'s `LogEntry`.
|
|
291
|
-
*/
|
|
273
|
+
* One buffered log line returned by `__lunora_admin__:getLogs`. `functionPath`
|
|
274
|
+
* is the RPC that produced it (when known); `timestamp` is epoch-ms.
|
|
275
|
+
* `instance`/`exitCode` are populated for container lifecycle entries
|
|
276
|
+
* (`instance` = the per-instance Durable Object id, `exitCode` = the process
|
|
277
|
+
* exit code parsed out of a `stop` event). Mirrors `@lunora/do`'s `LogEntry`.
|
|
278
|
+
*/
|
|
292
279
|
interface LogEntry {
|
|
293
280
|
exitCode?: number;
|
|
281
|
+
/** Structured fields from a `ctx.log.<level>(message, fields)` / `ctx.log.with(fields)` call, when present. */
|
|
282
|
+
fields?: Record<string, unknown>;
|
|
294
283
|
functionPath?: string;
|
|
295
284
|
instance?: string;
|
|
296
285
|
level: LogLevel;
|
|
@@ -302,13 +291,13 @@ interface LogsResult {
|
|
|
302
291
|
entries: LogEntry[];
|
|
303
292
|
}
|
|
304
293
|
/**
|
|
305
|
-
* One recorded admin operation returned by `__lunora_admin__:getAuditLog`,
|
|
306
|
-
* mirroring `@lunora/do`'s `AuditEntry`. Unlike the in-memory logs, the audit
|
|
307
|
-
* log is durable and survives hibernation/restart. `seq` is a monotonic
|
|
308
|
-
* per-shard cursor; `op` the short op name (`writeRow`, `runMigration`,
|
|
309
|
-
* `importShard`, `applyCdc`); `table`/`id` are present when the op targets one;
|
|
310
|
-
* `detail` carries op-specific context (notably the acting `userId`).
|
|
311
|
-
*/
|
|
294
|
+
* One recorded admin operation returned by `__lunora_admin__:getAuditLog`,
|
|
295
|
+
* mirroring `@lunora/do`'s `AuditEntry`. Unlike the in-memory logs, the audit
|
|
296
|
+
* log is durable and survives hibernation/restart. `seq` is a monotonic
|
|
297
|
+
* per-shard cursor; `op` the short op name (`writeRow`, `runMigration`,
|
|
298
|
+
* `importShard`, `applyCdc`); `table`/`id` are present when the op targets one;
|
|
299
|
+
* `detail` carries op-specific context (notably the acting `userId`).
|
|
300
|
+
*/
|
|
312
301
|
interface AuditEntry {
|
|
313
302
|
detail?: Record<string, unknown>;
|
|
314
303
|
id?: string;
|
|
@@ -322,17 +311,17 @@ interface AuditLogResult {
|
|
|
322
311
|
entries: AuditEntry[];
|
|
323
312
|
}
|
|
324
313
|
/**
|
|
325
|
-
* How a deployment binding/var classifies, mirroring `@lunora/do`'s `SettingKind`.
|
|
326
|
-
* `var` is a plain Worker var, `secret` a sensitive string (always masked), and
|
|
327
|
-
* `binding` a non-string binding object (R2/KV/DO/D1/queue/service).
|
|
328
|
-
*/
|
|
314
|
+
* How a deployment binding/var classifies, mirroring `@lunora/do`'s `SettingKind`.
|
|
315
|
+
* `var` is a plain Worker var, `secret` a sensitive string (always masked), and
|
|
316
|
+
* `binding` a non-string binding object (R2/KV/DO/D1/queue/service).
|
|
317
|
+
*/
|
|
329
318
|
type SettingKind = "binding" | "secret" | "var";
|
|
330
319
|
/**
|
|
331
|
-
* One row of the read-only deployment-settings view, mirroring `@lunora/do`'s
|
|
332
|
-
* `SettingEntry`. `value` is a masked preview for `var`/`secret` strings (never
|
|
333
|
-
* the raw secret) and `null` for `binding` entries. The server masks every
|
|
334
|
-
* string value, so the studio only ever renders the masked text.
|
|
335
|
-
*/
|
|
320
|
+
* One row of the read-only deployment-settings view, mirroring `@lunora/do`'s
|
|
321
|
+
* `SettingEntry`. `value` is a masked preview for `var`/`secret` strings (never
|
|
322
|
+
* the raw secret) and `null` for `binding` entries. The server masks every
|
|
323
|
+
* string value, so the studio only ever renders the masked text.
|
|
324
|
+
*/
|
|
336
325
|
interface SettingEntry {
|
|
337
326
|
/** Coarse runtime class for `binding` entries (`r2`, `kv`, `durable-object`, …). */
|
|
338
327
|
bindingType?: string;
|
|
@@ -341,10 +330,10 @@ interface SettingEntry {
|
|
|
341
330
|
value: null | string;
|
|
342
331
|
}
|
|
343
332
|
/**
|
|
344
|
-
* Best-effort deploy metadata, mirroring `@lunora/do`'s `DeployInfo`. Every
|
|
345
|
-
* field is optional: the server reads only what the Worker `env` exposes and
|
|
346
|
-
* omits the rest.
|
|
347
|
-
*/
|
|
333
|
+
* Best-effort deploy metadata, mirroring `@lunora/do`'s `DeployInfo`. Every
|
|
334
|
+
* field is optional: the server reads only what the Worker `env` exposes and
|
|
335
|
+
* omits the rest.
|
|
336
|
+
*/
|
|
348
337
|
interface DeployInfo {
|
|
349
338
|
deploymentId?: string;
|
|
350
339
|
environment?: string;
|
|
@@ -357,24 +346,24 @@ interface SettingsResult {
|
|
|
357
346
|
settings: SettingEntry[];
|
|
358
347
|
}
|
|
359
348
|
/**
|
|
360
|
-
* Ordering/visual weight of a {@link SecurityFinding}, mirroring `@lunora/do`'s
|
|
361
|
-
* `SecurityFindingLevel`. Shares the studio's insight-severity vocabulary so the
|
|
362
|
-
* Security and Performance advisors render with one badge palette.
|
|
363
|
-
*/
|
|
349
|
+
* Ordering/visual weight of a {@link SecurityFinding}, mirroring `@lunora/do`'s
|
|
350
|
+
* `SecurityFindingLevel`. Shares the studio's insight-severity vocabulary so the
|
|
351
|
+
* Security and Performance advisors render with one badge palette.
|
|
352
|
+
*/
|
|
364
353
|
type SecurityFindingLevel = "error" | "info" | "warning";
|
|
365
354
|
/**
|
|
366
|
-
* Which deployment-level security heuristic fired, mirroring `@lunora/do`'s
|
|
367
|
-
* `SecurityFindingKind`. The studio maps each kind to a localized title,
|
|
368
|
-
* explanation, and remediation hint; the wire payload carries only the kind,
|
|
369
|
-
* level, and optional `detail`.
|
|
370
|
-
*/
|
|
355
|
+
* Which deployment-level security heuristic fired, mirroring `@lunora/do`'s
|
|
356
|
+
* `SecurityFindingKind`. The studio maps each kind to a localized title,
|
|
357
|
+
* explanation, and remediation hint; the wire payload carries only the kind,
|
|
358
|
+
* level, and optional `detail`.
|
|
359
|
+
*/
|
|
371
360
|
type SecurityFindingKind = "admin-token-weak" | "auth-secret-weak" | "cookies-insecure" | "cors-wildcard-credentials" | "csrf-disabled" | "dev-args-unredacted" | "security-headers-disabled" | "ws-gate-open";
|
|
372
361
|
/**
|
|
373
|
-
* One detected security issue from `__lunora_admin__:getSecurityAudit`, mirroring
|
|
374
|
-
* `@lunora/do`'s `SecurityFinding`. `detail` carries kind-specific context the
|
|
375
|
-
* studio interpolates into the localized copy (e.g. `{ length, min }` for a weak
|
|
376
|
-
* admin token); absent when the kind needs none.
|
|
377
|
-
*/
|
|
362
|
+
* One detected security issue from `__lunora_admin__:getSecurityAudit`, mirroring
|
|
363
|
+
* `@lunora/do`'s `SecurityFinding`. `detail` carries kind-specific context the
|
|
364
|
+
* studio interpolates into the localized copy (e.g. `{ length, min }` for a weak
|
|
365
|
+
* admin token); absent when the kind needs none.
|
|
366
|
+
*/
|
|
378
367
|
interface SecurityFinding {
|
|
379
368
|
detail?: Record<string, unknown>;
|
|
380
369
|
kind: SecurityFindingKind;
|
|
@@ -396,10 +385,10 @@ interface TablePage {
|
|
|
396
385
|
refs?: Record<string, string>;
|
|
397
386
|
rows: Record<string, unknown>[];
|
|
398
387
|
/**
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
388
|
+
* Total rows matching the predicate. Absent when the read passed
|
|
389
|
+
* `skipCount: true` — the data browser sources the count from a separate,
|
|
390
|
+
* predicate-keyed read so paging never re-runs the COUNT.
|
|
391
|
+
*/
|
|
403
392
|
total?: number;
|
|
404
393
|
}
|
|
405
394
|
/** Direction a data migration is run in. Mirrors `@lunora/do`. */
|
|
@@ -407,9 +396,9 @@ type MigrationDirection = "down" | "up";
|
|
|
407
396
|
/** Lifecycle of a data-migration run. Mirrors `@lunora/do`. */
|
|
408
397
|
type MigrationStatus = "completed" | "failed" | "in_progress";
|
|
409
398
|
/**
|
|
410
|
-
* One persisted migration run-state row, as returned by the
|
|
411
|
-
* `__lunora_admin__:migrationStatus` RPC (`{ migrations: MigrationStatusRow[] }`).
|
|
412
|
-
*/
|
|
399
|
+
* One persisted migration run-state row, as returned by the
|
|
400
|
+
* `__lunora_admin__:migrationStatus` RPC (`{ migrations: MigrationStatusRow[] }`).
|
|
401
|
+
*/
|
|
413
402
|
interface MigrationStatusRow {
|
|
414
403
|
changed: number;
|
|
415
404
|
cursor: null | string;
|
|
@@ -458,23 +447,23 @@ interface ImportShardResult {
|
|
|
458
447
|
inserted: Record<string, number>;
|
|
459
448
|
}
|
|
460
449
|
/**
|
|
461
|
-
* One shard's request total from the worker's `POST /_lunora/admin/shard-traffic`
|
|
462
|
-
* endpoint, mirroring `@lunora/runtime`'s `ShardTrafficEntry`. `requests` is the
|
|
463
|
-
* shard's lifetime dispatch count (`0` for a shard that failed/timed out);
|
|
464
|
-
* `shardKey` is the DO id name (`""` for the root shard). The cross-shard feed
|
|
465
|
-
* the `hot_shard` runtime advisor consumes to compute skew.
|
|
466
|
-
*/
|
|
450
|
+
* One shard's request total from the worker's `POST /_lunora/admin/shard-traffic`
|
|
451
|
+
* endpoint, mirroring `@lunora/runtime`'s `ShardTrafficEntry`. `requests` is the
|
|
452
|
+
* shard's lifetime dispatch count (`0` for a shard that failed/timed out);
|
|
453
|
+
* `shardKey` is the DO id name (`""` for the root shard). The cross-shard feed
|
|
454
|
+
* the `hot_shard` runtime advisor consumes to compute skew.
|
|
455
|
+
*/
|
|
467
456
|
interface ShardTrafficEntry {
|
|
468
457
|
requests: number;
|
|
469
458
|
shardKey: string;
|
|
470
459
|
}
|
|
471
460
|
/**
|
|
472
|
-
* Payload of a `POST /_lunora/admin/shard-traffic` call, mirroring the runtime
|
|
473
|
-
* coordinator's shard-traffic fan-out result: one `{ shardKey, requests }` entry
|
|
474
|
-
* per live shard plus the ok / failed counts. Fanned out on demand (not on the
|
|
475
|
-
* metrics hot path) so the panel can feed `hot_shard` the whole shard set's
|
|
476
|
-
* request volumes.
|
|
477
|
-
*/
|
|
461
|
+
* Payload of a `POST /_lunora/admin/shard-traffic` call, mirroring the runtime
|
|
462
|
+
* coordinator's shard-traffic fan-out result: one `{ shardKey, requests }` entry
|
|
463
|
+
* per live shard plus the ok / failed counts. Fanned out on demand (not on the
|
|
464
|
+
* metrics hot path) so the panel can feed `hot_shard` the whole shard set's
|
|
465
|
+
* request volumes.
|
|
466
|
+
*/
|
|
478
467
|
interface ShardTrafficResult {
|
|
479
468
|
failed: number;
|
|
480
469
|
ok: number;
|
|
@@ -483,25 +472,25 @@ interface ShardTrafficResult {
|
|
|
483
472
|
/** Visual + ordering weight of a detected issue. */
|
|
484
473
|
type InsightSeverity = "error" | "info" | "warning";
|
|
485
474
|
/**
|
|
486
|
-
* Which heuristic fired. The panel maps each kind to a localized title/detail,
|
|
487
|
-
* so the detection stays free of presentation strings (and trivially testable).
|
|
488
|
-
*
|
|
489
|
-
* `missing-index` is the causal upgrade of `slow-function`: a slow function
|
|
490
|
-
* whose latency is explained by a full-table scan. When the scan attribution
|
|
491
|
-
* pins the cause, the insight names the scanned table(s) (`tables`) and deep-
|
|
492
|
-
* links to the Schema/Indexes tab to add the index, rather than leaving the
|
|
493
|
-
* slowness an unattributed symptom.
|
|
494
|
-
*/
|
|
475
|
+
* Which heuristic fired. The panel maps each kind to a localized title/detail,
|
|
476
|
+
* so the detection stays free of presentation strings (and trivially testable).
|
|
477
|
+
*
|
|
478
|
+
* `missing-index` is the causal upgrade of `slow-function`: a slow function
|
|
479
|
+
* whose latency is explained by a full-table scan. When the scan attribution
|
|
480
|
+
* pins the cause, the insight names the scanned table(s) (`tables`) and deep-
|
|
481
|
+
* links to the Schema/Indexes tab to add the index, rather than leaving the
|
|
482
|
+
* slowness an unattributed symptom.
|
|
483
|
+
*/
|
|
495
484
|
type InsightKind = "high-error-rate" | "high-evictions" | "high-write-contention" | "low-cache-hit-rate" | "missing-index" | "slow-function";
|
|
496
485
|
/**
|
|
497
|
-
* One detected issue. `value` is the headline number whose meaning depends on
|
|
498
|
-
* `kind`: a 0–1 rate for cache-hit / error-rate, a millisecond figure for
|
|
499
|
-
* slow-function / missing-index, an entry count for evictions. `fn` is set only
|
|
500
|
-
* for per-function insights; `message` carries the last error for
|
|
501
|
-
* high-error-rate; `tables` carries the full-scanned tables (busiest first) for
|
|
502
|
-
* the causal `missing-index` kind. For `high-write-contention` it is the OCC
|
|
503
|
-
* conflict ratio (conflicts / calls).
|
|
504
|
-
*/
|
|
486
|
+
* One detected issue. `value` is the headline number whose meaning depends on
|
|
487
|
+
* `kind`: a 0–1 rate for cache-hit / error-rate, a millisecond figure for
|
|
488
|
+
* slow-function / missing-index, an entry count for evictions. `fn` is set only
|
|
489
|
+
* for per-function insights; `message` carries the last error for
|
|
490
|
+
* high-error-rate; `tables` carries the full-scanned tables (busiest first) for
|
|
491
|
+
* the causal `missing-index` kind. For `high-write-contention` it is the OCC
|
|
492
|
+
* conflict ratio (conflicts / calls).
|
|
493
|
+
*/
|
|
505
494
|
interface Insight {
|
|
506
495
|
fn?: string;
|
|
507
496
|
kind: InsightKind;
|
|
@@ -529,181 +518,165 @@ interface InsightThresholds {
|
|
|
529
518
|
}
|
|
530
519
|
declare const DEFAULT_INSIGHT_THRESHOLDS: InsightThresholds;
|
|
531
520
|
/**
|
|
532
|
-
* Derive a prioritised list of issues from the two snapshots the studio
|
|
533
|
-
* already pulls — the `getMetrics` health snapshot and the `getFunctionStats`
|
|
534
|
-
* per-function table. Pure and side-effect-free: same inputs, same output, so
|
|
535
|
-
* the heuristics can be unit-tested without rendering.
|
|
536
|
-
*
|
|
537
|
-
* Heuristics: low-cache-hit-rate (cache below the threshold once enough samples
|
|
538
|
-
* exist — a cold cache isn't a problem); high-evictions (more evictions than
|
|
539
|
-
* hits, so the cache is too small or churning on invalidation); missing-index (a
|
|
540
|
-
* slow function whose latency is *explained* by a full-table scan — the causal
|
|
541
|
-
* upgrade of slow-function, naming the scanned table(s)); slow-function (a
|
|
542
|
-
* function whose slowest call crosses the threshold with no scan attribution to
|
|
543
|
-
* blame); high-error-rate (a function failing over a meaningful count);
|
|
544
|
-
* high-write-contention (a function whose OCC write conflicts make up a
|
|
545
|
-
* meaningful share of calls — a sharding candidate).
|
|
546
|
-
*
|
|
547
|
-
* A slow function with full-scan attribution emits `missing-index` (causal, with
|
|
548
|
-
* `tables`) instead of the bare `slow-function`, so the panel can link straight
|
|
549
|
-
* to the fix rather than restating the symptom.
|
|
550
|
-
*/
|
|
521
|
+
* Derive a prioritised list of issues from the two snapshots the studio
|
|
522
|
+
* already pulls — the `getMetrics` health snapshot and the `getFunctionStats`
|
|
523
|
+
* per-function table. Pure and side-effect-free: same inputs, same output, so
|
|
524
|
+
* the heuristics can be unit-tested without rendering.
|
|
525
|
+
*
|
|
526
|
+
* Heuristics: low-cache-hit-rate (cache below the threshold once enough samples
|
|
527
|
+
* exist — a cold cache isn't a problem); high-evictions (more evictions than
|
|
528
|
+
* hits, so the cache is too small or churning on invalidation); missing-index (a
|
|
529
|
+
* slow function whose latency is *explained* by a full-table scan — the causal
|
|
530
|
+
* upgrade of slow-function, naming the scanned table(s)); slow-function (a
|
|
531
|
+
* function whose slowest call crosses the threshold with no scan attribution to
|
|
532
|
+
* blame); high-error-rate (a function failing over a meaningful count);
|
|
533
|
+
* high-write-contention (a function whose OCC write conflicts make up a
|
|
534
|
+
* meaningful share of calls — a sharding candidate).
|
|
535
|
+
*
|
|
536
|
+
* A slow function with full-scan attribution emits `missing-index` (causal, with
|
|
537
|
+
* `tables`) instead of the bare `slow-function`, so the panel can link straight
|
|
538
|
+
* to the fix rather than restating the symptom.
|
|
539
|
+
*/
|
|
551
540
|
declare const deriveInsights: (metrics: ShardMetrics | null, functions: FunctionCallStat[] | null, thresholds?: InsightThresholds) => Insight[];
|
|
552
541
|
interface InsightsPanelProps {
|
|
553
542
|
/** Shard key the snapshots target on first load. Defaults to the root shard. */
|
|
554
543
|
readonly initialShardKey?: string;
|
|
555
544
|
/**
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
545
|
+
* Fan the cross-shard traffic feed out for `table`, returning each shard's
|
|
546
|
+
* `{ shardKey, requests }` total — the input the `hot_shard` advisor lint
|
|
547
|
+
* needs. Defaults to `client.shardTraffic(table)` (the admin-gated
|
|
548
|
+
* `POST /_lunora/admin/shard-traffic` fan-out). Best-effort: a rejection
|
|
549
|
+
* leaves `hot_shard` dormant rather than blanking the panel. Injectable so
|
|
550
|
+
* tests can drive the skew without a worker.
|
|
551
|
+
*/
|
|
563
552
|
readonly loadShardTraffic?: (table: string) => Promise<ShardTrafficResult>;
|
|
564
553
|
}
|
|
565
554
|
/**
|
|
566
|
-
* The Performance Advisor — a 1-to-1 of Supabase's Performance Advisor: severity
|
|
567
|
-
* tabs over a findings table (via {@link AdvisorView}). It pulls the `getMetrics`
|
|
568
|
-
* health snapshot and `getFunctionStats` per-function table for one shard, then
|
|
569
|
-
* maps the issues {@link deriveInsights} detects (low cache hit rate, high
|
|
570
|
-
* eviction, slow functions, missing indexes, error spikes) into rows. A
|
|
571
|
-
* `missing-index` row carries an inline "add the index" jump to the Schema tab.
|
|
572
|
-
* Both reads are best-effort — one failing still yields the other's insights.
|
|
573
|
-
*/
|
|
574
|
-
declare const InsightsPanel: ({
|
|
575
|
-
initialShardKey,
|
|
576
|
-
loadShardTraffic
|
|
577
|
-
}: InsightsPanelProps) => ReactElement;
|
|
555
|
+
* The Performance Advisor — a 1-to-1 of Supabase's Performance Advisor: severity
|
|
556
|
+
* tabs over a findings table (via {@link AdvisorView}). It pulls the `getMetrics`
|
|
557
|
+
* health snapshot and `getFunctionStats` per-function table for one shard, then
|
|
558
|
+
* maps the issues {@link deriveInsights} detects (low cache hit rate, high
|
|
559
|
+
* eviction, slow functions, missing indexes, error spikes) into rows. A
|
|
560
|
+
* `missing-index` row carries an inline "add the index" jump to the Schema tab.
|
|
561
|
+
* Both reads are best-effort — one failing still yields the other's insights.
|
|
562
|
+
*/
|
|
563
|
+
declare const InsightsPanel: ({ initialShardKey, loadShardTraffic }: InsightsPanelProps) => ReactElement;
|
|
578
564
|
/**
|
|
579
|
-
* The Security Advisor — a 1-to-1 of Supabase's Security Advisor: severity tabs
|
|
580
|
-
* (Errors / Warnings / Info) over a findings table. It pulls `getSecurityAudit`
|
|
581
|
-
* (deployment-wide, so it targets the root shard and needs no shard selector) and
|
|
582
|
-
* maps each finding the server derived from the Worker `env` — weak admin token,
|
|
583
|
-
* an open WebSocket gate, a dev-mode request log keeping un-redacted args — into a
|
|
584
|
-
* row. These are signals only lunora can surface: Cloudflare's dashboard can't
|
|
585
|
-
* reason about lunora's admin/WS gates or its log-redaction policy.
|
|
586
|
-
*/
|
|
565
|
+
* The Security Advisor — a 1-to-1 of Supabase's Security Advisor: severity tabs
|
|
566
|
+
* (Errors / Warnings / Info) over a findings table. It pulls `getSecurityAudit`
|
|
567
|
+
* (deployment-wide, so it targets the root shard and needs no shard selector) and
|
|
568
|
+
* maps each finding the server derived from the Worker `env` — weak admin token,
|
|
569
|
+
* an open WebSocket gate, a dev-mode request log keeping un-redacted args — into a
|
|
570
|
+
* row. These are signals only lunora can surface: Cloudflare's dashboard can't
|
|
571
|
+
* reason about lunora's admin/WS gates or its log-redaction policy.
|
|
572
|
+
*/
|
|
587
573
|
declare const SecurityAdvisorPanel: () => ReactElement;
|
|
588
574
|
interface ApiDocsPanelProps {
|
|
589
575
|
/**
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
576
|
+
* Registered functions to document. Mirrors the list the Functions tab's
|
|
577
|
+
* runner and stats panels receive — a query/mutation/action's `kind` is
|
|
578
|
+
* compile-time-only, so it must be named here. When omitted the panel still
|
|
579
|
+
* renders (tables come from the admin RPC) and shows an empty functions list.
|
|
580
|
+
*/
|
|
595
581
|
readonly functions?: FunctionDescriptor[];
|
|
596
582
|
/** Shard key the table list is read from. Defaults to the root shard. */
|
|
597
583
|
readonly initialShardKey?: string;
|
|
598
584
|
}
|
|
599
|
-
/** Inputs every function snippet builder closes over — the split path plus its `kind`. */
|
|
600
585
|
/**
|
|
601
|
-
* Per-resource "how to call this from your app" browser, generated from the
|
|
602
|
-
* registered functions and tables the studio already has — no new endpoints.
|
|
603
|
-
* The left rail lists functions grouped by file plus a Tables section; the right
|
|
604
|
-
* pane shows copy-paste snippets (React / Client / CLI for functions; the typed
|
|
605
|
-
* data-model usage for tables).
|
|
606
|
-
*
|
|
607
|
-
* Args are a placeholder: the real argument shape lives in the codegen'd `api`
|
|
608
|
-
* types this browser never loads, the same way Supabase's usage snippets show
|
|
609
|
-
* placeholders.
|
|
610
|
-
*/
|
|
611
|
-
declare const ApiDocsPanel: ({
|
|
612
|
-
functions,
|
|
613
|
-
initialShardKey
|
|
614
|
-
}: ApiDocsPanelProps) => ReactElement;
|
|
586
|
+
* Per-resource "how to call this from your app" browser, generated from the
|
|
587
|
+
* registered functions and tables the studio already has — no new endpoints.
|
|
588
|
+
* The left rail lists functions grouped by file plus a Tables section; the right
|
|
589
|
+
* pane shows copy-paste snippets (React / Client / CLI for functions; the typed
|
|
590
|
+
* data-model usage for tables).
|
|
591
|
+
*
|
|
592
|
+
* Args are a placeholder: the real argument shape lives in the codegen'd `api`
|
|
593
|
+
* types this browser never loads, the same way Supabase's usage snippets show
|
|
594
|
+
* placeholders.
|
|
595
|
+
*/
|
|
596
|
+
declare const ApiDocsPanel: ({ functions, initialShardKey }: ApiDocsPanelProps) => ReactElement;
|
|
615
597
|
interface ApiReferencePanelProps {
|
|
616
598
|
/**
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
599
|
+
* Inline OpenAPI document. When supplied the panel renders it directly and
|
|
600
|
+
* skips the fetch — used by the mock harness and by hosts that already hold
|
|
601
|
+
* the generated spec. When omitted the panel fetches the worker's
|
|
602
|
+
* admin-gated `GET /_lunora/admin/openapi` endpoint via the client.
|
|
603
|
+
*/
|
|
622
604
|
readonly spec?: unknown;
|
|
623
605
|
}
|
|
624
606
|
/**
|
|
625
|
-
* In-studio OpenAPI reference: renders the generated OpenAPI 3.1 document with
|
|
626
|
-
* the studio-native {@link ReferenceView} — a tag-grouped operation browser,
|
|
627
|
-
* schema tables, a live "try it" console, and copy-paste request samples, all
|
|
628
|
-
* themed to the studio. The spec comes from an inline
|
|
629
|
-
* {@link ApiReferencePanelProps.spec} prop, or — by default — the worker's
|
|
630
|
-
* admin-gated `GET /_lunora/admin/openapi` endpoint fetched through the client.
|
|
631
|
-
*
|
|
632
|
-
* This replaced the embedded Scalar reference (a Vue app in React): Scalar's
|
|
633
|
-
* portal/overlay layers repeatedly intercepted clicks and froze the tab, and it
|
|
634
|
-
* shipped a multi-megabyte bundle. The native view is overlay-free and reuses
|
|
635
|
-
* the studio's own primitives.
|
|
636
|
-
*/
|
|
637
|
-
declare const ApiReferencePanel: ({
|
|
638
|
-
spec: inlineSpec
|
|
639
|
-
}: ApiReferencePanelProps) => ReactElement;
|
|
607
|
+
* In-studio OpenAPI reference: renders the generated OpenAPI 3.1 document with
|
|
608
|
+
* the studio-native {@link ReferenceView} — a tag-grouped operation browser,
|
|
609
|
+
* schema tables, a live "try it" console, and copy-paste request samples, all
|
|
610
|
+
* themed to the studio. The spec comes from an inline
|
|
611
|
+
* {@link ApiReferencePanelProps.spec} prop, or — by default — the worker's
|
|
612
|
+
* admin-gated `GET /_lunora/admin/openapi` endpoint fetched through the client.
|
|
613
|
+
*
|
|
614
|
+
* This replaced the embedded Scalar reference (a Vue app in React): Scalar's
|
|
615
|
+
* portal/overlay layers repeatedly intercepted clicks and froze the tab, and it
|
|
616
|
+
* shipped a multi-megabyte bundle. The native view is overlay-free and reuses
|
|
617
|
+
* the studio's own primitives.
|
|
618
|
+
*/
|
|
619
|
+
declare const ApiReferencePanel: ({ spec: inlineSpec }: ApiReferencePanelProps) => ReactElement;
|
|
640
620
|
interface ApiTabProps {
|
|
641
621
|
/** Registered functions documented by the snippets sub-view. Threaded host → studio. */
|
|
642
622
|
readonly functions?: FunctionDescriptor[];
|
|
643
623
|
/** Shard key the snippets view reads its table list from. */
|
|
644
624
|
readonly initialShardKey?: string;
|
|
645
625
|
/**
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
626
|
+
* Inline OpenAPI document for the reference sub-view. When omitted the
|
|
627
|
+
* reference fetches the worker's `GET /_lunora/admin/openapi` endpoint.
|
|
628
|
+
*/
|
|
649
629
|
readonly openApiSpec?: unknown;
|
|
650
630
|
/**
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
631
|
+
* Inline OpenRPC document for the reference sub-view's OpenRPC format. When
|
|
632
|
+
* omitted the OpenRPC view fetches the worker's `GET /_lunora/admin/openrpc`
|
|
633
|
+
* endpoint. OpenRPC is the RPC-native spec (RPC functions only); OpenAPI
|
|
634
|
+
* additionally covers `httpRouter()` REST routes.
|
|
635
|
+
*/
|
|
656
636
|
readonly openRpcSpec?: unknown;
|
|
657
637
|
}
|
|
658
638
|
/**
|
|
659
|
-
* The studio's API tab. Hosts two complementary surfaces behind a segmented
|
|
660
|
-
* toggle. The Reference view renders a machine-readable spec — the OpenAPI 3.1
|
|
661
|
-
* document or the RPC-native OpenRPC document — through the studio-native
|
|
662
|
-
* reference UI (operation browser, schema tables, a live "try it" console, and a
|
|
663
|
-
* request-sample rail), with a small format switch between them. The Snippets
|
|
664
|
-
* view is the per-function React / Client / CLI copy-paste browser
|
|
665
|
-
* (`api-docs-panel`), the lightweight "how do I call this" DX.
|
|
666
|
-
*
|
|
667
|
-
* Reference is the default; OpenAPI is the default format (the richer,
|
|
668
|
-
* spec-driven view that also covers REST). Each format degrades to a clear
|
|
669
|
-
* empty state when its spec isn't wired.
|
|
670
|
-
*/
|
|
671
|
-
declare const ApiTab: ({
|
|
672
|
-
functions,
|
|
673
|
-
initialShardKey,
|
|
674
|
-
openApiSpec,
|
|
675
|
-
openRpcSpec
|
|
676
|
-
}: ApiTabProps) => ReactElement;
|
|
639
|
+
* The studio's API tab. Hosts two complementary surfaces behind a segmented
|
|
640
|
+
* toggle. The Reference view renders a machine-readable spec — the OpenAPI 3.1
|
|
641
|
+
* document or the RPC-native OpenRPC document — through the studio-native
|
|
642
|
+
* reference UI (operation browser, schema tables, a live "try it" console, and a
|
|
643
|
+
* request-sample rail), with a small format switch between them. The Snippets
|
|
644
|
+
* view is the per-function React / Client / CLI copy-paste browser
|
|
645
|
+
* (`api-docs-panel`), the lightweight "how do I call this" DX.
|
|
646
|
+
*
|
|
647
|
+
* Reference is the default; OpenAPI is the default format (the richer,
|
|
648
|
+
* spec-driven view that also covers REST). Each format degrades to a clear
|
|
649
|
+
* empty state when its spec isn't wired.
|
|
650
|
+
*/
|
|
651
|
+
declare const ApiTab: ({ functions, initialShardKey, openApiSpec, openRpcSpec }: ApiTabProps) => ReactElement;
|
|
677
652
|
interface OpenRpcReferencePanelProps {
|
|
678
653
|
/**
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
654
|
+
* Inline OpenRPC document. When supplied the panel renders it directly and
|
|
655
|
+
* skips the fetch — used by the mock harness and by hosts that already hold
|
|
656
|
+
* the generated spec. When omitted the panel fetches the worker's
|
|
657
|
+
* admin-gated `GET /_lunora/admin/openrpc` endpoint via the client.
|
|
658
|
+
*/
|
|
684
659
|
readonly spec?: unknown;
|
|
685
660
|
}
|
|
686
661
|
/**
|
|
687
|
-
* In-studio OpenRPC reference. OpenRPC is the RPC-native spec (a `methods` array
|
|
688
|
-
* over the JSON-RPC-shaped `POST /_lunora/rpc` transport), documenting the RPC
|
|
689
|
-
* functions only. It is parsed into the shared `ApiModel` and rendered by the
|
|
690
|
-
* same studio-native {@link ReferenceView} the OpenAPI panel uses, so both
|
|
691
|
-
* formats share one operation browser, schema view, try-it console, and sample
|
|
692
|
-
* rail.
|
|
693
|
-
*
|
|
694
|
-
* The spec comes from an inline {@link OpenRpcReferencePanelProps.spec} prop, or
|
|
695
|
-
* — by default — the worker's admin-gated `GET /_lunora/admin/openrpc` endpoint.
|
|
696
|
-
*/
|
|
697
|
-
declare const OpenRpcReferencePanel: ({
|
|
698
|
-
spec: inlineSpec
|
|
699
|
-
}: OpenRpcReferencePanelProps) => ReactElement;
|
|
662
|
+
* In-studio OpenRPC reference. OpenRPC is the RPC-native spec (a `methods` array
|
|
663
|
+
* over the JSON-RPC-shaped `POST /_lunora/rpc` transport), documenting the RPC
|
|
664
|
+
* functions only. It is parsed into the shared `ApiModel` and rendered by the
|
|
665
|
+
* same studio-native {@link ReferenceView} the OpenAPI panel uses, so both
|
|
666
|
+
* formats share one operation browser, schema view, try-it console, and sample
|
|
667
|
+
* rail.
|
|
668
|
+
*
|
|
669
|
+
* The spec comes from an inline {@link OpenRpcReferencePanelProps.spec} prop, or
|
|
670
|
+
* — by default — the worker's admin-gated `GET /_lunora/admin/openrpc` endpoint.
|
|
671
|
+
*/
|
|
672
|
+
declare const OpenRpcReferencePanel: ({ spec: inlineSpec }: OpenRpcReferencePanelProps) => ReactElement;
|
|
700
673
|
/**
|
|
701
|
-
* A shareable data-browser view: the table, storage tier, shard, structured
|
|
702
|
-
* filters, substring search, and sort that together reproduce exactly what the
|
|
703
|
-
* grid is showing. This is the unit that is serialized into the URL (so the link
|
|
704
|
-
* IS the query) and persisted by name in {@link loadSavedQueries}. Every field is
|
|
705
|
-
* optional so a partial/legacy URL still hydrates into a sensible default view.
|
|
706
|
-
*/
|
|
674
|
+
* A shareable data-browser view: the table, storage tier, shard, structured
|
|
675
|
+
* filters, substring search, and sort that together reproduce exactly what the
|
|
676
|
+
* grid is showing. This is the unit that is serialized into the URL (so the link
|
|
677
|
+
* IS the query) and persisted by name in {@link loadSavedQueries}. Every field is
|
|
678
|
+
* optional so a partial/legacy URL still hydrates into a sensible default view.
|
|
679
|
+
*/
|
|
707
680
|
interface DataView {
|
|
708
681
|
/** Structured `column operator value` clauses, AND-combined with the search. */
|
|
709
682
|
filters?: FilterClause[];
|
|
@@ -726,20 +699,19 @@ interface SavedQuery {
|
|
|
726
699
|
name: string;
|
|
727
700
|
view: DataView;
|
|
728
701
|
}
|
|
729
|
-
/** Saved queries, most-recently-saved first. Empty when storage is unavailable or empty. */
|
|
730
702
|
interface DataBrowserProps {
|
|
731
703
|
/**
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
704
|
+
* Allow editing: surfaces insert/edit/delete actions that issue
|
|
705
|
+
* `__lunora_admin__:writeRow` ops through the schema-aware writer. Off by
|
|
706
|
+
* default — the browser is read-only unless the host opts in.
|
|
707
|
+
*/
|
|
736
708
|
readonly editable?: boolean;
|
|
737
709
|
/**
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
710
|
+
* Names of the `.global()` (D1-backed) tables. A `v.id` ref cell whose target
|
|
711
|
+
* is one of these is followed cross-tier via `onNavigateToGlobal` instead of
|
|
712
|
+
* being read from this shard (where it doesn't exist). Supplied by the Table
|
|
713
|
+
* editor; defaults to none when the browser is used standalone.
|
|
714
|
+
*/
|
|
743
715
|
readonly globalTableNames?: ReadonlySet<string>;
|
|
744
716
|
/** Structured filters to hydrate from a shared link / saved query. */
|
|
745
717
|
readonly initialFilters?: FilterClause[];
|
|
@@ -750,33 +722,33 @@ interface DataBrowserProps {
|
|
|
750
722
|
/** Shard key the browser targets on first load. Defaults to the root shard. */
|
|
751
723
|
readonly initialShardKey?: string;
|
|
752
724
|
/**
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
725
|
+
* Follow a `v.id` ref whose target is a global table — the Table editor switches
|
|
726
|
+
* to the global tier and opens that table. When omitted (standalone use), a ref
|
|
727
|
+
* to a global table falls through to the in-shard read (and surfaces its error).
|
|
728
|
+
*/
|
|
757
729
|
readonly onNavigateToGlobal?: (table: string, id: string) => void;
|
|
758
730
|
/**
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
731
|
+
* Navigate the URL to a table (the Table editor pushes `?table=…`), opening it
|
|
732
|
+
* clean; `options.search` pre-fills the search for an FK-cell traversal.
|
|
733
|
+
* Omitted in standalone use.
|
|
734
|
+
*/
|
|
763
735
|
readonly onSelectTable?: (table: string, options?: {
|
|
764
736
|
search?: string;
|
|
765
737
|
}) => void;
|
|
766
738
|
/**
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
739
|
+
* Called whenever the loaded view (shard / search / filters / sort) changes, so
|
|
740
|
+
* the host can mirror it to the URL — making every view a shareable link.
|
|
741
|
+
* Omitted in standalone use (view state stays in-component).
|
|
742
|
+
*/
|
|
771
743
|
readonly onViewChange?: (view: Pick<DataView, "filters" | "orderBy" | "search" | "shard">) => void;
|
|
772
744
|
/** Rows requested per page. Clamped server-side to `[1, 500]`. */
|
|
773
745
|
readonly pageSize?: number;
|
|
774
746
|
/**
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
747
|
+
* The canned-query toolbar's handlers + saved list. Supplied by the Table editor
|
|
748
|
+
* (it owns the router and the `saved-queries` localStorage helper); omitted in
|
|
749
|
+
* standalone use, which hides the toolbar entirely. `onSaveQuery` receives the
|
|
750
|
+
* name plus the current view to persist.
|
|
751
|
+
*/
|
|
780
752
|
readonly queryBar?: {
|
|
781
753
|
readonly onApplyQuery: (query: SavedQuery) => void;
|
|
782
754
|
readonly onCopyLink: () => void;
|
|
@@ -785,50 +757,36 @@ interface DataBrowserProps {
|
|
|
785
757
|
readonly saved: ReadonlyArray<SavedQuery>;
|
|
786
758
|
};
|
|
787
759
|
/**
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
760
|
+
* The schema/source selector rendered at the top of the table-list sidebar —
|
|
761
|
+
* the Table editor's `schema public ▾` switch. Supplied when this browser is
|
|
762
|
+
* composed into the Table editor; omitted when it's used alone.
|
|
763
|
+
*/
|
|
792
764
|
readonly schemaSwitch?: ReactNode;
|
|
793
765
|
/**
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
766
|
+
* The table named in the URL. Drives the selection — a deep link or browser
|
|
767
|
+
* back/forward to a different `?table=…` re-opens that table. Supplied by the
|
|
768
|
+
* Table editor; omitted in standalone use (selection stays purely in-component).
|
|
769
|
+
*/
|
|
798
770
|
readonly tableParam?: string;
|
|
799
771
|
}
|
|
800
772
|
/**
|
|
801
|
-
* Read-only data browser for a single shard's SQLite database. Lists the user
|
|
802
|
-
* tables (via the `__lunora_admin__:listTables` RPC), then pages through the
|
|
803
|
-
* rows of whichever table is selected (`__lunora_admin__:readTablePage`).
|
|
804
|
-
*
|
|
805
|
-
* Both calls travel over the ordinary `useLunora` client transport; the
|
|
806
|
-
* admin RPCs are intercepted inside the Durable Object and are gated by the
|
|
807
|
-
* server's `LUNORA_ADMIN_TOKEN`. The host is responsible for configuring the
|
|
808
|
-
* client's auth token — this component issues no credentials of its own.
|
|
809
|
-
*
|
|
810
|
-
* The table view is built on a headless `@tanstack/react-table` model: column
|
|
811
|
-
* defs derive from `page.columns`, sorting and (global) filtering run
|
|
812
|
-
* page-locally over the loaded rows, and the rendered rows are virtualized with
|
|
813
|
-
* `@tanstack/react-virtual` so a large page never inflates the DOM. None of this
|
|
814
|
-
* touches the server — pagination still flows through `readTablePage`. All of
|
|
815
|
-
* that state lives in {@link useDataBrowser}; this component is just the markup.
|
|
816
|
-
*/
|
|
817
|
-
declare const DataBrowser: ({
|
|
818
|
-
editable,
|
|
819
|
-
globalTableNames,
|
|
820
|
-
initialFilters,
|
|
821
|
-
initialOrderBy,
|
|
822
|
-
initialSearch,
|
|
823
|
-
initialShardKey,
|
|
824
|
-
onNavigateToGlobal,
|
|
825
|
-
onSelectTable,
|
|
826
|
-
onViewChange,
|
|
827
|
-
pageSize: initialPageSize,
|
|
828
|
-
queryBar,
|
|
829
|
-
schemaSwitch,
|
|
830
|
-
tableParam
|
|
831
|
-
}: DataBrowserProps) => ReactElement;
|
|
773
|
+
* Read-only data browser for a single shard's SQLite database. Lists the user
|
|
774
|
+
* tables (via the `__lunora_admin__:listTables` RPC), then pages through the
|
|
775
|
+
* rows of whichever table is selected (`__lunora_admin__:readTablePage`).
|
|
776
|
+
*
|
|
777
|
+
* Both calls travel over the ordinary `useLunora` client transport; the
|
|
778
|
+
* admin RPCs are intercepted inside the Durable Object and are gated by the
|
|
779
|
+
* server's `LUNORA_ADMIN_TOKEN`. The host is responsible for configuring the
|
|
780
|
+
* client's auth token — this component issues no credentials of its own.
|
|
781
|
+
*
|
|
782
|
+
* The table view is built on a headless `@tanstack/react-table` model: column
|
|
783
|
+
* defs derive from `page.columns`, sorting and (global) filtering run
|
|
784
|
+
* page-locally over the loaded rows, and the rendered rows are virtualized with
|
|
785
|
+
* `@tanstack/react-virtual` so a large page never inflates the DOM. None of this
|
|
786
|
+
* touches the server — pagination still flows through `readTablePage`. All of
|
|
787
|
+
* that state lives in {@link useDataBrowser}; this component is just the markup.
|
|
788
|
+
*/
|
|
789
|
+
declare const DataBrowser: ({ editable, globalTableNames, initialFilters, initialOrderBy, initialSearch, initialShardKey, onNavigateToGlobal, onSelectTable, onViewChange, pageSize: initialPageSize, queryBar, schemaSwitch, tableParam }: DataBrowserProps) => ReactElement;
|
|
832
790
|
/** A filter row as edited in the UI — the value is always a string until coerced for the wire. */
|
|
833
791
|
interface EditableFilter {
|
|
834
792
|
column: string;
|
|
@@ -836,28 +794,22 @@ interface EditableFilter {
|
|
|
836
794
|
value: string;
|
|
837
795
|
}
|
|
838
796
|
/**
|
|
839
|
-
* Convert the UI's string-valued filter rows into wire {@link FilterClause}s:
|
|
840
|
-
* drops rows with no column, and coerces a canonical numeric string to a number for
|
|
841
|
-
* every comparison operator (so `age > 18` compares numerically, not lexically, and
|
|
842
|
-
* an `eq` on a numeric column still matches — see {@link coerceFilterValue} for why a
|
|
843
|
-
* numeric-looking but non-canonical string like a zip code stays text). `contains`
|
|
844
|
-
* always stays a string.
|
|
845
|
-
*/
|
|
797
|
+
* Convert the UI's string-valued filter rows into wire {@link FilterClause}s:
|
|
798
|
+
* drops rows with no column, and coerces a canonical numeric string to a number for
|
|
799
|
+
* every comparison operator (so `age > 18` compares numerically, not lexically, and
|
|
800
|
+
* an `eq` on a numeric column still matches — see {@link coerceFilterValue} for why a
|
|
801
|
+
* numeric-looking but non-canonical string like a zip code stays text). `contains`
|
|
802
|
+
* always stays a string.
|
|
803
|
+
*/
|
|
846
804
|
declare const toFilterClauses: (filters: ReadonlyArray<EditableFilter>) => FilterClause[];
|
|
847
805
|
/**
|
|
848
|
-
* The data browser's filtering controls: the substring search box plus a stack
|
|
849
|
-
* of structured `column operator value` rows. All state is owned by the parent
|
|
850
|
-
* (the data-browser model); this is the control markup, emitting the full
|
|
851
|
-
* filter array up on every edit. Raw strings (no i18n) to match the surrounding
|
|
852
|
-
* data-browser controls.
|
|
853
|
-
*/
|
|
854
|
-
declare const DataFilters: ({
|
|
855
|
-
columns,
|
|
856
|
-
filters,
|
|
857
|
-
onFiltersChange,
|
|
858
|
-
onSearchChange,
|
|
859
|
-
search
|
|
860
|
-
}: {
|
|
806
|
+
* The data browser's filtering controls: the substring search box plus a stack
|
|
807
|
+
* of structured `column operator value` rows. All state is owned by the parent
|
|
808
|
+
* (the data-browser model); this is the control markup, emitting the full
|
|
809
|
+
* filter array up on every edit. Raw strings (no i18n) to match the surrounding
|
|
810
|
+
* data-browser controls.
|
|
811
|
+
*/
|
|
812
|
+
declare const DataFilters: ({ columns, filters, onFiltersChange, onSearchChange, search }: {
|
|
861
813
|
columns: ReadonlyArray<string>;
|
|
862
814
|
filters: ReadonlyArray<EditableFilter>;
|
|
863
815
|
onFiltersChange: (filters: EditableFilter[]) => void;
|
|
@@ -866,156 +818,139 @@ declare const DataFilters: ({
|
|
|
866
818
|
}) => ReactElement;
|
|
867
819
|
interface GlobalDataBrowserProps {
|
|
868
820
|
/**
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
821
|
+
* Table to open automatically on mount (and whenever it changes). Used by the
|
|
822
|
+
* Table editor when a `v.id` reference in a shard row points at a `.global()`
|
|
823
|
+
* table: clicking it switches to the global tier and lands here with that table
|
|
824
|
+
* pre-selected. Each distinct value is applied once, so the operator can still
|
|
825
|
+
* navigate away afterwards.
|
|
826
|
+
*/
|
|
875
827
|
readonly initialTable?: string;
|
|
876
828
|
/**
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
829
|
+
* Called whenever the open table changes, so the host can mirror it to the URL
|
|
830
|
+
* (the Table editor pushes `?table=…`). Omitted in standalone use.
|
|
831
|
+
*/
|
|
880
832
|
readonly onSelectTable?: (table: string) => void;
|
|
881
833
|
/** Rows requested per page. Clamped server-side to `[1, 500]`. */
|
|
882
834
|
readonly pageSize?: number;
|
|
883
835
|
/**
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
836
|
+
* The schema/source selector rendered at the top of the table-list sidebar —
|
|
837
|
+
* the Table editor's `schema public ▾` switch. Supplied when this browser is
|
|
838
|
+
* composed into the Table editor; omitted when it's used alone.
|
|
839
|
+
*/
|
|
888
840
|
readonly schemaSwitch?: ReactNode;
|
|
889
841
|
}
|
|
890
842
|
/**
|
|
891
|
-
* Read-only browser for `.global()` (D1-backed) tables. Twin of `DataBrowser`,
|
|
892
|
-
* but not shard-scoped: it lists tables via `listGlobalTables()` and pages rows
|
|
893
|
-
* via `readGlobalTablePage()`. Laid out like Supabase's Table Editor — a left
|
|
894
|
-
* table sidebar + a bordered grid with a paginated footer — and gated by the
|
|
895
|
-
* server's `LUNORA_ADMIN_TOKEN`.
|
|
896
|
-
*/
|
|
897
|
-
declare const GlobalDataBrowser: ({
|
|
898
|
-
initialTable,
|
|
899
|
-
onSelectTable,
|
|
900
|
-
pageSize: initialPageSize,
|
|
901
|
-
schemaSwitch
|
|
902
|
-
}?: GlobalDataBrowserProps) => ReactElement;
|
|
843
|
+
* Read-only browser for `.global()` (D1-backed) tables. Twin of `DataBrowser`,
|
|
844
|
+
* but not shard-scoped: it lists tables via `listGlobalTables()` and pages rows
|
|
845
|
+
* via `readGlobalTablePage()`. Laid out like Supabase's Table Editor — a left
|
|
846
|
+
* table sidebar + a bordered grid with a paginated footer — and gated by the
|
|
847
|
+
* server's `LUNORA_ADMIN_TOKEN`.
|
|
848
|
+
*/
|
|
849
|
+
declare const GlobalDataBrowser: ({ initialTable, onSelectTable, pageSize: initialPageSize, schemaSwitch }?: GlobalDataBrowserProps) => ReactElement;
|
|
903
850
|
interface TableEditorProps {
|
|
904
851
|
/**
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
852
|
+
* Allow editing the shard-local tables (insert/edit/delete). Forwarded to the
|
|
853
|
+
* shard {@link DataBrowser}; the global D1 browser is always read-only. Off by
|
|
854
|
+
* default — see {@link DataBrowser}.
|
|
855
|
+
*/
|
|
909
856
|
readonly editable?: boolean;
|
|
910
857
|
/** Shard key the shard browser targets on first load. Defaults to the root shard. */
|
|
911
858
|
readonly initialShardKey?: string;
|
|
912
859
|
}
|
|
913
860
|
/**
|
|
914
|
-
* The Table editor: browses your application's tables across both storage tiers
|
|
915
|
-
* from one section. A schema switch in the sidebar header (Supabase's
|
|
916
|
-
* `schema public ▾`) toggles between the per-shard SQLite browser
|
|
917
|
-
* (`.shardBy(...)`, editable when the host opts in) and the read-only global D1
|
|
918
|
-
* browser (`.global()`) — folding what used to be a separate "Global Tables" tab
|
|
919
|
-
* into a single editor (`STUDIO-REDESIGN-PLAN.md` §2).
|
|
920
|
-
*
|
|
921
|
-
* The active tier and open table live in the URL search params (`?schema=global`,
|
|
922
|
-
* `?table=…`) rather than component state, so every selection is a real, shareable
|
|
923
|
-
* URL and browser back/forward moves between tables and tiers. The browsers push on
|
|
924
|
-
* selection and re-open whatever the URL names.
|
|
925
|
-
*/
|
|
926
|
-
declare const TableEditor: ({
|
|
927
|
-
editable,
|
|
928
|
-
initialShardKey
|
|
929
|
-
}: TableEditorProps) => ReactElement;
|
|
861
|
+
* The Table editor: browses your application's tables across both storage tiers
|
|
862
|
+
* from one section. A schema switch in the sidebar header (Supabase's
|
|
863
|
+
* `schema public ▾`) toggles between the per-shard SQLite browser
|
|
864
|
+
* (`.shardBy(...)`, editable when the host opts in) and the read-only global D1
|
|
865
|
+
* browser (`.global()`) — folding what used to be a separate "Global Tables" tab
|
|
866
|
+
* into a single editor (`STUDIO-REDESIGN-PLAN.md` §2).
|
|
867
|
+
*
|
|
868
|
+
* The active tier and open table live in the URL search params (`?schema=global`,
|
|
869
|
+
* `?table=…`) rather than component state, so every selection is a real, shareable
|
|
870
|
+
* URL and browser back/forward moves between tables and tiers. The browsers push on
|
|
871
|
+
* selection and re-open whatever the URL names.
|
|
872
|
+
*/
|
|
873
|
+
declare const TableEditor: ({ editable, initialShardKey }: TableEditorProps) => ReactElement;
|
|
930
874
|
interface ExportImportPanelProps {
|
|
931
875
|
/** Shard key the panel targets. Defaults to the root shard. */
|
|
932
876
|
readonly initialShardKey?: string;
|
|
933
877
|
}
|
|
934
878
|
/**
|
|
935
|
-
* Snapshot and restore a single shard's data as NDJSON.
|
|
936
|
-
*
|
|
937
|
-
* "Export" reads every shard-local row via `__lunora_admin__:exportShard` and
|
|
938
|
-
* renders it as NDJSON for download/copy. "Import" parses NDJSON the operator
|
|
939
|
-
* pastes in and replays it through `__lunora_admin__:importShard`, reporting
|
|
940
|
-
* inserted counts, id conflicts and per-row errors. Globally-scoped (`.global()`)
|
|
941
|
-
* tables live in D1 and are intentionally out of scope here.
|
|
942
|
-
*
|
|
943
|
-
* Both calls travel over the {@link useLunora} client transport and are gated by
|
|
944
|
-
* the server's `LUNORA_ADMIN_TOKEN`.
|
|
945
|
-
*/
|
|
946
|
-
declare const ExportImportPanel: ({
|
|
947
|
-
initialShardKey
|
|
948
|
-
}: ExportImportPanelProps) => ReactElement;
|
|
879
|
+
* Snapshot and restore a single shard's data as NDJSON.
|
|
880
|
+
*
|
|
881
|
+
* "Export" reads every shard-local row via `__lunora_admin__:exportShard` and
|
|
882
|
+
* renders it as NDJSON for download/copy. "Import" parses NDJSON the operator
|
|
883
|
+
* pastes in and replays it through `__lunora_admin__:importShard`, reporting
|
|
884
|
+
* inserted counts, id conflicts and per-row errors. Globally-scoped (`.global()`)
|
|
885
|
+
* tables live in D1 and are intentionally out of scope here.
|
|
886
|
+
*
|
|
887
|
+
* Both calls travel over the {@link useLunora} client transport and are gated by
|
|
888
|
+
* the server's `LUNORA_ADMIN_TOKEN`.
|
|
889
|
+
*/
|
|
890
|
+
declare const ExportImportPanel: ({ initialShardKey }: ExportImportPanelProps) => ReactElement;
|
|
949
891
|
interface MigrationsPanelProps {
|
|
950
892
|
/** Shard key the panel targets. Defaults to the root shard. */
|
|
951
893
|
readonly initialShardKey?: string;
|
|
952
894
|
}
|
|
953
895
|
/**
|
|
954
|
-
* Inspect and drive data migrations on a single shard.
|
|
955
|
-
*
|
|
956
|
-
* Reads the persisted run-state via the `__lunora_admin__:migrationStatus` RPC
|
|
957
|
-
* and lets an operator kick off a migration by id (`__lunora_admin__:runMigration`)
|
|
958
|
-
* with a direction, an optional batch cap and a dry-run toggle. Both calls
|
|
959
|
-
* travel over the ordinary {@link useLunora} client transport and are gated by
|
|
960
|
-
* the server's `LUNORA_ADMIN_TOKEN` — this component issues no credentials of
|
|
961
|
-
* its own.
|
|
962
|
-
*/
|
|
963
|
-
declare const MigrationsPanel: ({
|
|
964
|
-
initialShardKey
|
|
965
|
-
}: MigrationsPanelProps) => ReactElement;
|
|
896
|
+
* Inspect and drive data migrations on a single shard.
|
|
897
|
+
*
|
|
898
|
+
* Reads the persisted run-state via the `__lunora_admin__:migrationStatus` RPC
|
|
899
|
+
* and lets an operator kick off a migration by id (`__lunora_admin__:runMigration`)
|
|
900
|
+
* with a direction, an optional batch cap and a dry-run toggle. Both calls
|
|
901
|
+
* travel over the ordinary {@link useLunora} client transport and are gated by
|
|
902
|
+
* the server's `LUNORA_ADMIN_TOKEN` — this component issues no credentials of
|
|
903
|
+
* its own.
|
|
904
|
+
*/
|
|
905
|
+
declare const MigrationsPanel: ({ initialShardKey }: MigrationsPanelProps) => ReactElement;
|
|
966
906
|
interface PitrPanelProps {
|
|
967
907
|
/** Shard key the PITR ops target. Defaults to the root shard. */
|
|
968
908
|
readonly initialShardKey?: string;
|
|
969
909
|
}
|
|
970
910
|
/**
|
|
971
|
-
* Native Durable-Object point-in-time recovery for one shard — the **Time
|
|
972
|
-
* Travel** view.
|
|
973
|
-
*
|
|
974
|
-
* Reads the shard's current bookmark, previews the bookmark nearest a chosen
|
|
975
|
-
* time, and (behind a confirm step) restores the shard to a time or an explicit
|
|
976
|
-
* bookmark via the `__lunora_admin__:pitrRestore` RPC, surfacing the returned
|
|
977
|
-
* undo bookmark so the restore can be reversed. All ops run over the
|
|
978
|
-
* {@link useLunora} client and are gated by the server's `LUNORA_ADMIN_TOKEN`.
|
|
979
|
-
*
|
|
980
|
-
* In-place recovery covers the last 30 days; for older or off-platform recovery
|
|
981
|
-
* use the snapshot tier (`lunora backup` / the backup registry item).
|
|
982
|
-
*/
|
|
983
|
-
declare const PitrPanel: ({
|
|
984
|
-
initialShardKey
|
|
985
|
-
}: PitrPanelProps) => ReactElement;
|
|
911
|
+
* Native Durable-Object point-in-time recovery for one shard — the **Time
|
|
912
|
+
* Travel** view.
|
|
913
|
+
*
|
|
914
|
+
* Reads the shard's current bookmark, previews the bookmark nearest a chosen
|
|
915
|
+
* time, and (behind a confirm step) restores the shard to a time or an explicit
|
|
916
|
+
* bookmark via the `__lunora_admin__:pitrRestore` RPC, surfacing the returned
|
|
917
|
+
* undo bookmark so the restore can be reversed. All ops run over the
|
|
918
|
+
* {@link useLunora} client and are gated by the server's `LUNORA_ADMIN_TOKEN`.
|
|
919
|
+
*
|
|
920
|
+
* In-place recovery covers the last 30 days; for older or off-platform recovery
|
|
921
|
+
* use the snapshot tier (`lunora backup` / the backup registry item).
|
|
922
|
+
*/
|
|
923
|
+
declare const PitrPanel: ({ initialShardKey }: PitrPanelProps) => ReactElement;
|
|
986
924
|
interface FunctionRunnerProps {
|
|
987
925
|
/**
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
926
|
+
* Functions to expose. When omitted, the runner auto-discovers them via the
|
|
927
|
+
* client's `listFunctions()` (the admin-gated `/_lunora/admin/functions`
|
|
928
|
+
* endpoint), so it works with no wiring when the worker is built with a
|
|
929
|
+
* `functions` registry. Supply the list to override discovery.
|
|
930
|
+
*/
|
|
993
931
|
readonly functions?: FunctionDescriptor[];
|
|
994
932
|
/**
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
933
|
+
* Expose the "Run as identity" control — execute the selected function AS a
|
|
934
|
+
* chosen authenticated user so an operator can test auth + RLS behavior.
|
|
935
|
+
* Security-sensitive: the run is forwarded over the admin-gated
|
|
936
|
+
* `__lunora_admin__:runAs` RPC, which forges the per-request identity. The
|
|
937
|
+
* host sets this only on a trusted loopback-dev gate (the `Studio` component's
|
|
938
|
+
* `runAsIdentity` prop); off by default, the runner always runs with the
|
|
939
|
+
* caller's own (admin) identity.
|
|
940
|
+
*/
|
|
1003
941
|
readonly runAsIdentity?: boolean;
|
|
1004
942
|
}
|
|
1005
943
|
/**
|
|
1006
|
-
* Interactive runner for the registered functions: pick one, edit its JSON
|
|
1007
|
-
* arguments, optionally target a shard, then invoke it against the live
|
|
1008
|
-
* {@link useLunora} client and inspect the result or error.
|
|
1009
|
-
*
|
|
1010
|
-
* By default the function list is auto-discovered from the worker's
|
|
1011
|
-
* `/_lunora/admin/functions` endpoint; pass an explicit `functions` array to
|
|
1012
|
-
* skip discovery (a query/mutation/action's `kind` is compile-time-only, so it
|
|
1013
|
-
* must be named).
|
|
1014
|
-
*/
|
|
1015
|
-
declare const FunctionRunner: ({
|
|
1016
|
-
functions: functionsProp,
|
|
1017
|
-
runAsIdentity
|
|
1018
|
-
}?: FunctionRunnerProps) => ReactElement;
|
|
944
|
+
* Interactive runner for the registered functions: pick one, edit its JSON
|
|
945
|
+
* arguments, optionally target a shard, then invoke it against the live
|
|
946
|
+
* {@link useLunora} client and inspect the result or error.
|
|
947
|
+
*
|
|
948
|
+
* By default the function list is auto-discovered from the worker's
|
|
949
|
+
* `/_lunora/admin/functions` endpoint; pass an explicit `functions` array to
|
|
950
|
+
* skip discovery (a query/mutation/action's `kind` is compile-time-only, so it
|
|
951
|
+
* must be named).
|
|
952
|
+
*/
|
|
953
|
+
declare const FunctionRunner: ({ functions: functionsProp, runAsIdentity }?: FunctionRunnerProps) => ReactElement;
|
|
1019
954
|
interface FunctionStatsPanelProps {
|
|
1020
955
|
/** Descriptors from codegen, used to annotate each row with the function's `kind`. */
|
|
1021
956
|
readonly functions?: FunctionDescriptor[];
|
|
@@ -1023,127 +958,113 @@ interface FunctionStatsPanelProps {
|
|
|
1023
958
|
readonly initialShardKey?: string;
|
|
1024
959
|
}
|
|
1025
960
|
/**
|
|
1026
|
-
* Per-function execution metrics for one shard: call count, error count/rate,
|
|
1027
|
-
* mean and slowest handler latency, last-run time, and the most recent error
|
|
1028
|
-
* message. Reads via the `__lunora_admin__:getFunctionStats` RPC through
|
|
1029
|
-
* `useAdminQuery`; gated by the server's `LUNORA_ADMIN_TOKEN`.
|
|
1030
|
-
*
|
|
1031
|
-
* Counters are per-DO-instance and reset on hibernation/restart — this is a
|
|
1032
|
-
* "since this instance woke" readout, mirroring the metrics panel. The panel is
|
|
1033
|
-
* always live: `useAdminQuery`'s `live` subscription re-pushes on every server
|
|
1034
|
-
* write-flush so the table updates as mutations land.
|
|
1035
|
-
*/
|
|
1036
|
-
declare const FunctionStatsPanel: ({
|
|
1037
|
-
functions,
|
|
1038
|
-
initialShardKey
|
|
1039
|
-
}: FunctionStatsPanelProps) => ReactElement;
|
|
961
|
+
* Per-function execution metrics for one shard: call count, error count/rate,
|
|
962
|
+
* mean and slowest handler latency, last-run time, and the most recent error
|
|
963
|
+
* message. Reads via the `__lunora_admin__:getFunctionStats` RPC through
|
|
964
|
+
* `useAdminQuery`; gated by the server's `LUNORA_ADMIN_TOKEN`.
|
|
965
|
+
*
|
|
966
|
+
* Counters are per-DO-instance and reset on hibernation/restart — this is a
|
|
967
|
+
* "since this instance woke" readout, mirroring the metrics panel. The panel is
|
|
968
|
+
* always live: `useAdminQuery`'s `live` subscription re-pushes on every server
|
|
969
|
+
* write-flush so the table updates as mutations land.
|
|
970
|
+
*/
|
|
971
|
+
declare const FunctionStatsPanel: ({ functions, initialShardKey }: FunctionStatsPanelProps) => ReactElement;
|
|
1040
972
|
interface HomePanelProps {
|
|
1041
973
|
/** Shard key the health digest targets on first load. Defaults to the root shard. */
|
|
1042
974
|
readonly initialShardKey?: string;
|
|
1043
975
|
}
|
|
1044
976
|
/**
|
|
1045
|
-
* The Home overview — the studio's landing page. It pulls the root shard's
|
|
1046
|
-
* health snapshot, the function stats, the two advisor signals, the live
|
|
1047
|
-
* subscription pulse, and the recent admin audit log, then presents an
|
|
1048
|
-
* at-a-glance digest: a KPI row (requests, errors, latency, database size), a
|
|
1049
|
-
* busiest-functions leaderboard, live connections, recent activity, the advisor
|
|
1050
|
-
* summary, and connect/quick-link shortcuts. Every read is best-effort — a
|
|
1051
|
-
* missing admin token or a cold instance leaves a card showing a muted
|
|
1052
|
-
* placeholder rather than blanking the page.
|
|
1053
|
-
*/
|
|
1054
|
-
declare const HomePanel: ({
|
|
1055
|
-
initialShardKey
|
|
1056
|
-
}: HomePanelProps) => ReactElement;
|
|
977
|
+
* The Home overview — the studio's landing page. It pulls the root shard's
|
|
978
|
+
* health snapshot, the function stats, the two advisor signals, the live
|
|
979
|
+
* subscription pulse, and the recent admin audit log, then presents an
|
|
980
|
+
* at-a-glance digest: a KPI row (requests, errors, latency, database size), a
|
|
981
|
+
* busiest-functions leaderboard, live connections, recent activity, the advisor
|
|
982
|
+
* summary, and connect/quick-link shortcuts. Every read is best-effort — a
|
|
983
|
+
* missing admin token or a cold instance leaves a card showing a muted
|
|
984
|
+
* placeholder rather than blanking the page.
|
|
985
|
+
*/
|
|
986
|
+
declare const HomePanel: ({ initialShardKey }: HomePanelProps) => ReactElement;
|
|
1057
987
|
interface AuditPanelProps {
|
|
1058
988
|
/** Shard key the panel reports on. Defaults to the root shard. */
|
|
1059
989
|
readonly initialShardKey?: string;
|
|
1060
990
|
}
|
|
1061
991
|
/**
|
|
1062
|
-
* Durable audit log for one shard: the admin state-changing operations
|
|
1063
|
-
* (`writeRow`, `runMigration`, `importShard`, `applyCdc`) recorded to the
|
|
1064
|
-
* reserved `__lunora_audit__` table, newest first. Reads via the
|
|
1065
|
-
* `__lunora_admin__:getAuditLog` RPC through `useAdminQuery`; gated by the
|
|
1066
|
-
* server's `LUNORA_ADMIN_TOKEN`.
|
|
1067
|
-
*
|
|
1068
|
-
* Unlike the logs panel (an in-memory ring that resets on hibernation), the
|
|
1069
|
-
* audit log is durable and bounded only by a retention cap. The panel is always
|
|
1070
|
-
* live: `useAdminQuery`'s `live` subscription re-pushes on every server
|
|
1071
|
-
* write-flush so new entries appear without a manual refresh. The op filter is
|
|
1072
|
-
* client-side over the already-fetched buffer — it never triggers a refetch.
|
|
1073
|
-
*/
|
|
1074
|
-
declare const AuditPanel: ({
|
|
1075
|
-
initialShardKey
|
|
1076
|
-
}: AuditPanelProps) => ReactElement;
|
|
992
|
+
* Durable audit log for one shard: the admin state-changing operations
|
|
993
|
+
* (`writeRow`, `runMigration`, `importShard`, `applyCdc`) recorded to the
|
|
994
|
+
* reserved `__lunora_audit__` table, newest first. Reads via the
|
|
995
|
+
* `__lunora_admin__:getAuditLog` RPC through `useAdminQuery`; gated by the
|
|
996
|
+
* server's `LUNORA_ADMIN_TOKEN`.
|
|
997
|
+
*
|
|
998
|
+
* Unlike the logs panel (an in-memory ring that resets on hibernation), the
|
|
999
|
+
* audit log is durable and bounded only by a retention cap. The panel is always
|
|
1000
|
+
* live: `useAdminQuery`'s `live` subscription re-pushes on every server
|
|
1001
|
+
* write-flush so new entries appear without a manual refresh. The op filter is
|
|
1002
|
+
* client-side over the already-fetched buffer — it never triggers a refetch.
|
|
1003
|
+
*/
|
|
1004
|
+
declare const AuditPanel: ({ initialShardKey }: AuditPanelProps) => ReactElement;
|
|
1077
1005
|
interface LogsPanelProps {
|
|
1078
1006
|
/** Shard key the panel reports on. Defaults to the root shard. */
|
|
1079
1007
|
readonly initialShardKey?: string;
|
|
1080
1008
|
}
|
|
1081
|
-
/** A relative time-range window over the Errors buffer, or `all` (no bound). */
|
|
1082
1009
|
/**
|
|
1083
|
-
* The shard's log feed, newest first, over the gated `__lunora_admin__:*` RPC
|
|
1084
|
-
* layer (gated by the server's `LUNORA_ADMIN_TOKEN`). Two views.
|
|
1085
|
-
*
|
|
1086
|
-
* The Requests view (`getRequestLog`) is the durable, structured per-request log
|
|
1087
|
-
* `@lunora/do` writes once per `/rpc` dispatch (PLAN3 §1.1): function path,
|
|
1088
|
-
* shard, acting user/identity, redacted args, outcome, duration, and tables
|
|
1089
|
-
* read/written. It survives hibernation/restart (bounded retention) and is
|
|
1090
|
-
* filtered/correlated SERVER-side on function-path prefix, userId, shard,
|
|
1091
|
-
* outcome, and a touched table.
|
|
1092
|
-
*
|
|
1093
|
-
* The Errors view (`getLogs`) is the legacy in-memory RPC-error buffer, which
|
|
1094
|
-
* only captures dispatch failures (path + message) and resets on hibernation —
|
|
1095
|
-
* kept for the "what's failing on this instance right now" view, filtered
|
|
1096
|
-
* client-side.
|
|
1097
|
-
*
|
|
1098
|
-
* For the raw, un-attributed request firehose (which Lunora deliberately does
|
|
1099
|
-
* NOT re-stream), a deep-link to Cloudflare Workers Observability is provided.
|
|
1100
|
-
*/
|
|
1101
|
-
declare const LogsPanel: ({
|
|
1102
|
-
initialShardKey
|
|
1103
|
-
}: LogsPanelProps) => ReactElement;
|
|
1010
|
+
* The shard's log feed, newest first, over the gated `__lunora_admin__:*` RPC
|
|
1011
|
+
* layer (gated by the server's `LUNORA_ADMIN_TOKEN`). Two views.
|
|
1012
|
+
*
|
|
1013
|
+
* The Requests view (`getRequestLog`) is the durable, structured per-request log
|
|
1014
|
+
* `@lunora/do` writes once per `/rpc` dispatch (PLAN3 §1.1): function path,
|
|
1015
|
+
* shard, acting user/identity, redacted args, outcome, duration, and tables
|
|
1016
|
+
* read/written. It survives hibernation/restart (bounded retention) and is
|
|
1017
|
+
* filtered/correlated SERVER-side on function-path prefix, userId, shard,
|
|
1018
|
+
* outcome, and a touched table.
|
|
1019
|
+
*
|
|
1020
|
+
* The Errors view (`getLogs`) is the legacy in-memory RPC-error buffer, which
|
|
1021
|
+
* only captures dispatch failures (path + message) and resets on hibernation —
|
|
1022
|
+
* kept for the "what's failing on this instance right now" view, filtered
|
|
1023
|
+
* client-side.
|
|
1024
|
+
*
|
|
1025
|
+
* For the raw, un-attributed request firehose (which Lunora deliberately does
|
|
1026
|
+
* NOT re-stream), a deep-link to Cloudflare Workers Observability is provided.
|
|
1027
|
+
*/
|
|
1028
|
+
declare const LogsPanel: ({ initialShardKey }: LogsPanelProps) => ReactElement;
|
|
1104
1029
|
interface MailPanelProps {
|
|
1105
1030
|
/** Newest-N to load (default 100). */
|
|
1106
1031
|
readonly limit?: number;
|
|
1107
1032
|
}
|
|
1108
1033
|
/**
|
|
1109
|
-
* Dev mail catcher — a unified inbox of every email the app sent. `@lunora/mail`'s
|
|
1110
|
-
* capture transport (wired in dev) intercepts each send and persists it to the
|
|
1111
|
-
* root-shard mailbox instead of delivering, so verification / forgot-password and
|
|
1112
|
-
* any app mail show up here with nothing leaving the machine. Reads the
|
|
1113
|
-
* `__lunora_admin__:getCapturedMail` RPC over the {@link useLunora} client;
|
|
1114
|
-
* gated by the server's `LUNORA_ADMIN_TOKEN`.
|
|
1115
|
-
*
|
|
1116
|
-
* The inbox is a single root-shard table with no write-flush to subscribe to, so
|
|
1117
|
-
* it polls on a fixed interval (paused while the tab is hidden) — new captured
|
|
1118
|
-
* mail appears without a manual refresh. The HTML body is rendered in a fully
|
|
1119
|
-
* sandboxed iframe (no script execution) so captured markup can't run in the studio.
|
|
1120
|
-
*/
|
|
1121
|
-
declare const MailPanel: ({
|
|
1122
|
-
limit
|
|
1123
|
-
}: MailPanelProps) => ReactElement;
|
|
1034
|
+
* Dev mail catcher — a unified inbox of every email the app sent. `@lunora/mail`'s
|
|
1035
|
+
* capture transport (wired in dev) intercepts each send and persists it to the
|
|
1036
|
+
* root-shard mailbox instead of delivering, so verification / forgot-password and
|
|
1037
|
+
* any app mail show up here with nothing leaving the machine. Reads the
|
|
1038
|
+
* `__lunora_admin__:getCapturedMail` RPC over the {@link useLunora} client;
|
|
1039
|
+
* gated by the server's `LUNORA_ADMIN_TOKEN`.
|
|
1040
|
+
*
|
|
1041
|
+
* The inbox is a single root-shard table with no write-flush to subscribe to, so
|
|
1042
|
+
* it polls on a fixed interval (paused while the tab is hidden) — new captured
|
|
1043
|
+
* mail appears without a manual refresh. The HTML body is rendered in a fully
|
|
1044
|
+
* sandboxed iframe (no script execution) so captured markup can't run in the studio.
|
|
1045
|
+
*/
|
|
1046
|
+
declare const MailPanel: ({ limit }: MailPanelProps) => ReactElement;
|
|
1124
1047
|
interface HealthPanelProps {
|
|
1125
1048
|
/** Shard key the metric/log reads target on first load. Defaults to the root shard. */
|
|
1126
1049
|
readonly initialShardKey?: string;
|
|
1127
1050
|
}
|
|
1128
1051
|
/**
|
|
1129
|
-
* App-level health & SLO overview. On top of the original single-shard snapshot
|
|
1130
|
-
* (recent errors, request/error counts, shards seen) it composes the
|
|
1131
|
-
* lunora-attributed SLO signals the studio can already reach — app error
|
|
1132
|
-
* rate, auth-failure rate, scheduler backlog, and migration status — each with a
|
|
1133
|
-
* status badge, plus durable request/error and auth sparklines, and a
|
|
1134
|
-
* worst-first per-function error-rate list. None of this is CF's per-Worker
|
|
1135
|
-
* charting: it is attributed to lunora functions, the auth flow, and the
|
|
1136
|
-
* scheduler/migration subsystems.
|
|
1137
|
-
*
|
|
1138
|
-
* Every read is independent and best-effort (via `Promise.allSettled`): a
|
|
1139
|
-
* missing `LUNORA_ADMIN_TOKEN`, an unconfigured scheduler, or a cold instance
|
|
1140
|
-
* degrades that one tile to `—` without blanking the rest. The overview is always
|
|
1141
|
-
* live: a root-shard `getMetrics` subscription drives a full cross-shard re-pull
|
|
1142
|
-
* on every write-flush (coalesced so a burst yields at most one in-flight pull).
|
|
1143
|
-
*/
|
|
1144
|
-
declare const HealthPanel: ({
|
|
1145
|
-
initialShardKey
|
|
1146
|
-
}: HealthPanelProps) => ReactElement;
|
|
1052
|
+
* App-level health & SLO overview. On top of the original single-shard snapshot
|
|
1053
|
+
* (recent errors, request/error counts, shards seen) it composes the
|
|
1054
|
+
* lunora-attributed SLO signals the studio can already reach — app error
|
|
1055
|
+
* rate, auth-failure rate, scheduler backlog, and migration status — each with a
|
|
1056
|
+
* status badge, plus durable request/error and auth sparklines, and a
|
|
1057
|
+
* worst-first per-function error-rate list. None of this is CF's per-Worker
|
|
1058
|
+
* charting: it is attributed to lunora functions, the auth flow, and the
|
|
1059
|
+
* scheduler/migration subsystems.
|
|
1060
|
+
*
|
|
1061
|
+
* Every read is independent and best-effort (via `Promise.allSettled`): a
|
|
1062
|
+
* missing `LUNORA_ADMIN_TOKEN`, an unconfigured scheduler, or a cold instance
|
|
1063
|
+
* degrades that one tile to `—` without blanking the rest. The overview is always
|
|
1064
|
+
* live: a root-shard `getMetrics` subscription drives a full cross-shard re-pull
|
|
1065
|
+
* on every write-flush (coalesced so a burst yields at most one in-flight pull).
|
|
1066
|
+
*/
|
|
1067
|
+
declare const HealthPanel: ({ initialShardKey }: HealthPanelProps) => ReactElement;
|
|
1147
1068
|
/** One shard's metrics fetch outcome: the snapshot, or the error that shard returned. */
|
|
1148
1069
|
interface ShardMetricsResult {
|
|
1149
1070
|
error: null | string;
|
|
@@ -1164,120 +1085,110 @@ interface AggregateMetrics {
|
|
|
1164
1085
|
totalRequests: number;
|
|
1165
1086
|
}
|
|
1166
1087
|
/**
|
|
1167
|
-
* Roll up per-shard metrics into repo-wide totals. Errors-per-shard are kept as
|
|
1168
|
-
* `failed` (a shard that's down is data, not a hard failure), and counters are
|
|
1169
|
-
* summed only over reachable shards. The combined cache hit-rate weights by each
|
|
1170
|
-
* shard's hits+misses so a busy shard dominates a quiet one.
|
|
1171
|
-
*/
|
|
1088
|
+
* Roll up per-shard metrics into repo-wide totals. Errors-per-shard are kept as
|
|
1089
|
+
* `failed` (a shard that's down is data, not a hard failure), and counters are
|
|
1090
|
+
* summed only over reachable shards. The combined cache hit-rate weights by each
|
|
1091
|
+
* shard's hits+misses so a busy shard dominates a quiet one.
|
|
1092
|
+
*/
|
|
1172
1093
|
declare const aggregateMetrics: (results: ReadonlyArray<ShardMetricsResult>) => AggregateMetrics;
|
|
1173
1094
|
/**
|
|
1174
|
-
* The shard keys to aggregate over. Durable Objects aren't enumerable, so this
|
|
1175
|
-
* is the union of the root shard (`""`), an explicit current shard, and the
|
|
1176
|
-
* recently-visited shards — de-duplicated, order-stable (root first). It's a
|
|
1177
|
-
* best-effort "shards we know about", not every shard that exists.
|
|
1178
|
-
*/
|
|
1095
|
+
* The shard keys to aggregate over. Durable Objects aren't enumerable, so this
|
|
1096
|
+
* is the union of the root shard (`""`), an explicit current shard, and the
|
|
1097
|
+
* recently-visited shards — de-duplicated, order-stable (root first). It's a
|
|
1098
|
+
* best-effort "shards we know about", not every shard that exists.
|
|
1099
|
+
*/
|
|
1179
1100
|
declare const shardsToAggregate: (current: string, recents: ReadonlyArray<string>) => string[];
|
|
1180
1101
|
interface MetricsPanelProps {
|
|
1181
1102
|
/** Shard key the panel reports on. Defaults to the root shard. */
|
|
1182
1103
|
readonly initialShardKey?: string;
|
|
1183
1104
|
}
|
|
1184
1105
|
/**
|
|
1185
|
-
* Health snapshot for a single shard: request / error counts (since the DO last
|
|
1186
|
-
* woke), its live SQLite size, and reactive-cache hit/miss stats when a cache is
|
|
1187
|
-
* configured. Reads via the `__lunora_admin__:getMetrics` RPC over the
|
|
1188
|
-
* {@link useLunora} client; gated by the server's `LUNORA_ADMIN_TOKEN`.
|
|
1189
|
-
*
|
|
1190
|
-
* Counters are per-DO-instance and reset on hibernation/restart — this is a
|
|
1191
|
-
* "since this instance woke" readout, not a durable time series.
|
|
1192
|
-
*
|
|
1193
|
-
* The panel is always live: a `getMetrics` WebSocket subscription opens once the
|
|
1194
|
-
* first one-shot seed commits a shard and re-pushes on every server write-flush,
|
|
1195
|
-
* accumulating a client-side, in-memory series of requests-per-sample (the delta
|
|
1196
|
-
* of `requests` between consecutive samples), rendered as an inline-SVG
|
|
1197
|
-
* sparkline. The series is capped at {@link MAX_HISTORY} points and is lost on
|
|
1198
|
-
* remount.
|
|
1199
|
-
*/
|
|
1200
|
-
declare const MetricsPanel: ({
|
|
1201
|
-
initialShardKey
|
|
1202
|
-
}: MetricsPanelProps) => ReactElement;
|
|
1106
|
+
* Health snapshot for a single shard: request / error counts (since the DO last
|
|
1107
|
+
* woke), its live SQLite size, and reactive-cache hit/miss stats when a cache is
|
|
1108
|
+
* configured. Reads via the `__lunora_admin__:getMetrics` RPC over the
|
|
1109
|
+
* {@link useLunora} client; gated by the server's `LUNORA_ADMIN_TOKEN`.
|
|
1110
|
+
*
|
|
1111
|
+
* Counters are per-DO-instance and reset on hibernation/restart — this is a
|
|
1112
|
+
* "since this instance woke" readout, not a durable time series.
|
|
1113
|
+
*
|
|
1114
|
+
* The panel is always live: a `getMetrics` WebSocket subscription opens once the
|
|
1115
|
+
* first one-shot seed commits a shard and re-pushes on every server write-flush,
|
|
1116
|
+
* accumulating a client-side, in-memory series of requests-per-sample (the delta
|
|
1117
|
+
* of `requests` between consecutive samples), rendered as an inline-SVG
|
|
1118
|
+
* sparkline. The series is capped at {@link MAX_HISTORY} points and is lost on
|
|
1119
|
+
* remount.
|
|
1120
|
+
*/
|
|
1121
|
+
declare const MetricsPanel: ({ initialShardKey }: MetricsPanelProps) => ReactElement;
|
|
1203
1122
|
interface SchemaViewerProps {
|
|
1204
1123
|
/** Shard key the viewer targets. Defaults to the root shard. */
|
|
1205
1124
|
readonly initialShardKey?: string;
|
|
1206
1125
|
/**
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1126
|
+
* Table to auto-expand once the shard's tables load. Set by the Insights
|
|
1127
|
+
* "add the index" deep-link (`/schema?table=<name>`) so the operator lands
|
|
1128
|
+
* directly on the scanned table's index list instead of hunting for it.
|
|
1129
|
+
* Re-applied whenever the value changes, so following the link a second time
|
|
1130
|
+
* (same tab already open) re-expands the target.
|
|
1131
|
+
*/
|
|
1213
1132
|
readonly initialTable?: string;
|
|
1214
1133
|
/**
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1134
|
+
* Enable the visual schema-editor overlay (add table / column / index). Off by
|
|
1135
|
+
* default so the diagram stays read-only. Set only by the loopback dev hosts
|
|
1136
|
+
* (see `StudioProps.schemaEditable`); when true, the authoring overlay
|
|
1137
|
+
* (plan 024 Item 4) renders above the table lists and applies additive edits
|
|
1138
|
+
* through the dev host's local schema-edit endpoint.
|
|
1139
|
+
*/
|
|
1221
1140
|
readonly schemaEditable?: boolean;
|
|
1222
1141
|
}
|
|
1223
1142
|
/**
|
|
1224
|
-
* Schema overview that shows both storage tiers so the distinction is never a
|
|
1225
|
-
* mystery. The shard section lists every user table in the selected Durable
|
|
1226
|
-
* Object with row counts, and probes a table's columns on expand via a one-row
|
|
1227
|
-
* `__lunora_admin__:readTablePage` (`PRAGMA table_info`). The global section
|
|
1228
|
-
* lists every `.global()` table — including the auth tables (`user`, `session`,
|
|
1229
|
-
* …) — via the client's `listGlobalTables()`, reading columns from a one-row
|
|
1230
|
-
* `readGlobalTablePage` on expand.
|
|
1231
|
-
*
|
|
1232
|
-
* Two presentations: a **Table list** (searchable, expandable cards per tier)
|
|
1233
|
-
* and a **Graph** — a single React Flow relationship diagram showing both tiers
|
|
1234
|
-
* on one canvas, with cross-tier FK edges and its own in-canvas find-table box,
|
|
1235
|
-
* tier filter, and legend.
|
|
1236
|
-
*
|
|
1237
|
-
* Read-only and gated by the server's `LUNORA_ADMIN_TOKEN`, like the rest of the
|
|
1238
|
-
* studio's admin surface. Global discovery is best-effort: if D1 isn't
|
|
1239
|
-
* configured the global section simply reports it, and the shard section still
|
|
1240
|
-
* works.
|
|
1241
|
-
*/
|
|
1242
|
-
declare const SchemaViewer: ({
|
|
1243
|
-
initialShardKey,
|
|
1244
|
-
initialTable,
|
|
1245
|
-
schemaEditable
|
|
1246
|
-
}: SchemaViewerProps) => ReactElement;
|
|
1143
|
+
* Schema overview that shows both storage tiers so the distinction is never a
|
|
1144
|
+
* mystery. The shard section lists every user table in the selected Durable
|
|
1145
|
+
* Object with row counts, and probes a table's columns on expand via a one-row
|
|
1146
|
+
* `__lunora_admin__:readTablePage` (`PRAGMA table_info`). The global section
|
|
1147
|
+
* lists every `.global()` table — including the auth tables (`user`, `session`,
|
|
1148
|
+
* …) — via the client's `listGlobalTables()`, reading columns from a one-row
|
|
1149
|
+
* `readGlobalTablePage` on expand.
|
|
1150
|
+
*
|
|
1151
|
+
* Two presentations: a **Table list** (searchable, expandable cards per tier)
|
|
1152
|
+
* and a **Graph** — a single React Flow relationship diagram showing both tiers
|
|
1153
|
+
* on one canvas, with cross-tier FK edges and its own in-canvas find-table box,
|
|
1154
|
+
* tier filter, and legend.
|
|
1155
|
+
*
|
|
1156
|
+
* Read-only and gated by the server's `LUNORA_ADMIN_TOKEN`, like the rest of the
|
|
1157
|
+
* studio's admin surface. Global discovery is best-effort: if D1 isn't
|
|
1158
|
+
* configured the global section simply reports it, and the shard section still
|
|
1159
|
+
* works.
|
|
1160
|
+
*/
|
|
1161
|
+
declare const SchemaViewer: ({ initialShardKey, initialTable, schemaEditable }: SchemaViewerProps) => ReactElement;
|
|
1247
1162
|
interface SettingsPanelProps {
|
|
1248
1163
|
/** Shard key the settings read targets on first load. Defaults to the root shard. */
|
|
1249
1164
|
readonly initialShardKey?: string;
|
|
1250
1165
|
}
|
|
1251
1166
|
/**
|
|
1252
|
-
* Read-only **Settings** view of the deployment's config: the Worker vars,
|
|
1253
|
-
* secrets, and bindings exposed via `env`, plus best-effort deploy metadata.
|
|
1254
|
-
* Reads the `__lunora_admin__:getSettings` RPC via {@link useAdminQuery} (gated
|
|
1255
|
-
* by the server's `LUNORA_ADMIN_TOKEN`).
|
|
1256
|
-
*
|
|
1257
|
-
* Strictly view-only: secret values are masked server-side and never returned
|
|
1258
|
-
* raw, and there is no editing here. The infrastructure plane lives in
|
|
1259
|
-
* Cloudflare/wrangler — a deep-link to the Cloudflare dashboard is provided so
|
|
1260
|
-
* you can edit there. Deployment config is static at runtime (it only changes on
|
|
1261
|
-
* redeploy), so this loads once on mount — there is no live channel or poll.
|
|
1262
|
-
*/
|
|
1263
|
-
declare const SettingsPanel: ({
|
|
1264
|
-
initialShardKey
|
|
1265
|
-
}: SettingsPanelProps) => ReactElement;
|
|
1167
|
+
* Read-only **Settings** view of the deployment's config: the Worker vars,
|
|
1168
|
+
* secrets, and bindings exposed via `env`, plus best-effort deploy metadata.
|
|
1169
|
+
* Reads the `__lunora_admin__:getSettings` RPC via {@link useAdminQuery} (gated
|
|
1170
|
+
* by the server's `LUNORA_ADMIN_TOKEN`).
|
|
1171
|
+
*
|
|
1172
|
+
* Strictly view-only: secret values are masked server-side and never returned
|
|
1173
|
+
* raw, and there is no editing here. The infrastructure plane lives in
|
|
1174
|
+
* Cloudflare/wrangler — a deep-link to the Cloudflare dashboard is provided so
|
|
1175
|
+
* you can edit there. Deployment config is static at runtime (it only changes on
|
|
1176
|
+
* redeploy), so this loads once on mount — there is no live channel or poll.
|
|
1177
|
+
*/
|
|
1178
|
+
declare const SettingsPanel: ({ initialShardKey }: SettingsPanelProps) => ReactElement;
|
|
1266
1179
|
interface SqlEditorPanelProps {
|
|
1267
1180
|
/** Shard key the query runs against on first load. Defaults to the root shard. */
|
|
1268
1181
|
readonly initialShardKey?: string;
|
|
1269
1182
|
}
|
|
1270
1183
|
/**
|
|
1271
|
-
* A full-height, Supabase-style SQL editor: a left query sidebar (search + new,
|
|
1272
|
-
* a browser-persisted PRIVATE list, and REFERENCE templates), a line-numbered
|
|
1273
|
-
* editor pane, and a Results / Explain pane with a Run control + shard selector.
|
|
1274
|
-
* Read-only — the `__lunora_admin__:runSql` RPC rejects everything but
|
|
1275
|
-
* SELECT / WITH / EXPLAIN, so raw writes can't desync the doc-store's shadow
|
|
1276
|
-
* tables (use the Data grid's inline edit for mutations).
|
|
1277
|
-
*/
|
|
1278
|
-
declare const SqlEditorPanel: ({
|
|
1279
|
-
initialShardKey
|
|
1280
|
-
}: SqlEditorPanelProps) => ReactElement;
|
|
1184
|
+
* A full-height, Supabase-style SQL editor: a left query sidebar (search + new,
|
|
1185
|
+
* a browser-persisted PRIVATE list, and REFERENCE templates), a line-numbered
|
|
1186
|
+
* editor pane, and a Results / Explain pane with a Run control + shard selector.
|
|
1187
|
+
* Read-only — the `__lunora_admin__:runSql` RPC rejects everything but
|
|
1188
|
+
* SELECT / WITH / EXPLAIN, so raw writes can't desync the doc-store's shadow
|
|
1189
|
+
* tables (use the Data grid's inline edit for mutations).
|
|
1190
|
+
*/
|
|
1191
|
+
declare const SqlEditorPanel: ({ initialShardKey }: SqlEditorPanelProps) => ReactElement;
|
|
1281
1192
|
interface FileBrowserProps {
|
|
1282
1193
|
/** Object-key prefix the browser filters by on first load. */
|
|
1283
1194
|
readonly initialPrefix?: string;
|
|
@@ -1285,120 +1196,108 @@ interface FileBrowserProps {
|
|
|
1285
1196
|
readonly pageSize?: number;
|
|
1286
1197
|
}
|
|
1287
1198
|
/**
|
|
1288
|
-
* Browse — and mutate — objects in the storage (R2) bucket. Lists keys under an
|
|
1289
|
-
* optional prefix via the client's `listStorageObjects`, which hits the worker's
|
|
1290
|
-
* admin-gated `GET /_lunora/admin/storage` endpoint — so the worker must be built
|
|
1291
|
-
* with a `storageList` function and `adminToken`. Paginates forward by cursor.
|
|
1292
|
-
*
|
|
1293
|
-
* Each row offers a "Copy URL" (signed/public URL via `signedStorageUrl`) and a
|
|
1294
|
-
* confirm-gated "Delete" (`deleteStorageObject`); the toolbar offers an upload
|
|
1295
|
-
* (`uploadStorageObject`) into the current prefix. Those write paths require the
|
|
1296
|
-
* worker to be built with `storageSignedUrl` / `storageDelete` / `storageUpload`
|
|
1297
|
-
* respectively — when absent, the worker responds with a clear `*_NOT_CONFIGURED`
|
|
1298
|
-
* error that surfaces inline rather than crashing the panel.
|
|
1299
|
-
*
|
|
1300
|
-
* All state + behavior lives in {@link useFileBrowser}; this shell only wires the
|
|
1301
|
-
* view-model into the toolbar, breadcrumbs, selection bar, list/gallery and the
|
|
1302
|
-
* load-more / error / empty affordances.
|
|
1303
|
-
*/
|
|
1304
|
-
declare const FileBrowser: ({
|
|
1305
|
-
initialPrefix,
|
|
1306
|
-
pageSize
|
|
1307
|
-
}: FileBrowserProps) => ReactElement;
|
|
1199
|
+
* Browse — and mutate — objects in the storage (R2) bucket. Lists keys under an
|
|
1200
|
+
* optional prefix via the client's `listStorageObjects`, which hits the worker's
|
|
1201
|
+
* admin-gated `GET /_lunora/admin/storage` endpoint — so the worker must be built
|
|
1202
|
+
* with a `storageList` function and `adminToken`. Paginates forward by cursor.
|
|
1203
|
+
*
|
|
1204
|
+
* Each row offers a "Copy URL" (signed/public URL via `signedStorageUrl`) and a
|
|
1205
|
+
* confirm-gated "Delete" (`deleteStorageObject`); the toolbar offers an upload
|
|
1206
|
+
* (`uploadStorageObject`) into the current prefix. Those write paths require the
|
|
1207
|
+
* worker to be built with `storageSignedUrl` / `storageDelete` / `storageUpload`
|
|
1208
|
+
* respectively — when absent, the worker responds with a clear `*_NOT_CONFIGURED`
|
|
1209
|
+
* error that surfaces inline rather than crashing the panel.
|
|
1210
|
+
*
|
|
1211
|
+
* All state + behavior lives in {@link useFileBrowser}; this shell only wires the
|
|
1212
|
+
* view-model into the toolbar, breadcrumbs, selection bar, list/gallery and the
|
|
1213
|
+
* load-more / error / empty affordances.
|
|
1214
|
+
*/
|
|
1215
|
+
declare const FileBrowser: ({ initialPrefix, pageSize }: FileBrowserProps) => ReactElement;
|
|
1308
1216
|
/** Default polling cadence for auto-refresh, in milliseconds. */
|
|
1309
1217
|
declare const DEFAULT_AUTO_REFRESH_MS = 5e3;
|
|
1310
1218
|
/**
|
|
1311
|
-
* Call `onTick` on a fixed interval while `enabled`, for panels whose backend
|
|
1312
|
-
* has no live subscription channel (the scheduler, R2, D1, the SessionDO — all
|
|
1313
|
-
* HTTP-only). Polling is the honest "live" here: a timer-driven scheduler has no
|
|
1314
|
-
* client-observable write event to push on, so the UI watches jobs count down
|
|
1315
|
-
* and disappear by re-asking.
|
|
1316
|
-
*
|
|
1317
|
-
* Ticks are skipped while the tab is hidden (`document.hidden`) so a backgrounded
|
|
1318
|
-
* studio doesn't keep hammering the worker. `onTick` is held in a ref so a
|
|
1319
|
-
* fresh closure each render doesn't reset the interval; only `enabled`/`intervalMs`
|
|
1320
|
-
* do. The interval is cleared on disable and unmount.
|
|
1321
|
-
*/
|
|
1219
|
+
* Call `onTick` on a fixed interval while `enabled`, for panels whose backend
|
|
1220
|
+
* has no live subscription channel (the scheduler, R2, D1, the SessionDO — all
|
|
1221
|
+
* HTTP-only). Polling is the honest "live" here: a timer-driven scheduler has no
|
|
1222
|
+
* client-observable write event to push on, so the UI watches jobs count down
|
|
1223
|
+
* and disappear by re-asking.
|
|
1224
|
+
*
|
|
1225
|
+
* Ticks are skipped while the tab is hidden (`document.hidden`) so a backgrounded
|
|
1226
|
+
* studio doesn't keep hammering the worker. `onTick` is held in a ref so a
|
|
1227
|
+
* fresh closure each render doesn't reset the interval; only `enabled`/`intervalMs`
|
|
1228
|
+
* do. The interval is cleared on disable and unmount.
|
|
1229
|
+
*/
|
|
1322
1230
|
declare const useAutoRefresh: (onTick: () => void, enabled: boolean, intervalMs?: number) => void;
|
|
1323
1231
|
/**
|
|
1324
|
-
* Debounced mirror of `value`: returns the latest value only after it has been
|
|
1325
|
-
* stable for `delayMs`. Used so a per-keystroke search box drives at most one
|
|
1326
|
-
* server round-trip per pause, instead of one request per character.
|
|
1327
|
-
*/
|
|
1232
|
+
* Debounced mirror of `value`: returns the latest value only after it has been
|
|
1233
|
+
* stable for `delayMs`. Used so a per-keystroke search box drives at most one
|
|
1234
|
+
* server round-trip per pause, instead of one request per character.
|
|
1235
|
+
*/
|
|
1328
1236
|
declare const useDebounced: <T>(value: T, delayMs?: number) => T;
|
|
1329
1237
|
/**
|
|
1330
|
-
* The registry of every English source string a call site may pass to `t(...)`.
|
|
1331
|
-
*
|
|
1332
|
-
* English is the source locale, so each id doubles as the rendered text: Lingui
|
|
1333
|
-
* compiles an id verbatim when a catalog has no entry for it. This list is the
|
|
1334
|
-
* single source of known strings — {@link MessageId} is derived from it and
|
|
1335
|
-
* `TFunction` is typed against that union, so `t("Dat")` (or any string absent
|
|
1336
|
-
* here) is a compile error rather than a silently-rendered typo.
|
|
1337
|
-
*
|
|
1338
|
-
* Add a string here the moment a new call site needs it. To translate, create a
|
|
1339
|
-
* sibling catalog (for example `de.ts`) mapping each id to its translation and
|
|
1340
|
-
* register it via `createStudioI18n(locale, { en: enMessages, de: deMessages })`.
|
|
1341
|
-
*/
|
|
1238
|
+
* The registry of every English source string a call site may pass to `t(...)`.
|
|
1239
|
+
*
|
|
1240
|
+
* English is the source locale, so each id doubles as the rendered text: Lingui
|
|
1241
|
+
* compiles an id verbatim when a catalog has no entry for it. This list is the
|
|
1242
|
+
* single source of known strings — {@link MessageId} is derived from it and
|
|
1243
|
+
* `TFunction` is typed against that union, so `t("Dat")` (or any string absent
|
|
1244
|
+
* here) is a compile error rather than a silently-rendered typo.
|
|
1245
|
+
*
|
|
1246
|
+
* Add a string here the moment a new call site needs it. To translate, create a
|
|
1247
|
+
* sibling catalog (for example `de.ts`) mapping each id to its translation and
|
|
1248
|
+
* register it via `createStudioI18n(locale, { en: enMessages, de: deMessages })`.
|
|
1249
|
+
*/
|
|
1342
1250
|
declare const MESSAGE_IDS: readonly ["Agents", "Agent", "Threads", "Timeline", "Messages", "Tokens", "Updated", "Content", "Tool", "Usage", "Approval", "Inspect agent threads, message timelines, tool calls, and token usage.", "Agents run as durable workflows. Each run persists a thread of assistant and tool messages; select a thread to inspect its timeline, tool calls, approvals, and token usage.", "No @lunora/agent tables found in this deployment. Add lunora/agents.ts with defineAgent(...) and merge the agent schema extension to run durable AI agents.", "No agents configured", "No agent has run yet. Start a run with ctx.agents.<name>.run(...) and its thread appears here.", "No agent threads yet", "This thread has no messages yet.", "Bindings", "KV Namespaces", "R2 Buckets", "Vectorize Indexes", "{count} bindings", "1 binding", "Lunora AI rules aren't installed.", "lets your coding agent use Lunora correctly.", "Dismiss", ", changed", "(no subject)", "(root)", "{count} active", "{count} calls", "{count} failed", "{total} total", "No subscriptions yet", "Payments", "Plan", "Provider", "Recent webhook events", "Renews", "State", "Subscriptions", "Synced customers, subscriptions, and webhook events.", "{count} messages", "{count} pending changes", "{count} running", "{name} ({rowCount})", "{rangeStart}-{rangeEnd} of {total}", "{rate} ({count} entries)", "{reachable} reachable", "{reachable} reachable, {failed} unreachable", "{status} — processed", "{title} failed", "Actions", "Actions have no React hook — call them through the client.", "Add a widget to chart a saved SQL query on this browser.", "Add index on {table}", "Add row", "Add widget", "admin token", "Aggregating…", "all", "All shards", "API", "API reference unavailable", "API resources", "API usage snippets", "API view", "Arguments", "Auth", "Auth failures", "Auth failures over time", "Cache hit rate", "Call this {kind} from your app.", "Cancel", "Cancel job?", "Cc", "changed", "Chart widgets backed by saved read-only SQL queries.", "Lunora surfaces slow functions, error spikes, and cache problems here.", "Clear", "Clear inbox", "Columns unavailable", "CLI", "Client", "collecting samples…", "Combined cache hit rate", "Commit", "Committing…", "Breadcrumb", "Confirm", "Connect", "Connect to Lunora Studio", "Connected", "Connecting…", "Enter your admin token to access the studio.", "From your worker's LUNORA_ADMIN_TOKEN — your project's .dev.vars in dev, or a deployment secret in production.", "Local", "Not connected", "content-type", "Copy", "Copy link", "Copy-paste snippets for calling your functions and tables.", "created", "Cron triggers", "Dashboards", "Data", "Data migrations you run against this shard will be tracked here.", "Data model", "Database", "Database size", "db size", "Delete", "Delete saved query {name}", "Delete?", "direction", "Direction", "Discard", "down", "Dry run", "Dry run: ", "Edit", "Edit widget", "email", "Email preview", "Email your app sends in dev is captured here — nothing is delivered.", "Email your app sent, captured in dev.", "Enter a migration id", "error", "Error rate", "errors", "Errors", "Errors over time", "expires", "Export", "PNG", "SVG", "Export / Import", "Exported {count} rows.", "Facets", "file:function", "Files", "Filter messages", "Filter tables", "Find table…", "Foreign key", "From", "function", "Function", "Function path", "Functions", "Functions by error rate", "Graph", "Headers", "Health", "Indexes", "Hide", "HTML", "id", "Idle", "Import", "Import (writes rows)?", "Inserted {inserted}, {conflicts} conflicts, {errors} errors.", "Interactive OpenAPI reference and copy-paste snippets for your functions.", "Invalid JSON args: {message}", "Invalid JSON: {message}", "Invalid NDJSON: {message}", "ip", "Jobs queued with runAfter / runAt will appear here.", "JSON", "key", "Key prefix", "key prefix (optional)", "Level filter", "line {line} ({table}): {message}", "List", "Live", "Live — changes stream in automatically", "Live unavailable", "Live unavailable: {liveError}", "Live: on", "Load", "Load more", "Load tables", "Logic", "Logs", "Mail", "Mask sensitive columns", "Metrics", "migration id", "Migration id", "Migrations", "Missing index", "name", "Next", "no", "No active sessions.", "no cache configured", "No captured email.", "No cron triggers.", "No function activity yet.", "No functions or tables to document yet.", "No global tables.", "No headers.", "No HTML body.", "No logs.", "No migrations have run on this shard.", "No objects.", "No recent errors.", "No scheduled jobs.", "No tables to graph.", "No tables match your filter.", "No text body.", "No users.", "No widgets yet", "Objects you upload to your R2 buckets will appear here.", "Observability", "of {pages}", "off", "Offline", "ok", "OK", "on", "Open {target} {id}", "Open in new tab", "Outcome filter", "Page", "Plain text", "Prefill", "Previous", "Primary key", "processed", "React", "Read and write this table through the typed data model.", "Recent errors", "Recent logs", "Recently visited shards — click to switch", "Refresh", "Reload tables", "Remove widget", "RLS Policies", "Policies", "No policies defined", "No `definePolicy` is wired through `.use(rls(...))` in this deployment. Add one to guard a table's rows.", "Read", "Insert", "Update", "Guarded by", "Guarded", "Roles", "No roles defined", "No `defineRole` is registered via `rls(policies, { roles })`. Roles back `ctx.auth.can(...)` permission checks.", "Permissions", "Run as identity (userId)", "Leave empty to run as admin", "Dev only: runs the function as this user so you can test auth and RLS. Forged over the admin gate.", "as {userId}", "No policy", "Covered by {procedure}", "Uncovered — reachable without a policy", "Masked columns", "No tables in this deployment's schema.", "Add a `definePolicy` and wire it through `.use(rls(...))` to populate this matrix.", "Pick a function and an identity, then run it to see the access outcome.", "Probe", "Probe this", "Run as (userId)", "Identity (userId) to run as", "Run probe", "Allowed", "Denied", "Probing…", "Set `runAsIdentity` to forge an identity and probe access.", "Dev only: runs the selected function as this user over the admin gate so you can test auth and RLS.", "Inspect access policies per table, and probe a function as any identity.", "Scaffold access rules", "Writes a new deny-by-default policy file under lunora/, or wires one into a procedure, then reruns codegen. Local dev only.", "New policy file", "Wire into a procedure", "Policy name", "Create policy file", "Procedure file path", "Exported procedure", "Policy set identifier", "Wire RLS", "Creating…", "Wiring…", "Scaffolded {label} and reran codegen. Fill in the `when` predicates before relying on it.", "This change must be made by hand — the scaffolder only adds new, deny-by-default rules.", "requests", "Requests", "Requests / interval", "Requests over time", "Requests per interval over time", "Row actions", "Row document JSON", "Rows per page", "Run", "Run migration", "Run migration?", "Running…", "Query name", "Save", "Save query", "Save widget", "Saved", "schedule", "target", "workflow", "Run now", "Run now?", "Running…", "ran", "attempts", "backlog", "Dead letter", "Drop", "Drop job?", "in flight", "Jobs that exhaust their retry budget are parked here instead of being dropped.", "last tried", "max concurrency", "No dead-letter jobs.", "No workpools.", "pool", "Pools", "pools", "Pools created with createWorkpool appear here once they have activity.", "queued", "Retry", "Schedule view", "Scheduled", "scheduled for", "Scheduled jobs", "Scheduler backlog", "Schema", "Schema graph", "Schema view", "search message", "Search messages", "Search rows", "search table…", "Search…", "Select a function or table to see how to call it from your app.", "Select all rows", "Select row", "Send test", "Sent", "Service level", "Sessions", "Sessions for {userId}", "shard", "Shard", "Shard key", "shard key (optional)", "Shard key (optional)", "Shards", "Shards seen", "Signature", "size", "Snippet flavour", "State-changing admin operations are recorded here.", "status", "Storage", "Storage tier", "Storage tiers", "Studio", "Studio areas", "Studio failed", "Switch to dark theme", "Switch to light theme", "Table", "Table list", "Table touched", "Tables", "To", "Token rides the WebSocket URL — it can surface in browser DevTools and server logs. Use a dev-only token.", "Total database size", "Total errors", "Total requests", "Triggers declared with the cronJobs() builder appear here.", "Try again", "unreachable", "up", "updated", "Uptime", "user agent", "User id", "userId", "Users", "Users who sign up to your app will appear here.", "verified", "Widget title", "yes", "A live stream of recent function logs.", "Browse and edit rows across your shard and global tables.", "Browse auth users and their active sessions.", "Browse objects in your R2 storage buckets.", "Export a shard to NDJSON, or import rows from it.", "At-a-glance connection, error, and shard signals.", "Inspect and cancel scheduled jobs.", "Inspect each table and its columns.", "Inspect row-level-security policies and roles, per table.", "Per-shard health and aggregate metrics.", "Review migration status and run them.", "Run registered queries, mutations, and actions.", "Global tables (D1)", "Shard tables", "{shard} tables", "Tables marked .global() (D1-backed, region-replicated) will appear here.", "Select a table to browse its rows.", "Shared across every tenant, stored once in D1. Includes auth tables.", "Partitioned per shard key into separate Durable Objects — scoped to the shard above.", "avg", "calls", "conflicts", "kind", "last error", "last run", "max", "Most called", "No functions have run on this shard yet.", "Recent", "Slowest", "Insights", "Surface slow functions, error spikes, and cache problems.", "No issues detected.", "Low cache hit rate", "High cache eviction rate", "Slow function", "High error rate", "High write contention", "{rate} hit rate over recent traffic.", "{count} entries evicted recently.", "Slowest call took {duration}.", "Slowest call took {duration} — it full-scanned {tables} with no index.", "{rate} of calls failed.", "{rate} of calls hit a write conflict — consider sharding to cut contention.", "Home", "Reports", "SQL / Functions", "Table editor", "Connection, health, and advisor summary for your deployment.", "Collapse sidebar", "Expand sidebar", "SQL editor", "Run read-only SQL against a shard.", "Run", "SQL query", "{count} rows", "Showing the first {max} of {count} rows.", "Showing the {n} most common values.", "No rows returned.", "Private", "Reference", "Search queries…", "New query", "Untitled query", "Delete query", "No saved queries yet — they save to this browser as you type.", "Results", "Explain", "Chart", "Split editor and results", "History", "Format", "Clear history", "No numeric column to chart.", "Click Run to execute your query.", "Untitled", "New tab", "Close tab", "Tab title", "Double-click to rename", "Discard?", "Discard changes", "Keep editing", "Close other tabs", "Close tabs to the right", "Close all tabs", "Discard unsaved tabs?", "column", "keyword", "Columns", "Show all", "Hide all", "Transpose", "Swap rows and columns", "Field", "Row {n}", "Loading…", "No matching row.", "CSV", "SQL", "{count} selected", "Delete {count}", "Delete {count} rows?", "Copy", "Copied", "Cell value", "Close", "Form", "Invalid JSON", "Command palette", "No results.", "Quick links", "Security findings", "Performance issues", "View", "All clear", "No data yet", "Get connected", "No issues found", "No security or performance issues detected.", "Client SDK", "React", "CLI", "Connect an AI agent", "Drive this deployment from an AI agent over the Model Context Protocol — it can list functions and tables, read schemas, and run read-only queries. Writes stay off unless you opt in.", "Copy MCP config", "Copy agent prompt", "Advisors", "Security", "Performance", "Warnings", "Info", "Issue type", "Entity/item", "Description", "{count} errors", "{count} warnings", "{count} suggestions", "No errors detected", "No warnings detected", "No suggestions", "Nothing to report for this deployment.", "Security and performance findings for your deployment.", "Review admin gates, credentials, and log redaction.", "Lunora checks admin-token strength, the live-subscription gate, and request-log redaction here.", "No security issues detected.", "Weak admin token", "Weak auth secret", "Session cookies are not Secure", "Wildcard CORS with credentials", "CSRF/origin guard is off", "Security headers are off", "Live admin subscriptions are ungated", "Request log keeps un-redacted args", "Unknown security finding", "Update your worker to a version of Lunora that describes this finding.", "Your admin token is {length} characters — use at least {min} for a brute-force-resistant secret.", "Your auth secret is {length} characters — use at least {min} (e.g. `openssl rand -hex 32`) to sign sessions safely.", "BETTER_AUTH_URL is a plaintext http:// origin, so session cookies cannot be Secure and ride in cleartext. Serve auth over https:// in production.", "LUNORA_ALLOWED_ORIGINS includes a wildcard while credentials are allowed — browsers reject this and it defeats the allowlist. Name explicit origins instead of *.", "LUNORA_SECURITY_CSRF is off, so cross-origin state-changing cookie requests are not blocked. Re-enable it in production to keep mutations un-forgeable.", "LUNORA_SECURITY_HEADERS is off, so HSTS, CSP, nosniff, and frame-options are not applied. Re-enable the baseline headers in production.", "Apply index", "Apply index on {table}", "Apply?", "CREATE INDEX SQL copied to clipboard.", "LUNORA_WS_BEARER is unset, so the WebSocket upgrade gate is open: live admin subscriptions need no credential. Set it to gate them like the HTTP admin RPCs.", "This worker reports a development environment, so the request log stores raw args and identity. Confirm it isn't a mislabeled production deploy.", "Audit", "A durable log of admin state-changing operations.", "Filter audit log", "filter op, table, id", "No audit entries.", "time", "op", "table", "detail", "Settings", "Deployment", "Read-only deployment config — vars, secrets, and bindings.", "Environment & bindings", "No environment variables or bindings.", "Open in Cloudflare", "Remove filter", "View-only — values are masked. Edit vars, secrets, and bindings in wrangler or the Cloudflare dashboard.", "URL", "Environment", "Version", "value", "Cascade impact", "Delete preview — rows that would cascade or be blocked", "No related rows found.", "Restrict relations will block this delete.", "Generate rows", "Generate dummy rows", "Seed {table} with Faker-generated rows. Existing rows are not affected.", "Row count", "(max {max})", "Columns to seed", "FK: no rows in {ref} — will skip", "→ {ref}", "No rows generated — all columns were skipped.", "Inserted {count} rows. Skipped FK columns: {cols}", "Inserted {count} rows successfully.", "Generate & insert", "Inserting…", "Time Travel", "Restore a shard to a point in the last 30 days.", "root", "In-place recovery to any moment in the last 30 days. For older or portable recovery, use the snapshot backup tier.", "Current bookmark", "Restore", "Time (ISO or epoch-ms, last 30 days)", "Preview", "Bookmark for that time", "Or an explicit bookmark (wins over time)", "bookmark string", "Restart the shard now so recovery applies immediately", "Confirm restore", "restarted now", "on next restart", "Restore armed", "Restored to", "Undo bookmark", "Confirm undo", "Undo restore", "role", "Role", "Role (optional)", "Active", "Banned", "unverified", "Manage", "New user", "Create", "Create user", "Creating…", "Password (optional)", "Search users", "Search by email or name…", "Filter by role", "Set role", "Ban user", "Ban reason (optional)", "Days", "Unban", "New password", "Set password", "Impersonate", "Impersonation token", "Revoke", "Revoke all sessions", "Delete user", "Confirm delete", "User details", "Fields", "Linked accounts", "No linked accounts.", "provider", "Unlink", "Security", "Disable two-factor", "No passkeys.", "Operations", "Organizations", "slug", "Members", "Invitations", "Remove", "No organizations.", "Select an organization to view its members and invitations.", "Organizations are not enabled.", "Enable the organization() plugin in your auth config to manage organizations here.", "Browse and manage organizations, members, and invitations.", "Reload", "Manage auth users — roles, bans, sessions, and identity.", "Auth config", "Configuration", "Enabled plugins and session config (read-only).", "Enabled capabilities", "Loading auth configuration…", "Accounts", "Admin", "Passkeys", "Two-factor", "Enabled", "Disabled", "OAuth providers, email templates, and rate limits are configured at deploy time in the better-auth setup and aren't editable here. See the Mail tab for email output.", "Sessions", "Browse and revoke active sessions across all users.", "user", "impersonated by", "Log drains", "Forward logs to Logpush, Tail Workers, or a webhook collector.", "Cloudflare destinations", "Lunora does not ship logs itself — forwarding is handled by Cloudflare. Configure a destination below, then test your collector.", "Logpush", "Stream every request log to R2, a SIEM, or a third-party log service.", "Tail Workers", "Send logs programmatically to a Worker for custom capture and forwarding.", "Workers Logs", "Retain and query recent request logs directly in Cloudflare's dashboard.", "Webhook test", "POST a sample Lunora request-log envelope to your collector to confirm it is reachable.", "https://example.com/logs", "Send test event", "Delivered — status {status} in {latency}ms", "Failed: {message}", "fetch is unavailable in this environment.", "Realtime", "Active WebSocket subscriptions on this shard.", "{count} connections", "{count} subscriptions", "No active subscriptions.", "Connection", "admin", "Folder path", "Grid", "Sort", "Name", "Type", "Modified", "Toggle sort direction", "Thumbnail size", "Link expiry", "15m", "1h", "24h", "7d", "Upload", "Uploading…", "Copy URL", "Download", "Delete object?", "Uploaded {key}", "Deleted {key}", "Summary", "Time range", "All time", "Last 5m", "Last 15m", "Last hour", "filter path", "By level", "By function", "Count", "{count} entries", "Snippets", "Couldn't load the OpenAPI spec: {message}", "No OpenAPI spec configured", "Run `lunora codegen` and wire `_generated/openapi.json` to the worker to render the API reference here.", "API operations", "Filter operations", "No operations match your filter.", "Try it", "Request arguments", "Response body", "Response", "application/json", "Arguments (JSON)", "Send", "Sending…", "Send a request to see the response.", "No example for this response.", "Error", "{ms} ms", "Range", "Value in", "relation", "API spec format", "OpenAPI", "OpenRPC", "Params", "Result", "Field", "Required", "JSON-RPC request", "Couldn't load the OpenRPC spec: {message}", "No OpenRPC spec configured", "Run `lunora codegen --api-spec openrpc` and wire `_generated/openrpc.json` to the worker to render the OpenRPC reference here.", "used by", "Orphan", "1 record", "{count} records", "References shard", "Which shard's records are checked for references to these files. Empty = root shard.", "Orphaned objects", "Find records whose file reference points at an object the bucket no longer has.", "Check for orphans", "Checking…", "No dangling references.", "Every record's file reference points at an object that exists in the bucket.", "Missing object", "→", "Showing the first {count} dangling references — the scan was truncated.", "Per-function call counts, error rates, and latency land here after your first request.", "Function and request logs for this shard show up here as your app handles traffic.", "No tables in this shard.", "Browse Vectorize indexes and run similarity searches.", "dimensions", "field", "Indexes declared with .vectorize() or defineVectorIndex() appear here.", "metadata", "metric", "No matches.", "No vector indexes.", "score", "Search", "Search by similarity…", "Searching…", "vectors", "Vectors", "Add a kv_namespaces binding to wrangler.jsonc — it appears here automatically, no wiring needed.", "Browse and edit key-value pairs in your Workers KV namespaces.", "Deleting…", "Expiration", "Filter", "Filter by prefix…", "Filter keys by prefix", "Key is absent or has no value.", "KV", "KV value", "Copy key", "Copy value", "Create key", "Failed to delete {count} keys.", "Format JSON", "Key name", "Expires after", "TTL unit", "TTL must be at least 60 seconds.", "seconds", "minutes", "hours", "days", "Leave blank to keep the current expiration.", "Metadata (JSON)", "Metadata must be valid JSON.", "New key", "No expiration", "Select all", "Select {name}", "Metadata", "Namespace", "No keys.", "No KV namespaces.", "Saving…", "vs. prev.", "Top functions", "No functions called yet.", "Calls", "Avg", "Err", "Avg latency", "cache hit", "Live connections", "sockets", "active subscriptions", "Recent activity", "No recent activity.", "last interval", "{rate} error rate", "cache entries", "Critical", "Degraded", "All systems healthy", "One or more service levels are breached.", "Some service levels need attention.", "All service levels are within target.", "Analytics", "Analytics is not configured.", "Hot shards", "Latency p50 / p95 per function", "No data points yet.", "Request volume per function", "Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN (Analytics Read) in your .dev.vars to enable usage panels.", "Usage and latency from Analytics Engine — request volume, p50/p95, and hot shards.", "(whole bucket)", "Access Rules", "Bucket", "Inspect storage access rules — per bucket, operation, and key prefix.", "No defineStorageRule is wired through .use(storageRules(...)) in this deployment. Add one to gate object access by key prefix.", "No storage rules defined", "Operation", "Storage rules are declared in code with defineStorageRule and gate ctx.storage access per bucket. This view is read-only.", "Write", "Queues", "Queue", "Mode", "Dead-letter", "No queues defined", "Inspect declared Cloudflare Queues — their producer bindings, consumer mode, and dead-letter queue.", "No defineQueue is declared in lunora/queues.ts in this deployment. Add one to offload async work to a Cloudflare Queue.", "Queues are declared in code with defineQueue. Enqueue from a mutation or action with ctx.queues.<name>.send(...); push consumers process batches in the worker.", "No dead-letter queue on {queues}.", "Exhausted messages are dropped after retries. Add a deadLetterQueue to capture them.", "1 message was recently dead-lettered.", "{count} messages were recently dead-lettered.", "Batch mode needs a JSON array body — each element is enqueued as one message.", "Body", "Body must be valid JSON.", "Captured", "Clear log", "Cloudflare Queues have no peek API, so this is what push consumers actually processed — not pending depth.", "Consumed messages appear here once a push consumer processes a batch in dev. Send one from the Send tab to see it captured.", "Declare a queue with defineQueue in lunora/queues.ts to enqueue a test message.", "Declared", "Delay must be a non-negative number of seconds.", "Delay (s)", "Delay (seconds)", "DLQ", "Enqueue a JSON message to a declared producer to exercise its consumer. Nothing is captured until the consumer processes it.", "Message", "Message body (JSON)", "Messages", "No consumed messages yet.", "No queues to send to", "Outcome", "Replay", "Replaying…", "Send as batch (JSON array)", "Send message", "Flags", "Inspect feature flags and their live evaluation under a targeting context.", "Feature flags are read in code with ctx.flags.<type>(\"key\", default). They evaluate through the OpenFeature provider configured in lunora/flags.ts; edit the targeting context below to see how each flag resolves for a given audience.", "Targeting context (JSON)", "Targeting context must be a JSON object.", "Targeting context is not valid JSON.", "Live updates unavailable; showing the last evaluation.", "No @lunora/flags provider is wired in this deployment. Add lunora/flags.ts with defineFlags({ provider }) to gate code paths on feature flags.", "No flags provider configured", "A flags provider is configured, but no handler reads a flag yet. Call ctx.flags.boolean(\"key\", false) in a query, mutation, or action.", "No flags read", "Key", "Value", "Reason", "Variant", "Workflows", "Inspect declared Cloudflare Workflows and their bindings.", "Binding", "Class", "No workflows defined", "No defineWorkflow is declared in lunora/workflows.ts in this deployment. Add one to run a durable, multi-step workflow.", "Workflows are declared in code with defineWorkflow and run as durable Cloudflare Workflows. This view is read-only.", "Workflows are declared in code with defineWorkflow and run as durable Cloudflare Workflows. Start an instance and observe its status below.", "Start instance", "Starting…", "Workflow", "Instance id", "Instance id (optional)", "Params (JSON)", "Params (JSON, optional)", "Params must be valid JSON", "Instances", "Status", "Output", "Refresh", "Refreshing…", "Instance history", "Filter by status", "All statuses", "Workflow inspection not configured", "Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN in your .dev.vars to enable workflow instance history.", "No instances", "No instances match this filter for the selected workflow.", "Created", "Ended", "Steps", "Step", "Attempts", "Started", "This instance has no recorded steps yet.", "pause", "resume", "terminate", ">100ms avg execution", "50–100ms avg execution", "<50ms avg execution", "{count} tracked statements", "Avg time", "avg", "avg time", "avgTime", "Critical queries", "Exec count", "exec count", "execCount", "Execution count", "Fast queries", "Full statement", "Moderate queries", "No query insights yet", "Overview", "P90 latency", "P95 latency", "Query insights", "Query insights appear once statements are executed against this shard.", "Query leaderboard", "Rows read", "Rows written", "rowsRead", "Slow queries sorted by {sortField}", "Sort by", "Sort queries by", "Statements", "total", "Total time", "total time", "totalTime", "Edit schema", "Add table", "Add column", "Add index", "Rename / drop / change type…", "Table name", "Column name", "Column type", "Index name", "Index fields (comma-separated)", "Optional", "Unique", "Cancel", "Apply", "Applying…", "This edit changes stored data and must go through a migration. Review the migration before applying.", "Open Migrations", "Schema updated.", "Codegen reported diagnostics:", "Editing the schema is only available in local dev.", "Adds a table, column, or index to lunora/schema.ts and reruns codegen.", "Theme", "Dark theme", "Light theme", "System theme", "Integrity", "Fan-out", "auto-scaled: {relayCount}/{maxRelays} relays", "auto-scaled: {relayCount}/{maxRelays} relays (at ceiling)", "Realtime fan-out cost and per-topic subscriber counts for this shard.", "No fan-out activity yet.", "peak {count} subscribers", "Hot topics", "Topic", "Kind", "Subscribers", "Fan-out cost since this instance woke", "Shape pokes", "Whisper broadcasts", "Passes", "Sockets iterated", "Delivered", "Peak width", "Max time", "Containers", "Container", "Instance", "Last event", "Detail", "Exit", "When", "No container activity", "Live Cloudflare Containers — current lifecycle state per instance from the log stream.", "Cloudflare Containers are observed from their lifecycle log stream. This shows the current state per instance — ports and health checks aren't carried in that stream.", "No container lifecycle activity yet. Instances declared with defineContainer show up here once they start, sleep, stop, or error.", "Issues", "Issue", "Source", "Events", "First seen", "Last seen", "No issues", "Grouped error triage — Worker throws and container crashes folded by fingerprint.", "No grouped errors yet. When a function throws or a container crashes, matching errors fold into a single issue here.", "optional", "required", "unique", "Plugin fields", "New organization", "Edit organization", "Delete organization", "Delete this organization? Its members, invitations, teams, and custom roles are removed. This cannot be undone.", "Slug (optional — derived from name)", "Logo URL (optional)", "Owner user id (optional)", "Metadata (JSON, optional)", "Add member", "Invite member", "Send invitation", "Change member role", "Change role", "New team", "Rename team", "Rename", "Delete team", "Delete this team and its memberships? This cannot be undone.", "Add team member", "Team members", "No members.", "No teams.", "No team members.", "Teams", "New role", "Edit role", "Delete role", "Delete this custom role? Members keeping it will lose its grants.", "No custom roles.", "Role name", "Permission", "Permission (JSON, e.g. {\"project\":[\"create\",\"update\"]})", "Plugins", "No plugins enabled.", "Sign-in methods", "Email & password", "Social providers", "None", "Custom roles", "Session policy", "Expires in", "Refresh after", "Fresh window", "Cookie cache", "Rate limit", "Max requests", "Window", "Plugin user fields"];
|
|
1343
1251
|
/** A known studio message id — one of the entries in {@link MESSAGE_IDS}. */
|
|
1344
1252
|
type MessageId = (typeof MESSAGE_IDS)[number];
|
|
1345
|
-
/**
|
|
1346
|
-
* English message catalog.
|
|
1347
|
-
*
|
|
1348
|
-
* English is the source locale: every call site passes its English string as the
|
|
1349
|
-
* message id (e.g. `t("Save")`), and Lingui compiles the id verbatim when a
|
|
1350
|
-
* catalog has no entry for it. So English needs no translations — this stays
|
|
1351
|
-
* empty and the source strings render as-is. The known ids live in
|
|
1352
|
-
* {@link MESSAGE_IDS}, which types the `t` function.
|
|
1353
|
-
*/
|
|
1354
1253
|
/** The locale the studio ships with and falls back to. */
|
|
1355
1254
|
declare const DEFAULT_LOCALE = "en";
|
|
1356
1255
|
/**
|
|
1357
|
-
* Locale code to catalog. Each catalog maps an English source string (which
|
|
1358
|
-
* doubles as the message id) to its translation. English ships empty: Lingui
|
|
1359
|
-
* compiles the id verbatim when a translation is missing, so the source strings
|
|
1360
|
-
* render as-is. To add a language, register `{ "Some English text": "…" }`.
|
|
1361
|
-
*/
|
|
1256
|
+
* Locale code to catalog. Each catalog maps an English source string (which
|
|
1257
|
+
* doubles as the message id) to its translation. English ships empty: Lingui
|
|
1258
|
+
* compiles the id verbatim when a translation is missing, so the source strings
|
|
1259
|
+
* render as-is. To add a language, register `{ "Some English text": "…" }`.
|
|
1260
|
+
*/
|
|
1362
1261
|
type StudioCatalogs = Readonly<Record<string, Messages>>;
|
|
1363
1262
|
/**
|
|
1364
|
-
* Translate function: `t("Clear")` or `t("{title} failed", { title })`.
|
|
1365
|
-
*
|
|
1366
|
-
* `id` is constrained to a known {@link MessageId}, so a typo is a compile error.
|
|
1367
|
-
* The interpolation `values` stay loosely typed: mapping each id to its exact
|
|
1368
|
-
* placeholder set isn't worth the machinery for the handful of interpolated
|
|
1369
|
-
* strings, so a wrong or missing value key isn't caught at this boundary.
|
|
1370
|
-
*/
|
|
1263
|
+
* Translate function: `t("Clear")` or `t("{title} failed", { title })`.
|
|
1264
|
+
*
|
|
1265
|
+
* `id` is constrained to a known {@link MessageId}, so a typo is a compile error.
|
|
1266
|
+
* The interpolation `values` stay loosely typed: mapping each id to its exact
|
|
1267
|
+
* placeholder set isn't worth the machinery for the handful of interpolated
|
|
1268
|
+
* strings, so a wrong or missing value key isn't caught at this boundary.
|
|
1269
|
+
*/
|
|
1371
1270
|
type TFunction = (id: MessageId, values?: Record<string, unknown>) => string;
|
|
1372
1271
|
/**
|
|
1373
|
-
* Build a studio-scoped Lingui instance. We deliberately use `@lingui/core`'s
|
|
1374
|
-
* `setupI18n` (a fresh instance) rather than the global singleton so the
|
|
1375
|
-
* studio can never clobber — or be clobbered by — a host app that also uses
|
|
1376
|
-
* Lingui.
|
|
1377
|
-
*
|
|
1378
|
-
* The message compiler is installed explicitly. `@lingui/core` only auto-installs
|
|
1379
|
-
* it when `NODE_ENV !== "production"`, but the studio ships as a library and
|
|
1380
|
-
* relies on the compiler at runtime to interpolate uncompiled source strings
|
|
1381
|
-
* (e.g. `t("{title} failed", { title })`). Without this, a consumer's production
|
|
1382
|
-
* build would render `{title}` literally and `console.warn` on every `t(...)`.
|
|
1383
|
-
*
|
|
1384
|
-
* Pass extra `catalogs` to ship more locales; unknown `locale` codes fall back
|
|
1385
|
-
* to `DEFAULT_LOCALE`.
|
|
1386
|
-
*/
|
|
1272
|
+
* Build a studio-scoped Lingui instance. We deliberately use `@lingui/core`'s
|
|
1273
|
+
* `setupI18n` (a fresh instance) rather than the global singleton so the
|
|
1274
|
+
* studio can never clobber — or be clobbered by — a host app that also uses
|
|
1275
|
+
* Lingui.
|
|
1276
|
+
*
|
|
1277
|
+
* The message compiler is installed explicitly. `@lingui/core` only auto-installs
|
|
1278
|
+
* it when `NODE_ENV !== "production"`, but the studio ships as a library and
|
|
1279
|
+
* relies on the compiler at runtime to interpolate uncompiled source strings
|
|
1280
|
+
* (e.g. `t("{title} failed", { title })`). Without this, a consumer's production
|
|
1281
|
+
* build would render `{title}` literally and `console.warn` on every `t(...)`.
|
|
1282
|
+
*
|
|
1283
|
+
* Pass extra `catalogs` to ship more locales; unknown `locale` codes fall back
|
|
1284
|
+
* to `DEFAULT_LOCALE`.
|
|
1285
|
+
*/
|
|
1387
1286
|
declare const createStudioI18n: (locale?: string, catalogs?: StudioCatalogs) => I18n;
|
|
1388
1287
|
/**
|
|
1389
|
-
* Shared default instance. Backs the i18n context's default value so the
|
|
1390
|
-
* composable studio and individual exported panels resolve their strings even
|
|
1391
|
-
* when rendered without `StudioI18nProvider` (e.g. in tests, or a host's own
|
|
1392
|
-
* admin UI). English-only, so it renders source strings as-is.
|
|
1393
|
-
*/
|
|
1288
|
+
* Shared default instance. Backs the i18n context's default value so the
|
|
1289
|
+
* composable studio and individual exported panels resolve their strings even
|
|
1290
|
+
* when rendered without `StudioI18nProvider` (e.g. in tests, or a host's own
|
|
1291
|
+
* admin UI). English-only, so it renders source strings as-is.
|
|
1292
|
+
*/
|
|
1394
1293
|
declare const studioI18n: I18n;
|
|
1395
1294
|
/**
|
|
1396
|
-
* Hook returning a `t` bound to the nearest `StudioI18nProvider` (or the
|
|
1397
|
-
* shared instance when there's none). This is the runtime stand-in for Lingui's
|
|
1398
|
-
* `t` macro — the studio builds with esbuild and tests under Vite 8/Rolldown,
|
|
1399
|
-
* neither of which runs Lingui's Babel macro transform, so call sites pass the
|
|
1400
|
-
* English string as the id directly.
|
|
1401
|
-
*/
|
|
1295
|
+
* Hook returning a `t` bound to the nearest `StudioI18nProvider` (or the
|
|
1296
|
+
* shared instance when there's none). This is the runtime stand-in for Lingui's
|
|
1297
|
+
* `t` macro — the studio builds with esbuild and tests under Vite 8/Rolldown,
|
|
1298
|
+
* neither of which runs Lingui's Babel macro transform, so call sites pass the
|
|
1299
|
+
* English string as the id directly.
|
|
1300
|
+
*/
|
|
1402
1301
|
declare const useT: () => TFunction;
|
|
1403
1302
|
interface StudioI18nProviderProps {
|
|
1404
1303
|
/** Catalogs to register in addition to the built-in English one. */
|
|
@@ -1410,15 +1309,10 @@ interface StudioI18nProviderProps {
|
|
|
1410
1309
|
readonly locale?: string;
|
|
1411
1310
|
}
|
|
1412
1311
|
/**
|
|
1413
|
-
* Provides a studio-scoped Lingui instance to `useT`. Nesting is safe:
|
|
1414
|
-
* providers sharing the same instance resolve to the same context value.
|
|
1415
|
-
*/
|
|
1416
|
-
declare const StudioI18nProvider: ({
|
|
1417
|
-
catalogs,
|
|
1418
|
-
children,
|
|
1419
|
-
i18n,
|
|
1420
|
-
locale
|
|
1421
|
-
}: StudioI18nProviderProps) => ReactElement;
|
|
1312
|
+
* Provides a studio-scoped Lingui instance to `useT`. Nesting is safe:
|
|
1313
|
+
* providers sharing the same instance resolve to the same context value.
|
|
1314
|
+
*/
|
|
1315
|
+
declare const StudioI18nProvider: ({ catalogs, children, i18n, locale }: StudioI18nProviderProps) => ReactElement;
|
|
1422
1316
|
/** Root class the batteries-included app sets so the studio styles stay scoped. */
|
|
1423
1317
|
declare const STUDIO_ROOT_CLASS = "lunora-studio-root";
|
|
1424
1318
|
export { ADMIN_FUNCTIONS, ADMIN_FUNCTION_PREFIX, type AggregateMetrics, ApiDocsPanel, type ApiDocsPanelProps, ApiReferencePanel, type ApiReferencePanelProps, ApiTab, type ApiTabProps, type AuditEntry, type AuditLogResult, AuditPanel, type AuditPanelProps, type CacheStats, type CapturedMailResult, type CommandItem, CommandPalette, type CommandPaletteProps, ConfirmButton, type ConfirmButtonProps, ConnectionBadge, DEFAULT_AUTO_REFRESH_MS, DEFAULT_INSIGHT_THRESHOLDS, DEFAULT_LOCALE, DataBrowser, type DataBrowserProps, DataFilters, type DeployInfo, type EditableFilter, ErrorBoundary, type ErrorBoundaryProps, ExportImportPanel, type ExportImportPanelProps, type ExportRow, FileBrowser, type FileBrowserProps, type FilterClause, type FilterOperator, type FunctionCallStat, type FunctionDescriptor, FunctionRunner, type FunctionRunnerProps, FunctionStatsPanel, type FunctionStatsPanelProps, type FunctionStatsResult, GlobalDataBrowser, type GlobalDataBrowserProps, HealthPanel, type HealthPanelProps, HomePanel, type HomePanelProps, type ImportError, type ImportShardResult, type Insight, type InsightKind, type InsightSeverity, type InsightThresholds, InsightsPanel, type InsightsPanelProps, type LogEntry, type LogLevel, LogsPanel, type LogsPanelProps, type LogsResult, MailPanel, type MailPanelProps, type MessageId, MetricsPanel, type MetricsPanelProps, type MigrationDirection, type MigrationRunResult, type MigrationStatus, type MigrationStatusRow, MigrationsPanel, type MigrationsPanelProps, OpenRpcReferencePanel, type OpenRpcReferencePanelProps, PitrPanel, type PitrPanelProps, type RunMigrationArgs, STUDIO_ROOT_CLASS, SchemaViewer, type SchemaViewerProps, SecurityAdvisorPanel, type SecurityAuditResult, type SecurityFinding, type SecurityFindingKind, type SecurityFindingLevel, type SettingEntry, type SettingKind, SettingsPanel, type SettingsPanelProps, type SettingsResult, ShardInput, type ShardInputProps, type ShardMetrics, type ShardMetricsResult, SqlEditorPanel, type SqlEditorPanelProps, type StudioCatalogs, StudioI18nProvider, type StudioI18nProviderProps, type TFunction, TableEditor, type TableEditorProps, type TableIndexInfo, type TableIndexesResult, type TableInfo, type TablePage, type WriteRowArgs, type WriteRowOp, type WriteRowResult, aggregateMetrics, createStudioI18n, deriveInsights, openCommandPalette, shardsToAggregate, studioI18n, toFilterClauses, useAutoRefresh, useDebounced, useT };
|