dorkos 0.118.0 → 0.120.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/cli.js +3588 -3000
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-BOS59p1y.js → AboutPage-Y8O56Cz5.js} +1 -1
- package/dist/client/assets/{ActivityErrorState-DOmV85tr.js → ActivityErrorState-DlROxqde.js} +1 -1
- package/dist/client/assets/{ActivityPage-DbsBpb6N.js → ActivityPage-BdV90CV2.js} +1 -1
- package/dist/client/assets/{ActivityRow-B1ZeL7Jb.js → ActivityRow-B5yiD_uD.js} +1 -1
- package/dist/client/assets/{AdapterIcon-XPLZ-NAi.js → AdapterIcon-Dyq92Eup.js} +1 -1
- package/dist/client/assets/AdapterSetupWizard-D9tqz7Hl.js +2 -0
- package/dist/client/assets/{AgentOptionRow-C15RQsub.js → AgentOptionRow-BeRqDo7c.js} +1 -1
- package/dist/client/assets/{AgentPicker-CydNJYi_.js → AgentPicker-BRyYVJZu.js} +1 -1
- package/dist/client/assets/{AgentRequestCard-BBSbluBs.js → AgentRequestCard-xX6fAKgO.js} +4 -4
- package/dist/client/assets/AppearancePage-DKF9BqRt.js +1 -0
- package/dist/client/assets/{ApplyToOverridesDialog-Cv3KEf7T.js → ApplyToOverridesDialog-CPvtr_-f.js} +1 -1
- package/dist/client/assets/AttentionSignalRow-vBfioH1A.js +1 -0
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-Re2CfOlC.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-B50zNtwB.js} +1 -1
- package/dist/client/assets/{BindingDialog-8xnsM47D.js → BindingDialog-CSNjws3F.js} +1 -1
- package/dist/client/assets/{BlintzCanvas-DUDSNxlM.js → BlintzCanvas-ClOKWzws.js} +80 -79
- package/dist/client/assets/{CanvasCsvContent-D697P3sa.js → CanvasCsvContent-0Mb7uOuA.js} +6 -6
- package/dist/client/assets/CanvasFileContent-B_8zsIas.js +2 -0
- package/dist/client/assets/CanvasModel3dContent-UokbHY9i.js +2 -0
- package/dist/client/assets/{ChatAppsOff-CFEmPGm1.js → ChatAppsOff-CLRB0YU5.js} +1 -1
- package/dist/client/assets/{CodeMirrorDiff-B7VUevZG.js → CodeMirrorDiff-B4uFJD6g.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-BX1bJlnT.js → CodeMirrorEditor-rYOrBAZc.js} +1 -1
- package/dist/client/assets/{CommitmentList-CDocwl5K.js → CommitmentList-i-IZ4gbr.js} +1 -1
- package/dist/client/assets/{CommitmentsPage-Cr_MvU96.js → CommitmentsPage-ChO1JkrE.js} +1 -1
- package/dist/client/assets/{ComputerResourceView-CJMUZPDy.js → ComputerResourceView-pLuD2ie6.js} +1 -1
- package/dist/client/assets/{ComputerViewer-BA-9lBBN.js → ComputerViewer-D7tPmpY5.js} +1 -1
- package/dist/client/assets/{ConnectionAccessLists-BLLpxhn3.js → ConnectionAccessLists-D6VH1vX3.js} +1 -1
- package/dist/client/assets/{ConnectionsPage-BWVfAPd1.js → ConnectionsPage-7x5olD9q.js} +2 -2
- package/dist/client/assets/{ConventionPage-EK3WUWVa.js → ConventionPage-BTYLWw6p.js} +1 -1
- package/dist/client/assets/{ExtensionPageRoute-C9hsJNX2.js → ExtensionPageRoute-A9AdBBbw.js} +2 -2
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-BeyAgBfh.js → FloatingTanStackRouterDevtools-CqogiFob-ayv0yz1C.js} +1 -1
- package/dist/client/assets/HandlePage-BdRWgke2.js +1 -0
- package/dist/client/assets/{HeartbeatPage-DfbNenFv.js → HeartbeatPage-Dh6W9Qg5.js} +1 -1
- package/dist/client/assets/KeyEntry-owhPGtw3.js +1 -0
- package/dist/client/assets/{LexicalField-DC_6Z-Ye.js → LexicalField-B1NFMLD6.js} +2 -2
- package/dist/client/assets/{ManagesPage-CYnGvNM2.js → ManagesPage-BAnBmBdo.js} +1 -1
- package/dist/client/assets/{Marketplace-CWiiq8of.js → Marketplace-67maxdwz.js} +2 -2
- package/dist/client/assets/{MarketplaceSourcesView-DF3cHMR0.js → MarketplaceSourcesView-CzPBNJJj.js} +1 -1
- package/dist/client/assets/{McpAppFrame-D5Muf5Sf.js → McpAppFrame-CuObpQTg.js} +2 -2
- package/dist/client/assets/McpSigninBody-B-ayj6bQ.js +1 -0
- package/dist/client/assets/{Model3dViewer-C9ODHy5I.js → Model3dViewer-DRVqxazk.js} +1 -1
- package/dist/client/assets/NamePage-DyH8JAqT.js +1 -0
- package/dist/client/assets/NewDirectMessageMenu-B3DxayR2.js +1 -0
- package/dist/client/assets/{NotificationsPage-ldulSpVu.js → NotificationsPage-BavEo7VZ.js} +1 -1
- package/dist/client/assets/{OpenMeshSwitch-BfEvR7s7.js → OpenMeshSwitch-BwkX2Toa.js} +2 -2
- package/dist/client/assets/{OperatorIdentityForm-ZM_zDnjM.js → OperatorIdentityForm-CtWgz2yi.js} +1 -1
- package/dist/client/assets/{PermissionHistory-liL_pJDR.js → PermissionHistory-DvM0F2bS.js} +1 -1
- package/dist/client/assets/{PermissionsPage-DFMjDQby.js → PermissionsPage-D1DJHezV.js} +1 -1
- package/dist/client/assets/{PersonalityPopover-CITFG0_N.js → PersonalityPopover-BV-9wfIl.js} +1 -1
- package/dist/client/assets/PhotoPage-BHvRQnex.js +1 -0
- package/dist/client/assets/{PresetPicker-CpYu7nb6.js → PresetPicker-BOQKgYAK.js} +2 -2
- package/dist/client/assets/{PreviewRefusedNotice-CF3bzfSe.js → PreviewRefusedNotice-BdhUln2h.js} +1 -1
- package/dist/client/assets/{ProfileFields-D4p6bhIa.js → ProfileFields-DFRnRR38.js} +1 -1
- package/dist/client/assets/{ProfilePanelContainer-XCuCnd1t.js → ProfilePanelContainer-CkxX9Dps.js} +1 -1
- package/dist/client/assets/{ProfileRolePicker-qRf3DSdk.js → ProfileRolePicker-BSYi_luB.js} +1 -1
- package/dist/client/assets/PromptSuggestionChips-r08GqBH1.js +1 -0
- package/dist/client/assets/{ReportsToPopover-Cu-Cnzij.js → ReportsToPopover-BcsM5Eia.js} +1 -1
- package/dist/client/assets/{RoomSurface-CsAifwp2.js → RoomSurface-DaRCf4og.js} +7 -7
- package/dist/client/assets/{RoomsPage-DZYMR2in.js → RoomsPage-CQqsdVvB.js} +1 -1
- package/dist/client/assets/RunsOnPopover-DFb4xEhP.js +1 -0
- package/dist/client/assets/RuntimeConnectFlow-pKFJlNSJ.js +1 -0
- package/dist/client/assets/RuntimeSetupDialog-DvBJbrmj.js +1 -0
- package/dist/client/assets/{SessionsPage-thndqcpY.js → SessionsPage-CGgnEPh7.js} +1 -1
- package/dist/client/assets/SettingsDialog-D0cmzjrH.js +12 -0
- package/dist/client/assets/{SkillsPage-CmXyAw3J.js → SkillsPage-DDoPlsn2.js} +1 -1
- package/dist/client/assets/TaskDialogWrapper-DoIVzbKU.js +1 -0
- package/dist/client/assets/TasksEmptyState-B68O6dnT.js +3 -0
- package/dist/client/assets/{TasksPage-DGNXrDAk.js → TasksPage-BsBDphim.js} +1 -1
- package/dist/client/assets/{TeamComputerEntry-CIfFRo6-.js → TeamComputerEntry-CoQ4EsDm.js} +1 -1
- package/dist/client/assets/{ToolsPage-BKZkSarf.js → ToolsPage-Cl1aOpev.js} +2 -2
- package/dist/client/assets/{TopologyGraph-og2tlLj7.js → TopologyGraph-D3CxaLGX.js} +2 -2
- package/dist/client/assets/TourHost-4O6TJzc-.js +1 -0
- package/dist/client/assets/{UnlinkDialog-BTYC_Sit.js → UnlinkDialog-DIMY60Fi.js} +1 -1
- package/dist/client/assets/WidgetErrorCard-CzWw_SPD.js +108 -0
- package/dist/client/assets/_shell-BRH2Y-U-.js +80 -0
- package/dist/client/assets/{_shell._home-CP7HQ7Cs.js → _shell._home-DG3Vw7S5.js} +1 -1
- package/dist/client/assets/_shell._home.activity-COI96oAO.js +1 -0
- package/dist/client/assets/_shell._home.index-CTwsTjcQ.js +3 -0
- package/dist/client/assets/_shell._home.tasks-DOVoPYaf.js +1 -0
- package/dist/client/assets/{_shell._home.workspaces-Cdsw2-jI.js → _shell._home.workspaces-ApZhnjwy.js} +1 -1
- package/dist/client/assets/_shell.channels-CRkJHU5R.js +10 -0
- package/dist/client/assets/{_shell.connections-sF5vS-Lm.js → _shell.connections-bhAK3jnE.js} +1 -1
- package/dist/client/assets/{_shell.feedback-requests-hu21WXyA.js → _shell.feedback-requests-k43R8-rW.js} +2 -2
- package/dist/client/assets/_shell.marketplace-DGN_IdZY.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-2YMpLInp.js +1 -0
- package/dist/client/assets/_shell.session-D871zZl3.js +61 -0
- package/dist/client/assets/{_shell.team-raG7wRwF.js → _shell.team-DHCM1QoO.js} +6 -6
- package/dist/client/assets/_shell.x._extensionId-D3-n5IRW.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-D3-n5IRW.js +1 -0
- package/dist/client/assets/{access-copy-CcG3wpsK.js → access-copy-BVzi1REx.js} +1 -1
- package/dist/client/assets/{banner-nt7EFLr6.js → banner-3xXXsU5J.js} +2 -2
- package/dist/client/assets/{card-B_zeSZiU.js → card-Bt6IU-Bh.js} +1 -1
- package/dist/client/assets/{command-CDfYcQI6.js → command-CWokzKS1.js} +1 -1
- package/dist/client/assets/{cpu-D861493C.js → cpu-BzByzE9V.js} +1 -1
- package/dist/client/assets/{empty-state-CQ1oXLFa.js → empty-state-BgnQDiMZ.js} +1 -1
- package/dist/client/assets/{execution-config-on8kVvnW.js → execution-config-D5-SEt2t.js} +1 -1
- package/dist/client/assets/{file-Bwo21EVR.js → file-VHDTQub2.js} +1 -1
- package/dist/client/assets/{file-exclamation-point-BedYLbs2.js → file-exclamation-point-DbWvGys0.js} +1 -1
- package/dist/client/assets/{file-text-BTj3WyHS.js → file-text-BAhi2zct.js} +1 -1
- package/dist/client/assets/{find-latest-widget-fence-B8fM5rIs.js → find-latest-widget-fence-Z0HPVqeK.js} +2 -2
- package/dist/client/assets/{form-lSBktWDn.js → form-Blrb1xBU.js} +1 -1
- package/dist/client/assets/{format-cron-W7G0In8e.js → format-cron-lKWqEmle.js} +1 -1
- package/dist/client/assets/{git-branch-CKlZ81Bg.js → git-branch-BObm8Rlz.js} +1 -1
- package/dist/client/assets/{heart-BSVjeGLA.js → heart-Du7nuefC.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-Ct8vmPkj.js → highlighted-body-KPVGNVTW-B_GO7V1P.js} +1 -1
- package/dist/client/assets/image-lightbox-BZ1TV3mN.js +1 -0
- package/dist/client/assets/image-off-hnjcBIzN.js +6 -0
- package/dist/client/assets/{index-6pYWHTBx.js → index-1I8qHZDt.js} +1 -1
- package/dist/client/assets/{index-CeZ13dpH.js → index-4GC2fkeO.js} +1 -1
- package/dist/client/assets/index-4PAAWURd.js +1 -0
- package/dist/client/assets/{index-CaKe9EaL.js → index-B0tAedq7.js} +1 -1
- package/dist/client/assets/{index-BVedye9r.js → index-BP68J4pb.js} +1 -1
- package/dist/client/assets/{index-gbNK9zj5.js → index-BUOcbPfv.js} +3 -3
- package/dist/client/assets/{index-DShrfGYE.js → index-BVKXIbLh.js} +1 -1
- package/dist/client/assets/{index-CeeHkxIC.js → index-BaRQVgiN.js} +1 -1
- package/dist/client/assets/{index-B-C_A3lP.js → index-BeVbHOwX.js} +2 -2
- package/dist/client/assets/{index-KaSZDcGa.js → index-BgzgdvDn.js} +1 -1
- package/dist/client/assets/{index-C0TknRcB.js → index-Bm0z9mHt.js} +1 -1
- package/dist/client/assets/{index-bvqpTKLz.js → index-BnNTKsbt.js} +1 -1
- package/dist/client/assets/{index-DjI5vH_U.js → index-BtbZpz4b.js} +1 -1
- package/dist/client/assets/{index-D7kjWnlR.js → index-BvjuGXcS.js} +1 -1
- package/dist/client/assets/{index-7Fd_Eeda.js → index-C60RrnTd.js} +1 -1
- package/dist/client/assets/{index-CQrM6oF9.js → index-CBm3whA-.js} +1 -1
- package/dist/client/assets/{index-C96eZrOR.js → index-CCg7yRe1.js} +1 -1
- package/dist/client/assets/{index-Dh8D-3Sb.js → index-CQCN6kWR.js} +1 -1
- package/dist/client/assets/index-Cdyszxoa.js +17 -0
- package/dist/client/assets/index-Ch-ON5gw.js +1 -0
- package/dist/client/assets/{index-UNxDevG6.js → index-Ci74HAFs.js} +1 -1
- package/dist/client/assets/{index-Dq4bx2np.js → index-CiQxS4Bn.js} +1 -1
- package/dist/client/assets/{index-DEOzZEcu.js → index-CqoIjNC2.js} +3 -3
- package/dist/client/assets/index-CrflCTqO.css +1 -0
- package/dist/client/assets/index-D5TZCu8j.js +1 -0
- package/dist/client/assets/{index-CNnnXzI4.js → index-D6y4WeTi.js} +1 -1
- package/dist/client/assets/{index-BjTJ6p2k.js → index-DB8TDRSm.js} +1 -1
- package/dist/client/assets/index-DCOOlbEt.js +1 -0
- package/dist/client/assets/index-DHYvT3nr.js +23 -0
- package/dist/client/assets/{index-GINKfP45.js → index-DRea_Gi0.js} +1 -1
- package/dist/client/assets/index-Dain_3cO.js +1 -0
- package/dist/client/assets/index-Dc5cpBoO.js +1023 -0
- package/dist/client/assets/{index-DOuj--Yi.js → index-Df7a-2P5.js} +1 -1
- package/dist/client/assets/{index-BHt5KOZA.js → index-DkhM0fDi.js} +1 -1
- package/dist/client/assets/{index-CCWSicoJ.js → index-DoMJUxt_.js} +1 -1
- package/dist/client/assets/{index-09EqfhW0.js → index-EZHlD3gf.js} +1 -1
- package/dist/client/assets/{index-SdTS2P3x.js → index-HxT_wkaZ.js} +1 -1
- package/dist/client/assets/{index-RFknyjho.js → index-Lh82Rz5C.js} +1 -1
- package/dist/client/assets/{index-DgRqCuFH.js → index-WxtASL5_.js} +1 -1
- package/dist/client/assets/{index-CF73kwtO.js → index-_5Dn0bFm.js} +17 -17
- package/dist/client/assets/{index-V_EcsvR4.js → index-aXm0xP_2.js} +1 -1
- package/dist/client/assets/{index-DeNVXdMl.js → index-ox3ce99A.js} +1 -1
- package/dist/client/assets/{index-BdrbKBym.js → index-r_O6CmXY.js} +1 -1
- package/dist/client/assets/index.esm-DXsF3Bua.js +41 -0
- package/dist/client/assets/{inline-code-Beal0546.js → inline-code-DAEoWvTf.js} +1 -1
- package/dist/client/assets/{layers-DUfQMkMa.js → layers-CsM34LRv.js} +1 -1
- package/dist/client/assets/{lightbulb-DTSn-mNB.js → lightbulb-B8JAixK_.js} +1 -1
- package/dist/client/assets/{link-2-CHr2s4m2.js → link-2-Csc6okl3.js} +1 -1
- package/dist/client/assets/{list-runtime-types-CwEp9Lg4.js → list-runtime-types-DQrZNB7x.js} +1 -1
- package/dist/client/assets/markdown-content-DPc7aD1j.js +1 -0
- package/dist/client/assets/{mention-pill-XE9mX9G8.js → mention-pill-8P_w4muj.js} +1 -1
- package/dist/client/assets/{message-square-off-DUkKSITA.js → message-square-off-D5DXu2cY.js} +1 -1
- package/dist/client/assets/{more-details-3dDtVYc6.js → more-details-DEeu2M-p.js} +1 -1
- package/dist/client/assets/{owner-notice-BKmuWRki.js → owner-notice-BW4k1ycg.js} +1 -1
- package/dist/client/assets/{package-DM7e-GVa.js → package-BSwwAFVm.js} +1 -1
- package/dist/client/assets/{page-container-nGewlFnj.js → page-container-CjPUNtNw.js} +1 -1
- package/dist/client/assets/{paperclip-BgXlvBBI.js → paperclip-DQaRz34E.js} +1 -1
- package/dist/client/assets/{path-input-RzOiTE45.js → path-input-CgXSYNZn.js} +1 -1
- package/dist/client/assets/plug-BaUXMfIl.js +11 -0
- package/dist/client/assets/primer-trigger-DHB0vilf.js +3 -0
- package/dist/client/assets/{profile-errors-CFZN0y6a.js → profile-errors-JW2XTgia.js} +1 -1
- package/dist/client/assets/{progress-Cvnh4Qcr.js → progress-CErAw8zp.js} +1 -1
- package/dist/client/assets/{query-error-state-CfJfYpa3.js → query-error-state-BFWpEXsl.js} +1 -1
- package/dist/client/assets/{radio-BOcAjXVO.js → radio-Bkx216ga.js} +1 -1
- package/dist/client/assets/registry-Ce1VRIS3.js +1 -0
- package/dist/client/assets/{relay-trace-schemas-Cvb7RGjg.js → relay-trace-schemas-DiZj_AFV.js} +2 -2
- package/dist/client/assets/{room-files-source-B-ZJA_NM.js → room-files-source-BilZvdpf.js} +2 -2
- package/dist/client/assets/{rotate-ccw-clock-vRQP4hWE.js → rotate-ccw-clock-D_SO1stN.js} +1 -1
- package/dist/client/assets/{rotate-cw-DD2nOAQ-.js → rotate-cw-C68kM23F.js} +1 -1
- package/dist/client/assets/{scroll-area-DTvv8_DS.js → scroll-area-CVWFUmJV.js} +1 -1
- package/dist/client/assets/{search-x-Ig8nk-DU.js → search-x-BTFVvyA2.js} +1 -1
- package/dist/client/assets/{shield-check-DjnWx7aT.js → shield-check-Dpxi6WqO.js} +1 -1
- package/dist/client/assets/{shield-x-BrtccpM7.js → shield-x-CdCCgyXk.js} +1 -1
- package/dist/client/assets/signed-in-BxAnDo0S.js +1 -0
- package/dist/client/assets/{soul-file-C5mMIP4v.js → soul-file-CRfKVJX3.js} +1 -1
- package/dist/client/assets/{table-Rll_Jxd8.js → table-BL3xUC41.js} +1 -1
- package/dist/client/assets/{terminal-Bjss9oke.js → terminal-u_UCRzSM.js} +1 -1
- package/dist/client/assets/{trust-posture-Dmk2WlZv.js → trust-posture-B-v4BWo7.js} +1 -1
- package/dist/client/assets/{unplug-BHYMc4ND.js → unplug-CFbC-L5W.js} +1 -1
- package/dist/client/assets/{unverified-catalog-notice-BmIVQhjE.js → unverified-catalog-notice-ZUqscVFM.js} +1 -1
- package/dist/client/assets/{use-adapter-catalog-RzlxX2Wa.js → use-adapter-catalog-Z4MDWZAZ.js} +1 -1
- package/dist/client/assets/{use-bindings-Ds_MAC67.js → use-bindings-CsTavmf-.js} +1 -1
- package/dist/client/assets/{use-composer-prefs-ckA_eZQS.js → use-composer-prefs-BY2dTvep.js} +1 -1
- package/dist/client/assets/{use-connector-management-oEqok0QG.js → use-connector-management-L9l21yTi.js} +1 -1
- package/dist/client/assets/{use-deep-link-scroll-Clu9Sz2-.js → use-deep-link-scroll-Bn2ZUtDY.js} +1 -1
- package/dist/client/assets/{use-delete-binding-B_zHPcy8.js → use-delete-binding-DLvdHtPD.js} +1 -1
- package/dist/client/assets/{use-dev-links-BO7-IHe9.js → use-dev-links-DFvL8mIg.js} +1 -1
- package/dist/client/assets/{use-external-adapter-catalog-7lRWtn7J.js → use-external-adapter-catalog-Be57G4tz.js} +1 -1
- package/dist/client/assets/{use-full-activity-feed-DrcMJL9m.js → use-full-activity-feed-Cp3lYXdi.js} +1 -1
- package/dist/client/assets/use-is-below-desktop-DmekpHAF.js +1 -0
- package/dist/client/assets/use-is-hub-el7LTkg3.js +1 -0
- package/dist/client/assets/{use-jump-back-in-Dav0ttfs.js → use-jump-back-in-ChH1FSEK.js} +3 -3
- package/dist/client/assets/{use-local-browser-CtltDlof.js → use-local-browser-zA8gMhcC.js} +1 -1
- package/dist/client/assets/{use-mesh-topology-CiS9XQsg.js → use-mesh-topology-CvoD-L1G.js} +1 -1
- package/dist/client/assets/{use-mounted-ref-DuK0vm9N.js → use-mounted-ref-Ch0wqQry.js} +1 -1
- package/dist/client/assets/{use-notification-prefs-Chf4UNbq.js → use-notification-prefs-DeR05zhp.js} +1 -1
- package/dist/client/assets/{use-panel-tab-placements-C5y831aL.js → use-panel-tab-placements-DdjrmaoK.js} +1 -1
- package/dist/client/assets/use-pending-read-DBpte0GI.js +1 -0
- package/dist/client/assets/use-personality-commit-qQfISO2-.js +1 -0
- package/dist/client/assets/use-promo-activation-CwGoE7b-.js +11 -0
- package/dist/client/assets/{use-promo-dismissals-8-hGry_v.js → use-promo-dismissals-BBqVN4hx.js} +1 -1
- package/dist/client/assets/{use-pulse-freshness-CWudgqNc.js → use-pulse-freshness-BKW7tjvX.js} +1 -1
- package/dist/client/assets/{use-relay-config-8mXfegbP.js → use-relay-config-D5iieBXl.js} +1 -1
- package/dist/client/assets/{use-room-follow-claim-DgEWUsoP.js → use-room-follow-claim-BwZh2ZPH.js} +1 -1
- package/dist/client/assets/{use-roving-tab-list-CXy0Hv5J.js → use-roving-tab-list-Ct7yDAUE.js} +1 -1
- package/dist/client/assets/use-session-canvas-CJrfZrYG.js +24 -0
- package/dist/client/assets/{use-session-diagnostics-LKiXub1H.js → use-session-diagnostics-Dn-Wnyhh.js} +4 -4
- package/dist/client/assets/{use-unclaimed-chats-Cr812OTh.js → use-unclaimed-chats-M-c5tjXH.js} +1 -1
- package/dist/client/assets/use-update-config-DhlbZldm.js +1 -0
- package/dist/client/assets/{useMutationState-BnXJ-0A_.js → useMutationState-Cd-VqRAv.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/drizzle/20261017113300_session_public_computer.sql +1 -0
- package/dist/drizzle/meta/20261017113300_snapshot.json +14020 -0
- package/dist/drizzle/meta/_journal.json +7 -0
- package/dist/server/index.js +128843 -121508
- package/dist/server/index.js.map +2 -2
- package/package.json +5 -5
- package/dist/client/assets/AdapterSetupWizard-DfNJz5SD.js +0 -2
- package/dist/client/assets/AppearancePage-8ALtWGZZ.js +0 -1
- package/dist/client/assets/AttentionSignalRow-c-u1cE1l.js +0 -1
- package/dist/client/assets/CanvasFileContent-BJ39nHuR.js +0 -2
- package/dist/client/assets/CanvasModel3dContent-TaunlbT2.js +0 -2
- package/dist/client/assets/HandlePage-CfeEzfDk.js +0 -1
- package/dist/client/assets/KeyEntry-CEbe5Xvn.js +0 -6
- package/dist/client/assets/McpSigninBody-CLZFoQgC.js +0 -1
- package/dist/client/assets/NamePage-B4YrH-ug.js +0 -1
- package/dist/client/assets/NewDirectMessageMenu-Co9Uv5t5.js +0 -1
- package/dist/client/assets/PhotoPage-DYDJPBfu.js +0 -1
- package/dist/client/assets/PromptSuggestionChips-CUwLk83h.js +0 -1
- package/dist/client/assets/RunsOnPopover-CTBEMstG.js +0 -1
- package/dist/client/assets/RuntimeConnectFlow-DY4sjRgN.js +0 -1
- package/dist/client/assets/RuntimeSetupDialog-DJu_-eNa.js +0 -1
- package/dist/client/assets/SettingsDialog-CKmcLF66.js +0 -12
- package/dist/client/assets/TaskDialogWrapper-Boxr_hgF.js +0 -1
- package/dist/client/assets/TasksEmptyState-CQf1YroK.js +0 -3
- package/dist/client/assets/TourHost-DzEG8bZP.js +0 -1
- package/dist/client/assets/WidgetErrorCard-CT4sl_T6.js +0 -108
- package/dist/client/assets/_shell-BDlkTSin.js +0 -90
- package/dist/client/assets/_shell._home.activity-DGXa_ouh.js +0 -1
- package/dist/client/assets/_shell._home.index-D5kOfqnL.js +0 -3
- package/dist/client/assets/_shell._home.tasks-BSMD-atB.js +0 -1
- package/dist/client/assets/_shell.channels-B4VQ7tiZ.js +0 -10
- package/dist/client/assets/_shell.marketplace-B-T-ALMv.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-Chu-9-Vi.js +0 -1
- package/dist/client/assets/_shell.session-Bz6wvDBp.js +0 -66
- package/dist/client/assets/_shell.x._extensionId-DSqMu6Ey.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-DSqMu6Ey.js +0 -1
- package/dist/client/assets/index-BDCqg2iM.css +0 -1
- package/dist/client/assets/index-C8-dwIPp.js +0 -1018
- package/dist/client/assets/index-CAv_6Po4.js +0 -1
- package/dist/client/assets/index-ClELcMX1.js +0 -1
- package/dist/client/assets/index-CrEyJcPM.js +0 -17
- package/dist/client/assets/index-DQJM5kjJ.js +0 -1
- package/dist/client/assets/index-DURo45pu.js +0 -1
- package/dist/client/assets/index-sfSRuIXm.js +0 -23
- package/dist/client/assets/markdown-content-GoymYcRL.js +0 -1
- package/dist/client/assets/primer-trigger-B60oEVY7.js +0 -3
- package/dist/client/assets/registry-B9wsS5De.js +0 -1
- package/dist/client/assets/use-is-below-desktop-BhzXZsbH.js +0 -1
- package/dist/client/assets/use-pending-read-i6TB4gGQ.js +0 -1
- package/dist/client/assets/use-personality-commit-KKJ2ve1V.js +0 -1
- package/dist/client/assets/use-promo-activation-D45fuXdT.js +0 -11
- package/dist/client/assets/use-session-canvas-CUvHGgMf.js +0 -64
- package/dist/client/assets/use-update-config-Bad4g6mB.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o,
|
|
1
|
+
import{j as o,cC as t}from"./index-Dc5cpBoO.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c4 as R,cD as D,r as l,iu as C,iv as V,j as e,bx as G,ar as g,B as M,X as Y,G as x,A as j,eJ as K,eK as k,_ as W,e as v,x as q,a1 as z,a2 as U,iw as X,eF as J,ix as Q,dI as Z}from"./index-Dc5cpBoO.js";import{P as ee}from"./page-container-CjPUNtNw.js";import{g as te,A as se,a as ne,b as ie}from"./ActivityErrorState-DlROxqde.js";import{u as ae}from"./use-full-activity-feed-Cp3lYXdi.js";import{C as A,A as re}from"./ActivityRow-B5yiD_uD.js";import{T as P,a as _,b as oe,c as p}from"./table-BL3xUC41.js";import{E as b}from"./empty-state-BgnQDiMZ.js";const S=["categories","actorType","actorId","since"];function w(){const s=R(),n=D({strict:!1}),t={categories:n.categories,actorType:n.actorType,actorId:n.actorId,since:n.since},i=S.some(c=>n[c]!==void 0),a={};t.categories&&(a.categories=t.categories),t.actorType&&(a.actorType=t.actorType),t.actorId&&(a.actorId=t.actorId),t.since&&(a.since=t.since);const r=l.useCallback(c=>{s({search:c})},[s]),o=l.useCallback(c=>{r(f=>{const y=f.categories?f.categories.split(","):[],N=y.includes(c)?y.filter(O=>O!==c):[...y,c];return{...f,categories:N.length>0?N.join(","):void 0}})},[r]),d=l.useCallback(c=>{r(f=>({...f,actorType:c}))},[r]),m=l.useCallback(c=>{r(f=>({...f,actorId:c}))},[r]),u=l.useCallback(c=>{r(f=>({...f,since:c}))},[r]),h=l.useCallback(()=>{r(c=>{const f={...c};for(const y of S)delete f[y];return f})},[r]);return{filters:t,queryFilters:a,isFiltered:i,toggleCategory:o,setActorType:d,setActorId:m,setSince:u,clearAll:h}}function ce(){const s=R(),t=D({strict:!1}).view==="all"?"all":"activity",i=l.useCallback(a=>{s({search:(r=>({...r,view:a==="all"?"all":void 0}))})},[s]);return{view:t,setView:i}}function 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"],L="group inline-flex min-h-11 shrink-0 items-center outline-none md:min-h-0",$="inline-flex h-6 items-center rounded-full px-2.5 text-xs font-medium transition-colors group-focus-visible:ring-ring group-focus-visible:ring-2 group-focus-visible:ring-offset-1";function 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:L,children:e.jsx("span",{className:x($,n?x(i.bg,i.text):"text-muted-foreground group-hover:bg-muted group-hover:text-foreground"),children:i.label})})}function he({isActive:s,onClick:n}){return e.jsx(g.button,{type:"button",layout:!0,onClick:n,"aria-pressed":s,transition:{duration:.15},className:L,children:e.jsx("span",{className:x($,s?"bg-foreground text-background":"text-muted-foreground group-hover:bg-muted group-hover:text-foreground"),children:"All"})})}function xe({className:s}){const{filters:n,isFiltered:t,toggleCategory:i,clearAll:a}=w(),r=l.useRef(null),o=V(r,"horizontal"),d=new Set(n.categories?n.categories.split(","):[]),m=()=>{t&&a()};return e.jsxs("div",{className:x("relative",s),children:[e.jsxs("div",{ref:r,onScroll:o.onScroll,"data-slot":"activity-filter-bar",className:"flex items-center gap-1 overflow-x-auto",children:[e.jsx(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(M,{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 fe({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:x("w-fit shrink-0",t),value:s,onValueChange:i=>n(i),children:[e.jsx(k,{value:"activity",children:"Activity"}),e.jsx(k,{value:"all",children:"All actions"})]})}function 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:x("rounded-lg border px-4 py-3","bg-card border-border",t),children:[e.jsxs("p",{className:"text-muted-foreground text-xs",children:[e.jsx("span",{className:"text-foreground font-medium",children:"Since your last visit"})," ",e.jsxs("span",{children:["(",r,")"]})]}),e.jsx("p",{className:"text-foreground/80 mt-0.5 text-sm",children:o}),e.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:Object.keys(i).map(d=>{const m=i[d];if(!m)return null;const u=A[d];return e.jsxs(W,{shape:"pill",className:x("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(_,{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:x(o),children:e.jsx(Ne,{})}):t&&s.length===0?e.jsx("div",{"data-slot":"activity-timeline",className:x(o),children:e.jsx(se,{onRetry:i})}):s.length===0?e.jsx("div",{"data-slot":"activity-timeline",className:x(o),children:e.jsx(fe,{isFiltered:a,view:r})}):e.jsx("div",{ref:m,onKeyDown:u,"data-slot":"activity-timeline",className:x(o),children:d.map(h=>e.jsxs("section",{children:[e.jsx(ne,{label:h.label}),e.jsx(g.div,{variants:Ae,initial:"initial",animate:"animate",children:e.jsx(P,{children:e.jsx(_,{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:x("flex justify-center py-4",i),children:e.jsxs(M,{variant:"outline",size:"sm",onClick:s,disabled:n,className:"gap-2",children:[n&&e.jsx(q,{size:"xs"}),"Load 50 more events"]})}):null}const T=7;function 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:x("text-muted-foreground",n),"aria-hidden":"true",children:s.map((i,a)=>{const r=i/t*E;return e.jsx("rect",{x:a*(I+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=J("dashboard.sections"),t=l.useMemo(()=>n.filter(i=>Q(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(xe,{className:"min-w-0 flex-1"})]}),e.jsx(Ie,{}),e.jsx(Ee,{}),s==="all"?e.jsx(De,{}):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 De(){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};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{k5 as be,k6 as ye,j as t,hi as F,hj as $,hk as L,hl as q,hm as B,_ as I,ay as A,O as ke,Q as Se,C as Ne,U as we,k7 as z,B as b,k8 as Re,k9 as Ce,c4 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,dx as Oe,aW as Me,X as oe,kb as Te,kc as Ee,aN as Fe,dy as ie,iv as $e,bx as G,ar as R,T as Le,kd as qe,ke as Be,kf as ze,eb as We,ec as He,kg as _e,kh as Ue,ki as Ke,kj as Ge,e5 as ae,e7 as Ve,kk as Qe,cD as re,ad as Ye,e8 as Je,kl as Xe,l as le,km as de,kn as ce,io as Ze,ko as _,e6 as et,bd as tt,aZ as st,h9 as nt,f5 as ot,kp as it,as as at,kq as ue,g as rt,eM as me,kr as V,ai as Q,ks as lt,kt as dt,ku as ct,kv as ut,a1 as mt,kw as ht,eL as gt,bO as ft,iF as pt,bk as xt,hy as jt,eh as M,jM as vt,q as Y,dI as bt,jj as yt,kx as kt,n as St}from"./index-Dc5cpBoO.js";import{I as Nt,i as wt,a as Rt}from"./RoomSurface-DaRCf4og.js";import{u as Ct}from"./index-DHYvT3nr.js";import{P as he}from"./PromptSuggestionChips-r08GqBH1.js";import{S as U}from"./scroll-area-CVWFUmJV.js";import{d as It}from"./dead-letter-reasons-DtBHju9v.js";import{u as At}from"./use-mesh-topology-CvoD-L1G.js";import{A as Pt}from"./AttentionSignalRow-vBfioH1A.js";import{u as ge}from"./use-promo-dismissals-BBqVN4hx.js";import{u as Dt,s as Ot,P as Mt,a as Tt}from"./use-promo-activation-CwGoE7b-.js";import"./use-jump-back-in-ChH1FSEK.js";import"./use-room-follow-claim-BwZh2ZPH.js";import"./WidgetErrorCard-CzWw_SPD.js";import"./index-Ch-ON5gw.js";import"./card-Bt6IU-Bh.js";import"./progress-CErAw8zp.js";import"./markdown-content-DPc7aD1j.js";import"./table-BL3xUC41.js";import"./terminal-u_UCRzSM.js";import"./package-BSwwAFVm.js";import"./heart-Du7nuefC.js";import"./git-branch-BObm8Rlz.js";import"./file-text-BAhi2zct.js";import"./file-VHDTQub2.js";import"./find-latest-widget-fence-Z0HPVqeK.js";import"./format-duration-BCr6uzby.js";import"./RuntimeSetupDialog-DvBJbrmj.js";import"./inline-code-DAEoWvTf.js";import"./list-runtime-types-DQrZNB7x.js";import"./RuntimeConnectFlow-pKFJlNSJ.js";import"./useMutationState-Cd-VqRAv.js";import"./runtime-connect-Dn0T5YWv.js";import"./mention-pill-8P_w4muj.js";import"./rotate-ccw-clock-D_SO1stN.js";import"./unplug-CFbC-L5W.js";import"./message-square-off-D5DXu2cY.js";import"./registry-Ce1VRIS3.js";import"./use-connector-management-L9l21yTi.js";import"./AgentRequestCard-xX6fAKgO.js";import"./access-copy-BVzi1REx.js";import"./query-error-state-BFWpEXsl.js";import"./empty-state-BgnQDiMZ.js";import"./use-bindings-CsTavmf-.js";import"./connection-copy--MA7AN04.js";import"./KeyEntry-owhPGtw3.js";import"./file-drag-GDx2qhdk.js";import"./paperclip-DQaRz34E.js";import"./index-4GC2fkeO.js";import"./use-update-config-DhlbZldm.js";import"./use-relay-config-D5iieBXl.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(F,{open:e,onOpenChange:h=>!h&&o(),children:t.jsxs($,{side:"right",children:[t.jsxs(L,{children:[t.jsx(q,{children:"Messages that never arrived"}),t.jsx(B,{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 Ft(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 $t(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 qt({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?$t(s.status):null,g=h?Lt[h.tone]:null;return t.jsx(F,{open:e,onOpenChange:f=>!f&&o(),children:t.jsxs($,{side:"right",children:[t.jsxs(L,{children:[t.jsx(q,{children:(h==null?void 0:h.title)??"Run that needs a look"}),t.jsx(B,{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: ",Ft(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 Bt({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(F,{open:e,onOpenChange:i=>!i&&n(),children:t.jsxs($,{side:"right",children:[t.jsxs(L,{children:[t.jsx(q,{children:"Agents that aren’t answering"}),t.jsxs(B,{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(Bt,{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 Kt(){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 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(Fe,{"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]",Jt={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 J({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 X={animate:{transition:{staggerChildren:.04}}};function Xt(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=$e(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(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:Xt(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",...Jt,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(qe,{asks:n,agentNames:s,onOpenSession:i,emptyState:t.jsx("p",{className:"text-muted-foreground text-xs",children:"Nothing needs you"})}),e.length>0&&t.jsx(Be,{approvals:e}),e.length===0&&a&&t.jsx(ze,{onRetry:r}),t.jsx(G,{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:X,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:X,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(J,{edge:"top"}),S.end&&t.jsx(J,{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=Ke(),c=Ge(l),{schedules:h,errors:g,activity:f}=ae(),j=Ve(),x=fe(),{mutate:u}=Qe(),p=re({strict:!1}),v=W(),S=Ye(),N=Je(h),P=Xe(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:K=>{v(H({session:K}))},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(qt,{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(Kt,{})}):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=Ct(),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
|
+
`),[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"){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(Rt,{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 Mn=Ts;export{Mn as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{dC as k,r as i,dD as w,dE as C,dF as E,j as e,e as D,dG as o,dH as R,ar as x,B as M,cu as B,dI as _,bd as L,aZ as G,ct as H,b0 as z}from"./index-Dc5cpBoO.js";import{Q as K}from"./query-error-state-BFWpEXsl.js";import{P as F}from"./page-container-CjPUNtNw.js";import{F as Q,T as U,C as V}from"./TasksEmptyState-B68O6dnT.js";import{i as W}from"./registry-Ce1VRIS3.js";import{u as X,S as Z}from"./search-x-BTFVvyA2.js";import{S as $}from"./scroll-area-CVWFUmJV.js";import"./empty-state-BgnQDiMZ.js";import"./inline-code-DAEoWvTf.js";import"./form-Blrb1xBU.js";import"./command-CWokzKS1.js";import"./AgentPicker-BRyYVJZu.js";import"./AgentOptionRow-BeRqDo7c.js";import"./execution-config-D5-SEt2t.js";import"./settings-for-runtime-BoOa-ZFG.js";import"./list-runtime-types-DQrZNB7x.js";import"./format-cron-lKWqEmle.js";const q=8,J={visible:{transition:{staggerChildren:.04}},hidden:{}},Y={hidden:{opacity:0,y:8},visible:{opacity:1,y:0}};function ee({tasks:l,isLoading:c,agentMap:u,onEditTask:j,agentId:m}){const s=X(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(D,{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($,{className:"min-h-0 flex-1","data-testid":R.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(Z,{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:J,className:"space-y-2",children:h.map((t,g)=>e.jsx(x.div,{variants:g<q?Y: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}=G(l),[s,r]=i.useState(!1),[f,d]=i.useState(),[n,p]=i.useState(null),h=c.some(a=>a.agentId),{data:t}=H(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}=z(),[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)},I=a=>{d(a),r(!0)},O=a=>{r(a),a||p(null)};if(!l)return e.jsx(Q,{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(K,{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 P=c.length>0;return e.jsxs(e.Fragment,{children:[!P&&!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:I})})}),e.jsx(V,{open:s,onOpenChange:O,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,
|
|
1
|
+
import{a1 as j,a2 as g,r as f,j as e,dI as N,am as i,a0 as b,dJ as y,_ as u,b6 as w}from"./index-Dc5cpBoO.js";import{I as C}from"./inline-code-DAEoWvTf.js";import{T,d as v,b as p,e as c,a as S,c as d}from"./table-BL3xUC41.js";import{P as k}from"./page-container-CjPUNtNw.js";import{G as L}from"./git-branch-BObm8Rlz.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 Rt,r as m,j as t,gz as wt,a1 as ee,a3 as de,jg as ue,jh as V,ji as B,jj as St,c4 as Re,l as ge,a2 as bt,a4 as Te,jk as kt,jl as At,jm as Dt,jn as je,jo as ke,B as k,jp as Tt,ct as Et,jq as Ge,d$ as ce,dU as Mt,dV as Ot,dW as It,dX as $t,dY as Ut,I as We,g8 as Ve,gZ as Kt,g9 as Xe,ga as Ze,gb as et,gc as tt,gd as st,ge as nt,gf as _t,$ as Lt,jr as zt,iB as xe,cw as Ee,cx as Me,cz as Oe,cA as Ie,cB as $e,dw as Ue,dc as Ke,a7 as rt,js as Pt,jt as qt,hg as Ft,ju as Ht,jv as _e,jw as Yt,jx as Bt,jy as at,jz as Qt,jA as it,jB as ot,jC as Jt,dI as lt,jD as Gt,jE as Wt,jF as Vt,iP as Xt,a0 as Zt,e2 as es,fo as ts,jG as ss,cD as ct,jH as ns,jI as rs,ad as as,n as He}from"./index-Dc5cpBoO.js";import{T as is,R as os,a as ls}from"./RoomSurface-DaRCf4og.js";import{M as pe,C as Ne}from"./index-DHYvT3nr.js";import{M as cs}from"./markdown-content-DPc7aD1j.js";import{o as ds,a as us,c as ms}from"./owner-notice-BW4k1ycg.js";import"./use-jump-back-in-ChH1FSEK.js";import"./use-room-follow-claim-BwZh2ZPH.js";import"./WidgetErrorCard-CzWw_SPD.js";import"./index-Ch-ON5gw.js";import"./card-Bt6IU-Bh.js";import"./progress-CErAw8zp.js";import"./table-BL3xUC41.js";import"./terminal-u_UCRzSM.js";import"./package-BSwwAFVm.js";import"./heart-Du7nuefC.js";import"./git-branch-BObm8Rlz.js";import"./file-text-BAhi2zct.js";import"./file-VHDTQub2.js";import"./find-latest-widget-fence-Z0HPVqeK.js";import"./format-duration-BCr6uzby.js";import"./RuntimeSetupDialog-DvBJbrmj.js";import"./inline-code-DAEoWvTf.js";import"./list-runtime-types-DQrZNB7x.js";import"./RuntimeConnectFlow-pKFJlNSJ.js";import"./useMutationState-Cd-VqRAv.js";import"./runtime-connect-Dn0T5YWv.js";import"./mention-pill-8P_w4muj.js";import"./rotate-ccw-clock-D_SO1stN.js";import"./unplug-CFbC-L5W.js";import"./message-square-off-D5DXu2cY.js";import"./registry-Ce1VRIS3.js";import"./use-connector-management-L9l21yTi.js";import"./AgentRequestCard-xX6fAKgO.js";import"./access-copy-BVzi1REx.js";import"./query-error-state-BFWpEXsl.js";import"./empty-state-BgnQDiMZ.js";import"./use-bindings-CsTavmf-.js";import"./connection-copy--MA7AN04.js";import"./KeyEntry-owhPGtw3.js";import"./file-drag-GDx2qhdk.js";import"./paperclip-DQaRz34E.js";import"./index-4GC2fkeO.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 dt={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"}]]};dt.node;const fs=Rt(dt),ps=5e3;function hs({connection:e}){var d;const s=e.official===!0&&e.status==="connected"&&((d=e.access)==null?void 0:d.state)==="unverified",n=m.useMemo(()=>s?{}:null,[s]),[r,o]=m.useState(null);return m.useEffect(()=>{if(!n)return;const f=setTimeout(()=>o(n),ps);return()=>clearTimeout(f)},[n]),n===null||r!==n?null:t.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."})}const gs=500,ie=new Map;function ut(e,s){return e.id!==s.id||e.community!==s.community||e.roomId!==s.roomId||e.text===s.text&&e.authorDisplayName===s.authorDisplayName&&JSON.stringify(e.mentions)===JSON.stringify(s.mentions)&&JSON.stringify(e.attachments)===JSON.stringify(s.attachments)?e:{...e,text:s.text,mentions:s.mentions,attachments:s.attachments,authorDisplayName:s.authorDisplayName}}function De(e,s){if(s.size===0)return e;let n=!1;const r=e.map(o=>{const d=s.get(o.id),f=d?ut(o,d):o;return f!==o&&(n=!0),f});return n?r:e}function Ce(e,s,...n){const r=new Map;for(const o of n)for(const d of o){if(d.community!==e||d.roomId!==s)throw new Error("Community history contains a different room.");r.set(d.id,d)}return[...r.values()].sort((o,d)=>o.remoteSeq-d.remoteSeq)}function xs(e,s,n=!0,r=0,o="legacy",d=!1,f){const l=ee(),a=m.useRef(f);m.useEffect(()=>{a.current=f},[f]);const i=de(),h=ue(!0,o,e),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,e,s]),[N,C]=m.useState(()=>({address:u,room:null,entries:[],revisions:ie,deliveries:[],status:"connecting"}));return m.useEffect(()=>{if(!h||!n)return;const v=h,w=new AbortController;let x,O=0,A,z,F=!1;C({address:u,room:null,entries:[],revisions:ie,deliveries:[],status:"connecting"});function M(){F=!0,A=void 0,z=void 0,i.removeQueries({queryKey:B.remote(v,e)}),C({address:u,room:null,entries:[],revisions:ie,deliveries:[],status:"removed"})}async function q(){try{await l.subscribeRemoteCommunityRoom(e,s,j=>{var $;if(!(w.signal.aborted||F||!V(v))){if(j.type==="closed"){(j.reason==="removed"||j.reason==="revoked")&&M();return}if(O=0,j.type==="snapshot")A=j.cursor??void 0,j.redactionCursor&&(z=j.redactionCursor),i.setQueryData(B.room(v,e,s),j.room),C(y=>({address:u,room:j.room,entries:De(Ce(e,s,y.address===u?y.entries:[],j.entries).slice(-500),y.address===u?y.revisions:ie),revisions:y.address===u?y.revisions:ie,deliveries:y.deliveries.filter(g=>!j.entries.some(U=>U.originIdempotencyKey===g.idempotencyKey)),status:j.stale?"offline":"live"}));else if(j.type==="revision"){const y=j.entry;j.redactionCursor&&(z=j.redactionCursor);const g=[...B.room(v,e,s),"entries"],b=i.getQueriesData({queryKey:g}).some(([,S])=>S==null?void 0:S.pages.some(_=>_.entries.some(H=>H.id===y.id)))||i.isFetching({queryKey:g})>0||(($=a.current)==null?void 0:$.call(a,y.id))===!0;i.setQueriesData({queryKey:g},S=>{if(!S)return S;let _=!1;const H=S.pages.map(X=>{const re=X.entries.map(Z=>ut(Z,y));return re.some((Z,me)=>Z!==X.entries[me])?(_=!0,{...X,entries:re}):X});return _?{...S,pages:H}:S}),C(S=>{if(!b&&!S.entries.some(H=>H.id===y.id))return S;const _=new Map(S.revisions);for(_.delete(y.id),_.set(y.id,y);_.size>gs;)_.delete(_.keys().next().value);return{...S,entries:De(S.entries,_),revisions:_}})}else j.type==="deliveries"?C(y=>({...y,deliveries:j.deliveries.filter(g=>!y.entries.some(U=>U.originIdempotencyKey===g.idempotencyKey))})):(A=j.entry.cursor,C(y=>({...y,entries:Ce(e,s,y.entries,[j.entry]).slice(-500),deliveries:y.deliveries.filter(g=>g.idempotencyKey!==j.entry.originIdempotencyKey),status:"live"})))}},{since:A,redactions:z,signal:w.signal})}catch(j){if(w.signal.aborted||!V(v))return;const $=j&&typeof j=="object"&&"status"in j?j.status:void 0,y=j&&typeof j=="object"&&"code"in j?j.code:void 0;y==="COMMUNITY_DELETED"||y==="COMMUNITY_TAKEN_DOWN"?(M(),i.invalidateQueries({queryKey:B.connections(v)})):$===401||$===403||$===404?M():$===410&&y==="COMMUNITY_CURSOR_STALE"&&(A=void 0)}if(w.signal.aborted||F||!V(v))return;const K=i.getQueryData(B.room(v,e,s));K&&i.setQueryData(B.room(v,e,s),{...K,stale:!0,writable:!1}),C(j=>({...j,room:j.room?{...j.room,stale:!0,writable:!1}:null,status:"offline"})),x=setTimeout(()=>{q()},Math.min(3e4,1e3*2**Math.min(O++,5)))}return q(),()=>{w.abort(),clearTimeout(x)}},[u,e,s,n,r,i,l,h,d]),N.address!==u||!h?{address:u,room:null,entries:[],revisions:ie,deliveries:[],status:"connecting"}:n?N:d?{...N,room:N.room?{...N.room,stale:!0,writable:!1}:null,deliveries:[],status:"offline"}:{address:u,room:null,entries:[],revisions:ie,deliveries:[],status:"removed"}}function ys(e,s,n){var l;const r=St(),o=Re(),d=e!==void 0&&((l=r.room)==null?void 0:l.id)===e,f=r.status!=="loading";return m.useEffect(()=>{d&&o({...ge.home(),search:{...s===void 0?{}:{thread:s},...n===void 0?{}:{entry:n}},replace:!0})},[d,s,n,o]),e===void 0?"show":d?"redirecting":f?"show":"pending"}function vs(e){return e?{ownerAddress:JSON.stringify([e.ownerKey,e.epoch]),contextAddress:JSON.stringify([e.ownerKey,e.epoch,e.route.epoch,e.accessFingerprint])}:{ownerAddress:"",contextAddress:""}}const js=new Set(["COMMUNITY_MUTED","COMMUNITY_SLOW_MODE","COMMUNITY_RULES_NOT_ACCEPTED"]);function Ns(e){const s=e==null?void 0:e.code;return typeof s=="string"&&js.has(s)}function Cs(e,s=new Date){return e.kind==="muted"?`You’re muted here until ${kt(e.until,s)??"later"}.`:e.kind==="rules"?"Accept this space’s rules to post.":`Slow mode. Post again in ${e.secondsLeft}s.`}function Rs(e,s){if(!e)return null;if(e.mutedUntil&&Date.parse(e.mutedUntil)>s)return{kind:"muted",until:e.mutedUntil};const{rules:n}=e;return n.text!==null&&n.version>0&&n.acceptedVersion<n.version?{kind:"rules"}:null}function ws({community:e,roomId:s,enabled:n,accessFingerprint:r}){var F;const o=ee(),d=de(),f=ue(n,r,e),l=f?[...B.room(f,e,s),"standing"]:[...B.all,"owner","unresolved",e,"room",s,"standing"],a=bt({queryKey:l,queryFn:()=>At(f,()=>o.getRemoteCommunityStanding(e,s)),enabled:n&&f!==null,staleTime:3e4,retry:!1,refetchInterval:M=>{var q;return(q=M.state.data)!=null&&q.mutedUntil&&Date.parse(M.state.data.mutedUntil)>Date.now()?6e4:!1}}),[i,h]=m.useState(null),[u,N]=m.useState(()=>Date.now()),C=(F=a.data)!=null&&F.mutedUntil?Date.parse(a.data.mutedUntil):null;m.useEffect(()=>{if(i!==null&&i>u){const M=setTimeout(()=>N(Date.now()),1e3);return()=>clearTimeout(M)}if(C!==null&&C>u){const M=setTimeout(()=>N(Date.now()),Math.min(C-u+50,1073741824));return()=>clearTimeout(M)}},[C,u,i]);const v=a.refetch,w=m.useCallback(M=>{if((M==null?void 0:M.code)==="COMMUNITY_SLOW_MODE"){const K=M.retryAfterMs;if(typeof K=="number"&&K>0){const j=Date.now();N(j),h(j+K)}return}v()},[v]),x=Te({meta:{suppressErrorToast:!0},mutationFn:M=>o.acceptRemoteCommunityRules(e,M),onSuccess:M=>{d.setQueryData(l,q=>q&&{...q,rules:M})},onError:()=>void v()}),O=Rs(a.data,u),A=i===null?0:Math.ceil((i-u)/1e3),z=O??(A>0?{kind:"slow",secondsLeft:A}:null);return{standing:a.data,hold:z,noteHold:w,accept:x}}const Ss=new Set(["COMMUNITY_DELETED","COMMUNITY_TAKEN_DOWN"]),bs=30*6e4,he=new Map;function mt(e,s,n){return JSON.stringify([e,s,n])}function ft(e){return Date.now()-e<bs}function ks(e){for(const[s,n]of he)ft(n.at)||he.delete(s);return he.get(e)}function As(){return Date.now()}function Ds(e,s,n){he.set(e,{attachmentId:s,at:n})}function Ye(e){for(const s of e.files)he.delete(mt(e.ref,e.roomId,s.id))}function Be(e){return e.filter(s=>s.trim()).join(`
|
|
7
|
+
|
|
8
|
+
`)}function Ts(e){const s=e==null?void 0:e.code;return typeof s=="string"&&Ss.has(s)}function Ae(e){return e.map(({id:s,file:n})=>({id:s,file:n,status:"pending",progress:0}))}function Es({ref:e,roomId:s,canSend:n,entries:r,onReceipt:o,draft:d,ownerKey:f,contextKey:l=f,onHold:a}){const i=ee(),h=JSON.stringify([f,e,s,l]),u=Dt(d),N=u.text,C=m.useMemo(()=>Ae(u.files),[u.files]),v=m.useRef(d);m.useLayoutEffect(()=>{v.current=d},[d]);function w(c){const R=v.current;if(!R)return;const I=je.getState(),T=I.drafts[ke(R)],E=c({text:(T==null?void 0:T.text)??"",files:Ae((T==null?void 0:T.files)??[])});I.write(R,{text:E.text,files:E.files.map(({id:P,file:Q})=>({id:P,file:Q}))})}function x(c){w(R=>({...R,text:c}))}function O(c){w(R=>({...R,files:c(R.files)}))}const[A,z]=m.useState(null);function F(c){z(c===null?null:{address:h,context:l,message:c})}const[M,q]=m.useState([]),K=m.useRef(new Map),j=m.useRef(0),$=m.useRef(new Map),y=m.useRef(new Set),g=m.useRef(h),U=m.useRef(l),b=m.useRef(!0),S=m.useRef(n),_=m.useRef(o),H=m.useRef(a);m.useLayoutEffect(()=>{g.current=h,U.current=l,S.current=n,_.current=o,H.current=a},[h,n,l,o,a]),m.useEffect(()=>(b.current=!0,()=>{b.current=!1}),[]),m.useEffect(()=>{let c=!1;for(const R of r){if(!R.originIdempotencyKey)continue;const I=K.current.get(R.originIdempotencyKey);(I==null?void 0:I.address)===g.current&&I.context===U.current&&K.current.delete(R.originIdempotencyKey)&&(Ye(I),c=!0)}c&&q([...K.current.values()])},[r]);function X(){b.current&&q([...K.current.values()].filter(c=>c.address===g.current&&c.context===U.current).map(c=>({...c})))}async function re(c){var R,I;if(!(y.current.has(c.key)||!S.current||!b.current||c.address!==g.current)){y.current.add(c.key),c.status="sending",c.error=void 0,X();try{!c.posted&&c.uploadedAt.some(E=>!ft(E))&&(c.attachmentIds=[],c.uploadedAt=[],c.triedAt=[],c.uploadRound+=1);for(let E=c.attachmentIds.length;E<c.files.length;E++){if(!S.current||!b.current||c.address!==g.current)throw new Error("Reconnect to this channel, then try again.");const P=c.files[E],Q=mt(c.ref,c.roomId,P.id),J=ks(Q);if(J){c.attachmentIds.push(J.attachmentId),c.uploadedAt.push(J.at);continue}const te=(R=c.triedAt)[E]??(R[E]=As()),G=await i.uploadRemoteCommunityAttachment(c.ref,c.roomId,P.file,c.uploadRound?`${c.key}:file:${E}:${c.uploadRound}`:`${c.key}:file:${E}`);Ds(Q,G.id,te),c.uploadedAt.push(te),c.attachmentIds.push(G.id)}if(!S.current||!b.current||c.address!==g.current)throw new Error("Reconnect to this channel, then try again.");c.posted=!0;const T=await i.postRemoteCommunityEntry(c.ref,c.roomId,{text:c.text,parentEntryId:c.parentEntryId,attachmentIds:c.attachmentIds,idempotencyKey:c.key});K.current.delete(c.key),Ye(c),b.current&&c.address===g.current&&c.context===U.current&&_.current(T)}catch(T){if(Ts(T)&&Z(c)){K.current.delete(c.key);return}if(Ns(T)&&Z(c)){K.current.delete(c.key),b.current&&c.address===g.current&&((I=H.current)==null||I.call(H,T));return}c.status="failed",c.error=T instanceof Error?T.message:"Not confirmed. Try this message again."}finally{y.current.delete(c.key),X()}}}function Z(c){const{draft:R}=c.origin,I=ke(R),T=je.getState(),E=T.drafts[I],P=(E==null?void 0:E.text)??"";let Q=$.current.get(I)??[];const J=Be(Q.map(W=>W.origin.typed));let te=P;J&&P.startsWith(J)?te=P.slice(J.length).replace(/^\n+/,""):Q=[];const G=[...Q,c].sort((W,se)=>W.origin.seq-se.origin.seq),ye=new Set(G.flatMap(W=>W.files.map(se=>se.id))),ae=[...G.flatMap(W=>W.files.map(({id:se,file:fe})=>({id:se,file:fe}))),...((E==null?void 0:E.files)??[]).filter(W=>!ye.has(W.id))];return T.write(R,{text:Be([...G.map(W=>W.origin.typed),te]),files:ae}),I in je.getState().drafts?($.current.set(I,G),!0):!1}function me(c){const R=v.current;if(!R||!S.current)return;const I=je.getState(),T=I.drafts[ke(R)];if(!T||!T.text.trim()&&T.files.length===0)return;if(K.current.size>=30){F("Too many messages waiting. Let them send, or retry them first.");return}const E=I.take(R),P=Ae(E.files),Q={address:h,context:l,ref:e,roomId:s,key:crypto.randomUUID(),text:E.text.trim()?E.text:P.map(J=>J.file.name).join(", "),parentEntryId:c,files:P,attachmentIds:[],uploadedAt:[],triedAt:[],posted:!1,uploadRound:0,status:"sending",origin:{draft:R,typed:E.text,seq:j.current+=1}};K.current.set(Q.key,Q),F(null),re(Q)}return{text:N,setText:x,attachments:{staged:C,add(c){if(c.some(R=>R.size>25*1024*1024)){F("Each file must be 25 MB or smaller.");return}O(R=>R.length+c.length>8?(F("Attach up to eight files to one message."),R):[...R,...c.map(I=>({id:crypto.randomUUID(),file:I,status:"pending",progress:0}))])},remove(c){O(R=>R.filter(I=>I.id!==c))},retry(){},cancel(){O(()=>[])},hasFailed:!1,isUploading:!1,holdsSendWhileUploading:!1},deliveries:M.filter(c=>c.address===h&&c.context===l),error:(A==null?void 0:A.address)===h&&A.context===l?A.message:null,send:me,retry(c){const R=K.current.get(c);R&&re(R)}}}function pt({entry:e,onThread:s,onReport:n}){const r=ee(),o=m.useId(),[d,f]=m.useState(null),[l,a]=m.useState(null),i={id:JSON.stringify([e.community,e.authorId]),kind:e.authorKind,displayName:e.authorDisplayName};async function h(u,N){if(l)return;a(u),f(null);let C;try{const v=await r.downloadRemoteCommunityAttachment(e.community,e.roomId,u);C=URL.createObjectURL(v);const w=document.createElement("a");w.href=C,w.download=Array.from(N,x=>x==="/"||x==="\\"||x.charCodeAt(0)<32?"_":x).join(""),document.body.append(w),w.click(),w.remove()}catch(v){f(v instanceof Error?v.message:"Couldn’t download the file. Try again.")}finally{C&&setTimeout(()=>URL.revokeObjectURL(C),1e3),a(null)}}return t.jsxs(pe.Root,{role:e.authorKind==="human"?"user":"assistant","aria-labelledby":o,children:[t.jsx(pe.Gutter,{author:i,at:e.createdAt}),t.jsxs(pe.Body,{children:[t.jsx(pe.Author,{id:o,author:i,at:e.createdAt}),t.jsxs(pe.Content,{children:[t.jsx(cs,{content:e.text}),e.attachments.map(u=>t.jsx(k,{variant:"outline",size:"sm",disabled:l!==null,onClick:()=>void h(u.id,u.name),className:"max-w-full",children:t.jsx("span",{className:"min-w-0 truncate",children:l===u.id?"Downloading…":u.name})},u.id)),d&&t.jsx("p",{role:"alert",className:"text-destructive text-sm",children:d}),s&&t.jsx(k,{variant:"ghost",size:"sm",onClick:()=>s(e.threadRootEntryId??e.id),children:e.depth===0?"Reply in thread":"Open thread"}),n&&t.jsx(k,{variant:"ghost",size:"sm",onClick:n,children:"Report"})]})]})]})}function Ms({community:e,roomId:s,online:n,canEnroll:r,accessFingerprint:o}){var y,g,U;const d=ee(),f=de(),l=ue(!0,o,e),a=Tt(e,r,o),i=Et(),h=Ge(e,r,o),[u,N]=m.useState(""),[C,v]=m.useState(""),[w,x]=m.useState(!1),[O,A]=m.useState(null),[z,F]=m.useState(null),M=m.useId(),q=((y=a.data)==null?void 0:y.filter(b=>b.active))??[],K=((g=i.data)==null?void 0:g.agents.filter(b=>!q.some(S=>S.localAgentId===b.id)))??[];async function j(){l&&V(l)&&await f.invalidateQueries({queryKey:B.remote(l,e)})}async function $(b){if(b.preventDefault(),!u||w||!n||!r||!l)return;const S=l;x(!0),A(null);try{if(await d.enrollRemoteCommunityAgent(e,u,C.trim()?{handle:C.trim()}:{}),!V(S))return;N(""),v(""),await j()}catch(_){V(S)&&A(_ instanceof Error?_.message:"Couldn’t add the agent. Try again.")}finally{V(S)&&x(!1)}}return t.jsxs("section",{className:"mt-3 space-y-2 border-t pt-3","aria-label":"Your agents in this space",children:[t.jsx("h3",{className:"text-sm font-medium",children:"My agents"}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"Add an agent from here, then choose whether it joins this channel."}),a.isError&&t.jsxs("p",{role:"alert",children:["Couldn’t load your agents in this space."," ",t.jsx(k,{variant:"ghost",size:"sm",onClick:()=>void a.refetch(),children:"Retry"})]}),(U=a.data)==null?void 0:U.map(b=>{var S;return t.jsx(Os,{agent:b,roomId:s,online:n,canEnroll:r,takesDms:((S=h.data)==null?void 0:S.available)===!0,onChanged:j,onNotice:F},b.localAgentId)}),i.isError&&t.jsx("p",{role:"alert",children:"Couldn’t load the agents on this computer."}),r&&K.length>0&&t.jsxs("form",{onSubmit:b=>void $(b),className:"flex flex-wrap items-end gap-2",children:[t.jsxs("div",{className:"min-w-40 flex-1 space-y-1",children:[t.jsx(ce,{htmlFor:`${M}-agent`,children:"Local agent"}),t.jsxs(Mt,{value:u,onValueChange:N,disabled:!n||w,children:[t.jsx(Ot,{id:`${M}-agent`,children:t.jsx(It,{placeholder:"Choose an agent"})}),t.jsx($t,{children:K.map(b=>t.jsx(Ut,{value:b.id,children:b.name},b.id))})]})]}),t.jsxs("div",{className:"min-w-40 flex-1 space-y-1",children:[t.jsx(ce,{htmlFor:`${M}-handle`,children:"Space handle (optional)"}),t.jsx(We,{id:`${M}-handle`,value:C,onChange:b=>v(b.target.value),disabled:!n||w,placeholder:"Use the agent’s handle"})]}),t.jsx(k,{type:"submit",disabled:!u||!n||w,children:w?"Adding…":"Add to space"})]}),z&&t.jsx("p",{role:"status",className:"text-muted-foreground text-sm",children:z}),O&&t.jsx("p",{role:"alert",className:"text-destructive text-sm",children:O})]})}function Os({agent:e,roomId:s,online:n,canEnroll:r,takesDms:o,onChanged:d,onNotice:f}){const l=ee(),[a,i]=m.useState(null),[h,u]=m.useState(null),N=e.roomIds.includes(s),C=m.useId();async function v(x,O){if(!a){i(x),u(null);try{await O(),await d()}catch(A){u(A instanceof Error?A.message:"Couldn’t finish that. Try again.")}finally{i(null)}}}function w(x){f(x.remoteRevoked?"Stopped taking part.":"Stopped here, but the space wasn’t told. Try again when it’s reachable.")}return t.jsxs("div",{className:"space-y-1 rounded-md border p-2",children:[t.jsxs("p",{className:"text-sm font-medium",children:[e.displayName,!e.active&&" · stopped here"," ",t.jsxs("span",{className:"text-muted-foreground font-normal",children:["· owned by ",e.ownerDisplayName]})]}),t.jsxs("div",{className:"flex flex-wrap gap-1",children:[t.jsx(k,{variant:"outline",size:"sm",disabled:a!==null||!r||!e.active||!N&&!n,onClick:()=>void v("membership",async()=>{N?w(await l.leaveRemoteCommunityAgentRoom(e.community,s,e.localAgentId)):await l.joinRemoteCommunityAgentRoom(e.community,s,e.localAgentId)}),children:N?"Leave channel":"Join channel"}),t.jsx(k,{variant:"ghost",size:"sm",disabled:a!==null||!r,onClick:()=>void v("stop",()=>l.haltRemoteCommunityAgent(e.community,s,e.localAgentId)),children:"Stop agent"}),t.jsxs(Ve,{children:[t.jsx(Kt,{asChild:!0,children:t.jsx(k,{variant:"ghost",size:"sm",disabled:a!==null||!r,children:"Remove from space"})}),t.jsxs(Xe,{children:[t.jsxs(Ze,{children:[t.jsxs(et,{children:["Remove ",e.displayName,"?"]}),t.jsx(tt,{children:"It leaves every channel in this space. You can re-add it."})]}),t.jsxs(st,{children:[t.jsx(nt,{children:"Cancel"}),t.jsx(_t,{onClick:()=>void v("remove",async()=>w(await l.ejectRemoteCommunityAgent(e.community,e.localAgentId))),children:"Remove agent"})]})]})]})]}),o&&e.active&&t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Lt,{id:C,checked:e.acceptsDms===!0,disabled:a!==null||!r||!n,onCheckedChange:x=>void v("dms",()=>l.setRemoteCommunityAgentDms(e.community,e.localAgentId,x))}),t.jsx(ce,{htmlFor:C,className:"text-xs font-normal",children:"Takes direct messages"})]}),h&&t.jsx("p",{role:"status",className:"text-muted-foreground text-xs",children:h})]})}function Is({community:e,agent:s,disabled:n,accessFingerprint:r}){const o=ee(),d=Re(),f=de(),l=ue(!0,r,e),[a,i]=m.useState(!1),[h,u]=m.useState(null);async function N(){if(!a){i(!0),u(null);try{const C=await o.startRemoteCommunityDm(e,s.memberId);l&&await f.invalidateQueries({queryKey:B.dms(l,e)}),d({...ge.channels(),search:{community:e,id:C.roomId}})}catch(C){u(C.code===zt?`${s.displayName} isn’t taking direct messages.`:"Couldn’t open the direct message. Try again.")}finally{i(!1)}}}return t.jsxs("span",{className:"flex flex-wrap items-center justify-end gap-x-2",children:[h&&t.jsx("span",{role:"status",className:"text-muted-foreground order-last w-full text-right text-xs sm:order-none sm:w-auto",children:h}),t.jsx(k,{variant:"ghost",size:"sm",disabled:n||a,onClick:()=>void N(),"aria-label":`Message ${s.displayName}`,children:"Message"})]})}function $s(e,s){const n=new Date(e),r=n.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"});return n.toDateString()===s.toDateString()?r:`${n.toLocaleDateString([],{month:"short",day:"numeric",...n.getFullYear()===s.getFullYear()?{}:{year:"numeric"}})}, ${r}`}function Us(e,s=new Date){return e.kind!=="agent"?null:e.availability==="available"?{text:"Available"}:e.availability==="offline"&&e.lastSeenAt?{text:"Offline since",since:{dateTime:new Date(e.lastSeenAt).toISOString(),label:$s(e.lastSeenAt,s)}}:null}function Ks({roster:e,failed:s,canMention:n,onMention:r,community:o,roomId:d,online:f,canEnroll:l,agentsKey:a,accessFingerprint:i}){var C,v,w;const u=((C=Ge(o,!0,i).data)==null?void 0:C.available)===!0,N=(w=(v=xe().data)==null?void 0:v.find(x=>x.ref===o))==null?void 0:w.connectedHumanMemberId;return t.jsxs("div",{className:"max-h-48 overflow-auto border-b p-3","aria-label":"Channel members",children:[s&&t.jsx("p",{role:"alert",children:"Couldn’t load members."}),(e==null?void 0:e.stale)&&t.jsx("p",{className:"text-muted-foreground text-sm",children:"Saved member list"}),e==null?void 0:e.members.map(x=>{var A;const O=Us(x);return t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-2 text-sm",children:[t.jsxs("span",{children:[x.displayName,x.kind==="agent"?" · Agent":"",x.ownerMemberId&&` · owned by ${((A=e.members.find(z=>z.memberId===x.ownerMemberId))==null?void 0:A.displayName)??"a space member"}`,O&&t.jsxs("span",{className:"text-muted-foreground",children:[` · ${O.text}`,O.since&&t.jsxs(t.Fragment,{children:[" ",t.jsx("time",{dateTime:O.since.dateTime,children:O.since.label})]})]})]}),t.jsxs("span",{className:"flex flex-wrap items-center justify-end",children:[u&&x.kind==="agent"&&x.ownerMemberId!==N&&t.jsx(Is,{community:o,agent:x,disabled:!f,accessFingerprint:i}),x.handle&&t.jsxs(k,{variant:"ghost",size:"sm",disabled:!n,onClick:()=>r(x.handle),children:["Mention @",x.handle]})]})]},x.memberId)}),l&&t.jsx(Ms,{community:o,roomId:d,online:f,canEnroll:!0,accessFingerprint:i},a)]})}function ht(e,s){return e instanceof Error&&e.message?e.message:s}function _s({conduct:e,staff:s,onReadRules:n}){const{hold:r,standing:o}=e;return(r==null?void 0:r.kind)==="rules"?t.jsx("div",{className:"px-1 pb-1",children:t.jsx(k,{size:"sm",variant:"outline",onClick:n,children:"Read the rules"})}):r||s||!(o!=null&&o.slowModeSeconds)?null:t.jsxs("p",{className:"text-muted-foreground px-1 pb-1 text-xs",children:["Slow mode: one message every ",o.slowModeSeconds,"s."]})}function Ls({conduct:e,open:s,onOpenChange:n}){var d;const r=(d=e.standing)==null?void 0:d.rules,o=r?r.acceptedVersion>=r.version:!1;return t.jsx(Ee,{open:s,onOpenChange:n,children:t.jsxs(Me,{className:"sm:max-w-lg",children:[t.jsxs(Oe,{children:[t.jsx(Ie,{children:"Space rules"}),t.jsx($e,{children:o?"You accepted these rules.":"Accept these rules to post here."})]}),t.jsxs(Ue,{children:[t.jsx("div",{className:"max-h-[50vh] overflow-y-auto rounded-md border p-3 text-sm leading-relaxed whitespace-pre-wrap",children:(r==null?void 0:r.text)??"This space has no rules."}),e.accept.error&&t.jsx("p",{role:"alert",className:"text-destructive mt-2 text-sm",children:ht(e.accept.error,"Couldn’t accept the rules. Try again.")})]}),t.jsxs(Ke,{children:[t.jsx(k,{variant:"outline",onClick:()=>n(!1),children:"Close"}),(r==null?void 0:r.text)&&!o&&t.jsx(k,{disabled:e.accept.isPending,onClick:()=>e.accept.mutate(r.version,{onSuccess:()=>n(!1)}),children:e.accept.isPending?"Accepting…":"Accept rules"})]})]})})}function zs({community:e,accessFingerprint:s,currentName:n,open:r,onOpenChange:o}){return t.jsx(Ee,{open:r,onOpenChange:o,children:t.jsx(Me,{className:"sm:max-w-md",children:r&&t.jsx(Ps,{community:e,accessFingerprint:s,currentName:n,onDone:()=>o(!1)})})})}function Ps({community:e,accessFingerprint:s,currentName:n,onDone:r}){const o=ee(),d=de(),f=ue(!0,s,e),[l,a]=m.useState(n),i=Te({meta:{suppressErrorToast:!0},mutationFn:u=>o.setRemoteCommunityDisplayName(e,u),onSuccess:async()=>{f&&await d.invalidateQueries({queryKey:B.content(f,e)}),r()}}),h=l.trim();return t.jsxs("form",{onSubmit:u=>{u.preventDefault(),h&&h!==n&&i.mutate(h)},children:[t.jsxs(Oe,{children:[t.jsx(Ie,{children:"Your name in this space"}),t.jsx($e,{children:"Other spaces keep the name they show."})]}),t.jsxs(Ue,{className:"space-y-2",children:[t.jsx(ce,{htmlFor:"remote-community-display-name",children:"Name"}),t.jsx(We,{id:"remote-community-display-name",value:l,maxLength:128,autoComplete:"nickname",onChange:u=>a(u.target.value)}),i.error&&t.jsx("p",{role:"alert",className:"text-destructive text-sm",children:ht(i.error,"Couldn’t change your name. Try again.")})]}),t.jsxs(Ke,{children:[t.jsx(k,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),t.jsx(k,{type:"submit",disabled:!h||h===n||i.isPending,children:i.isPending?"Saving…":"Save name"})]})]})}const qs=[{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 Fs({entry:e,onClose:s}){return t.jsx(Ee,{open:e!==null,onOpenChange:n=>!n&&s(),children:t.jsx(Me,{className:"sm:max-w-md",children:e&&t.jsx(Hs,{entry:e,onClose:s},e.id)})})}function Hs({entry:e,onClose:s}){const n=ee(),r=m.useId(),[o,d]=m.useState(null),[f,l]=m.useState(""),a=Te({meta:{suppressErrorToast:!0},mutationFn:i=>n.reportRemoteCommunityEntry(e.community,e.roomId,e.id,i),onSuccess:()=>{rt("Message reported"),s()}});return t.jsxs("form",{onSubmit:i=>{i.preventDefault(),o&&a.mutate({reason:o,...f.trim()?{note:f.trim()}:{}})},children:[t.jsxs(Oe,{children:[t.jsx(Ie,{children:"Report message"}),t.jsx($e,{children:"This space’s owners and admins review reports."})]}),t.jsxs(Ue,{className:"space-y-4",children:[t.jsxs("p",{className:"text-muted-foreground line-clamp-3 text-sm",children:[e.authorDisplayName,": ",e.text]}),t.jsx(Pt,{"aria-label":"Reason",value:o??"",onValueChange:i=>d(i),children:qs.map(i=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(qt,{value:i.value,id:`${r}-${i.value}`}),t.jsx(ce,{htmlFor:`${r}-${i.value}`,children:i.label})]},i.value))}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ce,{htmlFor:`${r}-note`,children:"Note (optional)"}),t.jsx(Ft,{id:`${r}-note`,value:f,maxLength:Ht,onChange:i=>l(i.target.value),rows:3}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"Only owners and admins see this."})]}),a.error&&t.jsx("p",{role:"alert",className:"text-destructive text-sm",children:a.error instanceof Error&&a.error.message?a.error.message:"Couldn’t send the report. Try again."})]}),t.jsxs(Ke,{children:[t.jsx(k,{type:"button",variant:"outline",onClick:s,children:"Cancel"}),t.jsx(k,{type:"submit",disabled:!o||a.isPending,children:a.isPending?"Sending…":"Send report"})]})]})}function Ys({agentDeliveries:e,drafts:s,entries:n,threadId:r,canSend:o,action:d,onRetryAgent:f,onRetryDraft:l}){return t.jsxs(t.Fragment,{children:[e.filter(a=>a.parentEntryId===(r??null)&&!n.some(i=>i.originIdempotencyKey===a.idempotencyKey)).map(a=>t.jsxs("div",{className:"border-t px-4 py-2 text-sm",role:"status",children:[t.jsxs("p",{className:"font-medium",children:[a.author.displayName," · Agent"]}),t.jsx("p",{className:"whitespace-pre-wrap",children:a.text}),a.attachments.map((i,h)=>t.jsx("span",{className:"mr-2",children:i.name},h)),t.jsx("p",{className:"text-muted-foreground",children:a.state==="pending"?"Waiting for the space to confirm…":a.failure==="expired"?"Not confirmed. Too late to try again.":"Not confirmed. Check the space and the agent’s channel access."}),a.state==="pending"&&a.retryable&&t.jsx(k,{variant:"outline",size:"sm",disabled:!o||d!==null,onClick:()=>f(a.idempotencyKey),children:d===`retry:${a.idempotencyKey}`?"Retrying…":"Retry now"})]},a.idempotencyKey)),s.filter(a=>a.parentEntryId===r&&!n.some(i=>i.originIdempotencyKey===a.key)).map(a=>t.jsxs("div",{className:"border-t px-4 py-2 text-sm",role:"status",children:[t.jsx("p",{className:"whitespace-pre-wrap",children:a.text}),a.files.map(i=>t.jsx("span",{className:"mr-2",children:i.file.name},i.id)),t.jsx("p",{className:"text-muted-foreground",children:a.status==="sending"?"Sending…":"Delivery not confirmed."}),a.error&&t.jsx("p",{children:a.error}),a.status==="failed"&&t.jsx(k,{variant:"outline",size:"sm",disabled:!o,onClick:()=>l(a.key),children:"Retry message"})]},a.key))]})}function Bs(e,s){var d;const n=new Map;for(const f of e)f.thread&&n.set(f.id,{count:f.thread.replyCount,lastAt:f.thread.lastReplyAt,through:f.threadLastReplySeq});const r=new Map;for(const f of s){const l=f.threadRootEntryId;if(f.depth===0||l===null)continue;const a=(d=n.get(l))==null?void 0:d.through;if(a!==void 0&&f.remoteSeq<=a)continue;const i=r.get(l);r.set(l,{count:((i==null?void 0:i.count)??0)+1,newest:i&&i.newest.remoteSeq>f.remoteSeq?i.newest:f})}const o=new Map;for(const f of new Set([...n.keys(),...r.keys()])){const l=n.get(f),a=r.get(f),i=l===void 0?a.count:l.through===void 0?Math.max(l.count,(a==null?void 0:a.count)??0):l.count+((a==null?void 0:a.count)??0);o.set(f,{count:i,lastAt:(a==null?void 0:a.newest.createdAt)??l.lastAt,unread:0})}return o}const Qs={reactions:!1,threads:!0,runWith:!1,attachments:!0,mentions:!0,streamHealth:!0,presence:!1,turnStatus:!1,asks:!1};function Js({community:e,roomId:s,threadId:n,onThread:r,dmAgentName:o}){var ze,Pe,qe,Fe;const d=ee(),l=(ze=xe().data)==null?void 0:ze.find(p=>p.ref===e),a=_e(l==null?void 0:l.access),i=ue(!0,a.fingerprint,e),{ownerAddress:h,contextAddress:u}=vs(i),N=de(),C=Yt(),v=Bt(),w=(Pe=C.data)==null?void 0:Pe.destinations.find(p=>p.ref===e&&p.roomId===s),x=m.useRef(null),O=m.useRef(void 0),A=(w==null?void 0:w.scrollAnchorEntryId)??null,z=m.useCallback(p=>{if(!i||n)return;x.current&&clearTimeout(x.current),x.current=null;const D=p??null,L=O.current===void 0?A:O.current;D===null&&L===null||(x.current=setTimeout(()=>{x.current=null,O.current=D,v.mutate({ref:e,roomId:s,threadId:n??null,scrollAnchorEntryId:D})},400))},[i,e,v,A,s,n]);m.useEffect(()=>()=>{x.current&&clearTimeout(x.current)},[]),m.useEffect(()=>{(l==null?void 0:l.status)==="reconnect-required"&&i&&N.removeQueries({queryKey:B.remote(i,e)})},[i,e,l==null?void 0:l.status,N]);const F=at(e,s,a.capabilities.read,a.fingerprint),[M,q]=m.useState(0),K=m.useRef([]),j=m.useCallback(p=>K.current.some(D=>D.id===p),[]),$=xs(e,s,a.capabilities.stream,M,a.fingerprint,a.cacheReadable,j),y=$.status==="removed",g=y?null:$.room??F.data,U=Qt(e,s,n,!y&&a.capabilities.read&&(g==null?void 0:g.readable)===!0,a.fingerprint),b=it(e,s,!y&&a.capabilities.read&&(g==null?void 0:g.readable)===!0,a.fingerprint),[S,_]=m.useState(()=>({address:u,entries:[]})),H=m.useMemo(()=>S.address===u?S.entries:[],[u,S]);m.useEffect(()=>{K.current=H},[H]);const[X,re]=m.useState(0),[Z,me]=m.useState(!1),[we,c]=m.useState(null),[R,I]=m.useState(null),T=ws({community:e,roomId:s,enabled:!y&&a.capabilities.read&&(g==null?void 0:g.readable)===!0,accessFingerprint:a.fingerprint}),E=(l==null?void 0:l.connectedHumanMemberId)??null,P=(qe=b.data)==null?void 0:qe.members.find(p=>p.memberId===E),Q=p=>{var D;return p===E||((D=b.data)==null?void 0:D.members.some(L=>L.memberId===p&&L.ownerMemberId===E))===!0},[J,te]=m.useState({address:"",name:null,error:null}),G=J.address===u?J.name:null,ye=J.address===u?J.error:null,ae=m.useRef(null),W=m.useRef(null),se=m.useRef(null),fe=!y&&a.capabilities.post&&$.status==="live"&&(g==null?void 0:g.writable)===!0,Se=fe&&T.hold===null,oe=m.useMemo(()=>{var p;return y?[]:De(Ce(e,s,...((p=U.data)==null?void 0:p.pages.map(D=>D.entries))??[],$.entries,H),$.revisions)},[e,s,U.data,$.entries,$.revisions,H,y]),xt=m.useCallback(p=>{_(D=>({address:u,entries:Ce(e,s,D.address===u?D.entries:[],[p]).slice(-500)})),re(D=>D+1)},[u,e,s]);m.useLayoutEffect(()=>{var p;X>0&&((p=se.current)==null||p.scrollToBottom())},[X]);const yt=m.useMemo(()=>{var p;return i?{ownerKey:i.ownerKey,epoch:i.epoch,ref:e,generation:((p=i.connection)==null?void 0:p.generation)??0,roomId:s,threadId:n}:null},[i,e,s,n]),Y=Es({ref:e,roomId:s,canSend:Se,entries:oe,onReceipt:xt,draft:yt,ownerKey:h||"unresolved",contextKey:u||"unresolved",onHold:T.noteHold}),vt=oe.filter(p=>n?p.id===n||p.threadRootEntryId===n:p.depth===0),jt=m.useMemo(()=>{var p;return n?new Map:Bs(((p=U.data)==null?void 0:p.pages.flatMap(D=>D.entries))??[],oe)},[n,U.data,oe]),Le=vt.flatMap(p=>{const D=jt.get(p.id);return D?[{kind:"message",entry:p},{kind:"replies",rootId:p.id,summary:D}]:[{kind:"message",entry:p}]}),Nt=Le.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([e,p.entry.authorId]),kind:p.entry.authorKind,displayName:p.entry.authorDisplayName},at:p.entry.createdAt}),be={kind:"room",id:JSON.stringify([e,s,n]),placeholder:n?"Reply in thread…":`Message ${o??(g==null?void 0:g.title)??"this channel"}…`,canSend:Se,canSendReason:y?"You no longer have access to this channel.":T.hold?Cs(T.hold):!a.capabilities.post&&a.cacheReadable?"This space is read-only.":g!=null&&g.archived?"This channel is archived.":g!=null&&g.joined?"Reconnecting. You can send once the space is back.":"Join this channel to send messages.",attachments:Y.attachments,async send(){Y.send(n)}};async function ve(p,D){if(G||!i)return;const L=i,le=u;te({address:le,name:p,error:null});try{if(await D(),!V(L))return;(p==="join"||p==="leave"||p.startsWith("retry:"))&&q(ne=>ne+1),await N.invalidateQueries({queryKey:B.remote(L,e)})}catch(ne){V(L)&&te({address:le,name:p,error:ne instanceof Error?ne.message:"Couldn’t finish that. Try again."})}finally{V(L)&&te(ne=>ne.address===le?{...ne,name:null}:ne)}}function Ct(){var L;const p=oe.at(-1);if(n||U.hasNextPage||!p||$.status!=="live"||((L=ae.current)==null?void 0:L.address)===u&&ae.current.cursor===p.cursor||!i)return;const D=i;ae.current={address:u,cursor:p.cursor},d.setRemoteCommunityReadCursor(e,s,p.cursor).then(()=>{V(D)&&N.invalidateQueries({queryKey:B.rooms(D,e)})}).catch(()=>{var le;((le=ae.current)==null?void 0:le.address)===u&&(ae.current=null)})}return t.jsxs(Ne.Root,{surface:"room",capabilities:Qs,target:be,children:[t.jsxs("section",{className:"flex h-full min-h-0 flex-col","aria-label":(g==null?void 0:g.title)??"Space channel",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b px-3 py-2",children:[n&&t.jsx(k,{variant:"ghost",size:"sm",onClick:()=>r(),children:"Back to channel"}),!y&&a.capabilities.post&&g&&!g.joined&&!g.stale&&t.jsx(k,{size:"sm",disabled:G!==null,onClick:()=>void ve("join",()=>d.joinRemoteCommunityRoom(e,s)),children:"Join channel"}),a.cacheReadable&&t.jsx(k,{variant:"ghost",size:"sm",disabled:y,onClick:()=>me(!Z),children:Z?"Hide members":"Members"}),((Fe=T.standing)==null?void 0:Fe.rules.text)&&t.jsx(k,{variant:"ghost",size:"sm",onClick:()=>c("rules"),children:"Rules"}),a.capabilities.post&&t.jsx(k,{variant:"ghost",size:"sm",onClick:()=>c("name"),children:"Your name"}),a.capabilities.enrollAgent&&t.jsx(k,{variant:"outline",size:"sm",disabled:G!==null,onClick:()=>void ve("stop",()=>d.haltRemoteCommunityRoom(e,s)),children:G==="stop"?"Stopping…":"Stop my agents"}),a.capabilities.post&&(g==null?void 0:g.joined)&&!o&&t.jsx(k,{variant:"ghost",size:"sm",disabled:G!==null||!fe,onClick:()=>void ve("leave",async()=>{await d.leaveRemoteCommunityRoom(e,s),i&&N.removeQueries({queryKey:B.room(i,e,s)})}),children:"Leave channel"})]}),ye&&t.jsx("p",{role:"alert",className:"text-destructive px-4 py-2 text-sm",children:ye}),y?t.jsx("p",{role:"status",className:"p-6 text-sm",children:"You no longer have access to this channel."}):t.jsxs(t.Fragment,{children:[$.status!=="live"&&t.jsx("p",{role:"status",className:"text-muted-foreground px-4 py-2 text-sm",children:$.status==="connecting"?"Connecting to the space…":"Space unavailable. Showing saved messages."}),F.isError&&t.jsx("p",{role:"alert",className:"px-4 py-2 text-sm",children:"Couldn’t load this channel."}),Z&&t.jsx(Ks,{roster:b.data,failed:b.isError,canMention:fe,onMention:p=>{var D;Y.setText(`${Y.text}${Y.text&&!Y.text.endsWith(" ")?" ":""}@${p} `),(D=W.current)==null||D.focus()},community:e,roomId:s,online:$.status==="live",canEnroll:a.capabilities.enrollAgent,agentsKey:u,accessFingerprint:a.fingerprint}),U.isError&&t.jsxs("p",{role:"alert",className:"p-3 text-sm",children:["Some messages could not be loaded."," ",t.jsx(k,{variant:"ghost",size:"sm",onClick:()=>void U.refetch(),children:"Retry"})]}),U.hasNextPage&&t.jsx(k,{variant:"ghost",size:"sm",disabled:U.isFetchingNextPage,onClick:()=>void U.fetchNextPage(),children:"Load the next page of history"}),t.jsx(Ne.Timeline,{ref:se,conversationId:be.id,rows:Nt,label:n?"Space thread":"Space messages",busy:U.isFetching,resumeRow:()=>n?void 0:A??void 0,onTopRow:z,onReachedBottom:Ct,onOpenThread:r,empty:t.jsx("p",{className:"text-muted-foreground p-6 text-sm",children:U.isPending?"Loading messages…":"No messages here yet."}),renderRow:(p,D)=>{const L=Le[D.index];return L.kind==="message"?t.jsx(pt,{entry:L.entry,onThread:r,onReport:a.capabilities.post&&b.data&&!Q(L.entry.authorId)?()=>I(L.entry):void 0}):t.jsx(is,{summary:L.summary,open:!1,onOpen:()=>r(L.rootId)})}}),t.jsx(Ys,{agentDeliveries:$.deliveries,drafts:Y.deliveries,entries:oe,threadId:n,canSend:Se,action:G,onRetryAgent:p=>void ve(`retry:${p}`,()=>d.retryRemoteCommunityDelivery(e,s,p)),onRetryDraft:Y.retry}),Y.error&&t.jsx("p",{role:"alert",className:"text-destructive px-4 py-2 text-sm",children:Y.error}),t.jsx(Ne.Composer,{inputRef:W,aboveInput:t.jsx(_s,{conduct:T,staff:["owner","admin"].includes((P==null?void 0:P.role)??""),onReadRules:()=>c("rules")}),className:"m-3",value:Y.text,onChange:Y.setText,onSubmit:()=>Y.send(n),input:{isStreaming:!1,contextKey:be.id,canSubmit:Y.text.trim().length>0||Y.attachments.staged.length>0}})]})]}),t.jsx(Ls,{conduct:T,open:we==="rules",onOpenChange:p=>c(p?"rules":null)}),t.jsx(zs,{community:e,accessFingerprint:a.fingerprint,currentName:(P==null?void 0:P.displayName)??"",open:we==="name",onOpenChange:p=>c(p?"name":null)}),t.jsx(Fs,{entry:R,onClose:()=>I(null)})]})}function Gs({community:e,roomId:s}){var h,u;const n=xe(),r=(h=n.data)==null?void 0:h.find(N=>N.ref===e),o=_e(r==null?void 0:r.access),d=at(e,s??"",!!s&&o.capabilities.read,o.fingerprint),{dm:f}=ot(e,s??"",!!s&&o.capabilities.read,o.fingerprint),l=(r==null?void 0:r.label)??"Space",a=s?f?Jt(f):(u=d.data)==null?void 0:u.title:void 0,i=r===void 0&&n.fetchStatus==="fetching"||s!==void 0&&a===void 0&&d.fetchStatus==="fetching";return t.jsx(lt,{pending:i,children:a?`${l} · ${a}`:l})}function gt(e){var s,n,r,o;return!e||e.status==="reconnect-required"?null:((n=(s=e.access)==null?void 0:s.lastKnown)==null?void 0:n.lifecycle)==="deleted"?"deleted":((o=(r=e.access)==null?void 0:r.lastKnown)==null?void 0:o.lifecycle)==="taken_down"?"taken-down":e.seemsGoneSince?"seems-gone":null}function Qe(e,s,n){return`${e} ${e===1?s:n}`}function Ws(e,s){const n=[e>0?Qe(e,"message from your agents","messages from your agents"):null,s>0?Qe(s,"draft of yours","drafts of yours"):null].filter(o=>o!==null);if(n.length===0)return null;const r=n.length===1&&(e===1||s===1);return`${n.join(" and ")} ${r?"wasn’t":"weren’t"} sent.`}function Vs({connection:e,onRemoved:s}){const n=gt(e),r=Gt(),[o,d]=m.useState(!1),{ownerKey:f}=Wt(),l=Vt(f,e.ref),{copied:a,failed:i,copy:h}=Xt(),u=e.label,N=e.seemsGoneSince?new Date(e.seemsGoneSince).toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"}):null;function C(){r.mutate(e,{onSuccess:()=>{d(!1),rt.success(`${u} is removed from DorkOS.`),s()}})}const v=n==="deleted"||n==="taken-down",w=n==="taken-down"?"This space was taken down":n==="deleted"?"This space was deleted":"This space seems to be gone",x=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 ${N}, ${u} says it doesn’t exist. Its channels, messages and files are still here.`,O=Ws(v?e.undeliveredAgentMessages??0:0,l.length),A=l.length===0?null:l.length===1?"Your unsent draft is cleared too.":`Your ${l.length} unsent drafts are cleared too.`;return t.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:[t.jsx(fs,{className:"text-muted-foreground/50 size-10","aria-hidden":!0}),t.jsx("p",{className:"text-foreground font-medium",children:w}),t.jsx("p",{className:"text-muted-foreground max-w-sm",children:x}),O&&t.jsx("p",{role:"status",className:"text-foreground max-w-sm","data-testid":"community-gone-unsent",children:O}),t.jsx("span",{className:"sr-only","aria-live":"polite","data-testid":"community-gone-copy-status",children:a?"Copied.":i?"Couldn’t copy to the clipboard.":""}),t.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[l.length>0&&t.jsx(k,{variant:"outline",onClick:()=>void h(l.join(`
|
|
9
|
+
|
|
10
|
+
`)),children:a?"Copied":i?"Couldn’t copy":l.length===1?"Copy your draft":"Copy your drafts"}),t.jsx(k,{variant:v?"outline":"destructive",onClick:()=>d(!0),children:v?"Remove from DorkOS":"Remove local copy"})]}),t.jsx(Ve,{open:o,onOpenChange:z=>{z||r.reset(),d(z)},children:t.jsxs(Xe,{children:[t.jsxs(Ze,{children:[t.jsx(et,{children:v?`Remove ${u} from DorkOS?`:`Remove your copy of ${u}?`}),t.jsx(tt,{asChild:!0,children:t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{children:v?`${u} leaves this app. Nothing else is stored here.`:"This deletes its channels, messages and files from this computer."}),!v&&t.jsx("p",{children:"Your agents stop answering there. If it’s still around, you can connect again."}),A&&t.jsx("p",{children:A})]})})]}),r.isError&&t.jsx("p",{role:"alert",className:"text-destructive text-sm",children:"Couldn’t remove it. Check that DorkOS is running, then try again."}),t.jsxs(st,{children:[t.jsx(nt,{disabled:r.isPending,children:"Cancel"}),t.jsx(k,{variant:"destructive",disabled:r.isPending,onClick:C,children:r.isPending?"Removing…":v?"Remove from DorkOS":"Remove local copy"})]})]})})]})}function Xs({connection:e,dateFormat:s}){var d,f;const n=ds(e);if(!n)return null;const[r,...o]=us(n,(f=(d=e.access)==null?void 0:d.lastKnown)==null?void 0:f.lifecycle,s);return t.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:[t.jsx(Zt,{className:"mt-0.5 size-4 shrink-0","aria-hidden":!0}),t.jsxs("div",{className:"min-w-0 flex-1 basis-60 space-y-1",children:[t.jsx("p",{className:"text-foreground font-medium",children:r}),o.map(l=>t.jsx("p",{children:l},l))]}),t.jsxs(k,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>ts(ms(e)),children:["Open space",t.jsx(es,{className:"size-3.5","aria-hidden":!0})]})]})}const Zs={reactions:!1,threads:!1,runWith:!1,attachments:!1,mentions:!1,streamHealth:!1,presence:!1,turnStatus:!1,asks:!1};function en({dm:e,localAgentId:s,access:n}){var a,i,h,u;const r=ss(e.community,e.roomId,s,n),o=m.useRef(null),d=m.useRef(!0),f=(i=(a=r.data)==null?void 0:a.entries.at(-1))==null?void 0:i.id;m.useLayoutEffect(()=>{const N=o.current;N&&d.current&&(N.scrollTop=N.scrollHeight)},[f]);const l={kind:"room",id:JSON.stringify([e.community,e.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 t.jsx(Ne.Root,{surface:"room",capabilities:Zs,target:l,children:t.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[t.jsxs("section",{className:"border-b px-4 py-2 text-sm","aria-label":"About this direct message",children:[t.jsxs("p",{children:[t.jsx("span",{className:"font-medium",children:`${e.member.displayName} with ${e.agent.displayName}`}),t.jsx("span",{className:"text-muted-foreground",children:" · Read-only"})]}),t.jsx("p",{className:"text-muted-foreground text-xs",children:`Only ${e.member.displayName} and ${e.agent.displayName} can post here.`})]}),t.jsxs("section",{ref:o,onScroll:N=>{const C=N.currentTarget;d.current=C.scrollHeight-C.scrollTop-C.clientHeight<40},className:"min-h-0 flex-1 overflow-auto py-2","aria-label":"Messages",children:[r.isError&&t.jsxs("p",{role:"alert",className:"px-4 text-sm",children:["Couldn’t load this direct message."," ",t.jsx(k,{variant:"ghost",size:"sm",onClick:()=>void r.refetch(),children:"Retry"})]}),((h=r.data)==null?void 0:h.entries.length)===0&&t.jsx("p",{className:"text-muted-foreground px-4 text-sm",children:"No messages yet."}),(u=r.data)==null?void 0:u.entries.map(N=>t.jsx(pt,{entry:N},N.id))]})]})})}function tn({community:e,roomId:s,children:n}){var f;const r=(f=xe().data)==null?void 0:f.find(l=>l.ref===e),o=_e(r==null?void 0:r.access),{dm:d}=ot(e,s,o.verified&&o.capabilities.read,o.fingerprint);return d?d.readOnly&&d.localAgentId?t.jsx(en,{dm:d,localAgentId:d.localAgentId,access:o.fingerprint}):t.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[t.jsx(sn,{dm:d,accessFingerprint:o.fingerprint}),t.jsx("div",{className:"min-h-0 flex-1",children:n(d.agent.displayName)})]}):n()}function sn({dm:e,accessFingerprint:s}){var d;const r=(d=it(e.community,e.roomId,!0,s).data)==null?void 0:d.members.find(f=>f.memberId===e.agent.memberId),o=e.agent.ownerDisplayName;return t.jsxs("section",{className:"border-b px-4 py-2 text-sm","aria-label":"About this direct message",children:[t.jsxs("p",{children:[t.jsx("span",{className:"font-medium",children:e.agent.displayName}),t.jsx("span",{className:"text-muted-foreground",children:` · ${o}’s agent · ${o} can read this`})]}),(r==null?void 0:r.availability)==="offline"&&t.jsx("p",{role:"status",className:"text-muted-foreground text-xs",children:`Offline. ${e.agent.displayName} won’t answer until its computer is back on.`})]})}function nn(){const{id:e,community:s}=ct({from:"/_shell/channels"}),n=ns(s);return s&&!n.visible?n.isLoading?null:t.jsx(rs,{...ge.channels(),search:{},replace:!0}):t.jsxs(t.Fragment,{children:[s?t.jsx(Gs,{community:s,roomId:e}):e===void 0&&t.jsx(lt,{children:"Channels"}),t.jsx(rn,{})]})}function rn(){const{id:e,thread:s,entry:n,community:r}=ct({from:"/_shell/channels"}),o=Re(),d=ys(r?void 0:e,s,n),f=as();return r&&e?t.jsx(Je,{community:r,children:t.jsx(tn,{community:r,roomId:e,children:l=>t.jsx(Js,{community:r,roomId:e,threadId:s,dmAgentName:l,onThread:a=>{o({...ge.channels(),search:{community:r,id:e,thread:a}})}})},JSON.stringify([r,e]))}):r?t.jsx(Je,{community:r,children: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(He,{className:"text-muted-foreground/50 size-10","aria-hidden":!0}),t.jsx("p",{className:"text-foreground font-medium",children:"No channel selected"}),t.jsx("p",{className:"max-w-sm",children:"Choose a channel from this space."})]})}):d==="pending"?t.jsx("div",{className:"flex h-full flex-col","aria-busy":!0,children:t.jsx(os,{})}):d==="redirecting"?null:e===void 0?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(He,{className:"text-muted-foreground/50 size-10","aria-hidden":!0}),t.jsx("p",{className:"text-foreground font-medium",children:"Pick a channel or DM"}),t.jsx("p",{className:"max-w-sm",children:f?"Open one from All, at the bottom of the screen.":"Open one from the sidebar, or use + next to Channels."})]}):t.jsx(ls,{roomId:e,threadId:s,entrySeq:n,threadRoute:"/channels"})}function Je({community:e,children:s}){var o;const n=Re(),r=(o=xe().data)==null?void 0:o.find(d=>d.ref===e);return r&>(r)?t.jsx(Vs,{connection:r,onRemoved:()=>void n({...ge.channels(),search:{}})}):t.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[r&&t.jsx(Xs,{connection:r}),r&&t.jsx(hs,{connection:r}),t.jsx("div",{className:"min-h-0 flex-1",children:s})]})}const Jn=nn;export{Jn as component};
|