dorkos 0.125.2 → 0.125.4
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 +359 -223
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-BqGlH1pd.js → AboutPage-CTG5VvGg.js} +1 -1
- package/dist/client/assets/{ActivityErrorState-C4hqCedX.js → ActivityErrorState-BSuvlEdx.js} +1 -1
- package/dist/client/assets/{ActivityPage-frpyizcK.js → ActivityPage-BoiN89nn.js} +1 -1
- package/dist/client/assets/{ActivityRow-DB9c3g1G.js → ActivityRow-Bj0V45d7.js} +1 -1
- package/dist/client/assets/{AdapterIcon-CEHkdca8.js → AdapterIcon-LFpWySMg.js} +1 -1
- package/dist/client/assets/{AdapterSetupWizard-DLJMkb-u.js → AdapterSetupWizard-D9V6g6ha.js} +1 -1
- package/dist/client/assets/{AgentOptionRow-D-QjHi5k.js → AgentOptionRow-nGR6PdC6.js} +1 -1
- package/dist/client/assets/{AgentPicker-DoGucmqI.js → AgentPicker-BhsmtQgu.js} +1 -1
- package/dist/client/assets/{AgentRequestCard--9GA9ymH.js → AgentRequestCard-DBVuClMO.js} +4 -4
- package/dist/client/assets/{AppearancePage-NHNiZrtY.js → AppearancePage-DoDVD6OA.js} +1 -1
- package/dist/client/assets/{ApplyToOverridesDialog-Clo55n6V.js → ApplyToOverridesDialog-56HrIRuZ.js} +1 -1
- package/dist/client/assets/{AttentionSignalRow-BOpClaCD.js → AttentionSignalRow-x8vRACw-.js} +1 -1
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-D9Tm8ual.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-Bxeb6ihh.js} +1 -1
- package/dist/client/assets/{BindingDialog-DZcTXLE8.js → BindingDialog-D6HqDfnK.js} +1 -1
- package/dist/client/assets/{BlintzCanvas-DzjdPTlx.js → BlintzCanvas-DFsdE-hF.js} +3 -3
- package/dist/client/assets/{CanvasCsvContent-xYUrbFeA.js → CanvasCsvContent-BsRV_kUK.js} +1 -1
- package/dist/client/assets/{CanvasFileContent-D6fTvMea.js → CanvasFileContent-BzGYGFSi.js} +2 -2
- package/dist/client/assets/{CanvasModel3dContent-DEassnBV.js → CanvasModel3dContent-dA90prow.js} +2 -2
- package/dist/client/assets/ChannelComposer-MROo35vI.js +44 -0
- package/dist/client/assets/{ChatAppsOff-C00Nl_w6.js → ChatAppsOff-4xIVwDUJ.js} +1 -1
- package/dist/client/assets/{CodeMirrorDiff-JYxkSqFi.js → CodeMirrorDiff-Cexj7RYA.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-CVXZ9B5S.js → CodeMirrorEditor-D1-q0hSM.js} +1 -1
- package/dist/client/assets/{CommitmentList-CcCSwcZ8.js → CommitmentList-Bn7E15MO.js} +1 -1
- package/dist/client/assets/{CommitmentsPage-BrDbzpyR.js → CommitmentsPage-Ch-y0wr0.js} +1 -1
- package/dist/client/assets/{ComputerResourceView-BlLvMt1I.js → ComputerResourceView-Bbqh7e8R.js} +1 -1
- package/dist/client/assets/{ComputerViewer-B8SWICbj.js → ComputerViewer-XqZtg4O4.js} +1 -1
- package/dist/client/assets/{ConnectionAccessLists-Bsb-t24W.js → ConnectionAccessLists-D324Hahi.js} +1 -1
- package/dist/client/assets/{ConnectionsPage-RAhWxuWU.js → ConnectionsPage-5nIQrmtW.js} +1 -1
- package/dist/client/assets/{ConventionPage-CNij_BXA.js → ConventionPage-PFy9ASYy.js} +1 -1
- package/dist/client/assets/{ExtensionPageRoute-BsGqTcyI.js → ExtensionPageRoute-ClLEO5sJ.js} +1 -1
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-eQVA1bL6.js → FloatingTanStackRouterDevtools-CqogiFob-D007PSSL.js} +1 -1
- package/dist/client/assets/HandlePage-DW4b2avU.js +1 -0
- package/dist/client/assets/{HeartbeatPage-D0tKoR6G.js → HeartbeatPage-IqTdsHR6.js} +1 -1
- package/dist/client/assets/{KeyEntry-CSmznLcG.js → KeyEntry-ZYnZcVmM.js} +1 -1
- package/dist/client/assets/{LexicalField-gYKPjFfN.js → LexicalField-PdcZjVov.js} +1 -1
- package/dist/client/assets/{ManagesPage-BF6MFrsv.js → ManagesPage-doVOC8Dk.js} +1 -1
- package/dist/client/assets/{Marketplace-BWDlXgwH.js → Marketplace-B9X8IIWI.js} +2 -2
- package/dist/client/assets/{MarketplaceSourcesView-BhKzgkiO.js → MarketplaceSourcesView-BZCnUvqP.js} +1 -1
- package/dist/client/assets/{McpAppFrame-BotrzoHd.js → McpAppFrame-BXdeDoQB.js} +1 -1
- package/dist/client/assets/{McpSigninBody-CdeX_lYs.js → McpSigninBody-CI-gwQuU.js} +1 -1
- package/dist/client/assets/{Model3dViewer-KHktOpbD.js → Model3dViewer-ws_p2e-Q.js} +1 -1
- package/dist/client/assets/NamePage-Cv95tb4E.js +1 -0
- package/dist/client/assets/{NewDirectMessageMenu-CuvKJEDY.js → NewDirectMessageMenu-PuW-lVGF.js} +1 -1
- package/dist/client/assets/{NotificationsPage-DWcgfZJD.js → NotificationsPage-D_qHMJYR.js} +1 -1
- package/dist/client/assets/{OpenMeshSwitch-DdJ7g4yD.js → OpenMeshSwitch-DiuAcyMj.js} +1 -1
- package/dist/client/assets/{OperatorIdentityForm-7FUOEWw_.js → OperatorIdentityForm-DBbsUGPX.js} +1 -1
- package/dist/client/assets/{PermissionHistory-CgQhZrvg.js → PermissionHistory-DNBswqms.js} +1 -1
- package/dist/client/assets/{PermissionsPage-CK34y1VF.js → PermissionsPage-D6cAIUTe.js} +1 -1
- package/dist/client/assets/{PersonalityPopover-3BA36sB0.js → PersonalityPopover-d_PR1nuF.js} +1 -1
- package/dist/client/assets/PhotoPage-D8f25EFY.js +1 -0
- package/dist/client/assets/{PreviewRefusedNotice-CnqAE9sr.js → PreviewRefusedNotice-p-KIYJVf.js} +1 -1
- package/dist/client/assets/{ProfileFields-CIbISW83.js → ProfileFields-D_e9XQav.js} +1 -1
- package/dist/client/assets/{ProfilePanelContainer-DPDHtTbI.js → ProfilePanelContainer-DxSkglaS.js} +1 -1
- package/dist/client/assets/{ProfileRolePicker-83GFtm2P.js → ProfileRolePicker-kNJMfzUF.js} +1 -1
- package/dist/client/assets/{PromptSuggestionChips-B9chKG4w.js → PromptSuggestionChips-Dpie7Ut6.js} +1 -1
- package/dist/client/assets/{ReportsToPopover-DUv03JZP.js → ReportsToPopover-kZWnpINs.js} +1 -1
- package/dist/client/assets/{RoomSurface-Bq6Slne3.js → RoomSurface-DyubmENi.js} +1 -1
- package/dist/client/assets/{RoomsPage-BKxzz-nN.js → RoomsPage-B88d-F2r.js} +1 -1
- package/dist/client/assets/{RunsOnPopover-BIdmMhs9.js → RunsOnPopover-C51USCpv.js} +1 -1
- package/dist/client/assets/RuntimeConnectFlow-DJMtgkZF.js +1 -0
- package/dist/client/assets/{RuntimeSetupDialog-Er-lzjmK.js → RuntimeSetupDialog-DQss2qqJ.js} +1 -1
- package/dist/client/assets/SeenDevices-DQnrqn19.js +19 -0
- package/dist/client/assets/{SessionsPage-CGic5VaN.js → SessionsPage-BxT6HETG.js} +1 -1
- package/dist/client/assets/SettingsDialog-BriAKBHz.js +12 -0
- package/dist/client/assets/{SkillsPage-VRYwez5T.js → SkillsPage-QfxMaHeF.js} +1 -1
- package/dist/client/assets/{TaskDialogWrapper-C9LMV8oe.js → TaskDialogWrapper-D54Nqlkr.js} +1 -1
- package/dist/client/assets/{TasksEmptyState-CagC0LAa.js → TasksEmptyState-rCcan38Y.js} +1 -1
- package/dist/client/assets/{TasksPage-3gkHB1Pv.js → TasksPage-rIqxyB15.js} +1 -1
- package/dist/client/assets/{TeamComputerEntry-BD89Y5e6.js → TeamComputerEntry-BtSsE94x.js} +1 -1
- package/dist/client/assets/{ToolsPage-Ds6LwY79.js → ToolsPage-CfM2Cdtm.js} +1 -1
- package/dist/client/assets/{TopologyGraph-CiZ2ACcQ.js → TopologyGraph-BMvLKLwd.js} +2 -2
- package/dist/client/assets/{TourHost-BISNaEzZ.js → TourHost-XxcgkZcj.js} +1 -1
- package/dist/client/assets/{UnlinkDialog-DTuXHNsi.js → UnlinkDialog-D1tIChdU.js} +1 -1
- package/dist/client/assets/{UnreadDivider-l_VZ7ECn.js → UnreadDivider-mAlJ1Ci7.js} +1 -1
- package/dist/client/assets/{WidgetErrorCard-I8WiJv2g.js → WidgetErrorCard-DQWpqcbG.js} +2 -2
- package/dist/client/assets/{WorkView-_wehEEl-.js → WorkView-D1V2vzFd.js} +3 -3
- package/dist/client/assets/{_shell-BLcPeb8K.js → _shell-C5LhHVEU.js} +22 -22
- package/dist/client/assets/{_shell._home-CcRH-M-A.js → _shell._home-BhaXi3EI.js} +1 -1
- package/dist/client/assets/{_shell._home.activity-cR24Vr9Q.js → _shell._home.activity-Bd8jIlgC.js} +1 -1
- package/dist/client/assets/{_shell._home.index-agU2ItcI.js → _shell._home.index-zoh1Ij4R.js} +2 -2
- package/dist/client/assets/{_shell._home.tasks-BDR9JTj3.js → _shell._home.tasks-CnfbD4z-.js} +1 -1
- package/dist/client/assets/{_shell._home.workspaces-B4nlcACK.js → _shell._home.workspaces-Cew8PET2.js} +1 -1
- package/dist/client/assets/_shell.channels-efUOy5uH.js +10 -0
- package/dist/client/assets/{_shell.connections-CWQYcH58.js → _shell.connections-DS8BI_M6.js} +1 -1
- package/dist/client/assets/{_shell.feedback-requests-BkgHtyZr.js → _shell.feedback-requests-C9nwY8FH.js} +1 -1
- package/dist/client/assets/_shell.marketplace-BxOR_qkR.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-BdVMq5Gt.js +1 -0
- package/dist/client/assets/_shell.session-DxIjWGPk.js +1 -0
- package/dist/client/assets/{_shell.team-CTIVEpZQ.js → _shell.team-DejtvgcD.js} +3 -3
- package/dist/client/assets/{_shell.threads-ClWYrnld.js → _shell.threads-BiIjml5t.js} +1 -1
- package/dist/client/assets/_shell.x._extensionId-VrXvDnpj.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-VrXvDnpj.js +1 -0
- package/dist/client/assets/{abnfDiagram-WEYOIA3C-0-Mx5lSG.js → abnfDiagram-WEYOIA3C-CAQusbaN.js} +1 -1
- package/dist/client/assets/{access-copy-Cj31J6PU.js → access-copy-DzgVmhna.js} +1 -1
- package/dist/client/assets/{arc-DVmpcNHP.js → arc-Dx6GrexJ.js} +1 -1
- package/dist/client/assets/{architectureDiagram-ZHVYKT53-BZhMXbuC.js → architectureDiagram-ZHVYKT53-wFr3hleP.js} +1 -1
- package/dist/client/assets/{banner-Ctq7kvQ0.js → banner-C0yzCrO7.js} +1 -1
- package/dist/client/assets/{blockDiagram-RJAE7QA3-Ctmof3-7.js → blockDiagram-RJAE7QA3-CnuvSqM0.js} +1 -1
- package/dist/client/assets/{c4Diagram-XDPPPE54-BPglmQhG.js → c4Diagram-XDPPPE54-DzLijAHt.js} +1 -1
- package/dist/client/assets/{card-DI7YtQh3.js → card-ZF4yWM1Y.js} +1 -1
- package/dist/client/assets/channel-BhigWC_Q.js +1 -0
- package/dist/client/assets/{chunk-2E7WHVMD-DIK6CHka.js → chunk-2E7WHVMD-SN1xBBT1.js} +1 -1
- package/dist/client/assets/{chunk-2Q5K7J3B-C3uATYd9.js → chunk-2Q5K7J3B-DbW-InNL.js} +1 -1
- package/dist/client/assets/{chunk-4EMNKR2T-Dl3iYXVl.js → chunk-4EMNKR2T-DxMZsEVE.js} +1 -1
- package/dist/client/assets/{chunk-55XCU76K-BJF-Hcs9.js → chunk-55XCU76K-9dknyxgR.js} +1 -1
- package/dist/client/assets/{chunk-5VM5RSS4-Cju3BnqQ.js → chunk-5VM5RSS4-CeL_dp1K.js} +1 -1
- package/dist/client/assets/{chunk-JWPE2WC7-v1omZzgE.js → chunk-JWPE2WC7-H-uQEL4m.js} +1 -1
- package/dist/client/assets/{chunk-VQ5W62QI-2HqA3jPL.js → chunk-VQ5W62QI-YZCtp46Q.js} +1 -1
- package/dist/client/assets/{chunk-XXDRQBXY-RDXwFs9Z.js → chunk-XXDRQBXY-CTsuviQ9.js} +1 -1
- package/dist/client/assets/{chunk-ZCHMQSOR-DhQsY-OT.js → chunk-ZCHMQSOR-Dymmj4ca.js} +2 -2
- package/dist/client/assets/{classDiagram-v2-4MYWR3UA-DC5N-GDk.js → classDiagram-v2-4MYWR3UA-AZrXuO6n.js} +1 -1
- package/dist/client/assets/{command-DpK0GpDM.js → command-D2uvj-5S.js} +1 -1
- package/dist/client/assets/{cose-bilkent-JH36ORCC-BriFsb6c.js → cose-bilkent-JH36ORCC-DH6uyH8n.js} +1 -1
- package/dist/client/assets/{cpu-DzCUBK-1.js → cpu-CxkuIIZ9.js} +1 -1
- package/dist/client/assets/{cynefin-EF2NZ3EQ-cj34OpiI.js → cynefin-EF2NZ3EQ-CPF1WTGP.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-WF24UDRP-DvAggKpl.js → cynefinDiagram-WF24UDRP-BvgLB9D2.js} +1 -1
- package/dist/client/assets/{dagre-NK4GIZVX-BskSpt7C.js → dagre-NK4GIZVX-Dbgki4TG.js} +1 -1
- package/dist/client/assets/{diagram-CBK3MWTC-C6BZljcO.js → diagram-CBK3MWTC-C84DYVUU.js} +1 -1
- package/dist/client/assets/{diagram-I5XIIV2D--4FPRmBZ.js → diagram-I5XIIV2D-DKFohwHa.js} +1 -1
- package/dist/client/assets/{diagram-ODIL2UCW-kZxp81Fr.js → diagram-ODIL2UCW-C80JpCDz.js} +1 -1
- package/dist/client/assets/{diagram-PFBEJUXE-BSXBAffS.js → diagram-PFBEJUXE-I7bZPRJw.js} +1 -1
- package/dist/client/assets/{diagram-RJA3I4VV-DLDPF6FG.js → diagram-RJA3I4VV-Gqdnf6A3.js} +1 -1
- package/dist/client/assets/{diagram-TYUNFSNR-CoU2knZy.js → diagram-TYUNFSNR-CCzmXB0d.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-V4P3TTPT-C77T1UPB.js → ebnfDiagram-V4P3TTPT-DWKMGbp5.js} +1 -1
- package/dist/client/assets/{elk-QONTBCTQ-UFXrlbAn.js → elk-QONTBCTQ-BH9-VsJv.js} +1 -1
- package/dist/client/assets/{empty-state-aNwJA6H8.js → empty-state-CQVHyP7G.js} +1 -1
- package/dist/client/assets/{erDiagram-KYQIGQAA-CyLB8fKu.js → erDiagram-KYQIGQAA-Dw7o0PKQ.js} +1 -1
- package/dist/client/assets/{execution-config-D7JzMYC2.js → execution-config-B0Ip8o1B.js} +1 -1
- package/dist/client/assets/{file-bSD5jgk_.js → file-aWVIKIhu.js} +1 -1
- package/dist/client/assets/{file-exclamation-point-BcCIL-rE.js → file-exclamation-point-VqrEIkK2.js} +1 -1
- package/dist/client/assets/{file-text-DTvj1wzM.js → file-text-BcDT6eqO.js} +1 -1
- package/dist/client/assets/{find-latest-widget-fence-D01ENK2h.js → find-latest-widget-fence-BBx2mbzG.js} +1 -1
- package/dist/client/assets/{flowDiagram-IUGLLWBU-qmnUF-Ak.js → flowDiagram-IUGLLWBU-DUap_2VM.js} +1 -1
- package/dist/client/assets/{form-C_yPntkz.js → form-Bq-P02ub.js} +1 -1
- package/dist/client/assets/{format-cron-DUPWkOrW.js → format-cron-CoTCXmQp.js} +1 -1
- package/dist/client/assets/{ganttDiagram-R7GPNTJY-CBzoqGuU.js → ganttDiagram-R7GPNTJY-GAxFxszj.js} +1 -1
- package/dist/client/assets/{git-branch-ClXAt1_G.js → git-branch-Cvc-Sr6q.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-DMh_n1S2.js → gitGraphDiagram-PDYL7XHY-CNXDdCW9.js} +1 -1
- package/dist/client/assets/{graph-BgkuepqW.js → graph-CtCYTWZj.js} +1 -1
- package/dist/client/assets/{heart-BrjEmIsl.js → heart-yvX6jsem.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-DlHNVEaV.js → highlighted-body-KPVGNVTW-B6iFwydl.js} +1 -1
- package/dist/client/assets/{image-lightbox-BtzkRztd.js → image-lightbox-COo7DKXH.js} +1 -1
- package/dist/client/assets/{image-off-4yaoLh32.js → image-off-BPRcQBvJ.js} +1 -1
- package/dist/client/assets/{index-f1W4Bd4W.js → index-7EayMDlv.js} +1 -1
- package/dist/client/assets/{index-WkQdt6Zo.js → index-B1UgkD5d.js} +1 -1
- package/dist/client/assets/{index-DB2t3GUm.js → index-B36G1Wt7.js} +3 -3
- package/dist/client/assets/{index-WxG6nG96.js → index-B7M2ny5y.js} +1 -1
- package/dist/client/assets/{index-DQ9ppIWv.js → index-B8YnzTmr.js} +1 -1
- package/dist/client/assets/{index-B-X82FND.js → index-BI7mYC3q.js} +1 -1
- package/dist/client/assets/{index-C_xSr5lb.js → index-BIoO-kFF.js} +1 -1
- package/dist/client/assets/{index-BUkUamu4.js → index-BJKRrppi.js} +1 -1
- package/dist/client/assets/{index-CNV11SW6.js → index-BSGg8ud2.js} +1 -1
- package/dist/client/assets/index-BSNB2iOV.js +1053 -0
- package/dist/client/assets/{index-A_qzw4D8.js → index-Bcv5Znqx.js} +1 -1
- package/dist/client/assets/{index-DgxXSEmR.js → index-BsmQ2VMC.js} +1 -1
- package/dist/client/assets/{index-CJhmUsIv.js → index-BzlepYwD.js} +1 -1
- package/dist/client/assets/{index-qdygDruh.js → index-CCo77KAN.js} +1 -1
- package/dist/client/assets/{index-DXalAOXT.js → index-CIIAns2d.js} +1 -1
- package/dist/client/assets/{index-Dj4I8KcL.js → index-CNlIRtiQ.js} +3 -3
- package/dist/client/assets/{index-Cefoks17.js → index-COenrxg6.js} +1 -1
- package/dist/client/assets/{index-CrQWuUpr.js → index-CXCoNv1T.js} +1 -1
- package/dist/client/assets/{index-CSyZb1X9.js → index-CYPbNdgY.js} +1 -1
- package/dist/client/assets/{index-CyfSPJ1D.js → index-CYl4FhO7.js} +1 -1
- package/dist/client/assets/{index-DGdKO24t.js → index-CZA2uFZQ.js} +1 -1
- package/dist/client/assets/index-CaOL5rt9.js +17 -0
- package/dist/client/assets/{index-CThGpHO2.js → index-Cbu89CsC.js} +1 -1
- package/dist/client/assets/{index-C_H6ZIel.js → index-Cdzlu1-P.js} +1 -1
- package/dist/client/assets/{index-DX546SK5.js → index-D1e3aPAe.js} +2 -2
- package/dist/client/assets/{index-C0LPB1iH.js → index-D9pvn-mm.js} +1 -1
- package/dist/client/assets/{index-CNiC7KUz.js → index-DRao3lV4.js} +1 -1
- package/dist/client/assets/{index-BqHUbNdh.js → index-DefXQdQA.js} +1 -1
- package/dist/client/assets/{index-DrnHzrt4.js → index-Dqq2lV9x.js} +1 -1
- package/dist/client/assets/{index-CMLDdOez.js → index-Drg391kA.js} +1 -1
- package/dist/client/assets/index-DtlBeLQB.css +1 -0
- package/dist/client/assets/{index-Bgg4cW4L.js → index-DuEmhl4K.js} +1 -1
- package/dist/client/assets/{index-BXtagrMY.js → index-FCztjyrm.js} +1 -1
- package/dist/client/assets/{index-Ckut3u-d.js → index-GEDh_fwN.js} +1 -1
- package/dist/client/assets/{index-BtG4vr8c.js → index-KLtoKDvx.js} +1 -1
- package/dist/client/assets/{index-FhmSwVD0.js → index-N3JAoXse.js} +1 -1
- package/dist/client/assets/{index-t-NyR7HD.js → index-NbnKjhyZ.js} +1 -1
- package/dist/client/assets/index-ZRwRzKll.js +1 -0
- package/dist/client/assets/index-bgXdb4vP.js +1 -0
- package/dist/client/assets/{index-Adjbt_HC.js → index-io81RE8o.js} +1 -1
- package/dist/client/assets/{index-D0yajRDv.js → index-p7yYM6Iz.js} +1 -1
- package/dist/client/assets/{index-6yT0Qr0s.js → index-sTYFlBEJ.js} +1 -1
- package/dist/client/assets/{index-DZ1BC5JW.js → index-thNMHUmT.js} +1 -1
- package/dist/client/assets/{index-BeVLPg9t.js → index-vWi6pOlY.js} +1 -1
- package/dist/client/assets/{index-DFWrO42z.js → index-xKvoBO92.js} +1 -1
- package/dist/client/assets/{index.esm-Bb3LMu5X.js → index.esm-BYS3OpKb.js} +1 -1
- package/dist/client/assets/{infoDiagram-MVDRKAX5-DbU4eDjZ.js → infoDiagram-MVDRKAX5-BB5v9AOj.js} +1 -1
- package/dist/client/assets/{inline-code-DwFNff3_.js → inline-code-Df1J1tQV.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-DmHmF-HT.js → ishikawaDiagram-HPEHV2GE-D8Zw0Wka.js} +1 -1
- package/dist/client/assets/{journeyDiagram-BOSHW7O7-DsjOeP3J.js → journeyDiagram-BOSHW7O7-CIaVEmcq.js} +1 -1
- package/dist/client/assets/{kanban-definition-FNSA4HC5-ByQ1WGy2.js → kanban-definition-FNSA4HC5-D0jxBQB1.js} +1 -1
- package/dist/client/assets/{layers-DFZUUHM5.js → layers-Byywl2sz.js} +1 -1
- package/dist/client/assets/{lightbulb-Bbgsejp1.js → lightbulb-Cu6PlV7n.js} +1 -1
- package/dist/client/assets/{link-2-xieOmwOK.js → link-2-D2LX2bAn.js} +1 -1
- package/dist/client/assets/{list-runtime-types-B0CSonAi.js → list-runtime-types-C4Ik3n5A.js} +1 -1
- package/dist/client/assets/{markdown-content-ysBIqFAg.js → markdown-content-BbH7L0YO.js} +1 -1
- package/dist/client/assets/{mention-pill-Daeu1X92.js → mention-pill-DxRP9Bkp.js} +1 -1
- package/dist/client/assets/{mermaid.core-B1mQMOXd.js → mermaid.core-D9Vc69mt.js} +4 -4
- package/dist/client/assets/{message-square-off-D9hm8WNH.js → message-square-off-BP01X_ck.js} +1 -1
- package/dist/client/assets/{mindmap-definition-6OY57UG3-CoP-DGm1.js → mindmap-definition-6OY57UG3-DNd2V0AH.js} +1 -1
- package/dist/client/assets/{more-details-DHCpYDi7.js → more-details-7psgoF8x.js} +1 -1
- package/dist/client/assets/{owner-notice-Crxco7HN.js → owner-notice-83ejBJ3g.js} +1 -1
- package/dist/client/assets/{package-CD8xq7hk.js → package-DSJyi_sq.js} +1 -1
- package/dist/client/assets/{page-container-B9sDc2wq.js → page-container-D7q7ISl1.js} +1 -1
- package/dist/client/assets/{pane-resize-handle-DOchpdJ6.js → pane-resize-handle-BnQ8IKj6.js} +1 -1
- package/dist/client/assets/{paperclip-CzhXW5qi.js → paperclip-CeOJ8Nwp.js} +1 -1
- package/dist/client/assets/{path-input-Z2p922fj.js → path-input-BToXn1c2.js} +1 -1
- package/dist/client/assets/{pegDiagram-ECIUJNBX-TEsMAO1a.js → pegDiagram-ECIUJNBX-sCkH1RIT.js} +1 -1
- package/dist/client/assets/{pieDiagram-GNMPY74T-CMIDIiMP.js → pieDiagram-GNMPY74T-B4V9xf2z.js} +1 -1
- package/dist/client/assets/{plug-BEp9Ly3k.js → plug-CMcqk2p3.js} +1 -1
- package/dist/client/assets/{primer-trigger-4qUY83SX.js → primer-trigger-DtyY4fpx.js} +1 -1
- package/dist/client/assets/{profile-errors-CezsKqhA.js → profile-errors-DSKechEz.js} +1 -1
- package/dist/client/assets/{progress-eQl1UvNz.js → progress-8CDPI0xL.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-D57K4MC3-DXjohzOz.js → quadrantDiagram-D57K4MC3-DkcmqAD-.js} +1 -1
- package/dist/client/assets/{query-error-state-COuKRlU0.js → query-error-state-jrioxcrf.js} +1 -1
- package/dist/client/assets/{radio-Cdnkcg1w.js → radio-D3k0l1vj.js} +1 -1
- package/dist/client/assets/{railroadDiagram-Y72NRBL7-BojgH6Hw.js → railroadDiagram-Y72NRBL7-T9Qbdks1.js} +1 -1
- package/dist/client/assets/registry-B0s0gwF4.js +1 -0
- package/dist/client/assets/{relay-trace-schemas-XcVQg5Fa.js → relay-trace-schemas-epyobQGg.js} +1 -1
- package/dist/client/assets/{repeat-wB31CP7I.js → repeat-Cbe4MVvF.js} +1 -1
- package/dist/client/assets/{requirementDiagram-EQYSW5RA-Gojbrcvg.js → requirementDiagram-EQYSW5RA-BKrsOvZR.js} +1 -1
- package/dist/client/assets/{room-files-source-DXKpm43a.js → room-files-source-wUgOb12j.js} +1 -1
- package/dist/client/assets/{rotate-ccw-clock-LSKKAcnR.js → rotate-ccw-clock-CI-xhvb_.js} +1 -1
- package/dist/client/assets/{rotate-cw-scTEKxeZ.js → rotate-cw-BGDIfrKN.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-SY24JHO5-QS71aycL.js → sankeyDiagram-SY24JHO5-SVj2Csf7.js} +1 -1
- package/dist/client/assets/{scroll-area-BNFXgTKM.js → scroll-area-D3x48cAw.js} +1 -1
- package/dist/client/assets/{search-x-Cjf0n9z7.js → search-x-Dz-ryi0D.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-BLEHNHQU-Beg7mj69.js → sequenceDiagram-BLEHNHQU-CSliXD3t.js} +1 -1
- package/dist/client/assets/{shield-x-Dr4BZfo_.js → shield-x-FVhBth4G.js} +1 -1
- package/dist/client/assets/{signed-in-L9MLqTuc.js → signed-in-BQcV7AMx.js} +1 -1
- package/dist/client/assets/{sizeCapture-INFHLROL-3Oo1KjRp.js → sizeCapture-INFHLROL-4lP-N234.js} +1 -1
- package/dist/client/assets/{soul-file-CxpOawh5.js → soul-file-CS-EETV8.js} +1 -1
- package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-DFYIDQ6C.js → stateDiagram-v2-A6IESKWZ-Cij5yf9S.js} +1 -1
- package/dist/client/assets/{swimlanes-B3ENRKFQ-BUgKOOrv.js → swimlanes-B3ENRKFQ-iSf_hOim.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-C8oY0fep.js +8 -0
- package/dist/client/assets/{table-B0LsKsEv.js → table-Cg_1lfh0.js} +1 -1
- package/dist/client/assets/{timeline-definition-JXYKGLGB-BsPZ0P_8.js → timeline-definition-JXYKGLGB-DVZj2yY_.js} +1 -1
- package/dist/client/assets/{trust-posture-Cm7OhCEx.js → trust-posture-CkEXRlxW.js} +1 -1
- package/dist/client/assets/{unplug-DLA7Ib_s.js → unplug-CASvw-Yn.js} +1 -1
- package/dist/client/assets/{unverified-catalog-notice-CxBO_pta.js → unverified-catalog-notice-CMDo7sp5.js} +1 -1
- package/dist/client/assets/{use-adapter-catalog-C333Z2Q6.js → use-adapter-catalog-BVeUe0tR.js} +1 -1
- package/dist/client/assets/{use-bindings-Bu4yLLR5.js → use-bindings-Clux6PJ0.js} +1 -1
- package/dist/client/assets/{use-composer-prefs-BnjCX9pM.js → use-composer-prefs-D0poHQqk.js} +1 -1
- package/dist/client/assets/{use-connector-management-Bo6wOJQS.js → use-connector-management-CQQGCFaL.js} +1 -1
- package/dist/client/assets/{use-deep-link-scroll-D867V6rs.js → use-deep-link-scroll-BdGMaupf.js} +1 -1
- package/dist/client/assets/{use-delete-binding-DKObM-zT.js → use-delete-binding-CSpocSwM.js} +1 -1
- package/dist/client/assets/{use-dev-links-C0Zc30aj.js → use-dev-links-c6K0en5G.js} +1 -1
- package/dist/client/assets/{use-direct-message-panel-DNWtQq4B.js → use-direct-message-panel-sq9_ehHu.js} +1 -1
- package/dist/client/assets/{use-external-adapter-catalog-Bv5rDkX4.js → use-external-adapter-catalog-C3T1MGxz.js} +1 -1
- package/dist/client/assets/{use-full-activity-feed-CFUj0qCS.js → use-full-activity-feed-Bmmagy2q.js} +1 -1
- package/dist/client/assets/use-is-below-desktop-CGj5vT8N.js +1 -0
- package/dist/client/assets/{use-local-browser-BeZjn0gA.js → use-local-browser-Di54G1yg.js} +1 -1
- package/dist/client/assets/{use-mesh-topology-DurMpvjU.js → use-mesh-topology-C_bdAJfy.js} +1 -1
- package/dist/client/assets/{use-mounted-ref-CBSuPNPv.js → use-mounted-ref-C_ChQ0xs.js} +1 -1
- package/dist/client/assets/{use-notification-prefs-b8iKvzB4.js → use-notification-prefs-BjGauolP.js} +1 -1
- package/dist/client/assets/{use-panel-tab-placements-BcKEux1G.js → use-panel-tab-placements-Bn-CIS6M.js} +1 -1
- package/dist/client/assets/use-pending-read-CIp204qI.js +1 -0
- package/dist/client/assets/{use-personality-commit-u3kQ6h3H.js → use-personality-commit-WeCQulwl.js} +1 -1
- package/dist/client/assets/{use-promo-activation-C8_cGmEW.js → use-promo-activation-C9I5YwBo.js} +1 -1
- package/dist/client/assets/{use-promo-dismissals-B3VuaQCf.js → use-promo-dismissals-BhTNS7LX.js} +1 -1
- package/dist/client/assets/{use-pulse-freshness-CSWQ0TZS.js → use-pulse-freshness-DDo5a3nh.js} +1 -1
- package/dist/client/assets/{use-relay-config-BA6c0FMB.js → use-relay-config-Bfjxr2lE.js} +1 -1
- package/dist/client/assets/{use-room-follow-claim-BV-MtDQ5.js → use-room-follow-claim-D_HTjK2r.js} +1 -1
- package/dist/client/assets/{use-room-sessions-W62Zl72O.js → use-room-sessions-UwyzNxeo.js} +1 -1
- package/dist/client/assets/{use-roving-tab-list-CMITzUHu.js → use-roving-tab-list-CXAJxnx0.js} +1 -1
- package/dist/client/assets/{use-session-canvas-u63m2mYH.js → use-session-canvas-CTDXU27z.js} +3 -3
- package/dist/client/assets/{use-status-budget-CbmPFvpQ.js → use-status-budget-CFS9gmSZ.js} +4 -4
- package/dist/client/assets/{use-unclaimed-chats-D7SEUfiO.js → use-unclaimed-chats-BlUFVbnm.js} +1 -1
- package/dist/client/assets/use-update-config-BwjEWlgj.js +1 -0
- package/dist/client/assets/{useMutationState-rOg4bnKv.js → useMutationState-CUuSnqrc.js} +1 -1
- package/dist/client/assets/{usecaseDiagram-WPOLBNNX-C-w0e-nv.js → usecaseDiagram-WPOLBNNX-BTdq_YOC.js} +1 -1
- package/dist/client/assets/{vennDiagram-Q3Y3IDCW-BNm2WXT5.js → vennDiagram-Q3Y3IDCW-BLQwiECh.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-IVAIDKWA-BFyFLiir.js → wardleyDiagram-IVAIDKWA-Cp8QrBQm.js} +1 -1
- package/dist/client/assets/{xychartDiagram-4URNHDU4-BKxZlnEx.js → xychartDiagram-4URNHDU4-CrrAKTa0.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/extension-child.cjs +1701 -435
- package/dist/server/index.js +22346 -20856
- package/dist/server/index.js.map +2 -2
- package/package.json +5 -5
- package/dist/client/assets/ChannelComposer-CutghXOq.js +0 -44
- package/dist/client/assets/HandlePage-XG5mP_e9.js +0 -1
- package/dist/client/assets/NamePage-Cdd9-mZg.js +0 -1
- package/dist/client/assets/PhotoPage-DFic-gDH.js +0 -1
- package/dist/client/assets/RuntimeConnectFlow-IaRVgmqH.js +0 -1
- package/dist/client/assets/SeenDevices-9quCcdUW.js +0 -19
- package/dist/client/assets/SettingsDialog-BZ58IaK1.js +0 -12
- package/dist/client/assets/_shell.channels-B7lTxkqM.js +0 -10
- package/dist/client/assets/_shell.marketplace-BMqwT9qX.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-pXGa7Cqb.js +0 -1
- package/dist/client/assets/_shell.session-CmoE1W38.js +0 -1
- package/dist/client/assets/_shell.x._extensionId-BiXilrSW.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-BiXilrSW.js +0 -1
- package/dist/client/assets/channel-A2WD4smw.js +0 -1
- package/dist/client/assets/index-BMCDckcY.js +0 -17
- package/dist/client/assets/index-BOuCpkRb.js +0 -1
- package/dist/client/assets/index-BVq1p60h.js +0 -1
- package/dist/client/assets/index-CjUfPyOM.js +0 -1053
- package/dist/client/assets/index-D2ZFfqZZ.css +0 -1
- package/dist/client/assets/registry-BSucT23N.js +0 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-Bqjv1MSj.js +0 -8
- package/dist/client/assets/use-is-below-desktop-BUS7OPGv.js +0 -1
- package/dist/client/assets/use-is-hub-CFhvDMHt.js +0 -1
- package/dist/client/assets/use-pending-read-BBBAnUYu.js +0 -1
- package/dist/client/assets/use-update-config-Dfd7KMde.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o,c_ as t}from"./index-
|
|
1
|
+
import{j as o,c_ as t}from"./index-BSNB2iOV.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-cR24Vr9Q.js → _shell._home.activity-Bd8jIlgC.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cj as R,c$ as M,r as l,iK as C,iL as V,j as e,by as G,ar as g,B as D,X as Y,G as f,A as j,gi as K,gj as k,_ as W,e as v,x as q,a1 as z,a2 as U,iM as X,ge as Q,iN as J,eb as Z}from"./index-CjUfPyOM.js";import{P as ee}from"./page-container-B9sDc2wq.js";import{g as te,A as se,a as ne,b as ie}from"./ActivityErrorState-C4hqCedX.js";import{u as ae}from"./use-full-activity-feed-CFUj0qCS.js";import{C as A,A as re}from"./ActivityRow-DB9c3g1G.js";import{T as P,a as L,b as oe,c as p}from"./table-B0LsKsEv.js";import{E as b}from"./empty-state-aNwJA6H8.js";const S=["categories","actorType","actorId","since"];function w(){const s=R(),n=M({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(x=>{const y=x.categories?x.categories.split(","):[],N=y.includes(c)?y.filter(O=>O!==c):[...y,c];return{...x,categories:N.length>0?N.join(","):void 0}})},[r]),d=l.useCallback(c=>{r(x=>({...x,actorType:c}))},[r]),m=l.useCallback(c=>{r(x=>({...x,actorId:c}))},[r]),u=l.useCallback(c=>{r(x=>({...x,since:c}))},[r]),h=l.useCallback(()=>{r(c=>{const x={...c};for(const y of S)delete x[y];return x})},[r]);return{filters:t,queryFilters:a,isFiltered:i,toggleCategory:o,setActorType:d,setActorId:m,setSince:u,clearAll:h}}function ce(){const s=R(),t=M({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 le(){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 ue(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 de=["tasks","relay","agent","config","system","permissions"],_="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 me({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:_,children:e.jsx("span",{className:f($,n?f(i.bg,i.text):"text-muted-foreground group-hover:bg-muted group-hover:text-foreground"),children:i.label})})}function he({isActive:s,onClick:n}){return e.jsx(g.button,{type:"button",layout:!0,onClick:n,"aria-pressed":s,transition:{duration:.15},className:_,children:e.jsx("span",{className:f($,s?"bg-foreground text-background":"text-muted-foreground group-hover:bg-muted group-hover:text-foreground"),children:"All"})})}function fe({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:f("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(he,{isActive:!t,onClick:m}),de.map(u=>e.jsx(me,{category:u,isActive:d.has(u),onToggle:()=>i(u)},u)),e.jsx(G,{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(D,{variant:"ghost",size:"xs",className:"ml-1",onClick:a,children:[e.jsx(Y,{"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 xe({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 ${ge(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 ge(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 ye({view:s,onViewChange:n,className:t}){return e.jsxs(K,{"aria-label":"Which list to show",className:f("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 pe(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 ve(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 je(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 be({lastVisitedAt:s,items:n,className:t}){if(!s)return null;const i=ve(n,s);if(Object.values(i).reduce((d,m)=>d+(m??0),0)===0)return null;const r=pe(s),o=je(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:f("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(W,{shape:"pill",className:f("border-transparent",u.bg,u.text),children:[m," ",u.label]},d)})})]})}const Ae={initial:{opacity:0,y:6},animate:{opacity:1,y:0,transition:{duration:.2,ease:"easeOut"}}};function we(){const s=l.useId(),n=l.useMemo(()=>`${s.split("").reduce((i,a)=>i+a.charCodeAt(0),0)%40+50}%`,[s]);return e.jsxs(oe,{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 Ne(){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(L,{children:Array.from({length:5}).map((s,n)=>e.jsx(we,{},n))})})]})}function H({items:s,isLoading:n,isError:t,onRetry:i,isFiltered:a,view:r="activity",className:o}){const d=l.useMemo(()=>te(s,new Date),[s]),{containerRef:m,handleKeyDown:u}=ue(s.length);return n&&s.length===0?e.jsx("div",{"data-slot":"activity-timeline",className:f(o),children:e.jsx(Ne,{})}):t&&s.length===0?e.jsx("div",{"data-slot":"activity-timeline",className:f(o),children:e.jsx(se,{onRetry:i})}):s.length===0?e.jsx("div",{"data-slot":"activity-timeline",className:f(o),children:e.jsx(xe,{isFiltered:a,view:r})}):e.jsx("div",{ref:m,onKeyDown:u,"data-slot":"activity-timeline",className:f(o),children:d.map(h=>e.jsxs("section",{children:[e.jsx(ne,{label:h.label}),e.jsx(g.div,{variants:Ae,initial:"initial",animate:"animate",children:e.jsx(P,{children:e.jsx(L,{children:h.items.map(c=>e.jsx(re,{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:f("flex justify-center py-4",i),children:e.jsxs(D,{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 Ce(){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 ke(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,Se=4,E=30,F=1;function Te({data:s,className:n}){const t=Math.max(...s,1);return e.jsx("svg",{viewBox:"0 0 100 30",className:f("text-muted-foreground",n),"aria-hidden":"true",children:s.map((i,a)=>{const r=i/t*E;return e.jsx("rect",{x:a*(I+Se)+1,y:E-Math.max(r,F),width:I,height:Math.max(r,F),rx:2,fill:"currentColor",opacity:.6},a)})})}function Ie(){const s=Ce();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:ke(s.dailyCounts,s.degraded)}),e.jsx(Te,{data:s.dailyCounts,className:"h-6 w-24 shrink-0"})]})}function Ee(){const s=l.useId(),n=Q("dashboard.sections"),t=l.useMemo(()=>n.filter(i=>J(i.id)&&(!i.visibleWhen||i.visibleWhen())),[n]);return t.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("div",{className:"space-y-4",children:t.map(i=>e.jsx(i.component,{},i.id))})]})}function Fe(){const{view:s,setView:n}=ce();return e.jsxs(e.Fragment,{children:[e.jsx(Z,{children:"Activity"}),e.jsxs(ee,{width:"wide",className:"space-y-4",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx(ye,{view:s,onViewChange:n}),s==="activity"&&e.jsx(fe,{className:"min-w-0 flex-1"})]}),e.jsx(Ie,{}),e.jsx(Ee,{}),s==="all"?e.jsx(Me,{}):e.jsx(Re,{})]})]})}function Re(){const{queryFilters:s,isFiltered:n}=w(),t=le(),{data:i,isLoading:a,isError:r,refetch:o,isFetchingNextPage:d,hasNextPage:m,fetchNextPage:u}=ae(s),h=l.useMemo(()=>(i==null?void 0:i.pages.flatMap(c=>c.items))??[],[i]);return e.jsxs(e.Fragment,{children:[e.jsx(be,{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 Me(){const{data:s,isLoading:n,isError:t,refetch:i,isFetchingNextPage:a,hasNextPage:r,fetchNextPage:o}=ie();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 Oe=Fe;export{Oe as component};
|
|
1
|
+
import{cj as R,c$ as M,r as l,iK as C,iL as V,j as e,by as G,ar as g,B as D,X as Y,G as f,A as j,gi as K,gj as k,_ as W,e as v,x as q,a1 as z,a2 as U,iM as X,ge as Q,iN as J,eb as Z}from"./index-BSNB2iOV.js";import{P as ee}from"./page-container-D7q7ISl1.js";import{g as te,A as se,a as ne,b as ie}from"./ActivityErrorState-BSuvlEdx.js";import{u as ae}from"./use-full-activity-feed-Bmmagy2q.js";import{C as A,A as re}from"./ActivityRow-Bj0V45d7.js";import{T as P,a as L,b as oe,c as p}from"./table-Cg_1lfh0.js";import{E as b}from"./empty-state-CQVHyP7G.js";const S=["categories","actorType","actorId","since"];function w(){const s=R(),n=M({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(x=>{const y=x.categories?x.categories.split(","):[],N=y.includes(c)?y.filter(O=>O!==c):[...y,c];return{...x,categories:N.length>0?N.join(","):void 0}})},[r]),d=l.useCallback(c=>{r(x=>({...x,actorType:c}))},[r]),m=l.useCallback(c=>{r(x=>({...x,actorId:c}))},[r]),u=l.useCallback(c=>{r(x=>({...x,since:c}))},[r]),h=l.useCallback(()=>{r(c=>{const x={...c};for(const y of S)delete x[y];return x})},[r]);return{filters:t,queryFilters:a,isFiltered:i,toggleCategory:o,setActorType:d,setActorId:m,setSince:u,clearAll:h}}function ce(){const s=R(),t=M({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 le(){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 ue(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 de=["tasks","relay","agent","config","system","permissions"],_="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 me({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:_,children:e.jsx("span",{className:f($,n?f(i.bg,i.text):"text-muted-foreground group-hover:bg-muted group-hover:text-foreground"),children:i.label})})}function he({isActive:s,onClick:n}){return e.jsx(g.button,{type:"button",layout:!0,onClick:n,"aria-pressed":s,transition:{duration:.15},className:_,children:e.jsx("span",{className:f($,s?"bg-foreground text-background":"text-muted-foreground group-hover:bg-muted group-hover:text-foreground"),children:"All"})})}function fe({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:f("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(he,{isActive:!t,onClick:m}),de.map(u=>e.jsx(me,{category:u,isActive:d.has(u),onToggle:()=>i(u)},u)),e.jsx(G,{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(D,{variant:"ghost",size:"xs",className:"ml-1",onClick:a,children:[e.jsx(Y,{"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 xe({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 ${ge(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 ge(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 ye({view:s,onViewChange:n,className:t}){return e.jsxs(K,{"aria-label":"Which list to show",className:f("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 pe(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 ve(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 je(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 be({lastVisitedAt:s,items:n,className:t}){if(!s)return null;const i=ve(n,s);if(Object.values(i).reduce((d,m)=>d+(m??0),0)===0)return null;const r=pe(s),o=je(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:f("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(W,{shape:"pill",className:f("border-transparent",u.bg,u.text),children:[m," ",u.label]},d)})})]})}const Ae={initial:{opacity:0,y:6},animate:{opacity:1,y:0,transition:{duration:.2,ease:"easeOut"}}};function we(){const s=l.useId(),n=l.useMemo(()=>`${s.split("").reduce((i,a)=>i+a.charCodeAt(0),0)%40+50}%`,[s]);return e.jsxs(oe,{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 Ne(){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(L,{children:Array.from({length:5}).map((s,n)=>e.jsx(we,{},n))})})]})}function H({items:s,isLoading:n,isError:t,onRetry:i,isFiltered:a,view:r="activity",className:o}){const d=l.useMemo(()=>te(s,new Date),[s]),{containerRef:m,handleKeyDown:u}=ue(s.length);return n&&s.length===0?e.jsx("div",{"data-slot":"activity-timeline",className:f(o),children:e.jsx(Ne,{})}):t&&s.length===0?e.jsx("div",{"data-slot":"activity-timeline",className:f(o),children:e.jsx(se,{onRetry:i})}):s.length===0?e.jsx("div",{"data-slot":"activity-timeline",className:f(o),children:e.jsx(xe,{isFiltered:a,view:r})}):e.jsx("div",{ref:m,onKeyDown:u,"data-slot":"activity-timeline",className:f(o),children:d.map(h=>e.jsxs("section",{children:[e.jsx(ne,{label:h.label}),e.jsx(g.div,{variants:Ae,initial:"initial",animate:"animate",children:e.jsx(P,{children:e.jsx(L,{children:h.items.map(c=>e.jsx(re,{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:f("flex justify-center py-4",i),children:e.jsxs(D,{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 Ce(){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 ke(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,Se=4,E=30,F=1;function Te({data:s,className:n}){const t=Math.max(...s,1);return e.jsx("svg",{viewBox:"0 0 100 30",className:f("text-muted-foreground",n),"aria-hidden":"true",children:s.map((i,a)=>{const r=i/t*E;return e.jsx("rect",{x:a*(I+Se)+1,y:E-Math.max(r,F),width:I,height:Math.max(r,F),rx:2,fill:"currentColor",opacity:.6},a)})})}function Ie(){const s=Ce();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:ke(s.dailyCounts,s.degraded)}),e.jsx(Te,{data:s.dailyCounts,className:"h-6 w-24 shrink-0"})]})}function Ee(){const s=l.useId(),n=Q("dashboard.sections"),t=l.useMemo(()=>n.filter(i=>J(i.id)&&(!i.visibleWhen||i.visibleWhen())),[n]);return t.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("div",{className:"space-y-4",children:t.map(i=>e.jsx(i.component,{},i.id))})]})}function Fe(){const{view:s,setView:n}=ce();return e.jsxs(e.Fragment,{children:[e.jsx(Z,{children:"Activity"}),e.jsxs(ee,{width:"wide",className:"space-y-4",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx(ye,{view:s,onViewChange:n}),s==="activity"&&e.jsx(fe,{className:"min-w-0 flex-1"})]}),e.jsx(Ie,{}),e.jsx(Ee,{}),s==="all"?e.jsx(Me,{}):e.jsx(Re,{})]})]})}function Re(){const{queryFilters:s,isFiltered:n}=w(),t=le(),{data:i,isLoading:a,isError:r,refetch:o,isFetchingNextPage:d,hasNextPage:m,fetchNextPage:u}=ae(s),h=l.useMemo(()=>(i==null?void 0:i.pages.flatMap(c=>c.items))??[],[i]);return e.jsxs(e.Fragment,{children:[e.jsx(be,{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 Me(){const{data:s,isLoading:n,isError:t,refetch:i,isFetchingNextPage:a,hasNextPage:r,fetchNextPage:o}=ie();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 Oe=Fe;export{Oe as component};
|
package/dist/client/assets/{_shell._home.index-agU2ItcI.js → _shell._home.index-zoh1Ij4R.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{lf as be,lg as ye,j as t,hV as $,hW as F,hX as L,hY as B,hZ as q,_ as I,ay as A,O as Se,Q as Ne,C as ke,U as we,lh as z,B as b,li as Re,lj as Ce,cj as W,e as C,G as y,s as H,r as m,J as Ie,lk as Ae,aj as Pe,ak as De,dV as Oe,aY as Me,X as oe,ll as Te,lm as Ee,aQ as $e,dW as ie,iL as Fe,by as G,ar as R,T as Le,ln as Be,i_ as qe,lo as ze,eG as We,eH as He,iY as _e,j3 as Ue,lp as Ve,lq as Ge,eA as ae,eC as Ke,lr as Ye,c$ as re,ad as Qe,eD as Xe,iZ as Je,l as le,ls as de,lt as ce,gX as Ze,lu as _,eB as et,bf as tt,a$ as st,hI as nt,gB as ot,lv as it,as as at,gY as ue,g as rt,gk as me,lw as K,ai as Y,c7 as lt,lx as dt,ly as ct,lz as ut,a1 as mt,lA as ht,cf as gt,bP as ft,jl as pt,aP as xt,i6 as jt,eM as M,k7 as vt,q as Q,eb as bt,g$ as yt,lB as St,n as Nt}from"./index-CjUfPyOM.js";import{I as kt,p as wt}from"./ChannelComposer-CutghXOq.js";import{c as Rt}from"./index-Dj4I8KcL.js";import{a as Ct}from"./RoomSurface-Bq6Slne3.js";import{P as he}from"./PromptSuggestionChips-B9chKG4w.js";import{S as U}from"./scroll-area-BNFXgTKM.js";import{d as It}from"./dead-letter-reasons-DtBHju9v.js";import{u as At}from"./use-mesh-topology-DurMpvjU.js";import{A as Pt}from"./AttentionSignalRow-BOpClaCD.js";import{u as ge}from"./use-promo-dismissals-B3VuaQCf.js";import{u as Dt,s as Ot,P as Mt,a as Tt}from"./use-promo-activation-C8_cGmEW.js";import"./repeat-wB31CP7I.js";import"./use-room-sessions-W62Zl72O.js";import"./WidgetErrorCard-I8WiJv2g.js";import"./index-D0yajRDv.js";import"./card-DI7YtQh3.js";import"./progress-eQl1UvNz.js";import"./markdown-content-ysBIqFAg.js";import"./table-B0LsKsEv.js";import"./package-CD8xq7hk.js";import"./heart-BrjEmIsl.js";import"./git-branch-ClXAt1_G.js";import"./file-text-DTvj1wzM.js";import"./file-bSD5jgk_.js";import"./find-latest-widget-fence-D01ENK2h.js";import"./format-duration-BCr6uzby.js";import"./RuntimeSetupDialog-Er-lzjmK.js";import"./inline-code-DwFNff3_.js";import"./list-runtime-types-B0CSonAi.js";import"./RuntimeConnectFlow-IaRVgmqH.js";import"./useMutationState-rOg4bnKv.js";import"./runtime-connect-Dn0T5YWv.js";import"./mention-pill-Daeu1X92.js";import"./rotate-ccw-clock-LSKKAcnR.js";import"./unplug-DLA7Ib_s.js";import"./message-square-off-D9hm8WNH.js";import"./registry-BSucT23N.js";import"./file-drag-GDx2qhdk.js";import"./paperclip-CzhXW5qi.js";import"./index-6yT0Qr0s.js";import"./pane-resize-handle-DOchpdJ6.js";import"./UnreadDivider-l_VZ7ECn.js";import"./use-room-follow-claim-BV-MtDQ5.js";import"./use-connector-management-Bo6wOJQS.js";import"./AgentRequestCard--9GA9ymH.js";import"./access-copy-Cj31J6PU.js";import"./query-error-state-COuKRlU0.js";import"./empty-state-aNwJA6H8.js";import"./use-bindings-Bu4yLLR5.js";import"./connection-copy--MA7AN04.js";import"./KeyEntry-CSmznLcG.js";import"./use-update-config-Dfd7KMde.js";import"./use-relay-config-BA6c0FMB.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,d=s==null?void 0:s.find(h=>h.source===r&&h.reason===l),c=()=>{!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(B,{children:"Messages that never arrived"}),t.jsx(q,{children:r??"Source unknown"})]}),t.jsx(U,{className:"flex-1 px-4",children:d?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:[d.count," message",d.count===1?"":"s"," couldn’t be delivered"]}),t.jsx(I,{variant:"secondary",children:It(d.reason)})]}),t.jsxs("div",{className:"space-y-1 text-sm",children:[t.jsxs("p",{className:"text-muted-foreground",children:["First happened ",A(d.firstSeen)," ago"]}),t.jsxs("p",{className:"text-muted-foreground",children:["Last happened ",A(d.lastSeen)," ago"]})]}),d.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(d.sample,null,2)})})]})]}):t.jsx("p",{className:"text-muted-foreground py-8 text-center text-sm",children:"These are cleared already."})}),t.jsxs(z,{children:[d&&t.jsx(b,{variant:"destructive",onClick:c,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"blocked":return{label:"Blocked",badge:"outline",tone:"warning",heading:"What it needed",title:"Run that couldn’t use its tools"};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"},warning:{box:"bg-status-warning-bg border-status-warning-border",heading:"text-status-warning-fg",body:"text-status-warning-fg"},neutral:{box:"bg-muted border-border",heading:"text-foreground",body:"text-foreground/80"}};function Bt({open:e,itemId:n,onClose:o}){const{data:s,isLoading:i,isError:a}=Re(e?n??null:null),r=Ce(),l=W(),d=()=>{s!=null&&s.sessionId&&l(H({session:s.sessionId}))},c=()=>{s&&r.mutate(s.id)},h=s?Ft(s.status):null,g=h?Lt[h.tone]:null;return t.jsx($,{open:e,onOpenChange:f=>!f&&o(),children:t.jsxs(F,{side:"right",children:[t.jsxs(L,{children:[t.jsx(B,{children:(h==null?void 0:h.title)??"Run that needs a look"}),t.jsx(q,{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(z,{children:[(s==null?void 0:s.sessionId)&&t.jsx(b,{variant:"default",onClick:d,children:"View chat"}),(s==null?void 0:s.status)==="running"&&t.jsx(b,{variant:"destructive",onClick:c,disabled:r.isPending,children:r.isPending?"Cancelling…":"Cancel run"}),t.jsx(b,{variant:"outline",onClick:o,children:"Close"})]})]})})}function qt({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 zt({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(B,{children:"Agents that aren’t answering"}),t.jsxs(q,{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(qt,{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(z,{children:t.jsx(b,{variant:"outline",onClick:n,children:"Close"})})]})})}function Wt(e){return e.content.suggestion!==void 0}function Ht(){const e=Dt(),{dismissedIds:n}=ge(),o=Me(s=>s.promoEnabled);return m.useMemo(()=>{if(!o)return null;const[s]=Ot(Mt.filter(Wt),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 Vt(){const e=Ht();return e===null?null:t.jsx(Ut,{promo:e},e.id)}const Gt=["report.daily"];function fe(){const{notifications:e}=Te({kinds:Gt,unread:!0});return m.useMemo(()=>e[0],[e])}function Kt({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 Yt({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 Qt="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:d,activityItems:c,onOpenActivity:h,shiftReport:g,presence:f,condensed:j,onExpand:x,className:u}){const p=ie(),v=m.useRef(null),N=Fe(v),k=e.length>0||n.length>0||o.length>0||l.length>0||a,P=d.length>0,w=c.length>0,je=k||P||w||g!==void 0||(f==null?void 0:f.occupied)===!0,O=Kt({questions:n.length,requests:e.length,schedules:l.length,approvalsUnavailable:a,attention:d.length+c.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(G,{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(p===!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:p?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",Qt),children:[k&&t.jsxs(T,{title:"Waiting on you",children:[(n.length>0||o.length>0)&&t.jsx(Be,{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(qe,{approvals:e}),e.length===0&&a&&t.jsx(ze,{onRetry:r}),t.jsx(G,{initial:!1,children:l.map(S=>t.jsx(We,{task:S,className:"mt-2"},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:d.map(S=>t.jsx(Pt,{signal:S},S.id))})})}),g&&t.jsx(Yt,{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:c.map(S=>t.jsx(He,{notification:S,onOpen:()=>h(S)},S.id))})})}),f==null?void 0:f.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(),d=Ve(),c=Ge(l),{schedules:h,errors:g,activity:f}=ae(),j=Ke(),x=fe(),{mutate:u}=Ye(),p=re({strict:!1}),v=W(),N=Qe(),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:d,askAgentNames:c,onOpenSession:V=>{v(H({session:V}))},approvalsUnavailable:a&&i.length===0,onRetryApprovals:r,scheduleApprovals:k,errorSignals:g,activityItems:f,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:p.detail==="dead-letter",itemId:p.itemId,onClose:w}),t.jsx(Bt,{open:p.detail==="failed-run",itemId:p.itemId,onClose:w}),t.jsx(zt,{open:p.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=>{de.getState().set(e,o),ce.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 ds({roomId:e,presenceOccupied:n}){const o=_(e),s=ns(e),{items:i,isLoading:a,isAnyError:r}=et(),{total:l}=ae(),d=fe(),c=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||d!==void 0||n,f=c&&h&&!g,[j,x]=m.useState("waiting");f&&j==="waiting"?x("shown"):!f&&j==="shown"&&x("retired");const u=f&&j!=="retired",p=tt(),{data:v}=st(p&&u),N=nt();return u?t.jsx(ls,{forwardLook:rs(os(v,N),N),suggestion:t.jsx(Vt,{})}):null}const pe="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 cs(){try{return localStorage.getItem(pe)}catch{return null}}function us(e){try{localStorage.setItem(pe,e)}catch{}}function ms(){const[e]=m.useState(()=>cs()!==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",fs="Make a daily plan board",xe="Something else",ps=[gs,fs,xe];function xs({roomId:e,mode:n}){const o=Rt(),s=ot(),i=m.useCallback(a=>{if(a===xe){de.getState().set(e,`${ee} `),ce.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:ps,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((d,c)=>d===void 0||c.seq>d.seq?c:d,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:ct(e.name,e.binding,e.state),detail:dt(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 d=Rs(l.roomId,e).find(f=>f.author.id===l.authorId);if(d===void 0)continue;const c=d.author.agentRef===void 0?void 0:n.get(d.author.agentRef);if(c!==void 0&&i.add(c.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:d.author.displayName,handle:d.author.handle,face:K({record:d.author,override:c===void 0?null:Y(c.manifest),...d.origin!==void 0?{origin:d.origin}:{}}),binding:g===null?null:ks(g),state:l.state,since:l.since,roomTitle:g,runtime:(c==null?void 0:c.manifest.runtime)??null,profileMemberId:c===void 0?null:e.meshIdByPath[c.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 d=e.agents[l.cwd];if(d==null)continue;a.add(l.cwd);const c=d.displayName??d.name;r.push(te({id:`session:${l.sessionId}`,name:c,handle:null,face:K({record:{id:d.id,kind:"agent",displayName:c},override:Y(d)}),binding:ws,state:"working",since:null,roomTitle:null,runtime:d.runtime,profileMemberId:e.meshIdByPath[l.cwd]??null,follow:{kind:"session",sessionId:l.sessionId,cwd:l.cwd}}))}return r.sort((l,d)=>l.name.localeCompare(d.name)||l.id.localeCompare(d.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}=ft(),r=m.useMemo(()=>[...new Set(o.map(u=>u.roomId))].sort().join(`
|
|
1
|
+
import{kv as be,kw as ye,j as t,hV as $,hW as F,hX as L,hY as B,hZ as q,_ as I,ay as A,O as ke,Q as Se,C as Ne,U as we,kx as z,B as b,ky as Re,kz as Ce,cj as W,e as C,G as y,s as H,r as m,J as Ie,kA as Ae,aj as Pe,ak as De,dV as Oe,aY as Me,X as oe,kB as Te,kC as Ee,aQ as $e,dW as ie,iL as Fe,by as K,ar as R,T as Le,kD as Be,i_ as qe,kE as ze,eG as We,eH as He,iY as _e,j3 as Ue,kF as Ge,kG as Ke,eA as ae,eC as Ve,kH as Qe,c$ as re,ad as Ye,eD as Xe,iZ as Je,l as le,kI as de,kJ as ce,gX as Ze,kK as _,eB as et,bf as tt,a$ as st,hI as nt,gB as ot,kL as it,as as at,gY as ue,g as rt,gk as me,kM as V,ai as Q,c7 as lt,kN as dt,kO as ct,kP as ut,a1 as mt,kQ as ht,cf as gt,bP as ft,jl as pt,aP as xt,i6 as jt,eM as M,k9 as vt,q as Y,eb as bt,g$ as yt,kR as kt,n as St}from"./index-BSNB2iOV.js";import{I as Nt,p as wt}from"./ChannelComposer-MROo35vI.js";import{b as Rt}from"./index-CNlIRtiQ.js";import{R as Ct}from"./RoomSurface-DyubmENi.js";import{P as he}from"./PromptSuggestionChips-Dpie7Ut6.js";import{S as U}from"./scroll-area-D3x48cAw.js";import{d as It}from"./dead-letter-reasons-DtBHju9v.js";import{u as At}from"./use-mesh-topology-C_bdAJfy.js";import{A as Pt}from"./AttentionSignalRow-x8vRACw-.js";import{u as ge}from"./use-promo-dismissals-BhTNS7LX.js";import{u as Dt,s as Ot,P as Mt,a as Tt}from"./use-promo-activation-C9I5YwBo.js";import"./repeat-Cbe4MVvF.js";import"./use-room-sessions-UwyzNxeo.js";import"./WidgetErrorCard-DQWpqcbG.js";import"./index-p7yYM6Iz.js";import"./card-ZF4yWM1Y.js";import"./progress-8CDPI0xL.js";import"./markdown-content-BbH7L0YO.js";import"./table-Cg_1lfh0.js";import"./package-DSJyi_sq.js";import"./heart-yvX6jsem.js";import"./git-branch-Cvc-Sr6q.js";import"./file-text-BcDT6eqO.js";import"./file-aWVIKIhu.js";import"./find-latest-widget-fence-BBx2mbzG.js";import"./format-duration-BCr6uzby.js";import"./RuntimeSetupDialog-DQss2qqJ.js";import"./inline-code-Df1J1tQV.js";import"./list-runtime-types-C4Ik3n5A.js";import"./RuntimeConnectFlow-DJMtgkZF.js";import"./useMutationState-CUuSnqrc.js";import"./runtime-connect-Dn0T5YWv.js";import"./mention-pill-DxRP9Bkp.js";import"./rotate-ccw-clock-CI-xhvb_.js";import"./unplug-CASvw-Yn.js";import"./message-square-off-BP01X_ck.js";import"./registry-B0s0gwF4.js";import"./file-drag-GDx2qhdk.js";import"./paperclip-CeOJ8Nwp.js";import"./index-sTYFlBEJ.js";import"./pane-resize-handle-BnQ8IKj6.js";import"./UnreadDivider-mAlJ1Ci7.js";import"./use-room-follow-claim-D_HTjK2r.js";import"./use-connector-management-CQQGCFaL.js";import"./AgentRequestCard-DBVuClMO.js";import"./access-copy-DzgVmhna.js";import"./query-error-state-jrioxcrf.js";import"./empty-state-CQVHyP7G.js";import"./use-bindings-Clux6PJ0.js";import"./connection-copy--MA7AN04.js";import"./KeyEntry-ZYnZcVmM.js";import"./use-update-config-BwjEWlgj.js";import"./use-relay-config-Bfjxr2lE.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,d=s==null?void 0:s.find(h=>h.source===r&&h.reason===l),c=()=>{!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(B,{children:"Messages that never arrived"}),t.jsx(q,{children:r??"Source unknown"})]}),t.jsx(U,{className:"flex-1 px-4",children:d?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:[d.count," message",d.count===1?"":"s"," couldn’t be delivered"]}),t.jsx(I,{variant:"secondary",children:It(d.reason)})]}),t.jsxs("div",{className:"space-y-1 text-sm",children:[t.jsxs("p",{className:"text-muted-foreground",children:["First happened ",A(d.firstSeen)," ago"]}),t.jsxs("p",{className:"text-muted-foreground",children:["Last happened ",A(d.lastSeen)," ago"]})]}),d.sample!=null&&t.jsxs(ke,{children:[t.jsxs(Se,{className:"text-muted-foreground hover:text-foreground group flex items-center gap-1 text-xs font-medium transition-colors",children:[t.jsx(Ne,{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(d.sample,null,2)})})]})]}):t.jsx("p",{className:"text-muted-foreground py-8 text-center text-sm",children:"These are cleared already."})}),t.jsxs(z,{children:[d&&t.jsx(b,{variant:"destructive",onClick:c,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"blocked":return{label:"Blocked",badge:"outline",tone:"warning",heading:"What it needed",title:"Run that couldn’t use its tools"};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"},warning:{box:"bg-status-warning-bg border-status-warning-border",heading:"text-status-warning-fg",body:"text-status-warning-fg"},neutral:{box:"bg-muted border-border",heading:"text-foreground",body:"text-foreground/80"}};function Bt({open:e,itemId:n,onClose:o}){const{data:s,isLoading:i,isError:a}=Re(e?n??null:null),r=Ce(),l=W(),d=()=>{s!=null&&s.sessionId&&l(H({session:s.sessionId}))},c=()=>{s&&r.mutate(s.id)},h=s?Ft(s.status):null,g=h?Lt[h.tone]:null;return t.jsx($,{open:e,onOpenChange:f=>!f&&o(),children:t.jsxs(F,{side:"right",children:[t.jsxs(L,{children:[t.jsx(B,{children:(h==null?void 0:h.title)??"Run that needs a look"}),t.jsx(q,{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(z,{children:[(s==null?void 0:s.sessionId)&&t.jsx(b,{variant:"default",onClick:d,children:"View chat"}),(s==null?void 0:s.status)==="running"&&t.jsx(b,{variant:"destructive",onClick:c,disabled:r.isPending,children:r.isPending?"Cancelling…":"Cancel run"}),t.jsx(b,{variant:"outline",onClick:o,children:"Close"})]})]})})}function qt({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 zt({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(B,{children:"Agents that aren’t answering"}),t.jsxs(q,{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(qt,{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(z,{children:t.jsx(b,{variant:"outline",onClick:n,children:"Close"})})]})})}function Wt(e){return e.content.suggestion!==void 0}function Ht(){const e=Dt(),{dismissedIds:n}=ge(),o=Me(s=>s.promoEnabled);return m.useMemo(()=>{if(!o)return null;const[s]=Ot(Mt.filter(Wt),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 Gt(){const e=Ht();return e===null?null:t.jsx(Ut,{promo:e},e.id)}const Kt=["report.daily"];function fe(){const{notifications:e}=Te({kinds:Kt,unread:!0});return m.useMemo(()=>e[0],[e])}function Vt({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:d,activityItems:c,onOpenActivity:h,shiftReport:g,presence:f,condensed:j,onExpand:x,className:u}){const p=ie(),v=m.useRef(null),S=Fe(v),N=e.length>0||n.length>0||o.length>0||l.length>0||a,P=d.length>0,w=c.length>0,je=N||P||w||g!==void 0||(f==null?void 0:f.occupied)===!0,O=Vt({questions:n.length,requests:e.length,schedules:l.length,approvalsUnavailable:a,attention:d.length+c.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(K,{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(p===!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:p?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:S.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:[N&&t.jsxs(T,{title:"Waiting on you",children:[(n.length>0||o.length>0)&&t.jsx(Be,{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(qe,{approvals:e}),e.length===0&&a&&t.jsx(ze,{onRetry:r}),t.jsx(K,{initial:!1,children:l.map(k=>t.jsx(We,{task:k,className:"mt-2"},k.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:d.map(k=>t.jsx(Pt,{signal:k},k.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:c.map(k=>t.jsx(He,{notification:k,onOpen:()=>h(k)},k.id))})})}),f==null?void 0:f.node]}),S.start&&t.jsx(X,{edge:"top"}),S.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(),d=Ge(),c=Ke(l),{schedules:h,errors:g,activity:f}=ae(),j=Ve(),x=fe(),{mutate:u}=Qe(),p=re({strict:!1}),v=W(),S=Ye(),N=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:d,askAgentNames:c,onOpenSession:G=>{v(H({session:G}))},approvalsUnavailable:a&&i.length===0,onRetryApprovals:r,scheduleApprovals:N,errorSignals:g,activityItems:f,onOpenActivity:j,shiftReport:x===void 0?void 0:{notification:x,onDismiss:()=>u(x.id)},presence:e,condensed:S&&n===!0,onExpand:o,className:s}),t.jsx(Et,{open:p.detail==="dead-letter",itemId:p.itemId,onClose:w}),t.jsx(Bt,{open:p.detail==="failed-run",itemId:p.itemId,onClose:w}),t.jsx(zt,{open:p.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=>{de.getState().set(e,o),ce.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 ds({roomId:e,presenceOccupied:n}){const o=_(e),s=ns(e),{items:i,isLoading:a,isAnyError:r}=et(),{total:l}=ae(),d=fe(),c=o!==void 0&&o.length>0,h=s!==null&&o!==void 0&&o.every(N=>N.seq<=s),g=i.length>0||a||r||l>0||d!==void 0||n,f=c&&h&&!g,[j,x]=m.useState("waiting");f&&j==="waiting"?x("shown"):!f&&j==="shown"&&x("retired");const u=f&&j!=="retired",p=tt(),{data:v}=st(p&&u),S=nt();return u?t.jsx(ls,{forwardLook:rs(os(v,S),S),suggestion:t.jsx(Gt,{})}):null}const pe="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 cs(){try{return localStorage.getItem(pe)}catch{return null}}function us(e){try{localStorage.setItem(pe,e)}catch{}}function ms(){const[e]=m.useState(()=>cs()!==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",fs="Make a daily plan board",xe="Something else",ps=[gs,fs,xe];function xs({roomId:e,mode:n}){const o=Rt(),s=ot(),i=m.useCallback(a=>{if(a===xe){de.getState().set(e,`${ee} `),ce.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:ps,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((d,c)=>d===void 0||c.seq>d.seq?c:d,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 ks({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(Nt,{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 Ss({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(ks,{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 Ns(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:ct(e.name,e.binding,e.state),detail:dt(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 d=Rs(l.roomId,e).find(f=>f.author.id===l.authorId);if(d===void 0)continue;const c=d.author.agentRef===void 0?void 0:n.get(d.author.agentRef);if(c!==void 0&&i.add(c.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:d.author.displayName,handle:d.author.handle,face:V({record:d.author,override:c===void 0?null:Q(c.manifest),...d.origin!==void 0?{origin:d.origin}:{}}),binding:g===null?null:Ns(g),state:l.state,since:l.since,roomTitle:g,runtime:(c==null?void 0:c.manifest.runtime)??null,profileMemberId:c===void 0?null:e.meshIdByPath[c.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 d=e.agents[l.cwd];if(d==null)continue;a.add(l.cwd);const c=d.displayName??d.name;r.push(te({id:`session:${l.sessionId}`,name:c,handle:null,face:V({record:{id:d.id,kind:"agent",displayName:c},override:Q(d)}),binding:ws,state:"working",since:null,roomTitle:null,runtime:d.runtime,profileMemberId:e.meshIdByPath[l.cwd]??null,follow:{kind:"session",sessionId:l.sessionId,cwd:l.cwd}}))}return r.sort((l,d)=>l.name.localeCompare(d.name)||l.id.localeCompare(d.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}=ft(),r=m.useMemo(()=>[...new Set(o.map(u=>u.roomId))].sort().join(`
|
|
2
2
|
`),[o]),l=m.useMemo(()=>r.length===0?[]:r.split(`
|
|
3
|
-
`),[r]),d=pt({queries:l.map(u=>({queryKey:xt.detail(u),queryFn:()=>n.getRoom(u)})),combine:u=>{const p={};for(const v of u)v.data!==void 0&&(p[v.data.id]=v.data);return p}}),c=m.useMemo(()=>{const u={};for(const p of i??[])u[p.id]=p;return u},[i]),h=m.useMemo(()=>((a==null?void 0:a.agents)??[]).map(u=>u.projectPath),[a]),{data:g}=jt(h),f=m.useMemo(()=>g??{},[g]),j=m.useMemo(()=>{const u={};for(const p of(a==null?void 0:a.agents)??[])u[p.projectPath]=p.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:d,rooms:c,sessions:s,agents:f,meshIdByPath:j,excludeRoomIds:x.length===0?[]:x.split(D)});return u.length===0?se:u},[o,d,c,s,f,j,x])}function Ms(e=[]){const n=Os(e),o=W(),{open:s}=vt(),i=m.useCallback(r=>{if(r.kind==="room"){
|
|
3
|
+
`),[r]),d=pt({queries:l.map(u=>({queryKey:xt.detail(u),queryFn:()=>n.getRoom(u)})),combine:u=>{const p={};for(const v of u)v.data!==void 0&&(p[v.data.id]=v.data);return p}}),c=m.useMemo(()=>{const u={};for(const p of i??[])u[p.id]=p;return u},[i]),h=m.useMemo(()=>((a==null?void 0:a.agents)??[]).map(u=>u.projectPath),[a]),{data:g}=jt(h),f=m.useMemo(()=>g??{},[g]),j=m.useMemo(()=>{const u={};for(const p of(a==null?void 0:a.agents)??[])u[p.projectPath]=p.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:d,rooms:c,sessions:s,agents:f,meshIdByPath:j,excludeRoomIds:x.length===0?[]:x.split(D)});return u.length===0?se:u},[o,d,c,s,f,j,x])}function Ms(e=[]){const n=Os(e),o=W(),{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(H({session:r.sessionId,dir:r.cwd}))},[o]),a=m.useMemo(()=>t.jsx(Ss,{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(St,{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 f,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=kt(),l=Ms(e.room===null?[]:[e.room.id]),d=_(((f=e.room)==null?void 0:f.id)??null),c=ue(((j=e.room)==null?void 0:j.id)??null,null),h=d!==void 0&&d.length===0&&c.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(ds,{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 $n=Ts;export{$n as component};
|
package/dist/client/assets/{_shell._home.tasks-BDR9JTj3.js → _shell._home.tasks-CnfbD4z-.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e5 as k,r as i,e6 as w,e7 as C,e8 as E,j as e,e as R,e9 as o,ea as D,ar as x,B as M,cR as B,eb as _,bf as L,a$ as Q,cQ as z,b2 as G}from"./index-
|
|
1
|
+
import{e5 as k,r as i,e6 as w,e7 as C,e8 as E,j as e,e as R,e9 as o,ea as D,ar as x,B as M,cR as B,eb as _,bf as L,a$ as Q,cQ as z,b2 as G}from"./index-BSNB2iOV.js";import{Q as H}from"./query-error-state-jrioxcrf.js";import{P as F}from"./page-container-D7q7ISl1.js";import{F as K,T as U,C as V}from"./TasksEmptyState-rCcan38Y.js";import{i as W}from"./registry-B0s0gwF4.js";import{u as $,S as X}from"./search-x-Dz-ryi0D.js";import{S as q}from"./scroll-area-D3x48cAw.js";import"./empty-state-CQVHyP7G.js";import"./inline-code-Df1J1tQV.js";import"./form-Bq-P02ub.js";import"./command-D2uvj-5S.js";import"./AgentPicker-BhsmtQgu.js";import"./AgentOptionRow-nGR6PdC6.js";import"./execution-config-B0Ip8o1B.js";import"./settings-for-runtime-BoOa-ZFG.js";import"./list-runtime-types-C4Ik3n5A.js";import"./format-cron-CoTCXmQp.js";const J=8,Y={visible:{transition:{staggerChildren:.04}},hidden:{}},Z={hidden:{opacity:0,y:8},visible:{opacity:1,y:0}};function ee({tasks:l,isLoading:c,agentMap:u,onEditTask:j,agentId:m}){const s=$(k,{debounce:{search:200}}),[r]=i.useState(0),[f,d]=i.useState(null),n=i.useMemo(()=>m?l.filter(t=>t.agentId===m):l,[l,m]),p=i.useMemo(()=>[...new Set(n.map(t=>t.agentId).filter(t=>!!t))],[n]),h=i.useMemo(()=>w(n,k,s.values,E,{field:s.sortField||C,direction:s.sortDirection}),[n,s.values,s.sortField,s.sortDirection]);return c?e.jsx("div",{className:"space-y-3 py-4",children:Array.from({length:3}).map((t,g)=>e.jsx(R,{className:"h-14 w-full rounded-xl"},g))}):e.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[e.jsxs(o,{state:s,className:"px-0",children:[e.jsx(o.Search,{placeholder:"Filter tasks…"}),e.jsx(o.Primary,{name:"status"}),e.jsx(o.AddFilter,{dynamicOptions:{agent:p}}),e.jsx(o.Sort,{options:E,defaultField:C}),e.jsx(o.ResultCount,{count:h.length,total:n.length,noun:"task"}),e.jsx(o.ActiveFilters,{})]}),e.jsx(q,{className:"min-h-0 flex-1","data-testid":D.tasksList,children:e.jsx("div",{className:"space-y-2 pb-4",children:h.length===0&&n.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(X,{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(M,{variant:"outline",size:"sm",onClick:s.clearAll,children:"Clear filters"})]}):e.jsx(x.div,{initial:"hidden",animate:"visible",variants:Y,className:"space-y-2",children:h.map((t,g)=>e.jsx(x.div,{variants:g<J?Z:void 0,transition:{duration:.15},children:e.jsx(B,{task:t,agent:(t.agentId?u.get(t.agentId):void 0)??null,expanded:f===t.id,onToggleExpand:()=>d(f===t.id?null:t.id),onEdit:()=>j(t)})},t.id))},r)})})]})}function te(){return e.jsxs(e.Fragment,{children:[e.jsx(_,{children:"Schedules"}),e.jsx(se,{})]})}function se(){const l=L(),{data:c=[],isLoading:u,isError:j,refetch:m}=Q(l),[s,r]=i.useState(!1),[f,d]=i.useState(),[n,p]=i.useState(null),h=c.some(a=>a.agentId),{data:t}=z(void 0,h||!u),g=i.useMemo(()=>{const a=new Map;for(const S of(t==null?void 0:t.agents)??[])a.set(S.id,S);return a},[t]),{externalTrigger:T,clear:N}=G(),[v,y]=i.useState(!1);T&&!v&&!s?(y(!0),d(void 0),r(!0),N()):!T&&v&&y(!1);const A=a=>{p(a),d(void 0),r(!0)},b=()=>{p(null),d(void 0),r(!0)},O=a=>{d(a),r(!0)},P=a=>{r(a),a||p(null)};if(!l)return e.jsx(K,{icon:W.tasks,name:"Scheduling",description:"Agents run tasks on a schedule, even while you’re away.",command:"dorkos --tasks"});if(j)return e.jsx(H,{className:"h-full",title:"Couldn’t load your scheduled tasks",description:"The DorkOS server didn’t answer. Check that it’s running.",onRetry:()=>void m()});const I=c.length>0;return e.jsxs(e.Fragment,{children:[!I&&!u?e.jsx(x.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.15},className:"h-full min-h-0",children:e.jsx(F,{width:"full",children:e.jsx(U,{onCreateWithPreset:A,onCreateBlank:b})})}):e.jsx(x.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.15},className:"h-full min-h-0",children:e.jsx(F,{width:"full",scroll:!1,children:e.jsx(ee,{tasks:c,isLoading:u,agentMap:g,onEditTask:O})})}),e.jsx(V,{open:s,onOpenChange:P,editTask:f,initialPreset:n})]})}const ve=te;export{ve as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a1 as j,a2 as g,r as f,j as e,eb as N,am as i,a0 as b,ec as y,_ as u,b8 as w}from"./index-
|
|
1
|
+
import{a1 as j,a2 as g,r as f,j as e,eb as N,am as i,a0 as b,ec as y,_ as u,b8 as w}from"./index-BSNB2iOV.js";import{I as C}from"./inline-code-Df1J1tQV.js";import{T,d as v,b as p,e as c,a as S,c as d}from"./table-Cg_1lfh0.js";import{P as k}from"./page-container-D7q7ISl1.js";import{G as L}from"./git-branch-Cvc-Sr6q.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};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{W as Qt,r as f,j as e,gU as Wt,a1 as V,lk as mt,a2 as ft,ll as Y,a3 as ce,a4 as $e,lm as Gt,ln as fe,lo as X,cf as Jt,lp as Vt,c6 as Xt,g$ as Zt,cj as Ie,l as Ne,lq as es,lr as ts,ls as ss,lt as Se,lu as Fe,B as S,lv as ns,cQ as ht,lw as pt,eu as re,en as xt,eo as gt,ep as yt,eq as vt,er as Ke,I as qe,fX as jt,hs as as,fY as Nt,fZ as wt,f_ as bt,f$ as Ct,g0 as St,g1 as Rt,g2 as rs,$ as is,lx as os,ly as ls,lz as cs,kT as he,cT as He,cU as Be,cW as Qe,cX as We,cY as Ge,dU as Je,dB as Ve,a7 as kt,lc as ds,ld as us,hT as ms,lA as fs,lB as Xe,lC as hs,lD as ps,lE as At,lF as xs,lG as Dt,lH as Tt,lI as gs,eb as Mt,lJ as ys,lK as vs,lL as js,ji as Ns,a0 as ws,ey as bs,fe as Cs,lM as Ss,lN as Rs,G as ve,ba as Re,ex as Ze,Y as De,ht as ks,lO as As,lP as rt,lQ as it,c$ as Et,lR as Ds,lS as Ts,kl as Ms,ad as Es,n as ot}from"./index-BSNB2iOV.js";import{T as Os,a as $s,R as Is}from"./RoomSurface-DyubmENi.js";import{c as ge,C as ke}from"./index-CNlIRtiQ.js";import{M as Ls}from"./markdown-content-BbH7L0YO.js";import{o as Us,a as zs,c as Fs}from"./owner-notice-83ejBJ3g.js";import{B as Ps}from"./banner-C0yzCrO7.js";import"./ChannelComposer-MROo35vI.js";import"./pane-resize-handle-BnQ8IKj6.js";import"./UnreadDivider-mAlJ1Ci7.js";import"./use-room-follow-claim-D_HTjK2r.js";import"./use-connector-management-CQQGCFaL.js";import"./AgentRequestCard-DBVuClMO.js";import"./access-copy-DzgVmhna.js";import"./query-error-state-jrioxcrf.js";import"./empty-state-CQVHyP7G.js";import"./use-bindings-Clux6PJ0.js";import"./connection-copy--MA7AN04.js";import"./KeyEntry-ZYnZcVmM.js";import"./use-room-sessions-UwyzNxeo.js";import"./file-aWVIKIhu.js";import"./file-drag-GDx2qhdk.js";import"./find-latest-widget-fence-BBx2mbzG.js";import"./WidgetErrorCard-DQWpqcbG.js";import"./index-p7yYM6Iz.js";import"./card-ZF4yWM1Y.js";import"./progress-8CDPI0xL.js";import"./table-Cg_1lfh0.js";import"./package-DSJyi_sq.js";import"./heart-yvX6jsem.js";import"./git-branch-Cvc-Sr6q.js";import"./file-text-BcDT6eqO.js";import"./paperclip-CeOJ8Nwp.js";import"./index-sTYFlBEJ.js";import"./RuntimeSetupDialog-DQss2qqJ.js";import"./inline-code-Df1J1tQV.js";import"./list-runtime-types-C4Ik3n5A.js";import"./RuntimeConnectFlow-DJMtgkZF.js";import"./useMutationState-CUuSnqrc.js";import"./runtime-connect-Dn0T5YWv.js";import"./repeat-Cbe4MVvF.js";import"./format-duration-BCr6uzby.js";import"./mention-pill-DxRP9Bkp.js";import"./rotate-ccw-clock-CI-xhvb_.js";import"./unplug-CASvw-Yn.js";import"./message-square-off-BP01X_ck.js";import"./registry-B0s0gwF4.js";/**
|
|
2
|
+
* @license lucide-react v1.48.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const Ot={name:"circle-off",size:24,node:[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.35 2.69A10 10 0 0 1 21.3 15.65",key:"1pfsoa"}],["path",{d:"M19.08 19.08A10 10 0 1 1 4.92 4.92",key:"1ablyi"}]]};Ot.node;const _s=Qt(Ot),Ks=5e3;function Ys({connection:t}){var c;const s=t.official===!0&&t.status==="connected"&&((c=t.access)==null?void 0:c.state)==="unverified",n=f.useMemo(()=>s?{}:null,[s]),[a,i]=f.useState(null);return f.useEffect(()=>{if(!n)return;const l=setTimeout(()=>i(n),Ks);return()=>clearTimeout(l)},[n]),n===null||a!==n?null:e.jsx(Wt,{tone:"info",role:"status",className:"m-3","data-testid":"official-space-unreachable",children:"The DorkOS community isn’t reachable right now. Try again in a few minutes."})}function $t(t,s){return[...Y.remote(t,s),"teammates"]}function qs(t,s=!0){const n=V(),a=mt(s);return ft({queryKey:a?$t(a,t):[...Y.all,"owner","unresolved",t,"teammates"],queryFn:()=>Gt(a,async()=>{const[i,c]=await Promise.all([n.getCommunityWakeAgentsFrom(t),n.getCommunityTeammateSpend(t)]);return{wakeAgentsFrom:i.wakeAgentsFrom,spend:c}}),enabled:s&&a!==null})}function Hs(t){const s=V(),n=ce(),a=mt(!0);return $e({mutationFn:async i=>{"wakeAgentsFrom"in i?await s.setCommunityWakeAgentsFrom(t,i.wakeAgentsFrom):await s.setCommunityTeammateSpendLimit(t,i.monthlyLimitUsd)},onSettled:async()=>{a&&await n.invalidateQueries({queryKey:$t(a,t)})}})}const Bs=500,le=new Map;function It(t,s){return t.id!==s.id||t.community!==s.community||t.roomId!==s.roomId||t.text===s.text&&t.authorDisplayName===s.authorDisplayName&&JSON.stringify(t.mentions)===JSON.stringify(s.mentions)&&JSON.stringify(t.attachments)===JSON.stringify(s.attachments)?t:{...t,text:s.text,mentions:s.mentions,attachments:s.attachments,authorDisplayName:s.authorDisplayName}}function Ye(t,s){if(s.size===0)return t;let n=!1;const a=t.map(i=>{const c=s.get(i.id),l=c?It(i,c):i;return l!==i&&(n=!0),l});return n?a:t}function Te(t,s,...n){const a=new Map;for(const i of n)for(const c of i){if(c.community!==t||c.roomId!==s)throw new Error("Community history contains a different room.");a.set(c.id,c)}return[...a.values()].sort((i,c)=>i.remoteSeq-c.remoteSeq)}function Qs(t,s,n=!0,a=0,i="legacy",c=!1,l){const d=V(),r=f.useRef(l);f.useEffect(()=>{r.current=l},[l]);const o=ce(),h=fe(!0,i,t),u=JSON.stringify([h==null?void 0:h.ownerKey,h==null?void 0:h.epoch,h==null?void 0:h.route.epoch,h==null?void 0:h.accessFingerprint,t,s]),[x,j]=f.useState(()=>({address:u,room:null,entries:[],revisions:le,deliveries:[],status:"connecting"}));return f.useEffect(()=>{if(!h||!n)return;const v=h,b=new AbortController;let g,T=0,C,P,q=!1;j({address:u,room:null,entries:[],revisions:le,deliveries:[],status:"connecting"});function O(){q=!0,C=void 0,P=void 0,o.removeQueries({queryKey:Y.remote(v,t)}),j({address:u,room:null,entries:[],revisions:le,deliveries:[],status:"removed"})}async function K(){try{await d.subscribeRemoteCommunityRoom(t,s,w=>{var I;if(!(b.signal.aborted||q||!X(v))){if(w.type==="closed"){(w.reason==="removed"||w.reason==="revoked")&&O();return}if(T=0,w.type==="snapshot")C=w.cursor??void 0,w.redactionCursor&&(P=w.redactionCursor),o.setQueryData(Y.room(v,t,s),w.room),j(N=>({address:u,room:w.room,entries:Ye(Te(t,s,N.address===u?N.entries:[],w.entries).slice(-500),N.address===u?N.revisions:le),revisions:N.address===u?N.revisions:le,deliveries:N.deliveries.filter(y=>!w.entries.some(L=>L.originIdempotencyKey===y.idempotencyKey)),status:w.stale?"offline":"live"}));else if(w.type==="revision"){const N=w.entry;w.redactionCursor&&(P=w.redactionCursor);const y=[...Y.room(v,t,s),"entries"],A=o.getQueriesData({queryKey:y}).some(([,k])=>k==null?void 0:k.pages.some(z=>z.entries.some(H=>H.id===N.id)))||o.isFetching({queryKey:y})>0||((I=r.current)==null?void 0:I.call(r,N.id))===!0;o.setQueriesData({queryKey:y},k=>{if(!k)return k;let z=!1;const H=k.pages.map(Z=>{const ie=Z.entries.map(ee=>It(ee,N));return ie.some((ee,pe)=>ee!==Z.entries[pe])?(z=!0,{...Z,entries:ie}):Z});return z?{...k,pages:H}:k}),j(k=>{if(!A&&!k.entries.some(H=>H.id===N.id))return k;const z=new Map(k.revisions);for(z.delete(N.id),z.set(N.id,N);z.size>Bs;)z.delete(z.keys().next().value);return{...k,entries:Ye(k.entries,z),revisions:z}})}else w.type==="deliveries"?j(N=>({...N,deliveries:w.deliveries.filter(y=>!N.entries.some(L=>L.originIdempotencyKey===y.idempotencyKey))})):(C=w.entry.cursor,j(N=>({...N,entries:Te(t,s,N.entries,[w.entry]).slice(-500),deliveries:N.deliveries.filter(y=>y.idempotencyKey!==w.entry.originIdempotencyKey),status:"live"})))}},{since:C,redactions:P,signal:b.signal})}catch(w){if(b.signal.aborted||!X(v))return;const I=w&&typeof w=="object"&&"status"in w?w.status:void 0,N=w&&typeof w=="object"&&"code"in w?w.code:void 0;N==="COMMUNITY_DELETED"||N==="COMMUNITY_TAKEN_DOWN"?(O(),o.invalidateQueries({queryKey:Y.connections(v)})):I===401||I===403||I===404?O():I===410&&N==="COMMUNITY_CURSOR_STALE"&&(C=void 0)}if(b.signal.aborted||q||!X(v))return;const U=o.getQueryData(Y.room(v,t,s));U&&o.setQueryData(Y.room(v,t,s),{...U,stale:!0,writable:!1}),j(w=>({...w,room:w.room?{...w.room,stale:!0,writable:!1}:null,status:"offline"})),g=setTimeout(()=>{K()},Math.min(3e4,1e3*2**Math.min(T++,5)))}return K(),()=>{b.abort(),clearTimeout(g)}},[u,t,s,n,a,o,d,h,c]),x.address!==u||!h?{address:u,room:null,entries:[],revisions:le,deliveries:[],status:"connecting"}:n?x:c?{...x,room:x.room?{...x.room,stale:!0,writable:!1}:null,deliveries:[],status:"offline"}:{address:u,room:null,entries:[],revisions:le,deliveries:[],status:"removed"}}function Ws(t){var h;const s=Jt(),n=Vt(),a=t===void 0||(h=s.data)==null?void 0:h.find(u=>u.id===t),i=a!==void 0&&Xt(a)!==null,c=t===void 0||s.data!==void 0||s.isError,[l,d]=f.useState(void 0),r=t!==void 0&&l===t,o=f.useRef(void 0);return f.useEffect(()=>{!i||t===void 0||r||o.current===t||(o.current=t,n({roomId:t},{replace:!0,quiet:!0}).then(u=>{u||d(t)}))},[i,t,r,n]),c?i&&!r?"redirecting":"show":"pending"}function Gs(t,s,n){var d;const a=Zt(),i=Ie(),c=t!==void 0&&((d=a.room)==null?void 0:d.id)===t,l=a.status!=="loading";return f.useEffect(()=>{c&&i({...Ne.home(),search:{...s===void 0?{}:{thread:s},...n===void 0?{}:{entry:n}},replace:!0})},[c,s,n,i]),t===void 0?"show":c?"redirecting":l?"show":"pending"}function Js(t){return t?{ownerAddress:JSON.stringify([t.ownerKey,t.epoch]),contextAddress:JSON.stringify([t.ownerKey,t.epoch,t.route.epoch,t.accessFingerprint])}:{ownerAddress:"",contextAddress:""}}const Vs=new Set(["COMMUNITY_MUTED","COMMUNITY_SLOW_MODE","COMMUNITY_RULES_NOT_ACCEPTED"]);function Xs(t){const s=t==null?void 0:t.code;return typeof s=="string"&&Vs.has(s)}function Zs(t,s=new Date){return t.kind==="muted"?`You’re muted here until ${es(t.until,s)??"later"}.`:t.kind==="rules"?"Accept this space’s rules to post.":`Slow mode. Post again in ${t.secondsLeft}s.`}function en(t,s){if(!t)return null;if(t.mutedUntil&&Date.parse(t.mutedUntil)>s)return{kind:"muted",until:t.mutedUntil};const{rules:n}=t;return n.text!==null&&n.version>0&&n.acceptedVersion<n.version?{kind:"rules"}:null}function tn({community:t,roomId:s,enabled:n,accessFingerprint:a}){var q;const i=V(),c=ce(),l=fe(n,a,t),d=l?[...Y.room(l,t,s),"standing"]:[...Y.all,"owner","unresolved",t,"room",s,"standing"],r=ft({queryKey:d,queryFn:()=>ts(l,()=>i.getRemoteCommunityStanding(t,s)),enabled:n&&l!==null,staleTime:3e4,retry:!1,refetchInterval:O=>{var K;return(K=O.state.data)!=null&&K.mutedUntil&&Date.parse(O.state.data.mutedUntil)>Date.now()?6e4:!1}}),[o,h]=f.useState(null),[u,x]=f.useState(()=>Date.now()),j=(q=r.data)!=null&&q.mutedUntil?Date.parse(r.data.mutedUntil):null;f.useEffect(()=>{if(o!==null&&o>u){const O=setTimeout(()=>x(Date.now()),1e3);return()=>clearTimeout(O)}if(j!==null&&j>u){const O=setTimeout(()=>x(Date.now()),Math.min(j-u+50,1073741824));return()=>clearTimeout(O)}},[j,u,o]);const v=r.refetch,b=f.useCallback(O=>{if((O==null?void 0:O.code)==="COMMUNITY_SLOW_MODE"){const U=O.retryAfterMs;if(typeof U=="number"&&U>0){const w=Date.now();x(w),h(w+U)}return}v()},[v]),g=$e({meta:{suppressErrorToast:!0},mutationFn:O=>i.acceptRemoteCommunityRules(t,O),onSuccess:O=>{c.setQueryData(d,K=>K&&{...K,rules:O})},onError:()=>void v()}),T=en(r.data,u),C=o===null?0:Math.ceil((o-u)/1e3),P=T??(C>0?{kind:"slow",secondsLeft:C}:null);return{standing:r.data,hold:P,noteHold:b,accept:g}}const sn=new Set(["COMMUNITY_DELETED","COMMUNITY_TAKEN_DOWN"]),nn=30*6e4,ye=new Map;function Lt(t,s,n){return JSON.stringify([t,s,n])}function Ut(t){return Date.now()-t<nn}function an(t){for(const[s,n]of ye)Ut(n.at)||ye.delete(s);return ye.get(t)}function rn(){return Date.now()}function on(t,s,n){ye.set(t,{attachmentId:s,at:n})}function lt(t){for(const s of t.files)ye.delete(Lt(t.ref,t.roomId,s.id))}function ct(t){return t.filter(s=>s.trim()).join(`
|
|
7
|
+
|
|
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
|
+
|
|
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 Ha=Jn;export{Ha as component};
|