@lunora/studio 1.0.0-alpha.19 → 1.0.0-alpha.190
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +6 -0
- package/README.md +1 -1
- package/dist/index.d.mts +1566 -0
- package/dist/index.d.ts +962 -803
- package/dist/index.mjs +1 -0
- package/dist/mount.d.mts +22 -0
- package/dist/mount.d.ts +11 -10
- package/dist/mount.mjs +1 -0
- package/dist/packem_chunks/AdvisorHealthPanel.mjs +1 -0
- package/dist/packem_chunks/ApiTab.mjs +1 -0
- package/dist/packem_chunks/AuditPanel.mjs +1 -0
- package/dist/packem_chunks/DeploymentHealthPanel.mjs +1 -0
- package/dist/packem_chunks/ExportImportPanel.mjs +3 -0
- package/dist/packem_chunks/FileBrowser.mjs +4 -0
- package/dist/packem_chunks/FunctionRunner.mjs +1 -0
- package/dist/packem_chunks/FunctionStatsPanel.mjs +1 -0
- package/dist/packem_chunks/HealthPanel.mjs +1 -0
- package/dist/packem_chunks/InsightsPanel.mjs +1 -0
- package/dist/packem_chunks/LogsPanel.mjs +1 -0
- package/dist/packem_chunks/MailPanel.mjs +2 -0
- package/dist/packem_chunks/MetricsPanel.mjs +1 -0
- package/dist/packem_chunks/NotificationsPanel.mjs +1 -0
- package/dist/packem_chunks/PitrPanel.mjs +1 -0
- package/dist/packem_chunks/SchemaViewer.mjs +1 -0
- package/dist/packem_chunks/SecurityAdvisorPanel.mjs +1 -0
- package/dist/packem_chunks/SettingsPanel.mjs +1 -0
- package/dist/packem_chunks/SqlEditorPanel.mjs +8 -0
- package/dist/packem_chunks/TableEditor.mjs +1 -0
- package/dist/packem_chunks/agents-panel.mjs +1 -0
- package/dist/packem_chunks/analytics-panel.mjs +1 -0
- package/dist/packem_chunks/auth-audit-panel.mjs +1 -0
- package/dist/packem_chunks/auth-config-panel.mjs +1 -0
- package/dist/packem_chunks/auth-sessions-panel.mjs +1 -0
- package/dist/packem_chunks/containers-panel.mjs +1 -0
- package/dist/packem_chunks/dashboards-panel.mjs +1 -0
- package/dist/packem_chunks/evals-panel.mjs +1 -0
- package/dist/packem_chunks/fanout-panel.mjs +1 -0
- package/dist/packem_chunks/flags-panel.mjs +1 -0
- package/dist/packem_chunks/issues-panel.mjs +1 -0
- package/dist/packem_chunks/kv-browser.mjs +1 -0
- package/dist/packem_chunks/log-drains-panel.mjs +4 -0
- package/dist/packem_chunks/migrations-route.mjs +1 -0
- package/dist/packem_chunks/organizations-panel.mjs +1 -0
- package/dist/packem_chunks/payments-panel.mjs +1 -0
- package/dist/packem_chunks/permissions-panel.mjs +1 -0
- package/dist/packem_chunks/queues-panel.mjs +1 -0
- package/dist/packem_chunks/reactors-panel.mjs +1 -0
- package/dist/packem_chunks/rls-panel.mjs +1 -0
- package/dist/packem_chunks/schedule-panel.mjs +1 -0
- package/dist/packem_chunks/sparkline.mjs +1 -0
- package/dist/packem_chunks/storage-rules-panel.mjs +1 -0
- package/dist/packem_chunks/subscriptions-panel.mjs +1 -0
- package/dist/packem_chunks/sync-client-panel.mjs +1 -0
- package/dist/packem_chunks/traces-panel.mjs +1 -0
- package/dist/packem_chunks/users-panel.mjs +1 -0
- package/dist/packem_chunks/vector-browser.mjs +1 -0
- package/dist/packem_chunks/workflows-panel.mjs +1 -0
- package/dist/packem_shared/ADMIN_FUNCTIONS-B8yyk5BX.mjs +1 -0
- package/dist/packem_shared/ApiDocsPanel-BImfQhyJ.mjs +2 -0
- package/dist/packem_shared/ApiReferencePanel-CigvHhCa.mjs +1 -0
- package/dist/packem_shared/CommandPalette-CSdz9zax.mjs +1 -0
- package/dist/packem_shared/ConfirmButton-DU4p72Er.mjs +1 -0
- package/dist/packem_shared/ConnectionBadge-B8Hj5DaE.mjs +1 -0
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-DuULO4XM.mjs +1 -0
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-D5YMT0gM.mjs +1 -0
- package/dist/packem_shared/DEFAULT_LOCALE-A1Yg5ORA.mjs +1 -0
- package/dist/packem_shared/DataBrowser-zqK4s0IE.mjs +4 -0
- package/dist/packem_shared/DataFilters-Cocu-WWE.mjs +1 -0
- package/dist/packem_shared/ErrorBoundary-BWNF98VF.mjs +1 -0
- package/dist/packem_shared/GlobalDataBrowser-BTbqR6Wc.mjs +1 -0
- package/dist/packem_shared/HomePanel-_BwLI4TQ.mjs +1 -0
- package/dist/packem_shared/MigrationsPanel-BPWzFdxC.mjs +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-C6CM791D.mjs +1 -0
- package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.mjs +1 -0
- package/dist/packem_shared/ScheduledJobs-B4DPADwk.mjs +1 -0
- package/dist/packem_shared/ShardInput-C6mjgAh4.mjs +1 -0
- package/dist/packem_shared/Studio-CcWQdYrV.mjs +1 -0
- package/dist/packem_shared/StudioApp-fYFz6zZQ.mjs +1 -0
- package/dist/packem_shared/StudioI18nProvider-fVsCSs5L.mjs +1 -0
- package/dist/packem_shared/advisor-view-CPgOok_h.mjs +1 -0
- package/dist/packem_shared/aggregateMetrics-CY05xrYU.mjs +1 -0
- package/dist/packem_shared/alert-PB5W11MM.mjs +1 -0
- package/dist/packem_shared/app.d-BbmO2HA2.d.mts +301 -0
- package/dist/packem_shared/app.d-BbmO2HA2.d.ts +301 -0
- package/dist/packem_shared/badge-r_5B4LHP.mjs +1 -0
- package/dist/packem_shared/bar-chart-BCsEIQoQ.mjs +6 -0
- package/dist/packem_shared/browser-storage-BH1MxLZs.mjs +1 -0
- package/dist/packem_shared/button-q0UYSmrn.mjs +1 -0
- package/dist/packem_shared/card--2hKx4L2.mjs +1 -0
- package/dist/packem_shared/cf-links-CBJ5SywP.mjs +1 -0
- package/dist/packem_shared/checkbox-CnS9cyCz.mjs +1 -0
- package/dist/packem_shared/control-button-BOZ5K-FC.mjs +1 -0
- package/dist/packem_shared/data-grid-DTBAKZlm.mjs +1 -0
- package/dist/packem_shared/data-view-params-qoSTqjAj.mjs +1 -0
- package/dist/packem_shared/dropdown-menu-jLZenfWH.mjs +2 -0
- package/dist/packem_shared/empty-state-D7jEML_T.mjs +1 -0
- package/dist/packem_shared/error-alert-tf5zvSLV.mjs +1 -0
- package/dist/packem_shared/grid-features-Dm80ngyR.mjs +6 -0
- package/dist/packem_shared/home-panel-DCUKd8Uk.mjs +3 -0
- package/dist/packem_shared/input-CXhxesPC.mjs +1 -0
- package/dist/packem_shared/internal-B6haJbiP.mjs +2 -0
- package/dist/packem_shared/label-DKFzyHq6.mjs +1 -0
- package/dist/packem_shared/live-status-BuJdUZFU.mjs +1 -0
- package/dist/packem_shared/log-fields-SBxKyBug.mjs +1 -0
- package/dist/packem_shared/log-line-BoObzuue.mjs +1 -0
- package/dist/packem_shared/modal-shell-CDztwLnv.mjs +1 -0
- package/dist/packem_shared/operation-console-provider-DoloEvon.mjs +1 -0
- package/dist/packem_shared/recording-client-BXUIyBL4.mjs +1 -0
- package/dist/packem_shared/reference-view-DiikOols.mjs +13 -0
- package/dist/packem_shared/schema-diagram-CDj_69jF.mjs +2 -0
- package/dist/packem_shared/scroll-area-CXCQH7VT.mjs +2 -0
- package/dist/packem_shared/select-DPyS18Vy.mjs +2 -0
- package/dist/packem_shared/shard-history-CaO3C4KQ.mjs +1 -0
- package/dist/packem_shared/shortcuts-B9gDaXmw.mjs +1 -0
- package/dist/packem_shared/skeleton-DX1gfixl.mjs +1 -0
- package/dist/packem_shared/sparkline-B_sPPO_8.mjs +1 -0
- package/dist/packem_shared/sql-result-table-C5y0jwaK.mjs +1 -0
- package/dist/packem_shared/stat-card-D0Fe04cX.mjs +1 -0
- package/dist/packem_shared/storage-tier-C2mKwYRj.mjs +1 -0
- package/dist/packem_shared/studio-OqNyRY1N.mjs +2 -0
- package/dist/packem_shared/table-D0SBiDu-.mjs +2 -0
- package/dist/packem_shared/table-list-sidebar-DHG1UJC4.mjs +1 -0
- package/dist/packem_shared/textarea--40GKAyz.mjs +1 -0
- package/dist/packem_shared/trace-handoff-BV3EWqy_.mjs +1 -0
- package/dist/packem_shared/use-admin-query-BKXiqLci.mjs +1 -0
- package/dist/packem_shared/use-async-submit-BTr3w2-K.mjs +1 -0
- package/dist/packem_shared/use-auth-config-CuM3eJZz.mjs +1 -0
- package/dist/packem_shared/use-open-trace-BCW0c9qq.mjs +1 -0
- package/dist/packem_shared/use-shard-key-BsP3o5wT.mjs +1 -0
- package/dist/packem_shared/use-sql-assistant-BhIMDQHV.mjs +1 -0
- package/dist/packem_shared/useDebounced-DVeQ5-oW.mjs +1 -0
- package/dist/packem_shared/utils-bhneXptQ.mjs +1 -0
- package/dist/packem_shared/virtual-rect-D_j7aLxX.mjs +1 -0
- package/dist/packem_shared/wire-codec-Bk4XZGE4.mjs +1 -0
- package/dist/standalone/chunk-225VJ77I.js +1 -0
- package/dist/standalone/chunk-23C2QL7Z.js +8 -0
- package/dist/standalone/chunk-2DX5MROH.js +1 -0
- package/dist/standalone/chunk-2H24GTUC.js +1 -0
- package/dist/standalone/chunk-2URQKGWU.js +1 -0
- package/dist/standalone/chunk-35DM4JJG.js +1 -0
- package/dist/standalone/chunk-3FBLWUXD.js +1 -0
- package/dist/standalone/chunk-3GNAY2MJ.js +1 -0
- package/dist/standalone/chunk-3Q2P62UR.js +1 -0
- package/dist/standalone/chunk-46CZEK2Q.js +1 -0
- package/dist/standalone/chunk-4GTO7FL5.js +1 -0
- package/dist/standalone/chunk-4IUB2OTN.js +3 -0
- package/dist/standalone/chunk-4JLGLPWV.js +1 -0
- package/dist/standalone/chunk-4L4WTGN5.js +1 -0
- package/dist/standalone/chunk-4NRXTCX2.js +1 -0
- package/dist/standalone/chunk-4ZEL6BYL.js +1 -0
- package/dist/standalone/chunk-55754F6H.js +1 -0
- package/dist/standalone/chunk-5IHQJLV7.js +1 -0
- package/dist/standalone/chunk-5JDWLCSH.js +1 -0
- package/dist/standalone/chunk-5WJXVZMZ.js +1 -0
- package/dist/standalone/chunk-5WUSR5UW.js +1 -0
- package/dist/standalone/chunk-66UGPQVC.js +1 -0
- package/dist/standalone/chunk-6D6Z2KXU.js +1 -0
- package/dist/standalone/chunk-6UWFARCM.js +1 -0
- package/dist/standalone/chunk-6XL3S5RE.js +1 -0
- package/dist/standalone/chunk-746WMHVP.js +1 -0
- package/dist/standalone/chunk-AALNIR3V.js +14 -0
- package/dist/standalone/chunk-AAVLPU5Q.js +1 -0
- package/dist/standalone/chunk-AWHXPIXU.js +1 -0
- package/dist/standalone/chunk-B5N47BXE.js +4 -0
- package/dist/standalone/chunk-BDO4YYBB.js +6 -0
- package/dist/standalone/chunk-BLQN7VBN.js +1 -0
- package/dist/standalone/chunk-BOTGXX4H.js +1 -0
- package/dist/standalone/chunk-BXSJ3MOM.js +5 -0
- package/dist/standalone/chunk-CCRIC2PX.js +1 -0
- package/dist/standalone/chunk-CEQOKOTY.js +1 -0
- package/dist/standalone/chunk-CMA4PTV7.js +1 -0
- package/dist/standalone/chunk-CSUROWL2.js +1 -0
- package/dist/standalone/chunk-DDHH7VHP.js +1 -0
- package/dist/standalone/chunk-DX6FAHR2.js +1 -0
- package/dist/standalone/chunk-E2YWM2QN.js +1 -0
- package/dist/standalone/chunk-E7TOMONS.js +4 -0
- package/dist/standalone/chunk-EA2JKR5D.js +1 -0
- package/dist/standalone/chunk-EJYDHEAO.js +11 -0
- package/dist/standalone/chunk-EVTM6Q43.js +1 -0
- package/dist/standalone/chunk-EY7RT4YO.js +1 -0
- package/dist/standalone/chunk-F7UC63UN.js +1 -0
- package/dist/standalone/chunk-FEWMAPNI.js +1 -0
- package/dist/standalone/chunk-FKVZRPV5.js +1 -0
- package/dist/standalone/chunk-FODLDLE2.js +19 -0
- package/dist/standalone/chunk-FSRSK4LY.js +1 -0
- package/dist/standalone/chunk-GG2N7OO3.js +1 -0
- package/dist/standalone/chunk-GGPSI4ZR.js +1 -0
- package/dist/standalone/chunk-GMS77BZD.js +1 -0
- package/dist/standalone/chunk-GSVZDPHS.js +1 -0
- package/dist/standalone/chunk-H6Y5JYSG.js +1 -0
- package/dist/standalone/chunk-HEAQVSNS.js +1 -0
- package/dist/standalone/chunk-HKALXRQ5.js +1 -0
- package/dist/standalone/chunk-IHMGCHAA.js +1 -0
- package/dist/standalone/chunk-IMKTN66X.js +1 -0
- package/dist/standalone/chunk-IMOHEGMV.js +1 -0
- package/dist/standalone/chunk-IPCE6QOA.js +1 -0
- package/dist/standalone/chunk-IS6LVJ6L.js +1 -0
- package/dist/standalone/chunk-IWRLEQ72.js +1 -0
- package/dist/standalone/chunk-JTDNWSOY.js +1 -0
- package/dist/standalone/chunk-JXIPB43K.js +1 -0
- package/dist/standalone/chunk-K7AJEMKE.js +1 -0
- package/dist/standalone/chunk-KEBHEIFH.js +8 -0
- package/dist/standalone/chunk-LAT7MUQV.js +1 -0
- package/dist/standalone/chunk-LBMSRD6N.js +1 -0
- package/dist/standalone/chunk-LV2OBCJS.js +1 -0
- package/dist/standalone/chunk-LV6N3H5U.js +1 -0
- package/dist/standalone/chunk-M4XQHWSJ.js +1 -0
- package/dist/standalone/chunk-MKL7VDTL.js +15 -0
- package/dist/standalone/chunk-MRZ7CD3T.js +1 -0
- package/dist/standalone/chunk-MU3P2FI7.js +1 -0
- package/dist/standalone/chunk-MXLAOCAN.js +1 -0
- package/dist/standalone/chunk-NID5AZAR.js +1 -0
- package/dist/standalone/chunk-NZCQC5YS.js +1 -0
- package/dist/standalone/chunk-OGUKYRFM.js +1 -0
- package/dist/standalone/chunk-OKG3HWSJ.js +1 -0
- package/dist/standalone/chunk-OUDWIUT7.js +1 -0
- package/dist/standalone/chunk-P5RUFDVX.js +59 -0
- package/dist/standalone/chunk-P62LO76E.js +3 -0
- package/dist/standalone/chunk-PD6WIDY6.js +1 -0
- package/dist/standalone/chunk-PHCXSS6I.js +1 -0
- package/dist/standalone/chunk-PLHA3OWK.js +3 -0
- package/dist/standalone/chunk-Q4CAKBWN.js +1 -0
- package/dist/standalone/chunk-Q5U22R2E.js +2 -0
- package/dist/standalone/chunk-QBXHU32E.js +1 -0
- package/dist/standalone/chunk-QJNVJU5I.js +1 -0
- package/dist/standalone/chunk-QKEJLVC5.js +1 -0
- package/dist/standalone/chunk-QY766ZKO.js +1 -0
- package/dist/standalone/chunk-RFNGDE33.js +1 -0
- package/dist/standalone/chunk-RLLKECZT.js +1 -0
- package/dist/standalone/chunk-RPQL45FL.js +1 -0
- package/dist/standalone/chunk-RSDM6WG5.js +1 -0
- package/dist/standalone/chunk-S3CRZLGS.js +1 -0
- package/dist/standalone/chunk-SS2SI65S.js +1 -0
- package/dist/standalone/chunk-SSERHMYQ.js +1 -0
- package/dist/standalone/chunk-SUDJTC4S.js +1 -0
- package/dist/standalone/chunk-TACXQS76.js +1 -0
- package/dist/standalone/chunk-TIUMFAN2.js +1 -0
- package/dist/standalone/chunk-UAMGVADC.js +1 -0
- package/dist/standalone/chunk-ULIQFBZU.js +1 -0
- package/dist/standalone/chunk-USCV7TYG.js +1 -0
- package/dist/standalone/chunk-UYEZR3BI.js +1 -0
- package/dist/standalone/chunk-V3CZW3JB.js +1 -0
- package/dist/standalone/chunk-V3VJAA4D.js +1 -0
- package/dist/standalone/chunk-VTPGX4ZT.js +1 -0
- package/dist/standalone/chunk-WE3N45LG.js +1 -0
- package/dist/standalone/chunk-WQLNHY3B.js +1 -0
- package/dist/standalone/chunk-WUWBZPUK.js +1 -0
- package/dist/standalone/chunk-X74DHIA3.js +1 -0
- package/dist/standalone/chunk-XZMOZFE6.js +1 -0
- package/dist/standalone/chunk-Y6CXU7T4.js +1 -0
- package/dist/standalone/chunk-YBQUFWZB.js +1 -0
- package/dist/standalone/chunk-YHFTNPS2.js +1 -0
- package/dist/standalone/chunk-YKXDMIHQ.js +1 -0
- package/dist/standalone/chunk-YOB2X3FZ.js +1 -0
- package/dist/standalone/chunk-YPRQLCKF.js +1 -0
- package/dist/standalone/chunk-YVVP4DRM.js +1 -0
- package/dist/standalone/chunk-YWROJNX3.js +1 -0
- package/dist/standalone/chunk-ZJ4U2EWG.js +1 -0
- package/dist/standalone/studio.js +9 -378
- package/dist/styles.css +2 -2
- package/package.json +23 -20
- package/dist/index.js +0 -41
- package/dist/mount.js +0 -26
- package/dist/packem_shared/ADMIN_FUNCTIONS-CZJCZ4c7.js +0 -47
- package/dist/packem_shared/ApiDocsPanel-yEz0fiof.js +0 -842
- package/dist/packem_shared/ApiReferencePanel-1vubqG5s.js +0 -229
- package/dist/packem_shared/ApiTab-DdubReQI.js +0 -251
- package/dist/packem_shared/AuditPanel-CE5ofjCc.js +0 -200
- package/dist/packem_shared/CommandPalette-BtgkBzZI.js +0 -373
- package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
- package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
- package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
- package/dist/packem_shared/DataBrowser-DpL8U-Nf.js +0 -4475
- package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
- package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
- package/dist/packem_shared/ExportImportPanel-ChsSUCYZ.js +0 -197
- package/dist/packem_shared/FileBrowser-DsRBnVhZ.js +0 -2932
- package/dist/packem_shared/FunctionRunner-D4cZ6fuA.js +0 -343
- package/dist/packem_shared/FunctionStatsPanel-BVelWgNv.js +0 -375
- package/dist/packem_shared/GlobalDataBrowser-3X9uRfdO.js +0 -289
- package/dist/packem_shared/HealthPanel-CxUVKfvo.js +0 -648
- package/dist/packem_shared/HomePanel-tfqpZxuu.js +0 -1334
- package/dist/packem_shared/InsightsPanel-DNg3K9XN.js +0 -461
- package/dist/packem_shared/LogsPanel-B4LoSRj0.js +0 -827
- package/dist/packem_shared/MailPanel-CcpdyWYs.js +0 -440
- package/dist/packem_shared/MetricsPanel-CxoyWbNb.js +0 -1611
- package/dist/packem_shared/MigrationsPanel-DGwJGWDA.js +0 -239
- package/dist/packem_shared/OpenRpcReferencePanel-vbcYbv3V.js +0 -191
- package/dist/packem_shared/PitrPanel-CKUzyyHi.js +0 -252
- package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
- package/dist/packem_shared/ScheduledJobs-BWNwIN3I.js +0 -262
- package/dist/packem_shared/SchemaViewer-RclXFo9Q.js +0 -2512
- package/dist/packem_shared/SecurityAdvisorPanel-Dqql1Z5O.js +0 -92
- package/dist/packem_shared/SettingsPanel-D5iTY0YE.js +0 -390
- package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
- package/dist/packem_shared/SqlEditorPanel-Dj-In-B3.js +0 -13
- package/dist/packem_shared/Studio-VWvKNOw4.js +0 -33
- package/dist/packem_shared/StudioApp-BhQ6T2pn.js +0 -657
- package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
- package/dist/packem_shared/TableEditor-BY8bTpCl.js +0 -11
- package/dist/packem_shared/advisor-view-CGcfMiPq.js +0 -159
- package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
- package/dist/packem_shared/app.d-BVJFkXyj.d.ts +0 -300
- package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
- package/dist/packem_shared/bar-chart-CzJAgqkp.js +0 -3245
- package/dist/packem_shared/button-BhsN2uZH.js +0 -49
- package/dist/packem_shared/card-DURq3ElK.js +0 -175
- package/dist/packem_shared/cf-links-2cktDedA.js +0 -8
- package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
- package/dist/packem_shared/data-grid-B5CaV3wS.js +0 -183
- package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
- package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
- package/dist/packem_shared/grid-features-CzUfqgsM.js +0 -840
- package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
- package/dist/packem_shared/internal-rXJEAhXS.js +0 -68
- package/dist/packem_shared/label-D8ykjn5J.js +0 -46
- package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
- package/dist/packem_shared/reference-view-B4E49Lip.js +0 -2180
- package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
- package/dist/packem_shared/sparkline-10dG-_f0.js +0 -93
- package/dist/packem_shared/sql-editor-panel-CMdxstu5.js +0 -2562
- package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
- package/dist/packem_shared/studio-D8ry3tJR.js +0 -11043
- package/dist/packem_shared/table-_RzNvy3R.js +0 -246
- package/dist/packem_shared/table-editor-CWx68ZCg.js +0 -407
- package/dist/packem_shared/table-list-sidebar-Bg7uzbvC.js +0 -832
- package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
- package/dist/packem_shared/use-admin-query-BkbdNFNz.js +0 -105
- package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
- package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
- package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as O}from"react/compiler-runtime";import{LunoraClient as G}from"@lunora/client";import{LunoraProvider as H}from"@lunora/react";import{useState as B,useEffect as $}from"react";import{ErrorBoundary as z}from"./ErrorBoundary-BWNF98VF.mjs";import{u as U,B as V,T as Y,a as q,S as J}from"./studio-OqNyRY1N.mjs";import Q from"./useDebounced-DVeQ5-oW.mjs";import{useT as j,createStudioI18n as X}from"./DEFAULT_LOCALE-A1Yg5ORA.mjs";import{StudioI18nProvider as D}from"./StudioI18nProvider-fVsCSs5L.mjs";import{r as Z}from"./internal-B6haJbiP.mjs";import{w as R}from"./recording-client-BXUIyBL4.mjs";import F from"./STUDIO_ROOT_CLASS-C6MccdVk.mjs";import{a as K}from"./browser-storage-BH1MxLZs.mjs";import{c as W}from"./utils-bhneXptQ.mjs";import{B as ee}from"./button-q0UYSmrn.mjs";import{I as te}from"./input-CXhxesPC.mjs";import{jsx as m,jsxs as P}from"react/jsx-runtime";const L="lunora-studio-admin-token",oe=()=>{try{return K("session")?.getItem(L)??""}catch{return""}},ne=u=>{const e=K("session");if(e!==void 0)try{u===""?e.removeItem(L):e.setItem(L,u)}catch{}},se="/_lunora/admin/ws-token",ie=1e4,re=u=>{const e=u;return typeof e?.token=="string"&&e.token.length>0&&typeof e.expiresAtMs=="number"},le=u=>{const{adminToken:e,baseUrl:d}=u,o=u.fetchImpl??fetch;let r=d;for(;r.endsWith("/");)r=r.slice(0,-1);const l=`${r}${se}`;let t,n=!1,s;const a=async()=>{const c=await o(l,{headers:{authorization:`Bearer ${e}`},method:"POST"});if(c.status===404||c.status===405)return n=!0,e;if(!c.ok)throw new Error(`ws-token mint failed: ${String(c.status)}`);const i=await c.json().catch(()=>{});if(!re(i))throw new Error("ws-token mint failed: malformed response body");return t=i,i.token};return{getToken:async()=>n?e:t!==void 0&&t.expiresAtMs-ie>Date.now()?t.token:(s??=a().finally(()=>{s=void 0}),s),invalidate:()=>{t=void 0,n=!1}}},ae=u=>{const e=O(42),{onSubmit:d}=u,o=j(),[r,l]=B("");let t;e[0]!==r?(t=r.trim(),e[0]=r,e[1]=t):t=e[1];const n=t;let s;e[2]!==d||e[3]!==n?(s=_=>{_.preventDefault(),n!==""&&d(n)},e[2]=d,e[3]=n,e[4]=s):s=e[4];const a=s;let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=m("div",{className:"h-10 w-10 text-foreground",children:m(V,{})}),e[5]=c):c=e[5];let i;e[6]!==o?(i=o("Connect to Lunora Studio"),e[6]=o,e[7]=i):i=e[7];let v;e[8]!==i?(v=m("h1",{className:"text-base font-semibold text-foreground",children:i}),e[8]=i,e[9]=v):v=e[9];let k;e[10]!==o?(k=o("Enter your admin token to access the studio."),e[10]=o,e[11]=k):k=e[11];let p;e[12]!==k?(p=m("p",{className:"text-[13px] text-muted-foreground",children:k}),e[12]=k,e[13]=p):p=e[13];let h;e[14]!==v||e[15]!==p?(h=P("div",{className:"flex flex-col items-center gap-3 text-center",children:[c,P("div",{className:"flex flex-col gap-1",children:[v,p]})]}),e[14]=v,e[15]=p,e[16]=h):h=e[16];let g;e[17]!==o?(g=o("admin token"),e[17]=o,e[18]=g):g=e[18];let f;e[19]!==g?(f=m("label",{className:"text-xs font-medium text-foreground",htmlFor:"lunora-studio-login-token",children:g}),e[19]=g,e[20]=f):f=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=_=>{l(_.target.value)},e[21]=b):b=e[21];let x;e[22]!==r?(x=m(te,{autoComplete:"off",autoFocus:!0,"data-testid":"lunora-studio-login-token",id:"lunora-studio-login-token",onChange:b,placeholder:"LUNORA_ADMIN_TOKEN",type:"password",value:r}),e[22]=r,e[23]=x):x=e[23];let T;e[24]!==o?(T=o("From your worker's LUNORA_ADMIN_TOKEN — your project's .dev.vars in dev, or a deployment secret in production."),e[24]=o,e[25]=T):T=e[25];let I;e[26]!==T?(I=m("p",{className:"text-[11px] text-muted-foreground",children:T}),e[26]=T,e[27]=I):I=e[27];let S;e[28]!==f||e[29]!==x||e[30]!==I?(S=P("div",{className:"flex flex-col gap-1.5",children:[f,x,I]}),e[28]=f,e[29]=x,e[30]=I,e[31]=S):S=e[31];const E=n==="";let y;e[32]!==o?(y=o("Connect"),e[32]=o,e[33]=y):y=e[33];let w;e[34]!==E||e[35]!==y?(w=m(ee,{"data-testid":"lunora-studio-login-submit",disabled:E,type:"submit",children:y}),e[34]=E,e[35]=y,e[36]=w):w=e[36];let N;return e[37]!==a||e[38]!==S||e[39]!==w||e[40]!==h?(N=P("form",{className:"flex w-full max-w-sm flex-col gap-5 rounded-xl border border-border bg-card p-7 shadow-lg","data-testid":"lunora-studio-login",onSubmit:a,children:[h,S,w]}),e[37]=a,e[38]=S,e[39]=w,e[40]=h,e[41]=N):N=e[41],N},de=u=>{const e=O(10),{i18n:d,onSubmit:o}=u,{resolvedTheme:r}=U(),l=r==="dark"&&"dark";let t;e[0]!==l?(t=W(F,l,"flex h-dvh items-center justify-center bg-sidebar p-6 text-sm text-foreground"),e[0]=l,e[1]=t):t=e[1];let n;e[2]!==o?(n=m(ae,{onSubmit:o}),e[2]=o,e[3]=n):n=e[3];let s;e[4]!==d||e[5]!==n?(s=m(D,{i18n:d,children:n}),e[4]=d,e[5]=n,e[6]=s):s=e[6];let a;return e[7]!==t||e[8]!==s?(a=m("div",{className:t,"data-testid":"lunora-studio-login-root",children:s}),e[7]=t,e[8]=s,e[9]=a):a=e[9],a},ce=u=>{const e=O(15),{basePath:d,chrome:o,studio:r}=u,l=j();let t;e[0]!==l?(t=l("Studio failed"),e[0]=l,e[1]=t):t=e[1];let n;e[2]!==l?(n=l("Studio"),e[2]=l,e[3]=n):n=e[3];let s;e[4]!==l?(s=l("Try again"),e[4]=l,e[5]=s):s=e[5];let a;e[6]!==d||e[7]!==o||e[8]!==r?(a=m(J,{...r,basePath:d,chrome:o}),e[6]=d,e[7]=o,e[8]=r,e[9]=a):a=e[9];let c;return e[10]!==t||e[11]!==n||e[12]!==s||e[13]!==a?(c=m(z,{fallbackTitle:t,label:n,retryLabel:s,children:a}),e[10]=t,e[11]=n,e[12]=s,e[13]=a,e[14]=c):c=e[14],c},fe=u=>{const e=O(20),{basePath:d,clearToken:o,client:r,i18n:l,onTokenChange:t,rulesInstalled:n,studio:s,token:a}=u,{resolvedTheme:c}=U();let i;e[0]!==o||e[1]!==t||e[2]!==n||e[3]!==a?(i={clearToken:o,onTokenChange:t,rulesInstalled:n,token:a},e[0]=o,e[1]=t,e[2]=n,e[3]=a,e[4]=i):i=e[4];const v=i,k=c==="dark"&&"dark";let p;e[5]!==k?(p=W(F,k,"flex h-dvh flex-col overflow-hidden bg-sidebar text-sm text-foreground"),e[5]=k,e[6]=p):p=e[6];let h;e[7]!==d||e[8]!==v||e[9]!==s?(h=m(q,{children:m(ce,{basePath:d,chrome:v,studio:s})}),e[7]=d,e[8]=v,e[9]=s,e[10]=h):h=e[10];let g;e[11]!==l||e[12]!==h?(g=m(D,{i18n:l,children:h}),e[11]=l,e[12]=h,e[13]=g):g=e[13];let f;e[14]!==r||e[15]!==g?(f=m(H,{client:r,children:g}),e[14]=r,e[15]=g,e[16]=f):f=e[16];let b;return e[17]!==p||e[18]!==f?(b=m("div",{className:p,"data-testid":"lunora-studio-app",children:f}),e[17]=p,e[18]=f,e[19]=b):b=e[19],b},Ee=u=>{const e=O(28);let d;e[0]!==u?(d=u===void 0?{}:u,e[0]=u,e[1]=d):d=e[1];const{adminToken:o,basePath:r,baseUrl:l,client:t,rulesInstalled:n,studio:s,locale:a}=d;let c;e[2]!==o?(c=()=>o??oe(),e[2]=o,e[3]=c):c=e[3];const[i,v]=B(c);let k,p;e[4]!==i?(k=()=>{ne(i)},p=[i],e[4]=i,e[5]=k,e[6]=p):(k=e[5],p=e[6]),$(k,p);const h=Q(i,300,i==="");let g;e:{if(t!==void 0){let A;e[7]!==t?(A=R(t),e[7]=t,e[8]=A):A=e[8],g=A;break e}let _;if(e[9]!==l||e[10]!==h){const A=Z(l),M=h===""?void 0:le({adminToken:h,baseUrl:A}),C=new G({url:A,...M===void 0?{}:{wsToken:M.getToken}});M!==void 0&&(C.setAuthToken(h),C.onTokenExpired(M.invalidate)),_=R(C),e[9]=l,e[10]=h,e[11]=_}else _=e[11];g=_}const f=g;let b,x;e[12]!==f||e[13]!==t?(b=()=>()=>{t===void 0&&f.close()},x=[f,t],e[12]=f,e[13]=t,e[14]=b,e[15]=x):(b=e[14],x=e[15]),$(b,x);let T;e[16]===Symbol.for("react.memo_cache_sentinel")?(T=_=>{v(_.target.value)},e[16]=T):T=e[16];const I=T;let S;e[17]===Symbol.for("react.memo_cache_sentinel")?(S=()=>{v("")},e[17]=S):S=e[17];const E=S;let y;e[18]!==a?(y=X(a),e[18]=a,e[19]=y):y=e[19];const w=y;let N;return e[20]!==r||e[21]!==f||e[22]!==w||e[23]!==t||e[24]!==n||e[25]!==s||e[26]!==i?(N=m(Y,{children:i===""&&t===void 0?m(de,{i18n:w,onSubmit:v}):m(fe,{basePath:r,clearToken:E,client:f,i18n:w,onTokenChange:I,rulesInstalled:n,studio:s,token:i})}),e[20]=r,e[21]=f,e[22]=w,e[23]=t,e[24]=n,e[25]=s,e[26]=i,e[27]=N):N=e[27],N};export{Ee as StudioApp};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as u}from"react/compiler-runtime";import{studioI18n as f,createStudioI18n as l,StudioI18nContext as m}from"./DEFAULT_LOCALE-A1Yg5ORA.mjs";import{jsx as v}from"react/jsx-runtime";const I=(e,t,o)=>e!==void 0?e:t===void 0&&o===void 0?f:l(t,o),S=e=>{const t=u(7),{catalogs:o,children:i,i18n:s,locale:c}=e;let r;t[0]!==o||t[1]!==s||t[2]!==c?(r=I(s,c,o),t[0]=o,t[1]=s,t[2]=c,t[3]=r):r=t[3];const d=r;let n;return t[4]!==i||t[5]!==d?(n=v(m,{value:d,children:i}),t[4]=i,t[5]=d,t[6]=n):n=t[6],n};export{S as StudioI18nProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useState as g}from"react";import{E as x}from"./error-alert-tf5zvSLV.mjs";import{C as N,a as y}from"./card--2hKx4L2.mjs";import{T as v,a as T,b as d,c as m,d as w,e as l}from"./table-D0SBiDu-.mjs";import{useT as E}from"./DEFAULT_LOCALE-A1Yg5ORA.mjs";import{c as L}from"./utils-bhneXptQ.mjs";import{jsxs as o,jsx as t}from"react/jsx-runtime";const C={ERROR:"error",INFO:"info",WARN:"warning"},z=e=>{const a=typeof e.metadata.table=="string"?e.metadata.table:void 0;return{description:`${e.detail} ${e.remediation}`,entity:a,issueType:e.title,key:e.cacheKey,level:C[e.level]}},R=["error","warning","info"],A={error:"bg-destructive",info:"bg-info",warning:"bg-warning"},$=(e,a)=>({error:e("Errors"),info:e("Info"),warning:e("Warnings")})[a],k=(e,a,n)=>({error:e("{count} errors",{count:n}),info:e("{count} suggestions",{count:n}),warning:e("{count} warnings",{count:n})})[a],V=(e,a)=>({error:e("No errors detected"),info:e("No suggestions"),warning:e("No warnings detected")})[a],O=e=>{const a={error:0,info:0,warning:0};for(const n of e??[])a[n.level]+=1;return a},F=({error:e=null,errorSource:a,rows:n,testId:i,toolbar:p})=>{const s=E(),[c,f]=g("error"),b=O(n),u=(n??[]).filter(r=>r.level===c),h=r=>{f(r.currentTarget.dataset.level)};return o("div",{className:"flex flex-col gap-3","data-testid":i,children:[t("div",{className:"flex border-b border-border",role:"tablist",children:R.map(r=>o("button",{"aria-selected":c===r,className:"flex min-w-32 flex-col gap-0.5 border-b-2 border-transparent px-4 py-2 text-start outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40 aria-selected:border-foreground","data-level":r,"data-testid":`${i}-tab-${r}`,onClick:h,role:"tab",type:"button",children:[o("span",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[t("span",{"aria-hidden":"true",className:L("size-2 rounded-sm",A[r])}),$(s,r)]}),t("span",{className:"ps-4 text-xs text-muted-foreground",children:k(s,r,b[r])})]},r))}),p!==void 0&&t("div",{className:"flex flex-wrap items-center gap-2",children:p}),e!==null&&t(x,{error:a??e,testId:`${i}-error`}),t(N,{className:"overflow-hidden py-0",children:t(y,{className:"px-0",children:o(v,{children:[t(T,{children:o(d,{children:[t(m,{children:s("Issue type")}),t(m,{children:s("Entity/item")}),t(m,{children:s("Description")})]})}),t(w,{children:u.length===0?t(d,{children:o(l,{className:"h-40 text-center align-middle text-muted-foreground",colSpan:3,"data-testid":`${i}-empty`,children:[t("span",{className:"block text-sm font-medium text-foreground",children:V(s,c)}),t("span",{className:"block text-sm",children:s("Nothing to report for this deployment.")})]})}):u.map(r=>o(d,{children:[t(l,{className:"font-medium text-foreground",children:r.issueType}),t(l,{className:"font-mono text-xs text-muted-foreground",children:r.entity??"—"}),o(l,{className:"text-muted-foreground",children:[t("span",{children:r.description}),r.action!==void 0&&t("span",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:r.action})]})]},r.key))})]})})})]})};export{F as A,z as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const u=t=>{let e=0,c=0,s=0,n=0,r=0,i=0,a=0;for(const{metrics:o}of t){if(o===null){r+=1;continue}n+=1,e+=o.requests,c+=o.errors,s+=o.databaseSize??0,o.cache&&(i+=o.cache.hits,a+=o.cache.hits+o.cache.misses)}return{failed:r,hitRate:a===0?null:i/a,reachable:n,totalDatabaseSize:s,totalErrors:c,totalRequests:e}},h=(t,e)=>{const c=new Set,s=[];for(const n of["",t.trim(),...e])c.has(n)||(c.add(n),s.push(n));return s},l=(t,e)=>{if(t.length===0)return 0;if(t.sort((s,n)=>s-n),e<=0)return t[0]??0;if(e>=100)return t.at(-1)??0;const c=Math.ceil(e/100*t.length)-1;return t[c]??0},f=t=>{const c=t.functions;if(!c||c.length===0)return{p90:0,p95:0};const s=1e3,n=[];for(const r of c){if(r.calls<=0)continue;const i=r.totalDurationMs/r.calls,a=Math.min(r.calls,s);for(let o=0;o<a;o+=1)n.push(i)}return n.length===0?{p90:0,p95:0}:{p90:l([...n],90),p95:l([...n],95)}},p=(t,e,c="neutral")=>{const s=e-t,n=t===0?null:s/t*100;return{delta:s,direction:c,pct:n}},g=t=>t.map(e=>({...e,avgDurationMs:e.execCount>0?e.totalDurationMs/e.execCount:0}));export{u as aggregateMetrics,p as computeDelta,f as computeLatencyPercentiles,g as enrichQueryStats,l as percentile,h as shardsToAggregate};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as l}from"react/compiler-runtime";import{cva as c}from"class-variance-authority";import{c as v}from"./utils-bhneXptQ.mjs";import{jsx as f,jsxs as b}from"react/jsx-runtime";const u=c("flex items-start gap-2 rounded-md border px-3 py-2 text-sm [&>svg]:mt-0.5 [&>svg]:size-4 [&>svg]:shrink-0",{defaultVariants:{variant:"default"},variants:{variant:{default:"border-border bg-muted/40 text-foreground",destructive:"border-destructive/40 bg-destructive/5 text-destructive",warning:"border-amber-500/40 bg-amber-500/5 text-amber-700 dark:text-amber-400"}}}),N=n=>{const t=l(10),{children:s,className:i,icon:d,testId:o,variant:m}=n;let e;t[0]!==i||t[1]!==m?(e=v(u({variant:m}),i),t[0]=i,t[1]=m,t[2]=e):e=t[2];let r;t[3]!==s?(r=f("div",{className:"min-w-0 flex-1",children:s}),t[3]=s,t[4]=r):r=t[4];let a;return t[5]!==d||t[6]!==e||t[7]!==r||t[8]!==o?(a=b("div",{className:e,"data-testid":o,role:"alert",children:[d,r]}),t[5]=d,t[6]=e,t[7]=r,t[8]=o,t[9]=a):a=t[9],a};export{N as A};
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { CronJobInfo, ScheduleRecord, LunoraClient } from '@lunora/client';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
import { I18n } from '@lingui/core';
|
|
4
|
+
import { AnalyticsSqlResult } from '@lunora/bindings/analytics';
|
|
5
|
+
interface AnalyticsPanelProps {
|
|
6
|
+
/**
|
|
7
|
+
* Dataset name to query (the `analytics_engine_datasets[].dataset`, default
|
|
8
|
+
* `ANALYTICS` — the value the config layer reconciles).
|
|
9
|
+
*/
|
|
10
|
+
readonly dataset?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Run one Analytics Engine SQL statement and resolve its result. The panel has
|
|
13
|
+
* no default: the AE SQL API authenticates with an **account-scoped Cloudflare
|
|
14
|
+
* API token**, and a browser bundle is the last place that may hold one. The
|
|
15
|
+
* host supplies a runner that proxies the statement through its own worker
|
|
16
|
+
* (thread it in as `StudioProps.analyticsQuery`); with none, the panel renders
|
|
17
|
+
* an empty state and makes no network call.
|
|
18
|
+
*/
|
|
19
|
+
readonly runQuery?: (sql: string) => Promise<AnalyticsSqlResult>;
|
|
20
|
+
}
|
|
21
|
+
interface CronTriggersPanelProps {
|
|
22
|
+
/**
|
|
23
|
+
* Load the code-defined cron triggers. Defaults to `client.getCronJobs`,
|
|
24
|
+
* which hits the worker's admin-gated `/_lunora/admin/cron-jobs` endpoint —
|
|
25
|
+
* so the panel works out of the box under `<LunoraProvider>`, provided the
|
|
26
|
+
* worker is built with a `cronJobs` map and `adminToken`. Override it to
|
|
27
|
+
* source triggers from elsewhere (e.g. tests).
|
|
28
|
+
*/
|
|
29
|
+
readonly loadCronJobs?: () => Promise<CronJobInfo[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Manually fire one cron job by name. Defaults to `client.runCronJob`, which
|
|
32
|
+
* hits the admin-gated `POST /_lunora/admin/cron-jobs/run` endpoint (the same
|
|
33
|
+
* dispatch the scheduled trigger runs). When a custom {@link CronTriggersPanelProps.loadCronJobs}
|
|
34
|
+
* is supplied without a `runCronJob`, the "Run now" control is hidden — useful
|
|
35
|
+
* for a read-only view.
|
|
36
|
+
*/
|
|
37
|
+
readonly runCronJob?: (name: string) => Promise<{
|
|
38
|
+
name: string;
|
|
39
|
+
ran: boolean;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
42
|
+
interface ScheduledJobsProps {
|
|
43
|
+
/**
|
|
44
|
+
* Cancel a pending job by id. Defaults to `client.cancelScheduledJob` when
|
|
45
|
+
* {@link ScheduledJobsProps.loadJobs} is also left to the client. When a
|
|
46
|
+
* custom `loadJobs` is supplied without a `cancelJob`, the cancel control is
|
|
47
|
+
* hidden — useful for a read-only view.
|
|
48
|
+
*/
|
|
49
|
+
readonly cancelJob?: (id: string) => Promise<{
|
|
50
|
+
cancelled: boolean;
|
|
51
|
+
}>;
|
|
52
|
+
/**
|
|
53
|
+
* Load the pending scheduled jobs. Defaults to `client.listScheduledJobs`,
|
|
54
|
+
* which hits the worker's admin-gated `/_lunora/admin/scheduled` endpoint —
|
|
55
|
+
* so the panel works out of the box under `<LunoraProvider>`, provided the
|
|
56
|
+
* worker is built with a `schedulerDO` namespace and `adminToken`. Override
|
|
57
|
+
* it to source jobs from elsewhere.
|
|
58
|
+
*/
|
|
59
|
+
readonly loadJobs?: () => Promise<ScheduleRecord[]>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* View — and cancel — the functions queued via `runAfter` / `runAt` on the
|
|
63
|
+
* scheduler. Cron *triggers* are static wrangler config and don't appear here;
|
|
64
|
+
* this lists the dynamic, in-flight schedule only.
|
|
65
|
+
*
|
|
66
|
+
* Works out of the box under `<LunoraProvider>` via the client's scheduler
|
|
67
|
+
* admin methods; pass {@link ScheduledJobsProps.loadJobs} /
|
|
68
|
+
* {@link ScheduledJobsProps.cancelJob} to override the transport.
|
|
69
|
+
*/
|
|
70
|
+
declare const ScheduledJobs: ({ cancelJob, loadJobs }?: ScheduledJobsProps) => ReactElement;
|
|
71
|
+
interface SchedulePanelProps {
|
|
72
|
+
/** Override how the Cron triggers sub-view loads triggers; see {@link CronTriggersPanel}. */
|
|
73
|
+
readonly loadCronJobs?: CronTriggersPanelProps["loadCronJobs"];
|
|
74
|
+
/** Override how the Scheduled jobs sub-view cancels a job; see {@link ScheduledJobs}. */
|
|
75
|
+
readonly scheduledCancel?: ScheduledJobsProps["cancelJob"];
|
|
76
|
+
/** Override how the Scheduled jobs sub-view loads jobs; see {@link ScheduledJobs}. */
|
|
77
|
+
readonly scheduledLoad?: ScheduledJobsProps["loadJobs"];
|
|
78
|
+
}
|
|
79
|
+
/** Which client method a {@link FunctionDescriptor} is invoked through. */
|
|
80
|
+
type FunctionKind = "action" | "mutation" | "query";
|
|
81
|
+
/**
|
|
82
|
+
* One argument of a registered function, derived from its `v.*` validator by the
|
|
83
|
+
* worker's `/_lunora/admin/functions` endpoint. A compact signature shape.
|
|
84
|
+
*/
|
|
85
|
+
interface FunctionArgumentDescriptor {
|
|
86
|
+
/** Element validator kind for an `array` arg (one level), e.g. `string`. */
|
|
87
|
+
element?: string;
|
|
88
|
+
/** The (optional-unwrapped) validator kind, e.g. `string`, `id`, `object`. */
|
|
89
|
+
kind: string;
|
|
90
|
+
/** The argument name. */
|
|
91
|
+
name: string;
|
|
92
|
+
/** True when the arg is wrapped in `v.optional(...)`. */
|
|
93
|
+
optional: boolean;
|
|
94
|
+
/** Target table for an `id` arg (`v.id("table")`). */
|
|
95
|
+
table?: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Runtime descriptor for a registered Lunora function. The function's `kind` is
|
|
99
|
+
* a compile-time-only phantom on `FunctionReference`, so the runner needs it
|
|
100
|
+
* spelled out here to know which client method to call. `args` carries the
|
|
101
|
+
* function's argument signature (absent on responses from an older worker).
|
|
102
|
+
*/
|
|
103
|
+
interface FunctionDescriptor {
|
|
104
|
+
args?: FunctionArgumentDescriptor[];
|
|
105
|
+
kind: FunctionKind;
|
|
106
|
+
/** The `<file>:<function>` identifier, e.g. `messages:list`. */
|
|
107
|
+
path: string;
|
|
108
|
+
}
|
|
109
|
+
/** Outcome of a single `FunctionRunner` invocation. */
|
|
110
|
+
type RunStatus = "error" | "idle" | "running" | "success";
|
|
111
|
+
interface StudioProps {
|
|
112
|
+
/**
|
|
113
|
+
* Run one Analytics Engine SQL statement for the Analytics tab. There is no
|
|
114
|
+
* default: the AE SQL API authenticates with an account-scoped Cloudflare API
|
|
115
|
+
* token, and inlining one into this browser bundle would leak it to anyone who
|
|
116
|
+
* views source. Supply a runner that proxies the statement through your own
|
|
117
|
+
* worker (which holds the token server-side). Without it the Analytics tab
|
|
118
|
+
* renders an empty state and issues no request.
|
|
119
|
+
*
|
|
120
|
+
* Pass a STABLE reference — a module-level function, or one held in a
|
|
121
|
+
* `useCallback`/ref. It is read while building the tab router, so a fresh
|
|
122
|
+
* inline arrow on every render rebuilds the router and remounts the panel
|
|
123
|
+
* tree, losing in-progress query state. The same holds for `scheduledLoad`,
|
|
124
|
+
* `scheduledCancel` and `scheduledCron`.
|
|
125
|
+
*/
|
|
126
|
+
readonly analyticsQuery?: AnalyticsPanelProps["runQuery"];
|
|
127
|
+
/**
|
|
128
|
+
* URL path prefix the studio is mounted under, passed to the router as its
|
|
129
|
+
* `basepath`. Defaults to `/` (mounted at the origin root). The `@lunora/vite`
|
|
130
|
+
* dev route serves the studio under `/__lunora`, so it sets this — without
|
|
131
|
+
* it the router treats `/__lunora` as unknown and bounces to `/data`, escaping
|
|
132
|
+
* the mount.
|
|
133
|
+
*/
|
|
134
|
+
readonly basePath?: string;
|
|
135
|
+
/**
|
|
136
|
+
* App-owned top-bar + sidebar-footer chrome (theme toggle, admin-token
|
|
137
|
+
* popover, rules banner). The batteries-included `StudioApp` supplies
|
|
138
|
+
* this; composing `<Studio>` bare omits those affordances. See {@link StudioChrome}.
|
|
139
|
+
*/
|
|
140
|
+
readonly chrome?: StudioChrome;
|
|
141
|
+
/**
|
|
142
|
+
* Show the data tab's write controls (insert/edit/delete rows). Off by
|
|
143
|
+
* default; see {@link TableEditor}.
|
|
144
|
+
*
|
|
145
|
+
* **This HIDES THE CONTROLS. It does not make anything read-only.** The
|
|
146
|
+
* write RPCs are gated server-side by `LUNORA_ADMIN_TOKEN` alone — one
|
|
147
|
+
* all-or-nothing check in `handleAdminRpc`, with no read/write scoping — and
|
|
148
|
+
* `renderStudioHtml({ adminToken })` already ships that bearer to the
|
|
149
|
+
* browser. So a viewer handed a studio deployed with `dataEditable: false`
|
|
150
|
+
* still holds a credential that can write; the buttons are simply absent
|
|
151
|
+
* from the page. Treat it as an affordance switch for a trusted operator,
|
|
152
|
+
* never as an authorization boundary. The same holds for
|
|
153
|
+
* {@link StudioProps.schemaEditable} and {@link StudioProps.runAsIdentity}.
|
|
154
|
+
*/
|
|
155
|
+
readonly dataEditable?: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Functions exposed in the runner tab. The runner tab only appears when at
|
|
158
|
+
* least one descriptor is supplied (a query/mutation/action's `kind` is
|
|
159
|
+
* compile-time-only, so it must be named here).
|
|
160
|
+
*/
|
|
161
|
+
readonly functions?: FunctionDescriptor[];
|
|
162
|
+
/** Reuse an existing Lingui instance (wins over `locale`). */
|
|
163
|
+
readonly i18n?: I18n;
|
|
164
|
+
/** Shard key every shard-scoped panel targets on first load. */
|
|
165
|
+
readonly initialShardKey?: string;
|
|
166
|
+
/** Active locale for the studio's own UI strings. Defaults to `en`. */
|
|
167
|
+
readonly locale?: string;
|
|
168
|
+
/**
|
|
169
|
+
* Inline OpenAPI 3.1 document rendered by the API tab's reference sub-view.
|
|
170
|
+
* Thread the generated `_generated/openapi.json` here to render it
|
|
171
|
+
* without a round-trip. When omitted the reference fetches the worker's
|
|
172
|
+
* admin-gated `GET /_lunora/admin/openapi` endpoint via the client.
|
|
173
|
+
*/
|
|
174
|
+
readonly openApiSpec?: unknown;
|
|
175
|
+
/**
|
|
176
|
+
* Inline OpenRPC 1.x document rendered by the API tab's reference sub-view
|
|
177
|
+
* when the OpenRPC format is selected. Thread the generated
|
|
178
|
+
* `_generated/openrpc.json` here to render it without a round-trip. When
|
|
179
|
+
* omitted the OpenRPC view fetches the worker's admin-gated
|
|
180
|
+
* `GET /_lunora/admin/openrpc` endpoint via the client.
|
|
181
|
+
*/
|
|
182
|
+
readonly openRpcSpec?: unknown;
|
|
183
|
+
/**
|
|
184
|
+
* Allow the function runner to execute a function AS a chosen authenticated
|
|
185
|
+
* identity (the "Run as identity" tool), so an operator can test auth + RLS
|
|
186
|
+
* behavior. Security-sensitive: it forges identity on an admin-gated RPC, so
|
|
187
|
+
* the host MUST set this only on a trusted loopback-dev gate (the same gate
|
|
188
|
+
* as `dataEditable`) — never in a production/static deploy. Off by default;
|
|
189
|
+
* see {@link FunctionRunner}.
|
|
190
|
+
*
|
|
191
|
+
* Like {@link StudioProps.dataEditable}, leaving it off only hides the tool.
|
|
192
|
+
* The RPC behind it stays reachable to anyone holding the admin token the
|
|
193
|
+
* page already carries — the gate is the token, not this flag.
|
|
194
|
+
*/
|
|
195
|
+
readonly runAsIdentity?: boolean;
|
|
196
|
+
/**
|
|
197
|
+
* Override how the schedule tab cancels a job. Defaults to the client's
|
|
198
|
+
* scheduler admin endpoint; see {@link SchedulePanel}.
|
|
199
|
+
*/
|
|
200
|
+
readonly scheduledCancel?: SchedulePanelProps["scheduledCancel"];
|
|
201
|
+
/**
|
|
202
|
+
* Override how the schedule tab's Cron triggers sub-view loads triggers.
|
|
203
|
+
* Defaults to the client's `/_lunora/admin/cron-jobs` endpoint; see
|
|
204
|
+
* {@link SchedulePanel}.
|
|
205
|
+
*/
|
|
206
|
+
readonly scheduledCron?: SchedulePanelProps["loadCronJobs"];
|
|
207
|
+
/**
|
|
208
|
+
* Override how the schedule tab loads jobs. Defaults to the client's
|
|
209
|
+
* scheduler admin endpoint, so the tab works without extra wiring.
|
|
210
|
+
*/
|
|
211
|
+
readonly scheduledLoad?: SchedulePanelProps["scheduledLoad"];
|
|
212
|
+
/**
|
|
213
|
+
* Show the visual schema editor overlay on the schema diagram (add table /
|
|
214
|
+
* column / index, written back to `lunora/schema.ts` + codegen). Off by
|
|
215
|
+
* default. Only the loopback-only dev hosts set this — the write path needs
|
|
216
|
+
* the project's filesystem + toolchain, so a static deploy leaves it off.
|
|
217
|
+
*
|
|
218
|
+
* Like {@link StudioProps.dataEditable}, it hides the overlay rather than
|
|
219
|
+
* making the diagram read-only: what actually stops a schema write in a
|
|
220
|
+
* static deploy is that the host has no filesystem to write to, not this
|
|
221
|
+
* flag.
|
|
222
|
+
*/
|
|
223
|
+
readonly schemaEditable?: boolean;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Top-bar + sidebar-footer chrome the `StudioApp` owns (theme + admin
|
|
227
|
+
* token state, the rules banner) but which renders *inside* the router-owned
|
|
228
|
+
* {@link StudioLayout} (the header and sidebar footer). The layout is a route
|
|
229
|
+
* component with no props, so it reads this from context rather than threading
|
|
230
|
+
* it through the router. Absent (composing `<Studio>` bare) the layout simply
|
|
231
|
+
* omits those affordances.
|
|
232
|
+
*/
|
|
233
|
+
interface StudioChrome {
|
|
234
|
+
readonly clearToken: () => void;
|
|
235
|
+
readonly onTokenChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
236
|
+
readonly rulesInstalled?: boolean;
|
|
237
|
+
readonly token: string;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* The composable studio. {@link StudioShell} reads its strings from `useT`,
|
|
241
|
+
* which needs a `StudioI18nProvider` above it.
|
|
242
|
+
*
|
|
243
|
+
* When an `i18n` instance or a `locale` is supplied, this owns a provider so the
|
|
244
|
+
* studio localises itself standalone. When neither is given it renders the
|
|
245
|
+
* shell bare and inherits whatever provider is already in scope — the host app's
|
|
246
|
+
* (`StudioApp` owns one for the top bar too) or the shared default — instead
|
|
247
|
+
* of nesting a second, redundant provider.
|
|
248
|
+
*/
|
|
249
|
+
declare const Studio: ({ i18n, locale, ...shellProps }: StudioProps) => ReactElement;
|
|
250
|
+
interface StudioAppProps {
|
|
251
|
+
/**
|
|
252
|
+
* Admin bearer token to send with every admin request. When omitted the app
|
|
253
|
+
* renders a small prompt so an operator can paste it at runtime — handy in
|
|
254
|
+
* dev where you don't want to bake the token into a bundle.
|
|
255
|
+
*/
|
|
256
|
+
readonly adminToken?: string;
|
|
257
|
+
/**
|
|
258
|
+
* URL path prefix the studio is mounted under (router `basepath`). Defaults
|
|
259
|
+
* to `/`. The `@lunora/vite` dev route sets `/__lunora`. Forwarded to the
|
|
260
|
+
* composed {@link Studio}.
|
|
261
|
+
*/
|
|
262
|
+
readonly basePath?: string;
|
|
263
|
+
/**
|
|
264
|
+
* Base URL of the Lunora worker the studio talks to. Defaults to the
|
|
265
|
+
* current origin, which is correct when the studio is served from the
|
|
266
|
+
* same worker (the `@lunora/vite` dev route) or proxied to it.
|
|
267
|
+
*/
|
|
268
|
+
readonly baseUrl?: string;
|
|
269
|
+
/**
|
|
270
|
+
* Inject a pre-built client instead of constructing one from `baseUrl` +
|
|
271
|
+
* the admin token. Used by the dev mock harness (and embeddings that own
|
|
272
|
+
* the client) so the chrome renders against a supplied client; when set,
|
|
273
|
+
* `baseUrl`/`adminToken` are ignored and this client is never closed here.
|
|
274
|
+
*/
|
|
275
|
+
readonly client?: LunoraClient;
|
|
276
|
+
/** UI language for the studio's own strings. Defaults to `en`. */
|
|
277
|
+
readonly locale?: string;
|
|
278
|
+
/**
|
|
279
|
+
* Whether the project's Lunora agent skills ("rules") are installed. When
|
|
280
|
+
* explicitly `false`, the studio shows a one-line banner pointing at
|
|
281
|
+
* `lunora rules install`. The loopback dev hosts inject this; a static deploy
|
|
282
|
+
* leaves it unset (no banner).
|
|
283
|
+
*/
|
|
284
|
+
readonly rulesInstalled?: boolean;
|
|
285
|
+
/** Forwarded to the composed {@link Studio} (functions, initialShardKey, scheduled overrides). */
|
|
286
|
+
readonly studio?: Omit<StudioProps, "children" | "chrome" | "i18n" | "locale">;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* A fully self-contained studio page: it constructs a {@link LunoraClient}
|
|
290
|
+
* pointed at the worker, wires it through a `<LunoraProvider>`, manages the
|
|
291
|
+
* admin token + theme, and renders the composed {@link Studio} — handing it the
|
|
292
|
+
* top-bar/sidebar {@link StudioChrome} (theme toggle, admin-token popover, rules
|
|
293
|
+
* banner) so those affordances render inside the sidebar shell.
|
|
294
|
+
*
|
|
295
|
+
* Mount this directly (the standalone app and the `@lunora/vite` dev route both
|
|
296
|
+
* do) when you want the batteries-included page rather than composing panels
|
|
297
|
+
* yourself. For embedding into an existing admin UI, use the individual panels
|
|
298
|
+
* or `<Studio>` under your own provider instead.
|
|
299
|
+
*/
|
|
300
|
+
declare const StudioApp: ({ adminToken, basePath, baseUrl, client: injectedClient, rulesInstalled, studio, locale }?: StudioAppProps) => ReactElement;
|
|
301
|
+
export { FunctionDescriptor as F, RunStatus as R, StudioAppProps as S, FunctionKind as a, ScheduledJobs as b, ScheduledJobsProps as c, Studio as d, StudioApp as e, StudioProps as f };
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { CronJobInfo, ScheduleRecord, LunoraClient } from '@lunora/client';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
import { I18n } from '@lingui/core';
|
|
4
|
+
import { AnalyticsSqlResult } from '@lunora/bindings/analytics';
|
|
5
|
+
interface AnalyticsPanelProps {
|
|
6
|
+
/**
|
|
7
|
+
* Dataset name to query (the `analytics_engine_datasets[].dataset`, default
|
|
8
|
+
* `ANALYTICS` — the value the config layer reconciles).
|
|
9
|
+
*/
|
|
10
|
+
readonly dataset?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Run one Analytics Engine SQL statement and resolve its result. The panel has
|
|
13
|
+
* no default: the AE SQL API authenticates with an **account-scoped Cloudflare
|
|
14
|
+
* API token**, and a browser bundle is the last place that may hold one. The
|
|
15
|
+
* host supplies a runner that proxies the statement through its own worker
|
|
16
|
+
* (thread it in as `StudioProps.analyticsQuery`); with none, the panel renders
|
|
17
|
+
* an empty state and makes no network call.
|
|
18
|
+
*/
|
|
19
|
+
readonly runQuery?: (sql: string) => Promise<AnalyticsSqlResult>;
|
|
20
|
+
}
|
|
21
|
+
interface CronTriggersPanelProps {
|
|
22
|
+
/**
|
|
23
|
+
* Load the code-defined cron triggers. Defaults to `client.getCronJobs`,
|
|
24
|
+
* which hits the worker's admin-gated `/_lunora/admin/cron-jobs` endpoint —
|
|
25
|
+
* so the panel works out of the box under `<LunoraProvider>`, provided the
|
|
26
|
+
* worker is built with a `cronJobs` map and `adminToken`. Override it to
|
|
27
|
+
* source triggers from elsewhere (e.g. tests).
|
|
28
|
+
*/
|
|
29
|
+
readonly loadCronJobs?: () => Promise<CronJobInfo[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Manually fire one cron job by name. Defaults to `client.runCronJob`, which
|
|
32
|
+
* hits the admin-gated `POST /_lunora/admin/cron-jobs/run` endpoint (the same
|
|
33
|
+
* dispatch the scheduled trigger runs). When a custom {@link CronTriggersPanelProps.loadCronJobs}
|
|
34
|
+
* is supplied without a `runCronJob`, the "Run now" control is hidden — useful
|
|
35
|
+
* for a read-only view.
|
|
36
|
+
*/
|
|
37
|
+
readonly runCronJob?: (name: string) => Promise<{
|
|
38
|
+
name: string;
|
|
39
|
+
ran: boolean;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
42
|
+
interface ScheduledJobsProps {
|
|
43
|
+
/**
|
|
44
|
+
* Cancel a pending job by id. Defaults to `client.cancelScheduledJob` when
|
|
45
|
+
* {@link ScheduledJobsProps.loadJobs} is also left to the client. When a
|
|
46
|
+
* custom `loadJobs` is supplied without a `cancelJob`, the cancel control is
|
|
47
|
+
* hidden — useful for a read-only view.
|
|
48
|
+
*/
|
|
49
|
+
readonly cancelJob?: (id: string) => Promise<{
|
|
50
|
+
cancelled: boolean;
|
|
51
|
+
}>;
|
|
52
|
+
/**
|
|
53
|
+
* Load the pending scheduled jobs. Defaults to `client.listScheduledJobs`,
|
|
54
|
+
* which hits the worker's admin-gated `/_lunora/admin/scheduled` endpoint —
|
|
55
|
+
* so the panel works out of the box under `<LunoraProvider>`, provided the
|
|
56
|
+
* worker is built with a `schedulerDO` namespace and `adminToken`. Override
|
|
57
|
+
* it to source jobs from elsewhere.
|
|
58
|
+
*/
|
|
59
|
+
readonly loadJobs?: () => Promise<ScheduleRecord[]>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* View — and cancel — the functions queued via `runAfter` / `runAt` on the
|
|
63
|
+
* scheduler. Cron *triggers* are static wrangler config and don't appear here;
|
|
64
|
+
* this lists the dynamic, in-flight schedule only.
|
|
65
|
+
*
|
|
66
|
+
* Works out of the box under `<LunoraProvider>` via the client's scheduler
|
|
67
|
+
* admin methods; pass {@link ScheduledJobsProps.loadJobs} /
|
|
68
|
+
* {@link ScheduledJobsProps.cancelJob} to override the transport.
|
|
69
|
+
*/
|
|
70
|
+
declare const ScheduledJobs: ({ cancelJob, loadJobs }?: ScheduledJobsProps) => ReactElement;
|
|
71
|
+
interface SchedulePanelProps {
|
|
72
|
+
/** Override how the Cron triggers sub-view loads triggers; see {@link CronTriggersPanel}. */
|
|
73
|
+
readonly loadCronJobs?: CronTriggersPanelProps["loadCronJobs"];
|
|
74
|
+
/** Override how the Scheduled jobs sub-view cancels a job; see {@link ScheduledJobs}. */
|
|
75
|
+
readonly scheduledCancel?: ScheduledJobsProps["cancelJob"];
|
|
76
|
+
/** Override how the Scheduled jobs sub-view loads jobs; see {@link ScheduledJobs}. */
|
|
77
|
+
readonly scheduledLoad?: ScheduledJobsProps["loadJobs"];
|
|
78
|
+
}
|
|
79
|
+
/** Which client method a {@link FunctionDescriptor} is invoked through. */
|
|
80
|
+
type FunctionKind = "action" | "mutation" | "query";
|
|
81
|
+
/**
|
|
82
|
+
* One argument of a registered function, derived from its `v.*` validator by the
|
|
83
|
+
* worker's `/_lunora/admin/functions` endpoint. A compact signature shape.
|
|
84
|
+
*/
|
|
85
|
+
interface FunctionArgumentDescriptor {
|
|
86
|
+
/** Element validator kind for an `array` arg (one level), e.g. `string`. */
|
|
87
|
+
element?: string;
|
|
88
|
+
/** The (optional-unwrapped) validator kind, e.g. `string`, `id`, `object`. */
|
|
89
|
+
kind: string;
|
|
90
|
+
/** The argument name. */
|
|
91
|
+
name: string;
|
|
92
|
+
/** True when the arg is wrapped in `v.optional(...)`. */
|
|
93
|
+
optional: boolean;
|
|
94
|
+
/** Target table for an `id` arg (`v.id("table")`). */
|
|
95
|
+
table?: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Runtime descriptor for a registered Lunora function. The function's `kind` is
|
|
99
|
+
* a compile-time-only phantom on `FunctionReference`, so the runner needs it
|
|
100
|
+
* spelled out here to know which client method to call. `args` carries the
|
|
101
|
+
* function's argument signature (absent on responses from an older worker).
|
|
102
|
+
*/
|
|
103
|
+
interface FunctionDescriptor {
|
|
104
|
+
args?: FunctionArgumentDescriptor[];
|
|
105
|
+
kind: FunctionKind;
|
|
106
|
+
/** The `<file>:<function>` identifier, e.g. `messages:list`. */
|
|
107
|
+
path: string;
|
|
108
|
+
}
|
|
109
|
+
/** Outcome of a single `FunctionRunner` invocation. */
|
|
110
|
+
type RunStatus = "error" | "idle" | "running" | "success";
|
|
111
|
+
interface StudioProps {
|
|
112
|
+
/**
|
|
113
|
+
* Run one Analytics Engine SQL statement for the Analytics tab. There is no
|
|
114
|
+
* default: the AE SQL API authenticates with an account-scoped Cloudflare API
|
|
115
|
+
* token, and inlining one into this browser bundle would leak it to anyone who
|
|
116
|
+
* views source. Supply a runner that proxies the statement through your own
|
|
117
|
+
* worker (which holds the token server-side). Without it the Analytics tab
|
|
118
|
+
* renders an empty state and issues no request.
|
|
119
|
+
*
|
|
120
|
+
* Pass a STABLE reference — a module-level function, or one held in a
|
|
121
|
+
* `useCallback`/ref. It is read while building the tab router, so a fresh
|
|
122
|
+
* inline arrow on every render rebuilds the router and remounts the panel
|
|
123
|
+
* tree, losing in-progress query state. The same holds for `scheduledLoad`,
|
|
124
|
+
* `scheduledCancel` and `scheduledCron`.
|
|
125
|
+
*/
|
|
126
|
+
readonly analyticsQuery?: AnalyticsPanelProps["runQuery"];
|
|
127
|
+
/**
|
|
128
|
+
* URL path prefix the studio is mounted under, passed to the router as its
|
|
129
|
+
* `basepath`. Defaults to `/` (mounted at the origin root). The `@lunora/vite`
|
|
130
|
+
* dev route serves the studio under `/__lunora`, so it sets this — without
|
|
131
|
+
* it the router treats `/__lunora` as unknown and bounces to `/data`, escaping
|
|
132
|
+
* the mount.
|
|
133
|
+
*/
|
|
134
|
+
readonly basePath?: string;
|
|
135
|
+
/**
|
|
136
|
+
* App-owned top-bar + sidebar-footer chrome (theme toggle, admin-token
|
|
137
|
+
* popover, rules banner). The batteries-included `StudioApp` supplies
|
|
138
|
+
* this; composing `<Studio>` bare omits those affordances. See {@link StudioChrome}.
|
|
139
|
+
*/
|
|
140
|
+
readonly chrome?: StudioChrome;
|
|
141
|
+
/**
|
|
142
|
+
* Show the data tab's write controls (insert/edit/delete rows). Off by
|
|
143
|
+
* default; see {@link TableEditor}.
|
|
144
|
+
*
|
|
145
|
+
* **This HIDES THE CONTROLS. It does not make anything read-only.** The
|
|
146
|
+
* write RPCs are gated server-side by `LUNORA_ADMIN_TOKEN` alone — one
|
|
147
|
+
* all-or-nothing check in `handleAdminRpc`, with no read/write scoping — and
|
|
148
|
+
* `renderStudioHtml({ adminToken })` already ships that bearer to the
|
|
149
|
+
* browser. So a viewer handed a studio deployed with `dataEditable: false`
|
|
150
|
+
* still holds a credential that can write; the buttons are simply absent
|
|
151
|
+
* from the page. Treat it as an affordance switch for a trusted operator,
|
|
152
|
+
* never as an authorization boundary. The same holds for
|
|
153
|
+
* {@link StudioProps.schemaEditable} and {@link StudioProps.runAsIdentity}.
|
|
154
|
+
*/
|
|
155
|
+
readonly dataEditable?: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Functions exposed in the runner tab. The runner tab only appears when at
|
|
158
|
+
* least one descriptor is supplied (a query/mutation/action's `kind` is
|
|
159
|
+
* compile-time-only, so it must be named here).
|
|
160
|
+
*/
|
|
161
|
+
readonly functions?: FunctionDescriptor[];
|
|
162
|
+
/** Reuse an existing Lingui instance (wins over `locale`). */
|
|
163
|
+
readonly i18n?: I18n;
|
|
164
|
+
/** Shard key every shard-scoped panel targets on first load. */
|
|
165
|
+
readonly initialShardKey?: string;
|
|
166
|
+
/** Active locale for the studio's own UI strings. Defaults to `en`. */
|
|
167
|
+
readonly locale?: string;
|
|
168
|
+
/**
|
|
169
|
+
* Inline OpenAPI 3.1 document rendered by the API tab's reference sub-view.
|
|
170
|
+
* Thread the generated `_generated/openapi.json` here to render it
|
|
171
|
+
* without a round-trip. When omitted the reference fetches the worker's
|
|
172
|
+
* admin-gated `GET /_lunora/admin/openapi` endpoint via the client.
|
|
173
|
+
*/
|
|
174
|
+
readonly openApiSpec?: unknown;
|
|
175
|
+
/**
|
|
176
|
+
* Inline OpenRPC 1.x document rendered by the API tab's reference sub-view
|
|
177
|
+
* when the OpenRPC format is selected. Thread the generated
|
|
178
|
+
* `_generated/openrpc.json` here to render it without a round-trip. When
|
|
179
|
+
* omitted the OpenRPC view fetches the worker's admin-gated
|
|
180
|
+
* `GET /_lunora/admin/openrpc` endpoint via the client.
|
|
181
|
+
*/
|
|
182
|
+
readonly openRpcSpec?: unknown;
|
|
183
|
+
/**
|
|
184
|
+
* Allow the function runner to execute a function AS a chosen authenticated
|
|
185
|
+
* identity (the "Run as identity" tool), so an operator can test auth + RLS
|
|
186
|
+
* behavior. Security-sensitive: it forges identity on an admin-gated RPC, so
|
|
187
|
+
* the host MUST set this only on a trusted loopback-dev gate (the same gate
|
|
188
|
+
* as `dataEditable`) — never in a production/static deploy. Off by default;
|
|
189
|
+
* see {@link FunctionRunner}.
|
|
190
|
+
*
|
|
191
|
+
* Like {@link StudioProps.dataEditable}, leaving it off only hides the tool.
|
|
192
|
+
* The RPC behind it stays reachable to anyone holding the admin token the
|
|
193
|
+
* page already carries — the gate is the token, not this flag.
|
|
194
|
+
*/
|
|
195
|
+
readonly runAsIdentity?: boolean;
|
|
196
|
+
/**
|
|
197
|
+
* Override how the schedule tab cancels a job. Defaults to the client's
|
|
198
|
+
* scheduler admin endpoint; see {@link SchedulePanel}.
|
|
199
|
+
*/
|
|
200
|
+
readonly scheduledCancel?: SchedulePanelProps["scheduledCancel"];
|
|
201
|
+
/**
|
|
202
|
+
* Override how the schedule tab's Cron triggers sub-view loads triggers.
|
|
203
|
+
* Defaults to the client's `/_lunora/admin/cron-jobs` endpoint; see
|
|
204
|
+
* {@link SchedulePanel}.
|
|
205
|
+
*/
|
|
206
|
+
readonly scheduledCron?: SchedulePanelProps["loadCronJobs"];
|
|
207
|
+
/**
|
|
208
|
+
* Override how the schedule tab loads jobs. Defaults to the client's
|
|
209
|
+
* scheduler admin endpoint, so the tab works without extra wiring.
|
|
210
|
+
*/
|
|
211
|
+
readonly scheduledLoad?: SchedulePanelProps["scheduledLoad"];
|
|
212
|
+
/**
|
|
213
|
+
* Show the visual schema editor overlay on the schema diagram (add table /
|
|
214
|
+
* column / index, written back to `lunora/schema.ts` + codegen). Off by
|
|
215
|
+
* default. Only the loopback-only dev hosts set this — the write path needs
|
|
216
|
+
* the project's filesystem + toolchain, so a static deploy leaves it off.
|
|
217
|
+
*
|
|
218
|
+
* Like {@link StudioProps.dataEditable}, it hides the overlay rather than
|
|
219
|
+
* making the diagram read-only: what actually stops a schema write in a
|
|
220
|
+
* static deploy is that the host has no filesystem to write to, not this
|
|
221
|
+
* flag.
|
|
222
|
+
*/
|
|
223
|
+
readonly schemaEditable?: boolean;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Top-bar + sidebar-footer chrome the `StudioApp` owns (theme + admin
|
|
227
|
+
* token state, the rules banner) but which renders *inside* the router-owned
|
|
228
|
+
* {@link StudioLayout} (the header and sidebar footer). The layout is a route
|
|
229
|
+
* component with no props, so it reads this from context rather than threading
|
|
230
|
+
* it through the router. Absent (composing `<Studio>` bare) the layout simply
|
|
231
|
+
* omits those affordances.
|
|
232
|
+
*/
|
|
233
|
+
interface StudioChrome {
|
|
234
|
+
readonly clearToken: () => void;
|
|
235
|
+
readonly onTokenChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
236
|
+
readonly rulesInstalled?: boolean;
|
|
237
|
+
readonly token: string;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* The composable studio. {@link StudioShell} reads its strings from `useT`,
|
|
241
|
+
* which needs a `StudioI18nProvider` above it.
|
|
242
|
+
*
|
|
243
|
+
* When an `i18n` instance or a `locale` is supplied, this owns a provider so the
|
|
244
|
+
* studio localises itself standalone. When neither is given it renders the
|
|
245
|
+
* shell bare and inherits whatever provider is already in scope — the host app's
|
|
246
|
+
* (`StudioApp` owns one for the top bar too) or the shared default — instead
|
|
247
|
+
* of nesting a second, redundant provider.
|
|
248
|
+
*/
|
|
249
|
+
declare const Studio: ({ i18n, locale, ...shellProps }: StudioProps) => ReactElement;
|
|
250
|
+
interface StudioAppProps {
|
|
251
|
+
/**
|
|
252
|
+
* Admin bearer token to send with every admin request. When omitted the app
|
|
253
|
+
* renders a small prompt so an operator can paste it at runtime — handy in
|
|
254
|
+
* dev where you don't want to bake the token into a bundle.
|
|
255
|
+
*/
|
|
256
|
+
readonly adminToken?: string;
|
|
257
|
+
/**
|
|
258
|
+
* URL path prefix the studio is mounted under (router `basepath`). Defaults
|
|
259
|
+
* to `/`. The `@lunora/vite` dev route sets `/__lunora`. Forwarded to the
|
|
260
|
+
* composed {@link Studio}.
|
|
261
|
+
*/
|
|
262
|
+
readonly basePath?: string;
|
|
263
|
+
/**
|
|
264
|
+
* Base URL of the Lunora worker the studio talks to. Defaults to the
|
|
265
|
+
* current origin, which is correct when the studio is served from the
|
|
266
|
+
* same worker (the `@lunora/vite` dev route) or proxied to it.
|
|
267
|
+
*/
|
|
268
|
+
readonly baseUrl?: string;
|
|
269
|
+
/**
|
|
270
|
+
* Inject a pre-built client instead of constructing one from `baseUrl` +
|
|
271
|
+
* the admin token. Used by the dev mock harness (and embeddings that own
|
|
272
|
+
* the client) so the chrome renders against a supplied client; when set,
|
|
273
|
+
* `baseUrl`/`adminToken` are ignored and this client is never closed here.
|
|
274
|
+
*/
|
|
275
|
+
readonly client?: LunoraClient;
|
|
276
|
+
/** UI language for the studio's own strings. Defaults to `en`. */
|
|
277
|
+
readonly locale?: string;
|
|
278
|
+
/**
|
|
279
|
+
* Whether the project's Lunora agent skills ("rules") are installed. When
|
|
280
|
+
* explicitly `false`, the studio shows a one-line banner pointing at
|
|
281
|
+
* `lunora rules install`. The loopback dev hosts inject this; a static deploy
|
|
282
|
+
* leaves it unset (no banner).
|
|
283
|
+
*/
|
|
284
|
+
readonly rulesInstalled?: boolean;
|
|
285
|
+
/** Forwarded to the composed {@link Studio} (functions, initialShardKey, scheduled overrides). */
|
|
286
|
+
readonly studio?: Omit<StudioProps, "children" | "chrome" | "i18n" | "locale">;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* A fully self-contained studio page: it constructs a {@link LunoraClient}
|
|
290
|
+
* pointed at the worker, wires it through a `<LunoraProvider>`, manages the
|
|
291
|
+
* admin token + theme, and renders the composed {@link Studio} — handing it the
|
|
292
|
+
* top-bar/sidebar {@link StudioChrome} (theme toggle, admin-token popover, rules
|
|
293
|
+
* banner) so those affordances render inside the sidebar shell.
|
|
294
|
+
*
|
|
295
|
+
* Mount this directly (the standalone app and the `@lunora/vite` dev route both
|
|
296
|
+
* do) when you want the batteries-included page rather than composing panels
|
|
297
|
+
* yourself. For embedding into an existing admin UI, use the individual panels
|
|
298
|
+
* or `<Studio>` under your own provider instead.
|
|
299
|
+
*/
|
|
300
|
+
declare const StudioApp: ({ adminToken, basePath, baseUrl, client: injectedClient, rulesInstalled, studio, locale }?: StudioAppProps) => ReactElement;
|
|
301
|
+
export { FunctionDescriptor as F, RunStatus as R, StudioAppProps as S, FunctionKind as a, ScheduledJobs as b, ScheduledJobsProps as c, Studio as d, StudioApp as e, StudioProps as f };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mergeProps as n}from"@base-ui/react/merge-props";import{useRender as a}from"@base-ui/react/use-render";import{cva as o}from"class-variance-authority";import{c as s}from"./utils-bhneXptQ.mjs";const d=o("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-none border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive font-mono text-[11px] tracking-wide uppercase focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline",success:"bg-success/10 text-success font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-success/15 dark:bg-success/15",warning:"bg-warning/10 text-warning font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-warning/15 dark:bg-warning/15",info:"bg-info/10 text-info font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-info/15 dark:bg-info/15"}},defaultVariants:{variant:"default"}});function f({className:r,variant:e="default",render:t,...i}){return a({defaultTagName:"span",props:n({className:s(d({variant:e}),r)},i),render:t,state:{slot:"badge",variant:e}})}export{f as B};
|