@lunora/studio 1.0.0-alpha.118 → 1.0.0-alpha.119

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/dist/index.d.ts +3 -2
  2. package/dist/index.js +1 -1
  3. package/dist/mount.js +1 -1
  4. package/dist/packem_chunks/AdvisorHealthPanel.js +1 -1
  5. package/dist/packem_chunks/ApiTab.js +1 -1
  6. package/dist/packem_chunks/AuditPanel.js +1 -1
  7. package/dist/packem_chunks/ExportImportPanel.js +1 -1
  8. package/dist/packem_chunks/FileBrowser.js +1 -1
  9. package/dist/packem_chunks/FunctionRunner.js +1 -1
  10. package/dist/packem_chunks/FunctionStatsPanel.js +1 -1
  11. package/dist/packem_chunks/HealthPanel.js +1 -1
  12. package/dist/packem_chunks/InsightsPanel.js +1 -1
  13. package/dist/packem_chunks/LogsPanel.js +1 -1
  14. package/dist/packem_chunks/MailPanel.js +1 -1
  15. package/dist/packem_chunks/MetricsPanel.js +1 -1
  16. package/dist/packem_chunks/NotificationsPanel.js +1 -1
  17. package/dist/packem_chunks/PitrPanel.js +1 -1
  18. package/dist/packem_chunks/SchemaViewer.js +1 -1
  19. package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -1
  20. package/dist/packem_chunks/SettingsPanel.js +1 -1
  21. package/dist/packem_chunks/SqlEditorPanel.js +1 -1
  22. package/dist/packem_chunks/TableEditor.js +1 -1
  23. package/dist/packem_chunks/agents-panel.js +1 -1
  24. package/dist/packem_chunks/auth-audit-panel.js +1 -1
  25. package/dist/packem_chunks/containers-panel.js +1 -1
  26. package/dist/packem_chunks/dashboards-panel.js +1 -1
  27. package/dist/packem_chunks/evals-panel.js +1 -1
  28. package/dist/packem_chunks/fanout-panel.js +1 -1
  29. package/dist/packem_chunks/flags-panel.js +1 -1
  30. package/dist/packem_chunks/issues-panel.js +1 -1
  31. package/dist/packem_chunks/kv-browser.js +1 -1
  32. package/dist/packem_chunks/migrations-route.js +1 -1
  33. package/dist/packem_chunks/payments-panel.js +1 -1
  34. package/dist/packem_chunks/permissions-panel.js +1 -1
  35. package/dist/packem_chunks/queues-panel.js +1 -1
  36. package/dist/packem_chunks/reactors-panel.js +1 -0
  37. package/dist/packem_chunks/rls-panel.js +1 -1
  38. package/dist/packem_chunks/storage-rules-panel.js +1 -1
  39. package/dist/packem_chunks/subscriptions-panel.js +1 -1
  40. package/dist/packem_chunks/traces-panel.js +1 -1
  41. package/dist/packem_chunks/workflows-panel.js +1 -1
  42. package/dist/packem_shared/ADMIN_FUNCTIONS-B6z7VLYt.js +1 -0
  43. package/dist/packem_shared/{ApiDocsPanel-C_dZt4ve.js → ApiDocsPanel-BMzLPgvv.js} +1 -1
  44. package/dist/packem_shared/{DataBrowser-BPCr2f8V.js → DataBrowser-C68K5QHO.js} +1 -1
  45. package/dist/packem_shared/{HomePanel-B8U_LJkK.js → HomePanel-B-tcMcTZ.js} +1 -1
  46. package/dist/packem_shared/{MigrationsPanel-CF73xHke.js → MigrationsPanel-CLRWwPyL.js} +1 -1
  47. package/dist/packem_shared/{Studio-RFVDC2sC.js → Studio-BYdUxnM5.js} +1 -1
  48. package/dist/packem_shared/{StudioApp-jTW-QnDo.js → StudioApp-Bxmtp-Fi.js} +1 -1
  49. package/dist/packem_shared/{home-panel-DywiFhDs.js → home-panel-ecz6-nHV.js} +1 -1
  50. package/dist/packem_shared/studio-Cvdwfzxm.js +2 -0
  51. package/dist/packem_shared/{use-sql-assistant-DFO2i-n-.js → use-sql-assistant-CXgVX_PP.js} +1 -1
  52. package/dist/standalone/{chunk-FN5OO2OT.js → chunk-2F6FYL5O.js} +1 -1
  53. package/dist/standalone/{chunk-4ZTQORBY.js → chunk-2RASQG3R.js} +1 -1
  54. package/dist/standalone/{chunk-ZYWLKW7L.js → chunk-2VLBFSIX.js} +1 -1
  55. package/dist/standalone/{chunk-YIEWRRZG.js → chunk-4DJQV5UA.js} +1 -1
  56. package/dist/standalone/{chunk-IN2BDO6Y.js → chunk-4LVLLM6B.js} +1 -1
  57. package/dist/standalone/{chunk-GQJOXK25.js → chunk-4Y2QHI65.js} +1 -1
  58. package/dist/standalone/{chunk-5QLWJ2DD.js → chunk-5COHJLQF.js} +1 -1
  59. package/dist/standalone/{chunk-XZACOGRP.js → chunk-5JF2HAU4.js} +1 -1
  60. package/dist/standalone/chunk-5QAT5NQ4.js +1 -0
  61. package/dist/standalone/{chunk-HT7B3NZN.js → chunk-6J5TEYI5.js} +1 -1
  62. package/dist/standalone/{chunk-NWXW4JWB.js → chunk-6KJLNWPJ.js} +1 -1
  63. package/dist/standalone/{chunk-OHYP4OEU.js → chunk-6QKKYBML.js} +1 -1
  64. package/dist/standalone/{chunk-P2GOC5GL.js → chunk-7CVIN6KU.js} +1 -1
  65. package/dist/standalone/{chunk-3HLSTC4J.js → chunk-A44VDLY3.js} +1 -1
  66. package/dist/standalone/{chunk-5GFVNJR5.js → chunk-ATGYWQUI.js} +1 -1
  67. package/dist/standalone/{chunk-ILRATMDS.js → chunk-BKW7FMAU.js} +1 -1
  68. package/dist/standalone/{chunk-NXHRLXOC.js → chunk-BYJZGWWY.js} +1 -1
  69. package/dist/standalone/{chunk-QBVBJKLV.js → chunk-CFQQSG6L.js} +1 -1
  70. package/dist/standalone/{chunk-G4FZNPHS.js → chunk-D3ZLKFO4.js} +1 -1
  71. package/dist/standalone/{chunk-DVHN4KWR.js → chunk-DYKGLIBC.js} +1 -1
  72. package/dist/standalone/chunk-DZGOHOOE.js +1 -0
  73. package/dist/standalone/{chunk-O2VDNK4B.js → chunk-FJ6G6FNE.js} +1 -1
  74. package/dist/standalone/{chunk-HFDJ2FL3.js → chunk-GTEXP4P3.js} +1 -1
  75. package/dist/standalone/{chunk-45MGKKVR.js → chunk-J2GQE4PW.js} +1 -1
  76. package/dist/standalone/{chunk-O6N6T57Q.js → chunk-JIPVSPSG.js} +1 -1
  77. package/dist/standalone/{chunk-AWYHNGHI.js → chunk-KPQROFH5.js} +1 -1
  78. package/dist/standalone/{chunk-FQX3BSPP.js → chunk-KWGHNORP.js} +1 -1
  79. package/dist/standalone/{chunk-5PU6Q4DG.js → chunk-P54YTPHL.js} +1 -1
  80. package/dist/standalone/{chunk-XUVD6ILO.js → chunk-PS66CRK5.js} +1 -1
  81. package/dist/standalone/{chunk-EIWJYMNM.js → chunk-QDGAB4R2.js} +1 -1
  82. package/dist/standalone/{chunk-MZ6O7Z67.js → chunk-QKN5EHEF.js} +1 -1
  83. package/dist/standalone/{chunk-ELJFDMV3.js → chunk-QXLU6YPU.js} +1 -1
  84. package/dist/standalone/{chunk-TDCEPDQ3.js → chunk-R3G55P4J.js} +1 -1
  85. package/dist/standalone/chunk-R4HRS232.js +1 -0
  86. package/dist/standalone/{chunk-22LNEQ5H.js → chunk-R52YOHVU.js} +1 -1
  87. package/dist/standalone/{chunk-4PCLBPH4.js → chunk-RK5XWYUL.js} +1 -1
  88. package/dist/standalone/{chunk-EG6CI6JJ.js → chunk-RSG2DVHH.js} +1 -1
  89. package/dist/standalone/{chunk-O5FM6GKY.js → chunk-T5SC5RAD.js} +1 -1
  90. package/dist/standalone/{chunk-HUGJ4X52.js → chunk-TCKQ4E5Y.js} +1 -1
  91. package/dist/standalone/{chunk-TYOIBCR6.js → chunk-UBT2FIU5.js} +1 -1
  92. package/dist/standalone/{chunk-FD7DEJMJ.js → chunk-VDSFYFDH.js} +1 -1
  93. package/dist/standalone/{chunk-ZBGI3UQN.js → chunk-WFABZPAK.js} +1 -1
  94. package/dist/standalone/{chunk-MKZV6X4G.js → chunk-WIFYD4A6.js} +1 -1
  95. package/dist/standalone/{chunk-2UP5EBFR.js → chunk-WYSR5F77.js} +1 -1
  96. package/dist/standalone/{chunk-4SM4AD63.js → chunk-XFU6YBYL.js} +1 -1
  97. package/dist/standalone/{chunk-PWN4NIIK.js → chunk-XRC7KEEN.js} +1 -1
  98. package/dist/standalone/{chunk-5FS4HLRG.js → chunk-XTNSQYXW.js} +1 -1
  99. package/dist/standalone/chunk-XUX7B54Z.js +1 -0
  100. package/dist/standalone/{chunk-GEX7IWQL.js → chunk-YN2KHW3B.js} +1 -1
  101. package/dist/standalone/studio.js +1 -1
  102. package/package.json +5 -5
  103. package/dist/packem_shared/ADMIN_FUNCTIONS-4aE59aDq.js +0 -1
  104. package/dist/packem_shared/studio-BdV57x3O.js +0 -2
  105. package/dist/standalone/chunk-7VYPO4TI.js +0 -1
  106. package/dist/standalone/chunk-OQS4HFKC.js +0 -1
  107. package/dist/standalone/chunk-VDW32UET.js +0 -1
package/dist/index.d.ts CHANGED
@@ -28,7 +28,7 @@ export type { LunoraClient, ScheduleRecord, StorageObject } from '@lunora/client
28
28
  * importing `studio.tsx`, which pulls in every lazy panel behind it.
29
29
  */
30
30
  /** Identifier for each built-in studio tab. */
31
- type StudioTab = "agents" | "analytics" | "api" | "audit" | "authAudit" | "authConfig" | "authSessions" | "containers" | "dashboards" | "data" | "deploymentHealth" | "drains" | "export" | "fanout" | "files" | "flags" | "functions" | "health" | "home" | "insights" | "issues" | "kv" | "logs" | "mail" | "metrics" | "migrations" | "notifications" | "organizations" | "payments" | "permissions" | "pitr" | "queues" | "realtime" | "rls" | "schedule" | "schema" | "advisorHealth" | "evals" | "security" | "settings" | "sql" | "storageRules" | "traces" | "users" | "vectors" | "workflows";
31
+ type StudioTab = "agents" | "analytics" | "api" | "audit" | "authAudit" | "authConfig" | "authSessions" | "containers" | "dashboards" | "data" | "deploymentHealth" | "drains" | "export" | "fanout" | "files" | "flags" | "functions" | "health" | "home" | "insights" | "issues" | "kv" | "logs" | "mail" | "metrics" | "migrations" | "notifications" | "organizations" | "payments" | "permissions" | "pitr" | "queues" | "reactors" | "realtime" | "rls" | "schedule" | "schema" | "advisorHealth" | "evals" | "security" | "settings" | "sql" | "storageRules" | "traces" | "users" | "vectors" | "workflows";
32
32
  /**
33
33
  * One palette entry: a navigable destination, or an action to run.
34
34
  *
@@ -189,6 +189,7 @@ declare const ADMIN_FUNCTIONS: {
189
189
  readonly getIssues: "__lunora_admin__:getIssues";
190
190
  readonly lintSql: "__lunora_admin__:lintSql";
191
191
  readonly listFlags: "__lunora_admin__:listFlags";
192
+ readonly listReactors: "__lunora_admin__:listReactors";
192
193
  readonly listPushSubscriptions: "__lunora_admin__:listPushSubscriptions";
193
194
  readonly listQueues: "__lunora_admin__:listQueues";
194
195
  readonly listSubscriptions: "__lunora_admin__:listSubscriptions";
@@ -1385,7 +1386,7 @@ declare const useDebounced: <T>(value: T, delayMs?: number, resetKey?: unknown)
1385
1386
  * sibling catalog (for example `de.ts`) mapping each id to its translation and
1386
1387
  * register it via `createStudioI18n(locale, { en: enMessages, de: deMessages })`.
1387
1388
  */
1388
- declare const MESSAGE_IDS: readonly ["Agents", "Agent", "Threads", "Timeline", "Messages", "Tokens", "Updated", "Content", "Tool", "Usage", "Approval", "Score your app's advisor findings: a grade, the coverage split, and every procedure ranked worst-first.", "Health score", "Rules fired", "Procedure", "Score", "Kind", "clean", "warned", "failing", "exempt", "sensitive", "no reason given", "Schema & config", "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)", "(none)", "{count} active", "{count} calls", "{count} failed", "{total} total", "No subscriptions yet", "No payments configured", "No @lunora/payment tables found in this deployment. Declare the store tables (subscriptions, events, …) in lunora/schema.ts and wire `payment` on createShardDO() to sync customers and subscriptions.", "Payments", "Plan", "Provider", "Recent webhook events", "Renews", "State", "Subscriptions", "Synced customers, subscriptions, and webhook events.", "{count} messages", "{count} pending changes", "{count} pasted cells were skipped", "{count} running", "{name} ({rowCount})", "{rangeStart}-{rangeEnd} of {total}", "{rate} ({count} entries)", "{reachable} reachable", "{reachable} reachable, {failed} unreachable", "{status} — processed", "{title} failed", "Actions", "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", "Instruments", "Instruments unavailable: {error}", "Counter", "Gauge", "Histogram", "count", "range", "trend", "trace", "{name} trend", "Open the exemplar trace {trace}", "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.", "Archive", "Log archive not configured", "Wire pipelineLogSink to a Cloudflare Pipeline → R2 Data Catalog table and set R2_SQL_ACCOUNT_ID, R2_SQL_TOKEN, R2_SQL_BUCKET to browse the durable log archive here.", "No archived logs.", "No archived logs match these filters. The durable archive fills as pipelineLogSink flushes records to R2.", "Function path prefix", "function path…", "user id…", "Minimum level", "min level", "Time", "Level", "Trace", "User", "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.", "Move widget down", "Move widget up", "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", "SQL problems", "Operation console", "Suggest chart", "Chart type", "Widget type", "Could not suggest a chart for that result.", "Add a chart, a single value, a table, or a note. Everything is saved on this browser.", "Keyboard shortcuts", "Command palette", "Reset", "Stored in this browser. Focus a box and press a key to rebind it.", "Single value", "Text", "Notes for whoever reads this dashboard.", "Charts, values, tables, and notes. Drag a tile to reorder.", "—", "Bar", "Line", "Area", "Suggesting…", "Describe the query you want", "Draft SQL", "Thinking…", "Fix this", "Related", "p50", "p95", "showing a capped set", "Statements executed in the selected window appear here, with throughput and latency over time.", "No queries in this window.", "Throughput", "Mean latency (ms)", "Schema versions", "Data migrations", "{count} pushes", "live", "Show in console", "Every admin call this studio makes is recorded here.", "{count} rows", "Filter", "Each distinct schema shape this shard runs is recorded here, so you can see what changed and when.", "No schema versions recorded yet.", "First recorded version — every table is new.", "{count} change(s)", "change", "Diagram", "Changes", "added", "changed", "removed", "schema", "{count} columns", "changes", "tables", "{count} breaking", "breaking", "safe", "{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", "Keep history on this browser", "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.", "Notifications", "Registered push devices — endpoint, kind, last-send status, and delivery errors.", "Registered Web Push / FCM devices appear here. Configure lunora/notify.ts with defineNotify({ store }) and register a device with ctx.push.register(...).", "No registered devices.", "Filter devices", "filter endpoint, user", "{count} devices", "endpoint", "last seen", "n/a", "time", "op", "table", "detail", "Auth audit", "Authentication and security events — sign-ins, MFA, and session changes.", "Filter security events", "filter event, actor, IP", "Authentication and security events are recorded here.", "No security events.", "event", "actor", "ip / user agent", "outcome", "success", "failure", "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.", "Inserted {inserted} of {total} rows — {conflicts} skipped as id conflicts.", "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", "Toggle operation console", "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", "This Studio session's sync client", "Reading the sync client's state…", "Sync client", "{count} pending writes", "Reads client.debug() for the client running in this page — not your application's client. Call client.debug() in your app to diagnose a specific stuck overlay there.", "No shard connection has been opened yet.", "No shards", "Shard", "Socket", "Confirmed watermark", "(default)", "This client holds no live queries or shapes.", "No subscriptions", "Subscription", "Kind", "Acked", "Cursor", "Pending overlays", "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.", "Showing a partial request/error history — one or more shards have more data than the trend chart can display.", "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", "Clear {count} messages?", "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.", "Traces", "Recent ctx.trace waterfalls for this shard — the drill-down from a log line.", "Evals", "Queued", "Scores recorded by recordEvaluation — the latest verdict per eval, its trend, and the graded runs behind it.", "min {min} · mean {mean} · max {max}", "Score trend for {name}", "No durable history yet — pass ctx.metrics to recordEvaluation to chart a trend.", "Open the trace {trace}", "No evals recorded", "Call recordEvaluation from a graded run and its score shows up here.", "Search traces", "search trace, span, or function", "Errors only", "Recent traces", "Trace waterfall", "{count} spans", "{name}, {duration}, starts {offset} in{failure}", ", failed: {message}", "Showing the {shown} most recent of {total} traces in the buffer.", "No traces", "Span ID", "Parent span ID", "— (trace root)", "Started at", "+{offset}", "Duration", "Attributes", "Logs ({count})", "Traces recorded with ctx.trace show up here as your app handles traffic. The span buffer resets when the shard hibernates.", "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.", "Severity", "Assignee", "Set severity", "Unassigned", "Resolve", "Ignore", "Reopen", "All", "Open", "Resolved", "Ignored", "—", "Toggle issue details", "Suggested fix", "No known fix for this error yet.", "Explain in plain language", "Explaining…", "AI explanation", "Generated by {model}", "No AI binding is configured. Wire an AI binding to enable plain-language explanations — the suggested fix above is always available.", "The AI model could not explain this error right now. The suggested fix above still applies.", "No catalog fix matched this error, so this explanation is the model's own reading of the message. Verify before acting on it.", "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", "Deployment health", "Live liveness, readiness, and per-binding health from the deployment's /_lunora/health endpoint.", "Live liveness, readiness, and per-binding health from the deployment's /_lunora/health endpoint — wire an uptime monitor or a Cloudflare Health Check at it.", "Liveness", "Readiness", "Ready", "Not ready", "Healthy", "Unhealthy", "Checked", "Subsystem checks", "No checks reported.", "Up", "Down", "Health endpoint unavailable", "The health endpoint is in the admin posture. Paste a valid admin token in the connect popover, or set its auth to public.", "Couldn't reach the health endpoint: {message}", "no response"];
1389
+ declare const MESSAGE_IDS: readonly ["Reactors", "Server-side onQueryChange reactors: what has run, what was suppressed, and what is failing.", "Reactor", "State", "Ran", "Suppressed", "Errors", "Watches", "Last dispatch", "No reactors declared", "No reactor is declared in this deployment. Export an onQueryChange(select, handler) from lunora/ to run server-side logic when a query's result changes.", "A reactor runs after a write flush, but only when the result of the query it watches actually changed — a trigger fires on a row write, a reactor fires on a result changing. Suppressed dispatches are the ones where the read re-ran and nothing had moved.", "last dispatch failed", "Live updates unavailable; showing the last reading.", "Agents", "Agent", "Threads", "Timeline", "Messages", "Tokens", "Updated", "Content", "Tool", "Usage", "Approval", "Score your app's advisor findings: a grade, the coverage split, and every procedure ranked worst-first.", "Health score", "Rules fired", "Procedure", "Score", "Kind", "clean", "warned", "failing", "exempt", "sensitive", "no reason given", "Schema & config", "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)", "(none)", "{count} active", "{count} calls", "{count} failed", "{total} total", "No subscriptions yet", "No payments configured", "No @lunora/payment tables found in this deployment. Declare the store tables (subscriptions, events, …) in lunora/schema.ts and wire `payment` on createShardDO() to sync customers and subscriptions.", "Payments", "Plan", "Provider", "Recent webhook events", "Renews", "State", "Subscriptions", "Synced customers, subscriptions, and webhook events.", "{count} messages", "{count} pending changes", "{count} pasted cells were skipped", "{count} running", "{name} ({rowCount})", "{rangeStart}-{rangeEnd} of {total}", "{rate} ({count} entries)", "{reachable} reachable", "{reachable} reachable, {failed} unreachable", "{status} — processed", "{title} failed", "Actions", "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", "Instruments", "Instruments unavailable: {error}", "Counter", "Gauge", "Histogram", "count", "range", "trend", "trace", "{name} trend", "Open the exemplar trace {trace}", "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.", "Archive", "Log archive not configured", "Wire pipelineLogSink to a Cloudflare Pipeline → R2 Data Catalog table and set R2_SQL_ACCOUNT_ID, R2_SQL_TOKEN, R2_SQL_BUCKET to browse the durable log archive here.", "No archived logs.", "No archived logs match these filters. The durable archive fills as pipelineLogSink flushes records to R2.", "Function path prefix", "function path…", "user id…", "Minimum level", "min level", "Time", "Level", "Trace", "User", "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.", "Move widget down", "Move widget up", "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", "SQL problems", "Operation console", "Suggest chart", "Chart type", "Widget type", "Could not suggest a chart for that result.", "Add a chart, a single value, a table, or a note. Everything is saved on this browser.", "Keyboard shortcuts", "Command palette", "Reset", "Stored in this browser. Focus a box and press a key to rebind it.", "Single value", "Text", "Notes for whoever reads this dashboard.", "Charts, values, tables, and notes. Drag a tile to reorder.", "—", "Bar", "Line", "Area", "Suggesting…", "Describe the query you want", "Draft SQL", "Thinking…", "Fix this", "Related", "p50", "p95", "showing a capped set", "Statements executed in the selected window appear here, with throughput and latency over time.", "No queries in this window.", "Throughput", "Mean latency (ms)", "Schema versions", "Data migrations", "{count} pushes", "live", "Show in console", "Every admin call this studio makes is recorded here.", "{count} rows", "Filter", "Each distinct schema shape this shard runs is recorded here, so you can see what changed and when.", "No schema versions recorded yet.", "First recorded version — every table is new.", "{count} change(s)", "change", "Diagram", "Changes", "added", "changed", "removed", "schema", "{count} columns", "changes", "tables", "{count} breaking", "breaking", "safe", "{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", "Keep history on this browser", "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.", "Notifications", "Registered push devices — endpoint, kind, last-send status, and delivery errors.", "Registered Web Push / FCM devices appear here. Configure lunora/notify.ts with defineNotify({ store }) and register a device with ctx.push.register(...).", "No registered devices.", "Filter devices", "filter endpoint, user", "{count} devices", "endpoint", "last seen", "n/a", "time", "op", "table", "detail", "Auth audit", "Authentication and security events — sign-ins, MFA, and session changes.", "Filter security events", "filter event, actor, IP", "Authentication and security events are recorded here.", "No security events.", "event", "actor", "ip / user agent", "outcome", "success", "failure", "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.", "Inserted {inserted} of {total} rows — {conflicts} skipped as id conflicts.", "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", "Toggle operation console", "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", "This Studio session's sync client", "Reading the sync client's state…", "Sync client", "{count} pending writes", "Reads client.debug() for the client running in this page — not your application's client. Call client.debug() in your app to diagnose a specific stuck overlay there.", "No shard connection has been opened yet.", "No shards", "Shard", "Socket", "Confirmed watermark", "(default)", "This client holds no live queries or shapes.", "No subscriptions", "Subscription", "Kind", "Acked", "Cursor", "Pending overlays", "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.", "Showing a partial request/error history — one or more shards have more data than the trend chart can display.", "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", "Clear {count} messages?", "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.", "Traces", "Recent ctx.trace waterfalls for this shard — the drill-down from a log line.", "Evals", "Queued", "Scores recorded by recordEvaluation — the latest verdict per eval, its trend, and the graded runs behind it.", "min {min} · mean {mean} · max {max}", "Score trend for {name}", "No durable history yet — pass ctx.metrics to recordEvaluation to chart a trend.", "Open the trace {trace}", "No evals recorded", "Call recordEvaluation from a graded run and its score shows up here.", "Search traces", "search trace, span, or function", "Errors only", "Recent traces", "Trace waterfall", "{count} spans", "{name}, {duration}, starts {offset} in{failure}", ", failed: {message}", "Showing the {shown} most recent of {total} traces in the buffer.", "No traces", "Span ID", "Parent span ID", "— (trace root)", "Started at", "+{offset}", "Duration", "Attributes", "Logs ({count})", "Traces recorded with ctx.trace show up here as your app handles traffic. The span buffer resets when the shard hibernates.", "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.", "Severity", "Assignee", "Set severity", "Unassigned", "Resolve", "Ignore", "Reopen", "All", "Open", "Resolved", "Ignored", "—", "Toggle issue details", "Suggested fix", "No known fix for this error yet.", "Explain in plain language", "Explaining…", "AI explanation", "Generated by {model}", "No AI binding is configured. Wire an AI binding to enable plain-language explanations — the suggested fix above is always available.", "The AI model could not explain this error right now. The suggested fix above still applies.", "No catalog fix matched this error, so this explanation is the model's own reading of the message. Verify before acting on it.", "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", "Deployment health", "Live liveness, readiness, and per-binding health from the deployment's /_lunora/health endpoint.", "Live liveness, readiness, and per-binding health from the deployment's /_lunora/health endpoint — wire an uptime monitor or a Cloudflare Health Check at it.", "Liveness", "Readiness", "Ready", "Not ready", "Healthy", "Unhealthy", "Checked", "Subsystem checks", "No checks reported.", "Up", "Down", "Health endpoint unavailable", "The health endpoint is in the admin posture. Paste a valid admin token in the connect popover, or set its auth to public.", "Couldn't reach the health endpoint: {message}", "no response"];
1389
1390
  /** A known studio message id — one of the entries in {@link MESSAGE_IDS}. */
1390
1391
  type MessageId = (typeof MESSAGE_IDS)[number];
1391
1392
  /** The locale the studio ships with and falls back to. */
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{StudioApp as r}from"./packem_shared/StudioApp-jTW-QnDo.js";import{CommandPalette as a,openCommandPalette as f}from"./packem_shared/CommandPalette-kQLn0xlS.js";import{S as m}from"./packem_shared/studio-BdV57x3O.js";import{ConfirmButton as l}from"./packem_shared/ConfirmButton-Cj2SOapE.js";import{default as s}from"./packem_shared/ConnectionBadge-Bh16X9-u.js";import{ErrorBoundary as d}from"./packem_shared/ErrorBoundary-BWNF98VF.js";import{ShardInput as P}from"./packem_shared/ShardInput-CdawpUiS.js";import{default as A}from"./packem_chunks/AdvisorHealthPanel.js";import{DEFAULT_INSIGHT_THRESHOLDS as I,deriveInsights as T}from"./packem_shared/DEFAULT_INSIGHT_THRESHOLDS-1Lrg55IV.js";import{InsightsPanel as g}from"./packem_chunks/InsightsPanel.js";import{default as F}from"./packem_chunks/SecurityAdvisorPanel.js";import{default as h}from"./packem_shared/ApiDocsPanel-C_dZt4ve.js";import{default as C}from"./packem_shared/ApiReferencePanel-DXrGI45U.js";import{default as O}from"./packem_chunks/ApiTab.js";import{default as N}from"./packem_shared/OpenRpcReferencePanel-DkYBLJGb.js";import{DataBrowser as U}from"./packem_shared/DataBrowser-BPCr2f8V.js";import{DataFilters as b,toFilterClauses as v}from"./packem_shared/DataFilters-3nbW0uax.js";import{GlobalDataBrowser as y}from"./packem_shared/GlobalDataBrowser-BHFgEqMl.js";import{TableEditor as q}from"./packem_chunks/TableEditor.js";import{ExportImportPanel as V}from"./packem_chunks/ExportImportPanel.js";import{MigrationsPanel as j}from"./packem_shared/MigrationsPanel-CF73xHke.js";import{PitrPanel as z}from"./packem_chunks/PitrPanel.js";import{FunctionRunner as Q}from"./packem_chunks/FunctionRunner.js";import{FunctionStatsPanel as Y}from"./packem_chunks/FunctionStatsPanel.js";import{DeploymentHealthPanel as $}from"./packem_chunks/DeploymentHealthPanel.js";import{H as oe}from"./packem_shared/home-panel-DywiFhDs.js";import{AuditPanel as te}from"./packem_chunks/AuditPanel.js";import{LogsPanel as fe}from"./packem_chunks/LogsPanel.js";import{MailPanel as me}from"./packem_chunks/MailPanel.js";import{ScheduledJobs as le}from"./packem_shared/ScheduledJobs-DRmOKtDa.js";import{default as se}from"./packem_chunks/NotificationsPanel.js";import{HealthPanel as de}from"./packem_chunks/HealthPanel.js";import{aggregateMetrics as Pe,shardsToAggregate as Se}from"./packem_shared/aggregateMetrics-A-Y7OH6R.js";import{MetricsPanel as ce}from"./packem_chunks/MetricsPanel.js";import{SchemaViewer as Te}from"./packem_chunks/SchemaViewer.js";import{SettingsPanel as ge}from"./packem_chunks/SettingsPanel.js";import{SqlEditorPanel as Fe}from"./packem_chunks/SqlEditorPanel.js";import{FileBrowser as he}from"./packem_chunks/FileBrowser.js";import{DEFAULT_AUTO_REFRESH_MS as Ce,useAutoRefresh as He}from"./packem_shared/DEFAULT_AUTO_REFRESH_MS-DuULO4XM.js";import{default as Le}from"./packem_shared/useDebounced-DVeQ5-oW.js";import{DEFAULT_LOCALE as Me,createStudioI18n as Ue,studioI18n as Be,useT as be}from"./packem_shared/DEFAULT_LOCALE-A1Yg5ORA.js";import{StudioI18nProvider as we}from"./packem_shared/StudioI18nProvider-Bl547evf.js";import{ADMIN_FUNCTIONS as Ge,ADMIN_FUNCTION_PREFIX as qe}from"./packem_shared/ADMIN_FUNCTIONS-4aE59aDq.js";import{default as Ve}from"./packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.js";export{Ge as ADMIN_FUNCTIONS,qe as ADMIN_FUNCTION_PREFIX,A as AdvisorHealthPanel,h as ApiDocsPanel,C as ApiReferencePanel,O as ApiTab,te as AuditPanel,a as CommandPalette,l as ConfirmButton,s as ConnectionBadge,Ce as DEFAULT_AUTO_REFRESH_MS,I as DEFAULT_INSIGHT_THRESHOLDS,Me as DEFAULT_LOCALE,U as DataBrowser,b as DataFilters,$ as DeploymentHealthPanel,d as ErrorBoundary,V as ExportImportPanel,he as FileBrowser,Q as FunctionRunner,Y as FunctionStatsPanel,y as GlobalDataBrowser,de as HealthPanel,oe as HomePanel,g as InsightsPanel,fe as LogsPanel,me as MailPanel,ce as MetricsPanel,j as MigrationsPanel,se as NotificationsPanel,N as OpenRpcReferencePanel,z as PitrPanel,Ve as STUDIO_ROOT_CLASS,le as ScheduledJobs,Te as SchemaViewer,F as SecurityAdvisorPanel,ge as SettingsPanel,P as ShardInput,Fe as SqlEditorPanel,m as Studio,r as StudioApp,we as StudioI18nProvider,q as TableEditor,Pe as aggregateMetrics,Ue as createStudioI18n,T as deriveInsights,f as openCommandPalette,Se as shardsToAggregate,Be as studioI18n,v as toFilterClauses,He as useAutoRefresh,Le as useDebounced,be as useT};
1
+ import{StudioApp as r}from"./packem_shared/StudioApp-Bxmtp-Fi.js";import{CommandPalette as a,openCommandPalette as f}from"./packem_shared/CommandPalette-kQLn0xlS.js";import{S as m}from"./packem_shared/studio-Cvdwfzxm.js";import{ConfirmButton as l}from"./packem_shared/ConfirmButton-Cj2SOapE.js";import{default as s}from"./packem_shared/ConnectionBadge-Bh16X9-u.js";import{ErrorBoundary as d}from"./packem_shared/ErrorBoundary-BWNF98VF.js";import{ShardInput as P}from"./packem_shared/ShardInput-CdawpUiS.js";import{default as A}from"./packem_chunks/AdvisorHealthPanel.js";import{DEFAULT_INSIGHT_THRESHOLDS as I,deriveInsights as T}from"./packem_shared/DEFAULT_INSIGHT_THRESHOLDS-1Lrg55IV.js";import{InsightsPanel as g}from"./packem_chunks/InsightsPanel.js";import{default as F}from"./packem_chunks/SecurityAdvisorPanel.js";import{default as h}from"./packem_shared/ApiDocsPanel-BMzLPgvv.js";import{default as C}from"./packem_shared/ApiReferencePanel-DXrGI45U.js";import{default as O}from"./packem_chunks/ApiTab.js";import{default as N}from"./packem_shared/OpenRpcReferencePanel-DkYBLJGb.js";import{DataBrowser as U}from"./packem_shared/DataBrowser-C68K5QHO.js";import{DataFilters as b,toFilterClauses as v}from"./packem_shared/DataFilters-3nbW0uax.js";import{GlobalDataBrowser as y}from"./packem_shared/GlobalDataBrowser-BHFgEqMl.js";import{TableEditor as q}from"./packem_chunks/TableEditor.js";import{ExportImportPanel as V}from"./packem_chunks/ExportImportPanel.js";import{MigrationsPanel as j}from"./packem_shared/MigrationsPanel-CLRWwPyL.js";import{PitrPanel as z}from"./packem_chunks/PitrPanel.js";import{FunctionRunner as Q}from"./packem_chunks/FunctionRunner.js";import{FunctionStatsPanel as Y}from"./packem_chunks/FunctionStatsPanel.js";import{DeploymentHealthPanel as $}from"./packem_chunks/DeploymentHealthPanel.js";import{H as oe}from"./packem_shared/home-panel-ecz6-nHV.js";import{AuditPanel as te}from"./packem_chunks/AuditPanel.js";import{LogsPanel as fe}from"./packem_chunks/LogsPanel.js";import{MailPanel as me}from"./packem_chunks/MailPanel.js";import{ScheduledJobs as le}from"./packem_shared/ScheduledJobs-DRmOKtDa.js";import{default as se}from"./packem_chunks/NotificationsPanel.js";import{HealthPanel as de}from"./packem_chunks/HealthPanel.js";import{aggregateMetrics as Pe,shardsToAggregate as Se}from"./packem_shared/aggregateMetrics-A-Y7OH6R.js";import{MetricsPanel as ce}from"./packem_chunks/MetricsPanel.js";import{SchemaViewer as Te}from"./packem_chunks/SchemaViewer.js";import{SettingsPanel as ge}from"./packem_chunks/SettingsPanel.js";import{SqlEditorPanel as Fe}from"./packem_chunks/SqlEditorPanel.js";import{FileBrowser as he}from"./packem_chunks/FileBrowser.js";import{DEFAULT_AUTO_REFRESH_MS as Ce,useAutoRefresh as He}from"./packem_shared/DEFAULT_AUTO_REFRESH_MS-DuULO4XM.js";import{default as Le}from"./packem_shared/useDebounced-DVeQ5-oW.js";import{DEFAULT_LOCALE as Me,createStudioI18n as Ue,studioI18n as Be,useT as be}from"./packem_shared/DEFAULT_LOCALE-A1Yg5ORA.js";import{StudioI18nProvider as we}from"./packem_shared/StudioI18nProvider-Bl547evf.js";import{ADMIN_FUNCTIONS as Ge,ADMIN_FUNCTION_PREFIX as qe}from"./packem_shared/ADMIN_FUNCTIONS-B6z7VLYt.js";import{default as Ve}from"./packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.js";export{Ge as ADMIN_FUNCTIONS,qe as ADMIN_FUNCTION_PREFIX,A as AdvisorHealthPanel,h as ApiDocsPanel,C as ApiReferencePanel,O as ApiTab,te as AuditPanel,a as CommandPalette,l as ConfirmButton,s as ConnectionBadge,Ce as DEFAULT_AUTO_REFRESH_MS,I as DEFAULT_INSIGHT_THRESHOLDS,Me as DEFAULT_LOCALE,U as DataBrowser,b as DataFilters,$ as DeploymentHealthPanel,d as ErrorBoundary,V as ExportImportPanel,he as FileBrowser,Q as FunctionRunner,Y as FunctionStatsPanel,y as GlobalDataBrowser,de as HealthPanel,oe as HomePanel,g as InsightsPanel,fe as LogsPanel,me as MailPanel,ce as MetricsPanel,j as MigrationsPanel,se as NotificationsPanel,N as OpenRpcReferencePanel,z as PitrPanel,Ve as STUDIO_ROOT_CLASS,le as ScheduledJobs,Te as SchemaViewer,F as SecurityAdvisorPanel,ge as SettingsPanel,P as ShardInput,Fe as SqlEditorPanel,m as Studio,r as StudioApp,we as StudioI18nProvider,q as TableEditor,Pe as aggregateMetrics,Ue as createStudioI18n,T as deriveInsights,f as openCommandPalette,Se as shardsToAggregate,Be as studioI18n,v as toFilterClauses,He as useAutoRefresh,Le as useDebounced,be as useT};
package/dist/mount.js CHANGED
@@ -1 +1 @@
1
- import{LunoraError as s}from"@lunora/errors";import{createRoot as a}from"react-dom/client";import{StudioApp as l}from"./packem_shared/StudioApp-jTW-QnDo.js";import{jsx as i}from"react/jsx-runtime";const c=(n={})=>{const{container:t="#root",...o}=n,e=typeof t=="string"?document.querySelector(t):t;if(e===null)throw new s("INTERNAL",`mountStudio: container ${typeof t=="string"?t:"element"} not found`);const r=a(e);return r.render(i(l,{adminToken:o.adminToken,basePath:o.basePath,baseUrl:o.baseUrl,locale:o.locale,rulesInstalled:o.rulesInstalled,studio:o.studio})),r};export{c as mountStudio};
1
+ import{LunoraError as s}from"@lunora/errors";import{createRoot as a}from"react-dom/client";import{StudioApp as l}from"./packem_shared/StudioApp-Bxmtp-Fi.js";import{jsx as i}from"react/jsx-runtime";const c=(n={})=>{const{container:t="#root",...o}=n,e=typeof t=="string"?document.querySelector(t):t;if(e===null)throw new s("INTERNAL",`mountStudio: container ${typeof t=="string"?t:"element"} not found`);const r=a(e);return r.render(i(l,{adminToken:o.adminToken,basePath:o.basePath,baseUrl:o.baseUrl,locale:o.locale,rulesInstalled:o.rulesInstalled,studio:o.studio})),r};export{c as mountStudio};
@@ -1 +1 @@
1
- import{scoreAdvisor as T}from"@lunora/advisor";import{E as A}from"../packem_shared/error-alert-CKqB2CiN.js";import{C as c,a as o}from"../packem_shared/card-BGlQzQY-.js";import{T as j,a as R,b as f,c as i,d as $,e as m}from"../packem_shared/table-BMsuYFhk.js";import{u as v}from"../packem_shared/use-admin-query-DV9xmFl8.js";import{useT as C}from"../packem_shared/DEFAULT_LOCALE-A1Yg5ORA.js";import{ADMIN_FUNCTIONS as N}from"../packem_shared/ADMIN_FUNCTIONS-4aE59aDq.js";import{c as u}from"../packem_shared/utils-bhneXptQ.js";import{jsx as e,jsxs as r}from"react/jsx-runtime";const n={clean:"text-emerald-600 dark:text-emerald-400",exempt:"text-muted-foreground",failing:"text-red-600 dark:text-red-400",warned:"text-amber-600 dark:text-amber-400"},b={"at-risk":"text-red-600 dark:text-red-400",excellent:"text-emerald-600 dark:text-emerald-400",good:"text-emerald-600 dark:text-emerald-400","needs-work":"text-amber-600 dark:text-amber-400"},E=(s,a)=>`exempt: ${s.exemptReason===void 0||s.exemptReason===""?a:s.exemptReason}`,S=s=>s.toSorted((a,l)=>a.coverage==="clean"&&l.coverage!=="clean"?1:l.coverage==="clean"&&a.coverage!=="clean"?-1:a.score-l.score),Y=({testId:s="advisor-health"})=>{const a=C(),l=v(N.getAdvisories,{},{live:!0}),x=v(N.getAdvisorProcedures,{},{live:!0}),p=l.data?.advisories??null,h=x.data?.procedures??null,t=p===null||h===null?null:T(h,p),g=x.error??l.error;if(g!==null)return e(A,{error:g,testId:`${s}-error`});if(t===null)return e(c,{children:e(o,{className:"py-8 text-center text-muted-foreground","data-testid":`${s}-loading`,children:a("Loading…")})});const k=S(t.procedures);return r("div",{className:"space-y-4","data-testid":s,children:[e(c,{children:r(o,{className:"flex flex-wrap items-baseline gap-x-6 gap-y-2 py-6",children:[r("div",{children:[e("span",{className:u("text-4xl font-semibold tabular-nums",b[t.grade]),"data-testid":`${s}-score`,children:t.score}),e("span",{className:"text-muted-foreground text-lg",children:"/100"})]}),e("span",{className:u("text-sm font-medium uppercase tracking-wide",b[t.grade]),"data-testid":`${s}-grade`,children:t.grade}),r("div",{className:"text-muted-foreground flex gap-4 text-sm tabular-nums","data-testid":`${s}-summary`,children:[r("span",{className:n.clean,children:[t.summary.clean," ",a("clean")]}),r("span",{className:n.warned,children:[t.summary.warned," ",a("warned")]}),r("span",{className:n.failing,children:[t.summary.failing," ",a("failing")]}),r("span",{className:n.exempt,children:[t.summary.exempt," ",a("exempt")]})]})]})}),t.project.checks.length>0&&e(c,{children:r(o,{className:"py-4 text-sm","data-testid":`${s}-project`,children:[r("span",{className:"font-medium",children:[a("Schema & config")," ",t.project.score,"/100"]}),r("span",{className:"text-muted-foreground",children:[" — ",t.project.checks.map(d=>d.name).join(", ")]})]})}),e(c,{children:e(o,{className:"p-0",children:r(j,{children:[e(R,{children:r(f,{children:[e(i,{className:"w-20",children:a("Score")}),e(i,{children:a("Procedure")}),e(i,{className:"w-32",children:a("Kind")}),e(i,{children:a("Rules fired")})]})}),e($,{children:k.map(d=>r(f,{"data-testid":`${s}-row`,children:[e(m,{className:u("tabular-nums font-medium",n[d.coverage]),children:d.coverage==="exempt"?"—":d.score}),e(m,{className:"font-mono text-xs",children:d.id}),r(m,{className:"text-muted-foreground text-xs",children:[d.visibility," ",d.kind,d.sensitivity.level==="high"&&e("span",{className:"ml-1 text-amber-600 dark:text-amber-400",children:a("sensitive")})]}),e(m,{className:"text-muted-foreground text-xs",children:d.coverage==="exempt"?E(d,a("no reason given")):d.checks.map(w=>w.name).join(", ")})]},d.id))})]})})})]})};export{Y as default};
1
+ import{scoreAdvisor as T}from"@lunora/advisor";import{E as A}from"../packem_shared/error-alert-CKqB2CiN.js";import{C as c,a as o}from"../packem_shared/card-BGlQzQY-.js";import{T as j,a as R,b as f,c as i,d as $,e as m}from"../packem_shared/table-BMsuYFhk.js";import{u as v}from"../packem_shared/use-admin-query-DV9xmFl8.js";import{useT as C}from"../packem_shared/DEFAULT_LOCALE-A1Yg5ORA.js";import{ADMIN_FUNCTIONS as N}from"../packem_shared/ADMIN_FUNCTIONS-B6z7VLYt.js";import{c as u}from"../packem_shared/utils-bhneXptQ.js";import{jsx as e,jsxs as r}from"react/jsx-runtime";const n={clean:"text-emerald-600 dark:text-emerald-400",exempt:"text-muted-foreground",failing:"text-red-600 dark:text-red-400",warned:"text-amber-600 dark:text-amber-400"},b={"at-risk":"text-red-600 dark:text-red-400",excellent:"text-emerald-600 dark:text-emerald-400",good:"text-emerald-600 dark:text-emerald-400","needs-work":"text-amber-600 dark:text-amber-400"},E=(s,a)=>`exempt: ${s.exemptReason===void 0||s.exemptReason===""?a:s.exemptReason}`,S=s=>s.toSorted((a,l)=>a.coverage==="clean"&&l.coverage!=="clean"?1:l.coverage==="clean"&&a.coverage!=="clean"?-1:a.score-l.score),Y=({testId:s="advisor-health"})=>{const a=C(),l=v(N.getAdvisories,{},{live:!0}),x=v(N.getAdvisorProcedures,{},{live:!0}),p=l.data?.advisories??null,h=x.data?.procedures??null,t=p===null||h===null?null:T(h,p),g=x.error??l.error;if(g!==null)return e(A,{error:g,testId:`${s}-error`});if(t===null)return e(c,{children:e(o,{className:"py-8 text-center text-muted-foreground","data-testid":`${s}-loading`,children:a("Loading…")})});const k=S(t.procedures);return r("div",{className:"space-y-4","data-testid":s,children:[e(c,{children:r(o,{className:"flex flex-wrap items-baseline gap-x-6 gap-y-2 py-6",children:[r("div",{children:[e("span",{className:u("text-4xl font-semibold tabular-nums",b[t.grade]),"data-testid":`${s}-score`,children:t.score}),e("span",{className:"text-muted-foreground text-lg",children:"/100"})]}),e("span",{className:u("text-sm font-medium uppercase tracking-wide",b[t.grade]),"data-testid":`${s}-grade`,children:t.grade}),r("div",{className:"text-muted-foreground flex gap-4 text-sm tabular-nums","data-testid":`${s}-summary`,children:[r("span",{className:n.clean,children:[t.summary.clean," ",a("clean")]}),r("span",{className:n.warned,children:[t.summary.warned," ",a("warned")]}),r("span",{className:n.failing,children:[t.summary.failing," ",a("failing")]}),r("span",{className:n.exempt,children:[t.summary.exempt," ",a("exempt")]})]})]})}),t.project.checks.length>0&&e(c,{children:r(o,{className:"py-4 text-sm","data-testid":`${s}-project`,children:[r("span",{className:"font-medium",children:[a("Schema & config")," ",t.project.score,"/100"]}),r("span",{className:"text-muted-foreground",children:[" — ",t.project.checks.map(d=>d.name).join(", ")]})]})}),e(c,{children:e(o,{className:"p-0",children:r(j,{children:[e(R,{children:r(f,{children:[e(i,{className:"w-20",children:a("Score")}),e(i,{children:a("Procedure")}),e(i,{className:"w-32",children:a("Kind")}),e(i,{children:a("Rules fired")})]})}),e($,{children:k.map(d=>r(f,{"data-testid":`${s}-row`,children:[e(m,{className:u("tabular-nums font-medium",n[d.coverage]),children:d.coverage==="exempt"?"—":d.score}),e(m,{className:"font-mono text-xs",children:d.id}),r(m,{className:"text-muted-foreground text-xs",children:[d.visibility," ",d.kind,d.sensitivity.level==="high"&&e("span",{className:"ml-1 text-amber-600 dark:text-amber-400",children:a("sensitive")})]}),e(m,{className:"text-muted-foreground text-xs",children:d.coverage==="exempt"?E(d,a("no reason given")):d.checks.map(w=>w.name).join(", ")})]},d.id))})]})})})]})};export{Y as default};
@@ -1 +1 @@
1
- import{c as L}from"react/compiler-runtime";import{useState as F}from"react";import{B as K}from"../packem_shared/button-BOPLD1un.js";import{useT as Y}from"../packem_shared/DEFAULT_LOCALE-A1Yg5ORA.js";import D from"../packem_shared/ApiDocsPanel-C_dZt4ve.js";import M from"../packem_shared/ApiReferencePanel-DXrGI45U.js";import W from"../packem_shared/OpenRpcReferencePanel-DkYBLJGb.js";import{jsx as r,jsxs as E}from"react/jsx-runtime";const _=["reference","snippets"],q=["openapi","openrpc"],k=V=>{const e=L(51),{functions:R,initialShardKey:N,openApiSpec:T,openRpcSpec:I}=V,t=Y(),[i,$]=F("reference"),[a,j]=F("openapi");let s;e[0]!==t?(s=t("Reference"),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==t?(o=t("Snippets"),e[2]=t,e[3]=o):o=e[3];let w;e[4]!==s||e[5]!==o?(w={reference:s,snippets:o},e[4]=s,e[5]=o,e[6]=w):w=e[6];const O=w;let n;e[7]!==t?(n=t("OpenAPI"),e[7]=t,e[8]=n):n=e[8];let c;e[9]!==t?(c=t("OpenRPC"),e[9]=t,e[10]=c):c=e[10];let g;e[11]!==n||e[12]!==c?(g={openapi:n,openrpc:c},e[11]=n,e[12]=c,e[13]=g):g=e[13];const C=g;let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=l=>{$(l.currentTarget.dataset.view)},e[14]=S):S=e[14];const z=S;let A;e[15]===Symbol.for("react.memo_cache_sentinel")?(A=l=>{j(l.currentTarget.dataset.format)},e[15]=A):A=e[15];const B=A;let p;e[16]!==t?(p=t("API view"),e[16]=t,e[17]=p):p=e[17];let f;e[18]!==i||e[19]!==O?(f=_.map(l=>r(K,{"aria-selected":i===l,"data-testid":`api-view-${l}`,"data-view":l,onClick:z,role:"tab",size:"sm",type:"button",variant:i===l?"default":"outline",children:O[l]},l)),e[18]=i,e[19]=O,e[20]=f):f=e[20];let m;e[21]!==f||e[22]!==p?(m=r("div",{"aria-label":p,className:"flex gap-1.5","data-testid":"api-view-toggle",role:"tablist",children:f}),e[21]=f,e[22]=p,e[23]=m):m=e[23];let d;e[24]!==a||e[25]!==C||e[26]!==t||e[27]!==i?(d=i==="reference"&&r("div",{"aria-label":t("API spec format"),className:"flex gap-1.5","data-testid":"api-format-toggle",role:"tablist",children:q.map(l=>r(K,{"aria-selected":a===l,"data-format":l,"data-testid":`api-format-${l}`,onClick:B,role:"tab",size:"sm",type:"button",variant:a===l?"default":"outline",children:C[l]},l))}),e[24]=a,e[25]=C,e[26]=t,e[27]=i,e[28]=d):d=e[28];let b;e[29]!==m||e[30]!==d?(b=E("div",{className:"flex shrink-0 flex-wrap items-center gap-3 border-b border-border px-6 py-3",children:[m,d]}),e[29]=m,e[30]=d,e[31]=b):b=e[31];let v;e[32]!==R||e[33]!==N||e[34]!==i?(v=i==="snippets"&&r("div",{className:"min-h-0 flex-1 overflow-y-auto p-6",children:r(D,{functions:R,initialShardKey:N})}),e[32]=R,e[33]=N,e[34]=i,e[35]=v):v=e[35];let h;e[36]!==a||e[37]!==T||e[38]!==i?(h=i==="reference"&&a==="openapi"&&r(M,{spec:T}),e[36]=a,e[37]=T,e[38]=i,e[39]=h):h=e[39];let u;e[40]!==a||e[41]!==I||e[42]!==i?(u=i==="reference"&&a==="openrpc"&&r(W,{spec:I}),e[40]=a,e[41]=I,e[42]=i,e[43]=u):u=e[43];let x;e[44]!==v||e[45]!==h||e[46]!==u?(x=E("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[v,h,u]}),e[44]=v,e[45]=h,e[46]=u,e[47]=x):x=e[47];let P;return e[48]!==b||e[49]!==x?(P=E("div",{className:"flex min-h-0 flex-1 flex-col","data-testid":"lunora-api-tab",children:[b,x]}),e[48]=b,e[49]=x,e[50]=P):P=e[50],P};export{k as default};
1
+ import{c as L}from"react/compiler-runtime";import{useState as F}from"react";import{B as K}from"../packem_shared/button-BOPLD1un.js";import{useT as Y}from"../packem_shared/DEFAULT_LOCALE-A1Yg5ORA.js";import D from"../packem_shared/ApiDocsPanel-BMzLPgvv.js";import M from"../packem_shared/ApiReferencePanel-DXrGI45U.js";import W from"../packem_shared/OpenRpcReferencePanel-DkYBLJGb.js";import{jsx as r,jsxs as E}from"react/jsx-runtime";const _=["reference","snippets"],q=["openapi","openrpc"],k=V=>{const e=L(51),{functions:R,initialShardKey:N,openApiSpec:T,openRpcSpec:I}=V,t=Y(),[i,$]=F("reference"),[a,j]=F("openapi");let s;e[0]!==t?(s=t("Reference"),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==t?(o=t("Snippets"),e[2]=t,e[3]=o):o=e[3];let w;e[4]!==s||e[5]!==o?(w={reference:s,snippets:o},e[4]=s,e[5]=o,e[6]=w):w=e[6];const O=w;let n;e[7]!==t?(n=t("OpenAPI"),e[7]=t,e[8]=n):n=e[8];let c;e[9]!==t?(c=t("OpenRPC"),e[9]=t,e[10]=c):c=e[10];let g;e[11]!==n||e[12]!==c?(g={openapi:n,openrpc:c},e[11]=n,e[12]=c,e[13]=g):g=e[13];const C=g;let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=l=>{$(l.currentTarget.dataset.view)},e[14]=S):S=e[14];const z=S;let A;e[15]===Symbol.for("react.memo_cache_sentinel")?(A=l=>{j(l.currentTarget.dataset.format)},e[15]=A):A=e[15];const B=A;let p;e[16]!==t?(p=t("API view"),e[16]=t,e[17]=p):p=e[17];let f;e[18]!==i||e[19]!==O?(f=_.map(l=>r(K,{"aria-selected":i===l,"data-testid":`api-view-${l}`,"data-view":l,onClick:z,role:"tab",size:"sm",type:"button",variant:i===l?"default":"outline",children:O[l]},l)),e[18]=i,e[19]=O,e[20]=f):f=e[20];let m;e[21]!==f||e[22]!==p?(m=r("div",{"aria-label":p,className:"flex gap-1.5","data-testid":"api-view-toggle",role:"tablist",children:f}),e[21]=f,e[22]=p,e[23]=m):m=e[23];let d;e[24]!==a||e[25]!==C||e[26]!==t||e[27]!==i?(d=i==="reference"&&r("div",{"aria-label":t("API spec format"),className:"flex gap-1.5","data-testid":"api-format-toggle",role:"tablist",children:q.map(l=>r(K,{"aria-selected":a===l,"data-format":l,"data-testid":`api-format-${l}`,onClick:B,role:"tab",size:"sm",type:"button",variant:a===l?"default":"outline",children:C[l]},l))}),e[24]=a,e[25]=C,e[26]=t,e[27]=i,e[28]=d):d=e[28];let b;e[29]!==m||e[30]!==d?(b=E("div",{className:"flex shrink-0 flex-wrap items-center gap-3 border-b border-border px-6 py-3",children:[m,d]}),e[29]=m,e[30]=d,e[31]=b):b=e[31];let v;e[32]!==R||e[33]!==N||e[34]!==i?(v=i==="snippets"&&r("div",{className:"min-h-0 flex-1 overflow-y-auto p-6",children:r(D,{functions:R,initialShardKey:N})}),e[32]=R,e[33]=N,e[34]=i,e[35]=v):v=e[35];let h;e[36]!==a||e[37]!==T||e[38]!==i?(h=i==="reference"&&a==="openapi"&&r(M,{spec:T}),e[36]=a,e[37]=T,e[38]=i,e[39]=h):h=e[39];let u;e[40]!==a||e[41]!==I||e[42]!==i?(u=i==="reference"&&a==="openrpc"&&r(W,{spec:I}),e[40]=a,e[41]=I,e[42]=i,e[43]=u):u=e[43];let x;e[44]!==v||e[45]!==h||e[46]!==u?(x=E("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[v,h,u]}),e[44]=v,e[45]=h,e[46]=u,e[47]=x):x=e[47];let P;return e[48]!==b||e[49]!==x?(P=E("div",{className:"flex min-h-0 flex-1 flex-col","data-testid":"lunora-api-tab",children:[b,x]}),e[48]=b,e[49]=x,e[50]=P):P=e[50],P};export{k as default};
@@ -1 +1 @@
1
- import{useVirtualizer as z,observeElementRect as B}from"@tanstack/react-virtual";import{useState as K,useMemo as N,useRef as V}from"react";import{E as j}from"../packem_shared/error-alert-CKqB2CiN.js";import{L as k}from"../packem_shared/live-status-Bf7rR8o8.js";import{ShardInput as D}from"../packem_shared/ShardInput-CdawpUiS.js";import{B as U}from"../packem_shared/badge-cAk9Di1Q.js";import{C as q,a as F}from"../packem_shared/card-BGlQzQY-.js";import{E as G}from"../packem_shared/empty-state-B939z6K2.js";import{I as W}from"../packem_shared/input-CY5W3wzv.js";import{T as J,a as P,b,c as s,d as Q,e as l}from"../packem_shared/table-BMsuYFhk.js";import{u as X}from"../packem_shared/use-admin-query-DV9xmFl8.js";import{u as Z}from"../packem_shared/use-shard-key-BsP3o5wT.js";import{useT as $}from"../packem_shared/DEFAULT_LOCALE-A1Yg5ORA.js";import{ADMIN_FUNCTIONS as Y}from"../packem_shared/ADMIN_FUNCTIONS-4aE59aDq.js";import{i as ee}from"../packem_shared/internal-7bgd8inO.js";import{jsxs as i,jsx as e}from"react/jsx-runtime";const w=80,te=o=>{if(o===void 0)return"";const t=JSON.stringify(o);return t.length>w?`${t.slice(0,w)}…`:t},re=41,y=480,C=5,ae=(o,t)=>B(o,n=>{t(n.height>0?n:{height:y,width:n.width})}),Ne=({initialShardKey:o})=>{const t=$(),{queryShardKey:n,setShardKey:T,shardKey:L}=Z(o),[c,E]=K(""),{data:u,error:p,errorSource:I,isLoading:R,liveError:A}=X(Y.getAuditLog,{},{live:!0,shardKey:n}),m=N(()=>u?.entries??[],[u]),d=N(()=>{const a=c.trim().toLowerCase();return a===""?m:m.filter(r=>r.op.toLowerCase().includes(a)||(r.table??"").toLowerCase().includes(a)||(r.id??"").toLowerCase().includes(a))},[m,c]),f=V(null),g=z({count:d.length,estimateSize:()=>re,getScrollElement:()=>f.current,initialRect:{height:y,width:800},observeElementRect:ae,overscan:8}),h=g.getVirtualItems(),H=g.getTotalSize(),v=h[0]?.start??0,x=H-(h.at(-1)?.end??0),M={height:v},O={height:x},_=a=>{E(a.target.value)};return i("div",{className:"flex flex-col gap-4","data-testid":"lunora-audit",children:[i("div",{className:"flex flex-wrap items-center gap-2",children:[e(D,{onChange:T,testId:"au-shard-input",value:L}),e(k,{message:A,prefix:"au"}),e(W,{"aria-label":t("Filter audit log"),className:"h-8 w-48","data-testid":"au-search",onChange:_,placeholder:t("filter op, table, id"),value:c})]}),p!==null&&e(j,{error:I,testId:"au-error"}),p===null&&!R&&d.length===0&&e(G,{description:t("State-changing admin operations are recorded here."),icon:e("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:e("path",{d:"M8 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2h-2M9 3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1V3Zm-1 9h8m-8 4h5"})}),testId:"au-empty",title:t("No audit entries.")}),d.length>0&&e(q,{className:"overflow-hidden py-0",children:e(F,{className:"max-h-[30rem] overflow-auto px-0",ref:f,children:i(J,{"data-testid":"au-table",children:[e(P,{children:i(b,{children:[e(s,{children:t("time")}),e(s,{children:t("op")}),e(s,{children:t("table")}),e(s,{children:t("id")}),e(s,{children:t("detail")})]})}),i(Q,{children:[v>0&&e("tr",{"aria-hidden":"true",children:e("td",{colSpan:C,style:M})}),h.map(a=>{const r=d[a.index],S=te(r.detail);return i(b,{"data-testid":"au-row",children:[e(l,{className:"text-muted-foreground tabular-nums",children:ee(r.ts,"—")}),e(l,{children:e(U,{variant:"secondary",children:r.op})}),e(l,{className:"font-medium",children:r.table??e("span",{className:"text-muted-foreground",children:"—"})}),e(l,{className:"max-w-[20ch] truncate font-mono text-xs",children:r.id??e("span",{className:"text-muted-foreground",children:"—"})}),e(l,{className:"max-w-[32ch] truncate font-mono text-xs text-muted-foreground",title:S||void 0,children:S||e("span",{className:"text-muted-foreground",children:"—"})})]},r.seq)}),x>0&&e("tr",{"aria-hidden":"true",children:e("td",{colSpan:C,style:O})})]})]})})})]})};export{Ne as AuditPanel};
1
+ import{useVirtualizer as z,observeElementRect as B}from"@tanstack/react-virtual";import{useState as K,useMemo as N,useRef as V}from"react";import{E as j}from"../packem_shared/error-alert-CKqB2CiN.js";import{L as k}from"../packem_shared/live-status-Bf7rR8o8.js";import{ShardInput as D}from"../packem_shared/ShardInput-CdawpUiS.js";import{B as U}from"../packem_shared/badge-cAk9Di1Q.js";import{C as q,a as F}from"../packem_shared/card-BGlQzQY-.js";import{E as G}from"../packem_shared/empty-state-B939z6K2.js";import{I as W}from"../packem_shared/input-CY5W3wzv.js";import{T as J,a as P,b,c as s,d as Q,e as l}from"../packem_shared/table-BMsuYFhk.js";import{u as X}from"../packem_shared/use-admin-query-DV9xmFl8.js";import{u as Z}from"../packem_shared/use-shard-key-BsP3o5wT.js";import{useT as $}from"../packem_shared/DEFAULT_LOCALE-A1Yg5ORA.js";import{ADMIN_FUNCTIONS as Y}from"../packem_shared/ADMIN_FUNCTIONS-B6z7VLYt.js";import{i as ee}from"../packem_shared/internal-7bgd8inO.js";import{jsxs as i,jsx as e}from"react/jsx-runtime";const w=80,te=o=>{if(o===void 0)return"";const t=JSON.stringify(o);return t.length>w?`${t.slice(0,w)}…`:t},re=41,y=480,C=5,ae=(o,t)=>B(o,n=>{t(n.height>0?n:{height:y,width:n.width})}),Ne=({initialShardKey:o})=>{const t=$(),{queryShardKey:n,setShardKey:T,shardKey:L}=Z(o),[c,E]=K(""),{data:u,error:p,errorSource:I,isLoading:R,liveError:A}=X(Y.getAuditLog,{},{live:!0,shardKey:n}),m=N(()=>u?.entries??[],[u]),d=N(()=>{const a=c.trim().toLowerCase();return a===""?m:m.filter(r=>r.op.toLowerCase().includes(a)||(r.table??"").toLowerCase().includes(a)||(r.id??"").toLowerCase().includes(a))},[m,c]),f=V(null),g=z({count:d.length,estimateSize:()=>re,getScrollElement:()=>f.current,initialRect:{height:y,width:800},observeElementRect:ae,overscan:8}),h=g.getVirtualItems(),H=g.getTotalSize(),v=h[0]?.start??0,x=H-(h.at(-1)?.end??0),M={height:v},O={height:x},_=a=>{E(a.target.value)};return i("div",{className:"flex flex-col gap-4","data-testid":"lunora-audit",children:[i("div",{className:"flex flex-wrap items-center gap-2",children:[e(D,{onChange:T,testId:"au-shard-input",value:L}),e(k,{message:A,prefix:"au"}),e(W,{"aria-label":t("Filter audit log"),className:"h-8 w-48","data-testid":"au-search",onChange:_,placeholder:t("filter op, table, id"),value:c})]}),p!==null&&e(j,{error:I,testId:"au-error"}),p===null&&!R&&d.length===0&&e(G,{description:t("State-changing admin operations are recorded here."),icon:e("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:e("path",{d:"M8 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2h-2M9 3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1V3Zm-1 9h8m-8 4h5"})}),testId:"au-empty",title:t("No audit entries.")}),d.length>0&&e(q,{className:"overflow-hidden py-0",children:e(F,{className:"max-h-[30rem] overflow-auto px-0",ref:f,children:i(J,{"data-testid":"au-table",children:[e(P,{children:i(b,{children:[e(s,{children:t("time")}),e(s,{children:t("op")}),e(s,{children:t("table")}),e(s,{children:t("id")}),e(s,{children:t("detail")})]})}),i(Q,{children:[v>0&&e("tr",{"aria-hidden":"true",children:e("td",{colSpan:C,style:M})}),h.map(a=>{const r=d[a.index],S=te(r.detail);return i(b,{"data-testid":"au-row",children:[e(l,{className:"text-muted-foreground tabular-nums",children:ee(r.ts,"—")}),e(l,{children:e(U,{variant:"secondary",children:r.op})}),e(l,{className:"font-medium",children:r.table??e("span",{className:"text-muted-foreground",children:"—"})}),e(l,{className:"max-w-[20ch] truncate font-mono text-xs",children:r.id??e("span",{className:"text-muted-foreground",children:"—"})}),e(l,{className:"max-w-[32ch] truncate font-mono text-xs text-muted-foreground",title:S||void 0,children:S||e("span",{className:"text-muted-foreground",children:"—"})})]},r.seq)}),x>0&&e("tr",{"aria-hidden":"true",children:e("td",{colSpan:C,style:O})})]})]})})})]})};export{Ne as AuditPanel};
@@ -1,3 +1,3 @@
1
- import{c as xe}from"react/compiler-runtime";import{LunoraError as ae}from"@lunora/errors";import{useLunora as he}from"@lunora/react";import{useState as q}from"react";import{ConfirmButton as be}from"../packem_shared/ConfirmButton-Cj2SOapE.js";import{ShardInput as ge}from"../packem_shared/ShardInput-CdawpUiS.js";import{B as Ne}from"../packem_shared/button-BOPLD1un.js";import{a as ie,C as ce}from"../packem_shared/card-BGlQzQY-.js";import{T as ye}from"../packem_shared/textarea-DpO3i-Qo.js";import{a as Se}from"../packem_shared/use-admin-query-DV9xmFl8.js";import{useT as we}from"../packem_shared/DEFAULT_LOCALE-A1Yg5ORA.js";import{ADMIN_FUNCTIONS as ee}from"../packem_shared/ADMIN_FUNCTIONS-4aE59aDq.js";import{c as fe,d as de,b as le,f as me}from"../packem_shared/internal-7bgd8inO.js";import{r as pe}from"../packem_shared/shard-history-DU5b3QDI.js";import{jsx as s,jsxs as b}from"react/jsx-runtime";const Ie=fe(ee.exportShard),_e=fe(ee.importShard),je=u=>u.map(e=>JSON.stringify(e)).join(`
1
+ import{c as xe}from"react/compiler-runtime";import{LunoraError as ae}from"@lunora/errors";import{useLunora as he}from"@lunora/react";import{useState as q}from"react";import{ConfirmButton as be}from"../packem_shared/ConfirmButton-Cj2SOapE.js";import{ShardInput as ge}from"../packem_shared/ShardInput-CdawpUiS.js";import{B as Ne}from"../packem_shared/button-BOPLD1un.js";import{a as ie,C as ce}from"../packem_shared/card-BGlQzQY-.js";import{T as ye}from"../packem_shared/textarea-DpO3i-Qo.js";import{a as Se}from"../packem_shared/use-admin-query-DV9xmFl8.js";import{useT as we}from"../packem_shared/DEFAULT_LOCALE-A1Yg5ORA.js";import{ADMIN_FUNCTIONS as ee}from"../packem_shared/ADMIN_FUNCTIONS-B6z7VLYt.js";import{c as fe,d as de,b as le,f as me}from"../packem_shared/internal-7bgd8inO.js";import{r as pe}from"../packem_shared/shard-history-DU5b3QDI.js";import{jsx as s,jsxs as b}from"react/jsx-runtime";const Ie=fe(ee.exportShard),_e=fe(ee.importShard),je=u=>u.map(e=>JSON.stringify(e)).join(`
2
2
  `),ve=u=>{const e=[],te=u.split(`
3
3
  `);for(const[n,g]of te.entries()){const t=g.trim();if(t==="")continue;const r=JSON.parse(t);if(typeof r!="object"||r===null)throw new ae("INTERNAL",`line ${(n+1).toString()}: expected a { table, doc } object`);const x=r;if(typeof x.table!="string"||typeof x.doc!="object"||x.doc===null||Array.isArray(x.doc))throw new ae("INTERNAL",`line ${(n+1).toString()}: expected a { table, doc } object`);e.push(x)}return e},Fe=u=>{const e=xe(94),{initialShardKey:te}=u,n=he(),g=Se(),t=we(),[r,x]=q(te??""),[l,oe]=q(""),[c,F]=q(!1),[G,H]=q(null),[a,re]=q(null),[N,ne]=q(null);let Q;e[0]!==n||e[1]!==r?(Q=async()=>{F(!0),H(null),re(null);try{const i=await n.query(Ie,{},de(r));pe(r),oe(je(i.rows)),ne(i.rows.length)}catch(i){H(le(i))}F(!1)},e[0]=n,e[1]=r,e[2]=Q):Q=e[2];const U=Q;let V;e[3]!==n||e[4]!==g||e[5]!==l||e[6]!==r||e[7]!==t?(V=async()=>{F(!0),H(null),re(null),ne(null);let i;try{i=ve(l)}catch(o){H(t("Invalid NDJSON: {message}",{message:le(o)})),F(!1);return}try{const o=await n.query(_e,{rows:i},de(r));pe(r),re(o),g(ee.readTablePage),g(ee.listTables)}catch(o){H(le(o))}F(!1)},e[3]=n,e[4]=g,e[5]=l,e[6]=r,e[7]=t,e[8]=V):V=e[8];const X=V;let y,S,w,d,I,m,p,_,j,f,v;if(e[9]!==c||e[10]!==N||e[11]!==U||e[12]!==a||e[13]!==X||e[14]!==l||e[15]!==r||e[16]!==t){const i=a===null?0:Object.values(a.inserted).reduce(Ce,0);let o;e[28]!==U?(o=()=>{me(U())},e[28]=U,e[29]=o):o=e[29];const z=o;let Y;e[30]!==X?(Y=()=>{me(X())},e[30]=X,e[31]=Y):Y=e[31];const se=Y;let Z;e[32]===Symbol.for("react.memo_cache_sentinel")?(Z=h=>{oe(h.target.value)},e[32]=Z):Z=e[32];const ue=Z;v="flex flex-col gap-4",w="lunora-export-import";let O;e[33]!==t?(O=t("Export"),e[33]=t,e[34]=O):O=e[34];let R;e[35]!==O?(R=s("header",{className:"border-b border-border px-4 py-3",children:s("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:O})}),e[35]=O,e[36]=R):R=e[36];let E;e[37]!==r?(E=s(ge,{onChange:x,testId:"ei-shard-input",value:r}),e[37]=r,e[38]=E):E=e[38];let L;e[39]!==t?(L=t("Export"),e[39]=t,e[40]=L):L=e[40];let D;e[41]!==c||e[42]!==z||e[43]!==L?(D=s(Ne,{"data-testid":"ei-export",disabled:c,onClick:z,type:"button",children:L}),e[41]=c,e[42]=z,e[43]=L,e[44]=D):D=e[44];let $;e[45]!==E||e[46]!==D?($=b("div",{className:"flex flex-wrap items-center gap-2",children:[E,D]}),e[45]=E,e[46]=D,e[47]=$):$=e[47];let B;e[48]!==N||e[49]!==t?(B=N!==null&&s("p",{className:"text-sm text-muted-foreground","data-testid":"ei-export-result",children:t("Exported {count} rows.",{count:N})}),e[48]=N,e[49]=t,e[50]=B):B=e[50];let J;e[51]!==$||e[52]!==B?(J=b(ie,{className:"flex flex-col gap-3 p-4",children:[$,B]}),e[51]=$,e[52]=B,e[53]=J):J=e[53],e[54]!==R||e[55]!==J?(d=b(ce,{className:"gap-0 py-0 rounded-xl border border-border bg-card shadow-xs",children:[R,J]}),e[54]=R,e[55]=J,e[56]=d):d=e[56],S=ce,j="gap-0 py-0 rounded-xl border border-border bg-card shadow-xs";let P;e[57]!==t?(P=t("Import"),e[57]=t,e[58]=P):P=e[58],e[59]!==P?(f=s("header",{className:"border-b border-border px-4 py-3",children:s("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:P})}),e[59]=P,e[60]=f):f=e[60],y=ie,I="flex flex-col gap-3 p-4",e[61]!==l?(m=s(ye,{"aria-label":"NDJSON",className:"font-mono text-xs min-h-40 rounded-md","data-testid":"ei-ndjson",onChange:ue,placeholder:'{"table":"messages","doc":{…}}',value:l}),e[61]=l,e[62]=m):m=e[62];let k;e[63]!==t?(k=t("Import (writes rows)?"),e[63]=t,e[64]=k):k=e[64];let K;e[65]!==c||e[66]!==l?(K=c||l.trim()==="",e[65]=c,e[66]=l,e[67]=K):K=e[67];let M;e[68]!==t?(M=t("Import"),e[68]=t,e[69]=M):M=e[69],e[70]!==se||e[71]!==k||e[72]!==K||e[73]!==M?(p=s("div",{className:"flex flex-wrap items-center gap-2",children:s(be,{confirmLabel:k,disabled:K,onConfirm:se,testId:"ei-import",children:M})}),e[70]=se,e[71]=k,e[72]=K,e[73]=M,e[74]=p):p=e[74],_=a!==null&&b("div",{className:"flex flex-col gap-2","data-testid":"ei-import-result",children:[s("p",{className:"text-sm text-muted-foreground",children:t("Inserted {inserted}, {conflicts} conflicts, {errors} errors.",{conflicts:a.conflicts,errors:a.errors.length,inserted:i})}),a.errors.length>0&&s("ul",{className:"flex flex-col gap-1","data-testid":"ei-import-errors",children:a.errors.map(h=>s("li",{className:"text-xs text-destructive",children:t("line {line} ({table}): {message}",{line:h.line,message:h.message,table:h.table})},`${h.table}-${h.line.toString()}`))})]}),e[9]=c,e[10]=N,e[11]=U,e[12]=a,e[13]=X,e[14]=l,e[15]=r,e[16]=t,e[17]=y,e[18]=S,e[19]=w,e[20]=d,e[21]=I,e[22]=m,e[23]=p,e[24]=_,e[25]=j,e[26]=f,e[27]=v}else y=e[17],S=e[18],w=e[19],d=e[20],I=e[21],m=e[22],p=e[23],_=e[24],j=e[25],f=e[26],v=e[27];let C;e[75]!==y||e[76]!==I||e[77]!==m||e[78]!==p||e[79]!==_?(C=b(y,{className:I,children:[m,p,_]}),e[75]=y,e[76]=I,e[77]=m,e[78]=p,e[79]=_,e[80]=C):C=e[80];let T;e[81]!==S||e[82]!==C||e[83]!==j||e[84]!==f?(T=b(S,{className:j,children:[f,C]}),e[81]=S,e[82]=C,e[83]=j,e[84]=f,e[85]=T):T=e[85];let A;e[86]!==G?(A=G!==null&&s("p",{className:"text-sm text-destructive","data-testid":"ei-error",role:"alert",children:G}),e[86]=G,e[87]=A):A=e[87];let W;return e[88]!==w||e[89]!==d||e[90]!==T||e[91]!==A||e[92]!==v?(W=b("div",{className:v,"data-testid":w,children:[d,T,A]}),e[88]=w,e[89]=d,e[90]=T,e[91]=A,e[92]=v,e[93]=W):W=e[93],W};function Ce(u,e){return u+e}export{Fe as ExportImportPanel};
@@ -1,4 +1,4 @@
1
- import{c as U}from"react/compiler-runtime";import{useState as B,useEffect as oe,useRef as me,useMemo as he,useCallback as lt}from"react";import{ShardInput as nt}from"../packem_shared/ShardInput-CdawpUiS.js";import{B as re}from"../packem_shared/button-BOPLD1un.js";import{E as we}from"../packem_shared/empty-state-B939z6K2.js";import{useT as ot}from"../packem_shared/DEFAULT_LOCALE-A1Yg5ORA.js";import{S as rt}from"../packem_shared/grid-features-AzpmpR3Q.js";import{C as it,a as at}from"../packem_shared/card-BGlQzQY-.js";import{C as Ce}from"../packem_shared/checkbox-C5w53W-E.js";import{c as ne,a as ct,b as pe,d as dt,T as ft,e as te}from"../packem_shared/table-BMsuYFhk.js";import{l as Ne,f as P,b as ee,d as xe,c as Te,g as ut}from"../packem_shared/internal-7bgd8inO.js";import{ConfirmButton as ht}from"../packem_shared/ConfirmButton-Cj2SOapE.js";import{B as de}from"../packem_shared/badge-cAk9Di1Q.js";import{jsx as r,jsxs as R,Fragment as _e}from"react/jsx-runtime";import{I as mt}from"../packem_shared/input-CY5W3wzv.js";import{d as pt}from"../packem_shared/cf-links-CBJ5SywP.js";import{useLunora as gt}from"@lunora/react";import{useAutoRefresh as bt}from"../packem_shared/DEFAULT_AUTO_REFRESH_MS-DuULO4XM.js";import{ADMIN_FUNCTIONS as Ee}from"../packem_shared/ADMIN_FUNCTIONS-4aE59aDq.js";const $e=(f,e,t)=>{const{onCopy:s,onDelete:o,onDownload:l,onToggleSelect:c}=t,a=()=>{s(f.key)},n=()=>{l(f.key)},d=()=>{o(f.key)},h=()=>{c(f.key)};return{copy:a,download:n,name:f.key.slice(e.length),remove:d,toggle:h}},Fe=f=>{const e=U(31),{busy:t,buttonClassName:s,copied:o,objectKey:l,onCopy:c,onDelete:a,onDownload:n,t:d}=f,h=`storage-copy-${l}`;let u;e[0]!==o||e[1]!==d?(u=d(o?"Copied":"Copy URL"),e[0]=o,e[1]=d,e[2]=u):u=e[2];let m;e[3]!==t||e[4]!==s||e[5]!==c||e[6]!==h||e[7]!==u?(m=r(re,{className:s,"data-testid":h,disabled:t,onClick:c,size:"sm",type:"button",variant:"ghost",children:u}),e[3]=t,e[4]=s,e[5]=c,e[6]=h,e[7]=u,e[8]=m):m=e[8];const k=`storage-download-${l}`;let i;e[9]!==d?(i=d("Download"),e[9]=d,e[10]=i):i=e[10];let v;e[11]!==t||e[12]!==s||e[13]!==n||e[14]!==k||e[15]!==i?(v=r(re,{className:s,"data-testid":k,disabled:t,onClick:n,size:"sm",type:"button",variant:"ghost",children:i}),e[11]=t,e[12]=s,e[13]=n,e[14]=k,e[15]=i,e[16]=v):v=e[16];let w;e[17]!==d?(w=d("Delete object?"),e[17]=d,e[18]=w):w=e[18];const y=`storage-delete-${l}`;let g;e[19]!==d?(g=d("Delete"),e[19]=d,e[20]=g):g=e[20];let x;e[21]!==t||e[22]!==a||e[23]!==w||e[24]!==y||e[25]!==g?(x=r(ht,{confirmLabel:w,disabled:t,onConfirm:a,testId:y,children:g}),e[21]=t,e[22]=a,e[23]=w,e[24]=y,e[25]=g,e[26]=x):x=e[26];let b;return e[27]!==x||e[28]!==m||e[29]!==v?(b=R(_e,{children:[m,v,x]}),e[27]=x,e[28]=m,e[29]=v,e[30]=b):b=e[30],b},Re=f=>{const e=U(14),{objectKey:t,references:s,t:o}=f;if(s===void 0)return null;if(s.length===0){const h=`storage-orphan-${t}`;let u;e[0]!==o?(u=o("Orphan"),e[0]=o,e[1]=u):u=e[1];let m;return e[2]!==h||e[3]!==u?(m=r(de,{"data-testid":h,variant:"warning",children:u}),e[2]=h,e[3]=u,e[4]=m):m=e[4],m}let l;e[5]!==s?(l=s.map(yt).join(`
1
+ import{c as U}from"react/compiler-runtime";import{useState as B,useEffect as oe,useRef as me,useMemo as he,useCallback as lt}from"react";import{ShardInput as nt}from"../packem_shared/ShardInput-CdawpUiS.js";import{B as re}from"../packem_shared/button-BOPLD1un.js";import{E as we}from"../packem_shared/empty-state-B939z6K2.js";import{useT as ot}from"../packem_shared/DEFAULT_LOCALE-A1Yg5ORA.js";import{S as rt}from"../packem_shared/grid-features-AzpmpR3Q.js";import{C as it,a as at}from"../packem_shared/card-BGlQzQY-.js";import{C as Ce}from"../packem_shared/checkbox-C5w53W-E.js";import{c as ne,a as ct,b as pe,d as dt,T as ft,e as te}from"../packem_shared/table-BMsuYFhk.js";import{l as Ne,f as P,b as ee,d as xe,c as Te,g as ut}from"../packem_shared/internal-7bgd8inO.js";import{ConfirmButton as ht}from"../packem_shared/ConfirmButton-Cj2SOapE.js";import{B as de}from"../packem_shared/badge-cAk9Di1Q.js";import{jsx as r,jsxs as R,Fragment as _e}from"react/jsx-runtime";import{I as mt}from"../packem_shared/input-CY5W3wzv.js";import{d as pt}from"../packem_shared/cf-links-CBJ5SywP.js";import{useLunora as gt}from"@lunora/react";import{useAutoRefresh as bt}from"../packem_shared/DEFAULT_AUTO_REFRESH_MS-DuULO4XM.js";import{ADMIN_FUNCTIONS as Ee}from"../packem_shared/ADMIN_FUNCTIONS-B6z7VLYt.js";const $e=(f,e,t)=>{const{onCopy:s,onDelete:o,onDownload:l,onToggleSelect:c}=t,a=()=>{s(f.key)},n=()=>{l(f.key)},d=()=>{o(f.key)},h=()=>{c(f.key)};return{copy:a,download:n,name:f.key.slice(e.length),remove:d,toggle:h}},Fe=f=>{const e=U(31),{busy:t,buttonClassName:s,copied:o,objectKey:l,onCopy:c,onDelete:a,onDownload:n,t:d}=f,h=`storage-copy-${l}`;let u;e[0]!==o||e[1]!==d?(u=d(o?"Copied":"Copy URL"),e[0]=o,e[1]=d,e[2]=u):u=e[2];let m;e[3]!==t||e[4]!==s||e[5]!==c||e[6]!==h||e[7]!==u?(m=r(re,{className:s,"data-testid":h,disabled:t,onClick:c,size:"sm",type:"button",variant:"ghost",children:u}),e[3]=t,e[4]=s,e[5]=c,e[6]=h,e[7]=u,e[8]=m):m=e[8];const k=`storage-download-${l}`;let i;e[9]!==d?(i=d("Download"),e[9]=d,e[10]=i):i=e[10];let v;e[11]!==t||e[12]!==s||e[13]!==n||e[14]!==k||e[15]!==i?(v=r(re,{className:s,"data-testid":k,disabled:t,onClick:n,size:"sm",type:"button",variant:"ghost",children:i}),e[11]=t,e[12]=s,e[13]=n,e[14]=k,e[15]=i,e[16]=v):v=e[16];let w;e[17]!==d?(w=d("Delete object?"),e[17]=d,e[18]=w):w=e[18];const y=`storage-delete-${l}`;let g;e[19]!==d?(g=d("Delete"),e[19]=d,e[20]=g):g=e[20];let x;e[21]!==t||e[22]!==a||e[23]!==w||e[24]!==y||e[25]!==g?(x=r(ht,{confirmLabel:w,disabled:t,onConfirm:a,testId:y,children:g}),e[21]=t,e[22]=a,e[23]=w,e[24]=y,e[25]=g,e[26]=x):x=e[26];let b;return e[27]!==x||e[28]!==m||e[29]!==v?(b=R(_e,{children:[m,v,x]}),e[27]=x,e[28]=m,e[29]=v,e[30]=b):b=e[30],b},Re=f=>{const e=U(14),{objectKey:t,references:s,t:o}=f;if(s===void 0)return null;if(s.length===0){const h=`storage-orphan-${t}`;let u;e[0]!==o?(u=o("Orphan"),e[0]=o,e[1]=u):u=e[1];let m;return e[2]!==h||e[3]!==u?(m=r(de,{"data-testid":h,variant:"warning",children:u}),e[2]=h,e[3]=u,e[4]=m):m=e[4],m}let l;e[5]!==s?(l=s.map(yt).join(`
2
2
  `),e[5]=s,e[6]=l):l=e[6];const c=l,a=`storage-refs-${t}`;let n;e[7]!==s.length||e[8]!==o?(n=s.length===1?o("1 record"):o("{count} records",{count:s.length}),e[7]=s.length,e[8]=o,e[9]=n):n=e[9];let d;return e[10]!==c||e[11]!==a||e[12]!==n?(d=r(de,{"data-testid":a,title:c,variant:"secondary",children:n}),e[10]=c,e[11]=a,e[12]=n,e[13]=d):d=e[13],d},ze=f=>{const e=U(7),{objectKey:t,onToggle:s,selected:o,t:l}=f;let c;e[0]!==l?(c=l("Select row"),e[0]=l,e[1]=c):c=e[1];const a=`storage-select-${t}`;let n;return e[2]!==s||e[3]!==o||e[4]!==c||e[5]!==a?(n=r(Ce,{"aria-label":c,checked:o,"data-testid":a,onCheckedChange:s}),e[2]=s,e[3]=o,e[4]=c,e[5]=a,e[6]=n):n=e[6],n};function yt(f){return`${f.table}·${f.id}`}const xt=f=>{const e=U(10),{colSpan:t,name:s,onEnter:o}=f;let l;e[0]!==s||e[1]!==o?(l=()=>{o(s)},e[0]=s,e[1]=o,e[2]=l):l=e[2];const c=l;let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=r("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:r("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z"})}),e[3]=a):a=e[3];let n;e[4]!==c||e[5]!==s?(n=R("button",{className:"inline-flex items-center gap-2 font-mono text-xs outline-none hover:text-foreground focus-visible:text-foreground","data-testid":"fb-folder",onClick:c,type:"button",children:[a,s]}),e[4]=c,e[5]=s,e[6]=n):n=e[6];let d;return e[7]!==t||e[8]!==n?(d=r(pe,{children:r(te,{colSpan:t,children:n})}),e[7]=t,e[8]=n,e[9]=d):d=e[9],d},vt=f=>{const e=U(37),{busy:t,copiedKey:s,handlers:o,object:l,prefix:c,references:a,selected:n,showReferences:d,t:h}=f;let u;e[0]!==o||e[1]!==l||e[2]!==c?(u=$e(l,c,o),e[0]=o,e[1]=l,e[2]=c,e[3]=u):u=e[3];const{copy:m,download:k,name:i,remove:v,toggle:w}=u;let y;e[4]!==l.key||e[5]!==n||e[6]!==h||e[7]!==w?(y=r(te,{className:"w-8",children:r(ze,{objectKey:l.key,onToggle:w,selected:n,t:h})}),e[4]=l.key,e[5]=n,e[6]=h,e[7]=w,e[8]=y):y=e[8];let g;e[9]!==i?(g=r(te,{className:"font-mono text-xs",children:i}),e[9]=i,e[10]=g):g=e[10];let x;e[11]!==l.size?(x=Ne(l.size),e[11]=l.size,e[12]=x):x=e[12];let b;e[13]!==x?(b=r(te,{className:"tabular-nums text-muted-foreground",children:x}),e[13]=x,e[14]=b):b=e[14];const N=l.httpMetadata?.contentType??"";let S;e[15]!==N?(S=r(te,{children:N}),e[15]=N,e[16]=S):S=e[16];let C;e[17]!==l.key||e[18]!==a||e[19]!==d||e[20]!==h?(C=d&&r(te,{children:r(Re,{objectKey:l.key,references:a,t:h})}),e[17]=l.key,e[18]=a,e[19]=d,e[20]=h,e[21]=C):C=e[21];const E=s===l.key;let T;e[22]!==t||e[23]!==m||e[24]!==k||e[25]!==l.key||e[26]!==v||e[27]!==h||e[28]!==E?(T=r(te,{className:"text-right",children:r("span",{className:"inline-flex items-center gap-1",children:r(Fe,{busy:t,copied:E,objectKey:l.key,onCopy:m,onDelete:v,onDownload:k,t:h})})}),e[22]=t,e[23]=m,e[24]=k,e[25]=l.key,e[26]=v,e[27]=h,e[28]=E,e[29]=T):T=e[29];let F;return e[30]!==T||e[31]!==y||e[32]!==g||e[33]!==b||e[34]!==S||e[35]!==C?(F=R(pe,{"data-testid":"fb-row",children:[y,g,b,S,C,T]}),e[30]=T,e[31]=y,e[32]=g,e[33]=b,e[34]=S,e[35]=C,e[36]=F):F=e[36],F},kt=f=>{const e=U(65),{allSelected:t,busy:s,copiedKey:o,files:l,folders:c,handlers:a,onEnterFolder:n,prefix:d,references:h,selected:u,showReferences:m,someSelected:k,t:i,toggleSelectAll:v}=f;let w;e[0]!==i?(w=i("Select all rows"),e[0]=i,e[1]=w):w=e[1];let y;e[2]!==t||e[3]!==k||e[4]!==w||e[5]!==v?(y=r(ne,{className:"w-8",children:r(Ce,{"aria-label":w,checked:t,"data-testid":"storage-select-all",indeterminate:k,onCheckedChange:v})}),e[2]=t,e[3]=k,e[4]=w,e[5]=v,e[6]=y):y=e[6];let g;e[7]!==i?(g=i("key"),e[7]=i,e[8]=g):g=e[8];let x;e[9]!==g?(x=r(ne,{children:g}),e[9]=g,e[10]=x):x=e[10];let b;e[11]!==i?(b=i("size"),e[11]=i,e[12]=b):b=e[12];let N;e[13]!==b?(N=r(ne,{children:b}),e[13]=b,e[14]=N):N=e[14];let S;e[15]!==i?(S=i("content-type"),e[15]=i,e[16]=S):S=e[16];let C;e[17]!==S?(C=r(ne,{children:S}),e[17]=S,e[18]=C):C=e[18];let E;e[19]!==m||e[20]!==i?(E=m&&r(ne,{children:i("used by")}),e[19]=m,e[20]=i,e[21]=E):E=e[21];let T;e[22]!==i?(T=i("Actions"),e[22]=i,e[23]=T):T=e[23];let F;e[24]!==T?(F=r(ne,{"aria-label":T}),e[24]=T,e[25]=F):F=e[25];let $;e[26]!==F||e[27]!==y||e[28]!==x||e[29]!==N||e[30]!==C||e[31]!==E?($=r(ct,{children:R(pe,{children:[y,x,N,C,E,F]})}),e[26]=F,e[27]=y,e[28]=x,e[29]=N,e[30]=C,e[31]=E,e[32]=$):$=e[32];let z;if(e[33]!==c||e[34]!==n||e[35]!==m){let D;e[37]!==n||e[38]!==m?(D=K=>r(xt,{colSpan:m?6:5,name:K,onEnter:n},K),e[37]=n,e[38]=m,e[39]=D):D=e[39],z=c.map(D),e[33]=c,e[34]=n,e[35]=m,e[36]=z}else z=e[36];let L;if(e[40]!==s||e[41]!==o||e[42]!==l||e[43]!==a||e[44]!==d||e[45]!==h||e[46]!==u||e[47]!==m||e[48]!==i){let D;e[50]!==s||e[51]!==o||e[52]!==a||e[53]!==d||e[54]!==h||e[55]!==u||e[56]!==m||e[57]!==i?(D=K=>r(vt,{busy:s,copiedKey:o,handlers:a,object:K,prefix:d,references:h[K.key],selected:u.has(K.key),showReferences:m,t:i},K.key),e[50]=s,e[51]=o,e[52]=a,e[53]=d,e[54]=h,e[55]=u,e[56]=m,e[57]=i,e[58]=D):D=e[58],L=l.map(D),e[40]=s,e[41]=o,e[42]=l,e[43]=a,e[44]=d,e[45]=h,e[46]=u,e[47]=m,e[48]=i,e[49]=L}else L=e[49];let j;e[59]!==z||e[60]!==L?(j=R(dt,{children:[z,L]}),e[59]=z,e[60]=L,e[61]=j):j=e[61];let O;return e[62]!==$||e[63]!==j?(O=r(it,{className:"overflow-hidden py-0",children:r(at,{className:"px-0",children:R(ft,{"data-testid":"fb-table",children:[$,j]})})}),e[62]=$,e[63]=j,e[64]=O):O=e[64],O},St=[{label:"15m",seconds:900},{label:"1h",seconds:3600},{label:"24h",seconds:86400},{label:"7d",seconds:604800}],wt=3600,ve=(f,e)=>{if(e==="size")return f.size;if(e==="type")return f.httpMetadata?.contentType??"";if(e==="date"){if(f.uploaded===void 0)return 0;const t=new Date(f.uploaded).getTime();return Number.isNaN(t)?0:t}return e.startsWith("tag:")?f.customMetadata?.[e.slice(4)]??"":f.key},Ct=(f,e,t)=>{const s=t==="desc"?-1:1;return f.toSorted((o,l)=>{const c=ve(o,e),a=ve(l,e);return(typeof c=="number"&&typeof a=="number"?c-a:String(c).localeCompare(String(a)))*s})},Nt=(f,e)=>{const t=new Set,s=[];for(const o of f){const l=o.key.slice(e.length),c=l.indexOf("/");c===-1?s.push(o):t.add(l.slice(0,c+1))}return{files:s,folders:[...t].toSorted((o,l)=>o.localeCompare(l))}},Tt=f=>{const e=U(59),{bucket:t,buckets:s,busy:o,draftPrefix:l,expiry:c,fileInputRef:a,onBucketChange:n,onExpiryChange:d,onFileChange:h,onList:u,onPrefixChange:m,onUploadClick:k,t:i}=f;let v;e[0]!==m?(v=G=>{m(G.target.value)},e[0]=m,e[1]=v):v=e[1];const w=v;let y;e[2]!==n?(y=G=>{n(G.target.value)},e[2]=n,e[3]=y):y=e[3];const g=y;let x;e[4]!==d?(x=G=>{d(Number.parseInt(G.target.value,10))},e[4]=d,e[5]=x):x=e[5];const b=x;let N;e[6]!==t||e[7]!==s||e[8]!==g||e[9]!==i?(N=s.length>0&&r("select",{"aria-label":i("Bucket"),className:"h-8 rounded-md border border-border bg-background px-1 outline-none focus-visible:border-ring","data-testid":"fb-bucket",onChange:g,value:t,children:s.map(Et)}),e[6]=t,e[7]=s,e[8]=g,e[9]=i,e[10]=N):N=e[10];let S;e[11]!==i?(S=i("Key prefix"),e[11]=i,e[12]=S):S=e[12];let C;e[13]!==i?(C=i("key prefix (optional)"),e[13]=i,e[14]=C):C=e[14];let E;e[15]!==l||e[16]!==w||e[17]!==S||e[18]!==C?(E=r(mt,{"aria-label":S,className:"h-8 w-64 max-w-full","data-testid":"fb-prefix-input",onChange:w,placeholder:C,value:l}),e[15]=l,e[16]=w,e[17]=S,e[18]=C,e[19]=E):E=e[19];let T;e[20]!==i?(T=i("List"),e[20]=i,e[21]=T):T=e[21];let F;e[22]!==o||e[23]!==u||e[24]!==T?(F=r(re,{"data-testid":"fb-list",disabled:o,onClick:u,size:"sm",type:"button",children:T}),e[22]=o,e[23]=u,e[24]=T,e[25]=F):F=e[25];let $;e[26]!==o||e[27]!==i?($=i(o?"Uploading…":"Upload"),e[26]=o,e[27]=i,e[28]=$):$=e[28];let z;e[29]!==o||e[30]!==k||e[31]!==$?(z=r(re,{"data-testid":"storage-upload",disabled:o,onClick:k,size:"sm",type:"button",variant:"outline",children:$}),e[29]=o,e[30]=k,e[31]=$,e[32]=z):z=e[32];let L;e[33]!==a||e[34]!==h?(L=r("input",{className:"hidden","data-testid":"storage-file-input",onChange:h,ref:a,type:"file"}),e[33]=a,e[34]=h,e[35]=L):L=e[35];let j;e[36]!==i?(j=i("Link expiry"),e[36]=i,e[37]=j):j=e[37];let O;e[38]!==i?(O=St.map(G=>r("option",{value:G.seconds,children:i(G.label)},G.seconds)),e[38]=i,e[39]=O):O=e[39];let D;e[40]!==c||e[41]!==b||e[42]!==O?(D=r("select",{className:"h-8 rounded-md border border-border bg-background px-1 tabular-nums outline-none focus-visible:border-ring","data-testid":"storage-expiry",id:"storage-expiry",onChange:b,value:c,children:O}),e[40]=c,e[41]=b,e[42]=O,e[43]=D):D=e[43];let K;e[44]!==j||e[45]!==D?(K=R("label",{className:"ml-auto flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"storage-expiry",children:[j,D]}),e[44]=j,e[45]=D,e[46]=K):K=e[46];let A;e[47]!==i?(A=i("Open in Cloudflare"),e[47]=i,e[48]=A):A=e[48];let M;e[49]!==A?(M=r("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"fb-cf-link",href:pt,rel:"noreferrer",target:"_blank",children:A}),e[49]=A,e[50]=M):M=e[50];let H;return e[51]!==z||e[52]!==L||e[53]!==K||e[54]!==M||e[55]!==N||e[56]!==E||e[57]!==F?(H=R("div",{className:"flex flex-wrap items-center gap-2",children:[N,E,F,z,L,K,M]}),e[51]=z,e[52]=L,e[53]=K,e[54]=M,e[55]=N,e[56]=E,e[57]=F,e[58]=H):H=e[58],H},_t=f=>{const e=U(66),{onSortKeyChange:t,onThumbSizeChange:s,showGrid:o,showList:l,sortDirection:c,sortKey:a,t:n,tagKeys:d,thumbSize:h,toggleSortDirection:u,view:m}=f;let k;e[0]!==t?(k=W=>{t(W.target.value)},e[0]=t,e[1]=k):k=e[1];const i=k;let v;e[2]!==s?(v=W=>{s(Number.parseInt(W.target.value,10))},e[2]=s,e[3]=v):v=e[3];const w=v,y=m==="list";let g;e[4]!==n?(g=n("List"),e[4]=n,e[5]=g):g=e[5];let x;e[6]!==l||e[7]!==y||e[8]!==g?(x=r("button",{"aria-pressed":y,className:"px-2 py-1 outline-none transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-testid":"fb-view-list",onClick:l,type:"button",children:g}),e[6]=l,e[7]=y,e[8]=g,e[9]=x):x=e[9];const b=m==="grid";let N;e[10]!==n?(N=n("Grid"),e[10]=n,e[11]=N):N=e[11];let S;e[12]!==o||e[13]!==b||e[14]!==N?(S=r("button",{"aria-pressed":b,className:"border-s border-border px-2 py-1 outline-none transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-testid":"fb-view-grid",onClick:o,type:"button",children:N}),e[12]=o,e[13]=b,e[14]=N,e[15]=S):S=e[15];let C;e[16]!==x||e[17]!==S?(C=R("div",{className:"inline-flex overflow-hidden rounded-md border border-border",children:[x,S]}),e[16]=x,e[17]=S,e[18]=C):C=e[18];let E;e[19]!==n?(E=n("Sort"),e[19]=n,e[20]=E):E=e[20];let T;e[21]!==n?(T=n("Name"),e[21]=n,e[22]=T):T=e[22];let F;e[23]!==T?(F=r("option",{value:"name",children:T}),e[23]=T,e[24]=F):F=e[24];let $;e[25]!==n?($=n("size"),e[25]=n,e[26]=$):$=e[26];let z;e[27]!==$?(z=r("option",{value:"size",children:$}),e[27]=$,e[28]=z):z=e[28];let L;e[29]!==n?(L=n("Type"),e[29]=n,e[30]=L):L=e[30];let j;e[31]!==L?(j=r("option",{value:"type",children:L}),e[31]=L,e[32]=j):j=e[32];let O;e[33]!==n?(O=n("Modified"),e[33]=n,e[34]=O):O=e[34];let D;e[35]!==O?(D=r("option",{value:"date",children:O}),e[35]=O,e[36]=D):D=e[36];let K;e[37]!==d?(K=d.map($t),e[37]=d,e[38]=K):K=e[38];let A;e[39]!==i||e[40]!==a||e[41]!==F||e[42]!==z||e[43]!==j||e[44]!==D||e[45]!==K?(A=R("select",{className:"h-8 rounded-md border border-border bg-background px-1 outline-none focus-visible:border-ring","data-testid":"fb-sort",id:"fb-sort",onChange:i,value:a,children:[F,z,j,D,K]}),e[39]=i,e[40]=a,e[41]=F,e[42]=z,e[43]=j,e[44]=D,e[45]=K,e[46]=A):A=e[46];let M;e[47]!==E||e[48]!==A?(M=R("label",{className:"flex items-center gap-1.5 text-muted-foreground",htmlFor:"fb-sort",children:[E,A]}),e[47]=E,e[48]=A,e[49]=M):M=e[49];let H;e[50]!==n?(H=n("Toggle sort direction"),e[50]=n,e[51]=H):H=e[51];const G=c==="asc"?"↑":"↓";let q;e[52]!==H||e[53]!==G||e[54]!==u?(q=r("button",{"aria-label":H,className:"flex size-8 items-center justify-center rounded-md border border-border tabular-nums outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"fb-sort-dir",onClick:u,type:"button",children:G}),e[52]=H,e[53]=G,e[54]=u,e[55]=q):q=e[55];let Y;e[56]!==w||e[57]!==n||e[58]!==h||e[59]!==m?(Y=m==="grid"&&R("label",{className:"ml-auto flex items-center gap-1.5 text-muted-foreground",htmlFor:"fb-thumb-size",children:[n("Thumbnail size"),r("input",{className:"accent-primary","data-testid":"fb-thumb-size",id:"fb-thumb-size",max:240,min:80,onChange:w,step:8,type:"range",value:h})]}),e[56]=w,e[57]=n,e[58]=h,e[59]=m,e[60]=Y):Y=e[60];let se;return e[61]!==M||e[62]!==q||e[63]!==Y||e[64]!==C?(se=R("div",{className:"flex flex-wrap items-center gap-2 text-xs","data-testid":"fb-controls",children:[C,M,q,Y]}),e[61]=M,e[62]=q,e[63]=Y,e[64]=C,e[65]=se):se=e[65],se};function Et(f){return r("option",{value:f,children:f},f)}function $t(f){return r("option",{value:`tag:${f}`,children:f},f)}const Ft=/\.(?:avif|bmp|gif|ico|jpe?g|png|svg|webp)$/iu,Rt=f=>(f.httpMetadata?.contentType??"").startsWith("image/")||Ft.test(f.key),zt=()=>{const f=U(1);let e;return f[0]===Symbol.for("react.memo_cache_sentinel")?(e=r("svg",{"aria-hidden":"true",className:"size-8 text-muted-foreground/60",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.4,viewBox:"0 0 24 24",children:r("path",{d:"M7 3h7l5 5v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm7 0v5h5"})}),f[0]=e):e=f[0],e},Dt=f=>{const e=U(13),{object:t,resolveUrl:s}=f,[o,l]=B(null),[c,a]=B(!1);let n;e[0]!==t?(n=Rt(t),e[0]=t,e[1]=n):n=e[1];const d=n;let h,u;e[2]!==d||e[3]!==t.key||e[4]!==s?(h=()=>{if(!d)return;const v={cancelled:!1};return P((async()=>{try{const w=await s(t.key);v.cancelled||l(w)}catch{v.cancelled||a(!0)}})()),()=>{v.cancelled=!0}},u=[d,t.key,s],e[2]=d,e[3]=t.key,e[4]=s,e[5]=h,e[6]=u):(h=e[5],u=e[6]),oe(h,u);let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=()=>{a(!0)},e[7]=m):m=e[7];const k=m;let i;return e[8]!==c||e[9]!==d||e[10]!==t.key||e[11]!==o?(i=r("div",{className:"flex aspect-square w-full items-center justify-center overflow-hidden rounded-md border border-border bg-muted/30",children:d&&o!==null&&!c?r("img",{alt:t.key,className:"size-full object-cover",loading:"lazy",onError:k,src:o}):r(zt,{})}),e[8]=c,e[9]=d,e[10]=t.key,e[11]=o,e[12]=i):i=e[12],i},jt=f=>{const e=U(42),{busy:t,copiedKey:s,handlers:o,object:l,prefix:c,references:a,resolveUrl:n,selected:d,showReferences:h,t:u}=f;let m;e[0]!==o||e[1]!==l||e[2]!==c?(m=$e(l,c,o),e[0]=o,e[1]=l,e[2]=c,e[3]=m):m=e[3];const{copy:k,download:i,name:v,remove:w,toggle:y}=m;let g;e[4]!==l||e[5]!==n?(g=r(Dt,{object:l,resolveUrl:n}),e[4]=l,e[5]=n,e[6]=g):g=e[6];let x;e[7]!==l.key||e[8]!==d||e[9]!==u||e[10]!==y?(x=r("span",{className:"absolute left-1.5 top-1.5 rounded bg-background/80 p-0.5",children:r(ze,{objectKey:l.key,onToggle:y,selected:d,t:u})}),e[7]=l.key,e[8]=d,e[9]=u,e[10]=y,e[11]=x):x=e[11];let b;e[12]!==g||e[13]!==x?(b=R("div",{className:"relative",children:[g,x]}),e[12]=g,e[13]=x,e[14]=b):b=e[14];let N;e[15]!==v?(N=r("p",{className:"truncate font-mono text-xs",title:v,children:v}),e[15]=v,e[16]=N):N=e[16];let S;e[17]!==l.size?(S=Ne(l.size),e[17]=l.size,e[18]=S):S=e[18];let C;e[19]!==S?(C=r("p",{className:"text-[11px] tabular-nums text-muted-foreground",children:S}),e[19]=S,e[20]=C):C=e[20];let E;e[21]!==l.key||e[22]!==a||e[23]!==h||e[24]!==u?(E=h&&r("div",{className:"mt-1",children:r(Re,{objectKey:l.key,references:a,t:u})}),e[21]=l.key,e[22]=a,e[23]=h,e[24]=u,e[25]=E):E=e[25];let T;e[26]!==N||e[27]!==C||e[28]!==E?(T=R("div",{className:"min-w-0",children:[N,C,E]}),e[26]=N,e[27]=C,e[28]=E,e[29]=T):T=e[29];const F=s===l.key;let $;e[30]!==t||e[31]!==k||e[32]!==i||e[33]!==l.key||e[34]!==w||e[35]!==u||e[36]!==F?($=r("div",{className:"flex items-center gap-1",children:r(Fe,{busy:t,buttonClassName:"h-7 px-2 text-xs",copied:F,objectKey:l.key,onCopy:k,onDelete:w,onDownload:i,t:u})}),e[30]=t,e[31]=k,e[32]=i,e[33]=l.key,e[34]=w,e[35]=u,e[36]=F,e[37]=$):$=e[37];let z;return e[38]!==$||e[39]!==b||e[40]!==T?(z=R("div",{className:"flex flex-col gap-1.5","data-testid":"fb-tile",children:[b,T,$]}),e[38]=$,e[39]=b,e[40]=T,e[41]=z):z=e[41],z},Kt=f=>{const e=U(9),{name:t,onEnter:s}=f;let o;e[0]!==t||e[1]!==s?(o=()=>{s(t)},e[0]=t,e[1]=s,e[2]=o):o=e[2];const l=o;let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=r("span",{className:"flex aspect-square w-full items-center justify-center rounded-md border border-border bg-muted/30 transition-colors hover:bg-accent",children:r("svg",{"aria-hidden":"true",className:"size-10 text-muted-foreground",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.4,viewBox:"0 0 24 24",children:r("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z"})})}),e[3]=c):c=e[3];let a;e[4]!==t?(a=r("span",{className:"truncate font-mono text-xs",title:t,children:t}),e[4]=t,e[5]=a):a=e[5];let n;return e[6]!==l||e[7]!==a?(n=R("button",{className:"flex flex-col gap-1.5 text-left outline-none","data-testid":"fb-folder",onClick:l,type:"button",children:[c,a]}),e[6]=l,e[7]=a,e[8]=n):n=e[8],n},Bt=f=>{const e=U(34),{busy:t,copiedKey:s,files:o,folders:l,handlers:c,onEnterFolder:a,prefix:n,references:d,resolveUrl:h,selected:u,showReferences:m,size:k,t:i}=f;let v;e[0]!==k?(v=k.toString(),e[0]=k,e[1]=v):v=e[1];const w=`repeat(auto-fill, minmax(${v}px, 1fr))`;let y;e[2]!==w?(y={gridTemplateColumns:w},e[2]=w,e[3]=y):y=e[3];const g=y;let x;if(e[4]!==l||e[5]!==a){let S;e[7]!==a?(S=C=>r(Kt,{name:C,onEnter:a},C),e[7]=a,e[8]=S):S=e[8],x=l.map(S),e[4]=l,e[5]=a,e[6]=x}else x=e[6];let b;if(e[9]!==t||e[10]!==s||e[11]!==o||e[12]!==c||e[13]!==n||e[14]!==d||e[15]!==h||e[16]!==u||e[17]!==m||e[18]!==i){let S;e[20]!==t||e[21]!==s||e[22]!==c||e[23]!==n||e[24]!==d||e[25]!==h||e[26]!==u||e[27]!==m||e[28]!==i?(S=C=>r(jt,{busy:t,copiedKey:s,handlers:c,object:C,prefix:n,references:d[C.key],resolveUrl:h,selected:u.has(C.key),showReferences:m,t:i},C.key),e[20]=t,e[21]=s,e[22]=c,e[23]=n,e[24]=d,e[25]=h,e[26]=u,e[27]=m,e[28]=i,e[29]=S):S=e[29],b=o.map(S),e[9]=t,e[10]=s,e[11]=o,e[12]=c,e[13]=n,e[14]=d,e[15]=h,e[16]=u,e[17]=m,e[18]=i,e[19]=b}else b=e[19];let N;return e[30]!==g||e[31]!==x||e[32]!==b?(N=R("div",{className:"grid gap-4","data-testid":"fb-gallery",style:g,children:[x,b]}),e[30]=g,e[31]=x,e[32]=b,e[33]=N):N=e[33],N},Lt=f=>{const e=U(23),{reference:t,t:s}=f,o=`fb-dangling-${t.table}-${t.id}-${t.column}`,l=`${t.table}·${t.id}`;let c;e[0]!==l?(c=r(de,{variant:"secondary",children:l}),e[0]=l,e[1]=c):c=e[1];let a;e[2]!==t.column?(a=r("span",{className:"text-muted-foreground",children:t.column}),e[2]=t.column,e[3]=a):a=e[3];let n;e[4]!==s?(n=s("→"),e[4]=s,e[5]=n):n=e[5];let d;e[6]!==n?(d=r("span",{className:"text-muted-foreground/60",children:n}),e[6]=n,e[7]=d):d=e[7];let h;e[8]!==t.key?(h=r("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-foreground",children:t.key}),e[8]=t.key,e[9]=h):h=e[9];let u;e[10]!==c||e[11]!==a||e[12]!==d||e[13]!==h?(u=R("span",{className:"flex flex-wrap items-center gap-1.5",children:[c,a,d,h]}),e[10]=c,e[11]=a,e[12]=d,e[13]=h,e[14]=u):u=e[14];let m;e[15]!==s?(m=s("Missing object"),e[15]=s,e[16]=m):m=e[16];let k;e[17]!==m?(k=r(de,{className:"border-destructive/40 text-destructive",variant:"outline",children:m}),e[17]=m,e[18]=k):k=e[18];let i;return e[19]!==o||e[20]!==k||e[21]!==u?(i=R("li",{className:"flex flex-wrap items-center justify-between gap-2 rounded-md border border-border/60 px-3 py-2 text-xs","data-testid":o,children:[u,k]}),e[19]=o,e[20]=k,e[21]=u,e[22]=i):i=e[22],i},It=f=>{const e=U(37),{busy:t,onCheck:s,references:o,t:l,truncated:c}=f;let a;e[0]!==l?(a=l("Integrity"),e[0]=l,e[1]=a):a=e[1];let n;e[2]!==a?(n=r("span",{className:"font-mono text-[11px] uppercase tracking-wide text-muted-foreground",children:a}),e[2]=a,e[3]=n):n=e[3];let d;e[4]!==l?(d=l("Orphaned objects"),e[4]=l,e[5]=d):d=e[5];let h;e[6]!==d?(h=r("span",{className:"text-sm font-medium text-foreground",children:d}),e[6]=d,e[7]=h):h=e[7];let u;e[8]!==l?(u=l("Find records whose file reference points at an object the bucket no longer has."),e[8]=l,e[9]=u):u=e[9];let m;e[10]!==u?(m=r("span",{className:"text-xs text-muted-foreground",children:u}),e[10]=u,e[11]=m):m=e[11];let k;e[12]!==n||e[13]!==h||e[14]!==m?(k=R("div",{className:"flex flex-col gap-1",children:[n,h,m]}),e[12]=n,e[13]=h,e[14]=m,e[15]=k):k=e[15];let i;e[16]!==t||e[17]!==l?(i=l(t?"Checking…":"Check for orphans"),e[16]=t,e[17]=l,e[18]=i):i=e[18];let v;e[19]!==t||e[20]!==s||e[21]!==i?(v=r(re,{"data-testid":"fb-orphans-check",disabled:t,onClick:s,size:"sm",type:"button",variant:"outline",children:i}),e[19]=t,e[20]=s,e[21]=i,e[22]=v):v=e[22];let w;e[23]!==k||e[24]!==v?(w=R("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[k,v]}),e[23]=k,e[24]=v,e[25]=w):w=e[25];let y;e[26]!==o?.length||e[27]!==l?(y=o?.length===0&&r(we,{description:l("Every record's file reference points at an object that exists in the bucket."),testId:"fb-orphans-empty",title:l("No dangling references.")}),e[26]=o?.length,e[27]=l,e[28]=y):y=e[28];let g;e[29]!==o||e[30]!==l||e[31]!==c?(g=o!==void 0&&o.length>0&&R(_e,{children:[c&&r("p",{className:"text-xs text-warning","data-testid":"fb-orphans-truncated",children:l("Showing the first {count} dangling references — the scan was truncated.",{count:o.length})}),r("ul",{className:"flex flex-col gap-1.5","data-testid":"fb-orphans-list",children:o.map(b=>r(Lt,{reference:b,t:l},`${b.table}·${b.id}·${b.column}`))})]}),e[29]=o,e[30]=l,e[31]=c,e[32]=g):g=e[32];let x;return e[33]!==w||e[34]!==y||e[35]!==g?(x=R("section",{className:"flex flex-col gap-2 rounded-lg border border-border/60 p-3","data-testid":"fb-orphans",children:[w,y,g]}),e[33]=w,e[34]=y,e[35]=g,e[36]=x):x=e[36],x},Ot=function(f,e){const t=U(18);let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=new Set,t[0]=s):s=t[0];const[o,l]=B(s);let c;t[1]===Symbol.for("react.memo_cache_sentinel")?(c=y=>{l(g=>{const x=new Set(g);return x.has(y)?x.delete(y):x.add(y),x})},t[1]=c):c=t[1];const a=c;let n;t[2]===Symbol.for("react.memo_cache_sentinel")?(n=()=>{l(new Set)},t[2]=n):n=t[2];const d=n;let h,u,m;if(t[3]!==f||t[4]!==e||t[5]!==o){let y;t[9]!==e?(y=g=>e(g),t[9]=e,t[10]=y):y=t[10],u=f.map(y),h=u.length>0&&u.every(g=>o.has(g)),m=!h&&u.some(g=>o.has(g)),t[3]=f,t[4]=e,t[5]=o,t[6]=h,t[7]=u,t[8]=m}else h=t[6],u=t[7],m=t[8];const k=m;let i;t[11]!==u?(i=()=>{l(y=>u.every(g=>y.has(g))?new Set:new Set(u))},t[11]=u,t[12]=i):i=t[12];const v=i;let w;return t[13]!==h||t[14]!==o||t[15]!==k||t[16]!==v?(w={allSelected:h,clear:d,selected:o,someSelected:k,toggle:a,toggleAll:v},t[13]=h,t[14]=o,t[15]=k,t[16]=v,t[17]=w):w=t[17],w},At=Te(Ee.storageReferences),Ut=Te(Ee.storageOrphans),ke=1e4,Mt=1e3,Gt=3600,Ht=(f,e)=>{if(!("document"in globalThis))return;const t=globalThis.document.createElement("a");t.href=f,t.download=e,t.rel="noopener",globalThis.document.body.append(t),t.click(),t.remove()},Pt=f=>f.key,qt=({initialPrefix:f,pageSize:e})=>{const t=gt(),[s,o]=B(f??""),[l,c]=B(f??""),[a,n]=B(wt),[d,h]=B("list"),[u,m]=B(128),[k,i]=B("name"),[v,w]=B("asc"),[y,g]=B(void 0),[x,b]=B(void 0),[N,S]=B(!1),[C,E]=B(void 0),[T,F]=B(void 0),[$,z]=B(""),[L,j]=B({}),[O,D]=B(!1),[K,A]=B(void 0),[M,H]=B(!1),[G,q]=B(!1),[Y,se]=B([]),[W,ge]=B(""),le=me(0),J=me(0);oe(()=>{const p={cancelled:!1};return P((async()=>{try{const _=await t.listStorageBuckets();if(!p.cancelled){se(_);const[I]=_;I!==void 0&&ge(Q=>Q===""?I:Q)}}catch{}})()),()=>{p.cancelled=!0}},[t]);const Z=he(()=>({list:p=>t.listStorageObjects({...p,bucket:W}),remove:p=>t.deleteStorageObject(p,{bucket:W}),signedUrl:(p,_)=>t.signedStorageUrl(p,{..._,bucket:W}),upload:p=>t.uploadStorageObject({...p,bucket:W})}),[W,t]),X=lt(async(p,_,I)=>{le.current+=1;const Q=le.current;b(void 0),S(!0);try{const V=await Z.list({cursor:_,limit:e,prefix:p});if(Q!==le.current)return;g(ce=>I&&ce!==void 0?[...ce,...V.objects]:V.objects),F(V.cursor)}catch(V){if(Q!==le.current)return;I||g(void 0),b(ee(V))}finally{Q===le.current&&S(!1)}},[e,Z]);oe(()=>{P(X(f??"",void 0,!1))},[X,f]);const De=(y?.length??0)<=e;bt(()=>{P(X(s,void 0,!1))},De);const{files:fe,folders:je}=Nt(y??[],s),Ke=he(()=>{const p=new Set;for(const _ of fe)for(const I of Object.keys(_.customMetadata??{}))p.add(I);return[...p].toSorted((_,I)=>_.localeCompare(I))},[fe]),ae=Ct(fe,k,v),ue=he(()=>[...new Set(ae.map(p=>p.key))].toSorted((p,_)=>p.localeCompare(_)).join(`
3
3
  `),[ae]);oe(()=>{const p=ue===""?[]:ue.split(`
4
4
  `);if(p.length===0){j({});return}const _={current:!0};return P((async()=>{try{const I=await t.query(At,{keys:p},xe($));_.current&&(j(I.references??{}),D(Object.keys(I.storageColumns??{}).length>0))}catch{_.current&&(j({}),D(!1))}})()),()=>{_.current=!1}},[t,ue,$]);const{allSelected:Be,clear:ie,selected:be,someSelected:Le,toggle:Ie,toggleAll:Oe}=Ot(ae,Pt),Ae=()=>{o(l),ie(),P(X(l,void 0,!1))},Ue=()=>{P(X(s,T,!0))},ye=p=>{o(p),c(p),ie(),P(X(p,void 0,!1))},Me=p=>{ye(`${s}${p}`)},Ge=p=>Z.signedUrl(p,{expiresInSeconds:Gt}),He=()=>{h("list")},Pe=()=>{h("grid")},qe=p=>{i(p)},Ve=()=>{w(p=>p==="asc"?"desc":"asc")},We=p=>{m(p)},Ze=p=>{n(p)},Xe=()=>{b(void 0),S(!0),P((async()=>{try{for(const p of be)await Z.remove(p);await X(s,void 0,!1),ie()}catch(p){b(ee(p))}S(!1)})())},Ye=p=>{b(void 0),P((async()=>{try{const _=await Z.signedUrl(p,{expiresInSeconds:a});ut(_)&&E(p)}catch(_){b(ee(_))}})())},Je=p=>{b(void 0),P((async()=>{try{const _=await Z.signedUrl(p,{expiresInSeconds:a}),I=p.slice(p.lastIndexOf("/")+1)||p;Ht(_,I)}catch(_){b(ee(_))}})())};oe(()=>{if(C===void 0)return;const p=globalThis.setTimeout(()=>{E(void 0)},2e3);return()=>{globalThis.clearTimeout(p)}},[C]);const Qe=p=>{b(void 0),S(!0),P((async()=>{try{await Z.remove(p),await X(s,void 0,!1)}catch(_){b(ee(_))}S(!1)})())},et=p=>{const _=`${s}${p.name}`;b(void 0),S(!0),P((async()=>{try{const I=await p.arrayBuffer();await Z.upload({body:I,contentType:p.type===""?void 0:p.type,key:_}),await X(s,void 0,!1)}catch(I){b(ee(I))}S(!1)})())};oe(()=>{J.current+=1,A(void 0),q(!1)},[$]);const tt=()=>{J.current+=1;const p=J.current;b(void 0),H(!0),P((async()=>{try{const _=[];let I;do{const V=await Z.list({cursor:I,limit:Mt});for(const ce of V.objects)_.push(ce.key);I=_.length>=ke?void 0:V.cursor}while(I!==void 0);if(_.length>=ke)p===J.current&&(A([]),q(!0));else{const V=await t.query(Ut,{liveKeys:_},xe($));p===J.current&&(A(V.references??[]),q(V.truncated===!0))}}catch(_){p===J.current&&(A([]),q(!1),b(ee(_)))}p===J.current&&H(!1)})())},st=p=>{le.current+=1,J.current+=1,ge(p),o(f??""),c(f??""),g(void 0),A(void 0),q(!1),ie()};return{allSelected:Be,bucket:W,buckets:Y,bulkDelete:Xe,busy:N,checkOrphans:tt,clearSelection:ie,copiedKey:C,danglingBusy:M,danglingReferences:K,danglingTruncated:G,draftPrefix:l,enterFolder:Me,error:x,expiry:a,files:ae,folders:je,hasObjects:y!==void 0&&y.length>0,hasStorageColumns:O,listFirst:Ae,loaded:y!==void 0,loadMore:Ue,navigate:ye,nextCursor:T,onCopy:Ye,onDelete:Qe,onDownload:Je,onExpiryChange:Ze,onFile:et,onSortKeyChange:qe,onThumbSizeChange:We,prefix:s,referenceShard:$,references:L,resolveUrl:Ge,selectBucket:st,selected:be,setDraftPrefix:c,setReferenceShard:z,showGrid:Pe,showList:He,someSelected:Le,sortDirection:v,sortKey:k,tagKeys:Ke,thumbSize:u,toggleSelect:Ie,toggleSelectAll:Oe,toggleSortDirection:Ve,view:d}},Vt=100,Se=f=>{const e=U(6),{label:t,onNavigate:s,target:o}=f;let l;e[0]!==s||e[1]!==o?(l=()=>{s(o)},e[0]=s,e[1]=o,e[2]=l):l=e[2];const c=l;let a;return e[3]!==c||e[4]!==t?(a=r("button",{className:"rounded px-1 text-muted-foreground outline-none hover:text-foreground focus-visible:text-foreground",onClick:c,type:"button",children:t}),e[3]=c,e[4]=t,e[5]=a):a=e[5],a},Wt=f=>{const e=U(11),{onNavigate:t,prefix:s,t:o}=f;let l;if(e[0]!==t||e[1]!==s||e[2]!==o){const c=s.split("/").filter(Zt);let a;e[4]!==o?(a=o("Folder path"),e[4]=o,e[5]=a):a=e[5];let n;e[6]!==o?(n=o("root"),e[6]=o,e[7]=n):n=e[7];let d;e[8]!==t||e[9]!==n?(d=r(Se,{label:n,onNavigate:t,target:""}),e[8]=t,e[9]=n,e[10]=d):d=e[10],l=R("nav",{"aria-label":a,className:"flex flex-wrap items-center gap-0.5 text-xs","data-testid":"fb-breadcrumbs",children:[d,c.map((h,u)=>R("span",{className:"flex items-center gap-0.5",children:[r("span",{className:"text-muted-foreground/50",children:"/"}),r(Se,{label:h,onNavigate:t,target:`${c.slice(0,u+1).join("/")}/`})]},`${h}-${u.toString()}`))]}),e[0]=t,e[1]=s,e[2]=o,e[3]=l}else l=e[3];return l},ps=({initialPrefix:f,pageSize:e=Vt})=>{const t=ot(),s=qt({initialPrefix:f,pageSize:e}),o=me(null),{onCopy:l,onDelete:c,onDownload:a,onFile:n,toggleSelect:d}=s,h={onCopy:l,onDelete:c,onDownload:a,onToggleSelect:d},u=()=>{o.current?.click()},m=i=>{const v=i.target,w=v.files?.[0];v.value="",w&&n(w)},k=s.loaded&&!s.hasObjects;return R("div",{className:"flex flex-col gap-3","data-testid":"lunora-file-browser",children:[r(Tt,{bucket:s.bucket,buckets:s.buckets,busy:s.busy,draftPrefix:s.draftPrefix,expiry:s.expiry,fileInputRef:o,onBucketChange:s.selectBucket,onExpiryChange:s.onExpiryChange,onFileChange:m,onList:s.listFirst,onPrefixChange:s.setDraftPrefix,onUploadClick:u,t}),s.loaded&&r(Wt,{onNavigate:s.navigate,prefix:s.prefix,t}),s.hasObjects&&r(_t,{onSortKeyChange:s.onSortKeyChange,onThumbSizeChange:s.onThumbSizeChange,showGrid:s.showGrid,showList:s.showList,sortDirection:s.sortDirection,sortKey:s.sortKey,t,tagKeys:s.tagKeys,thumbSize:s.thumbSize,toggleSortDirection:s.toggleSortDirection,view:s.view}),s.hasStorageColumns&&R("div",{className:"flex flex-wrap items-center gap-2","data-testid":"fb-references-shard",children:[r("label",{className:"text-xs text-muted-foreground",htmlFor:"fb-reference-shard-input",children:t("References shard")}),r(nt,{id:"fb-reference-shard-input",onChange:s.setReferenceShard,testId:"fb-reference-shard-input",value:s.referenceShard}),r("span",{className:"text-xs text-muted-foreground",children:t("Which shard's records are checked for references to these files. Empty = root shard.")})]}),s.hasStorageColumns&&r(It,{busy:s.danglingBusy,onCheck:s.checkOrphans,references:s.danglingReferences,t,truncated:s.danglingTruncated}),s.selected.size>0&&r(rt,{count:s.selected.size,editable:!0,onClear:s.clearSelection,onDelete:s.bulkDelete}),s.error!==void 0&&r("p",{className:"text-sm text-destructive","data-testid":"storage-error",role:"alert",children:s.error}),k&&r(we,{description:t("Objects you upload to your R2 buckets will appear here."),icon:R("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[r("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z"}),r("path",{d:"M12 11v5m-2.5-2.5h5"})]}),testId:"fb-empty",title:t("No objects.")}),s.hasObjects&&s.view==="list"&&r(kt,{allSelected:s.allSelected,busy:s.busy,copiedKey:s.copiedKey,files:s.files,folders:s.folders,handlers:h,onEnterFolder:s.enterFolder,prefix:s.prefix,references:s.references,selected:s.selected,showReferences:s.hasStorageColumns,someSelected:s.someSelected,t,toggleSelectAll:s.toggleSelectAll}),s.hasObjects&&s.view==="grid"&&r(Bt,{busy:s.busy,copiedKey:s.copiedKey,files:s.files,folders:s.folders,handlers:h,onEnterFolder:s.enterFolder,prefix:s.prefix,references:s.references,resolveUrl:s.resolveUrl,selected:s.selected,showReferences:s.hasStorageColumns,size:s.thumbSize,t}),s.nextCursor!==void 0&&r("div",{children:r(re,{"data-testid":"fb-next",disabled:s.busy,onClick:s.loadMore,size:"sm",type:"button",variant:"outline",children:t("Load more")})})]})};function Zt(f){return f!==""}export{ps as FileBrowser};
@@ -1 +1 @@
1
- import{useLunora as X}from"@lunora/react";import{useState as i,useEffect as Y}from"react";import{ShardInput as G}from"../packem_shared/ShardInput-CdawpUiS.js";import{B as E}from"../packem_shared/badge-cAk9Di1Q.js";import{B as N}from"../packem_shared/button-BOPLD1un.js";import{I as Q}from"../packem_shared/input-CY5W3wzv.js";import{L as y}from"../packem_shared/label-BOUo-DP0.js";import{T as W}from"../packem_shared/textarea-DpO3i-Qo.js";import{useT as Z}from"../packem_shared/DEFAULT_LOCALE-A1Yg5ORA.js";import{ADMIN_FUNCTIONS as _}from"../packem_shared/ADMIN_FUNCTIONS-4aE59aDq.js";import{b as ee,i as te,f as re,k as se,c as ae}from"../packem_shared/internal-7bgd8inO.js";import{r as ne}from"../packem_shared/shard-history-DU5b3QDI.js";import{jsxs as n,jsx as r}from"react/jsx-runtime";const oe=t=>t.kind==="id"?t.table===void 0?"id":`id<${t.table}>`:t.kind==="array"?t.element===void 0?"array":`${t.element}[]`:t.kind,ie=t=>t===void 0||t.length===0?"()":`(${t.map(o=>`${o.name}${o.optional?"?":""}: ${oe(o)}`).join(", ")})`,de=t=>{switch(t){case"array":return[];case"bigint":case"number":return 0;case"boolean":return!1;case"object":case"record":return{};default:return""}},le=t=>{const o={};for(const s of t??[])s.optional||(o[s.name]=de(s.kind));return JSON.stringify(o,void 0,2)},ce=ae(_.runAs),ue=10,me=t=>t===void 0?"undefined":JSON.stringify(t,null,2),Ae=({functions:t,runAsIdentity:o=!1}={})=>{const s=Z(),u=X(),[L,j]=i(null),[S,B]=i(null),p=t??L??[],[w,R]=i(""),[m,g]=i("{}"),[c,k]=i(""),[f,D]=i(""),[x,h]=i("idle"),[K,b]=i(void 0),[I,v]=i(null),[A,U]=i([]);Y(()=>{if(t!==void 0)return;let e=!1;return u.listFunctions().then(d=>(e||j(d),d)).catch(d=>{e||B(ee(d))}),()=>{e=!0}},[u,t]);const C=w===""?p[0]?.path??"":w,a=p.find(e=>e.path===C),J=async()=>{if(!a)return;let e;try{e=m.trim()===""?{}:JSON.parse(m)}catch(l){h("error"),b(void 0),v(s("Invalid JSON args: {message}",{message:l.message}));return}const d={__lunoraRef:a.path},T=c.trim()===""?{}:{shardKey:c.trim()},F=o?f.trim():"",$=l=>{U(O=>[{argsText:m,at:Date.now(),id:(O[0]?.id??0)+1,kind:a.kind,path:a.path,shardKey:c,status:l},...O].slice(0,ue))};h("running"),v(null);try{const l=F===""?await se(u,a.kind,d,e,T):await u.query(ce,{args:e,functionPath:a.path,userId:F},T);ne(c),b(l),h("success"),$("success")}catch(l){b(void 0),v(l.message),h("error"),$("error")}},M=e=>{R(e.path),g(e.argsText),k(e.shardKey)},P=e=>{R(e.target.value)},z=e=>{g(e.target.value)},q=e=>{D(e.target.value)},H=()=>{re(J())},V=()=>{g(le(a?.args))};return n("div",{className:"flex flex-col gap-4","data-testid":"lunora-function-runner",children:[S!==null&&r("p",{className:"text-sm text-destructive","data-testid":"function-discover-error",role:"alert",children:S}),n("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-4",children:[n("div",{className:"flex flex-col gap-1.5",children:[r(y,{htmlFor:"function-select",children:s("Function")}),r("select",{"aria-label":s("Function"),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50","data-testid":"function-select",id:"function-select",onChange:P,value:C,children:p.map(e=>n("option",{value:e.path,children:[e.path," (",e.kind,")"]},e.path))}),a!==void 0&&n("p",{className:"text-xs text-muted-foreground",children:[r("span",{className:"mr-1.5 font-medium",children:s("Signature")}),r("code",{className:"font-mono","data-testid":"function-signature",children:ie(a.args)})]})]}),n("div",{className:"flex flex-col gap-1.5",children:[n("div",{className:"flex items-center justify-between gap-2",children:[r(y,{htmlFor:"args-input",children:s("Arguments")}),r(N,{"data-testid":"prefill-button",disabled:a===void 0,onClick:V,size:"xs",type:"button",variant:"ghost",children:s("Prefill")})]}),r(W,{"aria-label":s("Arguments"),className:"font-mono text-xs","data-testid":"args-input",id:"args-input",onChange:z,value:m})]}),r(G,{onChange:k,testId:"shard-input",value:c}),o&&n("div",{className:"flex flex-col gap-1.5","data-testid":"run-as-field",children:[r(y,{htmlFor:"run-as-input",children:s("Run as identity (userId)")}),r(Q,{"aria-label":s("Run as identity (userId)"),className:"font-mono text-xs","data-testid":"run-as-input",id:"run-as-input",onChange:q,placeholder:s("Leave empty to run as admin"),value:f}),r("p",{className:"text-[11px] text-muted-foreground",children:s("Dev only: runs the function as this user so you can test auth and RLS. Forged over the admin gate.")})]}),n("div",{className:"flex flex-wrap items-center gap-2",children:[r(N,{"data-testid":"run-button",disabled:x==="running"||a===void 0,onClick:H,type:"button",children:s("Run")}),a!==void 0&&r(E,{variant:"outline",children:a.kind}),o&&f.trim()!==""&&r(E,{"data-testid":"run-as-badge",variant:"secondary",children:s("as {userId}",{userId:f.trim()})})]})]}),x==="error"&&I!==null&&r("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs text-destructive","data-testid":"error",role:"alert",children:I}),x==="success"&&r("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":"result",children:me(K)}),A.length>0&&r("ul",{className:"flex flex-col overflow-hidden rounded-xl border border-border","data-testid":"fn-history",children:A.map((e,d)=>n("li",{className:"flex flex-wrap items-center gap-2 border-b border-border px-3 py-2 text-sm last:border-b-0","data-testid":"fn-history-row",children:[r("span",{className:e.status==="success"?"text-success":"text-destructive","data-testid":`fn-history-status-${d.toString()}`,children:e.status==="success"?"✓":"✗"})," ",n("span",{className:"font-mono text-xs",children:[e.path," (",e.kind,")"]})," ",r("time",{className:"text-xs text-muted-foreground",children:te(e.at)})," ",r(N,{className:"ml-auto","data-testid":`fn-history-load-${d.toString()}`,onClick:()=>{M(e)},size:"xs",type:"button",variant:"ghost",children:s("Load")})]},e.id))})]})};export{Ae as FunctionRunner};
1
+ import{useLunora as X}from"@lunora/react";import{useState as i,useEffect as Y}from"react";import{ShardInput as G}from"../packem_shared/ShardInput-CdawpUiS.js";import{B as E}from"../packem_shared/badge-cAk9Di1Q.js";import{B as N}from"../packem_shared/button-BOPLD1un.js";import{I as Q}from"../packem_shared/input-CY5W3wzv.js";import{L as y}from"../packem_shared/label-BOUo-DP0.js";import{T as W}from"../packem_shared/textarea-DpO3i-Qo.js";import{useT as Z}from"../packem_shared/DEFAULT_LOCALE-A1Yg5ORA.js";import{ADMIN_FUNCTIONS as _}from"../packem_shared/ADMIN_FUNCTIONS-B6z7VLYt.js";import{b as ee,i as te,f as re,k as se,c as ae}from"../packem_shared/internal-7bgd8inO.js";import{r as ne}from"../packem_shared/shard-history-DU5b3QDI.js";import{jsxs as n,jsx as r}from"react/jsx-runtime";const oe=t=>t.kind==="id"?t.table===void 0?"id":`id<${t.table}>`:t.kind==="array"?t.element===void 0?"array":`${t.element}[]`:t.kind,ie=t=>t===void 0||t.length===0?"()":`(${t.map(o=>`${o.name}${o.optional?"?":""}: ${oe(o)}`).join(", ")})`,de=t=>{switch(t){case"array":return[];case"bigint":case"number":return 0;case"boolean":return!1;case"object":case"record":return{};default:return""}},le=t=>{const o={};for(const s of t??[])s.optional||(o[s.name]=de(s.kind));return JSON.stringify(o,void 0,2)},ce=ae(_.runAs),ue=10,me=t=>t===void 0?"undefined":JSON.stringify(t,null,2),Ae=({functions:t,runAsIdentity:o=!1}={})=>{const s=Z(),u=X(),[L,j]=i(null),[S,B]=i(null),p=t??L??[],[w,R]=i(""),[m,g]=i("{}"),[c,k]=i(""),[f,D]=i(""),[x,h]=i("idle"),[K,b]=i(void 0),[I,v]=i(null),[A,U]=i([]);Y(()=>{if(t!==void 0)return;let e=!1;return u.listFunctions().then(d=>(e||j(d),d)).catch(d=>{e||B(ee(d))}),()=>{e=!0}},[u,t]);const C=w===""?p[0]?.path??"":w,a=p.find(e=>e.path===C),J=async()=>{if(!a)return;let e;try{e=m.trim()===""?{}:JSON.parse(m)}catch(l){h("error"),b(void 0),v(s("Invalid JSON args: {message}",{message:l.message}));return}const d={__lunoraRef:a.path},T=c.trim()===""?{}:{shardKey:c.trim()},F=o?f.trim():"",$=l=>{U(O=>[{argsText:m,at:Date.now(),id:(O[0]?.id??0)+1,kind:a.kind,path:a.path,shardKey:c,status:l},...O].slice(0,ue))};h("running"),v(null);try{const l=F===""?await se(u,a.kind,d,e,T):await u.query(ce,{args:e,functionPath:a.path,userId:F},T);ne(c),b(l),h("success"),$("success")}catch(l){b(void 0),v(l.message),h("error"),$("error")}},M=e=>{R(e.path),g(e.argsText),k(e.shardKey)},P=e=>{R(e.target.value)},z=e=>{g(e.target.value)},q=e=>{D(e.target.value)},H=()=>{re(J())},V=()=>{g(le(a?.args))};return n("div",{className:"flex flex-col gap-4","data-testid":"lunora-function-runner",children:[S!==null&&r("p",{className:"text-sm text-destructive","data-testid":"function-discover-error",role:"alert",children:S}),n("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-4",children:[n("div",{className:"flex flex-col gap-1.5",children:[r(y,{htmlFor:"function-select",children:s("Function")}),r("select",{"aria-label":s("Function"),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50","data-testid":"function-select",id:"function-select",onChange:P,value:C,children:p.map(e=>n("option",{value:e.path,children:[e.path," (",e.kind,")"]},e.path))}),a!==void 0&&n("p",{className:"text-xs text-muted-foreground",children:[r("span",{className:"mr-1.5 font-medium",children:s("Signature")}),r("code",{className:"font-mono","data-testid":"function-signature",children:ie(a.args)})]})]}),n("div",{className:"flex flex-col gap-1.5",children:[n("div",{className:"flex items-center justify-between gap-2",children:[r(y,{htmlFor:"args-input",children:s("Arguments")}),r(N,{"data-testid":"prefill-button",disabled:a===void 0,onClick:V,size:"xs",type:"button",variant:"ghost",children:s("Prefill")})]}),r(W,{"aria-label":s("Arguments"),className:"font-mono text-xs","data-testid":"args-input",id:"args-input",onChange:z,value:m})]}),r(G,{onChange:k,testId:"shard-input",value:c}),o&&n("div",{className:"flex flex-col gap-1.5","data-testid":"run-as-field",children:[r(y,{htmlFor:"run-as-input",children:s("Run as identity (userId)")}),r(Q,{"aria-label":s("Run as identity (userId)"),className:"font-mono text-xs","data-testid":"run-as-input",id:"run-as-input",onChange:q,placeholder:s("Leave empty to run as admin"),value:f}),r("p",{className:"text-[11px] text-muted-foreground",children:s("Dev only: runs the function as this user so you can test auth and RLS. Forged over the admin gate.")})]}),n("div",{className:"flex flex-wrap items-center gap-2",children:[r(N,{"data-testid":"run-button",disabled:x==="running"||a===void 0,onClick:H,type:"button",children:s("Run")}),a!==void 0&&r(E,{variant:"outline",children:a.kind}),o&&f.trim()!==""&&r(E,{"data-testid":"run-as-badge",variant:"secondary",children:s("as {userId}",{userId:f.trim()})})]})]}),x==="error"&&I!==null&&r("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs text-destructive","data-testid":"error",role:"alert",children:I}),x==="success"&&r("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":"result",children:me(K)}),A.length>0&&r("ul",{className:"flex flex-col overflow-hidden rounded-xl border border-border","data-testid":"fn-history",children:A.map((e,d)=>n("li",{className:"flex flex-wrap items-center gap-2 border-b border-border px-3 py-2 text-sm last:border-b-0","data-testid":"fn-history-row",children:[r("span",{className:e.status==="success"?"text-success":"text-destructive","data-testid":`fn-history-status-${d.toString()}`,children:e.status==="success"?"✓":"✗"})," ",n("span",{className:"font-mono text-xs",children:[e.path," (",e.kind,")"]})," ",r("time",{className:"text-xs text-muted-foreground",children:te(e.at)})," ",r(N,{className:"ml-auto","data-testid":`fn-history-load-${d.toString()}`,onClick:()=>{M(e)},size:"xs",type:"button",variant:"ghost",children:s("Load")})]},e.id))})]})};export{Ae as FunctionRunner};
@@ -1 +1 @@
1
- import{c as Q}from"react/compiler-runtime";import{useState as U}from"react";import{E as V}from"../packem_shared/error-alert-CKqB2CiN.js";import{L as W}from"../packem_shared/live-status-Bf7rR8o8.js";import{ShardInput as G}from"../packem_shared/ShardInput-CdawpUiS.js";import{B as J}from"../packem_shared/badge-cAk9Di1Q.js";import{B as X}from"../packem_shared/button-BOPLD1un.js";import{C as Y,a as Z}from"../packem_shared/card-BGlQzQY-.js";import{E as ee}from"../packem_shared/empty-state-B939z6K2.js";import{T as te,a as re,b as L,c as a,d as le,e as n}from"../packem_shared/table-BMsuYFhk.js";import{u as se}from"../packem_shared/use-admin-query-DV9xmFl8.js";import{u as ae}from"../packem_shared/use-shard-key-BsP3o5wT.js";import{useT as ne}from"../packem_shared/DEFAULT_LOCALE-A1Yg5ORA.js";import{ADMIN_FUNCTIONS as oe}from"../packem_shared/ADMIN_FUNCTIONS-4aE59aDq.js";import{i as ie}from"../packem_shared/internal-7bgd8inO.js";import{c as j}from"../packem_shared/utils-bhneXptQ.js";import{jsx as t,jsxs as y}from"react/jsx-runtime";const ce={action:"outline",mutation:"default",query:"secondary"},q=r=>r<1e3?`${r<10?r.toFixed(1):Math.round(r).toString()}ms`:`${(r/1e3).toFixed(2)}s`,de=r=>r.calls===0?"—":r.errors===0?"0":`${r.errors.toString()} (${(r.errors/r.calls*100).toFixed(1)}%)`,me=r=>{const e=r.conflicts??0;return r.calls===0?"—":e===0?"0":`${e.toString()} (${(e/r.calls*100).toFixed(1)}%)`},ue={calls:(r,e)=>e.calls-r.calls,recent:(r,e)=>e.lastCalledAt-r.lastCalledAt,slowest:(r,e)=>e.maxDurationMs-r.maxDurationMs},Ae=r=>{const e=Q(47),{functions:I,initialShardKey:P}=r,s=ne(),{queryShardKey:F,setShardKey:N,shardKey:S}=ae(P),[o,H]=U("recent");let M;e[0]===Symbol.for("react.memo_cache_sentinel")?(M={},e[0]=M):M=e[0];let T;e[1]!==F?(T={live:!0,shardKey:F},e[1]=F,e[2]=T):T=e[2];const{data:O,error:i,errorSource:b,liveError:v}=se(oe.getFunctionStats,M,T),k=O?.functions??null;let w;e[3]!==I?(w=new Map((I??[]).map(fe)),e[3]=I,e[4]=w):w=e[4];const _=w;let E;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=C=>{H(C.currentTarget.dataset.sort)},e[5]=E):E=e[5];const z=E;let K;if(e[6]!==i||e[7]!==b||e[8]!==_||e[9]!==v||e[10]!==N||e[11]!==S||e[12]!==o||e[13]!==k||e[14]!==s){const C=k===null?[]:k.toSorted(ue[o]);let c;e[16]!==s?(c=s("Recent"),e[16]=s,e[17]=c):c=e[17];let d;e[18]!==c?(d={key:"recent",label:c},e[18]=c,e[19]=d):d=e[19];let m;e[20]!==s?(m=s("Most called"),e[20]=s,e[21]=m):m=e[21];let u;e[22]!==m?(u={key:"calls",label:m},e[22]=m,e[23]=u):u=e[23];let f;e[24]!==s?(f=s("Slowest"),e[24]=s,e[25]=f):f=e[25];let h;e[26]!==f?(h={key:"slowest",label:f},e[26]=f,e[27]=h):h=e[27];let $;e[28]!==h||e[29]!==d||e[30]!==u?($=[d,u,h],e[28]=h,e[29]=d,e[30]=u,e[31]=$):$=e[31];const D=$;let p;e[32]!==N||e[33]!==S?(p=t(G,{onChange:N,testId:"fs-shard-input",value:S}),e[32]=N,e[33]=S,e[34]=p):p=e[34];let x;e[35]!==v?(x=t(W,{message:v,prefix:"fs"}),e[35]=v,e[36]=x):x=e[36];let g;e[37]!==D||e[38]!==o?(g=t("div",{className:"ml-auto flex items-center gap-1",role:"group",children:D.map(l=>t(X,{"data-sort":l.key,"data-testid":`fs-sort-${l.key}`,onClick:z,size:"sm",type:"button",variant:o===l.key?"secondary":"ghost",children:l.label},l.key))}),e[37]=D,e[38]=o,e[39]=g):g=e[39];let A;e[40]!==p||e[41]!==x||e[42]!==g?(A=y("div",{className:"flex flex-wrap items-center gap-2",children:[p,x,g]}),e[40]=p,e[41]=x,e[42]=g,e[43]=A):A=e[43];let B;e[44]!==i||e[45]!==b?(B=i!==null&&t(V,{error:b,testId:"fs-error"}),e[44]=i,e[45]=b,e[46]=B):B=e[46],K=y("div",{className:"flex flex-col gap-4","data-testid":"lunora-function-stats",children:[A,B,k!==null&&C.length===0&&i===null&&t(ee,{description:s("Per-function call counts, error rates, and latency land here after your first request."),icon:y("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[t("path",{d:"M3 3v18h18"}),t("path",{d:"M7 14l4-4 3 3 5-6"})]}),testId:"fs-empty",title:s("No functions have run on this shard yet.")}),C.length>0&&t(Y,{className:"overflow-hidden py-0",children:t(Z,{className:"px-0",children:y(te,{"data-testid":"fs-table",children:[t(re,{children:y(L,{children:[t(a,{children:s("function")}),t(a,{children:s("kind")}),t(a,{className:"text-right",children:s("calls")}),t(a,{className:"text-right",children:s("errors")}),t(a,{className:"text-right",children:s("conflicts")}),t(a,{className:"text-right",children:s("avg")}),t(a,{className:"text-right",children:s("max")}),t(a,{children:s("last run")}),t(a,{children:s("last error")})]})}),t(le,{children:C.map(l=>{const R=_.get(l.path);return y(L,{"data-testid":`fs-row-${l.path}`,children:[t(n,{className:"font-medium",children:l.path}),t(n,{children:R===void 0?t("span",{className:"text-muted-foreground",children:"—"}):t(J,{variant:ce[R],children:R})}),t(n,{className:"text-right tabular-nums",children:l.calls}),t(n,{className:j("text-right tabular-nums",l.errors>0&&"text-destructive"),children:de(l)}),t(n,{className:j("text-right tabular-nums",(l.conflicts??0)>0&&"text-warning"),children:me(l)}),t(n,{className:"text-right tabular-nums",children:l.calls===0?"—":q(l.totalDurationMs/l.calls)}),t(n,{className:"text-right tabular-nums",children:l.calls===0?"—":q(l.maxDurationMs)}),t(n,{className:"text-muted-foreground",children:ie(l.lastCalledAt,"—")}),t(n,{className:"max-w-[24ch] truncate text-destructive",title:l.lastErrorMessage??void 0,children:l.lastErrorMessage??t("span",{className:"text-muted-foreground",children:"—"})})]},l.path)})})]})})})]}),e[6]=i,e[7]=b,e[8]=_,e[9]=v,e[10]=N,e[11]=S,e[12]=o,e[13]=k,e[14]=s,e[15]=K}else K=e[15];return K};function fe(r){return[r.path,r.kind]}export{Ae as FunctionStatsPanel};
1
+ import{c as Q}from"react/compiler-runtime";import{useState as U}from"react";import{E as V}from"../packem_shared/error-alert-CKqB2CiN.js";import{L as W}from"../packem_shared/live-status-Bf7rR8o8.js";import{ShardInput as G}from"../packem_shared/ShardInput-CdawpUiS.js";import{B as J}from"../packem_shared/badge-cAk9Di1Q.js";import{B as X}from"../packem_shared/button-BOPLD1un.js";import{C as Y,a as Z}from"../packem_shared/card-BGlQzQY-.js";import{E as ee}from"../packem_shared/empty-state-B939z6K2.js";import{T as te,a as re,b as L,c as a,d as le,e as n}from"../packem_shared/table-BMsuYFhk.js";import{u as se}from"../packem_shared/use-admin-query-DV9xmFl8.js";import{u as ae}from"../packem_shared/use-shard-key-BsP3o5wT.js";import{useT as ne}from"../packem_shared/DEFAULT_LOCALE-A1Yg5ORA.js";import{ADMIN_FUNCTIONS as oe}from"../packem_shared/ADMIN_FUNCTIONS-B6z7VLYt.js";import{i as ie}from"../packem_shared/internal-7bgd8inO.js";import{c as j}from"../packem_shared/utils-bhneXptQ.js";import{jsx as t,jsxs as y}from"react/jsx-runtime";const ce={action:"outline",mutation:"default",query:"secondary"},q=r=>r<1e3?`${r<10?r.toFixed(1):Math.round(r).toString()}ms`:`${(r/1e3).toFixed(2)}s`,de=r=>r.calls===0?"—":r.errors===0?"0":`${r.errors.toString()} (${(r.errors/r.calls*100).toFixed(1)}%)`,me=r=>{const e=r.conflicts??0;return r.calls===0?"—":e===0?"0":`${e.toString()} (${(e/r.calls*100).toFixed(1)}%)`},ue={calls:(r,e)=>e.calls-r.calls,recent:(r,e)=>e.lastCalledAt-r.lastCalledAt,slowest:(r,e)=>e.maxDurationMs-r.maxDurationMs},Ae=r=>{const e=Q(47),{functions:I,initialShardKey:P}=r,s=ne(),{queryShardKey:F,setShardKey:N,shardKey:S}=ae(P),[o,H]=U("recent");let M;e[0]===Symbol.for("react.memo_cache_sentinel")?(M={},e[0]=M):M=e[0];let T;e[1]!==F?(T={live:!0,shardKey:F},e[1]=F,e[2]=T):T=e[2];const{data:O,error:i,errorSource:b,liveError:v}=se(oe.getFunctionStats,M,T),k=O?.functions??null;let w;e[3]!==I?(w=new Map((I??[]).map(fe)),e[3]=I,e[4]=w):w=e[4];const _=w;let E;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=C=>{H(C.currentTarget.dataset.sort)},e[5]=E):E=e[5];const z=E;let K;if(e[6]!==i||e[7]!==b||e[8]!==_||e[9]!==v||e[10]!==N||e[11]!==S||e[12]!==o||e[13]!==k||e[14]!==s){const C=k===null?[]:k.toSorted(ue[o]);let c;e[16]!==s?(c=s("Recent"),e[16]=s,e[17]=c):c=e[17];let d;e[18]!==c?(d={key:"recent",label:c},e[18]=c,e[19]=d):d=e[19];let m;e[20]!==s?(m=s("Most called"),e[20]=s,e[21]=m):m=e[21];let u;e[22]!==m?(u={key:"calls",label:m},e[22]=m,e[23]=u):u=e[23];let f;e[24]!==s?(f=s("Slowest"),e[24]=s,e[25]=f):f=e[25];let h;e[26]!==f?(h={key:"slowest",label:f},e[26]=f,e[27]=h):h=e[27];let $;e[28]!==h||e[29]!==d||e[30]!==u?($=[d,u,h],e[28]=h,e[29]=d,e[30]=u,e[31]=$):$=e[31];const D=$;let p;e[32]!==N||e[33]!==S?(p=t(G,{onChange:N,testId:"fs-shard-input",value:S}),e[32]=N,e[33]=S,e[34]=p):p=e[34];let x;e[35]!==v?(x=t(W,{message:v,prefix:"fs"}),e[35]=v,e[36]=x):x=e[36];let g;e[37]!==D||e[38]!==o?(g=t("div",{className:"ml-auto flex items-center gap-1",role:"group",children:D.map(l=>t(X,{"data-sort":l.key,"data-testid":`fs-sort-${l.key}`,onClick:z,size:"sm",type:"button",variant:o===l.key?"secondary":"ghost",children:l.label},l.key))}),e[37]=D,e[38]=o,e[39]=g):g=e[39];let A;e[40]!==p||e[41]!==x||e[42]!==g?(A=y("div",{className:"flex flex-wrap items-center gap-2",children:[p,x,g]}),e[40]=p,e[41]=x,e[42]=g,e[43]=A):A=e[43];let B;e[44]!==i||e[45]!==b?(B=i!==null&&t(V,{error:b,testId:"fs-error"}),e[44]=i,e[45]=b,e[46]=B):B=e[46],K=y("div",{className:"flex flex-col gap-4","data-testid":"lunora-function-stats",children:[A,B,k!==null&&C.length===0&&i===null&&t(ee,{description:s("Per-function call counts, error rates, and latency land here after your first request."),icon:y("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[t("path",{d:"M3 3v18h18"}),t("path",{d:"M7 14l4-4 3 3 5-6"})]}),testId:"fs-empty",title:s("No functions have run on this shard yet.")}),C.length>0&&t(Y,{className:"overflow-hidden py-0",children:t(Z,{className:"px-0",children:y(te,{"data-testid":"fs-table",children:[t(re,{children:y(L,{children:[t(a,{children:s("function")}),t(a,{children:s("kind")}),t(a,{className:"text-right",children:s("calls")}),t(a,{className:"text-right",children:s("errors")}),t(a,{className:"text-right",children:s("conflicts")}),t(a,{className:"text-right",children:s("avg")}),t(a,{className:"text-right",children:s("max")}),t(a,{children:s("last run")}),t(a,{children:s("last error")})]})}),t(le,{children:C.map(l=>{const R=_.get(l.path);return y(L,{"data-testid":`fs-row-${l.path}`,children:[t(n,{className:"font-medium",children:l.path}),t(n,{children:R===void 0?t("span",{className:"text-muted-foreground",children:"—"}):t(J,{variant:ce[R],children:R})}),t(n,{className:"text-right tabular-nums",children:l.calls}),t(n,{className:j("text-right tabular-nums",l.errors>0&&"text-destructive"),children:de(l)}),t(n,{className:j("text-right tabular-nums",(l.conflicts??0)>0&&"text-warning"),children:me(l)}),t(n,{className:"text-right tabular-nums",children:l.calls===0?"—":q(l.totalDurationMs/l.calls)}),t(n,{className:"text-right tabular-nums",children:l.calls===0?"—":q(l.maxDurationMs)}),t(n,{className:"text-muted-foreground",children:ie(l.lastCalledAt,"—")}),t(n,{className:"max-w-[24ch] truncate text-destructive",title:l.lastErrorMessage??void 0,children:l.lastErrorMessage??t("span",{className:"text-muted-foreground",children:"—"})})]},l.path)})})]})})})]}),e[6]=i,e[7]=b,e[8]=_,e[9]=v,e[10]=N,e[11]=S,e[12]=o,e[13]=k,e[14]=s,e[15]=K}else K=e[15];return K};function fe(r){return[r.path,r.kind]}export{Ae as FunctionStatsPanel};