dorkos 0.131.0 → 0.133.0
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/bin/cli.js +499 -314
- package/dist/browser/fresh-verifier.mjs +13 -13
- package/dist/browser/native/darwin-supervisor-worker.mjs +3 -3
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-BZ2LLJ0k.js → AboutPage-D-EHHVPa.js} +1 -1
- package/dist/client/assets/{ActivityErrorState-BnqAwUiy.js → ActivityErrorState-BTHnE1vP.js} +1 -1
- package/dist/client/assets/{ActivityPage-BlZKrSVo.js → ActivityPage-BfSLPIdR.js} +1 -1
- package/dist/client/assets/{ActivityRow-Ch8HxQ2m.js → ActivityRow-PwUBjQw8.js} +1 -1
- package/dist/client/assets/{AdapterIcon-CfocFMw-.js → AdapterIcon-DgkNN6bi.js} +1 -1
- package/dist/client/assets/{AdapterSetupWizard-Dtjx1Oad.js → AdapterSetupWizard-DX0dzp7q.js} +2 -2
- package/dist/client/assets/{AgentOptionRow-BGRvUeF7.js → AgentOptionRow-ApuDEKqq.js} +1 -1
- package/dist/client/assets/{AgentPicker-BcURPZQp.js → AgentPicker-BDci-9aL.js} +1 -1
- package/dist/client/assets/{AgentRequestCard-kNq5A_IN.js → AgentRequestCard-B2gxCMGi.js} +3 -3
- package/dist/client/assets/{AppearancePage-Cd-k7dcc.js → AppearancePage-8SVnFe0k.js} +1 -1
- package/dist/client/assets/ApplyToOverridesDialog-CnL1ubxL.js +1 -0
- package/dist/client/assets/{AttentionSignalRow-QY8AIjf9.js → AttentionSignalRow-CCKhUtil.js} +1 -1
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-Cgkvajbw.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-B7wFPzG4.js} +3 -3
- package/dist/client/assets/BindingDialog-C4BHVXno.js +1 -0
- package/dist/client/assets/{BlintzCanvas-CMzZnmWK.js → BlintzCanvas-7E5uwVms.js} +3 -3
- package/dist/client/assets/{CanvasCsvContent-uxMaHePf.js → CanvasCsvContent-l7lfyDGn.js} +4 -4
- package/dist/client/assets/CanvasFileContent-Bqd0IEfK.js +2 -0
- package/dist/client/assets/CanvasModel3dContent-DqL0Sy4r.js +2 -0
- package/dist/client/assets/{ChannelComposer-BAg0a29Q.js → ChannelComposer-CAYvz_ZB.js} +12 -17
- package/dist/client/assets/{ChatAppsOff-DD28V0vX.js → ChatAppsOff-CNeKBVNz.js} +2 -2
- package/dist/client/assets/{CodeMirrorDiff-CyoduBgM.js → CodeMirrorDiff-BZRcNFsS.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-DGccoZ8Q.js → CodeMirrorEditor-DD5tArRn.js} +1 -1
- package/dist/client/assets/{ComputerResourceView-Dk98shko.js → ComputerResourceView-BUmsVssG.js} +1 -1
- package/dist/client/assets/{ComputerViewer-Broprz4q.js → ComputerViewer-BKMR5LkF.js} +1 -1
- package/dist/client/assets/{ConnectionAccessLists-C_qLz8GJ.js → ConnectionAccessLists-DYUiFmPY.js} +1 -1
- package/dist/client/assets/{ConnectionsPage-CmGgGmDO.js → ConnectionsPage-DR2Kfm9Q.js} +2 -2
- package/dist/client/assets/{ConventionPage-BxWLIUUC.js → ConventionPage-Do6q8873.js} +2 -2
- package/dist/client/assets/{ExtensionPageRoute-CyfIRaGs.js → ExtensionPageRoute-CP7NM7fw.js} +2 -2
- package/dist/client/assets/{FeatureDisabledState-By2dhVpu.js → FeatureDisabledState-Bi23k3rg.js} +1 -1
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-B6wKQpLR.js → FloatingTanStackRouterDevtools-CqogiFob-lRlmDXYz.js} +1 -1
- package/dist/client/assets/{ForwardConsentHost-kDdpyBgA.js → ForwardConsentHost-DSR1pEEK.js} +1 -1
- package/dist/client/assets/HandlePage-aHId3bYX.js +1 -0
- package/dist/client/assets/HeartbeatPage-BTNVcHOI.js +1 -0
- package/dist/client/assets/{KeyEntry-Ctc1zp2J.js → KeyEntry-67acsEG2.js} +1 -1
- package/dist/client/assets/{LexicalField-7zd4B8f1.js → LexicalField-Cb68LIar.js} +2 -2
- package/dist/client/assets/{ManagesPage-BG1TIMP3.js → ManagesPage-ChPlBF42.js} +1 -1
- package/dist/client/assets/{Marketplace-C9r4jRJf.js → Marketplace-CzPhJEE1.js} +4 -4
- package/dist/client/assets/{MarketplaceSourcesView-C01Cdrge.js → MarketplaceSourcesView-CmQgxQmU.js} +1 -1
- package/dist/client/assets/{McpAppFrame-Dm7MqOhc.js → McpAppFrame-z5JUaCSA.js} +2 -2
- package/dist/client/assets/{McpSigninBody-CsXP_7lE.js → McpSigninBody-ZrnzwrOH.js} +1 -1
- package/dist/client/assets/{Model3dViewer-DOl8ZkrU.js → Model3dViewer-HJpWK-JI.js} +1 -1
- package/dist/client/assets/NamePage-C7F-SotG.js +1 -0
- package/dist/client/assets/{NewDirectMessageMenu-Dj-Qw8zA.js → NewDirectMessageMenu-CjBjzsDe.js} +1 -1
- package/dist/client/assets/{NotificationsPage-UExs4YE2.js → NotificationsPage-DwNUI0Z3.js} +1 -1
- package/dist/client/assets/{OpenMeshSwitch-Dx3M3wwS.js → OpenMeshSwitch-RNAZY1vn.js} +2 -2
- package/dist/client/assets/{OperatorIdentityForm-Bz5570RF.js → OperatorIdentityForm-B7S2C_eT.js} +1 -1
- package/dist/client/assets/PermissionHistory-D0chstxf.js +1 -0
- package/dist/client/assets/PermissionsPage-ToK0DZVV.js +1 -0
- package/dist/client/assets/{PersonalityPopover-Do-k_Hhw.js → PersonalityPopover-BvMtUQRM.js} +1 -1
- package/dist/client/assets/PhotoPage-Cqo3PNO_.js +1 -0
- package/dist/client/assets/{PreviewRefusedNotice-B-yyzQZP.js → PreviewRefusedNotice-DzbkMrUo.js} +1 -1
- package/dist/client/assets/{ProfileFields-DiarOK2y.js → ProfileFields-DU8dTGHT.js} +1 -1
- package/dist/client/assets/{ProfilePanelContainer-33Xkwoc3.js → ProfilePanelContainer-BfT-ufV7.js} +1 -1
- package/dist/client/assets/{ProfileRolePicker-BI6T4hj8.js → ProfileRolePicker-DrOtV-0N.js} +1 -1
- package/dist/client/assets/{PromptSuggestionChips-v5MScpZF.js → PromptSuggestionChips-CEnhme_V.js} +1 -1
- package/dist/client/assets/{ReportsToPopover-BALADuTO.js → ReportsToPopover-CwjpR1Tw.js} +1 -1
- package/dist/client/assets/{RoomSurface-BatV7gf5.js → RoomSurface-CChzNJKw.js} +1 -1
- package/dist/client/assets/{RoomsPage-DCCC3Dst.js → RoomsPage-Dbf6ijKr.js} +1 -1
- package/dist/client/assets/{RunsOnPopover-C7hMPyrb.js → RunsOnPopover-Bh5sSsSC.js} +1 -1
- package/dist/client/assets/{RuntimeConnectFlow-Dc5a8dlJ.js → RuntimeConnectFlow-BYQnY5vv.js} +1 -1
- package/dist/client/assets/{RuntimeSetupDialog-w90VGjJ4.js → RuntimeSetupDialog-DTO5v0dP.js} +1 -1
- package/dist/client/assets/{SeenDevices-BIMmbMWC.js → SeenDevices-cuY7ASEy.js} +3 -3
- package/dist/client/assets/{SessionsPage-0lwvSYHB.js → SessionsPage-BrqpVx-t.js} +1 -1
- package/dist/client/assets/{SettingsDialog-CrP6JzPg.js → SettingsDialog-DCAZX_1d.js} +4 -4
- package/dist/client/assets/{SkillsPage-BDgKWTfe.js → SkillsPage-D5who_ZH.js} +1 -1
- package/dist/client/assets/TaskDialogWrapper-BJ6XtOC5.js +1 -0
- package/dist/client/assets/TasksEmptyState-B3SjsxQa.js +3 -0
- package/dist/client/assets/{TasksPage-DjGbMGvn.js → TasksPage-B72w7J87.js} +1 -1
- package/dist/client/assets/{TeamComputerEntry-B_sM9Fik.js → TeamComputerEntry-B9ma5j-X.js} +1 -1
- package/dist/client/assets/TodoPromiseList-DDKWAfmv.js +1 -0
- package/dist/client/assets/TodoPromisesPage-BNXpvXzS.js +1 -0
- package/dist/client/assets/{ToolsPage-CeETRCd8.js → ToolsPage-DbJykCG3.js} +2 -2
- package/dist/client/assets/{TopologyGraph-CnpH2NjE.js → TopologyGraph-DKZS3nlr.js} +3 -3
- package/dist/client/assets/{TourHost-BQHrS47S.js → TourHost-Bw3Uoea5.js} +1 -1
- package/dist/client/assets/{UnlinkDialog-DOQLeNx4.js → UnlinkDialog-B-XCFNSd.js} +1 -1
- package/dist/client/assets/{UnreadDivider-DhyK6uGG.js → UnreadDivider-1aPVzwd7.js} +1 -1
- package/dist/client/assets/{WidgetErrorCard-Bwlfu514.js → WidgetErrorCard-C5ieVv_9.js} +6 -6
- package/dist/client/assets/{WithheldExtensionsNotice-BDc-CM2t.js → WithheldExtensionsNotice-CCO4ClRZ.js} +1 -1
- package/dist/client/assets/{WorkQueuePage-iO_DO1YK.js → WorkQueuePage-BbPKNwDg.js} +1 -1
- package/dist/client/assets/WorkView-BRcytACJ.js +51 -0
- package/dist/client/assets/_shell-EwFeSIGp.js +80 -0
- package/dist/client/assets/{_shell._home-BWi5YPaR.js → _shell._home-DD2mg-iK.js} +1 -1
- package/dist/client/assets/{_shell._home.activity-BU1NIGb7.js → _shell._home.activity-Z1QuU2M4.js} +1 -1
- package/dist/client/assets/_shell._home.index-BzTYr8Bw.js +3 -0
- package/dist/client/assets/_shell._home.tasks-BtC85Iut.js +1 -0
- package/dist/client/assets/{_shell._home.workspaces-wbnqJ58w.js → _shell._home.workspaces-qMG5OJYR.js} +1 -1
- package/dist/client/assets/{_shell.channels-D1KdvWZF.js → _shell.channels-BE4EK-iM.js} +2 -2
- package/dist/client/assets/_shell.connections-CBx0ogzx.js +1 -0
- package/dist/client/assets/{_shell.feedback-requests-DzHWC1fJ.js → _shell.feedback-requests-CwKSkkuD.js} +2 -2
- package/dist/client/assets/_shell.marketplace-CgWBUKSA.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-8HZpKFDI.js +1 -0
- package/dist/client/assets/_shell.session-D6HcVbnm.js +1 -0
- package/dist/client/assets/{_shell.team-BMNSUpQQ.js → _shell.team-Dm5a4f8_.js} +4 -4
- package/dist/client/assets/_shell.threads-BavVtQOE.js +1 -0
- package/dist/client/assets/_shell.todos-B6uWr0zA.js +6 -0
- package/dist/client/assets/_shell.x._extensionId-DaELdkCH.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-DaELdkCH.js +1 -0
- package/dist/client/assets/{abnfDiagram-WEYOIA3C-Co2k29JX.js → abnfDiagram-WEYOIA3C-Bu2T3jVw.js} +1 -1
- package/dist/client/assets/{access-copy-D6BUySpp.js → access-copy-tkiFMhRf.js} +1 -1
- package/dist/client/assets/{arc-DLZZpkuJ.js → arc-5q4SfXO9.js} +1 -1
- package/dist/client/assets/{architectureDiagram-ZHVYKT53-ClS9xqK5.js → architectureDiagram-ZHVYKT53-BnDMOBhV.js} +1 -1
- package/dist/client/assets/{banner-B8iMuXCP.js → banner-CSKUrrI0.js} +2 -2
- package/dist/client/assets/{blockDiagram-RJAE7QA3-DheoOELu.js → blockDiagram-RJAE7QA3-CtushlEs.js} +1 -1
- package/dist/client/assets/{c4Diagram-XDPPPE54-VWWZJ5x4.js → c4Diagram-XDPPPE54-7L-qYwKH.js} +1 -1
- package/dist/client/assets/channel-A3XT7_2L.js +1 -0
- package/dist/client/assets/{chunk-2E7WHVMD-BqPLJVkv.js → chunk-2E7WHVMD-ksBVyqQ3.js} +1 -1
- package/dist/client/assets/{chunk-2Q5K7J3B-DZn6OnKe.js → chunk-2Q5K7J3B-Bfqdkihb.js} +1 -1
- package/dist/client/assets/{chunk-4EMNKR2T-Dl9Poajp.js → chunk-4EMNKR2T-Brf2dH9x.js} +1 -1
- package/dist/client/assets/{chunk-55XCU76K-RoKuZPUc.js → chunk-55XCU76K-BlE7Cq40.js} +1 -1
- package/dist/client/assets/{chunk-5VM5RSS4-DV_1XHtU.js → chunk-5VM5RSS4-Bkgg3j7L.js} +1 -1
- package/dist/client/assets/{chunk-JWPE2WC7-B_IuS45y.js → chunk-JWPE2WC7-B9TRpN4O.js} +1 -1
- package/dist/client/assets/{chunk-VQ5W62QI-DkLNi45x.js → chunk-VQ5W62QI-ZoILnIYi.js} +1 -1
- package/dist/client/assets/{chunk-XXDRQBXY-ISM-1Dpw.js → chunk-XXDRQBXY-r2xNhaKz.js} +1 -1
- package/dist/client/assets/{chunk-ZCHMQSOR-MKaLMW8o.js → chunk-ZCHMQSOR-DfV3cF7d.js} +2 -2
- package/dist/client/assets/{classDiagram-v2-4MYWR3UA-CIWuu4ht.js → classDiagram-v2-4MYWR3UA-VOVqMNNP.js} +1 -1
- package/dist/client/assets/{command-CxGYZKco.js → command-CaUEAy3b.js} +1 -1
- package/dist/client/assets/{copy-button-DjAoGwds.js → copy-button-BOznikwM.js} +1 -1
- package/dist/client/assets/{cose-bilkent-JH36ORCC-HiCifRyi.js → cose-bilkent-JH36ORCC-CAdBvyLz.js} +1 -1
- package/dist/client/assets/{cpu-DHHTTvp_.js → cpu-j9vX9Wfk.js} +1 -1
- package/dist/client/assets/{cynefin-EF2NZ3EQ-DjJGZrPz.js → cynefin-EF2NZ3EQ-DcH1A9Oo.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-WF24UDRP-DE2NdiJ2.js → cynefinDiagram-WF24UDRP-DJuKBXHi.js} +1 -1
- package/dist/client/assets/{dagre-NK4GIZVX-C6gDOD26.js → dagre-NK4GIZVX-D099H_0S.js} +1 -1
- package/dist/client/assets/{detail-row-CjwI1iuc.js → detail-row-Crl89jnh.js} +1 -1
- package/dist/client/assets/{diagram-CBK3MWTC-38LckcsL.js → diagram-CBK3MWTC-Cd_4W9XO.js} +1 -1
- package/dist/client/assets/{diagram-I5XIIV2D--8L6D9Ra.js → diagram-I5XIIV2D-Bc7aQKt3.js} +1 -1
- package/dist/client/assets/{diagram-ODIL2UCW-DGC2Inhd.js → diagram-ODIL2UCW-awVJZ4Bg.js} +1 -1
- package/dist/client/assets/{diagram-PFBEJUXE-BDHp0AyR.js → diagram-PFBEJUXE-dhsj9aeU.js} +1 -1
- package/dist/client/assets/{diagram-RJA3I4VV-uBatJYPi.js → diagram-RJA3I4VV-Dm59CbiV.js} +1 -1
- package/dist/client/assets/{diagram-TYUNFSNR-C8e1EH9X.js → diagram-TYUNFSNR-BhvcIjA9.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-V4P3TTPT-DimRzU5B.js → ebnfDiagram-V4P3TTPT-C4wT_MTC.js} +1 -1
- package/dist/client/assets/{elk-QONTBCTQ-Dz6_Y2-G.js → elk-QONTBCTQ-CPI0zjmW.js} +1 -1
- package/dist/client/assets/{empty-state-saV209Il.js → empty-state-BHcmkSzu.js} +1 -1
- package/dist/client/assets/{erDiagram-KYQIGQAA-JeuTF8w6.js → erDiagram-KYQIGQAA-C_vGcbOB.js} +1 -1
- package/dist/client/assets/{execution-config-ClQZyDs9.js → execution-config-BS5rtvTZ.js} +1 -1
- package/dist/client/assets/{file-BIF-4ARS.js → file-CQGljfDT.js} +1 -1
- package/dist/client/assets/{file-exclamation-point-DxadH2b-.js → file-exclamation-point-B0a55VME.js} +1 -1
- package/dist/client/assets/{file-text-C_NPIQr4.js → file-text-Cycq_S0e.js} +1 -1
- package/dist/client/assets/{find-latest-widget-fence-CXai_zs0.js → find-latest-widget-fence-B6sJdG3Q.js} +4 -4
- package/dist/client/assets/{flowDiagram-IUGLLWBU-9FHDdK4j.js → flowDiagram-IUGLLWBU-_VNfmnxx.js} +1 -1
- package/dist/client/assets/{form-D3VdAYl4.js → form-BL14vwyB.js} +1 -1
- package/dist/client/assets/{format-cron-BqRDcFZM.js → format-cron-meJMgYNe.js} +1 -1
- package/dist/client/assets/{ganttDiagram-R7GPNTJY-CLMuXlHt.js → ganttDiagram-R7GPNTJY-o0gGU7X_.js} +1 -1
- package/dist/client/assets/{git-branch-Df7a5_fb.js → git-branch-CsLE6G0Y.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-sE7Rlpr6.js → gitGraphDiagram-PDYL7XHY-DjXjUpJo.js} +1 -1
- package/dist/client/assets/{graph-iNVyFhBQ.js → graph-BMYee_VK.js} +1 -1
- package/dist/client/assets/{heart-BHMhDZ0K.js → heart-Cn3a-UQI.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-VvvsrJbu.js → highlighted-body-KPVGNVTW-DsX5yCC0.js} +1 -1
- package/dist/client/assets/{image-lightbox-CGEIRguA.js → image-lightbox-BZ_eBZgA.js} +1 -1
- package/dist/client/assets/{image-off-C5-TmSq8.js → image-off-DjR7LI5G.js} +1 -1
- package/dist/client/assets/{index-C3zS0ghJ.js → index-1MwES_vb.js} +1 -1
- package/dist/client/assets/{index-ClyRhxV_.js → index-47--OGKJ.js} +1 -1
- package/dist/client/assets/{index-CTgUh4p3.js → index-4rSR8lau.js} +1 -1
- package/dist/client/assets/{index-D9bEy8X-.js → index-B4TxpTKD.js} +1 -1
- package/dist/client/assets/{index-Dw-4S640.js → index-B8LqLhq7.js} +1 -1
- package/dist/client/assets/index-BJRgbiEd.js +1 -0
- package/dist/client/assets/{index-DWZ5M321.js → index-BOCclWF3.js} +1 -1
- package/dist/client/assets/index-BR1m9FON.js +1066 -0
- package/dist/client/assets/index-BcFn_S6b.js +1 -0
- package/dist/client/assets/{index-DRtg_sGG.js → index-BcnwvTnt.js} +1 -1
- package/dist/client/assets/index-BdVQOlVQ.css +1 -0
- package/dist/client/assets/{index-DEvpdTo6.js → index-BmKHO-FD.js} +1 -1
- package/dist/client/assets/{index-Bd0PAkxf.js → index-BsZkXHsH.js} +1 -1
- package/dist/client/assets/{index-Cudi8rs6.js → index-BxWr8Mrf.js} +1 -1
- package/dist/client/assets/index-C5EvpXcq.js +1 -0
- package/dist/client/assets/{index-CExh9cKN.js → index-Cb_p_ynP.js} +1 -1
- package/dist/client/assets/{index-YZbu9tke.js → index-CczLBUKI.js} +1 -1
- package/dist/client/assets/{index-264YDu-W.js → index-Cf4Gtxf9.js} +1 -1
- package/dist/client/assets/{index-Dpu2CORc.js → index-CfKSlYjb.js} +1 -1
- package/dist/client/assets/{index-Bzm9YMbr.js → index-Cgjq7a-8.js} +1 -1
- package/dist/client/assets/{index-Ci_J5Q-6.js → index-CpWxcN5D.js} +1 -1
- package/dist/client/assets/{index-BK5QrGfQ.js → index-Cv67OXfk.js} +1 -1
- package/dist/client/assets/{index-Di-MIFQG.js → index-D5Qmx1JR.js} +3 -3
- package/dist/client/assets/{index-LPrq0pOA.js → index-DARchye_.js} +1 -1
- package/dist/client/assets/{index-DMwivStD.js → index-DFb4kOjm.js} +2 -2
- package/dist/client/assets/{index-WeLoaNzW.js → index-DLN0kcME.js} +1 -1
- package/dist/client/assets/{index-BMLCfTba.js → index-DMSSN08i.js} +1 -1
- package/dist/client/assets/{index-Y6BDhuGt.js → index-DQ8uADJF.js} +1 -1
- package/dist/client/assets/index-DZhMvc9m.js +1 -0
- package/dist/client/assets/{index-CLsoFUml.js → index-Dfko0tSp.js} +1 -1
- package/dist/client/assets/{index-BgdYXP8E.js → index-DiM3QX-4.js} +3 -3
- package/dist/client/assets/{index-BxFLHNLg.js → index-DlvUENo4.js} +1 -1
- package/dist/client/assets/{index-BLUUshO9.js → index-DqZmnJED.js} +1 -1
- package/dist/client/assets/{index-D_bAtIJZ.js → index-DrlB9RSk.js} +1 -1
- package/dist/client/assets/{index-CgWzzIbx.js → index-H4e5Wpmi.js} +1 -1
- package/dist/client/assets/{index-k67dvyau.js → index-Joav7LQU.js} +1 -1
- package/dist/client/assets/{index-B0FHRkHM.js → index-KganLhU1.js} +2 -2
- package/dist/client/assets/{index-DFkofTx1.js → index-Kt6r3DQg.js} +1 -1
- package/dist/client/assets/{index-B8I1k-z9.js → index-Z2ApBQt4.js} +1 -1
- package/dist/client/assets/index-dY7IFpet.js +1 -0
- package/dist/client/assets/{index-DYVNSRDk.js → index-faSyUc2q.js} +1 -1
- package/dist/client/assets/{index-BgRYuqWs.js → index-gmyiXkmr.js} +1 -1
- package/dist/client/assets/{index-BZTLFzJp.js → index-o6kGmVGx.js} +1 -1
- package/dist/client/assets/{index-C_0JoCV6.js → index-vHKVYcH7.js} +1 -1
- package/dist/client/assets/{index.esm-CYmalBux.js → index.esm-CJIDYBqd.js} +1 -1
- package/dist/client/assets/{infoDiagram-MVDRKAX5-0aR9wjgO.js → infoDiagram-MVDRKAX5-B1mMyUlp.js} +1 -1
- package/dist/client/assets/{inline-code-DyTKSC5b.js → inline-code-mh48Uhbi.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-D1lN8x2t.js → ishikawaDiagram-HPEHV2GE-efEMQ0_X.js} +1 -1
- package/dist/client/assets/{journeyDiagram-BOSHW7O7-CkXITXiJ.js → journeyDiagram-BOSHW7O7-DSAywiVk.js} +1 -1
- package/dist/client/assets/{kanban-definition-FNSA4HC5-ge33IiSq.js → kanban-definition-FNSA4HC5-B9pbU4zK.js} +1 -1
- package/dist/client/assets/{layers-Bx3K7OUm.js → layers-B0Z5Od3N.js} +1 -1
- package/dist/client/assets/{lightbulb-C5LvXkvM.js → lightbulb-Cfb5ecEd.js} +1 -1
- package/dist/client/assets/{link-2-Bj0_Zkvr.js → link-2-Dzy5BUL3.js} +1 -1
- package/dist/client/assets/{list-runtime-types-VNj1C8TB.js → list-runtime-types-DLmjtBMq.js} +1 -1
- package/dist/client/assets/{markdown-content-BRaPEOC7.js → markdown-content-DhAtZOfj.js} +1 -1
- package/dist/client/assets/{mention-pill-B_MiJWfo.js → mention-pill-DmA8FxL4.js} +1 -1
- package/dist/client/assets/{mermaid.core-B2hil_4a.js → mermaid.core-DUIkdbeL.js} +4 -4
- package/dist/client/assets/{message-square-off-T33FHpr7.js → message-square-off-BowIzJUV.js} +1 -1
- package/dist/client/assets/{mindmap-definition-6OY57UG3-Bu_Ia4Xz.js → mindmap-definition-6OY57UG3-Dz7ZOR4C.js} +1 -1
- package/dist/client/assets/{more-details-oDazWBxm.js → more-details-DV7LmY0E.js} +1 -1
- package/dist/client/assets/{owner-notice-VepbAQhj.js → owner-notice-DdFc2P8z.js} +1 -1
- package/dist/client/assets/{package-DBsl3ao5.js → package-BhKXbvU_.js} +1 -1
- package/dist/client/assets/{page-container-Bkarym6m.js → page-container-0sWZ3xh9.js} +1 -1
- package/dist/client/assets/{pane-resize-handle-gBlb5k1v.js → pane-resize-handle-Bjy4udre.js} +1 -1
- package/dist/client/assets/{paperclip-BeFttiUK.js → paperclip-C-7LhBfl.js} +1 -1
- package/dist/client/assets/{path-input-NY_yCBHb.js → path-input-BPVyI72G.js} +1 -1
- package/dist/client/assets/{pegDiagram-ECIUJNBX-0KmJlW0E.js → pegDiagram-ECIUJNBX-C4EOP-Fa.js} +1 -1
- package/dist/client/assets/{pieDiagram-GNMPY74T-IjeZXicv.js → pieDiagram-GNMPY74T-CQ1OxRkv.js} +1 -1
- package/dist/client/assets/{plug-CTqOZ7cA.js → plug-CIZ-wWL8.js} +1 -1
- package/dist/client/assets/{primer-trigger-CjaGrT2u.js → primer-trigger-XA5fLzR5.js} +2 -2
- package/dist/client/assets/{profile-errors-B8XkL2Rp.js → profile-errors-C1XACbc9.js} +1 -1
- package/dist/client/assets/{progress-Cr-4myw6.js → progress-BA2JPtb6.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-D57K4MC3-CP6kLJKa.js → quadrantDiagram-D57K4MC3-Cw4BdkpS.js} +1 -1
- package/dist/client/assets/{query-error-state-DvhY-YKM.js → query-error-state-Cm-Lozlb.js} +1 -1
- package/dist/client/assets/{radio-CmDmmJy6.js → radio-DQ29H26H.js} +1 -1
- package/dist/client/assets/{railroadDiagram-Y72NRBL7-Bcto__oE.js → railroadDiagram-Y72NRBL7-CSKtYLmm.js} +1 -1
- package/dist/client/assets/registry-Tbt9pcZl.js +39 -0
- package/dist/client/assets/registry-jD9zw538.js +1 -0
- package/dist/client/assets/{relay-trace-schemas-ZLR1S8ft.js → relay-trace-schemas-4AAUf-Zl.js} +2 -2
- package/dist/client/assets/{repeat-DVTM8et8.js → repeat-B8g-x-Sc.js} +1 -1
- package/dist/client/assets/{requirementDiagram-EQYSW5RA-DNJrds3m.js → requirementDiagram-EQYSW5RA-BPSBZr7X.js} +1 -1
- package/dist/client/assets/{room-files-source-9Wdtc-bG.js → room-files-source-BkiK4-ZI.js} +2 -2
- package/dist/client/assets/{rotate-ccw-clock-qJSWqifh.js → rotate-ccw-clock-DRtL-2nr.js} +1 -1
- package/dist/client/assets/{rotate-cw-uoeBxIeM.js → rotate-cw-BbHkWN-J.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-SY24JHO5-DNlU7xGI.js → sankeyDiagram-SY24JHO5-DVlHablQ.js} +1 -1
- package/dist/client/assets/{scroll-area-B1d3NfEn.js → scroll-area-DAC7NrVU.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-BLEHNHQU-CRk71coF.js → sequenceDiagram-BLEHNHQU--wZkN8xk.js} +1 -1
- package/dist/client/assets/{shield-x-BpQmg1qz.js → shield-x-CEWfkzDN.js} +1 -1
- package/dist/client/assets/{signed-in-CTmJ3OqM.js → signed-in-CMhCR-m8.js} +1 -1
- package/dist/client/assets/{sizeCapture-INFHLROL-cihX3QNq.js → sizeCapture-INFHLROL-CLXc7d3S.js} +1 -1
- package/dist/client/assets/{soul-file-BwiyiI5v.js → soul-file-CbX7rNqz.js} +1 -1
- package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-BAwwRsnH.js → stateDiagram-v2-A6IESKWZ-5xa1FM_X.js} +1 -1
- package/dist/client/assets/{swimlanes-B3ENRKFQ-CpDB6CUC.js → swimlanes-B3ENRKFQ-DKgxJxjE.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-f6MOc3pl.js +8 -0
- package/dist/client/assets/{table-dWrfPeX-.js → table-D0EJT0uP.js} +1 -1
- package/dist/client/assets/{tabs-D4txthOi.js → tabs-Ctjzrm8t.js} +1 -1
- package/dist/client/assets/{timeline-definition-JXYKGLGB-RDrKgCoU.js → timeline-definition-JXYKGLGB-B9P7ituI.js} +1 -1
- package/dist/client/assets/trust-dial-D__tIhzt.js +11 -0
- package/dist/client/assets/{trust-posture-atZIh8tf.js → trust-posture-DaHHtOZn.js} +1 -1
- package/dist/client/assets/{unplug-CnevV4yX.js → unplug-B-ipHefz.js} +1 -1
- package/dist/client/assets/{unverified-catalog-notice-BQwT36FA.js → unverified-catalog-notice-C8swqaTn.js} +1 -1
- package/dist/client/assets/{use-bindings-CltfjAWW.js → use-bindings-gLHRNAFU.js} +1 -1
- package/dist/client/assets/{use-composer-prefs-D-Zlt6z2.js → use-composer-prefs-CjpxcBIe.js} +1 -1
- package/dist/client/assets/{use-connector-management-C3CLnOOt.js → use-connector-management-BLiCJMgU.js} +1 -1
- package/dist/client/assets/{use-deep-link-scroll-DQlz-scx.js → use-deep-link-scroll-r2nKjzA-.js} +1 -1
- package/dist/client/assets/{use-delete-binding-D73CLm_7.js → use-delete-binding-BSiOik_K.js} +1 -1
- package/dist/client/assets/{use-dev-links-BqVFsMKU.js → use-dev-links-DXcIlMf-.js} +1 -1
- package/dist/client/assets/use-direct-message-panel-BbH8N4mE.js +1 -0
- package/dist/client/assets/{use-external-adapter-catalog-DrnksH0t.js → use-external-adapter-catalog-mmKni5ui.js} +1 -1
- package/dist/client/assets/{use-filter-state-D4i-hDOk.js → use-filter-state-CiPZ0AIH.js} +2 -2
- package/dist/client/assets/{use-full-activity-feed-DdDsRg8s.js → use-full-activity-feed-DXroUzfN.js} +1 -1
- package/dist/client/assets/use-is-below-desktop-LUZL5z5t.js +1 -0
- package/dist/client/assets/{use-mesh-topology-B7aLtPkZ.js → use-mesh-topology-upehQ5Cv.js} +1 -1
- package/dist/client/assets/{use-mounted-ref-DSSTCJfY.js → use-mounted-ref-IHwyriaF.js} +1 -1
- package/dist/client/assets/{use-notification-prefs-DaF3kwmq.js → use-notification-prefs-BHOK2P2l.js} +1 -1
- package/dist/client/assets/use-pending-read-mVsOBTzn.js +1 -0
- package/dist/client/assets/{use-personality-commit-D5b90JPX.js → use-personality-commit-Chf3UX8P.js} +1 -1
- package/dist/client/assets/{use-promo-activation-CPAOQpfe.js → use-promo-activation-Dlw6bg7G.js} +2 -2
- package/dist/client/assets/{use-promo-dismissals-Bx1gz1R1.js → use-promo-dismissals-Dx_fli7I.js} +1 -1
- package/dist/client/assets/{use-pulse-freshness-DeulB37O.js → use-pulse-freshness-CG_I6a-O.js} +1 -1
- package/dist/client/assets/{use-room-follow-claim-Dwke6RFQ.js → use-room-follow-claim-Bgrpr3bO.js} +1 -1
- package/dist/client/assets/{use-room-sessions-iepVrIMm.js → use-room-sessions-DecGrP3E.js} +1 -1
- package/dist/client/assets/{use-roving-tab-list-pCPKNQKv.js → use-roving-tab-list-CDkh-Ujm.js} +1 -1
- package/dist/client/assets/{use-session-canvas-BvvO-_V1.js → use-session-canvas-tvLLPQcm.js} +6 -6
- package/dist/client/assets/{use-status-budget-Bs7MMriS.js → use-status-budget-BBl2yxLR.js} +2 -2
- package/dist/client/assets/{use-todos-C-eREuDS.js → use-todos-BzRauzdQ.js} +1 -1
- package/dist/client/assets/{use-transform-lj3TkjYO.js → use-transform-DzJeHpxm.js} +1 -1
- package/dist/client/assets/{use-unclaimed-chats-BF3-0jHC.js → use-unclaimed-chats--HZdmq4F.js} +1 -1
- package/dist/client/assets/use-update-config-DjL7-nUR.js +1 -0
- package/dist/client/assets/{useMutationState-B_x_4f2K.js → useMutationState-DIywUTDG.js} +1 -1
- package/dist/client/assets/{usecaseDiagram-WPOLBNNX-DBsRYa4J.js → usecaseDiagram-WPOLBNNX-C9aLJ03F.js} +1 -1
- package/dist/client/assets/{vennDiagram-Q3Y3IDCW-rFAXvcQI.js → vennDiagram-Q3Y3IDCW-ChBIWbL0.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-IVAIDKWA-bI0JZkO3.js → wardleyDiagram-IVAIDKWA-DvQDOaTm.js} +1 -1
- package/dist/client/assets/{xychartDiagram-4URNHDU4-DZUd8iln.js → xychartDiagram-4URNHDU4-8FxLPP2c.js} +1 -1
- package/dist/client/assets/zap-DSllMMHe.js +6 -0
- package/dist/client/index.html +2 -2
- package/dist/drizzle/20261104060919_package_approval_request.sql +1 -0
- package/dist/drizzle/20261104081935_hook_decline_review.sql +3 -0
- package/dist/drizzle/20261107183323_dor3933_todos_rename.sql +64 -0
- package/dist/drizzle/20261108014418_dor3938_cross_agent_writer.sql +4 -0
- package/dist/drizzle/meta/20261104060919_snapshot.json +14889 -0
- package/dist/drizzle/meta/20261104081935_snapshot.json +14910 -0
- package/dist/drizzle/meta/20261107183323_snapshot.json +14910 -0
- package/dist/drizzle/meta/20261108014418_snapshot.json +14938 -0
- package/dist/drizzle/meta/_journal.json +28 -0
- package/dist/server/index.js +24875 -21931
- package/dist/server/index.js.map +2 -2
- package/package.json +5 -5
- package/dist/client/assets/ApplyToOverridesDialog-DE9VVQCA.js +0 -1
- package/dist/client/assets/BindingDialog-C_yflKOE.js +0 -1
- package/dist/client/assets/CanvasFileContent-C3ZKszxn.js +0 -2
- package/dist/client/assets/CanvasModel3dContent-CsNUuaj6.js +0 -2
- package/dist/client/assets/CommitmentList-DOvfnyDA.js +0 -1
- package/dist/client/assets/CommitmentsPage-D81vxHUk.js +0 -1
- package/dist/client/assets/HandlePage-vsG04kBg.js +0 -1
- package/dist/client/assets/HeartbeatPage-CMj1SS30.js +0 -1
- package/dist/client/assets/NamePage-DdX2yQ5f.js +0 -1
- package/dist/client/assets/PermissionHistory-Bhl2kr1R.js +0 -1
- package/dist/client/assets/PermissionsPage-DUbenFkt.js +0 -1
- package/dist/client/assets/PhotoPage-CExABoHA.js +0 -1
- package/dist/client/assets/TaskDialogWrapper-BVb8gAr0.js +0 -1
- package/dist/client/assets/TasksEmptyState-RkUEEU2r.js +0 -3
- package/dist/client/assets/WorkView-BDk_vwu3.js +0 -51
- package/dist/client/assets/_shell-CMNFxZKJ.js +0 -80
- package/dist/client/assets/_shell._home.index-BjR-d3_s.js +0 -3
- package/dist/client/assets/_shell._home.tasks-CqURPMQD.js +0 -1
- package/dist/client/assets/_shell.connections-D3gJrBTQ.js +0 -1
- package/dist/client/assets/_shell.marketplace-HdefWdN_.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-wAZKfDQF.js +0 -1
- package/dist/client/assets/_shell.session-C0utZeSI.js +0 -1
- package/dist/client/assets/_shell.threads-TvzYRNMt.js +0 -1
- package/dist/client/assets/_shell.todos-sOFmsIPE.js +0 -6
- package/dist/client/assets/_shell.x._extensionId-DiEQZIvl.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-DiEQZIvl.js +0 -1
- package/dist/client/assets/channel-B0WiEIVe.js +0 -1
- package/dist/client/assets/index-BwTGkJbK.js +0 -1071
- package/dist/client/assets/index-CCHGVclj.js +0 -1
- package/dist/client/assets/index-CiUmx-i3.js +0 -1
- package/dist/client/assets/index-Dd4JoHFP.js +0 -1
- package/dist/client/assets/index-DlmGvYpy.js +0 -1
- package/dist/client/assets/index-EXJsA5kw.js +0 -1
- package/dist/client/assets/index-MpS13vhQ.css +0 -1
- package/dist/client/assets/registry-BQTcAm5U.js +0 -39
- package/dist/client/assets/registry-HencHRXy.js +0 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-nJfOIWYW.js +0 -8
- package/dist/client/assets/use-direct-message-panel-B3qfpDjY.js +0 -1
- package/dist/client/assets/use-is-below-desktop-BXHT3oPL.js +0 -1
- package/dist/client/assets/use-local-browser-DDWknHZE.js +0 -1
- package/dist/client/assets/use-pending-read-uvmEJ7H9.js +0 -1
- package/dist/client/assets/use-update-config-D-OGlXGR.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o,
|
|
1
|
+
import{j as o,db as t}from"./index-BR1m9FON.js";function e(){return o.jsx("div",{className:"h-full min-h-0 overflow-hidden",children:o.jsx(t,{})})}const s=e;export{s as component};
|
package/dist/client/assets/{_shell._home.activity-BU1NIGb7.js → _shell._home.activity-Z1QuU2M4.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cA as R,dd as D,r as l,js as C,jt as V,j as e,Z as W,_ as g,B as M,X as G,G as x,A as j,hx as Y,hy as k,a2 as K,e as v,x as q,a5 as z,a6 as U,ju as X,ht as Q,jv as Z,eP as J,ei as ee}from"./index-BwTGkJbK.js";import{P as te}from"./page-container-Bkarym6m.js";import{g as se,A as ne,a as ie,b as ae}from"./ActivityErrorState-BnqAwUiy.js";import{u as re}from"./use-full-activity-feed-DdDsRg8s.js";import{C as A,A as oe}from"./ActivityRow-Ch8HxQ2m.js";import{T as P,a as _,b as ce,c as p}from"./table-dWrfPeX-.js";import{E as b}from"./empty-state-saV209Il.js";import{u as le,W as ue}from"./WithheldExtensionsNotice-BDc-CM2t.js";const S=["categories","actorType","actorId","since"];function w(){const s=R(),n=D({strict:!1}),t={categories:n.categories,actorType:n.actorType,actorId:n.actorId,since:n.since},i=S.some(c=>n[c]!==void 0),a={};t.categories&&(a.categories=t.categories),t.actorType&&(a.actorType=t.actorType),t.actorId&&(a.actorId=t.actorId),t.since&&(a.since=t.since);const r=l.useCallback(c=>{s({search:c})},[s]),o=l.useCallback(c=>{r(f=>{const y=f.categories?f.categories.split(","):[],N=y.includes(c)?y.filter(O=>O!==c):[...y,c];return{...f,categories:N.length>0?N.join(","):void 0}})},[r]),d=l.useCallback(c=>{r(f=>({...f,actorType:c}))},[r]),m=l.useCallback(c=>{r(f=>({...f,actorId:c}))},[r]),u=l.useCallback(c=>{r(f=>({...f,since:c}))},[r]),h=l.useCallback(()=>{r(c=>{const f={...c};for(const y of S)delete f[y];return f})},[r]);return{filters:t,queryFilters:a,isFiltered:i,toggleCategory:o,setActorType:d,setActorId:m,setSince:u,clearAll:h}}function de(){const s=R(),t=D({strict:!1}).view==="all"?"all":"activity",i=l.useCallback(a=>{s({search:(r=>({...r,view:a==="all"?"all":void 0}))})},[s]);return{view:t,setView:i}}function me(){const[s]=l.useState(()=>C.getState().lastSeenAt);return l.useEffect(()=>{const{markSeen:n,setViewing:t}=C.getState();return n(),t(!0),()=>{n(),t(!1)}},[]),s}function he(s){const n=l.useRef(null),t=l.useCallback(i=>{var d,m,u;const a=n.current;if(!a)return;const r=a.querySelectorAll("[data-activity-row]"),o=Array.from(r).findIndex(h=>h===document.activeElement||h.contains(document.activeElement));switch(i.key){case"ArrowDown":{i.preventDefault();const h=Math.min(o+1,r.length-1);(d=r[h])==null||d.focus();break}case"ArrowUp":{i.preventDefault();const h=Math.max(o-1,0);(m=r[h])==null||m.focus();break}case"Escape":{(u=document.activeElement)==null||u.blur();break}}},[s]);return{containerRef:n,handleKeyDown:t}}const xe=["tasks","relay","agent","config","system","permissions"],L="group inline-flex min-h-11 shrink-0 items-center outline-none md:min-h-0",$="inline-flex h-6 items-center rounded-full px-2.5 text-xs font-medium transition-colors group-focus-visible:ring-ring group-focus-visible:ring-2 group-focus-visible:ring-offset-1";function fe({category:s,isActive:n,onToggle:t}){const i=A[s];return e.jsx(g.button,{type:"button",layout:!0,onClick:t,"aria-pressed":n,transition:{duration:.15},className:L,children:e.jsx("span",{className:x($,n?x(i.bg,i.text):"text-muted-foreground group-hover:bg-muted group-hover:text-foreground"),children:i.label})})}function ge({isActive:s,onClick:n}){return e.jsx(g.button,{type:"button",layout:!0,onClick:n,"aria-pressed":s,transition:{duration:.15},className:L,children:e.jsx("span",{className:x($,s?"bg-foreground text-background":"text-muted-foreground group-hover:bg-muted group-hover:text-foreground"),children:"All"})})}function ye({className:s}){const{filters:n,isFiltered:t,toggleCategory:i,clearAll:a}=w(),r=l.useRef(null),o=V(r,"horizontal"),d=new Set(n.categories?n.categories.split(","):[]),m=()=>{t&&a()};return e.jsxs("div",{className:x("relative",s),children:[e.jsxs("div",{ref:r,onScroll:o.onScroll,"data-slot":"activity-filter-bar",className:"flex items-center gap-1 overflow-x-auto",children:[e.jsx(ge,{isActive:!t,onClick:m}),xe.map(u=>e.jsx(fe,{category:u,isActive:d.has(u),onToggle:()=>i(u)},u)),e.jsx(W,{children:t&&e.jsx(g.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},children:e.jsxs(M,{variant:"ghost",size:"xs",className:"ml-1",onClick:a,children:[e.jsx(G,{"aria-hidden":!0}),"Clear"]})},"clear-filters")})]}),o.start&&e.jsx("div",{"aria-hidden":!0,"data-testid":"activity-filter-bar-fade-start",className:"from-background via-background/70 pointer-events-none absolute inset-y-0 left-0 w-8 bg-gradient-to-r to-transparent"}),o.end&&e.jsx("div",{"aria-hidden":!0,"data-testid":"activity-filter-bar-fade-end",className:"from-background via-background/70 pointer-events-none absolute inset-y-0 right-0 w-8 bg-gradient-to-l to-transparent"})]})}function pe({isFiltered:s=!1,view:n="activity",className:t}){const{filters:i,clearAll:a}=w();return n==="all"?e.jsx(b,{className:t,icon:j,headline:"No actions yet",description:"Every action a person or agent takes shows up here."}):s?e.jsx(b,{className:t,icon:j,headline:`No ${ve(i.categories)} activity found`,description:"Try other filters.",action:{label:"Clear filters",onClick:a,variant:"outline"}}):e.jsx(b,{className:t,icon:j,headline:"No activity yet",description:"Your agents’ work shows up here."})}function ve(s){if(!s)return"matching";const t=s.split(",").map(r=>{var o;return((o=A[r])==null?void 0:o.label)??r});if(t.length===1)return t[0];const i=t[t.length-1];return`${t.slice(0,-1).join(", ")} or ${i}`}function je({view:s,onViewChange:n,className:t}){return e.jsxs(Y,{"aria-label":"Which list to show",className:x("w-fit shrink-0",t),value:s,onValueChange:i=>n(i),children:[e.jsx(k,{value:"activity",children:"Activity"}),e.jsx(k,{value:"all",children:"All actions"})]})}function be(s){const n=Date.now()-new Date(s).getTime(),t=Math.floor(n/36e5);return t<1?"recently":t<24?`${t}h ago`:`${Math.floor(t/24)}d ago`}function Ae(s,n){const t=new Date(n),i={};for(const a of s)new Date(a.occurredAt)>t&&(i[a.category]=(i[a.category]??0)+1);return i}function we(s){const n={tasks:"scheduled run",relay:"message",agent:"agent update",config:"settings change",system:"system event",permissions:"permission change"};return Object.entries(s).filter(([,t])=>t>0).map(([t,i])=>{const a=n[t];return`${i} ${i===1?a:`${a}s`}`}).join(" · ")}function Ne({lastVisitedAt:s,items:n,className:t}){if(!s)return null;const i=Ae(n,s);if(Object.values(i).reduce((d,m)=>d+(m??0),0)===0)return null;const r=be(s),o=we(i);return e.jsxs(g.div,{"data-slot":"activity-since-last-visit",initial:{opacity:0,y:-6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},className:x("rounded-lg border px-4 py-3","bg-card border-border",t),children:[e.jsxs("p",{className:"text-muted-foreground text-xs",children:[e.jsx("span",{className:"text-foreground font-medium",children:"Since your last visit"})," ",e.jsxs("span",{children:["(",r,")"]})]}),e.jsx("p",{className:"text-foreground/80 mt-0.5 text-sm",children:o}),e.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:Object.keys(i).map(d=>{const m=i[d];if(!m)return null;const u=A[d];return e.jsxs(K,{shape:"pill",className:x("border-transparent",u.bg,u.text),children:[m," ",u.label]},d)})})]})}const Ce={initial:{opacity:0,y:6},animate:{opacity:1,y:0,transition:{duration:.2,ease:"easeOut"}}};function ke(){const s=l.useId(),n=l.useMemo(()=>`${s.split("").reduce((i,a)=>i+a.charCodeAt(0),0)%40+50}%`,[s]);return e.jsxs(ce,{children:[e.jsx(p,{className:"w-28 py-1.5 pr-0 pl-2 max-sm:hidden",children:e.jsx(v,{className:"h-3 w-20"})}),e.jsx(p,{className:"w-24 py-1.5 pr-0 max-sm:hidden",children:e.jsx(v,{className:"h-5 w-20 rounded-full"})}),e.jsx(p,{className:"py-1.5 max-sm:pl-2",children:e.jsx(v,{className:"h-3 rounded",style:{width:n}})}),e.jsx(p,{className:"w-16 py-1.5 max-sm:w-10"})]})}function Se(){return e.jsxs("div",{"data-slot":"activity-timeline-skeleton",className:"space-y-1",children:[e.jsx("div",{className:"py-2",children:e.jsx(v,{className:"h-3 w-16 rounded"})}),e.jsx(P,{children:e.jsx(_,{children:Array.from({length:5}).map((s,n)=>e.jsx(ke,{},n))})})]})}function H({items:s,isLoading:n,isError:t,onRetry:i,isFiltered:a,view:r="activity",className:o}){const d=l.useMemo(()=>se(s,new Date),[s]),{containerRef:m,handleKeyDown:u}=he(s.length);return n&&s.length===0?e.jsx("div",{"data-slot":"activity-timeline",className:x(o),children:e.jsx(Se,{})}):t&&s.length===0?e.jsx("div",{"data-slot":"activity-timeline",className:x(o),children:e.jsx(ne,{onRetry:i})}):s.length===0?e.jsx("div",{"data-slot":"activity-timeline",className:x(o),children:e.jsx(pe,{isFiltered:a,view:r})}):e.jsx("div",{ref:m,onKeyDown:u,"data-slot":"activity-timeline",className:x(o),children:d.map(h=>e.jsxs("section",{children:[e.jsx(ie,{label:h.label}),e.jsx(g.div,{variants:Ce,initial:"initial",animate:"animate",children:e.jsx(P,{children:e.jsx(_,{children:h.items.map(c=>e.jsx(oe,{item:c},c.id))})})})]},h.label))})}function B({onLoadMore:s,isFetching:n,hasNextPage:t,className:i}){return t?e.jsx(g.div,{"data-slot":"activity-load-more",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2,delay:.1},className:x("flex justify-center py-4",i),children:e.jsxs(M,{variant:"outline",size:"sm",onClick:s,disabled:n,className:"gap-2",children:[n&&e.jsx(q,{size:"xs"}),"Load 50 more events"]})}):null}const T=7;function Te(){var t;const s=z(),{data:n}=U({queryKey:X.dailyCounts(T),queryFn:()=>s.getSessionDailyCounts(T),staleTime:6e4});return!n||n.dailyCounts.length===0?null:{dailyCounts:n.dailyCounts,degraded:(((t=n.warnings)==null?void 0:t.length)??0)>0}}function Ie(s,n){const t=s.reduce((a,r)=>a+r,0),i=t===1?"session":"sessions";return n?t===0?"This week’s count is incomplete":`Your agents started at least ${t} ${i} this week`:t===0?"Your agents started no chats this week":`Your agents started ${t} ${i} this week`}const I=10,Ee=4,E=30,F=1;function Fe({data:s,className:n}){const t=Math.max(...s,1);return e.jsx("svg",{viewBox:"0 0 100 30",className:x("text-muted-foreground",n),"aria-hidden":"true",children:s.map((i,a)=>{const r=i/t*E;return e.jsx("rect",{x:a*(I+Ee)+1,y:E-Math.max(r,F),width:I,height:Math.max(r,F),rx:2,fill:"currentColor",opacity:.6},a)})})}function Re(){const s=Te();return s===null?null:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("p",{className:"text-muted-foreground text-sm",children:Ie(s.dailyCounts,s.degraded)}),e.jsx(Fe,{data:s.dailyCounts,className:"h-6 w-24 shrink-0"})]})}function De(){const s=l.useId(),n=Q("dashboard.sections"),t=l.useMemo(()=>n.filter(a=>Z(a.id)&&(!a.visibleWhen||a.visibleWhen())),[n]),i=le("dashboard.sections");return t.length===0&&i.length===0?null:e.jsxs("section",{className:"space-y-3","aria-labelledby":s,children:[e.jsx("h2",{id:s,className:"text-muted-foreground text-xs font-medium tracking-widest uppercase",children:"From your extensions"}),e.jsx(ue,{slot:"dashboard.sections",onReview:()=>J()}),e.jsx("div",{className:"space-y-4",children:t.map(a=>e.jsx(a.component,{},a.id))})]})}function Me(){const{view:s,setView:n}=de();return e.jsxs(e.Fragment,{children:[e.jsx(ee,{children:"Activity"}),e.jsxs(te,{width:"wide",className:"space-y-4",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx(je,{view:s,onViewChange:n}),s==="activity"&&e.jsx(ye,{className:"min-w-0 flex-1"})]}),e.jsx(Re,{}),e.jsx(De,{}),s==="all"?e.jsx(_e,{}):e.jsx(Pe,{})]})]})}function Pe(){const{queryFilters:s,isFiltered:n}=w(),t=me(),{data:i,isLoading:a,isError:r,refetch:o,isFetchingNextPage:d,hasNextPage:m,fetchNextPage:u}=re(s),h=l.useMemo(()=>(i==null?void 0:i.pages.flatMap(c=>c.items))??[],[i]);return e.jsxs(e.Fragment,{children:[e.jsx(Ne,{lastVisitedAt:t,items:h}),e.jsx(H,{items:h,isLoading:a,isError:r,onRetry:()=>void o(),isFiltered:n}),e.jsx(B,{onLoadMore:()=>void u(),isFetching:d,hasNextPage:!!m})]})}function _e(){const{data:s,isLoading:n,isError:t,refetch:i,isFetchingNextPage:a,hasNextPage:r,fetchNextPage:o}=ae();return e.jsxs(e.Fragment,{children:[e.jsx(H,{items:s??[],isLoading:n,isError:t,onRetry:()=>void i(),isFiltered:!1,view:"all"}),e.jsx(B,{onLoadMore:()=>void o(),isFetching:a,hasNextPage:!!r})]})}const Ye=Me;export{Ye as component};
|
|
1
|
+
import{cz as R,dc as D,r as l,jv as C,jw as O,j as e,Z as V,_ as g,B as M,X as G,G as x,A as j,eH as Y,eI as k,a2 as K,e as v,x as q,a5 as z,a6 as U,jx as X,hv as Q,jy as Z,eW as J,eh as ee}from"./index-BR1m9FON.js";import{P as te}from"./page-container-0sWZ3xh9.js";import{g as se,A as ne,a as ie,b as ae}from"./ActivityErrorState-BTHnE1vP.js";import{u as re}from"./use-full-activity-feed-DXroUzfN.js";import{C as w,A as oe}from"./ActivityRow-PwUBjQw8.js";import{T as P,a as _,b as ce,c as p}from"./table-D0EJT0uP.js";import{E as b}from"./empty-state-BHcmkSzu.js";import{u as le,W as ue}from"./WithheldExtensionsNotice-CCO4ClRZ.js";const S=["categories","actorType","actorId","since"];function A(){const s=R(),n=D({strict:!1}),t={categories:n.categories,actorType:n.actorType,actorId:n.actorId,since:n.since},i=S.some(c=>n[c]!==void 0),a={};t.categories&&(a.categories=t.categories),t.actorType&&(a.actorType=t.actorType),t.actorId&&(a.actorId=t.actorId),t.since&&(a.since=t.since);const r=l.useCallback(c=>{s({search:c})},[s]),o=l.useCallback(c=>{r(f=>{const y=f.categories?f.categories.split(","):[],N=y.includes(c)?y.filter(B=>B!==c):[...y,c];return{...f,categories:N.length>0?N.join(","):void 0}})},[r]),d=l.useCallback(c=>{r(f=>({...f,actorType:c}))},[r]),m=l.useCallback(c=>{r(f=>({...f,actorId:c}))},[r]),u=l.useCallback(c=>{r(f=>({...f,since:c}))},[r]),h=l.useCallback(()=>{r(c=>{const f={...c};for(const y of S)delete f[y];return f})},[r]);return{filters:t,queryFilters:a,isFiltered:i,toggleCategory:o,setActorType:d,setActorId:m,setSince:u,clearAll:h}}function de(){const s=R(),t=D({strict:!1}).view==="all"?"all":"activity",i=l.useCallback(a=>{s({search:(r=>({...r,view:a==="all"?"all":void 0}))})},[s]);return{view:t,setView:i}}function me(){const[s]=l.useState(()=>C.getState().lastSeenAt);return l.useEffect(()=>{const{markSeen:n,setViewing:t}=C.getState();return n(),t(!0),()=>{n(),t(!1)}},[]),s}function he(s){const n=l.useRef(null),t=l.useCallback(i=>{var d,m,u;const a=n.current;if(!a)return;const r=a.querySelectorAll("[data-activity-row]"),o=Array.from(r).findIndex(h=>h===document.activeElement||h.contains(document.activeElement));switch(i.key){case"ArrowDown":{i.preventDefault();const h=Math.min(o+1,r.length-1);(d=r[h])==null||d.focus();break}case"ArrowUp":{i.preventDefault();const h=Math.max(o-1,0);(m=r[h])==null||m.focus();break}case"Escape":{(u=document.activeElement)==null||u.blur();break}}},[s]);return{containerRef:n,handleKeyDown:t}}const xe=["tasks","relay","agent","config","system","permissions"],L="group inline-flex min-h-11 shrink-0 items-center outline-none md:min-h-0",H="inline-flex h-6 items-center rounded-full px-2.5 text-xs font-medium transition-colors group-focus-visible:ring-ring group-focus-visible:ring-2 group-focus-visible:ring-offset-1";function fe({category:s,isActive:n,onToggle:t}){const i=w[s];return e.jsx(g.button,{type:"button",layout:!0,onClick:t,"aria-pressed":n,transition:{duration:.15},className:L,children:e.jsx("span",{className:x(H,n?x(i.bg,i.text):"text-muted-foreground group-hover:bg-muted group-hover:text-foreground"),children:i.label})})}function ge({isActive:s,onClick:n}){return e.jsx(g.button,{type:"button",layout:!0,onClick:n,"aria-pressed":s,transition:{duration:.15},className:L,children:e.jsx("span",{className:x(H,s?"bg-foreground text-background":"text-muted-foreground group-hover:bg-muted group-hover:text-foreground"),children:"All"})})}function ye({className:s}){const{filters:n,isFiltered:t,toggleCategory:i,clearAll:a}=A(),r=l.useRef(null),o=O(r,"horizontal"),d=new Set(n.categories?n.categories.split(","):[]),m=()=>{t&&a()};return e.jsxs("div",{className:x("relative",s),children:[e.jsxs("div",{ref:r,onScroll:o.onScroll,"data-slot":"activity-filter-bar",className:"flex items-center gap-1 overflow-x-auto",children:[e.jsx(ge,{isActive:!t,onClick:m}),xe.map(u=>e.jsx(fe,{category:u,isActive:d.has(u),onToggle:()=>i(u)},u)),e.jsx(V,{children:t&&e.jsx(g.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},children:e.jsxs(M,{variant:"ghost",size:"xs",className:"ml-1",onClick:a,children:[e.jsx(G,{"aria-hidden":!0}),"Clear"]})},"clear-filters")})]}),o.start&&e.jsx("div",{"aria-hidden":!0,"data-testid":"activity-filter-bar-fade-start",className:"from-background via-background/70 pointer-events-none absolute inset-y-0 left-0 w-8 bg-gradient-to-r to-transparent"}),o.end&&e.jsx("div",{"aria-hidden":!0,"data-testid":"activity-filter-bar-fade-end",className:"from-background via-background/70 pointer-events-none absolute inset-y-0 right-0 w-8 bg-gradient-to-l to-transparent"})]})}function pe({isFiltered:s=!1,view:n="activity",className:t}){const{filters:i,clearAll:a}=A();return n==="all"?e.jsx(b,{className:t,icon:j,headline:"No actions yet",description:"Every action a person or agent takes shows up here."}):s?e.jsx(b,{className:t,icon:j,headline:`No ${ve(i.categories)} activity found`,description:"Try other filters.",action:{label:"Clear filters",onClick:a,variant:"outline"}}):e.jsx(b,{className:t,icon:j,headline:"No activity yet",description:"Your agents’ work shows up here."})}function ve(s){if(!s)return"matching";const t=s.split(",").map(r=>{var o;return((o=w[r])==null?void 0:o.label)??r});if(t.length===1)return t[0];const i=t[t.length-1];return`${t.slice(0,-1).join(", ")} or ${i}`}function je({view:s,onViewChange:n,className:t}){return e.jsxs(Y,{"aria-label":"Which list to show",className:x("w-fit shrink-0",t),value:s,onValueChange:i=>n(i),children:[e.jsx(k,{value:"activity",children:"Activity"}),e.jsx(k,{value:"all",children:"All actions"})]})}function be(s){const n=Date.now()-new Date(s).getTime(),t=Math.floor(n/36e5);return t<1?"recently":t<24?`${t}h ago`:`${Math.floor(t/24)}d ago`}function we(s,n){const t=new Date(n),i={};for(const a of s)new Date(a.occurredAt)>t&&(i[a.category]=(i[a.category]??0)+1);return i}function Ae(s){const n={tasks:"scheduled run",relay:"message",agent:"agent update",config:"settings change",system:"system event",permissions:"permission change"};return Object.entries(s).filter(([,t])=>t>0).map(([t,i])=>{const a=n[t];return`${i} ${i===1?a:`${a}s`}`}).join(" · ")}function Ne({lastVisitedAt:s,items:n,className:t}){if(!s)return null;const i=we(n,s);if(Object.values(i).reduce((d,m)=>d+(m??0),0)===0)return null;const r=be(s),o=Ae(i);return e.jsxs(g.div,{"data-slot":"activity-since-last-visit",initial:{opacity:0,y:-6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},className:x("rounded-lg border px-4 py-3","bg-card border-border",t),children:[e.jsxs("p",{className:"text-muted-foreground text-xs",children:[e.jsx("span",{className:"text-foreground font-medium",children:"Since your last visit"})," ",e.jsxs("span",{children:["(",r,")"]})]}),e.jsx("p",{className:"text-foreground/80 mt-0.5 text-sm",children:o}),e.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:Object.keys(i).map(d=>{const m=i[d];if(!m)return null;const u=w[d];return e.jsxs(K,{shape:"pill",className:x("border-transparent",u.bg,u.text),children:[m," ",u.label]},d)})})]})}const Ce={initial:{opacity:0,y:6},animate:{opacity:1,y:0,transition:{duration:.2,ease:"easeOut"}}};function ke(){const s=l.useId(),n=l.useMemo(()=>`${s.split("").reduce((i,a)=>i+a.charCodeAt(0),0)%40+50}%`,[s]);return e.jsxs(ce,{children:[e.jsx(p,{className:"w-28 py-1.5 pr-0 pl-2 max-sm:hidden",children:e.jsx(v,{className:"h-3 w-20"})}),e.jsx(p,{className:"w-24 py-1.5 pr-0 max-sm:hidden",children:e.jsx(v,{className:"h-5 w-20 rounded-full"})}),e.jsx(p,{className:"py-1.5 max-sm:pl-2",children:e.jsx(v,{className:"h-3 rounded",style:{width:n}})}),e.jsx(p,{className:"w-16 py-1.5 max-sm:w-10"})]})}function Se(){return e.jsxs("div",{"data-slot":"activity-timeline-skeleton",className:"space-y-1",children:[e.jsx("div",{className:"py-2",children:e.jsx(v,{className:"h-3 w-16 rounded"})}),e.jsx(P,{children:e.jsx(_,{children:Array.from({length:5}).map((s,n)=>e.jsx(ke,{},n))})})]})}function $({items:s,isLoading:n,isError:t,onRetry:i,isFiltered:a,view:r="activity",className:o}){const d=l.useMemo(()=>se(s,new Date),[s]),{containerRef:m,handleKeyDown:u}=he(s.length);return n&&s.length===0?e.jsx("div",{"data-slot":"activity-timeline",className:x(o),children:e.jsx(Se,{})}):t&&s.length===0?e.jsx("div",{"data-slot":"activity-timeline",className:x(o),children:e.jsx(ne,{onRetry:i})}):s.length===0?e.jsx("div",{"data-slot":"activity-timeline",className:x(o),children:e.jsx(pe,{isFiltered:a,view:r})}):e.jsx("div",{ref:m,onKeyDown:u,"data-slot":"activity-timeline",className:x(o),children:d.map(h=>e.jsxs("section",{children:[e.jsx(ie,{label:h.label}),e.jsx(g.div,{variants:Ce,initial:"initial",animate:"animate",children:e.jsx(P,{children:e.jsx(_,{children:h.items.map(c=>e.jsx(oe,{item:c},c.id))})})})]},h.label))})}function W({onLoadMore:s,isFetching:n,hasNextPage:t,className:i}){return t?e.jsx(g.div,{"data-slot":"activity-load-more",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2,delay:.1},className:x("flex justify-center py-4",i),children:e.jsxs(M,{variant:"outline",size:"sm",onClick:s,disabled:n,className:"gap-2",children:[n&&e.jsx(q,{size:"xs"}),"Load 50 more events"]})}):null}const T=7;function Te(){var t;const s=z(),{data:n}=U({queryKey:X.dailyCounts(T),queryFn:()=>s.getSessionDailyCounts(T),staleTime:6e4});return!n||n.dailyCounts.length===0?null:{dailyCounts:n.dailyCounts,degraded:(((t=n.warnings)==null?void 0:t.length)??0)>0}}function Ie(s,n){const t=s.reduce((a,r)=>a+r,0),i=t===1?"session":"sessions";return n?t===0?"This week’s count is incomplete":`Your agents started at least ${t} ${i} this week`:t===0?"Your agents started no chats this week":`Your agents started ${t} ${i} this week`}const I=10,Ee=4,E=30,F=1;function Fe({data:s,className:n}){const t=Math.max(...s,1);return e.jsx("svg",{viewBox:"0 0 100 30",className:x("text-muted-foreground",n),"aria-hidden":"true",children:s.map((i,a)=>{const r=i/t*E;return e.jsx("rect",{x:a*(I+Ee)+1,y:E-Math.max(r,F),width:I,height:Math.max(r,F),rx:2,fill:"currentColor",opacity:.6},a)})})}function Re(){const s=Te();return s===null?null:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("p",{className:"text-muted-foreground text-sm",children:Ie(s.dailyCounts,s.degraded)}),e.jsx(Fe,{data:s.dailyCounts,className:"h-6 w-24 shrink-0"})]})}function De(){const s=l.useId(),n=Q("dashboard.sections"),t=l.useMemo(()=>n.filter(a=>Z(a.id)&&(!a.visibleWhen||a.visibleWhen())),[n]),i=le("dashboard.sections");return t.length===0&&i.length===0?null:e.jsxs("section",{className:"space-y-3","aria-labelledby":s,children:[e.jsx("h2",{id:s,className:"text-muted-foreground text-xs font-medium tracking-widest uppercase",children:"From your extensions"}),e.jsx(ue,{slot:"dashboard.sections",onReview:()=>J()}),e.jsx("div",{className:"space-y-4",children:t.map(a=>e.jsx(a.component,{},a.id))})]})}function Me(){const{view:s,setView:n}=de();return e.jsxs(e.Fragment,{children:[e.jsx(ee,{children:"Activity"}),e.jsxs(te,{width:"wide",className:"space-y-4",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx(je,{view:s,onViewChange:n}),s==="activity"&&e.jsx(ye,{className:"min-w-0 flex-1"})]}),e.jsx(Re,{}),e.jsx(De,{}),s==="all"?e.jsx(_e,{}):e.jsx(Pe,{})]})]})}function Pe(){const{queryFilters:s,isFiltered:n}=A(),t=me(),{data:i,isLoading:a,isError:r,refetch:o,isFetchingNextPage:d,hasNextPage:m,fetchNextPage:u}=re(s),h=l.useMemo(()=>(i==null?void 0:i.pages.flatMap(c=>c.items))??[],[i]);return e.jsxs(e.Fragment,{children:[e.jsx(Ne,{lastVisitedAt:t,items:h}),e.jsx($,{items:h,isLoading:a,isError:r,onRetry:()=>void o(),isFiltered:n}),e.jsx(W,{onLoadMore:()=>void u(),isFetching:d,hasNextPage:!!m})]})}function _e(){const{data:s,isLoading:n,isError:t,refetch:i,isFetchingNextPage:a,hasNextPage:r,fetchNextPage:o}=ae();return e.jsxs(e.Fragment,{children:[e.jsx($,{items:s??[],isLoading:n,isError:t,onRetry:()=>void i(),isFiltered:!1,view:"all"}),e.jsx(W,{onLoadMore:()=>void o(),isFetching:a,hasNextPage:!!r})]})}const Ye=Me;export{Ye as component};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{li as be,lj as ye,j as t,i9 as $,ia as F,ib as L,ic as q,id as z,a2 as I,aw as A,Q as Se,T as Ne,C as ke,V as we,lk as B,B as b,ll as Re,lm as Ce,cz as H,e as C,G as y,s as W,r as m,J as Ie,ln as Ae,al as Pe,am as De,eu as Oe,aZ as Me,X as oe,lo as Te,lp as Ee,aR as $e,ej as ie,jw as Fe,Z as V,_ as R,U as Le,lq as qe,jO as ze,lr as Be,eX as He,eY as We,jM as _e,jT as Ue,ls as Ke,lt as Ve,eR as ae,eT as Ge,lu as Qe,dc as re,af as Ye,eU as Xe,jN as Je,l as le,lv as ce,lw as de,gH as Ze,lx as _,eS as et,bg as tt,b0 as st,hr as nt,hS as ot,ly as it,aO as at,gJ as ue,g as rt,gI as me,lz as G,ak as Q,cn as lt,lA as ct,lB as dt,lC as ut,a5 as mt,lD as ht,cv as gt,c3 as pt,k8 as ft,aQ as xt,iX as jt,fg as M,kY as vt,q as Y,eh as bt,gM as yt,lE as St,n as Nt}from"./index-BR1m9FON.js";import{I as kt,q as wt}from"./ChannelComposer-CAYvz_ZB.js";import{b as Rt}from"./registry-Tbt9pcZl.js";import{R as Ct}from"./RoomSurface-CChzNJKw.js";import{P as he}from"./PromptSuggestionChips-CEnhme_V.js";import{S as U}from"./scroll-area-DAC7NrVU.js";import{d as It}from"./dead-letter-reasons-DtBHju9v.js";import{u as At}from"./use-mesh-topology-upehQ5Cv.js";import{A as Pt}from"./AttentionSignalRow-CCKhUtil.js";import{u as ge}from"./use-promo-dismissals-Dx_fli7I.js";import{u as Dt,s as Ot,P as Mt,a as Tt}from"./use-promo-activation-Dlw6bg7G.js";import"./WidgetErrorCard-C5ieVv_9.js";import"./index-CpWxcN5D.js";import"./progress-BA2JPtb6.js";import"./markdown-content-DhAtZOfj.js";import"./table-D0EJT0uP.js";import"./zap-DSllMMHe.js";import"./package-BhKXbvU_.js";import"./heart-Cn3a-UQI.js";import"./git-branch-CsLE6G0Y.js";import"./file-text-Cycq_S0e.js";import"./file-CQGljfDT.js";import"./repeat-B8g-x-Sc.js";import"./use-room-sessions-DecGrP3E.js";import"./find-latest-widget-fence-B6sJdG3Q.js";import"./format-duration-BCr6uzby.js";import"./RuntimeSetupDialog-DTO5v0dP.js";import"./inline-code-mh48Uhbi.js";import"./list-runtime-types-DLmjtBMq.js";import"./RuntimeConnectFlow-BYQnY5vv.js";import"./copy-button-BOznikwM.js";import"./useMutationState-DIywUTDG.js";import"./runtime-connect-Dn0T5YWv.js";import"./mention-pill-DmA8FxL4.js";import"./rotate-ccw-clock-DRtL-2nr.js";import"./unplug-B-ipHefz.js";import"./message-square-off-BowIzJUV.js";import"./registry-jD9zw538.js";import"./use-todos-BzRauzdQ.js";import"./file-drag-GDx2qhdk.js";import"./paperclip-C-7LhBfl.js";import"./index-Cgjq7a-8.js";import"./use-transform-DzJeHpxm.js";import"./pane-resize-handle-Bjy4udre.js";import"./UnreadDivider-1aPVzwd7.js";import"./use-room-follow-claim-Bgrpr3bO.js";import"./use-connector-management-BLiCJMgU.js";import"./AgentRequestCard-B2gxCMGi.js";import"./access-copy-tkiFMhRf.js";import"./query-error-state-Cm-Lozlb.js";import"./empty-state-BHcmkSzu.js";import"./use-bindings-gLHRNAFU.js";import"./connection-copy--MA7AN04.js";import"./KeyEntry-67acsEG2.js";import"./use-update-config-DjL7-nUR.js";function Et({open:e,itemId:n,onClose:o}){const{data:s}=be(),i=ye(),a=(n==null?void 0:n.indexOf("::"))??-1,r=a>=0?n.slice(0,a):void 0,l=a>=0?n.slice(a+2):void 0,c=s==null?void 0:s.find(h=>h.source===r&&h.reason===l),d=()=>{!r||!l||i.mutate({source:r,reason:l},{onSuccess:o})};return t.jsx($,{open:e,onOpenChange:h=>!h&&o(),children:t.jsxs(F,{side:"right",children:[t.jsxs(L,{children:[t.jsx(q,{children:"Messages that never arrived"}),t.jsx(z,{children:r??"Source unknown"})]}),t.jsx(U,{className:"flex-1 px-4",children:c?t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"text-muted-foreground text-sm",children:"These never reached an agent. Clearing them doesn’t send them."}),t.jsxs("p",{className:"text-foreground text-sm",children:[c.count," message",c.count===1?"":"s"," couldn’t be delivered"]}),t.jsx(I,{variant:"secondary",children:It(c.reason)})]}),t.jsxs("div",{className:"space-y-1 text-sm",children:[t.jsxs("p",{className:"text-muted-foreground",children:["First happened ",A(c.firstSeen)," ago"]}),t.jsxs("p",{className:"text-muted-foreground",children:["Last happened ",A(c.lastSeen)," ago"]})]}),c.sample!=null&&t.jsxs(Se,{children:[t.jsxs(Ne,{className:"text-muted-foreground hover:text-foreground group flex items-center gap-1 text-xs font-medium transition-colors",children:[t.jsx(ke,{className:"size-3 transition-transform group-data-[state=open]:rotate-90"}),"What one of them looked like"]}),t.jsx(we,{children:t.jsx("pre",{className:"bg-muted mt-1 overflow-x-auto rounded-md p-3 font-mono text-xs",children:JSON.stringify(c.sample,null,2)})})]})]}):t.jsx("p",{className:"text-muted-foreground py-8 text-center text-sm",children:"These are cleared already."})}),t.jsxs(B,{children:[c&&t.jsx(b,{variant:"destructive",onClick:d,disabled:i.isPending,children:i.isPending?"Clearing…":"Clear these"}),t.jsx(b,{variant:"outline",onClick:o,children:"Close"})]})]})})}function $t(e){const n=Math.floor(e/1e3);if(n<60)return`${n}s`;const o=Math.floor(n/60),s=n%60;if(o<60)return`${o}m ${s}s`;const i=Math.floor(o/60),a=o%60;return`${i}h ${a}m`}function Ft(e){switch(e){case"needs_attention":return{label:"Needs attention",badge:"destructive",tone:"error",heading:"What it needed",title:"Run that was refused a tool"};case"failed":return{label:"Didn’t finish",badge:"destructive",tone:"error",heading:"Error",title:"Run that didn’t finish"};case"cancelled":return{label:"Cancelled",badge:"secondary",tone:"neutral",heading:"Stopped",title:"Run that was stopped"};case"skipped":return{label:"Skipped",badge:"secondary",tone:"neutral",heading:"Why",title:"Run that never started"};case"running":return{label:"Running",badge:"secondary",tone:"neutral",heading:"Latest",title:"Run that is still going"};default:return{label:"Completed",badge:"secondary",tone:"neutral",heading:"Note",title:"Run that finished"}}}const Lt={error:{box:"bg-destructive/10 border-destructive/20",heading:"text-destructive",body:"text-destructive"},neutral:{box:"bg-muted border-border",heading:"text-foreground",body:"text-foreground/80"}};function qt({open:e,itemId:n,onClose:o}){const{data:s,isLoading:i,isError:a}=Re(e?n??null:null),r=Ce(),l=H(),c=()=>{s!=null&&s.sessionId&&l(W({session:s.sessionId}))},d=()=>{s&&r.mutate(s.id)},h=s?Ft(s.status):null,g=h?Lt[h.tone]:null;return t.jsx($,{open:e,onOpenChange:p=>!p&&o(),children:t.jsxs(F,{side:"right",children:[t.jsxs(L,{children:[t.jsx(q,{children:(h==null?void 0:h.title)??"Run that needs a look"}),t.jsx(z,{children:n?n.slice(0,8):"Unknown"})]}),t.jsxs(U,{className:"flex-1 px-4",children:[i&&t.jsxs("div",{className:"space-y-4",children:[t.jsx(C,{className:"h-6 w-24"}),t.jsx(C,{className:"h-4 w-48"}),t.jsx(C,{className:"h-20 w-full"})]}),a&&t.jsx("p",{className:"text-destructive py-8 text-center text-sm",children:"Couldn’t load this run."}),!i&&!a&&!s&&t.jsx("p",{className:"text-muted-foreground py-8 text-center text-sm",children:"Already resolved."}),s&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex gap-2",children:[t.jsx(I,{variant:h.badge,children:h.label}),t.jsx(I,{variant:"secondary",children:s.trigger==="scheduled"?"Scheduled":"Manual"})]}),t.jsxs("div",{className:"space-y-1 text-sm",children:[s.startedAt&&t.jsxs("p",{className:"text-muted-foreground",children:["Started: ",A(s.startedAt)," ago"]}),s.finishedAt&&t.jsxs("p",{className:"text-muted-foreground",children:["Finished: ",A(s.finishedAt)," ago"]}),s.durationMs!=null&&t.jsxs("p",{className:"text-muted-foreground",children:["Duration: ",$t(s.durationMs)]})]}),s.error&&t.jsxs("div",{className:y("rounded-md border p-3",g.box),children:[t.jsx("p",{className:y("text-sm font-medium",g.heading),children:h.heading}),t.jsx("p",{className:y("mt-1 text-sm",g.body),children:s.error})]}),s.outputSummary&&t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Output"}),t.jsx("pre",{className:"bg-muted max-h-48 overflow-auto rounded-md p-3 font-mono text-xs",children:s.outputSummary})]})]})]}),t.jsxs(B,{children:[(s==null?void 0:s.sessionId)&&t.jsx(b,{variant:"default",onClick:c,children:"View chat"}),(s==null?void 0:s.status)==="running"&&t.jsx(b,{variant:"destructive",onClick:d,disabled:r.isPending,children:r.isPending?"Cancelling…":"Cancel run"}),t.jsx(b,{variant:"outline",onClick:o,children:"Close"})]})]})})}function zt({agent:e}){const n=Ae(e,e.projectPath??"");return t.jsxs("div",{className:"flex items-center gap-3 py-2",children:[t.jsx(Pe,{color:n.color,emoji:n.emoji,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"text-foreground truncate text-sm font-medium",children:De(e)}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(I,{variant:"destructive",children:"Unreachable"}),e.runtime&&t.jsx(I,{variant:"secondary",children:Oe(e.runtime).label})]})]}),e.lastSeenAt&&t.jsxs("span",{className:"text-muted-foreground shrink-0 text-xs",children:[A(e.lastSeenAt)," ago"]})]})}function Bt({open:e,onClose:n}){const{data:o}=At(void 0,e),s=m.useMemo(()=>o?o.namespaces.flatMap(i=>i.agents).filter(i=>i.healthStatus==="unreachable"):[],[o]);return t.jsx($,{open:e,onOpenChange:i=>!i&&n(),children:t.jsxs(F,{side:"right",children:[t.jsxs(L,{children:[t.jsx(q,{children:"Agents that aren’t answering"}),t.jsxs(z,{children:["DorkOS can’t reach ",s.length," agent",s.length===1?"":"s"," right now"]})]}),t.jsx(U,{className:"flex-1 px-4",children:s.length>0?t.jsx("div",{className:"divide-y",children:s.map(i=>t.jsx(zt,{agent:i},i.id))}):t.jsxs("div",{className:"flex flex-col items-center gap-2 py-8",children:[t.jsx(Ie,{className:"text-status-success size-6"}),t.jsx("p",{className:"text-muted-foreground text-sm",children:"All agents are online"})]})}),t.jsx(B,{children:t.jsx(b,{variant:"outline",onClick:n,children:"Close"})})]})})}function Ht(e){return e.content.suggestion!==void 0}function Wt(){const e=Dt(),{dismissedIds:n}=ge(),o=Me(s=>s.promoEnabled);return m.useMemo(()=>{if(!o)return null;const[s]=Ot(Mt.filter(Ht),e,n,1);return s??null},[e,n,o])}function _t({suggestion:e,promoTitle:n,onAccept:o,onDismiss:s}){return t.jsxs("p",{"data-slot":"quiet-suggestion",className:"text-muted-foreground/70 text-2xs mt-1",children:[e.question," ",t.jsx("button",{type:"button",onClick:o,className:"text-muted-foreground hover:text-foreground focus-ring rounded-sm font-medium underline-offset-4 transition-colors hover:underline focus-visible:underline",children:e.action}),t.jsx("button",{type:"button","aria-label":`Dismiss suggestion: ${n}`,onClick:s,className:"text-muted-foreground/60 hover:text-foreground focus-ring -my-1.5 ml-0.5 inline-flex translate-y-[3px] items-center justify-center rounded-sm p-1.5 align-baseline transition-colors",children:t.jsx(oe,{className:"size-3"})})]})}function Ut({promo:e}){const{dismissPromo:n}=ge(),{activate:o,dialog:s}=Tt(e);return t.jsxs(t.Fragment,{children:[t.jsx(_t,{suggestion:e.content.suggestion,promoTitle:e.content.title,onAccept:o,onDismiss:()=>n(e.id)}),s]})}function Kt(){const e=Wt();return e===null?null:t.jsx(Ut,{promo:e},e.id)}const Vt=["report.daily"];function pe(){const{notifications:e}=Te({kinds:Vt,unread:!0});return m.useMemo(()=>e[0],[e])}function Gt({questions:e,requests:n,schedules:o,approvalsUnavailable:s,attention:i}){const a=[],r=[],l=e+n+o;return l>0?(a.push(`${Ee(e,n,o)} ${l===1?"is":"are"} waiting on you.`),r.push(`${l} waiting`)):s&&(a.push("Couldn’t read approvals."),r.push("Couldn’t read approvals")),i===1?(a.push("1 thing needs attention."),r.push("1 needs attention")):i>1&&(a.push(`${i} things need attention.`),r.push(`${i} need attention`)),{spoken:a.join(" "),compact:r.join(" · ")}}function Qt({notification:e,onDismiss:n}){return t.jsxs("div",{"data-slot":"shift-report-card",className:"border-border/60 bg-background/60 relative rounded-lg border p-3 pr-8",children:[t.jsxs("div",{className:"flex items-start gap-2.5",children:[t.jsx($e,{"aria-hidden":!0,className:"text-muted-foreground mt-0.5 size-3.5 shrink-0"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"text-foreground text-xs font-medium",children:e.title}),e.body!==void 0&&t.jsx("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:e.body})]})]}),t.jsx("button",{type:"button",onClick:n,"aria-label":"Dismiss",className:"text-muted-foreground hover:text-foreground focus-ring absolute top-2 right-2 rounded-md p-1 transition-colors",children:t.jsx(oe,{className:"size-3.5"})})]})}const Yt="max-h-[40svh] sm:max-h-[50svh]",Xt={initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0}};function T({title:e,tone:n="waiting",children:o}){const s=m.useId();return t.jsxs("section",{"aria-labelledby":s,className:"min-w-0",children:[t.jsx("h2",{id:s,className:y("mb-2 text-xs font-medium",n==="waiting"?"text-status-warning-fg":"text-muted-foreground"),children:e}),o]})}function X({edge:e}){return t.jsx("div",{"aria-hidden":"true","data-slot":`pinned-triage-fade-${e}`,className:y("from-background/95 via-background/65 pointer-events-none absolute inset-x-0 h-6 to-transparent",e==="bottom"?"bottom-0 bg-gradient-to-t":"top-0 bg-gradient-to-b")})}const J={animate:{transition:{staggerChildren:.04}}};function Jt(e){return e?0:.18}function Zt({approvals:e,asks:n,settlingAsks:o,askAgentNames:s,onOpenSession:i,approvalsUnavailable:a,onRetryApprovals:r,scheduleApprovals:l,errorSignals:c,activityItems:d,onOpenActivity:h,shiftReport:g,presence:p,condensed:j,onExpand:x,className:u}){const f=ie(),v=m.useRef(null),N=Fe(v),k=e.length>0||n.length>0||o.length>0||l.length>0||a,P=c.length>0,w=d.length>0,je=k||P||w||g!==void 0||(p==null?void 0:p.occupied)===!0,O=Gt({questions:n.length,requests:e.length,schedules:l.length,approvalsUnavailable:a,attention:c.length+d.length}),ve=j===!0&&O.compact!=="";return t.jsxs(t.Fragment,{children:[t.jsx("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:O.spoken}),t.jsxs(V,{initial:!1,children:[ve&&t.jsx(R.div,{"data-slot":"pinned-triage-summary",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:Jt(f===!0)},className:y("bg-background/95 border-border/60 shrink-0 border-b backdrop-blur-sm",u),children:t.jsxs("button",{type:"button",onClick:x,className:"text-muted-foreground hover:text-foreground flex min-h-11 w-full min-w-0 items-center gap-2 px-[var(--msg-padding-x)] text-left text-xs",children:[t.jsx("span",{className:"bg-status-warning-dot size-1.5 shrink-0 rounded-full","aria-hidden":!0}),t.jsx("span",{className:"min-w-0 flex-1 truncate",children:O.compact}),t.jsx(Le,{className:"size-3.5 shrink-0","aria-hidden":!0})]})},"triage-summary"),je&&j!==!0&&t.jsxs(R.div,{"data-slot":"pinned-triage-header",...Xt,transition:{duration:f?0:.25,ease:[0,0,.2,1]},className:y("bg-background/95 border-border/60 relative shrink-0 overflow-hidden border-b backdrop-blur-sm",u),children:[t.jsxs("div",{ref:v,onScroll:N.onScroll,"data-slot":"pinned-triage-scroller",className:y("flex w-full min-w-0 scroll-py-6 flex-col gap-3 overflow-y-auto overscroll-contain px-[var(--msg-padding-x)] py-3",Yt),children:[k&&t.jsxs(T,{title:"Waiting on you",children:[(n.length>0||o.length>0)&&t.jsx(qe,{asks:n,agentNames:s,onOpenSession:i,emptyState:t.jsx("p",{className:"text-muted-foreground text-xs",children:"Nothing needs you"})}),e.length>0&&t.jsx(ze,{approvals:e}),e.length===0&&a&&t.jsx(Be,{onRetry:r}),t.jsx(V,{initial:!1,children:l.map(S=>t.jsx(He,{task:S,className:"mt-2",compact:!0},S.id))})]}),P&&t.jsx(T,{title:"Needs attention",children:t.jsx("div",{className:"border-status-warning-border/40 bg-background/60 rounded-lg border p-2",children:t.jsx(R.div,{variants:J,initial:"initial",animate:"animate",children:c.map(S=>t.jsx(Pt,{signal:S},S.id))})})}),g&&t.jsx(Qt,{notification:g.notification,onDismiss:g.onDismiss}),w&&t.jsx(T,{title:"Recent activity",tone:"neutral",children:t.jsx("div",{className:"border-border/60 bg-background/60 rounded-lg border p-2",children:t.jsx(R.div,{variants:J,initial:"initial",animate:"animate",children:d.map(S=>t.jsx(We,{notification:S,onOpen:()=>h(S)},S.id))})})}),p==null?void 0:p.node]}),N.start&&t.jsx(X,{edge:"top"}),N.end&&t.jsx(X,{edge:"bottom"})]},"triage-header")]})]})}function es({presence:e,composerFocused:n,onExpand:o,className:s}){const{approvals:i,isError:a,retry:r}=_e(),{interactions:l}=Ue(),c=Ke(),d=Ve(l),{schedules:h,errors:g,activity:p}=ae(),j=Ge(),x=pe(),{mutate:u}=Qe(),f=re({strict:!1}),v=H(),N=Ye(),k=Xe(h),P=Je(i),w=m.useCallback(()=>{v({...le.home(),search:{}})},[v]);return t.jsxs(t.Fragment,{children:[t.jsx(Zt,{approvals:P,asks:l,settlingAsks:c,askAgentNames:d,onOpenSession:K=>{v(W({session:K}))},approvalsUnavailable:a&&i.length===0,onRetryApprovals:r,scheduleApprovals:k,errorSignals:g,activityItems:p,onOpenActivity:j,shiftReport:x===void 0?void 0:{notification:x,onDismiss:()=>u(x.id)},presence:e,condensed:N&&n===!0,onExpand:o,className:s}),t.jsx(Et,{open:f.detail==="dead-letter",itemId:f.itemId,onClose:w}),t.jsx(qt,{open:f.detail==="failed-run",itemId:f.itemId,onClose:w}),t.jsx(Bt,{open:f.detail==="offline-agent",onClose:w})]})}const ts=["What can you help with?","Make my first agent","What’s in this project?","Set up a daily run"];function ss({roomId:e}){const n=m.useCallback(o=>{ce.getState().set(e,o),de.getState().requestFocus(e)},[e]);return t.jsx("div",{className:"w-full px-[var(--msg-padding-x)] pb-1",children:t.jsx(he,{suggestions:ts,onChipClick:n,ariaLabel:"Ways to start",size:"comfortable"})})}function ns(e){var a;const{data:n}=Ze(e),o=((a=n==null?void 0:n.members.find(r=>r.author.id===n.viewerAuthorId))==null?void 0:a.lastReadSeq)??null,[s,i]=m.useState({roomId:null,seq:null});return s.roomId===e?s.seq:o===null?null:(i({roomId:e,seq:o}),o)}function os(e,n){if(e===void 0)return null;let o=null,s=1/0;for(const i of e){if(!i.enabled||i.status!=="active")continue;const a=i.nextRun;if(a==null)continue;const r=Date.parse(a);Number.isNaN(r)||r<=n||r>=s||(s=r,o={name:i.displayName??i.name,at:a})}return o}function is(e,n){const o=new Date(e),s=o.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),i=as(new Date(n),o);return i===0?`today at ${s}`:i===1?`tomorrow at ${s}`:`on ${o.toLocaleDateString(void 0,{weekday:"long",month:"short",day:"numeric"})} at ${s}`}function as(e,n){const o=s=>new Date(s.getFullYear(),s.getMonth(),s.getDate()).getTime();return Math.round((o(n)-o(e))/864e5)}function rs(e,n){return e===null?null:`Next up: ${e.name} runs ${is(e.at,n)}.`}function ls({forwardLook:e,suggestion:n}){return t.jsx(R.div,{"data-slot":"home-quiet-state",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"border-border/60 shrink-0 border-b",children:t.jsxs("div",{className:"w-full px-[var(--msg-padding-x)] py-2",children:[t.jsxs("p",{className:"text-muted-foreground text-xs",children:[t.jsx("span",{className:"text-foreground/80 font-medium",children:"All quiet."}),e!==null&&t.jsxs(t.Fragment,{children:[" ",e]})]}),n]})})}function cs({roomId:e,presenceOccupied:n}){const o=_(e),s=ns(e),{items:i,isLoading:a,isAnyError:r}=et(),{total:l}=ae(),c=pe(),d=o!==void 0&&o.length>0,h=s!==null&&o!==void 0&&o.every(k=>k.seq<=s),g=i.length>0||a||r||l>0||c!==void 0||n,p=d&&h&&!g,[j,x]=m.useState("waiting");p&&j==="waiting"?x("shown"):!p&&j==="shown"&&x("retired");const u=p&&j!=="retired",f=tt(),{data:v}=st(f&&u),N=nt();return u?t.jsx(ls,{forwardLook:rs(os(v,N),N),suggestion:t.jsx(Kt,{})}):null}const fe="dorkos:home-opened-on";function Z(){const e=new Date,n=String(e.getMonth()+1).padStart(2,"0"),o=String(e.getDate()).padStart(2,"0");return`${e.getFullYear()}-${n}-${o}`}function ds(){try{return localStorage.getItem(fe)}catch{return null}}function us(e){try{localStorage.setItem(fe,e)}catch{}}function ms(){const[e]=m.useState(()=>ds()!==Z());return m.useEffect(()=>{e&&us(Z())},[e]),e}function hs({children:e}){const n=ms(),o=ie(),s=n&&o!==!0;return t.jsx(R.div,{className:"h-full",initial:s?{opacity:0}:!1,animate:{opacity:1},transition:{duration:.45,ease:[0,0,.2,1]},children:e})}const ee="@dorkbot",gs="Build me a tracker for my customers",ps="Make a daily plan board",xe="Something else",fs=[gs,ps,xe];function xs({roomId:e,mode:n}){const o=Rt(),s=ot(),i=m.useCallback(a=>{if(a===xe){ce.getState().set(e,`${ee} `),de.getState().requestFocus(e);return}o.mutate({roomId:e,text:`${ee} ${a}`,clientId:it()})},[e,o]);return n==="starters"?t.jsx("div",{className:"w-full px-[var(--msg-padding-x)] pb-1","data-testid":"first-run-chips",children:t.jsx(he,{suggestions:fs,onChipClick:i,ariaLabel:"First jobs for DorkBot",size:"comfortable"})}):t.jsxs("div",{className:"flex w-full flex-wrap gap-2 px-[var(--msg-padding-x)] pb-1","data-testid":"first-run-connect-chips",children:[t.jsx(b,{size:"sm",onClick:()=>s.open("account"),children:"Continue with DorkOS"}),t.jsx(b,{size:"sm",variant:"outline",onClick:()=>s.open("runtimes"),children:"Use my own AI"})]})}function js(e){var r,l;const{data:n}=at(),o=_(e),s=ue(e,null),i=((r=n==null?void 0:n.onboarding)==null?void 0:r.welcomeEntryId)??null;if(e===null||i===null||!o||s.length>0)return null;const a=o.reduce((c,d)=>c===void 0||d.seq>c.seq?d:c,void 0);return(a==null?void 0:a.id)!==i?null:((l=n==null?void 0:n.onboarding)==null?void 0:l.firstRunPath)==="none"?"connect":"starters"}const vs=5,bs="relative after:absolute after:-inset-x-1 after:-inset-y-2.5 md:after:hidden";function ys(e,n){return e===null||n===null?null:Math.max(0,n-Date.parse(e))}function Ss({row:e,onFollow:n,onViewProfile:o}){const[s,i]=m.useState(null),a=ys(e.since,s),r=e.profileMemberId,l=o===void 0||r===null?void 0:()=>o(r);return t.jsx(kt,{onViewProfile:l,identity:{kind:e.face.kind,displayName:e.name,...e.handle!==null?{handle:e.handle}:{},color:e.face.color,...e.face.emoji!==void 0?{emoji:e.face.emoji}:{},...e.face.imageUrl!==void 0?{imageUrl:e.face.imageUrl}:{},...e.face.origin!==void 0?{origin:e.face.origin}:{},...e.face.kind==="agent"?{agent:{...e.runtime!==null?{runtime:e.runtime}:{},...a!==null?{working:{...e.roomTitle!==null?{room:e.roomTitle}:{},forMs:a}}:{}}}:{}},children:t.jsxs("button",{type:"button","aria-label":e.detail===null?`Watch ${e.name}`:`Watch ${e.name}: ${e.detail}`,onClick:()=>n(e.follow),onPointerEnter:()=>i(Date.now()),onPointerLeave:()=>i(null),onFocus:()=>i(Date.now()),onBlur:()=>i(null),className:y("focus-ring group/identity hover:bg-muted/60 flex min-w-0 items-center gap-1.5 rounded-full py-1 pr-2.5 pl-1 text-xs transition-colors",bs),children:[t.jsx(rt,{size:"xs",kind:e.face.kind,color:e.face.color,...e.face.emoji!==void 0?{emoji:e.face.emoji}:{},...e.face.imageUrl!==void 0?{imageUrl:e.face.imageUrl}:{},...e.face.origin!==void 0?{origin:e.face.origin}:{},fallback:e.face.fallback,status:"working"}),t.jsx("span",{className:"text-foreground shrink-0 font-medium",children:e.name}),e.detail!==null&&t.jsxs("span",{"aria-hidden":!0,className:"text-muted-foreground truncate",children:["· ",e.detail]})]})})}function Ns({rows:e,onFollow:n,onViewProfile:o,className:s}){if(e.length===0)return null;const i=e.slice(0,vs),a=e.length-i.length;return t.jsxs("ul",{"data-testid":"presence-strip","aria-label":"Working right now",className:y("flex items-center gap-x-2 overflow-hidden",s),children:[i.map(r=>t.jsx("li",{className:"min-w-0",children:t.jsx(Ss,{row:r,onFollow:n,onViewProfile:o})},r.id)),a>0&&t.jsx("li",{"aria-label":a===1?"1 more agent is working":`${a} more agents are working`,className:"text-muted-foreground shrink-0 text-xs",children:t.jsxs("span",{"aria-hidden":!0,children:["+",a," more"]})})]})}function ks(e){return`replying in ${e}`}const ws="working in a chat";function Rs(e,n){var i;const o=n.rosters[e];if(o!==void 0)return o.members.map(a=>({author:a.author,origin:a.origin}));const s=(i=n.rooms[e])==null?void 0:i.participants;return s==null?[]:s.map(a=>({author:a}))}function Cs(e){const n=new Map;for(const[o,s]of Object.entries(e))s!==null&&n.set(lt(o),{path:o,manifest:s});return n}function te(e){return{...e,line:dt(e.name,e.binding,e.state),detail:ct(e.binding,e.state)}}function Is(e){const n=Cs(e.agents),o=new Set(e.excludeRoomIds??[]),s=[],i=new Set;for(const l of e.claims){const c=Rs(l.roomId,e).find(p=>p.author.id===l.authorId);if(c===void 0)continue;const d=c.author.agentRef===void 0?void 0:n.get(c.author.agentRef);if(d!==void 0&&i.add(d.path),o.has(l.roomId))continue;const h=e.rooms[l.roomId],g=h===void 0?null:me(h);s.push(te({id:`room:${l.roomId}:${l.authorId}`,name:c.author.displayName,handle:c.author.handle,face:G({record:c.author,override:d===void 0?null:Q(d.manifest),...c.origin!==void 0?{origin:c.origin}:{}}),binding:g===null?null:ks(g),state:l.state,since:l.since,roomTitle:g,runtime:(d==null?void 0:d.manifest.runtime)??null,profileMemberId:d===void 0?null:e.meshIdByPath[d.path]??null,follow:{kind:"room",roomId:l.roomId}}))}const a=new Set(i),r=[];for(const l of e.sessions){if(a.has(l.cwd))continue;const c=e.agents[l.cwd];if(c==null)continue;a.add(l.cwd);const d=c.displayName??c.name;r.push(te({id:`session:${l.sessionId}`,name:d,handle:null,face:G({record:{id:c.id,kind:"agent",displayName:d},override:Q(c)}),binding:ws,state:"working",since:null,roomTitle:null,runtime:c.runtime,profileMemberId:e.meshIdByPath[l.cwd]??null,follow:{kind:"session",sessionId:l.sessionId,cwd:l.cwd}}))}return r.sort((l,c)=>l.name.localeCompare(c.name)||l.id.localeCompare(c.id)),[...s,...r]}function As(e,n,o){var a;const s=new Set(ut(Object.keys(n),Object.values(o))),i=[];for(const[r,l]of Object.entries(n))((a=e[r])==null?void 0:a.lifecycle)==="streaming"&&s.has(r)&&i.push({sessionId:r,cwd:l});return i}const se=[],Ps=[],ne="\0",D="";function Ds(){const e=M(m.useCallback(i=>i.statuses,[])),n=M(m.useCallback(i=>i.statusCwds,[])),o=M(m.useCallback(i=>i.sessions,[])),s=m.useMemo(()=>As(e,n,o).map(i=>`${i.sessionId}${ne}${i.cwd}`).sort().join(D),[e,n,o]);return m.useMemo(()=>s.length===0?Ps:s.split(D).map(i=>{const[a,r]=i.split(ne);return{sessionId:a,cwd:r}}),[s])}function Os(e=[]){const n=mt(),o=ht(),s=Ds(),{data:i}=gt(),{data:a}=pt(),r=m.useMemo(()=>[...new Set(o.map(u=>u.roomId))].sort().join(`
|
|
2
|
+
`),[o]),l=m.useMemo(()=>r.length===0?[]:r.split(`
|
|
3
|
+
`),[r]),c=ft({queries:l.map(u=>({queryKey:xt.detail(u),queryFn:()=>n.getRoom(u)})),combine:u=>{const f={};for(const v of u)v.data!==void 0&&(f[v.data.id]=v.data);return f}}),d=m.useMemo(()=>{const u={};for(const f of i??[])u[f.id]=f;return u},[i]),h=m.useMemo(()=>((a==null?void 0:a.agents)??[]).map(u=>u.projectPath),[a]),{data:g}=jt(h),p=m.useMemo(()=>g??{},[g]),j=m.useMemo(()=>{const u={};for(const f of(a==null?void 0:a.agents)??[])u[f.projectPath]=f.id;return u},[a]),x=e.join(D);return m.useMemo(()=>{if(o.length===0&&s.length===0)return se;const u=Is({claims:o,rosters:c,rooms:d,sessions:s,agents:p,meshIdByPath:j,excludeRoomIds:x.length===0?[]:x.split(D)});return u.length===0?se:u},[o,c,d,s,p,j,x])}function Ms(e=[]){const n=Os(e),o=H(),{open:s}=vt(),i=m.useCallback(r=>{if(r.kind==="room"){Y.getState().recordOpened("room",r.roomId),o({...le.channels(),search:{id:r.roomId}});return}r.cwd&&Y.getState().recordOpened("agent",r.cwd),o(W({session:r.sessionId,dir:r.cwd}))},[o]),a=m.useMemo(()=>t.jsx(Ns,{rows:n,onFollow:i,onViewProfile:s}),[n,i,s]);return{occupied:n.length>0,node:a}}function E({title:e,children:n,action:o}){return t.jsxs("div",{className:"text-muted-foreground flex h-full flex-col items-center justify-center gap-2 p-10 text-center text-sm",children:[t.jsx(Nt,{className:"text-muted-foreground/50 size-10","aria-hidden":!0}),t.jsx("p",{className:"text-foreground font-medium",children:e}),t.jsx("p",{className:"max-w-sm",children:n}),o]})}function Ts(){return t.jsxs(t.Fragment,{children:[t.jsx(bt,{children:"Home"}),t.jsx(Es,{})]})}function Es(){var p,j,x;const e=yt(),[n,o]=m.useState(!1),s=m.useCallback(()=>{const u=document.activeElement;wt(u)&&u.blur()},[]),{thread:i,entry:a}=re({strict:!1}),r=St(),l=Ms(e.room===null?[]:[e.room.id]),c=_(((p=e.room)==null?void 0:p.id)??null),d=ue(((j=e.room)==null?void 0:j.id)??null,null),h=c!==void 0&&c.length===0&&d.length===0,g=js(((x=e.room)==null?void 0:x.id)??null);if(e.status==="loading")return t.jsxs("div",{className:"flex h-full flex-col","aria-busy":!0,children:[t.jsxs("div",{className:"flex items-center gap-3 border-b px-4 py-3",children:[t.jsx(C,{className:"size-7 rounded-full"}),t.jsx(C,{className:"h-4 w-40"})]}),t.jsx("div",{className:"flex-1"})]});if(e.status==="error")return t.jsx(E,{title:"Couldn’t load your team room",action:t.jsx(b,{variant:"outline",size:"sm",className:"mt-2",onClick:e.retry,children:"Try again"}),children:"Its messages are safe."});if(e.status==="missing")return t.jsx(E,{title:"Your team room isn’t open yet",children:"DorkOS opens it at startup. Still missing? Restart DorkOS."});if(e.status==="archived"){const u=e.room;return t.jsx(E,{title:`${me(u)} is archived`,action:t.jsx(b,{variant:"outline",size:"sm",className:"mt-2",disabled:r.isPending,onClick:()=>r.mutate({roomId:u.id}),children:r.isPending?"Bringing it back…":"Bring it back"}),children:"Its messages are safe."})}return t.jsx(hs,{children:t.jsx(Ct,{roomId:e.room.id,threadId:i,entrySeq:a,threadRoute:"/",offerJumpBackIn:!0,onComposerFocusChange:o,aboveTimeline:t.jsxs(t.Fragment,{children:[t.jsx(es,{presence:l,composerFocused:n,onExpand:s}),t.jsx(cs,{roomId:e.room.id,presenceOccupied:l.occupied})]}),aboveComposer:g?t.jsx(xs,{roomId:e.room.id,mode:g}):h?t.jsx(ss,{roomId:e.room.id}):void 0})})}const Ln=Ts;export{Ln as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,G as _,_ as x,bf as B,B as O,fl as F,r as n,fm as L,fn as N,fo as E,fp as z,fq as H,e as G,fr as h,fs as U,d0 as K,eh as Q,ct as V,h as W,bg as $,b0 as q,c$ as X,b3 as J,l as Y}from"./index-BR1m9FON.js";import{Q as Z}from"./query-error-state-Cm-Lozlb.js";import{P as A}from"./page-container-0sWZ3xh9.js";import{F as ee}from"./FeatureDisabledState-Bi23k3rg.js";import{i as te}from"./registry-jD9zw538.js";import{T as se,C as ae}from"./TasksEmptyState-B3SjsxQa.js";import{u as ie,S as ne}from"./use-filter-state-CiPZ0AIH.js";import{S as re}from"./scroll-area-DAC7NrVU.js";import"./empty-state-BHcmkSzu.js";import"./copy-button-BOznikwM.js";import"./inline-code-mh48Uhbi.js";import"./zap-DSllMMHe.js";import"./form-BL14vwyB.js";import"./trust-dial-D__tIhzt.js";import"./command-CaUEAy3b.js";import"./AgentPicker-BDci-9aL.js";import"./AgentOptionRow-ApuDEKqq.js";import"./execution-config-BS5rtvTZ.js";import"./settings-for-runtime-BoOa-ZFG.js";import"./list-runtime-types-DLmjtBMq.js";import"./format-cron-meJMgYNe.js";const oe="relative after:absolute after:-inset-x-1 after:-inset-y-2 md:after:hidden";function le({count:i,active:o,onToggle:m}){return e.jsxs("button",{type:"button","data-slot":"tasks-failing-chip","aria-pressed":o,onClick:m,className:_("text-destructive hover:bg-destructive/10 inline-flex h-7 items-center gap-1.5 rounded-md border px-2.5 text-xs",oe,o?"border-destructive/50 bg-destructive/10":"border-input"),children:["Failing",e.jsx("span",{className:"font-medium tabular-nums",children:i})]})}function de({count:i,onShow:o}){return e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsxs("button",{type:"button","data-slot":"tasks-failing-count",onClick:o,className:"text-destructive rounded-sm underline-offset-2 hover:underline",children:[i," failing"]})]})}function ce({onShowAll:i}){return e.jsxs(x.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},"data-slot":"tasks-nothing-failing",className:"flex flex-col items-center justify-center gap-3 py-12 text-center",children:[e.jsx(B,{className:"text-muted-foreground/50 size-10","aria-hidden":!0}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Nothing is failing. Every schedule’s last run did its job."}),e.jsx(O,{variant:"outline",size:"sm",onClick:i,children:"Show all"})]})}const ue=8,he={visible:{transition:{staggerChildren:.04}},hidden:{}},me={hidden:{opacity:0,y:8},visible:{opacity:1,y:0}};function ge({tasks:i,isLoading:o,agentMap:m,onEditTask:g,agentId:d}){const s=ie(F,{debounce:{search:200}}),[y]=n.useState(0),[j,c]=n.useState(null),r=n.useMemo(()=>d?i.filter(t=>t.agentId===d):i,[i,d]),p=n.useMemo(()=>[...new Set(r.map(t=>t.agentId).filter(t=>!!t))],[r]),f=n.useMemo(()=>{const t=L(r,F,s.values,E,{field:s.sortField||N,direction:s.sortDirection});return s.sortField?t:z(t)},[r,s.values,s.sortField,s.sortDirection]),l=n.useMemo(()=>r.filter(H).length,[r]),u=s.values.health==="failing",k=()=>s.set("health",u?"":"failing");return o?e.jsx("div",{className:"space-y-3 py-4",children:Array.from({length:3}).map((t,v)=>e.jsx(G,{className:"h-14 w-full rounded-xl"},v))}):e.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[e.jsxs(h,{state:s,className:"px-0",children:[e.jsx(h.Search,{placeholder:"Filter tasks…"}),(l>0||u)&&e.jsx(le,{count:l,active:u,onToggle:k}),e.jsx(h.Primary,{name:"status"}),e.jsx(h.AddFilter,{dynamicOptions:{agent:p}}),e.jsx(h.Sort,{options:E,defaultField:N}),e.jsx(h.ResultCount,{count:f.length,total:r.length,noun:"schedule",children:l>0&&e.jsx(de,{count:l,onShow:()=>s.set("health","failing")})}),e.jsx(h.ActiveFilters,{})]}),e.jsx(re,{className:"min-h-0 flex-1","data-testid":U.tasksList,children:e.jsx("div",{"data-slot":"tasks-list-cards",className:"space-y-2 pb-4 sm:pr-3",children:f.length===0&&u&&l===0?e.jsx(ce,{onShowAll:()=>s.clear("health")}):f.length===0&&r.length>0?e.jsxs(x.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},className:"flex flex-col items-center justify-center gap-3 py-12 text-center",children:[e.jsx(ne,{className:"text-muted-foreground/50 size-10"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:s.describeActive()?`No tasks match ${s.describeActive()}`:"No tasks match your filters"}),e.jsx(O,{variant:"outline",size:"sm",onClick:s.clearAll,children:"Clear filters"})]}):e.jsx(x.div,{initial:"hidden",animate:"visible",variants:he,className:"space-y-2",children:f.map((t,v)=>e.jsx(x.div,{variants:v<ue?me:void 0,transition:{duration:.15},children:e.jsx(K,{task:t,agent:(t.agentId?m.get(t.agentId):void 0)??null,expanded:j===t.id,onToggleExpand:()=>c(j===t.id?null:t.id),onEdit:()=>g(t)})},t.id))},y)})})]})}function pe(){return e.jsxs(e.Fragment,{children:[e.jsx(Q,{children:"Schedules"}),e.jsx(fe,{})]})}function fe(){const i=V(),o=W(),m=$(),{data:g=[],isLoading:d,isError:s,refetch:y}=q(m),[j,c]=n.useState(!1),[r,p]=n.useState(),[f,l]=n.useState(null),u=g.find(a=>a.id===i.schedule),k=g.some(a=>a.agentId),{data:t}=X(void 0,k||!d),v=n.useMemo(()=>{const a=new Map;for(const b of(t==null?void 0:t.agents)??[])a.set(b.id,b);return a},[t]),{externalTrigger:T,clear:w}=J(),[S,C]=n.useState(!1);T&&!S&&!j?(C(!0),p(void 0),c(!0),w()):!T&&S&&C(!1);const P=a=>{l(a),p(void 0),c(!0)},I=()=>{l(null),p(void 0),c(!0)},R=a=>{p(a),c(!0)},D=a=>{c(a),a||l(null),!a&&i.schedule&&o&&o({...Y.tasks(),search:{...i,schedule:void 0},replace:!0})};if(!m)return e.jsx(ee,{icon:te.tasks,name:"Scheduling",description:"Agents run tasks on a schedule, even while you’re away.",command:"dorkos --tasks"});if(s)return e.jsx(Z,{className:"h-full",title:"Couldn’t load your scheduled tasks",description:"The DorkOS server didn’t answer. Check that it’s running.",onRetry:()=>void y()});const M=g.length>0;return e.jsxs(e.Fragment,{children:[!M&&!d?e.jsx(x.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.15},className:"h-full min-h-0",children:e.jsx(A,{width:"full",children:e.jsx(se,{onCreateWithPreset:P,onCreateBlank:I})})}):e.jsx(x.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.15},className:"h-full min-h-0",children:e.jsx(A,{width:"full",scroll:!1,children:e.jsx(ge,{tasks:g,isLoading:d,agentMap:v,onEditTask:R})})}),e.jsx(ae,{open:j||u!==void 0,onOpenChange:D,editTask:u??r,initialPreset:f})]})}const Be=pe;export{Be as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a5 as j,a6 as g,r as f,j as e,
|
|
1
|
+
import{a5 as j,a6 as g,r as f,j as e,eh as N,ao as i,a4 as b,ei as y,a2 as u,b9 as w}from"./index-BR1m9FON.js";import{I as C}from"./inline-code-mh48Uhbi.js";import{T,d as v,b as p,e as c,a as S,c as d}from"./table-D0EJT0uP.js";import{P as k}from"./page-container-0sWZ3xh9.js";import{G as L}from"./git-branch-CsLE6G0Y.js";const F=["workspaces","scan"],P=6e4;function W(){var a,n,l;const s=j(),t=g({queryKey:F,queryFn:()=>s.scanWorktrees(),staleTime:P,refetchOnWindowFocus:!0});return{root:((a=t.data)==null?void 0:a.root)??null,worktrees:((n=t.data)==null?void 0:n.worktrees)??[],warnings:((l=t.data)==null?void 0:l.warnings)??[],isLoading:t.isLoading,isError:t.isError}}const m="—";function A(s){return s.changedFiles===null?m:s.changedFiles===0?"Clean":`${s.changedFiles} changed`}function B(s){const{ahead:t,behind:a,upstreamGone:n}=s;return n?"Branch merged or deleted":t===null||a===null?m:t===0&&a===0?"In sync":[t>0&&`${t} ahead`,a>0&&`${a} behind`].filter(Boolean).join(" · ")}function E({worktree:s}){const t=(s.changedFiles??0)>0;return e.jsxs(p,{children:[e.jsxs(d,{className:"max-w-0",children:[e.jsx("div",{className:"truncate font-medium",children:s.name}),e.jsx("div",{className:"text-muted-foreground truncate text-xs",title:s.path,children:i(s.path)})]}),e.jsx(d,{className:"max-w-0",children:s.readable?s.branch?e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(L,{className:"text-muted-foreground size-3.5 shrink-0"}),e.jsx("span",{className:"truncate text-xs",children:s.branch})]}):e.jsx("span",{className:"text-muted-foreground text-xs",children:"No branch"}):e.jsx(u,{variant:"outline",title:"DorkOS couldn’t read this folder with git.",children:"Can’t read"})}),e.jsx(d,{className:t?"text-status-warning-fg":"text-muted-foreground",children:e.jsx("span",{className:"text-xs whitespace-nowrap",children:A(s)})}),e.jsx(d,{className:"text-muted-foreground hidden md:table-cell",children:e.jsx("span",{className:"text-xs whitespace-nowrap",children:B(s)})}),e.jsx(d,{className:"text-muted-foreground hidden sm:table-cell",children:e.jsx("span",{className:"text-xs whitespace-nowrap",children:s.lastCommitAt?w(s.lastCommitAt):m})})]})}function G({project:s,worktrees:t}){return e.jsxs("section",{children:[e.jsxs("h2",{className:"mb-3 flex items-center gap-2 text-sm font-semibold",children:[s,e.jsx(u,{variant:"secondary",children:t.length})]}),e.jsx("div",{className:"bg-card rounded-lg border",children:e.jsxs(T,{children:[e.jsx(v,{children:e.jsxs(p,{children:[e.jsx(c,{children:"Folder"}),e.jsx(c,{children:"Branch"}),e.jsx(c,{children:"Changes"}),e.jsx(c,{className:"hidden md:table-cell",children:"Compared to remote"}),e.jsx(c,{className:"hidden sm:table-cell",children:"Last commit"})]})}),e.jsx(S,{children:t.map(a=>e.jsx(E,{worktree:a},a.path))})]})})]})}function H(){const{root:s,worktrees:t,warnings:a,isLoading:n,isError:l}=W(),x=f.useMemo(()=>{const r=new Map;for(const o of t){const h=r.get(o.project)??[];h.push(o),r.set(o.project,h)}return[...r.entries()]},[t]);return e.jsxs(k,{width:"wide",children:[e.jsx(N,{children:"Workspaces"}),e.jsx("p",{className:"text-muted-foreground mb-6 text-sm",children:"Copies of your code, per agent."}),a.length>0&&e.jsxs("div",{className:"mb-6 rounded-lg border border-amber-600/40 bg-amber-500/10 p-4",children:[e.jsx("p",{className:"text-sm font-medium",children:"Some folders couldn’t be read"}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm",children:"This list may be missing what’s inside them."}),e.jsx("ul",{className:"text-muted-foreground mt-2 space-y-0.5 text-xs",children:a.map(r=>e.jsxs("li",{className:"truncate",title:r.path,children:[i(r.path)," (",r.reason,")"]},r.path))})]}),n?e.jsx("p",{className:"text-muted-foreground text-sm",children:"Looking for your worktrees…"}):l?e.jsxs("div",{className:"bg-card rounded-xl border p-10 text-center",children:[e.jsx(b,{className:"text-muted-foreground/60 mx-auto size-8"}),e.jsx("p",{className:"mt-3 font-medium",children:"Couldn’t check your worktrees"}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm",children:"The scan didn’t finish. DorkOS tries again on its own."})]}):x.length===0?e.jsxs("div",{className:"bg-card rounded-xl border p-10 text-center",children:[e.jsx(y,{className:"text-muted-foreground/60 mx-auto size-8"}),e.jsx("p",{className:"mt-3 font-medium",children:"No worktrees yet"}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm",children:"A worktree is a copy of your project, so agents’ edits never collide."}),s&&e.jsxs("p",{className:"text-muted-foreground mt-3 truncate text-xs",title:s,"data-slot":"workspaces-root-path",children:["Looking in ",e.jsx(C,{children:i(s)})]})]}):e.jsx("div",{className:"flex flex-col gap-8",children:x.map(([r,o])=>e.jsx(G,{project:r,worktrees:o},r))})]})}const K=H;export{K as component};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{O as Qt,r as f,j as e,
|
|
1
|
+
import{O as Qt,r as f,j as e,gE as Wt,a5 as V,m5 as mt,a6 as ft,m6 as Y,a7 as ce,a8 as $e,m7 as Gt,m8 as fe,m9 as X,cv as Jt,ma as Vt,cm as Xt,gM as Zt,cz as Ie,l as Ne,mb as es,mc as ts,md as ss,me as Se,mf as Fe,B as S,mg as ns,c$ as ht,mh as pt,eL as re,ew as xt,ex as gt,ey as yt,ez as vt,eA as Ke,I as qe,bO as jt,h7 as as,bP as Nt,bQ as wt,bR as bt,bS as Ct,bT as St,bU as Rt,bW as rs,a3 as is,mi as os,mj as ls,mk as cs,lG as he,d2 as He,d3 as Be,d5 as Qe,d6 as We,d7 as Ge,e_ as Je,d$ as Ve,dR as kt,l$ as ds,m0 as us,dC as ms,ml as fs,mm as Xe,mn as hs,mo as ps,mp as At,mq as xs,mr as Dt,ms as Tt,mt as gs,eh as Mt,mu as ys,mv as vs,mw as js,Y as Ns,a4 as ws,eP as bs,fX as Cs,mx as Ss,my as Rs,G as ve,bb as Re,eO as Ze,a0 as De,h8 as ks,mz as As,mA as rt,mB as it,dc as Et,mC as Ds,mD as Ts,l8 as Ms,af as Es,n as ot}from"./index-BR1m9FON.js";import{T as Os,a as $s,R as Is}from"./RoomSurface-CChzNJKw.js";import{c as ge,C as ke}from"./registry-Tbt9pcZl.js";import{M as Ls}from"./markdown-content-DhAtZOfj.js";import{o as Us,a as zs,c as Fs}from"./owner-notice-DdFc2P8z.js";import{B as Ps}from"./banner-CSKUrrI0.js";import"./ChannelComposer-CAYvz_ZB.js";import"./pane-resize-handle-Bjy4udre.js";import"./UnreadDivider-1aPVzwd7.js";import"./use-room-follow-claim-Bgrpr3bO.js";import"./use-connector-management-BLiCJMgU.js";import"./AgentRequestCard-B2gxCMGi.js";import"./access-copy-tkiFMhRf.js";import"./query-error-state-Cm-Lozlb.js";import"./empty-state-BHcmkSzu.js";import"./use-bindings-gLHRNAFU.js";import"./connection-copy--MA7AN04.js";import"./KeyEntry-67acsEG2.js";import"./use-room-sessions-DecGrP3E.js";import"./use-todos-BzRauzdQ.js";import"./file-CQGljfDT.js";import"./file-drag-GDx2qhdk.js";import"./find-latest-widget-fence-B6sJdG3Q.js";import"./WidgetErrorCard-C5ieVv_9.js";import"./index-CpWxcN5D.js";import"./progress-BA2JPtb6.js";import"./table-D0EJT0uP.js";import"./zap-DSllMMHe.js";import"./package-BhKXbvU_.js";import"./heart-Cn3a-UQI.js";import"./git-branch-CsLE6G0Y.js";import"./file-text-Cycq_S0e.js";import"./paperclip-C-7LhBfl.js";import"./index-Cgjq7a-8.js";import"./RuntimeSetupDialog-DTO5v0dP.js";import"./inline-code-mh48Uhbi.js";import"./list-runtime-types-DLmjtBMq.js";import"./RuntimeConnectFlow-BYQnY5vv.js";import"./copy-button-BOznikwM.js";import"./useMutationState-DIywUTDG.js";import"./runtime-connect-Dn0T5YWv.js";import"./use-transform-DzJeHpxm.js";import"./repeat-B8g-x-Sc.js";import"./format-duration-BCr6uzby.js";import"./mention-pill-DmA8FxL4.js";import"./rotate-ccw-clock-DRtL-2nr.js";import"./unplug-B-ipHefz.js";import"./message-square-off-BowIzJUV.js";import"./registry-jD9zw538.js";/**
|
|
2
2
|
* @license lucide-react v1.48.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -7,4 +7,4 @@ import{O as Qt,r as f,j as e,gz as Wt,a5 as V,m2 as mt,a6 as ft,m3 as Y,a7 as ce
|
|
|
7
7
|
|
|
8
8
|
`)}function ln(t){const s=t==null?void 0:t.code;return typeof s=="string"&&sn.has(s)}function Pe(t){return t.map(({id:s,file:n})=>({id:s,file:n,status:"pending",progress:0}))}function cn({ref:t,roomId:s,canSend:n,entries:a,onReceipt:i,draft:c,ownerKey:l,contextKey:d=l,onHold:r}){const o=V(),h=JSON.stringify([l,t,s,d]),u=ss(c),x=u.text,j=f.useMemo(()=>Pe(u.files),[u.files]),v=f.useRef(c);f.useLayoutEffect(()=>{v.current=c},[c]);function b(m){const R=v.current;if(!R)return;const $=Se.getState(),M=$.drafts[Fe(R)],E=m({text:(M==null?void 0:M.text)??"",files:Pe((M==null?void 0:M.files)??[])});$.write(R,{text:E.text,files:E.files.map(({id:_,file:Q})=>({id:_,file:Q}))})}function g(m){b(R=>({...R,text:m}))}function T(m){b(R=>({...R,files:m(R.files)}))}const[C,P]=f.useState(null);function q(m){P(m===null?null:{address:h,context:d,message:m})}const[O,K]=f.useState([]),U=f.useRef(new Map),w=f.useRef(0),I=f.useRef(new Map),N=f.useRef(new Set),y=f.useRef(h),L=f.useRef(d),A=f.useRef(!0),k=f.useRef(n),z=f.useRef(i),H=f.useRef(r);f.useLayoutEffect(()=>{y.current=h,L.current=d,k.current=n,z.current=i,H.current=r},[h,n,d,i,r]),f.useEffect(()=>(A.current=!0,()=>{A.current=!1}),[]),f.useEffect(()=>{let m=!1;for(const R of a){if(!R.originIdempotencyKey)continue;const $=U.current.get(R.originIdempotencyKey);($==null?void 0:$.address)===y.current&&$.context===L.current&&U.current.delete(R.originIdempotencyKey)&&(lt($),m=!0)}m&&K([...U.current.values()])},[a]);function Z(){A.current&&K([...U.current.values()].filter(m=>m.address===y.current&&m.context===L.current).map(m=>({...m})))}async function ie(m){var R,$;if(!(N.current.has(m.key)||!k.current||!A.current||m.address!==y.current)){N.current.add(m.key),m.status="sending",m.error=void 0,Z();try{!m.posted&&m.uploadedAt.some(E=>!Ut(E))&&(m.attachmentIds=[],m.uploadedAt=[],m.triedAt=[],m.uploadRound+=1);for(let E=m.attachmentIds.length;E<m.files.length;E++){if(!k.current||!A.current||m.address!==y.current)throw new Error("Reconnect to this channel, then try again.");const _=m.files[E],Q=Lt(m.ref,m.roomId,_.id),W=an(Q);if(W){m.attachmentIds.push(W.attachmentId),m.uploadedAt.push(W.at);continue}const se=(R=m.triedAt)[E]??(R[E]=rn()),G=await o.uploadRemoteCommunityAttachment(m.ref,m.roomId,_.file,m.uploadRound?`${m.key}:file:${E}:${m.uploadRound}`:`${m.key}:file:${E}`);on(Q,G.id,se),m.uploadedAt.push(se),m.attachmentIds.push(G.id)}if(!k.current||!A.current||m.address!==y.current)throw new Error("Reconnect to this channel, then try again.");m.posted=!0;const M=await o.postRemoteCommunityEntry(m.ref,m.roomId,{text:m.text,parentEntryId:m.parentEntryId,attachmentIds:m.attachmentIds,idempotencyKey:m.key});U.current.delete(m.key),lt(m),A.current&&m.address===y.current&&m.context===L.current&&z.current(M)}catch(M){if(ln(M)&&ee(m)){U.current.delete(m.key);return}if(Xs(M)&&ee(m)){U.current.delete(m.key),A.current&&m.address===y.current&&(($=H.current)==null||$.call(H,M));return}m.status="failed",m.error=M instanceof Error?M.message:"Not confirmed. Try this message again."}finally{N.current.delete(m.key),Z()}}}function ee(m){const{draft:R}=m.origin,$=Fe(R),M=Se.getState(),E=M.drafts[$],_=(E==null?void 0:E.text)??"";let Q=I.current.get($)??[];const W=ct(Q.map(J=>J.origin.typed));let se=_;W&&_.startsWith(W)?se=_.slice(W.length).replace(/^\n+/,""):Q=[];const G=[...Q,m].sort((J,ne)=>J.origin.seq-ne.origin.seq),be=new Set(G.flatMap(J=>J.files.map(ne=>ne.id))),oe=[...G.flatMap(J=>J.files.map(({id:ne,file:xe})=>({id:ne,file:xe}))),...((E==null?void 0:E.files)??[]).filter(J=>!be.has(J.id))];return M.write(R,{text:ct([...G.map(J=>J.origin.typed),se]),files:oe}),$ in Se.getState().drafts?(I.current.set($,G),!0):!1}function pe(m){const R=v.current;if(!R||!k.current)return;const $=Se.getState(),M=$.drafts[Fe(R)];if(!M||!M.text.trim()&&M.files.length===0)return;if(U.current.size>=30){q("Too many messages waiting. Let them send, or retry them first.");return}const E=$.take(R),_=Pe(E.files),Q={address:h,context:d,ref:t,roomId:s,key:crypto.randomUUID(),text:E.text.trim()?E.text:_.map(W=>W.file.name).join(", "),parentEntryId:m,files:_,attachmentIds:[],uploadedAt:[],triedAt:[],posted:!1,uploadRound:0,status:"sending",origin:{draft:R,typed:E.text,seq:w.current+=1}};U.current.set(Q.key,Q),q(null),ie(Q)}return{text:x,setText:g,attachments:{staged:j,add(m){if(m.some(R=>R.size>25*1024*1024)){q("Each file must be 25 MB or smaller.");return}T(R=>R.length+m.length>8?(q("Attach up to eight files to one message."),R):[...R,...m.map($=>({id:crypto.randomUUID(),file:$,status:"pending",progress:0}))])},remove(m){T(R=>R.filter($=>$.id!==m))},retry(){},cancel(){T(()=>[])},hasFailed:!1,isUploading:!1,holdsSendWhileUploading:!1},deliveries:O.filter(m=>m.address===h&&m.context===d),error:(C==null?void 0:C.address)===h&&C.context===d?C.message:null,send:pe,retry(m){const R=U.current.get(m);R&&ie(R)}}}function zt({entry:t,onThread:s,onReport:n}){const a=V(),i=f.useId(),[c,l]=f.useState(null),[d,r]=f.useState(null),o={id:JSON.stringify([t.community,t.authorId]),kind:t.authorKind,displayName:t.authorDisplayName};async function h(u,x){if(d)return;r(u),l(null);let j;try{const v=await a.downloadRemoteCommunityAttachment(t.community,t.roomId,u);j=URL.createObjectURL(v);const b=document.createElement("a");b.href=j,b.download=Array.from(x,g=>g==="/"||g==="\\"||g.charCodeAt(0)<32?"_":g).join(""),document.body.append(b),b.click(),b.remove()}catch(v){l(v instanceof Error?v.message:"Couldn’t download the file. Try again.")}finally{j&&setTimeout(()=>URL.revokeObjectURL(j),1e3),r(null)}}return e.jsxs(ge.Root,{role:t.authorKind==="human"?"user":"assistant","aria-labelledby":i,children:[e.jsx(ge.Gutter,{author:o,at:t.createdAt}),e.jsxs(ge.Body,{children:[e.jsx(ge.Author,{id:i,author:o,at:t.createdAt}),e.jsxs(ge.Content,{children:[e.jsx(Ls,{content:t.text}),t.attachments.map(u=>e.jsx(S,{variant:"outline",size:"sm",disabled:d!==null,onClick:()=>void h(u.id,u.name),className:"max-w-full",children:e.jsx("span",{className:"min-w-0 truncate",children:d===u.id?"Downloading…":u.name})},u.id)),c&&e.jsx("p",{role:"alert",className:"text-destructive text-sm",children:c}),s&&e.jsx(S,{variant:"ghost",size:"sm",onClick:()=>s(t.threadRootEntryId??t.id),children:t.depth===0?"Reply in thread":"Open thread"}),n&&e.jsx(S,{variant:"ghost",size:"sm",onClick:n,children:"Report"})]})]})]})}function dn({community:t,roomId:s,online:n,canEnroll:a,accessFingerprint:i}){var N,y,L;const c=V(),l=ce(),d=fe(!0,i,t),r=ns(t,a,i),o=ht(),h=pt(t,a,i),[u,x]=f.useState(""),[j,v]=f.useState(""),[b,g]=f.useState(!1),[T,C]=f.useState(null),[P,q]=f.useState(null),O=f.useId(),K=((N=r.data)==null?void 0:N.filter(A=>A.active))??[],U=((y=o.data)==null?void 0:y.agents.filter(A=>!K.some(k=>k.localAgentId===A.id)))??[];async function w(){d&&X(d)&&await l.invalidateQueries({queryKey:Y.remote(d,t)})}async function I(A){if(A.preventDefault(),!u||b||!n||!a||!d)return;const k=d;g(!0),C(null);try{if(await c.enrollRemoteCommunityAgent(t,u,j.trim()?{handle:j.trim()}:{}),!X(k))return;x(""),v(""),await w()}catch(z){X(k)&&C(z instanceof Error?z.message:"Couldn’t add the agent. Try again.")}finally{X(k)&&g(!1)}}return e.jsxs("section",{className:"mt-3 space-y-2 border-t pt-3","aria-label":"Your agents in this space",children:[e.jsx("h3",{className:"text-sm font-medium",children:"My agents"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Add an agent from here, then choose whether it joins this channel."}),r.isError&&e.jsxs("p",{role:"alert",children:["Couldn’t load your agents in this space."," ",e.jsx(S,{variant:"ghost",size:"sm",onClick:()=>void r.refetch(),children:"Retry"})]}),(L=r.data)==null?void 0:L.map(A=>{var k;return e.jsx(un,{agent:A,roomId:s,online:n,canEnroll:a,takesDms:((k=h.data)==null?void 0:k.available)===!0,onChanged:w,onNotice:q},A.localAgentId)}),o.isError&&e.jsx("p",{role:"alert",children:"Couldn’t load the agents on this computer."}),a&&U.length>0&&e.jsxs("form",{onSubmit:A=>void I(A),className:"flex flex-wrap items-end gap-2",children:[e.jsxs("div",{className:"min-w-40 flex-1 space-y-1",children:[e.jsx(re,{htmlFor:`${O}-agent`,children:"Local agent"}),e.jsxs(xt,{value:u,onValueChange:x,disabled:!n||b,children:[e.jsx(gt,{id:`${O}-agent`,children:e.jsx(yt,{placeholder:"Choose an agent"})}),e.jsx(vt,{children:U.map(A=>e.jsx(Ke,{value:A.id,children:A.name},A.id))})]})]}),e.jsxs("div",{className:"min-w-40 flex-1 space-y-1",children:[e.jsx(re,{htmlFor:`${O}-handle`,children:"Space handle (optional)"}),e.jsx(qe,{id:`${O}-handle`,value:j,onChange:A=>v(A.target.value),disabled:!n||b,placeholder:"Use the agent’s handle"})]}),e.jsx(S,{type:"submit",disabled:!u||!n||b,children:b?"Adding…":"Add to space"})]}),P&&e.jsx("p",{role:"status",className:"text-muted-foreground text-sm",children:P}),T&&e.jsx("p",{role:"alert",className:"text-destructive text-sm",children:T})]})}function un({agent:t,roomId:s,online:n,canEnroll:a,takesDms:i,onChanged:c,onNotice:l}){const d=V(),[r,o]=f.useState(null),[h,u]=f.useState(null),x=t.roomIds.includes(s),j=f.useId();async function v(g,T){if(!r){o(g),u(null);try{await T(),await c()}catch(C){u(C instanceof Error?C.message:"Couldn’t finish that. Try again.")}finally{o(null)}}}function b(g){l(g.remoteRevoked?"Stopped taking part.":"Stopped here, but the space wasn’t told. Try again when it’s reachable.")}return e.jsxs("div",{className:"space-y-1 rounded-md border p-2",children:[e.jsxs("p",{className:"text-sm font-medium",children:[t.displayName,!t.active&&" · stopped here"," ",e.jsxs("span",{className:"text-muted-foreground font-normal",children:["· owned by ",t.ownerDisplayName]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.jsx(S,{variant:"outline",size:"sm",disabled:r!==null||!a||!t.active||!x&&!n,onClick:()=>void v("membership",async()=>{x?b(await d.leaveRemoteCommunityAgentRoom(t.community,s,t.localAgentId)):await d.joinRemoteCommunityAgentRoom(t.community,s,t.localAgentId)}),children:x?"Leave channel":"Join channel"}),e.jsx(S,{variant:"ghost",size:"sm",disabled:r!==null||!a,onClick:()=>void v("stop",()=>d.haltRemoteCommunityAgent(t.community,s,t.localAgentId)),children:"Stop agent"}),e.jsxs(jt,{children:[e.jsx(as,{asChild:!0,children:e.jsx(S,{variant:"ghost",size:"sm",disabled:r!==null||!a,children:"Remove from space"})}),e.jsxs(Nt,{children:[e.jsxs(wt,{children:[e.jsxs(bt,{children:["Remove ",t.displayName,"?"]}),e.jsx(Ct,{children:"It leaves every channel in this space. You can re-add it."})]}),e.jsxs(St,{children:[e.jsx(Rt,{children:"Cancel"}),e.jsx(rs,{onClick:()=>void v("remove",async()=>b(await d.ejectRemoteCommunityAgent(t.community,t.localAgentId))),children:"Remove agent"})]})]})]})]}),i&&t.active&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(is,{id:j,checked:t.acceptsDms===!0,disabled:r!==null||!a||!n,onCheckedChange:g=>void v("dms",()=>d.setRemoteCommunityAgentDms(t.community,t.localAgentId,g))}),e.jsx(re,{htmlFor:j,className:"text-xs font-normal",children:"Takes direct messages"})]}),h&&e.jsx("p",{role:"status",className:"text-muted-foreground text-xs",children:h})]})}function mn({community:t,agent:s,disabled:n,accessFingerprint:a}){const i=V(),c=Ie(),l=ce(),d=fe(!0,a,t),[r,o]=f.useState(!1),[h,u]=f.useState(null);async function x(){if(!r){o(!0),u(null);try{const j=await i.startRemoteCommunityDm(t,s.memberId);d&&await l.invalidateQueries({queryKey:Y.dms(d,t)}),c({...Ne.channels(),search:{community:t,id:j.roomId}})}catch(j){u(j.code===os?`${s.displayName} isn’t taking direct messages.`:"Couldn’t open the direct message. Try again.")}finally{o(!1)}}}return e.jsxs("span",{className:"flex flex-wrap items-center justify-end gap-x-2",children:[h&&e.jsx("span",{role:"status",className:"text-muted-foreground order-last w-full text-right text-xs sm:order-none sm:w-auto",children:h}),e.jsx(S,{variant:"ghost",size:"sm",disabled:n||r,onClick:()=>void x(),"aria-label":`Message ${s.displayName}`,children:"Message"})]})}function dt(t){return`$${t.toFixed(2)}`}function fn({community:t,online:s,canEnroll:n}){var b;const a=f.useId(),i=qs(t),c=Hs(t),l=(b=i.data)==null?void 0:b.spend,[d,r]=f.useState(null),o=(l==null?void 0:l.monthlyLimitUsd)!=null?String(l.monthlyLimitUsd):"",h=d??o,u=h.trim()===""?null:ls(Number(h)),x=u===null||Number.isFinite(u)&&u>=cs,j=u!==((l==null?void 0:l.monthlyLimitUsd)??null);function v(g){g.preventDefault(),!(!x||!j||c.isPending)&&c.mutate({monthlyLimitUsd:u},{onSuccess:()=>r(null)})}return!n&&!(l!=null&&l.hasAgentsHere)?null:e.jsxs("section",{className:"mt-3 space-y-2 border-t pt-3","aria-labelledby":`${a}-heading`,children:[e.jsx("h3",{id:`${a}-heading`,className:"text-sm font-medium",children:"Teammates"}),i.isError&&e.jsxs("p",{role:"alert",className:"text-sm",children:["Couldn’t load teammate settings."," ",e.jsx(S,{variant:"ghost",size:"sm",onClick:()=>void i.refetch(),children:"Retry"})]}),i.data&&l&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(re,{htmlFor:`${a}-wake`,children:"Who can wake your agents"}),e.jsxs(xt,{value:i.data.wakeAgentsFrom,onValueChange:g=>c.mutate({wakeAgentsFrom:g==="me"?"me":"members"}),disabled:!s||c.isPending,children:[e.jsx(gt,{id:`${a}-wake`,className:"max-w-64",children:e.jsx(yt,{})}),e.jsxs(vt,{children:[e.jsx(Ke,{value:"members",children:"Anyone in this space"}),e.jsx(Ke,{value:"me",children:"Only me"})]})]})]}),e.jsxs("form",{onSubmit:v,className:"space-y-1",children:[e.jsx(re,{htmlFor:`${a}-limit`,children:"Monthly limit for teammates"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground text-sm","aria-hidden":!0,children:"$"}),e.jsx(qe,{id:`${a}-limit`,inputMode:"decimal",value:h,onChange:g=>r(g.target.value),placeholder:"No limit","aria-invalid":!x,disabled:!s||c.isPending,className:"w-32"}),e.jsx(S,{type:"submit",size:"sm",disabled:!s||!x||!j||c.isPending,children:"Save"})]}),e.jsxs("p",{className:"text-muted-foreground text-xs",children:[l.monthlyLimitUsd===null?"No limit":`Limit ${dt(l.monthlyLimitUsd)} a month`,` · ${dt(l.spentUsd)} spent this month${l.approximate?", approximate":""}`]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Past the limit, teammates’ messages wake nobody. A running turn may go slightly over."}),!x&&e.jsx("p",{role:"alert",className:"text-destructive text-xs",children:"Enter at least $0.01, or leave it empty."})]}),c.isError&&e.jsx("p",{role:"alert",className:"text-destructive text-sm",children:"Couldn’t save. Try again."})]})]})}function hn(t,s){const n=new Date(t),a=n.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"});return n.toDateString()===s.toDateString()?a:`${n.toLocaleDateString([],{month:"short",day:"numeric",...n.getFullYear()===s.getFullYear()?{}:{year:"numeric"}})}, ${a}`}function pn(t,s=new Date){return t.kind!=="agent"?null:t.availability==="available"?{text:"Available"}:t.availability==="offline"&&t.lastSeenAt?{text:"Offline since",since:{dateTime:new Date(t.lastSeenAt).toISOString(),label:hn(t.lastSeenAt,s)}}:null}function xn({roster:t,failed:s,canMention:n,onMention:a,community:i,roomId:c,online:l,canEnroll:d,agentsKey:r,accessFingerprint:o}){var j,v,b;const u=((j=pt(i,!0,o).data)==null?void 0:j.available)===!0,x=(b=(v=he().data)==null?void 0:v.find(g=>g.ref===i))==null?void 0:b.connectedHumanMemberId;return e.jsxs("div",{className:"max-h-48 overflow-auto border-b p-3","aria-label":"Channel members",children:[s&&e.jsx("p",{role:"alert",children:"Couldn’t load members."}),(t==null?void 0:t.stale)&&e.jsx("p",{className:"text-muted-foreground text-sm",children:"Saved member list"}),t==null?void 0:t.members.map(g=>{var C;const T=pn(g);return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-2 text-sm",children:[e.jsxs("span",{children:[g.displayName,g.kind==="agent"?" · Agent":"",g.ownerMemberId&&` · owned by ${((C=t.members.find(P=>P.memberId===g.ownerMemberId))==null?void 0:C.displayName)??"a space member"}`,T&&e.jsxs("span",{className:"text-muted-foreground",children:[` · ${T.text}`,T.since&&e.jsxs(e.Fragment,{children:[" ",e.jsx("time",{dateTime:T.since.dateTime,children:T.since.label})]})]})]}),e.jsxs("span",{className:"flex flex-wrap items-center justify-end",children:[u&&g.kind==="agent"&&g.ownerMemberId!==x&&e.jsx(mn,{community:i,agent:g,disabled:!l,accessFingerprint:o}),g.handle&&e.jsxs(S,{variant:"ghost",size:"sm",disabled:!n,onClick:()=>a(g.handle),children:["Mention @",g.handle]})]})]},g.memberId)}),d&&e.jsx(dn,{community:i,roomId:c,online:l,canEnroll:!0,accessFingerprint:o},r),e.jsx(fn,{community:i,online:l,canEnroll:d})]})}function Ft(t,s){return t instanceof Error&&t.message?t.message:s}function gn({conduct:t,staff:s,onReadRules:n}){const{hold:a,standing:i}=t;return(a==null?void 0:a.kind)==="rules"?e.jsx("div",{className:"px-1 pb-1",children:e.jsx(S,{size:"sm",variant:"outline",onClick:n,children:"Read the rules"})}):a||s||!(i!=null&&i.slowModeSeconds)?null:e.jsxs("p",{className:"text-muted-foreground px-1 pb-1 text-xs",children:["Slow mode: one message every ",i.slowModeSeconds,"s."]})}function yn({conduct:t,open:s,onOpenChange:n}){var c;const a=(c=t.standing)==null?void 0:c.rules,i=a?a.acceptedVersion>=a.version:!1;return e.jsx(He,{open:s,onOpenChange:n,children:e.jsxs(Be,{className:"sm:max-w-lg",children:[e.jsxs(Qe,{children:[e.jsx(We,{children:"Space rules"}),e.jsx(Ge,{children:i?"You accepted these rules.":"Accept these rules to post here."})]}),e.jsxs(Je,{children:[e.jsx("div",{className:"max-h-[50vh] overflow-y-auto rounded-md border p-3 text-sm leading-relaxed whitespace-pre-wrap",children:(a==null?void 0:a.text)??"This space has no rules."}),t.accept.error&&e.jsx("p",{role:"alert",className:"text-destructive mt-2 text-sm",children:Ft(t.accept.error,"Couldn’t accept the rules. Try again.")})]}),e.jsxs(Ve,{children:[e.jsx(S,{variant:"outline",onClick:()=>n(!1),children:"Close"}),(a==null?void 0:a.text)&&!i&&e.jsx(S,{disabled:t.accept.isPending,onClick:()=>t.accept.mutate(a.version,{onSuccess:()=>n(!1)}),children:t.accept.isPending?"Accepting…":"Accept rules"})]})]})})}function vn({community:t,accessFingerprint:s,currentName:n,open:a,onOpenChange:i}){return e.jsx(He,{open:a,onOpenChange:i,children:e.jsx(Be,{className:"sm:max-w-md",children:a&&e.jsx(jn,{community:t,accessFingerprint:s,currentName:n,onDone:()=>i(!1)})})})}function jn({community:t,accessFingerprint:s,currentName:n,onDone:a}){const i=V(),c=ce(),l=fe(!0,s,t),[d,r]=f.useState(n),o=$e({meta:{suppressErrorToast:!0},mutationFn:u=>i.setRemoteCommunityDisplayName(t,u),onSuccess:async()=>{l&&await c.invalidateQueries({queryKey:Y.content(l,t)}),a()}}),h=d.trim();return e.jsxs("form",{onSubmit:u=>{u.preventDefault(),h&&h!==n&&o.mutate(h)},children:[e.jsxs(Qe,{children:[e.jsx(We,{children:"Your name in this space"}),e.jsx(Ge,{children:"Other spaces keep the name they show."})]}),e.jsxs(Je,{className:"space-y-2",children:[e.jsx(re,{htmlFor:"remote-community-display-name",children:"Name"}),e.jsx(qe,{id:"remote-community-display-name",value:d,maxLength:128,autoComplete:"nickname",onChange:u=>r(u.target.value)}),o.error&&e.jsx("p",{role:"alert",className:"text-destructive text-sm",children:Ft(o.error,"Couldn’t change your name. Try again.")})]}),e.jsxs(Ve,{children:[e.jsx(S,{type:"button",variant:"outline",onClick:a,children:"Cancel"}),e.jsx(S,{type:"submit",disabled:!h||h===n||o.isPending,children:o.isPending?"Saving…":"Save name"})]})]})}const Nn=[{value:"spam",label:"Spam"},{value:"harassment",label:"Harassment"},{value:"off_topic",label:"Off topic"},{value:"illegal",label:"Against the law"},{value:"other",label:"Something else"}];function wn({entry:t,onClose:s}){return e.jsx(He,{open:t!==null,onOpenChange:n=>!n&&s(),children:e.jsx(Be,{className:"sm:max-w-md",children:t&&e.jsx(bn,{entry:t,onClose:s},t.id)})})}function bn({entry:t,onClose:s}){const n=V(),a=f.useId(),[i,c]=f.useState(null),[l,d]=f.useState(""),r=$e({meta:{suppressErrorToast:!0},mutationFn:o=>n.reportRemoteCommunityEntry(t.community,t.roomId,t.id,o),onSuccess:()=>{kt("Message reported"),s()}});return e.jsxs("form",{onSubmit:o=>{o.preventDefault(),i&&r.mutate({reason:i,...l.trim()?{note:l.trim()}:{}})},children:[e.jsxs(Qe,{children:[e.jsx(We,{children:"Report message"}),e.jsx(Ge,{children:"This space’s owners and admins review reports."})]}),e.jsxs(Je,{className:"space-y-4",children:[e.jsxs("p",{className:"text-muted-foreground line-clamp-3 text-sm",children:[t.authorDisplayName,": ",t.text]}),e.jsx(ds,{"aria-label":"Reason",value:i??"",onValueChange:o=>c(o),children:Nn.map(o=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(us,{value:o.value,id:`${a}-${o.value}`}),e.jsx(re,{htmlFor:`${a}-${o.value}`,children:o.label})]},o.value))}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(re,{htmlFor:`${a}-note`,children:"Note (optional)"}),e.jsx(ms,{id:`${a}-note`,value:l,maxLength:fs,onChange:o=>d(o.target.value),rows:3}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Only owners and admins see this."})]}),r.error&&e.jsx("p",{role:"alert",className:"text-destructive text-sm",children:r.error instanceof Error&&r.error.message?r.error.message:"Couldn’t send the report. Try again."})]}),e.jsxs(Ve,{children:[e.jsx(S,{type:"button",variant:"outline",onClick:s,children:"Cancel"}),e.jsx(S,{type:"submit",disabled:!i||r.isPending,children:r.isPending?"Sending…":"Send report"})]})]})}function Cn({agentDeliveries:t,drafts:s,entries:n,threadId:a,canSend:i,action:c,onRetryAgent:l,onRetryDraft:d}){return e.jsxs(e.Fragment,{children:[t.filter(r=>r.parentEntryId===(a??null)&&!n.some(o=>o.originIdempotencyKey===r.idempotencyKey)).map(r=>e.jsxs("div",{className:"border-t px-4 py-2 text-sm",role:"status",children:[e.jsxs("p",{className:"font-medium",children:[r.author.displayName," · Agent"]}),e.jsx("p",{className:"whitespace-pre-wrap",children:r.text}),r.attachments.map((o,h)=>e.jsx("span",{className:"mr-2",children:o.name},h)),e.jsx("p",{className:"text-muted-foreground",children:r.state==="pending"?"Waiting for the space to confirm…":r.failure==="expired"?"Not confirmed. Too late to try again.":"Not confirmed. Check the space and the agent’s channel access."}),r.state==="pending"&&r.retryable&&e.jsx(S,{variant:"outline",size:"sm",disabled:!i||c!==null,onClick:()=>l(r.idempotencyKey),children:c===`retry:${r.idempotencyKey}`?"Retrying…":"Retry now"})]},r.idempotencyKey)),s.filter(r=>r.parentEntryId===a&&!n.some(o=>o.originIdempotencyKey===r.key)).map(r=>e.jsxs("div",{className:"border-t px-4 py-2 text-sm",role:"status",children:[e.jsx("p",{className:"whitespace-pre-wrap",children:r.text}),r.files.map(o=>e.jsx("span",{className:"mr-2",children:o.file.name},o.id)),e.jsx("p",{className:"text-muted-foreground",children:r.status==="sending"?"Sending…":"Delivery not confirmed."}),r.error&&e.jsx("p",{children:r.error}),r.status==="failed"&&e.jsx(S,{variant:"outline",size:"sm",disabled:!i,onClick:()=>d(r.key),children:"Retry message"})]},r.key))]})}function Sn(t,s){var c;const n=new Map;for(const l of t)l.thread&&n.set(l.id,{count:l.thread.replyCount,lastAt:l.thread.lastReplyAt,through:l.threadLastReplySeq});const a=new Map;for(const l of s){const d=l.threadRootEntryId;if(l.depth===0||d===null)continue;const r=(c=n.get(d))==null?void 0:c.through;if(r!==void 0&&l.remoteSeq<=r)continue;const o=a.get(d);a.set(d,{count:((o==null?void 0:o.count)??0)+1,newest:o&&o.newest.remoteSeq>l.remoteSeq?o.newest:l})}const i=new Map;for(const l of new Set([...n.keys(),...a.keys()])){const d=n.get(l),r=a.get(l),o=d===void 0?r.count:d.through===void 0?Math.max(d.count,(r==null?void 0:r.count)??0):d.count+((r==null?void 0:r.count)??0);i.set(l,{count:o,lastAt:(r==null?void 0:r.newest.createdAt)??d.lastAt,unread:0})}return i}const Rn={reactions:!1,threads:!0,runWith:!1,attachments:!0,mentions:!0,streamHealth:!0,presence:!1,turnStatus:!1,asks:!1};function kn({community:t,roomId:s,threadId:n,onThread:a,dmAgentName:i}){var tt,st,nt,at;const c=V(),d=(tt=he().data)==null?void 0:tt.find(p=>p.ref===t),r=Xe(d==null?void 0:d.access),o=fe(!0,r.fingerprint,t),{ownerAddress:h,contextAddress:u}=Js(o),x=ce(),j=hs(),v=ps(),b=(st=j.data)==null?void 0:st.destinations.find(p=>p.ref===t&&p.roomId===s),g=f.useRef(null),T=f.useRef(void 0),C=(b==null?void 0:b.scrollAnchorEntryId)??null,P=f.useCallback(p=>{if(!o||n)return;g.current&&clearTimeout(g.current),g.current=null;const D=p??null,F=T.current===void 0?C:T.current;D===null&&F===null||(g.current=setTimeout(()=>{g.current=null,T.current=D,v.mutate({ref:t,roomId:s,threadId:n??null,scrollAnchorEntryId:D})},400))},[o,t,v,C,s,n]);f.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]),f.useEffect(()=>{(d==null?void 0:d.status)==="reconnect-required"&&o&&x.removeQueries({queryKey:Y.remote(o,t)})},[o,t,d==null?void 0:d.status,x]);const q=At(t,s,r.capabilities.read,r.fingerprint),[O,K]=f.useState(0),U=f.useRef([]),w=f.useCallback(p=>U.current.some(D=>D.id===p),[]),I=Qs(t,s,r.capabilities.stream,O,r.fingerprint,r.cacheReadable,w),N=I.status==="removed",y=N?null:I.room??q.data,L=xs(t,s,n,!N&&r.capabilities.read&&(y==null?void 0:y.readable)===!0,r.fingerprint),A=Dt(t,s,!N&&r.capabilities.read&&(y==null?void 0:y.readable)===!0,r.fingerprint),[k,z]=f.useState(()=>({address:u,entries:[]})),H=f.useMemo(()=>k.address===u?k.entries:[],[u,k]);f.useEffect(()=>{U.current=H},[H]);const[Z,ie]=f.useState(0),[ee,pe]=f.useState(!1),[Le,m]=f.useState(null),[R,$]=f.useState(null),M=tn({community:t,roomId:s,enabled:!N&&r.capabilities.read&&(y==null?void 0:y.readable)===!0,accessFingerprint:r.fingerprint}),E=(d==null?void 0:d.connectedHumanMemberId)??null,_=(nt=A.data)==null?void 0:nt.members.find(p=>p.memberId===E),Q=p=>{var D;return p===E||((D=A.data)==null?void 0:D.members.some(F=>F.memberId===p&&F.ownerMemberId===E))===!0},[W,se]=f.useState({address:"",name:null,error:null}),G=W.address===u?W.name:null,be=W.address===u?W.error:null,oe=f.useRef(null),J=f.useRef(null),ne=f.useRef(null),xe=!N&&r.capabilities.post&&I.status==="live"&&(y==null?void 0:y.writable)===!0,Ue=xe&&M.hold===null,de=f.useMemo(()=>{var p;return N?[]:Ye(Te(t,s,...((p=L.data)==null?void 0:p.pages.map(D=>D.entries))??[],I.entries,H),I.revisions)},[t,s,L.data,I.entries,I.revisions,H,N]),_t=f.useCallback(p=>{z(D=>({address:u,entries:Te(t,s,D.address===u?D.entries:[],[p]).slice(-500)})),ie(D=>D+1)},[u,t,s]);f.useLayoutEffect(()=>{var p;Z>0&&((p=ne.current)==null||p.scrollToBottom())},[Z]);const Kt=f.useMemo(()=>{var p;return o?{ownerKey:o.ownerKey,epoch:o.epoch,ref:t,generation:((p=o.connection)==null?void 0:p.generation)??0,roomId:s,threadId:n}:null},[o,t,s,n]),B=cn({ref:t,roomId:s,canSend:Ue,entries:de,onReceipt:_t,draft:Kt,ownerKey:h||"unresolved",contextKey:u||"unresolved",onHold:M.noteHold}),Yt=de.filter(p=>n?p.id===n||p.threadRootEntryId===n:p.depth===0),qt=f.useMemo(()=>{var p;return n?new Map:Sn(((p=L.data)==null?void 0:p.pages.flatMap(D=>D.entries))??[],de)},[n,L.data,de]),et=Yt.flatMap(p=>{const D=qt.get(p.id);return D?[{kind:"message",entry:p},{kind:"replies",rootId:p.id,summary:D}]:[{kind:"message",entry:p}]}),Ht=et.map(p=>p.kind==="replies"?{kind:"thread-reply",id:`${p.rootId}:replies`,rootId:p.rootId,replyCount:p.summary.count,lastAt:p.summary.lastAt}:{kind:"message",id:p.entry.id,payload:p.entry,grouping:{position:"only"},author:{id:JSON.stringify([t,p.entry.authorId]),kind:p.entry.authorKind,displayName:p.entry.authorDisplayName},at:p.entry.createdAt}),ze={kind:"room",id:JSON.stringify([t,s,n]),placeholder:n?"Reply in thread…":`Message ${i??(y==null?void 0:y.title)??"this channel"}…`,canSend:Ue,canSendReason:N?"You no longer have access to this channel.":M.hold?Zs(M.hold):!r.capabilities.post&&r.cacheReadable?"This space is read-only.":y!=null&&y.archived?"This channel is archived.":y!=null&&y.joined?"Reconnecting. You can send once the space is back.":"Join this channel to send messages.",attachments:B.attachments,async send(){B.send(n)}};async function Ce(p,D){if(G||!o)return;const F=o,ue=u;se({address:ue,name:p,error:null});try{if(await D(),!X(F))return;(p==="join"||p==="leave"||p.startsWith("retry:"))&&K(ae=>ae+1),await x.invalidateQueries({queryKey:Y.remote(F,t)})}catch(ae){X(F)&&se({address:ue,name:p,error:ae instanceof Error?ae.message:"Couldn’t finish that. Try again."})}finally{X(F)&&se(ae=>ae.address===ue?{...ae,name:null}:ae)}}function Bt(){var F;const p=de.at(-1);if(n||L.hasNextPage||!p||I.status!=="live"||((F=oe.current)==null?void 0:F.address)===u&&oe.current.cursor===p.cursor||!o)return;const D=o;oe.current={address:u,cursor:p.cursor},c.setRemoteCommunityReadCursor(t,s,p.cursor).then(()=>{X(D)&&x.invalidateQueries({queryKey:Y.rooms(D,t)})}).catch(()=>{var ue;((ue=oe.current)==null?void 0:ue.address)===u&&(oe.current=null)})}return e.jsxs(ke.Root,{surface:"room",capabilities:Rn,target:ze,children:[e.jsxs("section",{className:"flex h-full min-h-0 flex-col","aria-label":(y==null?void 0:y.title)??"Space channel",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b px-3 py-2",children:[n&&e.jsx(S,{variant:"ghost",size:"sm",onClick:()=>a(),children:"Back to channel"}),!N&&r.capabilities.post&&y&&!y.joined&&!y.stale&&e.jsx(S,{size:"sm",disabled:G!==null,onClick:()=>void Ce("join",()=>c.joinRemoteCommunityRoom(t,s)),children:"Join channel"}),r.cacheReadable&&e.jsx(S,{variant:"ghost",size:"sm",disabled:N,onClick:()=>pe(!ee),children:ee?"Hide members":"Members"}),((at=M.standing)==null?void 0:at.rules.text)&&e.jsx(S,{variant:"ghost",size:"sm",onClick:()=>m("rules"),children:"Rules"}),r.capabilities.post&&e.jsx(S,{variant:"ghost",size:"sm",onClick:()=>m("name"),children:"Your name"}),r.capabilities.enrollAgent&&e.jsx(S,{variant:"outline",size:"sm",disabled:G!==null,onClick:()=>void Ce("stop",()=>c.haltRemoteCommunityRoom(t,s)),children:G==="stop"?"Stopping…":"Stop my agents"}),r.capabilities.post&&(y==null?void 0:y.joined)&&!i&&e.jsx(S,{variant:"ghost",size:"sm",disabled:G!==null||!xe,onClick:()=>void Ce("leave",async()=>{await c.leaveRemoteCommunityRoom(t,s),o&&x.removeQueries({queryKey:Y.room(o,t,s)})}),children:"Leave channel"})]}),be&&e.jsx("p",{role:"alert",className:"text-destructive px-4 py-2 text-sm",children:be}),N?e.jsx("p",{role:"status",className:"p-6 text-sm",children:"You no longer have access to this channel."}):e.jsxs(e.Fragment,{children:[I.status!=="live"&&e.jsx("p",{role:"status",className:"text-muted-foreground px-4 py-2 text-sm",children:I.status==="connecting"?"Connecting to the space…":"Space unavailable. Showing saved messages."}),q.isError&&e.jsx("p",{role:"alert",className:"px-4 py-2 text-sm",children:"Couldn’t load this channel."}),ee&&e.jsx(xn,{roster:A.data,failed:A.isError,canMention:xe,onMention:p=>{var D;B.setText(`${B.text}${B.text&&!B.text.endsWith(" ")?" ":""}@${p} `),(D=J.current)==null||D.focus()},community:t,roomId:s,online:I.status==="live",canEnroll:r.capabilities.enrollAgent,agentsKey:u,accessFingerprint:r.fingerprint}),L.isError&&e.jsxs("p",{role:"alert",className:"p-3 text-sm",children:["Some messages could not be loaded."," ",e.jsx(S,{variant:"ghost",size:"sm",onClick:()=>void L.refetch(),children:"Retry"})]}),L.hasNextPage&&e.jsx(S,{variant:"ghost",size:"sm",disabled:L.isFetchingNextPage,onClick:()=>void L.fetchNextPage(),children:"Load the next page of history"}),e.jsx(ke.Timeline,{ref:ne,conversationId:ze.id,rows:Ht,label:n?"Space thread":"Space messages",busy:L.isFetching,resumeRow:()=>n?void 0:C??void 0,onTopRow:P,onReachedBottom:Bt,onOpenThread:a,empty:e.jsx("p",{className:"text-muted-foreground p-6 text-sm",children:L.isPending?"Loading messages…":"No messages here yet."}),renderRow:(p,D)=>{const F=et[D.index];return F.kind==="message"?e.jsx(zt,{entry:F.entry,onThread:a,onReport:r.capabilities.post&&A.data&&!Q(F.entry.authorId)?()=>$(F.entry):void 0}):e.jsx(Os,{summary:F.summary,open:!1,onOpen:()=>a(F.rootId)})}}),e.jsx(Cn,{agentDeliveries:I.deliveries,drafts:B.deliveries,entries:de,threadId:n,canSend:Ue,action:G,onRetryAgent:p=>void Ce(`retry:${p}`,()=>c.retryRemoteCommunityDelivery(t,s,p)),onRetryDraft:B.retry}),B.error&&e.jsx("p",{role:"alert",className:"text-destructive px-4 py-2 text-sm",children:B.error}),e.jsx(ke.Composer,{inputRef:J,aboveInput:e.jsx(gn,{conduct:M,staff:["owner","admin"].includes((_==null?void 0:_.role)??""),onReadRules:()=>m("rules")}),className:"m-3",value:B.text,onChange:B.setText,onSubmit:()=>B.send(n),input:{isStreaming:!1,contextKey:ze.id,canSubmit:B.text.trim().length>0||B.attachments.staged.length>0}})]})]}),e.jsx(yn,{conduct:M,open:Le==="rules",onOpenChange:p=>m(p?"rules":null)}),e.jsx(vn,{community:t,accessFingerprint:r.fingerprint,currentName:(_==null?void 0:_.displayName)??"",open:Le==="name",onOpenChange:p=>m(p?"name":null)}),e.jsx(wn,{entry:R,onClose:()=>$(null)})]})}function An({community:t,roomId:s}){var h,u;const n=he(),a=(h=n.data)==null?void 0:h.find(x=>x.ref===t),i=Xe(a==null?void 0:a.access),c=At(t,s??"",!!s&&i.capabilities.read,i.fingerprint),{dm:l}=Tt(t,s??"",!!s&&i.capabilities.read,i.fingerprint),d=(a==null?void 0:a.label)??"Space",r=s?l?gs(l):(u=c.data)==null?void 0:u.title:void 0,o=a===void 0&&n.fetchStatus==="fetching"||s!==void 0&&r===void 0&&c.fetchStatus==="fetching";return e.jsx(Mt,{pending:o,children:r?`${d} · ${r}`:d})}function Pt(t){var s,n,a,i;return!t||t.status==="reconnect-required"?null:((n=(s=t.access)==null?void 0:s.lastKnown)==null?void 0:n.lifecycle)==="deleted"?"deleted":((i=(a=t.access)==null?void 0:a.lastKnown)==null?void 0:i.lifecycle)==="taken_down"?"taken-down":t.seemsGoneSince?"seems-gone":null}function ut(t,s,n){return`${t} ${t===1?s:n}`}function Dn(t,s){const n=[t>0?ut(t,"message from your agents","messages from your agents"):null,s>0?ut(s,"draft of yours","drafts of yours"):null].filter(i=>i!==null);if(n.length===0)return null;const a=n.length===1&&(t===1||s===1);return`${n.join(" and ")} ${a?"wasn’t":"weren’t"} sent.`}function Tn({connection:t,onRemoved:s}){const n=Pt(t),a=ys(),[i,c]=f.useState(!1),{ownerKey:l}=vs(),d=js(l,t.ref),{copied:r,failed:o,copy:h}=Ns(),u=t.label,x=t.seemsGoneSince?new Date(t.seemsGoneSince).toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"}):null;function j(){a.mutate(t,{onSuccess:()=>{c(!1),kt.success(`${u} is removed from DorkOS.`),s()}})}const v=n==="deleted"||n==="taken-down",b=n==="taken-down"?"This space was taken down":n==="deleted"?"This space was deleted":"This space seems to be gone",g=n==="taken-down"?`DorkOS removed its copy here. If ${u} returns, you can connect again.`:n==="deleted"?"DorkOS removed its copy from this computer.":`Since ${x}, ${u} says it doesn’t exist. Its channels, messages and files are still here.`,T=Dn(v?t.undeliveredAgentMessages??0:0,d.length),C=d.length===0?null:d.length===1?"Your unsent draft is cleared too.":`Your ${d.length} unsent drafts are cleared too.`;return e.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 p-10 text-center text-sm","data-testid":"community-gone",children:[e.jsx(_s,{className:"text-muted-foreground/50 size-10","aria-hidden":!0}),e.jsx("p",{className:"text-foreground font-medium",children:b}),e.jsx("p",{className:"text-muted-foreground max-w-sm",children:g}),T&&e.jsx("p",{role:"status",className:"text-foreground max-w-sm","data-testid":"community-gone-unsent",children:T}),e.jsx("span",{className:"sr-only","aria-live":"polite","data-testid":"community-gone-copy-status",children:r?"Copied.":o?"Couldn’t copy to the clipboard.":""}),e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[d.length>0&&e.jsx(S,{variant:"outline",onClick:()=>void h(d.join(`
|
|
9
9
|
|
|
10
|
-
`)),children:r?"Copied":o?"Couldn’t copy":d.length===1?"Copy your draft":"Copy your drafts"}),e.jsx(S,{variant:v?"outline":"destructive",onClick:()=>c(!0),children:v?"Remove from DorkOS":"Remove local copy"})]}),e.jsx(jt,{open:i,onOpenChange:P=>{P||a.reset(),c(P)},children:e.jsxs(Nt,{children:[e.jsxs(wt,{children:[e.jsx(bt,{children:v?`Remove ${u} from DorkOS?`:`Remove your copy of ${u}?`}),e.jsx(Ct,{asChild:!0,children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{children:v?`${u} leaves this app. Nothing else is stored here.`:"This deletes its channels, messages and files from this computer."}),!v&&e.jsx("p",{children:"Your agents stop answering there. If it’s still around, you can connect again."}),C&&e.jsx("p",{children:C})]})})]}),a.isError&&e.jsx("p",{role:"alert",className:"text-destructive text-sm",children:"Couldn’t remove it. Check that DorkOS is running, then try again."}),e.jsxs(St,{children:[e.jsx(Rt,{disabled:a.isPending,children:"Cancel"}),e.jsx(S,{variant:"destructive",disabled:a.isPending,onClick:j,children:a.isPending?"Removing…":v?"Remove from DorkOS":"Remove local copy"})]})]})})]})}function Mn({connection:t,dateFormat:s}){var c,l;const n=Us(t);if(!n)return null;const[a,...i]=zs(n,(l=(c=t.access)==null?void 0:c.lastKnown)==null?void 0:l.lifecycle,s);return e.jsxs("section",{"aria-label":"Request to take over this space",className:"border-status-warning-border bg-status-warning-bg text-status-warning-fg flex flex-wrap items-start gap-x-3 gap-y-2 border-b px-4 py-3 text-sm",children:[e.jsx(ws,{className:"mt-0.5 size-4 shrink-0","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 flex-1 basis-60 space-y-1",children:[e.jsx("p",{className:"text-foreground font-medium",children:a}),i.map(d=>e.jsx("p",{children:d},d))]}),e.jsxs(S,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>Cs(Fs(t)),children:["Open space",e.jsx(bs,{className:"size-3.5","aria-hidden":!0})]})]})}const En={reactions:!1,threads:!1,runWith:!1,attachments:!1,mentions:!1,streamHealth:!1,presence:!1,turnStatus:!1,asks:!1};function On({dm:t,localAgentId:s,access:n}){var r,o,h,u;const a=Ss(t.community,t.roomId,s,n),i=f.useRef(null),c=f.useRef(!0),l=(o=(r=a.data)==null?void 0:r.entries.at(-1))==null?void 0:o.id;f.useLayoutEffect(()=>{const x=i.current;x&&c.current&&(x.scrollTop=x.scrollHeight)},[l]);const d={kind:"room",id:JSON.stringify([t.community,t.roomId,"read-only"]),placeholder:"",canSend:!1,canSendReason:"This direct message is read-only.",attachments:null,send:()=>Promise.reject(new Error("This direct message is read-only."))};return e.jsx(ke.Root,{surface:"room",capabilities:En,target:d,children:e.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[e.jsxs("section",{className:"border-b px-4 py-2 text-sm","aria-label":"About this direct message",children:[e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:`${t.member.displayName} with ${t.agent.displayName}`}),e.jsx("span",{className:"text-muted-foreground",children:" · Read-only"})]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:`Only ${t.member.displayName} and ${t.agent.displayName} can post here.`})]}),e.jsxs("section",{ref:i,onScroll:x=>{const j=x.currentTarget;c.current=j.scrollHeight-j.scrollTop-j.clientHeight<40},className:"min-h-0 flex-1 overflow-auto py-2","aria-label":"Messages",children:[a.isError&&e.jsxs("p",{role:"alert",className:"px-4 text-sm",children:["Couldn’t load this direct message."," ",e.jsx(S,{variant:"ghost",size:"sm",onClick:()=>void a.refetch(),children:"Retry"})]}),((h=a.data)==null?void 0:h.entries.length)===0&&e.jsx("p",{className:"text-muted-foreground px-4 text-sm",children:"No messages yet."}),(u=a.data)==null?void 0:u.entries.map(x=>e.jsx(zt,{entry:x},x.id))]})]})})}function $n({community:t,roomId:s,children:n}){var l;const a=(l=he().data)==null?void 0:l.find(d=>d.ref===t),i=Xe(a==null?void 0:a.access),{dm:c}=Tt(t,s,i.verified&&i.capabilities.read,i.fingerprint);return c?c.readOnly&&c.localAgentId?e.jsx(On,{dm:c,localAgentId:c.localAgentId,access:i.fingerprint}):e.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[e.jsx(In,{dm:c,accessFingerprint:i.fingerprint}),e.jsx("div",{className:"min-h-0 flex-1",children:n(c.agent.displayName)})]}):n()}function In({dm:t,accessFingerprint:s}){var c;const a=(c=Dt(t.community,t.roomId,!0,s).data)==null?void 0:c.members.find(l=>l.memberId===t.agent.memberId),i=t.agent.ownerDisplayName;return e.jsxs("section",{className:"border-b px-4 py-2 text-sm","aria-label":"About this direct message",children:[e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:t.agent.displayName}),e.jsx("span",{className:"text-muted-foreground",children:` · ${i}’s agent · ${i} can read this`})]}),(a==null?void 0:a.availability)==="offline"&&e.jsx("p",{role:"status",className:"text-muted-foreground text-xs",children:`Offline. ${t.agent.displayName} won’t answer until its computer is back on.`})]})}function Ln(t){return t==="owner"?"You’re the owner":t==="admin"?"You’re an admin":"You’re a member"}function Un(t){return t==="owner"?"Owner":t==="admin"?"Admin":"Member"}function zn(t){return t==="invite_only"?"Invite only":t==="closed"?"Closed":"Anyone who signs in"}function Fn(t){const s=new Map;for(const n of t.agents??[])n.ownerMemberId&&s.set(n.ownerMemberId,[...s.get(n.ownerMemberId)??[],n]);return t.members.map(n=>({person:n,agents:s.get(n.memberId)??[]}))}function Pn(t,s,n=!1){const a=t.reduce((l,d)=>l+d.agents.length,0),i=t.length.toLocaleString("en-US"),c=n?`First ${i} people`:`${i} ${t.length===1?"person":"people"}`;return s?`${c} · ${a.toLocaleString("en-US")} ${a===1?"agent":"agents"}`:c}function _n(t){const s=t.agents.length;return s===0?`@${t.person.handle}`:`@${t.person.handle} · ${s} ${s===1?"agent":"agents"}`}function Kn(t,s){return t.availability==="available"?"Available":t.availability==="offline"&&t.lastSeenAt?`Away since ${new Date(t.lastSeenAt).toLocaleTimeString(s,{hour:"numeric",minute:"2-digit"})}`:null}function Yn(t,s=new Date){const n=Math.max(0,Math.round((s.getTime()-Date.parse(t))/6e4));if(n<1)return"just now";if(n<60)return`${n} ${n===1?"minute":"minutes"} ago`;const a=Math.round(n/60);return a<48?`${a} ${a===1?"hour":"hours"} ago`:`${Math.round(a/24)} days ago`}function je(t){var s;return((s=Array.from(t.trim())[0])==null?void 0:s.toLocaleUpperCase())??"?"}function qn(t){const s=t.trim().split(/\s+/u).filter(Boolean);return(s.length>1?[s[0],s.at(-1)]:s).map(a=>je(a)).join("")||"?"}function Me(t){return`hsl(${Rs(t)%360}, 40%, 36%)`}function me({title:t,meta:s,action:n,reason:a,children:i,testId:c}){const l=`space-settings-${t.toLowerCase().replace(/[^a-z]+/g,"-")}`;return e.jsxs("section",{"aria-labelledby":l,className:"flex flex-col gap-2","data-testid":c,children:[e.jsxs("div",{className:"flex min-h-8 items-center gap-2 px-1",children:[e.jsx("h2",{id:l,className:"text-sm font-semibold",children:t}),s&&e.jsx("span",{className:"text-muted-foreground text-xs",children:s}),n&&e.jsx("div",{className:"ml-auto",children:n})]}),typeof a=="string"?e.jsx(we,{className:"px-1",children:a}):a&&e.jsx("div",{className:"px-1",children:a}),e.jsx("div",{className:"bg-muted flex flex-col rounded-xl py-1",children:i})]})}function te({label:t,description:s,reason:n,children:a,stacked:i=!1}){return e.jsxs("div",{className:ve("flex gap-x-4 gap-y-1.5 px-4 py-3",i?"flex-col":"flex-wrap items-center justify-between"),children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:t}),s&&e.jsx("p",{className:"text-muted-foreground text-xs",children:s}),typeof n=="string"?e.jsx(we,{children:n}):n]}),a!==void 0&&e.jsx("div",{className:ve("min-w-0 text-sm",!i&&"text-right"),children:a})]})}function we({children:t,className:s}){return e.jsxs("p",{className:ve("text-muted-foreground flex items-center gap-1.5 text-xs",s),children:[e.jsx(Re,{"aria-hidden":!0,className:"size-3 shrink-0"}),e.jsx("span",{children:t})]})}function Ee({letter:t,color:s,size:n="sm"}){return e.jsx("span",{"aria-hidden":!0,style:{backgroundColor:s},className:ve("inline-flex shrink-0 items-center justify-center font-semibold text-white",n==="lg"?"size-12 rounded-xl text-xl":"size-7 rounded-lg text-xs"),children:t})}function Oe({href:t}){return e.jsxs(Ze,{href:t,className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs underline-offset-4 hover:underline",children:["Manage this in web settings",e.jsx(De,{"aria-hidden":!0,className:"size-3"})]})}function Hn({members:t,refusal:s,role:n,meId:a,offline:i,manageUrl:c}){const l=t?Fn(t.value):[],d=n==="owner"||n==="admin",r=i?null:d?e.jsx(Oe,{href:c}):"Ask an owner or admin to invite or remove people.";return e.jsxs(me,{title:"Members",testId:"space-settings-members",meta:t?Pn(l,t.value.agents!==void 0,t.value.nextCursor!==null):void 0,reason:r,children:[s?e.jsx("div",{className:"px-4 py-3",children:e.jsx(we,{children:s})}):t===void 0?e.jsx("p",{className:"text-muted-foreground px-4 py-3 text-sm",children:"Loading…"}):e.jsx("ul",{className:"flex flex-col","aria-label":"People in this space",children:l.map(({person:o,agents:h})=>e.jsxs("li",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[e.jsx("span",{"aria-hidden":!0,className:"bg-background text-muted-foreground inline-flex size-7 shrink-0 items-center justify-center rounded-full text-[10px] font-semibold",children:qn(o.displayName)}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsxs("span",{className:"truncate text-sm font-medium",children:[e.jsx("bdi",{children:o.displayName}),o.memberId===a&&e.jsx("span",{className:"text-muted-foreground ml-1.5 text-xs font-normal",children:"You"})]}),e.jsx("span",{className:"text-muted-foreground truncate text-xs",dir:"auto",children:_n({person:o,agents:h})})]}),e.jsx("span",{className:"text-muted-foreground w-[104px] shrink-0 text-sm",children:Un(o.role)})]}),h.length>0&&e.jsx("ul",{className:"flex flex-col","aria-label":`${o.displayName}’s agents`,children:h.map(u=>{const x=Kn(u);return e.jsxs("li",{className:"flex items-center gap-3 py-2 pr-4 pl-14",children:[e.jsx(Ee,{letter:je(u.displayName),color:Me(u.memberId)}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-sm font-medium",children:[e.jsx("span",{className:"truncate",dir:"auto",children:u.displayName}),e.jsx("span",{className:"bg-background text-muted-foreground shrink-0 rounded px-1.5 text-[11px] font-normal",children:"Agent"})]}),x&&e.jsx("span",{className:"text-muted-foreground text-xs",children:x})]})]},u.memberId)})})]},o.memberId))}),d&&!s&&e.jsxs("div",{className:"px-4 py-3",children:[e.jsx("div",{className:"text-sm font-medium",children:"Invite links and mutes"}),!i&&e.jsx(Oe,{href:c})]})]})}const Bn="text-destructive bg-destructive/10 hover:bg-destructive/15";function Qn({role:t,webSettingsUrl:s,offline:n}){const a=t==="owner",i=(c,l)=>n?e.jsxs(S,{variant:"secondary",size:"sm",disabled:!0,children:["Continue in web settings",e.jsx(De,{"aria-hidden":!0})]}):e.jsxs(Ze,{href:s(c),className:ve(ks({variant:l?"ghost":"secondary",size:"sm"}),l&&Bn),children:["Continue in web settings",e.jsx(De,{"aria-hidden":!0})]});return e.jsxs(me,{title:a?"Leave, archive or delete":"Leave",testId:"space-settings-danger",children:[e.jsx(te,{label:"Leave space",description:a?void 0:"Your agents leave with you. Someone can invite you back.",reason:a?"Make someone else an owner first.":null,children:a?void 0:i("account",!1)}),a&&e.jsxs(e.Fragment,{children:[e.jsx(te,{label:"Transfer ownership",description:"Hand the space to someone here.",children:i("community",!1)}),e.jsx(te,{label:"Archive",description:"Closes the space for everyone. You can restore it any time.",children:i("community",!0)}),e.jsx(te,{label:"Delete space",description:"Deletes channels, messages and files for everyone after 7 days.",children:i("community",!0)})]})]})}function Wn({connection:t}){var j,v,b,g,T;const s=As(t.ref),n=(j=s.settings.data)==null?void 0:j.value,a=((v=s.me.data)==null?void 0:v.value.member.role)??"member",i=((b=s.me.data)==null?void 0:b.value.member.memberId)??null,c=(g=[s.settings,s.me,s.members,s.rules].map(C=>C.data).find(C=>C==null?void 0:C.offline))==null?void 0:g.fetchedAt,l=c!==void 0,d=new URL(t.pinnedOrigin).host,r=C=>new URL(it(t.remoteCommunityId,C),t.pinnedOrigin).toString(),h=a==="owner"||a==="admin",u=l?null:h?e.jsx(Oe,{href:r("community")}):"Owners and admins change these.",x=(n==null?void 0:n.name)??t.label;return!s.me.data&&s.me.isPending?e.jsx(Ae,{children:e.jsx("p",{className:"text-muted-foreground py-10 text-sm","aria-busy":!0,children:"Loading settings…"})}):s.settings.error&&!n?e.jsx(Ae,{children:e.jsxs("div",{className:"flex flex-col items-start gap-3 py-10",children:[e.jsx("p",{className:"text-sm",children:s.settings.error.message}),e.jsx(S,{variant:"secondary",size:"sm",onClick:s.refetch,children:"Try again"})]})}):e.jsxs(Ae,{children:[e.jsxs("header",{className:"flex items-center gap-4",children:[e.jsx(Ee,{letter:je(x),color:Me(t.ref),size:"lg"}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[e.jsxs("h2",{className:"flex min-w-0 items-center gap-2 text-lg font-semibold",children:[e.jsx("span",{className:"min-w-0 truncate",dir:"auto",children:x}),l&&e.jsxs("span",{className:"bg-status-warning-bg text-status-warning-fg inline-flex shrink-0 items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",children:[e.jsx(rt,{"aria-hidden":!0,className:"size-3"}),"Offline"]})]}),e.jsxs("p",{className:"text-muted-foreground truncate text-sm",children:["Team space · Hosted on ",d,s.me.data&&` · ${Ln(a)}`]})]})]}),l&&e.jsxs(Ps,{variant:"warning",icon:rt,actions:e.jsx(S,{variant:"secondary",size:"xs",onClick:s.refetch,disabled:s.refetching,children:"Try again"}),children:["Can’t reach ",d,". These are the settings from ",Yn(c),"."]}),e.jsxs(me,{title:"General",reason:u,testId:"space-settings-general",children:[e.jsx(te,{label:"Icon",children:e.jsx(Ee,{letter:je(x),color:Me(t.ref)})}),e.jsx(te,{label:"Name",children:e.jsx("span",{dir:"auto",className:"break-words",children:x})}),e.jsx(te,{label:"Description",stacked:!0,children:n!=null&&n.description?e.jsx("p",{dir:"auto",className:"break-words whitespace-pre-wrap",children:n.description}):e.jsx("p",{className:"text-muted-foreground",children:"No description"})}),e.jsx(te,{label:"Who can join",children:n?zn(n.admissionPolicy):"…"})]}),e.jsx(Hn,{members:s.members.data,refusal:s.members.error&&!s.members.data?s.members.error.message:null,role:a,meId:i,offline:l,manageUrl:r("members")}),e.jsx(me,{title:"Rules",testId:"space-settings-rules",children:e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[(T=s.rules.data)!=null&&T.value.text?e.jsx("p",{dir:"auto",className:"text-sm break-words whitespace-pre-wrap",children:s.rules.data.value.text}):e.jsx("p",{className:"text-muted-foreground text-sm",children:s.rules.error&&!s.rules.data?s.rules.error.message:"No rules yet."}),s.rules.data&&e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:s.rules.data.value.acceptedVersion===s.rules.data.value.version?`You agreed to version ${s.rules.data.value.version}.`:`Version ${s.rules.data.value.version}`}),!l&&(h?e.jsx(Oe,{href:r("community")}):e.jsx(we,{children:"Owners and admins change the rules."}))]})]})}),e.jsx(Qn,{role:a,webSettingsUrl:r,offline:l}),e.jsxs("p",{className:"text-muted-foreground px-1 text-sm",children:["Also on the web:"," ",e.jsxs(Ze,{href:r(),className:"text-foreground inline-flex items-center gap-0.5 underline-offset-4 hover:underline",children:[d,it(t.remoteCommunityId),e.jsx(De,{"aria-hidden":!0,className:"size-3.5"})]})]})]})}function Ae({children:t}){return e.jsx("div",{className:"h-full overflow-y-auto","data-testid":"space-settings",children:e.jsx("div",{className:"mx-auto flex w-full max-w-[680px] flex-col gap-8 px-4 py-8",children:t})})}function Gn(){var s;const t=((s=ht().data)==null?void 0:s.agents)??[];return e.jsxs(Ae,{children:[e.jsxs("header",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"bg-muted inline-flex size-12 shrink-0 items-center justify-center rounded-xl",children:e.jsx(Re,{"aria-hidden":!0,className:"size-5"})}),e.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Private"}),e.jsxs("p",{className:"text-muted-foreground flex items-center gap-1.5 text-sm",children:[e.jsx(Re,{"aria-hidden":!0,className:"size-3"}),"Just you and your agents"]})]})]}),e.jsxs(me,{title:"General",testId:"space-settings-general",children:[e.jsx(te,{label:"Icon",reason:"Your private space keeps this icon.",children:e.jsx("span",{className:"bg-background inline-flex size-7 items-center justify-center rounded-lg",children:e.jsx(Re,{"aria-hidden":!0,className:"size-3.5"})})}),e.jsx(te,{label:"Name",reason:"Your private space keeps this name.",children:"Private"})]}),e.jsxs(me,{title:"Who’s here",meta:`You and ${t.length} ${t.length===1?"agent":"agents"}`,testId:"space-settings-members",children:[e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[e.jsx("span",{"aria-hidden":!0,className:"bg-background text-muted-foreground inline-flex size-7 shrink-0 items-center justify-center rounded-full text-[10px] font-semibold",children:"You"}),e.jsxs("div",{className:"flex min-w-0 flex-col",children:[e.jsx("span",{className:"text-sm font-medium",children:"You"}),e.jsx("span",{className:"text-muted-foreground text-xs",children:"Only you can be here. Nobody can be invited."})]})]}),t.length>0&&e.jsx("ul",{className:"flex flex-col","aria-label":"Your agents",children:t.map(n=>e.jsxs("li",{className:"flex items-center gap-3 py-2 pr-4 pl-14",children:[e.jsx(Ee,{letter:je(n.name),color:Me(n.id)}),e.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-sm font-medium",children:[e.jsx("span",{className:"truncate",children:n.name}),e.jsx("span",{className:"bg-background text-muted-foreground shrink-0 rounded px-1.5 text-[11px] font-normal",children:"Agent"})]})]},n.id))})]}),e.jsx(we,{className:"px-1 text-sm",children:"Your private space can’t be left or deleted. It goes with your account."})]})}function Jn(){const{id:t,community:s,tab:n}=Et({from:"/_shell/channels"}),a=Ds(s);return s&&!a.visible?a.isLoading?null:e.jsx(Ts,{...Ne.channels(),search:{},replace:!0}):e.jsxs(e.Fragment,{children:[s?e.jsx(An,{community:s,roomId:t}):t===void 0&&e.jsx(Mt,{children:n==="settings"?"Settings":"Channels"}),e.jsx(Vn,{})]})}function Vn(){const{id:t,thread:s,entry:n,community:a,tab:i}=Et({from:"/_shell/channels"}),c=Ie(),l=Ms(),d=Gs(a?void 0:t,s,n),r=Ws(a?void 0:t),o=Es();if(i==="settings"&&t===void 0){if(a)return e.jsx(_e,{community:a,children:e.jsx(Xn,{community:a})});if(l)return e.jsx(Gn,{})}return a&&t?e.jsx(_e,{community:a,children:e.jsx($n,{community:a,roomId:t,children:h=>e.jsx(kn,{community:a,roomId:t,threadId:s,dmAgentName:h,onThread:u=>{c({...Ne.channels(),search:{community:a,id:t,thread:u}})}})},JSON.stringify([a,t]))}):a?e.jsx(_e,{community:a,children:e.jsxs("div",{className:"text-muted-foreground flex h-full flex-col items-center justify-center gap-2 p-10 text-center text-sm",children:[e.jsx(ot,{className:"text-muted-foreground/50 size-10","aria-hidden":!0}),e.jsx("p",{className:"text-foreground font-medium",children:"No channel selected"}),e.jsx("p",{className:"max-w-sm",children:"Choose a channel from this space."})]})}):d==="pending"||r==="pending"?e.jsx("div",{className:"flex h-full flex-col","aria-busy":!0,children:e.jsx($s,{})}):d==="redirecting"||r==="redirecting"?null:t===void 0?e.jsxs("div",{className:"text-muted-foreground flex h-full flex-col items-center justify-center gap-2 p-10 text-center text-sm",children:[e.jsx(ot,{className:"text-muted-foreground/50 size-10","aria-hidden":!0}),e.jsx("p",{className:"text-foreground font-medium",children:"Pick a channel or DM"}),e.jsx("p",{className:"max-w-sm",children:o?"Open one from All, at the bottom of the screen.":"Open one from the sidebar, or use + next to Channels."})]}):e.jsx(Is,{roomId:t,threadId:s,entrySeq:n,threadRoute:"/channels"})}function Xn({community:t}){var a;const s=he(),n=(a=s.data)==null?void 0:a.find(i=>i.ref===t);return n?e.jsx(Wn,{connection:n}):s.data===void 0?null:e.jsx("p",{className:"text-muted-foreground mx-auto w-full max-w-[680px] px-4 py-10 text-sm",children:"This space isn’t connected."})}function _e({community:t,children:s}){var i;const n=Ie(),a=(i=he().data)==null?void 0:i.find(c=>c.ref===t);return a&&Pt(a)?e.jsx(Tn,{connection:a,onRemoved:()=>void n({...Ne.channels(),search:{}})}):e.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[a&&e.jsx(Mn,{connection:a}),a&&e.jsx(Ys,{connection:a}),e.jsx("div",{className:"min-h-0 flex-1",children:s})]})}const Qa=Jn;export{Qa as component};
|
|
10
|
+
`)),children:r?"Copied":o?"Couldn’t copy":d.length===1?"Copy your draft":"Copy your drafts"}),e.jsx(S,{variant:v?"outline":"destructive",onClick:()=>c(!0),children:v?"Remove from DorkOS":"Remove local copy"})]}),e.jsx(jt,{open:i,onOpenChange:P=>{P||a.reset(),c(P)},children:e.jsxs(Nt,{children:[e.jsxs(wt,{children:[e.jsx(bt,{children:v?`Remove ${u} from DorkOS?`:`Remove your copy of ${u}?`}),e.jsx(Ct,{asChild:!0,children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{children:v?`${u} leaves this app. Nothing else is stored here.`:"This deletes its channels, messages and files from this computer."}),!v&&e.jsx("p",{children:"Your agents stop answering there. If it’s still around, you can connect again."}),C&&e.jsx("p",{children:C})]})})]}),a.isError&&e.jsx("p",{role:"alert",className:"text-destructive text-sm",children:"Couldn’t remove it. Check that DorkOS is running, then try again."}),e.jsxs(St,{children:[e.jsx(Rt,{disabled:a.isPending,children:"Cancel"}),e.jsx(S,{variant:"destructive",disabled:a.isPending,onClick:j,children:a.isPending?"Removing…":v?"Remove from DorkOS":"Remove local copy"})]})]})})]})}function Mn({connection:t,dateFormat:s}){var c,l;const n=Us(t);if(!n)return null;const[a,...i]=zs(n,(l=(c=t.access)==null?void 0:c.lastKnown)==null?void 0:l.lifecycle,s);return e.jsxs("section",{"aria-label":"Request to take over this space",className:"border-status-warning-border bg-status-warning-bg text-status-warning-fg flex flex-wrap items-start gap-x-3 gap-y-2 border-b px-4 py-3 text-sm",children:[e.jsx(ws,{className:"mt-0.5 size-4 shrink-0","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 flex-1 basis-60 space-y-1",children:[e.jsx("p",{className:"text-foreground font-medium",children:a}),i.map(d=>e.jsx("p",{children:d},d))]}),e.jsxs(S,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>Cs(Fs(t)),children:["Open space",e.jsx(bs,{className:"size-3.5","aria-hidden":!0})]})]})}const En={reactions:!1,threads:!1,runWith:!1,attachments:!1,mentions:!1,streamHealth:!1,presence:!1,turnStatus:!1,asks:!1};function On({dm:t,localAgentId:s,access:n}){var r,o,h,u;const a=Ss(t.community,t.roomId,s,n),i=f.useRef(null),c=f.useRef(!0),l=(o=(r=a.data)==null?void 0:r.entries.at(-1))==null?void 0:o.id;f.useLayoutEffect(()=>{const x=i.current;x&&c.current&&(x.scrollTop=x.scrollHeight)},[l]);const d={kind:"room",id:JSON.stringify([t.community,t.roomId,"read-only"]),placeholder:"",canSend:!1,canSendReason:"This direct message is read-only.",attachments:null,send:()=>Promise.reject(new Error("This direct message is read-only."))};return e.jsx(ke.Root,{surface:"room",capabilities:En,target:d,children:e.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[e.jsxs("section",{className:"border-b px-4 py-2 text-sm","aria-label":"About this direct message",children:[e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:`${t.member.displayName} with ${t.agent.displayName}`}),e.jsx("span",{className:"text-muted-foreground",children:" · Read-only"})]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:`Only ${t.member.displayName} and ${t.agent.displayName} can post here.`})]}),e.jsxs("section",{ref:i,onScroll:x=>{const j=x.currentTarget;c.current=j.scrollHeight-j.scrollTop-j.clientHeight<40},className:"min-h-0 flex-1 overflow-auto py-2","aria-label":"Messages",children:[a.isError&&e.jsxs("p",{role:"alert",className:"px-4 text-sm",children:["Couldn’t load this direct message."," ",e.jsx(S,{variant:"ghost",size:"sm",onClick:()=>void a.refetch(),children:"Retry"})]}),((h=a.data)==null?void 0:h.entries.length)===0&&e.jsx("p",{className:"text-muted-foreground px-4 text-sm",children:"No messages yet."}),(u=a.data)==null?void 0:u.entries.map(x=>e.jsx(zt,{entry:x},x.id))]})]})})}function $n({community:t,roomId:s,children:n}){var l;const a=(l=he().data)==null?void 0:l.find(d=>d.ref===t),i=Xe(a==null?void 0:a.access),{dm:c}=Tt(t,s,i.verified&&i.capabilities.read,i.fingerprint);return c?c.readOnly&&c.localAgentId?e.jsx(On,{dm:c,localAgentId:c.localAgentId,access:i.fingerprint}):e.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[e.jsx(In,{dm:c,accessFingerprint:i.fingerprint}),e.jsx("div",{className:"min-h-0 flex-1",children:n(c.agent.displayName)})]}):n()}function In({dm:t,accessFingerprint:s}){var c;const a=(c=Dt(t.community,t.roomId,!0,s).data)==null?void 0:c.members.find(l=>l.memberId===t.agent.memberId),i=t.agent.ownerDisplayName;return e.jsxs("section",{className:"border-b px-4 py-2 text-sm","aria-label":"About this direct message",children:[e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:t.agent.displayName}),e.jsx("span",{className:"text-muted-foreground",children:` · ${i}’s agent · ${i} can read this`})]}),(a==null?void 0:a.availability)==="offline"&&e.jsx("p",{role:"status",className:"text-muted-foreground text-xs",children:`Offline. ${t.agent.displayName} won’t answer until its computer is back on.`})]})}function Ln(t){return t==="owner"?"You’re the owner":t==="admin"?"You’re an admin":"You’re a member"}function Un(t){return t==="owner"?"Owner":t==="admin"?"Admin":"Member"}function zn(t){return t==="invite_only"?"Invite only":t==="closed"?"Closed":"Anyone who signs in"}function Fn(t){const s=new Map;for(const n of t.agents??[])n.ownerMemberId&&s.set(n.ownerMemberId,[...s.get(n.ownerMemberId)??[],n]);return t.members.map(n=>({person:n,agents:s.get(n.memberId)??[]}))}function Pn(t,s,n=!1){const a=t.reduce((l,d)=>l+d.agents.length,0),i=t.length.toLocaleString("en-US"),c=n?`First ${i} people`:`${i} ${t.length===1?"person":"people"}`;return s?`${c} · ${a.toLocaleString("en-US")} ${a===1?"agent":"agents"}`:c}function _n(t){const s=t.agents.length;return s===0?`@${t.person.handle}`:`@${t.person.handle} · ${s} ${s===1?"agent":"agents"}`}function Kn(t,s){return t.availability==="available"?"Available":t.availability==="offline"&&t.lastSeenAt?`Away since ${new Date(t.lastSeenAt).toLocaleTimeString(s,{hour:"numeric",minute:"2-digit"})}`:null}function Yn(t,s=new Date){const n=Math.max(0,Math.round((s.getTime()-Date.parse(t))/6e4));if(n<1)return"just now";if(n<60)return`${n} ${n===1?"minute":"minutes"} ago`;const a=Math.round(n/60);return a<48?`${a} ${a===1?"hour":"hours"} ago`:`${Math.round(a/24)} days ago`}function je(t){var s;return((s=Array.from(t.trim())[0])==null?void 0:s.toLocaleUpperCase())??"?"}function qn(t){const s=t.trim().split(/\s+/u).filter(Boolean);return(s.length>1?[s[0],s.at(-1)]:s).map(a=>je(a)).join("")||"?"}function Me(t){return`hsl(${Rs(t)%360}, 40%, 36%)`}function me({title:t,meta:s,action:n,reason:a,children:i,testId:c}){const l=`space-settings-${t.toLowerCase().replace(/[^a-z]+/g,"-")}`;return e.jsxs("section",{"aria-labelledby":l,className:"flex flex-col gap-2","data-testid":c,children:[e.jsxs("div",{className:"flex min-h-8 items-center gap-2 px-1",children:[e.jsx("h2",{id:l,className:"text-sm font-semibold",children:t}),s&&e.jsx("span",{className:"text-muted-foreground text-xs",children:s}),n&&e.jsx("div",{className:"ml-auto",children:n})]}),typeof a=="string"?e.jsx(we,{className:"px-1",children:a}):a&&e.jsx("div",{className:"px-1",children:a}),e.jsx("div",{className:"bg-muted flex flex-col rounded-xl py-1",children:i})]})}function te({label:t,description:s,reason:n,children:a,stacked:i=!1}){return e.jsxs("div",{className:ve("flex gap-x-4 gap-y-1.5 px-4 py-3",i?"flex-col":"flex-wrap items-center justify-between"),children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:t}),s&&e.jsx("p",{className:"text-muted-foreground text-xs",children:s}),typeof n=="string"?e.jsx(we,{children:n}):n]}),a!==void 0&&e.jsx("div",{className:ve("min-w-0 text-sm",!i&&"text-right"),children:a})]})}function we({children:t,className:s}){return e.jsxs("p",{className:ve("text-muted-foreground flex items-center gap-1.5 text-xs",s),children:[e.jsx(Re,{"aria-hidden":!0,className:"size-3 shrink-0"}),e.jsx("span",{children:t})]})}function Ee({letter:t,color:s,size:n="sm"}){return e.jsx("span",{"aria-hidden":!0,style:{backgroundColor:s},className:ve("inline-flex shrink-0 items-center justify-center font-semibold text-white",n==="lg"?"size-12 rounded-xl text-xl":"size-7 rounded-lg text-xs"),children:t})}function Oe({href:t}){return e.jsxs(Ze,{href:t,className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs underline-offset-4 hover:underline",children:["Manage this in web settings",e.jsx(De,{"aria-hidden":!0,className:"size-3"})]})}function Hn({members:t,refusal:s,role:n,meId:a,offline:i,manageUrl:c}){const l=t?Fn(t.value):[],d=n==="owner"||n==="admin",r=i?null:d?e.jsx(Oe,{href:c}):"Ask an owner or admin to invite or remove people.";return e.jsxs(me,{title:"Members",testId:"space-settings-members",meta:t?Pn(l,t.value.agents!==void 0,t.value.nextCursor!==null):void 0,reason:r,children:[s?e.jsx("div",{className:"px-4 py-3",children:e.jsx(we,{children:s})}):t===void 0?e.jsx("p",{className:"text-muted-foreground px-4 py-3 text-sm",children:"Loading…"}):e.jsx("ul",{className:"flex flex-col","aria-label":"People in this space",children:l.map(({person:o,agents:h})=>e.jsxs("li",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[e.jsx("span",{"aria-hidden":!0,className:"bg-background text-muted-foreground inline-flex size-7 shrink-0 items-center justify-center rounded-full text-[10px] font-semibold",children:qn(o.displayName)}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsxs("span",{className:"truncate text-sm font-medium",children:[e.jsx("bdi",{children:o.displayName}),o.memberId===a&&e.jsx("span",{className:"text-muted-foreground ml-1.5 text-xs font-normal",children:"You"})]}),e.jsx("span",{className:"text-muted-foreground truncate text-xs",dir:"auto",children:_n({person:o,agents:h})})]}),e.jsx("span",{className:"text-muted-foreground w-[104px] shrink-0 text-sm",children:Un(o.role)})]}),h.length>0&&e.jsx("ul",{className:"flex flex-col","aria-label":`${o.displayName}’s agents`,children:h.map(u=>{const x=Kn(u);return e.jsxs("li",{className:"flex items-center gap-3 py-2 pr-4 pl-14",children:[e.jsx(Ee,{letter:je(u.displayName),color:Me(u.memberId)}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-sm font-medium",children:[e.jsx("span",{className:"truncate",dir:"auto",children:u.displayName}),e.jsx("span",{className:"bg-background text-muted-foreground shrink-0 rounded px-1.5 text-[11px] font-normal",children:"Agent"})]}),x&&e.jsx("span",{className:"text-muted-foreground text-xs",children:x})]})]},u.memberId)})})]},o.memberId))}),d&&!s&&e.jsxs("div",{className:"px-4 py-3",children:[e.jsx("div",{className:"text-sm font-medium",children:"Invite links and mutes"}),!i&&e.jsx(Oe,{href:c})]})]})}const Bn="text-destructive bg-destructive/10 hover:bg-destructive/15";function Qn({role:t,webSettingsUrl:s,offline:n}){const a=t==="owner",i=(c,l)=>n?e.jsxs(S,{variant:"secondary",size:"sm",disabled:!0,children:["Continue in web settings",e.jsx(De,{"aria-hidden":!0})]}):e.jsxs(Ze,{href:s(c),className:ve(ks({variant:l?"ghost":"secondary",size:"sm"}),l&&Bn),children:["Continue in web settings",e.jsx(De,{"aria-hidden":!0})]});return e.jsxs(me,{title:a?"Leave, archive or delete":"Leave",testId:"space-settings-danger",children:[e.jsx(te,{label:"Leave space",description:a?void 0:"Your agents leave with you. Someone can invite you back.",reason:a?"Make someone else an owner first.":null,children:a?void 0:i("account",!1)}),a&&e.jsxs(e.Fragment,{children:[e.jsx(te,{label:"Transfer ownership",description:"Hand the space to someone here.",children:i("community",!1)}),e.jsx(te,{label:"Archive",description:"Closes the space for everyone. You can restore it any time.",children:i("community",!0)}),e.jsx(te,{label:"Delete space",description:"Deletes channels, messages and files for everyone after 7 days.",children:i("community",!0)})]})]})}function Wn({connection:t}){var j,v,b,g,T;const s=As(t.ref),n=(j=s.settings.data)==null?void 0:j.value,a=((v=s.me.data)==null?void 0:v.value.member.role)??"member",i=((b=s.me.data)==null?void 0:b.value.member.memberId)??null,c=(g=[s.settings,s.me,s.members,s.rules].map(C=>C.data).find(C=>C==null?void 0:C.offline))==null?void 0:g.fetchedAt,l=c!==void 0,d=new URL(t.pinnedOrigin).host,r=C=>new URL(it(t.remoteCommunityId,C),t.pinnedOrigin).toString(),h=a==="owner"||a==="admin",u=l?null:h?e.jsx(Oe,{href:r("community")}):"Owners and admins change these.",x=(n==null?void 0:n.name)??t.label;return!s.me.data&&s.me.isPending?e.jsx(Ae,{children:e.jsx("p",{className:"text-muted-foreground py-10 text-sm","aria-busy":!0,children:"Loading settings…"})}):s.settings.error&&!n?e.jsx(Ae,{children:e.jsxs("div",{className:"flex flex-col items-start gap-3 py-10",children:[e.jsx("p",{className:"text-sm",children:s.settings.error.message}),e.jsx(S,{variant:"secondary",size:"sm",onClick:s.refetch,children:"Try again"})]})}):e.jsxs(Ae,{children:[e.jsxs("header",{className:"flex items-center gap-4",children:[e.jsx(Ee,{letter:je(x),color:Me(t.ref),size:"lg"}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[e.jsxs("h2",{className:"flex min-w-0 items-center gap-2 text-lg font-semibold",children:[e.jsx("span",{className:"min-w-0 truncate",dir:"auto",children:x}),l&&e.jsxs("span",{className:"bg-status-warning-bg text-status-warning-fg inline-flex shrink-0 items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",children:[e.jsx(rt,{"aria-hidden":!0,className:"size-3"}),"Offline"]})]}),e.jsxs("p",{className:"text-muted-foreground truncate text-sm",children:["Team space · Hosted on ",d,s.me.data&&` · ${Ln(a)}`]})]})]}),l&&e.jsxs(Ps,{variant:"warning",icon:rt,actions:e.jsx(S,{variant:"secondary",size:"xs",onClick:s.refetch,disabled:s.refetching,children:"Try again"}),children:["Can’t reach ",d,". These are the settings from ",Yn(c),"."]}),e.jsxs(me,{title:"General",reason:u,testId:"space-settings-general",children:[e.jsx(te,{label:"Icon",children:e.jsx(Ee,{letter:je(x),color:Me(t.ref)})}),e.jsx(te,{label:"Name",children:e.jsx("span",{dir:"auto",className:"break-words",children:x})}),e.jsx(te,{label:"Description",stacked:!0,children:n!=null&&n.description?e.jsx("p",{dir:"auto",className:"break-words whitespace-pre-wrap",children:n.description}):e.jsx("p",{className:"text-muted-foreground",children:"No description"})}),e.jsx(te,{label:"Who can join",children:n?zn(n.admissionPolicy):"…"})]}),e.jsx(Hn,{members:s.members.data,refusal:s.members.error&&!s.members.data?s.members.error.message:null,role:a,meId:i,offline:l,manageUrl:r("members")}),e.jsx(me,{title:"Rules",testId:"space-settings-rules",children:e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[(T=s.rules.data)!=null&&T.value.text?e.jsx("p",{dir:"auto",className:"text-sm break-words whitespace-pre-wrap",children:s.rules.data.value.text}):e.jsx("p",{className:"text-muted-foreground text-sm",children:s.rules.error&&!s.rules.data?s.rules.error.message:"No rules yet."}),s.rules.data&&e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:s.rules.data.value.acceptedVersion===s.rules.data.value.version?`You agreed to version ${s.rules.data.value.version}.`:`Version ${s.rules.data.value.version}`}),!l&&(h?e.jsx(Oe,{href:r("community")}):e.jsx(we,{children:"Owners and admins change the rules."}))]})]})}),e.jsx(Qn,{role:a,webSettingsUrl:r,offline:l}),e.jsxs("p",{className:"text-muted-foreground px-1 text-sm",children:["Also on the web:"," ",e.jsxs(Ze,{href:r(),className:"text-foreground inline-flex items-center gap-0.5 underline-offset-4 hover:underline",children:[d,it(t.remoteCommunityId),e.jsx(De,{"aria-hidden":!0,className:"size-3.5"})]})]})]})}function Ae({children:t}){return e.jsx("div",{className:"h-full overflow-y-auto","data-testid":"space-settings",children:e.jsx("div",{className:"mx-auto flex w-full max-w-[680px] flex-col gap-8 px-4 py-8",children:t})})}function Gn(){var s;const t=((s=ht().data)==null?void 0:s.agents)??[];return e.jsxs(Ae,{children:[e.jsxs("header",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"bg-muted inline-flex size-12 shrink-0 items-center justify-center rounded-xl",children:e.jsx(Re,{"aria-hidden":!0,className:"size-5"})}),e.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Private"}),e.jsxs("p",{className:"text-muted-foreground flex items-center gap-1.5 text-sm",children:[e.jsx(Re,{"aria-hidden":!0,className:"size-3"}),"Just you and your agents"]})]})]}),e.jsxs(me,{title:"General",testId:"space-settings-general",children:[e.jsx(te,{label:"Icon",reason:"Your private space keeps this icon.",children:e.jsx("span",{className:"bg-background inline-flex size-7 items-center justify-center rounded-lg",children:e.jsx(Re,{"aria-hidden":!0,className:"size-3.5"})})}),e.jsx(te,{label:"Name",reason:"Your private space keeps this name.",children:"Private"})]}),e.jsxs(me,{title:"Who’s here",meta:`You and ${t.length} ${t.length===1?"agent":"agents"}`,testId:"space-settings-members",children:[e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[e.jsx("span",{"aria-hidden":!0,className:"bg-background text-muted-foreground inline-flex size-7 shrink-0 items-center justify-center rounded-full text-[10px] font-semibold",children:"You"}),e.jsxs("div",{className:"flex min-w-0 flex-col",children:[e.jsx("span",{className:"text-sm font-medium",children:"You"}),e.jsx("span",{className:"text-muted-foreground text-xs",children:"Only you can be here. Nobody can be invited."})]})]}),t.length>0&&e.jsx("ul",{className:"flex flex-col","aria-label":"Your agents",children:t.map(n=>e.jsxs("li",{className:"flex items-center gap-3 py-2 pr-4 pl-14",children:[e.jsx(Ee,{letter:je(n.name),color:Me(n.id)}),e.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-sm font-medium",children:[e.jsx("span",{className:"truncate",children:n.name}),e.jsx("span",{className:"bg-background text-muted-foreground shrink-0 rounded px-1.5 text-[11px] font-normal",children:"Agent"})]})]},n.id))})]}),e.jsx(we,{className:"px-1 text-sm",children:"Your private space can’t be left or deleted. It goes with your account."})]})}function Jn(){const{id:t,community:s,tab:n}=Et({from:"/_shell/channels"}),a=Ds(s);return s&&!a.visible?a.isLoading?null:e.jsx(Ts,{...Ne.channels(),search:{},replace:!0}):e.jsxs(e.Fragment,{children:[s?e.jsx(An,{community:s,roomId:t}):t===void 0&&e.jsx(Mt,{children:n==="settings"?"Settings":"Channels"}),e.jsx(Vn,{})]})}function Vn(){const{id:t,thread:s,entry:n,community:a,tab:i}=Et({from:"/_shell/channels"}),c=Ie(),l=Ms(),d=Gs(a?void 0:t,s,n),r=Ws(a?void 0:t),o=Es();if(i==="settings"&&t===void 0){if(a)return e.jsx(_e,{community:a,children:e.jsx(Xn,{community:a})});if(l)return e.jsx(Gn,{})}return a&&t?e.jsx(_e,{community:a,children:e.jsx($n,{community:a,roomId:t,children:h=>e.jsx(kn,{community:a,roomId:t,threadId:s,dmAgentName:h,onThread:u=>{c({...Ne.channels(),search:{community:a,id:t,thread:u}})}})},JSON.stringify([a,t]))}):a?e.jsx(_e,{community:a,children:e.jsxs("div",{className:"text-muted-foreground flex h-full flex-col items-center justify-center gap-2 p-10 text-center text-sm",children:[e.jsx(ot,{className:"text-muted-foreground/50 size-10","aria-hidden":!0}),e.jsx("p",{className:"text-foreground font-medium",children:"No channel selected"}),e.jsx("p",{className:"max-w-sm",children:"Choose a channel from this space."})]})}):d==="pending"||r==="pending"?e.jsx("div",{className:"flex h-full flex-col","aria-busy":!0,children:e.jsx($s,{})}):d==="redirecting"||r==="redirecting"?null:t===void 0?e.jsxs("div",{className:"text-muted-foreground flex h-full flex-col items-center justify-center gap-2 p-10 text-center text-sm",children:[e.jsx(ot,{className:"text-muted-foreground/50 size-10","aria-hidden":!0}),e.jsx("p",{className:"text-foreground font-medium",children:"Pick a channel or DM"}),e.jsx("p",{className:"max-w-sm",children:o?"Open one from All, at the bottom of the screen.":"Open one from the sidebar, or use + next to Channels."})]}):e.jsx(Is,{roomId:t,threadId:s,entrySeq:n,threadRoute:"/channels"})}function Xn({community:t}){var a;const s=he(),n=(a=s.data)==null?void 0:a.find(i=>i.ref===t);return n?e.jsx(Wn,{connection:n}):s.data===void 0?null:e.jsx("p",{className:"text-muted-foreground mx-auto w-full max-w-[680px] px-4 py-10 text-sm",children:"This space isn’t connected."})}function _e({community:t,children:s}){var i;const n=Ie(),a=(i=he().data)==null?void 0:i.find(c=>c.ref===t);return a&&Pt(a)?e.jsx(Tn,{connection:a,onRemoved:()=>void n({...Ne.channels(),search:{}})}):e.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[a&&e.jsx(Mn,{connection:a}),a&&e.jsx(Ys,{connection:a}),e.jsx("div",{className:"min-h-0 flex-1",children:s})]})}const Wa=Jn;export{Wa as component};
|