@lunora/studio 1.0.0-alpha.59 → 1.0.0-alpha.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -43
- package/dist/mount.js +1 -27
- package/dist/packem_chunks/ApiTab.js +1 -251
- package/dist/packem_chunks/AuditPanel.js +1 -200
- package/dist/packem_chunks/DeploymentHealthPanel.js +1 -664
- package/dist/packem_chunks/ExportImportPanel.js +3 -198
- package/dist/packem_chunks/FileBrowser.js +4 -2955
- package/dist/packem_chunks/FunctionRunner.js +1 -326
- package/dist/packem_chunks/FunctionStatsPanel.js +1 -377
- package/dist/packem_chunks/HealthPanel.js +1 -648
- package/dist/packem_chunks/InsightsPanel.js +1 -462
- package/dist/packem_chunks/LogsPanel.js +1 -1303
- package/dist/packem_chunks/MailPanel.js +2 -353
- package/dist/packem_chunks/MetricsPanel.js +1 -1960
- package/dist/packem_chunks/MigrationsPanel.js +1 -239
- package/dist/packem_chunks/NotificationsPanel.js +1 -306
- package/dist/packem_chunks/PitrPanel.js +1 -252
- package/dist/packem_chunks/SchemaViewer.js +1 -2512
- package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -95
- package/dist/packem_chunks/SettingsPanel.js +1 -391
- package/dist/packem_chunks/SqlEditorPanel.js +4 -2340
- package/dist/packem_chunks/TableEditor.js +1 -290
- package/dist/packem_chunks/agents-panel.js +1 -326
- package/dist/packem_chunks/analytics-panel.js +1 -261
- package/dist/packem_chunks/auth-audit-panel.js +1 -247
- package/dist/packem_chunks/auth-config-panel.js +1 -365
- package/dist/packem_chunks/auth-sessions-panel.js +1 -175
- package/dist/packem_chunks/containers-panel.js +1 -261
- package/dist/packem_chunks/dashboards-panel.js +1 -781
- package/dist/packem_chunks/fanout-panel.js +1 -482
- package/dist/packem_chunks/flags-panel.js +1 -176
- package/dist/packem_chunks/issues-panel.js +1 -427
- package/dist/packem_chunks/kv-browser.js +1 -1896
- package/dist/packem_chunks/log-drains-panel.js +4 -273
- package/dist/packem_chunks/organizations-panel.js +1 -3209
- package/dist/packem_chunks/payments-panel.js +1 -213
- package/dist/packem_chunks/permissions-panel.js +1 -805
- package/dist/packem_chunks/queues-panel.js +1 -1075
- package/dist/packem_chunks/rls-panel.js +1 -315
- package/dist/packem_chunks/schedule-panel.js +1 -831
- package/dist/packem_chunks/sparkline.js +1 -79
- package/dist/packem_chunks/storage-rules-panel.js +1 -140
- package/dist/packem_chunks/subscriptions-panel.js +1 -238
- package/dist/packem_chunks/sync-client-panel.js +1 -0
- package/dist/packem_chunks/traces-panel.js +1 -747
- package/dist/packem_chunks/users-panel.js +1 -1731
- package/dist/packem_chunks/vector-browser.js +1 -281
- package/dist/packem_chunks/workflows-panel.js +1 -562
- package/dist/packem_shared/ADMIN_FUNCTIONS-BYNSbBVE.js +1 -0
- package/dist/packem_shared/ApiDocsPanel-eJYZlylw.js +2 -0
- package/dist/packem_shared/ApiReferencePanel-C42v1jr6.js +1 -0
- package/dist/packem_shared/CommandPalette-CVIaY3j8.js +1 -0
- package/dist/packem_shared/ConfirmButton-CTL3f3kr.js +1 -0
- package/dist/packem_shared/ConnectionBadge-DOk0CQWo.js +1 -0
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-BCC8_4BQ.js +1 -0
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-B-hcFVoi.js +1 -0
- package/dist/packem_shared/DEFAULT_LOCALE-BZ4NojpD.js +1 -0
- package/dist/packem_shared/DataBrowser-B8J5lHjP.js +1 -0
- package/dist/packem_shared/DataFilters-Csb30F0C.js +1 -0
- package/dist/packem_shared/ErrorBoundary-DvzYskH7.js +1 -0
- package/dist/packem_shared/GlobalDataBrowser-RLJ6NvOs.js +1 -0
- package/dist/packem_shared/HomePanel-DL1HupAN.js +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-sGsIgYWj.js +1 -0
- package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.js +1 -0
- package/dist/packem_shared/ScheduledJobs-DUbo6epc.js +1 -0
- package/dist/packem_shared/ShardInput-BVn2iCU0.js +1 -0
- package/dist/packem_shared/Studio-BWBclm_C.js +1 -0
- package/dist/packem_shared/StudioApp-BFm73yVr.js +1 -0
- package/dist/packem_shared/StudioI18nProvider-CZ5h4nrV.js +1 -0
- package/dist/packem_shared/advisor-view-DaCX9Jy5.js +1 -0
- package/dist/packem_shared/aggregateMetrics-BNfajLa2.js +1 -0
- package/dist/packem_shared/alert-CVcOFuDR.js +1 -0
- package/dist/packem_shared/badge-BbuuAio7.js +1 -0
- package/dist/packem_shared/bar-chart-AryFCeoa.js +9 -0
- package/dist/packem_shared/browser-storage-xjTyMKY0.js +1 -0
- package/dist/packem_shared/button-BkCrNcAs.js +1 -0
- package/dist/packem_shared/card-CIDGUN6K.js +1 -0
- package/dist/packem_shared/cf-links-gbDy51nR.js +1 -0
- package/dist/packem_shared/checkbox-StT4Gob6.js +1 -0
- package/dist/packem_shared/data-grid-BMBKzMEJ.js +1 -0
- package/dist/packem_shared/data-view-params-C8T3bW1z.js +1 -0
- package/dist/packem_shared/dropdown-menu-C3RQ_HlW.js +2 -0
- package/dist/packem_shared/empty-state-Cg7t_8qu.js +1 -0
- package/dist/packem_shared/error-alert-B59DnrDI.js +1 -0
- package/dist/packem_shared/grid-features-uZCUj955.js +6 -0
- package/dist/packem_shared/home-panel-B-8BCffw.js +3 -0
- package/dist/packem_shared/input-JHu63lTv.js +1 -0
- package/dist/packem_shared/internal-AtZ4bTal.js +2 -0
- package/dist/packem_shared/label-6uP1obNF.js +1 -0
- package/dist/packem_shared/live-status-CGW2JHf_.js +1 -0
- package/dist/packem_shared/log-fields-CoL3hsIQ.js +1 -0
- package/dist/packem_shared/modal-shell-CUwwWC2o.js +1 -0
- package/dist/packem_shared/reference-view-KvhektwF.js +12 -0
- package/dist/packem_shared/result-chart-CwKhhKM0.js +1 -0
- package/dist/packem_shared/scroll-area-DTEq6Jec.js +2 -0
- package/dist/packem_shared/select-Bul-DeII.js +2 -0
- package/dist/packem_shared/shard-history-DMEW5VBE.js +1 -0
- package/dist/packem_shared/skeleton-C1wQ9M5t.js +1 -0
- package/dist/packem_shared/sparkline-DtcZoU48.js +1 -0
- package/dist/packem_shared/storage-tier-DznqOf-q.js +1 -0
- package/dist/packem_shared/studio-BHA7hnI3.js +2 -0
- package/dist/packem_shared/table-DdJBrClo.js +2 -0
- package/dist/packem_shared/table-list-sidebar-CMCcNALK.js +1 -0
- package/dist/packem_shared/textarea-Bu2-jKAs.js +1 -0
- package/dist/packem_shared/trace-handoff-Dw7mwjxu.js +1 -0
- package/dist/packem_shared/use-admin-query-Di3fLE8H.js +1 -0
- package/dist/packem_shared/use-async-submit-H68GHPz8.js +1 -0
- package/dist/packem_shared/useDebounced-Ihdiid_k.js +1 -0
- package/dist/packem_shared/utils-bhneXptQ.js +1 -0
- package/dist/packem_shared/virtual-rect-1o1veP7R.js +1 -0
- package/dist/standalone/chunk-23HKRH5H.js +13 -0
- package/dist/standalone/chunk-2A4RKII2.js +1 -0
- package/dist/standalone/chunk-3DTM4GI5.js +1 -0
- package/dist/standalone/chunk-3MHKT76P.js +1 -0
- package/dist/standalone/chunk-46IB4C4Q.js +1 -0
- package/dist/standalone/chunk-4AYEV5UN.js +1 -0
- package/dist/standalone/chunk-4FNHHFWR.js +1 -0
- package/dist/standalone/chunk-6CLVIOCB.js +1 -0
- package/dist/standalone/chunk-6I62RSI5.js +1 -0
- package/dist/standalone/chunk-6OKDCV7J.js +1 -0
- package/dist/standalone/chunk-6P7HIPUE.js +1 -0
- package/dist/standalone/chunk-6UYILUSX.js +1 -0
- package/dist/standalone/chunk-725RLB7D.js +1 -0
- package/dist/standalone/chunk-7AZZ7OJO.js +1 -0
- package/dist/standalone/chunk-7CRLAMGB.js +1 -0
- package/dist/standalone/chunk-7Z5QEFR4.js +2 -0
- package/dist/standalone/chunk-AGVJJQFL.js +1 -0
- package/dist/standalone/chunk-AKTGRZXN.js +1 -0
- package/dist/standalone/chunk-BAIN7UJ4.js +1 -0
- package/dist/standalone/chunk-BHWSIIDT.js +1 -0
- package/dist/standalone/{chunk-L7SK4ZZD.js → chunk-C4O5UR4Y.js} +1 -1
- package/dist/standalone/chunk-C4VURT57.js +1 -0
- package/dist/standalone/chunk-CKO3F55C.js +4 -0
- package/dist/standalone/chunk-CVMRZUF5.js +4 -0
- package/dist/standalone/chunk-CWWGDW4V.js +1 -0
- package/dist/standalone/chunk-CYET4BRZ.js +1 -0
- package/dist/standalone/chunk-CZEUVNCQ.js +1 -0
- package/dist/standalone/chunk-FXFK4M4E.js +1 -0
- package/dist/standalone/chunk-FYAJPWE7.js +1 -0
- package/dist/standalone/chunk-GS7OBQO5.js +1 -0
- package/dist/standalone/chunk-GTXVH7I5.js +1 -0
- package/dist/standalone/chunk-H6SIM4BT.js +1 -0
- package/dist/standalone/chunk-H6WOFY6A.js +8 -0
- package/dist/standalone/chunk-HA34GYEX.js +1 -0
- package/dist/standalone/chunk-HMIOF5GV.js +1 -0
- package/dist/standalone/chunk-HY46NTNW.js +6 -0
- package/dist/standalone/chunk-IBCKC2BO.js +1 -0
- package/dist/standalone/chunk-ICKBVXPP.js +1 -0
- package/dist/standalone/chunk-IE4ROTQD.js +1 -0
- package/dist/standalone/chunk-IYYTWZ2E.js +2 -0
- package/dist/standalone/chunk-J2LMP2A7.js +1 -0
- package/dist/standalone/chunk-JC6WYIHM.js +1 -0
- package/dist/standalone/chunk-JKPK25JO.js +1 -0
- package/dist/standalone/chunk-JLFCXBNQ.js +1 -0
- package/dist/standalone/chunk-JRWBGR5B.js +1 -0
- package/dist/standalone/chunk-K5PFWU5J.js +1 -0
- package/dist/standalone/chunk-KJTLW5W2.js +11 -0
- package/dist/standalone/{chunk-HBGS4SEX.js → chunk-KLLYGWNF.js} +9 -9
- package/dist/standalone/chunk-KNN3ZEQ7.js +1 -0
- package/dist/standalone/{chunk-4QHKBC77.js → chunk-KOC5KV3E.js} +1 -1
- package/dist/standalone/chunk-KSRXMTBV.js +1 -0
- package/dist/standalone/chunk-KYCAYNXM.js +1 -0
- package/dist/standalone/chunk-KZ2YUNMR.js +1 -0
- package/dist/standalone/chunk-LKHUVEHX.js +1 -0
- package/dist/standalone/chunk-LPOKAJT4.js +4 -0
- package/dist/standalone/chunk-MZEK4SGD.js +1 -0
- package/dist/standalone/chunk-NCCUM26H.js +1 -0
- package/dist/standalone/chunk-O62HJZV3.js +1 -0
- package/dist/standalone/chunk-OTJOI23O.js +62 -0
- package/dist/standalone/chunk-P2NBOUGZ.js +1 -0
- package/dist/standalone/chunk-P4J6XNG3.js +1 -0
- package/dist/standalone/chunk-PGDWFWH5.js +1 -0
- package/dist/standalone/chunk-PR2SE2MD.js +1 -0
- package/dist/standalone/chunk-PTTDIYGP.js +1 -0
- package/dist/standalone/chunk-PWDMXMRD.js +1 -0
- package/dist/standalone/chunk-Q34MSC2F.js +1 -0
- package/dist/standalone/chunk-Q5WXTZWX.js +1 -0
- package/dist/standalone/chunk-QC5HCNJZ.js +4 -0
- package/dist/standalone/chunk-QJKRHZYV.js +1 -0
- package/dist/standalone/chunk-R43KHQDA.js +1 -0
- package/dist/standalone/chunk-RC2K5RBE.js +1 -0
- package/dist/standalone/chunk-RE6UWCMG.js +1 -0
- package/dist/standalone/chunk-RUP3M2GF.js +3 -0
- package/dist/standalone/chunk-SA6MBPBL.js +1 -0
- package/dist/standalone/{chunk-BJGBHGK3.js → chunk-SEDZDNQF.js} +1 -1
- package/dist/standalone/chunk-SKHEGARW.js +1 -0
- package/dist/standalone/chunk-SKJZDOHG.js +1 -0
- package/dist/standalone/chunk-SNDYNCAA.js +1 -0
- package/dist/standalone/chunk-SZUHZ2OG.js +1 -0
- package/dist/standalone/chunk-TAE2H7PU.js +1 -0
- package/dist/standalone/chunk-TEIBKU46.js +1 -0
- package/dist/standalone/chunk-TO6NLVFD.js +1 -0
- package/dist/standalone/chunk-TYTJDFX2.js +1 -0
- package/dist/standalone/{chunk-LXULVPEM.js → chunk-UDZY7MKE.js} +3 -3
- package/dist/standalone/chunk-UHHTEBC3.js +1 -0
- package/dist/standalone/chunk-UNDFOYRI.js +1 -0
- package/dist/standalone/chunk-UNN4CESU.js +1 -0
- package/dist/standalone/chunk-UNXX5GQH.js +1 -0
- package/dist/standalone/{chunk-ZHVTQ37P.js → chunk-UREY4GLG.js} +1 -1
- package/dist/standalone/chunk-UWF5DOGV.js +1 -0
- package/dist/standalone/chunk-UY2Y5CXB.js +1 -0
- package/dist/standalone/{chunk-VLXV72QE.js → chunk-UZYGEOWY.js} +1 -1
- package/dist/standalone/chunk-V66TSUKV.js +1 -0
- package/dist/standalone/chunk-VEFNSN7P.js +1 -0
- package/dist/standalone/chunk-VUJGR4PB.js +1 -0
- package/dist/standalone/chunk-VUXJER3D.js +1 -0
- package/dist/standalone/chunk-W572365D.js +1 -0
- package/dist/standalone/chunk-WYFLGXZ3.js +3 -0
- package/dist/standalone/chunk-XDKFPBIL.js +1 -0
- package/dist/standalone/chunk-XRKCGQM2.js +1 -0
- package/dist/standalone/chunk-YNBJ6ICE.js +1 -0
- package/dist/standalone/chunk-YQ5PILIJ.js +1 -0
- package/dist/standalone/chunk-YT7VXQVX.js +1 -0
- package/dist/standalone/chunk-Z7MUQMLE.js +1 -0
- package/dist/standalone/chunk-ZFWEPGWG.js +1 -0
- package/dist/standalone/chunk-ZMFZRGAN.js +1 -0
- package/dist/standalone/studio.js +9 -214
- package/package.json +4 -4
- package/dist/packem_shared/ADMIN_FUNCTIONS-P2UzJscH.js +0 -62
- package/dist/packem_shared/ApiDocsPanel-DNDpeR5O.js +0 -842
- package/dist/packem_shared/ApiReferencePanel-ChlRsAXU.js +0 -230
- package/dist/packem_shared/CommandPalette-BpkopP5f.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-obTn4sKX.js +0 -4493
- package/dist/packem_shared/DataFilters-B1Q7mrt7.js +0 -253
- package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
- package/dist/packem_shared/GlobalDataBrowser-BCaohHZ5.js +0 -293
- package/dist/packem_shared/HomePanel-DCRj3hGB.js +0 -14
- package/dist/packem_shared/OpenRpcReferencePanel-CIeQE1aE.js +0 -192
- package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
- package/dist/packem_shared/ScheduledJobs-BQzQo84k.js +0 -262
- package/dist/packem_shared/ShardInput-CZnpHILL.js +0 -107
- package/dist/packem_shared/Studio-DnlPCbID.js +0 -16
- package/dist/packem_shared/StudioApp-CzqlB4zO.js +0 -708
- package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
- package/dist/packem_shared/advisor-view-D95sN-wO.js +0 -159
- package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
- package/dist/packem_shared/alert-CdAET2K_.js +0 -68
- package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
- package/dist/packem_shared/bar-chart-DSwcWIRy.js +0 -3246
- package/dist/packem_shared/browser-storage-L4gOP5gJ.js +0 -105
- package/dist/packem_shared/button-BhsN2uZH.js +0 -49
- package/dist/packem_shared/card-F2vH_aj2.js +0 -175
- package/dist/packem_shared/cf-links-SIbyi4Y1.js +0 -8
- package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
- package/dist/packem_shared/data-grid-BywzWfek.js +0 -183
- package/dist/packem_shared/data-view-params-Cd6yRVbv.js +0 -96
- 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/error-alert-D9uIFJUS.js +0 -114
- package/dist/packem_shared/grid-features-ZOLhHKrR.js +0 -809
- package/dist/packem_shared/home-panel-BRAA2UlM.js +0 -1889
- package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
- package/dist/packem_shared/internal-DzHCc2Rq.js +0 -131
- package/dist/packem_shared/label-D8ykjn5J.js +0 -46
- package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
- package/dist/packem_shared/log-fields-jEH83H2G.js +0 -18
- package/dist/packem_shared/modal-shell-hyaJvIJ6.js +0 -100
- package/dist/packem_shared/reference-view-DfXN7oWP.js +0 -2127
- package/dist/packem_shared/result-chart-Bf9mbCIo.js +0 -119
- package/dist/packem_shared/scroll-area-DLhcy-ml.js +0 -93
- package/dist/packem_shared/select-D9OwHEch.js +0 -273
- package/dist/packem_shared/shard-history-AxiJ1WPP.js +0 -16
- package/dist/packem_shared/skeleton-CGhL0p20.js +0 -45
- package/dist/packem_shared/sparkline-BnA1kC9X.js +0 -93
- package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
- package/dist/packem_shared/studio-8QSXbZ98.js +0 -4192
- package/dist/packem_shared/table-DsCa9Qp9.js +0 -246
- package/dist/packem_shared/table-list-sidebar-gCE17v9B.js +0 -842
- package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
- package/dist/packem_shared/trace-handoff-CGolF3KS.js +0 -38
- package/dist/packem_shared/use-admin-query-C7JNuQp-.js +0 -106
- package/dist/packem_shared/use-async-submit-rnSk_jXl.js +0 -91
- 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
- package/dist/standalone/chunk-2K47A3P6.js +0 -1
- package/dist/standalone/chunk-2MLA6WFH.js +0 -1
- package/dist/standalone/chunk-2NGUNNGW.js +0 -1
- package/dist/standalone/chunk-2TJVFKD2.js +0 -1
- package/dist/standalone/chunk-2YTF6LJ6.js +0 -1
- package/dist/standalone/chunk-3GXGLNKW.js +0 -1
- package/dist/standalone/chunk-3HGNPZBN.js +0 -1
- package/dist/standalone/chunk-3LJEGSMK.js +0 -11
- package/dist/standalone/chunk-3OA7PECS.js +0 -6
- package/dist/standalone/chunk-4PC7IXNY.js +0 -1
- package/dist/standalone/chunk-56XQYNUJ.js +0 -1
- package/dist/standalone/chunk-5OIBXYZM.js +0 -1
- package/dist/standalone/chunk-5QT5JRXD.js +0 -3
- package/dist/standalone/chunk-6RLPR7PL.js +0 -1
- package/dist/standalone/chunk-6V74EUPK.js +0 -1
- package/dist/standalone/chunk-7EE33WLB.js +0 -1
- package/dist/standalone/chunk-7TJJXVSE.js +0 -1
- package/dist/standalone/chunk-AHILM3ZP.js +0 -1
- package/dist/standalone/chunk-AN4RKMKW.js +0 -1
- package/dist/standalone/chunk-APSSZB6Z.js +0 -1
- package/dist/standalone/chunk-AXNGWSBM.js +0 -1
- package/dist/standalone/chunk-AXZILWRM.js +0 -1
- package/dist/standalone/chunk-C7RHEBOH.js +0 -1
- package/dist/standalone/chunk-CKSHCYGC.js +0 -2
- package/dist/standalone/chunk-CSWIYOB3.js +0 -1
- package/dist/standalone/chunk-D3VAON25.js +0 -1
- package/dist/standalone/chunk-DDLQN67F.js +0 -1
- package/dist/standalone/chunk-DGHW5JG5.js +0 -1
- package/dist/standalone/chunk-DMCSOTAE.js +0 -3
- package/dist/standalone/chunk-E3BKETAS.js +0 -1
- package/dist/standalone/chunk-E3OXNN6O.js +0 -1
- package/dist/standalone/chunk-E6BOGDIS.js +0 -1
- package/dist/standalone/chunk-F2YMCQ6B.js +0 -1
- package/dist/standalone/chunk-F7GE4X2U.js +0 -1
- package/dist/standalone/chunk-FAVUOGJR.js +0 -1
- package/dist/standalone/chunk-FXP6256Q.js +0 -1
- package/dist/standalone/chunk-G6CTAYHJ.js +0 -1
- package/dist/standalone/chunk-GTM65MVX.js +0 -1
- package/dist/standalone/chunk-H42W62SE.js +0 -1
- package/dist/standalone/chunk-HTF5ZX4I.js +0 -8
- package/dist/standalone/chunk-HV7G6DFP.js +0 -5
- package/dist/standalone/chunk-I2PS4L74.js +0 -1
- package/dist/standalone/chunk-IYHPYY4A.js +0 -1
- package/dist/standalone/chunk-J6J54MBP.js +0 -1
- package/dist/standalone/chunk-J7OGP4NN.js +0 -1
- package/dist/standalone/chunk-JSEXCW5Q.js +0 -1
- package/dist/standalone/chunk-JZLGLG4T.js +0 -1
- package/dist/standalone/chunk-KEGAWN6Y.js +0 -1
- package/dist/standalone/chunk-KZ6INM5M.js +0 -1
- package/dist/standalone/chunk-L2LN3MK4.js +0 -4
- package/dist/standalone/chunk-LT3FH6MW.js +0 -1
- package/dist/standalone/chunk-LZUWZBPE.js +0 -1
- package/dist/standalone/chunk-M4JM3TOY.js +0 -1
- package/dist/standalone/chunk-MLA5ZAEB.js +0 -1
- package/dist/standalone/chunk-MRBI5HNQ.js +0 -1
- package/dist/standalone/chunk-N5XX4HOL.js +0 -6
- package/dist/standalone/chunk-N7SVJOHN.js +0 -1
- package/dist/standalone/chunk-NKFXMDOD.js +0 -1
- package/dist/standalone/chunk-NPSNKFHE.js +0 -1
- package/dist/standalone/chunk-O3NAGRTR.js +0 -1
- package/dist/standalone/chunk-O7FVPUCO.js +0 -1
- package/dist/standalone/chunk-OKQXTLFX.js +0 -1
- package/dist/standalone/chunk-OXHHSUXO.js +0 -1
- package/dist/standalone/chunk-QAFAJBAW.js +0 -1
- package/dist/standalone/chunk-QAIM6KWT.js +0 -1
- package/dist/standalone/chunk-QCPMTB6W.js +0 -1
- package/dist/standalone/chunk-QQ2LOSZL.js +0 -1
- package/dist/standalone/chunk-QVIPA6UJ.js +0 -1
- package/dist/standalone/chunk-QVUQXJCT.js +0 -4
- package/dist/standalone/chunk-R2GMHLJY.js +0 -1
- package/dist/standalone/chunk-RD5UG2YL.js +0 -1
- package/dist/standalone/chunk-RJTIP3WF.js +0 -1
- package/dist/standalone/chunk-RRCPZMC2.js +0 -22
- package/dist/standalone/chunk-SHERR7ZP.js +0 -1
- package/dist/standalone/chunk-SOC5CY3F.js +0 -1
- package/dist/standalone/chunk-SS7JLF2I.js +0 -4
- package/dist/standalone/chunk-SWWYUGPL.js +0 -2
- package/dist/standalone/chunk-TAD43CG5.js +0 -1
- package/dist/standalone/chunk-TTXRHJUP.js +0 -4
- package/dist/standalone/chunk-UK64ZSUW.js +0 -1
- package/dist/standalone/chunk-UKDHGVOC.js +0 -1
- package/dist/standalone/chunk-UPNTMJFF.js +0 -1
- package/dist/standalone/chunk-V43BLH4J.js +0 -1
- package/dist/standalone/chunk-VL23Y44O.js +0 -4
- package/dist/standalone/chunk-VXM5H542.js +0 -4
- package/dist/standalone/chunk-WMDH2CIZ.js +0 -1
- package/dist/standalone/chunk-WVTPZ6CM.js +0 -1
- package/dist/standalone/chunk-XN6QYJQ6.js +0 -13
- package/dist/standalone/chunk-XNJNSCLM.js +0 -1
- package/dist/standalone/chunk-Y4U6CC22.js +0 -1
- package/dist/standalone/chunk-Y572GMZE.js +0 -1
- package/dist/standalone/chunk-Y7PD5KP4.js +0 -76
- package/dist/standalone/chunk-YFIPHCEC.js +0 -1
- package/dist/standalone/chunk-YJXOWLFJ.js +0 -1
- package/dist/standalone/chunk-YNN6NFRZ.js +0 -1
- package/dist/standalone/chunk-YUGHRVPD.js +0 -1
- package/dist/standalone/chunk-ZIGWVHCS.js +0 -1
- package/dist/standalone/chunk-ZPP2KOR4.js +0 -1
- package/dist/standalone/chunk-ZPUO7FNI.js +0 -1
- /package/dist/standalone/{chunk-TEWVD66F.js → chunk-GXZAXNZI.js} +0 -0
|
@@ -1,290 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useLunora } from '@lunora/react';
|
|
3
|
-
import { useNavigate, useRouter, useSearch } from '@tanstack/react-router';
|
|
4
|
-
import { useRef, useState, useEffect } from 'react';
|
|
5
|
-
import { T as TIER_META } from '../packem_shared/storage-tier-CL98eOvn.js';
|
|
6
|
-
import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
|
|
7
|
-
import { s as searchToDataView, d as dataViewToSearch } from '../packem_shared/data-view-params-Cd6yRVbv.js';
|
|
8
|
-
import { f as fireAndForget } from '../packem_shared/internal-DzHCc2Rq.js';
|
|
9
|
-
import { l as loadJsonArray, s as saveJson } from '../packem_shared/browser-storage-L4gOP5gJ.js';
|
|
10
|
-
import { DataBrowser } from '../packem_shared/DataBrowser-obTn4sKX.js';
|
|
11
|
-
import { GlobalDataBrowser } from '../packem_shared/GlobalDataBrowser-BCaohHZ5.js';
|
|
12
|
-
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
13
|
-
|
|
14
|
-
const STORAGE_KEY = "lunora-studio-saved-queries";
|
|
15
|
-
const MAX_SAVED = 50;
|
|
16
|
-
const isSavedQuery = (entry) => entry !== null && typeof entry === "object" && typeof entry.name === "string" && typeof entry.view === "object" && entry.view !== null;
|
|
17
|
-
const loadSavedQueries = () => loadJsonArray(STORAGE_KEY).filter(isSavedQuery);
|
|
18
|
-
const persist = (queries) => {
|
|
19
|
-
saveJson(STORAGE_KEY, queries);
|
|
20
|
-
};
|
|
21
|
-
const saveQuery = (name, view) => {
|
|
22
|
-
const trimmed = name.trim();
|
|
23
|
-
if (trimmed === "") {
|
|
24
|
-
return loadSavedQueries();
|
|
25
|
-
}
|
|
26
|
-
const next = [{
|
|
27
|
-
name: trimmed,
|
|
28
|
-
view
|
|
29
|
-
}, ...loadSavedQueries().filter((entry) => entry.name !== trimmed)].slice(0, MAX_SAVED);
|
|
30
|
-
persist(next);
|
|
31
|
-
return next;
|
|
32
|
-
};
|
|
33
|
-
const deleteSavedQuery = (name) => {
|
|
34
|
-
const next = loadSavedQueries().filter((entry) => entry.name !== name);
|
|
35
|
-
persist(next);
|
|
36
|
-
return next;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const SchemaSwitch = (t0) => {
|
|
40
|
-
const $ = c(15);
|
|
41
|
-
const {
|
|
42
|
-
onChange,
|
|
43
|
-
tier
|
|
44
|
-
} = t0;
|
|
45
|
-
const t = useT();
|
|
46
|
-
let t1;
|
|
47
|
-
if ($[0] !== onChange) {
|
|
48
|
-
t1 = (event) => {
|
|
49
|
-
onChange(event.target.value);
|
|
50
|
-
};
|
|
51
|
-
$[0] = onChange;
|
|
52
|
-
$[1] = t1;
|
|
53
|
-
} else {
|
|
54
|
-
t1 = $[1];
|
|
55
|
-
}
|
|
56
|
-
const onSelect = t1;
|
|
57
|
-
let t2;
|
|
58
|
-
if ($[2] !== t) {
|
|
59
|
-
t2 = t("Storage tier");
|
|
60
|
-
$[2] = t;
|
|
61
|
-
$[3] = t2;
|
|
62
|
-
} else {
|
|
63
|
-
t2 = $[3];
|
|
64
|
-
}
|
|
65
|
-
let t3;
|
|
66
|
-
if ($[4] !== t2) {
|
|
67
|
-
t3 = /* @__PURE__ */ jsxDEV("span", {
|
|
68
|
-
className: "font-mono text-[11px] tracking-wide uppercase text-muted-foreground",
|
|
69
|
-
children: t2
|
|
70
|
-
}, void 0, false);
|
|
71
|
-
$[4] = t2;
|
|
72
|
-
$[5] = t3;
|
|
73
|
-
} else {
|
|
74
|
-
t3 = $[5];
|
|
75
|
-
}
|
|
76
|
-
const t4 = TIER_META[tier];
|
|
77
|
-
let t5;
|
|
78
|
-
let t6;
|
|
79
|
-
if ($[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
80
|
-
t5 = /* @__PURE__ */ jsxDEV("option", {
|
|
81
|
-
value: "shard",
|
|
82
|
-
children: TIER_META.shard.label
|
|
83
|
-
}, void 0, false);
|
|
84
|
-
t6 = /* @__PURE__ */ jsxDEV("option", {
|
|
85
|
-
value: "global",
|
|
86
|
-
children: TIER_META.global.label
|
|
87
|
-
}, void 0, false);
|
|
88
|
-
$[6] = t5;
|
|
89
|
-
$[7] = t6;
|
|
90
|
-
} else {
|
|
91
|
-
t5 = $[6];
|
|
92
|
-
t6 = $[7];
|
|
93
|
-
}
|
|
94
|
-
let t7;
|
|
95
|
-
if ($[8] !== onSelect || $[9] !== t4.title || $[10] !== tier) {
|
|
96
|
-
t7 = /* @__PURE__ */ jsxDEV("select", {
|
|
97
|
-
className: "h-8 w-full rounded-md border border-border bg-background px-2 text-sm outline-none focus-visible:border-ring",
|
|
98
|
-
"data-testid": "table-editor-schema",
|
|
99
|
-
id: "table-editor-schema",
|
|
100
|
-
onChange: onSelect,
|
|
101
|
-
title: t4.title,
|
|
102
|
-
value: tier,
|
|
103
|
-
children: [t5, t6]
|
|
104
|
-
}, void 0, true);
|
|
105
|
-
$[8] = onSelect;
|
|
106
|
-
$[9] = t4.title;
|
|
107
|
-
$[10] = tier;
|
|
108
|
-
$[11] = t7;
|
|
109
|
-
} else {
|
|
110
|
-
t7 = $[11];
|
|
111
|
-
}
|
|
112
|
-
let t8;
|
|
113
|
-
if ($[12] !== t3 || $[13] !== t7) {
|
|
114
|
-
t8 = /* @__PURE__ */ jsxDEV("label", {
|
|
115
|
-
className: "flex w-full flex-col gap-1",
|
|
116
|
-
htmlFor: "table-editor-schema",
|
|
117
|
-
children: [t3, t7]
|
|
118
|
-
}, void 0, true);
|
|
119
|
-
$[12] = t3;
|
|
120
|
-
$[13] = t7;
|
|
121
|
-
$[14] = t8;
|
|
122
|
-
} else {
|
|
123
|
-
t8 = $[14];
|
|
124
|
-
}
|
|
125
|
-
return t8;
|
|
126
|
-
};
|
|
127
|
-
const TableEditor = ({
|
|
128
|
-
editable = false,
|
|
129
|
-
initialShardKey
|
|
130
|
-
}) => {
|
|
131
|
-
const client = useLunora();
|
|
132
|
-
const navigate = useNavigate();
|
|
133
|
-
const router = useRouter();
|
|
134
|
-
const search = useSearch({
|
|
135
|
-
strict: false
|
|
136
|
-
});
|
|
137
|
-
const view = searchToDataView(search);
|
|
138
|
-
const searchRef = useRef(search);
|
|
139
|
-
searchRef.current = search;
|
|
140
|
-
const onDataRoute = () => router.state.location.pathname.split("/").findLast(Boolean) === "data";
|
|
141
|
-
const tier = view.tier ?? "shard";
|
|
142
|
-
const tableParameter = view.table;
|
|
143
|
-
const [savedQueries, setSavedQueries] = useState(() => loadSavedQueries());
|
|
144
|
-
const [globalTableNames, setGlobalTableNames] = useState(() => /* @__PURE__ */ new Set());
|
|
145
|
-
useEffect(() => {
|
|
146
|
-
fireAndForget((async () => {
|
|
147
|
-
try {
|
|
148
|
-
const tables = await client.listGlobalTables();
|
|
149
|
-
setGlobalTableNames(new Set(tables.map((table) => table.name)));
|
|
150
|
-
} catch {
|
|
151
|
-
}
|
|
152
|
-
})());
|
|
153
|
-
}, [client]);
|
|
154
|
-
useEffect(() => {
|
|
155
|
-
if (tier === "shard" && tableParameter !== void 0 && globalTableNames.has(tableParameter)) {
|
|
156
|
-
fireAndForget(navigate({
|
|
157
|
-
replace: true,
|
|
158
|
-
search: (previous) => {
|
|
159
|
-
return {
|
|
160
|
-
...previous,
|
|
161
|
-
schema: "global"
|
|
162
|
-
};
|
|
163
|
-
},
|
|
164
|
-
to: "/data"
|
|
165
|
-
}));
|
|
166
|
-
}
|
|
167
|
-
}, [globalTableNames, navigate, tableParameter, tier]);
|
|
168
|
-
const selectTier = (next) => {
|
|
169
|
-
fireAndForget(navigate({
|
|
170
|
-
search: (previous_0) => {
|
|
171
|
-
return {
|
|
172
|
-
...previous_0,
|
|
173
|
-
schema: next === "global" ? "global" : void 0,
|
|
174
|
-
table: void 0
|
|
175
|
-
};
|
|
176
|
-
},
|
|
177
|
-
to: "/data"
|
|
178
|
-
}));
|
|
179
|
-
};
|
|
180
|
-
const onSelectTable = (table_0, options) => {
|
|
181
|
-
if (!onDataRoute()) {
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
fireAndForget(navigate({
|
|
185
|
-
search: (previous_1) => {
|
|
186
|
-
return {
|
|
187
|
-
schema: previous_1["schema"],
|
|
188
|
-
search: options?.search,
|
|
189
|
-
shard: previous_1["shard"],
|
|
190
|
-
table: table_0
|
|
191
|
-
};
|
|
192
|
-
},
|
|
193
|
-
to: "/data"
|
|
194
|
-
}));
|
|
195
|
-
};
|
|
196
|
-
const onNavigateToGlobal = (table_1) => {
|
|
197
|
-
fireAndForget(navigate({
|
|
198
|
-
search: (previous_2) => {
|
|
199
|
-
return {
|
|
200
|
-
...previous_2,
|
|
201
|
-
schema: "global",
|
|
202
|
-
table: table_1
|
|
203
|
-
};
|
|
204
|
-
},
|
|
205
|
-
to: "/data"
|
|
206
|
-
}));
|
|
207
|
-
};
|
|
208
|
-
const onViewChange = (next_0) => {
|
|
209
|
-
const patch = dataViewToSearch(next_0);
|
|
210
|
-
const {
|
|
211
|
-
current
|
|
212
|
-
} = searchRef;
|
|
213
|
-
const unchanged = (current["filters"] ?? void 0) === patch.filters && (current["order"] ?? void 0) === patch.order && (current["search"] ?? void 0) === patch.search && (current["shard"] ?? void 0) === patch.shard;
|
|
214
|
-
if (unchanged || !onDataRoute()) {
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
fireAndForget(navigate({
|
|
218
|
-
replace: true,
|
|
219
|
-
search: (previous_3) => {
|
|
220
|
-
return {
|
|
221
|
-
...previous_3,
|
|
222
|
-
filters: patch.filters,
|
|
223
|
-
order: patch.order,
|
|
224
|
-
search: patch.search,
|
|
225
|
-
shard: patch.shard
|
|
226
|
-
};
|
|
227
|
-
},
|
|
228
|
-
to: "/data"
|
|
229
|
-
}));
|
|
230
|
-
};
|
|
231
|
-
const onCopyLink = () => {
|
|
232
|
-
try {
|
|
233
|
-
fireAndForget(globalThis.navigator.clipboard.writeText(globalThis.location.href));
|
|
234
|
-
} catch {
|
|
235
|
-
}
|
|
236
|
-
};
|
|
237
|
-
const onSaveQuery = (name, snapshot) => {
|
|
238
|
-
setSavedQueries(saveQuery(name, snapshot));
|
|
239
|
-
};
|
|
240
|
-
const onDeleteQuery = (name_0) => {
|
|
241
|
-
setSavedQueries(deleteSavedQuery(name_0));
|
|
242
|
-
};
|
|
243
|
-
const onApplyQuery = (query) => {
|
|
244
|
-
const patch_0 = dataViewToSearch(query.view);
|
|
245
|
-
fireAndForget(navigate({
|
|
246
|
-
search: () => {
|
|
247
|
-
return {
|
|
248
|
-
filters: patch_0.filters,
|
|
249
|
-
order: patch_0.order,
|
|
250
|
-
schema: patch_0.schema,
|
|
251
|
-
search: patch_0.search,
|
|
252
|
-
shard: patch_0.shard,
|
|
253
|
-
table: patch_0.table
|
|
254
|
-
};
|
|
255
|
-
},
|
|
256
|
-
to: "/data"
|
|
257
|
-
}));
|
|
258
|
-
};
|
|
259
|
-
const queryBar = {
|
|
260
|
-
onApplyQuery,
|
|
261
|
-
onCopyLink,
|
|
262
|
-
onDeleteQuery,
|
|
263
|
-
onSaveQuery,
|
|
264
|
-
saved: savedQueries
|
|
265
|
-
};
|
|
266
|
-
const schemaSwitch = /* @__PURE__ */ jsxDEV(SchemaSwitch, {
|
|
267
|
-
onChange: selectTier,
|
|
268
|
-
tier
|
|
269
|
-
}, void 0, false);
|
|
270
|
-
return tier === "global" ? /* @__PURE__ */ jsxDEV(GlobalDataBrowser, {
|
|
271
|
-
initialTable: tableParameter,
|
|
272
|
-
onSelectTable,
|
|
273
|
-
schemaSwitch
|
|
274
|
-
}, void 0, false) : /* @__PURE__ */ jsxDEV(DataBrowser, {
|
|
275
|
-
editable,
|
|
276
|
-
globalTableNames,
|
|
277
|
-
initialFilters: view.filters,
|
|
278
|
-
initialOrderBy: view.orderBy,
|
|
279
|
-
initialSearch: view.search,
|
|
280
|
-
initialShardKey: view.shard ?? initialShardKey,
|
|
281
|
-
onNavigateToGlobal,
|
|
282
|
-
onSelectTable,
|
|
283
|
-
onViewChange,
|
|
284
|
-
queryBar,
|
|
285
|
-
schemaSwitch,
|
|
286
|
-
tableParam: tableParameter
|
|
287
|
-
}, void 0, false);
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
export { TableEditor };
|
|
1
|
+
import{c as G}from"react/compiler-runtime";import{useLunora as L}from"@lunora/react";import{useNavigate as Q,useRouter as q,useSearch as J}from"@tanstack/react-router";import{useRef as K,useState as N,useEffect as B}from"react";import{d as S}from"../packem_shared/storage-tier-DznqOf-q.js";import{useT as R}from"../packem_shared/DEFAULT_LOCALE-BZ4NojpD.js";import{s as _,d as C}from"../packem_shared/data-view-params-C8T3bW1z.js";import{f}from"../packem_shared/internal-AtZ4bTal.js";import{l as O,s as P}from"../packem_shared/browser-storage-xjTyMKY0.js";import{DataBrowser as z}from"../packem_shared/DataBrowser-B8J5lHjP.js";import{GlobalDataBrowser as H}from"../packem_shared/GlobalDataBrowser-RLJ6NvOs.js";import{jsx as v,jsxs as $}from"react/jsx-runtime";const j="lunora-studio-saved-queries",I=50,M=r=>r!==null&&typeof r=="object"&&typeof r.name=="string"&&typeof r.view=="object"&&r.view!==null,w=()=>O(j).filter(M),k=r=>{P(j,r)},U=(r,e)=>{const l=r.trim();if(l==="")return w();const o=[{name:l,view:e},...w().filter(u=>u.name!==l)].slice(0,I);return k(o),o},W=r=>{const e=w().filter(l=>l.name!==r);return k(e),e},X=r=>{const e=G(15),{onChange:l,tier:o}=r,u=R();let h;e[0]!==l?(h=y=>{l(y.target.value)},e[0]=l,e[1]=h):h=e[1];const s=h;let c;e[2]!==u?(c=u("Storage tier"),e[2]=u,e[3]=c):c=e[3];let n;e[4]!==c?(n=v("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:c}),e[4]=c,e[5]=n):n=e[5];const m=S[o];let i,g;e[6]===Symbol.for("react.memo_cache_sentinel")?(i=v("option",{value:"shard",children:S.shard.label}),g=v("option",{value:"global",children:S.global.label}),e[6]=i,e[7]=g):(i=e[6],g=e[7]);let d;e[8]!==s||e[9]!==m.title||e[10]!==o?(d=$("select",{className:"h-8 w-full rounded-md border border-border bg-background px-2 text-sm outline-none focus-visible:border-ring","data-testid":"table-editor-schema",id:"table-editor-schema",onChange:s,title:m.title,value:o,children:[i,g]}),e[8]=s,e[9]=m.title,e[10]=o,e[11]=d):d=e[11];let b;return e[12]!==n||e[13]!==d?(b=$("label",{className:"flex w-full flex-col gap-1",htmlFor:"table-editor-schema",children:[n,d]}),e[12]=n,e[13]=d,e[14]=b):b=e[14],b},de=({editable:r=!1,initialShardKey:e})=>{const l=L(),o=Q(),u=q(),h=J({strict:!1}),s=_(h),c=K(h);c.current=h;const n=()=>u.state.location.pathname.split("/").findLast(Boolean)==="data",m=s.tier??"shard",i=s.table,[g,d]=N(()=>w()),[b,y]=N(()=>new Set);B(()=>{f((async()=>{try{const t=await l.listGlobalTables();y(new Set(t.map(a=>a.name)))}catch{}})())},[l]),B(()=>{m==="shard"&&i!==void 0&&b.has(i)&&f(o({replace:!0,search:t=>({...t,schema:"global"}),to:"/data"}))},[b,o,i,m]);const D=t=>{f(o({search:a=>({...a,schema:t==="global"?"global":void 0,table:void 0}),to:"/data"}))},T=(t,a)=>{n()&&f(o({search:p=>({schema:p.schema,search:a?.search,shard:p.shard,table:t}),to:"/data"}))},V=t=>{f(o({search:a=>({...a,schema:"global",table:t}),to:"/data"}))},A=t=>{const a=C(t),{current:p}=c;(p.filters??void 0)===a.filters&&(p.order??void 0)===a.order&&(p.search??void 0)===a.search&&(p.shard??void 0)===a.shard||!n()||f(o({replace:!0,search:F=>({...F,filters:a.filters,order:a.order,search:a.search,shard:a.shard}),to:"/data"}))},E={onApplyQuery:t=>{const a=C(t.view);f(o({search:()=>({filters:a.filters,order:a.order,schema:a.schema,search:a.search,shard:a.shard,table:a.table}),to:"/data"}))},onCopyLink:()=>{try{f(globalThis.navigator.clipboard.writeText(globalThis.location.href))}catch{}},onDeleteQuery:t=>{d(W(t))},onSaveQuery:(t,a)=>{d(U(t,a))},saved:g},x=v(X,{onChange:D,tier:m});return m==="global"?v(H,{initialTable:i,onSelectTable:T,schemaSwitch:x}):v(z,{editable:r,globalTableNames:b,initialFilters:s.filters,initialOrderBy:s.orderBy,initialSearch:s.search,initialShardKey:s.shard??e,onNavigateToGlobal:V,onSelectTable:T,onViewChange:A,queryBar:E,schemaSwitch:x,tableParam:i})};export{de as TableEditor};
|
|
@@ -1,326 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { E as ErrorAlert } from '../packem_shared/error-alert-D9uIFJUS.js';
|
|
3
|
-
import { B as Badge } from '../packem_shared/badge-B2PKA1-5.js';
|
|
4
|
-
import { B as Button } from '../packem_shared/button-BhsN2uZH.js';
|
|
5
|
-
import { C as Card, a as CardContent } from '../packem_shared/card-F2vH_aj2.js';
|
|
6
|
-
import { E as EmptyState } from '../packem_shared/empty-state-DY_oe0k6.js';
|
|
7
|
-
import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from '../packem_shared/table-DsCa9Qp9.js';
|
|
8
|
-
import { u as useAdminQuery } from '../packem_shared/use-admin-query-C7JNuQp-.js';
|
|
9
|
-
import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
|
|
10
|
-
import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-P2UzJscH.js';
|
|
11
|
-
import { i as formatTimestamp } from '../packem_shared/internal-DzHCc2Rq.js';
|
|
12
|
-
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
13
|
-
|
|
14
|
-
const THREADS_TABLE = "agent_threads";
|
|
15
|
-
const MESSAGES_TABLE = "agent_messages";
|
|
16
|
-
const THREAD_LIMIT = 100;
|
|
17
|
-
const MESSAGE_LIMIT = 250;
|
|
18
|
-
const NO_ARGS = {};
|
|
19
|
-
const THREADS_ARGS = {
|
|
20
|
-
filters: [],
|
|
21
|
-
limit: THREAD_LIMIT,
|
|
22
|
-
offset: 0,
|
|
23
|
-
orderBy: {
|
|
24
|
-
column: "updatedAt",
|
|
25
|
-
direction: "desc"
|
|
26
|
-
},
|
|
27
|
-
skipCount: true,
|
|
28
|
-
table: THREADS_TABLE
|
|
29
|
-
};
|
|
30
|
-
const readString = (row, key) => {
|
|
31
|
-
const value = row[key];
|
|
32
|
-
return typeof value === "string" ? value : void 0;
|
|
33
|
-
};
|
|
34
|
-
const readNumber = (row, key) => {
|
|
35
|
-
const value = row[key];
|
|
36
|
-
return typeof value === "number" ? value : void 0;
|
|
37
|
-
};
|
|
38
|
-
const readTotalTokens = (row) => {
|
|
39
|
-
const {
|
|
40
|
-
usage
|
|
41
|
-
} = row;
|
|
42
|
-
if (usage === null || typeof usage !== "object") {
|
|
43
|
-
return void 0;
|
|
44
|
-
}
|
|
45
|
-
const {
|
|
46
|
-
totalTokens
|
|
47
|
-
} = usage;
|
|
48
|
-
return typeof totalTokens === "number" ? totalTokens : void 0;
|
|
49
|
-
};
|
|
50
|
-
const readToolNames = (row) => {
|
|
51
|
-
const {
|
|
52
|
-
toolCalls
|
|
53
|
-
} = row;
|
|
54
|
-
if (!Array.isArray(toolCalls)) {
|
|
55
|
-
return [];
|
|
56
|
-
}
|
|
57
|
-
return toolCalls.map((call) => call !== null && typeof call === "object" ? call.name : void 0).filter((name) => typeof name === "string");
|
|
58
|
-
};
|
|
59
|
-
const threadStatusVariant = (status) => {
|
|
60
|
-
switch (status) {
|
|
61
|
-
case "awaiting_input": {
|
|
62
|
-
return "warning";
|
|
63
|
-
}
|
|
64
|
-
case "cancelled": {
|
|
65
|
-
return "warning";
|
|
66
|
-
}
|
|
67
|
-
case "error": {
|
|
68
|
-
return "destructive";
|
|
69
|
-
}
|
|
70
|
-
case "running": {
|
|
71
|
-
return "info";
|
|
72
|
-
}
|
|
73
|
-
default: {
|
|
74
|
-
return "outline";
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
const approvalVariant = (status) => {
|
|
79
|
-
switch (status) {
|
|
80
|
-
case "approved": {
|
|
81
|
-
return "success";
|
|
82
|
-
}
|
|
83
|
-
case "rejected": {
|
|
84
|
-
return "destructive";
|
|
85
|
-
}
|
|
86
|
-
default: {
|
|
87
|
-
return "warning";
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
const AgentsPanel = ({
|
|
92
|
-
initialShardKey = ""
|
|
93
|
-
}) => {
|
|
94
|
-
const t = useT();
|
|
95
|
-
const [selectedKey, setSelectedKey] = useState(void 0);
|
|
96
|
-
const {
|
|
97
|
-
data: tables
|
|
98
|
-
} = useAdminQuery(ADMIN_FUNCTIONS.listTables, NO_ARGS, {
|
|
99
|
-
live: true,
|
|
100
|
-
shardKey: initialShardKey
|
|
101
|
-
});
|
|
102
|
-
const loadedTables = tables !== void 0;
|
|
103
|
-
const hasAgentTables = Array.isArray(tables) && tables.some((table) => table.name === THREADS_TABLE);
|
|
104
|
-
const {
|
|
105
|
-
data: threadsPage,
|
|
106
|
-
error: threadsError,
|
|
107
|
-
errorSource: threadsErrorSource,
|
|
108
|
-
liveError: threadsLiveError
|
|
109
|
-
} = useAdminQuery(ADMIN_FUNCTIONS.readTablePage, THREADS_ARGS, {
|
|
110
|
-
enabled: hasAgentTables,
|
|
111
|
-
live: true,
|
|
112
|
-
shardKey: initialShardKey
|
|
113
|
-
});
|
|
114
|
-
const messagesArgs = {
|
|
115
|
-
filters: [{
|
|
116
|
-
column: "threadKey",
|
|
117
|
-
operator: "eq",
|
|
118
|
-
value: selectedKey ?? ""
|
|
119
|
-
}],
|
|
120
|
-
limit: MESSAGE_LIMIT,
|
|
121
|
-
offset: 0,
|
|
122
|
-
orderBy: {
|
|
123
|
-
column: "seq",
|
|
124
|
-
direction: "asc"
|
|
125
|
-
},
|
|
126
|
-
skipCount: true,
|
|
127
|
-
table: MESSAGES_TABLE
|
|
128
|
-
};
|
|
129
|
-
const {
|
|
130
|
-
data: messagesPage,
|
|
131
|
-
error: messagesError,
|
|
132
|
-
errorSource: messagesErrorSource
|
|
133
|
-
} = useAdminQuery(ADMIN_FUNCTIONS.readTablePage, messagesArgs, {
|
|
134
|
-
enabled: hasAgentTables && selectedKey !== void 0,
|
|
135
|
-
live: true,
|
|
136
|
-
shardKey: initialShardKey
|
|
137
|
-
});
|
|
138
|
-
const threads = Array.isArray(threadsPage?.rows) ? threadsPage.rows : [];
|
|
139
|
-
const messages = Array.isArray(messagesPage?.rows) ? messagesPage.rows : [];
|
|
140
|
-
const selectedThread = threads.find((row) => readString(row, "key") === selectedKey);
|
|
141
|
-
let body;
|
|
142
|
-
if (loadedTables && !hasAgentTables) {
|
|
143
|
-
body = /* @__PURE__ */ jsxDEV(EmptyState, {
|
|
144
|
-
description: t("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."),
|
|
145
|
-
testId: "agents-unconfigured",
|
|
146
|
-
title: t("No agents configured")
|
|
147
|
-
}, void 0, false);
|
|
148
|
-
} else if (hasAgentTables && threads.length === 0) {
|
|
149
|
-
body = /* @__PURE__ */ jsxDEV(EmptyState, {
|
|
150
|
-
description: t("No agent has run yet. Start a run with ctx.agents.<name>.run(...) and its thread appears here."),
|
|
151
|
-
testId: "agents-empty",
|
|
152
|
-
title: t("No agent threads yet")
|
|
153
|
-
}, void 0, false);
|
|
154
|
-
} else {
|
|
155
|
-
body = /* @__PURE__ */ jsxDEV("div", {
|
|
156
|
-
className: "flex flex-col gap-6",
|
|
157
|
-
children: [/* @__PURE__ */ jsxDEV(Card, {
|
|
158
|
-
className: "overflow-hidden py-0",
|
|
159
|
-
children: /* @__PURE__ */ jsxDEV(CardContent, {
|
|
160
|
-
className: "px-0",
|
|
161
|
-
children: /* @__PURE__ */ jsxDEV(Table, {
|
|
162
|
-
"data-testid": "agents-threads-table",
|
|
163
|
-
children: [/* @__PURE__ */ jsxDEV(TableHeader, {
|
|
164
|
-
children: /* @__PURE__ */ jsxDEV(TableRow, {
|
|
165
|
-
children: [/* @__PURE__ */ jsxDEV(TableHead, {
|
|
166
|
-
children: t("Agent")
|
|
167
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
168
|
-
children: t("Key")
|
|
169
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
170
|
-
children: t("Status")
|
|
171
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
172
|
-
children: t("Messages")
|
|
173
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
174
|
-
children: t("Tokens")
|
|
175
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
176
|
-
children: t("Updated")
|
|
177
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
178
|
-
"aria-label": t("Actions")
|
|
179
|
-
}, void 0, false)]
|
|
180
|
-
}, void 0, true)
|
|
181
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
|
|
182
|
-
children: threads.map((row_0) => {
|
|
183
|
-
const key = readString(row_0, "key") ?? "";
|
|
184
|
-
const status = readString(row_0, "status");
|
|
185
|
-
const totalTokens = readTotalTokens(row_0);
|
|
186
|
-
return /* @__PURE__ */ jsxDEV(TableRow, {
|
|
187
|
-
"data-active": key === selectedKey ? "" : void 0,
|
|
188
|
-
"data-testid": `agents-thread-${key}`,
|
|
189
|
-
children: [/* @__PURE__ */ jsxDEV(TableCell, {
|
|
190
|
-
className: "font-mono text-xs",
|
|
191
|
-
children: readString(row_0, "agent") ?? "—"
|
|
192
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
193
|
-
className: "font-mono text-xs text-muted-foreground",
|
|
194
|
-
children: key
|
|
195
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
196
|
-
children: /* @__PURE__ */ jsxDEV(Badge, {
|
|
197
|
-
"data-testid": `agents-thread-status-${key}`,
|
|
198
|
-
variant: threadStatusVariant(status),
|
|
199
|
-
children: status ?? "—"
|
|
200
|
-
}, void 0, false)
|
|
201
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
202
|
-
className: "tabular-nums",
|
|
203
|
-
children: readNumber(row_0, "messageCount") ?? "—"
|
|
204
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
205
|
-
className: "tabular-nums text-muted-foreground",
|
|
206
|
-
children: totalTokens ?? "—"
|
|
207
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
208
|
-
className: "text-muted-foreground tabular-nums",
|
|
209
|
-
children: formatTimestamp(readNumber(row_0, "updatedAt"), "—")
|
|
210
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
211
|
-
className: "text-right",
|
|
212
|
-
children: /* @__PURE__ */ jsxDEV(Button, {
|
|
213
|
-
"data-testid": `agents-thread-open-${key}`,
|
|
214
|
-
onClick: () => {
|
|
215
|
-
setSelectedKey(key);
|
|
216
|
-
},
|
|
217
|
-
size: "sm",
|
|
218
|
-
type: "button",
|
|
219
|
-
variant: "outline",
|
|
220
|
-
children: t("Timeline")
|
|
221
|
-
}, void 0, false)
|
|
222
|
-
}, void 0, false)]
|
|
223
|
-
}, key, true);
|
|
224
|
-
})
|
|
225
|
-
}, void 0, false)]
|
|
226
|
-
}, void 0, true)
|
|
227
|
-
}, void 0, false)
|
|
228
|
-
}, void 0, false), messagesError !== null && /* @__PURE__ */ jsxDEV(ErrorAlert, {
|
|
229
|
-
error: messagesErrorSource,
|
|
230
|
-
testId: "agents-messages-error"
|
|
231
|
-
}, void 0, false), selectedKey !== void 0 && /* @__PURE__ */ jsxDEV(Card, {
|
|
232
|
-
className: "overflow-hidden py-0",
|
|
233
|
-
"data-testid": "agents-thread-detail",
|
|
234
|
-
children: /* @__PURE__ */ jsxDEV(CardContent, {
|
|
235
|
-
className: "flex flex-col gap-3 px-4 py-3",
|
|
236
|
-
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
237
|
-
className: "flex items-center justify-between gap-2",
|
|
238
|
-
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
239
|
-
className: "font-mono text-xs",
|
|
240
|
-
children: [t("Timeline"), " · ", selectedKey, selectedThread !== void 0 && /* @__PURE__ */ jsxDEV("span", {
|
|
241
|
-
className: "text-muted-foreground",
|
|
242
|
-
children: [" · ", t("Usage"), ": ", readTotalTokens(selectedThread) ?? 0, " ", t("Tokens")]
|
|
243
|
-
}, void 0, true)]
|
|
244
|
-
}, void 0, true), /* @__PURE__ */ jsxDEV(Button, {
|
|
245
|
-
"data-testid": "agents-thread-detail-close",
|
|
246
|
-
onClick: () => {
|
|
247
|
-
setSelectedKey(void 0);
|
|
248
|
-
},
|
|
249
|
-
size: "xs",
|
|
250
|
-
type: "button",
|
|
251
|
-
variant: "ghost",
|
|
252
|
-
children: t("Close")
|
|
253
|
-
}, void 0, false)]
|
|
254
|
-
}, void 0, true), messages.length === 0 ? /* @__PURE__ */ jsxDEV("p", {
|
|
255
|
-
className: "text-xs text-muted-foreground",
|
|
256
|
-
children: t("This thread has no messages yet.")
|
|
257
|
-
}, void 0, false) : /* @__PURE__ */ jsxDEV(Table, {
|
|
258
|
-
"data-testid": "agents-messages-table",
|
|
259
|
-
children: [/* @__PURE__ */ jsxDEV(TableHeader, {
|
|
260
|
-
children: /* @__PURE__ */ jsxDEV(TableRow, {
|
|
261
|
-
children: [/* @__PURE__ */ jsxDEV(TableHead, {
|
|
262
|
-
children: t("Role")
|
|
263
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
264
|
-
children: t("Content")
|
|
265
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
266
|
-
children: t("Tool")
|
|
267
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
268
|
-
children: t("Approval")
|
|
269
|
-
}, void 0, false)]
|
|
270
|
-
}, void 0, true)
|
|
271
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
|
|
272
|
-
children: messages.map((row_1, index) => {
|
|
273
|
-
const role = readString(row_1, "role") ?? "—";
|
|
274
|
-
const toolNames = readToolNames(row_1);
|
|
275
|
-
const toolName = readString(row_1, "toolName");
|
|
276
|
-
const approval = readString(row_1, "status");
|
|
277
|
-
const seq = readNumber(row_1, "seq") ?? index;
|
|
278
|
-
return /* @__PURE__ */ jsxDEV(TableRow, {
|
|
279
|
-
"data-testid": `agents-message-${String(seq)}`,
|
|
280
|
-
children: [/* @__PURE__ */ jsxDEV(TableCell, {
|
|
281
|
-
className: "font-mono text-xs align-top text-muted-foreground",
|
|
282
|
-
children: role
|
|
283
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
284
|
-
className: "max-w-md font-mono text-xs whitespace-pre-wrap break-words",
|
|
285
|
-
children: readString(row_1, "content") ?? "—"
|
|
286
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
287
|
-
className: "font-mono text-xs align-top text-muted-foreground",
|
|
288
|
-
children: toolName ?? (toolNames.length > 0 ? toolNames.join(", ") : "—")
|
|
289
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
290
|
-
className: "align-top",
|
|
291
|
-
children: approval === void 0 ? /* @__PURE__ */ jsxDEV("span", {
|
|
292
|
-
className: "text-xs text-muted-foreground",
|
|
293
|
-
children: "—"
|
|
294
|
-
}, void 0, false) : /* @__PURE__ */ jsxDEV(Badge, {
|
|
295
|
-
"data-testid": `agents-message-approval-${String(seq)}`,
|
|
296
|
-
variant: approvalVariant(approval),
|
|
297
|
-
children: approval
|
|
298
|
-
}, void 0, false)
|
|
299
|
-
}, void 0, false)]
|
|
300
|
-
}, readString(row_1, "messageKey") ?? `${role}:${String(seq)}`, true);
|
|
301
|
-
})
|
|
302
|
-
}, void 0, false)]
|
|
303
|
-
}, void 0, true)]
|
|
304
|
-
}, void 0, true)
|
|
305
|
-
}, void 0, false)]
|
|
306
|
-
}, void 0, true);
|
|
307
|
-
}
|
|
308
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
309
|
-
className: "flex flex-col gap-6",
|
|
310
|
-
"data-testid": "lunora-agents-panel",
|
|
311
|
-
children: [threadsError !== null && /* @__PURE__ */ jsxDEV(ErrorAlert, {
|
|
312
|
-
error: threadsErrorSource,
|
|
313
|
-
testId: "agents-error"
|
|
314
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("p", {
|
|
315
|
-
className: "text-sm text-muted-foreground",
|
|
316
|
-
children: t("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.")
|
|
317
|
-
}, void 0, false), threadsLiveError !== void 0 && /* @__PURE__ */ jsxDEV("p", {
|
|
318
|
-
className: "text-xs text-amber-600 dark:text-amber-500",
|
|
319
|
-
"data-testid": "agents-live-error",
|
|
320
|
-
role: "alert",
|
|
321
|
-
children: t("Live updates unavailable; showing the last evaluation.")
|
|
322
|
-
}, void 0, false), body]
|
|
323
|
-
}, void 0, true);
|
|
324
|
-
};
|
|
325
|
-
|
|
326
|
-
export { AgentsPanel };
|
|
1
|
+
import{useState as J}from"react";import{E as S}from"../packem_shared/error-alert-B59DnrDI.js";import{g as C}from"../packem_shared/badge-BbuuAio7.js";import{u as K}from"../packem_shared/button-BkCrNcAs.js";import{c as j,u as I}from"../packem_shared/card-CIDGUN6K.js";import{E}from"../packem_shared/empty-state-Cg7t_8qu.js";import{n as q,d as U,m as g,p as o,f as _,u as i}from"../packem_shared/table-DdJBrClo.js";import{K as y}from"../packem_shared/use-admin-query-Di3fLE8H.js";import{useT as R}from"../packem_shared/DEFAULT_LOCALE-BZ4NojpD.js";import{ADMIN_FUNCTIONS as N}from"../packem_shared/ADMIN_FUNCTIONS-BYNSbBVE.js";import{i as V}from"../packem_shared/internal-AtZ4bTal.js";import{jsx as e,jsxs as n}from"react/jsx-runtime";const M="agent_threads",W="agent_messages",X=100,Y=250,Z={},Q={filters:[],limit:X,offset:0,orderBy:{column:"updatedAt",direction:"desc"},skipCount:!0,table:M},d=(s,t)=>{const a=s[t];return typeof a=="string"?a:void 0},b=(s,t)=>{const a=s[t];return typeof a=="number"?a:void 0},z=s=>{const{usage:t}=s;if(t===null||typeof t!="object")return;const{totalTokens:a}=t;return typeof a=="number"?a:void 0},ee=s=>{const{toolCalls:t}=s;return Array.isArray(t)?t.map(a=>a!==null&&typeof a=="object"?a.name:void 0).filter(a=>typeof a=="string"):[]},te=s=>{switch(s){case"awaiting_input":return"warning";case"cancelled":return"warning";case"error":return"destructive";case"running":return"info";default:return"outline"}},ae=s=>{switch(s){case"approved":return"success";case"rejected":return"destructive";default:return"warning"}},pe=({initialShardKey:s=""})=>{const t=R(),[a,w]=J(void 0),{data:p}=y(N.listTables,Z,{live:!0,shardKey:s}),P=p!==void 0,m=Array.isArray(p)&&p.some(r=>r.name===M),{data:A,error:B,errorSource:D,liveError:L}=y(N.readTablePage,Q,{enabled:m,live:!0,shardKey:s}),O={filters:[{column:"threadKey",operator:"eq",value:a??""}],limit:Y,offset:0,orderBy:{column:"seq",direction:"asc"},skipCount:!0,table:W},{data:$,error:F,errorSource:G}=y(N.readTablePage,O,{enabled:m&&a!==void 0,live:!0,shardKey:s}),f=Array.isArray(A?.rows)?A.rows:[],k=Array.isArray($?.rows)?$.rows:[],T=f.find(r=>d(r,"key")===a);let u;return P&&!m?u=e(E,{description:t("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."),testId:"agents-unconfigured",title:t("No agents configured")}):m&&f.length===0?u=e(E,{description:t("No agent has run yet. Start a run with ctx.agents.<name>.run(...) and its thread appears here."),testId:"agents-empty",title:t("No agent threads yet")}):u=n("div",{className:"flex flex-col gap-6",children:[e(j,{className:"overflow-hidden py-0",children:e(I,{className:"px-0",children:n(q,{"data-testid":"agents-threads-table",children:[e(U,{children:n(g,{children:[e(o,{children:t("Agent")}),e(o,{children:t("Key")}),e(o,{children:t("Status")}),e(o,{children:t("Messages")}),e(o,{children:t("Tokens")}),e(o,{children:t("Updated")}),e(o,{"aria-label":t("Actions")})]})}),e(_,{children:f.map(r=>{const l=d(r,"key")??"",c=d(r,"status"),h=z(r);return n(g,{"data-active":l===a?"":void 0,"data-testid":`agents-thread-${l}`,children:[e(i,{className:"font-mono text-xs",children:d(r,"agent")??"—"}),e(i,{className:"font-mono text-xs text-muted-foreground",children:l}),e(i,{children:e(C,{"data-testid":`agents-thread-status-${l}`,variant:te(c),children:c??"—"})}),e(i,{className:"tabular-nums",children:b(r,"messageCount")??"—"}),e(i,{className:"tabular-nums text-muted-foreground",children:h??"—"}),e(i,{className:"text-muted-foreground tabular-nums",children:V(b(r,"updatedAt"),"—")}),e(i,{className:"text-right",children:e(K,{"data-testid":`agents-thread-open-${l}`,onClick:()=>{w(l)},size:"sm",type:"button",variant:"outline",children:t("Timeline")})})]},l)})})]})})}),F!==null&&e(S,{error:G,testId:"agents-messages-error"}),a!==void 0&&e(j,{className:"overflow-hidden py-0","data-testid":"agents-thread-detail",children:n(I,{className:"flex flex-col gap-3 px-4 py-3",children:[n("div",{className:"flex items-center justify-between gap-2",children:[n("span",{className:"font-mono text-xs",children:[t("Timeline")," · ",a,T!==void 0&&n("span",{className:"text-muted-foreground",children:[" · ",t("Usage"),": ",z(T)??0," ",t("Tokens")]})]}),e(K,{"data-testid":"agents-thread-detail-close",onClick:()=>{w(void 0)},size:"xs",type:"button",variant:"ghost",children:t("Close")})]}),k.length===0?e("p",{className:"text-xs text-muted-foreground",children:t("This thread has no messages yet.")}):n(q,{"data-testid":"agents-messages-table",children:[e(U,{children:n(g,{children:[e(o,{children:t("Role")}),e(o,{children:t("Content")}),e(o,{children:t("Tool")}),e(o,{children:t("Approval")})]})}),e(_,{children:k.map((r,l)=>{const c=d(r,"role")??"—",h=ee(r),H=d(r,"toolName"),x=d(r,"status"),v=b(r,"seq")??l;return n(g,{"data-testid":`agents-message-${String(v)}`,children:[e(i,{className:"font-mono text-xs align-top text-muted-foreground",children:c}),e(i,{className:"max-w-md font-mono text-xs whitespace-pre-wrap break-words",children:d(r,"content")??"—"}),e(i,{className:"font-mono text-xs align-top text-muted-foreground",children:H??(h.length>0?h.join(", "):"—")}),e(i,{className:"align-top",children:x===void 0?e("span",{className:"text-xs text-muted-foreground",children:"—"}):e(C,{"data-testid":`agents-message-approval-${String(v)}`,variant:ae(x),children:x})})]},d(r,"messageKey")??`${c}:${String(v)}`)})})]})]})})]}),n("div",{className:"flex flex-col gap-6","data-testid":"lunora-agents-panel",children:[B!==null&&e(S,{error:D,testId:"agents-error"}),e("p",{className:"text-sm text-muted-foreground",children:t("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.")}),L!==void 0&&e("p",{className:"text-xs text-amber-600 dark:text-amber-500","data-testid":"agents-live-error",role:"alert",children:t("Live updates unavailable; showing the last evaluation.")}),u]})};export{pe as AgentsPanel};
|