dorkos 0.125.2 → 0.125.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/cli.js +359 -223
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-BqGlH1pd.js → AboutPage-CTG5VvGg.js} +1 -1
- package/dist/client/assets/{ActivityErrorState-C4hqCedX.js → ActivityErrorState-BSuvlEdx.js} +1 -1
- package/dist/client/assets/{ActivityPage-frpyizcK.js → ActivityPage-BoiN89nn.js} +1 -1
- package/dist/client/assets/{ActivityRow-DB9c3g1G.js → ActivityRow-Bj0V45d7.js} +1 -1
- package/dist/client/assets/{AdapterIcon-CEHkdca8.js → AdapterIcon-LFpWySMg.js} +1 -1
- package/dist/client/assets/{AdapterSetupWizard-DLJMkb-u.js → AdapterSetupWizard-D9V6g6ha.js} +1 -1
- package/dist/client/assets/{AgentOptionRow-D-QjHi5k.js → AgentOptionRow-nGR6PdC6.js} +1 -1
- package/dist/client/assets/{AgentPicker-DoGucmqI.js → AgentPicker-BhsmtQgu.js} +1 -1
- package/dist/client/assets/{AgentRequestCard--9GA9ymH.js → AgentRequestCard-DBVuClMO.js} +4 -4
- package/dist/client/assets/{AppearancePage-NHNiZrtY.js → AppearancePage-DoDVD6OA.js} +1 -1
- package/dist/client/assets/{ApplyToOverridesDialog-Clo55n6V.js → ApplyToOverridesDialog-56HrIRuZ.js} +1 -1
- package/dist/client/assets/{AttentionSignalRow-BOpClaCD.js → AttentionSignalRow-x8vRACw-.js} +1 -1
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-D9Tm8ual.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-Bxeb6ihh.js} +1 -1
- package/dist/client/assets/{BindingDialog-DZcTXLE8.js → BindingDialog-D6HqDfnK.js} +1 -1
- package/dist/client/assets/{BlintzCanvas-DzjdPTlx.js → BlintzCanvas-DFsdE-hF.js} +3 -3
- package/dist/client/assets/{CanvasCsvContent-xYUrbFeA.js → CanvasCsvContent-BsRV_kUK.js} +1 -1
- package/dist/client/assets/{CanvasFileContent-D6fTvMea.js → CanvasFileContent-BzGYGFSi.js} +2 -2
- package/dist/client/assets/{CanvasModel3dContent-DEassnBV.js → CanvasModel3dContent-dA90prow.js} +2 -2
- package/dist/client/assets/ChannelComposer-MROo35vI.js +44 -0
- package/dist/client/assets/{ChatAppsOff-C00Nl_w6.js → ChatAppsOff-4xIVwDUJ.js} +1 -1
- package/dist/client/assets/{CodeMirrorDiff-JYxkSqFi.js → CodeMirrorDiff-Cexj7RYA.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-CVXZ9B5S.js → CodeMirrorEditor-D1-q0hSM.js} +1 -1
- package/dist/client/assets/{CommitmentList-CcCSwcZ8.js → CommitmentList-Bn7E15MO.js} +1 -1
- package/dist/client/assets/{CommitmentsPage-BrDbzpyR.js → CommitmentsPage-Ch-y0wr0.js} +1 -1
- package/dist/client/assets/{ComputerResourceView-BlLvMt1I.js → ComputerResourceView-Bbqh7e8R.js} +1 -1
- package/dist/client/assets/{ComputerViewer-B8SWICbj.js → ComputerViewer-XqZtg4O4.js} +1 -1
- package/dist/client/assets/{ConnectionAccessLists-Bsb-t24W.js → ConnectionAccessLists-D324Hahi.js} +1 -1
- package/dist/client/assets/{ConnectionsPage-RAhWxuWU.js → ConnectionsPage-5nIQrmtW.js} +1 -1
- package/dist/client/assets/{ConventionPage-CNij_BXA.js → ConventionPage-PFy9ASYy.js} +1 -1
- package/dist/client/assets/{ExtensionPageRoute-BsGqTcyI.js → ExtensionPageRoute-ClLEO5sJ.js} +1 -1
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-eQVA1bL6.js → FloatingTanStackRouterDevtools-CqogiFob-D007PSSL.js} +1 -1
- package/dist/client/assets/HandlePage-DW4b2avU.js +1 -0
- package/dist/client/assets/{HeartbeatPage-D0tKoR6G.js → HeartbeatPage-IqTdsHR6.js} +1 -1
- package/dist/client/assets/{KeyEntry-CSmznLcG.js → KeyEntry-ZYnZcVmM.js} +1 -1
- package/dist/client/assets/{LexicalField-gYKPjFfN.js → LexicalField-PdcZjVov.js} +1 -1
- package/dist/client/assets/{ManagesPage-BF6MFrsv.js → ManagesPage-doVOC8Dk.js} +1 -1
- package/dist/client/assets/{Marketplace-BWDlXgwH.js → Marketplace-B9X8IIWI.js} +2 -2
- package/dist/client/assets/{MarketplaceSourcesView-BhKzgkiO.js → MarketplaceSourcesView-BZCnUvqP.js} +1 -1
- package/dist/client/assets/{McpAppFrame-BotrzoHd.js → McpAppFrame-BXdeDoQB.js} +1 -1
- package/dist/client/assets/{McpSigninBody-CdeX_lYs.js → McpSigninBody-CI-gwQuU.js} +1 -1
- package/dist/client/assets/{Model3dViewer-KHktOpbD.js → Model3dViewer-ws_p2e-Q.js} +1 -1
- package/dist/client/assets/NamePage-Cv95tb4E.js +1 -0
- package/dist/client/assets/{NewDirectMessageMenu-CuvKJEDY.js → NewDirectMessageMenu-PuW-lVGF.js} +1 -1
- package/dist/client/assets/{NotificationsPage-DWcgfZJD.js → NotificationsPage-D_qHMJYR.js} +1 -1
- package/dist/client/assets/{OpenMeshSwitch-DdJ7g4yD.js → OpenMeshSwitch-DiuAcyMj.js} +1 -1
- package/dist/client/assets/{OperatorIdentityForm-7FUOEWw_.js → OperatorIdentityForm-DBbsUGPX.js} +1 -1
- package/dist/client/assets/{PermissionHistory-CgQhZrvg.js → PermissionHistory-DNBswqms.js} +1 -1
- package/dist/client/assets/{PermissionsPage-CK34y1VF.js → PermissionsPage-D6cAIUTe.js} +1 -1
- package/dist/client/assets/{PersonalityPopover-3BA36sB0.js → PersonalityPopover-d_PR1nuF.js} +1 -1
- package/dist/client/assets/PhotoPage-D8f25EFY.js +1 -0
- package/dist/client/assets/{PreviewRefusedNotice-CnqAE9sr.js → PreviewRefusedNotice-p-KIYJVf.js} +1 -1
- package/dist/client/assets/{ProfileFields-CIbISW83.js → ProfileFields-D_e9XQav.js} +1 -1
- package/dist/client/assets/{ProfilePanelContainer-DPDHtTbI.js → ProfilePanelContainer-DxSkglaS.js} +1 -1
- package/dist/client/assets/{ProfileRolePicker-83GFtm2P.js → ProfileRolePicker-kNJMfzUF.js} +1 -1
- package/dist/client/assets/{PromptSuggestionChips-B9chKG4w.js → PromptSuggestionChips-Dpie7Ut6.js} +1 -1
- package/dist/client/assets/{ReportsToPopover-DUv03JZP.js → ReportsToPopover-kZWnpINs.js} +1 -1
- package/dist/client/assets/{RoomSurface-Bq6Slne3.js → RoomSurface-DyubmENi.js} +1 -1
- package/dist/client/assets/{RoomsPage-BKxzz-nN.js → RoomsPage-B88d-F2r.js} +1 -1
- package/dist/client/assets/{RunsOnPopover-BIdmMhs9.js → RunsOnPopover-C51USCpv.js} +1 -1
- package/dist/client/assets/RuntimeConnectFlow-DJMtgkZF.js +1 -0
- package/dist/client/assets/{RuntimeSetupDialog-Er-lzjmK.js → RuntimeSetupDialog-DQss2qqJ.js} +1 -1
- package/dist/client/assets/SeenDevices-DQnrqn19.js +19 -0
- package/dist/client/assets/{SessionsPage-CGic5VaN.js → SessionsPage-BxT6HETG.js} +1 -1
- package/dist/client/assets/SettingsDialog-BriAKBHz.js +12 -0
- package/dist/client/assets/{SkillsPage-VRYwez5T.js → SkillsPage-QfxMaHeF.js} +1 -1
- package/dist/client/assets/{TaskDialogWrapper-C9LMV8oe.js → TaskDialogWrapper-D54Nqlkr.js} +1 -1
- package/dist/client/assets/{TasksEmptyState-CagC0LAa.js → TasksEmptyState-rCcan38Y.js} +1 -1
- package/dist/client/assets/{TasksPage-3gkHB1Pv.js → TasksPage-rIqxyB15.js} +1 -1
- package/dist/client/assets/{TeamComputerEntry-BD89Y5e6.js → TeamComputerEntry-BtSsE94x.js} +1 -1
- package/dist/client/assets/{ToolsPage-Ds6LwY79.js → ToolsPage-CfM2Cdtm.js} +1 -1
- package/dist/client/assets/{TopologyGraph-CiZ2ACcQ.js → TopologyGraph-BMvLKLwd.js} +2 -2
- package/dist/client/assets/{TourHost-BISNaEzZ.js → TourHost-XxcgkZcj.js} +1 -1
- package/dist/client/assets/{UnlinkDialog-DTuXHNsi.js → UnlinkDialog-D1tIChdU.js} +1 -1
- package/dist/client/assets/{UnreadDivider-l_VZ7ECn.js → UnreadDivider-mAlJ1Ci7.js} +1 -1
- package/dist/client/assets/{WidgetErrorCard-I8WiJv2g.js → WidgetErrorCard-DQWpqcbG.js} +2 -2
- package/dist/client/assets/{WorkView-_wehEEl-.js → WorkView-D1V2vzFd.js} +3 -3
- package/dist/client/assets/{_shell-BLcPeb8K.js → _shell-C5LhHVEU.js} +22 -22
- package/dist/client/assets/{_shell._home-CcRH-M-A.js → _shell._home-BhaXi3EI.js} +1 -1
- package/dist/client/assets/{_shell._home.activity-cR24Vr9Q.js → _shell._home.activity-Bd8jIlgC.js} +1 -1
- package/dist/client/assets/{_shell._home.index-agU2ItcI.js → _shell._home.index-zoh1Ij4R.js} +2 -2
- package/dist/client/assets/{_shell._home.tasks-BDR9JTj3.js → _shell._home.tasks-CnfbD4z-.js} +1 -1
- package/dist/client/assets/{_shell._home.workspaces-B4nlcACK.js → _shell._home.workspaces-Cew8PET2.js} +1 -1
- package/dist/client/assets/_shell.channels-efUOy5uH.js +10 -0
- package/dist/client/assets/{_shell.connections-CWQYcH58.js → _shell.connections-DS8BI_M6.js} +1 -1
- package/dist/client/assets/{_shell.feedback-requests-BkgHtyZr.js → _shell.feedback-requests-C9nwY8FH.js} +1 -1
- package/dist/client/assets/_shell.marketplace-BxOR_qkR.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-BdVMq5Gt.js +1 -0
- package/dist/client/assets/_shell.session-DxIjWGPk.js +1 -0
- package/dist/client/assets/{_shell.team-CTIVEpZQ.js → _shell.team-DejtvgcD.js} +3 -3
- package/dist/client/assets/{_shell.threads-ClWYrnld.js → _shell.threads-BiIjml5t.js} +1 -1
- package/dist/client/assets/_shell.x._extensionId-VrXvDnpj.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-VrXvDnpj.js +1 -0
- package/dist/client/assets/{abnfDiagram-WEYOIA3C-0-Mx5lSG.js → abnfDiagram-WEYOIA3C-CAQusbaN.js} +1 -1
- package/dist/client/assets/{access-copy-Cj31J6PU.js → access-copy-DzgVmhna.js} +1 -1
- package/dist/client/assets/{arc-DVmpcNHP.js → arc-Dx6GrexJ.js} +1 -1
- package/dist/client/assets/{architectureDiagram-ZHVYKT53-BZhMXbuC.js → architectureDiagram-ZHVYKT53-wFr3hleP.js} +1 -1
- package/dist/client/assets/{banner-Ctq7kvQ0.js → banner-C0yzCrO7.js} +1 -1
- package/dist/client/assets/{blockDiagram-RJAE7QA3-Ctmof3-7.js → blockDiagram-RJAE7QA3-CnuvSqM0.js} +1 -1
- package/dist/client/assets/{c4Diagram-XDPPPE54-BPglmQhG.js → c4Diagram-XDPPPE54-DzLijAHt.js} +1 -1
- package/dist/client/assets/{card-DI7YtQh3.js → card-ZF4yWM1Y.js} +1 -1
- package/dist/client/assets/channel-BhigWC_Q.js +1 -0
- package/dist/client/assets/{chunk-2E7WHVMD-DIK6CHka.js → chunk-2E7WHVMD-SN1xBBT1.js} +1 -1
- package/dist/client/assets/{chunk-2Q5K7J3B-C3uATYd9.js → chunk-2Q5K7J3B-DbW-InNL.js} +1 -1
- package/dist/client/assets/{chunk-4EMNKR2T-Dl3iYXVl.js → chunk-4EMNKR2T-DxMZsEVE.js} +1 -1
- package/dist/client/assets/{chunk-55XCU76K-BJF-Hcs9.js → chunk-55XCU76K-9dknyxgR.js} +1 -1
- package/dist/client/assets/{chunk-5VM5RSS4-Cju3BnqQ.js → chunk-5VM5RSS4-CeL_dp1K.js} +1 -1
- package/dist/client/assets/{chunk-JWPE2WC7-v1omZzgE.js → chunk-JWPE2WC7-H-uQEL4m.js} +1 -1
- package/dist/client/assets/{chunk-VQ5W62QI-2HqA3jPL.js → chunk-VQ5W62QI-YZCtp46Q.js} +1 -1
- package/dist/client/assets/{chunk-XXDRQBXY-RDXwFs9Z.js → chunk-XXDRQBXY-CTsuviQ9.js} +1 -1
- package/dist/client/assets/{chunk-ZCHMQSOR-DhQsY-OT.js → chunk-ZCHMQSOR-Dymmj4ca.js} +2 -2
- package/dist/client/assets/{classDiagram-v2-4MYWR3UA-DC5N-GDk.js → classDiagram-v2-4MYWR3UA-AZrXuO6n.js} +1 -1
- package/dist/client/assets/{command-DpK0GpDM.js → command-D2uvj-5S.js} +1 -1
- package/dist/client/assets/{cose-bilkent-JH36ORCC-BriFsb6c.js → cose-bilkent-JH36ORCC-DH6uyH8n.js} +1 -1
- package/dist/client/assets/{cpu-DzCUBK-1.js → cpu-CxkuIIZ9.js} +1 -1
- package/dist/client/assets/{cynefin-EF2NZ3EQ-cj34OpiI.js → cynefin-EF2NZ3EQ-CPF1WTGP.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-WF24UDRP-DvAggKpl.js → cynefinDiagram-WF24UDRP-BvgLB9D2.js} +1 -1
- package/dist/client/assets/{dagre-NK4GIZVX-BskSpt7C.js → dagre-NK4GIZVX-Dbgki4TG.js} +1 -1
- package/dist/client/assets/{diagram-CBK3MWTC-C6BZljcO.js → diagram-CBK3MWTC-C84DYVUU.js} +1 -1
- package/dist/client/assets/{diagram-I5XIIV2D--4FPRmBZ.js → diagram-I5XIIV2D-DKFohwHa.js} +1 -1
- package/dist/client/assets/{diagram-ODIL2UCW-kZxp81Fr.js → diagram-ODIL2UCW-C80JpCDz.js} +1 -1
- package/dist/client/assets/{diagram-PFBEJUXE-BSXBAffS.js → diagram-PFBEJUXE-I7bZPRJw.js} +1 -1
- package/dist/client/assets/{diagram-RJA3I4VV-DLDPF6FG.js → diagram-RJA3I4VV-Gqdnf6A3.js} +1 -1
- package/dist/client/assets/{diagram-TYUNFSNR-CoU2knZy.js → diagram-TYUNFSNR-CCzmXB0d.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-V4P3TTPT-C77T1UPB.js → ebnfDiagram-V4P3TTPT-DWKMGbp5.js} +1 -1
- package/dist/client/assets/{elk-QONTBCTQ-UFXrlbAn.js → elk-QONTBCTQ-BH9-VsJv.js} +1 -1
- package/dist/client/assets/{empty-state-aNwJA6H8.js → empty-state-CQVHyP7G.js} +1 -1
- package/dist/client/assets/{erDiagram-KYQIGQAA-CyLB8fKu.js → erDiagram-KYQIGQAA-Dw7o0PKQ.js} +1 -1
- package/dist/client/assets/{execution-config-D7JzMYC2.js → execution-config-B0Ip8o1B.js} +1 -1
- package/dist/client/assets/{file-bSD5jgk_.js → file-aWVIKIhu.js} +1 -1
- package/dist/client/assets/{file-exclamation-point-BcCIL-rE.js → file-exclamation-point-VqrEIkK2.js} +1 -1
- package/dist/client/assets/{file-text-DTvj1wzM.js → file-text-BcDT6eqO.js} +1 -1
- package/dist/client/assets/{find-latest-widget-fence-D01ENK2h.js → find-latest-widget-fence-BBx2mbzG.js} +1 -1
- package/dist/client/assets/{flowDiagram-IUGLLWBU-qmnUF-Ak.js → flowDiagram-IUGLLWBU-DUap_2VM.js} +1 -1
- package/dist/client/assets/{form-C_yPntkz.js → form-Bq-P02ub.js} +1 -1
- package/dist/client/assets/{format-cron-DUPWkOrW.js → format-cron-CoTCXmQp.js} +1 -1
- package/dist/client/assets/{ganttDiagram-R7GPNTJY-CBzoqGuU.js → ganttDiagram-R7GPNTJY-GAxFxszj.js} +1 -1
- package/dist/client/assets/{git-branch-ClXAt1_G.js → git-branch-Cvc-Sr6q.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-DMh_n1S2.js → gitGraphDiagram-PDYL7XHY-CNXDdCW9.js} +1 -1
- package/dist/client/assets/{graph-BgkuepqW.js → graph-CtCYTWZj.js} +1 -1
- package/dist/client/assets/{heart-BrjEmIsl.js → heart-yvX6jsem.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-DlHNVEaV.js → highlighted-body-KPVGNVTW-B6iFwydl.js} +1 -1
- package/dist/client/assets/{image-lightbox-BtzkRztd.js → image-lightbox-COo7DKXH.js} +1 -1
- package/dist/client/assets/{image-off-4yaoLh32.js → image-off-BPRcQBvJ.js} +1 -1
- package/dist/client/assets/{index-f1W4Bd4W.js → index-7EayMDlv.js} +1 -1
- package/dist/client/assets/{index-WkQdt6Zo.js → index-B1UgkD5d.js} +1 -1
- package/dist/client/assets/{index-DB2t3GUm.js → index-B36G1Wt7.js} +3 -3
- package/dist/client/assets/{index-WxG6nG96.js → index-B7M2ny5y.js} +1 -1
- package/dist/client/assets/{index-DQ9ppIWv.js → index-B8YnzTmr.js} +1 -1
- package/dist/client/assets/{index-B-X82FND.js → index-BI7mYC3q.js} +1 -1
- package/dist/client/assets/{index-C_xSr5lb.js → index-BIoO-kFF.js} +1 -1
- package/dist/client/assets/{index-BUkUamu4.js → index-BJKRrppi.js} +1 -1
- package/dist/client/assets/{index-CNV11SW6.js → index-BSGg8ud2.js} +1 -1
- package/dist/client/assets/index-BSNB2iOV.js +1053 -0
- package/dist/client/assets/{index-A_qzw4D8.js → index-Bcv5Znqx.js} +1 -1
- package/dist/client/assets/{index-DgxXSEmR.js → index-BsmQ2VMC.js} +1 -1
- package/dist/client/assets/{index-CJhmUsIv.js → index-BzlepYwD.js} +1 -1
- package/dist/client/assets/{index-qdygDruh.js → index-CCo77KAN.js} +1 -1
- package/dist/client/assets/{index-DXalAOXT.js → index-CIIAns2d.js} +1 -1
- package/dist/client/assets/{index-Dj4I8KcL.js → index-CNlIRtiQ.js} +3 -3
- package/dist/client/assets/{index-Cefoks17.js → index-COenrxg6.js} +1 -1
- package/dist/client/assets/{index-CrQWuUpr.js → index-CXCoNv1T.js} +1 -1
- package/dist/client/assets/{index-CSyZb1X9.js → index-CYPbNdgY.js} +1 -1
- package/dist/client/assets/{index-CyfSPJ1D.js → index-CYl4FhO7.js} +1 -1
- package/dist/client/assets/{index-DGdKO24t.js → index-CZA2uFZQ.js} +1 -1
- package/dist/client/assets/index-CaOL5rt9.js +17 -0
- package/dist/client/assets/{index-CThGpHO2.js → index-Cbu89CsC.js} +1 -1
- package/dist/client/assets/{index-C_H6ZIel.js → index-Cdzlu1-P.js} +1 -1
- package/dist/client/assets/{index-DX546SK5.js → index-D1e3aPAe.js} +2 -2
- package/dist/client/assets/{index-C0LPB1iH.js → index-D9pvn-mm.js} +1 -1
- package/dist/client/assets/{index-CNiC7KUz.js → index-DRao3lV4.js} +1 -1
- package/dist/client/assets/{index-BqHUbNdh.js → index-DefXQdQA.js} +1 -1
- package/dist/client/assets/{index-DrnHzrt4.js → index-Dqq2lV9x.js} +1 -1
- package/dist/client/assets/{index-CMLDdOez.js → index-Drg391kA.js} +1 -1
- package/dist/client/assets/index-DtlBeLQB.css +1 -0
- package/dist/client/assets/{index-Bgg4cW4L.js → index-DuEmhl4K.js} +1 -1
- package/dist/client/assets/{index-BXtagrMY.js → index-FCztjyrm.js} +1 -1
- package/dist/client/assets/{index-Ckut3u-d.js → index-GEDh_fwN.js} +1 -1
- package/dist/client/assets/{index-BtG4vr8c.js → index-KLtoKDvx.js} +1 -1
- package/dist/client/assets/{index-FhmSwVD0.js → index-N3JAoXse.js} +1 -1
- package/dist/client/assets/{index-t-NyR7HD.js → index-NbnKjhyZ.js} +1 -1
- package/dist/client/assets/index-ZRwRzKll.js +1 -0
- package/dist/client/assets/index-bgXdb4vP.js +1 -0
- package/dist/client/assets/{index-Adjbt_HC.js → index-io81RE8o.js} +1 -1
- package/dist/client/assets/{index-D0yajRDv.js → index-p7yYM6Iz.js} +1 -1
- package/dist/client/assets/{index-6yT0Qr0s.js → index-sTYFlBEJ.js} +1 -1
- package/dist/client/assets/{index-DZ1BC5JW.js → index-thNMHUmT.js} +1 -1
- package/dist/client/assets/{index-BeVLPg9t.js → index-vWi6pOlY.js} +1 -1
- package/dist/client/assets/{index-DFWrO42z.js → index-xKvoBO92.js} +1 -1
- package/dist/client/assets/{index.esm-Bb3LMu5X.js → index.esm-BYS3OpKb.js} +1 -1
- package/dist/client/assets/{infoDiagram-MVDRKAX5-DbU4eDjZ.js → infoDiagram-MVDRKAX5-BB5v9AOj.js} +1 -1
- package/dist/client/assets/{inline-code-DwFNff3_.js → inline-code-Df1J1tQV.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-DmHmF-HT.js → ishikawaDiagram-HPEHV2GE-D8Zw0Wka.js} +1 -1
- package/dist/client/assets/{journeyDiagram-BOSHW7O7-DsjOeP3J.js → journeyDiagram-BOSHW7O7-CIaVEmcq.js} +1 -1
- package/dist/client/assets/{kanban-definition-FNSA4HC5-ByQ1WGy2.js → kanban-definition-FNSA4HC5-D0jxBQB1.js} +1 -1
- package/dist/client/assets/{layers-DFZUUHM5.js → layers-Byywl2sz.js} +1 -1
- package/dist/client/assets/{lightbulb-Bbgsejp1.js → lightbulb-Cu6PlV7n.js} +1 -1
- package/dist/client/assets/{link-2-xieOmwOK.js → link-2-D2LX2bAn.js} +1 -1
- package/dist/client/assets/{list-runtime-types-B0CSonAi.js → list-runtime-types-C4Ik3n5A.js} +1 -1
- package/dist/client/assets/{markdown-content-ysBIqFAg.js → markdown-content-BbH7L0YO.js} +1 -1
- package/dist/client/assets/{mention-pill-Daeu1X92.js → mention-pill-DxRP9Bkp.js} +1 -1
- package/dist/client/assets/{mermaid.core-B1mQMOXd.js → mermaid.core-D9Vc69mt.js} +4 -4
- package/dist/client/assets/{message-square-off-D9hm8WNH.js → message-square-off-BP01X_ck.js} +1 -1
- package/dist/client/assets/{mindmap-definition-6OY57UG3-CoP-DGm1.js → mindmap-definition-6OY57UG3-DNd2V0AH.js} +1 -1
- package/dist/client/assets/{more-details-DHCpYDi7.js → more-details-7psgoF8x.js} +1 -1
- package/dist/client/assets/{owner-notice-Crxco7HN.js → owner-notice-83ejBJ3g.js} +1 -1
- package/dist/client/assets/{package-CD8xq7hk.js → package-DSJyi_sq.js} +1 -1
- package/dist/client/assets/{page-container-B9sDc2wq.js → page-container-D7q7ISl1.js} +1 -1
- package/dist/client/assets/{pane-resize-handle-DOchpdJ6.js → pane-resize-handle-BnQ8IKj6.js} +1 -1
- package/dist/client/assets/{paperclip-CzhXW5qi.js → paperclip-CeOJ8Nwp.js} +1 -1
- package/dist/client/assets/{path-input-Z2p922fj.js → path-input-BToXn1c2.js} +1 -1
- package/dist/client/assets/{pegDiagram-ECIUJNBX-TEsMAO1a.js → pegDiagram-ECIUJNBX-sCkH1RIT.js} +1 -1
- package/dist/client/assets/{pieDiagram-GNMPY74T-CMIDIiMP.js → pieDiagram-GNMPY74T-B4V9xf2z.js} +1 -1
- package/dist/client/assets/{plug-BEp9Ly3k.js → plug-CMcqk2p3.js} +1 -1
- package/dist/client/assets/{primer-trigger-4qUY83SX.js → primer-trigger-DtyY4fpx.js} +1 -1
- package/dist/client/assets/{profile-errors-CezsKqhA.js → profile-errors-DSKechEz.js} +1 -1
- package/dist/client/assets/{progress-eQl1UvNz.js → progress-8CDPI0xL.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-D57K4MC3-DXjohzOz.js → quadrantDiagram-D57K4MC3-DkcmqAD-.js} +1 -1
- package/dist/client/assets/{query-error-state-COuKRlU0.js → query-error-state-jrioxcrf.js} +1 -1
- package/dist/client/assets/{radio-Cdnkcg1w.js → radio-D3k0l1vj.js} +1 -1
- package/dist/client/assets/{railroadDiagram-Y72NRBL7-BojgH6Hw.js → railroadDiagram-Y72NRBL7-T9Qbdks1.js} +1 -1
- package/dist/client/assets/registry-B0s0gwF4.js +1 -0
- package/dist/client/assets/{relay-trace-schemas-XcVQg5Fa.js → relay-trace-schemas-epyobQGg.js} +1 -1
- package/dist/client/assets/{repeat-wB31CP7I.js → repeat-Cbe4MVvF.js} +1 -1
- package/dist/client/assets/{requirementDiagram-EQYSW5RA-Gojbrcvg.js → requirementDiagram-EQYSW5RA-BKrsOvZR.js} +1 -1
- package/dist/client/assets/{room-files-source-DXKpm43a.js → room-files-source-wUgOb12j.js} +1 -1
- package/dist/client/assets/{rotate-ccw-clock-LSKKAcnR.js → rotate-ccw-clock-CI-xhvb_.js} +1 -1
- package/dist/client/assets/{rotate-cw-scTEKxeZ.js → rotate-cw-BGDIfrKN.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-SY24JHO5-QS71aycL.js → sankeyDiagram-SY24JHO5-SVj2Csf7.js} +1 -1
- package/dist/client/assets/{scroll-area-BNFXgTKM.js → scroll-area-D3x48cAw.js} +1 -1
- package/dist/client/assets/{search-x-Cjf0n9z7.js → search-x-Dz-ryi0D.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-BLEHNHQU-Beg7mj69.js → sequenceDiagram-BLEHNHQU-CSliXD3t.js} +1 -1
- package/dist/client/assets/{shield-x-Dr4BZfo_.js → shield-x-FVhBth4G.js} +1 -1
- package/dist/client/assets/{signed-in-L9MLqTuc.js → signed-in-BQcV7AMx.js} +1 -1
- package/dist/client/assets/{sizeCapture-INFHLROL-3Oo1KjRp.js → sizeCapture-INFHLROL-4lP-N234.js} +1 -1
- package/dist/client/assets/{soul-file-CxpOawh5.js → soul-file-CS-EETV8.js} +1 -1
- package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-DFYIDQ6C.js → stateDiagram-v2-A6IESKWZ-Cij5yf9S.js} +1 -1
- package/dist/client/assets/{swimlanes-B3ENRKFQ-BUgKOOrv.js → swimlanes-B3ENRKFQ-iSf_hOim.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-C8oY0fep.js +8 -0
- package/dist/client/assets/{table-B0LsKsEv.js → table-Cg_1lfh0.js} +1 -1
- package/dist/client/assets/{timeline-definition-JXYKGLGB-BsPZ0P_8.js → timeline-definition-JXYKGLGB-DVZj2yY_.js} +1 -1
- package/dist/client/assets/{trust-posture-Cm7OhCEx.js → trust-posture-CkEXRlxW.js} +1 -1
- package/dist/client/assets/{unplug-DLA7Ib_s.js → unplug-CASvw-Yn.js} +1 -1
- package/dist/client/assets/{unverified-catalog-notice-CxBO_pta.js → unverified-catalog-notice-CMDo7sp5.js} +1 -1
- package/dist/client/assets/{use-adapter-catalog-C333Z2Q6.js → use-adapter-catalog-BVeUe0tR.js} +1 -1
- package/dist/client/assets/{use-bindings-Bu4yLLR5.js → use-bindings-Clux6PJ0.js} +1 -1
- package/dist/client/assets/{use-composer-prefs-BnjCX9pM.js → use-composer-prefs-D0poHQqk.js} +1 -1
- package/dist/client/assets/{use-connector-management-Bo6wOJQS.js → use-connector-management-CQQGCFaL.js} +1 -1
- package/dist/client/assets/{use-deep-link-scroll-D867V6rs.js → use-deep-link-scroll-BdGMaupf.js} +1 -1
- package/dist/client/assets/{use-delete-binding-DKObM-zT.js → use-delete-binding-CSpocSwM.js} +1 -1
- package/dist/client/assets/{use-dev-links-C0Zc30aj.js → use-dev-links-c6K0en5G.js} +1 -1
- package/dist/client/assets/{use-direct-message-panel-DNWtQq4B.js → use-direct-message-panel-sq9_ehHu.js} +1 -1
- package/dist/client/assets/{use-external-adapter-catalog-Bv5rDkX4.js → use-external-adapter-catalog-C3T1MGxz.js} +1 -1
- package/dist/client/assets/{use-full-activity-feed-CFUj0qCS.js → use-full-activity-feed-Bmmagy2q.js} +1 -1
- package/dist/client/assets/use-is-below-desktop-CGj5vT8N.js +1 -0
- package/dist/client/assets/{use-local-browser-BeZjn0gA.js → use-local-browser-Di54G1yg.js} +1 -1
- package/dist/client/assets/{use-mesh-topology-DurMpvjU.js → use-mesh-topology-C_bdAJfy.js} +1 -1
- package/dist/client/assets/{use-mounted-ref-CBSuPNPv.js → use-mounted-ref-C_ChQ0xs.js} +1 -1
- package/dist/client/assets/{use-notification-prefs-b8iKvzB4.js → use-notification-prefs-BjGauolP.js} +1 -1
- package/dist/client/assets/{use-panel-tab-placements-BcKEux1G.js → use-panel-tab-placements-Bn-CIS6M.js} +1 -1
- package/dist/client/assets/use-pending-read-CIp204qI.js +1 -0
- package/dist/client/assets/{use-personality-commit-u3kQ6h3H.js → use-personality-commit-WeCQulwl.js} +1 -1
- package/dist/client/assets/{use-promo-activation-C8_cGmEW.js → use-promo-activation-C9I5YwBo.js} +1 -1
- package/dist/client/assets/{use-promo-dismissals-B3VuaQCf.js → use-promo-dismissals-BhTNS7LX.js} +1 -1
- package/dist/client/assets/{use-pulse-freshness-CSWQ0TZS.js → use-pulse-freshness-DDo5a3nh.js} +1 -1
- package/dist/client/assets/{use-relay-config-BA6c0FMB.js → use-relay-config-Bfjxr2lE.js} +1 -1
- package/dist/client/assets/{use-room-follow-claim-BV-MtDQ5.js → use-room-follow-claim-D_HTjK2r.js} +1 -1
- package/dist/client/assets/{use-room-sessions-W62Zl72O.js → use-room-sessions-UwyzNxeo.js} +1 -1
- package/dist/client/assets/{use-roving-tab-list-CMITzUHu.js → use-roving-tab-list-CXAJxnx0.js} +1 -1
- package/dist/client/assets/{use-session-canvas-u63m2mYH.js → use-session-canvas-CTDXU27z.js} +3 -3
- package/dist/client/assets/{use-status-budget-CbmPFvpQ.js → use-status-budget-CFS9gmSZ.js} +4 -4
- package/dist/client/assets/{use-unclaimed-chats-D7SEUfiO.js → use-unclaimed-chats-BlUFVbnm.js} +1 -1
- package/dist/client/assets/use-update-config-BwjEWlgj.js +1 -0
- package/dist/client/assets/{useMutationState-rOg4bnKv.js → useMutationState-CUuSnqrc.js} +1 -1
- package/dist/client/assets/{usecaseDiagram-WPOLBNNX-C-w0e-nv.js → usecaseDiagram-WPOLBNNX-BTdq_YOC.js} +1 -1
- package/dist/client/assets/{vennDiagram-Q3Y3IDCW-BNm2WXT5.js → vennDiagram-Q3Y3IDCW-BLQwiECh.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-IVAIDKWA-BFyFLiir.js → wardleyDiagram-IVAIDKWA-Cp8QrBQm.js} +1 -1
- package/dist/client/assets/{xychartDiagram-4URNHDU4-BKxZlnEx.js → xychartDiagram-4URNHDU4-CrrAKTa0.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/extension-child.cjs +1701 -435
- package/dist/server/index.js +22346 -20856
- package/dist/server/index.js.map +2 -2
- package/package.json +5 -5
- package/dist/client/assets/ChannelComposer-CutghXOq.js +0 -44
- package/dist/client/assets/HandlePage-XG5mP_e9.js +0 -1
- package/dist/client/assets/NamePage-Cdd9-mZg.js +0 -1
- package/dist/client/assets/PhotoPage-DFic-gDH.js +0 -1
- package/dist/client/assets/RuntimeConnectFlow-IaRVgmqH.js +0 -1
- package/dist/client/assets/SeenDevices-9quCcdUW.js +0 -19
- package/dist/client/assets/SettingsDialog-BZ58IaK1.js +0 -12
- package/dist/client/assets/_shell.channels-B7lTxkqM.js +0 -10
- package/dist/client/assets/_shell.marketplace-BMqwT9qX.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-pXGa7Cqb.js +0 -1
- package/dist/client/assets/_shell.session-CmoE1W38.js +0 -1
- package/dist/client/assets/_shell.x._extensionId-BiXilrSW.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-BiXilrSW.js +0 -1
- package/dist/client/assets/channel-A2WD4smw.js +0 -1
- package/dist/client/assets/index-BMCDckcY.js +0 -17
- package/dist/client/assets/index-BOuCpkRb.js +0 -1
- package/dist/client/assets/index-BVq1p60h.js +0 -1
- package/dist/client/assets/index-CjUfPyOM.js +0 -1053
- package/dist/client/assets/index-D2ZFfqZZ.css +0 -1
- package/dist/client/assets/registry-BSucT23N.js +0 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-Bqjv1MSj.js +0 -8
- package/dist/client/assets/use-is-below-desktop-BUS7OPGv.js +0 -1
- package/dist/client/assets/use-is-hub-CFhvDMHt.js +0 -1
- package/dist/client/assets/use-pending-read-BBBAnUYu.js +0 -1
- package/dist/client/assets/use-update-config-Dfd7KMde.js +0 -1
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{W as Mt,r as f,j as t,gU as Ot,a1 as V,ks as Xe,a2 as Ze,kt as z,a3 as le,a4 as we,ku as $t,kv as ue,kw as X,cf as Ut,kx as It,c6 as Lt,g$ as Ft,cj as Re,l as xe,ky as Kt,kz as _t,kA as Pt,kB as je,kC as Ae,B as S,kD as qt,cQ as zt,kE as et,eu as ae,en as tt,eo as st,ep as nt,eq as at,er as Te,I as Me,fX as rt,hs as Yt,fY as it,fZ as ot,f_ as lt,f$ as ct,g0 as dt,g1 as ut,g2 as Ht,$ as Qt,kF as Bt,kG as Jt,kH as Wt,kI as ge,cT as Oe,cU as $e,cW as Ue,cX as Ie,cY as Le,dU as Fe,dB as Ke,a7 as mt,kJ as Gt,kK as Vt,hT as Xt,kL as Zt,kM as _e,kN as es,kO as ts,kP as ft,kQ as ss,kR as pt,kS as ht,kT as ns,eb as xt,kU as as,kV as rs,kW as is,ji as os,a0 as ls,ey as cs,fe as ds,kX as us,c$ as gt,kY as ms,kZ as fs,ad as ps,n as Qe}from"./index-CjUfPyOM.js";import{T as hs,R as xs,a as gs}from"./RoomSurface-Bq6Slne3.js";import{b as pe,C as Ne}from"./index-Dj4I8KcL.js";import{M as ys}from"./markdown-content-ysBIqFAg.js";import{o as vs,a as js,c as Ns}from"./owner-notice-Crxco7HN.js";import"./ChannelComposer-CutghXOq.js";import"./pane-resize-handle-DOchpdJ6.js";import"./UnreadDivider-l_VZ7ECn.js";import"./use-room-follow-claim-BV-MtDQ5.js";import"./use-connector-management-Bo6wOJQS.js";import"./AgentRequestCard--9GA9ymH.js";import"./access-copy-Cj31J6PU.js";import"./query-error-state-COuKRlU0.js";import"./empty-state-aNwJA6H8.js";import"./use-bindings-Bu4yLLR5.js";import"./connection-copy--MA7AN04.js";import"./KeyEntry-CSmznLcG.js";import"./use-room-sessions-W62Zl72O.js";import"./file-bSD5jgk_.js";import"./file-drag-GDx2qhdk.js";import"./find-latest-widget-fence-D01ENK2h.js";import"./WidgetErrorCard-I8WiJv2g.js";import"./index-D0yajRDv.js";import"./card-DI7YtQh3.js";import"./progress-eQl1UvNz.js";import"./table-B0LsKsEv.js";import"./package-CD8xq7hk.js";import"./heart-BrjEmIsl.js";import"./git-branch-ClXAt1_G.js";import"./file-text-DTvj1wzM.js";import"./paperclip-CzhXW5qi.js";import"./index-6yT0Qr0s.js";import"./RuntimeSetupDialog-Er-lzjmK.js";import"./inline-code-DwFNff3_.js";import"./list-runtime-types-B0CSonAi.js";import"./RuntimeConnectFlow-IaRVgmqH.js";import"./useMutationState-rOg4bnKv.js";import"./runtime-connect-Dn0T5YWv.js";import"./repeat-wB31CP7I.js";import"./format-duration-BCr6uzby.js";import"./mention-pill-Daeu1X92.js";import"./rotate-ccw-clock-LSKKAcnR.js";import"./unplug-DLA7Ib_s.js";import"./message-square-off-D9hm8WNH.js";import"./registry-BSucT23N.js";/**
|
|
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 yt={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"}]]};yt.node;const Cs=Mt(yt),ws=5e3;function Rs({connection:e}){var l;const s=e.official===!0&&e.status==="connected"&&((l=e.access)==null?void 0:l.state)==="unverified",n=f.useMemo(()=>s?{}:null,[s]),[a,i]=f.useState(null);return f.useEffect(()=>{if(!n)return;const d=setTimeout(()=>i(n),ws);return()=>clearTimeout(d)},[n]),n===null||a!==n?null:t.jsx(Ot,{tone:"info",role:"status",className:"m-3","data-testid":"official-space-unreachable",children:"The DorkOS community isn’t reachable right now. Try again in a few minutes."})}function vt(e,s){return[...z.remote(e,s),"teammates"]}function Ss(e,s=!0){const n=V(),a=Xe(s);return Ze({queryKey:a?vt(a,e):[...z.all,"owner","unresolved",e,"teammates"],queryFn:()=>$t(a,async()=>{const[i,l]=await Promise.all([n.getCommunityWakeAgentsFrom(e),n.getCommunityTeammateSpend(e)]);return{wakeAgentsFrom:i.wakeAgentsFrom,spend:l}}),enabled:s&&a!==null})}function ks(e){const s=V(),n=le(),a=Xe(!0);return we({mutationFn:async i=>{"wakeAgentsFrom"in i?await s.setCommunityWakeAgentsFrom(e,i.wakeAgentsFrom):await s.setCommunityTeammateSpendLimit(e,i.monthlyLimitUsd)},onSettled:async()=>{a&&await n.invalidateQueries({queryKey:vt(a,e)})}})}const bs=500,oe=new Map;function jt(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 Ee(e,s){if(s.size===0)return e;let n=!1;const a=e.map(i=>{const l=s.get(i.id),d=l?jt(i,l):i;return d!==i&&(n=!0),d});return n?a:e}function Ce(e,s,...n){const a=new Map;for(const i of n)for(const l of i){if(l.community!==e||l.roomId!==s)throw new Error("Community history contains a different room.");a.set(l.id,l)}return[...a.values()].sort((i,l)=>i.remoteSeq-l.remoteSeq)}function As(e,s,n=!0,a=0,i="legacy",l=!1,d){const c=V(),r=f.useRef(d);f.useEffect(()=>{r.current=d},[d]);const o=le(),h=ue(!0,i,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]),[y,N]=f.useState(()=>({address:u,room:null,entries:[],revisions:oe,deliveries:[],status:"connecting"}));return f.useEffect(()=>{if(!h||!n)return;const v=h,w=new AbortController;let g,O=0,A,_,Y=!1;N({address:u,room:null,entries:[],revisions:oe,deliveries:[],status:"connecting"});function M(){Y=!0,A=void 0,_=void 0,o.removeQueries({queryKey:z.remote(v,e)}),N({address:u,room:null,entries:[],revisions:oe,deliveries:[],status:"removed"})}async function q(){try{await c.subscribeRemoteCommunityRoom(e,s,C=>{var U;if(!(w.signal.aborted||Y||!X(v))){if(C.type==="closed"){(C.reason==="removed"||C.reason==="revoked")&&M();return}if(O=0,C.type==="snapshot")A=C.cursor??void 0,C.redactionCursor&&(_=C.redactionCursor),o.setQueryData(z.room(v,e,s),C.room),N(j=>({address:u,room:C.room,entries:Ee(Ce(e,s,j.address===u?j.entries:[],C.entries).slice(-500),j.address===u?j.revisions:oe),revisions:j.address===u?j.revisions:oe,deliveries:j.deliveries.filter(x=>!C.entries.some(I=>I.originIdempotencyKey===x.idempotencyKey)),status:C.stale?"offline":"live"}));else if(C.type==="revision"){const j=C.entry;C.redactionCursor&&(_=C.redactionCursor);const x=[...z.room(v,e,s),"entries"],b=o.getQueriesData({queryKey:x}).some(([,k])=>k==null?void 0:k.pages.some(F=>F.entries.some(H=>H.id===j.id)))||o.isFetching({queryKey:x})>0||((U=r.current)==null?void 0:U.call(r,j.id))===!0;o.setQueriesData({queryKey:x},k=>{if(!k)return k;let F=!1;const H=k.pages.map(Z=>{const re=Z.entries.map(ee=>jt(ee,j));return re.some((ee,me)=>ee!==Z.entries[me])?(F=!0,{...Z,entries:re}):Z});return F?{...k,pages:H}:k}),N(k=>{if(!b&&!k.entries.some(H=>H.id===j.id))return k;const F=new Map(k.revisions);for(F.delete(j.id),F.set(j.id,j);F.size>bs;)F.delete(F.keys().next().value);return{...k,entries:Ee(k.entries,F),revisions:F}})}else C.type==="deliveries"?N(j=>({...j,deliveries:C.deliveries.filter(x=>!j.entries.some(I=>I.originIdempotencyKey===x.idempotencyKey))})):(A=C.entry.cursor,N(j=>({...j,entries:Ce(e,s,j.entries,[C.entry]).slice(-500),deliveries:j.deliveries.filter(x=>x.idempotencyKey!==C.entry.originIdempotencyKey),status:"live"})))}},{since:A,redactions:_,signal:w.signal})}catch(C){if(w.signal.aborted||!X(v))return;const U=C&&typeof C=="object"&&"status"in C?C.status:void 0,j=C&&typeof C=="object"&&"code"in C?C.code:void 0;j==="COMMUNITY_DELETED"||j==="COMMUNITY_TAKEN_DOWN"?(M(),o.invalidateQueries({queryKey:z.connections(v)})):U===401||U===403||U===404?M():U===410&&j==="COMMUNITY_CURSOR_STALE"&&(A=void 0)}if(w.signal.aborted||Y||!X(v))return;const L=o.getQueryData(z.room(v,e,s));L&&o.setQueryData(z.room(v,e,s),{...L,stale:!0,writable:!1}),N(C=>({...C,room:C.room?{...C.room,stale:!0,writable:!1}:null,status:"offline"})),g=setTimeout(()=>{q()},Math.min(3e4,1e3*2**Math.min(O++,5)))}return q(),()=>{w.abort(),clearTimeout(g)}},[u,e,s,n,a,o,c,h,l]),y.address!==u||!h?{address:u,room:null,entries:[],revisions:oe,deliveries:[],status:"connecting"}:n?y:l?{...y,room:y.room?{...y.room,stale:!0,writable:!1}:null,deliveries:[],status:"offline"}:{address:u,room:null,entries:[],revisions:oe,deliveries:[],status:"removed"}}function Ds(e){var h;const s=Ut(),n=It(),a=e===void 0||(h=s.data)==null?void 0:h.find(u=>u.id===e),i=a!==void 0&&Lt(a)!==null,l=e===void 0||s.data!==void 0||s.isError,[d,c]=f.useState(void 0),r=e!==void 0&&d===e,o=f.useRef(void 0);return f.useEffect(()=>{!i||e===void 0||r||o.current===e||(o.current=e,n({roomId:e},{replace:!0,quiet:!0}).then(u=>{u||c(e)}))},[i,e,r,n]),l?i&&!r?"redirecting":"show":"pending"}function Ts(e,s,n){var c;const a=Ft(),i=Re(),l=e!==void 0&&((c=a.room)==null?void 0:c.id)===e,d=a.status!=="loading";return f.useEffect(()=>{l&&i({...xe.home(),search:{...s===void 0?{}:{thread:s},...n===void 0?{}:{entry:n}},replace:!0})},[l,s,n,i]),e===void 0?"show":l?"redirecting":d?"show":"pending"}function Es(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 Ms=new Set(["COMMUNITY_MUTED","COMMUNITY_SLOW_MODE","COMMUNITY_RULES_NOT_ACCEPTED"]);function Os(e){const s=e==null?void 0:e.code;return typeof s=="string"&&Ms.has(s)}function $s(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 Us(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 Is({community:e,roomId:s,enabled:n,accessFingerprint:a}){var Y;const i=V(),l=le(),d=ue(n,a,e),c=d?[...z.room(d,e,s),"standing"]:[...z.all,"owner","unresolved",e,"room",s,"standing"],r=Ze({queryKey:c,queryFn:()=>_t(d,()=>i.getRemoteCommunityStanding(e,s)),enabled:n&&d!==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}}),[o,h]=f.useState(null),[u,y]=f.useState(()=>Date.now()),N=(Y=r.data)!=null&&Y.mutedUntil?Date.parse(r.data.mutedUntil):null;f.useEffect(()=>{if(o!==null&&o>u){const M=setTimeout(()=>y(Date.now()),1e3);return()=>clearTimeout(M)}if(N!==null&&N>u){const M=setTimeout(()=>y(Date.now()),Math.min(N-u+50,1073741824));return()=>clearTimeout(M)}},[N,u,o]);const v=r.refetch,w=f.useCallback(M=>{if((M==null?void 0:M.code)==="COMMUNITY_SLOW_MODE"){const L=M.retryAfterMs;if(typeof L=="number"&&L>0){const C=Date.now();y(C),h(C+L)}return}v()},[v]),g=we({meta:{suppressErrorToast:!0},mutationFn:M=>i.acceptRemoteCommunityRules(e,M),onSuccess:M=>{l.setQueryData(c,q=>q&&{...q,rules:M})},onError:()=>void v()}),O=Us(r.data,u),A=o===null?0:Math.ceil((o-u)/1e3),_=O??(A>0?{kind:"slow",secondsLeft:A}:null);return{standing:r.data,hold:_,noteHold:w,accept:g}}const Ls=new Set(["COMMUNITY_DELETED","COMMUNITY_TAKEN_DOWN"]),Fs=30*6e4,he=new Map;function Nt(e,s,n){return JSON.stringify([e,s,n])}function Ct(e){return Date.now()-e<Fs}function Ks(e){for(const[s,n]of he)Ct(n.at)||he.delete(s);return he.get(e)}function _s(){return Date.now()}function Ps(e,s,n){he.set(e,{attachmentId:s,at:n})}function Be(e){for(const s of e.files)he.delete(Nt(e.ref,e.roomId,s.id))}function Je(e){return e.filter(s=>s.trim()).join(`
|
|
7
|
-
|
|
8
|
-
`)}function qs(e){const s=e==null?void 0:e.code;return typeof s=="string"&&Ls.has(s)}function De(e){return e.map(({id:s,file:n})=>({id:s,file:n,status:"pending",progress:0}))}function zs({ref:e,roomId:s,canSend:n,entries:a,onReceipt:i,draft:l,ownerKey:d,contextKey:c=d,onHold:r}){const o=V(),h=JSON.stringify([d,e,s,c]),u=Pt(l),y=u.text,N=f.useMemo(()=>De(u.files),[u.files]),v=f.useRef(l);f.useLayoutEffect(()=>{v.current=l},[l]);function w(m){const R=v.current;if(!R)return;const $=je.getState(),T=$.drafts[Ae(R)],E=m({text:(T==null?void 0:T.text)??"",files:De((T==null?void 0:T.files)??[])});$.write(R,{text:E.text,files:E.files.map(({id:P,file:B})=>({id:P,file:B}))})}function g(m){w(R=>({...R,text:m}))}function O(m){w(R=>({...R,files:m(R.files)}))}const[A,_]=f.useState(null);function Y(m){_(m===null?null:{address:h,context:c,message:m})}const[M,q]=f.useState([]),L=f.useRef(new Map),C=f.useRef(0),U=f.useRef(new Map),j=f.useRef(new Set),x=f.useRef(h),I=f.useRef(c),b=f.useRef(!0),k=f.useRef(n),F=f.useRef(i),H=f.useRef(r);f.useLayoutEffect(()=>{x.current=h,I.current=c,k.current=n,F.current=i,H.current=r},[h,n,c,i,r]),f.useEffect(()=>(b.current=!0,()=>{b.current=!1}),[]),f.useEffect(()=>{let m=!1;for(const R of a){if(!R.originIdempotencyKey)continue;const $=L.current.get(R.originIdempotencyKey);($==null?void 0:$.address)===x.current&&$.context===I.current&&L.current.delete(R.originIdempotencyKey)&&(Be($),m=!0)}m&&q([...L.current.values()])},[a]);function Z(){b.current&&q([...L.current.values()].filter(m=>m.address===x.current&&m.context===I.current).map(m=>({...m})))}async function re(m){var R,$;if(!(j.current.has(m.key)||!k.current||!b.current||m.address!==x.current)){j.current.add(m.key),m.status="sending",m.error=void 0,Z();try{!m.posted&&m.uploadedAt.some(E=>!Ct(E))&&(m.attachmentIds=[],m.uploadedAt=[],m.triedAt=[],m.uploadRound+=1);for(let E=m.attachmentIds.length;E<m.files.length;E++){if(!k.current||!b.current||m.address!==x.current)throw new Error("Reconnect to this channel, then try again.");const P=m.files[E],B=Nt(m.ref,m.roomId,P.id),J=Ks(B);if(J){m.attachmentIds.push(J.attachmentId),m.uploadedAt.push(J.at);continue}const te=(R=m.triedAt)[E]??(R[E]=_s()),W=await o.uploadRemoteCommunityAttachment(m.ref,m.roomId,P.file,m.uploadRound?`${m.key}:file:${E}:${m.uploadRound}`:`${m.key}:file:${E}`);Ps(B,W.id,te),m.uploadedAt.push(te),m.attachmentIds.push(W.id)}if(!k.current||!b.current||m.address!==x.current)throw new Error("Reconnect to this channel, then try again.");m.posted=!0;const T=await o.postRemoteCommunityEntry(m.ref,m.roomId,{text:m.text,parentEntryId:m.parentEntryId,attachmentIds:m.attachmentIds,idempotencyKey:m.key});L.current.delete(m.key),Be(m),b.current&&m.address===x.current&&m.context===I.current&&F.current(T)}catch(T){if(qs(T)&&ee(m)){L.current.delete(m.key);return}if(Os(T)&&ee(m)){L.current.delete(m.key),b.current&&m.address===x.current&&(($=H.current)==null||$.call(H,T));return}m.status="failed",m.error=T instanceof Error?T.message:"Not confirmed. Try this message again."}finally{j.current.delete(m.key),Z()}}}function ee(m){const{draft:R}=m.origin,$=Ae(R),T=je.getState(),E=T.drafts[$],P=(E==null?void 0:E.text)??"";let B=U.current.get($)??[];const J=Je(B.map(G=>G.origin.typed));let te=P;J&&P.startsWith(J)?te=P.slice(J.length).replace(/^\n+/,""):B=[];const W=[...B,m].sort((G,se)=>G.origin.seq-se.origin.seq),ye=new Set(W.flatMap(G=>G.files.map(se=>se.id))),ie=[...W.flatMap(G=>G.files.map(({id:se,file:fe})=>({id:se,file:fe}))),...((E==null?void 0:E.files)??[]).filter(G=>!ye.has(G.id))];return T.write(R,{text:Je([...W.map(G=>G.origin.typed),te]),files:ie}),$ in je.getState().drafts?(U.current.set($,W),!0):!1}function me(m){const R=v.current;if(!R||!k.current)return;const $=je.getState(),T=$.drafts[Ae(R)];if(!T||!T.text.trim()&&T.files.length===0)return;if(L.current.size>=30){Y("Too many messages waiting. Let them send, or retry them first.");return}const E=$.take(R),P=De(E.files),B={address:h,context:c,ref:e,roomId:s,key:crypto.randomUUID(),text:E.text.trim()?E.text:P.map(J=>J.file.name).join(", "),parentEntryId:m,files:P,attachmentIds:[],uploadedAt:[],triedAt:[],posted:!1,uploadRound:0,status:"sending",origin:{draft:R,typed:E.text,seq:C.current+=1}};L.current.set(B.key,B),Y(null),re(B)}return{text:y,setText:g,attachments:{staged:N,add(m){if(m.some(R=>R.size>25*1024*1024)){Y("Each file must be 25 MB or smaller.");return}O(R=>R.length+m.length>8?(Y("Attach up to eight files to one message."),R):[...R,...m.map($=>({id:crypto.randomUUID(),file:$,status:"pending",progress:0}))])},remove(m){O(R=>R.filter($=>$.id!==m))},retry(){},cancel(){O(()=>[])},hasFailed:!1,isUploading:!1,holdsSendWhileUploading:!1},deliveries:M.filter(m=>m.address===h&&m.context===c),error:(A==null?void 0:A.address)===h&&A.context===c?A.message:null,send:me,retry(m){const R=L.current.get(m);R&&re(R)}}}function wt({entry:e,onThread:s,onReport:n}){const a=V(),i=f.useId(),[l,d]=f.useState(null),[c,r]=f.useState(null),o={id:JSON.stringify([e.community,e.authorId]),kind:e.authorKind,displayName:e.authorDisplayName};async function h(u,y){if(c)return;r(u),d(null);let N;try{const v=await a.downloadRemoteCommunityAttachment(e.community,e.roomId,u);N=URL.createObjectURL(v);const w=document.createElement("a");w.href=N,w.download=Array.from(y,g=>g==="/"||g==="\\"||g.charCodeAt(0)<32?"_":g).join(""),document.body.append(w),w.click(),w.remove()}catch(v){d(v instanceof Error?v.message:"Couldn’t download the file. Try again.")}finally{N&&setTimeout(()=>URL.revokeObjectURL(N),1e3),r(null)}}return t.jsxs(pe.Root,{role:e.authorKind==="human"?"user":"assistant","aria-labelledby":i,children:[t.jsx(pe.Gutter,{author:o,at:e.createdAt}),t.jsxs(pe.Body,{children:[t.jsx(pe.Author,{id:i,author:o,at:e.createdAt}),t.jsxs(pe.Content,{children:[t.jsx(ys,{content:e.text}),e.attachments.map(u=>t.jsx(S,{variant:"outline",size:"sm",disabled:c!==null,onClick:()=>void h(u.id,u.name),className:"max-w-full",children:t.jsx("span",{className:"min-w-0 truncate",children:c===u.id?"Downloading…":u.name})},u.id)),l&&t.jsx("p",{role:"alert",className:"text-destructive text-sm",children:l}),s&&t.jsx(S,{variant:"ghost",size:"sm",onClick:()=>s(e.threadRootEntryId??e.id),children:e.depth===0?"Reply in thread":"Open thread"}),n&&t.jsx(S,{variant:"ghost",size:"sm",onClick:n,children:"Report"})]})]})]})}function Ys({community:e,roomId:s,online:n,canEnroll:a,accessFingerprint:i}){var j,x,I;const l=V(),d=le(),c=ue(!0,i,e),r=qt(e,a,i),o=zt(),h=et(e,a,i),[u,y]=f.useState(""),[N,v]=f.useState(""),[w,g]=f.useState(!1),[O,A]=f.useState(null),[_,Y]=f.useState(null),M=f.useId(),q=((j=r.data)==null?void 0:j.filter(b=>b.active))??[],L=((x=o.data)==null?void 0:x.agents.filter(b=>!q.some(k=>k.localAgentId===b.id)))??[];async function C(){c&&X(c)&&await d.invalidateQueries({queryKey:z.remote(c,e)})}async function U(b){if(b.preventDefault(),!u||w||!n||!a||!c)return;const k=c;g(!0),A(null);try{if(await l.enrollRemoteCommunityAgent(e,u,N.trim()?{handle:N.trim()}:{}),!X(k))return;y(""),v(""),await C()}catch(F){X(k)&&A(F instanceof Error?F.message:"Couldn’t add the agent. Try again.")}finally{X(k)&&g(!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."}),r.isError&&t.jsxs("p",{role:"alert",children:["Couldn’t load your agents in this space."," ",t.jsx(S,{variant:"ghost",size:"sm",onClick:()=>void r.refetch(),children:"Retry"})]}),(I=r.data)==null?void 0:I.map(b=>{var k;return t.jsx(Hs,{agent:b,roomId:s,online:n,canEnroll:a,takesDms:((k=h.data)==null?void 0:k.available)===!0,onChanged:C,onNotice:Y},b.localAgentId)}),o.isError&&t.jsx("p",{role:"alert",children:"Couldn’t load the agents on this computer."}),a&&L.length>0&&t.jsxs("form",{onSubmit:b=>void U(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(ae,{htmlFor:`${M}-agent`,children:"Local agent"}),t.jsxs(tt,{value:u,onValueChange:y,disabled:!n||w,children:[t.jsx(st,{id:`${M}-agent`,children:t.jsx(nt,{placeholder:"Choose an agent"})}),t.jsx(at,{children:L.map(b=>t.jsx(Te,{value:b.id,children:b.name},b.id))})]})]}),t.jsxs("div",{className:"min-w-40 flex-1 space-y-1",children:[t.jsx(ae,{htmlFor:`${M}-handle`,children:"Space handle (optional)"}),t.jsx(Me,{id:`${M}-handle`,value:N,onChange:b=>v(b.target.value),disabled:!n||w,placeholder:"Use the agent’s handle"})]}),t.jsx(S,{type:"submit",disabled:!u||!n||w,children:w?"Adding…":"Add to space"})]}),_&&t.jsx("p",{role:"status",className:"text-muted-foreground text-sm",children:_}),O&&t.jsx("p",{role:"alert",className:"text-destructive text-sm",children:O})]})}function Hs({agent:e,roomId:s,online:n,canEnroll:a,takesDms:i,onChanged:l,onNotice:d}){const c=V(),[r,o]=f.useState(null),[h,u]=f.useState(null),y=e.roomIds.includes(s),N=f.useId();async function v(g,O){if(!r){o(g),u(null);try{await O(),await l()}catch(A){u(A instanceof Error?A.message:"Couldn’t finish that. Try again.")}finally{o(null)}}}function w(g){d(g.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(S,{variant:"outline",size:"sm",disabled:r!==null||!a||!e.active||!y&&!n,onClick:()=>void v("membership",async()=>{y?w(await c.leaveRemoteCommunityAgentRoom(e.community,s,e.localAgentId)):await c.joinRemoteCommunityAgentRoom(e.community,s,e.localAgentId)}),children:y?"Leave channel":"Join channel"}),t.jsx(S,{variant:"ghost",size:"sm",disabled:r!==null||!a,onClick:()=>void v("stop",()=>c.haltRemoteCommunityAgent(e.community,s,e.localAgentId)),children:"Stop agent"}),t.jsxs(rt,{children:[t.jsx(Yt,{asChild:!0,children:t.jsx(S,{variant:"ghost",size:"sm",disabled:r!==null||!a,children:"Remove from space"})}),t.jsxs(it,{children:[t.jsxs(ot,{children:[t.jsxs(lt,{children:["Remove ",e.displayName,"?"]}),t.jsx(ct,{children:"It leaves every channel in this space. You can re-add it."})]}),t.jsxs(dt,{children:[t.jsx(ut,{children:"Cancel"}),t.jsx(Ht,{onClick:()=>void v("remove",async()=>w(await c.ejectRemoteCommunityAgent(e.community,e.localAgentId))),children:"Remove agent"})]})]})]})]}),i&&e.active&&t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Qt,{id:N,checked:e.acceptsDms===!0,disabled:r!==null||!a||!n,onCheckedChange:g=>void v("dms",()=>c.setRemoteCommunityAgentDms(e.community,e.localAgentId,g))}),t.jsx(ae,{htmlFor:N,className:"text-xs font-normal",children:"Takes direct messages"})]}),h&&t.jsx("p",{role:"status",className:"text-muted-foreground text-xs",children:h})]})}function Qs({community:e,agent:s,disabled:n,accessFingerprint:a}){const i=V(),l=Re(),d=le(),c=ue(!0,a,e),[r,o]=f.useState(!1),[h,u]=f.useState(null);async function y(){if(!r){o(!0),u(null);try{const N=await i.startRemoteCommunityDm(e,s.memberId);c&&await d.invalidateQueries({queryKey:z.dms(c,e)}),l({...xe.channels(),search:{community:e,id:N.roomId}})}catch(N){u(N.code===Bt?`${s.displayName} isn’t taking direct messages.`:"Couldn’t open the direct message. Try again.")}finally{o(!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(S,{variant:"ghost",size:"sm",disabled:n||r,onClick:()=>void y(),"aria-label":`Message ${s.displayName}`,children:"Message"})]})}function We(e){return`$${e.toFixed(2)}`}function Bs({community:e,online:s,canEnroll:n}){var w;const a=f.useId(),i=Ss(e),l=ks(e),d=(w=i.data)==null?void 0:w.spend,[c,r]=f.useState(null),o=(d==null?void 0:d.monthlyLimitUsd)!=null?String(d.monthlyLimitUsd):"",h=c??o,u=h.trim()===""?null:Jt(Number(h)),y=u===null||Number.isFinite(u)&&u>=Wt,N=u!==((d==null?void 0:d.monthlyLimitUsd)??null);function v(g){g.preventDefault(),!(!y||!N||l.isPending)&&l.mutate({monthlyLimitUsd:u},{onSuccess:()=>r(null)})}return!n&&!(d!=null&&d.hasAgentsHere)?null:t.jsxs("section",{className:"mt-3 space-y-2 border-t pt-3","aria-labelledby":`${a}-heading`,children:[t.jsx("h3",{id:`${a}-heading`,className:"text-sm font-medium",children:"Teammates"}),i.isError&&t.jsxs("p",{role:"alert",className:"text-sm",children:["Couldn’t load teammate settings."," ",t.jsx(S,{variant:"ghost",size:"sm",onClick:()=>void i.refetch(),children:"Retry"})]}),i.data&&d&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx(ae,{htmlFor:`${a}-wake`,children:"Who can wake your agents"}),t.jsxs(tt,{value:i.data.wakeAgentsFrom,onValueChange:g=>l.mutate({wakeAgentsFrom:g==="me"?"me":"members"}),disabled:!s||l.isPending,children:[t.jsx(st,{id:`${a}-wake`,className:"max-w-64",children:t.jsx(nt,{})}),t.jsxs(at,{children:[t.jsx(Te,{value:"members",children:"Anyone in this space"}),t.jsx(Te,{value:"me",children:"Only me"})]})]})]}),t.jsxs("form",{onSubmit:v,className:"space-y-1",children:[t.jsx(ae,{htmlFor:`${a}-limit`,children:"Monthly limit for teammates"}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("span",{className:"text-muted-foreground text-sm","aria-hidden":!0,children:"$"}),t.jsx(Me,{id:`${a}-limit`,inputMode:"decimal",value:h,onChange:g=>r(g.target.value),placeholder:"No limit","aria-invalid":!y,disabled:!s||l.isPending,className:"w-32"}),t.jsx(S,{type:"submit",size:"sm",disabled:!s||!y||!N||l.isPending,children:"Save"})]}),t.jsxs("p",{className:"text-muted-foreground text-xs",children:[d.monthlyLimitUsd===null?"No limit":`Limit ${We(d.monthlyLimitUsd)} a month`,` · ${We(d.spentUsd)} spent this month${d.approximate?", approximate":""}`]}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"Past the limit, teammates’ messages wake nobody. A running turn may go slightly over."}),!y&&t.jsx("p",{role:"alert",className:"text-destructive text-xs",children:"Enter at least $0.01, or leave it empty."})]}),l.isError&&t.jsx("p",{role:"alert",className:"text-destructive text-sm",children:"Couldn’t save. Try again."})]})]})}function Js(e,s){const n=new Date(e),a=n.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"});return n.toDateString()===s.toDateString()?a:`${n.toLocaleDateString([],{month:"short",day:"numeric",...n.getFullYear()===s.getFullYear()?{}:{year:"numeric"}})}, ${a}`}function Ws(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:Js(e.lastSeenAt,s)}}:null}function Gs({roster:e,failed:s,canMention:n,onMention:a,community:i,roomId:l,online:d,canEnroll:c,agentsKey:r,accessFingerprint:o}){var N,v,w;const u=((N=et(i,!0,o).data)==null?void 0:N.available)===!0,y=(w=(v=ge().data)==null?void 0:v.find(g=>g.ref===i))==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(g=>{var A;const O=Ws(g);return t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-2 text-sm",children:[t.jsxs("span",{children:[g.displayName,g.kind==="agent"?" · Agent":"",g.ownerMemberId&&` · owned by ${((A=e.members.find(_=>_.memberId===g.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&&g.kind==="agent"&&g.ownerMemberId!==y&&t.jsx(Qs,{community:i,agent:g,disabled:!d,accessFingerprint:o}),g.handle&&t.jsxs(S,{variant:"ghost",size:"sm",disabled:!n,onClick:()=>a(g.handle),children:["Mention @",g.handle]})]})]},g.memberId)}),c&&t.jsx(Ys,{community:i,roomId:l,online:d,canEnroll:!0,accessFingerprint:o},r),t.jsx(Bs,{community:i,online:d,canEnroll:c})]})}function Rt(e,s){return e instanceof Error&&e.message?e.message:s}function Vs({conduct:e,staff:s,onReadRules:n}){const{hold:a,standing:i}=e;return(a==null?void 0:a.kind)==="rules"?t.jsx("div",{className:"px-1 pb-1",children:t.jsx(S,{size:"sm",variant:"outline",onClick:n,children:"Read the rules"})}):a||s||!(i!=null&&i.slowModeSeconds)?null:t.jsxs("p",{className:"text-muted-foreground px-1 pb-1 text-xs",children:["Slow mode: one message every ",i.slowModeSeconds,"s."]})}function Xs({conduct:e,open:s,onOpenChange:n}){var l;const a=(l=e.standing)==null?void 0:l.rules,i=a?a.acceptedVersion>=a.version:!1;return t.jsx(Oe,{open:s,onOpenChange:n,children:t.jsxs($e,{className:"sm:max-w-lg",children:[t.jsxs(Ue,{children:[t.jsx(Ie,{children:"Space rules"}),t.jsx(Le,{children:i?"You accepted these rules.":"Accept these rules to post here."})]}),t.jsxs(Fe,{children:[t.jsx("div",{className:"max-h-[50vh] overflow-y-auto rounded-md border p-3 text-sm leading-relaxed whitespace-pre-wrap",children:(a==null?void 0:a.text)??"This space has no rules."}),e.accept.error&&t.jsx("p",{role:"alert",className:"text-destructive mt-2 text-sm",children:Rt(e.accept.error,"Couldn’t accept the rules. Try again.")})]}),t.jsxs(Ke,{children:[t.jsx(S,{variant:"outline",onClick:()=>n(!1),children:"Close"}),(a==null?void 0:a.text)&&!i&&t.jsx(S,{disabled:e.accept.isPending,onClick:()=>e.accept.mutate(a.version,{onSuccess:()=>n(!1)}),children:e.accept.isPending?"Accepting…":"Accept rules"})]})]})})}function Zs({community:e,accessFingerprint:s,currentName:n,open:a,onOpenChange:i}){return t.jsx(Oe,{open:a,onOpenChange:i,children:t.jsx($e,{className:"sm:max-w-md",children:a&&t.jsx(en,{community:e,accessFingerprint:s,currentName:n,onDone:()=>i(!1)})})})}function en({community:e,accessFingerprint:s,currentName:n,onDone:a}){const i=V(),l=le(),d=ue(!0,s,e),[c,r]=f.useState(n),o=we({meta:{suppressErrorToast:!0},mutationFn:u=>i.setRemoteCommunityDisplayName(e,u),onSuccess:async()=>{d&&await l.invalidateQueries({queryKey:z.content(d,e)}),a()}}),h=c.trim();return t.jsxs("form",{onSubmit:u=>{u.preventDefault(),h&&h!==n&&o.mutate(h)},children:[t.jsxs(Ue,{children:[t.jsx(Ie,{children:"Your name in this space"}),t.jsx(Le,{children:"Other spaces keep the name they show."})]}),t.jsxs(Fe,{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"remote-community-display-name",children:"Name"}),t.jsx(Me,{id:"remote-community-display-name",value:c,maxLength:128,autoComplete:"nickname",onChange:u=>r(u.target.value)}),o.error&&t.jsx("p",{role:"alert",className:"text-destructive text-sm",children:Rt(o.error,"Couldn’t change your name. Try again.")})]}),t.jsxs(Ke,{children:[t.jsx(S,{type:"button",variant:"outline",onClick:a,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:!h||h===n||o.isPending,children:o.isPending?"Saving…":"Save name"})]})]})}const tn=[{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 sn({entry:e,onClose:s}){return t.jsx(Oe,{open:e!==null,onOpenChange:n=>!n&&s(),children:t.jsx($e,{className:"sm:max-w-md",children:e&&t.jsx(nn,{entry:e,onClose:s},e.id)})})}function nn({entry:e,onClose:s}){const n=V(),a=f.useId(),[i,l]=f.useState(null),[d,c]=f.useState(""),r=we({meta:{suppressErrorToast:!0},mutationFn:o=>n.reportRemoteCommunityEntry(e.community,e.roomId,e.id,o),onSuccess:()=>{mt("Message reported"),s()}});return t.jsxs("form",{onSubmit:o=>{o.preventDefault(),i&&r.mutate({reason:i,...d.trim()?{note:d.trim()}:{}})},children:[t.jsxs(Ue,{children:[t.jsx(Ie,{children:"Report message"}),t.jsx(Le,{children:"This space’s owners and admins review reports."})]}),t.jsxs(Fe,{className:"space-y-4",children:[t.jsxs("p",{className:"text-muted-foreground line-clamp-3 text-sm",children:[e.authorDisplayName,": ",e.text]}),t.jsx(Gt,{"aria-label":"Reason",value:i??"",onValueChange:o=>l(o),children:tn.map(o=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Vt,{value:o.value,id:`${a}-${o.value}`}),t.jsx(ae,{htmlFor:`${a}-${o.value}`,children:o.label})]},o.value))}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ae,{htmlFor:`${a}-note`,children:"Note (optional)"}),t.jsx(Xt,{id:`${a}-note`,value:d,maxLength:Zt,onChange:o=>c(o.target.value),rows:3}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"Only owners and admins see this."})]}),r.error&&t.jsx("p",{role:"alert",className:"text-destructive text-sm",children:r.error instanceof Error&&r.error.message?r.error.message:"Couldn’t send the report. Try again."})]}),t.jsxs(Ke,{children:[t.jsx(S,{type:"button",variant:"outline",onClick:s,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:!i||r.isPending,children:r.isPending?"Sending…":"Send report"})]})]})}function an({agentDeliveries:e,drafts:s,entries:n,threadId:a,canSend:i,action:l,onRetryAgent:d,onRetryDraft:c}){return t.jsxs(t.Fragment,{children:[e.filter(r=>r.parentEntryId===(a??null)&&!n.some(o=>o.originIdempotencyKey===r.idempotencyKey)).map(r=>t.jsxs("div",{className:"border-t px-4 py-2 text-sm",role:"status",children:[t.jsxs("p",{className:"font-medium",children:[r.author.displayName," · Agent"]}),t.jsx("p",{className:"whitespace-pre-wrap",children:r.text}),r.attachments.map((o,h)=>t.jsx("span",{className:"mr-2",children:o.name},h)),t.jsx("p",{className:"text-muted-foreground",children:r.state==="pending"?"Waiting for the space to confirm…":r.failure==="expired"?"Not confirmed. Too late to try again.":"Not confirmed. Check the space and the agent’s channel access."}),r.state==="pending"&&r.retryable&&t.jsx(S,{variant:"outline",size:"sm",disabled:!i||l!==null,onClick:()=>d(r.idempotencyKey),children:l===`retry:${r.idempotencyKey}`?"Retrying…":"Retry now"})]},r.idempotencyKey)),s.filter(r=>r.parentEntryId===a&&!n.some(o=>o.originIdempotencyKey===r.key)).map(r=>t.jsxs("div",{className:"border-t px-4 py-2 text-sm",role:"status",children:[t.jsx("p",{className:"whitespace-pre-wrap",children:r.text}),r.files.map(o=>t.jsx("span",{className:"mr-2",children:o.file.name},o.id)),t.jsx("p",{className:"text-muted-foreground",children:r.status==="sending"?"Sending…":"Delivery not confirmed."}),r.error&&t.jsx("p",{children:r.error}),r.status==="failed"&&t.jsx(S,{variant:"outline",size:"sm",disabled:!i,onClick:()=>c(r.key),children:"Retry message"})]},r.key))]})}function rn(e,s){var l;const n=new Map;for(const d of e)d.thread&&n.set(d.id,{count:d.thread.replyCount,lastAt:d.thread.lastReplyAt,through:d.threadLastReplySeq});const a=new Map;for(const d of s){const c=d.threadRootEntryId;if(d.depth===0||c===null)continue;const r=(l=n.get(c))==null?void 0:l.through;if(r!==void 0&&d.remoteSeq<=r)continue;const o=a.get(c);a.set(c,{count:((o==null?void 0:o.count)??0)+1,newest:o&&o.newest.remoteSeq>d.remoteSeq?o.newest:d})}const i=new Map;for(const d of new Set([...n.keys(),...a.keys()])){const c=n.get(d),r=a.get(d),o=c===void 0?r.count:c.through===void 0?Math.max(c.count,(r==null?void 0:r.count)??0):c.count+((r==null?void 0:r.count)??0);i.set(d,{count:o,lastAt:(r==null?void 0:r.newest.createdAt)??c.lastAt,unread:0})}return i}const on={reactions:!1,threads:!0,runWith:!1,attachments:!0,mentions:!0,streamHealth:!0,presence:!1,turnStatus:!1,asks:!1};function ln({community:e,roomId:s,threadId:n,onThread:a,dmAgentName:i}){var qe,ze,Ye,He;const l=V(),c=(qe=ge().data)==null?void 0:qe.find(p=>p.ref===e),r=_e(c==null?void 0:c.access),o=ue(!0,r.fingerprint,e),{ownerAddress:h,contextAddress:u}=Es(o),y=le(),N=es(),v=ts(),w=(ze=N.data)==null?void 0:ze.destinations.find(p=>p.ref===e&&p.roomId===s),g=f.useRef(null),O=f.useRef(void 0),A=(w==null?void 0:w.scrollAnchorEntryId)??null,_=f.useCallback(p=>{if(!o||n)return;g.current&&clearTimeout(g.current),g.current=null;const D=p??null,K=O.current===void 0?A:O.current;D===null&&K===null||(g.current=setTimeout(()=>{g.current=null,O.current=D,v.mutate({ref:e,roomId:s,threadId:n??null,scrollAnchorEntryId:D})},400))},[o,e,v,A,s,n]);f.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]),f.useEffect(()=>{(c==null?void 0:c.status)==="reconnect-required"&&o&&y.removeQueries({queryKey:z.remote(o,e)})},[o,e,c==null?void 0:c.status,y]);const Y=ft(e,s,r.capabilities.read,r.fingerprint),[M,q]=f.useState(0),L=f.useRef([]),C=f.useCallback(p=>L.current.some(D=>D.id===p),[]),U=As(e,s,r.capabilities.stream,M,r.fingerprint,r.cacheReadable,C),j=U.status==="removed",x=j?null:U.room??Y.data,I=ss(e,s,n,!j&&r.capabilities.read&&(x==null?void 0:x.readable)===!0,r.fingerprint),b=pt(e,s,!j&&r.capabilities.read&&(x==null?void 0:x.readable)===!0,r.fingerprint),[k,F]=f.useState(()=>({address:u,entries:[]})),H=f.useMemo(()=>k.address===u?k.entries:[],[u,k]);f.useEffect(()=>{L.current=H},[H]);const[Z,re]=f.useState(0),[ee,me]=f.useState(!1),[Se,m]=f.useState(null),[R,$]=f.useState(null),T=Is({community:e,roomId:s,enabled:!j&&r.capabilities.read&&(x==null?void 0:x.readable)===!0,accessFingerprint:r.fingerprint}),E=(c==null?void 0:c.connectedHumanMemberId)??null,P=(Ye=b.data)==null?void 0:Ye.members.find(p=>p.memberId===E),B=p=>{var D;return p===E||((D=b.data)==null?void 0:D.members.some(K=>K.memberId===p&&K.ownerMemberId===E))===!0},[J,te]=f.useState({address:"",name:null,error:null}),W=J.address===u?J.name:null,ye=J.address===u?J.error:null,ie=f.useRef(null),G=f.useRef(null),se=f.useRef(null),fe=!j&&r.capabilities.post&&U.status==="live"&&(x==null?void 0:x.writable)===!0,ke=fe&&T.hold===null,ce=f.useMemo(()=>{var p;return j?[]:Ee(Ce(e,s,...((p=I.data)==null?void 0:p.pages.map(D=>D.entries))??[],U.entries,H),U.revisions)},[e,s,I.data,U.entries,U.revisions,H,j]),kt=f.useCallback(p=>{F(D=>({address:u,entries:Ce(e,s,D.address===u?D.entries:[],[p]).slice(-500)})),re(D=>D+1)},[u,e,s]);f.useLayoutEffect(()=>{var p;Z>0&&((p=se.current)==null||p.scrollToBottom())},[Z]);const bt=f.useMemo(()=>{var p;return o?{ownerKey:o.ownerKey,epoch:o.epoch,ref:e,generation:((p=o.connection)==null?void 0:p.generation)??0,roomId:s,threadId:n}:null},[o,e,s,n]),Q=zs({ref:e,roomId:s,canSend:ke,entries:ce,onReceipt:kt,draft:bt,ownerKey:h||"unresolved",contextKey:u||"unresolved",onHold:T.noteHold}),At=ce.filter(p=>n?p.id===n||p.threadRootEntryId===n:p.depth===0),Dt=f.useMemo(()=>{var p;return n?new Map:rn(((p=I.data)==null?void 0:p.pages.flatMap(D=>D.entries))??[],ce)},[n,I.data,ce]),Pe=At.flatMap(p=>{const D=Dt.get(p.id);return D?[{kind:"message",entry:p},{kind:"replies",rootId:p.id,summary:D}]:[{kind:"message",entry:p}]}),Tt=Pe.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 ${i??(x==null?void 0:x.title)??"this channel"}…`,canSend:ke,canSendReason:j?"You no longer have access to this channel.":T.hold?$s(T.hold):!r.capabilities.post&&r.cacheReadable?"This space is read-only.":x!=null&&x.archived?"This channel is archived.":x!=null&&x.joined?"Reconnecting. You can send once the space is back.":"Join this channel to send messages.",attachments:Q.attachments,async send(){Q.send(n)}};async function ve(p,D){if(W||!o)return;const K=o,de=u;te({address:de,name:p,error:null});try{if(await D(),!X(K))return;(p==="join"||p==="leave"||p.startsWith("retry:"))&&q(ne=>ne+1),await y.invalidateQueries({queryKey:z.remote(K,e)})}catch(ne){X(K)&&te({address:de,name:p,error:ne instanceof Error?ne.message:"Couldn’t finish that. Try again."})}finally{X(K)&&te(ne=>ne.address===de?{...ne,name:null}:ne)}}function Et(){var K;const p=ce.at(-1);if(n||I.hasNextPage||!p||U.status!=="live"||((K=ie.current)==null?void 0:K.address)===u&&ie.current.cursor===p.cursor||!o)return;const D=o;ie.current={address:u,cursor:p.cursor},l.setRemoteCommunityReadCursor(e,s,p.cursor).then(()=>{X(D)&&y.invalidateQueries({queryKey:z.rooms(D,e)})}).catch(()=>{var de;((de=ie.current)==null?void 0:de.address)===u&&(ie.current=null)})}return t.jsxs(Ne.Root,{surface:"room",capabilities:on,target:be,children:[t.jsxs("section",{className:"flex h-full min-h-0 flex-col","aria-label":(x==null?void 0:x.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(S,{variant:"ghost",size:"sm",onClick:()=>a(),children:"Back to channel"}),!j&&r.capabilities.post&&x&&!x.joined&&!x.stale&&t.jsx(S,{size:"sm",disabled:W!==null,onClick:()=>void ve("join",()=>l.joinRemoteCommunityRoom(e,s)),children:"Join channel"}),r.cacheReadable&&t.jsx(S,{variant:"ghost",size:"sm",disabled:j,onClick:()=>me(!ee),children:ee?"Hide members":"Members"}),((He=T.standing)==null?void 0:He.rules.text)&&t.jsx(S,{variant:"ghost",size:"sm",onClick:()=>m("rules"),children:"Rules"}),r.capabilities.post&&t.jsx(S,{variant:"ghost",size:"sm",onClick:()=>m("name"),children:"Your name"}),r.capabilities.enrollAgent&&t.jsx(S,{variant:"outline",size:"sm",disabled:W!==null,onClick:()=>void ve("stop",()=>l.haltRemoteCommunityRoom(e,s)),children:W==="stop"?"Stopping…":"Stop my agents"}),r.capabilities.post&&(x==null?void 0:x.joined)&&!i&&t.jsx(S,{variant:"ghost",size:"sm",disabled:W!==null||!fe,onClick:()=>void ve("leave",async()=>{await l.leaveRemoteCommunityRoom(e,s),o&&y.removeQueries({queryKey:z.room(o,e,s)})}),children:"Leave channel"})]}),ye&&t.jsx("p",{role:"alert",className:"text-destructive px-4 py-2 text-sm",children:ye}),j?t.jsx("p",{role:"status",className:"p-6 text-sm",children:"You no longer have access to this channel."}):t.jsxs(t.Fragment,{children:[U.status!=="live"&&t.jsx("p",{role:"status",className:"text-muted-foreground px-4 py-2 text-sm",children:U.status==="connecting"?"Connecting to the space…":"Space unavailable. Showing saved messages."}),Y.isError&&t.jsx("p",{role:"alert",className:"px-4 py-2 text-sm",children:"Couldn’t load this channel."}),ee&&t.jsx(Gs,{roster:b.data,failed:b.isError,canMention:fe,onMention:p=>{var D;Q.setText(`${Q.text}${Q.text&&!Q.text.endsWith(" ")?" ":""}@${p} `),(D=G.current)==null||D.focus()},community:e,roomId:s,online:U.status==="live",canEnroll:r.capabilities.enrollAgent,agentsKey:u,accessFingerprint:r.fingerprint}),I.isError&&t.jsxs("p",{role:"alert",className:"p-3 text-sm",children:["Some messages could not be loaded."," ",t.jsx(S,{variant:"ghost",size:"sm",onClick:()=>void I.refetch(),children:"Retry"})]}),I.hasNextPage&&t.jsx(S,{variant:"ghost",size:"sm",disabled:I.isFetchingNextPage,onClick:()=>void I.fetchNextPage(),children:"Load the next page of history"}),t.jsx(Ne.Timeline,{ref:se,conversationId:be.id,rows:Tt,label:n?"Space thread":"Space messages",busy:I.isFetching,resumeRow:()=>n?void 0:A??void 0,onTopRow:_,onReachedBottom:Et,onOpenThread:a,empty:t.jsx("p",{className:"text-muted-foreground p-6 text-sm",children:I.isPending?"Loading messages…":"No messages here yet."}),renderRow:(p,D)=>{const K=Pe[D.index];return K.kind==="message"?t.jsx(wt,{entry:K.entry,onThread:a,onReport:r.capabilities.post&&b.data&&!B(K.entry.authorId)?()=>$(K.entry):void 0}):t.jsx(hs,{summary:K.summary,open:!1,onOpen:()=>a(K.rootId)})}}),t.jsx(an,{agentDeliveries:U.deliveries,drafts:Q.deliveries,entries:ce,threadId:n,canSend:ke,action:W,onRetryAgent:p=>void ve(`retry:${p}`,()=>l.retryRemoteCommunityDelivery(e,s,p)),onRetryDraft:Q.retry}),Q.error&&t.jsx("p",{role:"alert",className:"text-destructive px-4 py-2 text-sm",children:Q.error}),t.jsx(Ne.Composer,{inputRef:G,aboveInput:t.jsx(Vs,{conduct:T,staff:["owner","admin"].includes((P==null?void 0:P.role)??""),onReadRules:()=>m("rules")}),className:"m-3",value:Q.text,onChange:Q.setText,onSubmit:()=>Q.send(n),input:{isStreaming:!1,contextKey:be.id,canSubmit:Q.text.trim().length>0||Q.attachments.staged.length>0}})]})]}),t.jsx(Xs,{conduct:T,open:Se==="rules",onOpenChange:p=>m(p?"rules":null)}),t.jsx(Zs,{community:e,accessFingerprint:r.fingerprint,currentName:(P==null?void 0:P.displayName)??"",open:Se==="name",onOpenChange:p=>m(p?"name":null)}),t.jsx(sn,{entry:R,onClose:()=>$(null)})]})}function cn({community:e,roomId:s}){var h,u;const n=ge(),a=(h=n.data)==null?void 0:h.find(y=>y.ref===e),i=_e(a==null?void 0:a.access),l=ft(e,s??"",!!s&&i.capabilities.read,i.fingerprint),{dm:d}=ht(e,s??"",!!s&&i.capabilities.read,i.fingerprint),c=(a==null?void 0:a.label)??"Space",r=s?d?ns(d):(u=l.data)==null?void 0:u.title:void 0,o=a===void 0&&n.fetchStatus==="fetching"||s!==void 0&&r===void 0&&l.fetchStatus==="fetching";return t.jsx(xt,{pending:o,children:r?`${c} · ${r}`:c})}function St(e){var s,n,a,i;return!e||e.status==="reconnect-required"?null:((n=(s=e.access)==null?void 0:s.lastKnown)==null?void 0:n.lifecycle)==="deleted"?"deleted":((i=(a=e.access)==null?void 0:a.lastKnown)==null?void 0:i.lifecycle)==="taken_down"?"taken-down":e.seemsGoneSince?"seems-gone":null}function Ge(e,s,n){return`${e} ${e===1?s:n}`}function dn(e,s){const n=[e>0?Ge(e,"message from your agents","messages from your agents"):null,s>0?Ge(s,"draft of yours","drafts of yours"):null].filter(i=>i!==null);if(n.length===0)return null;const a=n.length===1&&(e===1||s===1);return`${n.join(" and ")} ${a?"wasn’t":"weren’t"} sent.`}function un({connection:e,onRemoved:s}){const n=St(e),a=as(),[i,l]=f.useState(!1),{ownerKey:d}=rs(),c=is(d,e.ref),{copied:r,failed:o,copy:h}=os(),u=e.label,y=e.seemsGoneSince?new Date(e.seemsGoneSince).toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"}):null;function N(){a.mutate(e,{onSuccess:()=>{l(!1),mt.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",g=n==="taken-down"?`DorkOS removed its copy here. If ${u} returns, you can connect again.`:n==="deleted"?"DorkOS removed its copy from this computer.":`Since ${y}, ${u} says it doesn’t exist. Its channels, messages and files are still here.`,O=dn(v?e.undeliveredAgentMessages??0:0,c.length),A=c.length===0?null:c.length===1?"Your unsent draft is cleared too.":`Your ${c.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(Cs,{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:g}),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:r?"Copied.":o?"Couldn’t copy to the clipboard.":""}),t.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[c.length>0&&t.jsx(S,{variant:"outline",onClick:()=>void h(c.join(`
|
|
9
|
-
|
|
10
|
-
`)),children:r?"Copied":o?"Couldn’t copy":c.length===1?"Copy your draft":"Copy your drafts"}),t.jsx(S,{variant:v?"outline":"destructive",onClick:()=>l(!0),children:v?"Remove from DorkOS":"Remove local copy"})]}),t.jsx(rt,{open:i,onOpenChange:_=>{_||a.reset(),l(_)},children:t.jsxs(it,{children:[t.jsxs(ot,{children:[t.jsx(lt,{children:v?`Remove ${u} from DorkOS?`:`Remove your copy of ${u}?`}),t.jsx(ct,{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})]})})]}),a.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(dt,{children:[t.jsx(ut,{disabled:a.isPending,children:"Cancel"}),t.jsx(S,{variant:"destructive",disabled:a.isPending,onClick:N,children:a.isPending?"Removing…":v?"Remove from DorkOS":"Remove local copy"})]})]})})]})}function mn({connection:e,dateFormat:s}){var l,d;const n=vs(e);if(!n)return null;const[a,...i]=js(n,(d=(l=e.access)==null?void 0:l.lastKnown)==null?void 0:d.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(ls,{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:a}),i.map(c=>t.jsx("p",{children:c},c))]}),t.jsxs(S,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>ds(Ns(e)),children:["Open space",t.jsx(cs,{className:"size-3.5","aria-hidden":!0})]})]})}const fn={reactions:!1,threads:!1,runWith:!1,attachments:!1,mentions:!1,streamHealth:!1,presence:!1,turnStatus:!1,asks:!1};function pn({dm:e,localAgentId:s,access:n}){var r,o,h,u;const a=us(e.community,e.roomId,s,n),i=f.useRef(null),l=f.useRef(!0),d=(o=(r=a.data)==null?void 0:r.entries.at(-1))==null?void 0:o.id;f.useLayoutEffect(()=>{const y=i.current;y&&l.current&&(y.scrollTop=y.scrollHeight)},[d]);const c={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:fn,target:c,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:i,onScroll:y=>{const N=y.currentTarget;l.current=N.scrollHeight-N.scrollTop-N.clientHeight<40},className:"min-h-0 flex-1 overflow-auto py-2","aria-label":"Messages",children:[a.isError&&t.jsxs("p",{role:"alert",className:"px-4 text-sm",children:["Couldn’t load this direct message."," ",t.jsx(S,{variant:"ghost",size:"sm",onClick:()=>void a.refetch(),children:"Retry"})]}),((h=a.data)==null?void 0:h.entries.length)===0&&t.jsx("p",{className:"text-muted-foreground px-4 text-sm",children:"No messages yet."}),(u=a.data)==null?void 0:u.entries.map(y=>t.jsx(wt,{entry:y},y.id))]})]})})}function hn({community:e,roomId:s,children:n}){var d;const a=(d=ge().data)==null?void 0:d.find(c=>c.ref===e),i=_e(a==null?void 0:a.access),{dm:l}=ht(e,s,i.verified&&i.capabilities.read,i.fingerprint);return l?l.readOnly&&l.localAgentId?t.jsx(pn,{dm:l,localAgentId:l.localAgentId,access:i.fingerprint}):t.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[t.jsx(xn,{dm:l,accessFingerprint:i.fingerprint}),t.jsx("div",{className:"min-h-0 flex-1",children:n(l.agent.displayName)})]}):n()}function xn({dm:e,accessFingerprint:s}){var l;const a=(l=pt(e.community,e.roomId,!0,s).data)==null?void 0:l.members.find(d=>d.memberId===e.agent.memberId),i=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:` · ${i}’s agent · ${i} can read this`})]}),(a==null?void 0:a.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 gn(){const{id:e,community:s}=gt({from:"/_shell/channels"}),n=ms(s);return s&&!n.visible?n.isLoading?null:t.jsx(fs,{...xe.channels(),search:{},replace:!0}):t.jsxs(t.Fragment,{children:[s?t.jsx(cn,{community:s,roomId:e}):e===void 0&&t.jsx(xt,{children:"Channels"}),t.jsx(yn,{})]})}function yn(){const{id:e,thread:s,entry:n,community:a}=gt({from:"/_shell/channels"}),i=Re(),l=Ts(a?void 0:e,s,n),d=Ds(a?void 0:e),c=ps();return a&&e?t.jsx(Ve,{community:a,children:t.jsx(hn,{community:a,roomId:e,children:r=>t.jsx(ln,{community:a,roomId:e,threadId:s,dmAgentName:r,onThread:o=>{i({...xe.channels(),search:{community:a,id:e,thread:o}})}})},JSON.stringify([a,e]))}):a?t.jsx(Ve,{community:a,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(Qe,{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."})]})}):l==="pending"||d==="pending"?t.jsx("div",{className:"flex h-full flex-col","aria-busy":!0,children:t.jsx(xs,{})}):l==="redirecting"||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(Qe,{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:c?"Open one from All, at the bottom of the screen.":"Open one from the sidebar, or use + next to Channels."})]}):t.jsx(gs,{roomId:e,threadId:s,entrySeq:n,threadRoute:"/channels"})}function Ve({community:e,children:s}){var i;const n=Re(),a=(i=ge().data)==null?void 0:i.find(l=>l.ref===e);return a&&St(a)?t.jsx(un,{connection:a,onRemoved:()=>void n({...xe.channels(),search:{}})}):t.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[a&&t.jsx(mn,{connection:a}),a&&t.jsx(Rs,{connection:a}),t.jsx("div",{className:"min-h-0 flex-1",children:s})]})}const da=gn;export{da as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t}from"./index-CjUfPyOM.js";import{M as o}from"./Marketplace-BWDlXgwH.js";import{P as r}from"./page-container-B9sDc2wq.js";import"./PreviewRefusedNotice-CnqAE9sr.js";import"./shield-x-Dr4BZfo_.js";import"./card-DI7YtQh3.js";import"./empty-state-aNwJA6H8.js";import"./markdown-content-ysBIqFAg.js";import"./use-unclaimed-chats-D7SEUfiO.js";import"./use-bindings-Bu4yLLR5.js";import"./UnlinkDialog-DTuXHNsi.js";import"./use-dev-links-C0Zc30aj.js";import"./more-details-DHCpYDi7.js";import"./file-bSD5jgk_.js";import"./AgentPicker-DoGucmqI.js";import"./command-DpK0GpDM.js";import"./AgentOptionRow-D-QjHi5k.js";import"./useMutationState-rOg4bnKv.js";import"./file-exclamation-point-BcCIL-rE.js";import"./rotate-ccw-clock-LSKKAcnR.js";import"./path-input-Z2p922fj.js";function i(){return t.jsx(r,{width:"wide",children:t.jsx(o,{})})}const R=i;export{R as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-CjUfPyOM.js";import{P as r}from"./page-container-B9sDc2wq.js";import{M as e}from"./MarketplaceSourcesView-BhKzgkiO.js";import"./use-pending-read-BBBAnUYu.js";function t(){return o.jsx(r,{width:"reading",children:o.jsx(e,{})})}const s=t;export{s as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{S as o}from"./WorkView-_wehEEl-.js";import"./index-CjUfPyOM.js";import"./WidgetErrorCard-I8WiJv2g.js";import"./index-Dj4I8KcL.js";import"./PromptSuggestionChips-B9chKG4w.js";import"./primer-trigger-4qUY83SX.js";import"./use-is-below-desktop-BUS7OPGv.js";import"./use-notification-prefs-b8iKvzB4.js";import"./card-DI7YtQh3.js";import"./use-status-budget-CbmPFvpQ.js";import"./git-branch-ClXAt1_G.js";import"./use-update-config-Dfd7KMde.js";import"./settings-for-runtime-BoOa-ZFG.js";import"./RuntimeSetupDialog-Er-lzjmK.js";import"./inline-code-DwFNff3_.js";import"./list-runtime-types-B0CSonAi.js";import"./RuntimeConnectFlow-IaRVgmqH.js";import"./useMutationState-rOg4bnKv.js";import"./runtime-connect-Dn0T5YWv.js";import"./unverified-catalog-notice-CxBO_pta.js";import"./layers-DFZUUHM5.js";import"./cpu-DzCUBK-1.js";import"./banner-Ctq7kvQ0.js";import"./UnreadDivider-l_VZ7ECn.js";import"./composer-insert-BpyATrmR.js";import"./use-composer-prefs-BnjCX9pM.js";import"./McpAppFrame-BotrzoHd.js";import"./more-details-DHCpYDi7.js";import"./find-latest-widget-fence-D01ENK2h.js";import"./file-bSD5jgk_.js";import"./use-session-canvas-u63m2mYH.js";import"./rotate-cw-scTEKxeZ.js";import"./query-keys-DeYqUDia.js";import"./index.esm-Bb3LMu5X.js";import"./file-text-DTvj1wzM.js";import"./markdown-content-ysBIqFAg.js";import"./shield-x-Dr4BZfo_.js";import"./McpSigninBody-CdeX_lYs.js";import"./image-off-4yaoLh32.js";import"./format-duration-BCr6uzby.js";import"./use-connector-management-Bo6wOJQS.js";import"./AgentRequestCard--9GA9ymH.js";import"./access-copy-Cj31J6PU.js";import"./query-error-state-COuKRlU0.js";import"./empty-state-aNwJA6H8.js";import"./use-bindings-Bu4yLLR5.js";import"./connection-copy--MA7AN04.js";import"./KeyEntry-CSmznLcG.js";import"./index-D0yajRDv.js";import"./progress-eQl1UvNz.js";import"./table-B0LsKsEv.js";import"./package-CD8xq7hk.js";import"./heart-BrjEmIsl.js";import"./file-drag-GDx2qhdk.js";import"./paperclip-CzhXW5qi.js";import"./index-6yT0Qr0s.js";const mo=o;export{mo as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{E as o}from"./ExtensionPageRoute-BsGqTcyI.js";import"./index-CjUfPyOM.js";import"./empty-state-aNwJA6H8.js";import"./page-container-B9sDc2wq.js";import"./use-dev-links-C0Zc30aj.js";import"./UnlinkDialog-DTuXHNsi.js";const e=o;export{e as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{E as o}from"./ExtensionPageRoute-BsGqTcyI.js";import"./index-CjUfPyOM.js";import"./empty-state-aNwJA6H8.js";import"./page-container-B9sDc2wq.js";import"./use-dev-links-C0Zc30aj.js";import"./UnlinkDialog-DTuXHNsi.js";const e=o;export{e as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{U as a,C as n}from"./mermaid.core-B1mQMOXd.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import{W as Se,aU as Me,a1 as ne,r as s,jc as Ie,jd as Q,je as G,jf as H,g9 as le,jg as Ce,a7 as J,jh as ee,as as lt,ji as it,a3 as oe,jj as ct,jk as dt,jl as ut,jm as ft,aY as Te,jn as ht,j as e,x as Fe,T as pt,C as Ke,aq as mt,es as be,jo as xt,G as Pe,jp as gt,jq as yt,jr as vt,js as Z,jt as ue,fX as fe,fY as he,fZ as pe,f_ as me,f$ as xe,g0 as ge,g1 as ye,g2 as ve,B as W,b8 as Ct,ez as _e,ju as bt,jv as jt,a2 as ce,jw as He,dX as kt,jx as wt,jy as Et,jz as Dt,jA as Nt,aP as De,jB as Ue,a4 as Rt,g7 as St,a0 as Tt,hf as Ft,ec as Pt,gX as Ot,jC as Mt,cT as _t,cU as At,cW as Lt,cX as zt,cY as $t,dU as It,I as Kt,dB as Ht}from"./index-CjUfPyOM.js";import{t as ae,g as Ut,C as qt,n as qe,r as Qe,a as Qt,p as Bt,F as Yt,w as Wt,c as Be,b as Gt}from"./room-files-source-DXKpm43a.js";import{N as rs,R as os}from"./room-files-source-DXKpm43a.js";import{d as Vt}from"./query-keys-DeYqUDia.js";import{r as Xt,c as Zt}from"./composer-insert-BpyATrmR.js";import{u as Jt}from"./index-6yT0Qr0s.js";import{r as Ye,h as We,F as en}from"./file-drag-GDx2qhdk.js";import{R as Ge}from"./rotate-cw-scTEKxeZ.js";import{L as tn}from"./link-2-xieOmwOK.js";import{F as Ve}from"./file-bSD5jgk_.js";import{G as Xe}from"./git-branch-ClXAt1_G.js";import{M as nn}from"./more-details-DHCpYDi7.js";import"./markdown-content-ysBIqFAg.js";import"./file-exclamation-point-BcCIL-rE.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 Ze={name:"corner-left-up",size:24,node:[["path",{d:"M14 9 9 4 4 9",key:"1af5af"}],["path",{d:"M20 20h-7a4 4 0 0 1-4-4V4",key:"1blwi3"}]]};Ze.node;const sn=Se(Ze);/**
|
|
7
|
-
* @license lucide-react v1.48.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const Je={name:"file-plus",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]};Je.node;const et=Se(Je);/**
|
|
12
|
-
* @license lucide-react v1.48.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const tt={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};tt.node;const an=Se(tt);function ie(t,n,a){return["file-explorer","tree",t.scopeKey,n,t.filtersHidden?a:null]}function ke(t,n,a,x){return{queryKey:ie(t,n,a),queryFn:()=>t.list(n,{showHidden:a}),staleTime:Me.FILE_TREE_STALE_TIME_MS,gcTime:Me.FILE_TREE_GC_TIME_MS,refetchOnWindowFocus:!0,placeholderData:p=>p??x.getQueryData(ie(t,n,!a))}}const rn=[".git",".dork",".claude",".agents","node_modules"];function on(t){return t.startsWith(".")||rn.includes(t)}const Ne=["ROOM.md","README.md"];function Re(t){return Ne.some(n=>n.toLowerCase()===t.toLowerCase())}function nt(t){return t.filter(n=>!on(n.name))}function ln(t){if(t.reduce((p,c)=>c.type==="file"&&Re(c.name)?p+1:p,0)===0)return t;const a=[],x=[];for(const p of t)p.type==="file"&&Re(p.name)?a.push(p):x.push(p);return a.sort((p,c)=>Ne.findIndex(o=>o.toLowerCase()===p.name.toLowerCase())-Ne.findIndex(o=>o.toLowerCase()===c.name.toLowerCase())),[...a,...x]}const cn=/ copy(?: \d+)?$/;function Oe({name:t,isDir:n,taken:a}){const x=new Set(a);if(!x.has(t))return t;const p=n?-1:t.lastIndexOf("."),c=p>0,o=c?t.slice(p):"",m=(c?t.slice(0,p):t).replace(cn,"");for(let r=1;;r+=1){const l=r===1?`${m} copy${o}`:`${m} copy ${r}${o}`;if(!x.has(l))return l}}function Ae(t,n,a){return{name:n,path:t,type:a,size:0,mtime:Date.now(),isSymlink:!1}}function dn(t){const n=ne(),{source:a,showHidden:x,queryClient:p,inFlightRef:c}=t,o=a.cwd??"",[m,r]=s.useState(null),l=s.useCallback(async h=>{c.current+=1;try{return await h()}finally{c.current-=1}},[c]),u=s.useMemo(()=>{const h=g=>ie(a,g,x);return{getChildren:g=>{var w;return((w=p.getQueryData(h(g)))==null?void 0:w.entries)??[]},isLoaded:g=>p.getQueryData(h(g))!==void 0,takenNames:async g=>(await n.readFileTree(o,{path:g===Q?void 0:g,showHidden:!0})).entries.map(b=>b.name),snapshot:g=>p.getQueryData(h(g)),setChildren:(g,w)=>{p.setQueryData(h(g),b=>({entries:Ie(w((b==null?void 0:b.entries)??[]))}))},restore:(g,w)=>{p.setQueryData(h(g),w)},invalidate:g=>{p.invalidateQueries({queryKey:h(g),exact:!0}),p.invalidateQueries({queryKey:Vt.index(o)})}}},[p,n,o,a,x]),N=s.useCallback((h,g,w)=>l(async()=>{const b=ee(h,g),S=!u.getChildren(h).some(A=>A.path===b),K=u.snapshot(h);S&&u.setChildren(h,A=>[...A,Ae(b,g,w)]);try{return await n.createEntry(o,b,w),!0}catch(A){return S&&u.restore(h,K),ae(A,`Couldn’t create ${w==="dir"?"folder":"file"}`),!1}finally{u.invalidate(h)}}),[n,o,u,l]),F=s.useCallback((h,g)=>l(async()=>{if(g===h.name||g.length===0)return!0;const w=G(h.path),b=ee(w,g),S=u.getChildren(w).some(_=>_.path===b),K=u.snapshot(w),A={...h,name:g,path:b};S||u.setChildren(w,_=>_.map($=>$.path===h.path?A:$));try{return await n.renameEntry(o,h.path,b),H.getState().remapExpandedPaths(h.path,b),!0}catch(_){return S||u.restore(w,K),ae(_,"Couldn’t rename"),!1}finally{u.invalidate(w)}}),[n,o,u,l]),D=s.useCallback(h=>l(async()=>{const g=G(h.path),w=u.snapshot(g);u.setChildren(g,b=>b.filter(S=>S.path!==h.path));try{await n.deleteEntry(o,h.path,{recursive:!0}),H.getState().dropExpandedPaths(h.path)}catch(b){u.restore(g,w),ae(b,"Couldn’t delete")}finally{u.invalidate(g)}}),[n,o,u,l]),L=s.useCallback(h=>l(async()=>{const g=G(h.path);if(h.type==="file"){const w=u.snapshot(g);u.setChildren(g,b=>b.filter(S=>S.path!==h.path));try{await n.deleteEntry(o,h.path),H.getState().dropExpandedPaths(h.path)}catch(b){u.restore(g,w),ae(b,"Couldn’t delete")}finally{u.invalidate(g)}return}try{await n.deleteEntry(o,h.path),u.setChildren(g,w=>w.filter(b=>b.path!==h.path)),H.getState().dropExpandedPaths(h.path),u.invalidate(g)}catch(w){if(Ut(w)==="DIR_NOT_EMPTY"){r(h);return}ae(w,"Couldn’t delete")}}),[n,o,u,l]),C=s.useCallback(async()=>{const h=m;r(null),h&&await D(h)},[m,D]),U=s.useCallback(()=>r(null),[]),I=s.useCallback((h,g)=>l(async()=>{const w=G(h),b=le(h),S=ee(g,b);if(g===w||S===h||Ce(g,h))return;const K=u.getChildren(w).find(v=>v.path===h);if(!K)return;const A=u.isLoaded(g),_=A&&u.getChildren(g).some(v=>v.path===S),$={...K,name:b,path:S},Y=u.snapshot(w),P=A?u.snapshot(g):void 0;u.setChildren(w,v=>v.filter(z=>z.path!==h)),A&&!_&&u.setChildren(g,v=>[...v,$]);try{await n.renameEntry(o,h,S),H.getState().remapExpandedPaths(h,S)}catch(v){u.restore(w,Y),A&&!_&&u.restore(g,P),ae(v,"Couldn’t move")}finally{u.invalidate(w),A&&u.invalidate(g)}}),[n,o,u,l]),k=s.useCallback((h,g)=>l(async()=>{if(h.isDir&&Ce(g,h.path)){J.error(qt);return}let w;try{w=await u.takenNames(g)}catch(_){ae(_,"Couldn’t copy");return}const b=Oe({name:le(h.path),isDir:h.isDir,taken:w}),S=ee(g,b),K=u.isLoaded(g),A=K?u.snapshot(g):void 0;if(K){const _=u.getChildren(G(h.path)).find(Y=>Y.path===h.path),$=_?{..._,name:b,path:S}:Ae(S,b,h.isDir?"dir":"file");u.setChildren(g,Y=>[...Y,$])}try{await n.copyEntry(o,h.path,S)}catch(_){K&&u.restore(g,A),ae(_,"Couldn’t copy")}finally{u.invalidate(g)}}),[n,o,u,l]);return{createEntry:N,renameEntry:F,removeEntry:L,moveEntry:I,copyEntry:k,pendingRecursiveDelete:m,confirmRecursiveDelete:C,cancelRecursiveDelete:U}}function un(t){return t!=null&&t.startsWith("darwin")?"Reveal in Finder":t!=null&&t.startsWith("win32")?"Reveal in File Explorer":"Show in file manager"}function fn(t,n){const a=t.includes("\\")&&!t.includes("/"),x=t.replace(/[\\/]+$/,""),p=a?n.split("/").join("\\"):n;return`${x}${a?"\\":"/"}${p}`}function hn(t){const n=ne(),{data:a}=lt(),x=s.useMemo(()=>n.supportsReveal?un(a==null?void 0:a.platform):null,[n.supportsReveal,a==null?void 0:a.platform]),p=s.useCallback(async l=>{if(t)try{await n.revealEntry(t,l.path)}catch(u){ae(u,"Couldn’t open the file manager")}},[n,t]),{copy:c}=it(),o=s.useCallback(async(l,u)=>{const N=u==="absolute"&&t?fn(t,l.path):l.path;await c(N)||J.error("Couldn’t copy to the clipboard")},[t,c]),m=s.useCallback(l=>{Xt(Zt(l.path))||J.error("Open a chat to add this file")},[]),r=s.useCallback(l=>{H.getState().setClipboard({path:l.path,isDir:l.type==="dir"});try{navigator.clipboard.writeText(l.path).catch(()=>{})}catch{}},[]);return{revealLabel:x,reveal:p,copyPath:o,addToChat:m,copyToClipboard:r}}const pn=1e3;function mn(t){const{source:n,showHidden:a,queryClient:x,inFlightRef:p}=t,c=n.changes,[o,m]=s.useState(null),[r,l]=s.useState(null),[u,N]=s.useState(null),[F,D]=s.useState(0),L=s.useCallback(async d=>{p.current+=1,D(f=>f+1);try{return await d()}finally{p.current-=1,D(f=>f-1)}},[p]),C=s.useMemo(()=>{const d=f=>ie(n,f,a);return{listing:f=>x.getQueryData(d(f)),isLoaded:f=>x.getQueryData(d(f))!==void 0,entries:f=>{var T;return((T=x.getQueryData(d(f)))==null?void 0:T.entries)??[]},setEntries:(f,T)=>x.setQueryData(d(f),y=>({...y,entries:Ie(T((y==null?void 0:y.entries)??[]))})),restore:(f,T)=>x.setQueryData(d(f),T),fetch:f=>n.list(f,{showHidden:!0}),refreshAll:()=>{x.invalidateQueries({queryKey:["file-explorer","tree",n.scopeKey]}),x.invalidateQueries({queryKey:["file-explorer","preview",n.scopeKey]})}}},[x,n,a]),U=s.useCallback(async d=>{const f=C.listing(d);return(f==null?void 0:f.commit)!==void 0?f.commit:(await C.fetch(d)).commit??null},[C]),I=s.useCallback((d,f,T,y)=>{switch(d.status){case"changed":return!0;case"conflict":return N({kind:f,path:d.path,lastCommit:d.lastCommit,retry:()=>T(d.commit)}),!1;case"exists":return J.error(y===void 0?d.reason:qe(y)),!1;case"refused":return J.error(d.reason),!1}},[]),k=s.useCallback((d,f)=>{J.error(Qe(d)??f)},[]),h=s.useCallback((d,f,T)=>{const y=O=>L(async()=>{if(c===void 0)return!1;const E=G(d.path),R=G(f),j=le(f),q=C.isLoaded(R),te=q&&C.entries(R).some(X=>X.path===f),V=C.listing(E),de=R===E?void 0:C.listing(R),i={...d,name:j,path:f};te||(R===E?C.setEntries(E,X=>X.map(se=>se.path===d.path?i:se)):(C.setEntries(E,X=>X.filter(se=>se.path!==d.path)),q&&C.setEntries(R,X=>[...X,i])));const M=()=>{C.restore(E,V),R!==E&&q&&C.restore(R,de)};try{const X=O??await U(E);if(X===null)return M(),J.error("This room has no files to change yet."),!1;const se=await c.move({from:d.path,to:f,baseCommit:X}),we=I(se,T,async re=>{await y(re)},j);return we?H.getState().remapExpandedPaths(d.path,f):M(),we}catch(X){return M(),k(X,T==="rename"?"Couldn’t rename":"Couldn’t move"),!1}finally{C.refreshAll()}});return y(null)},[c,C,L,U,I,k]),g=s.useCallback(async(d,f)=>f===d.name||f.length===0?!0:h(d,ee(G(d.path),f),"rename"),[h]),w=s.useCallback(async(d,f)=>{const T=G(d),y=ee(f,le(d));if(f===T||y===d||Ce(f,d))return;const O=C.entries(T).find(E=>E.path===d);O&&await h(O,y,"move")},[C,h]),b=s.useCallback(async d=>{let f=0;const T=[d];for(;T.length>0;){const y=T.shift(),O=await C.fetch(y);for(const E of O.entries)if(E.type==="dir"?T.push(E.path):f+=1,f>=pn)return{count:f,moreThan:!0}}return{count:f,moreThan:!1}},[C]),S=s.useCallback(d=>{if(d.type!=="dir"){m({entry:d,fileCount:1,moreThan:!1});return}m({entry:d,fileCount:null,moreThan:!1}),b(d.path).then(({count:f,moreThan:T})=>m(y=>(y==null?void 0:y.entry.path)===d.path?{entry:d,fileCount:f,moreThan:T}:y),()=>{})},[b]),K=s.useCallback(d=>{const f=T=>L(async()=>{if(c===void 0)return;const y=G(d.path),O=C.listing(y);C.setEntries(y,E=>E.filter(R=>R.path!==d.path));try{const E=T??await U(y);if(E===null){C.restore(y,O);return}const R=await c.remove({path:d.path,baseCommit:E});I(R,"delete",q=>f(q))?H.getState().dropExpandedPaths(d.path):C.restore(y,O)}catch(E){C.restore(y,O),k(E,"Couldn’t delete")}finally{C.refreshAll()}});return f(null)},[c,C,L,U,I,k]),A=s.useCallback(async()=>{const d=o;m(null),d&&await K(d.entry)},[o,K]),_=s.useCallback(()=>m(null),[]),$=s.useCallback((d,f,T,y)=>{const O=E=>L(async()=>{if(c===void 0)return;const R=C.isLoaded(d),j=R?C.listing(d):void 0;if(R){const q=new Set(C.entries(d).map(V=>V.name)),te=f.filter(V=>!q.has(V.name)).map(V=>({name:V.name,path:ee(d,V.name),type:"file",size:V.size}));te.length>0&&C.setEntries(d,V=>[...V,...te])}try{const q=await c.upload({dir:d,baseCommit:E,replace:T,files:f});!I(q,"upload",V=>O(V))&&R&&C.restore(d,j)}catch(q){R&&C.restore(d,j),k(q,"Couldn’t upload")}finally{C.refreshAll()}});return O(y)},[c,C,L,I,k]),Y=s.useCallback(async(d,f)=>{if(c===void 0||f.length===0)return;if(f.length>c.maxUploadFiles){J.error(`Nothing was uploaded. One upload takes up to ${c.maxUploadFiles} files.`);return}let T;try{T=await C.fetch(d)}catch(j){k(j,"Couldn’t upload");return}const y=T.entries.map(j=>j.name),O=new Set(y),E=f.map(j=>j.name).filter(j=>O.has(j)),R=T.commit??null;if(E.length===0){await $(d,f,[],R);return}l({dir:d,files:f,names:E,taken:y,baseCommit:R})},[c,C,k,$]),P=s.useCallback(async d=>{const f=r;if(l(null),f===null)return;if(d==="replace"){await $(f.dir,f.files,f.names,f.baseCommit);return}const T=new Set([...f.taken,...f.files.map(E=>E.name)]),y=new Set(f.names),O=f.files.map(E=>{if(!y.has(E.name))return E;const R=Oe({name:E.name,isDir:!1,taken:T});return T.add(R),new File([E],R,{type:E.type,lastModified:E.lastModified})});await $(f.dir,O,[],f.baseCommit)},[r,$]),v=s.useCallback(()=>l(null),[]),z=s.useCallback(()=>N(null),[]),B=s.useMemo(()=>r===null?null:{dir:r.dir,names:r.names},[r]);return{renameEntry:g,moveEntry:w,requestDelete:S,pendingDelete:o,confirmDelete:A,cancelDelete:_,upload:Y,pendingClash:B,resolveClash:P,cancelClash:v,conflict:u,dismissConflict:z,busy:F>0}}const Le={scopeKey:"",cwd:null,writable:!1,provenance:!1,filtersHidden:!0,preview:"canvas",editable:!1,list:()=>Promise.resolve({entries:[]})};function xn(t){var d,f,T;const n=ne(),a=oe(),{setTheme:x}=ct(),p=H(y=>y.showHidden),c=H(y=>y.expanded),o=H(y=>y.loadExplorerForCwd),m=H(y=>y.pruneMissing),r=(t==null?void 0:t.scopeKey)??null,l=(t==null?void 0:t.cwd)??null;s.useEffect(()=>{o(r)},[r,o]);const u=s.useMemo(()=>[Q,...dt(c)],[c]),N=ut({queries:t?u.map(y=>ke(t,y,p,a)):[]}),F=(t==null?void 0:t.filtersHidden)??!0,D=s.useMemo(()=>{const y={};return u.forEach((O,E)=>{var q;const R=N[E];let j=((q=R==null?void 0:R.data)==null?void 0:q.entries)??[];!p&&!F&&(j=nt(j)),O===Q&&(j=ln(j)),y[O]={entries:j,loading:(R==null?void 0:R.isLoading)??!1,error:(R==null?void 0:R.isError)??!1}}),y},[u,N,p,F]),L=s.useRef(0),C=s.useRef({});s.useEffect(()=>{L.current>0||u.forEach((y,O)=>{var R,j,q;const E=(j=(R=N[O])==null?void 0:R.data)==null?void 0:j.entries;!E||(q=N[O])!=null&&q.isError||C.current[y]!==E&&(C.current[y]=E,m(y,E.map(te=>te.name)))})},[u,N,m]);const U=s.useMemo(()=>ft(c,D),[c,D]),I=!!t&&!!((d=D[Q])!=null&&d.loading),k=!!t&&!!((f=D[Q])!=null&&f.error),h=(T=N[0])==null?void 0:T.error,g=k&&h?Qt(h):void 0,w=(g==null?void 0:g.message)??null,b=(g==null?void 0:g.command)??null,S=s.useMemo(()=>{var O;const y=new Set;for(const E of u)E!==Q&&((O=D[E])!=null&&O.error)&&y.add(E);return y},[u,D]),K=s.useCallback(y=>{if(y.type!=="dir")return;const O=H.getState();O.setDirExpanded(y.path,!O.expanded[y.path])},[]),A=s.useCallback(y=>{if(y===Q)return;const O=H.getState();O.expanded[y]||O.setDirExpanded(y,!0)},[]),_=(t==null?void 0:t.preview)==="canvas",$=s.useCallback(y=>{if(y.type!=="file"||!_)return;const O={getStore:Te.getState,setTheme:x,supportsTerminal:n.supportsTerminal};ht(O,{action:"open_file",sourcePath:y.path},"user")},[_,x,n]),Y=s.useCallback(()=>{r!==null&&a.invalidateQueries({queryKey:["file-explorer","tree",r]})},[a,r]),P=s.useCallback(y=>{t!==null&&a.invalidateQueries({queryKey:ie(t,y,p),exact:!0})},[a,t,p]);s.useEffect(()=>{if(t!=null&&t.events)return t.events(Y)},[t,Y]);const v=dn({source:t??Le,showHidden:p,queryClient:a,inFlightRef:L}),z=mn({source:t??Le,showHidden:p,queryClient:a,inFlightRef:L}),B=hn(l);return{rows:U,rootLoading:I,rootError:k,rootErrorMessage:w,rootErrorCommand:b,errorPaths:S,toggleExpand:K,ensureExpanded:A,openFile:$,reload:Y,retryDir:P,changes:t!=null&&t.changes?z:null,...v,...B}}function gn(t){const{transport:n,cwd:a}=t;return{scopeKey:a,cwd:a,writable:!0,provenance:!1,filtersHidden:!0,preview:"canvas",editable:!1,list(x,p){return n.readFileTree(a,{path:x===""?void 0:x,showHidden:p.showHidden})}}}function je(t){return Array.from(t).includes("Files")}function st(t){const n=Array.from(t.items??[]);if(!(n.length>0&&n.every(c=>"webkitGetAsEntry"in c)))return{files:Array.from(t.files??[]),folders:0};const x=[];let p=0;for(const c of n){if(c.kind!=="file")continue;const o=c.webkitGetAsEntry();if(o!=null&&o.isDirectory){p+=1;continue}const m=c.getAsFile();m&&x.push(m)}return{files:x,folders:p}}const yn=12;function vn({row:t,selected:n,renaming:a,error:x,onSelect:p,onActivate:c,onRetry:o,onSubmitRename:m,onCancelRename:r,onNewFile:l,onNewFolder:u,onStartRename:N,onDelete:F,onMove:D,onCopyInto:L,onCopy:C,onPaste:U,onDuplicate:I,canPasteInto:k,revealLabel:h,onReveal:g,onAddToChat:w,onCopyPath:b,readOnly:S=!1,provenance:K=!1,copyable:A=!0,onDisk:_=!0,onUpload:$,onPickUpload:Y}){const{entry:P,depth:v,expanded:z,loading:B}=t,d=P.type==="dir",f=d?P.path:G(P.path),[T,y]=s.useState(!1),O=!d&&v===0&&Re(P.name),E=Bt(P.lastCommit),R=e.jsxs("div",{role:"treeitem","aria-label":P.name,"aria-expanded":d?z:void 0,"aria-selected":n,tabIndex:-1,onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),p(P),c(P))},draggable:!a&&!S,onDragStart:j=>{S||(j.dataTransfer.setData("text/plain",P.path),j.dataTransfer.setData(en,P.path),j.dataTransfer.effectAllowed="copyMove")},onDragOver:j=>{if(j.stopPropagation(),!S&&$&&je(j.dataTransfer.types)){j.preventDefault(),j.dataTransfer.dropEffect="copy",y(!0);return}S||!d||!We(j.dataTransfer.types)||(j.preventDefault(),j.dataTransfer.dropEffect=j.altKey&&A?"copy":"move",y(!0))},onDragLeave:()=>y(!1),onDrop:j=>{if(j.stopPropagation(),S)return;if(y(!1),$&&je(j.dataTransfer.types)){j.preventDefault();const{files:te}=st(j.dataTransfer);$(f,te);return}if(!d)return;const q=Ye(j.dataTransfer);q!==null&&(j.preventDefault(),j.altKey&&A?L(q,P.path):D(q,P.path))},onClick:()=>{p(P),c(P)},className:Pe("flex w-full cursor-pointer items-center gap-1 py-1 pr-2 text-sm transition-colors",n?"bg-accent text-foreground":"hover:bg-accent/50",T&&"ring-ring/60 bg-accent ring-1"),style:{paddingLeft:v*yn+8},children:[e.jsx("span",{className:"flex size-4 flex-shrink-0 items-center justify-center",children:d&&(B?e.jsx(Fe,{size:"xs",className:"text-muted-foreground"}):x?e.jsx("button",{type:"button","aria-label":"Retry loading",title:"Couldn’t load. Retry",onClick:j=>{j.stopPropagation(),o()},className:"flex items-center justify-center",children:e.jsx(Ge,{className:"text-destructive size-3.5"})}):z?e.jsx(pt,{className:"text-muted-foreground size-3.5"}):e.jsx(Ke,{className:"text-muted-foreground size-3.5"}))}),d?z?e.jsx(mt,{className:"size-(--size-icon-sm) flex-shrink-0 text-sky-500"}):e.jsx(be,{className:"size-(--size-icon-sm) flex-shrink-0 text-sky-500"}):P.isSymlink===!0?e.jsx(tn,{className:"text-muted-foreground size-(--size-icon-sm) flex-shrink-0"}):e.jsx(Ve,{className:"text-muted-foreground size-(--size-icon-sm) flex-shrink-0"}),a?e.jsx(Cn,{initialName:P.name,onSubmit:j=>m(P,j),onCancel:r}):e.jsx("span",{className:"min-w-0 flex-1 truncate",children:P.name}),O&&!a&&e.jsx(xt,{"aria-label":"Pinned to the top",className:"text-muted-foreground/60 size-3 flex-shrink-0"}),K&&!a&&e.jsx("span",{className:"text-muted-foreground/70 text-2xs max-w-[45%] flex-shrink-0 truncate tabular-nums",title:E.title??void 0,children:E.label})]});return S?R:e.jsxs(gt,{children:[e.jsx(yt,{asChild:!0,children:R}),e.jsxs(vt,{className:"w-52",children:[e.jsx(Z,{movesFocus:!0,onClick:()=>l(f),children:"New file"}),e.jsx(Z,{movesFocus:!0,onClick:()=>u(f),children:"New folder"}),Y&&e.jsx(Z,{onClick:()=>Y(f),children:"Upload files…"}),_&&e.jsxs(e.Fragment,{children:[e.jsx(ue,{}),h&&e.jsx(Z,{onClick:()=>g(P),children:h}),e.jsx(Z,{movesFocus:!0,onClick:()=>w(P),children:"Add to chat"})]}),A&&e.jsxs(e.Fragment,{children:[e.jsx(ue,{}),e.jsx(Z,{onClick:()=>C(P),children:"Copy"}),e.jsx(Z,{disabled:!k(f),onClick:()=>U(f),children:"Paste"}),e.jsx(Z,{onClick:()=>I(P),children:"Duplicate"})]}),e.jsx(ue,{}),_?e.jsxs(e.Fragment,{children:[e.jsx(Z,{onClick:()=>b(P,"absolute"),children:"Copy path"}),e.jsx(Z,{onClick:()=>b(P,"relative"),children:"Copy relative path"})]}):e.jsx(Z,{onClick:()=>b(P,"relative"),children:"Copy path"}),e.jsx(ue,{}),e.jsx(Z,{movesFocus:!0,onClick:()=>N(P),children:"Rename"}),e.jsx(Z,{variant:"destructive",onClick:()=>F(P),children:"Delete"})]})]})}function Cn({initialName:t,onSubmit:n,onCancel:a}){const x=s.useRef(null),[p,c]=s.useState(t);s.useEffect(()=>{const m=x.current;if(!m)return;m.focus();const r=t.lastIndexOf(".");m.setSelectionRange(0,r>0?r:t.length)},[t]);const o=()=>{const m=p.trim();m&&m!==t?n(m):a()};return e.jsx("input",{ref:x,type:"text",value:p,"aria-label":"New name",onChange:m=>c(m.target.value),onClick:m=>m.stopPropagation(),onBlur:o,onKeyDown:m=>{m.stopPropagation(),m.key==="Enter"?o():m.key==="Escape"&&a()},className:"border-border bg-background focus-ring min-w-0 flex-1 rounded border px-1 py-0 text-sm outline-none"})}const bn=100,jn=28,kn=250;function wn(t){const{rows:n,selectedPath:a,renamingPath:x,errorPaths:p,onSelectPath:c,onRetryDir:o}=t,m=s.useRef(null),r=H(v=>v.setScrollTop),l=H(v=>v.scopeKey),u=s.useCallback(v=>v.type==="dir"?t.onToggle(v):t.onOpen(v),[t]),N=Dn(t,u),F=n.length>bn,D=Jt({count:n.length,getScrollElement:()=>m.current,estimateSize:()=>jn,overscan:12,enabled:F}),L=s.useRef({scope:void 0,done:!1}),C=s.useRef(null);s.useLayoutEffect(()=>{const v=L.current;if(v.scope!==l&&(v.scope=l,v.done=!1),v.done||n.length===0)return;const z=m.current;if(!z)return;const B=H.getState().scrollTop;if(B<=0){v.done=!0;return}F?D.scrollToOffset(B):z.scrollTop=B,C.current=z.scrollTop,z.scrollTop>=B&&(v.done=!0)},[n.length,l,F,D]);const U=s.useRef(null),I=s.useRef(null),k=s.useCallback(()=>{const v=m.current;v&&v.scrollTop!==C.current&&(L.current.done=!0,U.current=v.scrollTop,I.current&&clearTimeout(I.current),I.current=setTimeout(()=>{I.current=null,U.current!==null&&r(U.current)},kn))},[r]);s.useEffect(()=>()=>{I.current&&clearTimeout(I.current),U.current!==null&&r(U.current)},[r]);const h=s.useRef(void 0);s.useEffect(()=>{var d,f;const v=h.current;if(h.current=a,v===void 0||a===v||a===null)return;const z=n.findIndex(T=>T.entry.path===a);if(z<0)return;const B=m.current;B&&(F?D.scrollToIndex(z,{align:"auto"}):(f=(d=B.querySelector(`[data-row-index="${z}"]`))==null?void 0:d.scrollIntoView)==null||f.call(d,{block:"nearest"}),C.current=B.scrollTop)},[a,n,F,D]);const[g,w]=s.useState(!1),{onCopyInto:b,onMove:S}=t,K=t.readOnly===!0,A=t.copyable!==!1,_=s.useCallback(v=>{K||!We(v.dataTransfer.types)||(v.preventDefault(),v.dataTransfer.dropEffect=v.altKey&&A?"copy":"move",w(!0))},[K,A]),$=s.useCallback((v,z)=>{const B=n.find(d=>d.entry.path===v);B&&b({path:v,isDir:B.entry.type==="dir"},z)},[n,b]),Y=s.useCallback(v=>{if(w(!1),K)return;const z=Ye(v.dataTransfer);z!==null&&(v.preventDefault(),v.altKey&&A?$(z,Q):S(z,Q))},[$,S,K,A]),P=v=>e.jsx(vn,{row:v,selected:v.entry.path===a,renaming:v.entry.path===x,error:v.entry.type==="dir"&&v.expanded&&p.has(v.entry.path),onSelect:z=>c(z.path),onActivate:u,onRetry:()=>o(v.entry.path),onSubmitRename:t.onSubmitRename,onCancelRename:t.onCancelRename,onStartRename:t.onStartRename,onNewFile:t.onNewFile,onNewFolder:t.onNewFolder,onDelete:t.onDelete,onMove:t.onMove,onCopyInto:$,onCopy:t.onCopy,onPaste:t.onPaste,onDuplicate:t.onDuplicate,canPasteInto:t.canPasteInto,revealLabel:t.revealLabel,onReveal:t.onReveal,onAddToChat:t.onAddToChat,onCopyPath:t.onCopyPath,readOnly:t.readOnly,provenance:t.provenance,copyable:t.copyable,onDisk:t.onDisk,onUpload:t.onUpload,onPickUpload:t.onPickUpload});return e.jsx("div",{ref:m,role:"tree","aria-label":"File explorer",tabIndex:0,onKeyDown:N,onScroll:k,onDragOver:_,onDragLeave:()=>w(!1),onDrop:Y,className:Pe("focus-visible:ring-ring h-full overflow-auto outline-none focus-visible:ring-1 focus-visible:ring-inset",g&&"ring-ring/60 bg-accent/30 ring-1 ring-inset"),children:F?e.jsx("div",{style:{height:D.getTotalSize()},className:"relative w-full",children:D.getVirtualItems().map(v=>e.jsx("div",{"data-row-index":v.index,className:"absolute top-0 left-0 w-full",style:{transform:`translateY(${v.start}px)`},children:P(n[v.index])},n[v.index].entry.path))}):n.map((v,z)=>e.jsx("div",{"data-row-index":z,children:P(v)},v.entry.path))})}function En(t){return t?t.type==="dir"?t.path:G(t.path):Q}function Dn(t,n){const{rows:a,selectedPath:x,renamingPath:p,onSelectPath:c}=t;return s.useCallback(o=>{var l,u,N,F;if(p!==null)return;const m=a.findIndex(D=>D.entry.path===x),r=m>=0?a[m]:void 0;if(o.metaKey||o.ctrlKey){if(t.readOnly===!0||t.copyable===!1)return;const D=o.key.toLowerCase();if(D==="c"&&r){o.preventDefault(),t.onCopy(r.entry);return}if(D==="v"){o.preventDefault(),t.onPaste(En(r==null?void 0:r.entry));return}return}switch(o.key){case"ArrowDown":o.preventDefault(),c(((l=a[Math.min(m+1,a.length-1)])==null?void 0:l.entry.path)??((u=a[0])==null?void 0:u.entry.path));break;case"ArrowUp":o.preventDefault(),c(((N=a[Math.max(m-1,0)])==null?void 0:N.entry.path)??((F=a[0])==null?void 0:F.entry.path));break;case"ArrowRight":(r==null?void 0:r.entry.type)==="dir"&&!r.expanded&&(o.preventDefault(),t.onToggle(r.entry));break;case"ArrowLeft":if(!r)break;if(o.preventDefault(),r.entry.type==="dir"&&r.expanded)t.onToggle(r.entry);else{const D=G(r.entry.path);D&&c(D)}break;case"Enter":r&&(o.preventDefault(),n(r.entry));break;case"F2":r&&t.readOnly!==!0&&(o.preventDefault(),t.onStartRename(r.entry));break;case"Delete":case"Backspace":r&&t.readOnly!==!0&&(o.preventDefault(),t.onDelete(r.entry));break}},[a,x,p,c,t,n])}const Nn={rename:"Rename it anyway",move:"Move it anyway",delete:"Delete it anyway",upload:"Upload mine over it"},Rn={rename:"nothing was renamed",move:"nothing was moved",delete:"nothing was deleted",upload:"nothing was uploaded"};function Sn(t){const{entry:n,fileCount:a,moreThan:x}=t;if(n.type!=="dir")return`“${n.name}” leaves the room’s files.`;const p=a===null?"everything in it":x?`the more than ${a.toLocaleString()} files in it`:a===1?"the 1 file in it":`the ${a.toLocaleString()} files in it`;return`“${n.name}” and ${p} leave the room’s files.`}const Tn="The room’s history keeps a copy. An agent can restore it.";function Fn({changes:t,onOpenTheirs:n,onReturnFocus:a}){var D;const x=L=>{L.preventDefault();const C=document.activeElement;C!==null&&C!==document.body||a()},{pendingDelete:p,pendingClash:c,conflict:o}=t,[m,r]=s.useState(p);p!==null&&p!==m&&r(p);const[l,u]=s.useState(c);c!==null&&c!==l&&u(c);const N=l===null?"":l.dir===Q?"The top folder":`“${l.dir}”`,F=(l==null?void 0:l.names.length)===1;return e.jsxs(e.Fragment,{children:[e.jsx(fe,{open:p!==null,onOpenChange:L=>!L&&t.cancelDelete(),children:e.jsxs(he,{onCloseAutoFocus:x,children:[e.jsxs(pe,{children:[e.jsx(me,{children:m===null?"":`Delete “${m.entry.name}”?`}),e.jsx(xe,{asChild:!0,children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{children:m===null?"":Sn(m)}),e.jsx("p",{children:Tn})]})})]}),e.jsxs(ge,{children:[e.jsx(ye,{onClick:t.cancelDelete,children:"Cancel"}),e.jsx(ve,{onClick:()=>void t.confirmDelete(),className:"bg-destructive hover:bg-destructive/90 dark:bg-destructive/60 text-white",children:(m==null?void 0:m.entry.type)==="dir"?"Delete folder":"Delete file"})]})]})}),e.jsx(fe,{open:c!==null,onOpenChange:L=>!L&&t.cancelClash(),children:e.jsxs(he,{onCloseAutoFocus:x,children:[e.jsxs(pe,{children:[e.jsx(me,{children:F?`Replace “${l==null?void 0:l.names[0]}”?`:`Replace ${(l==null?void 0:l.names.length)??0} files?`}),e.jsx(xe,{children:F?`${N} already has a file with this name. Replace it, or keep both.`:`${N} already has files named ${(l==null?void 0:l.names.join(", "))??""}. Replace them, or keep both.`})]}),e.jsxs(ge,{children:[e.jsx(ye,{onClick:t.cancelClash,children:"Cancel"}),e.jsx(W,{variant:"outline",onClick:()=>void t.resolveClash("keep-both"),children:"Keep both"}),e.jsx(ve,{onClick:()=>void t.resolveClash("replace"),children:"Replace"})]})]})}),e.jsx(fe,{open:o!==null,onOpenChange:L=>!L&&t.dismissConflict(),children:e.jsxs(he,{onCloseAutoFocus:x,children:[e.jsxs(pe,{children:[e.jsx(me,{children:"Somebody changed this first"}),e.jsx(xe,{children:o===null?"":`${((D=o.lastCommit)==null?void 0:D.author)??"Somebody"} changed “${o.path}” after you opened it, so ${Rn[o.kind]}.`})]}),(o==null?void 0:o.lastCommit)&&e.jsxs("p",{className:"text-muted-foreground text-xs",children:[o.lastCommit.subject," · ",Ct(o.lastCommit.at)]}),e.jsxs(ge,{children:[e.jsx(ye,{onClick:t.dismissConflict,children:"Cancel"}),e.jsx(W,{variant:"outline",onClick:()=>{o!==null&&(t.dismissConflict(),n(o.path))},children:"Open their version"}),e.jsx(ve,{onClick:()=>{o!==null&&(t.dismissConflict(),o.retry())},className:"bg-destructive hover:bg-destructive/90 dark:bg-destructive/60 text-white",children:o===null?"":Nn[o.kind]})]})]})})]})}function ze(t,n){return n.name===t?qe(t):`“${n.name}” is already there. Some computers ignore capital letters in names. Pick another name.`}const Pn="Folders can’t be uploaded. Drop the files inside instead.";function On({source:t,className:n,onCommands:a}={}){var de;const x=ne(),p=Te(i=>i.selectedCwd),c=s.useMemo(()=>p?gn({transport:x,cwd:p}):null,[x,p]),o=t===void 0?c:t,m=o!==null&&!o.writable,r=xn(o),l=r.changes,u=oe(),N=H(i=>i.showHidden),{rows:F,rootLoading:D,rootError:L,rootErrorMessage:C,rootErrorCommand:U,errorPaths:I}=r,k=H(i=>i.setCommands),h=H(i=>i.selectedPath),g=H(i=>i.setSelectedPath),w=H(i=>i.clipboard),[b,S]=s.useState(null),[K,A]=s.useState(null),[_,$]=s.useState(null),Y=s.useCallback(i=>$(i===null?null:{path:i,isNew:!1}),[]),P=s.useRef(null),v=s.useRef(Q),[z,B]=s.useState(!1),d=s.useCallback((i,M)=>{if(l!==null){if(M.length===0){J.error(Pn);return}r.ensureExpanded(i),l.upload(i,M)}},[l,r]),f=s.useRef(null),T=s.useCallback(()=>{var i,M;(M=(i=f.current)==null?void 0:i.querySelector('[role="tree"]'))==null||M.focus()},[]),y=s.useCallback(i=>{var M;v.current=i,(M=P.current)==null||M.click()},[]),O=s.useCallback(i=>w!==null&&!(w.isDir&&Ce(i,w.path)),[w]),E=s.useCallback((i,M)=>{r.ensureExpanded(i),_e.flushSync(()=>{A(null),S({parent:i,type:M})})},[r]),R=s.useCallback(i=>{_e.flushSync(()=>A(i.path))},[]),j=s.useRef({startCreate:E,reload:r.reload,pickUpload:y});s.useEffect(()=>{j.current={startCreate:E,reload:r.reload,pickUpload:y}});const q=l!==null;s.useEffect(()=>{if(m||a===void 0&&q)return;const i=a??k;return i({newFile:()=>j.current.startCreate(Q,"file"),newFolder:()=>j.current.startCreate(Q,"dir"),refresh:()=>j.current.reload(),...q&&{upload:()=>j.current.pickUpload(Q)}}),()=>i(null)},[k,a,m,q]);const te=s.useCallback(async i=>{var se;if(!b||o===null)return;const M=b;if(S(null),l!==null){const re=(((se=u.getQueryData(ie(o,M.parent,N)))==null?void 0:se.entries)??[]).find(ot=>ot.name.toLowerCase()===i.toLowerCase());if(M.type==="dir"){if(re!==void 0&&!(re.type==="dir"&&re.name===i)){J.error(ze(i,re));return}S({parent:ee(M.parent,i),type:"file",firstInFolder:i});return}if(re!==void 0){J.error(ze(i,re));return}const rt=ee(M.parent,i);$({path:rt,isNew:!0});return}await r.createEntry(M.parent,i,M.type)&&g(ee(M.parent,i))},[b,o,l,u,N,r,g]),V=s.useCallback(async(i,M)=>{A(null),(l?await l.renameEntry(i,M):await r.renameEntry(i,M))&&g(ee(G(i.path),M))},[l,r,g]);return o===null?t!==void 0?null:e.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-6 text-center text-sm",children:"Pick a folder to see its files."}):e.jsxs("div",{ref:f,className:Pe("flex h-full flex-col",z&&"ring-ring/60 bg-accent/30 ring-1 ring-inset",n),onDragOver:i=>{l===null||!je(i.dataTransfer.types)||(i.preventDefault(),i.dataTransfer.dropEffect="copy",B(!0))},onDragLeave:i=>{i.currentTarget.contains(i.relatedTarget)||B(!1)},onDrop:i=>{B(!1),!(l===null||!je(i.dataTransfer.types))&&(i.preventDefault(),d(Q,st(i.dataTransfer).files))},children:[l!==null&&e.jsx("input",{ref:P,type:"file",multiple:!0,hidden:!0,"aria-hidden":!0,tabIndex:-1,"data-testid":"room-files-upload-input",onChange:i=>{const M=Array.from(i.target.files??[]);i.target.value="",d(v.current,M)}}),e.jsxs("div",{className:"min-h-0 flex-1",children:[b&&e.jsx(Mn,{type:b.type,firstInFolder:b.firstInFolder,onSubmit:i=>void te(i),onCancel:()=>S(null)},`${b.parent}:${b.type}:${b.firstInFolder??""}`),D&&F.length===0?e.jsx("div",{className:"flex h-20 items-center justify-center",children:e.jsx(Fe,{size:"md",className:"text-muted-foreground",label:"Loading files"})}):L&&F.length===0?e.jsxs("div",{className:"text-muted-foreground flex min-h-20 flex-col items-center justify-center gap-2 px-4 py-3 text-center text-xs [overflow-wrap:anywhere]",children:[e.jsx("span",{children:C??"Couldn’t load files."}),U!==null&&e.jsx("code",{"aria-label":"Command that removes the settings",className:"bg-muted text-foreground block w-full rounded px-2 py-1.5 text-left font-mono select-all",children:U}),e.jsxs(W,{variant:"outline",size:"xs",onClick:r.reload,children:[e.jsx(Ge,{}),"Retry"]})]}):F.length===0&&!b?e.jsx("div",{className:"text-muted-foreground/60 flex h-20 items-center justify-center px-4 text-center text-xs",children:l!==null?"No files yet. Drop files here, or use Upload.":"Empty folder"}):e.jsx(wn,{rows:F,selectedPath:h,renamingPath:K,errorPaths:I,onSelectPath:g,onToggle:r.toggleExpand,onOpen:i=>{o.preview==="inline"?Y(i.path):r.openFile(i)},onRetryDir:r.retryDir,onSubmitRename:(i,M)=>void V(i,M),onCancelRename:()=>A(null),onStartRename:R,onNewFile:i=>E(i,"file"),onNewFolder:i=>E(i,"dir"),onDelete:i=>l?l.requestDelete(i):void r.removeEntry(i),onMove:(i,M)=>void(l?l.moveEntry(i,M):r.moveEntry(i,M)),onCopyInto:(i,M)=>void r.copyEntry(i,M),onCopy:r.copyToClipboard,onPaste:i=>{w&&r.copyEntry(w,i)},onDuplicate:i=>void r.copyEntry({path:i.path,isDir:i.type==="dir"},G(i.path)),canPasteInto:O,readOnly:m,provenance:o.provenance,copyable:l===null,onDisk:o.cwd!==null,onUpload:l?d:void 0,onPickUpload:l?y:void 0,revealLabel:r.revealLabel,onReveal:i=>void r.reveal(i),onAddToChat:r.addToChat,onCopyPath:(i,M)=>void r.copyPath(i,M)})]}),o.preview==="inline"&&e.jsx(Yt,{source:o,path:(_==null?void 0:_.path)??null,isNew:(_==null?void 0:_.isNew)??!1,onCreated:()=>{_!==null&&($({path:_.path,isNew:!1}),g(_.path))},onClose:()=>$(null)}),l!==null&&e.jsx(Fn,{changes:l,onOpenTheirs:i=>Y(i),onReturnFocus:T}),e.jsx(fe,{open:r.pendingRecursiveDelete!==null,onOpenChange:i=>!i&&r.cancelRecursiveDelete(),children:e.jsxs(he,{children:[e.jsxs(pe,{children:[e.jsxs(me,{children:["Delete “",(de=r.pendingRecursiveDelete)==null?void 0:de.name,"”?"]}),e.jsx(xe,{children:"This folder isn’t empty. Everything inside is deleted. This can’t be undone."})]}),e.jsxs(ge,{children:[e.jsx(ye,{onClick:r.cancelRecursiveDelete,children:"Cancel"}),e.jsx(ve,{onClick:()=>void r.confirmRecursiveDelete(),className:"bg-destructive hover:bg-destructive/90 dark:bg-destructive/60 text-white",children:"Delete folder"})]})]})})]})}function Mn({type:t,firstInFolder:n,onSubmit:a,onCancel:x}){const p=s.useRef(null),[c,o]=s.useState("");s.useEffect(()=>{var l;(l=p.current)==null||l.focus()},[]);const m=()=>{const l=c.trim();l?a(l):x()},r=e.jsxs("div",{className:"flex items-center gap-1",children:[t==="dir"?e.jsx(be,{className:"size-(--size-icon-sm) flex-shrink-0 text-sky-500"}):e.jsx(Ve,{className:"text-muted-foreground size-(--size-icon-sm) flex-shrink-0"}),e.jsx("input",{ref:p,type:"text",value:c,"aria-label":n!==void 0?`First file in ${n}`:t==="dir"?"New folder name":"New file name",placeholder:t==="dir"?"folder-name":"file-name",onChange:l=>o(l.target.value),onBlur:m,onKeyDown:l=>{l.key==="Enter"?m():l.key==="Escape"&&x()},className:"border-border bg-background focus-ring min-w-0 flex-1 rounded border px-1 py-0 text-sm outline-none"})]});return n===void 0?e.jsx("div",{className:"px-3 py-1",children:r}):e.jsxs("div",{className:"space-y-1 px-3 py-1",children:[e.jsxs("p",{className:"text-muted-foreground flex min-w-0 items-center gap-1 text-xs",children:[e.jsx(be,{className:"size-(--size-icon-xs) flex-shrink-0 text-sky-500"}),e.jsx("span",{className:"truncate",children:n})]}),r,e.jsx("p",{className:"text-muted-foreground text-2xs",children:"Name its first file. The folder appears on save."})]})}function at(){const t=H(x=>x.showHidden),n=H(x=>x.setShowHidden),a=t?"Hide hidden files":"Show hidden files";return e.jsx(W,{variant:"ghost",size:"icon-xs","aria-label":a,title:a,onClick:()=>n(!t),children:t?e.jsx(bt,{className:"text-muted-foreground"}):e.jsx(jt,{className:"text-muted-foreground"})})}function _n({cwd:t}){const n=ne(),{data:a}=ce({queryKey:["file-explorer","workspace",t],queryFn:()=>n.resolveWorkspace(t),staleTime:6e4});return a!=null&&a.branch?e.jsxs("span",{className:"text-muted-foreground bg-muted/50 text-2xs inline-flex min-w-0 items-center gap-1 rounded px-1.5 py-0.5",title:`Workspace ${a.key} on ${a.branch}`,children:[e.jsx(Xe,{className:"size-3 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:a.branch})]}):null}function es(){const t=Te(a=>a.selectedCwd),n=H(a=>a.commands);return t?e.jsxs(e.Fragment,{children:[e.jsx(_n,{cwd:t}),e.jsx(W,{variant:"ghost",size:"icon-xs","aria-label":"New file",title:"New file",onClick:()=>n==null?void 0:n.newFile(),children:e.jsx(et,{className:"text-muted-foreground"})}),e.jsx(W,{variant:"ghost",size:"icon-xs","aria-label":"New folder",title:"New folder",onClick:()=>n==null?void 0:n.newFolder(),children:e.jsx(He,{className:"text-muted-foreground"})}),e.jsx(at,{}),e.jsx(W,{variant:"ghost",size:"icon-xs","aria-label":"Refresh",title:"Refresh",onClick:()=>n==null?void 0:n.refresh(),children:e.jsx(kt,{className:"text-muted-foreground"})})]}):null}function An({roomId:t}){const n=ne(),a=oe(),x=ce(Ue(n,t));s.useEffect(()=>Wt(a,t,()=>{a.invalidateQueries({queryKey:De.repoStatus(t)})}),[a,t]);const p=s.useMemo(()=>{var r;return((r=x.data)==null?void 0:r.kind)==="ok"?wt(x.data.status):[]},[x.data]),c=Et(p),o=Dt(p);if(!o)return null;const m=p.map((r,l)=>`${c[l]}: ${Nt(r)}`);return e.jsxs("span",{"data-slot":"pending-work-badge",title:m.join(`
|
|
17
|
-
`),className:"text-muted-foreground bg-muted/50 text-2xs inline-flex min-w-0 items-center gap-1 rounded px-1.5 py-0.5",children:[e.jsx(Xe,{className:"size-3 flex-shrink-0"}),e.jsxs("span",{className:"sr-only",children:["Not merged into the room yet. ",m.join(". "),"."]}),e.jsx("span",{"aria-hidden":"true",className:"truncate",children:o})]})}const Ln={added:"added",modified:"changed",deleted:"deleted",untracked:"new"},zn=new Map([["OPERATOR_ONLY","Only the owner of this DorkOS can keep or discard these."],["ROOM_FILE_NOT_FOUND","One of those changes is gone, so nothing was discarded. The list is refreshed."],["MERGE_IN_FLIGHT","Something else is writing to these files. Nothing changed. Try again in a moment."],["MAIN_CHECKOUT_DIRTY","These files are on another branch. Switch them back to main yourself."],["ROOM_REPO_GIT_UNAVAILABLE","Room files need git, and git isn’t installed on this computer."],["ROOM_HAS_NO_REPO","This room no longer has its own files."],["ROOM_REPOS_DISABLED","Room files are turned off on this install."]]);function $n({roomId:t}){var U,I;const n=ne(),a=oe(),x=ce(Ue(n,t)),[p,c]=s.useState([]),[o,m]=s.useState(!1),[r,l]=s.useState(null),u=Rt({mutationFn:k=>n.repairRoomMain(t,k),onSuccess:()=>{c([]),m(!1),l(null),a.invalidateQueries({queryKey:De.repoStatus(t)})},onError:k=>{m(!1);const h=zn.get(St(k)??"");l(h??"Couldn’t update the files. Try again in a moment."),a.invalidateQueries({queryKey:De.repoStatus(t)})}});if(((U=x.data)==null?void 0:U.kind)==="unavailable")return e.jsx("p",{role:"alert","data-slot":"room-main-warning",className:"border-border/60 text-muted-foreground rounded-lg border px-3 py-2.5 text-xs",children:"Couldn’t check this room’s files. Saves may not work. Try again soon."});const N=((I=x.data)==null?void 0:I.kind)==="ok"?x.data.status.main:void 0;if(N===void 0||!N.dirty)return null;const F=N.branch!=="main",D=p.filter(k=>N.strays.some(h=>h.path===k)),L=o&&D.length>0,C=k=>c(h=>h.includes(k)?h.filter(g=>g!==k):[...h,k]);return e.jsxs("div",{"data-slot":"room-main-warning",className:"border-border/60 bg-muted/40 space-y-3 rounded-lg border px-3 py-2.5 text-sm",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Tt,{className:"text-muted-foreground mt-0.5 size-(--size-icon-sm) flex-shrink-0"}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("div",{role:"alert",className:"space-y-1",children:[e.jsx("p",{className:"font-medium",children:"Somebody changed this room’s files outside DorkOS"}),F?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:`This room’s files are on ${N.branch??"no branch"}, not main.`}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Saves and agent merges wait until they’re back on main."})]}):e.jsx("p",{className:"text-muted-foreground text-xs",children:"Saves and agent merges wait until you keep or discard these."})]}),F&&e.jsx(nn,{className:"text-xs",children:e.jsx("p",{children:"DorkOS won’t switch the branch for you. There may be work on it."})})]})]}),!F&&e.jsxs(e.Fragment,{children:[e.jsx("ul",{className:"space-y-1.5",children:N.strays.map(k=>e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(Ft,{id:`stray-${t}-${k.path}`,checked:D.includes(k.path),onCheckedChange:()=>C(k.path),disabled:u.isPending}),e.jsx("label",{htmlFor:`stray-${t}-${k.path}`,className:"min-w-0 flex-1 cursor-pointer truncate font-mono text-xs",title:k.path,children:k.path}),e.jsx("span",{className:"text-muted-foreground flex-shrink-0 text-xs",children:Ln[k.kind]})]},k.path))}),N.strayCount>N.strays.length&&e.jsxs("p",{className:"text-muted-foreground text-xs",children:["…and ",N.strayCount-N.strays.length," more not shown. “Keep them all” keeps these too."]}),L?e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs",children:D.length===1?"Discard this change? It can’t be undone.":`Discard these ${D.length} changes? They can’t be undone.`}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(W,{type:"button",variant:"ghost",size:"sm",disabled:u.isPending,onClick:()=>m(!1),children:"Cancel"}),e.jsx(W,{type:"button",variant:"destructive",size:"sm",disabled:u.isPending,onClick:()=>u.mutate({action:"discard",paths:[...D]}),children:D.length===1?"Discard change":`Discard ${D.length} changes`})]})]}):e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(W,{type:"button",variant:"outline",size:"sm",disabled:u.isPending,onClick:()=>u.mutate({action:"commit"}),children:"Keep them all"}),e.jsx(W,{type:"button",variant:"ghost",size:"sm",disabled:u.isPending||D.length===0,onClick:()=>m(!0),children:D.length===0?"Discard…":`Discard ${D.length}`})]})]}),r!==null&&e.jsx("p",{role:"alert",className:"text-destructive text-xs",children:r})]})}const Ee="pointer-coarse:size-11";function ts({roomId:t,canChange:n}){const a=ne(),x=oe(),p=H(F=>F.showHidden),[c,o]=s.useState(null),m=s.useMemo(()=>Be({transport:a,queryClient:x,roomId:t,canChange:n}),[a,x,t,n]),r=ce(ke(m,Q,p,x)),l=r.isSuccess&&r.data.absent!==!0||r.isError,[u,N]=s.useState(null);return l&&u!==t&&N(t),!l&&u!==t?null:e.jsxs("section",{"aria-label":"Room files",className:"space-y-2",children:[e.jsxs("header",{className:"flex items-center gap-2",children:[e.jsx(Pt,{className:"text-muted-foreground size-(--size-icon-sm) flex-shrink-0"}),e.jsx("h3",{className:"text-muted-foreground text-xs font-medium tracking-wide uppercase",children:"Files"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(An,{roomId:t})}),n&&e.jsxs(e.Fragment,{children:[e.jsx(W,{variant:"ghost",size:"icon-xs",className:Ee,"aria-label":"New file",title:"New file",disabled:c===null,onClick:()=>c==null?void 0:c.newFile(),children:e.jsx(et,{className:"text-muted-foreground"})}),e.jsx(W,{variant:"ghost",size:"icon-xs",className:Ee,"aria-label":"New folder",title:"New folder",disabled:c===null,onClick:()=>c==null?void 0:c.newFolder(),children:e.jsx(He,{className:"text-muted-foreground"})}),e.jsx(W,{variant:"ghost",size:"icon-xs",className:Ee,"aria-label":"Upload files",title:"Upload files",disabled:(c==null?void 0:c.upload)===void 0,onClick:()=>{var F;return(F=c==null?void 0:c.upload)==null?void 0:F.call(c)},children:e.jsx(an,{className:"text-muted-foreground"})})]}),e.jsx(at,{})]}),e.jsx($n,{roomId:t}),e.jsx("div",{"data-slot":"room-files-body",className:"border-border/60 h-72 overflow-hidden rounded-lg border",children:e.jsx(On,{source:m,onCommands:o})})]})}function ns({roomId:t,attachment:n}){var l;const a=ne(),x=oe(),p=s.useMemo(()=>Be({transport:a,queryClient:x,roomId:t}),[a,x,t]),c=ce(ke(p,Q,!1,x)),[o,m]=s.useState(!1),r=Ot(t);return!c.isSuccess||c.data.absent===!0||((l=r.data)==null?void 0:l.archived)!==!1?null:e.jsxs(e.Fragment,{children:[e.jsx(W,{type:"button",variant:"ghost",size:"icon-xs","aria-label":`Save ${n.name} to the room’s files`,title:"Save to room files",className:"text-muted-foreground hover:text-foreground mt-0.5 pointer-coarse:size-11",onClick:()=>m(!0),children:e.jsx(Mt,{})}),o&&e.jsx(In,{roomId:t,source:p,attachment:n,onClose:()=>m(!1)})]})}function In({roomId:t,source:n,attachment:a,onClose:x}){const p=ne(),c=oe(),[o,m]=s.useState(Q),[r,l]=s.useState(a.name),[u,N]=s.useState(null),[F,D]=s.useState(!1),L=s.useId(),C=ce(ke(n,o,!1,c)),U=s.useMemo(()=>{var k;return nt(((k=C.data)==null?void 0:k.entries)??[]).filter(h=>h.type==="dir")},[C.data]),I=async()=>{var h,g;const k=r.trim();if(k!==""){D(!0),N(null);try{await p.saveAttachmentToRoomFiles(t,{attachmentId:a.id,dir:o,name:k,baseCommit:((h=C.data)==null?void 0:h.commit)??null}),c.invalidateQueries({queryKey:["file-explorer","tree",n.scopeKey]}),J.success(`Saved ${k} to the room’s files`),x()}catch(w){let b;try{b=Gt(w,c,t)}catch{b={status:"refused",reason:Qe(w)??"Couldn’t save. Try again in a moment."}}if(b.status==="exists"){const S=(((g=C.data)==null?void 0:g.entries)??[]).map(K=>K.name);N({reason:`This folder already has a file called “${k}”. Pick another name.`,suggestion:Oe({name:k,isDir:!1,taken:[...S,k]})})}else b.status==="conflict"?(N({reason:"This folder changed while you chose, so nothing was saved. Try again."}),C.refetch()):b.status==="refused"&&N({reason:b.reason})}finally{D(!1)}}};return e.jsx(_t,{open:!0,onOpenChange:k=>!k&&x(),children:e.jsxs(At,{className:"sm:max-w-md",children:[e.jsxs(Lt,{children:[e.jsx(zt,{children:"Save to room files"}),e.jsx($t,{children:"Everyone in the room, and their agents, can find it there."})]}),e.jsxs(It,{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Folder"}),e.jsxs("div",{role:"group","aria-label":"Folders",className:"border-border/60 max-h-56 overflow-auto rounded-md border",children:[e.jsx("p",{className:"bg-muted/40 truncate px-3 py-1.5 font-mono text-xs",children:o===Q?"Top folder":`${o}/`}),o!==Q&&e.jsx($e,{label:"Up one folder",icon:e.jsx(sn,{className:"text-muted-foreground size-(--size-icon-sm)"}),onClick:()=>m(G(o))}),C.isPending?e.jsx("div",{className:"flex h-12 items-center justify-center",children:e.jsx(Fe,{size:"sm",className:"text-muted-foreground",label:"Loading folders"})}):U.length===0?e.jsx("p",{className:"text-muted-foreground px-3 py-2 text-xs",children:"No folders in here."}):U.map(k=>e.jsx($e,{label:k.name,icon:e.jsx(be,{className:"size-(--size-icon-sm) text-sky-500"}),chevron:!0,onClick:()=>m(ee(o,le(k.path)))},k.path))]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:L,className:"text-muted-foreground text-xs font-medium",children:"Name"}),e.jsx(Kt,{id:L,value:r,onChange:k=>{l(k.target.value),N(null)},spellCheck:!1,autoComplete:"off"})]}),u!==null&&e.jsxs("div",{role:"alert",className:"text-destructive space-y-1 text-xs",children:[e.jsx("p",{children:u.reason}),u.suggestion!==void 0&&e.jsxs(W,{type:"button",variant:"outline",size:"xs",onClick:()=>{l(u.suggestion),N(null)},children:["Use “",u.suggestion,"”"]})]})]}),e.jsxs(Ht,{className:"gap-2",children:[e.jsx(W,{type:"button",variant:"ghost",onClick:x,children:"Cancel"}),e.jsx(W,{type:"button",disabled:F||r.trim()===""||C.isPending,onClick:()=>void I(),children:F?"Saving…":o===Q?"Save to the top folder":`Save to ${le(o)}`})]})]})})}function $e({label:t,icon:n,chevron:a=!1,onClick:x}){return e.jsxs("button",{type:"button",onClick:x,className:"hover:bg-accent/50 focus-visible:bg-accent flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm outline-none",children:[n,e.jsx("span",{className:"min-w-0 flex-1 truncate",children:t}),a&&e.jsx(Ke,{className:"text-muted-foreground size-3.5"})]})}export{On as FileExplorer,es as FileExplorerActions,Yt as FilePreviewDialog,rn as HIDDEN_ENTRY_NAMES,at as HiddenEntriesToggle,rs as NO_PROVENANCE,Ne as PINNED_ENTRY_NAMES,os as ROOM_FILES_REFRESH_INTERVAL_MS,ts as RoomFilesSection,ns as SaveToRoomFilesButton,Be as createRoomFilesSource,gn as createSessionCwdSource,ie as explorerDirQueryKey,ke as explorerDirQueryOptions,on as isHiddenEntryName,Re as isPinnedEntryName,ln as pinnedFirst,Bt as provenanceLine,Ue as roomRepoStatusQueryOptions,nt as withoutHidden};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as p,T as a}from"./TeamComputerEntry-BD89Y5e6.js";import{C,a as n}from"./ComputerResourceView-BlLvMt1I.js";import"./index-CjUfPyOM.js";import"./ComputerViewer-B8SWICbj.js";import"./use-is-below-desktop-BUS7OPGv.js";export{p as AgentComputerPanel,C as ComputerPanelView,n as ComputerPipView,a as TeamComputerEntry};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as n,M as h}from"./Marketplace-BWDlXgwH.js";import{M as I,P as U,m as V,u as b,a as C}from"./index-CjUfPyOM.js";import{M as j}from"./MarketplaceSourcesView-BhKzgkiO.js";import{U as v}from"./UnlinkDialog-DTuXHNsi.js";import"./PreviewRefusedNotice-CnqAE9sr.js";import"./shield-x-Dr4BZfo_.js";import"./card-DI7YtQh3.js";import"./empty-state-aNwJA6H8.js";import"./markdown-content-ysBIqFAg.js";import"./use-unclaimed-chats-D7SEUfiO.js";import"./use-bindings-Bu4yLLR5.js";import"./more-details-DHCpYDi7.js";import"./use-dev-links-C0Zc30aj.js";import"./file-bSD5jgk_.js";import"./AgentPicker-DoGucmqI.js";import"./command-DpK0GpDM.js";import"./AgentOptionRow-D-QjHi5k.js";import"./useMutationState-rOg4bnKv.js";import"./file-exclamation-point-BcCIL-rE.js";import"./rotate-ccw-clock-LSKKAcnR.js";import"./path-input-Z2p922fj.js";import"./use-pending-read-BBBAnUYu.js";export{n as InstalledPackagesView,h as Marketplace,I as MarketplaceSidebar,j as MarketplaceSourcesView,U as PackageCard,v as UnlinkDialog,V as marketplaceSearchSchema,b as useMarketplaceParams,C as useMarketplaceStore};
|