@p4code/cli 0.9.5 → 0.9.6
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.mjs +1 -1
- package/dist/{binCli-CVJEJMnj.mjs → binCli-0A0KffG3.mjs} +62396 -60542
- package/dist/client/.vite/manifest.json +2002 -2002
- package/dist/client/assets/{2NI2N5EU-B7VyxMN2.js → 2NI2N5EU-BEr-Tfqs.js} +2 -2
- package/dist/client/assets/{4UO7MD6I-_i-iLqe4.js → 4UO7MD6I-z55jzCJI.js} +2 -2
- package/dist/client/assets/{5B3SVYGG-CARRzQXp.js → 5B3SVYGG-BFexm37i.js} +2 -2
- package/dist/client/assets/{5GK6JWQ2-Bmp0940o.js → 5GK6JWQ2-Bn_JiXgJ.js} +2 -2
- package/dist/client/assets/{5N7A7DKN-Vb8SXW7T.js → 5N7A7DKN-Duo22cWA.js} +2 -2
- package/dist/client/assets/{5OC2THR4-y3jeEKWa.js → 5OC2THR4-DidiZL1J.js} +2 -2
- package/dist/client/assets/{5S6HY5KT-Bfbcbcrn.js → 5S6HY5KT-DQ4fJlKq.js} +2 -2
- package/dist/client/assets/{6IMQ5BUJ-DALpMJ8I.js → 6IMQ5BUJ-JMPhBK1B.js} +2 -2
- package/dist/client/assets/{6OLKWJ4F-yeoADL6U.js → 6OLKWJ4F-CpaocvvP.js} +2 -2
- package/dist/client/assets/{74OO7NKP-BSRT49ed.js → 74OO7NKP-Btg8U3A7.js} +2 -2
- package/dist/client/assets/{75O6YZUN-DMpxNGcI.js → 75O6YZUN-BVcu_3G6.js} +2 -2
- package/dist/client/assets/{77XECAW3-Cn248Dt-.js → 77XECAW3-B2dqs2a0.js} +2 -2
- package/dist/client/assets/{ABYRPUBD-Cv-xq6SK.js → ABYRPUBD-csm8mwzG.js} +2 -2
- package/dist/client/assets/AlertDialogRoot-zitC_5YS.js +2 -0
- package/dist/client/assets/{AnimatedHeight-CqEEdPxS.js → AnimatedHeight-CU3C1NcV.js} +2 -2
- package/dist/client/assets/{AuthSurfaceShell-8r4Oh4o8.js → AuthSurfaceShell-DT2jFrxd.js} +2 -2
- package/dist/client/assets/{BB2UYUI2-CI5XHuPZ.js → BB2UYUI2-CrLDpD9c.js} +2 -2
- package/dist/client/assets/{BUM34MOA-BfLbkDc3.js → BUM34MOA-DGaisF3P.js} +2 -2
- package/dist/client/assets/{CEQABKGZ-DpqVSfdQ.js → CEQABKGZ-BHUFEz8L.js} +2 -2
- package/dist/client/assets/{CXAC5362-C31Wqp-g.js → CXAC5362-CF0Q8UlN.js} +2 -2
- package/dist/client/assets/{ChatGptUsageButton-Dkq13hxI.js → ChatGptUsageButton-LTPdlo27.js} +2 -2
- package/dist/client/assets/{ChatMarkdown-DWX9SN0I.js → ChatMarkdown-WBYeOz6B.js} +5 -5
- package/dist/client/assets/{CheckboxIndicator-COjg4Es5.js → CheckboxIndicator-CT--c3fO.js} +2 -2
- package/dist/client/assets/{ClippedText-DpqkIszs.js → ClippedText-BWXvwYxu.js} +2 -2
- package/dist/client/assets/{CodexSetupSection.logic-C8_mcFTG.js → CodexSetupSection.logic-7Ae1lVg1.js} +2 -2
- package/dist/client/assets/{ComboboxClear-xR2R2-pv.js → ComboboxClear-CRWQGFjR.js} +2 -2
- package/dist/client/assets/{ComboboxGroupLabel-H2tPGIr6.js → ComboboxGroupLabel-BMo03qXe.js} +2 -2
- package/dist/client/assets/{CommandBlock-BU2CuIfo.js → CommandBlock-D57LdSoM.js} +2 -2
- package/dist/client/assets/{ComposerPromptEditor-T4veXUFB.js → ComposerPromptEditor-DJ9XwB1O.js} +4 -4
- package/dist/client/assets/{CompositeRoot-BIHvyYsZ.js → CompositeRoot-DSNl3c3G.js} +2 -2
- package/dist/client/assets/{ConnectionDiagnosisDetails-Blx3b1Io.js → ConnectionDiagnosisDetails-CMRX7VzH.js} +2 -2
- package/dist/client/assets/{ConnectionStatusDot-VMSwkMx4.js → ConnectionStatusDot-CiISG6eT.js} +2 -2
- package/dist/client/assets/{DRLTVNUE-CgTmY7aZ.js → DRLTVNUE-BjIXDJQN.js} +2 -2
- package/dist/client/assets/{DYY6UVD2-CHyCh3iy.js → DYY6UVD2-Dpro9qr4.js} +2 -2
- package/dist/client/assets/{DevicePanel-Du9xpjah.js → DevicePanel-DtM34nRC.js} +2 -2
- package/dist/client/assets/{DeviceSetup-3I8BZ0G5.js → DeviceSetup-BgzTguQP.js} +2 -2
- package/dist/client/assets/{DialogTitle-ueL4fmrv.js → DialogTitle-CACErOl5.js} +2 -2
- package/dist/client/assets/{DiffCommentAnnotation-Cb3p3y9X.js → DiffCommentAnnotation-Bcjn-Btj.js} +2 -2
- package/dist/client/assets/{DiffFileTree-CDCTH6OS.js → DiffFileTree-1s_6Y4bE.js} +2 -2
- package/dist/client/assets/{DiffPanel-vcZG1S2-.js → DiffPanel-BTNwksR-.js} +2 -2
- package/dist/client/assets/{DiffWorkerPoolProvider-WP0Muna6.js → DiffWorkerPoolProvider-DDVuzh7w.js} +2 -2
- package/dist/client/assets/{EmbeddedDesign-CpBO6uA7.js → EmbeddedDesign-3XobSUFO.js} +2 -2
- package/dist/client/assets/{EnvironmentMachineIcon-CAhjzBdd.js → EnvironmentMachineIcon-B6RgXF8A.js} +2 -2
- package/dist/client/assets/{ExpandableText-BOZbK7rv.js → ExpandableText-B3WqZ3eC.js} +2 -2
- package/dist/client/assets/{FNOVOB4O-BOUHvPNW.js → FNOVOB4O-BxVVUi2o.js} +2 -2
- package/dist/client/assets/{FieldControl-CtZ34LP0.js → FieldControl-BDrBhdoh.js} +2 -2
- package/dist/client/assets/{FileDiff-DU2VaZza.js → FileDiff-DM8e9Pyt.js} +2 -2
- package/dist/client/assets/{FilePreviewPanel-BT7yD1Je.js → FilePreviewPanel-CRdP4-01.js} +2 -2
- package/dist/client/assets/{FoldedSettingsSection-DyeK8ENP.js → FoldedSettingsSection-CsaWcgI5.js} +2 -2
- package/dist/client/assets/{FormContext-0ymX4Zdq.js → FormContext-BZ8Nuwwa.js} +2 -2
- package/dist/client/assets/{HDGCDEEZ-DhgkYpl1.js → HDGCDEEZ-9x1WhMZA.js} +2 -2
- package/dist/client/assets/{HSJLKHB7-LRZ0mZom.js → HSJLKHB7-BI4g8Uha.js} +2 -2
- package/dist/client/assets/{Icons-DtaiKNi8.js → Icons-CPaJO8_C.js} +2 -2
- package/dist/client/assets/Input-CTKz2gGc.js +2 -0
- package/dist/client/assets/JZOYTAAL-BSyl5qdX.js +1 -0
- package/dist/client/assets/{K3MD6TGW-Bms96D04.js → K3MD6TGW-QvtIomBt.js} +2 -2
- package/dist/client/assets/{K7RP3OMA-C4yeqngm.js → K7RP3OMA-CenKL848.js} +2 -2
- package/dist/client/assets/{KeybindingsSettings.logic-Z0gn-b9C.js → KeybindingsSettings.logic-Dk-UU5gV.js} +2 -2
- package/dist/client/assets/{LHDIQX7Q-D-iPFOmd.js → LHDIQX7Q-Du31c03t.js} +2 -2
- package/dist/client/assets/{LUXOKEGN-CJld9Vod.js → LUXOKEGN-DwVZaHZy.js} +2 -2
- package/dist/client/assets/{MathTypeset-DVrs3WeR.js → MathTypeset-DUJJZ0qR.js} +2 -2
- package/dist/client/assets/{N3JZAHOW-DHlQszLH.js → N3JZAHOW-f6rXQzfb.js} +2 -2
- package/dist/client/assets/{NUIALGQ3-BZrVZkDz.js → NUIALGQ3-B7-2dGpz.js} +2 -2
- package/dist/client/assets/{NoProjectsHero-DvT0SZTY.js → NoProjectsHero-BJZpoal_.js} +2 -2
- package/dist/client/assets/{O65XPQGZ-1Tib5Wm-.js → O65XPQGZ-pxAza1nz.js} +2 -2
- package/dist/client/assets/{O7XIQ6OM-B-jqX1ax.js → O7XIQ6OM-nX2_hGto.js} +2 -2
- package/dist/client/assets/{OFQON5FD-Z7ov13yL.js → OFQON5FD-y110aBJF.js} +2 -2
- package/dist/client/assets/{P4ConnectAccountPages-CLjGS23g.js → P4ConnectAccountPages-C1rFKA40.js} +2 -2
- package/dist/client/assets/{P4ConnectSidebarSignIn-Bqoai3_p.js → P4ConnectSidebarSignIn-40UlSrjv.js} +2 -2
- package/dist/client/assets/{PJQHF43J-BxO9Ed7Y.js → PJQHF43J-CbQqRUq6.js} +2 -2
- package/dist/client/assets/{PanelLayoutControls-CikZjTVk.js → PanelLayoutControls-CrSkXhVM.js} +4 -4
- package/dist/client/assets/{PierreEntryIcon-8lVXHvon.js → PierreEntryIcon-C488PFw3.js} +2 -2
- package/dist/client/assets/{PopoverHandle-CY48vabI.js → PopoverHandle-ByI17B8T.js} +2 -2
- package/dist/client/assets/{PreviewPanel-BsOxA7PG.js → PreviewPanel-CsAlP3Pf.js} +2 -2
- package/dist/client/assets/{ProjectDefaultsSettings-B6A-veuE.js → ProjectDefaultsSettings-b9JKMHCZ.js} +2 -2
- package/dist/client/assets/{ProjectFavicon-CYE59XXq.js → ProjectFavicon-BhuB_Su5.js} +3 -3
- package/dist/client/assets/{ProjectIconPickerDialog-B29JEJpT.js → ProjectIconPickerDialog-Cug9qYje.js} +2 -2
- package/dist/client/assets/{ProjectMonogram-DglZOJVY.js → ProjectMonogram-DdSkqGzz.js} +2 -2
- package/dist/client/assets/{ProviderAuthTerminal-Du0soMRt.js → ProviderAuthTerminal-BiaVsusp.js} +2 -2
- package/dist/client/assets/{ProviderModelPicker-DSQrIw5c.js → ProviderModelPicker-CHf8PGFh.js} +2 -2
- package/dist/client/assets/{ProviderSettingsForm-BDstI6TK.js → ProviderSettingsForm-DTCgpI31.js} +2 -2
- package/dist/client/assets/{PullRequestCodeTab-D5rLVyxt.js → PullRequestCodeTab-CruWTaey.js} +2 -2
- package/dist/client/assets/{RHNBAITX-CFRd4LdH.js → RHNBAITX-NhKz5kz6.js} +2 -2
- package/dist/client/assets/{ReadOnlySourcePreview-DumpnOnX.js → ReadOnlySourcePreview-BVjNlm_O.js} +2 -2
- package/dist/client/assets/{RenderErrorBoundary-BfOIzAFb.js → RenderErrorBoundary-C2PF8Cmu.js} +2 -2
- package/dist/client/assets/{SLD4V6NK-BzuDe7TY.js → SLD4V6NK-Ca5SsXR4.js} +2 -2
- package/dist/client/assets/{ScheduledTasksSettings-BZDLn8vh.js → ScheduledTasksSettings-QWakG9R_.js} +2 -2
- package/dist/client/assets/{ScopedSwitch-BDRueGC0.js → ScopedSwitch-Dpqx-0tY.js} +2 -2
- package/dist/client/assets/{ScrollAreaCorner-CiDeFRJG.js → ScrollAreaCorner-CGc2ioKQ.js} +2 -2
- package/dist/client/assets/{SecretInput-Bpz_flBS.js → SecretInput-D6soOcQS.js} +2 -2
- package/dist/client/assets/{SelectScrollUpArrow-UhJfY29a.js → SelectScrollUpArrow-CjMNXdhr.js} +2 -2
- package/dist/client/assets/{SettingsPanels-D9i_jn8e.js → SettingsPanels-5CR3ByhH.js} +2 -2
- package/dist/client/assets/{SettingsPanels.logic-BO_7fD50.js → SettingsPanels.logic-DYKv08oD.js} +2 -2
- package/dist/client/assets/{SettingsScopeNotice-DYhbVTKo.js → SettingsScopeNotice-Bq20tBUp.js} +2 -2
- package/dist/client/assets/{SidebarStageBackdrop-CXA-VL7f.js → SidebarStageBackdrop-CEjjEyUl.js} +2 -2
- package/dist/client/assets/{T3PCR2KE-Iz8AFoGq.js → T3PCR2KE-D-xJTbp-.js} +2 -2
- package/dist/client/assets/{TKWO2OVW-BiMX9mgc.js → TKWO2OVW-JaByeldU.js} +2 -2
- package/dist/client/assets/{TSHNXIZL-T9Jpa5Rz.js → TSHNXIZL-7SUhC5Vk.js} +2 -2
- package/dist/client/assets/{ThemeEditorPanel-DFn3Yrn1.js → ThemeEditorPanel-TxkY9El4.js} +2 -2
- package/dist/client/assets/{ThreadTerminalDrawer-C1eykNJF.js → ThreadTerminalDrawer-CW0oM3tO.js} +2 -2
- package/dist/client/assets/{TooltipViewport-DOp3kVQY.js → TooltipViewport-beytMJmq.js} +2 -2
- package/dist/client/assets/{UQJE5E4I-yF2s3czF.js → UQJE5E4I-CHN9jRa_.js} +2 -2
- package/dist/client/assets/{USNYFO5S-DyMrZB5n.js → USNYFO5S-Bvrc0sLJ.js} +2 -2
- package/dist/client/assets/{Virtualizer-VNN198aV.js → Virtualizer-vgqc_DSl.js} +2 -2
- package/dist/client/assets/{WEVWDWVA-BbR-bYXa.js → WEVWDWVA-BaKbLsuO.js} +2 -2
- package/dist/client/assets/{WorkspaceBreadcrumb-Bp8cxbFz.js → WorkspaceBreadcrumb-1f5BN5n1.js} +2 -2
- package/dist/client/assets/{WorkspacePageContainer-CZSuBU6k.js → WorkspacePageContainer-CDQRGmcV.js} +2 -2
- package/dist/client/assets/{WorkspacePageHeader-CTjYrqv6.js → WorkspacePageHeader-Q5YQyOFt.js} +2 -2
- package/dist/client/assets/{X5RFHQXM-CMXzdpa6.js → X5RFHQXM-BfoStT6R.js} +2 -2
- package/dist/client/assets/{X62E3GBT-C88V1WXc.js → X62E3GBT-DPqQZAUV.js} +2 -2
- package/dist/client/assets/{XBNEOJTC-ZXo4ara-.js → XBNEOJTC-a4pknpW1.js} +2 -2
- package/dist/client/assets/{YHV2MVVZ-Ddw8TiKv.js → YHV2MVVZ-CLYitNzo.js} +2 -2
- package/dist/client/assets/{YURCZMG2-CRwbbhO8.js → YURCZMG2-D5G4Gqxk.js} +2 -2
- package/dist/client/assets/{YVG2LODB-yVeDUCXO.js → YVG2LODB-BaOOPjOj.js} +2 -2
- package/dist/client/assets/{_chat-unmRpcW-.js → _chat-DLjkfz3i.js} +5 -5
- package/dist/client/assets/{_chat.design-T6D4XSc2.js → _chat.design-C8CbENny.js} +2 -2
- package/dist/client/assets/{_chat.index-BrgyAe9a.js → _chat.index-CWE510ct.js} +2 -2
- package/dist/client/assets/{_chat.new-C7fjsbGq.js → _chat.new-wb1utvr4.js} +2 -2
- package/dist/client/assets/{_chat.pull-requests-CToI_h67.js → _chat.pull-requests-D0bA9kLT.js} +2 -2
- package/dist/client/assets/{alert-kMZL9jzU.js → alert-Cq0DAg5J.js} +2 -2
- package/dist/client/assets/{assetUrls-CDYiJSSP.js → assetUrls-DpLOinYe.js} +2 -2
- package/dist/client/assets/{assets-DnrC_hwl.js → assets-Dls9s4TR.js} +2 -2
- package/dist/client/assets/{browserHistoryStore-CPBdgvvO.js → browserHistoryStore-CUc0_P_z.js} +2 -2
- package/dist/client/assets/{browserLinkTarget-oPTgFwDG.js → browserLinkTarget-BmW74g3V.js} +2 -2
- package/dist/client/assets/{checkbox-CP-w8eOU.js → checkbox-CoJ-ki0Z.js} +2 -2
- package/dist/client/assets/{color-picker-CZcpcrrS.js → color-picker-ABTfqBnJ.js} +2 -2
- package/dist/client/assets/{combobox-BHK8wQLo.js → combobox-C6NpXSFx.js} +2 -2
- package/dist/client/assets/{command-Bps-UDxp.js → command-BOsIZcjU.js} +2 -2
- package/dist/client/assets/{connect-CvkwK1ES.js → connect-B3OIDtgH.js} +2 -2
- package/dist/client/assets/{connect-agent-B9W36itu.js → connect-agent-BcH8kUjm.js} +2 -2
- package/dist/client/assets/{design-BPvd5t1p.js → design-D0u5lYcP.js} +2 -2
- package/dist/client/assets/{device-D5HNJpEC.js → device-UePDkr_L.js} +2 -2
- package/dist/client/assets/{dialog-BGBsXIS2.js → dialog-r1KpDpid.js} +2 -2
- package/dist/client/assets/{diffRendering-UyG_CIdR.js → diffRendering-cPnt2kIt.js} +2 -2
- package/dist/client/assets/{dist-BsVTiAl1.js → dist-D4Fzk6mX.js} +3 -3
- package/dist/client/assets/{draft-input-DDmbM6Qp.js → draft-input-eAeawUnI.js} +2 -2
- package/dist/client/assets/{duoViewer-C6sIXAmx.js → duoViewer-6tHPOGH8.js} +2 -2
- package/dist/client/assets/{dynamic-CeJgJNu6.js → dynamic-bKXiwQos.js} +2 -2
- package/dist/client/assets/{embeddedScripts-CSKss0de.js → embeddedScripts-CALp_TgN.js} +2 -2
- package/dist/client/assets/{empty-BchIQtwZ.js → empty-B5VIjZQf.js} +2 -2
- package/dist/client/assets/{entities-Ba3s4XOS.js → entities-DhRbI2L4.js} +2 -2
- package/dist/client/assets/{fileLinks-wfxpV-Qo.js → fileLinks-B4-TDufo.js} +2 -2
- package/dist/client/assets/{fileTreeExpansion-G-ylmE2I.js → fileTreeExpansion-WgU7oBBt.js} +2 -2
- package/dist/client/assets/{getDiffFileInput-3SvhMdx2.js → getDiffFileInput-CIsReQa3.js} +2 -2
- package/dist/client/assets/{guideRunStore-DzJc7VAu.js → guideRunStore-D6SjxVHH.js} +2 -2
- package/dist/client/assets/{htmlRender-B2qNV9TA.js → htmlRender-eKT33KVk.js} +2 -2
- package/dist/client/assets/{index-DYSmz54X.js → index-Gp6V8OPo.js} +3 -3
- package/dist/client/assets/{input-gXGwC11t.js → input-CySdZpuF.js} +2 -2
- package/dist/client/assets/{input-group-BqTFWskf.js → input-group-BRBXX90v.js} +2 -2
- package/dist/client/assets/{kbd-C2W9UqaC.js → kbd-BEi8qVF9.js} +2 -2
- package/dist/client/assets/{keybindings-D8lOCt7z.js → keybindings-COfPuZJ9.js} +2 -2
- package/dist/client/assets/{lazy-3fGMvttY.js → lazy-BKgu9oVK.js} +4 -4
- package/dist/client/assets/{lazyRouteComponent-7R-i6XT2.js → lazyRouteComponent-BUMdW5GA.js} +2 -2
- package/dist/client/assets/{link-CrHFGDcA.js → link-BLuLRp-C.js} +2 -2
- package/dist/client/assets/{linkedPrompt-VMNYJ9GO.js → linkedPrompt-BCdDQK81.js} +2 -2
- package/dist/client/assets/{main-BsbTTyDp.js → main-1tW7jidE.js} +7 -7
- package/dist/client/assets/main-BE5xGjw3.css +2 -0
- package/dist/client/assets/{mediaReference-BDgCdUPv.js → mediaReference-DAak-Bfh.js} +2 -2
- package/dist/client/assets/{mediaSource-Cjbr6BqZ.js → mediaSource-CI8DI4FI.js} +2 -2
- package/dist/client/assets/{number-field-Dhe9aDDa.js → number-field-DqB5oGdp.js} +2 -2
- package/dist/client/assets/{observeResize-D2-UGRv1.js → observeResize-CAGp2C1D.js} +2 -2
- package/dist/client/assets/{onboarding-r9FLYQ-W.js → onboarding-JbZFsvi9.js} +2 -2
- package/dist/client/assets/{openFileInPreview-Bw1jIEqk.js → openFileInPreview-CDCQ6rKJ.js} +2 -2
- package/dist/client/assets/{p4ProjectFile-BpTD1cMi.js → p4ProjectFile-DuMklfjR.js} +2 -2
- package/dist/client/assets/{pair-ho4TSbex.js → pair-3U4lhizd.js} +2 -2
- package/dist/client/assets/{pendingSendStore-CuJffLFW.js → pendingSendStore-BaAUC-mU.js} +2 -2
- package/dist/client/assets/{phoneViewer-D2TwG0d-.js → phoneViewer-BhDgaxtz.js} +2 -2
- package/dist/client/assets/{pierre-icons-DbovR9oY.js → pierre-icons-BnU3xLFM.js} +2 -2
- package/dist/client/assets/{popover-C7uUfSpb.js → popover-Cmd3nOX1.js} +2 -2
- package/dist/client/assets/{preview-CQ-dmagT.js → preview-BhM7y-5f.js} +2 -2
- package/dist/client/assets/{preview-DjnkVD4h.js → preview-DzgdX_e_.js} +2 -2
- package/dist/client/assets/{previewMiniPlayerStore-B9M2YCIo.js → previewMiniPlayerStore-JEelmjkF.js} +2 -2
- package/dist/client/assets/{primary-DpIL5Bs7.js → primary-C5Pkih-v.js} +2 -2
- package/dist/client/assets/{primaryCloudLinkState-BsLCUljE.js → primaryCloudLinkState-1Xmc8JzR.js} +2 -2
- package/dist/client/assets/{projectFilesQueryState-Dk3vmsg5.js → projectFilesQueryState-D9gKctiS.js} +2 -2
- package/dist/client/assets/{projectScriptEditor-0BJmIRyM.js → projectScriptEditor-D20MTQIS.js} +2 -2
- package/dist/client/assets/{providerSkills-DTnO9Kdf.js → providerSkills-DY_Eya4r.js} +2 -2
- package/dist/client/assets/{pullRequestDetail.logic-DtuOiGEk.js → pullRequestDetail.logic-CLAnM03l.js} +2 -2
- package/dist/client/assets/{pullRequestIcons-Dlewxywr.js → pullRequestIcons-1vN39RsA.js} +2 -2
- package/dist/client/assets/{pullRequestReviewStore-gMxEUIkY.js → pullRequestReviewStore-z8tuJFXD.js} +2 -2
- package/dist/client/assets/{pullRequests-B0XzWwD9.js → pullRequests-Dqd6r9gw.js} +2 -2
- package/dist/client/assets/{queries-OL_Htq8-.js → queries-B6XxcqnT.js} +2 -2
- package/dist/client/assets/{query-D2ZruPOT.js → query-yuF2-QRx.js} +2 -2
- package/dist/client/assets/{radio-group-B3QH_8sP.js → radio-group-Dcl3ANRp.js} +2 -2
- package/dist/client/assets/{renderScheduler-Dm1z2lUO.js → renderScheduler-CfBAnW7l.js} +2 -2
- package/dist/client/assets/{rightPanelStore-8Ds3qezY.js → rightPanelStore-DKH3Bw74.js} +2 -2
- package/dist/client/assets/{runtime-BdUzhUUM.js → runtime-Csw1ghUb.js} +3 -3
- package/dist/client/assets/{runtime-CzKn37Ie.js → runtime-DYpzE3gq.js} +3 -3
- package/dist/client/assets/{runtimeModeConfig-CkMiiAL3.js → runtimeModeConfig-cuNxQIV-.js} +2 -2
- package/dist/client/assets/{scheduledTasksSettings.logic-DQ-I14gW.js → scheduledTasksSettings.logic-9aUS0PH9.js} +2 -2
- package/dist/client/assets/{scroll-area-YeND7YEE.js → scroll-area-DMQd4YlU.js} +2 -2
- package/dist/client/assets/{select-Vs0PFHo8.js → select-kRO2vVzo.js} +2 -2
- package/dist/client/assets/{selfImproveFindings-Dr0Xv5Cv.js → selfImproveFindings-uaqHvfDg.js} +2 -2
- package/dist/client/assets/{server-BWUPVzyQ.js → server-DXSwZxzT.js} +2 -2
- package/dist/client/assets/{session-logic-DEPJvR2T.js → session-logic-C42l2TRa.js} +2 -2
- package/dist/client/assets/{session-DO9vnR62.js → session-meZM9Xpf.js} +2 -2
- package/dist/client/assets/{settings-C4A95qyS.js → settings-DFDwiVWH.js} +2 -2
- package/dist/client/assets/{settings.appearance-BJlptNKw.js → settings.appearance-Cfti608t.js} +2 -2
- package/dist/client/assets/settings.archived-Bh4SpQp7.js +2 -0
- package/dist/client/assets/{settings.computer-use-DgrTOJNC.js → settings.computer-use-BlDOxUzy.js} +2 -2
- package/dist/client/assets/{settings.connections-CANgvtpc.js → settings.connections-BTrzLXQG.js} +2 -2
- package/dist/client/assets/{settings.data-controls-BSwYGvBW.js → settings.data-controls-DUdW2NVF.js} +2 -2
- package/dist/client/assets/{settings.decisions-DUMCyTuZ.js → settings.decisions-DrG6xwiq.js} +2 -2
- package/dist/client/assets/{settings.designs-BBZMrfcr.js → settings.designs-BtuTLR8n.js} +2 -2
- package/dist/client/assets/{settings.diagnostics-CIZDT4cV.js → settings.diagnostics-BK6KmZ6a.js} +2 -2
- package/dist/client/assets/{settings.general-bSnpL1hJ.js → settings.general-BmfZwZYV.js} +2 -2
- package/dist/client/assets/{settings.integrations-X7_if4hO.js → settings.integrations-D1gZz8sk.js} +2 -2
- package/dist/client/assets/{settings.keybindings-Zqqy5SpG.js → settings.keybindings-BTpVSO__.js} +2 -2
- package/dist/client/assets/{settings.open-source-licenses-B78rCdLj.js → settings.open-source-licenses-XO8zNkrl.js} +2 -2
- package/dist/client/assets/{settings.plugins-BBBQ-lLl.js → settings.plugins-VlmvBnPN.js} +2 -2
- package/dist/client/assets/{settings.projects-DB2aOKVF.js → settings.projects-M8mb50zO.js} +3 -3
- package/dist/client/assets/{settings.providers-CK3hv5-I.js → settings.providers-CQ0OTnQ1.js} +3 -3
- package/dist/client/assets/{settings.scheduled-tasks-DWtqoBGX.js → settings.scheduled-tasks-Dm3QDHlc.js} +2 -2
- package/dist/client/assets/{settings.snap-shot-5aoNTQNE.js → settings.snap-shot-BxcK0LEY.js} +2 -2
- package/dist/client/assets/{settings.source-control-DrKsCyRy.js → settings.source-control-DbAJM2fi.js} +2 -2
- package/dist/client/assets/{settings.storage-Bd2pVP1J.js → settings.storage-BWTGbbAs.js} +2 -2
- package/dist/client/assets/{settingsLayout-B5eZBFxv.js → settingsLayout-D3zsCQTE.js} +2 -2
- package/dist/client/assets/{sidebar-DXusvEJa.js → sidebar-C_Z-zEdU.js} +2 -2
- package/dist/client/assets/{sidebarProjectGrouping-Bkwz22MS.js → sidebarProjectGrouping-upKKecFM.js} +2 -2
- package/dist/client/assets/{skeleton-CQczLiXo.js → skeleton-CAZWrHi2.js} +2 -2
- package/dist/client/assets/{sourceControl-iC7SBPhY.js → sourceControl-Bb4nr0Wx.js} +2 -2
- package/dist/client/assets/{sourceControlClients-8HF20R-d.js → sourceControlClients-DExT5Wem.js} +2 -2
- package/dist/client/assets/{spinner-CkQHTBh8.js → spinner-DN7lJfwl.js} +2 -2
- package/dist/client/assets/{terminal-links-BwPSFkUp.js → terminal-links-Dj73wz5S.js} +2 -2
- package/dist/client/assets/{terminalSessions-Vl5lzDOp.js → terminalSessions-CyoMi8Lk.js} +2 -2
- package/dist/client/assets/{textarea-C3yif1uk.js → textarea-U0rH71iw.js} +2 -2
- package/dist/client/assets/{themePalette-kU5foqa6.js → themePalette-B5YWcpxp.js} +2 -2
- package/dist/client/assets/{toast-DJ2-4imd.js → toast-C1lIuL0v.js} +2 -2
- package/dist/client/assets/{toggle-BwVfYVI5.js → toggle-CrlljXsx.js} +2 -2
- package/dist/client/assets/{toggle-group-CUE2cE-r.js → toggle-group-BIVeiRdg.js} +2 -2
- package/dist/client/assets/{tooltip-DctjVJ7F.js → tooltip-CMPhQaPE.js} +2 -2
- package/dist/client/assets/{uiStateStore-D4coYv1J.js → uiStateStore-C6-jXt5N.js} +2 -2
- package/dist/client/assets/{usage-DnLLaKaF.js → usage-TbP8vhYG.js} +2 -2
- package/dist/client/assets/{usageAccess-BifB1Sam.js → usageAccess-B68ifs1q.js} +2 -2
- package/dist/client/assets/{usageFormat-DgseLcCP.js → usageFormat-5HVN-IRu.js} +2 -2
- package/dist/client/assets/{usageShortcuts-C0xlzVwU.js → usageShortcuts-cMgT39NO.js} +2 -2
- package/dist/client/assets/{use-atom-command-D7oRayrc.js → use-atom-command-sg76DXcz.js} +2 -2
- package/dist/client/assets/{useAriaLabelledBy-ChgWEu_a.js → useAriaLabelledBy-D_ENSt33.js} +2 -2
- package/dist/client/assets/{useHandleNewThread-BcOvatr7.js → useHandleNewThread-DglymQWA.js} +2 -2
- package/dist/client/assets/{useLocation-DctIJsoW.js → useLocation-t7z8sUje.js} +2 -2
- package/dist/client/assets/{useNavigate-C-nl3R9B.js → useNavigate-kfVoxx_T.js} +2 -2
- package/dist/client/assets/{useNavigateBack-BVWPYJko.js → useNavigateBack-B79USD1h.js} +2 -2
- package/dist/client/assets/{useP4ConnectAuthPrompt-Ds5beo6Y.js → useP4ConnectAuthPrompt-Caj-XRNA.js} +2 -2
- package/dist/client/assets/{useParams-BEj3muN1.js → useParams-DuqJgNNY.js} +2 -2
- package/dist/client/assets/{usePermissionStatus-BpCHJG9L.js → usePermissionStatus-hWpY6-jP.js} +2 -2
- package/dist/client/assets/{usePullRequestActions-BjCrAcbO.js → usePullRequestActions-B6Nj3E46.js} +2 -2
- package/dist/client/assets/{useRegisterFieldControl-DxvlOVA9.js → useRegisterFieldControl-y1AHmvVZ.js} +2 -2
- package/dist/client/assets/{useScopedModelAvailability-CgXMs_Zc.js → useScopedModelAvailability-Cb_UE0gJ.js} +2 -2
- package/dist/client/assets/{useSettings-BzfsGrZk.js → useSettings-CyF6ezIl.js} +2 -2
- package/dist/client/assets/{utils-DBdIFVCj.js → utils-BlwLA0C4.js} +17 -17
- package/dist/client/assets/{vcsRefInvalidation-D4Oei7uu.js → vcsRefInvalidation-Bkr613aV.js} +2 -2
- package/dist/client/assets/{welcome-Bmf6_fLo.js → welcome-Dj-C1U_A.js} +2 -2
- package/dist/client/index.html +1 -1
- package/dist/{renderer-DXsHnrqP.mjs → renderer-BaYdZX9b.mjs} +2 -2
- package/dist/{runtime-Sw1S5Uy7.mjs → runtime-xvtWpueC.mjs} +3 -4
- package/package.json +1 -1
- package/dist/client/assets/AlertDialogRoot-Cb4z5Mk4.js +0 -2
- package/dist/client/assets/Input-YAwDiPhc.js +0 -2
- package/dist/client/assets/JZOYTAAL-DrWLTUgY.js +0 -1
- package/dist/client/assets/main-DAlZJX1g.css +0 -2
- package/dist/client/assets/settings.archived-rIHiy1vU.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Nd as i,dr as a,sf as o,um as s}from"./utils-
|
|
2
|
-
//# sourceMappingURL=settings.open-source-licenses-
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Nd as i,dr as a,sf as o,um as s}from"./utils-BlwLA0C4.js";import{a as c,n as l,t as u}from"./tooltip-CMPhQaPE.js";import{n as d,r as f,t as p}from"./input-group-BRBXX90v.js";import{i as m,s as h}from"./settingsLayout-D3zsCQTE.js";import{co as g,lo as _,uo as v}from"./main-1tW7jidE.js";var y=e(t(),1),b=n();function x(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function S(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function C(e){if(typeof e!=`string`)return!1;try{let t=new URL(e).protocol;return t===`http:`||t===`https:`}catch{return!1}}function w(e,t){if(!x(e))throw Error(`License entry ${String(t+1)} is not an object.`);if(!S(e.bundles)||e.bundles.length===0||e.kind!==`custom`&&e.kind!==`package`||typeof e.license!=`string`||typeof e.name!=`string`||typeof e.noticeText!=`string`||e.sourceUrl!==null&&!C(e.sourceUrl)||e.version!==null&&typeof e.version!=`string`)throw Error(`License entry ${String(t+1)} has an invalid shape.`);return{bundles:e.bundles,kind:e.kind,license:e.license,name:e.name,noticeText:e.noticeText,sourceUrl:e.sourceUrl,version:e.version}}function T(e){if(!x(e)||e.schemaVersion!==1||!Array.isArray(e.entries))throw Error(`The open-source license manifest has an unsupported format.`);let t=e.entries.map(w),n=new Set;for(let e of t){let t=k(e);if(n.has(t))throw Error(`The open-source license manifest contains a duplicate entry: ${t}`);n.add(t)}return{schemaVersion:1,entries:t}}function E(e,t){let n=t.trim().toLowerCase().split(/\s+/).filter(e=>e.length>0);return n.length===0?e:e.filter(e=>{let t=[e.name,e.version,e.license,...e.bundles].filter(e=>e!==null).join(` `).toLowerCase();return n.every(e=>t.includes(e))})}var D={android:`Android`,assets:`Assets`,desktop:`Desktop`,"device-tools":`Device tools`,ios:`iOS`,mobile:`Mobile`,server:`Server`,web:`Web`};function O(e){return e.map(e=>Object.prototype.hasOwnProperty.call(D,e)?D[e]:e).join(`, `)}function k(e){return encodeURIComponent(JSON.stringify([e.kind,e.name,e.version]))}var A=e(r(),1),j;async function M(){let e=AbortSignal.timeout(3e4);try{let t=await fetch(`${`/`.replace(/\/$/,``)}/third-party-licenses.json`,{signal:e});if(!t.ok)throw Error(`The license manifest request failed with status ${String(t.status)}.`);return T(await t.json())}catch(t){throw e.aborted?Error(`The license manifest took too long to load.`,{cause:t}):t}}function N(){return j??=M().catch(e=>{throw j=void 0,e}),j}function P(e){let t=(0,b.c)(34),{entry:n,open:r,onOpenChange:s}=e,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,A.jsx)(i,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground transition-transform duration-200 group-data-panel-open:rotate-90`}),t[0]=c):c=t[0];let l;t[1]===n.name?l=t[2]:(l=(0,A.jsx)(`span`,{className:`truncate font-medium text-foreground`,children:n.name}),t[1]=n.name,t[2]=l);let u;t[3]===n.version?u=t[4]:(u=n.version?(0,A.jsx)(`code`,{className:`shrink-0 text-xs text-muted-foreground`,children:n.version}):null,t[3]=n.version,t[4]=u);let d;t[5]!==l||t[6]!==u?(d=(0,A.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-2`,children:[l,u]}),t[5]=l,t[6]=u,t[7]=d):d=t[7];let f=n.license,p;t[8]===n.bundles?p=t[9]:(p=O(n.bundles),t[8]=n.bundles,t[9]=p);let m;t[10]!==n.license||t[11]!==p?(m=(0,A.jsxs)(`span`,{className:`max-w-[42%] shrink-0 truncate text-xs text-muted-foreground`,children:[f,` · `,p]}),t[10]=n.license,t[11]=p,t[12]=m):m=t[12];let h;t[13]!==d||t[14]!==m?(h=(0,A.jsxs)(v,{className:`group flex min-h-10 min-w-0 flex-1 items-center gap-2.5 px-3 text-left sm:min-h-9 sm:px-4`,children:[c,d,m]}),t[13]=d,t[14]=m,t[15]=h):h=t[15];let y;t[16]!==n.name||t[17]!==n.sourceUrl?(y=n.sourceUrl?(0,A.jsx)(a,{"aria-label":`View project source for ${n.name}`,className:`me-3 shrink-0 sm:me-4`,render:(0,A.jsx)(`a`,{href:n.sourceUrl,rel:`noreferrer noopener`,target:`_blank`}),size:`icon-micro`,title:`Project source`,variant:`ghost-muted`,children:(0,A.jsx)(o,{"aria-hidden":!0,className:`size-3`})}):null,t[16]=n.name,t[17]=n.sourceUrl,t[18]=y):y=t[18];let x;t[19]!==h||t[20]!==y?(x=(0,A.jsxs)(`div`,{className:`flex min-h-10 items-center hover:bg-muted/35 sm:min-h-9`,children:[h,y]}),t[19]=h,t[20]=y,t[21]=x):x=t[21];let S;t[22]!==n.noticeText||t[23]!==r?(S=r?(0,A.jsx)(`div`,{className:`px-9 pt-1 pb-4 sm:px-10`,children:(0,A.jsx)(`pre`,{className:`max-w-[76ch] whitespace-pre-wrap break-words font-mono text-xs/5 text-foreground/80`,children:n.noticeText})}):null,t[22]=n.noticeText,t[23]=r,t[24]=S):S=t[24];let C;t[25]===S?C=t[26]:(C=(0,A.jsx)(_,{children:S}),t[25]=S,t[26]=C);let w;t[27]!==x||t[28]!==C?(w=(0,A.jsxs)(`article`,{children:[x,C]}),t[27]=x,t[28]=C,t[29]=w):w=t[29];let T;return t[30]!==s||t[31]!==r||t[32]!==w?(T=(0,A.jsx)(g,{open:r,onOpenChange:s,children:w}),t[30]=s,t[31]=r,t[32]=w,t[33]=T):T=t[33],T}function F(e){let t=(0,b.c)(2),{filteredCount:n,totalCount:r}=e,i=n===r?`${String(r)} notices`:`${String(n)} of ${String(r)}`,a;return t[0]===i?a=t[1]:(a=(0,A.jsx)(`p`,{className:`whitespace-nowrap text-xs font-normal text-muted-foreground tabular-nums`,children:i}),t[0]=i,t[1]=a),a}function I(e){let t=(0,b.c)(34),{query:n,onQueryChange:r,searchOpen:i,onSearchOpenChange:o,filteredCount:m,totalCount:h}=e;if(!i){let e;t[0]!==m||t[1]!==h?(e=(0,A.jsx)(F,{filteredCount:m,totalCount:h}),t[0]=m,t[1]=h,t[2]=e):e=t[2];let n;t[3]===o?n=t[4]:(n=()=>o(!0),t[3]=o,t[4]=n);let r;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,A.jsx)(s,{className:`size-3`}),t[5]=r):r=t[5];let i;t[6]===n?i=t[7]:(i=(0,A.jsx)(c,{render:(0,A.jsx)(a,{"aria-label":`Search open-source licenses`,onClick:n,size:`icon-micro`,type:`button`,variant:`ghost-muted`,children:r})}),t[6]=n,t[7]=i);let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,A.jsx)(l,{side:`top`,children:`Search licenses`}),t[8]=d):d=t[8];let f;t[9]===i?f=t[10]:(f=(0,A.jsxs)(u,{children:[i,d]}),t[9]=i,t[10]=f);let p;return t[11]!==e||t[12]!==f?(p=(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[e,f]}),t[11]=e,t[12]=f,t[13]=p):p=t[13],p}let g;t[14]!==m||t[15]!==h?(g=(0,A.jsx)(`div`,{className:`hidden sm:block`,children:(0,A.jsx)(F,{filteredCount:m,totalCount:h})}),t[14]=m,t[15]=h,t[16]=g):g=t[16];let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,A.jsx)(d,{children:(0,A.jsx)(s,{"aria-hidden":!0,className:`size-3`})}),t[17]=_):_=t[17];let v;t[18]!==o||t[19]!==n.length?(v=()=>{n.length===0&&o(!1)},t[18]=o,t[19]=n.length,t[20]=v):v=t[20];let y;t[21]===r?y=t[22]:(y=e=>r(e.currentTarget.value),t[21]=r,t[22]=y);let x;t[23]!==r||t[24]!==o?(x=e=>{e.key===`Escape`&&(e.preventDefault(),r(``),o(!1))},t[23]=r,t[24]=o,t[25]=x):x=t[25];let S;t[26]!==n||t[27]!==v||t[28]!==y||t[29]!==x?(S=(0,A.jsxs)(p,{className:`w-36 sm:w-44`,children:[_,(0,A.jsx)(f,{"aria-label":`Search open-source licenses`,autoFocus:!0,onBlur:v,onChange:y,onKeyDown:x,placeholder:`Search licenses`,size:`sm`,type:`search`,value:n})]}),t[26]=n,t[27]=v,t[28]=y,t[29]=x,t[30]=S):S=t[30];let C;return t[31]!==g||t[32]!==S?(C=(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[g,S]}),t[31]=g,t[32]=S,t[33]=C):C=t[33],C}function L(e){let t=(0,b.c)(8),{message:n,onRetry:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,A.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`Open-source notices are unavailable`}),t[0]=i):i=t[0];let o;t[1]===n?o=t[2]:(o=(0,A.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[i,(0,A.jsx)(`p`,{className:`max-w-[70ch] text-pretty text-xs leading-normal text-muted-foreground/80`,children:n})]}),t[1]=n,t[2]=o);let s;t[3]===r?s=t[4]:(s=(0,A.jsx)(a,{type:`button`,size:`xs`,variant:`outline`,onClick:r,children:`Try again`}),t[3]=r,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,A.jsxs)(`div`,{className:`flex flex-col items-start gap-3 px-3 py-5 sm:px-4`,children:[o,s]}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function R(){let e=(0,b.c)(25),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={status:`loading`},e[0]=t):t=e[0];let[n,r]=(0,y.useState)(t),[i,a]=(0,y.useState)(``),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)(0),f;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>{let e=!1;return r({status:`loading`}),N().then(t=>{e||r({status:`ready`,manifest:t})},t=>{e||r({status:`error`,message:t instanceof Error?t.message:`The license manifest could not load.`})}),()=>{e=!0}},e[1]=f):f=e[1];let p;e[2]===u?p=e[3]:(p=[u],e[2]=u,e[3]=p),(0,y.useEffect)(f,p);let g;e[4]!==n.manifest||e[5]!==n.status?(g=n.status===`ready`?n.manifest.entries:[],e[4]=n.manifest,e[5]=n.status,e[6]=g):g=e[6];let _=g,v;e[7]!==_||e[8]!==i?(v=E(_,i),e[7]=_,e[8]=i,e[9]=v):v=e[9];let x=v,S;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>d(z),e[10]=S):S=e[10];let C=S,w;e[11]!==_||e[12]!==x||e[13]!==i||e[14]!==o||e[15]!==n.status?(w=n.status===`ready`?(0,A.jsx)(I,{query:i,onQueryChange:a,searchOpen:o,onSearchOpenChange:s,filteredCount:x.length,totalCount:_.length}):null,e[11]=_,e[12]=x,e[13]=i,e[14]=o,e[15]=n.status,e[16]=w):w=e[16];let T;e[17]!==x||e[18]!==c||e[19]!==n.message||e[20]!==n.status?(T=n.status===`ready`?(0,A.jsx)(`div`,{className:`text-base sm:text-sm`,children:x.length>0?x.map(e=>{let t=k(e);return(0,A.jsx)(P,{entry:e,open:c===t,onOpenChange:e=>l(e?t:null)},t)}):(0,A.jsx)(`p`,{className:`px-3 py-8 text-center text-sm/6 text-muted-foreground sm:px-4`,children:`No licenses match that search.`})}):n.status===`error`?(0,A.jsx)(L,{message:n.message,onRetry:C}):(0,A.jsx)(`p`,{className:`px-3 py-5 text-sm/6 text-muted-foreground sm:px-4`,children:`Loading open-source notices…`}),e[17]=x,e[18]=c,e[19]=n.message,e[20]=n.status,e[21]=T):T=e[21];let D;return e[22]!==w||e[23]!==T?(D=(0,A.jsx)(m,{children:(0,A.jsx)(h,{title:`Third-party notices`,headerAction:w,children:T})}),e[22]=w,e[23]=T,e[24]=D):D=e[24],D}function z(e){return e+1}var B=R;export{B as component};
|
|
2
|
+
//# sourceMappingURL=settings.open-source-licenses-XO8zNkrl.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{$n as i,$p as a,A_ as o,Ab as s,Ep as c,F_ as l,I_ as u,Jn as d,M_ as f,N_ as p,Os as m,P_ as h,Rm as g,Xp as _,Yn as v,Yp as y,aE as b,dr as x,im as S,j_ as C,jd as w,k_ as T,l as E,mm as D,nT as O,sd as k,t as A,tr as j,ts as M,um as N,ur as P,xd as F}from"./utils-
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{$n as i,$p as a,A_ as o,Ab as s,Ep as c,F_ as l,I_ as u,Jn as d,M_ as f,N_ as p,Os as m,P_ as h,Rm as g,Xp as _,Yn as v,Yp as y,aE as b,dr as x,im as S,j_ as C,jd as w,k_ as T,l as E,mm as D,nT as O,sd as k,t as A,tr as j,ts as M,um as N,ur as P,xd as F}from"./utils-BlwLA0C4.js";import{n as I}from"./ChatMarkdown-WBYeOz6B.js";import{a as L,c as R,o as z,s as B,t as V}from"./select-kRO2vVzo.js";import{t as H}from"./useLocation-t7z8sUje.js";import{p as U}from"./toast-C1lIuL0v.js";import{S as W}from"./useSettings-CyF6ezIl.js";import{f as G}from"./server-DXSwZxzT.js";import{t as K}from"./use-atom-command-sg76DXcz.js";import{s as q,u as ee}from"./providerSkills-DY_Eya4r.js";import{a as J,n as te,t as ne}from"./tooltip-CMPhQaPE.js";import{t as re}from"./skeleton-CAZWrHi2.js";import{t as ie}from"./textarea-U0rH71iw.js";import{n as ae,t as oe}from"./toggle-group-BIVeiRdg.js";import{t as se}from"./input-CySdZpuF.js";import{c as ce,r as le,s as ue,t as de}from"./dialog-r1KpDpid.js";import{i as fe,o as pe,r as me,t as he}from"./empty-B5VIjZQf.js";import{n as ge,r as _e,t as ve}from"./input-group-BRBXX90v.js";import{a as ye}from"./projectFilesQueryState-D9gKctiS.js";import{F as be,G as xe,V as Se,a as Ce,i as we,s as Te}from"./settingsLayout-D3zsCQTE.js";import{Gr as Ee,Jr as De,Kr as Oe,Xr as ke,Yr as Ae,Zr as je,do as Me,qr as Ne,sa as Pe,yr as Fe}from"./main-1tW7jidE.js";import{t as Ie}from"./SecretInput-D6soOcQS.js";var Y=n(),Le={spawn:`Failed to start`,timeout:`Timed out`,protocol:`Not an MCP server`,http:`Can't connect`,auth:`Credentials rejected`};function Re(e,t,n){if(!e.enabled)return{tone:`muted`,label:`Off`,needsSignIn:!1};if(n)return{tone:`muted`,label:`Checking…`,needsSignIn:!1};if(e.transport.type===`http`&&e.transport.auth===`oauth`&&t?.auth===`signed-out`)return{tone:`warning`,label:`Needs sign-in`,needsSignIn:!0};let r=t?.health;switch(r?.status){case`connected`:return{tone:`success`,label:`Connected · ${r.toolCount} ${r.toolCount===1?`tool`:`tools`}`,needsSignIn:!1};case`needs-auth`:return{tone:`warning`,label:`Needs sign-in`,needsSignIn:!0};case`error`:return{tone:`error`,label:Le[r.category],detail:r.message,needsSignIn:!1};default:return t?.auth===`signed-in`?{tone:`success`,label:`Signed in`,needsSignIn:!1}:{tone:`muted`,label:`Not checked`,needsSignIn:!1}}}function ze(e){let t=e.transport;if(t.type===`http`)try{let e=new URL(t.url);return`Remote · ${e.host}${e.pathname===`/`?``:e.pathname}`}catch{return`Remote`}return[t.command,...t.args].join(` `)}var X=e(t(),1),Z=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Be=e=>typeof e==`string`&&e.trim()?e:void 0,Ve=e=>{if(e!==null)try{let t=JSON.parse(e);return Z(t)?t:void 0}catch{return}},He=e=>{let t=Be(e)?.replace(/^\.\//,``);if(t!==void 0&&t.toLowerCase().endsWith(`.svg`)&&!(t.startsWith(`/`)||t.split(/[\\/]/).includes(`..`)))return t};function Ue(e,t){let n=Ve(e),r=Ve(t),i=Z(r?.interface)?r.interface:void 0,a=n?.author??r?.author,o={displayName:Be(n?.displayName)??Be(i?.displayName),description:Be(n?.description)??Be(r?.description),publisher:Be(a)??(Z(a)?Be(a.name):void 0),iconPath:He(n?.icon)??He(i?.logo)??He(i?.composerIcon)};return Object.fromEntries(Object.entries(o).filter(([,e])=>e!==void 0))}function We(e){let t=Ve(e)?.userConfig;return Z(t)?Object.entries(t).map(([e,t])=>{let n=Z(t)?t:{},r=Be(n.description);return{key:e,title:Be(n.title)??e,...r===void 0?{}:{description:r},required:n.required===!0}}):[]}var Q=e(r(),1),Ge=e=>{let t=b(m(e));return t&&!t.truncated?t.contents:null};function Ke(e){let t=(0,Y.c)(48),{environmentId:n,plugin:r,enabled:o,disabled:s,onDetails:l,onToggle:u}=e,d;t[0]!==n||t[1]!==r.path?(d=ye(n,r.path,`.claude-plugin/plugin.json`),t[0]=n,t[1]=r.path,t[2]=d):d=t[2];let f=M(d),p;t[3]!==n||t[4]!==r.path?(p=ye(n,r.path,`.codex-plugin/plugin.json`),t[3]=n,t[4]=r.path,t[5]=p):p=t[5];let m=M(p),{displayName:h,description:g,publisher:_,iconPath:y}=Ue(Ge(f),Ge(m)),b=Ge(M(ye(n,r.path,y??null))),S=y&&b?.trimStart().startsWith(`<`)?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(b)}`:null,C=ee(n),w;t[6]===S?w=t[7]:(w=(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`flex size-10 shrink-0 items-center justify-center rounded-xl border border-border/60 bg-muted`,children:S?(0,Q.jsx)(`img`,{src:S,alt:``,className:`size-6 object-contain`}):(0,Q.jsx)(a,{className:`size-5 text-muted-foreground`})}),t[6]=S,t[7]=w);let T=h??r.name,E;t[8]===T?E=t[9]:(E=(0,Q.jsx)(`span`,{className:`break-words text-sm font-medium`,children:T}),t[8]=T,t[9]=E);let D;t[10]===_?D=t[11]:(D=_?(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:_}):null,t[10]=_,t[11]=D);let O;t[12]!==E||t[13]!==D?(O=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2`,children:[E,D]}),t[12]=E,t[13]=D,t[14]=O):O=t[14];let k=g??`Local plugin`,A;t[15]===k?A=t[16]:(A=(0,Q.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:k}),t[15]=k,t[16]=A);let N;t[17]!==O||t[18]!==A?(N=(0,Q.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-1`,children:[O,A]}),t[17]=O,t[18]=A,t[19]=N):N=t[19];let F=`More for ${r.name}`,I;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Q.jsx)(c,{"aria-hidden":!0}),t[20]=I):I=t[20];let L;t[21]===F?L=t[22]:(L=(0,Q.jsx)(J,{render:(0,Q.jsx)(P,{render:(0,Q.jsx)(x,{variant:`ghost`,size:`icon-sm`,"aria-label":F,children:I})})}),t[21]=F,t[22]=L);let R;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Q.jsx)(te,{children:`Plugin actions`}),t[23]=R):R=t[23];let z;t[24]===L?z=t[25]:(z=(0,Q.jsxs)(ne,{children:[L,R]}),t[24]=L,t[25]=z);let B;t[26]!==n||t[27]!==C||t[28]!==r.path?(B=C.capabilities.canOpenDefault?(0,Q.jsx)(i,{onClick:()=>void C.activate(`open`,{environmentId:n,filePath:r.path,workspaceRoot:void 0}),children:`Open`}):null,t[26]=n,t[27]=C,t[28]=r.path,t[29]=B):B=t[29];let V;t[30]===l?V=t[31]:(V=(0,Q.jsx)(i,{onClick:l,children:`Details`}),t[30]=l,t[31]=V);let H;t[32]!==B||t[33]!==V?(H=(0,Q.jsxs)(j,{align:`end`,children:[B,V]}),t[32]=B,t[33]=V,t[34]=H):H=t[34];let U;t[35]!==z||t[36]!==H?(U=(0,Q.jsxs)(v,{children:[z,H]}),t[35]=z,t[36]=H,t[37]=U):U=t[37];let W=`Load ${r.name}`,G;t[38]!==s||t[39]!==o||t[40]!==u||t[41]!==W?(G=(0,Q.jsx)(Me,{"aria-label":W,checked:o,disabled:s,onCheckedChange:u}),t[38]=s,t[39]=o,t[40]=u,t[41]=W,t[42]=G):G=t[42];let K;return t[43]!==N||t[44]!==U||t[45]!==G||t[46]!==w?(K=(0,Q.jsxs)(`li`,{className:`flex items-center gap-4 py-4`,children:[w,N,U,G]}),t[43]=N,t[44]=U,t[45]=G,t[46]=w,t[47]=K):K=t[47],K}var qe=[`Personal`,`Built-in`,`Project`,`Plugins`,`Other`];function Je(e){switch(q(e)){case`personal`:return`Personal`;case`system`:return`Built-in`;case`repo`:case`project`:return`Project`;case`app`:return`Plugins`;default:return`Other`}}var Ye=[[`codex`,`Codex`],[`claudeAgent`,`Claude`],[`cursor`,`Cursor`],[`grok`,`Grok`],[`antigravity`,`Antigravity`],[`opencode`,`OpenCode`],[`muse`,`Muse`],[`pi`,`Pi`]],Xe={remote:`Remote servers aren't supported by this provider`,"working-directory":`Servers with a working directory aren't supported here`,provider:`Not supported by this provider yet`};function Ze(e){return Ye.find(([t])=>t===e)?.[1]??e}function Qe(e){switch(e){case`signed-in`:return`Signed in`;case`signed-out`:return`Not signed in`;case`unavailable`:return`Add this server to the provider's own MCP config to sign in.`;case`unknown`:return`Sign-in status unknown`}}function $e(e,t){if(!h(e))return`unavailable`;let n=t.filter(t=>t.driver===e);if(n.some(e=>e.status===`signed-in`))return`signed-in`;if(n.some(e=>e.status===`signed-out`))return`needs-sign-in`}function et(e){return Ye.map(([t,n])=>{let r=f(t,e.transport),i=u.make(t);return{driver:i,label:n,enabled:r.supported&&!e.disabledProviders.includes(i),...r.supported?{}:{unsupported:Xe[r.reason]}}})}var tt={name:``,type:`stdio`,command:``,args:``,cwd:``,url:``,auth:`none`,values:[]};function nt(e){let t=e.transport;return t.type===`stdio`?{...tt,name:e.name,type:`stdio`,command:t.command,args:t.args.join(`
|
|
2
2
|
`),cwd:t.cwd??``,values:Object.entries(t.env).map(([e,t])=>({key:e,value:t}))}:{...tt,name:e.name,type:`http`,url:t.url,auth:t.auth,values:Object.entries(t.headers).map(([e,t])=>({key:e,value:t}))}}var rt=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;function it(e,t){let n=e.name.trim();if(!n)return`Enter a name.`;if(!rt.test(n)||n.length>64)return`Use letters, numbers, dashes, and underscores.`;if(n===`p4-code`)return`That name belongs to P4 Code's own server.`;if(t.has(n))return`Another server already uses that name.`;if(e.type===`stdio`&&!e.command.trim())return`Enter the command that starts it.`;if(e.type===`http`&&!/^https?:\/\/\S+$/i.test(e.url.trim()))return`Enter an http or https URL.`}function at(e,t){let n=Object.fromEntries(e.values.map(e=>[e.key.trim(),e.value]).filter(([e])=>e.length>0)),r=e.type===`stdio`?{type:`stdio`,command:e.command.trim(),args:e.args.split(`
|
|
3
3
|
`).map(e=>e.trim()).filter(e=>e.length>0),env:n,...e.cwd.trim()?{cwd:e.cwd.trim()}:{}}:{type:`http`,url:e.url.trim(),headers:n,auth:e.auth};return{name:e.name.trim(),enabled:t?.enabled??!0,transport:r,disabledProviders:t?.disabledProviders??[],...t?.source===void 0?{}:{source:t.source}}}function ot(e){let t=new Map;for(let n of e){let e=n.displayName??n.driver;for(let r of n.skills){let n=`${r.scope??``}\u0000${r.name}`,i=t.get(n);i===void 0?t.set(n,{skill:r,providers:[e]}):i.providers.includes(e)||i.providers.push(e)}}return[...t.values()].toSorted((e,t)=>st(e.skill).localeCompare(st(t.skill)))}var st=e=>e.displayName??e.name.split(/[-_\s]+/).filter(e=>e.length>0).map(e=>e[0].toUpperCase()+e.slice(1)).join(` `);function ct(e){switch(e){case void 0:return;case`user`:return`Personal`;case`project`:case`repo`:return`Project`;case`system`:return`Built-in`;default:return e[0].toUpperCase()+e.slice(1)}}function lt(e){let t=/^---\r?\n[\s\S]*?\r?\n---\r?\n?/.exec(e);return(t===null?e:e.slice(t[0].length)).trimStart()}function ut(e){let t=(0,Y.c)(14),{title:n,onBack:r,onUninstall:i,children:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(k,{"aria-hidden":!0}),t[0]=o):o=t[0];let s;t[1]===r?s=t[2]:(s=(0,Q.jsxs)(x,{size:`xs`,variant:`ghost`,className:`w-fit`,onClick:r,children:[o,`Back`]}),t[1]=r,t[2]=s);let c;t[3]===n?c=t[4]:(c=(0,Q.jsx)(`h2`,{className:`min-w-0 truncate text-xl font-semibold text-foreground`,children:n}),t[3]=n,t[4]=c);let l;t[5]===i?l=t[6]:(l=i?(0,Q.jsxs)(x,{size:`sm`,variant:`destructive-outline`,onClick:i,children:[(0,Q.jsx)(g,{"aria-hidden":!0}),`Uninstall`]}):null,t[5]=i,t[6]=l);let u;t[7]!==c||t[8]!==l?(u=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[c,l]}),t[7]=c,t[8]=l,t[9]=u):u=t[9];let d;return t[10]!==a||t[11]!==s||t[12]!==u?(d=(0,Q.jsxs)(`div`,{className:`grid gap-6`,children:[s,u,a]}),t[10]=a,t[11]=s,t[12]=u,t[13]=d):d=t[13],d}function $(e){let t=(0,Y.c)(6),{label:n,htmlFor:r,children:i}=e,a;t[0]!==r||t[1]!==n?(a=(0,Q.jsx)(Pe,{htmlFor:r,children:n}),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==a?(o=(0,Q.jsxs)(`div`,{className:`grid gap-2 px-4 py-4`,children:[a,i]}),t[3]=i,t[4]=a,t[5]=o):o=t[5],o}function dt(e){let t=(0,Y.c)(69),{server:n,takenNames:r,onSave:i}=e,a;t[0]===n?a=t[1]:(a=n===void 0?tt:nt(n),t[0]=n,t[1]=a);let o=a,[s,c]=(0,X.useState)(o),l;t[2]===o?l=t[3]:(l=JSON.stringify(o),t[2]=o,t[3]=l);let u=l,[d,f]=(0,X.useState)(u);u!==d&&(f(u),c(o));let p;t[4]!==s||t[5]!==r?(p=it(s,r),t[4]=s,t[5]=r,t[6]=p):p=t[6];let m=p,h;t[7]===s?h=t[8]:(h=JSON.stringify(s),t[7]=s,t[8]=h);let v=h!==u,y;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>c(t=>({...t,...e})),t[9]=y):y=t[9];let b=y,S=s.type===`stdio`?`Environment variables`:`Headers`,C;t[10]===s.values?C=t[11]:(C=(e,t)=>b({values:s.values.map((n,r)=>r===e?{...n,...t}:n)}),t[10]=s.values,t[11]=C);let w=C,T;t[12]!==v||t[13]!==s||t[14]!==i||t[15]!==m||t[16]!==n?(T=e=>{e.preventDefault(),v&&m===void 0&&i(at(s,n))},t[12]=v,t[13]=s,t[14]=i,t[15]=m,t[16]=n,t[17]=T):T=t[17];let E;t[18]===n?E=t[19]:(E=n===void 0?null:(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`To switch between a command and a URL, uninstall the server and add it again.`}),t[18]=n,t[19]=E);let D;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>b({name:e.target.value}),t[20]=D):D=t[20];let O;t[21]===s.name?O=t[22]:(O=(0,Q.jsx)($,{label:`Name`,htmlFor:`mcp-server-name`,children:(0,Q.jsx)(se,{id:`mcp-server-name`,placeholder:`github`,value:s.name,onChange:D})}),t[21]=s.name,t[22]=O);let k;t[23]!==s.type||t[24]!==n?(k=n===void 0?(0,Q.jsx)($,{label:`Type`,children:(0,Q.jsxs)(ae,{"aria-label":`How P4 Code reaches the server`,value:[s.type],onValueChange:e=>{let t=e[0];(t===`stdio`||t===`http`)&&b({type:t,values:[]})},children:[(0,Q.jsx)(oe,{value:`stdio`,children:`Command`}),(0,Q.jsx)(oe,{value:`http`,children:`URL`})]})}):null,t[23]=s.type,t[24]=n,t[25]=k):k=t[25];let A;t[26]!==s.args||t[27]!==s.auth||t[28]!==s.command||t[29]!==s.cwd||t[30]!==s.type||t[31]!==s.url?(A=s.type===`stdio`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)($,{label:`Command`,htmlFor:`mcp-server-command`,children:(0,Q.jsx)(se,{id:`mcp-server-command`,placeholder:`npx`,value:s.command,onChange:e=>b({command:e.target.value})})}),(0,Q.jsx)($,{label:`Arguments, one per line`,htmlFor:`mcp-server-args`,children:(0,Q.jsx)(ie,{id:`mcp-server-args`,placeholder:`-y
|
|
4
4
|
@modelcontextprotocol/server-postgres`,value:s.args,onChange:e=>b({args:e.target.value})})}),(0,Q.jsx)($,{label:`Working directory (optional)`,htmlFor:`mcp-server-cwd`,children:(0,Q.jsx)(se,{id:`mcp-server-cwd`,placeholder:`The session's project folder`,value:s.cwd,onChange:e=>b({cwd:e.target.value})})})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)($,{label:`URL`,htmlFor:`mcp-server-url`,children:(0,Q.jsx)(se,{id:`mcp-server-url`,placeholder:`https://mcp.example.com/mcp`,value:s.url,onChange:e=>b({url:e.target.value})})}),(0,Q.jsx)($,{label:`Authentication`,children:(0,Q.jsxs)(V,{value:s.auth,onValueChange:e=>{(e===`none`||e===`oauth`)&&b({auth:e})},children:[(0,Q.jsx)(B,{"aria-label":`Authentication`,children:(0,Q.jsx)(R,{children:ft})}),(0,Q.jsxs)(z,{alignItemWithTrigger:!1,children:[(0,Q.jsx)(L,{value:`none`,children:`None or headers`}),(0,Q.jsx)(L,{value:`oauth`,children:`OAuth (sign in after saving)`})]})]})})]}),t[26]=s.args,t[27]=s.auth,t[28]=s.command,t[29]=s.cwd,t[30]=s.type,t[31]=s.url,t[32]=A):A=t[32];let j;t[33]!==s.type||t[34]!==s.values||t[35]!==w||t[36]!==S?(j=s.values.map((e,t)=>(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(se,{"aria-label":`${S} name`,placeholder:s.type===`stdio`?`API_TOKEN`:`Authorization`,value:e.key,onChange:e=>w(t,{key:e.target.value})}),(0,Q.jsx)(Ie,{"aria-label":`${S} value`,placeholder:`Value`,value:e.value,onChange:e=>w(t,{value:e.target.value})}),(0,Q.jsx)(x,{size:`icon-sm`,variant:`ghost`,"aria-label":`Remove ${e.key||`row`}`,onClick:()=>b({values:s.values.filter((e,n)=>n!==t)}),children:(0,Q.jsx)(g,{"aria-hidden":!0})})]},t)),t[33]=s.type,t[34]=s.values,t[35]=w,t[36]=S,t[37]=j):j=t[37];let M;t[38]===s.values?M=t[39]:(M=()=>b({values:[...s.values,{key:``,value:``}]}),t[38]=s.values,t[39]=M);let N;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsx)(_,{"aria-hidden":!0}),t[40]=N):N=t[40];let P=s.type===`stdio`?`variable`:`header`,F;t[41]!==M||t[42]!==P?(F=(0,Q.jsxs)(x,{variant:`soft`,onClick:M,children:[N,`Add `,P]}),t[41]=M,t[42]=P,t[43]=F):F=t[43];let I;t[44]!==j||t[45]!==F?(I=(0,Q.jsxs)(`div`,{className:`grid gap-2`,children:[j,F]}),t[44]=j,t[45]=F,t[46]=I):I=t[46];let H;t[47]!==I||t[48]!==S?(H=(0,Q.jsx)($,{label:S,children:I}),t[47]=I,t[48]=S,t[49]=H):H=t[49];let U;t[50]!==O||t[51]!==k||t[52]!==A||t[53]!==H?(U=(0,Q.jsxs)(xe,{children:[O,k,A,H]}),t[50]=O,t[51]=k,t[52]=A,t[53]=H,t[54]=U):U=t[54];let W;t[55]!==v||t[56]!==m?(W=v&&m!==void 0?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-foreground`,children:m}):null,t[55]=v,t[56]=m,t[57]=W):W=t[57];let G=!v||m!==void 0,K=n===void 0?`Add server`:`Save`,q;t[58]!==G||t[59]!==K?(q=(0,Q.jsx)(x,{type:`submit`,disabled:G,children:K}),t[58]=G,t[59]=K,t[60]=q):q=t[60];let ee;t[61]!==W||t[62]!==q?(ee=(0,Q.jsxs)(`div`,{className:`flex items-center justify-end gap-3`,children:[W,q]}),t[61]=W,t[62]=q,t[63]=ee):ee=t[63];let J;return t[64]!==U||t[65]!==ee||t[66]!==T||t[67]!==E?(J=(0,Q.jsxs)(`form`,{className:`grid gap-3`,onSubmit:T,children:[E,U,ee]}),t[64]=U,t[65]=ee,t[66]=T,t[67]=E,t[68]=J):J=t[68],J}function ft(e){return e===`oauth`?`OAuth (sign in after saving)`:`None or headers`}function pt(e){let t=(0,Y.c)(55),{environmentId:n,plugin:r,environmentLabel:i,onSave:a}=e,o=r?.path??``,s=r===void 0?null:`.claude-plugin/plugin.json`,c;t[0]!==n||t[1]!==o||t[2]!==s?(c=ye(n,o,s),t[0]=n,t[1]=o,t[2]=s,t[3]=c):c=t[3];let l=b(m(M(c))),u=We(r!==void 0&&l!==null&&!l.truncated?l.contents:null),d;t[4]===r?.options?d=t[5]:(d=r?.options??{},t[4]=r?.options,t[5]=d);let f=d,p=[...u,...Object.keys(f).filter(e=>!u.some(t=>t.key===e)).map(ht)],[h,g]=(0,X.useState)(r?.name??``),[_,v]=(0,X.useState)(r?.path??``),[y,S]=(0,X.useState)(f),C;t[6]!==r?.name||t[7]!==r?.path||t[8]!==f?(C=JSON.stringify([r?.name??``,r?.path??``,f]),t[6]=r?.name,t[7]=r?.path,t[8]=f,t[9]=C):C=t[9];let w=C,[T,E]=(0,X.useState)(w);w!==T&&(E(w),g(r?.name??``),v(r?.path??``),S(f));let D,O;t[10]!==h||t[11]!==y||t[12]!==_||t[13]!==r?.name||t[14]!==r?.path||t[15]!==f?(D=Object.fromEntries(Object.entries(y).filter(mt)),O=h!==(r?.name??``)||_!==(r?.path??``)||JSON.stringify(D)!==JSON.stringify(f),t[10]=h,t[11]=y,t[12]=_,t[13]=r?.name,t[14]=r?.path,t[15]=f,t[16]=D,t[17]=O):(D=t[16],O=t[17]);let k=O,A;t[18]!==h||t[19]!==_?(A=h.trim().length>0&&_.trim().startsWith(`/`),t[18]=h,t[19]=_,t[20]=A):A=t[20];let j=A,N;t[21]!==k||t[22]!==h||t[23]!==D||t[24]!==a||t[25]!==_||t[26]!==r?.enabled||t[27]!==j?(N=e=>{e.preventDefault(),k&&j&&a({name:h.trim(),path:_.trim(),enabled:r?.enabled??!0,options:D})},t[21]=k,t[22]=h,t[23]=D,t[24]=a,t[25]=_,t[26]=r?.enabled,t[27]=j,t[28]=N):N=t[28];let P;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>g(e.target.value),t[29]=P):P=t[29];let F;t[30]===h?F=t[31]:(F=(0,Q.jsx)($,{label:`Name`,htmlFor:`plugin-name`,children:(0,Q.jsx)(se,{id:`plugin-name`,value:h,onChange:P})}),t[30]=h,t[31]=F);let I=`Folder on ${i}`,L;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>v(e.target.value),t[32]=L):L=t[32];let R;t[33]===_?R=t[34]:(R=(0,Q.jsx)(se,{id:`plugin-path`,placeholder:`/Users/me/plugins/my-plugin`,value:_,onChange:L}),t[33]=_,t[34]=R);let z;t[35]!==I||t[36]!==R?(z=(0,Q.jsx)($,{label:I,htmlFor:`plugin-path`,children:R}),t[35]=I,t[36]=R,t[37]=z):z=t[37];let B=p.map(e=>(0,Q.jsx)($,{label:e.required?e.title:`${e.title} (optional)`,htmlFor:`plugin-option-${e.key}`,children:(0,Q.jsx)(Ie,{id:`plugin-option-${e.key}`,placeholder:`description`in e?e.description:void 0,value:y[e.key]??``,onChange:t=>S(n=>({...n,[e.key]:t.target.value}))})},e.key)),V;t[38]!==F||t[39]!==z||t[40]!==B?(V=(0,Q.jsxs)(xe,{children:[F,z,B]}),t[38]=F,t[39]=z,t[40]=B,t[41]=V):V=t[41];let H;t[42]!==k||t[43]!==j?(H=k&&!j?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-foreground`,children:`Enter a name and the plugin folder's full path.`}):null,t[42]=k,t[43]=j,t[44]=H):H=t[44];let U=!k||!j,W=r===void 0?`Add plugin`:`Save`,G;t[45]!==U||t[46]!==W?(G=(0,Q.jsx)(x,{type:`submit`,disabled:U,children:W}),t[45]=U,t[46]=W,t[47]=G):G=t[47];let K;t[48]!==H||t[49]!==G?(K=(0,Q.jsxs)(`div`,{className:`flex items-center justify-end gap-3`,children:[H,G]}),t[48]=H,t[49]=G,t[50]=K):K=t[50];let q;return t[51]!==V||t[52]!==K||t[53]!==N?(q=(0,Q.jsxs)(`form`,{className:`grid gap-3`,onSubmit:N,children:[V,K]}),t[51]=V,t[52]=K,t[53]=N,t[54]=q):q=t[54],q}function mt(e){let[,t]=e;return t}function ht(e){return{key:e,title:e,required:!1}}var gt=e=>e.replace(/[\\/][^\\/]*$/,``)||`/`;function _t(e){let t=(0,Y.c)(69),{entry:n,environmentId:r,onClose:a}=e,{skill:o,providers:s}=n,l,u,d;t[0]!==r||t[1]!==o.path?(l=gt(o.path),u=M,d=ye(r,l,o.path),t[0]=r,t[1]=o.path,t[2]=l,t[3]=u,t[4]=d):(l=t[2],u=t[3],d=t[4]);let f=u(d),p;t[5]===f?p=t[6]:(p=b(m(f)),t[5]=f,t[6]=p);let h=p,g=ee(r),{copyToClipboard:_}=U(),y;t[7]!==r||t[8]!==o.path?(y={environmentId:r,filePath:o.path,workspaceRoot:void 0},t[7]=r,t[8]=o.path,t[9]=y):y=t[9];let S=y,C=o.shortDescription??o.description,w;t[10]===o.scope?w=t[11]:(w=ct(o.scope),t[10]=o.scope,t[11]=w);let T=w,E;t[12]===a?E=t[13]:(E=e=>!e&&a(),t[12]=a,t[13]=E);let D;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`flex size-12 shrink-0 items-center justify-center rounded-full border border-border/60 text-muted-foreground`,children:(0,Q.jsx)(F,{className:`size-5`})}),t[14]=D):D=t[14];let O;t[15]===o?O=t[16]:(O=st(o),t[15]=o,t[16]=O);let k=`More for ${O}`,A;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsx)(c,{"aria-hidden":!0}),t[17]=A):A=t[17];let N;t[18]===k?N=t[19]:(N=(0,Q.jsx)(P,{render:(0,Q.jsx)(x,{size:`icon-sm`,variant:`ghost`,"aria-label":k,children:A})}),t[18]=k,t[19]=N);let L;t[20]!==g||t[21]!==S?(L=g.capabilities.canOpenDefault?(0,Q.jsx)(i,{onClick:()=>void g.activate(`open`,S),children:`Open`}):null,t[20]=g,t[21]=S,t[22]=L):L=t[22];let R;t[23]!==g||t[24]!==S?(R=g.capabilities.revealLabel?(0,Q.jsx)(i,{onClick:()=>void g.activate(`reveal-in-folder`,S),children:g.capabilities.revealLabel}):null,t[23]=g,t[24]=S,t[25]=R):R=t[25];let z=h===null,B;t[26]!==_||t[27]!==h?(B=()=>h&&_(h.contents,void 0),t[26]=_,t[27]=h,t[28]=B):B=t[28];let V;t[29]!==z||t[30]!==B?(V=(0,Q.jsx)(i,{disabled:z,onClick:B,children:`Copy Markdown`}),t[29]=z,t[30]=B,t[31]=V):V=t[31];let H;t[32]!==L||t[33]!==R||t[34]!==V?(H=(0,Q.jsxs)(j,{align:`end`,children:[L,R,V]}),t[32]=L,t[33]=R,t[34]=V,t[35]=H):H=t[35];let W;t[36]!==N||t[37]!==H?(W=(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3 pe-8`,children:[D,(0,Q.jsxs)(v,{children:[N,H]})]}),t[36]=N,t[37]=H,t[38]=W):W=t[38];let G;t[39]===o?G=t[40]:(G=st(o),t[39]=o,t[40]=G);let K;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Q.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`Skill`}),t[41]=K):K=t[41];let q;t[42]===G?q=t[43]:(q=(0,Q.jsxs)(ce,{children:[G,` `,K]}),t[42]=G,t[43]=q);let J;t[44]===C?J=t[45]:(J=C?(0,Q.jsx)(le,{children:C}):null,t[44]=C,t[45]=J);let te;t[46]!==q||t[47]!==J?(te=(0,Q.jsxs)(`div`,{className:`grid gap-1.5`,children:[q,J]}),t[46]=q,t[47]=J,t[48]=te):te=t[48];let ne;t[49]!==l||t[50]!==r||t[51]!==h||t[52]!==f?(ne=(0,Q.jsx)(`div`,{className:`max-h-[50vh] min-h-24 overflow-y-auto rounded-xl border border-border/60 bg-card/40 px-5 py-4`,children:h===null?f._tag===`Failure`?(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This skill's file could not be read. It may have moved since the provider last scanned it.`}):(0,Q.jsxs)(`div`,{className:`grid gap-2`,children:[(0,Q.jsx)(re,{className:`h-4 w-3/4`}),(0,Q.jsx)(re,{className:`h-4 w-full`}),(0,Q.jsx)(re,{className:`h-4 w-2/3`})]}):(0,Q.jsx)(I,{text:lt(h.contents),cwd:l,environmentId:r})}),t[49]=l,t[50]=r,t[51]=h,t[52]=f,t[53]=ne):ne=t[53];let ie;t[54]===s?ie=t[55]:(ie=s.join(`, `),t[54]=s,t[55]=ie);let ae=`Loaded by ${ie}`,oe;t[56]!==T||t[57]!==ae?(oe=[T,ae].filter(Boolean),t[56]=T,t[57]=ae,t[58]=oe):oe=t[58];let se=oe.join(` · `),fe;t[59]===se?fe=t[60]:(fe=(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:se}),t[59]=se,t[60]=fe);let pe;t[61]!==W||t[62]!==te||t[63]!==ne||t[64]!==fe?(pe=(0,Q.jsx)(ue,{className:`max-w-2xl`,children:(0,Q.jsxs)(`div`,{className:`grid min-h-0 gap-4 p-6`,children:[W,te,ne,fe]})}),t[61]=W,t[62]=te,t[63]=ne,t[64]=fe,t[65]=pe):pe=t[65];let me;return t[66]!==pe||t[67]!==E?(me=(0,Q.jsx)(de,{open:!0,onOpenChange:E,children:pe}),t[66]=pe,t[67]=E,t[68]=me):me=t[68],me}var vt={claude:`Claude`,codex:`Codex`,cursor:`Cursor`},yt={success:`bg-success`,warning:`bg-warning`,error:`bg-destructive`,muted:`bg-muted-foreground/40`},bt={success:`text-success-foreground`,warning:`text-warning-foreground`,error:`text-destructive-foreground`,muted:`text-muted-foreground`},xt=s(T);function St(e){let t=O(e);return xt(t)&&t.reason===`rejected`?`This server only lets apps it has approved sign in, and it refused P4 Code. Sign in with a provider below instead.`:`Sign-in could not start. Check the server URL, then try again.`}function Ct(e,t,n){return e.transport.type===`http`&&(e.transport.auth===`oauth`||n?.auth===`signed-in`||t.needsSignIn)}function wt(e){let t=(0,Y.c)(13),{status:n,className:r}=e,i=bt[n.tone],a;t[0]!==r||t[1]!==i?(a=A(`flex min-w-0 items-center gap-1.5 text-xs`,i,r),t[0]=r,t[1]=i,t[2]=a):a=t[2];let o=yt[n.tone],s;t[3]===o?s=t[4]:(s=A(`size-1.5 shrink-0 rounded-full`,o),t[3]=o,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,Q.jsx)(`span`,{"aria-hidden":!0,className:s}),t[5]=s,t[6]=c);let l;t[7]===n.label?l=t[8]:(l=(0,Q.jsx)(`span`,{className:`truncate`,children:n.label}),t[7]=n.label,t[8]=l);let u;return t[9]!==a||t[10]!==c||t[11]!==l?(u=(0,Q.jsxs)(`span`,{className:a,children:[c,l]}),t[9]=a,t[10]=c,t[11]=l,t[12]=u):u=t[12],u}function Tt(){let e=(0,Y.c)(6),{environment:t,scope:n}=Se(),r=t?.connection.phase===`connected`&&t.serverConfig!==null,i=r?t.environmentId:null,a=r&&t.serverConfig?.environment.capabilities.mcpRegistry===!0,o;return e[0]!==r||e[1]!==t||e[2]!==i||e[3]!==n||e[4]!==a?(o=(0,Q.jsx)(we,{width:`wide`,children:t===null||!r?(0,Q.jsx)(he,{children:(0,Q.jsxs)(fe,{children:[(0,Q.jsx)(pe,{children:`Connect to manage plugins and MCP servers`}),(0,Q.jsx)(me,{children:`They live on each environment. Choose a connected one above.`})]})}):!a||i===null?(0,Q.jsx)(he,{children:(0,Q.jsxs)(fe,{children:[(0,Q.jsxs)(pe,{children:[`Update `,t.label,` to manage plugins and MCP servers`]}),(0,Q.jsx)(me,{children:`This environment runs a version without them.`})]})}):(0,Q.jsx)(kt,{environmentId:i,environmentLabel:t.label,projectId:n.kind===`checkout`?n.checkout.id:n.kind===`project`?n.members.find(e=>e.environmentId===i)?.id:void 0,projectLabel:n.kind===`project`||n.kind===`checkout`?n.label:void 0},i)}),e[0]=r,e[1]=t,e[2]=i,e[3]=n,e[4]=a,e[5]=o):o=e[5],o}var Et={plugins:`Search plugins`,mcps:`Search MCP servers`,skills:`Search skills`},Dt=(e,...t)=>e===``||t.some(t=>t.toLowerCase().includes(e));function Ot(e){let t=(0,Y.c)(9),{text:n}=e,r=(0,X.useRef)(null),[i,a]=(0,X.useState)(!1),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{let t=r.current;a(e&&t!==null&&t.scrollWidth>t.clientWidth)},t[0]=o):o=t[0];let s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsx)(`span`,{ref:r,tabIndex:0,className:`block truncate text-xs text-muted-foreground`}),t[1]=s):s=t[1];let c,l;t[2]===n?(c=t[3],l=t[4]):(c=(0,Q.jsx)(J,{render:s,children:n}),l=(0,Q.jsx)(te,{children:n}),t[2]=n,t[3]=c,t[4]=l);let u;return t[5]!==i||t[6]!==c||t[7]!==l?(u=(0,Q.jsxs)(ne,{open:i,onOpenChange:o,children:[c,l]}),t[5]=i,t[6]=c,t[7]=l,t[8]=u):u=t[8],u}function kt({environmentId:e,environmentLabel:t,projectId:n,projectLabel:r}){let s=H({select:e=>e.hash}),[u,d]=(0,X.useState)(()=>s.replace(/^#/,``)===`mcp-servers`?`mcps`:s.replace(/^#/,``)===`skills`?`skills`:`plugins`),[f,m]=(0,X.useState)(``),[h,g]=(0,X.useState)(`All categories`),_=M(G.configValueAtom(e))?.providers,b=(0,X.useMemo)(()=>ot(_??[]),[_]),[T,O]=(0,X.useState)(null),k=be(e=>e.mcpServers),A=be(e=>e.plugins),I=be(e=>e.projectSettingsOverrides),U=be(e=>e.skillOverrides),q=ee(e),re=M(G.updateSettings.permissionAtom(e)),[ie,se]=(0,X.useState)(null),ce=M(G.mcpRegistryTest.permissionAtom(e)),le=W(e),ue=K(G.updateSettings,{label:`update MCP registry`,reportFailure:!0}),de=K(G.mcpRegistryState,{reportFailure:!1}),fe=K(G.mcpRegistryTest,{label:`check MCP server`,reportFailure:!0}),pe=K(G.mcpRegistryOAuthStart,{label:`start MCP sign-in`,reportFailure:!0}),me=K(G.mcpRegistryOAuthSignOut,{label:`sign out of MCP server`,reportFailure:!0}),he=K(G.mcpRegistryDiscover,{reportFailure:!1}),ye=K(G.mcpRegistryImport,{label:`import MCP servers`,reportFailure:!0}),[xe,Se]=(0,X.useState)({}),[Ce,we]=(0,X.useState)(new Set),[Pe,Ie]=(0,X.useState)([]),[Y,Le]=(0,X.useState)({kind:`list`}),Z=Y.kind!==`list`&&Y.id!==null&&(Y.kind===`server`?k[Y.id]===void 0:A[Y.id]===void 0)?{kind:`list`}:Y,[Be,Ve]=(0,X.useState)(s);if(s!==Be){Ve(s);let e=s.replace(/^#/,``);(e===`mcp-servers`||e===`plugins`||e===`skills`)&&(d(e===`mcp-servers`?`mcps`:e),Le({kind:`list`}))}let[He,Ue]=(0,X.useState)(null),We=(0,X.useRef)(new Map),[Ge,Ye]=(0,X.useState)(null),[Xe,Ze]=(0,X.useState)({}),Qe=(0,X.useMemo)(()=>Object.entries(k).map(([e,t])=>[o.make(e),t]).toSorted(([,e],[,t])=>e.name.localeCompare(t.name)),[k]),$e=(0,X.useMemo)(()=>Object.entries(A).map(([e,t])=>[C.make(e),t]),[A]),et=(0,X.useCallback)(async()=>{let t=await de({environmentId:e,input:{}});t._tag===`Success`&&Se(t.value.servers)},[e,de]),tt=(0,X.useCallback)(async()=>{if(!ce)return;let t=await he({environmentId:e,input:n===void 0?{}:{projectId:n}});t._tag===`Success`&&Ie(t.value.servers)},[ce,he,e,n]);(0,X.useEffect)(()=>{et(),tt()},[et,tt]);let nt=e=>{d(`mcps`),Le({kind:`server`,id:e})},rt=e=>{d(`plugins`),Le({kind:`plugin`,id:e})},it=t=>ue({environmentId:e,input:{patch:t}}),at=async t=>{we(e=>new Set(e).add(t));let n=await fe({environmentId:e,input:{serverId:t}});if(we(e=>{let n=new Set(e);return n.delete(t),n}),n._tag===`Success`)return Se(e=>({...e,[t]:n.value})),n.value},ct=(0,X.useEffectEvent)(async e=>{(await at(e))?.health.status===`connected`&&Ye(null)});(0,X.useEffect)(()=>{if(Ge===null)return;let e=()=>void ct(Ge);return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[Ge]);let lt=async(e,t,n)=>{(await it({mcpServers:{[e]:t}}))._tag===`Success`&&(n&&Le({kind:`list`}),tt(),t.enabled&&await at(e))},$=async(t,n=!1)=>{let r=We.current.get(t);if(!n&&Ge===t&&r){window.open(r,`_blank`,`noopener,noreferrer`);return}let i=le??window.location.origin;Ze(e=>{let n={...e};return delete n[t],n});let a=await pe({environmentId:e,input:{serverId:t,origin:new URL(i,window.location.href).origin,...n?{reauthenticate:n}:{}}});a._tag===`Success`?a.value.authorizationUrl===null?await at(t):(We.current.set(t,a.value.authorizationUrl),Ye(t),window.open(a.value.authorizationUrl,`_blank`,`noopener,noreferrer`)):a._tag===`Failure`&&Ze(e=>({...e,[t]:St(a.cause)}))},ft=async t=>{let n=await me({environmentId:e,input:{serverId:t}});n._tag===`Success`&&Se(e=>({...e,[t]:n.value}))},mt=(e,t,r)=>{if(n===void 0)return;let i=I[n]??{},a={...i[e]};r===void 0?delete a[t]:a[t]={enabled:r},it({projectSettingsOverrides:{[n]:{...i,[e]:a}}})},ht=async()=>{let t=He;if(Ue(null),t!==null){if(t.kind===`server`){let n=k[t.id];n?.transport.type===`http`&&n.transport.auth===`oauth`&&await me({environmentId:e,input:{serverId:t.id}}),await it({mcpServers:{[t.id]:null}})}else await it({plugins:{[t.id]:null}});Le({kind:`list`})}},gt=Pe.filter(e=>!e.alreadyAdded),yt=new Set(Qe.filter(([e])=>Z.kind!==`server`||e!==Z.id).map(([,e])=>e.name)),bt=f.trim().toLowerCase(),xt=Qe.filter(([,e])=>Dt(bt,e.name,ze(e))),Tt=$e.filter(([,e])=>Dt(bt,e.name,e.path)),kt=gt.filter(e=>Dt(bt,e.name,e.summary)),At=(e,t)=>p({mcpServers:k,plugins:A,projectSettingsOverrides:I},e,n??null,t),Mt=(e,t,r)=>{n===void 0?it(e===`mcpServers`?{mcpServers:{[t]:{...k[t],enabled:r}}}:{plugins:{[t]:{...A[t],enabled:r}}}):mt(e,t,r)},Nt=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,Q.jsxs)(`div`,{className:`grid gap-1`,children:[(0,Q.jsx)(`h1`,{className:`text-2xl font-semibold text-foreground`,children:`Plugins`}),(0,Q.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Manage plugins, skills, and MCP servers given to agents on `,t,`.`]})]}),ce?(0,Q.jsxs)(v,{children:[(0,Q.jsx)(P,{render:(0,Q.jsxs)(x,{children:[`Add`,(0,Q.jsx)(w,{"aria-hidden":!0})]})}),(0,Q.jsxs)(j,{align:`end`,children:[(0,Q.jsxs)(i,{onClick:()=>nt(null),children:[(0,Q.jsx)(y,{"aria-hidden":!0}),`Add MCP server`]}),(0,Q.jsxs)(i,{onClick:()=>rt(null),children:[(0,Q.jsx)(a,{"aria-hidden":!0}),`Add plugin`]})]})]}):null]}),Pt=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Q.jsxs)(ae,{"aria-label":`Show`,variant:`default`,value:[u],onValueChange:e=>{let t=e[0];(t===`plugins`||t===`mcps`||t===`skills`)&&(d(t),Le({kind:`list`}))},children:[(0,Q.jsxs)(oe,{value:`plugins`,...Fe(`plugins`),children:[`Plugins `,(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:$e.length})]}),(0,Q.jsxs)(oe,{value:`mcps`,...Fe(`mcp-servers`),children:[`MCPs `,(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:Qe.length})]}),(0,Q.jsxs)(oe,{value:`skills`,...Fe(`skills`),children:[`Skills `,(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:b.length})]})]}),(0,Q.jsxs)(`div`,{className:`flex w-full gap-2 sm:w-auto`,children:[u===`skills`?(0,Q.jsx)(`div`,{className:`w-fit shrink-0`,children:(0,Q.jsxs)(V,{value:h,onValueChange:e=>e&&g(e),children:[(0,Q.jsx)(B,{"aria-label":`Skill category`,children:(0,Q.jsx)(R,{})}),(0,Q.jsxs)(z,{children:[(0,Q.jsx)(L,{value:`All categories`,children:`All categories`}),qe.filter(e=>e===`Personal`||e===`Built-in`||b.some(({skill:t})=>Je(t)===e)).map(e=>(0,Q.jsx)(L,{value:e,children:e},e))]})]})}):null,(0,Q.jsxs)(ve,{className:`min-w-0 flex-1 sm:w-56`,children:[(0,Q.jsx)(ge,{children:(0,Q.jsx)(N,{"aria-hidden":!0})}),(0,Q.jsx)(_e,{"aria-label":Et[u],placeholder:Et[u],value:f,onChange:e=>m(e.currentTarget.value)})]})]})]}),Ft=(e,t)=>(0,Q.jsxs)(ne,{children:[(0,Q.jsx)(J,{render:(0,Q.jsx)(x,{size:`icon-sm`,variant:`ghost`,"aria-label":e,onClick:t,children:(0,Q.jsx)(D,{"aria-hidden":!0})})}),(0,Q.jsx)(te,{children:e})]}),It=Tt.length===0?(0,Q.jsx)(`p`,{className:`py-6 text-sm text-muted-foreground`,children:$e.length===0?`No plugins yet. Add a Claude Code or Codex plugin folder to give its tools to your agents.`:`No plugins match your search.`}):(0,Q.jsx)(`ul`,{className:`grid gap-1`,children:Tt.map(([t,n])=>(0,Q.jsx)(Ke,{environmentId:e,plugin:n,enabled:At(`plugins`,t),disabled:!re,onDetails:()=>rt(t),onToggle:e=>Mt(`plugins`,t,e)},t))}),Lt=b.filter(({skill:e})=>(h===`All categories`||Je(e)===h)&&Dt(bt,st(e),e.name,e.shortDescription??``,e.description??``)),Rt=Lt.length===0?(0,Q.jsx)(`p`,{className:`py-6 text-sm text-muted-foreground`,children:b.length===0?`No skills found. Providers report the skills they load when they start.`:`No skills match these filters.`}):(0,Q.jsxs)(`div`,{className:`grid gap-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Switches apply to new Claude and OpenCode sessions.`}),(0,Q.jsx)(`ul`,{className:`grid gap-1`,children:Lt.map(t=>{let r=Je(t.skill),a=(_??[]).filter(e=>l(e.driver)&&e.skills.some(e=>e.name===t.skill.name)),o=a.length?a.map(e=>e.displayName??e.driver).join(`, `):`Native settings`;return(0,Q.jsxs)(`li`,{className:`flex items-center gap-3 py-3`,children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`flex size-10 shrink-0 items-center justify-center rounded-full border border-border/60 text-muted-foreground`,children:(0,Q.jsx)(F,{className:`size-4`})}),(0,Q.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-1`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:()=>O(t),className:`w-fit break-words text-left text-sm font-medium outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:st(t.skill)}),(0,Q.jsx)(Ot,{text:t.skill.shortDescription??t.skill.description??t.skill.path}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:[r,o].filter(Boolean).join(` · `)})]}),(0,Q.jsxs)(v,{children:[(0,Q.jsxs)(ne,{children:[(0,Q.jsx)(J,{render:(0,Q.jsx)(P,{render:(0,Q.jsx)(x,{variant:`ghost`,size:`icon-sm`,"aria-label":`More for ${st(t.skill)}`,children:(0,Q.jsx)(c,{"aria-hidden":!0})})})}),(0,Q.jsx)(te,{children:`Skill actions`})]}),(0,Q.jsxs)(j,{align:`end`,children:[q.capabilities.canOpenDefault?(0,Q.jsx)(i,{onClick:()=>void q.activate(`open`,{environmentId:e,filePath:t.skill.path,workspaceRoot:void 0}),children:`Open`}):null,(0,Q.jsx)(i,{onClick:()=>O(t),children:`Details`}),n!==void 0&&I[n]?.skillOverrides?.[t.skill.name]!==void 0?(0,Q.jsx)(i,{onClick:()=>{let e=I[n]??{},r={...e.skillOverrides};delete r[t.skill.name],it({projectSettingsOverrides:{[n]:{...e,skillOverrides:r}}})},children:`Use environment setting`}):null]})]}),(0,Q.jsx)(Me,{"aria-label":`Enable ${st(t.skill)} for ${o}`,checked:(n===void 0?void 0:I[n]?.skillOverrides?.[t.skill.name])??U[t.skill.name]??t.skill.enabled,disabled:!re||ie!==null||a.length===0,onCheckedChange:e=>{se(t.skill.name),it(n===void 0?{skillOverrides:{[t.skill.name]:e}}:{projectSettingsOverrides:{[n]:{...I[n],skillOverrides:{...I[n]?.skillOverrides,[t.skill.name]:e}}}}).finally(()=>se(null))}})]},t.skill.path)})})]}),Bt=(0,Q.jsxs)(`div`,{className:`grid gap-6`,children:[Qe.length>0?(0,Q.jsx)(Te,{title:`Servers`,children:xt.length===0?(0,Q.jsx)(`p`,{className:`px-3 text-sm text-muted-foreground sm:px-4`,children:`No MCP servers match your search.`}):(0,Q.jsx)(Q.Fragment,{children:xt.map(([e,t])=>{let n=At(`mcpServers`,e),r=Re({...t,enabled:n},xe[e],Ce.has(e)),a=Xe[e],o=Ct(t,r,xe[e]);return(0,Q.jsxs)(`div`,{className:`flex min-h-14 items-center gap-3 px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-0.5`,children:[(0,Q.jsx)(`span`,{className:`break-words text-sm font-medium text-foreground`,children:t.name}),r.tone===`error`||o?(0,Q.jsx)(wt,{status:r}):null,a?(0,Q.jsx)(`span`,{className:`text-xs text-destructive-foreground`,children:a}):null]}),r.needsSignIn&&ce?(0,Q.jsx)(x,{size:`xs`,variant:`outline`,onClick:()=>void $(e),children:`Authenticate`}):null,o&&!r.needsSignIn&&ce?(0,Q.jsxs)(v,{children:[(0,Q.jsxs)(ne,{children:[(0,Q.jsx)(J,{render:(0,Q.jsx)(P,{render:(0,Q.jsx)(x,{variant:`ghost`,size:`icon-sm`,"aria-label":`More for ${t.name}`,children:(0,Q.jsx)(c,{"aria-hidden":!0})})})}),(0,Q.jsx)(te,{children:`Sign-in actions`})]}),(0,Q.jsxs)(j,{align:`end`,children:[(0,Q.jsx)(i,{onClick:()=>void $(e,!0),children:`Re-authenticate`}),xe[e]?.auth===`signed-in`?(0,Q.jsx)(i,{onClick:()=>void ft(e),children:`Sign out`}):null]})]}):null,Ft(`Settings for ${t.name}`,()=>nt(e)),(0,Q.jsx)(Me,{"aria-label":`Give ${t.name} to agents`,checked:n,disabled:!ce,onCheckedChange:t=>Mt(`mcpServers`,e,t)})]},e)})})}):null,ce&&kt.length>0?(0,Q.jsx)(Te,{title:`Found in provider configs`,headerAction:(0,Q.jsx)(x,{size:`icon-xs`,variant:`ghost`,"aria-label":`Look again`,onClick:()=>void tt(),children:(0,Q.jsx)(S,{"aria-hidden":!0})}),children:(0,Q.jsx)(Q.Fragment,{children:kt.map(t=>(0,Q.jsxs)(`div`,{className:`flex min-h-14 items-center gap-3 px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-0.5`,children:[(0,Q.jsx)(`span`,{className:`break-words text-sm font-medium text-foreground`,children:t.name}),kt.filter(e=>e.name===t.name).length>1?(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:(t.providers??[t.provider]).map(e=>vt[e]).join(`, `)}):null]}),(0,Q.jsx)(x,{size:`xs`,variant:`outline`,onClick:async()=>{(await ye({environmentId:e,input:{...n===void 0?{}:{projectId:n},servers:[{provider:t.provider,path:t.path,name:t.name}]}}))._tag===`Success`&&(tt(),et())},children:`Import`})]},`${t.provider}:${t.path}:${t.name}`))})}):null]}),Vt=Z.kind===`server`?(0,Q.jsxs)(ut,{title:Z.id===null?`Add MCP server`:`Update ${k[Z.id]?.name??`server`} MCP`,onBack:()=>Le({kind:`list`}),onUninstall:Z.id!==null&&ce?()=>Ue({kind:`server`,id:Z.id}):void 0,children:[(0,Q.jsx)(dt,{server:Z.id===null?void 0:k[Z.id],takenNames:yt,onSave:e=>void lt(Z.id??o.make(E()),e,Z.id===null)},Z.id??`new`),Z.id!==null&&k[Z.id]!==void 0?(0,Q.jsx)(jt,{environmentId:e,id:Z.id,server:k[Z.id],runtime:xe[Z.id],checking:Ce.has(Z.id),canManage:ce,projectLabel:r,projectOverride:n===void 0?void 0:I[n]?.mcpServers?.[Z.id],awaitingSignIn:Ge===Z.id,onProviderToggle:(e,t)=>{let n=k[Z.id],r=t?n.disabledProviders.filter(t=>t!==e):[...n.disabledProviders,e];it({mcpServers:{[Z.id]:{...n,disabledProviders:r}}})},onProjectOverride:n===void 0?void 0:e=>mt(`mcpServers`,Z.id,e),signInError:Xe[Z.id],onTest:()=>void at(Z.id),onSignIn:()=>void $(Z.id),onReauthenticate:()=>void $(Z.id,!0),onSignOut:()=>void ft(Z.id)},`${e}:${Z.id}`):null]}):null,Ht=Z.kind===`plugin`?(0,Q.jsxs)(ut,{title:Z.id===null?`Add plugin`:`Update ${A[Z.id]?.name??`plugin`}`,onBack:()=>Le({kind:`list`}),onUninstall:Z.id!==null&&ce?()=>Ue({kind:`plugin`,id:Z.id}):void 0,children:[(0,Q.jsx)(pt,{environmentId:e,plugin:Z.id===null?void 0:A[Z.id],environmentLabel:t,onSave:async e=>{let t=Z.id??C.make(E());(await it({plugins:{[t]:e}}))._tag===`Success`&&Z.id===null&&Le({kind:`list`})}},Z.id??`new`),Z.id!==null&&A[Z.id]!==void 0?(0,Q.jsx)(zt,{plugin:A[Z.id],projectLabel:r,projectOverride:n===void 0?void 0:I[n]?.plugins?.[Z.id],onProjectOverride:n===void 0?void 0:e=>mt(`plugins`,Z.id,e)}):null]}):null;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`grid gap-6`,children:[Nt,Pt,Vt??Ht??(u===`plugins`?It:u===`mcps`?Bt:Rt)]}),T===null?null:(0,Q.jsx)(_t,{entry:T,environmentId:e,onClose:()=>O(null)}),(0,Q.jsx)(Ee,{open:He!==null,onOpenChange:e=>!e&&Ue(null),children:(0,Q.jsxs)(ke,{children:[(0,Q.jsxs)(Ae,{children:[(0,Q.jsxs)(je,{children:[`Remove`,` `,He?.kind===`server`?k[He.id]?.name??`server`:He?.kind===`plugin`?A[He.id]?.name??`plugin`:``,`?`]}),(0,Q.jsxs)(Ne,{children:[`New sessions on `,t,` stop getting it. Its stored values and sign-in are deleted. Provider config files are not changed.`]})]}),(0,Q.jsxs)(De,{children:[(0,Q.jsx)(Oe,{render:(0,Q.jsx)(x,{variant:`outline`,children:`Cancel`})}),(0,Q.jsx)(x,{variant:`destructive`,onClick:()=>void ht(),children:`Remove`})]})]})})]})}function At(e){let t=(0,Y.c)(16),{projectLabel:n,override:r,inherited:i,onChange:a}=e,o=r?.enabled!==void 0,s=`In ${n}`,c=o?`Set for this project.`:`Follows the environment (${i?`on`:`off`}).`,l;t[0]!==a||t[1]!==o?(l=o?(0,Q.jsx)(x,{size:`xs`,variant:`ghost`,onClick:()=>a(void 0),children:`Reset`}):null,t[0]=a,t[1]=o,t[2]=l):l=t[2];let u=`Use in ${n}`,d=r?.enabled??i,f;t[3]===a?f=t[4]:(f=e=>a(e),t[3]=a,t[4]=f);let p;t[5]!==u||t[6]!==d||t[7]!==f?(p=(0,Q.jsx)(Me,{"aria-label":u,checked:d,onCheckedChange:f}),t[5]=u,t[6]=d,t[7]=f,t[8]=p):p=t[8];let m;t[9]!==l||t[10]!==p?(m=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l,p]}),t[9]=l,t[10]=p,t[11]=m):m=t[11];let h;return t[12]!==s||t[13]!==c||t[14]!==m?(h=(0,Q.jsx)(Ce,{title:s,description:c,control:m}),t[12]=s,t[13]=c,t[14]=m,t[15]=h):h=t[15],h}function jt(e){let t=(0,Y.c)(108),{environmentId:n,id:r,server:i,runtime:a,checking:o,canManage:s,projectLabel:c,projectOverride:l,awaitingSignIn:u,signInError:f,onProviderToggle:p,onProjectOverride:m,onTest:h,onSignIn:g,onReauthenticate:_,onSignOut:v}=e,y=s&&i.transport.type===`http`&&i.transport.auth===`oauth`&&a?.auth===`signed-out`,b=Ft(n,r,y),S=b.entries,C;t[0]!==o||t[1]!==a||t[2]!==i?(C=Re(i,a,o),t[0]=o,t[1]=a,t[2]=i,t[3]=C):C=t[3];let w=C,T;t[4]===S?T=t[5]:(T=S?.filter(Nt).length??0,t[4]=S,t[5]=T);let E=T,D;t[6]!==w||t[7]!==E||t[8]!==S||t[9]!==y?(D=y?{...w,tone:`muted`,label:S===null?`Checking providers…`:E>0?`Available to ${E} ${E===1?`provider`:`providers`}`:`No providers connected`}:w,t[6]=w,t[7]=E,t[8]=S,t[9]=y,t[10]=D):D=t[10];let O=D,k,A,j,M,N,P,F;if(t[11]!==u||t[12]!==s||t[13]!==o||t[14]!==S||t[15]!==r||t[16]!==p||t[17]!==_||t[18]!==g||t[19]!==v||t[20]!==h||t[21]!==a?.auth||t[22]!==i||t[23]!==f||t[24]!==b||t[25]!==O||t[26]!==y){let e;t[34]===S?e=t[35]:(e=e=>({...e,badge:S===null||e.unsupported!==void 0?void 0:$e(e.driver,S)}),t[34]=S,t[35]=e);let n=et(i).map(e),c=i.transport.type===`http`&&a?.auth===`signed-in`,l=f??O.detail;N=`grid gap-6`,P=r;let m;t[36]===O?m=t[37]:(m=(0,Q.jsx)(wt,{status:O,className:`flex-1 text-sm`}),t[36]=O,t[37]=m);let C;t[38]!==u||t[39]!==s||t[40]!==g||t[41]!==O.needsSignIn||t[42]!==y?(C=O.needsSignIn&&s&&!y?(0,Q.jsx)(x,{size:`xs`,onClick:g,children:u?`Open sign-in again`:`Authenticate`}):null,t[38]=u,t[39]=s,t[40]=g,t[41]=O.needsSignIn,t[42]=y,t[43]=C):C=t[43];let w;t[44]!==s||t[45]!==_||t[46]!==c||t[47]!==O.needsSignIn?(w=c&&!O.needsSignIn&&s?(0,Q.jsx)(x,{size:`xs`,variant:`outline`,onClick:_,children:`Re-authenticate`}):null,t[44]=s,t[45]=_,t[46]=c,t[47]=O.needsSignIn,t[48]=w):w=t[48];let T;t[49]!==s||t[50]!==v||t[51]!==c?(T=c&&s?(0,Q.jsx)(x,{size:`xs`,variant:`ghost`,onClick:v,children:`Sign out`}):null,t[49]=s,t[50]=v,t[51]=c,t[52]=T):T=t[52];let E;t[53]!==s||t[54]!==o||t[55]!==h||t[56]!==i.enabled?(E=s&&i.enabled?(0,Q.jsx)(x,{size:`xs`,variant:`outline`,disabled:o,onClick:h,children:`Test connection`}):null,t[53]=s,t[54]=o,t[55]=h,t[56]=i.enabled,t[57]=E):E=t[57];let D;t[58]!==m||t[59]!==C||t[60]!==w||t[61]!==T||t[62]!==E?(D=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[m,C,w,T,E]}),t[58]=m,t[59]=C,t[60]=w,t[61]=T,t[62]=E,t[63]=D):D=t[63];let I;t[64]!==u||t[65]!==O.needsSignIn||t[66]!==y?(I=O.needsSignIn&&!y?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:u?`Finish signing in in your browser, then come back here.`:y?`Sign in here to give it to every provider.`:`Agents can't reach this server until you sign in.`}):null,t[64]=u,t[65]=O.needsSignIn,t[66]=y,t[67]=I):I=t[67];let L;t[68]!==l||t[69]!==y?(L=l&&!y?(0,Q.jsx)(`p`,{className:`rounded-md bg-destructive/8 px-2.5 py-1.5 text-xs text-destructive-foreground`,children:l}):null,t[68]=l,t[69]=y,t[70]=L):L=t[70];let R;t[71]!==u||t[72]!==l||t[73]!==g||t[74]!==y?(R=y?(0,Q.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:l?`Shared sign-in unavailable`:`Shared sign-in`}),(0,Q.jsxs)(`div`,{className:`grid gap-2 pt-2`,children:[(0,Q.jsx)(`p`,{children:l??`Sign in through P4 Code to share access with every enabled provider.`}),(0,Q.jsx)(`div`,{children:(0,Q.jsx)(x,{size:`xs`,variant:`outline`,onClick:g,children:u?`Open browser`:l?`Retry shared sign-in`:`Sign in through P4 Code`})})]})]}):null,t[71]=u,t[72]=l,t[73]=g,t[74]=y,t[75]=R):R=t[75];let z;t[76]===i.source?z=t[77]:(z=i.source?(0,Q.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:`Import source`}),(0,Q.jsx)(`p`,{className:`break-all pt-2`,children:i.source.path})]}):null,t[76]=i.source,t[77]=z);let B=y?(0,Q.jsx)(Lt,{serverName:i.name,signIns:b,blocked:n.filter(Mt).length}):null;t[78]!==D||t[79]!==I||t[80]!==L||t[81]!==R||t[82]!==z||t[83]!==B?(F=(0,Q.jsx)(Te,{title:`Status`,children:(0,Q.jsx)(xe,{children:(0,Q.jsxs)(`div`,{className:`grid gap-2 px-4 py-3`,children:[D,I,L,R,z,B]})})}),t[78]=D,t[79]=I,t[80]=L,t[81]=R,t[82]=z,t[83]=B,t[84]=F):F=t[84],A=Te,M=`Providers`,k=xe;let V;t[85]!==s||t[86]!==p||t[87]!==i.name?(V=e=>(0,Q.jsx)(Ce,{title:e.label,...e.unsupported===void 0?{}:{description:e.unsupported},control:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[e.badge===void 0?null:(0,Q.jsx)(d,{variant:Rt[e.badge].variant,children:Rt[e.badge].label}),(0,Q.jsx)(Me,{"aria-label":`Give ${i.name} to ${e.label}`,checked:e.enabled&&e.badge!==`unavailable`,disabled:!s||e.unsupported!==void 0||e.badge===`unavailable`,onCheckedChange:t=>p(e.driver,t)})]})},e.driver),t[85]=s,t[86]=p,t[87]=i.name,t[88]=V):V=t[88],j=n.map(V),t[11]=u,t[12]=s,t[13]=o,t[14]=S,t[15]=r,t[16]=p,t[17]=_,t[18]=g,t[19]=v,t[20]=h,t[21]=a?.auth,t[22]=i,t[23]=f,t[24]=b,t[25]=O,t[26]=y,t[27]=k,t[28]=A,t[29]=j,t[30]=M,t[31]=N,t[32]=P,t[33]=F}else k=t[27],A=t[28],j=t[29],M=t[30],N=t[31],P=t[32],F=t[33];let I;t[89]!==k||t[90]!==j?(I=(0,Q.jsx)(k,{children:j}),t[89]=k,t[90]=j,t[91]=I):I=t[91];let L;t[92]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Q.jsx)(`p`,{className:`px-3 text-xs text-muted-foreground sm:px-4`,children:`A change reaches a thread when its provider session next starts.`}),t[92]=L):L=t[92];let R;t[93]!==A||t[94]!==M||t[95]!==I?(R=(0,Q.jsxs)(A,{title:M,children:[I,L]}),t[93]=A,t[94]=M,t[95]=I,t[96]=R):R=t[96];let z;t[97]!==m||t[98]!==c||t[99]!==l||t[100]!==i.enabled?(z=c!==void 0&&m!==void 0?(0,Q.jsx)(Te,{title:`Project`,children:(0,Q.jsx)(xe,{children:(0,Q.jsx)(At,{projectLabel:c,override:l,inherited:i.enabled,onChange:m})})}):null,t[97]=m,t[98]=c,t[99]=l,t[100]=i.enabled,t[101]=z):z=t[101];let B;return t[102]!==R||t[103]!==z||t[104]!==N||t[105]!==P||t[106]!==F?(B=(0,Q.jsxs)(`div`,{className:N,"data-server-id":P,children:[F,R,z]}),t[102]=R,t[103]=z,t[104]=N,t[105]=P,t[106]=F,t[107]=B):B=t[107],B}function Mt(e){return e.enabled&&e.badge===`unavailable`}function Nt(e){return e.status===`signed-in`}function Pt(e){let t=O(e);return xt(t)&&t.detail!==void 0?t.detail:`Sign-in could not start. Try again.`}function Ft(e,t,n){let r=K(G.mcpRegistryProviderSignInState,{reportFailure:!1}),i=K(G.mcpRegistryProviderSignInStart,{reportFailure:!1}),a=K(G.mcpRegistryProviderSignInWait,{reportFailure:!1}),o=K(G.mcpRegistryProviderSignInComplete,{reportFailure:!1}),s=K(G.mcpRegistryProviderSignInCancel,{reportFailure:!1}),c=K(G.mcpRegistryProviderSignOut,{reportFailure:!1}),l=M(G.mcpRegistryProviderSignInComplete.permissionAtom(e)),u=M(G.mcpRegistryProviderSignInCancel.permissionAtom(e)),[d,f]=(0,X.useState)(null),[p,m]=(0,X.useState)({}),[h,g]=(0,X.useState)(new Set),_=(0,X.useRef)(new Set),v=e=>f(t=>t?.map(t=>t.instanceId===e.instanceId?e:t)??null),y=(e,t)=>m(n=>{let r={...n};return t===void 0?delete r[e]:r[e]=t,r});return(0,X.useEffect)(()=>{if(!n)return;let i=!1;return r({environmentId:e,input:{serverId:t}}).then(e=>{i||f(e._tag===`Success`?e.value.providers:[])}),()=>{i=!0}},[n,e,r,t]),(0,X.useEffect)(()=>{if(!n)return;let r=!1;for(let n of d??[]){let i=n.pending;i&&a({environmentId:e,input:{serverId:t,instanceId:n.instanceId,flowId:i.flowId}}).then(e=>{r||(f(t=>t?.map(t=>{if(t.instanceId!==n.instanceId||t.pending?.flowId!==i.flowId)return t;if(e._tag===`Success`)return e.value;let{pending:r,...a}=t;return a})??null),e._tag===`Failure`?y(n.instanceId,Pt(e.cause)):e._tag===`Success`&&e.value.status!==`signed-in`&&!_.current.has(n.instanceId)&&y(n.instanceId,`Sign-in ended without connecting. Try again.`))})}return()=>{r=!0}},[n,d,e,t,a]),{entries:n?d:null,errors:p,busy:h,run:async(n,r,a)=>{if(!_.current.has(n.instanceId)){_.current.add(n.instanceId),g(new Set(_.current)),y(n.instanceId,void 0);try{let l={serverId:t,instanceId:n.instanceId};if(r===`start`){let t=await i({environmentId:e,input:l});t._tag===`Success`?(v({...n,pending:t.value}),window.open(t.value.authorizationUrl,`_blank`,`noopener,noreferrer`)):t._tag===`Failure`&&y(n.instanceId,Pt(t.cause));return}let u={...l,flowId:n.pending?.flowId??``},d=r===`complete`?await o({environmentId:e,input:{...u,callbackUrl:a.trim()}}):r===`cancel`?await s({environmentId:e,input:u}):await c({environmentId:e,input:l});d._tag===`Success`?v(d.value):d._tag===`Failure`&&y(n.instanceId,Pt(d.cause))}finally{_.current.delete(n.instanceId),g(new Set(_.current))}}},canComplete:l,canCancel:u}}function It(e){let t=(0,Y.c)(39),{entry:n,signIns:r}=e,i;t[0]!==n.displayName||t[1]!==n.driver?(i=n.displayName??Ze(n.driver),t[0]=n.displayName,t[1]=n.driver,t[2]=i):i=t[2];let a=i,[o,s]=(0,X.useState)(``),c=n.pending,l;t[3]!==n.instanceId||t[4]!==r.busy?(l=r.busy.has(n.instanceId),t[3]=n.instanceId,t[4]=r.busy,t[5]=l):l=t[5];let u=l,d=r.errors[n.instanceId],f=`mcp-callback-${n.instanceId}`,p;t[6]===a?p=t[7]:(p=(0,Q.jsx)(`p`,{className:`text-sm font-medium`,children:a}),t[6]=a,t[7]=p);let m=c?`text-warning-foreground`:n.status===`signed-in`?`text-success-foreground`:`text-muted-foreground`,h;t[8]===m?h=t[9]:(h=A(`text-xs`,m),t[8]=m,t[9]=h);let g;t[10]!==n.status||t[11]!==c?(g=c?`Waiting for sign-in`:Qe(n.status),t[10]=n.status,t[11]=c,t[12]=g):g=t[12];let _;t[13]!==h||t[14]!==g?(_=(0,Q.jsx)(`p`,{className:h,role:`status`,children:g}),t[13]=h,t[14]=g,t[15]=_):_=t[15];let v;t[16]!==p||t[17]!==_?(v=(0,Q.jsxs)(`div`,{className:`grid gap-1`,children:[p,_]}),t[16]=p,t[17]=_,t[18]=v):v=t[18];let y;t[19]!==u||t[20]!==n||t[21]!==d||t[22]!==c||t[23]!==r?(y=!c&&n.status!==`unavailable`?(0,Q.jsx)(x,{size:`xs`,variant:n.status===`signed-in`?`outline`:`default`,disabled:u,onClick:()=>void r.run(n,n.status===`signed-in`?`signOut`:`start`),children:u?`Please wait…`:n.status===`signed-in`?`Sign out`:d?`Start over`:`Sign in`}):null,t[19]=u,t[20]=n,t[21]=d,t[22]=c,t[23]=r,t[24]=y):y=t[24];let b;t[25]!==v||t[26]!==y?(b=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[v,y]}),t[25]=v,t[26]=y,t[27]=b):b=t[27];let S;t[28]!==u||t[29]!==o||t[30]!==n||t[31]!==d||t[32]!==f||t[33]!==c||t[34]!==r?(S=c?(0,Q.jsxs)(`form`,{className:`grid gap-2`,onSubmit:e=>{e.preventDefault(),o.trim()&&!u&&r.canComplete&&r.run(n,`complete`,o)},children:[(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Approve in your browser. If it ends on a callback URL, paste that URL here.`}),(0,Q.jsx)(`label`,{htmlFor:f,className:`text-xs font-medium`,children:`Callback URL`}),(0,Q.jsx)(se,{id:f,value:o,onChange:e=>s(e.target.value),placeholder:`http://localhost:…/callback?code=…&state=…`,autoComplete:`off`,spellCheck:!1,disabled:u||!r.canComplete,"aria-invalid":!!d,"aria-describedby":d?`${f}-error`:void 0}),d?(0,Q.jsx)(`p`,{id:`${f}-error`,role:`alert`,className:`text-xs text-destructive-foreground`,children:d}):null,(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsx)(x,{type:`submit`,size:`xs`,disabled:u||!o.trim()||!r.canComplete,children:u?`Please wait…`:`Finish sign-in`}),(0,Q.jsx)(x,{type:`button`,size:`xs`,variant:`outline`,disabled:u,onClick:()=>window.open(c.authorizationUrl,`_blank`,`noopener,noreferrer`),children:`Open browser`}),(0,Q.jsx)(x,{type:`button`,size:`xs`,variant:`ghost`,disabled:u||!r.canCancel,onClick:()=>void r.run(n,`cancel`),children:`Cancel`})]})]}):d?(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive-foreground`,children:d}):null,t[28]=u,t[29]=o,t[30]=n,t[31]=d,t[32]=f,t[33]=c,t[34]=r,t[35]=S):S=t[35];let C;return t[36]!==b||t[37]!==S?(C=(0,Q.jsxs)(`div`,{className:`grid gap-2 border-t border-border pt-3`,children:[b,S]}),t[36]=b,t[37]=S,t[38]=C):C=t[38],C}function Lt(e){let t=(0,Y.c)(8),{serverName:n,signIns:r,blocked:i}=e,a;t[0]===r?a=t[1]:(a=r.entries===null?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Checking providers…`}):r.entries.length===0?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No enabled provider here can sign in to MCP servers itself.`}):r.entries.map(e=>(0,Q.jsx)(It,{entry:e,signIns:r},`${e.instanceId}:${e.pending?.flowId??`idle`}`)),t[0]=r,t[1]=a);let o;t[2]!==i||t[3]!==n?(o=i>0?(0,Q.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,Q.jsxs)(`summary`,{className:`cursor-pointer`,children:[i,` other `,i===1?`provider`:`providers`,` unavailable`]}),(0,Q.jsxs)(`p`,{className:`pt-2`,children:[`These providers need shared sign-in to use `,n,`.`]})]}):null,t[2]=i,t[3]=n,t[4]=o):o=t[4];let s;return t[5]!==a||t[6]!==o?(s=(0,Q.jsxs)(`div`,{className:`grid gap-3`,children:[a,o]}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s}var Rt={"signed-in":{variant:`success`,label:`Signed in`},"needs-sign-in":{variant:`warning`,label:`Sign in needed`},unavailable:{variant:`secondary`,label:`Unavailable`}};function zt(e){let t=(0,Y.c)(7),{plugin:n,projectLabel:r,projectOverride:i,onProjectOverride:a}=e,o;t[0]!==a||t[1]!==n||t[2]!==r||t[3]!==i?(o=r!==void 0&&a!==void 0?(0,Q.jsx)(Te,{title:`Project`,children:(0,Q.jsx)(xe,{children:(0,Q.jsx)(At,{projectLabel:r,override:i,inherited:n.enabled,onChange:a})})}):null,t[0]=a,t[1]=n,t[2]=r,t[3]=i,t[4]=o):o=t[4];let s;return t[5]===o?s=t[6]:(s=(0,Q.jsx)(`div`,{className:`grid gap-6`,children:o}),t[5]=o,t[6]=s),s}var Bt=Tt;export{Bt as component};
|
|
5
|
-
//# sourceMappingURL=settings.plugins-
|
|
5
|
+
//# sourceMappingURL=settings.plugins-VlmvBnPN.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectIconPickerDialog-
|
|
2
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./index-DYSmz54X.js";import{n as r,t as i}from"./jsx-runtime-DJeoFXNw.js";import{$n as a,D as o,Ds as s,Iy as c,Jf as l,Mc as u,Qn as d,Qs as f,Rm as p,Rw as m,Xp as h,Yn as g,Z_ as _,Zn as v,Zs as y,ar as b,bs as x,dr as S,jd as C,lv as w,mm as T,n as E,on as D,r as O,rv as k,tr as ee,ts as A,ur as te}from"./utils-DBdIFVCj.js";import{R as ne,U as j,W as re,z as M}from"./runtime-CzKn37Ie.js";import{A as N,F as ie,G as P,w as F}from"./entities-Ba3s4XOS.js";import{On as I}from"./runtime-BdUzhUUM.js";import{t as L}from"./useNavigate-C-nl3R9B.js";import{t as R}from"./useLocation-DctIJsoW.js";import{i as z}from"./toast-DJ2-4imd.js";import{D as B,G as V,T as ae,q as oe}from"./useSettings-BzfsGrZk.js";import{f as H,s as U}from"./server-BWUPVzyQ.js";import{n as W,o as G}from"./session-DO9vnR62.js";import{t as K}from"./use-atom-command-D7oRayrc.js";import{t as q}from"./toastHelpers-DxXYm50b.js";import{t as J}from"./input-gXGwC11t.js";import{n as Y}from"./assetUrls-CDYiJSSP.js";import{D as X,E as se,O as ce,j as le,y as ue}from"./keybindings-D8lOCt7z.js";import{t as de}from"./PierreEntryIcon-8lVXHvon.js";import{t as fe}from"./ProjectFavicon-CYE59XXq.js";import{d as pe}from"./projectFilesQueryState-Dk3vmsg5.js";import{n as me}from"./p4ProjectFile-BpTD1cMi.js";import{r as he,t as ge}from"./alert-kMZL9jzU.js";import{L as _e,V as ve,W as ye,a as Z,i as be,r as xe,s as Se}from"./settingsLayout-B5eZBFxv.js";import{i as Ce,o as we,r as Te}from"./command-Bps-UDxp.js";import{En as Ee,On as De,oa as Oe,qi as ke,yn as Ae}from"./main-BsbTTyDp.js";import{c as je,f as Me,i as Ne,n as Pe,o as Fe,r as Ie,s as Le,t as Re}from"./projectScriptEditor-0BJmIRyM.js";import{t as ze}from"./ProjectDefaultsSettings-B6A-veuE.js";import{t as Be}from"./SettingsScopeNotice-DYhbVTKo.js";var Ve=r(),Q=e(t(),1),$=e(i(),1);function He(e){let t=(0,Ve.c)(14),n=(0,Q.useRef)(null),[r,i]=(0,Q.useState)(We),[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(null),l,u;t[0]===r?(l=t[1],u=t[2]):(l=()=>{let e=n.current;if(r||!e)return;let t=new IntersectionObserver(e=>{e.some(Ue)&&i(!0)});return t.observe(e),()=>t.disconnect()},u=[r],t[0]=r,t[1]=l,t[2]=u),(0,Q.useEffect)(l,u);let d;t[3]!==r||t[4]!==e.cwd||t[5]!==e.path?(d=r?{_tag:`draft-workspace-file`,cwd:e.cwd,path:e.path}:null,t[3]=r,t[4]=e.cwd,t[5]=e.path,t[6]=d):d=t[6];let f=Y(e.environmentId,d),p=f._tag===`Success`?f.url:null,m=p!==null&&s!==p,h=m&&a===p,g=h?null:e.fallback,_;t[7]!==h||t[8]!==m||t[9]!==p?(_=m?(0,$.jsx)(`img`,{alt:``,className:`absolute max-h-8 max-w-8 rounded-sm object-contain${h?``:` invisible`}`,decoding:`async`,loading:`lazy`,onError:()=>c(p),onLoad:()=>o(p),src:p},p):null,t[7]=h,t[8]=m,t[9]=p,t[10]=_):_=t[10];let v;return t[11]!==g||t[12]!==_?(v=(0,$.jsxs)(`span`,{ref:n,className:`relative flex size-8 shrink-0 items-center justify-center`,children:[g,_]}),t[11]=g,t[12]=_,t[13]=v):v=t[13],v}function Ue(e){return e.isIntersecting}function We(){return typeof IntersectionObserver>`u`}function Ge(e,t,n){return t||(n?e.trim()?`Searching project files…`:`Indexing project files…`:e.trim()?`No matching image files.`:`No image files found.`)}function Ke(e,t){return!O(t)||I(e)}function qe(e){let[t,n]=(0,Q.useState)(``),[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(!1),s=pe(e.environmentId,e.cwd,t,200,{imageOnly:!0}),{resolvedTheme:c}=V(),l=A(U),u=e.onPickExternal,d=E(typeof navigator>`u`?``:navigator.platform),f=(0,Q.useMemo)(()=>Ae(s.entries,s.matchedQuery).map(t=>({kind:`action`,value:`project-favicon:${t.path}`,searchTerms:[t.name,t.path],title:t.name,description:t.path,icon:(0,$.jsx)(He,{cwd:e.cwd,environmentId:e.environmentId,fallback:(0,$.jsx)(de,{pathValue:t.path,kind:`file`,theme:c}),path:t.path}),run:async()=>e.onSelect(t.path)})),[e.cwd,e.environmentId,e.onSelect,c,s.entries,s.matchedQuery]);return(0,$.jsx)(Te,{open:e.open,onOpenChange:e.onOpenChange,children:e.open?(0,$.jsx)(Ce,{"aria-label":`Choose project icon`,className:`overflow-hidden`,onBackdropPointerDown:()=>e.onOpenChange(!1),children:(0,$.jsx)(De,{"aria-label":`Choose project icon`,autoHighlight:`always`,escapeLabel:`Close`,footerActionLabel:`Select icon`,footerTrailing:u?(0,$.jsx)(we,{disabled:a,onClick:()=>{o(!0),u().then(t=>{t&&(e.onOpenChange(!1),e.onSelect(t))}).catch(e=>{z.add({type:`error`,title:`Could not open image picker`,description:e instanceof Error?e.message:`An error occurred.`})}).finally(()=>o(!1))},children:`Open in ${d}`}):null,inputProps:{placeholder:`Search image files…`},mode:`none`,onItemHighlighted:e=>{i(typeof e==`string`?e:null)},onValueChange:e=>{i(null),n(e)},panelSize:`tall-list`,testId:`project-favicon-picker`,value:t,children:(0,$.jsx)(Ee,{groups:f.length>0?[{value:`project-favicon-files`,label:e.projectName,items:f}]:[],highlightedItemValue:r,isActionsOnly:!1,keybindings:l,onExecuteItem:t=>{t.kind===`action`&&(e.onOpenChange(!1),t.run())},emptyStateMessage:Ge(t,s.error,s.isPending)})})}):null})}function Je(e){let t=(0,Ve.c)(10),{scripts:n,keybindings:r,disabled:i,onEdit:a}=e;if(n.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{className:`px-3 py-2 text-base text-muted-foreground sm:px-4 sm:text-sm`,children:`No actions configured.`}),t[0]=e):e=t[0],e}let o;if(t[1]!==i||t[2]!==r||t[3]!==a||t[4]!==n){let e;t[6]!==i||t[7]!==r||t[8]!==a?(e=e=>{let t=ue(r,X(e.id));return(0,$.jsx)(Z,{className:`group py-2`,title:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Ie,{icon:e.icon,className:`size-4 shrink-0 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),e.runOnWorktreeCreate?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm border border-border/60 px-1.5 py-px text-2xs font-normal text-muted-foreground`,children:`setup`}):null,e.runOnSettle?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm border border-border/60 px-1.5 py-px text-2xs font-normal text-muted-foreground`,children:`on settle`}):null,e.previewUrl?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm border border-border/60 px-1.5 py-px text-2xs font-normal text-muted-foreground max-sm:hidden`,children:`preview · desktop only`}):null]}),description:(0,$.jsx)(`code`,{className:`block max-w-full truncate font-mono`,children:e.command}),control:(0,$.jsxs)($.Fragment,{children:[t?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t}):null,(0,$.jsx)(`span`,{className:`flex shrink-0 opacity-0 group-focus-within:opacity-100 group-hover:opacity-100`,children:(0,$.jsx)(S,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Edit ${e.name}`,disabled:i,onClick:()=>a(e),children:(0,$.jsx)(T,{className:`size-3.5`})})})]})},e.id)},t[6]=i,t[7]=r,t[8]=a,t[9]=e):e=t[9],o=n.map(e),t[1]=i,t[2]=r,t[3]=a,t[4]=n,t[5]=o}else o=t[5];return o}function Ye(e){if(e._tag===`Failure`&&!ne(e)){let t=re(e);z.add({type:`error`,title:`Failed to save project actions`,description:t instanceof Error?t.message:`An error occurred.`})}return M(e,()=>void 0)}function Xe(e){let t=F(),[n,r]=(0,Q.useState)(!1),i=(0,Q.useRef)(!1),a=K(H.updateSettings,`project actions update`),o=K(H.upsertKeybinding,`action shortcut update`),c=K(H.removeKeybinding,`action shortcut removal`);async function l(n,l,u){if(i.current||e.length===0){let e=`No available machine, or another action change is saving.`;return z.add({type:`error`,title:`Actions not saved`,description:e}),x(m(Error(e)))}if(e.some(({environmentId:e})=>!W(e,`settings:write`)))return Ye(x(m(new w({requiredScope:k,message:`This connection cannot change environment settings.`}))));i.current=!0,r(!0);try{for(let{environmentId:r,settings:i,keybindings:s,project:d}of e){let e=d?Me(i,d):i.defaultProjectScripts,f=n(e),p=f??i.defaultProjectScripts,m=await a({environmentId:r,input:{patch:d?{projectSettingsOverrides:{[d.id]:f===null?me(i,d.id,[`defaultProjectScripts`]):{...i.projectSettingsOverrides[d.id],defaultProjectScripts:f}}}:{defaultProjectScripts:f??[]}}});if(m._tag===`Failure`)return Ye(m);let h=l?[l]:e.filter(e=>!p.some(t=>t.id===e.id)).map(e=>e.id);for(let e of h){let n=X(e),a=je(s,n),l=a?Le({keybinding:a,command:n}):null,p=Le({keybinding:u,command:n}),m=!f?.some(t=>t.id===e)&&(d&&i.defaultProjectScripts.some(t=>t.id===e)||Object.entries(i.projectSettingsOverrides).some(([t,n])=>t!==d?.id&&n.defaultProjectScripts?.some(t=>t.id===e))||t.some(t=>t.environmentId===r&&t.id!==d?.id&&(d?Me(i,t):t.scripts).some(t=>t.id===e))),h=p?await o({environmentId:r,input:l&&l.key!==p.key?{...p,replace:l}:p}):l&&!m?await c({environmentId:r,input:l}):null;if(h?._tag===`Failure`)return Ye(h)}}return s(void 0)}finally{i.current=!1,r(!1)}}function u(n,r){let i=[...t.flatMap(e=>e.scripts.map(e=>e.id)),...e.flatMap(({settings:e,project:t})=>[...e.defaultProjectScripts,...Object.values(e.projectSettingsOverrides).flatMap(e=>e.defaultProjectScripts??[]),...t?.scripts??[]].map(e=>e.id))],a=n??ce(r.name,i),o=se(a,r);return l(e=>{let t=e.map(e=>e.id===a?o:le(e,r));return n===null?[...t,o]:t},a,r.keybinding)}return{saving:n,persist:l,submit:u}}function Ze(){let e=(0,Ve.c)(67),{scope:t,targets:n,target:r}=ve(),{environments:i}=ae(),o=t.kind===`project`||t.kind===`checkout`,s;e[0]!==i||e[1]!==r?(s=r?i.find(e=>e.environmentId===r.environmentId)?.serverConfig:void 0,e[0]=i,e[1]=r,e[2]=s):s=e[2];let l=s,f;e[3]===r?.settings.defaultProjectScripts?f=e[4]:(f=r?.settings.defaultProjectScripts??[],e[3]=r?.settings.defaultProjectScripts,e[4]=f);let p=f,m=l?.keybindings??u,_;if(e[5]!==p||e[6]!==n){let t;e[8]===p?t=e[9]:(t=e=>JSON.stringify(e.settings.defaultProjectScripts)!==JSON.stringify(p),e[8]=p,e[9]=t),_=n.some(t),e[5]=p,e[6]=n,e[7]=_}else _=e[7];let y=_,x=_e(),[w,T]=(0,Q.useState)(null),E,D,O;e[10]!==i||e[11]!==o||e[12]!==t.members||e[13]!==n?(E=new Map(o?t.members.map($e):[]),D=Xe,O=n.flatMap(e=>{let t=i.find(t=>t.environmentId===e.environmentId);if(!t?.serverConfig)return[];let n=e.projectId?E.get(e.projectId):void 0;return n&&t.serverConfig.environment?.capabilities.projectSettingsOverrides!==!0?[]:[{environmentId:e.environmentId,settings:t.serverConfig.settings,keybindings:t.serverConfig.keybindings,...n?{project:n}:{}}]}),e[10]=i,e[11]=o,e[12]=t.members,e[13]=n,e[14]=E,e[15]=D,e[16]=O):(E=e[14],D=e[15],O=e[16]);let{saving:k,persist:A,submit:j}=D(O),M;e[17]!==E||e[18]!==r?(M=r?.projectId?E.get(r.projectId):void 0,e[17]=E,e[18]=r,e[19]=M):M=e[19];let N=M,ie;e[20]===N?.environmentId?ie=e[21]:(ie=N?.environmentId??c.make(`none`),e[20]=N?.environmentId,e[21]=ie);let P=Fe(ie,N?.workspaceRoot??null),F;if(e[22]!==P.scripts||e[23]!==p){let t;e[25]===p?t=e[26]:(t=e=>!p.some(t=>t.command===e.command||t.name.toLowerCase()===e.name.toLowerCase()),e[25]=p,e[26]=t),F=P.scripts.filter(t),e[22]=P.scripts,e[23]=p,e[24]=F}else F=e[24];let I=F,L;e[27]===j?L=e[28]:(L=async e=>{let t={name:e.name,command:e.command,icon:e.icon??`play`,runOnWorktreeCreate:e.runOnWorktreeCreate??!1,waitForSetup:e.runOnWorktreeCreate===!0&&e.async===!1,runOnSettle:e.runOnSettle??!1,keybinding:null,previewUrl:e.previewUrl??null,autoOpenPreview:e.previewUrl?e.autoOpenPreview??!1:!1},n=await j(null,t);if(n._tag===`Failure`&&!ne(n)){let e=re(n);T({scriptId:null,initial:t,error:e instanceof Error?e.message:`Failed to import action.`})}},e[27]=j,e[28]=L);let R=L,z;e[29]===Symbol.for(`react.memo_cache_sentinel`)?(z=[`defaultProjectScripts`],e[29]=z):z=e[29];let B;e[30]===A?B=e[31]:(B=()=>void A(Qe),e[30]=A,e[31]=B);let V;e[32]!==x||e[33]!==R||e[34]!==I||e[35]!==k?(V=I.length>0?(0,$.jsxs)(g,{children:[(0,$.jsxs)(te,{render:(0,$.jsx)(S,{id:`import-scripts`,size:`xs`,variant:`ghost`,disabled:k||!x,type:`button`}),children:[`Import scripts`,(0,$.jsx)(C,{className:`size-3.5`})]}),(0,$.jsxs)(ee,{align:`end`,children:[(0,$.jsxs)(v,{children:[(0,$.jsx)(d,{children:`Import from p4.json`}),(0,$.jsx)(`p`,{className:`px-2 pb-2 text-pretty text-sm text-muted-foreground`,children:`Add actions declared by this checkout without editing them first.`})]}),(0,$.jsx)(b,{}),I.map(e=>(0,$.jsxs)(a,{onClick:()=>void R(e),children:[(0,$.jsx)(Ie,{icon:e.icon??`play`,className:`size-4 shrink-0`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`truncate font-medium`,children:e.name}),(0,$.jsx)(`div`,{className:`truncate font-mono text-muted-foreground`,children:e.command})]})]},`${e.name} ${e.command}`))]})]}):null,e[32]=x,e[33]=R,e[34]=I,e[35]=k,e[36]=V):V=e[36];let oe=k||!x||n.length===0,H,U;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(H=()=>T({scriptId:null,initial:Re}),U=(0,$.jsx)(h,{className:`size-3.5`}),e[37]=H,e[38]=U):(H=e[37],U=e[38]);let W;e[39]===oe?W=e[40]:(W=(0,$.jsxs)(S,{size:`xs`,variant:`outline`,disabled:oe,onClick:H,children:[U,`Add action`]}),e[39]=oe,e[40]=W);let G;e[41]!==V||e[42]!==W?(G=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[V,W]}),e[41]=V,e[42]=W,e[43]=G):G=e[43];let K;e[44]!==y||e[45]!==B||e[46]!==G?(K=(0,$.jsx)(Z,{serverScoped:!0,settingKeys:z,mixed:y,title:`Actions`,description:`Commands that run in this project's checkout or its worktree, with optional shortcuts.`,onResetOverride:B,control:G}),e[44]=y,e[45]=B,e[46]=G,e[47]=K):K=e[47];let q;e[48]!==x||e[49]!==m||e[50]!==y||e[51]!==k||e[52]!==p?(q=y?(0,$.jsx)(Z,{title:`Different actions across environments`,description:`Choose one environment to edit its list. Adding an action here adds it on every selected environment.`}):(0,$.jsx)(Je,{scripts:p,keybindings:m,disabled:k||!x,onEdit:e=>T(Ne(e,m))}),e[48]=x,e[49]=m,e[50]=y,e[51]=k,e[52]=p,e[53]=q):q=e[53];let J;e[54]===P.status?J=e[55]:(J=P.status===`invalid`?(0,$.jsx)(Z,{title:`p4.json is invalid`,description:`A p4.json exists in this checkout but fails to parse, so every action and icon it declares is ignored. Check the JSON syntax and icon values.`,className:`text-warning`}):null,e[54]=P.status,e[55]=J);let Y;e[56]!==A||e[57]!==w||e[58]!==p||e[59]!==j||e[60]!==r?(Y=r&&(0,$.jsx)(Pe,{environmentId:r.environmentId,editScope:`settings:write`,request:w,scripts:p,onSubmit:j,onDelete:e=>void A(t=>t.filter(t=>t.id!==e),e,null),onClose:()=>T(null)}),e[56]=A,e[57]=w,e[58]=p,e[59]=j,e[60]=r,e[61]=Y):Y=e[61];let X;return e[62]!==K||e[63]!==q||e[64]!==J||e[65]!==Y?(X=(0,$.jsxs)(Se,{id:`project-actions`,title:`Actions`,children:[K,q,J,Y]}),e[62]=K,e[63]=q,e[64]=J,e[65]=Y,e[66]=X):X=e[66],X}function Qe(){return null}function $e(e){return[e.id,e]}function et(e,t,n){return n&&e.some(e=>e!==t)}var tt=(0,Q.lazy)(()=>n(()=>import(`./ProjectIconPickerDialog-B29JEJpT.js`).then(e=>({default:e.ProjectIconPickerDialog})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233])));function nt(e){return`${e.environmentId}:${e.id}`}function rt(e){let t=(0,Ve.c)(34),{projectKey:n,environmentId:r,checkoutKey:i}=e,a=r===void 0?null:r,o=i===void 0?null:i,s=ye(),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={from:`/settings`},t[0]=c):c=t[0];let l=L(c),u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u={select:at},t[1]=u):u=t[1];let d=R(u),f;t[2]!==s||t[3]!==n?(f=s.find(e=>e.projectKey===n)??null,t[2]=s,t[3]=n,t[4]=f):f=t[4];let p=f,m;t[5]!==o||t[6]!==a||t[7]!==p?.memberProjects?(m=p?.memberProjects.filter(e=>(a===null||e.environmentId===a)&&(o===null||e.physicalProjectKey===o))??[],t[5]=o,t[6]=a,t[7]=p?.memberProjects,t[8]=m):m=t[8];let h=m,g=(0,Q.useRef)(null),_,v;t[9]!==o||t[10]!==a||t[11]!==h||t[12]!==p?(_=()=>{p&&h.length!==0&&(g.current={key:p.projectKey,environmentId:a,checkoutKey:o,memberKeys:h.map(it)})},v=[p,h,a,o],t[9]=o,t[10]=a,t[11]=h,t[12]=p,t[13]=_,t[14]=v):(_=t[13],v=t[14]),(0,Q.useEffect)(_,v);let y,b;if(t[15]!==o||t[16]!==a||t[17]!==s||t[18]!==h.length||t[19]!==l||t[20]!==d||t[21]!==n?(b=()=>{if(h.length>0)return;let e=g.current;if(e?.key!==n||e.environmentId!==a||e.checkoutKey!==o)return;let t=s.find(t=>t.memberProjects.some(t=>e.memberKeys.includes(t.physicalProjectKey)));t&&l({to:d,search:()=>({project:t.projectKey,machine:a??void 0,checkout:o??void 0}),replace:!0,hashScrollIntoView:!1})},y=[s,l,d,n,h.length,a,o],t[15]=o,t[16]=a,t[17]=s,t[18]=h.length,t[19]=l,t[20]=d,t[21]=n,t[22]=y,t[23]=b):(y=t[22],b=t[23]),(0,Q.useEffect)(b,y),!p){let e=s.length===0?`Add a project from the sidebar to configure it here.`:`This project is no longer available.`,n;return t[24]===e?n=t[25]:(n=(0,$.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-sm text-muted-foreground`,children:e}),t[24]=e,t[25]=n),n}if(h.length===0){let e;return t[26]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{className:`p-8 text-sm text-muted-foreground`,children:`This checkout is no longer available in the selected project and environment.`}),t[26]=e):e=t[26],e}let x;t[27]!==h||t[28]!==p?(x={...p,memberProjects:h,environmentId:h[0].environmentId,id:h[0].id},t[27]=h,t[28]=p,t[29]=x):x=t[29];let S=x,C=`${p.projectKey}:${a??`all`}:${o??`all`}`,w=h.length<p.memberProjects.length,T;return t[30]!==S||t[31]!==C||t[32]!==w?(T=(0,$.jsx)(ot,{group:S,hasOtherMembers:w},C),t[30]=S,t[31]=C,t[32]=w,t[33]=T):T=t[33],T}function it(e){return e.physicalProjectKey}function at(e){return e.pathname}function ot({group:e,hasOtherMembers:t}){let n=L({from:`/settings`}),r=B(),{environments:i}=ae(),a=(0,Q.useMemo)(()=>new Map(i.map(e=>[e.environmentId,e])),[i]),c=G(e.memberProjects,_),u=e.memberProjects.every(e=>c.has(e.environmentId)),d=e.memberProjects.find(e=>a.get(e.environmentId)?.serverConfig!=null)??e.memberProjects[0],h=N(),g=Oe(P.update,{reportFailure:!1}),v=Oe(P.delete,{reportFailure:!1}),b=(0,Q.useRef)(!1),C=d.faviconPath??null,w=d.projectIcon??null,T=typeof window<`u`&&e.memberProjects.every(e=>e.environmentId===r&&Ke(e.workspaceRoot,navigator.platform))?window.desktopBridge?.pickProjectFavicon:void 0,E=(0,Q.useCallback)((e,t)=>{if(t._tag!==`Failure`||ne(t))return;let n=re(t);z.add(q({type:`error`,title:e,description:n instanceof Error?n.message:`An error occurred.`}))},[]),O=(0,Q.useCallback)((e,t)=>{let n=e.find(e=>!W(e.environmentId,_));if(!n)return null;let r=x(m(Error(`This connection cannot change projects in ${n.environmentLabel??`this environment`}.`)));return E(t,r),r},[E]),k=(0,Q.useCallback)(async(t,n)=>{let r=O(e.memberProjects,n);if(r)return r;let i=e.memberProjects.find(e=>{let t=a.get(e.environmentId);return t?.connection.phase!==`connected`||!t.serverConfig});if(i){let e=Error(`Connect ${i.environmentLabel??`the selected environment`} and try again.`),t=x(m(e));return E(n,t),t}for(let r of e.memberProjects){let i=O([r],n);if(i)return i;let a=M(await g({environmentId:r.environmentId,input:{projectId:r.id,...t}}),()=>void 0);if(a._tag===`Failure`)return E(e.memberProjects.length>1?`${n} on ${r.environmentLabel??`the current environment`}`:n,a),a}return s(void 0)},[O,a,e.memberProjects,E,g]),ee=(0,Q.useCallback)(async(t,n)=>{let r=t.trim();r?et(e.memberProjects.map(e=>e.title),r,n)&&await k({title:r},`Failed to rename project`):z.add({type:`warning`,title:`Project title cannot be empty`})},[e.memberProjects,k]),[A,te]=D(!u),[F,I]=D(!u),[R,V]=(0,Q.useState)(!1),H=(0,Q.useRef)(!1),U=(0,Q.useCallback)(async e=>{if(!H.current){H.current=!0,V(!0);try{await k(e,`Failed to update project icon`)}finally{H.current=!1,V(!1)}}},[k]),K=e.memberProjects.length>1,Y=(0,Q.useCallback)(async r=>{if(O(r,`Failed to remove project`))return;let i=oe();if(!i)return;let a=new Set(r.map(nt)),s=h.filter(e=>a.has(`${e.environmentId}:${e.projectId}`)),c=r.length===e.memberProjects.length,l=t||!c?`checkout`:`project`,u=r.length===1?r[0]:null,d=u?.title??e.displayName,p=await j(()=>i.dialogs.confirm([s.length>0?`Remove ${l} "${d}" and delete its ${s.length} thread${s.length===1?``:`s`}?`:`Remove ${l} "${d}"?`,...u?[`Path: ${u.workspaceRoot}`,...u.environmentLabel?[`Environment: ${u.environmentLabel}`]:[]]:[`This removes ${r.length} grouped project entries.`],...s.length>0?[`This permanently clears conversation history for those threads and any archived threads.`]:[`This permanently clears any archived conversation history.`],c&&!t?`This removes only the project entries, not the files on disk.`:`Other entries in this grouped project are unaffected.`,`This action cannot be undone.`].join(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectIconPickerDialog-Cug9qYje.js","assets/react-BUfh6y28.js","assets/jsx-runtime-DJeoFXNw.js","assets/utils-BlwLA0C4.js","assets/activity-CbqMUSRC.js","assets/createLucideIcon-DDevWfFk.js","assets/Icon-DYn8279B.js","assets/alarm-clock-D3-pktbt.js","assets/app-window-DT4yrrS-.js","assets/archive-Cr7-RIjC.js","assets/arrow-down-up-CQvYrirj.js","assets/arrow-down-BKghgxKI.js","assets/arrow-left-BWI0-vRp.js","assets/arrow-right-left-DXmmhGuH.js","assets/arrow-right-BJPYbHTL.js","assets/arrow-up-down-BEa_lFuV.js","assets/arrow-up-left-DLNjxPfK.js","assets/arrow-up-right-B8xNcEXp.js","assets/arrow-up-DMEbfkKl.js","assets/battery-BNMPLne0.js","assets/bell-vGxw63Gg.js","assets/blocks-CpHzQlR2.js","assets/book-open-DKRWS47i.js","assets/bookmark-DfPbwgkW.js","assets/bot-Cp92syL6.js","assets/box-D-FyjNxy.js","assets/bug-DH2pu6U9.js","assets/calendar-arrow-down-WH0xj289.js","assets/calendar-arrow-up-Lk-Us3ba.js","assets/calendar-clock-BARV5L0a.js","assets/calendar-DHdDnhKF.js","assets/camera-8ozLiwCj.js","assets/chart-no-axes-column-CQLqBsxb.js","assets/check-CdrGo1Oa.js","assets/chevron-down-D0M7_175.js","assets/chevron-left-CEWOKn-e.js","assets/chevron-right-DPl-L-yL.js","assets/chevron-up-gyDnPot_.js","assets/chevrons-left-right-ellipsis-DEfsDjXt.js","assets/chevrons-up-down-DakHVkrx.js","assets/chromium-x91nZeen.js","assets/circle-alert-DsKXULDS.js","assets/circle-arrow-up-DCmGv6Tl.js","assets/circle-check-CZ31KO9m.js","assets/circle-dashed-DMw11mBM.js","assets/circle-dot-CWCBN-HY.js","assets/circle-slash-eIt5hG5T.js","assets/circle-x-DMkHWcTz.js","assets/circle-Doq0I3MA.js","assets/clock-3-C5l2rPxd.js","assets/clock-aK6BX5Ve.js","assets/cloud-download-Ddj2y2Q1.js","assets/cloud-upload-BzCXws1i.js","assets/cloud-BhcSs4Ie.js","assets/code-xml-DsmxIkJL.js","assets/code-Dfd-vS1O.js","assets/columns-2-CgvyvCTB.js","assets/copy-CO2RgESU.js","assets/corner-left-up-DUJ8nnVp.js","assets/corner-up-right-xmYx6v5O.js","assets/cpu-DBknwmfd.js","assets/database-D2y6m7fG.js","assets/download-S2u-tXaE.js","assets/earth-CDbKfFEl.js","assets/ellipsis-vertical-CY0vJAc8.js","assets/ellipsis-Zza4fevQ.js","assets/external-link-D1GSnnDW.js","assets/eye-off-CH68-9dO.js","assets/eye-C3U51ndb.js","assets/file-braces-BzATadbM.js","assets/file-code-corner-eTofF8xM.js","assets/file-diff-CNp_vbEN.js","assets/file-search-ymCSYDZx.js","assets/file-spreadsheet-GRfTgOTy.js","assets/file-text-Bfv40hwh.js","assets/file-Ksu7amJn.js","assets/files-DlNPWYbd.js","assets/film-BUU7xHiL.js","assets/flask-conical-Dsv3DUqc.js","assets/folder-closed-urrrH8hq.js","assets/folder-cog-Dph_MIqG.js","assets/folder-git-2-BNs-MyeS.js","assets/folder-git-CZrtjtbc.js","assets/folder-open-glqXjO8U.js","assets/folder-plus-hbrm_0zI.js","assets/folder-tree-DRc_6QzW.js","assets/folder-7OwzWKex.js","assets/gauge-Bn8T6vfX.js","assets/git-branch-plus-DHrV8m4V.js","assets/git-branch-fKUdZyoj.js","assets/git-commit-horizontal-BKUdfVpN.js","assets/git-fork-q7k7fP_a.js","assets/git-merge-B6FlDJ0L.js","assets/git-pull-request-arrow-C03R6MRd.js","assets/git-pull-request-closed-BmuvrrUt.js","assets/git-pull-request-draft-BiETgjOy.js","assets/globe-rqPSVFGf.js","assets/grip-vertical-CDZpgHdL.js","assets/hammer-D3FVtCT2.js","assets/hard-drive-BYq2E_is.js","assets/hat-glasses-Dr2HzrbT.js","assets/history-CdIQPf9A.js","assets/house-ClTLFcnB.js","assets/image-Dp6bFTt-.js","assets/inbox-CcvYrvdu.js","assets/info-D9JLmnlB.js","assets/keyboard-Cwz72Cn4.js","assets/laptop-BRe6y-6m.js","assets/layers-DnKM4R7R.js","assets/lightbulb-D4c0exHI.js","assets/link-2-LC4CLD9N.js","assets/link-BG0xfm4f.js","assets/list-checks-D4Mjxs0W.js","assets/list-filter-CT2YuCdg.js","assets/list-ordered-CmlribqV.js","assets/list-todo-C9Q41q8t.js","assets/list-DFOg7UCj.js","assets/loader-circle-C9YTWe0R.js","assets/lock-open-ZMNlBvF_.js","assets/lock-CUPWkQFd.js","assets/log-in-CmJt2PGl.js","assets/mail-DH8sy4L4.js","assets/maximize-2-Ci1M4n4b.js","assets/maximize--OpXUP-L.js","assets/memory-stick-BfRByDz7.js","assets/message-circle-question-mark-B1TZAw6J.js","assets/message-circle-CHd5kZQY.js","assets/message-square-dashed-Cdozx3vh.js","assets/message-square-off-CWEe8iPZ.js","assets/message-square-text-DqZTWyZK.js","assets/message-square-warning-BNloiEzN.js","assets/message-square-HrqKYo9g.js","assets/messages-square-CNMItvyI.js","assets/minimize-2-C4_6Xjo0.js","assets/minus-BIm_k5Zx.js","assets/monitor-Dsi2qeBw.js","assets/moon-CQPzCH_B.js","assets/mouse-pointer-2-4CaeeJnC.js","assets/mouse-pointer-click-BPbYQy6n.js","assets/octagon-alert-EzAYxsw5.js","assets/package-plus-B0kbli0A.js","assets/package-DgK3Panc.js","assets/paintbrush-CRnk3l4s.js","assets/palette-oisfBZwg.js","assets/panel-bottom-_VbUQKRM.js","assets/panel-left-7a6N5kup.js","assets/panel-right-BeNqPQu9.js","assets/paperclip-D4ApErSa.js","assets/panels-top-left-DWNysJ-h.js","assets/pen-line-dPqyqyP8.js","assets/pencil-ruler-DmVfcvOi.js","assets/pencil-CkBDbGEU.js","assets/picture-in-picture-2-CM4GLcBZ.js","assets/pilcrow-D4Yvx6IY.js","assets/pin-DXnYmcqx.js","assets/play-3I2EkmKd.js","assets/plug-2-s7zj7Hxq.js","assets/plus-B2sOrZDk.js","assets/plug-YkUyuPha.js","assets/power-Bvdrcoxh.js","assets/presentation-Dzj9KqNW.js","assets/puzzle-A0RiinH5.js","assets/qr-code-DliRXqLn.js","assets/quote-BVm0cRnP.js","assets/radio-tower-DUk4f2-O.js","assets/redo-2-BJ7l6vPt.js","assets/refresh-cw-D5OcXJqv.js","assets/rotate-ccw-DpwKQVbi.js","assets/rotate-cw--ORF2bp-.js","assets/route-VA8ojaMC.js","assets/rows-3-BtaOoWPd.js","assets/scale-CFZenX_z.js","assets/search-BXnNiPfE.js","assets/send-rvnCC0tk.js","assets/server-D1-mXw9_.js","assets/settings-2-Bv4a7vuX.js","assets/settings-DSIgI7hn.js","assets/shield-check-Dp6nEC76.js","assets/shield-question-mark-Ct8sQE8L.js","assets/shield-BffxaUbT.js","assets/sliders-horizontal-Cjgfn3-e.js","assets/smartphone-D_YX6TMp.js","assets/smile-plus-CCWLDL7I.js","assets/sparkles-cGzc0RFW.js","assets/square-arrow-out-up-right-BhjBGexN.js","assets/square-pen-D43PK7SU.js","assets/square-split-horizontal-1peTt3kF.js","assets/square-split-vertical-BiyS0VO4.js","assets/square-terminal-jbiJud2S.js","assets/square-ekoTCPwL.js","assets/star-DNOgk1Yn.js","assets/sun-Doo18Rp9.js","assets/tag-COKMM2Nu.js","assets/target-DINbFNKH.js","assets/terminal-B0APSOls.js","assets/text-align-start-CwrzoVmt.js","assets/text-search-CmRPmwd0.js","assets/text-wrap-CQL7aZBn.js","assets/ticket-DOLQqHse.js","assets/trash-2-PlYko97C.js","assets/trending-down-DVeDgUDE.js","assets/trending-up-DbEIgYu9.js","assets/triangle-alert-BoPMRm-g.js","assets/type-CjUvBO4t.js","assets/undo-2-BD9xLk2R.js","assets/unlink-2-D70rwDdQ.js","assets/unplug-BYib3V6l.js","assets/upload-Cra7ct3V.js","assets/user-check-CcyAu7dq.js","assets/user-lock--_mHRTC7.js","assets/user-plus-zMaVgV4o.js","assets/user-round-x-pYk-6fRI.js","assets/user-round-4JeqoQGO.js","assets/users-BZYEVbyz.js","assets/wifi-off-ODm5nCE4.js","assets/workflow-BefWgmas.js","assets/wrench-pR-6hpnb.js","assets/x-C35beONT.js","assets/zap-BIb9m3mg.js","assets/toggle-group-BIVeiRdg.js","assets/CompositeRoot-DSNl3c3G.js","assets/toggle-CrlljXsx.js","assets/input-CySdZpuF.js","assets/Input-CTKz2gGc.js","assets/FieldControl-BDrBhdoh.js","assets/useRegisterFieldControl-y1AHmvVZ.js","assets/scroll-area-DMQd4YlU.js","assets/ScrollAreaCorner-CGc2ioKQ.js","assets/CSPContext-jKZ42W4p.js","assets/dialog-r1KpDpid.js","assets/DialogTitle-CACErOl5.js","assets/ProjectMonogram-DdSkqGzz.js","assets/dynamic-bKXiwQos.js","assets/index-Gp6V8OPo.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./index-Gp6V8OPo.js";import{n as r,t as i}from"./jsx-runtime-DJeoFXNw.js";import{$n as a,D as o,Ds as s,Iy as c,Jf as l,Mc as u,Qn as d,Qs as f,Rm as p,Rw as m,Xp as h,Yn as g,Z_ as _,Zn as v,Zs as y,ar as b,bs as x,dr as S,jd as C,lv as w,mm as T,n as E,on as D,r as O,rv as k,tr as ee,ts as A,ur as te}from"./utils-BlwLA0C4.js";import{R as ne,U as j,W as re,z as M}from"./runtime-DYpzE3gq.js";import{A as N,F as ie,G as P,w as F}from"./entities-DhRbI2L4.js";import{On as I}from"./runtime-Csw1ghUb.js";import{t as L}from"./useNavigate-kfVoxx_T.js";import{t as R}from"./useLocation-t7z8sUje.js";import{i as z}from"./toast-C1lIuL0v.js";import{D as B,G as V,T as ae,q as oe}from"./useSettings-CyF6ezIl.js";import{f as H,s as U}from"./server-DXSwZxzT.js";import{n as W,o as G}from"./session-meZM9Xpf.js";import{t as K}from"./use-atom-command-sg76DXcz.js";import{t as q}from"./toastHelpers-DxXYm50b.js";import{t as J}from"./input-CySdZpuF.js";import{n as Y}from"./assetUrls-DpLOinYe.js";import{D as X,E as se,O as ce,j as le,y as ue}from"./keybindings-COfPuZJ9.js";import{t as de}from"./PierreEntryIcon-C488PFw3.js";import{t as fe}from"./ProjectFavicon-BhuB_Su5.js";import{d as pe}from"./projectFilesQueryState-D9gKctiS.js";import{n as me}from"./p4ProjectFile-DuMklfjR.js";import{r as he,t as ge}from"./alert-Cq0DAg5J.js";import{L as _e,V as ve,W as ye,a as Z,i as be,r as xe,s as Se}from"./settingsLayout-D3zsCQTE.js";import{i as Ce,o as we,r as Te}from"./command-BOsIZcjU.js";import{En as Ee,On as De,oa as Oe,qi as ke,yn as Ae}from"./main-1tW7jidE.js";import{c as je,f as Me,i as Ne,n as Pe,o as Fe,r as Ie,s as Le,t as Re}from"./projectScriptEditor-D20MTQIS.js";import{t as ze}from"./ProjectDefaultsSettings-b9JKMHCZ.js";import{t as Be}from"./SettingsScopeNotice-Bq20tBUp.js";var Ve=r(),Q=e(t(),1),$=e(i(),1);function He(e){let t=(0,Ve.c)(14),n=(0,Q.useRef)(null),[r,i]=(0,Q.useState)(We),[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(null),l,u;t[0]===r?(l=t[1],u=t[2]):(l=()=>{let e=n.current;if(r||!e)return;let t=new IntersectionObserver(e=>{e.some(Ue)&&i(!0)});return t.observe(e),()=>t.disconnect()},u=[r],t[0]=r,t[1]=l,t[2]=u),(0,Q.useEffect)(l,u);let d;t[3]!==r||t[4]!==e.cwd||t[5]!==e.path?(d=r?{_tag:`draft-workspace-file`,cwd:e.cwd,path:e.path}:null,t[3]=r,t[4]=e.cwd,t[5]=e.path,t[6]=d):d=t[6];let f=Y(e.environmentId,d),p=f._tag===`Success`?f.url:null,m=p!==null&&s!==p,h=m&&a===p,g=h?null:e.fallback,_;t[7]!==h||t[8]!==m||t[9]!==p?(_=m?(0,$.jsx)(`img`,{alt:``,className:`absolute max-h-8 max-w-8 rounded-sm object-contain${h?``:` invisible`}`,decoding:`async`,loading:`lazy`,onError:()=>c(p),onLoad:()=>o(p),src:p},p):null,t[7]=h,t[8]=m,t[9]=p,t[10]=_):_=t[10];let v;return t[11]!==g||t[12]!==_?(v=(0,$.jsxs)(`span`,{ref:n,className:`relative flex size-8 shrink-0 items-center justify-center`,children:[g,_]}),t[11]=g,t[12]=_,t[13]=v):v=t[13],v}function Ue(e){return e.isIntersecting}function We(){return typeof IntersectionObserver>`u`}function Ge(e,t,n){return t||(n?e.trim()?`Searching project files…`:`Indexing project files…`:e.trim()?`No matching image files.`:`No image files found.`)}function Ke(e,t){return!O(t)||I(e)}function qe(e){let[t,n]=(0,Q.useState)(``),[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(!1),s=pe(e.environmentId,e.cwd,t,200,{imageOnly:!0}),{resolvedTheme:c}=V(),l=A(U),u=e.onPickExternal,d=E(typeof navigator>`u`?``:navigator.platform),f=(0,Q.useMemo)(()=>Ae(s.entries,s.matchedQuery).map(t=>({kind:`action`,value:`project-favicon:${t.path}`,searchTerms:[t.name,t.path],title:t.name,description:t.path,icon:(0,$.jsx)(He,{cwd:e.cwd,environmentId:e.environmentId,fallback:(0,$.jsx)(de,{pathValue:t.path,kind:`file`,theme:c}),path:t.path}),run:async()=>e.onSelect(t.path)})),[e.cwd,e.environmentId,e.onSelect,c,s.entries,s.matchedQuery]);return(0,$.jsx)(Te,{open:e.open,onOpenChange:e.onOpenChange,children:e.open?(0,$.jsx)(Ce,{"aria-label":`Choose project icon`,className:`overflow-hidden`,onBackdropPointerDown:()=>e.onOpenChange(!1),children:(0,$.jsx)(De,{"aria-label":`Choose project icon`,autoHighlight:`always`,escapeLabel:`Close`,footerActionLabel:`Select icon`,footerTrailing:u?(0,$.jsx)(we,{disabled:a,onClick:()=>{o(!0),u().then(t=>{t&&(e.onOpenChange(!1),e.onSelect(t))}).catch(e=>{z.add({type:`error`,title:`Could not open image picker`,description:e instanceof Error?e.message:`An error occurred.`})}).finally(()=>o(!1))},children:`Open in ${d}`}):null,inputProps:{placeholder:`Search image files…`},mode:`none`,onItemHighlighted:e=>{i(typeof e==`string`?e:null)},onValueChange:e=>{i(null),n(e)},panelSize:`tall-list`,testId:`project-favicon-picker`,value:t,children:(0,$.jsx)(Ee,{groups:f.length>0?[{value:`project-favicon-files`,label:e.projectName,items:f}]:[],highlightedItemValue:r,isActionsOnly:!1,keybindings:l,onExecuteItem:t=>{t.kind===`action`&&(e.onOpenChange(!1),t.run())},emptyStateMessage:Ge(t,s.error,s.isPending)})})}):null})}function Je(e){let t=(0,Ve.c)(10),{scripts:n,keybindings:r,disabled:i,onEdit:a}=e;if(n.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{className:`px-3 py-2 text-base text-muted-foreground sm:px-4 sm:text-sm`,children:`No actions configured.`}),t[0]=e):e=t[0],e}let o;if(t[1]!==i||t[2]!==r||t[3]!==a||t[4]!==n){let e;t[6]!==i||t[7]!==r||t[8]!==a?(e=e=>{let t=ue(r,X(e.id));return(0,$.jsx)(Z,{className:`group py-2`,title:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Ie,{icon:e.icon,className:`size-4 shrink-0 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),e.runOnWorktreeCreate?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm border border-border/60 px-1.5 py-px text-2xs font-normal text-muted-foreground`,children:`setup`}):null,e.runOnSettle?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm border border-border/60 px-1.5 py-px text-2xs font-normal text-muted-foreground`,children:`on settle`}):null,e.previewUrl?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm border border-border/60 px-1.5 py-px text-2xs font-normal text-muted-foreground max-sm:hidden`,children:`preview · desktop only`}):null]}),description:(0,$.jsx)(`code`,{className:`block max-w-full truncate font-mono`,children:e.command}),control:(0,$.jsxs)($.Fragment,{children:[t?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t}):null,(0,$.jsx)(`span`,{className:`flex shrink-0 opacity-0 group-focus-within:opacity-100 group-hover:opacity-100`,children:(0,$.jsx)(S,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Edit ${e.name}`,disabled:i,onClick:()=>a(e),children:(0,$.jsx)(T,{className:`size-3.5`})})})]})},e.id)},t[6]=i,t[7]=r,t[8]=a,t[9]=e):e=t[9],o=n.map(e),t[1]=i,t[2]=r,t[3]=a,t[4]=n,t[5]=o}else o=t[5];return o}function Ye(e){if(e._tag===`Failure`&&!ne(e)){let t=re(e);z.add({type:`error`,title:`Failed to save project actions`,description:t instanceof Error?t.message:`An error occurred.`})}return M(e,()=>void 0)}function Xe(e){let t=F(),[n,r]=(0,Q.useState)(!1),i=(0,Q.useRef)(!1),a=K(H.updateSettings,`project actions update`),o=K(H.upsertKeybinding,`action shortcut update`),c=K(H.removeKeybinding,`action shortcut removal`);async function l(n,l,u){if(i.current||e.length===0){let e=`No available machine, or another action change is saving.`;return z.add({type:`error`,title:`Actions not saved`,description:e}),x(m(Error(e)))}if(e.some(({environmentId:e})=>!W(e,`settings:write`)))return Ye(x(m(new w({requiredScope:k,message:`This connection cannot change environment settings.`}))));i.current=!0,r(!0);try{for(let{environmentId:r,settings:i,keybindings:s,project:d}of e){let e=d?Me(i,d):i.defaultProjectScripts,f=n(e),p=f??i.defaultProjectScripts,m=await a({environmentId:r,input:{patch:d?{projectSettingsOverrides:{[d.id]:f===null?me(i,d.id,[`defaultProjectScripts`]):{...i.projectSettingsOverrides[d.id],defaultProjectScripts:f}}}:{defaultProjectScripts:f??[]}}});if(m._tag===`Failure`)return Ye(m);let h=l?[l]:e.filter(e=>!p.some(t=>t.id===e.id)).map(e=>e.id);for(let e of h){let n=X(e),a=je(s,n),l=a?Le({keybinding:a,command:n}):null,p=Le({keybinding:u,command:n}),m=!f?.some(t=>t.id===e)&&(d&&i.defaultProjectScripts.some(t=>t.id===e)||Object.entries(i.projectSettingsOverrides).some(([t,n])=>t!==d?.id&&n.defaultProjectScripts?.some(t=>t.id===e))||t.some(t=>t.environmentId===r&&t.id!==d?.id&&(d?Me(i,t):t.scripts).some(t=>t.id===e))),h=p?await o({environmentId:r,input:l&&l.key!==p.key?{...p,replace:l}:p}):l&&!m?await c({environmentId:r,input:l}):null;if(h?._tag===`Failure`)return Ye(h)}}return s(void 0)}finally{i.current=!1,r(!1)}}function u(n,r){let i=[...t.flatMap(e=>e.scripts.map(e=>e.id)),...e.flatMap(({settings:e,project:t})=>[...e.defaultProjectScripts,...Object.values(e.projectSettingsOverrides).flatMap(e=>e.defaultProjectScripts??[]),...t?.scripts??[]].map(e=>e.id))],a=n??ce(r.name,i),o=se(a,r);return l(e=>{let t=e.map(e=>e.id===a?o:le(e,r));return n===null?[...t,o]:t},a,r.keybinding)}return{saving:n,persist:l,submit:u}}function Ze(){let e=(0,Ve.c)(67),{scope:t,targets:n,target:r}=ve(),{environments:i}=ae(),o=t.kind===`project`||t.kind===`checkout`,s;e[0]!==i||e[1]!==r?(s=r?i.find(e=>e.environmentId===r.environmentId)?.serverConfig:void 0,e[0]=i,e[1]=r,e[2]=s):s=e[2];let l=s,f;e[3]===r?.settings.defaultProjectScripts?f=e[4]:(f=r?.settings.defaultProjectScripts??[],e[3]=r?.settings.defaultProjectScripts,e[4]=f);let p=f,m=l?.keybindings??u,_;if(e[5]!==p||e[6]!==n){let t;e[8]===p?t=e[9]:(t=e=>JSON.stringify(e.settings.defaultProjectScripts)!==JSON.stringify(p),e[8]=p,e[9]=t),_=n.some(t),e[5]=p,e[6]=n,e[7]=_}else _=e[7];let y=_,x=_e(),[w,T]=(0,Q.useState)(null),E,D,O;e[10]!==i||e[11]!==o||e[12]!==t.members||e[13]!==n?(E=new Map(o?t.members.map($e):[]),D=Xe,O=n.flatMap(e=>{let t=i.find(t=>t.environmentId===e.environmentId);if(!t?.serverConfig)return[];let n=e.projectId?E.get(e.projectId):void 0;return n&&t.serverConfig.environment?.capabilities.projectSettingsOverrides!==!0?[]:[{environmentId:e.environmentId,settings:t.serverConfig.settings,keybindings:t.serverConfig.keybindings,...n?{project:n}:{}}]}),e[10]=i,e[11]=o,e[12]=t.members,e[13]=n,e[14]=E,e[15]=D,e[16]=O):(E=e[14],D=e[15],O=e[16]);let{saving:k,persist:A,submit:j}=D(O),M;e[17]!==E||e[18]!==r?(M=r?.projectId?E.get(r.projectId):void 0,e[17]=E,e[18]=r,e[19]=M):M=e[19];let N=M,ie;e[20]===N?.environmentId?ie=e[21]:(ie=N?.environmentId??c.make(`none`),e[20]=N?.environmentId,e[21]=ie);let P=Fe(ie,N?.workspaceRoot??null),F;if(e[22]!==P.scripts||e[23]!==p){let t;e[25]===p?t=e[26]:(t=e=>!p.some(t=>t.command===e.command||t.name.toLowerCase()===e.name.toLowerCase()),e[25]=p,e[26]=t),F=P.scripts.filter(t),e[22]=P.scripts,e[23]=p,e[24]=F}else F=e[24];let I=F,L;e[27]===j?L=e[28]:(L=async e=>{let t={name:e.name,command:e.command,icon:e.icon??`play`,runOnWorktreeCreate:e.runOnWorktreeCreate??!1,waitForSetup:e.runOnWorktreeCreate===!0&&e.async===!1,runOnSettle:e.runOnSettle??!1,keybinding:null,previewUrl:e.previewUrl??null,autoOpenPreview:e.previewUrl?e.autoOpenPreview??!1:!1},n=await j(null,t);if(n._tag===`Failure`&&!ne(n)){let e=re(n);T({scriptId:null,initial:t,error:e instanceof Error?e.message:`Failed to import action.`})}},e[27]=j,e[28]=L);let R=L,z;e[29]===Symbol.for(`react.memo_cache_sentinel`)?(z=[`defaultProjectScripts`],e[29]=z):z=e[29];let B;e[30]===A?B=e[31]:(B=()=>void A(Qe),e[30]=A,e[31]=B);let V;e[32]!==x||e[33]!==R||e[34]!==I||e[35]!==k?(V=I.length>0?(0,$.jsxs)(g,{children:[(0,$.jsxs)(te,{render:(0,$.jsx)(S,{id:`import-scripts`,size:`xs`,variant:`ghost`,disabled:k||!x,type:`button`}),children:[`Import scripts`,(0,$.jsx)(C,{className:`size-3.5`})]}),(0,$.jsxs)(ee,{align:`end`,children:[(0,$.jsxs)(v,{children:[(0,$.jsx)(d,{children:`Import from p4.json`}),(0,$.jsx)(`p`,{className:`px-2 pb-2 text-pretty text-sm text-muted-foreground`,children:`Add actions declared by this checkout without editing them first.`})]}),(0,$.jsx)(b,{}),I.map(e=>(0,$.jsxs)(a,{onClick:()=>void R(e),children:[(0,$.jsx)(Ie,{icon:e.icon??`play`,className:`size-4 shrink-0`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`truncate font-medium`,children:e.name}),(0,$.jsx)(`div`,{className:`truncate font-mono text-muted-foreground`,children:e.command})]})]},`${e.name} ${e.command}`))]})]}):null,e[32]=x,e[33]=R,e[34]=I,e[35]=k,e[36]=V):V=e[36];let oe=k||!x||n.length===0,H,U;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(H=()=>T({scriptId:null,initial:Re}),U=(0,$.jsx)(h,{className:`size-3.5`}),e[37]=H,e[38]=U):(H=e[37],U=e[38]);let W;e[39]===oe?W=e[40]:(W=(0,$.jsxs)(S,{size:`xs`,variant:`outline`,disabled:oe,onClick:H,children:[U,`Add action`]}),e[39]=oe,e[40]=W);let G;e[41]!==V||e[42]!==W?(G=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[V,W]}),e[41]=V,e[42]=W,e[43]=G):G=e[43];let K;e[44]!==y||e[45]!==B||e[46]!==G?(K=(0,$.jsx)(Z,{serverScoped:!0,settingKeys:z,mixed:y,title:`Actions`,description:`Commands that run in this project's checkout or its worktree, with optional shortcuts.`,onResetOverride:B,control:G}),e[44]=y,e[45]=B,e[46]=G,e[47]=K):K=e[47];let q;e[48]!==x||e[49]!==m||e[50]!==y||e[51]!==k||e[52]!==p?(q=y?(0,$.jsx)(Z,{title:`Different actions across environments`,description:`Choose one environment to edit its list. Adding an action here adds it on every selected environment.`}):(0,$.jsx)(Je,{scripts:p,keybindings:m,disabled:k||!x,onEdit:e=>T(Ne(e,m))}),e[48]=x,e[49]=m,e[50]=y,e[51]=k,e[52]=p,e[53]=q):q=e[53];let J;e[54]===P.status?J=e[55]:(J=P.status===`invalid`?(0,$.jsx)(Z,{title:`p4.json is invalid`,description:`A p4.json exists in this checkout but fails to parse, so every action and icon it declares is ignored. Check the JSON syntax and icon values.`,className:`text-warning`}):null,e[54]=P.status,e[55]=J);let Y;e[56]!==A||e[57]!==w||e[58]!==p||e[59]!==j||e[60]!==r?(Y=r&&(0,$.jsx)(Pe,{environmentId:r.environmentId,editScope:`settings:write`,request:w,scripts:p,onSubmit:j,onDelete:e=>void A(t=>t.filter(t=>t.id!==e),e,null),onClose:()=>T(null)}),e[56]=A,e[57]=w,e[58]=p,e[59]=j,e[60]=r,e[61]=Y):Y=e[61];let X;return e[62]!==K||e[63]!==q||e[64]!==J||e[65]!==Y?(X=(0,$.jsxs)(Se,{id:`project-actions`,title:`Actions`,children:[K,q,J,Y]}),e[62]=K,e[63]=q,e[64]=J,e[65]=Y,e[66]=X):X=e[66],X}function Qe(){return null}function $e(e){return[e.id,e]}function et(e,t,n){return n&&e.some(e=>e!==t)}var tt=(0,Q.lazy)(()=>n(()=>import(`./ProjectIconPickerDialog-Cug9qYje.js`).then(e=>({default:e.ProjectIconPickerDialog})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233])));function nt(e){return`${e.environmentId}:${e.id}`}function rt(e){let t=(0,Ve.c)(34),{projectKey:n,environmentId:r,checkoutKey:i}=e,a=r===void 0?null:r,o=i===void 0?null:i,s=ye(),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={from:`/settings`},t[0]=c):c=t[0];let l=L(c),u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u={select:at},t[1]=u):u=t[1];let d=R(u),f;t[2]!==s||t[3]!==n?(f=s.find(e=>e.projectKey===n)??null,t[2]=s,t[3]=n,t[4]=f):f=t[4];let p=f,m;t[5]!==o||t[6]!==a||t[7]!==p?.memberProjects?(m=p?.memberProjects.filter(e=>(a===null||e.environmentId===a)&&(o===null||e.physicalProjectKey===o))??[],t[5]=o,t[6]=a,t[7]=p?.memberProjects,t[8]=m):m=t[8];let h=m,g=(0,Q.useRef)(null),_,v;t[9]!==o||t[10]!==a||t[11]!==h||t[12]!==p?(_=()=>{p&&h.length!==0&&(g.current={key:p.projectKey,environmentId:a,checkoutKey:o,memberKeys:h.map(it)})},v=[p,h,a,o],t[9]=o,t[10]=a,t[11]=h,t[12]=p,t[13]=_,t[14]=v):(_=t[13],v=t[14]),(0,Q.useEffect)(_,v);let y,b;if(t[15]!==o||t[16]!==a||t[17]!==s||t[18]!==h.length||t[19]!==l||t[20]!==d||t[21]!==n?(b=()=>{if(h.length>0)return;let e=g.current;if(e?.key!==n||e.environmentId!==a||e.checkoutKey!==o)return;let t=s.find(t=>t.memberProjects.some(t=>e.memberKeys.includes(t.physicalProjectKey)));t&&l({to:d,search:()=>({project:t.projectKey,machine:a??void 0,checkout:o??void 0}),replace:!0,hashScrollIntoView:!1})},y=[s,l,d,n,h.length,a,o],t[15]=o,t[16]=a,t[17]=s,t[18]=h.length,t[19]=l,t[20]=d,t[21]=n,t[22]=y,t[23]=b):(y=t[22],b=t[23]),(0,Q.useEffect)(b,y),!p){let e=s.length===0?`Add a project from the sidebar to configure it here.`:`This project is no longer available.`,n;return t[24]===e?n=t[25]:(n=(0,$.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-sm text-muted-foreground`,children:e}),t[24]=e,t[25]=n),n}if(h.length===0){let e;return t[26]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{className:`p-8 text-sm text-muted-foreground`,children:`This checkout is no longer available in the selected project and environment.`}),t[26]=e):e=t[26],e}let x;t[27]!==h||t[28]!==p?(x={...p,memberProjects:h,environmentId:h[0].environmentId,id:h[0].id},t[27]=h,t[28]=p,t[29]=x):x=t[29];let S=x,C=`${p.projectKey}:${a??`all`}:${o??`all`}`,w=h.length<p.memberProjects.length,T;return t[30]!==S||t[31]!==C||t[32]!==w?(T=(0,$.jsx)(ot,{group:S,hasOtherMembers:w},C),t[30]=S,t[31]=C,t[32]=w,t[33]=T):T=t[33],T}function it(e){return e.physicalProjectKey}function at(e){return e.pathname}function ot({group:e,hasOtherMembers:t}){let n=L({from:`/settings`}),r=B(),{environments:i}=ae(),a=(0,Q.useMemo)(()=>new Map(i.map(e=>[e.environmentId,e])),[i]),c=G(e.memberProjects,_),u=e.memberProjects.every(e=>c.has(e.environmentId)),d=e.memberProjects.find(e=>a.get(e.environmentId)?.serverConfig!=null)??e.memberProjects[0],h=N(),g=Oe(P.update,{reportFailure:!1}),v=Oe(P.delete,{reportFailure:!1}),b=(0,Q.useRef)(!1),C=d.faviconPath??null,w=d.projectIcon??null,T=typeof window<`u`&&e.memberProjects.every(e=>e.environmentId===r&&Ke(e.workspaceRoot,navigator.platform))?window.desktopBridge?.pickProjectFavicon:void 0,E=(0,Q.useCallback)((e,t)=>{if(t._tag!==`Failure`||ne(t))return;let n=re(t);z.add(q({type:`error`,title:e,description:n instanceof Error?n.message:`An error occurred.`}))},[]),O=(0,Q.useCallback)((e,t)=>{let n=e.find(e=>!W(e.environmentId,_));if(!n)return null;let r=x(m(Error(`This connection cannot change projects in ${n.environmentLabel??`this environment`}.`)));return E(t,r),r},[E]),k=(0,Q.useCallback)(async(t,n)=>{let r=O(e.memberProjects,n);if(r)return r;let i=e.memberProjects.find(e=>{let t=a.get(e.environmentId);return t?.connection.phase!==`connected`||!t.serverConfig});if(i){let e=Error(`Connect ${i.environmentLabel??`the selected environment`} and try again.`),t=x(m(e));return E(n,t),t}for(let r of e.memberProjects){let i=O([r],n);if(i)return i;let a=M(await g({environmentId:r.environmentId,input:{projectId:r.id,...t}}),()=>void 0);if(a._tag===`Failure`)return E(e.memberProjects.length>1?`${n} on ${r.environmentLabel??`the current environment`}`:n,a),a}return s(void 0)},[O,a,e.memberProjects,E,g]),ee=(0,Q.useCallback)(async(t,n)=>{let r=t.trim();r?et(e.memberProjects.map(e=>e.title),r,n)&&await k({title:r},`Failed to rename project`):z.add({type:`warning`,title:`Project title cannot be empty`})},[e.memberProjects,k]),[A,te]=D(!u),[F,I]=D(!u),[R,V]=(0,Q.useState)(!1),H=(0,Q.useRef)(!1),U=(0,Q.useCallback)(async e=>{if(!H.current){H.current=!0,V(!0);try{await k(e,`Failed to update project icon`)}finally{H.current=!1,V(!1)}}},[k]),K=e.memberProjects.length>1,Y=(0,Q.useCallback)(async r=>{if(O(r,`Failed to remove project`))return;let i=oe();if(!i)return;let a=new Set(r.map(nt)),s=h.filter(e=>a.has(`${e.environmentId}:${e.projectId}`)),c=r.length===e.memberProjects.length,l=t||!c?`checkout`:`project`,u=r.length===1?r[0]:null,d=u?.title??e.displayName,p=await j(()=>i.dialogs.confirm([s.length>0?`Remove ${l} "${d}" and delete its ${s.length} thread${s.length===1?``:`s`}?`:`Remove ${l} "${d}"?`,...u?[`Path: ${u.workspaceRoot}`,...u.environmentLabel?[`Environment: ${u.environmentLabel}`]:[]]:[`This removes ${r.length} grouped project entries.`],...s.length>0?[`This permanently clears conversation history for those threads and any archived threads.`]:[`This permanently clears any archived conversation history.`],c&&!t?`This removes only the project entries, not the files on disk.`:`Other entries in this grouped project are unaffected.`,`This action cannot be undone.`].join(`
|
|
3
3
|
`),{variant:`destructive`}));if(p._tag===`Failure`||!p.value||O(r,`Failed to remove project`))return;let m=o.getState();for(let e of r){if(O([e],`Failed to remove project`))return;let t=s.filter(t=>t.environmentId===e.environmentId&&t.projectId===e.id),n=M(await v({environmentId:e.environmentId,input:{projectId:e.id,force:!0}}),()=>void 0);if(n._tag===`Failure`){E(`Failed to remove "${e.title}"`,n);return}let r=y(e.environmentId,e.id);await ie(r),ke(r,t.map(e=>f(e.environmentId,e.id)));let i=m.getDraftThreadByProjectRef(r);i&&m.clearDraftThread(i.draftId),m.clearProjectDraftThreadId(r)}c&&!t&&n({to:`/`,replace:!0})},[O,v,e.displayName,e.memberProjects.length,t,n,E,h]),X=(0,$.jsx)(Se,{title:`Checkouts`,children:e.memberProjects.map(e=>(0,$.jsx)(Z,{title:e.environmentLabel??`Environment`,description:e.workspaceRoot,control:(0,$.jsx)(S,{size:`sm`,variant:`outline`,disabled:!c.has(e.environmentId),onClick:()=>void Y([e]),"aria-label":`Remove checkout ${e.workspaceRoot}`,children:`Remove`})},e.physicalProjectKey))});return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(be,{className:`gap-6`,children:[(0,$.jsxs)(ge,{variant:`info`,children:[(0,$.jsx)(l,{"aria-hidden":!0}),(0,$.jsx)(he,{children:`Can't find a setting? Keep this project picked above and hop to any other settings page.`})]}),(0,$.jsxs)(Se,{id:`project-overview`,title:`Project`,hideTitle:!0,children:[u?null:(0,$.jsx)(`p`,{className:`px-3 py-2 text-sm text-muted-foreground sm:px-4`,children:e.memberProjects.length>1?`Shared settings require permission to change every checkout in this group.`:`This connection cannot change this project.`}),(0,$.jsx)(Z,{title:`Name`,description:`The shared name for this project group in the sidebar and thread lists.`,control:(0,$.jsx)(J,{size:`sm`,className:`w-full sm:w-64`,"aria-label":`Project name`,disabled:!u,defaultValue:e.displayName,onChange:()=>{b.current=!0},onBlur:e=>{let t=b.current;b.current=!1,ee(e.currentTarget.value,t)},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()}},`${e.projectKey}:${e.displayName}`)}),(0,$.jsx)(Z,{title:`Project icon`,description:w?.kind===`lucide`?`${w.name} · ${w.color}`:w?.kind===`monogram`?`${w.text} · ${w.color}`:w?.kind===`emoji`?w.emoji:C??`Automatic`,resetAction:e.memberProjects.some(e=>e.faviconPath!=null||e.projectIcon!=null)?(0,$.jsx)(xe,{label:`project icon`,disabled:R||!u,onClick:()=>void U({faviconPath:null,projectIcon:null})}):null,control:(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(fe,{project:d,className:`size-6`}),(0,$.jsx)(S,{size:`sm`,variant:`outline`,type:`button`,"aria-label":`Choose a project icon`,disabled:R||!u,onClick:()=>I(!0),children:`Choose icon`}),(0,$.jsx)(S,{size:`sm`,variant:`outline`,type:`button`,"aria-label":`Choose a project icon file`,disabled:R||!u,onClick:()=>te(!0),children:`Choose file`})]})})]}),(0,$.jsx)(ze,{category:`project`}),(0,$.jsx)(Ze,{}),K?X:null,(0,$.jsx)(Se,{title:`Danger`,children:(0,$.jsx)(Z,{title:t?`Remove checkout`:e.memberProjects.length>1?`Remove this project everywhere`:`Remove project`,description:t?`Deletes the selected machine's checkout entries and their threads. Other machines and files on disk are not touched.`:e.memberProjects.length>1?`Deletes all ${e.memberProjects.length} checkout entries and their threads on every machine. Files on disk are not touched.`:`Deletes the project entry and its threads. Files on disk are not touched.`,control:(0,$.jsxs)(S,{size:`sm`,variant:`destructive-outline`,disabled:!u,onClick:()=>void Y(e.memberProjects),children:[(0,$.jsx)(p,{}),t?`Remove checkout`:e.memberProjects.length>1?`Remove all entries`:`Remove project`]})})})]}),(0,$.jsx)(qe,{cwd:d.workspaceRoot,environmentId:d.environmentId,onOpenChange:te,...T?{onPickExternal:()=>T(d.workspaceRoot)}:{},onSelect:e=>void U({faviconPath:e,projectIcon:null}),open:A&&u,projectName:e.displayName},`${d.environmentId}:${d.workspaceRoot}:${A}`),F&&u?(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(tt,{current:w,projectName:d.title,open:!0,onOpenChange:I,onSelect:e=>void U({faviconPath:null,projectIcon:e})})}):null]})}function st(){let e=(0,Ve.c)(7),{search:t,scope:n}=ve(),r=n.kind===`project`||n.kind===`checkout`||n.kind===`unavailable`&&(n.reason===`project-missing`||n.reason===`checkout-missing`),i;return e[0]!==r||e[1]!==n.kind||e[2]!==n.message||e[3]!==t.checkout||e[4]!==t.machine||e[5]!==t.project?(i=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:t.project&&r?(0,$.jsx)(rt,{projectKey:t.project,environmentId:t.machine?c.make(t.machine):null,checkoutKey:t.checkout??null}):n.kind===`unavailable`?(0,$.jsx)(be,{children:(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n.message})}):(0,$.jsx)(Be,{target:`project`,children:`Choose a project to manage its name, icon, checkouts and actions.`})}),e[0]=r,e[1]=n.kind,e[2]=n.message,e[3]=t.checkout,e[4]=t.machine,e[5]=t.project,e[6]=i):i=e[6],i}var ct=st;export{ct as component};
|
|
4
|
-
//# sourceMappingURL=settings.projects-
|
|
4
|
+
//# sourceMappingURL=settings.projects-M8mb50zO.js.map
|