dorkos 0.115.0 → 0.116.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/cli.js +130 -69
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-Cz8ijNrK.js → AboutPage-KW-6Y7Wm.js} +1 -1
- package/dist/client/assets/{ActivityErrorState-BzmfwxSZ.js → ActivityErrorState-C5xbcrFo.js} +1 -1
- package/dist/client/assets/{ActivityPage-BK7T3OiI.js → ActivityPage-DIeicP6l.js} +1 -1
- package/dist/client/assets/{ActivityRow-Ig5atv15.js → ActivityRow-Drxrnyea.js} +1 -1
- package/dist/client/assets/{AdapterIcon-BXPv5J8h.js → AdapterIcon-BEuzKbC6.js} +1 -1
- package/dist/client/assets/{AdapterSetupWizard-BEziztL3.js → AdapterSetupWizard-z_agWfDl.js} +2 -2
- package/dist/client/assets/{AgentOptionRow-BqFQvFeN.js → AgentOptionRow-DEwQwnKr.js} +1 -1
- package/dist/client/assets/{AgentPicker-dCfEIsU-.js → AgentPicker-CmyF25Oi.js} +1 -1
- package/dist/client/assets/{AgentRequestCard-BAhfGJxx.js → AgentRequestCard-BWtE34Nr.js} +3 -3
- package/dist/client/assets/{AppearancePage-7qHhFeEv.js → AppearancePage-BJO-Q3a4.js} +1 -1
- package/dist/client/assets/{ApplyToOverridesDialog-jqOFh0d1.js → ApplyToOverridesDialog-CsmbPbTh.js} +1 -1
- package/dist/client/assets/{AttentionSignalRow-3CgglXkd.js → AttentionSignalRow-2-aDCEdR.js} +1 -1
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-BMKtHI0D.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-CL7e4dO8.js} +1 -1
- package/dist/client/assets/{BindingDialog-DSBxRyzA.js → BindingDialog-CirNTa_m.js} +1 -1
- package/dist/client/assets/{BlintzCanvas-CyRuqAJV.js → BlintzCanvas-bfmQpoVE.js} +1 -1
- package/dist/client/assets/{CanvasCsvContent-Bd1c6TGx.js → CanvasCsvContent-x86ueAZo.js} +1 -1
- package/dist/client/assets/{CanvasFileContent-DelYwSH8.js → CanvasFileContent-DIQbKII9.js} +2 -2
- package/dist/client/assets/{CanvasModel3dContent-BExIu4RY.js → CanvasModel3dContent-DTAWG8IS.js} +2 -2
- package/dist/client/assets/{ChatAppsOff-SWemSaUp.js → ChatAppsOff-BQiTfHe3.js} +1 -1
- package/dist/client/assets/{CodeMirrorDiff-0WF4ITRZ.js → CodeMirrorDiff-DhNTAsQl.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-Bg7wC_Q8.js → CodeMirrorEditor-BpIF0kLM.js} +1 -1
- package/dist/client/assets/{CommitmentList-CTvEGUV3.js → CommitmentList-B-B3E6yN.js} +1 -1
- package/dist/client/assets/{CommitmentsPage-C68etoLe.js → CommitmentsPage-BNoKIW7z.js} +1 -1
- package/dist/client/assets/ComputerResourceView-NMA65a8a.js +6 -0
- package/dist/client/assets/ComputerViewer-BjU1hfpc.js +1 -0
- package/dist/client/assets/{ConnectionAccessLists-9oeVn_GK.js → ConnectionAccessLists-Iy_T25Rw.js} +1 -1
- package/dist/client/assets/{ConnectionsPage-CJOY4-kp.js → ConnectionsPage-DPfoPshS.js} +2 -2
- package/dist/client/assets/{ConventionPage-DD-f5o6y.js → ConventionPage-CoLB6WVs.js} +1 -1
- package/dist/client/assets/{ExtensionPageRoute-C6fW17AG.js → ExtensionPageRoute-Y_Na63mr.js} +2 -2
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-Zccd0fv6.js → FloatingTanStackRouterDevtools-CqogiFob-DCj2Id-d.js} +1 -1
- package/dist/client/assets/HandlePage-WyPrFOtj.js +1 -0
- package/dist/client/assets/{HeartbeatPage-cJM6NuTD.js → HeartbeatPage-zzL8W_zA.js} +1 -1
- package/dist/client/assets/{KeyEntry-K5k_3TfU.js → KeyEntry-DCATqdIG.js} +2 -2
- package/dist/client/assets/{LexicalField-DB5V20zv.js → LexicalField-B7d9UWFk.js} +1 -1
- package/dist/client/assets/{ManagesPage-Cj0-hwfr.js → ManagesPage-CKTb1w3G.js} +1 -1
- package/dist/client/assets/{Marketplace-eWEtLmd9.js → Marketplace-Deq-aTM6.js} +2 -2
- package/dist/client/assets/{MarketplaceSourcesView-B1h70C20.js → MarketplaceSourcesView-B2qLtCVG.js} +1 -1
- package/dist/client/assets/{McpAppFrame-BaJ_r-QR.js → McpAppFrame-BKgYSUH-.js} +1 -1
- package/dist/client/assets/{McpSigninBody-Coaq5Fkf.js → McpSigninBody-Begd1UNn.js} +1 -1
- package/dist/client/assets/{Model3dViewer-cKa-Jnbl.js → Model3dViewer-CK6siI6q.js} +1 -1
- package/dist/client/assets/NamePage-DxDcIFAo.js +1 -0
- package/dist/client/assets/{NewDirectMessageMenu-C4zNIv9x.js → NewDirectMessageMenu-D4ORE1Lo.js} +1 -1
- package/dist/client/assets/{NotificationsPage-gKNClvNU.js → NotificationsPage-CjRyxKXv.js} +1 -1
- package/dist/client/assets/{OpenMeshSwitch-RzB2u6-Q.js → OpenMeshSwitch-C0C-f-dF.js} +2 -2
- package/dist/client/assets/{OperatorIdentityForm-B_78Vqh8.js → OperatorIdentityForm-I9zvI2go.js} +1 -1
- package/dist/client/assets/{PermissionHistory-DrtlA4YM.js → PermissionHistory-C9vTiyw5.js} +1 -1
- package/dist/client/assets/{PermissionsPage-O7kUVaQv.js → PermissionsPage-BR9LM1Bo.js} +1 -1
- package/dist/client/assets/{PersonalityPopover-DiNuuoWu.js → PersonalityPopover-BhFUSfRe.js} +1 -1
- package/dist/client/assets/PhotoPage-C4OhoBR2.js +1 -0
- package/dist/client/assets/{PresetPicker-BUFwg8RS.js → PresetPicker-CpTnkeZt.js} +3 -3
- package/dist/client/assets/{PreviewRefusedNotice-DXZp669C.js → PreviewRefusedNotice-R5LB9PuV.js} +1 -1
- package/dist/client/assets/{ProfileFields-BCfMzNcT.js → ProfileFields-8fFud5gT.js} +1 -1
- package/dist/client/assets/{ProfilePanelContainer-BzC2MGdi.js → ProfilePanelContainer-BJFOrUov.js} +1 -1
- package/dist/client/assets/{ProfileRolePicker-f0FKXLtu.js → ProfileRolePicker-C8hpW08c.js} +1 -1
- package/dist/client/assets/{PromptSuggestionChips-EgeMFibt.js → PromptSuggestionChips-1su17rvx.js} +1 -1
- package/dist/client/assets/{ReportsToPopover-CQ4Xxslu.js → ReportsToPopover-7H3_8Brz.js} +1 -1
- package/dist/client/assets/{RoomSurface-oDbc6jnO.js → RoomSurface-BkoesTVz.js} +5 -5
- package/dist/client/assets/{RoomsPage-D_EbiSZ3.js → RoomsPage-BrMOJQpt.js} +1 -1
- package/dist/client/assets/{RunsOnPopover-LtmmbIsD.js → RunsOnPopover-BB7T1Zln.js} +1 -1
- package/dist/client/assets/{RuntimeConnectFlow-Kv2ytk2m.js → RuntimeConnectFlow-oHwqp_fn.js} +1 -1
- package/dist/client/assets/{RuntimeSetupDialog-CiWxlcPc.js → RuntimeSetupDialog-BTT2-FM8.js} +1 -1
- package/dist/client/assets/{SessionsPage-1rDO0SGV.js → SessionsPage-PpKG9Phd.js} +1 -1
- package/dist/client/assets/{SettingsDialog-_ctp2AfE.js → SettingsDialog-Dxtq0E9R.js} +4 -4
- package/dist/client/assets/{SkillsPage-gPuQHKps.js → SkillsPage-CzzuhGH2.js} +1 -1
- package/dist/client/assets/{TaskDialogWrapper-BPFpCgsN.js → TaskDialogWrapper-DWVo-1P7.js} +1 -1
- package/dist/client/assets/{TasksEmptyState-D0Jlzmed.js → TasksEmptyState-DfR9p54p.js} +2 -2
- package/dist/client/assets/{TasksPage-DvGfg5Bk.js → TasksPage-5_XngIV9.js} +1 -1
- package/dist/client/assets/TeamComputerEntry-BE_gamkp.js +1 -0
- package/dist/client/assets/{ToolsPage-B0qZ85pR.js → ToolsPage-CefworrO.js} +2 -2
- package/dist/client/assets/{TopologyGraph-q1ammgpG.js → TopologyGraph-C1DaL02H.js} +2 -2
- package/dist/client/assets/{TourHost-Dc8qw1Ef.js → TourHost-pT1tIPF7.js} +1 -1
- package/dist/client/assets/{UnlinkDialog-DXdrLsGV.js → UnlinkDialog-oMOr8e6G.js} +1 -1
- package/dist/client/assets/{WidgetErrorCard-ChDNC060.js → WidgetErrorCard-CBFo1SMe.js} +7 -7
- package/dist/client/assets/_shell-BiAMGu0F.js +90 -0
- package/dist/client/assets/{_shell._home-DjGunhLV.js → _shell._home-Cx7ZsoQO.js} +1 -1
- package/dist/client/assets/{_shell._home.activity-B014dET1.js → _shell._home.activity-C3fnNXgc.js} +1 -1
- package/dist/client/assets/{_shell._home.index-DEmtTHZg.js → _shell._home.index-CixksaeD.js} +2 -2
- package/dist/client/assets/{_shell._home.tasks-CnDEbUOd.js → _shell._home.tasks-DZWUHfK_.js} +1 -1
- package/dist/client/assets/{_shell._home.workspaces-AQtMUWuu.js → _shell._home.workspaces-y-DAPB_X.js} +1 -1
- package/dist/client/assets/{_shell.channels-C8NOhmJd.js → _shell.channels-DEErD0f0.js} +4 -4
- package/dist/client/assets/{_shell.connections-Bxe0wxOB.js → _shell.connections-B36f6FWi.js} +1 -1
- package/dist/client/assets/{_shell.feedback-requests-C6ku9F5_.js → _shell.feedback-requests-B0QiSuDC.js} +2 -2
- package/dist/client/assets/_shell.marketplace-CardBSA_.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-CVK8YKDA.js +1 -0
- package/dist/client/assets/{_shell.session-Dn0C0mEZ.js → _shell.session-Cl7qfi1Z.js} +3 -3
- package/dist/client/assets/_shell.team-DIdgc_vn.js +28 -0
- package/dist/client/assets/_shell.x._extensionId-BEPW8hvh.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-BEPW8hvh.js +1 -0
- package/dist/client/assets/{access-copy-CBGtcTk0.js → access-copy-CE5oc1d9.js} +1 -1
- package/dist/client/assets/{agent-browser-DbcLtsAx.js → agent-browser-DV76U8Ny.js} +1 -1
- package/dist/client/assets/{banner-rPsz3suJ.js → banner-DIVQNO0O.js} +1 -1
- package/dist/client/assets/{card-BqN3lfJn.js → card-DVdPY08b.js} +1 -1
- package/dist/client/assets/{command-ZTLTCj0l.js → command-BhZ8sKG4.js} +1 -1
- package/dist/client/assets/{cpu-D70xMHl2.js → cpu-CtmIFRqs.js} +1 -1
- package/dist/client/assets/{empty-state-yl1dLwLN.js → empty-state-DHuumxZB.js} +1 -1
- package/dist/client/assets/{execution-config-BbBEe6FO.js → execution-config-JdnxoV1P.js} +1 -1
- package/dist/client/assets/{file-CGg2M6ED.js → file-Bc34j1rj.js} +1 -1
- package/dist/client/assets/{file-exclamation-point-DZrVsShR.js → file-exclamation-point-dxJUSR3k.js} +1 -1
- package/dist/client/assets/{file-text-BYq_4IAt.js → file-text-BNSVr0Hh.js} +1 -1
- package/dist/client/assets/{find-latest-widget-fence-CWs9nr10.js → find-latest-widget-fence-oI6Sl7rV.js} +1 -1
- package/dist/client/assets/{form-vPuXuaYT.js → form-FbjLEM3I.js} +1 -1
- package/dist/client/assets/{format-cron-D02Tnupo.js → format-cron-BaE7qyNN.js} +1 -1
- package/dist/client/assets/{git-branch-DbjXDO_F.js → git-branch-BBKObhlk.js} +1 -1
- package/dist/client/assets/{heart-Dblp_miM.js → heart-BdbxexAy.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-CaMXMak-.js → highlighted-body-KPVGNVTW-R3x8mG02.js} +1 -1
- package/dist/client/assets/{index-vRc1D4KI.js → index-0AgY877T.js} +1 -1
- package/dist/client/assets/{index-D16KF-iC.js → index-1-RB7sXm.js} +3 -3
- package/dist/client/assets/{index-BW98owO8.js → index-4irOzx9Q.js} +1 -1
- package/dist/client/assets/{index-P5j6zmcN.js → index-6ZmBCm_d.js} +1 -1
- package/dist/client/assets/{index-DzeYt-GT.js → index-7xf1fyHe.js} +1 -1
- package/dist/client/assets/{index-BxqUb-n7.js → index-BCT0tkN4.js} +1 -1
- package/dist/client/assets/{index-BKuzoeSn.js → index-BFh_VGhh.js} +1 -1
- package/dist/client/assets/{index-B-WvQ24u.js → index-BKnIV8YQ.js} +6 -6
- package/dist/client/assets/{index-D6m2SWHr.js → index-BQgJVNUB.js} +1 -1
- package/dist/client/assets/{index-BiIbMZ6d.js → index-BV0RP90y.js} +1 -1
- package/dist/client/assets/{index-BV0tZnYg.js → index-BWHsw5Qn.js} +1 -1
- package/dist/client/assets/{index-CMWMhbec.js → index-BbUZazTt.js} +1 -1
- package/dist/client/assets/{index-CWNsRK97.js → index-BcPMhqQ_.js} +1 -1
- package/dist/client/assets/{index-DwUdUliR.js → index-BeKz0Z7i.js} +1 -1
- package/dist/client/assets/index-C481yCZ2.js +1 -0
- package/dist/client/assets/{index-Db2EOzA3.js → index-C4vL5hUU.js} +1 -1
- package/dist/client/assets/{index-DDYi817r.js → index-C5n3OkTH.js} +1 -1
- package/dist/client/assets/{index-Z8YcKwIB.js → index-C76UofV4.js} +1 -1
- package/dist/client/assets/index-CB-aY4BF.js +1 -0
- package/dist/client/assets/{index-CN9fywRC.js → index-CDx26Vyr.js} +1 -1
- package/dist/client/assets/{index-Dg_bax15.js → index-CJW9tZhq.js} +5 -5
- package/dist/client/assets/{index-BPwUl0Bz.js → index-CJw16oEF.js} +1 -1
- package/dist/client/assets/{index-CaLw69VE.js → index-C_Pquyu-.js} +1 -1
- package/dist/client/assets/{index-Gq3gqBhY.js → index-CpAdYUxX.js} +1 -1
- package/dist/client/assets/{index-XE46wAj9.js → index-D1bAoT3D.js} +1 -1
- package/dist/client/assets/{index-Bd23EYYT.js → index-D7MytHQN.js} +2 -2
- package/dist/client/assets/index-DKubbEZd.css +1 -0
- package/dist/client/assets/{index-BOL391En.js → index-DShpGK7T.js} +1 -1
- package/dist/client/assets/{index-C88NZagl.js → index-DlWFe9SD.js} +1 -1
- package/dist/client/assets/{index-oWLYcpm4.js → index-DluIa1Dv.js} +1 -1
- package/dist/client/assets/index-Dm1Ngy2r.js +38 -0
- package/dist/client/assets/{index-CdKpQ1hI.js → index-DxTOTFWT.js} +280 -280
- package/dist/client/assets/{index-lNMJBFB0.js → index-DzRQN8yx.js} +1 -1
- package/dist/client/assets/index-Fl8NxGfN.js +119 -0
- package/dist/client/assets/{index-CrK4rKAq.js → index-fe27h49h.js} +1 -1
- package/dist/client/assets/{index-DdbHrvr0.js → index-hIJdyL6m.js} +1 -1
- package/dist/client/assets/{index-BPqkuMIa.js → index-hLWqos0I.js} +1 -1
- package/dist/client/assets/{index-CRZXSh_q.js → index-pKhRsSRA.js} +1 -1
- package/dist/client/assets/{index-CHvi6xUU.js → index-sRPmoNhi.js} +1 -1
- package/dist/client/assets/{index-BdVOtoFr.js → index-tPf4Bia7.js} +1 -1
- package/dist/client/assets/{index-Bi7Um5RU.js → index-vHt--4jg.js} +1 -1
- package/dist/client/assets/{inline-code-Cvn43Gqu.js → inline-code-CrAiSiKW.js} +1 -1
- package/dist/client/assets/{layers-Bmz62WF4.js → layers-QYiauDIw.js} +1 -1
- package/dist/client/assets/{lightbulb-CAd6slmc.js → lightbulb-Dc3wEED9.js} +1 -1
- package/dist/client/assets/{link-2-C0mn8T24.js → link-2-BUnfBMCd.js} +1 -1
- package/dist/client/assets/{list-runtime-types-DxwGcKLx.js → list-runtime-types-H-N7VUS4.js} +1 -1
- package/dist/client/assets/{markdown-content-1-B7PdbY.js → markdown-content-fIydDTfa.js} +1 -1
- package/dist/client/assets/{mention-pill-D_-KXznh.js → mention-pill-CONiQ9Xs.js} +1 -1
- package/dist/client/assets/{message-square-off-Di7kQvfe.js → message-square-off-BMD4bxOr.js} +1 -1
- package/dist/client/assets/{more-details-C6UGVeDE.js → more-details-DMD6Pqb5.js} +1 -1
- package/dist/client/assets/{owner-notice-CudDDBX4.js → owner-notice-BRcpYvJk.js} +1 -1
- package/dist/client/assets/{package-D2eMoFCI.js → package-CGgpgsfC.js} +1 -1
- package/dist/client/assets/{page-container-CDHAACRA.js → page-container-uyGtbP6Z.js} +1 -1
- package/dist/client/assets/{paperclip-p0W24D54.js → paperclip-CUxIVlMU.js} +1 -1
- package/dist/client/assets/{path-input-j04LMj9z.js → path-input-CeMu6ytc.js} +1 -1
- package/dist/client/assets/{primer-trigger-DkCcHf2Q.js → primer-trigger-x8IfRd6U.js} +2 -2
- package/dist/client/assets/{profile-errors-CqflLCzu.js → profile-errors-DyrpY2ry.js} +1 -1
- package/dist/client/assets/{progress-BcuH4Eod.js → progress-2cuTo9I-.js} +1 -1
- package/dist/client/assets/{query-error-state-CEZs7dhg.js → query-error-state-Cq1O4FGq.js} +1 -1
- package/dist/client/assets/{radio-DGWfQ5Rf.js → radio-H5ktIFzD.js} +1 -1
- package/dist/client/assets/registry-DNRE0Em-.js +1 -0
- package/dist/client/assets/{relay-trace-schemas-y0nd8fzi.js → relay-trace-schemas-Crc4Iceb.js} +2 -2
- package/dist/client/assets/{room-files-source-C1TCg4W_.js → room-files-source-thCvGi0E.js} +2 -2
- package/dist/client/assets/{rotate-ccw-clock-DcBojy-0.js → rotate-ccw-clock-DKP7zbQr.js} +1 -1
- package/dist/client/assets/{rotate-cw-D0vUyeR2.js → rotate-cw-Cwv_uaU3.js} +1 -1
- package/dist/client/assets/{scroll-area-CQ9lO56h.js → scroll-area-CaJ1TwhG.js} +1 -1
- package/dist/client/assets/{search-x-EJGj73JB.js → search-x-D-Un20jR.js} +2 -2
- package/dist/client/assets/{shield-check-Bp58y9u7.js → shield-check-CMhrOu-d.js} +1 -1
- package/dist/client/assets/{shield-x-jF_NCCvp.js → shield-x-DlaUufPM.js} +1 -1
- package/dist/client/assets/{soul-file-Cag2i87x.js → soul-file-C5-nKCwV.js} +1 -1
- package/dist/client/assets/{table-D89CWVJX.js → table-C7pi-jkJ.js} +1 -1
- package/dist/client/assets/{terminal-BUhNMZAt.js → terminal-IYkyS2eR.js} +1 -1
- package/dist/client/assets/{trust-posture-15DMDZTA.js → trust-posture-BxFTuKAo.js} +1 -1
- package/dist/client/assets/{unplug-opnrSXAi.js → unplug-Bv5BESa4.js} +1 -1
- package/dist/client/assets/{unverified-catalog-notice-DHM5Coia.js → unverified-catalog-notice-B9dzvyVq.js} +1 -1
- package/dist/client/assets/{use-adapter-catalog-ClMqVelU.js → use-adapter-catalog-DDD8zCQo.js} +1 -1
- package/dist/client/assets/{use-bindings-Ch6UUBvz.js → use-bindings-BXHWfTB2.js} +1 -1
- package/dist/client/assets/{use-composer-prefs-Qn7KRpYe.js → use-composer-prefs-DG8dQD3D.js} +1 -1
- package/dist/client/assets/{use-connector-management-dX_4x0d3.js → use-connector-management-l6Ii6UIU.js} +1 -1
- package/dist/client/assets/{use-deep-link-scroll-BV2fY4gy.js → use-deep-link-scroll-CPgyWLMM.js} +1 -1
- package/dist/client/assets/{use-delete-binding-BklxjB_c.js → use-delete-binding-NPl-TzUw.js} +1 -1
- package/dist/client/assets/{use-dev-links-D4Bqam6F.js → use-dev-links-DYaUSRn0.js} +1 -1
- package/dist/client/assets/{use-external-adapter-catalog-nHiD8BKZ.js → use-external-adapter-catalog-BrmKSNvG.js} +1 -1
- package/dist/client/assets/{use-full-activity-feed-vYU7wQWT.js → use-full-activity-feed-CEvmRK6d.js} +1 -1
- package/dist/client/assets/use-is-below-desktop-Cx2BL1BK.js +1 -0
- package/dist/client/assets/{use-jump-back-in-BVunjzyr.js → use-jump-back-in-BMgpYhK-.js} +2 -2
- package/dist/client/assets/{use-mesh-topology-NaUKSKol.js → use-mesh-topology-D82_pOi9.js} +1 -1
- package/dist/client/assets/{use-mounted-ref-BWpQ8f91.js → use-mounted-ref-Bs5osknq.js} +1 -1
- package/dist/client/assets/{use-notification-prefs-qO1zRRFN.js → use-notification-prefs-Bpzt57w3.js} +1 -1
- package/dist/client/assets/{use-panel-tab-placements-Db6p2vLD.js → use-panel-tab-placements-COBgt4Uh.js} +1 -1
- package/dist/client/assets/use-pending-read-DpJbidPK.js +1 -0
- package/dist/client/assets/{use-personality-commit-DUEKxHt_.js → use-personality-commit-D8Fqsrzc.js} +1 -1
- package/dist/client/assets/{use-promo-activation-CnGaw39P.js → use-promo-activation-sHnkQjl-.js} +2 -2
- package/dist/client/assets/{use-promo-dismissals-bkSHhGhj.js → use-promo-dismissals-BW_429t4.js} +1 -1
- package/dist/client/assets/{use-pulse-freshness-Oc_1gs-Y.js → use-pulse-freshness-BkYMwuUb.js} +1 -1
- package/dist/client/assets/{use-relay-config-Ba-S4wxY.js → use-relay-config-CsB8Q0cK.js} +1 -1
- package/dist/client/assets/{use-room-follow-claim-DqE5b95Z.js → use-room-follow-claim-DqvqzwBA.js} +1 -1
- package/dist/client/assets/{use-roving-tab-list-DnMqliqf.js → use-roving-tab-list-iDj1p8tT.js} +1 -1
- package/dist/client/assets/{use-session-canvas-OdljtBE8.js → use-session-canvas-DrKA7UHs.js} +4 -4
- package/dist/client/assets/{use-session-diagnostics-CtjxsM8_.js → use-session-diagnostics-D6wJVzUG.js} +2 -2
- package/dist/client/assets/{use-unclaimed-chats-5RCD5wIp.js → use-unclaimed-chats-bLDQhIiU.js} +1 -1
- package/dist/client/assets/use-update-config-Dk0MthxZ.js +1 -0
- package/dist/client/assets/{useMutationState-Mjr_y4xX.js → useMutationState-eZMPCch6.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/extension-child.cjs +772 -36
- package/dist/server/index.js +5533 -4697
- package/dist/server/index.js.map +2 -2
- package/package.json +6 -5
- package/dist/client/assets/HandlePage-DOxlquWl.js +0 -1
- package/dist/client/assets/NamePage-W7Frb1yy.js +0 -1
- package/dist/client/assets/PhotoPage-DdBke3yj.js +0 -1
- package/dist/client/assets/_shell-BxPza3Lx.js +0 -88
- package/dist/client/assets/_shell.marketplace-CEnzWFmI.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-BZq1d2ih.js +0 -1
- package/dist/client/assets/_shell.team-DoLdOMoC.js +0 -28
- package/dist/client/assets/_shell.x._extensionId-DhE3OYMF.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-DhE3OYMF.js +0 -1
- package/dist/client/assets/index-BzczIyv5.js +0 -119
- package/dist/client/assets/index-C6NUjpzQ.js +0 -38
- package/dist/client/assets/index-O_HMols_.js +0 -1
- package/dist/client/assets/index-kktlr1TJ.css +0 -1
- package/dist/client/assets/registry-ChxwU0f4.js +0 -1
- package/dist/client/assets/use-is-below-desktop-G-mTu2Ga.js +0 -1
- package/dist/client/assets/use-pending-read-DUqJZUza.js +0 -1
- package/dist/client/assets/use-update-config-xkznZMHr.js +0 -1
package/dist/client/assets/{ApplyToOverridesDialog-jqOFh0d1.js → ApplyToOverridesDialog-CsmbPbTh.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{g7 as k,a8 as A,a9 as C,g8 as x,aa as j,ab as T,aA as R,g9 as D,j as n,bG as I,bH as N,Q as P,bI as E,bK as L,r as B,cG as q,cH as K,cJ as _,cK as F,cL as O,dD as M,ga as Q,e3 as W,dj as z,B as p}from"./index-DxTOTFWT.js";function X(e,s){const a=new Set(e.filesAndCommands.followingAgentIds);if(s.kind==="files")return a.size;const t=e.exceptions.filter(o=>o.action===void 0),r=new Set;if(s.kind==="preset"){const o=new Map;for(const c of t){const l=o.get(c.agentId)??new Set;l.add(c.area),o.set(c.agentId,l)}for(const[c,l]of o)l.size>=k.length&&!a.has(c)&&r.add(c)}else{for(const o of t)o.area===s.area&&r.add(o.agentId);if(s.kind==="action")for(const o of e.exceptions)o.action===s.action&&r.add(o.agentId)}return Math.max(0,e.agentCount-r.size)}function Y(e){return`affects ${e} ${e===1?"agent":"agents"}`}function V(){const e=A();return C({queryKey:x.overview(),queryFn:()=>e.getPermissions()})}function Z(e){const s=A(),a=j();return T({mutationFn:async t=>{if(t.kind==="preset"){if(e.kind!=="default")throw new Error("A preset is chosen for everyone.");return s.setPermissionPreset({preset:t.preset,surface:t.surface,...t.applyToAgents?{applyToAgents:t.applyToAgents}:{}})}const r={...t.areas?{areas:t.areas}:{},...t.actions?{actions:t.actions}:{},surface:t.surface};return e.kind==="agent"?s.patchAgentPermissions(e.agentId,{...r,...t.filesAndCommands!==void 0?{filesAndCommands:t.filesAndCommands}:{}}):s.patchPermissionDefaults({...r,...t.applyToAgents?{applyToAgents:t.applyToAgents}:{}})},onSettled:()=>{a.invalidateQueries({queryKey:x.all}),a.invalidateQueries({queryKey:["mesh","agents"]}),a.invalidateQueries({queryKey:R.all})}})}const h={blocked:"Blocked",ask:"Ask",allowed:"Allowed"},v={careful:"Careful",balanced:"Balanced",full:"Full power",trusted:"Trusted"},ee={careful:"Agents ask before they change anything, and can’t reach outside DorkOS.",balanced:"Agents run their rooms and ask before anything wider.",full:"Agents do everyday work alone and ask before installs or settings changes.",trusted:"Agents work on their own, and everything they do is recorded."};function se(e,s){switch(e){case"default-area":case"default-action":return"Changed from your preset";case"preset":return`From ${v[s??"trusted"]}`;case"floor":return"Never Allowed";case"always-asks":return"Always asks, so you see the change first";default:return""}}const te="Blocked stops agents that follow the rules. It isn’t a sandbox.";function ne(e){switch(e){case"agent":return"Set for this agent";case"runtime":return"Set in Settings → Runtimes";case"default":return"The setting everyone has";case"runtime-own":return"Not set, so each AI tool uses its own default"}}function w(e){return`the default (${v[e??"trusted"]})`}function ae(e){const s=h[e.state],a=e.agentName??"this agent";switch(e.source){case"inactive":return"Blocked, because this agent’s access was turned off.";case"floor":return`${s}. This area is locked, so it’s never Allowed.`;case"always-asks":return e.fromExtension?`${s}. Extension tools that can delete things always ask.`:`${s}. It always shows you the change first, so it’s never Allowed.`}if(e.destructiveAsk)return"Ask. Actions that run someone else’s code ask unless set one by one.";switch(e.source){case"agent-area":return`${s}, set for ${a}.`;case"agent-action":return`${s}, set for this one action on ${a}.`;case"default-area":return`${s} for everyone, changed from ${w(e.preset)}.`;case"default-action":return`${s} for everyone, set for this one action.`;case"preset":return`${s}, from ${w(e.preset)}.`}}function re(e,s,a){const t=e?D(e):null;switch(s){case"agent":return`${t}, set for ${a??"this agent"}.`;case"runtime":return`${t}, set in Settings → Runtimes.`;case"default":return`${t}, the setting everyone has.`;case"runtime-own":return"Not set, so each AI tool uses its own default."}}const H={settings:" in Settings","agent-page":" on the agent’s page","control-center":" in the Control Center","request-card":" from a request card","first-run":" during setup","agent-request":" from an agent's request",api:" through the API",cli:" from the command line",upgrade:"",undo:" with Undo","file-edit":""};function U(e){return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function G(e){if(!e)return null;const s=`on ${U(e.occurredAt)}`,a=H[e.surface];switch(e.attribution){case"signed-in":return`Changed by ${e.actorLabel.charAt(0).toLowerCase()+e.actorLabel.slice(1)} ${s}${a}.`;case"local-trust":return`Changed ${s}${a}. With login off, who is unknown.`;case"agent-request-approved":return`Changed ${s}: ${e.actorLabel}.`;case"agent":return`Changed by ${e.actorLabel} ${s}.`;case"upgrade":return`Set by an upgrade ${s}.`;case"outside":return`Changed outside DorkOS ${s}, in the agent’s settings file.`}}function oe({question:e,sentence:s,lastChange:a,className:t}){const r=G(a);return n.jsxs(I,{children:[n.jsx(N,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":e,className:P("text-muted-foreground hover:text-foreground focus-visible:ring-ring inline rounded-sm py-2 text-xs underline decoration-dotted underline-offset-2 transition-colors focus-visible:ring-2 focus-visible:outline-none md:py-0",t),children:"Why?"})}),n.jsxs(E,{className:"w-72 space-y-1.5",align:"start",children:[n.jsx(L,{className:"text-sm font-medium",children:e}),n.jsx("p",{className:"text-sm","data-testid":"permission-why-source",children:s}),r?n.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"permission-why-change",children:r}):null]})]})}function ie({open:e,onCancel:s,subject:a,title:t,next:r,agents:o,affectedCount:c,onKeep:l,onUpdate:b,pending:m=!1}){const[u,f]=B.useState(new Set),S=r in h?h[r]:r,y=o.length,$=(i,g)=>{const d=new Set(u);g?d.add(i):d.delete(i),f(d)};return n.jsx(q,{open:e,onOpenChange:i=>{i||(f(new Set),s())},children:n.jsxs(K,{className:"!min-h-0 sm:max-w-md",children:[n.jsxs(_,{children:[n.jsx(F,{children:t??`Set ${a} to ${S} for everyone?`}),n.jsxs(O,{children:[y===1?"1 agent is":`${y} agents are`," set differently. Pick any that should follow."]})]}),n.jsxs(M,{className:"space-y-3",children:[n.jsx("ul",{className:"space-y-2","aria-label":"Agents set differently",children:o.map(i=>{const g=`apply-${i.agentId}`;return n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx(Q,{id:g,checked:u.has(i.agentId),onCheckedChange:d=>$(i.agentId,d===!0)}),n.jsxs(W,{htmlFor:g,className:"text-sm font-normal",children:[i.agentName,": ",i.detail]})]},i.agentId)})}),n.jsxs("p",{className:"text-muted-foreground text-sm",children:["This affects ",c," ",c===1?"agent":"agents"," now."]})]}),n.jsxs(z,{className:"gap-2",children:[n.jsx(p,{variant:"outline",onClick:()=>{f(new Set),l()},disabled:m,children:"Keep their settings"}),n.jsx(p,{onClick:()=>{const i=[...u];f(new Set),b(i)},disabled:m||u.size===0,children:"Update selected"})]})]})})}export{ie as A,te as B,oe as P,h as S,Z as a,re as b,X as c,Y as d,v as e,ne as f,se as g,ee as h,G as l,ae as s,V as u};
|
package/dist/client/assets/{AttentionSignalRow-3CgglXkd.js → AttentionSignalRow-2-aDCEdR.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aD as r,aE as n,j as e,W as i,a7 as o,B as d}from"./index-
|
|
1
|
+
import{aD as r,aE as n,j as e,W as i,a7 as o,B as d}from"./index-DxTOTFWT.js";const c={initial:{opacity:0,y:8},animate:{opacity:1,y:0}};function l({signal:t}){const a=r(),s=n(t.since);return e.jsxs(i.div,{variants:c,"data-slot":"attention-signal-row",className:"hover:bg-accent/50 flex min-w-0 items-center gap-2.5 rounded-md px-2 py-1 transition-colors",children:[e.jsx("span",{className:"bg-status-error size-1.5 shrink-0 rounded-full","aria-hidden":!0}),e.jsx(o,{className:"text-status-error/70 size-3.5 shrink-0","aria-hidden":!0}),e.jsxs("span",{className:"text-foreground/90 min-w-0 flex-1 truncate text-xs",children:[t.primary,t.secondary!==void 0&&e.jsxs("span",{className:"text-muted-foreground",children:[" · ",t.secondary]})]}),e.jsx("span",{className:"text-muted-foreground shrink-0 text-xs tabular-nums",children:s}),e.jsx(d,{variant:"ghost",size:"sm",className:"relative h-6 shrink-0 px-2 text-xs after:absolute after:-inset-3 md:after:hidden","aria-label":`Open ${t.primary}`,onClick:()=>void a.navigate({href:t.deepLink}),children:"Open →"})]})}export{l as A};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as _t,c as Z,a as Te,b as U,s as ht,m as Je,i as g,k as Ft,e as w,f as s,d as S,l as O,M as He,j as le,F as zt,S as Et,n as pt,t as E,o as It,p as mt,q as Bt,r as $t,v as Ke}from"./index-
|
|
1
|
+
import{u as _t,c as Z,a as Te,b as U,s as ht,m as Je,i as g,k as Ft,e as w,f as s,d as S,l as O,M as He,j as le,F as zt,S as Et,n as pt,t as E,o as It,p as mt,q as Bt,r as $t,v as Ke}from"./index-D7MytHQN.js";import{cO as Dt,cP as be,a$ as V,cQ as st,cR as Tt,cS as At,cT as Rt}from"./index-DxTOTFWT.js";let Mt={data:""},Pt=r=>{if(typeof window=="object"){let e=(r?r.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return e.nonce=window.__nonce__,e.parentNode||(r||document.head).appendChild(e),e.firstChild}return r||Mt},Ot=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Lt=/\/\*[^]*?\*\/| +/g,lt=/\n+/g,ae=(r,e)=>{let i="",t="",c="";for(let a in r){let l=r[a];a[0]=="@"?a[1]=="i"?i=a+" "+l+";":t+=a[1]=="f"?ae(l,a):a+"{"+ae(l,a[1]=="k"?"":e)+"}":typeof l=="object"?t+=ae(l,e?e.replace(/([^,])+/g,v=>a.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,u=>/&/.test(u)?u.replace(/&/g,v):v?v+" "+u:u)):a):l!=null&&(a=a[1]=="-"?a:a.replace(/[A-Z]/g,"-$&").toLowerCase(),c+=ae.p?ae.p(a,l):a+":"+l+";")}return i+(e&&c?e+"{"+c+"}":c)+t},ne={},bt=r=>{if(typeof r=="object"){let e="";for(let i in r)e+=i+bt(r[i]);return e}return r},jt=(r,e,i,t,c)=>{let a=bt(r),l=ne[a]||(ne[a]=(u=>{let o=0,n=11;for(;o<u.length;)n=101*n+u.charCodeAt(o++)>>>0;return"go"+n})(a));if(!ne[l]){let u=a!==r?r:(o=>{let n,k,m=[{}];for(;n=Ot.exec(o.replace(Lt,""));)n[4]?m.shift():n[3]?(k=n[3].replace(lt," ").trim(),m.unshift(m[0][k]=m[0][k]||{})):m[0][n[1]]=n[2].replace(lt," ").trim();return m[0]})(r);ne[l]=ae(c?{["@keyframes "+l]:u}:u,i?"":"."+l)}let v=i&&ne.g;return i&&(ne.g=ne[l]),((u,o,n,k)=>{k?o.data=o.data.replace(k,u):o.data.indexOf(u)===-1&&(o.data=n?u+o.data:o.data+u)})(ne[l],e,t,v),l},Ht=(r,e,i)=>r.reduce((t,c,a)=>{let l=e[a];if(l&&l.call){let v=l(i),u=v&&v.props&&v.props.className||/^go/.test(v)&&v;l=u?"."+u:v&&typeof v=="object"?v.props?"":ae(v,""):v===!1?"":v}return t+c+(l??"")},"");function ue(r){let e=this||{},i=r.call?r(e.p):r;return jt(i.unshift?i.raw?Ht(i,[].slice.call(arguments,1),e.p):i.reduce((t,c)=>Object.assign(t,c&&c.call?c(e.p):c),{}):i,Pt(e.target),e.g,e.o,e.k)}ue.bind({g:1});ue.bind({k:1});var D={colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000000",white:"#ffffff",neutral:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},darkGray:{50:"#525c7a",100:"#49536e",200:"#414962",300:"#394056",400:"#313749",500:"#292e3d",600:"#212530",700:"#191c24",800:"#111318",900:"#0b0d10"},gray:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},blue:{25:"#F5FAFF",50:"#EFF8FF",100:"#D1E9FF",200:"#B2DDFF",300:"#84CAFF",400:"#53B1FD",500:"#2E90FA",600:"#1570EF",700:"#175CD3",800:"#1849A9",900:"#194185"},green:{25:"#F6FEF9",50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},yellow:{25:"#FFFCF5",50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E"},purple:{25:"#FAFAFF",50:"#F4F3FF",100:"#EBE9FE",200:"#D9D6FE",300:"#BDB4FE",400:"#9B8AFB",500:"#7A5AF8",600:"#6938EF",700:"#5925DC",800:"#4A1FB8",900:"#3E1C96"},teal:{25:"#F6FEFC",50:"#F0FDF9",100:"#CCFBEF",200:"#99F6E0",300:"#5FE9D0",400:"#2ED3B7",500:"#15B79E",600:"#0E9384",700:"#107569",800:"#125D56",900:"#134E48"},pink:{25:"#fdf2f8",50:"#fce7f3",100:"#fbcfe8",200:"#f9a8d4",300:"#f472b6",400:"#ec4899",500:"#db2777",600:"#be185d",700:"#9d174d",800:"#831843",900:"#500724"},cyan:{25:"#ecfeff",50:"#cffafe",100:"#a5f3fc",200:"#67e8f9",300:"#22d3ee",400:"#06b6d4",500:"#0891b2",600:"#0e7490",700:"#155e75",800:"#164e63",900:"#083344"}},alpha:{90:"e5",70:"b3",20:"33"},font:{size:{"2xs":"calc(var(--tsrd-font-size) * 0.625)",xs:"calc(var(--tsrd-font-size) * 0.75)",sm:"calc(var(--tsrd-font-size) * 0.875)",md:"var(--tsrd-font-size)"},lineHeight:{xs:"calc(var(--tsrd-font-size) * 1)",sm:"calc(var(--tsrd-font-size) * 1.25)"},weight:{normal:"400",medium:"500",semibold:"600",bold:"700"},fontFamily:{sans:"ui-sans-serif, Inter, system-ui, sans-serif, sans-serif",mono:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace"}},border:{radius:{xs:"calc(var(--tsrd-font-size) * 0.125)",sm:"calc(var(--tsrd-font-size) * 0.25)",md:"calc(var(--tsrd-font-size) * 0.375)",full:"9999px"}},size:{0:"0px",.5:"calc(var(--tsrd-font-size) * 0.125)",1:"calc(var(--tsrd-font-size) * 0.25)",1.5:"calc(var(--tsrd-font-size) * 0.375)",2:"calc(var(--tsrd-font-size) * 0.5)",2.5:"calc(var(--tsrd-font-size) * 0.625)",3:"calc(var(--tsrd-font-size) * 0.75)",3.5:"calc(var(--tsrd-font-size) * 0.875)",4:"calc(var(--tsrd-font-size) * 1)",5:"calc(var(--tsrd-font-size) * 1.25)",8:"calc(var(--tsrd-font-size) * 2)"}},Gt=r=>{const{colors:e,font:i,size:t,alpha:c,border:a}=D,{fontFamily:l,lineHeight:v,size:u}=i,o=r?ue.bind({target:r}):ue;return{devtoolsPanelContainer:o`
|
|
2
2
|
direction: ltr;
|
|
3
3
|
position: fixed;
|
|
4
4
|
bottom: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{gs as v,gt as fe,g7 as be,gu as Ce,j as e,fY as ee,fZ as ne,f_ as te,f$ as se,gv as Ne,g0 as ae,gw as ie,g1 as re,g2 as ce,g3 as oe,a8 as de,aa as Ie,ab as Te,a9 as Ae,y as le,gx as Se,r as A,gy as he,e1 as g,dW as S,dX as k,dY as R,dZ as F,d_ as b,gz as ke,gA as Re,a6 as E,a5 as pe,ay as Fe,gB as Oe,gC as we,cB as Me,cE as De,cF as Ee,cH as Be,cI as $e,cJ as _e,ar as Le,I as Pe,gD as Z,B,dh as ze,gE as He,et as qe,gF as Ye,x as Ge}from"./index-CdKpQ1hI.js";import{B as We}from"./use-bindings-Ch6UUBvz.js";import{u as Ke}from"./form-vPuXuaYT.js";import{u as Qe}from"./use-adapter-catalog-ClMqVelU.js";import{I as Ue,t as Ve}from"./trust-posture-15DMDZTA.js";function J(n){return`Turn on ${be(n.stop)}`}function Ze(n){return!v(n)||fe(n)?null:"This stop never pauses to ask. It acts without checking with you."}function Je({descriptor:n,consequence:i,onCancel:o,onConfirm:h}){const d=Ce(n??void 0),y=n?Ze(n):null;return e.jsx(ee,{open:n!==null,onOpenChange:C=>!C&&o(),children:e.jsxs(ne,{children:[e.jsxs(te,{children:[e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(Ne,{descriptor:n??void 0,className:`size-4 ${d}`}),n&&J(n)]}),e.jsxs(ae,{children:[n==null?void 0:n.promise,y&&" ",y&&e.jsx("span",{className:"text-foreground mt-2 block","data-testid":"consent-asks-note",children:y})]})]}),e.jsx("div",{className:"text-muted-foreground space-y-2 text-sm",children:i}),n&&e.jsx(ie,{mode:n.id,descriptor:n}),e.jsxs(re,{children:[e.jsx(ce,{children:"Cancel"}),e.jsx(oe,{onClick:h,children:n&&J(n)})]})]})})}function ln(n={}){const i=de(),o=Ie();return Te({mutationFn:h=>i.createBinding(h),onSuccess:()=>{o.invalidateQueries({queryKey:[...We]})},meta:n.suppressErrorToast?{suppressErrorToast:!0}:{errorLabel:n.errorLabel??"Couldn’t add that connection"}})}function Xe(n){const i=de();return Ae({queryKey:["relay","observed-chats",n],queryFn:()=>i.getObservedChats(n),enabled:!!n,staleTime:3e4})}const X=[{value:"per-chat",label:"One shared chat per group or channel",description:"Everyone there shares one chat with the agent."},{value:"per-user",label:"One chat per person",description:"Each person gets their own chat, even in a group."},{value:"stateless",label:"A fresh start every message",description:"Nothing carries over from the message before."}],Y="claude-code";function ve({strategy:n,onStrategyChange:i,permissionMode:o,onPermissionModeChange:h,canInitiate:d,onCanInitiateChange:y,canReply:C,onCanReplyChange:O,canReceive:w,onCanReceiveChange:M,notifyOnTaskComplete:$,onNotifyOnTaskCompleteChange:_,notifyBootstrapHint:p,bridged:L,open:P,onOpenChange:z,hasChanges:H}){const u=X.find(l=>l.value===n),j=le(Y),c=(j==null?void 0:j.permissionModes.values)??[],r=c.find(l=>l.id===o),D=(r==null?void 0:r.label)??Se(o),[f,I]=A.useState(null);function q(l){const N=c.find(T=>T.id===l);if(N&&v(N)){I(N);return}h(l)}return e.jsxs(e.Fragment,{children:[e.jsxs(he,{open:P,onOpenChange:z,trigger:"Advanced",badge:H?e.jsx(pe,{variant:"secondary",children:"Modified"}):void 0,children:[L?e.jsxs("div",{className:"space-y-1.5 px-4 py-3",children:[e.jsx(g,{children:"How the agent remembers"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Kept in the channel this chat is linked to."})]}):e.jsxs("div",{className:"space-y-1.5 px-4 py-3",children:[e.jsx(g,{htmlFor:"binding-session-strategy",children:"How the agent remembers"}),e.jsxs(S,{value:n,onValueChange:l=>i(l),children:[e.jsx(k,{id:"binding-session-strategy",className:"w-full",children:e.jsx(R,{})}),e.jsx(F,{children:X.map(l=>e.jsx(b,{value:l.value,children:l.label},l.value))})]}),u&&e.jsx("p",{className:"text-muted-foreground text-xs",children:u.description})]}),e.jsxs("div",{className:"space-y-2 px-4 py-3",children:[e.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Permissions"}),c.length===0?e.jsxs("p",{"data-testid":"trust-dial-unavailable",className:"text-muted-foreground px-1 text-xs leading-relaxed",children:["Set to “",D,"”. No other levels to choose yet. Saving keeps it."]}):e.jsxs(e.Fragment,{children:[e.jsx(ke,{mode:o,descriptors:c,onChangeMode:q,strandsWorkingMode:!0,strandedNote:e.jsxs(e.Fragment,{children:["Set to “",D,"”. Saving keeps it, or pick a stop."]})}),e.jsx(ie,{mode:o,...r?{descriptor:r}:{},className:"px-1"})]})]}),e.jsxs("div",{className:"space-y-2.5 px-4 py-3",children:[e.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Message direction"}),e.jsxs("div",{className:"flex cursor-pointer items-center justify-between gap-3",children:[e.jsxs(g,{htmlFor:"perm-initiate",className:"flex cursor-pointer items-center gap-1.5 text-xs font-normal",children:[e.jsx(Re,{className:"text-muted-foreground size-3"}),"Agent can message first"]}),e.jsx(E,{id:"perm-initiate",checked:d,onCheckedChange:y,"aria-label":"Agent can message first"})]}),e.jsxs("div",{className:"flex cursor-pointer items-center justify-between gap-3",children:[e.jsx(g,{htmlFor:"perm-reply",className:"cursor-pointer text-xs font-normal",children:"Agent can reply to messages"}),e.jsx(E,{id:"perm-reply",checked:C,onCheckedChange:O,"aria-label":"Agent can reply to messages"})]}),e.jsxs("div",{className:"flex cursor-pointer items-center justify-between gap-3",children:[e.jsx(g,{htmlFor:"perm-receive",className:"cursor-pointer text-xs font-normal",children:"Agent receives new messages"}),e.jsx(E,{id:"perm-receive",checked:w,onCheckedChange:M,"aria-label":"Agent receives new messages"})]})]}),e.jsxs("div",{className:"space-y-2.5 px-4 py-3",children:[e.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Notifications"}),e.jsxs("div",{className:"flex cursor-pointer items-center justify-between gap-3",children:[e.jsx(g,{htmlFor:"notify-task-complete",className:"cursor-pointer text-xs font-normal",children:"Message me when scheduled tasks finish"}),e.jsx(E,{id:"notify-task-complete",checked:$,onCheckedChange:_,"aria-label":"Message me when scheduled tasks finish"})]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"When off, you still hear about runs that didn’t finish."}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Needs “Agent can message first”."}),p&&e.jsx("p",{className:"text-muted-foreground text-xs",children:"Message your bot once to start. Bots can’t write first."})]})]}),e.jsx(Je,{descriptor:f,consequence:e.jsxs(e.Fragment,{children:["Anyone who can message this connection can make the agent act, with no one asked."," ",e.jsxs(Ue,{label:"About asking in the chat",title:"At a stop that asks",children:[e.jsx("p",{children:"Where your connection can show buttons, the agent waits for Approve or Deny."}),e.jsx("p",{children:"Only people on the approver list can answer."}),e.jsx("p",{children:"An ask nobody answers is refused after 10 minutes, and the agent carries on."})]})]}),onCancel:()=>I(null),onConfirm:()=>{f&&h(f.id),I(null)}})]})}const m="__any__",en={"per-chat":"One shared chat per group or channel","per-user":"One chat for each person",stateless:"No memory between messages"},me=[{value:"dm",label:"Direct message"},{value:"group",label:"Group"},{value:"channel",label:"Broadcast channel"},{value:"thread",label:"Thread"}];function ge(n){var i;return((i=me.find(o=>o.value===n))==null?void 0:i.label)??n}function nn({sessionStrategy:n,chatDisplayName:i,channelType:o}){const h=en[n];return i?`${h} in ${i}`:o?`${h} · ${ge(o)}`:h}function hn(n){return{adapterId:n.adapterId,agentId:n.agentId,sessionStrategy:n.sessionStrategy,label:n.label,permissionMode:n.permissionMode,chatId:n.chatId,channelType:n.channelType,canInitiate:n.canInitiate,canReply:n.canReply,canReceive:n.canReceive,notifyOnTaskComplete:n.notifyOnTaskComplete}}function pn(n){return{sessionStrategy:n.sessionStrategy,label:n.label,permissionMode:n.permissionMode,chatId:n.chatId??null,channelType:n.channelType??null,canInitiate:n.canInitiate,canReply:n.canReply,canReceive:n.canReceive,notifyOnTaskComplete:n.notifyOnTaskComplete}}function tn(n){return!!(n!=null&&n.canInitiate||(n==null?void 0:n.canReply)===!1||(n==null?void 0:n.canReceive)===!1||(n==null?void 0:n.notifyOnTaskComplete)===!1||(n==null?void 0:n.permissionMode)!==void 0&&n.permissionMode!=="acceptEdits"||n!=null&&n.sessionStrategy&&n.sessionStrategy!=="per-chat")}function sn(n,i){return{adapterId:(n==null?void 0:n.adapterId)??"",agentId:(n==null?void 0:n.agentId)??"",strategy:(n==null?void 0:n.sessionStrategy)??"per-chat",label:(n==null?void 0:n.label)??"",chatId:(n==null?void 0:n.chatId)??m,channelType:(n==null?void 0:n.channelType)??m,permissionMode:(n==null?void 0:n.permissionMode)??(i==null?void 0:i.defaultPermissionMode)??"acceptEdits",canInitiate:(n==null?void 0:n.canInitiate)??(i==null?void 0:i.defaultCanInitiate)??!1,canReply:(n==null?void 0:n.canReply)??!0,canReceive:(n==null?void 0:n.canReceive)??!0,notifyOnTaskComplete:(n==null?void 0:n.notifyOnTaskComplete)??!0}}function mn({open:n,onOpenChange:i,onConfirm:o,mode:h,initialValues:d,adapterName:y,agentName:C,onDelete:O,bindingId:w,isPending:M,bridged:$,bridgeSlot:_}){const p=h==="edit",[L,P]=A.useState(()=>!!(d!=null&&d.chatId||d!=null&&d.channelType)),[z,H]=A.useState(()=>tn(d)),{data:u}=Fe(),j=le(Y),[c]=A.useState(()=>{var t;return sn(d,p?void 0:{defaultPermissionMode:Oe(we(u==null?void 0:u.executionDefaults,Y),(j==null?void 0:j.permissionModes.values)??[]),defaultCanInitiate:u!=null&&Ve((t=u.permissions)==null?void 0:t.preset)==="trusted"})}),r=Ke({defaultValues:c,onSubmit:async({value:t})=>{await o({adapterId:t.adapterId,agentId:t.agentId,sessionStrategy:t.strategy,label:t.label,permissionMode:t.permissionMode,chatId:t.chatId===m?void 0:t.chatId,channelType:t.channelType===m?void 0:t.channelType,canInitiate:t.canInitiate,canReply:t.canReply,canReceive:t.canReceive,notifyOnTaskComplete:t.notifyOnTaskComplete}),p||r.reset()}}),{data:D=[]}=Qe(),{data:f}=Me(),[I,q]=A.useState(()=>(d==null?void 0:d.adapterId)??""),{data:l=[]}=Xe(I||void 0),N=D.flatMap(t=>t.instances.filter(x=>x.enabled).map(x=>({id:x.id,label:x.label?`${x.label} (${t.manifest.displayName})`:`${x.id} (${t.manifest.displayName})`}))),T=(f==null?void 0:f.agents)??[];function xe(){r.setFieldValue("chatId",m),r.setFieldValue("channelType",m)}return e.jsx(De,{open:n,onOpenChange:i,children:e.jsxs(Ee,{className:"max-h-[85vh] max-w-md gap-0 p-0",children:[e.jsxs(Be,{className:"border-b px-4 py-3",children:[e.jsx($e,{children:p?"Edit connection":"Add connection"}),e.jsx(_e,{className:"sr-only",children:p?"Edit this connection’s settings":"Connect this agent to a chat"})]}),e.jsx(r.Subscribe,{selector:t=>({values:t.values,isSubmitting:t.isSubmitting}),children:({values:t,isSubmitting:x})=>{var V;const G=p||!!t.adapterId&&!!t.agentId,ue=!p||t.adapterId!==c.adapterId||t.agentId!==c.agentId||t.strategy!==c.strategy||t.label!==c.label||t.chatId!==c.chatId||t.channelType!==c.channelType||t.permissionMode!==c.permissionMode||t.canInitiate!==c.canInitiate||t.canReply!==c.canReply||t.canReceive!==c.canReceive||t.notifyOnTaskComplete!==c.notifyOnTaskComplete,W=p?C:(V=T.find(s=>s.id===t.agentId))==null?void 0:V.name,K=G&&W?`${nn({sessionStrategy:t.strategy,chatDisplayName:t.chatId!==m?`#${t.chatId}`:void 0,channelType:t.channelType!==m?t.channelType:void 0})}. Routed to ${W}.`:null,Q=t.chatId!==m||t.channelType!==m,ye=t.strategy!=="per-chat"||t.permissionMode!=="acceptEdits"||t.canInitiate||!t.canReply||!t.canReceive||!t.notifyOnTaskComplete,je=!G||!ue||!!M||x,U=!!M||x;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-5 overflow-y-auto px-4 py-5",children:[p?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-muted-foreground text-sm",children:["Connection:"," ",e.jsx("span",{className:"text-foreground font-medium",children:y})," →"," ",e.jsx("span",{className:"text-foreground font-medium",children:C})]}),_]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(g,{htmlFor:"binding-adapter",children:"Source"}),N.length===0?e.jsx("p",{className:"text-muted-foreground border-input rounded-md border px-3 py-2 text-sm opacity-50",children:"Nothing set up yet"}):e.jsx(r.AppField,{name:"adapterId",children:s=>e.jsxs(S,{value:s.state.value,onValueChange:a=>{s.handleChange(a),q(a)},children:[e.jsx(k,{id:"binding-adapter",className:"w-full",children:e.jsx(R,{placeholder:"Pick a source"})}),e.jsx(F,{children:N.map(a=>e.jsx(b,{value:a.id,children:a.label},a.id))})]})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(g,{htmlFor:"binding-agent",children:"Agent"}),T.length===0?e.jsx("p",{className:"text-muted-foreground border-input rounded-md border px-3 py-2 text-sm opacity-50",children:"No agents yet"}):e.jsx(r.AppField,{name:"agentId",children:s=>e.jsxs(S,{value:s.state.value,onValueChange:s.handleChange,children:[e.jsx(k,{id:"binding-agent",className:"w-full",children:e.jsx(R,{placeholder:"Select an agent"})}),e.jsx(F,{children:T.map(a=>e.jsx(b,{value:a.id,children:Le(a)},a.id))})]})})]})]}),e.jsx(r.AppField,{name:"label",children:s=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(g,{htmlFor:"binding-label",children:"Label (optional)"}),e.jsx(Pe,{id:"binding-label",placeholder:"e.g., Customer support bot",value:s.state.value,onBlur:s.handleBlur,onChange:a=>s.handleChange(a.target.value)}),e.jsx(Z,{children:"A name to tell this connection apart"})]})}),e.jsxs(he,{open:L,onOpenChange:P,trigger:"Chat filter",badge:Q?e.jsx(pe,{variant:"secondary",children:"Active"}):void 0,children:[e.jsx(r.AppField,{name:"chatId",children:s=>e.jsxs("div",{className:"space-y-1.5 px-4 py-3",children:[e.jsx(g,{htmlFor:"binding-chat-id",children:"Chat ID"}),e.jsxs(S,{value:s.state.value,onValueChange:s.handleChange,children:[e.jsx(k,{id:"binding-chat-id",className:"w-full",children:e.jsx(R,{placeholder:"Any chat"})}),e.jsxs(F,{children:[e.jsx(b,{value:m,children:"Any chat"}),l.map(a=>e.jsxs(b,{value:a.chatId,children:[e.jsx("span",{children:a.displayName??a.chatId}),(a.channelType||a.messageCount>0)&&e.jsx("span",{className:"text-muted-foreground ml-2 text-xs",children:[a.channelType?ge(a.channelType):null,`${a.messageCount} messages`].filter(Boolean).join(" · ")})]},a.chatId))]})]}),e.jsx(Z,{children:"Only take messages from this chat"})]})}),e.jsx(r.AppField,{name:"channelType",children:s=>e.jsxs("div",{className:"space-y-1.5 px-4 py-3",children:[e.jsx(g,{htmlFor:"binding-channel-type",children:"Chat type"}),e.jsxs(S,{value:s.state.value,onValueChange:s.handleChange,children:[e.jsx(k,{id:"binding-channel-type",className:"w-full",children:e.jsx(R,{placeholder:"Any type"})}),e.jsxs(F,{children:[e.jsx(b,{value:m,children:"Any type"}),me.map(a=>e.jsx(b,{value:a.value,children:a.label},a.value))]})]})]})}),Q&&e.jsx("div",{className:"px-4 py-3",children:e.jsx(B,{variant:"ghost",size:"sm",onClick:xe,children:"Clear filters"})})]}),e.jsx(ve,{strategy:t.strategy,onStrategyChange:s=>r.setFieldValue("strategy",s),permissionMode:t.permissionMode,onPermissionModeChange:s=>r.setFieldValue("permissionMode",s),canInitiate:t.canInitiate,onCanInitiateChange:s=>r.setFieldValue("canInitiate",s),canReply:t.canReply,onCanReplyChange:s=>r.setFieldValue("canReply",s),canReceive:t.canReceive,onCanReceiveChange:s=>r.setFieldValue("canReceive",s),notifyOnTaskComplete:t.notifyOnTaskComplete,onNotifyOnTaskCompleteChange:s=>r.setFieldValue("notifyOnTaskComplete",s),notifyBootstrapHint:l.length===0,bridged:$,open:z,onOpenChange:H,hasChanges:ye}),K&&e.jsx("p",{className:"text-muted-foreground bg-muted/50 rounded-md px-3 py-2 text-xs italic",children:K})]}),e.jsxs(ze,{className:"border-t px-4 py-3",children:[p&&O&&w&&e.jsxs(ee,{children:[e.jsx(He,{asChild:!0,children:e.jsxs(B,{variant:"ghost",size:"sm",className:"mr-auto text-red-600 hover:bg-red-50 hover:text-red-700 dark:hover:bg-red-950",children:[e.jsx(qe,{className:"mr-1.5 size-3.5"}),"Remove"]})}),e.jsxs(ne,{children:[e.jsxs(te,{children:[e.jsx(se,{children:"Remove this connection?"}),e.jsx(ae,{children:"This agent stops getting messages from it."})]}),e.jsxs(re,{children:[e.jsx(ce,{children:"Cancel"}),e.jsx(oe,{onClick:()=>O(w),className:Ye({variant:"destructive"}),children:"Remove connection"})]})]})]}),e.jsx(B,{variant:"ghost",size:"sm",onClick:()=>i(!1),children:"Cancel"}),e.jsxs(B,{size:"sm",onClick:()=>r.handleSubmit(),disabled:je,children:[U&&e.jsx(Ge,{size:"xs",className:"mr-1.5"}),U?"Saving…":p?"Save changes":"Add connection"]})]})]})}})]})})}export{mn as B,ln as a,nn as b,hn as c,ge as d,pn as t,Xe as u};
|
|
1
|
+
import{gu as v,gv as fe,g9 as be,gw as Ce,j as e,f_ as ee,f$ as ne,g0 as te,g1 as se,gx as Ne,g2 as ae,gy as ie,g3 as re,g4 as ce,g5 as oe,a8 as de,aa as Ie,ab as Te,a9 as Ae,y as le,gz as Se,r as A,gA as he,e3 as g,dY as S,dZ as k,d_ as R,d$ as F,e0 as b,gB as ke,gC as Re,a6 as E,a5 as pe,ay as Fe,gD as Oe,gE as we,cD as Me,cG as De,cH as Ee,cJ as Be,cK as $e,cL as _e,ar as Le,I as Pe,gF as J,B,dj as ze,gG as He,ev as qe,gH as Ge,x as Ye}from"./index-DxTOTFWT.js";import{B as Ke}from"./use-bindings-BXHWfTB2.js";import{u as Qe}from"./form-FbjLEM3I.js";import{u as Ue}from"./use-adapter-catalog-DDD8zCQo.js";import{I as We,t as Ve}from"./trust-posture-BxFTuKAo.js";function Z(n){return`Turn on ${be(n.stop)}`}function Je(n){return!v(n)||fe(n)?null:"This stop never pauses to ask. It acts without checking with you."}function Ze({descriptor:n,consequence:i,onCancel:o,onConfirm:h}){const d=Ce(n??void 0),y=n?Je(n):null;return e.jsx(ee,{open:n!==null,onOpenChange:C=>!C&&o(),children:e.jsxs(ne,{children:[e.jsxs(te,{children:[e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(Ne,{descriptor:n??void 0,className:`size-4 ${d}`}),n&&Z(n)]}),e.jsxs(ae,{children:[n==null?void 0:n.promise,y&&" ",y&&e.jsx("span",{className:"text-foreground mt-2 block","data-testid":"consent-asks-note",children:y})]})]}),e.jsx("div",{className:"text-muted-foreground space-y-2 text-sm",children:i}),n&&e.jsx(ie,{mode:n.id,descriptor:n}),e.jsxs(re,{children:[e.jsx(ce,{children:"Cancel"}),e.jsx(oe,{onClick:h,children:n&&Z(n)})]})]})})}function ln(n={}){const i=de(),o=Ie();return Te({mutationFn:h=>i.createBinding(h),onSuccess:()=>{o.invalidateQueries({queryKey:[...Ke]})},meta:n.suppressErrorToast?{suppressErrorToast:!0}:{errorLabel:n.errorLabel??"Couldn’t add that connection"}})}function Xe(n){const i=de();return Ae({queryKey:["relay","observed-chats",n],queryFn:()=>i.getObservedChats(n),enabled:!!n,staleTime:3e4})}const X=[{value:"per-chat",label:"One shared chat per group or channel",description:"Everyone there shares one chat with the agent."},{value:"per-user",label:"One chat per person",description:"Each person gets their own chat, even in a group."},{value:"stateless",label:"A fresh start every message",description:"Nothing carries over from the message before."}],G="claude-code";function ve({strategy:n,onStrategyChange:i,permissionMode:o,onPermissionModeChange:h,canInitiate:d,onCanInitiateChange:y,canReply:C,onCanReplyChange:O,canReceive:w,onCanReceiveChange:M,notifyOnTaskComplete:$,onNotifyOnTaskCompleteChange:_,notifyBootstrapHint:p,bridged:L,open:P,onOpenChange:z,hasChanges:H}){const u=X.find(l=>l.value===n),j=le(G),c=(j==null?void 0:j.permissionModes.values)??[],r=c.find(l=>l.id===o),D=(r==null?void 0:r.label)??Se(o),[f,I]=A.useState(null);function q(l){const N=c.find(T=>T.id===l);if(N&&v(N)){I(N);return}h(l)}return e.jsxs(e.Fragment,{children:[e.jsxs(he,{open:P,onOpenChange:z,trigger:"Advanced",badge:H?e.jsx(pe,{variant:"secondary",children:"Modified"}):void 0,children:[L?e.jsxs("div",{className:"space-y-1.5 px-4 py-3",children:[e.jsx(g,{children:"How the agent remembers"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Kept in the channel this chat is linked to."})]}):e.jsxs("div",{className:"space-y-1.5 px-4 py-3",children:[e.jsx(g,{htmlFor:"binding-session-strategy",children:"How the agent remembers"}),e.jsxs(S,{value:n,onValueChange:l=>i(l),children:[e.jsx(k,{id:"binding-session-strategy",className:"w-full",children:e.jsx(R,{})}),e.jsx(F,{children:X.map(l=>e.jsx(b,{value:l.value,children:l.label},l.value))})]}),u&&e.jsx("p",{className:"text-muted-foreground text-xs",children:u.description})]}),e.jsxs("div",{className:"space-y-2 px-4 py-3",children:[e.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Permissions"}),c.length===0?e.jsxs("p",{"data-testid":"trust-dial-unavailable",className:"text-muted-foreground px-1 text-xs leading-relaxed",children:["Set to “",D,"”. No other levels to choose yet. Saving keeps it."]}):e.jsxs(e.Fragment,{children:[e.jsx(ke,{mode:o,descriptors:c,onChangeMode:q,strandsWorkingMode:!0,strandedNote:e.jsxs(e.Fragment,{children:["Set to “",D,"”. Saving keeps it, or pick a stop."]})}),e.jsx(ie,{mode:o,...r?{descriptor:r}:{},className:"px-1"})]})]}),e.jsxs("div",{className:"space-y-2.5 px-4 py-3",children:[e.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Message direction"}),e.jsxs("div",{className:"flex cursor-pointer items-center justify-between gap-3",children:[e.jsxs(g,{htmlFor:"perm-initiate",className:"flex cursor-pointer items-center gap-1.5 text-xs font-normal",children:[e.jsx(Re,{className:"text-muted-foreground size-3"}),"Agent can message first"]}),e.jsx(E,{id:"perm-initiate",checked:d,onCheckedChange:y,"aria-label":"Agent can message first"})]}),e.jsxs("div",{className:"flex cursor-pointer items-center justify-between gap-3",children:[e.jsx(g,{htmlFor:"perm-reply",className:"cursor-pointer text-xs font-normal",children:"Agent can reply to messages"}),e.jsx(E,{id:"perm-reply",checked:C,onCheckedChange:O,"aria-label":"Agent can reply to messages"})]}),e.jsxs("div",{className:"flex cursor-pointer items-center justify-between gap-3",children:[e.jsx(g,{htmlFor:"perm-receive",className:"cursor-pointer text-xs font-normal",children:"Agent receives new messages"}),e.jsx(E,{id:"perm-receive",checked:w,onCheckedChange:M,"aria-label":"Agent receives new messages"})]})]}),e.jsxs("div",{className:"space-y-2.5 px-4 py-3",children:[e.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Notifications"}),e.jsxs("div",{className:"flex cursor-pointer items-center justify-between gap-3",children:[e.jsx(g,{htmlFor:"notify-task-complete",className:"cursor-pointer text-xs font-normal",children:"Message me when scheduled tasks finish"}),e.jsx(E,{id:"notify-task-complete",checked:$,onCheckedChange:_,"aria-label":"Message me when scheduled tasks finish"})]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"When off, you still hear about runs that didn’t finish."}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Needs “Agent can message first”."}),p&&e.jsx("p",{className:"text-muted-foreground text-xs",children:"Message your bot once to start. Bots can’t write first."})]})]}),e.jsx(Ze,{descriptor:f,consequence:e.jsxs(e.Fragment,{children:["Anyone who can message this connection can make the agent act, with no one asked."," ",e.jsxs(We,{label:"About asking in the chat",title:"At a stop that asks",children:[e.jsx("p",{children:"Where your connection can show buttons, the agent waits for Approve or Deny."}),e.jsx("p",{children:"Only people on the approver list can answer."}),e.jsx("p",{children:"An ask nobody answers is refused after 10 minutes, and the agent carries on."})]})]}),onCancel:()=>I(null),onConfirm:()=>{f&&h(f.id),I(null)}})]})}const m="__any__",en={"per-chat":"One shared chat per group or channel","per-user":"One chat for each person",stateless:"No memory between messages"},me=[{value:"dm",label:"Direct message"},{value:"group",label:"Group"},{value:"channel",label:"Broadcast channel"},{value:"thread",label:"Thread"}];function ge(n){var i;return((i=me.find(o=>o.value===n))==null?void 0:i.label)??n}function nn({sessionStrategy:n,chatDisplayName:i,channelType:o}){const h=en[n];return i?`${h} in ${i}`:o?`${h} · ${ge(o)}`:h}function hn(n){return{adapterId:n.adapterId,agentId:n.agentId,sessionStrategy:n.sessionStrategy,label:n.label,permissionMode:n.permissionMode,chatId:n.chatId,channelType:n.channelType,canInitiate:n.canInitiate,canReply:n.canReply,canReceive:n.canReceive,notifyOnTaskComplete:n.notifyOnTaskComplete}}function pn(n){return{sessionStrategy:n.sessionStrategy,label:n.label,permissionMode:n.permissionMode,chatId:n.chatId??null,channelType:n.channelType??null,canInitiate:n.canInitiate,canReply:n.canReply,canReceive:n.canReceive,notifyOnTaskComplete:n.notifyOnTaskComplete}}function tn(n){return!!(n!=null&&n.canInitiate||(n==null?void 0:n.canReply)===!1||(n==null?void 0:n.canReceive)===!1||(n==null?void 0:n.notifyOnTaskComplete)===!1||(n==null?void 0:n.permissionMode)!==void 0&&n.permissionMode!=="acceptEdits"||n!=null&&n.sessionStrategy&&n.sessionStrategy!=="per-chat")}function sn(n,i){return{adapterId:(n==null?void 0:n.adapterId)??"",agentId:(n==null?void 0:n.agentId)??"",strategy:(n==null?void 0:n.sessionStrategy)??"per-chat",label:(n==null?void 0:n.label)??"",chatId:(n==null?void 0:n.chatId)??m,channelType:(n==null?void 0:n.channelType)??m,permissionMode:(n==null?void 0:n.permissionMode)??(i==null?void 0:i.defaultPermissionMode)??"acceptEdits",canInitiate:(n==null?void 0:n.canInitiate)??(i==null?void 0:i.defaultCanInitiate)??!1,canReply:(n==null?void 0:n.canReply)??!0,canReceive:(n==null?void 0:n.canReceive)??!0,notifyOnTaskComplete:(n==null?void 0:n.notifyOnTaskComplete)??!0}}function mn({open:n,onOpenChange:i,onConfirm:o,mode:h,initialValues:d,adapterName:y,agentName:C,onDelete:O,bindingId:w,isPending:M,bridged:$,bridgeSlot:_}){const p=h==="edit",[L,P]=A.useState(()=>!!(d!=null&&d.chatId||d!=null&&d.channelType)),[z,H]=A.useState(()=>tn(d)),{data:u}=Fe(),j=le(G),[c]=A.useState(()=>{var t;return sn(d,p?void 0:{defaultPermissionMode:Oe(we(u==null?void 0:u.executionDefaults,G),(j==null?void 0:j.permissionModes.values)??[]),defaultCanInitiate:u!=null&&Ve((t=u.permissions)==null?void 0:t.preset)==="trusted"})}),r=Qe({defaultValues:c,onSubmit:async({value:t})=>{await o({adapterId:t.adapterId,agentId:t.agentId,sessionStrategy:t.strategy,label:t.label,permissionMode:t.permissionMode,chatId:t.chatId===m?void 0:t.chatId,channelType:t.channelType===m?void 0:t.channelType,canInitiate:t.canInitiate,canReply:t.canReply,canReceive:t.canReceive,notifyOnTaskComplete:t.notifyOnTaskComplete}),p||r.reset()}}),{data:D=[]}=Ue(),{data:f}=Me(),[I,q]=A.useState(()=>(d==null?void 0:d.adapterId)??""),{data:l=[]}=Xe(I||void 0),N=D.flatMap(t=>t.instances.filter(x=>x.enabled).map(x=>({id:x.id,label:x.label?`${x.label} (${t.manifest.displayName})`:`${x.id} (${t.manifest.displayName})`}))),T=(f==null?void 0:f.agents)??[];function xe(){r.setFieldValue("chatId",m),r.setFieldValue("channelType",m)}return e.jsx(De,{open:n,onOpenChange:i,children:e.jsxs(Ee,{className:"max-h-[85vh] max-w-md gap-0 p-0",children:[e.jsxs(Be,{className:"border-b px-4 py-3",children:[e.jsx($e,{children:p?"Edit connection":"Add connection"}),e.jsx(_e,{className:"sr-only",children:p?"Edit this connection’s settings":"Connect this agent to a chat"})]}),e.jsx(r.Subscribe,{selector:t=>({values:t.values,isSubmitting:t.isSubmitting}),children:({values:t,isSubmitting:x})=>{var V;const Y=p||!!t.adapterId&&!!t.agentId,ue=!p||t.adapterId!==c.adapterId||t.agentId!==c.agentId||t.strategy!==c.strategy||t.label!==c.label||t.chatId!==c.chatId||t.channelType!==c.channelType||t.permissionMode!==c.permissionMode||t.canInitiate!==c.canInitiate||t.canReply!==c.canReply||t.canReceive!==c.canReceive||t.notifyOnTaskComplete!==c.notifyOnTaskComplete,K=p?C:(V=T.find(s=>s.id===t.agentId))==null?void 0:V.name,Q=Y&&K?`${nn({sessionStrategy:t.strategy,chatDisplayName:t.chatId!==m?`#${t.chatId}`:void 0,channelType:t.channelType!==m?t.channelType:void 0})}. Routed to ${K}.`:null,U=t.chatId!==m||t.channelType!==m,ye=t.strategy!=="per-chat"||t.permissionMode!=="acceptEdits"||t.canInitiate||!t.canReply||!t.canReceive||!t.notifyOnTaskComplete,je=!Y||!ue||!!M||x,W=!!M||x;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-5 overflow-y-auto px-4 py-5",children:[p?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-muted-foreground text-sm",children:["Connection:"," ",e.jsx("span",{className:"text-foreground font-medium",children:y})," →"," ",e.jsx("span",{className:"text-foreground font-medium",children:C})]}),_]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(g,{htmlFor:"binding-adapter",children:"Source"}),N.length===0?e.jsx("p",{className:"text-muted-foreground border-input rounded-md border px-3 py-2 text-sm opacity-50",children:"Nothing set up yet"}):e.jsx(r.AppField,{name:"adapterId",children:s=>e.jsxs(S,{value:s.state.value,onValueChange:a=>{s.handleChange(a),q(a)},children:[e.jsx(k,{id:"binding-adapter",className:"w-full",children:e.jsx(R,{placeholder:"Pick a source"})}),e.jsx(F,{children:N.map(a=>e.jsx(b,{value:a.id,children:a.label},a.id))})]})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(g,{htmlFor:"binding-agent",children:"Agent"}),T.length===0?e.jsx("p",{className:"text-muted-foreground border-input rounded-md border px-3 py-2 text-sm opacity-50",children:"No agents yet"}):e.jsx(r.AppField,{name:"agentId",children:s=>e.jsxs(S,{value:s.state.value,onValueChange:s.handleChange,children:[e.jsx(k,{id:"binding-agent",className:"w-full",children:e.jsx(R,{placeholder:"Select an agent"})}),e.jsx(F,{children:T.map(a=>e.jsx(b,{value:a.id,children:Le(a)},a.id))})]})})]})]}),e.jsx(r.AppField,{name:"label",children:s=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(g,{htmlFor:"binding-label",children:"Label (optional)"}),e.jsx(Pe,{id:"binding-label",placeholder:"e.g., Customer support bot",value:s.state.value,onBlur:s.handleBlur,onChange:a=>s.handleChange(a.target.value)}),e.jsx(J,{children:"A name to tell this connection apart"})]})}),e.jsxs(he,{open:L,onOpenChange:P,trigger:"Chat filter",badge:U?e.jsx(pe,{variant:"secondary",children:"Active"}):void 0,children:[e.jsx(r.AppField,{name:"chatId",children:s=>e.jsxs("div",{className:"space-y-1.5 px-4 py-3",children:[e.jsx(g,{htmlFor:"binding-chat-id",children:"Chat ID"}),e.jsxs(S,{value:s.state.value,onValueChange:s.handleChange,children:[e.jsx(k,{id:"binding-chat-id",className:"w-full",children:e.jsx(R,{placeholder:"Any chat"})}),e.jsxs(F,{children:[e.jsx(b,{value:m,children:"Any chat"}),l.map(a=>e.jsxs(b,{value:a.chatId,children:[e.jsx("span",{children:a.displayName??a.chatId}),(a.channelType||a.messageCount>0)&&e.jsx("span",{className:"text-muted-foreground ml-2 text-xs",children:[a.channelType?ge(a.channelType):null,`${a.messageCount} messages`].filter(Boolean).join(" · ")})]},a.chatId))]})]}),e.jsx(J,{children:"Only take messages from this chat"})]})}),e.jsx(r.AppField,{name:"channelType",children:s=>e.jsxs("div",{className:"space-y-1.5 px-4 py-3",children:[e.jsx(g,{htmlFor:"binding-channel-type",children:"Chat type"}),e.jsxs(S,{value:s.state.value,onValueChange:s.handleChange,children:[e.jsx(k,{id:"binding-channel-type",className:"w-full",children:e.jsx(R,{placeholder:"Any type"})}),e.jsxs(F,{children:[e.jsx(b,{value:m,children:"Any type"}),me.map(a=>e.jsx(b,{value:a.value,children:a.label},a.value))]})]})]})}),U&&e.jsx("div",{className:"px-4 py-3",children:e.jsx(B,{variant:"ghost",size:"sm",onClick:xe,children:"Clear filters"})})]}),e.jsx(ve,{strategy:t.strategy,onStrategyChange:s=>r.setFieldValue("strategy",s),permissionMode:t.permissionMode,onPermissionModeChange:s=>r.setFieldValue("permissionMode",s),canInitiate:t.canInitiate,onCanInitiateChange:s=>r.setFieldValue("canInitiate",s),canReply:t.canReply,onCanReplyChange:s=>r.setFieldValue("canReply",s),canReceive:t.canReceive,onCanReceiveChange:s=>r.setFieldValue("canReceive",s),notifyOnTaskComplete:t.notifyOnTaskComplete,onNotifyOnTaskCompleteChange:s=>r.setFieldValue("notifyOnTaskComplete",s),notifyBootstrapHint:l.length===0,bridged:$,open:z,onOpenChange:H,hasChanges:ye}),Q&&e.jsx("p",{className:"text-muted-foreground bg-muted/50 rounded-md px-3 py-2 text-xs italic",children:Q})]}),e.jsxs(ze,{className:"border-t px-4 py-3",children:[p&&O&&w&&e.jsxs(ee,{children:[e.jsx(He,{asChild:!0,children:e.jsxs(B,{variant:"ghost",size:"sm",className:"mr-auto text-red-600 hover:bg-red-50 hover:text-red-700 dark:hover:bg-red-950",children:[e.jsx(qe,{className:"mr-1.5 size-3.5"}),"Remove"]})}),e.jsxs(ne,{children:[e.jsxs(te,{children:[e.jsx(se,{children:"Remove this connection?"}),e.jsx(ae,{children:"This agent stops getting messages from it."})]}),e.jsxs(re,{children:[e.jsx(ce,{children:"Cancel"}),e.jsx(oe,{onClick:()=>O(w),className:Ge({variant:"destructive"}),children:"Remove connection"})]})]})]}),e.jsx(B,{variant:"ghost",size:"sm",onClick:()=>i(!1),children:"Cancel"}),e.jsxs(B,{size:"sm",onClick:()=>r.handleSubmit(),disabled:je,children:[W&&e.jsx(Ye,{size:"xs",className:"mr-1.5"}),W?"Saving…":p?"Save changes":"Add connection"]})]})]})}})]})})}export{mn as B,ln as a,nn as b,hn as c,ge as d,pn as t,Xe as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var qy=Object.defineProperty;var Em=r=>{throw TypeError(r)};var _y=(r,e,t)=>e in r?qy(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var we=(r,e,t)=>_y(r,typeof e!="symbol"?e+"":e,t),Du=(r,e,t)=>e.has(r)||Em("Cannot "+t);var C=(r,e,t)=>(Du(r,e,"read from private field"),t?t.call(r):e.get(r)),P=(r,e,t)=>e.has(r)?Em("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),I=(r,e,t,n)=>(Du(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),mi=(r,e,t)=>(Du(r,e,"access private method"),t);import{
|
|
1
|
+
var qy=Object.defineProperty;var Em=r=>{throw TypeError(r)};var _y=(r,e,t)=>e in r?qy(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var we=(r,e,t)=>_y(r,typeof e!="symbol"?e+"":e,t),Du=(r,e,t)=>e.has(r)||Em("Cannot "+t);var C=(r,e,t)=>(Du(r,e,"read from private field"),t?t.call(r):e.get(r)),P=(r,e,t)=>e.has(r)?Em("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),I=(r,e,t,n)=>(Du(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),mi=(r,e,t)=>(Du(r,e,"access private method"),t);import{oJ as Dm,oK as $y,oL as jy,oM as Rd,oN as Vy,oO as Wy,oP as Uy,r as B,hW as z4,e7 as Fl,oQ as Od,oR as Id,oS as no,oT as Rm,oU as Ky,oV as Gy,oW as qr,oX as Kh,oY as Xi,eq as Jy,oZ as g0,o_ as wr,o$ as Yy,p0 as Xy,p1 as Om,p2 as Ys,p3 as Zy,p4 as y0,j as L,b1 as Qy,Q as e7}from"./index-DxTOTFWT.js";import{aw as t7,ax as r7,ab as n7,ac as i7,ad as o7,ae as s7,af as a7,ag as L4,ah as l7,q as q0,ai as c7,aj as B4,ar as u7,ak as d7,al as h7,am as f7,an as p7,ao as m7,ap as g7,aq as y7,Z as Gh,a4 as v7,a5 as P4,a6 as b7,a7 as w7,a8 as x7,a9 as k7,aa as S7,E as na,as as C7,t as nt,at as M7,n as T7,C as Im}from"./index-1-RB7sXm.js";const A7={}.hasOwnProperty;function F4(r,e){let t=-1,n;if(e.extensions)for(;++t<e.extensions.length;)F4(r,e.extensions[t]);for(n in e)if(A7.call(e,n))switch(n){case"extensions":break;case"unsafe":{zm(r[n],e[n]);break}case"join":{zm(r[n],e[n]);break}case"handlers":{N7(r[n],e[n]);break}default:r.options[n]=e[n]}return r}function zm(r,e){e&&r.push(...e)}function N7(r,e){e&&Object.assign(r,e)}const E7=[D7];function D7(r,e,t,n){if(e.type==="code"&&Dm(e,n)&&(r.type==="list"||r.type===e.type&&Dm(r,n)))return!1;if("spread"in t&&typeof t.spread=="boolean")return r.type==="paragraph"&&(r.type===e.type||e.type==="definition"||e.type==="heading"&&$y(e,n))?void 0:t.spread?1:0}const gi=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],R7=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
|
|
2
2
|
`,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:gi},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
|
|
3
3
|
]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:gi},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
|
|
4
4
|
*])`},{character:"*",inConstruct:"phrasing",notInConstruct:gi},{atBreak:!0,character:"+",after:`(?:[ \r
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{eq as Ee,a8 as xe,b0 as Re,r as ve,a9 as Se,j,Q as Ce}from"./index-DxTOTFWT.js";import{u as Oe}from"./index-sRPmoNhi.js";import{r as Te}from"./use-session-canvas-DrKA7UHs.js";import"./rotate-cw-Cwv_uaU3.js";import"./WidgetErrorCard-CBFo1SMe.js";import"./card-DVdPY08b.js";import"./progress-2cuTo9I-.js";import"./markdown-content-fIydDTfa.js";import"./table-C7pi-jkJ.js";import"./terminal-IYkyS2eR.js";import"./package-CGgpgsfC.js";import"./heart-BdbxexAy.js";import"./git-branch-BBKObhlk.js";import"./file-text-BNSVr0Hh.js";import"./file-Bc34j1rj.js";import"./McpAppFrame-BKgYSUH-.js";import"./more-details-DMD6Pqb5.js";var he={exports:{}};/* @license
|
|
2
2
|
Papa Parse
|
|
3
3
|
v5.7.0
|
|
4
4
|
https://github.com/mholt/PapaParse
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeMirrorEditor-
|
|
2
|
-
import{a8 as q,b0 as _,b1 as H,a9 as K,r as s,j as t,aa as V,Q as $,B as R,R as U,b2 as Y,b3 as L}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeMirrorEditor-BpIF0kLM.js","assets/index-DxTOTFWT.js","assets/index-DKubbEZd.css","assets/index-BcPMhqQ_.js","assets/index-1-RB7sXm.js","assets/BlintzCanvas-bfmQpoVE.js","assets/BlintzCanvas-GgiCXV7C.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a8 as q,b0 as _,b1 as H,a9 as K,r as s,j as t,aa as V,Q as $,B as R,R as U,b2 as Y,b3 as L}from"./index-DxTOTFWT.js";import{u as G}from"./use-session-canvas-DrKA7UHs.js";import{R as I}from"./rotate-cw-Cwv_uaU3.js";import"./WidgetErrorCard-CBFo1SMe.js";import"./card-DVdPY08b.js";import"./progress-2cuTo9I-.js";import"./markdown-content-fIydDTfa.js";import"./table-C7pi-jkJ.js";import"./terminal-IYkyS2eR.js";import"./package-CGgpgsfC.js";import"./heart-BdbxexAy.js";import"./git-branch-BBKObhlk.js";import"./file-text-BNSVr0Hh.js";import"./file-Bc34j1rj.js";import"./McpAppFrame-BKgYSUH-.js";import"./more-details-DMD6Pqb5.js";const J=s.lazy(()=>L(()=>import("./CodeMirrorEditor-BpIF0kLM.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.CodeMirrorEditor}))),W=s.lazy(()=>L(()=>import("./BlintzCanvas-bfmQpoVE.js"),__vite__mapDeps([5,1,2,4,6])).then(e=>({default:e.BlintzCanvas}))),X=500;function w(e,o){return["canvas-file",e,o]}function Z(e,o){return o==="markdown"||/\.(md|markdown|mdx)$/i.test(e)}function ee(e){switch(e==null?void 0:e.code){case"NOT_FOUND":return"This file doesn’t exist.";case"NOT_A_FILE":return"This path is a directory, not a file.";case"TOO_LARGE":return"This file is too large to open here.";case"BINARY_FILE":return"This file isn’t text, so the editor can’t show it.";default:return"This file couldn’t be loaded."}}function te(e){switch(e){case"saving":return"Saving…";case"saved":return"Saved";case"error":return"Couldn’t save";default:return null}}function ge({content:e,documentId:o}){const m=q(),i=_(r=>r.selectedCwd),C=_(r=>r.setDocumentEditing),a=_(r=>{var f;return((f=r.openDocuments.find(j=>j.id===o))==null?void 0:f.editing)??!1}),h=H(),{data:c,error:x,isLoading:b}=K({queryKey:w(i,e.sourcePath),enabled:i!==null,queryFn:()=>m.readFileContent(i,e.sourcePath),staleTime:3e4,retry:!1}),[d,p]=s.useState(null),v=r=>{p(r&&c?{pinnedHash:c.hash}:null)};if(i===null)return t.jsx(k,{children:"Open a chat to view files."});if(b)return t.jsx(k,{children:"Loading file…"});if(x||!c)return t.jsx(k,{children:ee(x)});const u=d!==null&&a,n=(u?d==null?void 0:d.pinnedHash:null)??c.hash;return t.jsx(re,{content:e,documentId:o,cwd:i,loaded:c.content,theme:h,isEditing:u,onEditingChange:v,setDocumentEditing:C},`${e.sourcePath}:${n}`)}function re({content:e,documentId:o,cwd:m,loaded:i,theme:C,isEditing:a,onEditingChange:h,setDocumentEditing:c}){const x=e.readOnly!==!0,b=Z(e.sourcePath,e.language),d=V(),[p,v]=s.useState(i),u=G({sourcePath:e.sourcePath,cwd:m,loadedContent:i}),n=s.useRef(null),r=s.useRef(p),f=s.useRef(0),j=s.useRef(0),g=s.useRef(u.save),E=s.useRef(h);s.useEffect(()=>{r.current=p,g.current=u.save,E.current=h});const P=s.useCallback(l=>{f.current+=1,r.current=l,v(l),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{n.current=null,g.current(r.current)},X)},[]),S=()=>{f.current+=1,r.current=i,v(i),h(!0),c(o,!0)},A=async()=>{n.current&&(clearTimeout(n.current),n.current=null);const l=r.current,Q=f.current,B=++j.current,y=await g.current(l);if(y.status!=="changed"&&y.status!=="no_op"||f.current!==Q||j.current!==B||y.confirmed.content!==l)return;const T=y.confirmed;T.content===r.current&&d.setQueryData(w(m,e.sourcePath),N=>N&&{...N,content:T.content,hash:T.hash}),h(!1),c(o,!1)},F=()=>{d.invalidateQueries({queryKey:w(m,e.sourcePath)})};s.useEffect(()=>{a||!n.current||(clearTimeout(n.current),n.current=null)},[a]),s.useEffect(()=>()=>{n.current&&(clearTimeout(n.current),g.current(r.current)),c(o,!1),E.current(!1)},[o,c]);const D=()=>{const l=u.adoptDisk();l!=null&&v(l)},M=()=>{u.overwrite(r.current)},z=te(u.status),O=a?p:i;return t.jsxs("div",{className:"relative flex h-full flex-col",children:[t.jsxs("div",{className:"sticky top-0 z-10 flex h-0 items-start justify-end gap-2 pr-2",children:[x&&z&&t.jsx("span",{className:$("mt-3 text-xs",u.status==="error"?"text-destructive":"text-muted-foreground"),"aria-live":"polite",children:z}),!a&&t.jsx(R,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground mt-2",onClick:F,"aria-label":"Refresh from disk",children:t.jsx(I,{className:"size-4"})}),x&&t.jsx(R,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground mt-2",onClick:a?()=>void A():S,"aria-label":a?"Finish editing":"Edit file",children:a?t.jsx(U,{className:"size-4"}):t.jsx(Y,{className:"size-4"})})]}),u.status==="conflict"&&t.jsxs("div",{className:"bg-destructive/10 text-destructive mx-2 mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md px-3 py-2 text-sm",children:[t.jsx("span",{className:"flex-1",children:"This file changed on disk since you opened it."}),t.jsx(R,{type:"button",variant:"ghost",size:"sm",className:"h-7",onClick:D,children:"Reload"}),t.jsx(R,{type:"button",variant:"destructive",size:"sm",className:"h-7",onClick:M,children:"Overwrite"})]}),t.jsx("div",{className:"min-h-0 flex-1",children:t.jsx(s.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading editor…"}),children:b?t.jsx("div",{className:"px-2 pb-6",children:t.jsx(W,{value:O,editable:a,onChange:a?P:void 0})}):t.jsx(J,{value:O,editable:a,filename:e.sourcePath,languageHint:e.language,theme:C,onChange:a?P:void 0})})})]})}function k({children:e}){return t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:t.jsx("p",{children:e})})}export{ge as CanvasFileContent};
|
package/dist/client/assets/{CanvasModel3dContent-BExIu4RY.js → CanvasModel3dContent-DTAWG8IS.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Model3dViewer-
|
|
2
|
-
import{a8 as m,b0 as n,r as o,j as t,b3 as u}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Model3dViewer-CK6siI6q.js","assets/index-DxTOTFWT.js","assets/index-DKubbEZd.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a8 as m,b0 as n,r as o,j as t,b3 as u}from"./index-DxTOTFWT.js";import{r as d}from"./use-session-canvas-DrKA7UHs.js";import"./rotate-cw-Cwv_uaU3.js";import"./WidgetErrorCard-CBFo1SMe.js";import"./card-DVdPY08b.js";import"./progress-2cuTo9I-.js";import"./markdown-content-fIydDTfa.js";import"./table-C7pi-jkJ.js";import"./terminal-IYkyS2eR.js";import"./package-CGgpgsfC.js";import"./heart-BdbxexAy.js";import"./git-branch-BBKObhlk.js";import"./file-text-BNSVr0Hh.js";import"./file-Bc34j1rj.js";import"./McpAppFrame-BKgYSUH-.js";import"./more-details-DMD6Pqb5.js";const p=o.lazy(()=>u(()=>import("./Model3dViewer-CK6siI6q.js"),__vite__mapDeps([0,1,2])).then(e=>({default:e.Model3dViewer})));function f(e){var s;const r=(s=e.split(".").pop())==null?void 0:s.toLowerCase();return r==="glb"||r==="gltf"?"gltf":r==="stl"?"stl":r==="obj"?"obj":r==="3mf"?"3mf":r==="ply"?"ply":r==="fbx"?"fbx":r==="dae"?"dae":null}function T({content:e}){const r=m(),s=n(l=>l.selectedCwd),i=o.useMemo(()=>d(e.src,l=>r.mediaUrl(s??"",l)),[e.src,r,s]),a=o.useMemo(()=>f(e.src),[e.src]);return i.url===null||a===null?t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:t.jsx("p",{children:"This 3D model can’t be displayed here."})}):t.jsx("div",{className:"bg-muted/40 h-full w-full",children:t.jsx(o.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading 3D viewer…"}),children:t.jsx(p,{url:i.url,format:a,label:e.title??"Canvas 3D model"})})})}export{T as CanvasModel3dContent,f as formatOf};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a2 as m,a8 as x,b0 as k,r as v,j as t,B as d,Q as p,ae as y}from"./index-
|
|
1
|
+
import{a2 as m,a8 as x,b0 as k,r as v,j as t,B as d,Q as p,ae as y}from"./index-DxTOTFWT.js";import{u as R}from"./use-update-config-Dk0MthxZ.js";import{I as S}from"./inline-code-CrAiSiKW.js";/**
|
|
2
2
|
* @license lucide-react v1.48.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{j as J,r as T}from"./index-CdKpQ1hI.js";import{R as lt}from"./index-CWNsRK97.js";import{o as Q,E as B,q as ne,C as Ge,S as G,r as Ne,u as Fe,v as st,w as H,x as M,V as ot,F as Ve,y as je,R as N,W as Y,G as oe,z as at,A as ft,B as Ie,H as dt,m as ht,n as ct}from"./index-D16KF-iC.js";class v{constructor(e,n,l,i){this.fromA=e,this.toA=n,this.fromB=l,this.toB=i}offset(e,n=e){return new v(this.fromA+e,this.toA+e,this.fromB+n,this.toB+n)}}function y(t,e,n,l,i,r){if(t==l)return[];let s=fe(t,e,n,l,i,r),o=de(t,e+s,n,l,i+s,r);e+=s,n-=o,i+=s,r-=o;let f=n-e,h=r-i;if(!f||!h)return[new v(e,n,i,r)];if(f>h){let d=t.slice(e,n).indexOf(l.slice(i,r));if(d>-1)return[new v(e,e+d,i,i),new v(e+d+h,n,r,r)]}else if(h>f){let d=l.slice(i,r).indexOf(t.slice(e,n));if(d>-1)return[new v(e,e,i,i+d),new v(n,n,i+d+f,r)]}if(f==1||h==1)return[new v(e,n,i,r)];let a=He(t,e,n,l,i,r);if(a){let[d,c,u]=a;return y(t,e,d,l,i,c).concat(y(t,d+u,n,l,c+u,r))}return ut(t,e,n,l,i,r)}let I=1e9,U=0,ae=!1;function ut(t,e,n,l,i,r){let s=n-e,o=r-i;if(I<1e9&&Math.min(s,o)>I*16||U>0&&Date.now()>U)return Math.min(s,o)>I*64?[new v(e,n,i,r)]:ge(t,e,n,l,i,r);let f=Math.ceil((s+o)/2);ee.reset(f),te.reset(f);let h=(u,m)=>t.charCodeAt(e+u)==l.charCodeAt(i+m),a=(u,m)=>t.charCodeAt(n-u-1)==l.charCodeAt(r-m-1),d=(s-o)%2!=0?te:null,c=d?null:ee;for(let u=0;u<f;u++){if(u>I||U>0&&!(u&63)&&Date.now()>U)return ge(t,e,n,l,i,r);let m=ee.advance(u,s,o,f,d,!1,h)||te.advance(u,s,o,f,c,!0,a);if(m)return mt(t,e,n,e+m[0],l,i,r,i+m[1])}return[new v(e,n,i,r)]}class Ue{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let n=0;n<this.len;n++)this.vec[n]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,n,l,i,r,s,o){for(let f=-e+this.start;f<=e-this.end;f+=2){let h=i+f,a=f==-e||f!=e&&this.vec[h-1]<this.vec[h+1]?this.vec[h+1]:this.vec[h-1]+1,d=a-f;for(;a<n&&d<l&&o(a,d);)a++,d++;if(this.vec[h]=a,a>n)this.end+=2;else if(d>l)this.start+=2;else if(r){let c=i+(n-l)-f;if(c>=0&&c<this.len&&r.vec[c]!=-1)if(s){let u=r.vec[c];if(u>=n-a)return[u,i+u-c]}else{let u=n-r.vec[c];if(a>=u)return[a,d]}}}return null}}const ee=new Ue,te=new Ue;function mt(t,e,n,l,i,r,s,o){let f=!1;return!F(t,l)&&++l==n&&(f=!0),!F(i,o)&&++o==s&&(f=!0),f?[new v(e,n,r,s)]:y(t,e,l,i,r,o).concat(y(t,l,n,i,o,s))}function We(t,e){let n=1,l=Math.min(t,e);for(;n<l;)n=n<<1;return n}function fe(t,e,n,l,i,r){if(e==n||e==r||t.charCodeAt(e)!=l.charCodeAt(i))return 0;let s=We(n-e,r-i);for(let o=e,f=i;;){let h=o+s,a=f+s;if(h>n||a>r||t.slice(o,h)!=l.slice(f,a)){if(s==1)return o-e-(F(t,o)?0:1);s=s>>1}else{if(h==n||a==r)return h-e;o=h,f=a}}}function de(t,e,n,l,i,r){if(e==n||i==r||t.charCodeAt(n-1)!=l.charCodeAt(r-1))return 0;let s=We(n-e,r-i);for(let o=n,f=r;;){let h=o-s,a=f-s;if(h<e||a<i||t.slice(h,o)!=l.slice(a,f)){if(s==1)return n-o-(F(t,o)?0:1);s=s>>1}else{if(h==e||a==i)return n-h;o=h,f=a}}}function re(t,e,n,l,i,r,s,o){let f=l.slice(i,r),h=null;for(;;){if(h||s<o)return h;for(let a=e+s;;){F(t,a)||a++;let d=a+s;if(F(t,d)||(d+=d==a+1?1:-1),d>=n)break;let c=t.slice(a,d),u=-1;for(;(u=f.indexOf(c,u+1))!=-1;){let m=fe(t,d,n,l,i+u+c.length,r),p=de(t,e,a,l,i,i+u),g=c.length+m+p;(!h||h[2]<g)&&(h=[a-p,i+u-p,g])}a=d}if(o<0)return h;s=s>>1}}function He(t,e,n,l,i,r){let s=n-e,o=r-i;if(s<o){let f=He(l,i,r,t,e,n);return f&&[f[1],f[0],f[2]]}return s<4||o*2<s?null:re(t,e,n,l,i,r,Math.floor(s/4),-1)}function ge(t,e,n,l,i,r){ae=!0;let s=n-e,o=r-i,f;if(s<o){let c=re(l,i,r,t,e,n,Math.floor(s/6),50);f=c&&[c[1],c[0],c[2]]}else f=re(t,e,n,l,i,r,Math.floor(o/6),50);if(!f)return[new v(e,n,i,r)];let[h,a,d]=f;return y(t,e,h,l,i,a).concat(y(t,h+d,n,l,a+d,r))}function ze(t,e){for(let n=1;n<t.length;n++){let l=t[n-1],i=t[n];l.toA>i.fromA-e&&l.toB>i.fromB-e&&(t[n-1]=new v(l.fromA,i.toA,l.fromB,i.toB),t.splice(n--,1))}}function gt(t,e,n){for(;;){ze(n,1);let l=!1;for(let i=0;i<n.length;i++){let r=n[i],s,o;(s=fe(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new v(r.fromA+s,r.toA,r.fromB+s,r.toB)),(o=de(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new v(r.fromA,r.toA-o,r.fromB,r.toB-o));let f=r.toA-r.fromA,h=r.toB-r.fromB;if(f&&h)continue;let a=r.fromA-(i?n[i-1].toA:0),d=(i<n.length-1?n[i+1].fromA:t.length)-r.toA;if(!a||!d)continue;let c=f?t.slice(r.fromA,r.toA):e.slice(r.fromB,r.toB);a<=c.length&&t.slice(r.fromA-a,r.fromA)==c.slice(c.length-a)?(n[i]=new v(r.fromA-a,r.toA-a,r.fromB-a,r.toB-a),l=!0):d<=c.length&&t.slice(r.toA,r.toA+d)==c.slice(0,d)&&(n[i]=new v(r.fromA+d,r.toA+d,r.fromB+d,r.toB+d),l=!0)}if(!l)break}return n}function pt(t,e,n){for(let l=0,i=0;i<t.length;i++){let r=t[i],s=r.toA-r.fromA,o=r.toB-r.fromB;if(s&&o||s>3||o>3){let f=i==t.length-1?e.length:t[i+1].fromA,h=r.fromA-l,a=f-r.toA,d=Ce(e,r.fromA,h),c=pe(e,r.toA,a),u=r.fromA-d,m=c-r.toA;if((!s||!o)&&u&&m){let p=Math.max(s,o),[g,C,S]=s?[e,r.fromA,r.toA]:[n,r.fromB,r.toB];p>u&&e.slice(d,r.fromA)==g.slice(S-u,S)?(r=t[i]=new v(d,d+s,r.fromB-u,r.toB-u),d=r.fromA,c=pe(e,r.toA,f-r.toA)):p>m&&e.slice(r.toA,c)==g.slice(C,C+m)&&(r=t[i]=new v(c-s,c,r.fromB+m,r.toB+m),c=r.toA,d=Ce(e,r.fromA,r.fromA-l)),u=r.fromA-d,m=c-r.toA}if(u||m)r=t[i]=new v(r.fromA-u,r.toA+m,r.fromB-u,r.toB+m);else if(s){if(!o){let p=Ae(e,r.fromA,r.toA),g,C=p<0?-1:ve(e,r.toA,r.fromA);p>-1&&(g=p-r.fromA)<=a&&e.slice(r.fromA,p)==e.slice(r.toA,r.toA+g)?r=t[i]=r.offset(g):C>-1&&(g=r.toA-C)<=h&&e.slice(r.fromA-g,r.fromA)==e.slice(C,r.toA)&&(r=t[i]=r.offset(-g))}}else{let p=Ae(n,r.fromB,r.toB),g,C=p<0?-1:ve(n,r.toB,r.fromB);p>-1&&(g=p-r.fromB)<=a&&n.slice(r.fromB,p)==n.slice(r.toB,r.toB+g)?r=t[i]=r.offset(g):C>-1&&(g=r.toB-C)<=h&&n.slice(r.fromB-g,r.fromB)==n.slice(C,r.toB)&&(r=t[i]=r.offset(-g))}}l=r.toA}return ze(t,3),t}let E;try{E=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Pe(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function qe(t,e){if(e==t.length)return 0;let n=t.charCodeAt(e);return n<192?Pe(n)?1:0:E?!Je(n)||e==t.length-1?E.test(String.fromCharCode(n))?1:0:E.test(t.slice(e,e+2))?2:0:0}function _e(t,e){if(!e)return 0;let n=t.charCodeAt(e-1);return n<192?Pe(n)?1:0:E?!Ke(n)||e==1?E.test(String.fromCharCode(n))?1:0:E.test(t.slice(e-2,e))?2:0:0}const $e=8;function pe(t,e,n){if(e==t.length||!_e(t,e))return e;for(let l=e,i=e+n,r=0;r<$e;r++){let s=qe(t,l);if(!s||l+s>i)return l;l+=s}return e}function Ce(t,e,n){if(!e||!qe(t,e))return e;for(let l=e,i=e-n,r=0;r<$e;r++){let s=_e(t,l);if(!s||l-s<i)return l;l-=s}return e}function ve(t,e,n){for(;e!=n;e--)if(t.charCodeAt(e-1)==10)return e;return-1}function Ae(t,e,n){for(;e!=n;e++)if(t.charCodeAt(e)==10)return e;return-1}const Je=t=>t>=55296&&t<=56319,Ke=t=>t>=56320&&t<=57343;function F(t,e){return!e||e==t.length||!Je(t.charCodeAt(e-1))||!Ke(t.charCodeAt(e))}function Ct(t,e,n){var l;let i=n==null?void 0:n.override;return i?i(t,e):(I=((l=n==null?void 0:n.scanLimit)!==null&&l!==void 0?l:1e9)>>1,U=n!=null&&n.timeout?Date.now()+n.timeout:0,ae=!1,gt(t,e,y(t,0,t.length,e,0,e.length)))}function Qe(){return!ae}function Ye(t,e,n){return pt(Ct(t,e,n),t,e)}const b=Ve.define({combine:t=>t[0]}),ie=G.define(),Ze=Ve.define(),k=H.define({create(t){return null},update(t,e){for(let n of e.effects)n.is(ie)&&(t=n.value);for(let n of e.state.facet(Ze))t=n(t,e);return t}});function vt(t){let e=t.field(k,!1);if(!e)return null;let n=t.facet(b);return{chunks:e,side:n?n.side:null}}class O{constructor(e,n,l,i,r,s=!0){this.changes=e,this.fromA=n,this.toA=l,this.fromB=i,this.toB=r,this.precise=s}offset(e,n){return e||n?new O(this.changes,this.fromA+e,this.toA+e,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,n,l){let i=Ye(e.toString(),n.toString(),l);return Xe(i,e,n,0,0,Qe())}static updateA(e,n,l,i,r){return be(Be(e,i,!0,l.length),e,n,l,r)}static updateB(e,n,l,i,r){return be(Be(e,i,!1,n.length),e,n,l,r)}}function xe(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.to==t&&r.to==e&&t<n.length&&e<l.length?[t+1,e+1]:[i.from,r.from]}function we(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.from==t&&r.from==e?[t,e]:[i.to+1,r.to+1]}function Xe(t,e,n,l,i,r){let s=[];for(let o=0;o<t.length;o++){let f=t[o],[h,a]=xe(f.fromA+l,f.fromB+i,e,n),[d,c]=we(f.toA+l,f.toB+i,e,n),u=[f.offset(-h+l,-a+i)];for(;o<t.length-1;){let m=t[o+1],[p,g]=xe(m.fromA+l,m.fromB+i,e,n);if(p>d+1&&g>c+1)break;u.push(m.offset(-h+l,-a+i)),[d,c]=we(m.toA+l,m.toB+i,e,n),o++}s.push(new O(u,h,Math.max(h,d),a,Math.max(a,c),r))}return s}const z=1e3;function ke(t,e,n,l){let i=0,r=t.length;for(;;){if(i==r){let a=0,d=0;i&&({toA:a,toB:d}=t[i-1]);let c=e-(n?a:d);return[a+c,d+c]}let s=i+r>>1,o=t[s],[f,h]=n?[o.fromA,o.toA]:[o.fromB,o.toB];if(f>e)r=s;else if(h<=e)i=s+1;else return l?[o.fromA,o.fromB]:[o.toA,o.toB]}}function Be(t,e,n,l){let i=[];return e.iterChangedRanges((r,s,o,f)=>{let h=0,a=n?e.length:l,d=0,c=n?l:e.length;r>z&&([h,d]=ke(t,r-z,n,!0)),s<e.length-z&&([a,c]=ke(t,s+z,n,!1));let u=f-o-(s-r),m,[p,g]=n?[u,0]:[0,u];i.length&&(m=i[i.length-1]).toA>=h?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:a,toB:c,diffA:m.diffA+p,diffB:m.diffB+g}:i.push({fromA:h,toA:a,fromB:d,toB:c,diffA:p,diffB:g})}),i}function be(t,e,n,l,i){if(!t.length)return e;let r=[];for(let s=0,o=0,f=0,h=0;;s++){let a=s==t.length?null:t[s],d=a?a.fromA+o:n.length,c=a?a.fromB+f:l.length;for(;h<e.length;){let g=e[h];if(a&&(g.toA+o>d||g.toB+f>c))break;r.push(g.offset(o,f)),h++}if(!a)break;let u=a.toA+o+a.diffA,m=a.toB+f+a.diffB,p=Ye(n.sliceString(d,u),l.sliceString(c,m),i);for(let g of Xe(p,n,l,d,c,Qe()))r.push(g);for(o+=a.diffA,f+=a.diffB;h<e.length;){let g=e[h];if(g.fromA+o>u&&g.fromB+f>m)break;h++}}return r}const et={scanLimit:500},Z=ot.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=Le(t))}update(t){(t.docChanged||t.viewportChanged||At(t.startState,t.state)||xt(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=Le(t.view))}},{decorations:t=>t.deco}),P=Q.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(Z))===null||e===void 0?void 0:e.gutter)||Ie.empty}}));function At(t,e){return t.field(k,!1)!=e.field(k,!1)}function xt(t,e){return t.facet(b)!=e.facet(b)}const Me=M.line({class:"cm-changedLine"}),tt=M.mark({class:"cm-changedText"}),wt=M.mark({tagName:"ins",class:"cm-insertedLine"}),kt=M.mark({tagName:"del",class:"cm-deletedLine"}),De=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function Bt(t,e,n,l,i,r){let s=n?t.fromA:t.fromB,o=n?t.toA:t.toB,f=0;if(s!=o){i.add(s,s,Me),i.add(s,o,n?kt:wt),r&&r.add(s,s,De);for(let h=e.iterRange(s,o-1),a=s;!h.next().done;){if(h.lineBreak){a++,i.add(a,a,Me),r&&r.add(a,a,De);continue}let d=a+h.value.length;if(l)for(;f<t.changes.length;){let c=t.changes[f],u=s+(n?c.fromA:c.fromB),m=s+(n?c.toA:c.toB),p=Math.max(a,u),g=Math.min(d,m);if(p<g&&i.add(p,g,tt),m<d)f++;else break}a=d}}}function Le(t){let e=t.state.field(k),{side:n,highlightChanges:l,markGutter:i,overrideChunk:r}=t.state.facet(b),s=n=="a",o=new N,f=i?new N:null,{from:h,to:a}=t.viewport;for(let d of e){if((s?d.fromA:d.fromB)>=a)break;(s?d.toA:d.toB)>h&&(!r||!r(t.state,d,o,f))&&Bt(d,t.state.doc,s,l,o,f)}return{deco:o.finish(),gutter:f&&f.finish()}}class q extends Y{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const K=G.define({map:(t,e)=>t.map(e)}),W=H.define({create:()=>M.none,update:(t,e)=>{for(let n of e.effects)if(n.is(K))return n.value;return t.map(e.changes)},provide:t=>B.decorations.from(t)}),_=.01;function Se(t,e){if(t.size!=e.size)return!1;let n=t.iter(),l=e.iter();for(;n.value;){if(n.from!=l.from||Math.abs(n.value.spec.widget.height-l.value.spec.widget.height)>1)return!1;n.next(),l.next()}return!0}function bt(t,e,n){let l=new N,i=new N,r=t.state.field(W).iter(),s=e.state.field(W).iter(),o=0,f=0,h=0,a=0,d=t.viewport,c=e.viewport;for(let g=0;;g++){let C=g<n.length?n[g]:null,S=C?C.fromA:t.state.doc.length,R=C?C.fromB:e.state.doc.length;if(o<S){let x=t.lineBlockAt(o).top+h,D=e.lineBlockAt(f).top+a,w=x-D;w<-_?(h-=w,l.add(o,o,M.widget({widget:new q(-w),block:!0,side:-1}))):w>_&&(a+=w,i.add(f,f,M.widget({widget:new q(w),block:!0,side:-1})))}if(S>o+1e3&&o<d.from&&S>d.from&&f<c.from&&R>c.from){let x=Math.min(d.from-o,c.from-f);o+=x,f+=x,g--}else if(C)o=C.toA,f=C.toB;else break;for(;r.value&&r.from<o;)h-=r.value.spec.widget.height,r.next();for(;s.value&&s.from<f;)a-=s.value.spec.widget.height,s.next()}for(;r.value;)h-=r.value.spec.widget.height,r.next();for(;s.value;)a-=s.value.spec.widget.height,s.next();let u=t.contentHeight+h-(e.contentHeight+a);u<_?l.add(t.state.doc.length,t.state.doc.length,M.widget({widget:new q(-u),block:!0,side:1})):u>_&&i.add(e.state.doc.length,e.state.doc.length,M.widget({widget:new q(u),block:!0,side:1}));let m=l.finish(),p=i.finish();Se(m,t.state.field(W))||t.dispatch({effects:K.of(m)}),Se(p,e.state.field(W))||e.dispatch({effects:K.of(p)})}const le=G.define({map:(t,e)=>e.mapPos(t)});class Mt extends Y{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=e.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",l=>{let i=e.posAtDOM(l.target);e.dispatch({effects:le.of(i)});let{side:r,sibling:s}=e.state.facet(b);s&&s().dispatch({effects:le.of(Dt(i,e.state.field(k),r=="a"))})}),n}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function Dt(t,e,n){let l=0,i=0;for(let r=0;;r++){let s=r<e.length?e[r]:null;if(!s||(n?s.fromA:s.fromB)>=t)return i+(t-l);[l,i]=n?[s.toA,s.toB]:[s.toB,s.toA]}}const Lt=H.define({create(t){return M.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is(le)&&(t=t.update({filter:l=>l!=n.value}));if(t.size&&e.state.field(k)!=e.startState.field(k,!1)){let n=e.state.facet(b).side=="a",l=[];for(let i of e.state.field(k))t.between(n?i.fromA:i.fromB,n?i.toA:i.toB,r=>{l.push(r)});l.length&&(t=t.update({filter:i=>l.indexOf(i)<0}))}return t},provide:t=>B.decorations.from(t)});function se({margin:t=3,minSize:e=4}){return Lt.init(n=>St(n,t,e))}function St(t,e,n){let l=new N,i=t.facet(b).side=="a",r=t.field(k),s=1;for(let o=0;;o++){let f=o<r.length?r[o]:null,h=o?s+e:1,a=f?t.doc.lineAt(i?f.fromA:f.fromB).number-1-e:t.doc.lines,d=a-h+1;if(d>=n&&l.add(t.doc.line(h).from,t.doc.line(a).to,M.replace({widget:new Mt(d),block:!0})),!f)break;s=t.doc.lineAt(Math.min(t.doc.length,i?f.toA:f.toB)).number}return l.finish()}const Ot=B.styleModule.of(new st({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),nt=B.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),Oe=new Ge,$=new Ge;class Et{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||et;let n=[Q.low(Z),nt,Ot,W,B.updateListener.of(d=>{this.measuring<0&&(d.heightChanged||d.viewportChanged)&&!d.transactions.some(c=>c.effects.some(u=>u.is(K)))&&this.measure()})],l=[b.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&l.push(P);let i=ne.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],B.editorAttributes.of({class:"cm-merge-a"}),$.of(l),n]}),r=[b.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&r.push(P);let s=ne.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],B.editorAttributes.of({class:"cm-merge-b"}),$.of(r),n]});this.chunks=O.build(i.doc,s.doc,this.diffConf);let o=[k.init(()=>this.chunks),Oe.of(e.collapseUnchanged?se(e.collapseUnchanged):[])];i=i.update({effects:G.appendConfig.of(o)}).state,s=s.update({effects:G.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let f=e.orientation||"a-b",h=document.createElement("div");h.className="cm-mergeViewEditor";let a=document.createElement("div");a.className="cm-mergeViewEditor",this.editorDOM.appendChild(f=="a-b"?h:a),this.editorDOM.appendChild(f=="a-b"?a:h),this.a=new B({state:i,parent:h,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.a)}),this.b=new B({state:s,parent:a,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,n){if(e.some(l=>l.docChanged)){let l=e[e.length-1],i=e.reduce((s,o)=>s.compose(o.changes),Ne.empty(e[0].startState.doc.length));this.chunks=n==this.a?O.updateA(this.chunks,l.newDoc,this.b.state.doc,i,this.diffConf):O.updateB(this.chunks,this.a.state.doc,l.newDoc,i,this.diffConf),n.update([...e,l.state.update({effects:ie.of(this.chunks)})]);let r=n==this.a?this.b:this.a;r.update([r.state.update({effects:ie.of(this.chunks)})]),this.scheduleMeasure()}else n.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let r=e.orientation!="b-a";if(r!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let s=this.a.dom.parentNode,o=this.b.dom.parentNode;s.remove(),o.remove(),this.editorDOM.insertBefore(r?s:o,this.editorDOM.firstChild),this.editorDOM.appendChild(r?o:s),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let r=!!this.revertDOM,s=this.revertToA,o=this.renderRevert;"revertControls"in e&&(r=!!e.revertControls,s=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(o=e.renderRevertControl),this.setupRevertControls(r,s,o)}let n="highlightChanges"in e,l="gutter"in e,i="collapseUnchanged"in e;if(n||l||i){let r=[],s=[];if(n||l){let o=this.a.state.facet(b),f=l?e.gutter!==!1:o.markGutter,h=n?e.highlightChanges!==!1:o.highlightChanges;r.push($.reconfigure([b.of({side:"a",sibling:()=>this.b,highlightChanges:h,markGutter:f}),f?P:[]])),s.push($.reconfigure([b.of({side:"b",sibling:()=>this.a,highlightChanges:h,markGutter:f}),f?P:[]]))}if(i){let o=Oe.reconfigure(e.collapseUnchanged?se(e.collapseUnchanged):[]);r.push(o),s.push(o)}this.a.dispatch({effects:r}),this.b.dispatch({effects:s})}this.scheduleMeasure()}setupRevertControls(e,n,l){this.revertToA=n,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=l,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",i=>this.revertClicked(i)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){bt(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,n=e.firstChild,l=this.a.viewport,i=this.b.viewport;for(let r=0;r<this.chunks.length;r++){let s=this.chunks[r];if(s.fromA>l.to||s.fromB>i.to)break;if(s.fromA<l.from||s.fromB<i.from)continue;let o=this.a.lineBlockAt(s.fromA).top+"px";for(;n&&+n.dataset.chunk<r;)n=Ee(n);n&&n.dataset.chunk==String(r)?(n.style.top!=o&&(n.style.top=o),n=n.nextSibling):e.insertBefore(this.renderRevertButton(o,r),n)}for(;n;)n=Ee(n)}renderRevertButton(e,n){let l;if(this.renderRevert)l=this.renderRevert();else{l=document.createElement("button");let i=this.a.state.phrase("Revert this chunk");l.setAttribute("aria-label",i),l.setAttribute("title",i),l.textContent=this.revertToLeft?"⇜":"⇝"}return l.style.top=e,l.setAttribute("data-chunk",String(n)),l}revertClicked(e){let n=e.target,l;for(;n&&n.parentNode!=this.revertDOM;)n=n.parentNode;if(n&&(l=this.chunks[n.dataset.chunk])){let[i,r,s,o,f,h]=this.revertToA?[this.b,this.a,l.fromB,l.toB,l.fromA,l.toA]:[this.a,this.b,l.fromA,l.toA,l.fromB,l.toB],a=i.state.sliceDoc(s,Math.max(s,o-1));s!=o&&h<=r.state.doc.length&&(a+=i.state.lineBreak),r.dispatch({changes:{from:f,to:Math.min(r.state.doc.length,h),insert:a},userEvent:"revert"}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function Ee(t){let e=t.nextSibling;return t.remove(),e}const yt=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},Rt=Q.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(Z))===null||e===void 0?void 0:e.gutter)||Ie.empty},widgetMarker:(t,e)=>e instanceof rt?yt:null}));function Tt(t){var e;let n=typeof t.original=="string"?Fe.of(t.original.split(/\r?\n/)):t.original,l=t.diffConfig||et;return[Q.low(Z),Vt,nt,B.editorAttributes.of({class:"cm-merge-b"}),Ze.of((i,r)=>{let s=r.effects.find(o=>o.is(he));return s&&(i=O.updateA(i,s.value.doc,r.startState.doc,s.value.changes,l)),r.docChanged&&(i=O.updateB(i,r.state.field(V),r.newDoc,r.changes,l)),i}),b.of({highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1,syntaxHighlightDeletions:t.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:(e=t.mergeControls)!==null&&e!==void 0?e:!0,overrideChunk:t.allowInlineDiffs?Wt:void 0,side:"b"}),V.init(()=>n),t.gutter!==!1?Rt:[],t.collapseUnchanged?se(t.collapseUnchanged):[],k.init(i=>O.build(n,i.doc,l))]}const he=G.define(),V=H.define({create:()=>Fe.empty,update(t,e){for(let n of e.effects)n.is(he)&&(t=n.value.doc);return t}}),ye=new WeakMap;class rt extends Y{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||(this.dom=this.buildDOM(e))}}function Gt(t,e,n){let l=ye.get(e.changes);if(l)return l;let i=s=>{let{highlightChanges:o,syntaxHighlightDeletions:f,syntaxHighlightDeletionsMaxLength:h,mergeControls:a}=t.facet(b),d=document.createElement("div");if(d.className="cm-deletedChunk",a){let x=d.appendChild(document.createElement("div"));x.className="cm-chunkButtons";let D=A=>{A.preventDefault(),Nt(s,s.posAtDOM(d))},w=A=>{A.preventDefault(),Ft(s,s.posAtDOM(d))};if(typeof a=="function")x.appendChild(a("accept",D)),x.appendChild(a("reject",w));else{let A=x.appendChild(document.createElement("button"));A.name="accept",A.textContent=t.phrase("Accept"),A.onmousedown=D;let L=x.appendChild(document.createElement("button"));L.name="reject",L.textContent=t.phrase("Reject"),L.onmousedown=w}}if(n||e.fromA>=e.toA)return d;let c=s.state.field(V).sliceString(e.fromA,e.endA),u=f&&t.facet(at),m=S(),p=e.changes,g=0,C=!1;function S(){let x=d.appendChild(document.createElement("div"));return x.className="cm-deletedLine",x.appendChild(document.createElement("del"))}function R(x,D,w){for(let A=x;A<D;){if(c.charAt(A)==`
|
|
1
|
+
import{j as J,r as T}from"./index-DxTOTFWT.js";import{R as lt}from"./index-BcPMhqQ_.js";import{o as Q,E as B,q as ne,C as Ge,S as G,r as Ne,u as Fe,v as st,w as H,x as M,V as ot,F as Ve,y as je,R as N,W as Y,G as oe,z as at,A as ft,B as Ie,H as dt,m as ht,n as ct}from"./index-1-RB7sXm.js";class v{constructor(e,n,l,i){this.fromA=e,this.toA=n,this.fromB=l,this.toB=i}offset(e,n=e){return new v(this.fromA+e,this.toA+e,this.fromB+n,this.toB+n)}}function y(t,e,n,l,i,r){if(t==l)return[];let s=fe(t,e,n,l,i,r),o=de(t,e+s,n,l,i+s,r);e+=s,n-=o,i+=s,r-=o;let f=n-e,h=r-i;if(!f||!h)return[new v(e,n,i,r)];if(f>h){let d=t.slice(e,n).indexOf(l.slice(i,r));if(d>-1)return[new v(e,e+d,i,i),new v(e+d+h,n,r,r)]}else if(h>f){let d=l.slice(i,r).indexOf(t.slice(e,n));if(d>-1)return[new v(e,e,i,i+d),new v(n,n,i+d+f,r)]}if(f==1||h==1)return[new v(e,n,i,r)];let a=He(t,e,n,l,i,r);if(a){let[d,c,u]=a;return y(t,e,d,l,i,c).concat(y(t,d+u,n,l,c+u,r))}return ut(t,e,n,l,i,r)}let I=1e9,U=0,ae=!1;function ut(t,e,n,l,i,r){let s=n-e,o=r-i;if(I<1e9&&Math.min(s,o)>I*16||U>0&&Date.now()>U)return Math.min(s,o)>I*64?[new v(e,n,i,r)]:ge(t,e,n,l,i,r);let f=Math.ceil((s+o)/2);ee.reset(f),te.reset(f);let h=(u,m)=>t.charCodeAt(e+u)==l.charCodeAt(i+m),a=(u,m)=>t.charCodeAt(n-u-1)==l.charCodeAt(r-m-1),d=(s-o)%2!=0?te:null,c=d?null:ee;for(let u=0;u<f;u++){if(u>I||U>0&&!(u&63)&&Date.now()>U)return ge(t,e,n,l,i,r);let m=ee.advance(u,s,o,f,d,!1,h)||te.advance(u,s,o,f,c,!0,a);if(m)return mt(t,e,n,e+m[0],l,i,r,i+m[1])}return[new v(e,n,i,r)]}class Ue{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let n=0;n<this.len;n++)this.vec[n]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,n,l,i,r,s,o){for(let f=-e+this.start;f<=e-this.end;f+=2){let h=i+f,a=f==-e||f!=e&&this.vec[h-1]<this.vec[h+1]?this.vec[h+1]:this.vec[h-1]+1,d=a-f;for(;a<n&&d<l&&o(a,d);)a++,d++;if(this.vec[h]=a,a>n)this.end+=2;else if(d>l)this.start+=2;else if(r){let c=i+(n-l)-f;if(c>=0&&c<this.len&&r.vec[c]!=-1)if(s){let u=r.vec[c];if(u>=n-a)return[u,i+u-c]}else{let u=n-r.vec[c];if(a>=u)return[a,d]}}}return null}}const ee=new Ue,te=new Ue;function mt(t,e,n,l,i,r,s,o){let f=!1;return!F(t,l)&&++l==n&&(f=!0),!F(i,o)&&++o==s&&(f=!0),f?[new v(e,n,r,s)]:y(t,e,l,i,r,o).concat(y(t,l,n,i,o,s))}function We(t,e){let n=1,l=Math.min(t,e);for(;n<l;)n=n<<1;return n}function fe(t,e,n,l,i,r){if(e==n||e==r||t.charCodeAt(e)!=l.charCodeAt(i))return 0;let s=We(n-e,r-i);for(let o=e,f=i;;){let h=o+s,a=f+s;if(h>n||a>r||t.slice(o,h)!=l.slice(f,a)){if(s==1)return o-e-(F(t,o)?0:1);s=s>>1}else{if(h==n||a==r)return h-e;o=h,f=a}}}function de(t,e,n,l,i,r){if(e==n||i==r||t.charCodeAt(n-1)!=l.charCodeAt(r-1))return 0;let s=We(n-e,r-i);for(let o=n,f=r;;){let h=o-s,a=f-s;if(h<e||a<i||t.slice(h,o)!=l.slice(a,f)){if(s==1)return n-o-(F(t,o)?0:1);s=s>>1}else{if(h==e||a==i)return n-h;o=h,f=a}}}function re(t,e,n,l,i,r,s,o){let f=l.slice(i,r),h=null;for(;;){if(h||s<o)return h;for(let a=e+s;;){F(t,a)||a++;let d=a+s;if(F(t,d)||(d+=d==a+1?1:-1),d>=n)break;let c=t.slice(a,d),u=-1;for(;(u=f.indexOf(c,u+1))!=-1;){let m=fe(t,d,n,l,i+u+c.length,r),p=de(t,e,a,l,i,i+u),g=c.length+m+p;(!h||h[2]<g)&&(h=[a-p,i+u-p,g])}a=d}if(o<0)return h;s=s>>1}}function He(t,e,n,l,i,r){let s=n-e,o=r-i;if(s<o){let f=He(l,i,r,t,e,n);return f&&[f[1],f[0],f[2]]}return s<4||o*2<s?null:re(t,e,n,l,i,r,Math.floor(s/4),-1)}function ge(t,e,n,l,i,r){ae=!0;let s=n-e,o=r-i,f;if(s<o){let c=re(l,i,r,t,e,n,Math.floor(s/6),50);f=c&&[c[1],c[0],c[2]]}else f=re(t,e,n,l,i,r,Math.floor(o/6),50);if(!f)return[new v(e,n,i,r)];let[h,a,d]=f;return y(t,e,h,l,i,a).concat(y(t,h+d,n,l,a+d,r))}function ze(t,e){for(let n=1;n<t.length;n++){let l=t[n-1],i=t[n];l.toA>i.fromA-e&&l.toB>i.fromB-e&&(t[n-1]=new v(l.fromA,i.toA,l.fromB,i.toB),t.splice(n--,1))}}function gt(t,e,n){for(;;){ze(n,1);let l=!1;for(let i=0;i<n.length;i++){let r=n[i],s,o;(s=fe(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new v(r.fromA+s,r.toA,r.fromB+s,r.toB)),(o=de(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new v(r.fromA,r.toA-o,r.fromB,r.toB-o));let f=r.toA-r.fromA,h=r.toB-r.fromB;if(f&&h)continue;let a=r.fromA-(i?n[i-1].toA:0),d=(i<n.length-1?n[i+1].fromA:t.length)-r.toA;if(!a||!d)continue;let c=f?t.slice(r.fromA,r.toA):e.slice(r.fromB,r.toB);a<=c.length&&t.slice(r.fromA-a,r.fromA)==c.slice(c.length-a)?(n[i]=new v(r.fromA-a,r.toA-a,r.fromB-a,r.toB-a),l=!0):d<=c.length&&t.slice(r.toA,r.toA+d)==c.slice(0,d)&&(n[i]=new v(r.fromA+d,r.toA+d,r.fromB+d,r.toB+d),l=!0)}if(!l)break}return n}function pt(t,e,n){for(let l=0,i=0;i<t.length;i++){let r=t[i],s=r.toA-r.fromA,o=r.toB-r.fromB;if(s&&o||s>3||o>3){let f=i==t.length-1?e.length:t[i+1].fromA,h=r.fromA-l,a=f-r.toA,d=Ce(e,r.fromA,h),c=pe(e,r.toA,a),u=r.fromA-d,m=c-r.toA;if((!s||!o)&&u&&m){let p=Math.max(s,o),[g,C,S]=s?[e,r.fromA,r.toA]:[n,r.fromB,r.toB];p>u&&e.slice(d,r.fromA)==g.slice(S-u,S)?(r=t[i]=new v(d,d+s,r.fromB-u,r.toB-u),d=r.fromA,c=pe(e,r.toA,f-r.toA)):p>m&&e.slice(r.toA,c)==g.slice(C,C+m)&&(r=t[i]=new v(c-s,c,r.fromB+m,r.toB+m),c=r.toA,d=Ce(e,r.fromA,r.fromA-l)),u=r.fromA-d,m=c-r.toA}if(u||m)r=t[i]=new v(r.fromA-u,r.toA+m,r.fromB-u,r.toB+m);else if(s){if(!o){let p=Ae(e,r.fromA,r.toA),g,C=p<0?-1:ve(e,r.toA,r.fromA);p>-1&&(g=p-r.fromA)<=a&&e.slice(r.fromA,p)==e.slice(r.toA,r.toA+g)?r=t[i]=r.offset(g):C>-1&&(g=r.toA-C)<=h&&e.slice(r.fromA-g,r.fromA)==e.slice(C,r.toA)&&(r=t[i]=r.offset(-g))}}else{let p=Ae(n,r.fromB,r.toB),g,C=p<0?-1:ve(n,r.toB,r.fromB);p>-1&&(g=p-r.fromB)<=a&&n.slice(r.fromB,p)==n.slice(r.toB,r.toB+g)?r=t[i]=r.offset(g):C>-1&&(g=r.toB-C)<=h&&n.slice(r.fromB-g,r.fromB)==n.slice(C,r.toB)&&(r=t[i]=r.offset(-g))}}l=r.toA}return ze(t,3),t}let E;try{E=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Pe(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function qe(t,e){if(e==t.length)return 0;let n=t.charCodeAt(e);return n<192?Pe(n)?1:0:E?!Je(n)||e==t.length-1?E.test(String.fromCharCode(n))?1:0:E.test(t.slice(e,e+2))?2:0:0}function _e(t,e){if(!e)return 0;let n=t.charCodeAt(e-1);return n<192?Pe(n)?1:0:E?!Ke(n)||e==1?E.test(String.fromCharCode(n))?1:0:E.test(t.slice(e-2,e))?2:0:0}const $e=8;function pe(t,e,n){if(e==t.length||!_e(t,e))return e;for(let l=e,i=e+n,r=0;r<$e;r++){let s=qe(t,l);if(!s||l+s>i)return l;l+=s}return e}function Ce(t,e,n){if(!e||!qe(t,e))return e;for(let l=e,i=e-n,r=0;r<$e;r++){let s=_e(t,l);if(!s||l-s<i)return l;l-=s}return e}function ve(t,e,n){for(;e!=n;e--)if(t.charCodeAt(e-1)==10)return e;return-1}function Ae(t,e,n){for(;e!=n;e++)if(t.charCodeAt(e)==10)return e;return-1}const Je=t=>t>=55296&&t<=56319,Ke=t=>t>=56320&&t<=57343;function F(t,e){return!e||e==t.length||!Je(t.charCodeAt(e-1))||!Ke(t.charCodeAt(e))}function Ct(t,e,n){var l;let i=n==null?void 0:n.override;return i?i(t,e):(I=((l=n==null?void 0:n.scanLimit)!==null&&l!==void 0?l:1e9)>>1,U=n!=null&&n.timeout?Date.now()+n.timeout:0,ae=!1,gt(t,e,y(t,0,t.length,e,0,e.length)))}function Qe(){return!ae}function Ye(t,e,n){return pt(Ct(t,e,n),t,e)}const b=Ve.define({combine:t=>t[0]}),ie=G.define(),Ze=Ve.define(),k=H.define({create(t){return null},update(t,e){for(let n of e.effects)n.is(ie)&&(t=n.value);for(let n of e.state.facet(Ze))t=n(t,e);return t}});function vt(t){let e=t.field(k,!1);if(!e)return null;let n=t.facet(b);return{chunks:e,side:n?n.side:null}}class O{constructor(e,n,l,i,r,s=!0){this.changes=e,this.fromA=n,this.toA=l,this.fromB=i,this.toB=r,this.precise=s}offset(e,n){return e||n?new O(this.changes,this.fromA+e,this.toA+e,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,n,l){let i=Ye(e.toString(),n.toString(),l);return Xe(i,e,n,0,0,Qe())}static updateA(e,n,l,i,r){return be(Be(e,i,!0,l.length),e,n,l,r)}static updateB(e,n,l,i,r){return be(Be(e,i,!1,n.length),e,n,l,r)}}function xe(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.to==t&&r.to==e&&t<n.length&&e<l.length?[t+1,e+1]:[i.from,r.from]}function we(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.from==t&&r.from==e?[t,e]:[i.to+1,r.to+1]}function Xe(t,e,n,l,i,r){let s=[];for(let o=0;o<t.length;o++){let f=t[o],[h,a]=xe(f.fromA+l,f.fromB+i,e,n),[d,c]=we(f.toA+l,f.toB+i,e,n),u=[f.offset(-h+l,-a+i)];for(;o<t.length-1;){let m=t[o+1],[p,g]=xe(m.fromA+l,m.fromB+i,e,n);if(p>d+1&&g>c+1)break;u.push(m.offset(-h+l,-a+i)),[d,c]=we(m.toA+l,m.toB+i,e,n),o++}s.push(new O(u,h,Math.max(h,d),a,Math.max(a,c),r))}return s}const z=1e3;function ke(t,e,n,l){let i=0,r=t.length;for(;;){if(i==r){let a=0,d=0;i&&({toA:a,toB:d}=t[i-1]);let c=e-(n?a:d);return[a+c,d+c]}let s=i+r>>1,o=t[s],[f,h]=n?[o.fromA,o.toA]:[o.fromB,o.toB];if(f>e)r=s;else if(h<=e)i=s+1;else return l?[o.fromA,o.fromB]:[o.toA,o.toB]}}function Be(t,e,n,l){let i=[];return e.iterChangedRanges((r,s,o,f)=>{let h=0,a=n?e.length:l,d=0,c=n?l:e.length;r>z&&([h,d]=ke(t,r-z,n,!0)),s<e.length-z&&([a,c]=ke(t,s+z,n,!1));let u=f-o-(s-r),m,[p,g]=n?[u,0]:[0,u];i.length&&(m=i[i.length-1]).toA>=h?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:a,toB:c,diffA:m.diffA+p,diffB:m.diffB+g}:i.push({fromA:h,toA:a,fromB:d,toB:c,diffA:p,diffB:g})}),i}function be(t,e,n,l,i){if(!t.length)return e;let r=[];for(let s=0,o=0,f=0,h=0;;s++){let a=s==t.length?null:t[s],d=a?a.fromA+o:n.length,c=a?a.fromB+f:l.length;for(;h<e.length;){let g=e[h];if(a&&(g.toA+o>d||g.toB+f>c))break;r.push(g.offset(o,f)),h++}if(!a)break;let u=a.toA+o+a.diffA,m=a.toB+f+a.diffB,p=Ye(n.sliceString(d,u),l.sliceString(c,m),i);for(let g of Xe(p,n,l,d,c,Qe()))r.push(g);for(o+=a.diffA,f+=a.diffB;h<e.length;){let g=e[h];if(g.fromA+o>u&&g.fromB+f>m)break;h++}}return r}const et={scanLimit:500},Z=ot.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=Le(t))}update(t){(t.docChanged||t.viewportChanged||At(t.startState,t.state)||xt(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=Le(t.view))}},{decorations:t=>t.deco}),P=Q.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(Z))===null||e===void 0?void 0:e.gutter)||Ie.empty}}));function At(t,e){return t.field(k,!1)!=e.field(k,!1)}function xt(t,e){return t.facet(b)!=e.facet(b)}const Me=M.line({class:"cm-changedLine"}),tt=M.mark({class:"cm-changedText"}),wt=M.mark({tagName:"ins",class:"cm-insertedLine"}),kt=M.mark({tagName:"del",class:"cm-deletedLine"}),De=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function Bt(t,e,n,l,i,r){let s=n?t.fromA:t.fromB,o=n?t.toA:t.toB,f=0;if(s!=o){i.add(s,s,Me),i.add(s,o,n?kt:wt),r&&r.add(s,s,De);for(let h=e.iterRange(s,o-1),a=s;!h.next().done;){if(h.lineBreak){a++,i.add(a,a,Me),r&&r.add(a,a,De);continue}let d=a+h.value.length;if(l)for(;f<t.changes.length;){let c=t.changes[f],u=s+(n?c.fromA:c.fromB),m=s+(n?c.toA:c.toB),p=Math.max(a,u),g=Math.min(d,m);if(p<g&&i.add(p,g,tt),m<d)f++;else break}a=d}}}function Le(t){let e=t.state.field(k),{side:n,highlightChanges:l,markGutter:i,overrideChunk:r}=t.state.facet(b),s=n=="a",o=new N,f=i?new N:null,{from:h,to:a}=t.viewport;for(let d of e){if((s?d.fromA:d.fromB)>=a)break;(s?d.toA:d.toB)>h&&(!r||!r(t.state,d,o,f))&&Bt(d,t.state.doc,s,l,o,f)}return{deco:o.finish(),gutter:f&&f.finish()}}class q extends Y{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const K=G.define({map:(t,e)=>t.map(e)}),W=H.define({create:()=>M.none,update:(t,e)=>{for(let n of e.effects)if(n.is(K))return n.value;return t.map(e.changes)},provide:t=>B.decorations.from(t)}),_=.01;function Se(t,e){if(t.size!=e.size)return!1;let n=t.iter(),l=e.iter();for(;n.value;){if(n.from!=l.from||Math.abs(n.value.spec.widget.height-l.value.spec.widget.height)>1)return!1;n.next(),l.next()}return!0}function bt(t,e,n){let l=new N,i=new N,r=t.state.field(W).iter(),s=e.state.field(W).iter(),o=0,f=0,h=0,a=0,d=t.viewport,c=e.viewport;for(let g=0;;g++){let C=g<n.length?n[g]:null,S=C?C.fromA:t.state.doc.length,R=C?C.fromB:e.state.doc.length;if(o<S){let x=t.lineBlockAt(o).top+h,D=e.lineBlockAt(f).top+a,w=x-D;w<-_?(h-=w,l.add(o,o,M.widget({widget:new q(-w),block:!0,side:-1}))):w>_&&(a+=w,i.add(f,f,M.widget({widget:new q(w),block:!0,side:-1})))}if(S>o+1e3&&o<d.from&&S>d.from&&f<c.from&&R>c.from){let x=Math.min(d.from-o,c.from-f);o+=x,f+=x,g--}else if(C)o=C.toA,f=C.toB;else break;for(;r.value&&r.from<o;)h-=r.value.spec.widget.height,r.next();for(;s.value&&s.from<f;)a-=s.value.spec.widget.height,s.next()}for(;r.value;)h-=r.value.spec.widget.height,r.next();for(;s.value;)a-=s.value.spec.widget.height,s.next();let u=t.contentHeight+h-(e.contentHeight+a);u<_?l.add(t.state.doc.length,t.state.doc.length,M.widget({widget:new q(-u),block:!0,side:1})):u>_&&i.add(e.state.doc.length,e.state.doc.length,M.widget({widget:new q(u),block:!0,side:1}));let m=l.finish(),p=i.finish();Se(m,t.state.field(W))||t.dispatch({effects:K.of(m)}),Se(p,e.state.field(W))||e.dispatch({effects:K.of(p)})}const le=G.define({map:(t,e)=>e.mapPos(t)});class Mt extends Y{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=e.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",l=>{let i=e.posAtDOM(l.target);e.dispatch({effects:le.of(i)});let{side:r,sibling:s}=e.state.facet(b);s&&s().dispatch({effects:le.of(Dt(i,e.state.field(k),r=="a"))})}),n}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function Dt(t,e,n){let l=0,i=0;for(let r=0;;r++){let s=r<e.length?e[r]:null;if(!s||(n?s.fromA:s.fromB)>=t)return i+(t-l);[l,i]=n?[s.toA,s.toB]:[s.toB,s.toA]}}const Lt=H.define({create(t){return M.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is(le)&&(t=t.update({filter:l=>l!=n.value}));if(t.size&&e.state.field(k)!=e.startState.field(k,!1)){let n=e.state.facet(b).side=="a",l=[];for(let i of e.state.field(k))t.between(n?i.fromA:i.fromB,n?i.toA:i.toB,r=>{l.push(r)});l.length&&(t=t.update({filter:i=>l.indexOf(i)<0}))}return t},provide:t=>B.decorations.from(t)});function se({margin:t=3,minSize:e=4}){return Lt.init(n=>St(n,t,e))}function St(t,e,n){let l=new N,i=t.facet(b).side=="a",r=t.field(k),s=1;for(let o=0;;o++){let f=o<r.length?r[o]:null,h=o?s+e:1,a=f?t.doc.lineAt(i?f.fromA:f.fromB).number-1-e:t.doc.lines,d=a-h+1;if(d>=n&&l.add(t.doc.line(h).from,t.doc.line(a).to,M.replace({widget:new Mt(d),block:!0})),!f)break;s=t.doc.lineAt(Math.min(t.doc.length,i?f.toA:f.toB)).number}return l.finish()}const Ot=B.styleModule.of(new st({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),nt=B.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),Oe=new Ge,$=new Ge;class Et{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||et;let n=[Q.low(Z),nt,Ot,W,B.updateListener.of(d=>{this.measuring<0&&(d.heightChanged||d.viewportChanged)&&!d.transactions.some(c=>c.effects.some(u=>u.is(K)))&&this.measure()})],l=[b.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&l.push(P);let i=ne.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],B.editorAttributes.of({class:"cm-merge-a"}),$.of(l),n]}),r=[b.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&r.push(P);let s=ne.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],B.editorAttributes.of({class:"cm-merge-b"}),$.of(r),n]});this.chunks=O.build(i.doc,s.doc,this.diffConf);let o=[k.init(()=>this.chunks),Oe.of(e.collapseUnchanged?se(e.collapseUnchanged):[])];i=i.update({effects:G.appendConfig.of(o)}).state,s=s.update({effects:G.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let f=e.orientation||"a-b",h=document.createElement("div");h.className="cm-mergeViewEditor";let a=document.createElement("div");a.className="cm-mergeViewEditor",this.editorDOM.appendChild(f=="a-b"?h:a),this.editorDOM.appendChild(f=="a-b"?a:h),this.a=new B({state:i,parent:h,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.a)}),this.b=new B({state:s,parent:a,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,n){if(e.some(l=>l.docChanged)){let l=e[e.length-1],i=e.reduce((s,o)=>s.compose(o.changes),Ne.empty(e[0].startState.doc.length));this.chunks=n==this.a?O.updateA(this.chunks,l.newDoc,this.b.state.doc,i,this.diffConf):O.updateB(this.chunks,this.a.state.doc,l.newDoc,i,this.diffConf),n.update([...e,l.state.update({effects:ie.of(this.chunks)})]);let r=n==this.a?this.b:this.a;r.update([r.state.update({effects:ie.of(this.chunks)})]),this.scheduleMeasure()}else n.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let r=e.orientation!="b-a";if(r!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let s=this.a.dom.parentNode,o=this.b.dom.parentNode;s.remove(),o.remove(),this.editorDOM.insertBefore(r?s:o,this.editorDOM.firstChild),this.editorDOM.appendChild(r?o:s),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let r=!!this.revertDOM,s=this.revertToA,o=this.renderRevert;"revertControls"in e&&(r=!!e.revertControls,s=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(o=e.renderRevertControl),this.setupRevertControls(r,s,o)}let n="highlightChanges"in e,l="gutter"in e,i="collapseUnchanged"in e;if(n||l||i){let r=[],s=[];if(n||l){let o=this.a.state.facet(b),f=l?e.gutter!==!1:o.markGutter,h=n?e.highlightChanges!==!1:o.highlightChanges;r.push($.reconfigure([b.of({side:"a",sibling:()=>this.b,highlightChanges:h,markGutter:f}),f?P:[]])),s.push($.reconfigure([b.of({side:"b",sibling:()=>this.a,highlightChanges:h,markGutter:f}),f?P:[]]))}if(i){let o=Oe.reconfigure(e.collapseUnchanged?se(e.collapseUnchanged):[]);r.push(o),s.push(o)}this.a.dispatch({effects:r}),this.b.dispatch({effects:s})}this.scheduleMeasure()}setupRevertControls(e,n,l){this.revertToA=n,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=l,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",i=>this.revertClicked(i)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){bt(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,n=e.firstChild,l=this.a.viewport,i=this.b.viewport;for(let r=0;r<this.chunks.length;r++){let s=this.chunks[r];if(s.fromA>l.to||s.fromB>i.to)break;if(s.fromA<l.from||s.fromB<i.from)continue;let o=this.a.lineBlockAt(s.fromA).top+"px";for(;n&&+n.dataset.chunk<r;)n=Ee(n);n&&n.dataset.chunk==String(r)?(n.style.top!=o&&(n.style.top=o),n=n.nextSibling):e.insertBefore(this.renderRevertButton(o,r),n)}for(;n;)n=Ee(n)}renderRevertButton(e,n){let l;if(this.renderRevert)l=this.renderRevert();else{l=document.createElement("button");let i=this.a.state.phrase("Revert this chunk");l.setAttribute("aria-label",i),l.setAttribute("title",i),l.textContent=this.revertToLeft?"⇜":"⇝"}return l.style.top=e,l.setAttribute("data-chunk",String(n)),l}revertClicked(e){let n=e.target,l;for(;n&&n.parentNode!=this.revertDOM;)n=n.parentNode;if(n&&(l=this.chunks[n.dataset.chunk])){let[i,r,s,o,f,h]=this.revertToA?[this.b,this.a,l.fromB,l.toB,l.fromA,l.toA]:[this.a,this.b,l.fromA,l.toA,l.fromB,l.toB],a=i.state.sliceDoc(s,Math.max(s,o-1));s!=o&&h<=r.state.doc.length&&(a+=i.state.lineBreak),r.dispatch({changes:{from:f,to:Math.min(r.state.doc.length,h),insert:a},userEvent:"revert"}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function Ee(t){let e=t.nextSibling;return t.remove(),e}const yt=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},Rt=Q.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(Z))===null||e===void 0?void 0:e.gutter)||Ie.empty},widgetMarker:(t,e)=>e instanceof rt?yt:null}));function Tt(t){var e;let n=typeof t.original=="string"?Fe.of(t.original.split(/\r?\n/)):t.original,l=t.diffConfig||et;return[Q.low(Z),Vt,nt,B.editorAttributes.of({class:"cm-merge-b"}),Ze.of((i,r)=>{let s=r.effects.find(o=>o.is(he));return s&&(i=O.updateA(i,s.value.doc,r.startState.doc,s.value.changes,l)),r.docChanged&&(i=O.updateB(i,r.state.field(V),r.newDoc,r.changes,l)),i}),b.of({highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1,syntaxHighlightDeletions:t.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:(e=t.mergeControls)!==null&&e!==void 0?e:!0,overrideChunk:t.allowInlineDiffs?Wt:void 0,side:"b"}),V.init(()=>n),t.gutter!==!1?Rt:[],t.collapseUnchanged?se(t.collapseUnchanged):[],k.init(i=>O.build(n,i.doc,l))]}const he=G.define(),V=H.define({create:()=>Fe.empty,update(t,e){for(let n of e.effects)n.is(he)&&(t=n.value.doc);return t}}),ye=new WeakMap;class rt extends Y{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||(this.dom=this.buildDOM(e))}}function Gt(t,e,n){let l=ye.get(e.changes);if(l)return l;let i=s=>{let{highlightChanges:o,syntaxHighlightDeletions:f,syntaxHighlightDeletionsMaxLength:h,mergeControls:a}=t.facet(b),d=document.createElement("div");if(d.className="cm-deletedChunk",a){let x=d.appendChild(document.createElement("div"));x.className="cm-chunkButtons";let D=A=>{A.preventDefault(),Nt(s,s.posAtDOM(d))},w=A=>{A.preventDefault(),Ft(s,s.posAtDOM(d))};if(typeof a=="function")x.appendChild(a("accept",D)),x.appendChild(a("reject",w));else{let A=x.appendChild(document.createElement("button"));A.name="accept",A.textContent=t.phrase("Accept"),A.onmousedown=D;let L=x.appendChild(document.createElement("button"));L.name="reject",L.textContent=t.phrase("Reject"),L.onmousedown=w}}if(n||e.fromA>=e.toA)return d;let c=s.state.field(V).sliceString(e.fromA,e.endA),u=f&&t.facet(at),m=S(),p=e.changes,g=0,C=!1;function S(){let x=d.appendChild(document.createElement("div"));return x.className="cm-deletedLine",x.appendChild(document.createElement("del"))}function R(x,D,w){for(let A=x;A<D;){if(c.charAt(A)==`
|
|
2
2
|
`){m.firstChild||m.appendChild(document.createElement("br")),m=S(),A++;continue}let L=D,ce=w+(C?" cm-deletedText":""),ue=!1,X=c.indexOf(`
|
|
3
3
|
`,A);if(X>-1&&X<D&&(L=X),o&&g<p.length){let j=Math.max(0,C?p[g].toA:p[g].fromA);j<=L&&(L=j,C&&g++,ue=!0)}if(L>A){let j=document.createTextNode(c.slice(A,L));if(ce){let me=m.appendChild(document.createElement("span"));me.className=ce,me.appendChild(j)}else m.appendChild(j);A=L}ue&&(C=!C)}}if(u&&e.toA-e.fromA<=h){let x=u.parser.parse(c),D=0;ft(x,{style:w=>dt(t,w)},(w,A,L)=>{w>D&&R(D,w,""),R(w,A,L),D=A}),R(D,c.length,"")}else R(0,c.length,"");return m.firstChild||m.appendChild(document.createElement("br")),d},r=M.widget({block:!0,side:-1,widget:new rt(i)});return ye.set(e.changes,r),r}function Nt(t,e){let{state:n}=t,l=e??n.selection.main.head,i=t.state.field(k).find(f=>f.fromB<=l&&f.endB>=l);if(!i)return!1;let r=t.state.sliceDoc(i.fromB,Math.max(i.fromB,i.toB-1)),s=t.state.field(V);i.fromB!=i.toB&&i.toA<=s.length&&(r+=t.state.lineBreak);let o=Ne.of({from:i.fromA,to:Math.min(s.length,i.toA),insert:r},s.length);return t.dispatch({effects:he.of({doc:o.apply(s),changes:o}),userEvent:"accept"}),!0}function Ft(t,e){let{state:n}=t,l=e??n.selection.main.head,i=n.field(k).find(o=>o.fromB<=l&&o.endB>=l);if(!i)return!1;let s=n.field(V).sliceString(i.fromA,Math.max(i.fromA,i.toA-1));return i.fromA!=i.toA&&i.toB<=n.doc.length&&(s+=n.lineBreak),t.dispatch({changes:{from:i.fromB,to:Math.min(n.doc.length,i.toB),insert:s},userEvent:"revert"}),!0}function Re(t){let e=new N;for(let n of t.field(k)){let l=t.facet(b).overrideChunk&&it(t,n);e.add(n.fromB,n.fromB,Gt(t,n,!!l))}return e.finish()}const Vt=H.define({create:t=>Re(t),update(t,e){return e.state.field(k,!1)!=e.startState.field(k,!1)?Re(e.state):t},provide:t=>B.decorations.from(t)}),Te=new WeakMap;function it(t,e){let n=Te.get(e);if(n!==void 0)return n;n=null;let l=t.field(V),i=t.doc,r=l.lineAt(e.endA).number-l.lineAt(e.fromA).number+1,s=i.lineAt(e.endB).number-i.lineAt(e.fromB).number+1;e:if(r==s&&r<10){let o=[],f=0,h=e.fromA,a=e.fromB;for(let d of e.changes){if(d.fromA<d.toA){f+=d.toA-d.fromA;let c=l.sliceString(h+d.fromA,h+d.toA);if(/\n/.test(c))break e;o.push(M.widget({widget:new jt(c),side:-1}).range(a+d.fromB))}d.fromB<d.toB&&o.push(tt.range(a+d.fromB,a+d.toB))}f<e.endA-e.fromA-r*2&&(n=o)}return Te.set(e,n),n}class jt extends Y{constructor(e){super(),this.text=e}eq(e){return this.text==e.text}toDOM(e){let n=document.createElement("del");return n.className="cm-deletedText",n.textContent=this.text,n}}const It=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-inlineChangedLineGutter"}},Ut=M.line({class:"cm-inlineChangedLine"});function Wt(t,e,n,l){let i=it(t,e),r=0;if(!i)return!1;for(let s=t.doc.lineAt(e.fromB);;){for(l&&l.add(s.from,s.from,It),n.add(s.from,s.from,Ut);r<i.length&&i[r].to<=s.to;){let o=i[r++];n.add(o.from,o.to,o.value)}if(s.to>=e.endB)break;s=t.doc.lineAt(s.to+1)}return!0}function Ht(t){const[e,n]=T.useState([]);return T.useEffect(()=>{let l=!1;const i=ht.matchFilename(ct,t);if(!i){n([]);return}return i.load().then(r=>{l||n([r])}).catch(()=>{l||n([])}),()=>{l=!0}},[t]),e}function Kt({baseline:t,current:e,theme:n,filename:l,sideBySide:i,onRejectHunk:r,onHunkCountChange:s}){const o=Ht(l);return i?J.jsx(Pt,{baseline:t,current:e,theme:n,languageExtension:o}):J.jsx(zt,{baseline:t,current:e,theme:n,languageExtension:o,onRejectHunk:r,onHunkCountChange:s})}function zt({baseline:t,current:e,theme:n,languageExtension:l,onRejectHunk:i,onHunkCountChange:r}){const s=T.useRef(-1),o=T.useMemo(()=>[B.lineWrapping,Tt({original:t,gutter:!0,mergeControls:!0,collapseUnchanged:{margin:3,minSize:4}}),...l],[t,l]);return J.jsx(lt,{value:e,editable:!1,readOnly:!0,theme:n,height:"100%",className:"desktop:select-text h-full text-sm",extensions:o,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},onChange:f=>i(f),onUpdate:f=>{var a;const h=((a=vt(f.state))==null?void 0:a.chunks.length)??null;h!==null&&h!==s.current&&(s.current=h,r(h))}})}function Pt({baseline:t,current:e,theme:n,languageExtension:l}){const i=T.useRef(null);return T.useEffect(()=>{const r=i.current;if(!r)return;const s=[B.editable.of(!1),ne.readOnly.of(!0),B.lineWrapping,...n==="dark"?[qt()]:[],...l],o=new Et({a:{doc:t,extensions:s},b:{doc:e,extensions:s},parent:r,collapseUnchanged:{margin:3,minSize:4},highlightChanges:!0,gutter:!0});return()=>o.destroy()},[t,e,n,l]),J.jsx("div",{ref:i,className:"cm-diff-split h-full overflow-auto text-sm"})}function qt(){return B.theme({"&":{backgroundColor:"transparent",color:"inherit"}},{dark:!0})}export{Kt as CodeMirrorDiff};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,j as f}from"./index-
|
|
1
|
+
import{r as n,j as f}from"./index-DxTOTFWT.js";import{R as l}from"./index-BcPMhqQ_.js";import{m as a,n as c,E as x}from"./index-1-RB7sXm.js";function j({value:u,editable:t,filename:i,languageHint:e,theme:h,onChange:m}){const[g,r]=n.useState([]);return n.useEffect(()=>{let s=!1;const o=e?a.matchLanguageName(c,e,!0):a.matchFilename(c,i);if(!o){r([]);return}return o.load().then(p=>{s||r([p])}).catch(()=>{s||r([])}),()=>{s=!0}},[i,e]),f.jsx(l,{value:u,editable:t,readOnly:!t,onChange:m,theme:h,height:"100%",className:"desktop:select-text h-full text-sm",extensions:[x.lineWrapping,...g],basicSetup:{highlightActiveLine:t,highlightActiveLineGutter:t}})}export{j as CodeMirrorEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a8 as A,aa as E,ab as k,
|
|
1
|
+
import{a8 as A,aa as E,ab as k,fx as I,fy as $,_ as z,z as j,G as o,D as P,fz as R,J as q,r as p,j as t,I as y,B as v,Q as w,fA as W,e as F,Y as U,Z as X,C as K,a0 as Q,f as B,ae as H}from"./index-DxTOTFWT.js";function Z(){const e=A(),s=E();return k({mutationFn:({agentId:n,body:a})=>e.createCommitment(n,a),onSettled:()=>s.invalidateQueries({queryKey:I.all})})}function G(){const e=A(),s=E();return k({mutationFn:({id:n,body:a})=>e.updateCommitment(n,a),onSettled:()=>s.invalidateQueries({queryKey:I.all})})}$();const _=300,J=500,Y=200,D="external:",T=z(["open","kept","missed","dropped"]).openapi("CommitmentState"),O=j({id:o(),agentId:o(),to:o().nullable(),what:o(),dueAt:o().nullable(),state:T,overdue:P(),sourceSessionId:o().nullable(),sourceRoomEntryId:o().nullable(),createdAt:o(),closedAt:o().nullable(),note:o().nullable()}).openapi("Commitment"),L=o().datetime({offset:!0});j({what:o().trim().min(1).max(_),to:o().trim().min(1).max(Y).optional(),dueAt:L.optional()}).openapi("CreateCommitmentRequest");j({state:T,dueAt:L.nullable().optional(),note:o().trim().max(J).optional(),from:T.optional()}).openapi("UpdateCommitmentRequest");const V=500;j({agentId:o().min(1).optional(),state:T.optional(),to:o().min(1).optional(),limit:R().int().min(1).max(V).optional()}).openapi("ListCommitmentsQuery");j({commitments:q(O)}).openapi("ListCommitmentsResponse");function ee(e,s=new Date){if(!e)return null;const n=new Date(e);if(Number.isNaN(n.getTime()))return null;const a=n.getTime()<s.getTime()?"Overdue ·":"Due",d=n.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"});return n.toDateString()===s.toDateString()?`${a} ${d}`:Math.abs(n.getTime()-s.getTime())/864e5<6?`${a} ${n.toLocaleDateString(void 0,{weekday:"short"})} ${d}`:`${a} ${n.toLocaleDateString(void 0,{month:"short",day:"numeric"})}`}function te(e,s){return e?e.startsWith(D)?`To ${e.slice(D.length)}`:`To ${(s==null?void 0:s(e))??e}`:null}function se(e){return{open:e.filter(s=>s.state==="open"),closed:e.filter(s=>s.state!=="open")}}const ae={kept:"Kept",missed:"Missed",dropped:"Dropped"};function de(e){var n;const s=new Map;for(const a of e)s.set(a.id,a.displayName),(n=a.agent)!=null&&n.manifestId&&s.set(a.agent.manifestId,a.displayName);return a=>s.get(a)}const ne=6e4;function oe(){const e=new Date;return new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(0,16)}function ie({agentId:e,onDone:s}){var m;const n=Z(),[a,d]=p.useState(""),[r,l]=p.useState(""),u=p.useId(),g=p.useId(),x=a.trim(),b=n.isError&&((m=n.error)==null?void 0:m.code)==="PAST_DUE",h=r?new Date(r).getTime():null,[c,S]=p.useState(!1),[N]=p.useState(oe);function i(C){if(C.preventDefault(),!x||c)return;const f=h!==null?new Date(h).toISOString():void 0;n.mutate({agentId:e,body:{what:x,...f?{dueAt:f}:{}}},{onSuccess:s})}return t.jsxs("form",{onSubmit:i,"data-slot":"add-commitment-form",className:"flex flex-col gap-2 rounded-md border p-3",children:[t.jsx("label",{htmlFor:u,className:"text-xs font-medium",children:"What was promised"}),t.jsx(y,{id:u,value:a,maxLength:_,onChange:C=>d(C.target.value),placeholder:"Send Acme the revised quote"}),t.jsx("label",{htmlFor:g,className:"text-xs font-medium",children:"Due (optional)"}),t.jsx(y,{id:g,type:"datetime-local",value:r,min:N,"aria-invalid":c||void 0,onChange:C=>{const f=C.target.value;l(f),S(f!==""&&new Date(f).getTime()<Date.now()-ne)}}),(c||b)&&t.jsx("p",{className:"text-destructive text-xs",children:"That time has passed."}),n.isError&&!b&&t.jsx("p",{role:"alert",className:"text-destructive text-xs",children:"Couldn’t save the commitment. Try again."}),t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx(v,{type:"button",size:"sm",variant:"ghost",onClick:s,children:"Cancel"}),t.jsx(v,{type:"submit",size:"sm",disabled:!x||c||n.isPending,children:"Add commitment"})]})]})}function M({commitment:e,agentName:s,nameOf:n,onClose:a,busy:d}){const r=e.state==="open",l=[s,te(e.to,n)].filter(Boolean).join(" · "),u=r?ee(e.dueAt):null;return t.jsxs("li",{"data-slot":"commitment-row","data-state":e.state,"data-overdue":e.overdue||void 0,className:"flex flex-col gap-2 rounded-md px-2 py-2 sm:flex-row sm:items-center sm:gap-3",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:w("text-sm break-words",!r&&"text-muted-foreground",e.state==="dropped"&&"line-through"),children:e.what}),(l||u||!r)&&t.jsxs("div",{className:"text-muted-foreground mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs",children:[e.state!=="open"&&t.jsx("span",{children:ae[e.state]}),l&&t.jsx("span",{className:"min-w-0 truncate",children:l}),u&&t.jsx("span",{className:w(e.overdue&&"text-destructive font-medium"),children:u})]})]}),r&&a&&t.jsxs("div",{className:"flex shrink-0 gap-1",children:[t.jsx(v,{size:"xs",variant:"outline",disabled:d,onClick:()=>a("kept"),"aria-label":`Mark kept: ${e.what}`,children:"Mark kept"}),t.jsx(v,{size:"xs",variant:"ghost",disabled:d,onClick:()=>a("dropped"),"aria-label":`Drop: ${e.what}`,children:"Drop"})]})]})}const re={kept:"Marked kept",dropped:"Commitment dropped"};function ue({agentId:e,nameOf:s,canAdd:n=!1,readOnly:a=!1,canChange:d}){var N;const r=W(e?{agentId:e}:{}),l=G(),[u,g]=p.useState(!1),x=e===void 0;function b(i,m){l.mutate({id:i.id,body:{state:m}},{onSuccess:()=>H.success(re[m],{action:{label:"Undo",onClick:()=>l.mutate({id:i.id,body:{state:"open",from:m}})}})})}if(r.isPending)return t.jsx(F,{className:"h-16 w-full"});if(r.isError)return t.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read commitments."});const{open:h,closed:c}=se(r.data),S=l.isPending?(N=l.variables)==null?void 0:N.id:void 0;return t.jsxs("div",{"data-slot":"commitment-list",className:"flex flex-col gap-2",children:[h.length===0&&c.length===0&&!u&&t.jsx("p",{className:"text-muted-foreground text-sm",children:"No commitments yet."}),h.length>0&&t.jsx("ul",{className:"flex flex-col","aria-label":"Open commitments",children:h.map(i=>t.jsx(M,{commitment:i,agentName:x?s==null?void 0:s(i.agentId):void 0,nameOf:s,busy:S===i.id,...a||d&&!d(i)?{}:{onClose:m=>b(i,m)}},i.id))}),l.isError&&t.jsx("p",{role:"alert",className:"text-destructive text-xs",children:"Couldn’t change that commitment. Try again."}),c.length>0&&t.jsxs(U,{children:[t.jsxs(X,{className:"focus-ring text-muted-foreground hover:text-foreground group flex items-center gap-1 rounded-md px-2 py-1 text-xs",children:[t.jsx(K,{"aria-hidden":!0,className:"size-3.5 transition-transform group-data-[state=open]:rotate-90"}),"Closed (",c.length,")"]}),t.jsx(Q,{children:t.jsx("ul",{className:"flex flex-col","aria-label":"Closed commitments",children:c.map(i=>t.jsx(M,{commitment:i,agentName:x?s==null?void 0:s(i.agentId):void 0,nameOf:s},i.id))})})]}),n&&!a&&e&&u&&t.jsx(ie,{agentId:e,onDone:()=>g(!1)}),n&&!a&&e&&!u&&t.jsxs(v,{size:"sm",variant:"ghost",className:"self-start",onClick:()=>g(!0),children:[t.jsx(B,{"aria-hidden":!0}),"Add commitment"]})]})}export{ue as C,de as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,d,j as m}from"./index-
|
|
1
|
+
import{r,d,j as m}from"./index-DxTOTFWT.js";import{r as c,C as l}from"./CommitmentList-B-B3E6yN.js";function u({member:s,roster:t}){var o;const e=(o=s.agent)==null?void 0:o.manifestId,i=r.useMemo(()=>c(t),[t]),n=d(s,t),a=n==="managed"||n==="system";return e?m.jsx("div",{className:"min-h-0 flex-1","data-slot":"profile-commitments",children:m.jsx(l,{agentId:e,nameOf:i,canAdd:a,readOnly:!a})}):null}export{u as CommitmentsPage};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{a2 as g,a8 as x,b0 as o,r as C,j as e,B as d,a3 as P}from"./index-DxTOTFWT.js";import{r as m,u as f,C as w}from"./ComputerViewer-BjU1hfpc.js";import{u as v}from"./use-is-below-desktop-Cx2BL1BK.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 h={name:"arrow-down-left",size:24,node:[["path",{d:"M17 7 7 17",key:"15tmo1"}],["path",{d:"M17 17H7V7",key:"1org7z"}]]};h.node;const k=g(h);function z(){const s=f(),n=o(p=>p.pipContent),i=o(p=>p.closePip),c=o(p=>p.openPip),r=x(),t=s.data,l=v();if(!(t!=null&&t.cwd))return e.jsx(u,{});const a={kind:"computer",computerId:t.id,generation:t.generation,cwd:t.cwd,title:t.name,agentPath:t.cwd.replace(/\/workspace\/?$/,"")};return(n==null?void 0:n.kind)==="computer"&&n.computerId===a.computerId&&n.cwd===a.cwd?e.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 p-6 text-center",children:[e.jsx("p",{className:"text-muted-foreground text-sm",children:"Viewing in PiP."}),e.jsx(d,{variant:"outline",onClick:()=>{m(r),i()},children:"Bring back"})]}):e.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[e.jsx("div",{className:"flex justify-end px-3 pt-2",children:e.jsx(d,{variant:"ghost",size:"icon-sm","aria-label":"Pop computer out",onClick:()=>{m(r),c(a),l&&o.getState().setRightPanelOpen(!1)},children:e.jsx(P,{className:"size-4"})})}),e.jsx(j,{content:a})]})}function R({content:s}){const n=x(),i=o(t=>t.closePip),c=o(t=>t.setExplicitAgentPath),r=o(t=>t.requestRightPanel);return C.useEffect(()=>o.subscribe((t,l)=>{var a;((a=l.pipContent)==null?void 0:a.kind)==="computer"&&(t.pipContent!==l.pipContent||!l.pipMinimized&&t.pipMinimized)&&m(n)}),[n]),e.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[e.jsx("div",{className:"flex justify-end px-3 pt-1",children:e.jsx(d,{variant:"ghost",size:"icon-sm","aria-label":"Return computer to panel",onClick:()=>{m(n),i(),c(s.agentPath),r("computer",s.agentPath)},children:e.jsx(k,{className:"size-4"})})}),e.jsx(j,{content:s,pinned:!0})]})}function j({content:s,pinned:n=!1}){const i=f(),c=o(t=>t.openPip),r=i.data;return!r||i.isError?e.jsx(u,{reconnect:()=>void i.refetch()}):r.id!==s.computerId||r.cwd!==s.cwd?e.jsx(u,{}):r.phase!=="ready"||!r.ready?e.jsx(u,{label:r.phase==="stopped"?"Computer stopped.":"Computer unavailable.",reconnect:()=>void i.refetch()}):n&&r.generation!==s.generation?e.jsx(u,{label:"Computer restarted.",reconnect:()=>c({...s,generation:r.generation})}):e.jsx(w,{generation:r.generation})}function u({label:s="Couldn’t reach the computer.",reconnect:n}){return e.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 p-6 text-center",children:[e.jsx("p",{role:"status",className:"text-muted-foreground text-sm",children:s}),n&&e.jsx(d,{variant:"outline",onClick:n,children:"Reconnect"})]})}export{z as C,R as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var R=Object.defineProperty;var S=(i,t,e)=>t in i?R(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var o=(i,t,e)=>S(i,typeof t!="symbol"?t+"":t,e);import{a8 as D,a9 as F,r as h,j as a,I as O,B as y,Q as I}from"./index-DxTOTFWT.js";const Y=["computer","local"];function X(){const i=D();return F({queryKey:Y,queryFn:()=>i.getComputer(),networkMode:"always",refetchInterval:2e3,retry:!1})}class B{constructor(t,e,r){o(this,"snapshot",{frame:null,lease:null,owner:null,busy:!1,error:!1,controlError:!1});o(this,"listeners",new Map);o(this,"timer");o(this,"epoch",0);o(this,"acquisition",0);o(this,"queue",Promise.resolve());o(this,"movePending",!1);o(this,"polling",!1);o(this,"retired",!1);o(this,"pendingOwner",null);o(this,"frameRequest",null);o(this,"getSnapshot",()=>this.snapshot);o(this,"subscribe",(t,e)=>(this.listeners.set(t,e),!this.polling&&!this.retired&&this.start(),()=>{this.listeners.delete(t),this.releaseFor(t),this.listeners.size===0&&(this.epoch+=1,this.polling=!1,clearTimeout(this.timer),this.update({frame:null}))}));o(this,"release",async()=>{const t=this.snapshot.lease;this.drop();const e=this.acquisition;if(t)try{await this.transport.releaseComputerControl(t.leaseId)}catch{e===this.acquisition&&this.update({error:!0,frame:null})}});o(this,"releaseFor",t=>this.snapshot.owner===t||this.pendingOwner===t?this.release():Promise.resolve());o(this,"acquire",async t=>{if(this.retired||!this.listeners.has(t)||this.snapshot.busy||!this.snapshot.frame||this.snapshot.lease)return;const e=++this.acquisition;this.pendingOwner=t,this.update({busy:!0,controlError:!1});try{const r=await this.transport.acquireComputerControl();if(!this.listeners.has(t)||e!==this.acquisition||r.generation!==this.generation){await this.transport.releaseComputerControl(r.leaseId);return}this.update({lease:r,owner:t,controlError:!1})}catch{e===this.acquisition&&this.update({controlError:!0})}finally{e===this.acquisition&&(this.pendingOwner=null,this.update({busy:!1}))}});o(this,"send",(t,e)=>{const r=this.snapshot.lease;if(!r||this.snapshot.owner!==t||!this.listeners.has(t))return Promise.resolve(!1);const l=e.kind==="pointer"&&e.action==="move";if(l&&this.movePending)return Promise.resolve(!1);l&&(this.movePending=!0);const n=this.queue.then(async()=>{if(this.snapshot.lease!==r||this.snapshot.owner!==t||!this.listeners.has(t))return l&&(this.movePending=!1),!1;try{return await this.transport.sendComputerInput({...e,...r}),!0}catch{return this.snapshot.lease===r&&this.snapshot.owner===t&&(this.update({error:!0,frame:null}),await this.release()),!1}finally{l&&(this.movePending=!1)}});return this.queue=n.then(()=>{}),n});this.transport=t,this.generation=e,this.previous=r}update(t){this.snapshot={...this.snapshot,...t};for(const e of this.listeners.values())e()}retire(){this.retired=!0,this.epoch+=1,this.polling=!1,clearTimeout(this.timer),this.release(),this.update({frame:null,error:!0})}start(){var r;(r=this.previous)==null||r.retire(),this.previous=void 0,this.polling=!0;const t=++this.epoch,e=async()=>{const l=this.snapshot.lease;try{const n=this.frameRequest??this.transport.getComputerFrame();this.frameRequest=n;const u=await n.finally(()=>{this.frameRequest===n&&(this.frameRequest=null)});if(t!==this.epoch)return;u.generation!==this.generation?(this.update({frame:null,error:!0}),this.release()):(u.controlledByYou===!1&&l&&this.snapshot.lease===l&&this.drop(),this.update({frame:u,error:!1}))}catch{if(t!==this.epoch)return;this.update({frame:null,error:!0}),this.release()}t===this.epoch&&(this.timer=setTimeout(()=>void e(),500))};e()}drop(){this.acquisition+=1,this.movePending=!1,this.pendingOwner=null,this.update({lease:null,owner:null,busy:!1,controlError:!1})}}const k=new WeakMap;function z(i){var t;return((t=k.get(i))==null?void 0:t.release())??Promise.resolve()}function K(i,t){let e=k.get(i);return(!e||e.generation!==t)&&(e=new B(i,t,e),k.set(i,e)),e}function L(i){const t=D(),e=h.useId(),r=h.useMemo(()=>K(t,i),[t,i]),l=h.useCallback(u=>r.subscribe(e,u),[r,e]),n=h.useSyncExternalStore(l,r.getSnapshot);return{...n,lease:n.owner===e?n.lease:null,controlledElsewhere:!!(n.lease&&n.owner!==e),session:r,owner:e}}function U({send:i}){const[t,e]=h.useState(""),[r,l]=h.useState(!1),n=h.useRef(!0);return h.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),a.jsxs("form",{className:"flex flex-wrap gap-2",onSubmit:u=>{if(u.preventDefault(),!t||r)return;const m=t;l(!0),i({kind:"text",text:m}).then(c=>{n.current&&c&&e(d=>d===m?"":d)}).finally(()=>{n.current&&l(!1)})},children:[a.jsx(O,{"aria-label":"Type on computer",placeholder:"Type on computer",value:t,maxLength:4096,autoComplete:"off",autoCorrect:"off",autoCapitalize:"none",spellCheck:!1,className:"min-w-0 flex-1",onChange:u=>e(u.target.value)}),a.jsx(y,{type:"submit","aria-disabled":r||!t,"aria-busy":r,children:"Type"}),a.jsx(y,{type:"button",variant:"outline",onClick:()=>{i({kind:"key",key:"Enter",action:"down"}),i({kind:"key",key:"Enter",action:"up"})},children:"Enter"})]})}function _({generation:i,onClose:t}){const{frame:e,lease:r,busy:l,error:n,controlError:u,controlledElsewhere:m,session:c,owner:d}=L(i),E=h.useRef(null),q=h.useId(),v=c.release,x=s=>c.send(d,s),N=async()=>{var s;await c.acquire(d),(s=E.current)==null||s.focus()};h.useEffect(()=>{const s=()=>{c.releaseFor(d)},g=()=>{document.hidden&&s()};return window.addEventListener("blur",s),document.addEventListener("visibilitychange",g),()=>{window.removeEventListener("blur",s),document.removeEventListener("visibilitychange",g)}},[c,d,v]);const w=(s,g)=>{var j,P,T,M;if(!r||!e)return;const p=s.currentTarget.getBoundingClientRect();if(!p.width||!p.height)return;const f=Math.min(p.width/e.width,p.height/e.height),b=p.left+(p.width-e.width*f)/2,C=p.top+(p.height-e.height*f)/2;(s.clientX<b||s.clientX>b+e.width*f||s.clientY<C||s.clientY>C+e.height*f)&&!((P=(j=s.currentTarget).hasPointerCapture)!=null&&P.call(j,s.pointerId))||(s.preventDefault(),g==="down"&&(s.currentTarget.focus(),(M=(T=s.currentTarget).setPointerCapture)==null||M.call(T,s.pointerId)),x({kind:"pointer",action:g,button:Math.max(0,Math.min(2,s.button)),x:Math.max(0,Math.min(e.width-1,Math.floor((s.clientX-b)/f))),y:Math.max(0,Math.min(e.height-1,Math.floor((s.clientY-C)/f)))}))};return a.jsxs("section",{"data-slot":"computer-viewer","aria-label":"Computer desktop",className:"flex h-full min-h-0 flex-col gap-2 overflow-auto p-3",onBlur:s=>{s.currentTarget.contains(s.relatedTarget)||c.releaseFor(d)},children:[a.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:[a.jsx("p",{className:"text-muted-foreground mr-auto text-sm",role:"status",children:n?"Disconnected":r?"You have control":e?"Watching":"Connecting…"}),r?a.jsx(y,{variant:"outline",onClick:()=>void v(),children:"Return control"}):a.jsx(y,{variant:"outline",disabled:!e||m,"aria-disabled":l||!e||m,"aria-busy":l,onClick:()=>void N(),children:"Take over"}),t&&a.jsx(y,{variant:"ghost",onClick:t,children:"Close view"})]}),n&&a.jsx("p",{role:"alert",className:"text-destructive text-sm",children:"Disconnected. Trying to reconnect…"}),u&&!n&&a.jsx("p",{role:"alert",className:"text-destructive text-sm",children:"Couldn’t take control. Try again."}),e?a.jsx("div",{ref:E,role:"application","aria-label":"Computer desktop control","aria-describedby":q,tabIndex:r?0:-1,className:I("focus-visible:ring-ring block min-h-20 w-full flex-1 rounded-md outline-none select-none focus-visible:ring-2",r?"touch-none":"touch-pan-y"),onDragStart:s=>s.preventDefault(),onContextMenu:s=>s.preventDefault(),onPointerDown:s=>w(s,"down"),onPointerMove:s=>w(s,"move"),onPointerUp:s=>w(s,"up"),onPointerCancel:()=>void c.releaseFor(d),onKeyDown:s=>{if(r){if(s.preventDefault(),s.key==="Escape"&&s.ctrlKey&&s.shiftKey){v();return}s.repeat||x({kind:"key",key:s.key,action:"down"})}},onKeyUp:s=>{r&&(s.preventDefault(),x({kind:"key",key:s.key,action:"up"}))},children:a.jsx("img",{src:e.dataUrl,width:e.width,height:e.height,alt:"Live computer desktop",draggable:!1,className:"block h-full w-full rounded-md object-contain"})}):a.jsx("p",{role:"status",className:"text-muted-foreground py-10 text-center text-sm",children:"Waiting for the desktop…"}),r&&a.jsx(U,{send:x},r.leaseId),a.jsx("p",{id:q,className:I("text-muted-foreground shrink-0 text-xs",!r&&"sr-only"),children:"Press Control + Shift + Escape to return control."}),t&&a.jsx("p",{className:"text-muted-foreground shrink-0 text-xs",children:"Closing this view keeps the computer running."})]})}export{_ as C,Y as a,z as r,X as u};
|
package/dist/client/assets/{ConnectionAccessLists-9oeVn_GK.js → ConnectionAccessLists-Iy_T25Rw.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,e as x,B as o,a3 as m,a4 as u,a5 as h,a6 as g}from"./index-
|
|
1
|
+
import{j as s,e as x,B as o,a3 as m,a4 as u,a5 as h,a6 as g}from"./index-DxTOTFWT.js";import{u as p,s as l,a as j,b as f}from"./access-copy-CE5oc1d9.js";import{Q as N}from"./query-error-state-Cq1O4FGq.js";const v={agent:"From the agent",this_chat:"Only in this chat"};function k({agentId:n,onManage:e}){var i;const a=p(n);if(a.isPending)return s.jsx(x,{className:"h-24 w-full rounded-lg"});if(a.isError)return s.jsx(N,{title:"Couldn’t load account access",description:"Nothing changed. Try again.",onRetry:()=>void a.refetch(),isRetrying:a.isFetching});const c=((i=a.data)==null?void 0:i.connections)??[];return s.jsxs("section",{"aria-labelledby":"agent-account-access",className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h3",{id:"agent-account-access",className:"text-sm font-semibold",children:"Account access"}),s.jsx("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Accounts this agent can use."})]}),e&&s.jsxs(o,{variant:"ghost",size:"sm",onClick:e,children:["Manage",s.jsx(m,{className:"size-3.5","aria-hidden":!0})]})]}),c.length===0?s.jsxs("div",{className:"bg-muted/40 rounded-lg p-4 text-sm",children:[s.jsx("p",{className:"font-medium",children:"No account access"}),s.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:"Give access from the Connections page."})]}):s.jsx("ul",{className:"space-y-1.5",children:c.map(t=>{const r=t.readiness.state==="ready";return s.jsxs("li",{"data-testid":`agent-connection-${t.connectionId}`,className:"bg-muted/40 flex min-h-11 items-center gap-3 rounded-lg px-3 py-2",children:[s.jsx(u,{iconKey:t.toolkit,displayName:l(t.toolkit),className:"size-7"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("p",{className:"truncate text-sm font-medium",children:[l(t.toolkit)," (",t.label,")"]}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[t.operationRevisionIds.length," approved"," ",t.operationRevisionIds.length===1?"action":"actions",t.everyAgent&&" · given to every agent"]})]}),s.jsx(h,{size:"xs",variant:r?"secondary":"outline",title:r?void 0:t.readiness.copy.owner,children:r?"Available":"Unavailable"})]},t.connectionId)})})]})}const y="This only affects this chat. Turning an app back on never adds access.",C="Couldn’t change access for this chat. Try again.";function b(n){return(n==null?void 0:n.code)==="session_access_other_agent"?n.message:C}function T({sessionId:n,onManage:e,emptyAction:a,footer:c}){var r;const i=j(n);if(i.isPending)return s.jsx(x,{className:"h-16 w-full rounded-lg"});if(i.isError)return s.jsxs("section",{"data-testid":"session-connectors",className:"space-y-2",children:[s.jsx("p",{role:"alert",className:"text-destructive px-1 text-xs",children:"Couldn’t load account access."}),s.jsx(o,{variant:"ghost",size:"sm",onClick:()=>void i.refetch(),children:"Try again"})]});const t=((r=i.data)==null?void 0:r.connections)??[];return s.jsxs("section",{"data-testid":"session-connectors","aria-labelledby":"session-account-access",className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 px-1 pb-1",children:[s.jsx("h3",{id:"session-account-access",className:"text-muted-foreground text-xs font-medium tracking-wide uppercase",children:"Connections"}),e&&s.jsxs(o,{variant:"ghost",size:"xs",onClick:e,children:["Manage agent access",s.jsx(m,{className:"size-3","aria-hidden":!0})]})]}),t.length===0?s.jsxs("div",{className:"bg-muted/40 space-y-2 rounded-md px-2.5 py-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"No account access"}),s.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:"Ask this agent to request the access it needs."})]}),a]}):s.jsxs(s.Fragment,{children:[t.some(d=>d.thisChat)&&s.jsx("p",{className:"text-muted-foreground px-1 pb-1 text-xs",children:y}),t.map(d=>s.jsx(S,{sessionId:n,connection:d},d.connectionId))]}),t.length>0&&c]})}function S({sessionId:n,connection:e}){const a=f(n),c=e.readiness.state==="ready",i=`${l(e.toolkit)} (${e.label})`;return s.jsxs("div",{"data-testid":`session-connection-${e.connectionId}`,"data-reason":e.readiness.reason,className:"bg-muted/40 rounded-md px-2.5 py-2",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[s.jsx("span",{className:"text-sm font-medium",children:i}),s.jsx(h,{size:"xs",variant:c?"secondary":"outline",children:c?v[e.source]:"Not available"})]}),s.jsx("p",{className:c?"text-muted-foreground mt-1 text-xs":"text-status-warning-fg mt-1 text-xs",children:c?`${e.operationRevisionIds.length} ${e.operationRevisionIds.length===1?"action":"actions"} available in this chat.`:e.readiness.copy.owner})]}),e.thisChat&&s.jsx(g,{"aria-label":`${i} in this chat`,"data-testid":`session-connection-switch-${e.connectionId}`,checked:e.thisChat==="on",disabled:a.isPending,onCheckedChange:t=>a.mutate({connectionId:e.connectionId,on:t}),className:"mt-0.5 shrink-0"})]}),a.isError&&e.thisChat&&s.jsx("p",{role:"alert",className:"text-destructive mt-1 text-xs",children:b(a.error)})]})}export{k as A,T as S};
|