@p4code/cli 0.8.2 → 0.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AcpMcpStdioBridge-D_JnxPWS.mjs → AcpMcpStdioBridge-CD9BQr2l.mjs} +1 -1
- package/dist/{AcpMcpStdioBridge-DBONIB-w.mjs → AcpMcpStdioBridge-DHwGLtep.mjs} +61 -4
- package/dist/bin.mjs +2 -2
- package/dist/{binCli-C1tFongj.mjs → binCli-Bgjc_5FL.mjs} +17430 -3413
- package/dist/client/.vite/manifest.json +2209 -2169
- package/dist/client/assets/{AnimatedHeight-PJxVEp27.js → AnimatedHeight-DYUgtGfz.js} +2 -2
- package/dist/client/assets/{AuthSurfaceShell-BrPHaco9.js → AuthSurfaceShell-CfLnzrCc.js} +2 -2
- package/dist/client/assets/{CSPContext-C7uwFl6f.js → CSPContext-i9QaQnwk.js} +2 -2
- package/dist/client/assets/ChatGptUsageButton-BWTEbaUC.js +2 -0
- package/dist/client/assets/{ChatMarkdown-D3ITm4U-.js → ChatMarkdown-C6UsXjP9.js} +11 -11
- package/dist/client/assets/CodexSetupSection.logic-VTayPks4.js +2 -0
- package/dist/client/assets/ComboboxClear-B-iYnTX_.js +2 -0
- package/dist/client/assets/{CommandBlock-JrUX9e8E.js → CommandBlock-dh2vBT70.js} +2 -2
- package/dist/client/assets/{ComposerPromptEditor-Ba1dvqDN.js → ComposerPromptEditor-fIqs_--j.js} +55 -55
- package/dist/client/assets/CompositeRoot-JeAqW-33.js +2 -0
- package/dist/client/assets/{ConnectionStatusDot-Cjh57o6i.js → ConnectionStatusDot-BCSqqCpf.js} +2 -2
- package/dist/client/assets/DevicePanel-BckpiUTa.js +2 -0
- package/dist/client/assets/{DeviceSetup-DccRVnjb.js → DeviceSetup-L8Q-0h1V.js} +2 -2
- package/dist/client/assets/DialogTitle-BRYusK7T.js +2 -0
- package/dist/client/assets/{DiffCommentAnnotation-DDBZcMFv.js → DiffCommentAnnotation-DxxGd0sM.js} +3 -3
- package/dist/client/assets/DiffFileTree-C2N3dwbB.js +2 -0
- package/dist/client/assets/DiffPanel-0HWHkPjD.js +2 -0
- package/dist/client/assets/{DiffWorkerPoolProvider-RcplgHGv.js → DiffWorkerPoolProvider-Dd8cIhyy.js} +3 -3
- package/dist/client/assets/{EnvironmentMachineIcon-DMZGa766.js → EnvironmentMachineIcon-giyHKjbh.js} +2 -2
- package/dist/client/assets/ExpandableText-dJhpznMp.js +3 -0
- package/dist/client/assets/{FieldControl-C9UnFGZn.js → FieldControl-CxuWXcJE.js} +2 -2
- package/dist/client/assets/{FileDiff-BXlBWSxx.js → FileDiff-EWd5oWlS.js} +2 -2
- package/dist/client/assets/FilePreviewPanel-D3kud1xs.js +34 -0
- package/dist/client/assets/FoldedSettingsSection-CsN_jb3V.js +2 -0
- package/dist/client/assets/{FormContext-haYZgWIK.js → FormContext-Vk5aZcR6.js} +2 -2
- package/dist/client/assets/{Icons-C12feMOO.js → Icons-DM1SzuL7.js} +2 -2
- package/dist/client/assets/{KeybindingsSettings.logic-DhXMdk5O.js → KeybindingsSettings.logic-BcJGxVhV.js} +2 -2
- package/dist/client/assets/{NoProjectsHero-CDoSxJVV.js → NoProjectsHero-DrkWMiG4.js} +2 -2
- package/dist/client/assets/{PanelLayoutControls-CCKUTh1H.js → PanelLayoutControls-DjmAXscr.js} +13 -13
- package/dist/client/assets/{PierreEntryIcon-7x50Pz_C.js → PierreEntryIcon-BJ8xtDqQ.js} +2 -2
- package/dist/client/assets/PreviewPanel-D_JLD7YP.js +2 -0
- package/dist/client/assets/ProjectDefaultsSettings-Bqo3T1SR.js +2 -0
- package/dist/client/assets/{ProjectFavicon-ExMHrN16.js → ProjectFavicon-By6-kpgk.js} +3 -3
- package/dist/client/assets/ProjectIconPickerDialog-Cx-QcJLy.js +2 -0
- package/dist/client/assets/{ProjectMonogram-um8sYqIi.js → ProjectMonogram-BJVBhwjz.js} +2 -2
- package/dist/client/assets/{ProviderAuthTerminal-Tw3kH5vc.js → ProviderAuthTerminal-DBiUwanv.js} +2 -2
- package/dist/client/assets/ProviderModelPicker-DV64N-fE.js +2 -0
- package/dist/client/assets/ProviderSettingsForm-Tkr5xKCJ.js +2 -0
- package/dist/client/assets/PullRequestCodeTab-DijqMjN0.js +6 -0
- package/dist/client/assets/{ReadOnlySourcePreview-Cw6lfMjA.js → ReadOnlySourcePreview-CydDaO9-.js} +2 -2
- package/dist/client/assets/{RenderErrorBoundary-D21mPr47.js → RenderErrorBoundary-D4M2khxk.js} +2 -2
- package/dist/client/assets/ScheduledTasksSettings-D_Z_3GVl.js +4 -0
- package/dist/client/assets/{ScopedSwitch-2MBm4Srn.js → ScopedSwitch-B8wdvttG.js} +2 -2
- package/dist/client/assets/SecretInput-CNWNAhNe.js +2 -0
- package/dist/client/assets/SettingsPanels-DAv_V_mk.js +39 -0
- package/dist/client/assets/{SettingsPanels.logic-DpdMN_lX.js → SettingsPanels.logic-BYa5iHwl.js} +2 -2
- package/dist/client/assets/{SettingsScopeNotice-CdNfxmW3.js → SettingsScopeNotice-CcLrVZWz.js} +2 -2
- package/dist/client/assets/T3ConnectAccountPages-DjITJ87o.js +2 -0
- package/dist/client/assets/{T3ConnectSidebarSignIn-DewmE1PI.js → T3ConnectSidebarSignIn-B-rQNmqG.js} +2 -2
- package/dist/client/assets/{ThemeEditorPanel-aEsLfkYx.js → ThemeEditorPanel-CJGqmeTA.js} +3 -3
- package/dist/client/assets/ThreadTerminalDrawer-Cdl3DAIx.js +5 -0
- package/dist/client/assets/{Virtualizer-B2BG0GB9.js → Virtualizer-Bk-YJlPj.js} +2 -2
- package/dist/client/assets/WorkspaceBreadcrumb-DSFWvH19.js +2 -0
- package/dist/client/assets/WorkspacePageContainer-BXUbfbEU.js +2 -0
- package/dist/client/assets/{WorkspacePageHeader-BCZXPSxj.js → WorkspacePageHeader-LbIzJCDs.js} +2 -2
- package/dist/client/assets/_chat-oHhtDqeh.js +45 -0
- package/dist/client/assets/{_chat.index-7o1_qjfU.js → _chat.index-CTew1WmI.js} +2 -2
- package/dist/client/assets/_chat.new-COSURrfS.js +4 -0
- package/dist/client/assets/{_chat.pull-requests-DnQ-MKRG.js → _chat.pull-requests-BlXnsqov.js} +2 -2
- package/dist/client/assets/{abnfDiagram-VCTEODGH-DJY5x2uS.js → abnfDiagram-VCTEODGH-brKh7bzh.js} +2 -2
- package/dist/client/assets/{alert-yllEf0yh.js → alert-quTC4YbH.js} +2 -2
- package/dist/client/assets/architecture-7GRP2DOG-BMFS-mJW.js +1 -0
- package/dist/client/assets/{architectureDiagram-5GKGNRK7-6YiKazHv.js → architectureDiagram-5GKGNRK7-BVDiXgfK.js} +2 -2
- package/dist/client/assets/archive-x-D3w6saMD.js +2 -0
- package/dist/client/assets/arrow-left-BFquhiaO.js +1 -0
- package/dist/client/assets/arrow-right-DiV8cYUQ.js +1 -0
- package/dist/client/assets/arrow-up-down-BDQTjPr1.js +1 -0
- package/dist/client/assets/assets-CRmNKuHc.js +2 -0
- package/dist/client/assets/bell-BvJp3v99.js +1 -0
- package/dist/client/assets/{blockDiagram-I7D4REHJ-D_EURhbV.js → blockDiagram-I7D4REHJ-CzoRCJDe.js} +2 -2
- package/dist/client/assets/blocks-NuR9qdGl.js +1 -0
- package/dist/client/assets/bot-mvw1ddnU.js +1 -0
- package/dist/client/assets/{browserHistoryStore-B-t3Vc_Z.js → browserHistoryStore-Cw3ffhOV.js} +2 -2
- package/dist/client/assets/{browserLinkTarget-CiQS1wUg.js → browserLinkTarget-KTI1tSl7.js} +2 -2
- package/dist/client/assets/{c4Diagram-7LVT6UL2-CmfPrrIj.js → c4Diagram-7LVT6UL2-CfyobiDu.js} +2 -2
- package/dist/client/assets/calendar-clock-CuvWKWXS.js +1 -0
- package/dist/client/assets/channel-Cf2J77rP.js +2 -0
- package/dist/client/assets/chart-no-axes-column-Hfs9TSWj.js +1 -0
- package/dist/client/assets/checkbox-BHsP70Vt.js +2 -0
- package/dist/client/assets/{chunk-4HAMMTFA-BdvKUuii.js → chunk-4HAMMTFA-CPnMRFld.js} +2 -2
- package/dist/client/assets/{chunk-75Z2AOVW-DXz8BlJz.js → chunk-75Z2AOVW-C85FbOND.js} +2 -2
- package/dist/client/assets/{chunk-DU6HZSFF-ebFBoLTT.js → chunk-DU6HZSFF-s_qrqgaz.js} +2 -2
- package/dist/client/assets/{chunk-F27PBJKO-B1MlVcaX.js → chunk-F27PBJKO-90tTgV9x.js} +2 -2
- package/dist/client/assets/{chunk-GMAD6QVW-CEXqem_-.js → chunk-GMAD6QVW-CYRPr7hZ.js} +2 -2
- package/dist/client/assets/{chunk-GVQU2GXP-wsgr7T0u.js → chunk-GVQU2GXP-CxAvUb1-.js} +2 -2
- package/dist/client/assets/{chunk-IMKFNOWR-Daxc_3WP.js → chunk-IMKFNOWR-794woOlB.js} +2 -2
- package/dist/client/assets/{chunk-L3NEJ4N5-C4NnipZ0.js → chunk-L3NEJ4N5-JXcRdiIo.js} +2 -2
- package/dist/client/assets/{chunk-OSK3NFVY-DDd2Ay5_.js → chunk-OSK3NFVY-ToxVvjW1.js} +2 -2
- package/dist/client/assets/{chunk-P2QGCYS3-I9iEYMEJ.js → chunk-P2QGCYS3-JB1PmfIc.js} +2 -2
- package/dist/client/assets/{chunk-POPQ4Y6H-Cgwl0wkZ.js → chunk-POPQ4Y6H-RMxlqjhd.js} +2 -2
- package/dist/client/assets/{chunk-PWAF6VOD-kBB0Jquc.js → chunk-PWAF6VOD-AB579n2y.js} +2 -2
- package/dist/client/assets/{chunk-SHT3W25Y-gtUoMWd0.js → chunk-SHT3W25Y-CV2hE9-g.js} +2 -2
- package/dist/client/assets/{chunk-SVP7TREG-CbL5vJ0z.js → chunk-SVP7TREG-b2Gs4u5W.js} +2 -2
- package/dist/client/assets/{chunk-TICWLB2K-CMgrptzc.js → chunk-TICWLB2K-CtkYqLLJ.js} +2 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-D9m4giYc.js +2 -0
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-D9m4giYc.js +2 -0
- package/dist/client/assets/{color-picker-Cj2frYnP.js → color-picker-CFc6YapE.js} +2 -2
- package/dist/client/assets/{combobox-DixSlhgy.js → combobox-WVgW_agq.js} +2 -2
- package/dist/client/assets/{command-B45LRbFT.js → command-w6WcFbeZ.js} +2 -2
- package/dist/client/assets/{connect-CYM5DIkv.js → connect-D_ncSJiK.js} +2 -2
- package/dist/client/assets/{connect-agent-nn3QLMb4.js → connect-agent-8mHL_bau.js} +2 -2
- package/dist/client/assets/corner-left-up-DedXC9IG.js +1 -0
- package/dist/client/assets/{cynefin-OW5HDTMX-CmLjrFzm.js → cynefin-OW5HDTMX-BDIjrXPB.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-xQBevUIj.js → cynefinDiagram-5FMLGOSQ-h9tw36zs.js} +2 -2
- package/dist/client/assets/{dagre-GXQ25YYZ-Ck8BwJaT.js → dagre-GXQ25YYZ-D3s1T81F.js} +2 -2
- package/dist/client/assets/device-DhvzgETq.js +2 -0
- package/dist/client/assets/{diagram-S7CK7UJ4-Bl0e661x.js → diagram-S7CK7UJ4-DTawhR4X.js} +2 -2
- package/dist/client/assets/{diagram-UQ7AKVKN-TO9a3uQI.js → diagram-UQ7AKVKN-CTUDQHKY.js} +2 -2
- package/dist/client/assets/{diagram-VSXAHHWV-BZ7xQ8wz.js → diagram-VSXAHHWV-DsbNNWnj.js} +2 -2
- package/dist/client/assets/{diagram-VX7I27RA-C4cA30qa.js → diagram-VX7I27RA-BBy99N9O.js} +2 -2
- package/dist/client/assets/{diagram-Z3DM3KII-Hl3MmqeP.js → diagram-Z3DM3KII-CEy69xv1.js} +2 -2
- package/dist/client/assets/{dialog-DhJeevKt.js → dialog-CPLO59bH.js} +2 -2
- package/dist/client/assets/{diffRendering-QVeYVRDU.js → diffRendering-BlmxsRF9.js} +2 -2
- package/dist/client/assets/{discovery-list-VoilmsP7.js → discovery-list-D0LBmkzJ.js} +2 -2
- package/dist/client/assets/{dist-CxgL3edJ.js → dist-DZWol-cd.js} +5 -5
- package/dist/client/assets/download-CUcdw53T.js +1 -0
- package/dist/client/assets/{draft-input-BrEXLyuj.js → draft-input-CmvO5rl_.js} +2 -2
- package/dist/client/assets/{duoViewer-D-_bD3-L.js → duoViewer-B0QD-fyi.js} +2 -2
- package/dist/client/assets/dynamic-tF-2a8Zt.js +3 -0
- package/dist/client/assets/earth-BqADiov-.js +1 -0
- package/dist/client/assets/{ebnfDiagram-PWID7BFC-Bo_ALmgV.js → ebnfDiagram-PWID7BFC-B9LWNbny.js} +2 -2
- package/dist/client/assets/ellipsis-BUF_4-Z7.js +1 -0
- package/dist/client/assets/{embeddedScripts-DKKE5k7D.js → embeddedScripts-B1MGNr-e.js} +2 -2
- package/dist/client/assets/empty-tr-EsB66.js +2 -0
- package/dist/client/assets/entities-DqhRur25.js +2 -0
- package/dist/client/assets/{erDiagram-RLTQ6QDP-B38FLl2U.js → erDiagram-RLTQ6QDP-Nu9IMF5-.js} +2 -2
- package/dist/client/assets/eventmodeling-NTZA5JFV-CHuv5_8f.js +1 -0
- package/dist/client/assets/eye-C8OhITrC.js +1 -0
- package/dist/client/assets/file-search-ComEiFQ8.js +1 -0
- package/dist/client/assets/{fileLinks-VfyxNu8P.js → fileLinks-BHAkEh9k.js} +2 -2
- package/dist/client/assets/{fileTreeExpansion-BfMZMaRV.js → fileTreeExpansion-BierCVUV.js} +2 -2
- package/dist/client/assets/flowDiagram-HODETNUW-wmC7eeQc.js +1 -0
- package/dist/client/assets/fold-vertical-BMLbHh0a.js +2 -0
- package/dist/client/assets/folder-cog-BMK_9DOi.js +2 -0
- package/dist/client/assets/folder-git-2-COyuVTXA.js +1 -0
- package/dist/client/assets/folder-open-DZzz50kK.js +1 -0
- package/dist/client/assets/folder-plus-BzJT8jXs.js +1 -0
- package/dist/client/assets/{ganttDiagram-EL5Y4UJY-Cj0Kstgh.js → ganttDiagram-EL5Y4UJY-D_s5F9rI.js} +2 -2
- package/dist/client/assets/{getDiffFileInput-XUe1xsym.js → getDiffFileInput-B5j6sQbM.js} +2 -2
- package/dist/client/assets/git-branch-CCzcdr93.js +1 -0
- package/dist/client/assets/{gitGraph-4MIJSDKK-C84uaaYZ.js → gitGraph-4MIJSDKK-BASxGOL3.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-CvyimLfZ.js → gitGraphDiagram-WWUBYQGX-BtA4z_1S.js} +2 -2
- package/dist/client/assets/grip-vertical-COceJQZo.js +1 -0
- package/dist/client/assets/{guideRunStore-DwmmS8D0.js → guideRunStore-C95PbUuP.js} +2 -2
- package/dist/client/assets/hard-drive-BKLzbeTS.js +1 -0
- package/dist/client/assets/history-CAAEfWkp.js +1 -0
- package/dist/client/assets/house-U4txgvXa.js +1 -0
- package/dist/client/assets/{htmlRender-DRfZ8nFp.js → htmlRender-DgdJ8GkZ.js} +2 -2
- package/dist/client/assets/index-D_uSeco8.js +3 -0
- package/dist/client/assets/{info-A6RAGUB7-AXJa674d.js → info-A6RAGUB7-Q4Qe5TI_.js} +1 -1
- package/dist/client/assets/{infoDiagram-27XIBGKW-CgaIIar7.js → infoDiagram-27XIBGKW-CNnDxcfZ.js} +2 -2
- package/dist/client/assets/{input-u5qjnfMr.js → input-DaCwubQj.js} +2 -2
- package/dist/client/assets/{input-group-DIOgVvbV.js → input-group-DJwXFHGO.js} +2 -2
- package/dist/client/assets/{ishikawaDiagram-5VMMS53U-DSDzMD_t.js → ishikawaDiagram-5VMMS53U-Drb03OY6.js} +2 -2
- package/dist/client/assets/{journeyDiagram-3NMN7TZE-Be6o5a7O.js → journeyDiagram-3NMN7TZE-CynC6Up1.js} +2 -2
- package/dist/client/assets/{kanban-definition-UXKFOSKX-Fpr0ne16.js → kanban-definition-UXKFOSKX-DfyC_hIe.js} +2 -2
- package/dist/client/assets/kbd-R3wkAau0.js +2 -0
- package/dist/client/assets/keybindings-QrjnJ5jB.js +2 -0
- package/dist/client/assets/keyboard-kgy5M4lo.js +1 -0
- package/dist/client/assets/{lazyRouteComponent-dLOOuQ-r.js → lazyRouteComponent-cLZROdN-.js} +2 -2
- package/dist/client/assets/{line-BXhbrPh0.js → line-C3gvAOpf.js} +2 -2
- package/dist/client/assets/{link-YLDgrmSN.js → link-Bl21VXlj.js} +2 -2
- package/dist/client/assets/link-C1k5F8-V.js +1 -0
- package/dist/client/assets/{linkedPrompt-E32o3H76.js → linkedPrompt-DAcv0O_f.js} +2 -2
- package/dist/client/assets/list-CU7BIfIS.js +1 -0
- package/dist/client/assets/main-BsiZpg85.css +2 -0
- package/dist/client/assets/main-uLg3xUJM.js +30 -0
- package/dist/client/assets/{mediaReference-C-grVzJf.js → mediaReference-DN8lzwOF.js} +2 -2
- package/dist/client/assets/{mediaSource-CxVHZYDj.js → mediaSource-0nIWHHoL.js} +2 -2
- package/dist/client/assets/{mermaid-parser.core-BFPy42Wg.js → mermaid-parser.core-B3cYmj0d.js} +4 -4
- package/dist/client/assets/{mermaid.core-zK2u82e-.js → mermaid.core-9ekBSYCO.js} +5 -5
- package/dist/client/assets/message-circle-question-mark-wTwD9xwk.js +1 -0
- package/dist/client/assets/message-square-dashed-Hcy2Q2EP.js +1 -0
- package/dist/client/assets/message-square-lCzwndCW.js +1 -0
- package/dist/client/assets/{mindmap-definition-YA3MSWOX-RzkTvFrT.js → mindmap-definition-YA3MSWOX-K4rtZu2z.js} +2 -2
- package/dist/client/assets/mouse-pointer-2-BFFAEWXU.js +1 -0
- package/dist/client/assets/number-field-pAaF-e0N.js +2 -0
- package/dist/client/assets/{observeResize-WQaFQjbx.js → observeResize-BEjNJ-rK.js} +2 -2
- package/dist/client/assets/{onboarding-DNafmm6s.js → onboarding--LqcHqO0.js} +2 -2
- package/dist/client/assets/openFileInPreview-NwK1GJFN.js +2 -0
- package/dist/client/assets/{p4ProjectFile-BzCYJ8I-.js → p4ProjectFile-CVEoe1SJ.js} +2 -2
- package/dist/client/assets/{packet-AYTQ26CC-rDYSbNWh.js → packet-AYTQ26CC-kDkfULQq.js} +1 -1
- package/dist/client/assets/{pair-nG9A6oxp.js → pair-Bxo10T5t.js} +2 -2
- package/dist/client/assets/palette-BkpHEJXn.js +1 -0
- package/dist/client/assets/panel-left-DNz3ps89.js +1 -0
- package/dist/client/assets/panels-top-left-bKuZF4FX.js +1 -0
- package/dist/client/assets/{pegDiagram-XKGWAZYB-8wodyYDi.js → pegDiagram-XKGWAZYB-6b8AqBYd.js} +2 -2
- package/dist/client/assets/{phoneViewer-Bei8FsYJ.js → phoneViewer-Vql_2ZzY.js} +2 -2
- package/dist/client/assets/{pie-WAS4IAKB-Ce0_zpeP.js → pie-WAS4IAKB-CfoqFIwI.js} +1 -1
- package/dist/client/assets/{pieDiagram-E7YTZNPT-C3QJYWCY.js → pieDiagram-E7YTZNPT-i8FgTMai.js} +2 -2
- package/dist/client/assets/{pierre-icons-CsjmRq9p.js → pierre-icons-CBmlpFgP.js} +2 -2
- package/dist/client/assets/plug-Cdxb0djR.js +2 -0
- package/dist/client/assets/popover-BXin7C0B.js +2 -0
- package/dist/client/assets/{preview-BpTu6A2K.js → preview-6t42evKb.js} +2 -2
- package/dist/client/assets/{preview-DFDpDpup.js → preview-C9iPHfb1.js} +2 -2
- package/dist/client/assets/{previewMiniPlayerStore-BfMwexwO.js → previewMiniPlayerStore-BDRPsVx0.js} +2 -2
- package/dist/client/assets/{primary-Cc8Am8Ju.js → primary-DOpcfgLH.js} +2 -2
- package/dist/client/assets/primaryCloudLinkState-Dulej3bP.js +2 -0
- package/dist/client/assets/projectFilesQueryState-C1crs3C8.js +2 -0
- package/dist/client/assets/{projectScriptEditor-RR3KkKhh.js → projectScriptEditor-ku2tGeKq.js} +2 -2
- package/dist/client/assets/providerSkills-D0IxW0_5.js +2 -0
- package/dist/client/assets/{pullRequestDetail.logic-CE7fVOsp.js → pullRequestDetail.logic-BiwUoz1M.js} +4 -4
- package/dist/client/assets/{pullRequestReviewStore-BHEIYvsP.js → pullRequestReviewStore-J7YIGsZ9.js} +2 -2
- package/dist/client/assets/pullRequests-BQ9KruZm.js +2 -0
- package/dist/client/assets/puzzle-wfhgUaHl.js +1 -0
- package/dist/client/assets/{quadrantDiagram-AXDQQJYC-Cqx4Dcqi.js → quadrantDiagram-AXDQQJYC-DzvIAxCm.js} +2 -2
- package/dist/client/assets/queries-CEjFwxVW.js +2 -0
- package/dist/client/assets/query-D5pQUQvZ.js +2 -0
- package/dist/client/assets/{radar-RG4KPBEZ-DsccxBWq.js → radar-RG4KPBEZ-BnTV8utT.js} +1 -1
- package/dist/client/assets/radio-group-DhpPG5HP.js +2 -0
- package/dist/client/assets/{railroad-74A4TZTK-B-UN2mSQ.js → railroad-74A4TZTK-nxEBKbUo.js} +1 -1
- package/dist/client/assets/railroad-abnf-HS5TGJTU-bDIjPMME.js +1 -0
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-BREFlihg.js +1 -0
- package/dist/client/assets/railroad-peg-WCYAUIDC-B0hEZefb.js +1 -0
- package/dist/client/assets/{railroadDiagram-O6MQD6OU-B_PdDy5r.js → railroadDiagram-O6MQD6OU-DFdlMVKn.js} +2 -2
- package/dist/client/assets/{renderScheduler-D1ml_j--.js → renderScheduler-DWKKtxcJ.js} +2 -2
- package/dist/client/assets/{requirementDiagram-BXWQKSXE-CKZ6HpQu.js → requirementDiagram-BXWQKSXE-BW8o0F_p.js} +2 -2
- package/dist/client/assets/rightPanelStore-CQ94819A.js +2 -0
- package/dist/client/assets/rotate-ccw-CkpQmcC5.js +1 -0
- package/dist/client/assets/rotate-cw-BAiACGtX.js +1 -0
- package/dist/client/assets/runtime-Bsb2I_n2.js +2 -0
- package/dist/client/assets/runtime-DkYxB4ri.js +6 -0
- package/dist/client/assets/{sankeyDiagram-P5KCCOFB-BLF-VPcj.js → sankeyDiagram-P5KCCOFB-JA6FB6i0.js} +2 -2
- package/dist/client/assets/{scheduledTasksSettings.logic-ozIaTRfT.js → scheduledTasksSettings.logic-C_AdQNVz.js} +3 -3
- package/dist/client/assets/{scroll-area-CsrtHuL8.js → scroll-area-BYyfw-9F.js} +2 -2
- package/dist/client/assets/select-CjGEfXy_.js +2 -0
- package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-BpJGkNAx.js → sequenceDiagram-WJ2MYXX4-DgBrrcVR.js} +2 -2
- package/dist/client/assets/server-BYntb2dN.js +2 -0
- package/dist/client/assets/session-eLrubJEW.js +2 -0
- package/dist/client/assets/session-logic-l1juLk9v.js +26 -0
- package/dist/client/assets/settings-2-CDBTJPBs.js +1 -0
- package/dist/client/assets/settings-DDvSs7LG.js +1 -0
- package/dist/client/assets/settings-xKzLy5aw.js +2 -0
- package/dist/client/assets/settings.appearance-CEA3GKAa.js +2 -0
- package/dist/client/assets/settings.archived-DPWjmD2l.js +2 -0
- package/dist/client/assets/{settings.computer-use-DuW-mXPO.js → settings.computer-use-DZu90DiM.js} +2 -2
- package/dist/client/assets/settings.connections-BKWbsMUk.js +2 -0
- package/dist/client/assets/settings.data-controls-CBrcsSvm.js +2 -0
- package/dist/client/assets/settings.decisions-CGz9znLs.js +2 -0
- package/dist/client/assets/settings.diagnostics-DKkOOzoq.js +2 -0
- package/dist/client/assets/settings.general-CoPWyKC4.js +2 -0
- package/dist/client/assets/settings.integrations-K3Jwfkyd.js +2 -0
- package/dist/client/assets/{settings.keybindings-BeQmUtKv.js → settings.keybindings-BbR3qnVs.js} +2 -2
- package/dist/client/assets/settings.open-source-licenses-Mh-zg97k.js +2 -0
- package/dist/client/assets/settings.plugins-BI68kAsM.js +5 -0
- package/dist/client/assets/settings.projects-BahZsoyx.js +4 -0
- package/dist/client/assets/settings.providers-Dsnq0-AL.js +3 -0
- package/dist/client/assets/settings.scheduled-tasks-BOpVl_XK.js +2 -0
- package/dist/client/assets/{settings.snap-shot-CUZNOX9M.js → settings.snap-shot-Bs_DZS7D.js} +2 -2
- package/dist/client/assets/settings.source-control-Akrp_mGm.js +2 -0
- package/dist/client/assets/settings.storage-fl2BN0Cu.js +2 -0
- package/dist/client/assets/settingsLayout-DV36_Jgq.js +3 -0
- package/dist/client/assets/shield-check-yRjvgn4y.js +1 -0
- package/dist/client/assets/shield-question-mark-DyVUewRO.js +1 -0
- package/dist/client/assets/{sidebar-Dj0htG-5.js → sidebar-MBwCdIpv.js} +2 -2
- package/dist/client/assets/{sidebarProjectGrouping-DxzT7QCQ.js → sidebarProjectGrouping-Sm7y9bd1.js} +2 -2
- package/dist/client/assets/skeleton-CS8ffFVv.js +2 -0
- package/dist/client/assets/{sortable.esm-n8ce5zjO.js → sortable.esm-CwrTFe-B.js} +2 -2
- package/dist/client/assets/{sourceControl-C3RSledt.js → sourceControl-DyHbbOxl.js} +2 -2
- package/dist/client/assets/{spinner-BXr4m38K.js → spinner-B7a-VUeR.js} +2 -2
- package/dist/client/assets/square-menu-dCwciC39.js +2 -0
- package/dist/client/assets/square-pen-BrE59gWn.js +1 -0
- package/dist/client/assets/square-plus-CeFmBUPF.js +2 -0
- package/dist/client/assets/{standalone-page-DSQDdNcR.js → standalone-page-DTvNMgJy.js} +2 -2
- package/dist/client/assets/{stateDiagram-D77RDMKH-DFGb4Fx3.js → stateDiagram-D77RDMKH-gHEAo7xC.js} +2 -2
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-CGT21P8W.js +2 -0
- package/dist/client/assets/{swimlanes-42K2YHIH-D0z9osG6.js → swimlanes-42K2YHIH-_qZ90QGb.js} +2 -2
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-D9Ttx7dQ.js +9 -0
- package/dist/client/assets/terminal-links-Dc2HX7Ov.js +2 -0
- package/dist/client/assets/terminalLabels-BgLOlb2G.js +2 -0
- package/dist/client/assets/{terminalSessions-3aynRXX1.js → terminalSessions-DK9WKgga.js} +2 -2
- package/dist/client/assets/text-search-CFbEY3qo.js +1 -0
- package/dist/client/assets/{textarea-DZLyhzuZ.js → textarea-CYXHTTG6.js} +2 -2
- package/dist/client/assets/themePalette-zVYGoviO.js +5 -0
- package/dist/client/assets/{threadSort-BvhI6zOp.js → threadSort-Byzu7B1A.js} +2 -2
- package/dist/client/assets/{timeline-definition-24CTP7MA-oHM5IS4i.js → timeline-definition-24CTP7MA-BxWmcZQs.js} +2 -2
- package/dist/client/assets/toast-BX9uiMAh.js +2 -0
- package/dist/client/assets/{toggle-BzIEPTf7.js → toggle-fk33ppsB.js} +2 -2
- package/dist/client/assets/{toggle-group-_C7nJPTT.js → toggle-group-W0bDGcPB.js} +2 -2
- package/dist/client/assets/tooltip-B0rhqi5b.js +2 -0
- package/dist/client/assets/{treeView-Q6P3EWNA-ONHv8oqx.js → treeView-Q6P3EWNA-BsPhq-Fl.js} +1 -1
- package/dist/client/assets/{treemap-WGGIJYW6-Go2hwkyn.js → treemap-WGGIJYW6-DZ3fnU-o.js} +1 -1
- package/dist/client/assets/unfold-vertical-BLnEY4R7.js +2 -0
- package/dist/client/assets/usage-DlNazxzV.js +2 -0
- package/dist/client/assets/{usageAccess-BNLOTFbF.js → usageAccess-Mp1Nbm2r.js} +2 -2
- package/dist/client/assets/{usageFormat-DKCO_wk0.js → usageFormat-ZiOrCBxk.js} +2 -2
- package/dist/client/assets/{usageShortcuts-DxLRXv0W.js → usageShortcuts-Be5hddhr.js} +2 -2
- package/dist/client/assets/{use-atom-command-CiEeUGsC.js → use-atom-command-RgcuqzP9.js} +2 -2
- package/dist/client/assets/{useAriaLabelledBy-CJjXf8Fd.js → useAriaLabelledBy-D-n0SDV6.js} +2 -2
- package/dist/client/assets/useHandleNewThread-BQ5wqZab.js +2 -0
- package/dist/client/assets/{useLocation-9axGTsrg.js → useLocation-BN5q7LjL.js} +2 -2
- package/dist/client/assets/useNavigate-CDvr3Yvg.js +2 -0
- package/dist/client/assets/{useNavigateBack-AIHPN0Oo.js → useNavigateBack-BWhsiBJ5.js} +2 -2
- package/dist/client/assets/{useParams-CCV3vN4E.js → useParams-DQgx0pmy.js} +2 -2
- package/dist/client/assets/{usePermissionStatus-BnBF7CdE.js → usePermissionStatus-FtemMvNg.js} +2 -2
- package/dist/client/assets/{usePullRequestActions-aKrHzIiJ.js → usePullRequestActions-D97OVSkM.js} +3 -3
- package/dist/client/assets/useRegisterFieldControl-KOnbOVnX.js +2 -0
- package/dist/client/assets/{useScopedModelAvailability-IKTxpeQL.js → useScopedModelAvailability-BTR7tHpB.js} +2 -2
- package/dist/client/assets/useSettings-BIggY3j1.js +3 -0
- package/dist/client/assets/{useT3ConnectAuthPrompt-CK8il-7e.js → useT3ConnectAuthPrompt-CPGDAWRk.js} +2 -2
- package/dist/client/assets/utils-BxISc9RR.js +37 -0
- package/dist/client/assets/vcsRefInvalidation-h_E9Figo.js +2 -0
- package/dist/client/assets/{vennDiagram-4TSXK5OY-BwVRZPOj.js → vennDiagram-4TSXK5OY-BnH-hzBf.js} +2 -2
- package/dist/client/assets/{wardley-WFR3VGLG-CYl4h3U-.js → wardley-WFR3VGLG-BbiFWq4f.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-VM6X3IG4-yHMYVGhg.js → wardleyDiagram-VM6X3IG4-DPf4ISf5.js} +2 -2
- package/dist/client/assets/welcome-DjYohRu3.js +2 -0
- package/dist/client/assets/{xychartDiagram-S5SC5T6Z-Td7MQ_xN.js → xychartDiagram-S5SC5T6Z-oaZh5sFY.js} +2 -2
- package/dist/client/index.html +11 -8
- package/package.json +1 -1
- package/dist/client/assets/ChatGptUsageButton-7IZqWaQq.js +0 -2
- package/dist/client/assets/CodexSetupSection.logic-DyTuN6tg.js +0 -2
- package/dist/client/assets/ComboboxClear-BXGqqvsR.js +0 -2
- package/dist/client/assets/CompositeRoot-CW06ANMY.js +0 -2
- package/dist/client/assets/DevicePanel-zG3feCFw.js +0 -2
- package/dist/client/assets/DialogTitle-7tvQYVxE.js +0 -2
- package/dist/client/assets/DiffFileTree-BhSPT6m_.js +0 -2
- package/dist/client/assets/DiffPanel-D7QMWq_A.js +0 -2
- package/dist/client/assets/ExpandableText-DfY-qqRW.js +0 -3
- package/dist/client/assets/FilePreviewPanel-CSKeM-xZ.js +0 -34
- package/dist/client/assets/FoldedSettingsSection-BJm8ZaTy.js +0 -2
- package/dist/client/assets/PreviewPanel-BEWZuH6o.js +0 -2
- package/dist/client/assets/ProjectDefaultsSettings-BRRQlvgR.js +0 -2
- package/dist/client/assets/ProjectIconPickerDialog-DXSyEGg8.js +0 -2
- package/dist/client/assets/ProviderModelPicker-CpgHpUCG.js +0 -2
- package/dist/client/assets/ProviderSettingsForm-CaNO8FYK.js +0 -2
- package/dist/client/assets/PullRequestCodeTab-DwqL4aAJ.js +0 -6
- package/dist/client/assets/RedactedSensitiveText-citJBx4E.js +0 -2
- package/dist/client/assets/ScheduledTasksSettings-BXOG7dPV.js +0 -4
- package/dist/client/assets/SettingsPanels-DjzXV7Dm.js +0 -39
- package/dist/client/assets/T3ConnectAccountPages-C6qHq26m.js +0 -2
- package/dist/client/assets/ThreadTerminalDrawer-C1NDkTSs.js +0 -5
- package/dist/client/assets/UsageLimits-BUS51Bjr.js +0 -2
- package/dist/client/assets/WorkspaceBreadcrumb-DX3xH6tC.js +0 -2
- package/dist/client/assets/WorkspacePageContainer-BFo6qTGJ.js +0 -2
- package/dist/client/assets/_chat-B3j3XTUJ.js +0 -58
- package/dist/client/assets/_chat.new-W2E0MZ4y.js +0 -4
- package/dist/client/assets/architecture-7GRP2DOG-nO5xG-8k.js +0 -1
- package/dist/client/assets/archive-x-BN7DYXYC.js +0 -2
- package/dist/client/assets/arrow-left-yEW5WFYj.js +0 -1
- package/dist/client/assets/arrow-right-BzVZfSb7.js +0 -1
- package/dist/client/assets/arrow-up-down-DjL7trCL.js +0 -1
- package/dist/client/assets/assets-BxSVuao2.js +0 -2
- package/dist/client/assets/bell-ue7A6JFg.js +0 -1
- package/dist/client/assets/blocks-De0WwZYY.js +0 -1
- package/dist/client/assets/bot-_T9E-nkd.js +0 -1
- package/dist/client/assets/calendar-clock-DXFNSdXM.js +0 -1
- package/dist/client/assets/channel-BE0ymtNV.js +0 -2
- package/dist/client/assets/chart-no-axes-column-Dx_cyfN9.js +0 -1
- package/dist/client/assets/checkbox-CIeee0-J.js +0 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-YRduSbl9.js +0 -2
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-YRduSbl9.js +0 -2
- package/dist/client/assets/collapsible-C3qenpEI.js +0 -2
- package/dist/client/assets/corner-left-up-DohBMTTI.js +0 -1
- package/dist/client/assets/device-BRhRKysY.js +0 -2
- package/dist/client/assets/download-B587khDU.js +0 -1
- package/dist/client/assets/dynamic-R3OtJZHK.js +0 -3
- package/dist/client/assets/earth-26IFbzWm.js +0 -1
- package/dist/client/assets/ellipsis-BScTTB_n.js +0 -1
- package/dist/client/assets/empty-uoiaKPHo.js +0 -2
- package/dist/client/assets/entities-DNKDCsf2.js +0 -2
- package/dist/client/assets/eventmodeling-NTZA5JFV-6XFarcvj.js +0 -1
- package/dist/client/assets/eye-DTlv8Vet.js +0 -1
- package/dist/client/assets/file-search-gFHOfI6S.js +0 -1
- package/dist/client/assets/flowDiagram-HODETNUW-DQXavjl4.js +0 -1
- package/dist/client/assets/fold-vertical-BNQMJ6gu.js +0 -1
- package/dist/client/assets/folder-cog-CYwPj2H1.js +0 -2
- package/dist/client/assets/folder-git-2-6ON-nxul.js +0 -1
- package/dist/client/assets/folder-open-Rja0vZjv.js +0 -1
- package/dist/client/assets/folder-plus-CfJ5c8wa.js +0 -1
- package/dist/client/assets/git-branch-BuWXMpmq.js +0 -1
- package/dist/client/assets/grip-vertical-qjSy6wXX.js +0 -1
- package/dist/client/assets/hard-drive-DAxFba08.js +0 -1
- package/dist/client/assets/history-CrY611k2.js +0 -1
- package/dist/client/assets/house-CKS51Vx8.js +0 -1
- package/dist/client/assets/index-G0rP4C-v.js +0 -3
- package/dist/client/assets/kbd-D4mDfHPa.js +0 -2
- package/dist/client/assets/keybindings-CzL-fWkh.js +0 -2
- package/dist/client/assets/keyboard-Y7zJXIRo.js +0 -1
- package/dist/client/assets/link-CbhoiCa8.js +0 -1
- package/dist/client/assets/list-Cq4wtMwR.js +0 -1
- package/dist/client/assets/main-D9nJEeym.css +0 -2
- package/dist/client/assets/main-D9z9rMK1.js +0 -27
- package/dist/client/assets/message-circle-question-mark-BwzHSg4C.js +0 -1
- package/dist/client/assets/message-square-DcSgYDZ6.js +0 -1
- package/dist/client/assets/message-square-dashed-Cu56tC0F.js +0 -1
- package/dist/client/assets/mouse-pointer-2-DxhF1Woc.js +0 -1
- package/dist/client/assets/number-field-BLz8W5SU.js +0 -2
- package/dist/client/assets/openFileInPreview-l6IXWIxV.js +0 -2
- package/dist/client/assets/palette-B79srcx1.js +0 -1
- package/dist/client/assets/panel-left-Bp59PK2R.js +0 -1
- package/dist/client/assets/panel-tab-close-button-B2GW1bDy.js +0 -2
- package/dist/client/assets/panels-top-left-CC3HCiIs.js +0 -1
- package/dist/client/assets/plug-B1ccrQcT.js +0 -2
- package/dist/client/assets/popover-6BYEGLLK.js +0 -2
- package/dist/client/assets/primaryCloudLinkState-N7pLty-_.js +0 -2
- package/dist/client/assets/projectFilesQueryState-CrGsc81w.js +0 -2
- package/dist/client/assets/pullRequests-KhjrMCa0.js +0 -2
- package/dist/client/assets/puzzle-Df6hPSJS.js +0 -2
- package/dist/client/assets/queries-Cn1FJB1_.js +0 -2
- package/dist/client/assets/query-CK8MOmXr.js +0 -2
- package/dist/client/assets/radio-group-CM6Ra-QS.js +0 -2
- package/dist/client/assets/railroad-abnf-HS5TGJTU-CIxA0Vp4.js +0 -1
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-Czs81Kdn.js +0 -1
- package/dist/client/assets/railroad-peg-WCYAUIDC-B7O8OPsa.js +0 -1
- package/dist/client/assets/rightPanelStore-6LLb3GY0.js +0 -2
- package/dist/client/assets/rotate-ccw-dcahmZQ2.js +0 -1
- package/dist/client/assets/rotate-cw-CIep6yNT.js +0 -1
- package/dist/client/assets/runtime-BVgeNXTV.js +0 -2
- package/dist/client/assets/runtime-CCr9UADV.js +0 -6
- package/dist/client/assets/select-BiARKKgd.js +0 -2
- package/dist/client/assets/server-B26doYv6.js +0 -2
- package/dist/client/assets/session-CQXL-cTI.js +0 -2
- package/dist/client/assets/session-logic-C0mrkZ0j.js +0 -13
- package/dist/client/assets/settings-2-C2dIdVBr.js +0 -1
- package/dist/client/assets/settings-B5Dj0jhP.js +0 -2
- package/dist/client/assets/settings-DiBtchmK.js +0 -1
- package/dist/client/assets/settings.appearance-Di8HZa2Q.js +0 -2
- package/dist/client/assets/settings.archived-By34XjbG.js +0 -2
- package/dist/client/assets/settings.connections-BJuKrJhl.js +0 -2
- package/dist/client/assets/settings.decisions-BO8hfyYm.js +0 -2
- package/dist/client/assets/settings.diagnostics-DSw1QN-I.js +0 -2
- package/dist/client/assets/settings.general-RyWWgxqp.js +0 -2
- package/dist/client/assets/settings.integrations--N8SMmw7.js +0 -2
- package/dist/client/assets/settings.open-source-licenses-BmgFSigO.js +0 -2
- package/dist/client/assets/settings.projects--jLA2A5b.js +0 -4
- package/dist/client/assets/settings.providers-Cvt1-bmr.js +0 -3
- package/dist/client/assets/settings.scheduled-tasks-D5IG4nj_.js +0 -2
- package/dist/client/assets/settings.source-control-R63Z9kEM.js +0 -2
- package/dist/client/assets/settings.storage-J1kthey9.js +0 -2
- package/dist/client/assets/settingsLayout-BzyY4qHt.js +0 -3
- package/dist/client/assets/shield-check-k2SY7zjx.js +0 -2
- package/dist/client/assets/shield-question-mark-l31p7uuJ.js +0 -1
- package/dist/client/assets/skeleton-CtSxs1y1.js +0 -2
- package/dist/client/assets/square-menu-Bq3HnG2U.js +0 -2
- package/dist/client/assets/square-pen-CxvvUOOt.js +0 -1
- package/dist/client/assets/square-plus-B9j2jkOq.js +0 -2
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-BFcRJjAO.js +0 -2
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-B7z2b1Qv.js +0 -9
- package/dist/client/assets/text-search-DsadxNJw.js +0 -1
- package/dist/client/assets/themePalette-BZeqG2Hu.js +0 -5
- package/dist/client/assets/toast-Bm36EaG6.js +0 -2
- package/dist/client/assets/tooltip-Df-4YKs5.js +0 -2
- package/dist/client/assets/unfold-vertical--twzQtvn.js +0 -1
- package/dist/client/assets/usage-B26GT0RK.js +0 -2
- package/dist/client/assets/useHandleNewThread-DTz3ztCG.js +0 -2
- package/dist/client/assets/useNavigate-BK_XZ1It.js +0 -2
- package/dist/client/assets/useRegisterFieldControl-Daf1iBkI.js +0 -2
- package/dist/client/assets/useSettings-CckatJFa.js +0 -3
- package/dist/client/assets/utils-DmS758az.js +0 -37
- package/dist/client/assets/vcsRefInvalidation-lkYjTxah.js +0 -2
- package/dist/client/assets/welcome-CGBWwWzE.js +0 -2
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$b as n,Gn as r,Ho as i,Yn as a,Zn as o,du as s,fu as c,ha as l,hs as u,jx as d,l as f,lu as p,or as m,pu as h,sr as g,t as _,uu as v,vm as y}from"./utils-BxISc9RR.js";import{t as b}from"./box-CKWcQvdq.js";import{t as x}from"./chevron-down-DHV04o66.js";import{t as S}from"./plus-Cr075-cy.js";import{t as C}from"./plug-Cdxb0djR.js";import{t as w}from"./refresh-cw-PY_ECjtI.js";import{t as T}from"./search-Cr9eaeTj.js";import{t as E}from"./trash-2-CiyAV2xI.js";import{a as D,n as O,t as k}from"./tooltip-B0rhqi5b.js";import{n as A}from"./ChatMarkdown-C6UsXjP9.js";import{a as j,c as M,o as ee,s as te,t as ne}from"./select-CjGEfXy_.js";import{t as N}from"./useLocation-BN5q7LjL.js";import{p as P}from"./toast-BX9uiMAh.js";import{C as F}from"./useSettings-BIggY3j1.js";import{f as I}from"./server-BYntb2dN.js";import{t as L}from"./use-atom-command-RgcuqzP9.js";import{s as R,u as re}from"./providerSkills-D0IxW0_5.js";import{t as z}from"./skeleton-CS8ffFVv.js";import{t as B}from"./textarea-CYXHTTG6.js";import{n as ie,t as V}from"./toggle-group-W0bDGcPB.js";import{t as H}from"./input-DaCwubQj.js";import{c as U,r as ae,s as oe,t as se}from"./dialog-CPLO59bH.js";import{i as W,o as G,r as K,t as ce}from"./empty-tr-EsB66.js";import{n as le,r as ue,t as de}from"./input-group-DJwXFHGO.js";import{a as fe}from"./projectFilesQueryState-C1crs3C8.js";import{B as pe,P as q,U as J,a as me,i as he,s as ge}from"./settingsLayout-DV36_Jgq.js";import{Ar as _e,Fr as ve,Ir as ye,La as be,Mr as xe,Ni as Se,Nr as Ce,Pr as we,Qo as Te,bs as Ee,ir as De,jr as Oe,no as ke,uo as Ae}from"./main-uLg3xUJM.js";import{t as je}from"./SecretInput-CNWNAhNe.js";var Y=d(),Me={spawn:`Failed to start`,timeout:`Timed out`,protocol:`Not an MCP server`,http:`Can't connect`,auth:`Credentials rejected`};function Ne(e,t,n){if(!e.enabled)return{tone:`muted`,label:`Off`,needsSignIn:!1};if(n)return{tone:`muted`,label:`Checking…`,needsSignIn:!1};let r=e.transport.type===`http`&&e.transport.auth===`oauth`;if(r&&t?.auth===`signed-out`)return{tone:`warning`,label:`Needs sign-in`,needsSignIn:!0};let i=t?.health;switch(i?.status){case`connected`:return{tone:`success`,label:`Connected · ${i.toolCount} ${i.toolCount===1?`tool`:`tools`}`,needsSignIn:!1};case`needs-auth`:return{tone:`warning`,label:`Needs sign-in`,needsSignIn:r};case`error`:return{tone:`error`,label:Me[i.category],detail:i.message,needsSignIn:!1};default:return{tone:`muted`,label:`Not checked`,needsSignIn:!1}}}function Pe(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(l(),1);function Fe({environmentId:e,plugin:t,enabled:s,disabled:c,onDetails:l,onToggle:d}){let f=i(fe(e,t.path,`.claude-plugin/plugin.json`)),p=n(u(f)),h,_;try{let e=p&&!p.truncated?JSON.parse(p.contents):null;if(typeof e==`object`&&e&&(`description`in e&&typeof e.description==`string`&&(h=e.description),`author`in e)){let t=e.author;typeof t==`string`?_=t:typeof t==`object`&&t&&`name`in t&&typeof t.name==`string`&&(_=t.name)}}catch{}let v=re(e);return(0,Z.jsxs)(`li`,{className:`flex items-center gap-4 py-4`,children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`flex size-10 shrink-0 items-center justify-center rounded-xl border border-border/60 bg-muted`,children:(0,Z.jsx)(Ae,{className:`size-5 text-muted-foreground`})}),(0,Z.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-1`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2`,children:[(0,Z.jsx)(`span`,{className:`break-words text-sm font-medium`,children:t.name}),_?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:_}):null]}),(0,Z.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:h??`Local Claude plugin`})]}),(0,Z.jsxs)(r,{children:[(0,Z.jsxs)(k,{children:[(0,Z.jsx)(D,{render:(0,Z.jsx)(m,{render:(0,Z.jsx)(g,{variant:`ghost`,size:`icon-sm`,"aria-label":`More for ${t.name}`,children:(0,Z.jsx)(Te,{"aria-hidden":!0})})})}),(0,Z.jsx)(O,{children:`Plugin actions`})]}),(0,Z.jsxs)(o,{align:`end`,children:[v.capabilities.canOpenDefault?(0,Z.jsx)(a,{onClick:()=>void v.activate(`open`,{environmentId:e,filePath:t.path,workspaceRoot:void 0}),children:`Open`}):null,(0,Z.jsx)(a,{onClick:l,children:`Details`})]})]}),(0,Z.jsx)(be,{"aria-label":`Load ${t.name}`,checked:s,disabled:c,onCheckedChange:d})]})}var Ie=[`Personal`,`Built-in`,`Project`,`Plugins`,`Other`];function Le(e){switch(R(e)){case`personal`:return`Personal`;case`system`:return`Built-in`;case`repo`:case`project`:return`Project`;case`app`:return`Plugins`;default:return`Other`}}var Re=[[`codex`,`Codex`],[`claudeAgent`,`Claude`],[`cursor`,`Cursor`],[`grok`,`Grok`],[`antigravity`,`Antigravity`],[`opencode`,`OpenCode`],[`muse`,`Muse`],[`pi`,`Pi`]],ze={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 Be(e){return Re.map(([t,n])=>{let r=s(t,e.transport),i=y.make(t);return{driver:i,label:n,enabled:r.supported&&!e.disabledProviders.includes(i),...r.supported?{}:{unsupported:ze[r.reason]}}})}var Ve={name:``,type:`stdio`,command:``,args:``,cwd:``,url:``,auth:`none`,values:[]};function He(e){let t=e.transport;return t.type===`stdio`?{...Ve,name:e.name,type:`stdio`,command:t.command,args:t.args.join(`
|
|
2
|
+
`),cwd:t.cwd??``,values:Object.entries(t.env).map(([e,t])=>({key:e,value:t}))}:{...Ve,name:e.name,type:`http`,url:t.url,auth:t.auth,values:Object.entries(t.headers).map(([e,t])=>({key:e,value:t}))}}var Q=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;function Ue(e,t){let n=e.name.trim();if(!n)return`Enter a name.`;if(!Q.test(n)||n.length>64)return`Use letters, numbers, dashes, and underscores.`;if(n===`t3-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 We(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
|
+
`).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 Ge(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)=>Ke(e.skill).localeCompare(Ke(t.skill)))}var Ke=e=>e.displayName??e.name.split(/[-_\s]+/).filter(e=>e.length>0).map(e=>e[0].toUpperCase()+e.slice(1)).join(` `);function qe(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 Je(e){let t=/^---\r?\n[\s\S]*?\r?\n---\r?\n?/.exec(e);return(t===null?e:e.slice(t[0].length)).trimStart()}function Ye(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,Z.jsx)(Ee,{"aria-hidden":!0}),t[0]=o):o=t[0];let s;t[1]===r?s=t[2]:(s=(0,Z.jsxs)(g,{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,Z.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,Z.jsxs)(g,{size:`sm`,variant:`destructive-outline`,onClick:i,children:[(0,Z.jsx)(E,{"aria-hidden":!0}),`Uninstall`]}):null,t[5]=i,t[6]=l);let u;t[7]!==c||t[8]!==l?(u=(0,Z.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,Z.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,Z.jsx)(Se,{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,Z.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 Xe(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?Ve:He(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=Ue(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 _=h!==u,v;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>c(t=>({...t,...e})),t[9]=v):v=t[9];let y=v,b=s.type===`stdio`?`Environment variables`:`Headers`,x;t[10]===s.values?x=t[11]:(x=(e,t)=>y({values:s.values.map((n,r)=>r===e?{...n,...t}:n)}),t[10]=s.values,t[11]=x);let C=x,w;t[12]!==_||t[13]!==s||t[14]!==i||t[15]!==m||t[16]!==n?(w=e=>{e.preventDefault(),_&&m===void 0&&i(We(s,n))},t[12]=_,t[13]=s,t[14]=i,t[15]=m,t[16]=n,t[17]=w):w=t[17];let T;t[18]===n?T=t[19]:(T=n===void 0?null:(0,Z.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]=T);let D;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>y({name:e.target.value}),t[20]=D):D=t[20];let O;t[21]===s.name?O=t[22]:(O=(0,Z.jsx)($,{label:`Name`,htmlFor:`mcp-server-name`,children:(0,Z.jsx)(H,{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,Z.jsx)($,{label:`Type`,children:(0,Z.jsxs)(ie,{"aria-label":`How P4 Code reaches the server`,value:[s.type],onValueChange:e=>{let t=e[0];(t===`stdio`||t===`http`)&&y({type:t,values:[]})},children:[(0,Z.jsx)(V,{value:`stdio`,children:`Command`}),(0,Z.jsx)(V,{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,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($,{label:`Command`,htmlFor:`mcp-server-command`,children:(0,Z.jsx)(H,{id:`mcp-server-command`,placeholder:`npx`,value:s.command,onChange:e=>y({command:e.target.value})})}),(0,Z.jsx)($,{label:`Arguments, one per line`,htmlFor:`mcp-server-args`,children:(0,Z.jsx)(B,{id:`mcp-server-args`,placeholder:`-y
|
|
4
|
+
@modelcontextprotocol/server-postgres`,value:s.args,onChange:e=>y({args:e.target.value})})}),(0,Z.jsx)($,{label:`Working directory (optional)`,htmlFor:`mcp-server-cwd`,children:(0,Z.jsx)(H,{id:`mcp-server-cwd`,placeholder:`The session's project folder`,value:s.cwd,onChange:e=>y({cwd:e.target.value})})})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($,{label:`URL`,htmlFor:`mcp-server-url`,children:(0,Z.jsx)(H,{id:`mcp-server-url`,placeholder:`https://mcp.example.com/mcp`,value:s.url,onChange:e=>y({url:e.target.value})})}),(0,Z.jsx)($,{label:`Authentication`,children:(0,Z.jsxs)(ne,{value:s.auth,onValueChange:e=>{(e===`none`||e===`oauth`)&&y({auth:e})},children:[(0,Z.jsx)(te,{"aria-label":`Authentication`,children:(0,Z.jsx)(M,{children:Ze})}),(0,Z.jsxs)(ee,{alignItemWithTrigger:!1,children:[(0,Z.jsx)(j,{value:`none`,children:`None or headers`}),(0,Z.jsx)(j,{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 N;t[33]!==s.type||t[34]!==s.values||t[35]!==C||t[36]!==b?(N=s.values.map((e,t)=>(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(H,{"aria-label":`${b} name`,placeholder:s.type===`stdio`?`API_TOKEN`:`Authorization`,value:e.key,onChange:e=>C(t,{key:e.target.value})}),(0,Z.jsx)(je,{"aria-label":`${b} value`,placeholder:`Value`,value:e.value,onChange:e=>C(t,{value:e.target.value})}),(0,Z.jsx)(g,{size:`icon-sm`,variant:`ghost`,"aria-label":`Remove ${e.key||`row`}`,onClick:()=>y({values:s.values.filter((e,n)=>n!==t)}),children:(0,Z.jsx)(E,{"aria-hidden":!0})})]},t)),t[33]=s.type,t[34]=s.values,t[35]=C,t[36]=b,t[37]=N):N=t[37];let P;t[38]===s.values?P=t[39]:(P=()=>y({values:[...s.values,{key:``,value:``}]}),t[38]=s.values,t[39]=P);let F;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Z.jsx)(S,{"aria-hidden":!0}),t[40]=F):F=t[40];let I=s.type===`stdio`?`variable`:`header`,L;t[41]!==P||t[42]!==I?(L=(0,Z.jsxs)(g,{variant:`soft`,onClick:P,children:[F,`Add `,I]}),t[41]=P,t[42]=I,t[43]=L):L=t[43];let R;t[44]!==N||t[45]!==L?(R=(0,Z.jsxs)(`div`,{className:`grid gap-2`,children:[N,L]}),t[44]=N,t[45]=L,t[46]=R):R=t[46];let re;t[47]!==R||t[48]!==b?(re=(0,Z.jsx)($,{label:b,children:R}),t[47]=R,t[48]=b,t[49]=re):re=t[49];let z;t[50]!==O||t[51]!==k||t[52]!==A||t[53]!==re?(z=(0,Z.jsxs)(J,{children:[O,k,A,re]}),t[50]=O,t[51]=k,t[52]=A,t[53]=re,t[54]=z):z=t[54];let U;t[55]!==_||t[56]!==m?(U=_&&m!==void 0?(0,Z.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-foreground`,children:m}):null,t[55]=_,t[56]=m,t[57]=U):U=t[57];let ae=!_||m!==void 0,oe=n===void 0?`Add server`:`Save`,se;t[58]!==ae||t[59]!==oe?(se=(0,Z.jsx)(g,{type:`submit`,disabled:ae,children:oe}),t[58]=ae,t[59]=oe,t[60]=se):se=t[60];let W;t[61]!==U||t[62]!==se?(W=(0,Z.jsxs)(`div`,{className:`flex items-center justify-end gap-3`,children:[U,se]}),t[61]=U,t[62]=se,t[63]=W):W=t[63];let G;return t[64]!==z||t[65]!==W||t[66]!==w||t[67]!==T?(G=(0,Z.jsxs)(`form`,{className:`grid gap-3`,onSubmit:w,children:[T,z,W]}),t[64]=z,t[65]=W,t[66]=w,t[67]=T,t[68]=G):G=t[68],G}function Ze(e){return e===`oauth`?`OAuth (sign in after saving)`:`None or headers`}function Qe(e){let t=(0,Y.c)(35),{plugin:n,environmentLabel:r,onSave:i}=e,[a,o]=(0,X.useState)(n?.name??``),[s,c]=(0,X.useState)(n?.path??``),l=`${n?.name??``}\u0000${n?.path??``}`,[u,d]=(0,X.useState)(l);l!==u&&(d(l),o(n?.name??``),c(n?.path??``));let f=a!==(n?.name??``)||s!==(n?.path??``),p;t[0]!==a||t[1]!==s?(p=a.trim().length>0&&s.trim().startsWith(`/`),t[0]=a,t[1]=s,t[2]=p):p=t[2];let m=p,h;t[3]!==f||t[4]!==a||t[5]!==i||t[6]!==s||t[7]!==n?.enabled||t[8]!==m?(h=e=>{e.preventDefault(),f&&m&&i({name:a.trim(),path:s.trim(),enabled:n?.enabled??!0})},t[3]=f,t[4]=a,t[5]=i,t[6]=s,t[7]=n?.enabled,t[8]=m,t[9]=h):h=t[9];let _;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>o(e.target.value),t[10]=_):_=t[10];let v;t[11]===a?v=t[12]:(v=(0,Z.jsx)($,{label:`Name`,htmlFor:`plugin-name`,children:(0,Z.jsx)(H,{id:`plugin-name`,value:a,onChange:_})}),t[11]=a,t[12]=v);let y=`Folder on ${r}`,b;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(b=e=>c(e.target.value),t[13]=b):b=t[13];let x;t[14]===s?x=t[15]:(x=(0,Z.jsx)(H,{id:`plugin-path`,placeholder:`/Users/me/plugins/my-plugin`,value:s,onChange:b}),t[14]=s,t[15]=x);let S;t[16]!==y||t[17]!==x?(S=(0,Z.jsx)($,{label:y,htmlFor:`plugin-path`,children:x}),t[16]=y,t[17]=x,t[18]=S):S=t[18];let C;t[19]!==v||t[20]!==S?(C=(0,Z.jsxs)(J,{children:[v,S]}),t[19]=v,t[20]=S,t[21]=C):C=t[21];let w;t[22]!==f||t[23]!==m?(w=f&&!m?(0,Z.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-foreground`,children:`Enter a name and the plugin folder's full path.`}):null,t[22]=f,t[23]=m,t[24]=w):w=t[24];let T=!f||!m,E=n===void 0?`Add plugin`:`Save`,D;t[25]!==T||t[26]!==E?(D=(0,Z.jsx)(g,{type:`submit`,disabled:T,children:E}),t[25]=T,t[26]=E,t[27]=D):D=t[27];let O;t[28]!==w||t[29]!==D?(O=(0,Z.jsxs)(`div`,{className:`flex items-center justify-end gap-3`,children:[w,D]}),t[28]=w,t[29]=D,t[30]=O):O=t[30];let k;return t[31]!==O||t[32]!==h||t[33]!==C?(k=(0,Z.jsxs)(`form`,{className:`grid gap-3`,onSubmit:h,children:[C,O]}),t[31]=O,t[32]=h,t[33]=C,t[34]=k):k=t[34],k}var $e=e=>e.replace(/[\\/][^\\/]*$/,``)||`/`;function et(e){let t=(0,Y.c)(69),{entry:s,environmentId:c,onClose:l}=e,{skill:d,providers:f}=s,p,h,_;t[0]!==c||t[1]!==d.path?(p=$e(d.path),h=i,_=fe(c,p,d.path),t[0]=c,t[1]=d.path,t[2]=p,t[3]=h,t[4]=_):(p=t[2],h=t[3],_=t[4]);let v=h(_),y;t[5]===v?y=t[6]:(y=n(u(v)),t[5]=v,t[6]=y);let x=y,S=re(c),{copyToClipboard:C}=P(),w;t[7]!==c||t[8]!==d.path?(w={environmentId:c,filePath:d.path,workspaceRoot:void 0},t[7]=c,t[8]=d.path,t[9]=w):w=t[9];let T=w,E=d.shortDescription??d.description,D;t[10]===d.scope?D=t[11]:(D=qe(d.scope),t[10]=d.scope,t[11]=D);let O=D,k;t[12]===l?k=t[13]:(k=e=>!e&&l(),t[12]=l,t[13]=k);let j;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Z.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,Z.jsx)(b,{className:`size-5`})}),t[14]=j):j=t[14];let M;t[15]===d?M=t[16]:(M=Ke(d),t[15]=d,t[16]=M);let ee=`More for ${M}`,te;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,Z.jsx)(Te,{"aria-hidden":!0}),t[17]=te):te=t[17];let ne;t[18]===ee?ne=t[19]:(ne=(0,Z.jsx)(m,{render:(0,Z.jsx)(g,{size:`icon-sm`,variant:`ghost`,"aria-label":ee,children:te})}),t[18]=ee,t[19]=ne);let N;t[20]!==S||t[21]!==T?(N=S.capabilities.canOpenDefault?(0,Z.jsx)(a,{onClick:()=>void S.activate(`open`,T),children:`Open`}):null,t[20]=S,t[21]=T,t[22]=N):N=t[22];let F;t[23]!==S||t[24]!==T?(F=S.capabilities.revealLabel?(0,Z.jsx)(a,{onClick:()=>void S.activate(`reveal-in-folder`,T),children:S.capabilities.revealLabel}):null,t[23]=S,t[24]=T,t[25]=F):F=t[25];let I=x===null,L;t[26]!==C||t[27]!==x?(L=()=>x&&C(x.contents,void 0),t[26]=C,t[27]=x,t[28]=L):L=t[28];let R;t[29]!==I||t[30]!==L?(R=(0,Z.jsx)(a,{disabled:I,onClick:L,children:`Copy Markdown`}),t[29]=I,t[30]=L,t[31]=R):R=t[31];let B;t[32]!==N||t[33]!==F||t[34]!==R?(B=(0,Z.jsxs)(o,{align:`end`,children:[N,F,R]}),t[32]=N,t[33]=F,t[34]=R,t[35]=B):B=t[35];let ie;t[36]!==ne||t[37]!==B?(ie=(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3 pe-8`,children:[j,(0,Z.jsxs)(r,{children:[ne,B]})]}),t[36]=ne,t[37]=B,t[38]=ie):ie=t[38];let V;t[39]===d?V=t[40]:(V=Ke(d),t[39]=d,t[40]=V);let H;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,Z.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`Skill`}),t[41]=H):H=t[41];let W;t[42]===V?W=t[43]:(W=(0,Z.jsxs)(U,{children:[V,` `,H]}),t[42]=V,t[43]=W);let G;t[44]===E?G=t[45]:(G=E?(0,Z.jsx)(ae,{children:E}):null,t[44]=E,t[45]=G);let K;t[46]!==W||t[47]!==G?(K=(0,Z.jsxs)(`div`,{className:`grid gap-1.5`,children:[W,G]}),t[46]=W,t[47]=G,t[48]=K):K=t[48];let ce;t[49]!==p||t[50]!==c||t[51]!==x||t[52]!==v?(ce=(0,Z.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:x===null?v._tag===`Failure`?(0,Z.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,Z.jsxs)(`div`,{className:`grid gap-2`,children:[(0,Z.jsx)(z,{className:`h-4 w-3/4`}),(0,Z.jsx)(z,{className:`h-4 w-full`}),(0,Z.jsx)(z,{className:`h-4 w-2/3`})]}):(0,Z.jsx)(A,{text:Je(x.contents),cwd:p,environmentId:c})}),t[49]=p,t[50]=c,t[51]=x,t[52]=v,t[53]=ce):ce=t[53];let le;t[54]===f?le=t[55]:(le=f.join(`, `),t[54]=f,t[55]=le);let ue=`Loaded by ${le}`,de;t[56]!==O||t[57]!==ue?(de=[O,ue].filter(Boolean),t[56]=O,t[57]=ue,t[58]=de):de=t[58];let pe=de.join(` · `),q;t[59]===pe?q=t[60]:(q=(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:pe}),t[59]=pe,t[60]=q);let J;t[61]!==ie||t[62]!==K||t[63]!==ce||t[64]!==q?(J=(0,Z.jsx)(oe,{className:`max-w-2xl`,children:(0,Z.jsxs)(`div`,{className:`grid min-h-0 gap-4 p-6`,children:[ie,K,ce,q]})}),t[61]=ie,t[62]=K,t[63]=ce,t[64]=q,t[65]=J):J=t[65];let me;return t[66]!==J||t[67]!==k?(me=(0,Z.jsx)(se,{open:!0,onOpenChange:k,children:J}),t[66]=J,t[67]=k,t[68]=me):me=t[68],me}var tt={claude:`Claude`,codex:`Codex`,cursor:`Cursor`},nt={success:`bg-success`,warning:`bg-warning`,error:`bg-destructive`,muted:`bg-muted-foreground/40`},rt={success:`text-success-foreground`,warning:`text-warning-foreground`,error:`text-destructive-foreground`,muted:`text-muted-foreground`};function it(e){let t=(0,Y.c)(13),{status:n,className:r}=e,i=rt[n.tone],a;t[0]!==r||t[1]!==i?(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=nt[n.tone],s;t[3]===o?s=t[4]:(s=_(`size-1.5 shrink-0 rounded-full`,o),t[3]=o,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,Z.jsx)(`span`,{"aria-hidden":!0,className:s}),t[5]=s,t[6]=c);let l;t[7]===n.label?l=t[8]:(l=(0,Z.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,Z.jsxs)(`span`,{className:a,children:[c,l]}),t[9]=a,t[10]=c,t[11]=l,t[12]=u):u=t[12],u}function at(){let e=(0,Y.c)(6),{environment:t,scope:n}=pe(),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,Z.jsx)(he,{width:`wide`,children:t===null||!r?(0,Z.jsx)(ce,{children:(0,Z.jsxs)(W,{children:[(0,Z.jsx)(G,{children:`Connect to manage plugins and MCP servers`}),(0,Z.jsx)(K,{children:`They live on each environment. Choose a connected one above.`})]})}):!a||i===null?(0,Z.jsx)(ce,{children:(0,Z.jsxs)(W,{children:[(0,Z.jsxs)(G,{children:[`Update `,t.label,` to manage plugins and MCP servers`]}),(0,Z.jsx)(K,{children:`This environment runs a version without them.`})]})}):(0,Z.jsx)(lt,{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 ot={plugins:`Search plugins`,mcps:`Search MCP servers`,skills:`Search skills`},st=(e,...t)=>e===``||t.some(t=>t.toLowerCase().includes(e));function ct(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,Z.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,Z.jsx)(D,{render:s,children:n}),l=(0,Z.jsx)(O,{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,Z.jsxs)(k,{open:i,onOpenChange:o,children:[c,l]}),t[5]=i,t[6]=c,t[7]=l,t[8]=u):u=t[8],u}function lt({environmentId:e,environmentLabel:t,projectId:n,projectLabel:s}){let l=N({select:e=>e.hash}),[u,d]=(0,X.useState)(()=>l.replace(/^#/,``)===`mcp-servers`?`mcps`:l.replace(/^#/,``)===`skills`?`skills`:`plugins`),[_,y]=(0,X.useState)(``),[S,E]=(0,X.useState)(`All categories`),A=i(I.configValueAtom(e))?.providers,P=(0,X.useMemo)(()=>Ge(A??[]),[A]),[R,z]=(0,X.useState)(null),B=q(e=>e.mcpServers),H=q(e=>e.plugins),U=q(e=>e.projectSettingsOverrides),ae=q(e=>e.skillOverrides),oe=re(e),se=i(I.updateSettings.permissionAtom(e)),[W,G]=(0,X.useState)(null),K=i(I.mcpRegistryTest.permissionAtom(e)),ce=F(e),fe=L(I.updateSettings,{label:`update MCP registry`,reportFailure:!0}),pe=L(I.mcpRegistryState,{reportFailure:!1}),J=L(I.mcpRegistryTest,{label:`check MCP server`,reportFailure:!0}),me=L(I.mcpRegistryOAuthStart,{label:`start MCP sign-in`,reportFailure:!0}),he=L(I.mcpRegistryOAuthSignOut,{label:`sign out of MCP server`,reportFailure:!0}),Se=L(I.mcpRegistryDiscover,{reportFailure:!1}),Ee=L(I.mcpRegistryImport,{label:`import MCP servers`,reportFailure:!0}),[je,Y]=(0,X.useState)({}),[Me,Re]=(0,X.useState)(new Set),[ze,Be]=(0,X.useState)([]),[Ve,He]=(0,X.useState)({kind:`list`}),Q=Ve.kind!==`list`&&Ve.id!==null&&(Ve.kind===`server`?B[Ve.id]===void 0:H[Ve.id]===void 0)?{kind:`list`}:Ve,[Ue,We]=(0,X.useState)(l);if(l!==Ue){We(l);let e=l.replace(/^#/,``);(e===`mcp-servers`||e===`plugins`||e===`skills`)&&(d(e===`mcp-servers`?`mcps`:e),He({kind:`list`}))}let[qe,Je]=(0,X.useState)(null),[$,Ze]=(0,X.useState)(null),$e=(0,X.useMemo)(()=>Object.entries(B).map(([e,t])=>[p.make(e),t]).toSorted(([,e],[,t])=>e.name.localeCompare(t.name)),[B]),nt=(0,X.useMemo)(()=>Object.entries(H).map(([e,t])=>[v.make(e),t]),[H]),rt=(0,X.useCallback)(async()=>{let t=await pe({environmentId:e,input:{}});t._tag===`Success`&&Y(t.value.servers)},[e,pe]),at=(0,X.useCallback)(async()=>{if(!K)return;let t=await Se({environmentId:e,input:n===void 0?{}:{projectId:n}});t._tag===`Success`&&Be(t.value.servers)},[K,Se,e,n]);(0,X.useEffect)(()=>{rt(),at()},[rt,at]),(0,X.useEffect)(()=>{if($===null)return;let e=()=>void rt();return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[$,rt]);let lt=e=>{d(`mcps`),He({kind:`server`,id:e})},ut=e=>{d(`plugins`),He({kind:`plugin`,id:e})},pt=t=>fe({environmentId:e,input:{patch:t}}),mt=async t=>{Re(e=>new Set(e).add(t));let n=await J({environmentId:e,input:{serverId:t}});Re(e=>{let n=new Set(e);return n.delete(t),n}),n._tag===`Success`&&Y(e=>({...e,[t]:n.value}))},ht=async(e,t,n)=>{(await pt({mcpServers:{[e]:t}}))._tag===`Success`&&(n&&He({kind:`list`}),at(),t.enabled&&await mt(e))},gt=async t=>{let n=ce??window.location.origin,r=await me({environmentId:e,input:{serverId:t,origin:new URL(n,window.location.href).origin}});if(r._tag===`Success`){if(r.value.authorizationUrl===null){await mt(t);return}Ze(t),window.open(r.value.authorizationUrl,`_blank`,`noopener,noreferrer`)}},_t=(e,t,r)=>{if(n===void 0)return;let i=U[n]??{},a={...i[e]};r===void 0?delete a[t]:a[t]={enabled:r},pt({projectSettingsOverrides:{[n]:{...i,[e]:a}}})},vt=async()=>{let t=qe;if(Je(null),t!==null){if(t.kind===`server`){let n=B[t.id];n?.transport.type===`http`&&n.transport.auth===`oauth`&&await he({environmentId:e,input:{serverId:t.id}}),await pt({mcpServers:{[t.id]:null}})}else await pt({plugins:{[t.id]:null}});He({kind:`list`})}},yt=ze.filter(e=>!e.alreadyAdded),bt=new Set($e.filter(([e])=>Q.kind!==`server`||e!==Q.id).map(([,e])=>e.name)),xt=_.trim().toLowerCase(),St=$e.filter(([,e])=>st(xt,e.name,Pe(e))),Ct=nt.filter(([,e])=>st(xt,e.name,e.path)),wt=yt.filter(e=>st(xt,e.name,e.summary)),Tt=(e,t)=>c({mcpServers:B,plugins:H,projectSettingsOverrides:U},e,n??null,t),Et=(e,t,r)=>{if(n!==void 0){_t(e,t,r);return}pt(e===`mcpServers`?{mcpServers:{[t]:{...B[t],enabled:r}}}:{plugins:{[t]:{...H[t],enabled:r}}})},Dt=(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,Z.jsxs)(`div`,{className:`grid gap-1`,children:[(0,Z.jsx)(`h1`,{className:`text-2xl font-semibold text-foreground`,children:`Plugins`}),(0,Z.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Manage plugins, skills, and MCP servers given to agents on `,t,`.`]})]}),K?(0,Z.jsxs)(r,{children:[(0,Z.jsx)(m,{render:(0,Z.jsxs)(g,{children:[`Add`,(0,Z.jsx)(x,{"aria-hidden":!0})]})}),(0,Z.jsxs)(o,{align:`end`,children:[(0,Z.jsxs)(a,{onClick:()=>lt(null),children:[(0,Z.jsx)(C,{"aria-hidden":!0}),`Add MCP server`]}),(0,Z.jsxs)(a,{onClick:()=>ut(null),children:[(0,Z.jsx)(Ae,{"aria-hidden":!0}),`Add plugin`]})]})]}):null]}),Ot=(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsxs)(ie,{"aria-label":`Show`,variant:`default`,value:[u],onValueChange:e=>{let t=e[0];(t===`plugins`||t===`mcps`||t===`skills`)&&(d(t),He({kind:`list`}))},children:[(0,Z.jsxs)(V,{value:`plugins`,...De(`plugins`),children:[`Plugins `,(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:nt.length})]}),(0,Z.jsxs)(V,{value:`mcps`,...De(`mcp-servers`),children:[`MCPs `,(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:$e.length})]}),(0,Z.jsxs)(V,{value:`skills`,...De(`skills`),children:[`Skills `,(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:P.length})]})]}),(0,Z.jsxs)(`div`,{className:`flex w-full gap-2 sm:w-auto`,children:[u===`skills`?(0,Z.jsx)(`div`,{className:`w-fit shrink-0`,children:(0,Z.jsxs)(ne,{value:S,onValueChange:e=>e&&E(e),children:[(0,Z.jsx)(te,{"aria-label":`Skill category`,children:(0,Z.jsx)(M,{})}),(0,Z.jsxs)(ee,{children:[(0,Z.jsx)(j,{value:`All categories`,children:`All categories`}),Ie.filter(e=>e===`Personal`||e===`Built-in`||P.some(({skill:t})=>Le(t)===e)).map(e=>(0,Z.jsx)(j,{value:e,children:e},e))]})]})}):null,(0,Z.jsxs)(de,{className:`min-w-0 flex-1 sm:w-56`,children:[(0,Z.jsx)(le,{children:(0,Z.jsx)(T,{"aria-hidden":!0})}),(0,Z.jsx)(ue,{"aria-label":ot[u],placeholder:ot[u],value:_,onChange:e=>y(e.currentTarget.value)})]})]})]}),kt=(e,t)=>(0,Z.jsxs)(k,{children:[(0,Z.jsx)(D,{render:(0,Z.jsx)(g,{size:`icon-sm`,variant:`ghost`,"aria-label":e,onClick:t,children:(0,Z.jsx)(ke,{"aria-hidden":!0})})}),(0,Z.jsx)(O,{children:e})]}),At=Ct.length===0?(0,Z.jsx)(`p`,{className:`py-6 text-sm text-muted-foreground`,children:nt.length===0?`No plugins yet. Add a Claude Code plugin folder to load it in Claude sessions.`:`No plugins match your search.`}):(0,Z.jsx)(`ul`,{className:`grid gap-1`,children:Ct.map(([t,n])=>(0,Z.jsx)(Fe,{environmentId:e,plugin:n,enabled:Tt(`plugins`,t),disabled:!se,onDetails:()=>ut(t),onToggle:e=>Et(`plugins`,t,e)},t))}),jt=P.filter(({skill:e})=>(S===`All categories`||Le(e)===S)&&st(xt,Ke(e),e.name,e.shortDescription??``,e.description??``)),Mt=jt.length===0?(0,Z.jsx)(`p`,{className:`py-6 text-sm text-muted-foreground`,children:P.length===0?`No skills found. Providers report the skills they load when they start.`:`No skills match these filters.`}):(0,Z.jsxs)(`div`,{className:`grid gap-3`,children:[(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Switches apply to new Claude and OpenCode sessions.`}),(0,Z.jsx)(`ul`,{className:`grid gap-1`,children:jt.map(t=>{let i=Le(t.skill),s=(A??[]).filter(e=>h(e.driver)&&e.skills.some(e=>e.name===t.skill.name)),c=s.length?s.map(e=>e.displayName??e.driver).join(`, `):`Native settings`;return(0,Z.jsxs)(`li`,{className:`flex items-center gap-3 py-3`,children:[(0,Z.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,Z.jsx)(b,{className:`size-4`})}),(0,Z.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-1`,children:[(0,Z.jsx)(`button`,{type:`button`,onClick:()=>z(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:Ke(t.skill)}),(0,Z.jsx)(ct,{text:t.skill.shortDescription??t.skill.description??t.skill.path}),(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:[i,c].filter(Boolean).join(` · `)})]}),(0,Z.jsxs)(r,{children:[(0,Z.jsxs)(k,{children:[(0,Z.jsx)(D,{render:(0,Z.jsx)(m,{render:(0,Z.jsx)(g,{variant:`ghost`,size:`icon-sm`,"aria-label":`More for ${Ke(t.skill)}`,children:(0,Z.jsx)(Te,{"aria-hidden":!0})})})}),(0,Z.jsx)(O,{children:`Skill actions`})]}),(0,Z.jsxs)(o,{align:`end`,children:[oe.capabilities.canOpenDefault?(0,Z.jsx)(a,{onClick:()=>void oe.activate(`open`,{environmentId:e,filePath:t.skill.path,workspaceRoot:void 0}),children:`Open`}):null,(0,Z.jsx)(a,{onClick:()=>z(t),children:`Details`}),n!==void 0&&U[n]?.skillOverrides?.[t.skill.name]!==void 0?(0,Z.jsx)(a,{onClick:()=>{let e=U[n]??{},r={...e.skillOverrides};delete r[t.skill.name],pt({projectSettingsOverrides:{[n]:{...e,skillOverrides:r}}})},children:`Use environment setting`}):null]})]}),(0,Z.jsx)(be,{"aria-label":`Enable ${Ke(t.skill)} for ${c}`,checked:(n===void 0?void 0:U[n]?.skillOverrides?.[t.skill.name])??ae[t.skill.name]??t.skill.enabled,disabled:!se||W!==null||s.length===0,onCheckedChange:e=>{G(t.skill.name),pt(n===void 0?{skillOverrides:{[t.skill.name]:e}}:{projectSettingsOverrides:{[n]:{...U[n],skillOverrides:{...U[n]?.skillOverrides,[t.skill.name]:e}}}}).finally(()=>G(null))}})]},t.skill.path)})})]}),Nt=(0,Z.jsxs)(`div`,{className:`grid gap-6`,children:[$e.length>0?(0,Z.jsx)(ge,{title:`Servers`,children:St.length===0?(0,Z.jsx)(`p`,{className:`px-3 text-sm text-muted-foreground sm:px-4`,children:`No MCP servers match your search.`}):(0,Z.jsx)(Z.Fragment,{children:St.map(([e,t])=>{let n=Tt(`mcpServers`,e),r=Ne({...t,enabled:n},je[e],Me.has(e));return(0,Z.jsxs)(`div`,{className:`flex min-h-14 items-center gap-3 px-4 py-3`,children:[(0,Z.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-0.5`,children:[(0,Z.jsx)(`span`,{className:`break-words text-sm font-medium text-foreground`,children:t.name}),r.tone===`error`?(0,Z.jsx)(it,{status:r}):null]}),r.needsSignIn&&K?(0,Z.jsx)(g,{size:`xs`,variant:`outline`,onClick:()=>void gt(e),children:`Authenticate`}):null,kt(`Settings for ${t.name}`,()=>lt(e)),(0,Z.jsx)(be,{"aria-label":`Give ${t.name} to agents`,checked:n,disabled:!K,onCheckedChange:t=>Et(`mcpServers`,e,t)})]},e)})})}):null,K&&wt.length>0?(0,Z.jsx)(ge,{title:`Found in provider configs`,headerAction:(0,Z.jsx)(g,{size:`icon-xs`,variant:`ghost`,"aria-label":`Look again`,onClick:()=>void at(),children:(0,Z.jsx)(w,{"aria-hidden":!0})}),children:(0,Z.jsx)(Z.Fragment,{children:wt.map(t=>(0,Z.jsxs)(`div`,{className:`flex min-h-14 items-center gap-3 px-4 py-3`,children:[(0,Z.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-0.5`,children:[(0,Z.jsx)(`span`,{className:`break-words text-sm font-medium text-foreground`,children:t.name}),wt.filter(e=>e.name===t.name).length>1?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:(t.providers??[t.provider]).map(e=>tt[e]).join(`, `)}):null]}),(0,Z.jsx)(g,{size:`xs`,variant:`outline`,onClick:async()=>{(await Ee({environmentId:e,input:{...n===void 0?{}:{projectId:n},servers:[{provider:t.provider,path:t.path,name:t.name}]}}))._tag===`Success`&&(at(),rt())},children:`Import`})]},`${t.provider}:${t.path}:${t.name}`))})}):null]}),Pt=Q.kind===`server`?(0,Z.jsxs)(Ye,{title:Q.id===null?`Add MCP server`:`Update ${B[Q.id]?.name??`server`} MCP`,onBack:()=>He({kind:`list`}),onUninstall:Q.id!==null&&K?()=>Je({kind:`server`,id:Q.id}):void 0,children:[(0,Z.jsx)(Xe,{server:Q.id===null?void 0:B[Q.id],takenNames:bt,onSave:e=>void ht(Q.id??p.make(f()),e,Q.id===null)},Q.id??`new`),Q.id!==null&&B[Q.id]!==void 0?(0,Z.jsx)(dt,{id:Q.id,server:B[Q.id],runtime:je[Q.id],checking:Me.has(Q.id),canManage:K,projectLabel:s,projectOverride:n===void 0?void 0:U[n]?.mcpServers?.[Q.id],awaitingSignIn:$===Q.id,onProviderToggle:(e,t)=>{let n=B[Q.id],r=t?n.disabledProviders.filter(t=>t!==e):[...n.disabledProviders,e];pt({mcpServers:{[Q.id]:{...n,disabledProviders:r}}})},onProjectOverride:n===void 0?void 0:e=>_t(`mcpServers`,Q.id,e),onTest:()=>void mt(Q.id),onSignIn:()=>void gt(Q.id),onSignOut:async()=>{let t=await he({environmentId:e,input:{serverId:Q.id}});t._tag===`Success`&&Y(e=>({...e,[Q.id]:t.value}))}}):null]}):null,Ft=Q.kind===`plugin`?(0,Z.jsxs)(Ye,{title:Q.id===null?`Add plugin`:`Update ${H[Q.id]?.name??`plugin`}`,onBack:()=>He({kind:`list`}),onUninstall:Q.id!==null&&K?()=>Je({kind:`plugin`,id:Q.id}):void 0,children:[(0,Z.jsx)(Qe,{plugin:Q.id===null?void 0:H[Q.id],environmentLabel:t,onSave:async e=>{let t=Q.id??v.make(f());(await pt({plugins:{[t]:e}}))._tag===`Success`&&Q.id===null&&He({kind:`list`})}},Q.id??`new`),Q.id!==null&&H[Q.id]!==void 0?(0,Z.jsx)(ft,{plugin:H[Q.id],environmentLabel:t,projectLabel:s,projectOverride:n===void 0?void 0:U[n]?.plugins?.[Q.id],onProjectOverride:n===void 0?void 0:e=>_t(`plugins`,Q.id,e)}):null]}):null;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`grid gap-6`,children:[Dt,Ot,Pt??Ft??(u===`plugins`?At:u===`mcps`?Nt:Mt)]}),R===null?null:(0,Z.jsx)(et,{entry:R,environmentId:e,onClose:()=>z(null)}),(0,Z.jsx)(_e,{open:qe!==null,onOpenChange:e=>!e&&Je(null),children:(0,Z.jsxs)(ve,{children:[(0,Z.jsxs)(we,{children:[(0,Z.jsxs)(ye,{children:[`Remove`,` `,qe?.kind===`server`?B[qe.id]?.name??`server`:qe?.kind===`plugin`?H[qe.id]?.name??`plugin`:``,`?`]}),(0,Z.jsxs)(xe,{children:[`New sessions on `,t,` stop getting it. Its stored values and sign-in are deleted. Provider config files are not changed.`]})]}),(0,Z.jsxs)(Ce,{children:[(0,Z.jsx)(Oe,{render:(0,Z.jsx)(g,{variant:`outline`,children:`Cancel`})}),(0,Z.jsx)(g,{variant:`destructive`,onClick:()=>void vt(),children:`Remove`})]})]})})]})}function ut(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,Z.jsx)(g,{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,Z.jsx)(be,{"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,Z.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,Z.jsx)(me,{title:s,description:c,control:m}),t[12]=s,t[13]=c,t[14]=m,t[15]=h):h=t[15],h}function dt(e){let t=(0,Y.c)(60),{id:n,server:r,runtime:i,checking:a,canManage:o,projectLabel:s,projectOverride:c,awaitingSignIn:l,onProviderToggle:u,onProjectOverride:d,onTest:f,onSignIn:p,onSignOut:m}=e,h;t[0]!==a||t[1]!==i||t[2]!==r?(h=Ne(r,i,a),t[0]=a,t[1]=i,t[2]=r,t[3]=h):h=t[3];let _=h,v=r.transport.type===`http`&&r.transport.auth===`oauth`&&i?.auth===`signed-in`,y;t[4]===_?y=t[5]:(y=(0,Z.jsx)(it,{status:_,className:`flex-1 text-sm`}),t[4]=_,t[5]=y);let b;t[6]!==l||t[7]!==o||t[8]!==p||t[9]!==_.needsSignIn?(b=_.needsSignIn&&o?(0,Z.jsx)(g,{size:`xs`,onClick:p,children:l?`Open sign-in again`:`Authenticate`}):null,t[6]=l,t[7]=o,t[8]=p,t[9]=_.needsSignIn,t[10]=b):b=t[10];let x;t[11]!==o||t[12]!==m||t[13]!==v?(x=v&&o?(0,Z.jsx)(g,{size:`xs`,variant:`ghost`,onClick:m,children:`Sign out`}):null,t[11]=o,t[12]=m,t[13]=v,t[14]=x):x=t[14];let S;t[15]!==o||t[16]!==a||t[17]!==f||t[18]!==r.enabled?(S=o&&r.enabled?(0,Z.jsx)(g,{size:`xs`,variant:`outline`,disabled:a,onClick:f,children:`Test connection`}):null,t[15]=o,t[16]=a,t[17]=f,t[18]=r.enabled,t[19]=S):S=t[19];let C;t[20]!==y||t[21]!==b||t[22]!==x||t[23]!==S?(C=(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[y,b,x,S]}),t[20]=y,t[21]=b,t[22]=x,t[23]=S,t[24]=C):C=t[24];let w;t[25]!==l||t[26]!==_.needsSignIn?(w=_.needsSignIn?(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:l?`Finish signing in in your browser, then come back here.`:`Agents can't reach this server until you sign in.`}):null,t[25]=l,t[26]=_.needsSignIn,t[27]=w):w=t[27];let T;t[28]===_.detail?T=t[29]:(T=_.detail?(0,Z.jsx)(`p`,{className:`rounded-md bg-destructive/8 px-2.5 py-1.5 text-xs text-destructive-foreground`,children:_.detail}):null,t[28]=_.detail,t[29]=T);let E;t[30]===r.source?E=t[31]:(E=r.source?(0,Z.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[`Imported from `,r.source.path]}):null,t[30]=r.source,t[31]=E);let D;t[32]!==C||t[33]!==w||t[34]!==T||t[35]!==E?(D=(0,Z.jsx)(ge,{title:`Status`,children:(0,Z.jsx)(J,{children:(0,Z.jsxs)(`div`,{className:`grid gap-2 px-4 py-3`,children:[C,w,T,E]})})}),t[32]=C,t[33]=w,t[34]=T,t[35]=E,t[36]=D):D=t[36];let O;if(t[37]!==o||t[38]!==u||t[39]!==r){let e;t[41]!==o||t[42]!==u||t[43]!==r.name?(e=e=>(0,Z.jsx)(me,{title:e.label,...e.unsupported===void 0?{}:{description:e.unsupported},control:(0,Z.jsx)(be,{"aria-label":`Give ${r.name} to ${e.label}`,checked:e.enabled,disabled:!o||e.unsupported!==void 0,onCheckedChange:t=>u(e.driver,t)})},e.driver),t[41]=o,t[42]=u,t[43]=r.name,t[44]=e):e=t[44],O=Be(r).map(e),t[37]=o,t[38]=u,t[39]=r,t[40]=O}else O=t[40];let k;t[45]===O?k=t[46]:(k=(0,Z.jsx)(J,{children:O}),t[45]=O,t[46]=k);let A;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Z.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[47]=A):A=t[47];let j;t[48]===k?j=t[49]:(j=(0,Z.jsxs)(ge,{title:`Providers`,children:[k,A]}),t[48]=k,t[49]=j);let M;t[50]!==d||t[51]!==s||t[52]!==c||t[53]!==r.enabled?(M=s!==void 0&&d!==void 0?(0,Z.jsx)(ge,{title:`Project`,children:(0,Z.jsx)(J,{children:(0,Z.jsx)(ut,{projectLabel:s,override:c,inherited:r.enabled,onChange:d})})}):null,t[50]=d,t[51]=s,t[52]=c,t[53]=r.enabled,t[54]=M):M=t[54];let ee;return t[55]!==n||t[56]!==D||t[57]!==j||t[58]!==M?(ee=(0,Z.jsxs)(`div`,{className:`grid gap-6`,"data-server-id":n,children:[D,j,M]}),t[55]=n,t[56]=D,t[57]=j,t[58]=M,t[59]=ee):ee=t[59],ee}function ft(e){let t=(0,Y.c)(13),{plugin:n,environmentLabel:r,projectLabel:i,projectOverride:a,onProjectOverride:o}=e,s=`Claude sessions on ${r} load this plugin folder.`,c;t[0]===s?c=t[1]:(c=(0,Z.jsx)(me,{title:`Claude`,description:s}),t[0]=s,t[1]=c);let l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(me,{title:`Codex, Cursor, Grok, OpenCode, Antigravity`,description:`Not supported here. These providers have no Claude plugin format.`}),t[2]=l):l=t[2];let u;t[3]===c?u=t[4]:(u=(0,Z.jsx)(ge,{title:`Providers`,children:(0,Z.jsxs)(J,{children:[c,l]})}),t[3]=c,t[4]=u);let d;t[5]!==o||t[6]!==n||t[7]!==i||t[8]!==a?(d=i!==void 0&&o!==void 0?(0,Z.jsx)(ge,{title:`Project`,children:(0,Z.jsx)(J,{children:(0,Z.jsx)(ut,{projectLabel:i,override:a,inherited:n.enabled,onChange:o})})}):null,t[5]=o,t[6]=n,t[7]=i,t[8]=a,t[9]=d):d=t[9];let f;return t[10]!==u||t[11]!==d?(f=(0,Z.jsxs)(`div`,{className:`grid gap-6`,children:[u,d]}),t[10]=u,t[11]=d,t[12]=f):f=t[12],f}var pt=at;export{pt as component};
|
|
5
|
+
//# sourceMappingURL=settings.plugins-BI68kAsM.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectIconPickerDialog-Cx-QcJLy.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/Icon-l19w4AjM.js","assets/utils-BxISc9RR.js","assets/check-Cmy7pM2Y.js","assets/createLucideIcon-CacG5mZC.js","assets/chevron-down-DHV04o66.js","assets/chevron-right-NbahR9_s.js","assets/route-CQ6wZzks.js","assets/toggle-group-W0bDGcPB.js","assets/CompositeRoot-JeAqW-33.js","assets/toggle-fk33ppsB.js","assets/input-DaCwubQj.js","assets/FieldControl-CxuWXcJE.js","assets/useRegisterFieldControl-KOnbOVnX.js","assets/scroll-area-BYyfw-9F.js","assets/CSPContext-i9QaQnwk.js","assets/dialog-CPLO59bH.js","assets/x-CSwbgjBe.js","assets/DialogTitle-BRYusK7T.js","assets/ProjectMonogram-BJVBhwjz.js","assets/dynamic-tF-2a8Zt.js","assets/index-D_uSeco8.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./index-D_uSeco8.js";import{r as n}from"./Icon-l19w4AjM.js";import{D as r,Gn as i,Ho as a,Jn as o,Jv as s,Lf as c,Mm as l,Rs as u,Uf as d,Yn as f,Zn as p,_c as m,ha as h,in as g,jf as _,jx as v,ms as y,n as b,or as x,qn as S,r as C,sr as w,ss as T,tr as E,zs as ee}from"./utils-BxISc9RR.js";import{t as te}from"./chevron-down-DHV04o66.js";import{t as D}from"./info-BHB-83EA.js";import{t as ne}from"./plus-Cr075-cy.js";import{t as O}from"./trash-2-CiyAV2xI.js";import{H as k,L as re,R as A,U as ie}from"./runtime-DkYxB4ri.js";import{C as j,P as M,W as N,k as P}from"./entities-DqhRur25.js";import{yn as F}from"./runtime-Bsb2I_n2.js";import{t as I}from"./useNavigate-CDvr3Yvg.js";import{t as L}from"./useLocation-BN5q7LjL.js";import{i as R}from"./toast-BX9uiMAh.js";import{E as ae,J as z,K as B,O as V}from"./useSettings-BIggY3j1.js";import{f as H,s as U}from"./server-BYntb2dN.js";import{n as W,o as G}from"./session-eLrubJEW.js";import{t as K}from"./use-atom-command-RgcuqzP9.js";import{n as q}from"./toastHelpers-Dsph6LwL.js";import{i as J,o as Y,r as X}from"./command-w6WcFbeZ.js";import{t as oe}from"./input-DaCwubQj.js";import{D as se,E as ce,O as le,j as ue,y as de}from"./keybindings-QrjnJ5jB.js";import{t as fe}from"./PierreEntryIcon-BJ8xtDqQ.js";import{t as pe}from"./ProjectFavicon-By6-kpgk.js";import{d as me}from"./projectFilesQueryState-C1crs3C8.js";import{n as he}from"./p4ProjectFile-CVEoe1SJ.js";import{r as ge,t as _e}from"./alert-quTC4YbH.js";import{B as ve,H as ye,I as be,a as Z,i as xe,r as Se,s as Ce}from"./settingsLayout-DV36_Jgq.js";import{Mi as we,Sn as Te,bn as Ee,no as De,pn as Oe,yi as ke}from"./main-uLg3xUJM.js";import{c as Ae,f as je,i as Me,n as Ne,o as Pe,r as Fe,s as Ie,t as Le}from"./projectScriptEditor-ku2tGeKq.js";import{t as Re}from"./ProjectDefaultsSettings-Bqo3T1SR.js";import{t as ze}from"./SettingsScopeNotice-CcLrVZWz.js";var Be=v(),Q=e(n(),1),$=e(h(),1);function Ve(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 He(e,t){return!C(t)||F(e)}function Ue(e){let[t,n]=(0,Q.useState)(``),[r,i]=(0,Q.useState)(null),[o,s]=(0,Q.useState)(!1),c=me(e.environmentId,e.cwd,t,200,{imageOnly:!0}),{resolvedTheme:l}=B(),u=a(U),d=e.onPickExternal,f=b(typeof navigator>`u`?``:navigator.platform),p=(0,Q.useMemo)(()=>Oe(c.entries,c.matchedQuery).map(t=>({kind:`action`,value:`project-favicon:${t.path}`,searchTerms:[t.name,t.path],title:t.name,description:t.path,icon:(0,$.jsx)(fe,{pathValue:t.path,kind:`file`,theme:l}),run:async()=>e.onSelect(t.path)})),[e.onSelect,l,c.entries,c.matchedQuery]);return(0,$.jsx)(X,{open:e.open,onOpenChange:e.onOpenChange,children:e.open?(0,$.jsx)(J,{"aria-label":`Choose project icon`,className:`overflow-hidden`,onBackdropPointerDown:()=>e.onOpenChange(!1),children:(0,$.jsx)(Te,{"aria-label":`Choose project icon`,autoHighlight:`always`,escapeLabel:`Close`,footerActionLabel:`Select icon`,footerTrailing:d?(0,$.jsx)(Y,{disabled:o,onClick:()=>{s(!0),d().then(t=>{t&&(e.onOpenChange(!1),e.onSelect(t))}).catch(e=>{R.add({type:`error`,title:`Could not open image picker`,description:e instanceof Error?e.message:`An error occurred.`})}).finally(()=>s(!1))},children:`Open in ${f}`}):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:p.length>0?[{value:`project-favicon-files`,label:e.projectName,items:p}]:[],highlightedItemValue:r,isActionsOnly:!1,keybindings:u,onExecuteItem:t=>{t.kind===`action`&&(e.onOpenChange(!1),t.run())},emptyStateMessage:Ve(t,c.error,c.isPending)})})}):null})}function We(e){let t=(0,Be.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=de(r,se(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)(Fe,{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)(w,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Edit ${e.name}`,disabled:i,onClick:()=>a(e),children:(0,$.jsx)(De,{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 Ge(e){if(e._tag===`Failure`&&!re(e)){let t=ie(e);R.add({type:`error`,title:`Failed to save project actions`,description:t instanceof Error?t.message:`An error occurred.`})}return A(e,()=>void 0)}function Ke(e){let t=j(),[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`),l=K(H.removeKeybinding,`action shortcut removal`);async function u(n,u,f){if(i.current||e.length===0){let e=`No available machine, or another action change is saving.`;return R.add({type:`error`,title:`Actions not saved`,description:e}),T(s(Error(e)))}if(e.some(({environmentId:e})=>!W(e,`settings:write`)))return Ge(T(s(new d({requiredScope:c,message:`This connection cannot change environment settings.`}))));i.current=!0,r(!0);try{for(let{environmentId:r,settings:i,keybindings:s,project:c}of e){let e=c?je(i,c):i.defaultProjectScripts,d=n(e),p=d??i.defaultProjectScripts,m=await a({environmentId:r,input:{patch:c?{projectSettingsOverrides:{[c.id]:d===null?he(i,c.id,[`defaultProjectScripts`]):{...i.projectSettingsOverrides[c.id],defaultProjectScripts:d}}}:{defaultProjectScripts:d??[]}}});if(m._tag===`Failure`)return Ge(m);let h=u?[u]:e.filter(e=>!p.some(t=>t.id===e.id)).map(e=>e.id);for(let e of h){let n=se(e),a=Ae(s,n),u=a?Ie({keybinding:a,command:n}):null,p=Ie({keybinding:f,command:n}),m=!d?.some(t=>t.id===e)&&(c&&i.defaultProjectScripts.some(t=>t.id===e)||Object.entries(i.projectSettingsOverrides).some(([t,n])=>t!==c?.id&&n.defaultProjectScripts?.some(t=>t.id===e))||t.some(t=>t.environmentId===r&&t.id!==c?.id&&(c?je(i,t):t.scripts).some(t=>t.id===e))),h=p?await o({environmentId:r,input:u&&u.key!==p.key?{...p,replace:u}:p}):u&&!m?await l({environmentId:r,input:u}):null;if(h?._tag===`Failure`)return Ge(h)}}return y(void 0)}finally{i.current=!1,r(!1)}}function f(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??le(r.name,i),o=ce(a,r);return u(e=>{let t=e.map(e=>e.id===a?o:ue(e,r));return n===null?[...t,o]:t},a,r.keybinding)}return{saving:n,persist:u,submit:f}}function qe(){let e=(0,Be.c)(67),{scope:t,targets:n,target:r}=ve(),{environments:a}=ae(),s=t.kind===`project`||t.kind===`checkout`,c;e[0]!==a||e[1]!==r?(c=r?a.find(e=>e.environmentId===r.environmentId)?.serverConfig:void 0,e[0]=a,e[1]=r,e[2]=c):c=e[2];let u=c,d;e[3]===r?.settings.defaultProjectScripts?d=e[4]:(d=r?.settings.defaultProjectScripts??[],e[3]=r?.settings.defaultProjectScripts,e[4]=d);let h=d,g=u?.keybindings??m,_;if(e[5]!==h||e[6]!==n){let t;e[8]===h?t=e[9]:(t=e=>JSON.stringify(e.settings.defaultProjectScripts)!==JSON.stringify(h),e[8]=h,e[9]=t),_=n.some(t),e[5]=h,e[6]=n,e[7]=_}else _=e[7];let v=_,y=be(),[b,C]=(0,Q.useState)(null),T,ee,D;e[10]!==a||e[11]!==s||e[12]!==t.members||e[13]!==n?(T=new Map(s?t.members.map(Ye):[]),ee=Ke,D=n.flatMap(e=>{let t=a.find(t=>t.environmentId===e.environmentId);if(!t?.serverConfig)return[];let n=e.projectId?T.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]=a,e[11]=s,e[12]=t.members,e[13]=n,e[14]=T,e[15]=ee,e[16]=D):(T=e[14],ee=e[15],D=e[16]);let{saving:O,persist:k,submit:A}=ee(D),j;e[17]!==T||e[18]!==r?(j=r?.projectId?T.get(r.projectId):void 0,e[17]=T,e[18]=r,e[19]=j):j=e[19];let M=j,N;e[20]===M?.environmentId?N=e[21]:(N=M?.environmentId??l.make(`none`),e[20]=M?.environmentId,e[21]=N);let P=Pe(N,M?.workspaceRoot??null),F;if(e[22]!==h||e[23]!==P.scripts){let t;e[25]===h?t=e[26]:(t=e=>!h.some(t=>t.command===e.command||t.name.toLowerCase()===e.name.toLowerCase()),e[25]=h,e[26]=t),F=P.scripts.filter(t),e[22]=h,e[23]=P.scripts,e[24]=F}else F=e[24];let I=F,L;e[27]===A?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 A(null,t);if(n._tag===`Failure`&&!re(n)){let e=ie(n);C({scriptId:null,initial:t,error:e instanceof Error?e.message:`Failed to import action.`})}},e[27]=A,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]===k?B=e[31]:(B=()=>void k(Je),e[30]=k,e[31]=B);let V;e[32]!==y||e[33]!==R||e[34]!==I||e[35]!==O?(V=I.length>0?(0,$.jsxs)(i,{children:[(0,$.jsxs)(x,{render:(0,$.jsx)(w,{id:`import-scripts`,size:`xs`,variant:`ghost`,disabled:O||!y,type:`button`}),children:[`Import scripts`,(0,$.jsx)(te,{className:`size-3.5`})]}),(0,$.jsxs)(p,{align:`end`,children:[(0,$.jsxs)(S,{children:[(0,$.jsx)(o,{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)(E,{}),I.map(e=>(0,$.jsxs)(f,{onClick:()=>void R(e),children:[(0,$.jsx)(Fe,{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]=y,e[33]=R,e[34]=I,e[35]=O,e[36]=V):V=e[36];let H=O||!y||n.length===0,U,W;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(U=()=>C({scriptId:null,initial:Le}),W=(0,$.jsx)(ne,{className:`size-3.5`}),e[37]=U,e[38]=W):(U=e[37],W=e[38]);let G;e[39]===H?G=e[40]:(G=(0,$.jsxs)(w,{size:`xs`,variant:`outline`,disabled:H,onClick:U,children:[W,`Add action`]}),e[39]=H,e[40]=G);let K;e[41]!==V||e[42]!==G?(K=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[V,G]}),e[41]=V,e[42]=G,e[43]=K):K=e[43];let q;e[44]!==v||e[45]!==B||e[46]!==K?(q=(0,$.jsx)(Z,{serverScoped:!0,settingKeys:z,mixed:v,title:`Actions`,description:`Commands that run in this project's checkout or its worktree, with optional shortcuts.`,onResetOverride:B,control:K}),e[44]=v,e[45]=B,e[46]=K,e[47]=q):q=e[47];let J;e[48]!==y||e[49]!==g||e[50]!==v||e[51]!==O||e[52]!==h?(J=v?(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)(We,{scripts:h,keybindings:g,disabled:O||!y,onEdit:e=>C(Me(e,g))}),e[48]=y,e[49]=g,e[50]=v,e[51]=O,e[52]=h,e[53]=J):J=e[53];let Y;e[54]===P.status?Y=e[55]:(Y=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]=Y);let X;e[56]!==k||e[57]!==b||e[58]!==h||e[59]!==A||e[60]!==r?(X=r&&(0,$.jsx)(Ne,{environmentId:r.environmentId,editScope:`settings:write`,request:b,scripts:h,onSubmit:A,onDelete:e=>void k(t=>t.filter(t=>t.id!==e),e,null),onClose:()=>C(null)}),e[56]=k,e[57]=b,e[58]=h,e[59]=A,e[60]=r,e[61]=X):X=e[61];let oe;return e[62]!==q||e[63]!==J||e[64]!==Y||e[65]!==X?(oe=(0,$.jsxs)(Ce,{id:`project-actions`,title:`Actions`,children:[q,J,Y,X]}),e[62]=q,e[63]=J,e[64]=Y,e[65]=X,e[66]=oe):oe=e[66],oe}function Je(){return null}function Ye(e){return[e.id,e]}function Xe(e,t,n){return n&&e.some(e=>e!==t)}var Ze=(0,Q.lazy)(()=>t(()=>import(`./ProjectIconPickerDialog-Cx-QcJLy.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])));function Qe(e){return`${e.environmentId}:${e.id}`}function $e(e){let t=(0,Be.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=I(c),u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u={select:tt},t[1]=u):u=t[1];let d=L(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(et)})},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)(nt,{group:S,hasOtherMembers:w},C),t[30]=S,t[31]=C,t[32]=w,t[33]=T):T=t[33],T}function et(e){return e.physicalProjectKey}function tt(e){return e.pathname}function nt({group:e,hasOtherMembers:t}){let n=I({from:`/settings`}),i=V(),{environments:a}=ae(),o=(0,Q.useMemo)(()=>new Map(a.map(e=>[e.environmentId,e])),[a]),c=G(e.memberProjects,_),l=e.memberProjects.every(e=>c.has(e.environmentId)),d=e.memberProjects.find(e=>o.get(e.environmentId)?.serverConfig!=null)??e.memberProjects[0],f=P(),p=we(N.update,{reportFailure:!1}),m=we(N.delete,{reportFailure:!1}),h=(0,Q.useRef)(!1),v=d.faviconPath??null,b=d.projectIcon??null,x=typeof window<`u`&&e.memberProjects.every(e=>e.environmentId===i&&He(e.workspaceRoot,navigator.platform))?window.desktopBridge?.pickProjectFavicon:void 0,S=(0,Q.useCallback)((e,t)=>{if(t._tag!==`Failure`||re(t))return;let n=ie(t);R.add(q({type:`error`,title:e,description:n instanceof Error?n.message:`An error occurred.`}))},[]),C=(0,Q.useCallback)((e,t)=>{let n=e.find(e=>!W(e.environmentId,_));if(!n)return null;let r=T(s(Error(`This connection cannot change projects in ${n.environmentLabel??`this environment`}.`)));return S(t,r),r},[S]),E=(0,Q.useCallback)(async(t,n)=>{let r=C(e.memberProjects,n);if(r)return r;let i=e.memberProjects.find(e=>{let t=o.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=T(s(e));return S(n,t),t}for(let r of e.memberProjects){let i=C([r],n);if(i)return i;let a=A(await p({environmentId:r.environmentId,input:{projectId:r.id,...t}}),()=>void 0);if(a._tag===`Failure`)return S(e.memberProjects.length>1?`${n} on ${r.environmentLabel??`the current environment`}`:n,a),a}return y(void 0)},[C,o,e.memberProjects,S,p]),te=(0,Q.useCallback)(async(t,n)=>{let r=t.trim();if(!r){R.add({type:`warning`,title:`Project title cannot be empty`});return}Xe(e.memberProjects.map(e=>e.title),r,n)&&await E({title:r},`Failed to rename project`)},[e.memberProjects,E]),[ne,j]=g(!l),[F,L]=g(!l),[B,H]=(0,Q.useState)(!1),U=(0,Q.useRef)(!1),K=(0,Q.useCallback)(async e=>{if(!U.current){U.current=!0,H(!0);try{await E(e,`Failed to update project icon`)}finally{U.current=!1,H(!1)}}},[E]),J=e.memberProjects.length>1,Y=(0,Q.useCallback)(async i=>{if(C(i,`Failed to remove project`))return;let a=z();if(!a)return;let o=new Set(i.map(Qe)),s=f.filter(e=>o.has(`${e.environmentId}:${e.projectId}`)),c=i.length===e.memberProjects.length,l=t||!c?`checkout`:`project`,d=i.length===1?i[0]:null,p=d?.title??e.displayName,h=await k(()=>a.dialogs.confirm([s.length>0?`Remove ${l} "${p}" and delete its ${s.length} thread${s.length===1?``:`s`}?`:`Remove ${l} "${p}"?`,...d?[`Path: ${d.workspaceRoot}`,...d.environmentLabel?[`Environment: ${d.environmentLabel}`]:[]]:[`This removes ${i.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
|
+
`),{variant:`destructive`}));if(h._tag===`Failure`||!h.value||C(i,`Failed to remove project`))return;let g=r.getState();for(let e of i){if(C([e],`Failed to remove project`))return;let t=s.filter(t=>t.environmentId===e.environmentId&&t.projectId===e.id),n=A(await m({environmentId:e.environmentId,input:{projectId:e.id,force:!0}}),()=>void 0);if(n._tag===`Failure`){S(`Failed to remove "${e.title}"`,n);return}let r=u(e.environmentId,e.id);await M(r),ke(r,t.map(e=>ee(e.environmentId,e.id)));let i=g.getDraftThreadByProjectRef(r);i&&g.clearDraftThread(i.draftId),g.clearProjectDraftThreadId(r)}c&&!t&&n({to:`/`,replace:!0})},[C,m,e.displayName,e.memberProjects.length,t,n,S,f]),X=(0,$.jsx)(Ce,{title:`Checkouts`,children:e.memberProjects.map(e=>(0,$.jsx)(Z,{title:e.environmentLabel??`Environment`,description:e.workspaceRoot,control:(0,$.jsx)(w,{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)(xe,{className:`gap-6`,children:[(0,$.jsxs)(_e,{variant:`info`,children:[(0,$.jsx)(D,{"aria-hidden":!0}),(0,$.jsx)(ge,{children:`Can't find a setting? Keep this project picked above and hop to any other settings page.`})]}),(0,$.jsxs)(Ce,{id:`project-overview`,title:`Project`,hideTitle:!0,children:[l?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)(oe,{size:`sm`,className:`w-full sm:w-64`,"aria-label":`Project name`,disabled:!l,defaultValue:e.displayName,onChange:()=>{h.current=!0},onBlur:e=>{let t=h.current;h.current=!1,te(e.currentTarget.value,t)},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()}},`${e.projectKey}:${e.displayName}`)}),(0,$.jsx)(Z,{title:`Project icon`,description:b?.kind===`lucide`?`${b.name} · ${b.color}`:b?.kind===`monogram`?`${b.text} · ${b.color}`:b?.kind===`emoji`?b.emoji:v??`Automatic`,resetAction:e.memberProjects.some(e=>e.faviconPath!=null||e.projectIcon!=null)?(0,$.jsx)(Se,{label:`project icon`,disabled:B||!l,onClick:()=>void K({faviconPath:null,projectIcon:null})}):null,control:(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(pe,{project:d,className:`size-6`}),(0,$.jsx)(w,{size:`sm`,variant:`outline`,type:`button`,"aria-label":`Choose a project icon`,disabled:B||!l,onClick:()=>L(!0),children:`Choose icon`}),(0,$.jsx)(w,{size:`sm`,variant:`outline`,type:`button`,"aria-label":`Choose a project icon file`,disabled:B||!l,onClick:()=>j(!0),children:`Choose file`})]})})]}),(0,$.jsx)(Re,{category:`project`}),(0,$.jsx)(qe,{}),J?X:null,(0,$.jsx)(Ce,{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)(w,{size:`sm`,variant:`destructive-outline`,disabled:!l,onClick:()=>void Y(e.memberProjects),children:[(0,$.jsx)(O,{}),t?`Remove checkout`:e.memberProjects.length>1?`Remove all entries`:`Remove project`]})})})]}),(0,$.jsx)(Ue,{cwd:d.workspaceRoot,environmentId:d.environmentId,onOpenChange:j,...x?{onPickExternal:()=>x(d.workspaceRoot)}:{},onSelect:e=>void K({faviconPath:e,projectIcon:null}),open:ne&&l,projectName:e.displayName},`${d.environmentId}:${d.workspaceRoot}:${ne}`),F&&l?(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(Ze,{current:b,projectName:d.title,open:!0,onOpenChange:L,onSelect:e=>void K({faviconPath:null,projectIcon:e})})}):null]})}function rt(){let e=(0,Be.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)($e,{projectKey:t.project,environmentId:t.machine?l.make(t.machine):null,checkoutKey:t.checkout??null}):n.kind===`unavailable`?(0,$.jsx)(xe,{children:(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n.message})}):(0,$.jsx)(ze,{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 it=rt;export{it as component};
|
|
4
|
+
//# sourceMappingURL=settings.projects-BahZsoyx.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProviderAuthTerminal-DBiUwanv.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/Icon-l19w4AjM.js","assets/utils-BxISc9RR.js","assets/check-Cmy7pM2Y.js","assets/createLucideIcon-CacG5mZC.js","assets/chevron-down-DHV04o66.js","assets/chevron-right-NbahR9_s.js","assets/route-CQ6wZzks.js","assets/useSettings-BIggY3j1.js","assets/runtime-DkYxB4ri.js","assets/runtime-Bsb2I_n2.js","assets/toast-BX9uiMAh.js","assets/archive-0Qz6rgBl.js","assets/circle-alert-B83jEPoh.js","assets/circle-check-Y1T60J9X.js","assets/clock-bc9N_wA2.js","assets/info-BHB-83EA.js","assets/pin-DfMqpQHz.js","assets/trash-2-CiyAV2xI.js","assets/triangle-alert-BiHUyRl3.js","assets/x-CSwbgjBe.js","assets/tooltip-B0rhqi5b.js","assets/env-wK1YYxA8.js","assets/spinner-B7a-VUeR.js","assets/loader-circle-B3Ce8JIQ.js","assets/useParams-DQgx0pmy.js","assets/server-BYntb2dN.js","assets/session-eLrubJEW.js","assets/use-atom-command-RgcuqzP9.js","assets/themePalette-zVYGoviO.js","assets/ThreadTerminalDrawer-Cdl3DAIx.js","assets/plus-Cr075-cy.js","assets/square-split-horizontal-Ba4BZbro.js","assets/square-split-vertical-BqJX4cZa.js","assets/square-terminal-CB0QR1vW.js","assets/square-DVrCvZRU.js","assets/rightPanelStore-CQ94819A.js","assets/fileLinks-BHAkEh9k.js","assets/toastHelpers-Dsph6LwL.js","assets/observeResize-BEjNJ-rK.js","assets/browserHistoryStore-Cw3ffhOV.js","assets/entities-DqhRur25.js","assets/preview-6t42evKb.js","assets/keybindings-QrjnJ5jB.js","assets/preview-C9iPHfb1.js","assets/browserLinkTarget-KTI1tSl7.js","assets/popover-BXin7C0B.js","assets/terminal-links-Dc2HX7Ov.js","assets/terminalSessions-DK9WKgga.js","assets/query-D5pQUQvZ.js","assets/terminalLabels-BgLOlb2G.js","assets/main-uLg3xUJM.js","assets/index-D_uSeco8.js","assets/arrow-down-DvRecXuy.js","assets/arrow-up-3Yp3lsoe.js","assets/calendar-arrow-down-CAFi0Chs.js","assets/calendar-arrow-up-Cs2MbLyZ.js","assets/calendar-c_JH_1V1.js","assets/chevron-left-DrNh6cTh.js","assets/chevrons-up-down-BMPucOK_.js","assets/circle-arrow-up-kT0Pa2jA.js","assets/external-link-NWS0I_zo.js","assets/folder-CMIvEUJv.js","assets/gauge-C_4eEUrj.js","assets/link-2-B_p2EG7Q.js","assets/list-checks-CQu2FTgJ.js","assets/maximize-2-CHT2IkVy.js","assets/minimize-2-DOhpJbnX.js","assets/monitor-Ddj8MK6z.js","assets/moon-B9ss2TfK.js","assets/refresh-cw-PY_ECjtI.js","assets/search-Cr9eaeTj.js","assets/smartphone-zkhAIn1Q.js","assets/sun-C8irSiA-.js","assets/terminal-6kKaKv-Q.js","assets/ticket-LnwYlhC1.js","assets/trending-down-CZZKiTTZ.js","assets/trending-up-CyMfjRD-.js","assets/unlink-2-DKAoaBiV.js","assets/user-lock-BWt0Um72.js","assets/vcsRefInvalidation-h_E9Figo.js","assets/number-field-pAaF-e0N.js","assets/minus-C7W28oE7.js","assets/useRegisterFieldControl-KOnbOVnX.js","assets/FormContext-Vk5aZcR6.js","assets/CSPContext-i9QaQnwk.js","assets/select-CjGEfXy_.js","assets/chevron-up-C-w52bD6.js","assets/link-Bl21VXlj.js","assets/redirect-D3L17tzd.js","assets/lazyRouteComponent-cLZROdN-.js","assets/useNavigate-CDvr3Yvg.js","assets/useLocation-BN5q7LjL.js","assets/queries-CEjFwxVW.js","assets/diffRendering-BlmxsRF9.js","assets/session-logic-l1juLk9v.js","assets/htmlRender-DgdJ8GkZ.js","assets/mediaSource-0nIWHHoL.js","assets/mediaReference-DN8lzwOF.js","assets/usageFormat-ZiOrCBxk.js","assets/timestampFormat-wac2e_Jz.js","assets/skeleton-CS8ffFVv.js","assets/useAriaLabelledBy-D-n0SDV6.js","assets/checkbox-BHsP70Vt.js","assets/FieldItemContext-Bn6xBVJg.js","assets/toggle-fk33ppsB.js","assets/toggle-group-W0bDGcPB.js","assets/CompositeRoot-JeAqW-33.js","assets/command-w6WcFbeZ.js","assets/ComboboxClear-B-iYnTX_.js","assets/input-DaCwubQj.js","assets/FieldControl-CxuWXcJE.js","assets/scroll-area-BYyfw-9F.js","assets/DialogTitle-BRYusK7T.js","assets/dialog-CPLO59bH.js","assets/dist-DZWol-cd.js","assets/sidebar-MBwCdIpv.js","assets/useResizeDrag-KJl_F2EN.js","assets/AnimatedHeight-DYUgtGfz.js","assets/assets-CRmNKuHc.js","assets/sourceControl-DyHbbOxl.js","assets/openFileInPreview-NwK1GJFN.js","assets/Icons-DM1SzuL7.js","assets/PierreEntryIcon-BJ8xtDqQ.js","assets/file-1cutE11R.js","assets/pierre-icons-CBmlpFgP.js","assets/RenderErrorBoundary-D4M2khxk.js","assets/circle-dashed-ChJzoouS.js","assets/circle-dot-DSAuCGJf.js","assets/circle-x-C-GXnJRB.js","assets/user-check-BtCtF_-l.js","assets/user-round-x-D7izbSMH.js","assets/user-round-GtkOza8y.js","assets/threadSort-Byzu7B1A.js","assets/pullRequestIcons-BWiN_14V.js","assets/git-merge-C47N_dux.js","assets/git-pull-request-arrow-C9_ZycDh.js","assets/git-pull-request-closed-BkRFT_Rl.js","assets/git-pull-request-draft-BNpXqUsz.js","assets/layers-BqgDAlx3.js","assets/pullRequests-BQ9KruZm.js","assets/ProjectFavicon-By6-kpgk.js","assets/ProjectMonogram-BJVBhwjz.js","assets/projectFilesQueryState-C1crs3C8.js","assets/guideRunStore-C95PbUuP.js","assets/pullRequestDetail.logic-BiwUoz1M.js","assets/pullRequestReviewStore-J7YIGsZ9.js","assets/sortable.esm-CwrTFe-B.js","assets/p4ProjectFile-CVEoe1SJ.js","assets/sidebarProjectGrouping-Sm7y9bd1.js","assets/useHandleNewThread-BQ5wqZab.js","assets/EnvironmentMachineIcon-giyHKjbh.js","assets/cloud-DyVMWy7X.js","assets/laptop-05PEAB3d.js","assets/server-Le_hLOlf.js","assets/alert-quTC4YbH.js","assets/semver-CFbvOQKc.js","assets/ChatGptUsageButton-BWTEbaUC.js","assets/kbd-R3wkAau0.js","assets/settingsLayout-DV36_Jgq.js","assets/undo-2-ZlIXiNdF.js","assets/WorkspacePageContainer-BXUbfbEU.js","assets/KeybindingsSettings.logic-BcJGxVhV.js","assets/usageShortcuts-Be5hddhr.js","assets/primaryCloudLinkState-Dulej3bP.js","assets/ConnectionStatusDot-BCSqqCpf.js","assets/standalone-page-DTvNMgJy.js","assets/primary-DOpcfgLH.js","assets/onboarding--LqcHqO0.js","assets/scheduledTasksSettings.logic-C_AdQNVz.js","assets/main-BsiZpg85.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./index-D_uSeco8.js";import{r as n}from"./Icon-l19w4AjM.js";import{Fs as r,Ft as i,Gl as a,Ho as o,Lf as s,Mb as c,Mf as l,Ml as u,Pf as d,Rt as f,Tb as p,Wl as m,Wn as h,Yt as g,_l as _,_m as v,bb as y,bm as b,fb as x,gd as S,ha as C,jf as w,js as T,jx as E,ks as D,sl as O,sr as k,t as A,um as ee,vm as j,xm as M,xs as N,ym as P}from"./utils-BxISc9RR.js";import{t as F}from"./arrow-down-DvRecXuy.js";import{t as te}from"./arrow-up-3Yp3lsoe.js";import{t as I}from"./check-Cmy7pM2Y.js";import{t as L}from"./circle-arrow-up-kT0Pa2jA.js";import{t as R}from"./copy-CoM62e83.js";import{t as z}from"./external-link-NWS0I_zo.js";import{t as B}from"./layers-BqgDAlx3.js";import{t as ne}from"./pencil-CnxrJI7X.js";import{t as re}from"./plus-Cr075-cy.js";import{t as ie}from"./search-Cr9eaeTj.js";import{t as ae}from"./star-DJ6Ycqv6.js";import{t as oe}from"./trash-2-CiyAV2xI.js";import{t as V}from"./triangle-alert-BiHUyRl3.js";import{t as H}from"./x-CSwbgjBe.js";import{L as U,U as se,gt as ce}from"./runtime-DkYxB4ri.js";import{C as le,w as W}from"./entities-DqhRur25.js";import{_ as G,xt as ue}from"./runtime-Bsb2I_n2.js";import{a as de,c as fe,n as pe,t as me,u as he}from"./tooltip-B0rhqi5b.js";import{a as K,i as ge,n as _e,r as ve,t as ye}from"./number-field-pAaF-e0N.js";import{a as q,c as be,o as xe,s as Se,t as Ce}from"./select-CjGEfXy_.js";import{t as we}from"./spinner-B7a-VUeR.js";import{i as J,m as Te,p as Ee}from"./toast-BX9uiMAh.js";import{E as De,I as Oe,O as ke,_ as Ae,b as je,f as Me,m as Ne,q as Pe,y as Fe,z as Ie}from"./useSettings-BIggY3j1.js";import{f as Y,t as Le}from"./server-BYntb2dN.js";import{a as Re,i as ze,n as Be}from"./session-eLrubJEW.js";import{n as Ve}from"./query-D5pQUQvZ.js";import{t as X}from"./use-atom-command-RgcuqzP9.js";import{n as He}from"./toastHelpers-Dsph6LwL.js";import{u as Z}from"./timestampFormat-wac2e_Jz.js";import{i as Ue,n as We,r as Ge}from"./radio-group-DhpPG5HP.js";import{n as Ke,t as qe}from"./toggle-group-W0bDGcPB.js";import{t as Je}from"./input-DaCwubQj.js";import{t as Ye}from"./scroll-area-BYyfw-9F.js";import{a as Xe,c as Ze,i as Qe,o as $e,r as et,s as tt,t as nt}from"./dialog-CPLO59bH.js";import{a as rt,i as it,n as at,o as ot,r as st,t as ct}from"./empty-tr-EsB66.js";import{i as lt,n as ut,o as dt,t as ft}from"./popover-BXin7C0B.js";import{n as pt,r as mt,t as ht}from"./input-group-DJwXFHGO.js";import{i as gt,n as _t,r as vt,t as yt}from"./color-picker-CFc6YapE.js";import{n as bt}from"./EnvironmentMachineIcon-giyHKjbh.js";import{r as xt,t as St}from"./alert-quTC4YbH.js";import{i as Ct,n as wt}from"./ChatGptUsageButton-BWTEbaUC.js";import{B as Tt,U as Et,a as Dt,f as Ot,i as kt,r as At,s as jt,t as Mt,u as Nt}from"./settingsLayout-DV36_Jgq.js";import{n as Pt,r as Ft,t as It}from"./ConnectionStatusDot-BCSqqCpf.js";import{Aa as Lt,Ar as Rt,Bn as zt,Fr as Bt,Hn as Vt,Ir as Ht,La as Ut,Lr as Wt,Ma as Gt,Mr as Kt,Na as qt,Ni as Jt,Nr as Yt,Pr as Xt,Rr as Zt,Un as Qt,Vn as $t,Wn as en,fr as tn,ir as nn,ja as rn,jr as an,ka as on,ns as sn,qa as cn,r as ln,yr as un,zn as dn}from"./main-uLg3xUJM.js";import{t as fn}from"./draft-input-CmvO5rl_.js";import{i as pn,l as mn,r as hn,t as gn}from"./SettingsPanels.logic-BYa5iHwl.js";import{t as _n}from"./FoldedSettingsSection-CsN_jb3V.js";import{t as vn}from"./ExpandableText-dJhpznMp.js";import{t as yn}from"./SecretInput-CNWNAhNe.js";import{a as bn,c as xn,i as Sn,n as Cn,o as wn,p as Tn,r as En,s as Dn,t as On}from"./CodexSetupSection.logic-VTayPks4.js";import{n as kn,t as An}from"./ProviderSettingsForm-Tkr5xKCJ.js";var jn=E(),Q=e(n(),1),$=e(C(),1),Mn=`#2563eb`;function Nn(e){let t=(0,jn.c)(29),{onCommit:n}=e,r;t[0]===e.value?r=t[1]:(r=()=>vt(e.value),t[0]=e.value,t[1]=r);let[i,a]=(0,Q.useState)(r),o;t[2]!==i.h||t[3]!==i.s||t[4]!==i.v?(o=gt(i.h,i.s,i.v),t[2]=i.h,t[3]=i.s,t[4]=i.v,t[5]=o):o=t[5];let s=o,[c,l]=(0,Q.useState)(null),u;t[6]===n?u=t[7]:(u=e=>{a(e),n(gt(e.h,e.s,e.v))},t[6]=n,t[7]=u);let d=u,f;t[8]!==d||t[9]!==i?(f=(0,$.jsx)(_t,{label:`Accent color`,value:i,onChange:d,variant:`edge`}),t[8]=d,t[9]=i,t[10]=f):f=t[10];let p;t[11]!==d||t[12]!==i?(p=e=>d({...i,h:e}),t[11]=d,t[12]=i,t[13]=p):p=t[13];let m;t[14]!==i.h||t[15]!==p?(m=(0,$.jsx)(yt,{label:`Accent color hue`,value:i.h,onChange:p}),t[14]=i.h,t[15]=p,t[16]=m):m=t[16];let h=c??s,g;t[17]===e?g=t[18]:(g=t=>{let n=t.currentTarget.value;l(n),/^#[\da-f]{6}$/i.test(n)&&(a(vt(n)),e.onCommit(n))},t[17]=e,t[18]=g);let _;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>l(null),t[19]=_):_=t[19];let v;t[20]!==h||t[21]!==g?(v=(0,$.jsx)(Je,{nativeInput:!0,size:`compact`,value:h,onChange:g,onBlur:_,font:`mono`,"aria-label":`Custom hex accent color`,spellCheck:!1}),t[20]=h,t[21]=g,t[22]=v):v=t[22];let y;t[23]!==m||t[24]!==v?(y=(0,$.jsxs)(`div`,{className:`grid gap-3 p-3`,children:[m,v]}),t[23]=m,t[24]=v,t[25]=y):y=t[25];let b;return t[26]!==y||t[27]!==f?(b=(0,$.jsxs)(`div`,{className:`w-56 bg-popover`,children:[f,y]}),t[26]=y,t[27]=f,t[28]=b):b=t[28],b}function Pn(e){let t=(0,jn.c)(22),n;t[0]===e.value?n=t[1]:(n=g(e.value),t[0]=e.value,t[1]=n);let r=n,i;t[2]===r?i=t[3]:(i=r?{backgroundColor:r}:void 0,t[2]=r,t[3]=i);let a=`${r?`Change`:`Add`} accent color for ${e.displayName}`,o;t[4]===r?o=t[5]:(o=r?(0,$.jsx)(`span`,{className:`sr-only`,children:`Change accent color`}):(0,$.jsx)(re,{"aria-hidden":!0}),t[4]=r,t[5]=o);let s;t[6]!==i||t[7]!==a||t[8]!==o?(s=(0,$.jsx)(dt,{render:(0,$.jsx)(k,{type:`button`,size:`icon-sm`,variant:`ghost-muted`,style:i,"aria-label":a,children:o})}),t[6]=i,t[7]=a,t[8]=o,t[9]=s):s=t[9];let c=r??Mn,l;t[10]!==e.onCommit||t[11]!==c?(l=(0,$.jsx)(Nn,{value:c,onCommit:e.onCommit}),t[10]=e.onCommit,t[11]=c,t[12]=l):l=t[12];let u;t[13]!==r||t[14]!==e.onClear?(u=r?(0,$.jsx)(`div`,{className:`border-t border-border/60 p-1`,children:(0,$.jsx)(ut,{render:(0,$.jsxs)(k,{type:`button`,size:`compact`,variant:`ghost-muted`,className:`w-full justify-start`,onClick:e.onClear,children:[(0,$.jsx)(H,{className:`size-3.5`,"aria-hidden":!0}),`Clear color`]})})}):null,t[13]=r,t[14]=e.onClear,t[15]=u):u=t[15];let d;t[16]!==l||t[17]!==u?(d=(0,$.jsxs)(lt,{side:`bottom`,align:`start`,sideOffset:6,padding:`none`,children:[l,u]}),t[16]=l,t[17]=u,t[18]=d):d=t[18];let f;return t[19]!==s||t[20]!==d?(f=(0,$.jsxs)(ft,{children:[s,d]}),t[19]=s,t[20]=d,t[21]=f):f=t[21],f}function Fn(e){let t=(0,jn.c)(28),{commitDelayMs:n,description:r,displayName:i,layout:a,onCommit:o,value:s}=e,c=n===void 0?0:n,l=a===void 0?`stacked`:a,u;t[0]===s?u=t[1]:(u=()=>s??``,t[0]=s,t[1]=u);let[d,f]=(0,Q.useState)(u),p=(0,Q.useRef)(null),m=(0,Q.useRef)(null),h=(0,Q.useRef)(o),_,v;t[2]===o?(_=t[3],v=t[4]):(_=()=>{h.current=o},v=[o],t[2]=o,t[3]=_,t[4]=v),(0,Q.useEffect)(_,v);let y,b;t[5]===s?(y=t[6],b=t[7]):(y=()=>{m.current===null&&f(s??``)},b=[s],t[5]=s,t[6]=y,t[7]=b),(0,Q.useEffect)(y,b);let x,S;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>()=>{p.current!==null&&clearTimeout(p.current);let e=m.current;e!==null&&h.current(e)},S=[],t[8]=x,t[9]=S):(x=t[8],S=t[9]),(0,Q.useEffect)(x,S);let C;t[10]!==c||t[11]!==o?(C=e=>{let t=g(e)??``;if(f(t),c<=0){m.current=null,p.current!==null&&(clearTimeout(p.current),p.current=null),o(t);return}m.current=t,p.current!==null&&clearTimeout(p.current),p.current=setTimeout(()=>{p.current=null;let e=m.current;m.current=null,e!==null&&h.current(e)},c)},t[10]=c,t[11]=o,t[12]=C):C=t[12];let w=C,T;t[13]===d?T=t[14]:(T=g(d),t[13]=d,t[14]=T);let E=T,D;t[15]===w?D=t[16]:(D=()=>w(``),t[15]=w,t[16]=D);let O;t[17]!==w||t[18]!==i||t[19]!==E||t[20]!==D?(O=(0,$.jsx)(Pn,{displayName:i,value:E,onCommit:w,onClear:D}),t[17]=w,t[18]=i,t[19]=E,t[20]=D,t[21]=O):O=t[21];let k=O;if(l===`inline`)return k;let A;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Accent color`}),t[22]=A):A=t[22];let ee;t[23]===r?ee=t[24]:(ee=r?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:r}):null,t[23]=r,t[24]=ee);let j;return t[25]!==k||t[26]!==ee?(j=(0,$.jsxs)(`div`,{className:`grid gap-2`,children:[A,k,ee]}),t[25]=k,t[26]=ee,t[27]=j):j=t[27],j}var In=1,Ln=1,Rn=[`Provider`,`Identity`,`Config`],zn=[`Provider`,`Identity`,`Sign in`],Bn=[`Provider`,`Identity`],Vn={label:``,accentColor:``,instanceIdOverride:null};function Hn(e,t){return e[t]??Vn}function Un(e,t,n){return{...e,[t]:{...Hn(e,t),...n}}}function Wn(e,t,n){let r=e(t);if(!r||!n.has(r))return r;for(let e=2;;e+=1){let t=`_${e}`,i=`${r.slice(0,64-t.length)}${t}`;if(!n.has(i))return i}}function Gn(e,t){return Object.values(e).some(e=>{if(e.driver!==`acpRegistry`||!e.config||typeof e.config!=`object`)return!1;let n=e.config;return n.source!==`local`&&n.agentId===t})}function Kn(e,t,n,r){let i=Math.max(0,n-1),a=Math.max(0,Math.min(i,t)),o=r.identityStep??In,s=r.prerequisite;return s?.error&&e<=s.step&&a>s.step?{kind:`blocked`,step:Math.min(s.step,i),error:s.error}:e<=o&&a>o&&r.instanceIdError!==null?{kind:`blocked`,step:Math.min(o,i),error:r.instanceIdError}:{kind:`navigate`,step:a}}function qn(e,t,n){return Kn(e,t,zn.length,{instanceIdError:n.instanceIdError,identityStep:Ln,prerequisite:{step:0,error:n.selectionError}})}function Jn(e){let t=(0,jn.c)(15),{currentStep:n,summaries:r,instanceIdError:i,steps:a,identityStep:o,prerequisite:s,onNavigation:c,disabled:l}=e,u=a===void 0?Rn:a,d=l!==void 0&&l,f;t[0]===d?f=t[1]:(f=()=>d,t[0]=d,t[1]=f);let p;t[2]!==n||t[3]!==o||t[4]!==i||t[5]!==c||t[6]!==s||t[7]!==u.length?(p=e=>c(Kn(n,e,u.length,{instanceIdError:i,...o===void 0?{}:{identityStep:o},...s===void 0?{}:{prerequisite:s}})),t[2]=n,t[3]=o,t[4]=i,t[5]=c,t[6]=s,t[7]=u.length,t[8]=p):p=t[8];let m;return t[9]!==n||t[10]!==u||t[11]!==r||t[12]!==f||t[13]!==p?(m=(0,$.jsx)(qt,{steps:u,currentStep:n,summaries:r,isStepDisabled:f,onStepChange:p}),t[9]=n,t[10]=u,t[11]=r,t[12]=f,t[13]=p,t[14]=m):m=t[14],m}function Yn(e){return e instanceof Error&&e.message.trim()?e.message:`The ACP could not be prepared.`}function Xn(e,t){return{...e,id:t.agentId,version:t.version,distribution:t.distribution}}function Zn(e){let t=(0,jn.c)(48),{environmentId:n,providerInstances:r,onPrepared:i,onManualConfiguration:a,onLocalConfiguration:o,onLoadingChange:s,onPreparingChange:c}=e,[l,u]=(0,Q.useState)(``),[f,p]=(0,Q.useState)(``),m=ze(n,d),[h,g]=(0,Q.useState)(null),[_,v]=(0,Q.useState)(null),y=(0,Q.useRef)(0),b=(0,Q.useRef)(null),x;t[0]!==n||t[1]!==f?(x=Y.searchAcpRegistry({environmentId:n,input:{query:f}}),t[0]=n,t[1]=f,t[2]=x):x=t[2];let S=Ve(x),C;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(C={reportFailure:!1},t[3]=C):C=t[3];let w=X(Y.prepareAcpRegistryAgent,C),T,E;t[4]===c?(T=t[5],E=t[6]):(T=()=>()=>{y.current+=1,b.current!==null&&clearTimeout(b.current),c?.(!1)},E=[c],t[4]=c,t[5]=T,t[6]=E),(0,Q.useEffect)(T,E);let D;t[7]!==S||t[8]!==f?(D=e=>{b.current!==null&&clearTimeout(b.current);let t=e.trim();u(t),v(null),t===f?S.refresh():p(t)},t[7]=S,t[8]=f,t[9]=D):D=t[9];let O=D,A;t[10]!==l||t[11]!==O?(A=e=>{e.preventDefault(),O(l)},t[10]=l,t[11]=O,t[12]=A):A=t[12];let ee=A,M=async e=>{if(!Be(n,`providers:manage`))return;let t=y.current+=1;v(null),g(e.id),c?.(!0);let r=await w({environmentId:n,input:{agentId:e.id}});if(y.current===t){if(g(null),c?.(!1),r._tag===`Success`){i(Xn(e,r.value));return}U(r)||v(Yn(se(r)))}},N=S.data?.agents??null,P=S.isPending&&N===null,F=S.isPending&&N!==null,te=N?.length??0,I,L;t[13]!==s||t[14]!==S.isPending?(I=()=>(s?.(S.isPending),()=>s?.(!1)),L=[s,S.isPending],t[13]=s,t[14]=S.isPending,t[15]=I,t[16]=L):(I=t[15],L=t[16]),(0,Q.useLayoutEffect)(I,L);let R;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,$.jsx)(`h3`,{className:`sr-only`,id:`acp-registry-search-heading`,children:`Choose an agent`}),t[17]=R):R=t[17];let B;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,$.jsx)(pt,{children:(0,$.jsx)(ie,{})}),t[18]=B):B=t[18];let ne=h!==null,re;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(re=e=>{let t=e.currentTarget.value;u(t),v(null),b.current!==null&&clearTimeout(b.current),b.current=setTimeout(()=>{b.current=null,p(t.trim())},300)},t[19]=re):re=t[19];let ae;t[20]!==l||t[21]!==ne?(ae=(0,$.jsxs)(ht,{className:`min-w-40 flex-1`,children:[B,(0,$.jsx)(mt,{"aria-label":`Search ACP Registry`,disabled:ne,onChange:re,placeholder:`Search agents…`,size:`sm`,type:`search`,value:l})]}),t[20]=l,t[21]=ne,t[22]=ae):ae=t[22];let oe=h!==null,V;t[23]!==a||t[24]!==oe?(V=(0,$.jsx)(k,{disabled:oe,onClick:a,size:`sm`,type:`button`,variant:`ghost-muted`,children:`Enter manually`}),t[23]=a,t[24]=oe,t[25]=V):V=t[25];let H;t[26]!==o||t[27]!==h?(H=o?(0,$.jsx)(k,{disabled:h!==null,onClick:o,size:`sm`,type:`button`,variant:`outline`,children:`Local ACP command`}):null,t[26]=o,t[27]=h,t[28]=H):H=t[28];let ce;t[29]!==ee||t[30]!==ae||t[31]!==V||t[32]!==H?(ce=(0,$.jsxs)(`form`,{className:`flex flex-wrap items-center gap-2`,onSubmit:ee,children:[ae,V,H]}),t[29]=ee,t[30]=ae,t[31]=V,t[32]=H,t[33]=ce):ce=t[33];let le=P?`Searching the ACP Registry.`:F?`Refreshing ACP Registry results.`:N?`${te} compatible ${te===1?`agent`:`agents`} found.`:``,W;t[34]===le?W=t[35]:(W=(0,$.jsx)(`div`,{className:`sr-only`,role:`status`,children:le}),t[34]=le,t[35]=W);let G;t[36]!==_||t[37]!==S.error?(G=S.error||_?(0,$.jsx)(St,{variant:`error`,role:`status`,"aria-live":`polite`,children:(0,$.jsx)(xt,{children:_??S.error})}):null,t[36]=_,t[37]=S.error,t[38]=G):G=t[38];let ue;t[39]===P?ue=t[40]:(ue=P?(0,$.jsx)(`div`,{className:`flex min-h-20 items-center justify-center text-sm text-muted-foreground`,children:`Searching the registry...`}):null,t[39]=P,t[40]=ue);let fe=N?N.length===0?(0,$.jsxs)(`div`,{className:`flex min-h-28 flex-col items-center justify-center rounded-2xl border border-dashed px-4 text-center`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium`,children:`No compatible agents found`}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Try a broader search.`})]}):(0,$.jsx)(Ye,{scrollFade:!0,className:`max-h-64`,children:(0,$.jsx)(`div`,{className:`pr-2.5`,children:N.map(e=>{let t=Gn(r,e.id),n=h===e.id,i=e.distribution===`binary`?`Downloading`:`Preparing`;return(0,$.jsx)(`article`,{className:`min-w-0 py-2.5`,children:(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,$.jsx)(wt,{driverKind:j.make(`acpRegistry`),displayName:e.name,acpRegistryAgentId:e.id,acpRegistryIconUrl:e.icon??void 0,iconClassName:`size-6 rounded-md text-muted-foreground`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:(0,$.jsx)(`h4`,{className:`min-w-0 truncate text-sm font-medium text-foreground`,children:e.name})}),e.description?(0,$.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:e.description}):null]})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[e.website||e.repository?(0,$.jsxs)(me,{children:[(0,$.jsx)(de,{render:(0,$.jsx)(k,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`About ${e.name}`,render:(0,$.jsx)(`a`,{href:e.website||e.repository||void 0,target:`_blank`,rel:`noreferrer`}),children:(0,$.jsx)(z,{})})}),(0,$.jsxs)(pe,{children:[`About `,e.name]})]}):null,(0,$.jsx)(k,{"aria-label":`${t?`Already added`:n?i:`Add`} ${e.name}`,disabled:!m||t||h!==null,onClick:()=>void M(e),size:`xs`,variant:n?`secondary`:`outline`,children:t?`Added`:n?i:`Add`})]})]})},e.id)})})}):null,he;return t[41]!==R||t[42]!==ce||t[43]!==W||t[44]!==G||t[45]!==ue||t[46]!==fe?(he=(0,$.jsxs)(`section`,{className:`grid gap-3`,"aria-labelledby":`acp-registry-search-heading`,children:[R,ce,W,G,ue,fe]}),t[41]=R,t[42]=ce,t[43]=W,t[44]=G,t[45]=ue,t[46]=fe,t[47]=he):he=t[47],he}var Qn=(0,Q.lazy)(()=>t(()=>import(`./ProviderAuthTerminal-DBiUwanv.js`),__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])));function $n({environmentId:e,environmentLabel:t,instanceId:n,provider:r,readOnly:i}){let a={environmentId:e,input:{instanceId:n}},o=Ve(Y.providerAuthState(a)),s={reportFailure:!1,reportDefect:!1},c=X(Y.startProviderAuth,s),l=X(Y.respondProviderAuth,s),u=X(Y.completeProviderAuth,s),d=X(Y.cancelProviderAuth,s),f=X(Y.logoutProviderAuth,s),[p,m]=(0,Q.useState)(``),[h,g]=(0,Q.useState)({id:``,values:{}}),[_,v]=(0,Q.useState)(null),[y,b]=(0,Q.useState)(!1),x=(0,Q.useRef)(!1),S=(0,Q.useRef)([]),C=(0,Q.useRef)(!1),w=o.data,T=w?.interaction,E=w?.phase===`starting`||w?.phase===`waiting`||w?.phase===`verifying`,D=r.auth.status===`authenticated`||r.auth.status===`unknown`&&w?.phase===`succeeded`,O=r.driver===`acpRegistry`&&!E&&!D&&!o.error&&w?.methods===void 0,A=!E&&!D&&(r.setup?.canAuthenticate===!1||r.driver===`acpRegistry`&&w?.methods?.length===0),ee=E?w?.phase===`starting`?`Starting sign-in…`:w?.phase===`verifying`?`Checking your account…`:T?.type===`terminal`?`Complete sign-in in the terminal below.`:T?.type===`credentials`?`Enter your credentials below.`:`Finish signing in in your browser.`:D?`Signed in.`:O?`Discovering sign-in methods…`:A?`No in-app sign-in advertised. Follow the provider's docs to finish setup.`:`Sign in on ${t}.`,j=w?.phase===`failed`?w.message:null,M=i||y||o.error!==null||O,N=`${w?.flowId??``}:${T?.id??``}`,P=h.id===N?h.values:{},F=T?.type===`browser`||T?.type===`deviceCode`?T.url:w?.authorizationUrl;async function te(e){if(x.current)return!1;x.current=!0,b(!0),v(null);let t=!1;try{let n=await e();if(n._tag===`Success`)t=!0;else if(!U(n)){let e=se(n);v(e instanceof Error?e.message:`Provider sign-in failed. Try again.`)}}catch{v(`Provider sign-in failed. Try again.`)}return x.current=!1,b(!1),t}async function I(t){return!w?.flowId||!T?!1:te(()=>l({environmentId:e,input:{instanceId:n,flowId:w.flowId,interactionId:T.id,response:t}}))}async function L(){if(!F||i)return;let e=T?.type===`browser`&&T.requiresConsent,t=e&&!window.desktopBridge?window.open(``,`_blank`):null;t&&(t.opener=null);try{if(e&&!await I({type:`browser`,action:`accept`})){t?.close();return}t?t.location.href=F:await Pe().shell.openExternal(F),v(null)}catch{t?.close(),v(`Could not open the sign-in page. Copy the link and open it in your browser.`)}}function z(e,t){g({id:N,values:{...P,[e]:t}})}return(0,$.jsx)(Dt,{title:`Account`,description:D&&!E&&r.auth.email?.trim()?(0,$.jsxs)(`span`,{children:[`Signed in as`,` `,(0,$.jsx)(tn,{value:r.auth.email,ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`max-w-full truncate`},r.auth.email)]}):(0,$.jsx)(`span`,{role:`status`,children:ee}),status:j?(0,$.jsx)(`p`,{role:`status`,className:`[overflow-wrap:anywhere]`,children:j}):void 0,control:(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1.5`,children:[!E&&(w?.methods?.length??0)>1?(0,$.jsxs)(Ce,{value:w?.methods?.some(e=>e.id===p)?p:``,disabled:M,onValueChange:e=>m(e??``),children:[(0,$.jsx)(Se,{size:`sm`,"aria-label":`Sign-in method`,className:`w-44`,children:(0,$.jsx)(be,{children:w?.methods?.find(e=>e.id===p)?.name??`Provider default`})}),(0,$.jsxs)(xe,{children:[(0,$.jsx)(q,{value:``,children:`Provider default`}),w?.methods?.map(e=>(0,$.jsx)(q,{value:e.id,children:e.name},e.id))]})]}):null,F?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(k,{size:`sm`,variant:`outline`,disabled:M,onClick:()=>void L(),children:`Open browser`}),(0,$.jsxs)(me,{children:[(0,$.jsx)(de,{render:(0,$.jsx)(k,{"aria-label":`Copy sign-in link`,size:`icon-sm`,variant:`ghost-muted`,disabled:M,onClick:()=>{let e=Te(F,`Provider sign-in link`);(async()=>{await e,T?.type===`browser`&&T.requiresConsent&&await I({type:`browser`,action:`accept`})})().catch(()=>v(`Could not copy the sign-in link.`))},children:(0,$.jsx)(R,{})})}),(0,$.jsx)(pe,{children:`Copy sign-in link`})]})]}):null,(0,$.jsxs)($.Fragment,{children:[A&&r.setup?.documentationUrl?(0,$.jsx)(k,{size:`sm`,variant:`outline`,render:(0,$.jsx)(`a`,{href:r.setup.documentationUrl,target:`_blank`,rel:`noreferrer`}),children:`Open docs`}):E&&w?.flowId?(0,$.jsx)(k,{size:`sm`,variant:`ghost-muted`,"aria-label":`Cancel sign-in`,disabled:M,onClick:()=>void te(()=>d({environmentId:e,input:{instanceId:n,flowId:w.flowId}})),children:`Cancel`}):!E&&!A&&r.setup?.canAuthenticate!==!1?(0,$.jsx)(k,{size:`sm`,variant:`outline`,disabled:M||!r.enabled||!r.installed||!w,onClick:()=>void te(()=>c({environmentId:e,input:{instanceId:n,...p&&w?.methods?.some(e=>e.id===p)?{methodId:p}:{}}})),children:D?`Change account`:w?.phase===`failed`||w?.phase===`cancelled`?`Retry sign-in`:`Sign in`}):null,!E&&D&&(r.auth.canLogout??r.setup?.canAuthenticate)?(0,$.jsx)(k,{size:`sm`,variant:`ghost`,disabled:M||!w,onClick:()=>{Pe().dialogs.confirm(`Sign out of ${r.displayName??r.driver} on ${t}? This stops running threads that share this sign-in. Thread history is kept.`).then(e=>{e&&te(()=>f(a))})},children:`Sign out`}):null]})]}),children:T?.type===`terminal`||T?.type===`credentials`||T?.type===`deviceCode`||F&&(T?.type===`browser`?T.acceptsCallback:!T)||_||o.error?(0,$.jsxs)($.Fragment,{children:[T?.type===`deviceCode`?(0,$.jsxs)(`p`,{className:`py-2 text-sm text-muted-foreground`,children:[`Enter code`,` `,(0,$.jsx)(`code`,{className:`select-all font-mono text-foreground`,children:T.userCode}),` `,`in your browser.`]}):null,T?.type===`terminal`?(0,$.jsx)(`div`,{className:`py-2`,children:(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Loading sign-in terminal…`}),children:(0,$.jsx)(Qn,{output:T.output,outputOffset:T.outputOffset,onResponse:t=>{if(!i&&w?.flowId){for(let e=0;e<Math.max(1,t.data.length);e+=4096)S.current.push({instanceId:n,flowId:w.flowId,interactionId:T.id,response:{...t,data:t.data.slice(e,e+4096)}});C.current||(C.current=!0,(async()=>{for(;S.current.length>0;){let t=S.current.shift(),n=await l({environmentId:e,input:t});if(n._tag!==`Success`){S.current=[],U(n)||v(`The provider sign-in terminal is no longer available.`);break}}})().catch(()=>{S.current=[],v(`Could not send input to the provider sign-in terminal.`)}).finally(()=>{C.current=!1}))}}},`${w?.flowId}:${T.id}`)})}):null,T?.type===`credentials`?(0,$.jsxs)(`form`,{className:`grid gap-2 py-2 text-sm leading-normal`,onSubmit:e=>{e.preventDefault(),I({type:`credentials`,values:P}).then(e=>{e&&g({id:``,values:{}})})},children:[T.fields.map(e=>(0,$.jsxs)(`label`,{className:`grid gap-1`,children:[e.label,(0,$.jsx)(Je,{size:`sm`,type:e.secret?`password`:`text`,autoComplete:`off`,value:P[e.name]??``,disabled:M,maxLength:16384,onChange:t=>z(e.name,t.target.value)})]},e.name)),(0,$.jsx)(k,{type:`submit`,size:`sm`,variant:`outline`,className:`w-fit`,disabled:M,children:`Connect`})]}):null,F&&(T?.type===`browser`?T.acceptsCallback:!T)?(0,$.jsxs)(`form`,{className:`grid gap-2 py-2 text-sm leading-normal`,onSubmit:t=>{t.preventDefault(),w?.flowId&&P.callback?.trim()&&te(()=>u({environmentId:e,input:{instanceId:n,flowId:w.flowId,callbackUrl:P.callback}})).then(e=>{e&&g({id:``,values:{}})})},children:[(0,$.jsxs)(`label`,{className:`grid gap-1`,children:[`If the final localhost page does not load, paste its full URL here.`,(0,$.jsx)(Je,{size:`sm`,id:`provider-callback-${n}`,type:`url`,autoComplete:`off`,value:P.callback??``,disabled:M,maxLength:16384,onChange:e=>z(`callback`,e.target.value)})]}),(0,$.jsx)(k,{type:`submit`,size:`sm`,variant:`outline`,className:`w-fit`,disabled:M||!P.callback?.trim(),children:`Continue`})]}):null,_||o.error?(0,$.jsx)(`p`,{role:`alert`,className:`py-2 text-xs text-destructive`,children:_??o.error}):null]}):null})}function er(e){let t=(0,jn.c)(26),{environmentId:n,environmentLabel:r,instanceId:i,onFinish:a}=e,s=o(Y.providersValueAtom(n))??Le,c;if(t[0]!==i||t[1]!==s){let e;t[3]===i?e=t[4]:(e=e=>e.instanceId===i,t[3]=i,t[4]=e),c=s.find(e),t[0]=i,t[1]=s,t[2]=c}else c=t[2];let l=c,u;t[5]!==n||t[6]!==i?(u=Y.providerAuthState({environmentId:n,input:{instanceId:i}}),t[5]=n,t[6]=i,t[7]=u):u=t[7];let d=Ve(u),f=d.data,p=f?.phase===`starting`||f?.phase===`waiting`||f?.phase===`verifying`,m=l?.auth.status===`authenticated`||l?.auth.status===`unknown`&&f?.phase===`succeeded`,h=!m&&!d.error&&f?.methods===void 0,g=(f?.methods?.length??0)>0,_;t[8]!==f?.message||t[9]!==g||t[10]!==n||t[11]!==r||t[12]!==i||t[13]!==h||t[14]!==l||t[15]!==d.error||t[16]!==m?(_=(0,$.jsx)(rn,{className:`min-h-72`,children:(0,$.jsx)(Et,{variant:`plain`,children:l&&(g||m)?(0,$.jsx)($n,{environmentId:n,environmentLabel:r,instanceId:i,provider:{...l,setup:{...l.setup,canInstall:l.setup?.canInstall??!1,canAuthenticate:g}},readOnly:!1}):(0,$.jsx)(Dt,{title:`Account`,description:h?`Discovering sign-in methods…`:d.error??f?.message??`No in-app sign-in advertised. Follow the provider's docs to finish setup.`,control:h?(0,$.jsx)(k,{disabled:!0,size:`sm`,variant:`outline`,children:`Sign in`}):l?.setup?.documentationUrl?(0,$.jsx)(k,{size:`sm`,variant:`outline`,render:(0,$.jsx)(`a`,{href:l.setup.documentationUrl,target:`_blank`,rel:`noreferrer`}),children:`Open docs`}):void 0})})}),t[8]=f?.message,t[9]=g,t[10]=n,t[11]=r,t[12]=i,t[13]=h,t[14]=l,t[15]=d.error,t[16]=m,t[17]=_):_=t[17];let v=m?`default`:`outline`,y=m?`Done`:`Skip for now`,b;t[18]!==p||t[19]!==a||t[20]!==v||t[21]!==y?(b=(0,$.jsx)(on,{children:(0,$.jsx)(k,{size:`sm`,variant:v,disabled:p,onClick:a,children:y})}),t[18]=p,t[19]=a,t[20]=v,t[21]=y,t[22]=b):b=t[22];let x;return t[23]!==_||t[24]!==b?(x=(0,$.jsxs)($.Fragment,{children:[_,b]}),t[23]=_,t[24]=b,t[25]=x):x=t[25],x}var tr=he(),nr=[{id:`low`,label:`Low`},{id:`medium`,label:`Medium`,isDefault:!0},{id:`high`,label:`High`},{id:`xhigh`,label:`Extra High`}],rr={[j.make(`codex`)]:[{id:`reasoningEffort`,label:`Reasoning`,type:`select`,choices:nr},{id:`serviceTier`,label:`Speed`,type:`select`,choices:[{id:`default`,label:`Standard`,isDefault:!0},{id:`fast`,label:`Fast`}]}],[j.make(`claudeAgent`)]:[{id:`effort`,label:`Reasoning`,type:`select`,choices:[{id:`low`,label:`Low`},{id:`medium`,label:`Medium`},{id:`high`,label:`High`,isDefault:!0},{id:`xhigh`,label:`Extra High`},{id:`max`,label:`Max`}]},{id:`fastMode`,label:`Fast Mode`,type:`boolean`},{id:`thinking`,label:`Thinking`,type:`boolean`}],[j.make(`cursor`)]:[{id:`reasoning`,label:`Reasoning`,type:`select`,choices:nr},{id:`fastMode`,label:`Fast Mode`,type:`boolean`},{id:`thinking`,label:`Thinking`,type:`boolean`}],[j.make(`grok`)]:[{id:`reasoningEffort`,label:`Reasoning`,type:`select`,choices:nr}],[j.make(`pi`)]:[{id:`thinking`,label:`Thinking`,type:`select`,choices:[{id:`off`,label:`Off`},{id:`minimal`,label:`Minimal`},{id:`low`,label:`Low`},{id:`medium`,label:`Medium`,isDefault:!0},{id:`high`,label:`High`},{id:`xhigh`,label:`Extra High`},{id:`max`,label:`Max`}]}],[j.make(`opencode`)]:[{id:`variant`,label:`Reasoning`,type:`select`,choices:nr},{id:`agent`,label:`Agent`,type:`select`,choices:[{id:`build`,label:`Build`,isDefault:!0},{id:`plan`,label:`Plan`}]}]},ir=0;function ar(){return ir+=1,`k${ir}`}function or(e){return{key:ar(),id:e.id,label:e.label,isDefault:!!e.isDefault}}function sr(e){return{key:ar(),type:e.type,id:e.id,label:e.label,choices:(e.choices??[]).map(or)}}function cr(){return{key:ar(),type:`select`,id:``,label:``,choices:[]}}function lr(){return{key:ar(),id:``,label:``,isDefault:!1}}function ur(e){let t=new Set(e.type===`select`?e.promptInjectedValues??[]:[]),n=e.type===`select`?e.options.filter(e=>!t.has(e.id)):[],r=n.find(t=>t.id===e.currentValue)??n.find(e=>e.isDefault);return{key:ar(),type:e.type,id:e.id,label:e.label,...e.description===void 0?{}:{description:e.description},...e.type===`boolean`&&e.currentValue!==void 0?{currentBooleanValue:e.currentValue}:{},choices:n.map(e=>({key:ar(),id:e.id,label:e.label,...e.description===void 0?{}:{description:e.description},isDefault:e===r}))}}function dr(e){return{slug:e.slug,name:e.name===e.slug?``:e.name,descriptors:(e.capabilities?.optionDescriptors??[]).map(ur)}}function fr(e,t){return(e?.optionDescriptors??[]).filter(e=>t!==`claudeAgent`||e.id!==`contextWindow`).map(ur)}function pr(e){let t=new Set;for(let[n,r]of e.descriptors.entries()){let e=`Option ${n+1}`,i=r.id.trim();if(!i)return`${e} needs an id.`;if(t.has(i))return`${e}: id "${i}" is used twice.`;if(t.add(i),!r.label.trim())return`${e} needs a label.`;if(r.type!==`select`)continue;if(r.choices.length===0)return`${e} needs at least one choice.`;let a=new Set;for(let t of r.choices){let n=t.id.trim();if(!n)return`${e} has a choice without a value.`;if(a.has(n))return`${e}: choice "${n}" is used twice.`;a.add(n)}}return null}function mr(e){let t=e.descriptors.map(e=>{let t=e.id.trim(),n=e.label.trim();if(e.type===`boolean`)return{id:t,label:n,type:`boolean`,...e.description===void 0?{}:{description:e.description},...e.currentBooleanValue===void 0?{}:{currentValue:e.currentBooleanValue}};let r=e.choices.map(e=>({id:e.id.trim(),label:e.label.trim()||e.id.trim(),...e.description===void 0?{}:{description:e.description},...e.isDefault?{isDefault:!0}:{}})),i=r.find(e=>e.isDefault)?.id;return{id:t,label:n,type:`select`,...e.description===void 0?{}:{description:e.description},options:r,...i?{currentValue:i}:{}}}),n=e.name.trim();return{slug:e.slug,name:n||e.slug,capabilities:t.length>0?N({optionDescriptors:t}):null}}var hr=`__custom__`,gr=`__none__`;function _r(e){let t=(0,jn.c)(79),{instanceId:n,driverKind:r,entry:i,builtInModels:a,onSave:o,onCancel:s}=e,c;t[0]===i?c=t[1]:(c=()=>dr(i),t[0]=i,t[1]=c);let[l,u]=(0,Q.useState)(c),[d,f]=(0,Q.useState)(null),p;t[2]===r?p=t[3]:(p=r?rr[r]??[]:[],t[2]=r,t[3]=p);let m=p,h;t[4]===a?h=t[5]:(h=a.filter(br),t[4]=a,t[5]=h);let g=h,_;t[6]===n?_=t[7]:(_=e=>`provider-instance-${n}-custom-model-${e}`,t[6]=n,t[7]=_);let v=_,y;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(y=(e,t)=>{f(null),u(n=>({...n,descriptors:n.descriptors.map(n=>n.key===e?{...n,...t}:n)}))},t[8]=y):y=t[8];let b=y,x;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(x=(e,t,n)=>{f(null),u(r=>({...r,descriptors:r.descriptors.map(r=>r.key===e?{...r,choices:r.choices.map(e=>e.key===t?{...e,...n}:n.isDefault?{...e,isDefault:!1}:e)}:r)}))},t[9]=x):x=t[9];let S=x,C;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=e=>{f(null),u(t=>({...t,descriptors:t.descriptors.filter(t=>t.key!==e)}))},t[10]=C):C=t[10];let w=C,T;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>{f(null),u(t=>({...t,descriptors:[...t.descriptors,e]}))},t[11]=T):T=t[11];let E=T,D;t[12]===m?D=t[13]:(D=(e,t)=>{if(t===null)return;if(t===hr){b(e.key,{id:``});return}let n=m.find(e=>e.id===t);n&&b(e.key,{id:n.id,label:n.label,type:n.type,choices:(n.choices??[]).map(or),currentBooleanValue:void 0,description:void 0})},t[12]=m,t[13]=D);let O=D,ee;t[14]!==r||t[15]!==g?(ee=e=>{if(e===null||e===gr)return;let t=g.find(t=>t.slug===e);t&&(f(null),u(e=>({...e,descriptors:fr(t.capabilities,r)})))},t[14]=r,t[15]=g,t[16]=ee):ee=t[16];let j=ee,M;t[17]!==l||t[18]!==o?(M=()=>{let e=pr(l);if(e){f(e);return}o(mr(l))},t[17]=l,t[18]=o,t[19]=M):M=t[19];let N=M,P;t[20]===m?P=t[21]:(P=e=>m.some(t=>t.id===e.id)?e.id:hr,t[20]=m,t[21]=P);let F=P,te;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(te=(e,t)=>(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Je,{size:`compact`,value:t.id,onChange:n=>S(e.key,t.key,{id:n.target.value}),placeholder:`value`,font:`mono`,className:`w-28`,spellCheck:!1,"aria-label":`Choice value`}),(0,$.jsx)(Je,{size:`compact`,value:t.label,onChange:n=>S(e.key,t.key,{label:n.target.value}),placeholder:`Label`,className:`min-w-0 flex-1`,"aria-label":`Choice label`}),(0,$.jsxs)(`label`,{className:`flex shrink-0 items-center gap-1.5 text-2xs text-muted-foreground`,children:[(0,$.jsx)(Ut,{size:`sm`,checked:t.isDefault,onCheckedChange:n=>S(e.key,t.key,{isDefault:n}),"aria-label":`Default choice`}),`Default`]}),(0,$.jsx)(k,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":`Remove choice`,onClick:()=>b(e.key,{choices:e.choices.filter(e=>e.key!==t.key)}),children:(0,$.jsx)(H,{className:`size-3`})})]},t.key),t[22]=te):te=t[22];let I=te,L;t[23]!==O||t[24]!==F||t[25]!==m?(L=(e,t)=>(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md border border-border/60 bg-background/40 p-2.5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsxs)(`span`,{className:`w-14 shrink-0 text-2xs text-muted-foreground`,children:[`Option `,t+1]}),m.length>0?(0,$.jsxs)(Ce,{value:F(e),onValueChange:t=>O(e,t),children:[(0,$.jsx)(Se,{size:`compact`,className:`w-40`,"aria-label":`Option id`,children:(0,$.jsx)(be,{children:F(e)===hr?`Custom…`:e.id})}),(0,$.jsxs)(xe,{align:`start`,alignItemWithTrigger:!1,children:[m.map(yr),(0,$.jsx)(q,{value:hr,children:`Custom…`})]})]}):null,F(e)===hr?(0,$.jsx)(Je,{size:`compact`,value:e.id,onChange:t=>b(e.key,{id:t.target.value}),placeholder:`optionId`,font:`mono`,className:`w-36`,spellCheck:!1,"aria-label":`Option id`}):null,(0,$.jsx)(Je,{size:`compact`,value:e.label,onChange:t=>b(e.key,{label:t.target.value}),placeholder:`Label`,className:`min-w-0 flex-1`,"aria-label":`Option label`}),(0,$.jsxs)(Ce,{value:e.type,onValueChange:t=>b(e.key,{type:t===`boolean`?`boolean`:`select`}),children:[(0,$.jsx)(Se,{size:`compact`,className:`w-24`,"aria-label":`Option type`,children:(0,$.jsx)(be,{children:e.type===`boolean`?`Toggle`:`Choices`})}),(0,$.jsxs)(xe,{align:`end`,alignItemWithTrigger:!1,children:[(0,$.jsx)(q,{value:`select`,children:`Choices`}),(0,$.jsx)(q,{value:`boolean`,children:`Toggle`})]})]}),(0,$.jsx)(k,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":`Remove option ${t+1}`,onClick:()=>w(e.key),children:(0,$.jsx)(H,{className:`size-3`})})]}),e.type===`select`?(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5 pl-16`,children:[e.choices.map(t=>I(e,t)),(0,$.jsxs)(k,{type:`button`,size:`xs`,variant:`ghost-muted`,className:`-ml-2 self-start`,onClick:()=>b(e.key,{choices:[...e.choices,lr()]}),children:[(0,$.jsx)(re,{className:`size-3`}),`Add choice`]})]}):null]},e.key),t[23]=O,t[24]=F,t[25]=m,t[26]=L):L=t[26];let R=L,z;t[27]===s?z=t[28]:(z=e=>{e.key===`Escape`&&(e.preventDefault(),s())},t[27]=s,t[28]=z);let B=v(`name`),ne;t[29]===B?ne=t[30]:(ne=(0,$.jsx)(`label`,{htmlFor:B,className:`text-xs text-muted-foreground`,children:`Display name`}),t[29]=B,t[30]=ne);let ie=v(`name`),ae;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(ae=e=>u(t=>({...t,name:e.target.value})),t[31]=ae):ae=t[31];let oe;t[32]!==l.name||t[33]!==l.slug||t[34]!==ie?(oe=(0,$.jsx)(Je,{id:ie,size:`sm`,autoFocus:!0,value:l.name,onChange:ae,placeholder:l.slug,className:`sm:w-72`,spellCheck:!1}),t[32]=l.name,t[33]=l.slug,t[34]=ie,t[35]=oe):oe=t[35];let V;t[36]!==ne||t[37]!==oe?(V=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[ne,oe]}),t[36]=ne,t[37]=oe,t[38]=V):V=t[38];let U;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Options shown in the composer`}),t[39]=U):U=t[39];let se;t[40]!==j||t[41]!==g?(se=g.length>0?(0,$.jsxs)(Ce,{value:gr,onValueChange:j,children:[(0,$.jsx)(Se,{size:`compact`,className:`w-44`,"aria-label":`Copy options from a built-in model`,children:(0,$.jsx)(be,{children:`Copy from…`})}),(0,$.jsx)(xe,{align:`end`,alignItemWithTrigger:!1,children:g.map(vr)})]}):null,t[40]=j,t[41]=g,t[42]=se):se=t[42];let ce;t[43]===se?ce=t[44]:(ce=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[U,se]}),t[43]=se,t[44]=ce);let le;t[45]===l.descriptors.length?le=t[46]:(le=l.descriptors.length===0?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground/70`,children:`No custom options. The composer uses the provider's default options.`}):null,t[45]=l.descriptors.length,t[46]=le);let W;t[47]!==l.descriptors||t[48]!==R?(W=l.descriptors.map(R),t[47]=l.descriptors,t[48]=R,t[49]=W):W=t[49];let G;if(t[50]!==l.descriptors||t[51]!==m){let e;t[53]===l.descriptors?e=t[54]:(e=e=>!l.descriptors.some(t=>t.id===e.id),t[53]=l.descriptors,t[54]=e);let n;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(n=e=>(0,$.jsxs)(k,{type:`button`,size:`xs`,variant:`ghost-muted`,className:A(`-ml-2 first:ml-0`),onClick:()=>E(sr(e)),children:[(0,$.jsx)(re,{className:`size-3`}),e.label]},e.id),t[55]=n):n=t[55],G=m.filter(e).map(n),t[50]=l.descriptors,t[51]=m,t[52]=G}else G=t[52];let ue;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,$.jsxs)(k,{type:`button`,size:`xs`,variant:`ghost-muted`,onClick:()=>E(cr()),children:[(0,$.jsx)(re,{className:`size-3`}),`Custom option`]}),t[56]=ue):ue=t[56];let de;t[57]===G?de=t[58]:(de=(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[G,ue]}),t[57]=G,t[58]=de);let fe;t[59]!==ce||t[60]!==le||t[61]!==W||t[62]!==de?(fe=(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[ce,le,W,de]}),t[59]=ce,t[60]=le,t[61]=W,t[62]=de,t[63]=fe):fe=t[63];let pe;t[64]===d?pe=t[65]:(pe=d?(0,$.jsx)(`p`,{className:`text-xs text-destructive`,children:d}):null,t[64]=d,t[65]=pe);let me;t[66]===N?me=t[67]:(me=(0,$.jsx)(k,{size:`sm`,variant:`outline`,onClick:N,children:`Save`}),t[66]=N,t[67]=me);let he;t[68]===s?he=t[69]:(he=(0,$.jsx)(k,{size:`sm`,variant:`ghost`,onClick:s,children:`Cancel`}),t[68]=s,t[69]=he);let K;t[70]!==me||t[71]!==he?(K=(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[me,he]}),t[70]=me,t[71]=he,t[72]=K):K=t[72];let ge;return t[73]!==z||t[74]!==V||t[75]!==fe||t[76]!==pe||t[77]!==K?(ge=(0,$.jsxs)(`div`,{className:`mx-2 mt-1 mb-2 flex flex-col gap-3 rounded-md border border-border bg-muted/20 p-3`,onKeyDown:z,children:[V,fe,pe,K]}),t[73]=z,t[74]=V,t[75]=fe,t[76]=pe,t[77]=K,t[78]=ge):ge=t[78],ge}function vr(e){return(0,$.jsx)(q,{value:e.slug,children:e.name},e.slug)}function yr(e){return(0,$.jsx)(q,{value:e.id,children:(0,$.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,$.jsx)(`code`,{className:`font-mono text-xs`,children:e.id}),(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:e.label})]})},e.id)}function br(e){return(e.capabilities?.optionDescriptors?.length??0)>0}var xr={[j.make(`codex`)]:`gpt-6.7-codex-ultra-preview`,[j.make(`claudeAgent`)]:`claude-sonnet-5`,[j.make(`cursor`)]:`claude-sonnet-4-6`,[j.make(`opencode`)]:`openai/gpt-5`,[j.make(`pi`)]:`anthropic/claude-sonnet-5`},Sr=8;function Cr(e){let t=e.capabilities?.optionDescriptors??[],n=[];return t.some(e=>e.id===`fastMode`||e.id===`serviceTier`&&e.type===`select`&&e.options.some(e=>e.id===`fast`||e.label===`Fast`))&&n.push(`Fast mode`),t.some(e=>e.id===`thinking`)&&n.push(`Thinking`),t.some(e=>e.type===`select`&&(e.id===`reasoningEffort`||e.id===`effort`||e.id===`reasoning`||e.id===`variant`))&&n.push(`Reasoning`),n}function wr(e,t){let n=f(e,{favoriteModels:t.favoriteModels,groupFavorites:!0,modelOrder:t.modelOrder}),r=e=>!e.isCustom&&t.hiddenModels.has(e.slug);return[...n.filter(e=>t.favoriteModels.has(e.slug)),...n.filter(e=>!t.favoriteModels.has(e.slug)&&!r(e)),...n.filter(e=>!t.favoriteModels.has(e.slug)&&r(e))]}function Tr(e,t){let n=e.filter(e=>!e.isCustom).map(e=>e.slug),r=new Set(n);return n.every(e=>t.includes(e))?t.filter(e=>!r.has(e)):[...new Set([...t,...n])]}function Er(e){let t=(0,jn.c)(148),{instanceId:n,driverKind:r,models:i,customModels:a,canManageCustomModels:o,canWritePreferences:s,hiddenModels:c,favoriteModels:l,modelOrder:u,onChange:d,onHiddenModelsChange:f,onFavoriteModelsChange:p,onToggleFavorite:m,onModelOrderChange:h}=e,g=s===void 0||s,[_,v]=(0,Q.useState)(``),[y,b]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(``),[C,w]=(0,Q.useState)(null),[T,E]=(0,Q.useState)(null),O=(0,Q.useRef)(null),ee=(0,Q.useRef)(null),j;t[0]===c?j=t[1]:(j=new Set(c),t[0]=c,t[1]=j);let M=j,N;t[2]===l?N=t[3]:(N=new Set(l),t[2]=l,t[3]=N);let P=N,I;t[4]!==P||t[5]!==M||t[6]!==u||t[7]!==i?(I=wr(i,{favoriteModels:P,hiddenModels:M,modelOrder:u}),t[4]=P,t[5]=M,t[6]=u,t[7]=i,t[8]=I):I=t[8];let L=I,R;if(t[9]!==L||t[10]!==P){let e;t[12]===P?e=t[13]:(e=e=>P.has(e.slug),t[12]=P,t[13]=e),R=L.filter(e),t[9]=L,t[10]=P,t[11]=R}else R=t[11];let z=R.length,B;if(t[14]!==L||t[15]!==M){let e;t[17]===M?e=t[18]:(e=e=>!e.isCustom&&M.has(e.slug),t[17]=M,t[18]=e),B=L.filter(e),t[14]=L,t[15]=M,t[16]=B}else B=t[16];let ie=B.length,oe;t[19]===i?oe=t[20]:(oe=i.filter(jr),t[19]=i,t[20]=oe);let V=oe,U;t[21]!==V||t[22]!==M?(U=V.length>0&&V.every(e=>M.has(e.slug)),t[21]=V,t[22]=M,t[23]=U):U=t[23];let se=U,ce=i.length>Sr,le,W;if(t[24]!==L||t[25]!==x||t[26]!==ce){let e=x.trim().toLowerCase();le=ce&&e.length>0,W=le?L.filter(t=>t.name.toLowerCase().includes(e)||t.slug.toLowerCase().includes(e)):L,t[24]=L,t[25]=x,t[26]=ce,t[27]=le,t[28]=W}else le=t[27],W=t[28];let G=W,ue;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(ue=()=>{let e=ee.current;if(e===null)return;let t=O.current?.querySelector(`[data-model-slug="${CSS.escape(e)}"]`);t&&(ee.current=null,t.scrollIntoView({block:`nearest`}))},t[29]=ue):ue=t[29];let fe;t[30]===L?fe=t[31]:(fe=[L],t[30]=L,t[31]=fe),(0,Q.useEffect)(ue,fe);let he;t[32]!==o||t[33]!==a||t[34]!==r||t[35]!==_||t[36]!==i||t[37]!==d?(he=()=>{if(!o||r===`antigravity`)return;let e=D(_);if(!e){w(`Enter a model slug.`);return}if(i.some(t=>!t.isCustom&&t.slug===e)){w(`That model is already built in.`);return}if(e.length>256){w(`Model slugs must be 256 characters or less.`);return}if(a.some(t=>t.slug===e)){w(`That custom model is already saved.`);return}ee.current=e,S(``),d([...a,{slug:e,name:e,capabilities:null}]),v(``),w(null),b(!1)},t[32]=o,t[33]=a,t[34]=r,t[35]=_,t[36]=i,t[37]=d,t[38]=he):he=t[38];let K=he,ge;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(ge=()=>{v(``),w(null),b(!1)},t[39]=ge):ge=t[39];let _e=ge,ve;t[40]!==o||t[41]!==a||t[42]!==T||t[43]!==l||t[44]!==u||t[45]!==d||t[46]!==p||t[47]!==h?(ve=e=>{o&&(T===e&&E(null),d(a.filter(t=>t.slug!==e)),h(u.filter(t=>t!==e)),p(l.filter(t=>t!==e)),w(null))},t[40]=o,t[41]=a,t[42]=T,t[43]=l,t[44]=u,t[45]=d,t[46]=p,t[47]=h,t[48]=ve):ve=t[48];let ye=ve,q;t[49]!==o||t[50]!==a||t[51]!==d?(q=e=>{o&&(d(a.map(t=>t.slug===e.slug?e:t)),E(null))},t[49]=o,t[50]=a,t[51]=d,t[52]=q):q=t[52];let be=q,xe;t[53]!==g||t[54]!==M||t[55]!==c||t[56]!==f?(xe=(e,t)=>{g&&t!==M.has(e)&&f(t?[...c,e]:c.filter(t=>t!==e),[e])},t[53]=g,t[54]=M,t[55]=c,t[56]=f,t[57]=xe):xe=t[57];let Se=xe,Ce;t[58]!==g||t[59]!==m?(Ce=e=>{g&&m(e)},t[58]=g,t[59]=m,t[60]=Ce):Ce=t[60];let we=Ce,J;t[61]!==P||t[62]!==M?(J=e=>P.has(e.slug)?`favorite`:!e.isCustom&&M.has(e.slug)?`hidden`:`visible`,t[61]=P,t[62]=M,t[63]=J):J=t[63];let Te=J,Ee;t[64]!==g||t[65]!==L||t[66]!==Te||t[67]!==h?(Ee=(e,t)=>{if(!g)return;let n=L.findIndex(t=>t.slug===e),r=n+t;if(n<0||r<0||r>=L.length||Te(L[n])!==Te(L[r]))return;let i=L.map(Ar),[a,o]=[i[r],i[n]];i[n]=a,i[r]=o,h(i)},t[64]=g,t[65]=L,t[66]=Te,t[67]=h,t[68]=Ee):Ee=t[68];let De=Ee,Oe;t[69]!==g||t[70]!==we?(Oe=(e,t)=>(0,$.jsxs)(me,{children:[(0,$.jsx)(de,{render:(0,$.jsx)(k,{size:`icon-micro`,variant:`ghost-muted`,disabled:!g,onClick:()=>we(e.slug),"aria-label":`${t?`Remove`:`Add`} ${e.name} ${t?`from`:`to`} favorites`}),children:(0,$.jsx)(ae,{className:A(`size-3`,t&&`fill-current text-warning`)})}),(0,$.jsx)(pe,{side:`top`,children:t?`Remove from favorites`:`Add to favorites`})]}),t[69]=g,t[70]=we,t[71]=Oe):Oe=t[71];let ke=Oe,Ae;t[72]!==o||t[73]!==g||t[74]!==De||t[75]!==ye||t[76]!==le?(Ae=(e,t)=>(0,$.jsxs)(`span`,{className:`flex shrink-0 items-center justify-end gap-0.5`,children:[!t.isHidden&&!le?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(me,{children:[(0,$.jsx)(de,{render:(0,$.jsx)(k,{size:`icon-micro`,variant:`ghost-muted`,disabled:!g||!t.canMoveUp,onClick:()=>De(e.slug,-1),"aria-label":`Move ${e.name} up`}),children:(0,$.jsx)(te,{className:`size-3`})}),(0,$.jsx)(pe,{side:`top`,children:`Move up`})]}),(0,$.jsxs)(me,{children:[(0,$.jsx)(de,{render:(0,$.jsx)(k,{size:`icon-micro`,variant:`ghost-muted`,disabled:!g||!t.canMoveDown,onClick:()=>De(e.slug,1),"aria-label":`Move ${e.name} down`}),children:(0,$.jsx)(F,{className:`size-3`})}),(0,$.jsx)(pe,{side:`top`,children:`Move down`})]})]}):null,e.isCustom?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(me,{children:[(0,$.jsx)(de,{render:(0,$.jsx)(k,{size:`icon-micro`,variant:`ghost-muted`,disabled:!o,"aria-label":`Edit ${e.slug}`,onClick:()=>{o&&E(t=>t===e.slug?null:e.slug)}}),children:(0,$.jsx)(ne,{className:`size-3`})}),(0,$.jsx)(pe,{side:`top`,children:`Edit name and options`})]}),(0,$.jsxs)(me,{children:[(0,$.jsx)(de,{render:(0,$.jsx)(k,{size:`icon-micro`,variant:`ghost-muted`,disabled:!o,"aria-label":`Remove ${e.slug}`,onClick:()=>ye(e.slug)}),children:(0,$.jsx)(H,{className:`size-3`})}),(0,$.jsx)(pe,{side:`top`,children:`Remove custom model`})]})]}):null]}),t[72]=o,t[73]=g,t[74]=De,t[75]=ye,t[76]=le,t[77]=Ae):Ae=t[77];let je=Ae,Me=kr,Ne;t[78]!==g||t[79]!==Se?(Ne=(e,t)=>(0,$.jsxs)(me,{children:[(0,$.jsx)(de,{render:(0,$.jsx)(`span`,{className:`flex shrink-0 items-center`}),children:(0,$.jsx)(Ut,{size:`sm`,checked:!t,disabled:!g||e.isCustom,onCheckedChange:t=>Se(e.slug,!t),"aria-label":`Show ${e.name} in the model picker`})}),(0,$.jsx)(pe,{side:`top`,children:Me(e,t)})]}),t[78]=g,t[79]=Se,t[80]=Ne):Ne=t[80];let Pe=Ne,Fe;t[81]!==L||t[82]!==Te||t[83]!==M||t[84]!==n||t[85]!==le||t[86]!==Pe||t[87]!==je||t[88]!==ke?(Fe=e=>{let t=Cr(e),r=Te(e),i=!e.isCustom&&M.has(e.slug),a=r===`favorite`,o=L.indexOf(e),s=L[o-1],c=L[o+1],l=!le&&s!==void 0&&Te(s)===r,u=!le&&c!==void 0&&Te(c)===r,d=A(`text-xs`,i?`text-muted-foreground`:`text-foreground/90`);return(0,$.jsxs)(`div`,{"data-model-slug":e.slug,className:A(`grid h-7 grid-cols-[1.5rem_minmax(0,1fr)_auto_minmax(5.5rem,auto)_auto] items-center gap-2 rounded-md px-2 transition-colors hover:bg-muted/30`,i&&`opacity-50`),children:[ke(e,a),(0,$.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,$.jsx)(`span`,{className:A(d,`truncate`),children:e.name}),e.name===e.slug?null:(0,$.jsx)(`code`,{className:`truncate font-mono text-2xs text-muted-foreground/70`,children:e.slug}),e.isCustom?(0,$.jsx)(`span`,{className:`text-2xs text-muted-foreground/70`,children:`custom`}):null]}),(0,$.jsx)(`span`,{className:`text-2xs text-muted-foreground/70`,children:t.length>0?(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:t.join(` · `)}):null}),je(e,{isHidden:i,canMoveUp:l,canMoveDown:u}),Pe(e,i)]},`${n}:${e.slug}`)},t[81]=L,t[82]=Te,t[83]=M,t[84]=n,t[85]=le,t[86]=Pe,t[87]=je,t[88]=ke,t[89]=Fe):Fe=t[89];let Ie=Fe,Y=Or,Le;t[90]!==x||t[91]!==ce?(Le=ce?(0,$.jsx)(Je,{value:x,onChange:e=>S(e.target.value),placeholder:`Filter models`,size:`sm`,className:`w-56 max-w-full`,spellCheck:!1,"aria-label":`Filter models`}):null,t[90]=x,t[91]=ce,t[92]=Le):Le=t[92];let Re;t[93]!==se||t[94]!==V||t[95]!==c||t[96]!==i||t[97]!==f?(Re=V.length>0?(0,$.jsx)(k,{type:`button`,size:`xs`,variant:`ghost-muted`,onClick:()=>f(Tr(i,c),V.map(Dr)),children:se?`Enable all`:`Disable all`}):null,t[93]=se,t[94]=V,t[95]=c,t[96]=i,t[97]=f,t[98]=Re):Re=t[98];let ze=i.length===1?``:`s`,Be=z>0?` · ${z} favorite${z===1?``:`s`}`:``,Ve=ie>0?` · ${ie} hidden`:``,X;t[99]!==i.length||t[100]!==ze||t[101]!==Be||t[102]!==Ve?(X=(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[i.length,` model`,ze,Be,Ve]}),t[99]=i.length,t[100]=ze,t[101]=Be,t[102]=Ve,t[103]=X):X=t[103];let He;t[104]!==Re||t[105]!==X?(He=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[Re,X]}),t[104]=Re,t[105]=X,t[106]=He):He=t[106];let Z;t[107]!==r||t[108]!==y?(Z=r!==`antigravity`&&!y?(0,$.jsxs)(k,{type:`button`,size:`xs`,variant:`ghost-muted`,className:`ml-auto`,onClick:()=>b(!0),children:[(0,$.jsx)(re,{className:`size-3`}),`Add custom model`]}):null,t[107]=r,t[108]=y,t[109]=Z):Z=t[109];let Ue;t[110]!==Le||t[111]!==He||t[112]!==Z?(Ue=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[Le,He,Z]}),t[110]=Le,t[111]=He,t[112]=Z,t[113]=Ue):Ue=t[113];let We;t[114]!==le||t[115]!==G.length?(We=G.length===0?(0,$.jsx)(`p`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:le?`No models match.`:`No models reported for this provider yet.`}):null,t[114]=le,t[115]=G.length,t[116]=We):We=t[116];let Ge;t[117]!==V||t[118]!==o||t[119]!==a||t[120]!==r||t[121]!==T||t[122]!==z||t[123]!==Te||t[124]!==be||t[125]!==n||t[126]!==Ie||t[127]!==G?(Ge=G.map((e,t)=>{let i=Te(e),s=G[t-1],c=s===void 0||Te(s)!==i,l=o&&e.isCustom&&T===e.slug?a.find(t=>t.slug===e.slug):void 0;return(0,$.jsxs)(`div`,{children:[c&&z>0&&i===`favorite`?Y(`Favorites`,t===0):null,c&&z>0&&i===`visible`?Y(`All`,t===0):null,c&&i===`hidden`?Y(`Hidden from picker`,t===0):null,Ie(e),l?(0,$.jsx)(_r,{instanceId:n,driverKind:r,entry:l,builtInModels:V,onSave:be,onCancel:()=>E(null)},`${n}:${e.slug}:editor`):null]},`${n}:${e.slug}:group`)}),t[117]=V,t[118]=o,t[119]=a,t[120]=r,t[121]=T,t[122]=z,t[123]=Te,t[124]=be,t[125]=n,t[126]=Ie,t[127]=G,t[128]=Ge):Ge=t[128];let Ke;t[129]!==We||t[130]!==Ge?(Ke=(0,$.jsxs)(`div`,{ref:O,className:`mt-2 -mx-2 max-h-64 overflow-y-auto lg:max-h-none lg:min-h-0 lg:flex-1`,children:[We,Ge]}),t[129]=We,t[130]=Ge,t[131]=Ke):Ke=t[131];let qe;t[132]!==o||t[133]!==r||t[134]!==C||t[135]!==K||t[136]!==_||t[137]!==n||t[138]!==y?(qe=r===`antigravity`||!o?null:y?(0,$.jsxs)(`div`,{className:`mt-3 flex flex-col gap-2 sm:flex-row`,children:[(0,$.jsx)(Je,{id:`provider-instance-${n}-custom-model`,size:`sm`,autoFocus:!0,value:_,onChange:e=>{v(e.target.value),C&&w(null)},onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),_e();return}e.key===`Enter`&&(e.preventDefault(),K())},placeholder:r?xr[r]:`model-slug`,spellCheck:!1}),(0,$.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[(0,$.jsx)(k,{size:`sm`,variant:`outline`,onClick:K,children:`Add`}),(0,$.jsx)(k,{size:`sm`,variant:`ghost`,onClick:_e,children:`Cancel`})]})]}):null,t[132]=o,t[133]=r,t[134]=C,t[135]=K,t[136]=_,t[137]=n,t[138]=y,t[139]=qe):qe=t[139];let Ye;t[140]!==r||t[141]!==C?(Ye=r!==`antigravity`&&C?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-destructive`,children:C}):null,t[140]=r,t[141]=C,t[142]=Ye):Ye=t[142];let Xe;return t[143]!==Ue||t[144]!==Ke||t[145]!==qe||t[146]!==Ye?(Xe=(0,$.jsxs)(`div`,{className:`lg:flex lg:h-full lg:min-h-0 lg:flex-col`,children:[Ue,Ke,qe,Ye]}),t[143]=Ue,t[144]=Ke,t[145]=qe,t[146]=Ye,t[147]=Xe):Xe=t[147],Xe}function Dr(e){return e.slug}function Or(e,t){return(0,$.jsx)(`div`,{className:A(`px-2 pb-1.5 text-2xs text-muted-foreground`,t?`pt-1`:`pt-5`),children:e})}function kr(e,t){return e.isCustom?`Custom models are always shown in the picker`:t?`Hidden from picker`:`Shown in picker`}function Ar(e){return e.slug}function jr(e){return!e.isCustom}function Mr(e,t){if(t._tag!==`Failure`||U(t))return;let n=se(t);J.add({type:`error`,title:e,description:n instanceof Error?n.message:`The ACP operation failed.`})}function Nr(e){let t=ze(e.environmentId,w),n=ze(e.environmentId,l),[r,i]=(0,Q.useState)(e.projects[0]?.id??null),[a,o]=(0,Q.useState)([]),[s,c]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(!1),[f,p]=(0,Q.useState)(null),[m,h]=(0,Q.useState)(null),[g,_]=(0,Q.useState)(!1),[v,y]=(0,Q.useState)([]),[b,x]=(0,Q.useState)(!1),[S,C]=(0,Q.useState)(null),[T,E]=(0,Q.useState)({}),D=X(Y.listAcpRegistrySessions,{reportFailure:!1}),O=X(Y.importAcpRegistrySession,{reportFailure:!1}),A=X(Y.deleteAcpRegistrySession,{reportFailure:!1}),ee=X(Y.listAcpRegistryProviders,{reportFailure:!1}),j=X(Y.setAcpRegistryProvider,{reportFailure:!1}),M=X(Y.disableAcpRegistryProvider,{reportFailure:!1}),N=X(Y.logoutAcpRegistry,{reportFailure:!1}),P=e.provider.nativeSessions?.canList===!0,F=e.provider.nativeSessions?.canLoad===!0||e.provider.nativeSessions?.canResume===!0,te=e.provider.auth.canLogout===!0&&!e.provider.setup?.canAuthenticate,I=e.provider.nativeSessions?.canDelete===!0,L=e.provider.configurableProviders===!0,R=u||f!==null||m!==null||b||S!==null;if(!P&&!te&&!L)return null;let z=async t=>{if(r===null||u)return;d(!0);let n=await D({environmentId:e.environmentId,input:{instanceId:e.instanceId,projectId:r,...t===void 0?{}:{cursor:t}}});if(d(!1),n._tag===`Success`){o(e=>t===void 0?n.value.sessions:[...e,...n.value.sessions]),c(n.value.nextCursor);return}Mr(`Could not list ACP sessions`,n)},B=async t=>{if(!Be(e.environmentId,`orchestration:operate`)||r===null||f!==null)return;p(t.sessionId);let n=await O({environmentId:e.environmentId,input:{instanceId:e.instanceId,projectId:r,sessionId:t.sessionId,title:t.title,updatedAt:t.updatedAt}});if(p(null),n._tag===`Success`){o(e=>e.map(e=>e.sessionId===t.sessionId?{...e,importedThreadId:n.value.threadId}:e)),J.add({type:`success`,title:n.value.imported?`ACP session imported`:`ACP session already imported`});return}Mr(`Could not import ACP session`,n)},ne=async t=>{if(r===null||m!==null||t.importedThreadId!==null||!await Pe().dialogs.confirm(`Permanently delete native ACP session "${t.title??t.sessionId}"?`,{variant:`destructive`})||!Be(e.environmentId,`orchestration:operate`))return;h(t.sessionId);let n=await A({environmentId:e.environmentId,input:{instanceId:e.instanceId,projectId:r,sessionId:t.sessionId}});if(h(null),n._tag===`Success`){o(e=>e.filter(e=>e.sessionId!==t.sessionId)),J.add({type:`success`,title:`ACP session deleted`});return}Mr(`Could not delete ACP session`,n)},re=async()=>{if(r===null||b)return;x(!0);let t=await ee({environmentId:e.environmentId,input:{instanceId:e.instanceId,projectId:r}});if(x(!1),t._tag===`Success`){y(t.value.providers),E(Object.fromEntries(t.value.providers.map(e=>[e.providerId,{apiType:e.current?.apiType??e.supported[0]??``,baseUrl:e.current?.baseUrl??``,headers:``}])));return}Mr(`Could not list ACP providers`,t)},ie=async t=>{if(!Be(e.environmentId,`providers:manage`)||r===null||S!==null)return;let n=T[t.providerId];if(n===void 0||n.apiType.length===0||n.baseUrl.length===0)return;let i;if(n.headers.trim().length>0)try{let e=JSON.parse(n.headers);if(typeof e!=`object`||!e||Array.isArray(e)||!Object.values(e).every(e=>typeof e==`string`))throw Error(`Headers must be a JSON object with string values.`);i=e}catch(e){J.add({type:`error`,title:`Invalid provider headers`,description:e instanceof Error?e.message:`Headers must be valid JSON.`});return}C(t.providerId);let a=await j({environmentId:e.environmentId,input:{instanceId:e.instanceId,projectId:r,providerId:t.providerId,apiType:n.apiType,baseUrl:n.baseUrl,...i===void 0?{}:{headers:i}}});if(C(null),a._tag===`Success`){J.add({type:`success`,title:`ACP provider configured`}),await re();return}Mr(`Could not configure ACP provider`,a)},ae=async t=>{if(r===null||S!==null||t.required||!await Pe().dialogs.confirm(`Disable ACP provider "${t.providerId}"?`,{variant:`destructive`})||!Be(e.environmentId,`providers:manage`))return;C(t.providerId);let n=await M({environmentId:e.environmentId,input:{instanceId:e.instanceId,projectId:r,providerId:t.providerId}});if(C(null),n._tag===`Success`){J.add({type:`success`,title:`ACP provider disabled`}),await re();return}Mr(`Could not disable ACP provider`,n)},oe=async()=>{if(g||!Be(e.environmentId,`providers:manage`))return;_(!0);let t=await N({environmentId:e.environmentId,input:{instanceId:e.instanceId}});if(_(!1),t._tag===`Success`){o([]),c(null),J.add({type:`success`,title:`Logged out of ACP agent`});return}Mr(`Could not log out of ACP agent`,t)};return(0,$.jsxs)(`div`,{className:`grid gap-3`,children:[(0,$.jsx)(Dt,{title:`Native sessions`,description:`Resume agent-owned conversations as P4 threads.`,status:P&&e.projects.length===0?`Add a project before importing sessions.`:void 0,control:(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[te?(0,$.jsx)(k,{type:`button`,size:`sm`,variant:`outline`,disabled:e.readOnly||g,onClick:()=>void oe(),children:g?`Logging out`:`Log out`}):null,P&&e.projects.length>0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(Ce,{value:r??``,disabled:!n||R,onValueChange:e=>{e!==null&&(i(e),o([]),c(null),y([]),E({}))},children:[(0,$.jsx)(Se,{"aria-label":`Project for ACP sessions`,className:`w-40`,size:`sm`,children:(0,$.jsx)(be,{children:e.projects.find(e=>e.id===r)?.title})}),(0,$.jsx)(xe,{children:e.projects.map(e=>(0,$.jsx)(q,{value:e.id,children:e.title},e.id))})]}),(0,$.jsx)(k,{type:`button`,size:`sm`,variant:`outline`,disabled:!n||u||r===null,onClick:()=>void z(),children:u?`Loading`:a.length===0?`List sessions`:`Refresh`})]}):null]}),children:P&&(a.length>0||s!==null)?(0,$.jsxs)($.Fragment,{children:[a.length>0?(0,$.jsx)(`div`,{className:`divide-y divide-border/60 border-y border-border/60`,children:a.map(e=>(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3 py-2`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`truncate text-xs text-foreground`,children:e.title??e.sessionId}),(0,$.jsx)(`code`,{className:`block truncate text-3xs text-muted-foreground`,children:e.sessionId})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,$.jsx)(k,{type:`button`,size:`xs`,variant:`ghost-muted`,disabled:!t||!F||e.importedThreadId!==null||f!==null,onClick:()=>void B(e),children:e.importedThreadId===null?f===e.sessionId?`Importing`:`Import`:`Imported`}),I?(0,$.jsx)(k,{type:`button`,size:`xs`,variant:`ghost-muted`,disabled:!t||e.importedThreadId!==null||m!==null,onClick:()=>void ne(e),children:m===e.sessionId?`Deleting`:`Delete`}):null]})]},e.sessionId))}):null,s===null?null:(0,$.jsx)(k,{type:`button`,size:`xs`,variant:`ghost-muted`,className:`w-fit`,disabled:!n||u,onClick:()=>void z(s),children:u?`Loading`:`Load more`})]}):null}),L?(0,$.jsxs)(`div`,{className:`grid gap-3 border-t border-border/60 px-3 py-3 sm:px-4`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`text-xs font-medium text-foreground`,children:`Agent providers`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Configure non-secret routing. Headers are write-only.`})]}),(0,$.jsx)(k,{type:`button`,size:`xs`,variant:`outline`,disabled:!n||b||r===null,onClick:()=>void re(),children:b?`Loading`:v.length===0?`List providers`:`Refresh`})]}),!P&&e.projects.length>1?(0,$.jsxs)(Ce,{value:r??``,disabled:!n||R,onValueChange:e=>{e!==null&&(i(e),y([]),E({}))},children:[(0,$.jsx)(Se,{"aria-label":`Project for ACP providers`,className:`min-w-48`,size:`xs`,children:(0,$.jsx)(be,{children:e.projects.find(e=>e.id===r)?.title})}),(0,$.jsx)(xe,{children:e.projects.map(e=>(0,$.jsx)(q,{value:e.id,children:e.title},e.id))})]}):null,v.length>0?(0,$.jsx)(`div`,{className:`divide-y divide-border/60 border-y border-border/60`,children:v.map(t=>{let n=T[t.providerId]??{apiType:t.current?.apiType??t.supported[0]??``,baseUrl:t.current?.baseUrl??``,headers:``},r=e=>E(r=>({...r,[t.providerId]:{...n,...e}}));return(0,$.jsxs)(`div`,{className:`grid gap-2 py-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`truncate text-xs font-medium text-foreground`,children:t.providerId}),(0,$.jsxs)(`p`,{className:`text-3xs text-muted-foreground`,children:[t.current===null?`Disabled`:`Configured`,t.required?` · Required`:``]})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,$.jsx)(k,{type:`button`,size:`xs`,variant:`outline`,disabled:e.readOnly||S!==null||n.apiType.length===0||n.baseUrl.length===0,onClick:()=>void ie(t),children:S===t.providerId?`Saving`:`Save`}),!t.required&&t.current!==null?(0,$.jsx)(k,{type:`button`,size:`xs`,variant:`ghost-muted`,disabled:e.readOnly||S!==null,onClick:()=>void ae(t),children:`Disable`}):null]})]}),(0,$.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[9rem_minmax(0,1fr)]`,children:[(0,$.jsxs)(Ce,{value:n.apiType,disabled:e.readOnly||S!==null,onValueChange:e=>{e!==null&&r({apiType:e})},children:[(0,$.jsx)(Se,{"aria-label":`${t.providerId} protocol`,size:`sm`,children:(0,$.jsx)(be,{children:n.apiType})}),(0,$.jsx)(xe,{children:t.supported.map(e=>(0,$.jsx)(q,{value:e,children:e},e))})]}),(0,$.jsx)(Je,{size:`sm`,type:`url`,"aria-label":`${t.providerId} base URL`,placeholder:`https://api.example.com`,value:n.baseUrl,disabled:e.readOnly||S!==null,onValueChange:e=>r({baseUrl:e})})]}),(0,$.jsx)(Je,{size:`sm`,type:`password`,"aria-label":`${t.providerId} write-only headers JSON`,placeholder:`Write-only headers JSON, e.g. {"Authorization":"Bearer …"}`,value:n.headers,disabled:e.readOnly||S!==null,onValueChange:e=>r({headers:e})})]},t.providerId)})}):null]}):null]})}var Pr=/^[a-zA-Z_][a-zA-Z0-9_]*$/;function Fr(e){let t=(0,jn.c)(7),{detail:n,children:r}=e;if(!n)return r;let i;t[0]===r?i=t[1]:(i=(0,$.jsx)(de,{render:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,$.jsx)(pe,{side:`top`,children:n}),t[2]=n,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,$.jsxs)(me,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}var Ir=0,Lr=()=>`provider-env-${Ir++}`;function Rr(e,t){return{id:`${t}:${e.name}`,name:e.name,value:e.value,sensitive:e.sensitive,...e.valueRedacted===void 0?{}:{valueRedacted:e.valueRedacted}}}function zr(e,t){return e.length===t.length&&e.every((e,n)=>{let r=t[n];return r!==void 0&&e.name===r.name&&e.value===r.value&&e.sensitive===r.sensitive&&e.valueRedacted===r.valueRedacted})}function Br(e){return typeof e!=`object`||!e?[]:T(e.customModels)}function Vr(e,t){if(typeof e!=`object`||!e)return null;let n=e[t];return typeof n==`string`&&n.trim().length>0?n.trim():null}function Hr(e,t,n){let r=typeof e==`object`&&e?{...e}:{};return r[t]=n,r}function Ur(e){let t=new Map(x(e.liveModels??[],e=>e.isCustom?p([e.slug,e]):y)),n=e.liveModels?.filter(e=>!e.isCustom)??[],r=new Set(n.map(e=>e.slug)),i=e.customModels.flatMap(e=>r.has(e.slug)?[]:[{slug:e.slug,name:e.name,isCustom:!0,capabilities:e.capabilities??t.get(e.slug)?.capabilities??null}]);return[...n,...i]}function Wr(e){let t=(0,jn.c)(4),n;t[0]===e.email?n=t[1]:(n=e.email?.trim(),t[0]=e.email,t[1]=n);let r=n;if(!r)return null;let i;return t[2]===r?i=t[3]:(i=(0,$.jsx)(tn,{value:r,ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`max-w-full truncate`}),t[2]=r,t[3]=i),i}function Gr(e,t){return e?.find(e=>e.name===t)}function Kr(e,t){return(e??[]).filter(e=>!t.has(e.name))}function qr(e,t,n){let r=n.trim(),i=[],a=!1;for(let n of e??[]){if(n.name!==t.name){i.push(n);continue}a=!0,r.length>0&&i.push({name:n.name,value:r,sensitive:t.sensitive??!0})}return!a&&r.length>0&&i.push({name:t.name,value:r,sensitive:t.sensitive??!0}),i}function Jr(e){let t=(0,jn.c)(16),n=`${e.idPrefix}-environment-${e.field.name}`,r=e.variable?.valueRedacted?``:e.variable?.value??``,i;t[0]!==n||t[1]!==e.field.label?(i=(0,$.jsx)(`label`,{htmlFor:n,children:e.field.label}),t[0]=n,t[1]=e.field.label,t[2]=i):i=t[2];let a;t[3]!==n||t[4]!==e||t[5]!==r?(a=e.field.sensitive===!1?(0,$.jsx)(fn,{id:n,size:`sm`,className:`min-w-0 flex-1`,autoComplete:`off`,value:r,onCommit:t=>e.onCommit(e.field,t),placeholder:e.field.placeholder,spellCheck:!1}):(0,$.jsx)(yn,{id:n,size:`sm`,className:`min-w-0 flex-1`,value:r,onCommit:t=>e.onCommit(e.field,t),placeholder:e.field.placeholder,configured:e.variable?.valueRedacted===!0,spellCheck:!1}),t[3]=n,t[4]=e,t[5]=r,t[6]=a):a=t[6];let o;t[7]===e?o=t[8]:(o=e.variable?(0,$.jsx)(k,{type:`button`,size:`icon-sm`,variant:`ghost-destructive`,onClick:()=>e.onRemove(e.field),"aria-label":`Clear ${e.field.label}`,children:(0,$.jsx)(H,{className:`size-3.5`})}):null,t[7]=e,t[8]=o);let s;t[9]!==a||t[10]!==o?(s=(0,$.jsxs)(`div`,{className:`flex w-full min-w-0 items-center gap-2 @min-[32rem]/settings-row:w-56`,children:[a,o]}),t[9]=a,t[10]=o,t[11]=s):s=t[11];let c;return t[12]!==e.field.description||t[13]!==i||t[14]!==s?(c=(0,$.jsx)(Dt,{title:i,description:e.field.description,control:s}),t[12]=e.field.description,t[13]=i,t[14]=s,t[15]=c):c=t[15],c}function Yr(e){let t=(0,jn.c)(13),n;t[0]===e.environment?n=t[1]:(n=()=>e.environment.map(Rr),t[0]=e.environment,t[1]=n);let[r,i]=(0,Q.useState)(n),a=(0,Q.useRef)(e.environment),o=(0,Q.useRef)(void 0),s,c;t[2]===e.environment?(s=t[3],c=t[4]):(s=()=>{let t=a.current,n=o.current;a.current=e.environment,o.current=void 0,!(t===e.environment||zr(t,e.environment)||n!==void 0&&zr(n,e.environment))&&i(e.environment.map(Rr))},c=[e.environment],t[2]=e.environment,t[3]=s,t[4]=c),(0,Q.useEffect)(s,c);let l;if(t[5]!==e||t[6]!==r){let n=t=>{let n=[];for(let e of t){let t=e.name.trim();if(!Pr.test(t)){if(t.length>0||e.value.length>0||e.sensitive!==!0||e.valueRedacted!==void 0)return;continue}let{id:r,...i}=e;n.push({...i,name:t})}o.current=n,e.onChange(n)},a=(e,t)=>{let a=r.map(n=>n.id===e?{...n,...t,...t.value===void 0?{}:{valueRedacted:!1}}:n);i(a),n(a)},s=e=>{let t=r.filter(t=>t.id!==e);i(t),n(t)},c;t[8]===r?c=t[9]:(c=()=>i([...r,{id:Lr(),name:``,value:``,sensitive:!0}]),t[8]=r,t[9]=c);let u=c,d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(re,{className:`size-3`}),t[10]=d):d=t[10];let f;t[11]===u?f=t[12]:(f=(0,$.jsxs)(k,{type:`button`,size:`sm`,variant:`outline`,onClick:u,children:[d,`Add variable`]}),t[11]=u,t[12]=f),l=(0,$.jsx)(Dt,{title:`Variables`,description:`API keys, base URLs, and other per-instance CLI settings.`,control:f,children:r.length>0?(0,$.jsxs)(`div`,{className:`mt-3 min-w-0 space-y-2 pb-2`,children:[r.map((e,t)=>(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1.5`,children:[(0,$.jsx)(fn,{size:`sm`,font:`mono`,className:`w-full min-w-0 sm:w-44 sm:shrink-0`,value:e.name,onCommit:t=>a(e.id,{name:t.trim()}),placeholder:`VARIABLE_NAME`,spellCheck:!1,"aria-label":`Environment variable name ${t+1}`}),(0,$.jsx)(`span`,{className:`hidden text-xs text-muted-foreground sm:inline`,"aria-hidden":!0,children:`=`}),e.sensitive?(0,$.jsx)(yn,{size:`sm`,font:`mono`,className:`min-w-0 flex-1`,value:e.valueRedacted?``:e.value,onCommit:t=>a(e.id,{value:t}),placeholder:`value`,configured:e.valueRedacted===!0,spellCheck:!1,"aria-label":`Environment variable value ${t+1}`}):(0,$.jsx)(fn,{size:`sm`,font:`mono`,className:`min-w-0 flex-1`,value:e.valueRedacted?``:e.value,onCommit:t=>a(e.id,{value:t}),autoComplete:`off`,placeholder:`value`,spellCheck:!1,"aria-label":`Environment variable value ${t+1}`}),(0,$.jsxs)(me,{children:[(0,$.jsx)(de,{render:(0,$.jsx)(k,{type:`button`,size:`icon-micro`,variant:`ghost-muted`,onClick:()=>{let t=!e.sensitive;a(e.id,{sensitive:t,...t&&e.valueRedacted===void 0?{}:{valueRedacted:t?e.valueRedacted:!1}})},"aria-pressed":e.sensitive,"aria-label":`Mark environment variable ${e.name||t+1} as sensitive`,children:(0,$.jsx)(fe,{className:`size-3`,icon:e.sensitive?tr.Lock:tr.LockOpen})})}),(0,$.jsx)(pe,{side:`top`,children:e.sensitive?`Sensitive, stored separately`:`Plain text`})]}),(0,$.jsx)(k,{type:`button`,size:`icon-micro`,variant:`ghost-destructive`,onClick:()=>s(e.id),"aria-label":`Remove environment variable ${e.name||t+1}`,children:(0,$.jsx)(H,{className:`size-3`})})]},e.id)),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Sensitive values are stored separately and never returned to the app.`})]}):null}),t[5]=e,t[6]=r,t[7]=l}else l=t[7];return l}function Xr(e){let t=(0,jn.c)(26),{projectEnabled:n,deviceEnabled:r}=e,i,a,o,s,c,l,u,d,f;if(t[0]!==r||t[1]!==n){let e=[{key:`project`,label:`Project`,enabled:n,effective:!0},{key:`device`,label:`Device`,enabled:r,effective:!1}];a=ft,t[11]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(me,{children:[(0,$.jsx)(de,{render:(0,$.jsx)(dt,{render:(0,$.jsx)(k,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":`Overridden for this project. Show where this value comes from`})}),children:(0,$.jsx)(B,{className:`size-3 text-primary`})}),(0,$.jsx)(pe,{side:`top`,children:`Overridden for this project`})]}),t[11]=f):f=t[11],i=lt,l=`end`,u=`md`,d=`none`,o=`list`,s=`px-3 py-2.5 text-sm`,c=e.map(Zr),t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f}else i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10];let p;t[12]!==o||t[13]!==s||t[14]!==c?(p=(0,$.jsx)(`ol`,{role:o,className:s,children:c}),t[12]=o,t[13]=s,t[14]=c,t[15]=p):p=t[15];let m;t[16]!==i||t[17]!==l||t[18]!==u||t[19]!==d||t[20]!==p?(m=(0,$.jsx)(i,{align:l,width:u,padding:d,children:p}),t[16]=i,t[17]=l,t[18]=u,t[19]=d,t[20]=p,t[21]=m):m=t[21];let h;return t[22]!==a||t[23]!==f||t[24]!==m?(h=(0,$.jsxs)(a,{children:[f,m]}),t[22]=a,t[23]=f,t[24]=m,t[25]=h):h=t[25],h}function Zr(e){return(0,$.jsxs)(`li`,{className:A(`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 rounded-md px-2 py-1`,e.effective&&`bg-foreground/[0.06]`),children:[(0,$.jsx)(`span`,{className:A(`min-w-0 truncate`,e.effective?`font-medium text-foreground`:`text-muted-foreground`),children:e.label}),(0,$.jsxs)(`span`,{className:A(`flex items-center gap-1.5`,e.effective?`text-foreground`:`text-muted-foreground`),children:[e.enabled?`On`:`Off`,e.effective?(0,$.jsx)(I,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-primary`}):(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-3.5 shrink-0`})]})]},e.key)}var Qr=[];function $r(e){let t=(0,jn.c)(245),{instanceId:n,instance:i,driverOption:o,liveProvider:s,mode:c,selected:l,onSelect:u,readOnly:d,canWriteSettings:f,onUpdate:p,onDelete:m,headerAction:_,setup:v,runtime:y,hiddenModels:b,favoriteModels:x,modelOrder:S,onHiddenModelsChange:C,onFavoriteModelsChange:w,onToggleFavorite:T,onModelOrderChange:E,onRunUpdate:D,onInstallRecommended:O,isUpdating:ee,onAcceptUrlAuth:j,environmentId:N,acpProjects:P,projectOverride:F}=e,te=l!==void 0&&l,I=d!==void 0&&d,B=f===void 0||f,ne=ee!==void 0&&ee,re=P===void 0?Qr:P,ie=F?.effectiveEnabled??a(i),ae=ie?s?.compatibilityAdvisory:void 0,H=ie?s?.status??`warning`:`disabled`,U=bn[H],se=ie?wn(s&&{...s,enabled:!0}):{headline:`Disabled`,detail:null},ce;t[0]===s?.auth.email?ce=t[1]:(ce=s?.auth.email?.trim(),t[0]=s?.auth.email,t[1]=ce);let le=ce,W=ie&&s?.auth.status===`authenticated`,G=ie&&s?.auth.status===`authenticated`?s.auth.label??s.auth.type??null:null,ue=s?.version,fe;t[2]===ue?fe=t[3]:(fe=xn(ue),t[2]=ue,t[3]=fe);let he=fe,K=Dn(s?.versionAdvisory,s?.compatibilityAdvisory,ie),ge=K?.updateCommand??null,_e=s?.updateState,ve=ne?(_e?.status===`queued`||_e?.status===`running`?_e.message:null)??`Starting update`:null,ye=!ne&&(_e?.status===`failed`||_e?.status===`unchanged`)?_e.message:null,q=ae!==void 0&&ae.status!==`supported`&&ae.status!==`unknown`,be=q?V:L,xe=I?void 0:K?.targetVersion?O:D,Se=s?.auth.action,Ce;t[4]!==o?.label||t[5]!==i.displayName||t[6]!==i.driver?(Ce=i.displayName?.trim()||o?.label||String(i.driver),t[4]=o?.label,t[5]=i.displayName,t[6]=i.driver,t[7]=Ce):Ce=t[7];let J=Ce,Te;t[8]===i.accentColor?Te=t[9]:(Te=g(i.accentColor),t[8]=i.accentColor,t[9]=Te);let De=Te,Oe;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(Oe={onCopy:ri,onError:ni},t[10]=Oe):Oe=t[10];let{copyToClipboard:ke}=Ee(Oe),Ae=M(i.driver)?i.driver:null,je,Me;t[11]!==i.config||t[12]!==i.driver||t[13]!==s?.models?(je=i.driver===`antigravity`?[]:Br(i.config),Me=Ur({liveModels:s?.models,customModels:je}),t[11]=i.config,t[12]=i.driver,t[13]=s?.models,t[14]=je,t[15]=Me):(je=t[14],Me=t[15]);let Ne=Me,Pe;t[16]!==i||t[17]!==p?(Pe=e=>{let t=e.trim(),{displayName:n,...r}=i;p(t.length>0?{...r,displayName:t}:r)},t[16]=i,t[17]=p,t[18]=Pe):Pe=t[18];let Fe=Pe,Ie;t[19]!==i||t[20]!==p||t[21]!==F?(Ie=e=>{if(F){F.onChange(e);return}p({...i,enabled:e})},t[19]=i,t[20]=p,t[21]=F,t[22]=Ie):Ie=t[22];let Y=Ie,Le;t[23]!==i||t[24]!==p?(Le=e=>{let t=g(e),{accentColor:n,...r}=i;p(t?{...r,accentColor:t}:r)},t[23]=i,t[24]=p,t[25]=Le):Le=t[25];let Re=Le,ze;t[26]!==i||t[27]!==p?(ze=e=>{let{config:t,...n}=i;p(e===void 0?n:{...n,config:e})},t[26]=i,t[27]=p,t[28]=ze):ze=t[28];let Be=ze,Ve;t[29]!==i||t[30]!==p?(Ve=e=>{let t=Hr(i.config,`customModels`,e.map(r)),{config:n,...a}=i;p({...a,config:t})},t[29]=i,t[30]=p,t[31]=Ve):Ve=t[31];let X=Ve,He;t[32]!==i||t[33]!==p?(He=e=>{let t=e.filter(ti),{environment:n,...r}=i;p(t.length>0?{...r,environment:t}:r)},t[32]=i,t[33]=p,t[34]=He):He=t[34];let Z=He,Ue,We,Ge;t[35]!==o?.environmentFields||t[36]!==i.environment?(We=o?.environmentFields??[],Ue=new Set(We.map(ei)),Ge=Kr(i.environment,Ue),t[35]=o?.environmentFields,t[36]=i.environment,t[37]=Ue,t[38]=We,t[39]=Ge):(Ue=t[37],We=t[38],Ge=t[39]);let Ke=Ge,qe;t[40]!==Ue||t[41]!==i.environment||t[42]!==Z?(qe=e=>{let t=(i.environment??[]).filter(e=>Ue.has(e.name));Z([...t,...e])},t[40]=Ue,t[41]=i.environment,t[42]=Z,t[43]=qe):qe=t[43];let Je=qe,Ye;t[44]!==i.environment||t[45]!==Z?(Ye=(e,t)=>{Z(qr(i.environment,e,t))},t[44]=i.environment,t[45]=Z,t[46]=Ye):Ye=t[46];let Xe=Ye,Ze;t[47]!==i.environment||t[48]!==Z?(Ze=e=>{Z(Kr(i.environment,new Set([e.name])))},t[47]=i.environment,t[48]=Z,t[49]=Ze):Ze=t[49];let Qe=Ze,$e=Ae??i.driver,et;t[50]===i.config?et=t[51]:(et=Vr(i.config,`source`)===`local`?void 0:Vr(i.config,`agentId`)??void 0,t[50]=i.config,t[51]=et);let tt;t[52]===i.config?tt=t[53]:(tt=Vr(i.config,`source`)===`local`?void 0:Vr(i.config,`registryIconUrl`)??void 0,t[52]=i.config,t[53]=tt);let nt=!!De,rt;t[54]!==De||t[55]!==J||t[56]!==$e||t[57]!==et||t[58]!==tt||t[59]!==nt?(rt=(0,$.jsx)(wt,{driverKind:$e,displayName:J,accentColor:De,acpRegistryAgentId:et,acpRegistryIconUrl:tt,showBadge:nt,className:`size-5`,iconClassName:`size-4 text-foreground/80`,badgeClassName:`right-[-0.125rem] bottom-[-0.125rem] h-3 min-w-3 px-0.5 text-5xs`}),t[54]=De,t[55]=J,t[56]=$e,t[57]=et,t[58]=tt,t[59]=nt,t[60]=rt):rt=t[60];let it=rt,at;t[61]===_?at=t[62]:(at=_?(0,$.jsx)(`span`,{className:`inline-flex h-5 w-5 shrink-0 items-center justify-center`,children:_}):null,t[61]=_,t[62]=at);let ot=at,st;t[63]===he?st=t[64]:(st=he?(0,$.jsx)(`code`,{className:`text-xs text-muted-foreground`,children:he}):null,t[63]=he,t[64]=st);let ct=st,ut;t[65]!==H||t[66]!==U?(ut=H===`warning`||H===`error`?(0,$.jsx)(`span`,{className:A(`size-1.5 shrink-0 rounded-full`,U.dot),"aria-hidden":!0}):null,t[65]=H,t[66]=U,t[67]=ut):ut=t[67];let pt=ut,mt=H===`warning`||H===`error`,ht=q&&mt?se.detail:null,gt=q?ae?.status===`broken`?`Incompatible`:ae?.status===`unsupported`?`Unsupported`:`Limited support`:se.detail,_t=W&&le?(0,$.jsxs)($.Fragment,{children:[mt?pt:null,(0,$.jsx)(`span`,{children:`Authenticated as`}),(0,$.jsx)(Wr,{email:le}),G?(0,$.jsxs)(`span`,{children:[`· `,G]}):null,gt?(0,$.jsxs)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[`· `,gt]}):null]}):(0,$.jsxs)($.Fragment,{children:[pt,(0,$.jsx)(`span`,{children:se.headline}),gt?(0,$.jsxs)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[`· `,gt]}):null]}),vt=K?(0,$.jsxs)(ft,{children:[(0,$.jsxs)(me,{children:[(0,$.jsx)(de,{render:(0,$.jsx)(dt,{render:(0,$.jsx)(k,{type:`button`,size:c===`list`?`icon-micro`:`icon-xs`,variant:`ghost-muted`,className:c===`list`?`pointer-events-auto relative shrink-0`:void 0,"aria-label":`${ve?`Updating`:K.title} — view details`,children:ve?(0,$.jsx)(we,{tone:`muted`,...c===`list`?{size:`sm`}:{}}):(0,$.jsx)(be,{className:A(c===`list`&&`size-3.5`,q&&`text-warning`)})})})}),(0,$.jsx)(pe,{side:`top`,children:ve?`Updating`:K.title})]}),(0,$.jsx)(lt,{side:`bottom`,align:`end`,width:`md`,"aria-label":K.title,children:(0,$.jsxs)(`div`,{className:`grid min-w-0 gap-3`,children:[(0,$.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,$.jsx)(`p`,{className:`text-sm font-semibold leading-tight text-foreground`,children:K.title}),(0,$.jsx)(`p`,{className:A(`text-xs leading-snug`,K.emphasis===`strong`?`text-warning`:`text-muted-foreground`),children:K.detail})]}),xe?(0,$.jsxs)(k,{type:`button`,size:`xs`,variant:`outline`,className:`w-full`,disabled:ne,onClick:xe,children:[ne?(0,$.jsx)(we,{}):(0,$.jsx)(sn,{}),ne?`Updating`:K.targetVersion?`Install ${xn(K.targetVersion)}`:`Update now`]}):null,ve||ye?(0,$.jsx)(`p`,{"aria-live":`polite`,className:A(`text-xs leading-snug [overflow-wrap:anywhere]`,ye?`text-warning`:`text-muted-foreground`),children:ve??ye}):null,xe&&ge?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-3xs font-medium uppercase tracking-wider text-muted-foreground`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`h-px flex-1 bg-border`}),`or, update manually using`,(0,$.jsx)(`span`,{"aria-hidden":!0,className:`h-px flex-1 bg-border`})]}):null,ge?(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 rounded-md border border-border/70 bg-muted/40 py-0.5 pr-0.5 pl-2`,children:[(0,$.jsx)(`code`,{className:`min-w-0 flex-1 truncate font-mono text-2xs text-foreground`,children:ge}),(0,$.jsxs)(me,{children:[(0,$.jsx)(de,{render:(0,$.jsx)(k,{type:`button`,size:`icon-xs`,variant:`ghost-muted`,className:`shrink-0`,onClick:()=>ke(ge,{providerName:J}),"aria-label":`Copy update command`,children:(0,$.jsx)(R,{className:`size-3`})})}),(0,$.jsx)(pe,{side:`top`,children:`Copy command`})]})]}):null]})})]}):null;if(c===`list`){let e=te?`bg-muted/45`:`hover:bg-muted/25`,n;t[68]===e?n=t[69]:(n=A(`group flex min-h-18 items-center gap-3 px-3 py-3 transition-colors sm:px-4`,e),t[68]=e,t[69]=n);let r=!ie&&!te&&`opacity-60 group-hover:opacity-100`,o;t[70]===r?o=t[71]:(o=A(`pointer-events-none relative flex min-w-0 flex-1 items-start gap-3 rounded-md text-left transition-opacity`,r),t[70]=r,t[71]=o);let s=`Select ${J}`,c;t[72]!==u||t[73]!==te||t[74]!==s?(c=(0,$.jsx)(`button`,{type:`button`,className:`pointer-events-auto absolute inset-0 cursor-pointer rounded-md outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,onClick:u,"aria-label":s,"aria-pressed":te}),t[72]=u,t[73]=te,t[74]=s,t[75]=c):c=t[75];let l;t[76]===J?l=t[77]:(l=(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:J}),t[76]=J,t[77]=l);let d;t[78]===he?d=t[79]:(d=he?(0,$.jsx)(`code`,{className:`max-w-24 shrink-0 truncate text-xs text-muted-foreground`,children:he}):null,t[78]=he,t[79]=d);let f;t[80]!==l||t[81]!==d||t[82]!==vt?(f=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[l,d,vt]}),t[80]=l,t[81]=d,t[82]=vt,t[83]=f):f=t[83];let p;t[84]!==pt||t[85]!==ve?(p=pt&&!ve?(0,$.jsx)(`span`,{className:`flex h-[1.45em] shrink-0 items-center`,children:pt}):null,t[84]=pt,t[85]=ve,t[86]=p):p=t[86];let m=ht?0:void 0,h;t[87]!==gt||t[88]!==mt||t[89]!==se||t[90]!==ve?(h=ve?`Updating · ${ve}`:(0,$.jsxs)($.Fragment,{children:[se.headline,mt&>?` · ${gt}`:null]}),t[87]=gt,t[88]=mt,t[89]=se,t[90]=ve,t[91]=h):h=t[91];let g;t[92]!==m||t[93]!==h?(g=(0,$.jsx)(`span`,{tabIndex:m,"aria-live":`polite`,className:`pointer-events-auto line-clamp-2 [overflow-wrap:anywhere]`,children:h}),t[92]=m,t[93]=h,t[94]=g):g=t[94];let _;t[95]!==ht||t[96]!==g?(_=(0,$.jsx)(Fr,{detail:ht,children:g}),t[95]=ht,t[96]=g,t[97]=_):_=t[97];let v;t[98]!==p||t[99]!==_?(v=(0,$.jsxs)(`span`,{className:`mt-0.5 flex items-start gap-1.5 text-xs leading-normal text-muted-foreground/80`,children:[p,_]}),t[98]=p,t[99]=_,t[100]=v):v=t[100];let y;t[101]!==f||t[102]!==v?(y=(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[f,v]}),t[101]=f,t[102]=v,t[103]=y):y=t[103];let b;t[104]!==o||t[105]!==c||t[106]!==y||t[107]!==it?(b=(0,$.jsxs)(`div`,{className:o,children:[c,it,y]}),t[104]=o,t[105]=c,t[106]=y,t[107]=it,t[108]=b):b=t[108];let x;t[109]!==B||t[110]!==J||t[111]!==i||t[112]!==F||t[113]!==I?(x=F?.value===void 0?null:(0,$.jsxs)(`span`,{className:`flex items-center`,children:[(0,$.jsx)(Xr,{projectEnabled:F.value,deviceEnabled:a(i)}),(0,$.jsx)(At,{label:`${J} enablement`,tooltip:`Reset to the device setting`,disabled:I||!B,onClick:F.onReset})]}),t[109]=B,t[110]=J,t[111]=i,t[112]=F,t[113]=I,t[114]=x):x=t[114];let S=I||F!==void 0&&!B,C;t[115]===Y?C=t[116]:(C=e=>Y(!!e),t[115]=Y,t[116]=C);let w=`Enable ${J}`,T;t[117]!==ie||t[118]!==S||t[119]!==C||t[120]!==w?(T=(0,$.jsx)(Ut,{checked:ie,disabled:S,onCheckedChange:C,"aria-label":w}),t[117]=ie,t[118]=S,t[119]=C,t[120]=w,t[121]=T):T=t[121];let E;t[122]!==x||t[123]!==T?(E=(0,$.jsxs)(`span`,{className:`flex h-5 shrink-0 items-center gap-1`,children:[x,T]}),t[122]=x,t[123]=T,t[124]=E):E=t[124];let D;return t[125]!==n||t[126]!==b||t[127]!==E?(D=(0,$.jsxs)(`div`,{"data-slot":`settings-row`,className:n,children:[b,E]}),t[125]=n,t[126]=b,t[127]=E,t[128]=D):D=t[128],D}let yt;t[129]===o?yt=t[130]:(yt=o?.badgeLabel?(0,$.jsx)(h,{variant:`warning`,size:`sm`,className:`shrink-0`,children:o.badgeLabel}):null,t[129]=o,t[130]=yt);let bt=I||void 0,xt=I&&`opacity-50`,St;t[131]===xt?St=t[132]:(St=A(`inline-flex items-center gap-1`,xt),t[131]=xt,t[132]=St);let Ct;t[133]!==n||t[134]!==m||t[135]!==I?(Ct=m?(0,$.jsx)(k,{type:`button`,size:`icon-xs`,variant:`ghost-destructive`,disabled:I,onClick:m,"aria-label":`Delete instance ${n}`,children:(0,$.jsx)(oe,{})}):null,t[133]=n,t[134]=m,t[135]=I,t[136]=Ct):Ct=t[136];let Tt;t[137]!==I||t[138]!==bt||t[139]!==St||t[140]!==Ct||t[141]!==ot?(Tt=(0,$.jsxs)(`span`,{inert:I,"aria-disabled":bt,className:St,children:[ot,Ct]}),t[137]=I,t[138]=bt,t[139]=St,t[140]=Ct,t[141]=ot,t[142]=Tt):Tt=t[142];let Et;t[143]!==yt||t[144]!==Tt||t[145]!==vt||t[146]!==ct?(Et=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[yt,ct,vt,Tt]}),t[143]=yt,t[144]=Tt,t[145]=vt,t[146]=ct,t[147]=Et):Et=t[147];let Ot=Et,kt;t[148]!==o||t[149]!==i.config||t[150]!==i.driver||t[151]!==n||t[152]!==Be?(kt=o?(0,$.jsx)(An,{definition:o,value:i.config,idPrefix:`provider-instance-${n}`,variant:`settings`,onChange:Be}):(0,$.jsx)(Dt,{title:`Driver`,description:(0,$.jsxs)(`span`,{children:[`This instance uses `,(0,$.jsx)(`code`,{className:`text-foreground`,children:String(i.driver)}),`, which is not available in this build. Its configuration is preserved.`]})}),t[148]=o,t[149]=i.config,t[150]=i.driver,t[151]=n,t[152]=Be,t[153]=kt):kt=t[153];let Mt=kt,Nt=ht?0:void 0,Pt;t[154]!==_t||t[155]!==Nt?(Pt=(0,$.jsx)(`div`,{tabIndex:Nt,className:`flex min-w-0 flex-wrap items-baseline gap-x-1.5`,children:_t}),t[154]=_t,t[155]=Nt,t[156]=Pt):Pt=t[156];let Ft;t[157]!==ht||t[158]!==Pt?(Ft=(0,$.jsx)(Fr,{detail:ht,children:Pt}),t[157]=ht,t[158]=Pt,t[159]=Ft):Ft=t[159];let It;t[160]!==j||t[161]!==I||t[162]!==Se?(It=Se&&j?(0,$.jsxs)(`div`,{className:`grid max-w-xl gap-1.5 pt-1 text-xs`,children:[(0,$.jsx)(`p`,{children:Se.message}),(0,$.jsx)(`code`,{className:`break-all text-2xs`,children:Se.url}),(0,$.jsxs)(k,{render:(0,$.jsx)(`a`,{href:Se.url,target:`_blank`,rel:`noopener noreferrer`,onClick:()=>j(Se)}),size:`xs`,variant:`outline`,className:`w-fit`,disabled:I,children:[(0,$.jsx)(z,{}),`Continue authentication`]})]}):null,t[160]=j,t[161]=I,t[162]=Se,t[163]=It):It=t[163];let Lt;t[164]!==Ft||t[165]!==It?(Lt=(0,$.jsxs)($.Fragment,{children:[Ft,It]}),t[164]=Ft,t[165]=It,t[166]=Lt):Lt=t[166];let Rt=I||void 0,zt=I&&`opacity-50 select-none`,Bt;t[167]===zt?Bt=t[168]:(Bt=A(`flex w-full min-w-0 items-center justify-end gap-2 @min-[32rem]/settings-row:w-auto`,zt),t[167]=zt,t[168]=Bt);let Vt;t[169]!==De||t[170]!==J||t[171]!==Re?(Vt=(0,$.jsx)(Fn,{layout:`inline`,displayName:J,value:De,onCommit:Re,commitDelayMs:120}),t[169]=De,t[170]=J,t[171]=Re,t[172]=Vt):Vt=t[172];let Ht=`provider-instance-${n}-display-name`,Wt=i.displayName??``,Gt=o?.label??`Instance label`,Kt;t[173]!==Ht||t[174]!==Wt||t[175]!==Gt||t[176]!==Fe?(Kt=(0,$.jsx)(fn,{id:Ht,size:`sm`,className:`min-w-0 flex-1 @min-[32rem]/settings-row:w-56`,value:Wt,onCommit:Fe,placeholder:Gt,spellCheck:!1}),t[173]=Ht,t[174]=Wt,t[175]=Gt,t[176]=Fe,t[177]=Kt):Kt=t[177];let qt;t[178]!==I||t[179]!==Rt||t[180]!==Bt||t[181]!==Vt||t[182]!==Kt?(qt=(0,$.jsxs)(`div`,{inert:I,"aria-disabled":Rt,className:Bt,children:[Vt,Kt]}),t[178]=I,t[179]=Rt,t[180]=Bt,t[181]=Vt,t[182]=Kt,t[183]=qt):qt=t[183];let Jt;t[184]!==Lt||t[185]!==qt?(Jt=(0,$.jsx)(Dt,{title:`Display name`,status:Lt,control:qt}),t[184]=Lt,t[185]=qt,t[186]=Jt):Jt=t[186];let Yt;t[187]!==J||t[188]!==Ot||t[189]!==Jt||t[190]!==it?(Yt=(0,$.jsx)(jt,{title:J,icon:it,headerAction:Ot,children:Jt}),t[187]=J,t[188]=Ot,t[189]=Jt,t[190]=it,t[191]=Yt):Yt=t[191];let Xt;t[192]!==We||t[193]!==i.environment||t[194]!==n||t[195]!==I||t[196]!==Qe||t[197]!==v||t[198]!==Xe?(Xt=v||We.length>0?(0,$.jsxs)(jt,{title:`Setup`,children:[v,(0,$.jsx)(`div`,{inert:I,"aria-disabled":I||void 0,className:I?`opacity-50 select-none`:void 0,children:We.length>0?(0,$.jsx)($.Fragment,{children:We.map(e=>(0,$.jsx)(Jr,{field:e,variable:Gr(i.environment,e.name),idPrefix:`provider-instance-${n}`,onCommit:Xe,onRemove:Qe},e.name))}):null})]}):null,t[192]=We,t[193]=i.environment,t[194]=n,t[195]=I,t[196]=Qe,t[197]=v,t[198]=Xe,t[199]=Xt):Xt=t[199];let Zt;t[200]!==o||t[201]!==i.config||t[202]!==i.driver||t[203]!==n||t[204]!==I||t[205]!==y||t[206]!==Mt?(Zt=i.driver===`codex`&&On(i.config)===`managed`?(0,$.jsx)(`div`,{inert:I,"aria-disabled":I||void 0,className:I?`opacity-50 select-none`:void 0,children:(0,$.jsx)(_n,{id:`provider-instance-${n}-runtime`,title:`Runtime`,headerPlacement:`outside`,children:y??Mt},n)}):!o||kn(o).length>0?(0,$.jsx)(jt,{title:`Runtime`,inert:I,"aria-disabled":I||void 0,className:I?`opacity-50 select-none`:void 0,children:Mt}):null,t[200]=o,t[201]=i.config,t[202]=i.driver,t[203]=n,t[204]=I,t[205]=y,t[206]=Mt,t[207]=Zt):Zt=t[207];let Qt=I||void 0,$t=I?`opacity-50 select-none`:void 0,en;t[208]!==Ke||t[209]!==Je?(en=(0,$.jsx)(Yr,{environment:Ke,onChange:Je}),t[208]=Ke,t[209]=Je,t[210]=en):en=t[210];let tn;t[211]!==I||t[212]!==Qt||t[213]!==$t||t[214]!==en?(tn=(0,$.jsx)(jt,{title:`Environment`,inert:I,"aria-disabled":Qt,className:$t,children:en}),t[211]=I,t[212]=Qt,t[213]=$t,t[214]=en,t[215]=tn):tn=t[215];let nn;t[216]!==re||t[217]!==N||t[218]!==n||t[219]!==s||t[220]!==I?(nn=N!==void 0&&s?.driver===`acpRegistry`?(0,$.jsx)(Nr,{environmentId:N,instanceId:n,provider:s,projects:re,readOnly:I}):null,t[216]=re,t[217]=N,t[218]=n,t[219]=s,t[220]=I,t[221]=nn):nn=t[221];let rn;t[222]!==B||t[223]!==je||t[224]!==Ae||t[225]!==o||t[226]!==x||t[227]!==b||t[228]!==n||t[229]!==S||t[230]!==Ne||t[231]!==w||t[232]!==C||t[233]!==E||t[234]!==T||t[235]!==I||t[236]!==X?(rn=o===void 0?null:(0,$.jsx)(jt,{title:`Models`,children:(0,$.jsxs)(`div`,{className:`px-3 py-3 sm:px-4`,children:[(0,$.jsx)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:`Model preferences and custom models are saved on the selected environment and shared across connected devices.`}),(0,$.jsx)(Er,{canManageCustomModels:!I,canWritePreferences:B,instanceId:n,driverKind:Ae,models:Ne,customModels:je,hiddenModels:b,favoriteModels:x,modelOrder:S,onChange:X,onHiddenModelsChange:C,onFavoriteModelsChange:w,onToggleFavorite:T,onModelOrderChange:E})]})}),t[222]=B,t[223]=je,t[224]=Ae,t[225]=o,t[226]=x,t[227]=b,t[228]=n,t[229]=S,t[230]=Ne,t[231]=w,t[232]=C,t[233]=E,t[234]=T,t[235]=I,t[236]=X,t[237]=rn):rn=t[237];let an;return t[238]!==Yt||t[239]!==Xt||t[240]!==Zt||t[241]!==tn||t[242]!==nn||t[243]!==rn?(an=(0,$.jsxs)($.Fragment,{children:[Yt,Xt,Zt,tn,nn,rn]}),t[238]=Yt,t[239]=Xt,t[240]=Zt,t[241]=tn,t[242]=nn,t[243]=rn,t[244]=an):an=t[244],an}function ei(e){return e.name}function ti(e){return e.name.trim().length>0}function ni(e,t){let{providerName:n}=t;J.add(He({type:`error`,title:`Could not copy ${n} update command`,description:e.message}))}function ri(e){let{providerName:t}=e;J.add({type:`success`,title:`${t} update command copied`,description:`Run it in a terminal when you are ready to update.`})}function ii(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`_`).replace(/^_+|_+$/g,``).slice(0,48)}function ai(e,t){let n=ii(t);return n?`${e}_${n}`:``}var oi=/^[a-zA-Z][a-zA-Z0-9_-]*$/,si=j.make(`codex`),ci=j.make(`acpRegistry`),li=Ct.definitions[0],ui={};function di(e,t){return e.length===0?`Instance ID is required.`:e.length>64?`Instance ID must be 64 characters or fewer.`:oi.test(e)?t.has(e)?`An instance named '${e}' already exists.`:null:`Instance ID must start with a letter and use only letters, digits, '-', or '_'.`}function fi(e){let t=(0,jn.c)(130),{open:n,environmentId:r,environmentLabel:i,onOpenChange:a,onCreated:o}=e,s=Me(r),c=Ne(r),l=ze(r,d),[u,f]=(0,Q.useState)(0),[p,m]=(0,Q.useState)(!1),[h,_]=(0,Q.useState)(si),v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(v={},t[0]=v):v=t[0];let[y,b]=(0,Q.useState)(v),[x,S]=(0,Q.useState)(null),C;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(C=[],t[1]=C):C=t[1];let[w,T]=(0,Q.useState)(C),[E,D]=(0,Q.useState)(!1),[O,M]=(0,Q.useState)(!1),[N,F]=(0,Q.useState)(!1),te;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(te={},t[2]=te):te=t[2];let[I,L]=(0,Q.useState)(te),[R,z]=(0,Q.useState)(!1),[B,ne]=(0,Q.useState)(!1),[re,ie]=(0,Q.useState)(null),ae;t[3]===s.providerInstances?ae=t[4]:(ae=new Set([`codex`,`claudeAgent`,...Object.keys(s.providerInstances??{})]),t[3]=s.providerInstances,t[4]=ae);let oe=ae,V;t[5]===h?V=t[6]:(V=Ct.get(h)??li,t[5]=h,t[6]=V);let H=V,U=h===ci,ce;t[7]===H.label?ce=t[8]:(ce={label:H.label,accentColor:``,instanceIdOverride:null},t[7]=H.label,t[8]=ce);let le=ce,{label:W,accentColor:G,instanceIdOverride:ue}=y[h]??le,de;t[9]!==h||t[10]!==H.label||t[11]!==oe||t[12]!==ue||t[13]!==U||t[14]!==W?(de=ue??Wn(e=>!e.trim()||e===H.label?U?`${h}_custom`:h:ai(h,e),W,oe),t[9]=h,t[10]=H.label,t[11]=oe,t[12]=ue,t[13]=U,t[14]=W,t[15]=de):de=t[15];let fe=de,pe;t[16]===H?pe=t[17]:(pe=kn(H),t[16]=H,t[17]=pe);let me=pe,he;t[18]!==oe||t[19]!==fe?(he=di(fe,oe),t[18]=oe,t[19]=fe,t[20]=he):he=t[20];let K=he,ge=R&&K!==null,_e;t[21]!==H.label||t[22]!==W?(_e=W.trim()||`${H.label} Workspace`,t[21]=H.label,t[22]=W,t[23]=_e):_e=t[23];let ve=_e,ye=I[h]??ui,q=U&&E&&ye.source===`local`,be=typeof ye.commandPath==`string`?ye.commandPath.trim():``,xe;t[24]===ye.agentId?xe=t[25]:(xe=typeof ye.agentId==`string`?ye.agentId.trim():``,t[24]=ye.agentId,t[25]=xe);let Se=xe,Ce=q?be.length>0?null:`Executable is required.`:x!==null||E&&Se.length>0?null:`Select an ACP or configure one manually.`,we;t[26]!==H.label||t[27]!==U||t[28]!==q||t[29]!==Se||t[30]!==ve||t[31]!==x?.name?(we=U?[q?`Local ACP command`:x?.name??(Se||null),ve,null]:[H.label,ve,null],t[26]=H.label,t[27]=U,t[28]=q,t[29]=Se,t[30]=ve,t[31]=x?.name,t[32]=we):we=t[32];let Te=we,Ee;t[33]===h?Ee=t[34]:(Ee=e=>{L(t=>{let n={...t};return e===void 0||Object.keys(e).length===0?delete n[h]:n[h]=e,n})},t[33]=h,t[34]=Ee);let De=Ee,Oe;t[35]!==le||t[36]!==h?(Oe=e=>{b(t=>({...t,[h]:{...t[h]??le,...e}}))},t[35]=le,t[36]=h,t[37]=Oe):Oe=t[37];let ke=Oe,Ae,je,Pe,Fe,Ie,Y;if(t[38]!==G||t[39]!==Ce||t[40]!==I||t[41]!==re||t[42]!==h||t[43]!==H.label||t[44]!==r||t[45]!==oe||t[46]!==fe||t[47]!==K||t[48]!==U||t[49]!==q||t[50]!==N||t[51]!==B||t[52]!==W||t[53]!==w||t[54]!==o||t[55]!==a||t[56]!==c||t[57]!==u){Ae=e=>{if(!(B||N||re)){if(e.kind===`blocked`&&z(!0),U&&!q&&e.kind===`navigate`&&e.step===2){Ie();return}f(e.step)}},Y=e=>{Ae(U?q?Kn(u,e,Bn.length,{instanceIdError:K,prerequisite:{step:0,error:Ce}}):qn(u,e,{instanceIdError:K,selectionError:Ce}):Kn(u,e,Rn.length,{instanceIdError:K}))};let e;t[64]===oe?e=t[65]:(e=e=>{_(ci);let t=e.name,n=ee(e.icon),r=Wn(bi,t,oe);S(e),D(!1),b(e=>Un(e,ci,{label:t,instanceIdOverride:r})),L(t=>({...t,[ci]:{agentId:e.id,distribution:`auto`,...n?{registryIconUrl:n}:{}}})),z(!1),f(1)},t[64]=oe,t[65]=e),je=e;let n;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(n=()=>{_(ci),S(null),D(!0),L(yi),b(vi),z(!1)},t[66]=n):n=t[66],Fe=n;let i;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{_(ci),S(null),D(!0),L(_i),b(gi),T([]),z(!1)},t[67]=i):i=t[67],Pe=i,Ie=async()=>{if(!Be(r,`providers:manage`)||B||re||(z(!0),K!==null||U&&Ce!==null))return;let e=h===`codex`?{...I[h],setupMode:`existing`}:I[h]??{},t=Object.keys(e).length>0,n=g(G),i={driver:h,enabled:!0,...W.trim().length>0?{displayName:W.trim()}:{},...n?{accentColor:n}:{},...t?{config:e}:{},...q&&w.length>0?{environment:w}:{}},s=P.make(fe);ne(!0);let l=await c({operation:`create`,instanceId:s,instance:i});if(l._tag===`Failure`){let e=se(l);ne(!1),J.add({type:`error`,title:`Could not add provider instance`,description:e instanceof Error?e.message:`The settings update failed.`});return}if(o?.(s),U&&!q){ie(s),ne(!1),f(2);return}J.add({type:`success`,title:`Provider instance added`,description:`${H.label} instance '${fe}' was added.`}),a(!1)},t[38]=G,t[39]=Ce,t[40]=I,t[41]=re,t[42]=h,t[43]=H.label,t[44]=r,t[45]=oe,t[46]=fe,t[47]=K,t[48]=U,t[49]=q,t[50]=N,t[51]=B,t[52]=W,t[53]=w,t[54]=o,t[55]=a,t[56]=c,t[57]=u,t[58]=Ae,t[59]=je,t[60]=Pe,t[61]=Fe,t[62]=Ie,t[63]=Y}else Ae=t[58],je=t[59],Pe=t[60],Fe=t[61],Ie=t[62],Y=t[63];if(p){let e;t[68]===a?e=t[69]:(e=()=>a(!1),t[68]=a,t[69]=e);let n;return t[70]!==r||t[71]!==e?(n=(0,$.jsx)(Cn,{environmentId:r,onClose:e}),t[70]=r,t[71]=e,t[72]=n):n=t[72],n}let Le;t[73]===i?Le=t[74]:(Le=(0,$.jsxs)($.Fragment,{children:[`Add an account or configure a provider on `,i,`.`]}),t[73]=i,t[74]=Le);let Re;t[75]!==Ce||t[76]!==Ae||t[77]!==re||t[78]!==K||t[79]!==U||t[80]!==q||t[81]!==N||t[82]!==B||t[83]!==u||t[84]!==Te?(Re=U?(0,$.jsx)(Jn,{currentStep:u,summaries:Te,instanceIdError:K,steps:q?Bn:zn,disabled:B||N||re!==null,identityStep:1,prerequisite:{step:0,error:Ce},onNavigation:Ae}):(0,$.jsx)(Jn,{currentStep:u,summaries:Te,instanceIdError:K,disabled:B||N,onNavigation:Ae}),t[75]=Ce,t[76]=Ae,t[77]=re,t[78]=K,t[79]=U,t[80]=q,t[81]=N,t[82]=B,t[83]=u,t[84]=Te,t[85]=Re):Re=t[85];let Ve;t[86]!==Le||t[87]!==Re?(Ve=(0,$.jsx)(Lt,{title:`Add provider`,description:Le,children:Re}),t[86]=Le,t[87]=Re,t[88]=Ve):Ve=t[88];let X;t[89]!==G||t[90]!==Ce||t[91]!==l||t[92]!==ye||t[93]!==re||t[94]!==h||t[95]!==H||t[96]!==me||t[97]!==r||t[98]!==i||t[99]!==je||t[100]!==Pe||t[101]!==Fe||t[102]!==Ie||t[103]!==R||t[104]!==fe||t[105]!==K||t[106]!==U||t[107]!==q||t[108]!==E||t[109]!==N||t[110]!==O||t[111]!==B||t[112]!==W||t[113]!==w||t[114]!==Y||t[115]!==a||t[116]!==x||t[117]!==De||t[118]!==ke||t[119]!==s.providerInstances||t[120]!==ge||t[121]!==u?(X=re?(0,$.jsx)(er,{environmentId:r,environmentLabel:i,instanceId:re,onFinish:()=>a(!1)}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(rn,{className:A(U&&u===1&&`min-h-72`),holdHeight:u===0&&!E&&O,children:[(0,$.jsxs)(`div`,{className:A(`grid gap-2`,u!==0&&`hidden`),children:[(0,$.jsx)(`div`,{id:`add-instance-driver-label`,className:`text-sm font-medium text-foreground`,children:`Provider`}),(0,$.jsx)(We,{disabled:N,value:h,onValueChange:e=>{_(j.make(e)),D(!1),z(!1)},"aria-labelledby":`add-instance-driver-label`,className:`grid grid-cols-1 sm:grid-cols-2`,children:Ct.definitions.filter(hi).map(mi)})]}),u===0?(0,$.jsxs)(`div`,{className:`space-y-4 pt-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-muted-foreground`,children:[(0,$.jsx)(`div`,{"aria-hidden":!0,className:`flex-1 border-t border-border/70`}),(0,$.jsx)(`span`,{children:`Or choose from ACP Registry`}),(0,$.jsx)(`div`,{"aria-hidden":!0,className:`flex-1 border-t border-border/70`})]}),U&&E?(0,$.jsxs)(`div`,{className:`grid gap-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:q?`Local ACP command`:`Enter manually`}),(0,$.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:q?`Run an installed ACP executable on ${i}.`:`Enter an official registry ID and any local executable or auth override.`})]}),(0,$.jsx)(k,{onClick:()=>{D(!1),z(!1)},size:`xs`,variant:`ghost`,children:`Search registry`})]}),(0,$.jsxs)(Et,{variant:`plain`,children:[(0,$.jsx)(An,{definition:H,value:ye,idPrefix:`add-provider-acpRegistry-manual`,variant:`settings`,onChange:De}),q?(0,$.jsx)(Yr,{environment:w,onChange:T}):null]}),U&&R&&Ce?(0,$.jsx)(`p`,{className:`text-2xs text-destructive`,children:Ce}):null]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Zn,{environmentId:r,providerInstances:s.providerInstances,onPrepared:je,onManualConfiguration:Fe,onLocalConfiguration:Pe,onLoadingChange:M,onPreparingChange:F}),U&&R&&Ce?(0,$.jsx)(`p`,{className:`mt-2 text-2xs text-destructive`,children:Ce}):null]})]}):null,U&&u===1&&x?(0,$.jsxs)(`div`,{className:`mb-4 flex items-start justify-between gap-3 border-b border-border/70 pb-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`truncate text-sm font-medium text-foreground`,children:x.name}),(0,$.jsxs)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:[`v`,x.version,` · `,x.distribution]})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 gap-2 text-2xs`,children:[x.website?(0,$.jsx)(`a`,{"aria-label":`Open documentation for ${x.name} (${x.id})`,className:`text-muted-foreground hover:text-foreground`,href:x.website,rel:`noreferrer`,target:`_blank`,children:`Docs`}):null,x.repository?(0,$.jsx)(`a`,{"aria-label":`Open source for ${x.name} (${x.id})`,className:`text-muted-foreground hover:text-foreground`,href:x.repository,rel:`noreferrer`,target:`_blank`,children:`Source`}):null]})]}):null,(0,$.jsxs)(Et,{variant:`plain`,className:A(u!==1&&`hidden`),children:[(0,$.jsx)(Dt,{title:(0,$.jsx)(`label`,{htmlFor:`add-provider-label`,children:`Label`}),description:(0,$.jsx)(`span`,{id:`add-provider-label-description`,children:`Shown in the provider list.`}),control:(0,$.jsx)(Je,{id:`add-provider-label`,"aria-describedby":`add-provider-label-description`,size:`sm`,className:`w-full @min-[32rem]/settings-row:w-56`,placeholder:`e.g. Work`,value:W,onChange:e=>ke({label:e.target.value})})}),(0,$.jsx)(Dt,{title:(0,$.jsx)(`label`,{htmlFor:`add-provider-instance-id`,children:`Instance ID`}),description:(0,$.jsx)(`span`,{id:`add-provider-instance-id-description`,children:`Letters, digits, '-', or '_'.`}),status:ge?(0,$.jsx)(`span`,{id:`add-provider-instance-id-error`,role:`alert`,className:`text-destructive`,children:K}):void 0,control:(0,$.jsx)(Je,{id:`add-provider-instance-id`,"aria-describedby":ge?`add-provider-instance-id-description add-provider-instance-id-error`:`add-provider-instance-id-description`,size:`sm`,className:`w-full @min-[32rem]/settings-row:w-56`,placeholder:`${h}_work`,value:fe,onChange:e=>{ke({instanceIdOverride:e.target.value})},"aria-invalid":ge})}),(0,$.jsx)(Dt,{title:`Accent color`,description:`Optional marker shown in the picker.`,control:(0,$.jsx)(Fn,{displayName:W||H.label,value:G||void 0,onCommit:e=>ke({accentColor:e}),layout:`inline`})})]}),!U&&me.length>0?(0,$.jsx)(Et,{variant:`plain`,className:A(u!==2&&`hidden`),children:(0,$.jsx)(An,{definition:H,value:ye,idPrefix:`add-provider-${h}`,variant:`settings`,onChange:De})}):!U&&u===2?(0,$.jsx)(`div`,{className:`grid gap-2`,children:(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This driver has no required configuration. You can add the instance now.`})}):null]}),(0,$.jsxs)(on,{children:[(0,$.jsx)(k,{variant:u===0?`ghost-muted`:`outline`,size:`sm`,disabled:B||N,onClick:()=>{if(u===0){a(!1);return}f(pi)},children:u===0?`Cancel`:`Back`}),u===0&&h===`codex`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(k,{variant:`outline`,size:`sm`,onClick:()=>Y(1),children:`Configure manually`}),(0,$.jsx)(Tn,{size:`sm`,onClick:()=>m(!0)})]}):u<(U?1:2)?(0,$.jsx)(k,{size:`sm`,disabled:N,onClick:()=>Y(u+1),children:`Next`}):(0,$.jsx)(k,{size:`sm`,disabled:B||!l,onClick:()=>void Ie(),children:B?`Adding...`:U&&!q?`Continue to sign-in`:`Add instance`})]})]}),t[89]=G,t[90]=Ce,t[91]=l,t[92]=ye,t[93]=re,t[94]=h,t[95]=H,t[96]=me,t[97]=r,t[98]=i,t[99]=je,t[100]=Pe,t[101]=Fe,t[102]=Ie,t[103]=R,t[104]=fe,t[105]=K,t[106]=U,t[107]=q,t[108]=E,t[109]=N,t[110]=O,t[111]=B,t[112]=W,t[113]=w,t[114]=Y,t[115]=a,t[116]=x,t[117]=De,t[118]=ke,t[119]=s.providerInstances,t[120]=ge,t[121]=u,t[122]=X):X=t[122];let He;t[123]!==Ve||t[124]!==X?(He=(0,$.jsxs)(Gt,{size:`wide`,children:[Ve,X]}),t[123]=Ve,t[124]=X,t[125]=He):He=t[125];let Z;return t[126]!==a||t[127]!==n||t[128]!==He?(Z=(0,$.jsx)(nt,{open:n,onOpenChange:a,children:He}),t[126]=a,t[127]=n,t[128]=He,t[129]=Z):Z=t[129],Z}function pi(e){return Math.max(0,e-1)}function mi(e){return(0,$.jsxs)(Ue,{value:e.driverKind,className:`relative flex cursor-pointer items-center gap-3 rounded-lg bg-card px-3 py-3 text-left text-muted-foreground outline-none ring-1 ring-black/5 hover:bg-muted focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring data-checked:bg-primary/8 data-checked:text-foreground data-checked:ring-2 data-checked:ring-inset data-checked:ring-primary data-checked:hover:bg-primary/8 dark:bg-white/3 dark:ring-white/5 dark:hover:bg-white/5 dark:data-checked:bg-primary/15 dark:data-checked:ring-primary dark:data-checked:hover:bg-primary/15`,children:[(0,$.jsx)(wt,{driverKind:e.driverKind,displayName:e.label,iconClassName:`size-4`}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-foreground`,children:e.label}),(0,$.jsx)(Ge,{className:`grid size-5 shrink-0 place-items-center rounded-full bg-primary text-primary-foreground`,"aria-hidden":!0,children:(0,$.jsx)(I,{className:`size-3.5 shrink-0`})}),e.badgeLabel?(0,$.jsx)(h,{variant:`warning`,size:`sm`,children:e.badgeLabel}):null]},e.driverKind)}function hi(e){return e.driverKind!==ci}function gi(e){return Un(e,ci,{label:`Local ACP`,instanceIdOverride:null})}function _i(e){return{...e,[ci]:{source:`local`,commandArgs:[]}}}function vi(e){return Un(e,ci,{label:``,instanceIdOverride:null})}function yi(e){let t={...e};return delete t[ci],t}function bi(e){return ai(ci,e)}function xi(e){let t=e;try{t=new URL(e).host}catch{}let n=t.toLowerCase().replace(/[^a-z0-9.-]+/g,`-`).replace(/^-+|-+$/g,``);return S.make(`cliproxy-${n||`hub`}`)}function Si(e){let t=(0,jn.c)(53),{open:n,onOpenChange:r,environmentId:i,environmentLabel:a}=e,o=je(i),[s,c]=(0,Q.useState)(``),[l,u]=(0,Q.useState)(``),[d,f]=(0,Q.useState)(``),p;t[0]===l?p=t[1]:(p=l.trim(),t[0]=l,t[1]=p);let m=p,h;t[2]!==d||t[3]!==m.length?(h=m.length>0&&d.trim().length>0,t[2]=d,t[3]=m.length,t[4]=h):h=t[4];let g=h,_;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>{c(``),u(``),f(``)},t[5]=_):_=t[5];let v=_,y;t[6]!==g||t[7]!==s||t[8]!==d||t[9]!==r||t[10]!==m||t[11]!==o?(y=()=>{if(!g)return;let e=xi(m);o({usageLimitSources:{[e]:{kind:`cliproxy`,...s.trim()?{label:s.trim()}:{},url:m,managementKey:d.trim(),enabled:!0}}}),v(),r(!1)},t[6]=g,t[7]=s,t[8]=d,t[9]=r,t[10]=m,t[11]=o,t[12]=y):y=t[12];let b=y,x;t[13]===r?x=t[14]:(x=e=>{e||v(),r(e)},t[13]=r,t[14]=x);let S;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(Ze,{children:`Add a CLIProxyAPI hub`}),t[15]=S):S=t[15];let C;t[16]===a?C=t[17]:(C=(0,$.jsxs)(Xe,{children:[S,(0,$.jsxs)(et,{children:[`Show the quota of every account the hub pools, next to the providers on`,` `,a,`. The key stays on that server.`]})]}),t[16]=a,t[17]=C);let w;t[18]===b?w=t[19]:(w=e=>{e.preventDefault(),b()},t[18]=b,t[19]=w);let T;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsx)(Jt,{htmlFor:`usage-source-url`,children:`Hub URL`}),t[20]=T):T=t[20];let E;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>u(e.target.value),t[21]=E):E=t[21];let D;t[22]===l?D=t[23]:(D=(0,$.jsxs)(`div`,{className:`grid gap-1.5`,children:[T,(0,$.jsx)(Je,{id:`usage-source-url`,placeholder:`https://hub.example.ts.net:8318`,value:l,onChange:E,autoFocus:!0})]}),t[22]=l,t[23]=D);let O;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(Jt,{htmlFor:`usage-source-key`,children:`Management key`}),t[24]=O):O=t[24];let A;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(A=e=>f(e.target.value),t[25]=A):A=t[25];let ee;t[26]===d?ee=t[27]:(ee=(0,$.jsxs)(`div`,{className:`grid gap-1.5`,children:[O,(0,$.jsx)(yn,{id:`usage-source-key`,value:d,onChange:A})]}),t[26]=d,t[27]=ee);let j;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(Jt,{htmlFor:`usage-source-label`,children:`Label (optional)`}),t[28]=j):j=t[28];let M;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(M=e=>c(e.target.value),t[29]=M):M=t[29];let N;t[30]===s?N=t[31]:(N=(0,$.jsxs)(`div`,{className:`grid gap-1.5`,children:[j,(0,$.jsx)(Je,{id:`usage-source-label`,placeholder:`Defaults to the hub's host name`,value:s,onChange:M})]}),t[30]=s,t[31]=N);let P;t[32]!==D||t[33]!==ee||t[34]!==N||t[35]!==w?(P=(0,$.jsx)($e,{children:(0,$.jsxs)(`form`,{className:`grid gap-4`,onSubmit:w,children:[D,ee,N]})}),t[32]=D,t[33]=ee,t[34]=N,t[35]=w,t[36]=P):P=t[36];let F;t[37]===r?F=t[38]:(F=(0,$.jsx)(k,{variant:`outline`,onClick:()=>{v(),r(!1)},children:`Cancel`}),t[37]=r,t[38]=F);let te=!g,I;t[39]!==b||t[40]!==te?(I=(0,$.jsx)(k,{onClick:b,disabled:te,children:`Add hub`}),t[39]=b,t[40]=te,t[41]=I):I=t[41];let L;t[42]!==F||t[43]!==I?(L=(0,$.jsxs)(Qe,{variant:`bare`,children:[F,I]}),t[42]=F,t[43]=I,t[44]=L):L=t[44];let R;t[45]!==P||t[46]!==L||t[47]!==C?(R=(0,$.jsxs)(tt,{className:`max-w-md`,children:[C,P,L]}),t[45]=P,t[46]=L,t[47]=C,t[48]=R):R=t[48];let z;return t[49]!==n||t[50]!==R||t[51]!==x?(z=(0,$.jsx)(nt,{open:n,onOpenChange:x,children:R}),t[49]=n,t[50]=R,t[51]=x,t[52]=z):z=t[52],z}function Ci({environmentId:e,environmentLabel:t,sources:n,cursorKeychainUsageEnabled:r,readOnly:i}){let a=je(e),s=X(Y.updateSettings,{label:`update Cursor account usage`}),c=X(Y.refreshProviders,{reportFailure:!1}),l=o(Y.configValueAtom(e))?.environment.platform,[u,d]=(0,Q.useState)(!1),[f,p]=(0,Q.useState)(!1),m=Object.entries(n),h=async t=>{p(!0);try{(await s({environmentId:e,input:{patch:{cursorKeychainUsageEnabled:t}}}))._tag===`Success`&&await c({environmentId:e,input:{}})}finally{p(!1)}};return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(jt,{...nn(`usage-providers`),headerAction:i?null:(0,$.jsxs)(k,{size:`xs`,variant:`outline`,onClick:()=>d(!0),children:[(0,$.jsx)(re,{className:`size-3`,"aria-hidden":!0}),`Add hub`]}),children:[l?.os===`darwin`?(0,$.jsx)(Dt,{id:`cursor-keychain-usage`,title:`Cursor account usage`,description:`Read your existing Cursor CLI login from macOS Keychain to show account history and monthly limits. macOS may ask you to allow access.`,control:(0,$.jsx)(Ut,{"aria-label":`Cursor account usage`,checked:r,disabled:i||f,onCheckedChange:e=>void h(e)})}):null,m.length===0?(0,$.jsx)(Dt,{title:`No hubs configured.`}):m.map(([e,t])=>{let n=t.label?.trim()||t.url;return(0,$.jsx)(Dt,{title:n,description:(0,$.jsxs)(`span`,{className:`break-all`,children:[`CLI Proxy`,t.enabled?``:` · Disabled`,n===t.url?``:` · ${t.url}`]}),control:i?null:(0,$.jsx)(wi,{label:n,onConfirm:()=>a({usageLimitSources:{[e]:null}})})},e)})]}),u&&!i?(0,$.jsx)(Si,{open:!0,onOpenChange:d,environmentId:e,environmentLabel:t}):null]})}function wi(e){let t=(0,jn.c)(15),{label:n,onConfirm:r}=e,[i,a]=(0,Q.useState)(!1),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(k,{size:`xs`,variant:`ghost`,onClick:()=>a(!0),children:`Remove`}),t[0]=o):o=t[0];let s;t[1]===n?s=t[2]:(s=(0,$.jsxs)(Ht,{children:[`Remove `,n,`?`]}),t[1]=n,t[2]=s);let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(Kt,{children:`The hub's management key is deleted from this server. Its accounts leave the Limits view; the hub itself is untouched. Add it again with the URL and key to bring them back.`}),t[3]=c):c=t[3];let l;t[4]===s?l=t[5]:(l=(0,$.jsxs)(Xt,{children:[s,c]}),t[4]=s,t[5]=l);let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(an,{render:(0,$.jsx)(k,{variant:`outline`}),children:`Cancel`}),t[6]=u):u=t[6];let d;t[7]===r?d=t[8]:(d=(0,$.jsxs)(Yt,{children:[u,(0,$.jsx)(k,{variant:`destructive`,onClick:()=>{a(!1),r()},children:`Remove hub`})]}),t[7]=r,t[8]=d);let f;t[9]!==l||t[10]!==d?(f=(0,$.jsxs)(Bt,{children:[l,d]}),t[9]=l,t[10]=d,t[11]=f):f=t[11];let p;return t[12]!==i||t[13]!==f?(p=(0,$.jsxs)($.Fragment,{children:[o,(0,$.jsx)(Rt,{open:i,onOpenChange:a,children:f})]}),t[12]=i,t[13]=f,t[14]=p):p=t[14],p}function Ti(e){let t=typeof e==`object`&&e&&`authMethod`in e?e.authMethod:void 0;return _.find(e=>e.value===t)?.value??`oauth-personal`}function Ei(e){let t=(0,jn.c)(21),n;t[0]===e.environmentLabel?n=t[1]:(n=(0,$.jsx)(`span`,{className:`text-muted-foreground [overflow-wrap:anywhere]`,children:e.environmentLabel}),t[0]=e.environmentLabel,t[1]=n);let r;t[2]!==e.enabled||t[3]!==e.onEnable||t[4]!==e.readOnly?(r=!e.enabled&&!e.readOnly?(0,$.jsx)(k,{size:`sm`,variant:`outline`,onClick:e.onEnable,children:`Enable Antigravity`}):null,t[2]=e.enabled,t[3]=e.onEnable,t[4]=e.readOnly,t[5]=r):r=t[5];let i;t[6]!==n||t[7]!==r?(i=(0,$.jsx)(Dt,{className:`@max-lg/setup:[&>div:first-child]:flex @max-lg/setup:[&>div:first-child]:items-stretch @max-lg/setup:[&>div:first-child]:gap-3`,title:`Environment`,description:`Device that runs this provider.`,control:(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 sm:items-end`,children:[n,r]})}),t[6]=n,t[7]=r,t[8]=i):i=t[8];let a;t[9]!==e.authMethod||t[10]!==e.binaryPath||t[11]!==e.enabled||t[12]!==e.environmentId||t[13]!==e.environmentLabel||t[14]!==e.instanceId||t[15]!==e.provider||t[16]!==e.readOnly?(a=e.readOnly?(0,$.jsx)(Dt,{title:`Setup unavailable`,description:`Provider setup is read-only.`}):e.provider?.setup===void 0?(0,$.jsx)(Dt,{title:`Update required`,description:`Update this environment to manage Antigravity.`}):(0,$.jsx)(Di,{environmentId:e.environmentId,environmentLabel:e.environmentLabel,instanceId:e.instanceId,provider:e.provider,binaryPath:e.binaryPath,authMethod:e.authMethod??`oauth-personal`,enabled:e.enabled},`${e.environmentId}:${e.instanceId}`),t[9]=e.authMethod,t[10]=e.binaryPath,t[11]=e.enabled,t[12]=e.environmentId,t[13]=e.environmentLabel,t[14]=e.instanceId,t[15]=e.provider,t[16]=e.readOnly,t[17]=a):a=t[17];let o;return t[18]!==i||t[19]!==a?(o=(0,$.jsxs)(`section`,{"aria-label":`Antigravity setup`,className:`@container/setup divide-y divide-border/50 text-xs`,children:[i,a]}),t[18]=i,t[19]=a,t[20]=o):o=t[20],o}function Di({environmentId:e,environmentLabel:t,instanceId:n,provider:r,enabled:i,binaryPath:a}){let o={environmentId:e,input:{instanceId:n}},s=Ve(Y.providerAuthState(o)),c=Ve(Y.providerInstallState(o)),l=s.data,u=c.data,d={reportFailure:!1,reportDefect:!1},f=X(Y.startProviderInstall,d),p=X(Y.cancelProviderInstall,d),m=X(Y.removeProviderInstallation,d),[h,g]=(0,Q.useState)(null),_=(0,Q.useRef)(!1),[v,y]=(0,Q.useState)(null),b=l?.phase===`starting`||l?.phase===`waiting`||l?.phase===`verifying`,x=u?.phase===`downloading`||u?.phase===`extracting`||u?.phase===`verifying`,S=!!a?.trim(),C=r.installed||!S&&u?.installedVersion!=null,w=s.error??c.error,T=h!==null||w!==null,E=u?.phase===`downloading`?`Downloading ${(u.downloadedBytes/1e6).toFixed(1)} MB${u.totalBytes===null?``:` of ${(u.totalBytes/1e6).toFixed(1)} MB`}.`:u?.phase===`extracting`?`Extracting Antigravity.`:u?.phase===`verifying`?`Checking the downloaded runtime.`:C?`Installed.`:S?i?`The configured Antigravity runtime is unavailable.`:`The configured Antigravity runtime has not been checked.`:u?.totalBytes?`${Math.ceil(u.totalBytes/1e6)} MB download.`:`Not installed.`;async function D(e,t){if(_.current)return!1;_.current=!0,g(e),y(null);try{let e=await t();if(e._tag===`Failure`){if(!U(e)){let t=se(e);y(t instanceof Error?t.message:`Provider setup failed.`)}return!1}return!0}catch{return y(`Provider setup failed. Try again.`),!1}finally{_.current=!1,g(null)}}async function O(){await Pe().dialogs.confirm(`Remove the downloaded Antigravity runtime from ${t}? Google sign-in and thread history are kept.`)&&await D(`Removing runtime`,()=>m(o))}return(0,$.jsxs)(`div`,{className:`divide-y divide-border/50`,children:[(0,$.jsx)(Dt,{title:`Runtime`,className:`@max-lg/setup:[&>div:first-child]:flex @max-lg/setup:[&>div:first-child]:items-stretch @max-lg/setup:[&>div:first-child]:gap-3`,description:`Install and manage Antigravity.`,status:(0,$.jsxs)(`div`,{className:`space-y-2`,children:[S?(0,$.jsx)(`p`,{className:`text-muted-foreground`,children:`Uses the custom binary path below. Installation keeps that path.`}):null,!C&&!r.setup?.canInstall?(0,$.jsx)(`p`,{className:`text-muted-foreground`,children:`Automatic installation unavailable. Set a binary path or use another environment.`}):null]}),control:(0,$.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col gap-2 @min-[32rem]/settings-row:w-56 @min-[32rem]/settings-row:text-right`,children:[(0,$.jsx)(`p`,{role:`status`,className:`min-h-4 text-muted-foreground tabular-nums`,children:E}),(0,$.jsx)(`div`,{className:`h-1`,children:u?.phase===`downloading`&&u.totalBytes!==null&&u.totalBytes>0?(0,$.jsx)(`progress`,{"aria-label":`Antigravity download`,className:`block h-1 w-full accent-foreground`,value:u.downloadedBytes,max:u.totalBytes}):null}),!x&&u?.message&&u.message!==E?(0,$.jsx)(`p`,{className:`text-muted-foreground [overflow-wrap:anywhere]`,children:u.message}):null,(0,$.jsxs)(`div`,{className:`grid min-h-7 grid-cols-[1.75rem_minmax(0,1fr)] gap-2`,children:[(0,$.jsx)(`div`,{className:`col-start-2 row-start-1 grid`,children:x&&u.operationId?(0,$.jsx)(k,{size:`sm`,variant:`outline`,disabled:T,onClick:()=>{let t=u.operationId;t&&D(`Cancelling installation`,()=>p({environmentId:e,input:{instanceId:n,operationId:t}}))},children:`Cancel installation`}):!x&&r.setup?.canInstall?(0,$.jsx)(k,{size:`sm`,variant:`outline`,disabled:T||u===null||b,onClick:()=>void D(`Starting installation`,()=>f(o)),children:u?.installedVersion?u.version&&u.version!==u.installedVersion?`Update Antigravity`:`Reinstall Antigravity`:u?.phase===`failed`||u?.phase===`cancelled`?`Retry installation`:C?`Install managed runtime`:`Install Antigravity`}):null}),u?.canRemove&&!x?(0,$.jsx)(k,{size:`icon-sm`,variant:`ghost`,className:`col-start-1 row-start-1`,"aria-label":`Remove downloaded runtime`,disabled:T||b,onClick:()=>void O(),children:(0,$.jsx)(oe,{className:`size-3.5`})}):null]})]})}),(0,$.jsx)($n,{environmentId:e,environmentLabel:t,instanceId:n,provider:r,readOnly:!1}),(0,$.jsx)(`p`,{className:`sr-only`,role:`status`,children:h?`${h}.`:null}),v||w?(0,$.jsxs)(`div`,{className:`grid gap-2 px-3 py-3 sm:px-4`,children:[(0,$.jsx)(`p`,{role:`alert`,className:`text-destructive [overflow-wrap:anywhere]`,children:v??w}),w?(0,$.jsx)(k,{size:`sm`,variant:`outline`,className:`w-fit`,onClick:()=>{s.refresh(),c.refresh()},children:`Retry setup status`}):null]}):null]})}function Oi(e,t){let n=new Set(e),r=new Set(t.map(e=>e.trim()).filter(Boolean));return[...new Set([...n,...r])].filter(e=>n.has(e)!==r.has(e)).map(e=>({model:e,selected:r.has(e)}))}function ki(e,t){if(typeof e!=`object`||!e)return null;let n=e[t];return typeof n==`string`&&n.trim().length>0?n.trim():null}var Ai=Ct.definitions.map(e=>({provider:e.driverKind,hasDefaultInstance:e.hasDefaultInstance!==!1}));function ji(e){return typeof e!=`object`||!e||!(`binaryPath`in e)?``:typeof e.binaryPath==`string`?e.binaryPath.trim():``}function Mi(e){let t=(0,jn.c)(6),{lastCheckedAt:n}=e;Nt();let r;t[0]===n?r=t[1]:(r=Z(n),t[0]=n,t[1]=r);let i=r;if(i.status===`missing`)return null;if(i.status===`invalid`){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`span`,{children:`Checked unavailable`}),t[2]=e):e=t[2],e}let a;return t[3]!==i.suffix||t[4]!==i.value?(a=(0,$.jsx)(`span`,{children:i.suffix?(0,$.jsxs)($.Fragment,{children:[`Checked `,(0,$.jsx)(`span`,{className:`font-mono tabular-nums`,children:i.value}),` `,i.suffix]}):(0,$.jsxs)($.Fragment,{children:[`Checked `,i.value]})}),t[3]=i.suffix,t[4]=i.value,t[5]=a):a=t[5],a}function Ni(e){return e.entry.target._tag===`PrimaryConnectionTarget`?`Primary device`:e.relayManaged?`P4 Connect`:e.entry.target._tag===`SshConnectionTarget`?`SSH`:G(e.entry.target)?`Local device`:e.displayUrl??`Remote device`}var Pi=`@min-[48rem]/providers:h-[min(44rem,calc(100dvh-11rem))] @min-[48rem]/providers:min-h-[32rem]`;function Fi(e){let t=(0,jn.c)(22),{deviceTabs:n,icon:r,title:i,description:a,children:o}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=nn(`providers`),t[0]=s):s=t[0];let c;t[1]===n?c=t[2]:(c=n?(0,$.jsx)(`div`,{className:`flex min-h-11 min-w-0 items-center px-3 sm:px-4`,children:n}):null,t[1]=n,t[2]=c);let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=A(Pi,`scrollbar-gutter-both flex overflow-x-hidden overflow-y-auto`),t[3]=l):l=t[3];let u;t[4]===r?u=t[5]:(u=(0,$.jsx)(rt,{variant:`icon`,children:r}),t[4]=r,t[5]=u);let d;t[6]===i?d=t[7]:(d=(0,$.jsx)(ot,{children:i}),t[6]=i,t[7]=d);let f;t[8]===a?f=t[9]:(f=(0,$.jsx)(st,{children:a}),t[8]=a,t[9]=f);let p;t[10]!==d||t[11]!==f?(p=(0,$.jsxs)(it,{children:[d,f]}),t[10]=d,t[11]=f,t[12]=p):p=t[12];let m;t[13]===o?m=t[14]:(m=o?(0,$.jsx)(at,{className:`max-w-xl`,children:o}):null,t[13]=o,t[14]=m);let h;t[15]!==u||t[16]!==p||t[17]!==m?(h=(0,$.jsx)(Et,{divided:!1,className:l,children:(0,$.jsxs)(ct,{children:[u,p,m]})}),t[15]=u,t[16]=p,t[17]=m,t[18]=h):h=t[18];let g;return t[19]!==c||t[20]!==h?(g=(0,$.jsxs)(jt,{...s,variant:`plain`,children:[c,h]}),t[19]=c,t[20]=h,t[21]=g):g=t[21],g}function Ii(e){let t=(0,jn.c)(18),{environment:n,access:r,deviceTabs:i}=e,a=r.kind===`loading`,o=a?`Loading provider settings`:r.kind===`error`?`Could not connect to this device`:`Provider settings are unavailable`,s;t[0]!==r.reason||t[1]!==n.connection||t[2]!==n.label||t[3]!==a?(s=a?r.reason===`permissions`?`Checking what this session is allowed to change.`:`Waiting for ${n.label}'s configuration.`:ue(n.connection),t[0]=r.reason,t[1]=n.connection,t[2]=n.label,t[3]=a,t[4]=s):s=t[4];let c=s,l=a?null:n.connection.error,u;t[5]===n.serverConfig?u=t[6]:(u=O(n.serverConfig),t[5]=n.serverConfig,t[6]=u);let d;t[7]===u?d=t[8]:(d=(0,$.jsx)(bt,{kind:u}),t[7]=u,t[8]=d);let f;t[9]!==n.environmentId||t[10]!==l?(f=l?(0,$.jsx)(vn,{text:l,className:`w-full text-left font-mono text-xs leading-relaxed text-muted-foreground`},n.environmentId):null,t[9]=n.environmentId,t[10]=l,t[11]=f):f=t[11];let p;return t[12]!==c||t[13]!==i||t[14]!==d||t[15]!==f||t[16]!==o?(p=(0,$.jsx)(Fi,{deviceTabs:i,icon:d,title:o,description:c,children:f}),t[12]=c,t[13]=i,t[14]=d,t[15]=f,t[16]=o,t[17]=p):p=t[17],p}function Li(e){let t=(0,jn.c)(3),n=`${e.environmentId??``}:${e.instanceId??``}`,r;return t[0]!==n||t[1]!==e?(r=(0,$.jsx)(kt,{className:`@container/providers gap-8`,children:(0,$.jsx)(Ri,{...e},n)}),t[0]=n,t[1]=e,t[2]=r):r=t[2],r}function Ri(e){let t=(0,jn.c)(59),{environments:n,isReady:r}=De(),i=ke(),a=Ot(),o;t[0]!==n||t[1]!==i||t[2]!==e.environmentIds?(o=dn(n,i,e.environmentIds),t[0]=n,t[1]=i,t[2]=e.environmentIds,t[3]=o):o=t[3];let s=o,[c,l]=(0,Q.useState)(e.environmentId??i),u;t[4]!==s||t[5]!==c||t[6]!==e.environmentId?(u=e.environmentId!==void 0&&c===e.environmentId&&!s.some(t=>t.environmentId===e.environmentId),t[4]=s,t[5]=c,t[6]=e.environmentId,t[7]=u):u=t[7];let d=u,f;t[8]!==s||t[9]!==i||t[10]!==c||t[11]!==e.environmentId||t[12]!==e.scoped||t[13]!==d?(f=e.scoped||d?e.environmentId:en(s,c,i),t[8]=s,t[9]=i,t[10]=c,t[11]=e.environmentId,t[12]=e.scoped,t[13]=d,t[14]=f):f=t[14];let p=f,m,h;t[15]!==p||t[16]!==s?(m=s.find(e=>e.environmentId===p)??null,h=m!==null&&Vt({connectionPhase:m.connection.phase,hasServerConfig:m.serverConfig!==null}),t[15]=p,t[16]=s,t[17]=m,t[18]=h):(m=t[17],h=t[18]);let g=h,_;t[19]===s?_=t[20]:(_=s.find(Vi)?.environmentId,t[19]=s,t[20]=_);let v=_,y;t[21]===s?y=t[22]:(y=s.find(Bi)?.environmentId,t[21]=s,t[22]=y);let b=y,x;t[23]!==a||t[24]!==b||t[25]!==v||t[26]!==m?.serverConfig?.environment||t[27]!==g||t[28]!==e.scoped?(x=()=>{if(!e.scoped&&a===nn(`cursor-keychain-usage`).id&&(!g||m?.serverConfig?.environment.platform.os!==`darwin`)&&b!==void 0){l(b);return}!e.scoped&&(a===nn(`provider-health-check-interval`).id||a===nn(`usage-providers`).id)&&!g&&v!==void 0&&l(v)},t[23]=a,t[24]=b,t[25]=v,t[26]=m?.serverConfig?.environment,t[27]=g,t[28]=e.scoped,t[29]=x):x=t[29];let S;t[30]!==a||t[31]!==b||t[32]!==v||t[33]!==m||t[34]!==g||t[35]!==e.scoped?(S=[a,b,v,m,g,e.scoped],t[30]=a,t[31]=b,t[32]=v,t[33]=m,t[34]=g,t[35]=e.scoped,t[36]=S):S=t[36],(0,Q.useEffect)(x,S);let C=s.length===1&&s[0]?.entry.target._tag===`PrimaryConnectionTarget`,w;t[37]!==p||t[38]!==C||t[39]!==s||t[40]!==e.scoped?(w=!e.scoped&&!C&&s.length>0?(0,$.jsx)(Ye,{radius:`none`,hideScrollbars:!0,scrollFade:!0,className:`h-11 min-w-0 flex-1`,children:(0,$.jsx)(Ke,{"aria-label":`Devices`,variant:`segmented`,className:`my-2`,value:p?[p]:[],onValueChange:e=>{let t=s.find(t=>t.environmentId===e[0]);t&&l(t.environmentId)},children:s.map(zi)})}):null,t[37]=p,t[38]=C,t[39]=s,t[40]=e.scoped,t[41]=w):w=t[41];let T=w,E;t[42]!==T||t[43]!==d?(E=d?(0,$.jsx)(Fi,{deviceTabs:T,icon:(0,$.jsx)(bt,{kind:O(null)}),title:`Device unavailable`,description:`Reconnect this device to set up its provider, or select another device.`}):null,t[42]=T,t[43]=d,t[44]=E):E=t[44];let D;t[45]!==r||t[46]!==s.length||t[47]!==d?(D=s.length===0&&!d?(0,$.jsx)(Fi,{icon:(0,$.jsx)(bt,{kind:O(null)}),title:r?`No connected devices`:`Loading devices`,description:r?`Connect an execution environment before configuring providers.`:`Reading connected execution environments.`}):null,t[45]=r,t[46]=s.length,t[47]=d,t[48]=D):D=t[48];let k;t[49]!==T||t[50]!==m||t[51]!==e.environmentId||t[52]!==e.instanceId||t[53]!==e.projectIds?(k=m?(0,$.jsx)(Hi,{environment:m,deviceTabs:T,targetInstanceId:e.environmentId===void 0||m.environmentId===e.environmentId?e.instanceId:void 0,projectIds:e.projectIds??[]},m.environmentId):null,t[49]=T,t[50]=m,t[51]=e.environmentId,t[52]=e.instanceId,t[53]=e.projectIds,t[54]=k):k=t[54];let A;return t[55]!==D||t[56]!==k||t[57]!==E?(A=(0,$.jsxs)($.Fragment,{children:[E,D,k]}),t[55]=D,t[56]=k,t[57]=E,t[58]=A):A=t[58],A}function zi(e){let t=O(e.serverConfig),n=Ni(e),r=ue(e.connection);return(0,$.jsxs)(me,{children:[(0,$.jsx)(de,{render:(0,$.jsxs)(qe,{value:e.environmentId,children:[(0,$.jsx)(bt,{kind:t,className:`size-3.5 shrink-0`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`max-w-40 truncate`,children:e.label}),e.connection.phase===`connected`?null:(0,$.jsx)(It,{dotClassName:Pt(e.connection.phase),pingClassName:Ft(e.connection.phase)}),(0,$.jsxs)(`span`,{className:`sr-only`,children:[n,`, `,r]})]})}),(0,$.jsxs)(pe,{side:`top`,children:[n,` · `,r]})]},e.environmentId)}function Bi(e){return e.serverConfig?.environment.platform.os===`darwin`&&Vt({connectionPhase:e.connection.phase,hasServerConfig:!0})}function Vi(e){return Vt({connectionPhase:e.connection.phase,hasServerConfig:e.serverConfig!==null})}function Hi(e){let t=(0,jn.c)(5),{environment:n,deviceTabs:r,targetInstanceId:i,projectIds:a}=e,o;return t[0]!==r||t[1]!==n||t[2]!==a||t[3]!==i?(o=(0,$.jsx)(Ui,{environment:n,deviceTabs:r,targetInstanceId:i,projectIds:a}),t[0]=r,t[1]=n,t[2]=a,t[3]=i,t[4]=o):o=t[4],o}function Ui(e){let t=(0,jn.c)(10),{environment:n,deviceTabs:r,targetInstanceId:i,projectIds:a}=e,o=Re(n.environmentId),s;t[0]!==o.data||t[1]!==o.hasError||t[2]!==o.isPending?(s=Qt({session:o.data,isPending:o.isPending,hasError:o.hasError}),t[0]=o.data,t[1]=o.hasError,t[2]=o.isPending,t[3]=s):s=t[3];let c=s,l;return t[4]!==r||t[5]!==n||t[6]!==c||t[7]!==a||t[8]!==i?(l=(0,$.jsx)(Wi,{environment:n,operateAccess:c,deviceTabs:r,targetInstanceId:i,projectIds:a}),t[4]=r,t[5]=n,t[6]=c,t[7]=a,t[8]=i,t[9]=l):l=t[9],l}function Wi(e){let t=(0,jn.c)(15),{environment:n,operateAccess:r,deviceTabs:i,targetInstanceId:a,projectIds:o}=e,s=n.serverConfig!==null,c;t[0]!==n.connection.phase||t[1]!==r||t[2]!==s?(c=$t({connectionPhase:n.connection.phase,hasServerConfig:s,operateAccess:r}),t[0]=n.connection.phase,t[1]=r,t[2]=s,t[3]=c):c=t[3];let l=c;if(l.kind!==`editable`&&l.kind!==`read-only`){let e;return t[4]!==l||t[5]!==i||t[6]!==n?(e=(0,$.jsx)(Ii,{environment:n,access:l,deviceTabs:i}),t[4]=l,t[5]=i,t[6]=n,t[7]=e):e=t[7],e}let u=l.kind===`read-only`,d;return t[8]!==i||t[9]!==n.environmentId||t[10]!==n.label||t[11]!==o||t[12]!==u||t[13]!==a?(d=(0,$.jsx)(Gi,{environmentId:n.environmentId,environmentLabel:n.label,readOnly:u,deviceTabs:i,targetInstanceId:a,projectIds:o}),t[8]=i,t[9]=n.environmentId,t[10]=n.label,t[11]=o,t[12]=u,t[13]=a,t[14]=d):d=t[14],d}function Gi(e){let t=(0,jn.c)(179),{environmentId:n,environmentLabel:r,readOnly:d,deviceTabs:f,targetInstanceId:h,projectIds:g}=e,_=d!==void 0&&d,S;t[0]===g?S=t[1]:(S=g===void 0?[]:g,t[0]=g,t[1]=S);let C=S,w=Me(n),T=ze(n,s),E=ze(n,l),D=je(n),O=Fe(n),ee=Ae(n),M=Ne(n),N=o(Y.providersValueAtom(n))??Le,P=le(),F;if(t[2]!==n||t[3]!==P){let e;t[5]===n?e=t[6]:(e=e=>e.environmentId===n,t[5]=n,t[6]=e),F=P.filter(e),t[2]=n,t[3]=P,t[4]=F}else F=t[4];let te=F,I=W().get(n)?.environment.capabilities.projectProviderInstanceOverrides===!0,L;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(L={reportFailure:!1},t[7]=L):L=t[7];let R=X(Y.refreshProviders,L),z;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(z={reportFailure:!1},t[8]=z):z=t[8];let B=X(Y.updateProvider,z),ne;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(ne={reportFailure:!1},t[9]=ne):ne=t[9];let ie=X(Y.uninstallAcpRegistryManagedBinary,ne),ae;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(ae={reportFailure:!1},t[10]=ae):ae=t[10];let oe=X(Y.acceptAcpRegistryUrlAuth,ae),[V,H]=(0,Q.useState)(!1),[G,ue]=(0,Q.useState)(!1),[fe,he]=(0,Q.useState)(h??null),[q,be]=(0,Q.useState)($i),xe=(0,Q.useRef)(!1),Se;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(Se=new Set,t[11]=Se):Se=t[11];let Ce=(0,Q.useRef)(Se),we;t[12]!==oe||t[13]!==n?(we=(e,t)=>{oe({environmentId:n,input:{instanceId:e,elicitationId:t.elicitationId}}).then(Qi)},t[12]=oe,t[13]=n,t[14]=we):we=t[14];let Te=we,Ee;t[15]===N?Ee=t[16]:(Ee=new Map(N.filter(Wt).map(Zi)),t[15]=N,t[16]=Ee);let De=Ee,ke,Pe,Re,Ve,Z,Ue,We,Ge,Ke,qe,Je,Xe,Ze,Qe,$e,et;if(t[17]!==Te||t[18]!==E||t[19]!==T||t[20]!==f||t[21]!==n||t[22]!==r||t[23]!==V||t[24]!==M||t[25]!==C||t[26]!==te||t[27]!==De||t[28]!==_||t[29]!==R||t[30]!==fe||t[31]!==N||t[32]!==w||t[33]!==I||t[34]!==h||t[35]!==ee||t[36]!==ie||t[37]!==O||t[38]!==B||t[39]!==D||t[40]!==q){let e;t[57]===N?e=t[58]:(e=e=>e.provider!==`cursor`||N.some(Xi),t[57]=N,t[58]=e);let o=Ai.filter(e),s;t[59]!==N||t[60]!==w?(s=i(w,N),t[59]=N,t[60]=w,t[61]=s):s=t[61];let c=s.instanceId,l;if(t[62]!==w){Z=Ie(w);let e=Oe(Z.profile).providerHealthRefreshInterval;Ve=pn(Z.providerHealthRefreshInterval),l=pn(e),t[62]=w,t[63]=Ve,t[64]=Z,t[65]=l}else Ve=t[63],Z=t[64],l=t[65];Re=l;let d;t[66]===N?d=t[67]:(d=N.length>0?N.reduce(Yi,N[0].checkedAt):null,t[66]=N,t[67]=d);let g=d,S;t[68]!==n||t[69]!==R?(S=()=>{!xe.current&&Be(n,`orchestration:read`)&&(xe.current=!0,H(!0),(async()=>{let e=await R({environmentId:n,input:{refreshModels:!0}});xe.current=!1,H(!1),e._tag===`Failure`&&!U(e)&&console.warn(`Failed to refresh providers`,{operation:`refresh-providers`,environmentId:n,...ce(se(e))})})())},t[68]=n,t[69]=R,t[70]=S):S=t[70];let P=S,F;t[71]!==n||t[72]!==B?(F=async(e,t)=>{if(!Be(n,`providers:manage`)||Ce.current.has(e.instanceId))return;Ce.current.add(e.instanceId),be(t=>new Set(t).add(e.instanceId));let r=await B({environmentId:n,input:{provider:e.driver,instanceId:e.instanceId,...t?{targetVersion:t}:{}}});if(r._tag===`Failure`&&!U(r)){let t=se(r);J.add(He({type:`error`,title:`Could not update ${v[e.driver]??e.driver}`,description:t instanceof Error?t.message:`The provider update command could not be started.`}))}Ce.current.delete(e.instanceId),be(t=>{if(!t.has(e.instanceId))return t;let n=new Set(t);return n.delete(e.instanceId),n})},t[71]=n,t[72]=B,t[73]=F):F=t[73];let L=F,z=new Map;for(let[e,t]of Object.entries(w.providerInstances??{})){let n=t.driver,r=z.get(n)??[];r.push([e,t]),z.set(n,r)}let ne=new Set(o.map(Ji)),ae=[],oe=new Set(o.map(qi));for(let e of o){let t=e.provider,n=b(t),r=w.providerInstances?.[n],i=r??{driver:t},o=r!==void 0;(e.hasDefaultInstance||r!==void 0)&&(t===`codex`||t===`claudeAgent`||o||a(i)||n===h)&&ae.push({instanceId:n,instance:i,driver:t,isDefault:!0,isDirty:o});for(let[t,r]of z.get(e.provider)??[])t!==n&&ae.push({instanceId:t,instance:r,driver:r.driver,isDefault:!1})}for(let[e,t]of z)if(!oe.has(e))for(let[e,n]of t)ae.push({instanceId:e,instance:n,driver:n.driver,isDefault:ne.has(String(e))});let le=h!==void 0&&fe===h&&!ae.some(e=>e.instanceId===h),W=ae.find(e=>e.instanceId===fe)??(le?null:ae[0]??null),G;t[74]!==M||t[75]!==w?(G=async(e,t,n)=>{let{providerInstances:r,...i}=hn({settings:w,instanceId:e.instanceId,instance:t,textGenerationModelSelection:n?.textGenerationModelSelection}),a=await M({operation:`upsert`,instanceId:e.instanceId,instance:t},i);if(a._tag===`Failure`&&!U(a)){let e=se(a);J.add({type:`error`,title:`Could not update provider instance`,description:e instanceof Error?e.message:`The settings update failed.`})}},t[74]=M,t[75]=w,t[76]=G):G=t[76];let K=G,ge;t[77]!==n||t[78]!==M||t[79]!==ie?(ge=async e=>{let t=await M({operation:`remove`,instanceId:e.instanceId});if(t._tag===`Failure`){let e=se(t);J.add({type:`error`,title:`Could not delete provider instance`,description:e instanceof Error?e.message:`The settings update failed.`});return}if(e.driver!==j.make(`acpRegistry`)||ki(e.instance.config,`source`)===`local`)return;let r=ki(e.instance.config,`agentId`);if(r===null)return;let i=await ie({environmentId:n,input:{agentId:r}});if(i._tag===`Failure`&&!U(i)){let e=se(i);J.add({type:`warning`,title:`Provider deleted, but managed files remain`,description:e instanceof Error?e.message:`Managed binary cleanup failed.`})}},t[77]=n,t[78]=M,t[79]=ie,t[80]=ge):ge=t[80];let _e=ge,ve;t[81]===M?ve=t[82]:(ve=async e=>{let t=await M({operation:`remove`,instanceId:b(e)});if(t._tag===`Failure`&&!U(t)){let e=se(t);J.add({type:`error`,title:`Could not reset provider instance`,description:e instanceof Error?e.message:`The settings update failed.`})}},t[81]=M,t[82]=ve);let ye=ve,Se=(e,t)=>{let i=Ct.get(e.driver),o=N.find(t=>t.instanceId===e.instanceId),s=De.get(e.instanceId),l=q.has(e.instanceId)||o!==void 0&&Zt(o),d=s!==void 0,f=s!==void 0&&!l,h=w.providerModelPreferences?.[e.instanceId]??{hiddenModels:[],modelOrder:[]},g=x(w.favorites??[],t=>t.provider===e.instanceId?p(t.model):y),v=i?.label??String(e.driver),b=C[0],S=t=>{D({projectSettingsOverrides:zt(w,C,e.instanceId,t)})},E=b===void 0||!I?void 0:{value:w.projectSettingsOverrides[b]?.providerInstances?.[e.instanceId]?.enabled,effectiveEnabled:m(w,b,e.instanceId),onChange:e=>S(e),onReset:()=>S(void 0)};return(0,$.jsx)($r,{environmentId:n,acpProjects:te,projectOverride:E,onAcceptUrlAuth:_?void 0:t=>Te(e.instanceId,t),instanceId:e.instanceId,instance:e.instance,driverOption:i,liveProvider:o,mode:t,selected:t===`list`&&W?.instanceId===e.instanceId,onSelect:t===`list`?()=>he(e.instanceId):void 0,readOnly:_,runtime:t===`editor`&&e.driver===`codex`&&On(e.instance.config)===`managed`?(0,$.jsx)(En,{environmentId:n,instanceId:e.instanceId,provider:o}):void 0,canWriteSettings:T,setup:t===`editor`&&e.driver===`antigravity`?(0,$.jsx)(Ei,{environmentId:n,environmentLabel:r,instanceId:e.instanceId,provider:o,binaryPath:ji(e.instance.config),authMethod:Ti(e.instance.config),enabled:a(e.instance),readOnly:_,onEnable:()=>K(e,{...e.instance,enabled:!0})}):t===`editor`&&e.driver===`codex`&&On(e.instance.config)===`managed`?(0,$.jsx)(Sn,{environmentId:n,instanceId:e.instanceId,provider:o,mode:On(e.instance.config),enabled:a(e.instance),readOnly:_,onModeChange:t=>K(e,{...e.instance,enabled:!0,config:{...e.instance.config!==null&&typeof e.instance.config==`object`?e.instance.config:{},enabled:!0,setupMode:t}})}):t===`editor`&&!_&&o&&(o.setup?.canAuthenticate||o.driver===`acpRegistry`&&o.installed)?(0,$.jsx)($n,{environmentId:n,environmentLabel:r,instanceId:e.instanceId,provider:o,readOnly:_},`${n}:${e.instanceId}`):t===`editor`&&!_&&e.driver===`cursor`&&o?.setup?.canAuthenticate===!1?(0,$.jsx)(Dt,{title:`Cursor account`,description:`Using CURSOR_API_KEY. Remove it from this provider's environment to use browser sign-in.`}):null,onUpdate:t=>{let r=a(e.instance),i=t.enabled===!1&&r&&c===e.instanceId&&Be(n,`settings:write`);K(e,t,i?{textGenerationModelSelection:u.textGenerationModelSelection}:void 0)},onDelete:t===`editor`&&!e.isDefault?()=>_e(e):void 0,headerAction:t===`editor`&&e.isDefault&&e.isDirty?(0,$.jsx)(At,{label:`${v} provider settings`,onClick:()=>ye(e.driver)}):null,hiddenModels:h.hiddenModels,favoriteModels:g,modelOrder:h.modelOrder,onHiddenModelsChange:(t,n)=>{let r=new Set(t),i=n??Oi(h.hiddenModels,t).map(Ki);O({setModelsHidden:i.map(t=>({provider:e.instanceId,model:t,hidden:r.has(t)}))})},onToggleFavorite:t=>{ee(e.instanceId,t)},onFavoriteModelsChange:t=>{O({setModelFavorites:Oi(g,t).map(t=>{let{model:n,selected:r}=t;return{provider:e.instanceId,model:n,favorite:r}})})},onModelOrderChange:t=>{O({setProviderModelOrder:{provider:e.instanceId,modelOrder:t}})},onInstallRecommended:!_&&o?.compatibilityAdvisory?.message&&o.compatibilityAdvisory.recommendedVersion&&o.versionAdvisory?.canInstallVersion?()=>{L(o,o.compatibilityAdvisory?.recommendedVersion??void 0)}:void 0,onRunUpdate:!_&&d&&s?()=>{f&&L(s)}:void 0,isUpdating:l},e.instanceId)};Pe=jt,t[83]===Symbol.for(`react.memo_cache_sentinel`)?(Je=nn(`providers`),t[83]=Je):Je=t[83],Xe=`plain`,t[84]===_?Ze=t[85]:(Ze=_?null:(0,$.jsxs)(me,{children:[(0,$.jsx)(de,{render:(0,$.jsx)(k,{size:`icon-xs`,variant:`ghost-muted`,onClick:()=>ue(!0),"aria-label":`Add provider`,children:(0,$.jsx)(re,{})})}),(0,$.jsx)(pe,{side:`top`,children:`Add provider`})]}),t[84]=_,t[85]=Ze);let we;t[86]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,$.jsx)(un,{}),t[86]=we):we=t[86];let Ee=V||!E,Ae;t[87]===P?Ae=t[88]:(Ae=()=>void P(),t[87]=P,t[88]=Ae);let je;t[89]===V?je=t[90]:(je=(0,$.jsx)(cn,{refreshing:V}),t[89]=V,t[90]=je);let Me;t[91]===Symbol.for(`react.memo_cache_sentinel`)?(Me=(0,$.jsx)(`span`,{className:`sr-only`,children:`Refresh provider status`}),t[91]=Me):Me=t[91];let Ne;t[92]!==V||t[93]!==g?(Ne=V?`Refreshing providers`:(0,$.jsx)(Mi,{lastCheckedAt:g}),t[92]=V,t[93]=g,t[94]=Ne):Ne=t[94];let Fe;t[95]===Ne?Fe=t[96]:(Fe=(0,$.jsx)(`span`,{className:`hidden min-w-0 truncate sm:inline`,children:Ne}),t[95]=Ne,t[96]=Fe);let Y;t[97]!==V||t[98]!==Ee||t[99]!==Ae||t[100]!==je||t[101]!==Fe?(Y=(0,$.jsx)(de,{render:(0,$.jsxs)(k,{size:`xs`,variant:`ghost-muted`,disabled:Ee,"aria-busy":V,onClick:Ae,children:[je,Me,Fe]})}),t[97]=V,t[98]=Ee,t[99]=Ae,t[100]=je,t[101]=Fe,t[102]=Y):Y=t[102];let Le;t[103]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,$.jsx)(pe,{side:`top`,children:`Refresh provider status`}),t[103]=Le):Le=t[103],t[104]===Y?Qe=t[105]:(Qe=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[we,(0,$.jsxs)(me,{children:[Y,Le]})]}),t[104]=Y,t[105]=Qe),t[106]===f?$e=t[107]:($e=f?(0,$.jsx)(`div`,{className:`flex min-h-11 min-w-0 items-center gap-2 px-3 sm:px-4`,children:f}):null,t[106]=f,t[107]=$e),t[108]!==r||t[109]!==_?(et=_?(0,$.jsx)(Et,{divided:!1,className:`overflow-hidden`,children:(0,$.jsx)(Dt,{title:`Limited permissions`,description:`This session can view ${r}'s providers but can't change their settings.`})}):null,t[108]=r,t[109]=_,t[110]=et):et=t[110],ke=Et,Ge=!1,t[111]===Symbol.for(`react.memo_cache_sentinel`)?(Ke=A(Pi,`overflow-hidden @min-[48rem]/providers:grid @min-[48rem]/providers:grid-cols-[17rem_minmax(0,1fr)]`),t[111]=Ke):Ke=t[111];let ze;t[112]===_?ze=t[113]:(ze=_?null:(0,$.jsxs)(`button`,{type:`button`,className:`flex w-full cursor-pointer items-center gap-3 px-3 py-3 text-left text-sm text-muted-foreground transition-colors outline-none hover:bg-muted/25 hover:text-foreground focus-visible:bg-muted/25 focus-visible:text-foreground sm:px-4`,onClick:()=>ue(!0),children:[(0,$.jsx)(re,{className:`size-4 shrink-0`}),`Add provider`]}),t[112]=_,t[113]=ze);let X=(0,$.jsxs)(`div`,{className:`divide-y divide-border/50`,children:[ae.map(e=>Se(e,`list`)),ze]});t[114]===X?qe=t[115]:(qe=(0,$.jsx)(`div`,{className:`border-b border-border/60 bg-muted/10 @min-[48rem]/providers:flex @min-[48rem]/providers:min-h-0 @min-[48rem]/providers:flex-col @min-[48rem]/providers:border-r @min-[48rem]/providers:border-b-0`,children:(0,$.jsx)(Ye,{scrollFade:!0,chainVerticalScroll:!0,className:`@min-[48rem]/providers:min-h-0 @min-[48rem]/providers:flex-1`,children:X})}),t[114]=X,t[115]=qe),Ue=`min-w-0 @min-[48rem]/providers:min-h-0`,We=W?(0,$.jsx)(Ye,{scrollFade:!0,chainVerticalScroll:!0,className:`@min-[48rem]/providers:h-full`,children:(0,$.jsx)(`div`,{className:`space-y-6 p-4`,children:Se(W,`editor`)})}):(0,$.jsx)(`div`,{className:`p-6 text-sm text-muted-foreground`,children:le?`This provider instance is no longer available on this device.`:`No providers configured.`}),t[17]=Te,t[18]=E,t[19]=T,t[20]=f,t[21]=n,t[22]=r,t[23]=V,t[24]=M,t[25]=C,t[26]=te,t[27]=De,t[28]=_,t[29]=R,t[30]=fe,t[31]=N,t[32]=w,t[33]=I,t[34]=h,t[35]=ee,t[36]=ie,t[37]=O,t[38]=B,t[39]=D,t[40]=q,t[41]=ke,t[42]=Pe,t[43]=Re,t[44]=Ve,t[45]=Z,t[46]=Ue,t[47]=We,t[48]=Ge,t[49]=Ke,t[50]=qe,t[51]=Je,t[52]=Xe,t[53]=Ze,t[54]=Qe,t[55]=$e,t[56]=et}else ke=t[41],Pe=t[42],Re=t[43],Ve=t[44],Z=t[45],Ue=t[46],We=t[47],Ge=t[48],Ke=t[49],qe=t[50],Je=t[51],Xe=t[52],Ze=t[53],Qe=t[54],$e=t[55],et=t[56];let tt;t[116]!==Ue||t[117]!==We?(tt=(0,$.jsx)(`div`,{className:Ue,children:We}),t[116]=Ue,t[117]=We,t[118]=tt):tt=t[118];let nt;t[119]!==ke||t[120]!==Ge||t[121]!==Ke||t[122]!==qe||t[123]!==tt?(nt=(0,$.jsxs)(ke,{divided:Ge,className:Ke,children:[qe,tt]}),t[119]=ke,t[120]=Ge,t[121]=Ke,t[122]=qe,t[123]=tt,t[124]=nt):nt=t[124];let rt;t[125]!==Pe||t[126]!==Je||t[127]!==Xe||t[128]!==Ze||t[129]!==Qe||t[130]!==$e||t[131]!==et||t[132]!==nt?(rt=(0,$.jsxs)(Pe,{...Je,variant:Xe,titleAction:Ze,headerAction:Qe,children:[$e,et,nt]}),t[125]=Pe,t[126]=Je,t[127]=Xe,t[128]=Ze,t[129]=Qe,t[130]=$e,t[131]=et,t[132]=nt,t[133]=rt):rt=t[133];let it;t[134]!==n||t[135]!==r||t[136]!==_||t[137]!==w.cursorKeychainUsageEnabled||t[138]!==w.usageLimitSources?(it=(0,$.jsx)(Ci,{environmentId:n,environmentLabel:r,sources:w.usageLimitSources,cursorKeychainUsageEnabled:w.cursorKeychainUsageEnabled,readOnly:_},n),t[134]=n,t[135]=r,t[136]=_,t[137]=w.cursorKeychainUsageEnabled,t[138]=w.usageLimitSources,t[139]=it):it=t[139];let at;t[140]===Symbol.for(`react.memo_cache_sentinel`)?(at=nn(`provider-health-check-interval`),t[140]=at):at=t[140];let ot=at.id,st;t[141]===Symbol.for(`react.memo_cache_sentinel`)?(st=nn(`provider-health-check-interval`),t[141]=st):st=t[141];let ct;t[142]===Symbol.for(`react.memo_cache_sentinel`)?(ct=(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[st.title,(0,$.jsx)(Mt,{children:`This interval is configured here, then the shared Background activity policy decides whether provider probes may run when the timer fires. Custom intervals appear as Advanced in General settings.`})]}),t[142]=ct):ct=t[142];let lt;t[143]!==T||t[144]!==Re||t[145]!==Ve||t[146]!==Z||t[147]!==w.backgroundActivity||t[148]!==D?(lt=Ve===Re?null:(0,$.jsx)(`span`,{inert:!T,className:T?void 0:`opacity-50`,children:(0,$.jsx)(At,{label:`provider health check interval`,onClick:()=>D(gn(w.backgroundActivity,Z,{providerHealthRefreshInterval:void 0}))})}),t[143]=T,t[144]=Re,t[145]=Ve,t[146]=Z,t[147]=w.backgroundActivity,t[148]=D,t[149]=lt):lt=t[149];let ut=!T,dt=!T||void 0,ft=!T&&`opacity-50 select-none`,pt;t[150]===ft?pt=t[151]:(pt=A(`flex shrink-0 items-center gap-2`,ft),t[150]=ft,t[151]=pt);let mt;t[152]!==Z||t[153]!==w.backgroundActivity||t[154]!==D?(mt=e=>D(gn(w.backgroundActivity,Z,{providerHealthRefreshInterval:c(mn(e))})),t[152]=Z,t[153]=w.backgroundActivity,t[154]=D,t[155]=mt):mt=t[155];let ht;t[156]===Symbol.for(`react.memo_cache_sentinel`)?(ht=(0,$.jsxs)(ve,{children:[(0,$.jsx)(_e,{"aria-label":`Decrease provider health check interval`}),(0,$.jsx)(K,{"aria-label":`Provider health check interval in seconds`}),(0,$.jsx)(ge,{"aria-label":`Increase provider health check interval`})]}),t[156]=ht):ht=t[156];let gt;t[157]!==Ve||t[158]!==mt?(gt=(0,$.jsx)(ye,{value:Ve,min:0,step:30,size:`sm`,className:`w-32`,onValueChange:mt,children:ht}),t[157]=Ve,t[158]=mt,t[159]=gt):gt=t[159];let _t;t[160]===Symbol.for(`react.memo_cache_sentinel`)?(_t=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`seconds`}),t[160]=_t):_t=t[160];let vt;t[161]!==ut||t[162]!==dt||t[163]!==pt||t[164]!==gt?(vt=(0,$.jsxs)(`div`,{inert:ut,"aria-disabled":dt,className:pt,children:[gt,_t]}),t[161]=ut,t[162]=dt,t[163]=pt,t[164]=gt,t[165]=vt):vt=t[165];let yt;t[166]!==lt||t[167]!==vt?(yt=(0,$.jsx)(jt,{title:`Advanced`,children:(0,$.jsx)(Dt,{id:ot,title:ct,description:`Refresh provider status, versions, and models in the background. Set to 0 to disable.`,resetAction:lt,control:vt})}),t[166]=lt,t[167]=vt,t[168]=yt):yt=t[168];let bt;t[169]!==n||t[170]!==r||t[171]!==G||t[172]!==_?(bt=G&&!_?(0,$.jsx)(fi,{open:!0,environmentId:n,environmentLabel:r,onOpenChange:ue,onCreated:he}):null,t[169]=n,t[170]=r,t[171]=G,t[172]=_,t[173]=bt):bt=t[173];let xt;return t[174]!==rt||t[175]!==it||t[176]!==yt||t[177]!==bt?(xt=(0,$.jsxs)($.Fragment,{children:[rt,it,yt,bt]}),t[174]=rt,t[175]=it,t[176]=yt,t[177]=bt,t[178]=xt):xt=t[178],xt}function Ki(e){return e.model}function qi(e){return e.provider}function Ji(e){return String(b(e.provider))}function Yi(e,t){return t.checkedAt>e?t.checkedAt:e}function Xi(e){return e.instanceId===b(j.make(`cursor`))}function Zi(e){return[e.instanceId,e]}function Qi(e){if(e._tag===`Success`&&!e.value.accepted){J.add({type:`warning`,title:`Authentication request expired`,description:`Refresh the provider and start the authentication flow again.`});return}if(e._tag===`Failure`&&!U(e)){let t=se(e);J.add({type:`error`,title:`Could not continue authentication`,description:t instanceof Error?t.message:`The authentication request expired.`})}}function $i(){return new Set}function ea(){let e=(0,jn.c)(12),t=ln.useSearch(),{environment:n,scope:r}=Tt();if(!n){let t=r.kind===`environment`?`Reconnect ${r.label} to set up its providers.`:`Connect an environment to set up its providers.`,n;return e[0]===t?n=e[1]:(n=(0,$.jsx)(`p`,{className:`p-8 text-sm text-muted-foreground`,children:t}),e[0]=t,e[1]=n),n}let i;e[2]===t.instanceId?i=e[3]:(i=t.instanceId?{instanceId:t.instanceId}:{},e[2]=t.instanceId,e[3]=i);let a;e[4]!==n.environmentId||e[5]!==r.kind||e[6]!==r.members?(a=r.kind===`project`||r.kind===`checkout`?r.members.filter(e=>e.environmentId===n.environmentId).map(ta):[],e[4]=n.environmentId,e[5]=r.kind,e[6]=r.members,e[7]=a):a=e[7];let o;return e[8]!==n.environmentId||e[9]!==i||e[10]!==a?(o=(0,$.jsx)(Li,{environmentId:n.environmentId,...i,projectIds:a,scoped:!0}),e[8]=n.environmentId,e[9]=i,e[10]=a,e[11]=o):o=e[11],o}function ta(e){return e.id}export{ea as component};
|
|
3
|
+
//# sourceMappingURL=settings.providers-Dsnq0-AL.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{ha as t,jx as n}from"./utils-BxISc9RR.js";import{i as r}from"./main-uLg3xUJM.js";import{t as i}from"./ScheduledTasksSettings-D_Z_3GVl.js";var a=n(),o=e(t());function s(){let e=(0,a.c)(2),t=r.useSearch(),n;return e[0]===t?n=e[1]:(n=(0,o.jsx)(i,{...t}),e[0]=t,e[1]=n),n}export{s as component};
|
|
2
|
+
//# sourceMappingURL=settings.scheduled-tasks-BOpVl_XK.js.map
|