@readmagic/workmate 0.0.10 → 0.0.11
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/chunks/{AddWorkspaceDirectory-Vmmm7p1c.js → AddWorkspaceDirectory-ag2JTpmU.js} +1 -1
- package/dist/chunks/App-BuKmqFPm.js +1 -0
- package/dist/chunks/ApproveApiKey-CIWOi_7v.js +1 -0
- package/dist/chunks/ApproveApiKey-M6U-NafA.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-Pnpl3Ixx.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-CLSACUmo.js → BypassPermissionsModeDialog-B05t83wa.js} +1 -1
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-BqNxQOXJ.js → ClaudeMdExternalIncludesDialog-CSywJdVL.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-D-w166RC.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-CV6PcJOP.js +1 -0
- package/dist/chunks/{DiffDialog-9AYwtupw.js → DiffDialog-DUbFrzKu.js} +2 -2
- package/dist/chunks/Doctor-BcnUfJ4I.js +1 -0
- package/dist/chunks/Doctor-Dz4TuYas.js +3 -0
- package/dist/chunks/ExitFlow-BwyAtIHx.js +2 -0
- package/dist/chunks/{Grove-B9-hhkZA.js → Grove-BDoVj02t.js} +2 -2
- package/dist/chunks/{HybridTransport-MxJ_W_np.js → HybridTransport-C_U0IJfz.js} +4 -4
- package/dist/chunks/InvalidConfigDialog-bih293Xt.js +1 -0
- package/dist/chunks/{InvalidSettingsDialog-YyQcHocx.js → InvalidSettingsDialog-Br8kQOHz.js} +1 -1
- package/dist/chunks/MCPConnectionManager-B9n4SXN4.js +1 -0
- package/dist/chunks/MCPToolListView-DJ06N1DG.js +1 -0
- package/dist/chunks/{McpParsingWarnings-BCpfHaBK.js → McpParsingWarnings-COa71S9q.js} +1 -1
- package/dist/chunks/MessageSelector-o4ULADFg.js +3 -0
- package/dist/chunks/Messages-qqwHuAW5.js +11 -0
- package/dist/chunks/{Onboarding-ClwHS5rh.js → Onboarding-BzuQjney.js} +1 -1
- package/dist/chunks/{PromptInputFooterSuggestions-BSA9NrZc.js → PromptInputFooterSuggestions-to5eYBvI.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-Bb4KdIX_.js → PromptInputHelpMenu-CfMFx-TF.js} +1 -1
- package/dist/chunks/QueryEngine-Dt0BKUeF.js +1 -0
- package/dist/chunks/REPL-CUbEDqEl.js +133 -0
- package/dist/chunks/REPL-DMaKNhTa.js +1 -0
- package/dist/chunks/{RemoteSessionManager-CS6mywIn.js → RemoteSessionManager-Bf44A0Ol.js} +2 -2
- package/dist/chunks/ResumeConversation-Ctw5Q1g9.js +1 -0
- package/dist/chunks/{SSETransport-CoxQ8YpH.js → SSETransport-DN4tCDEh.js} +3 -3
- package/dist/chunks/SearchExtraToolsTool-C80OdtPZ.js +1 -0
- package/dist/chunks/Settings-DfdcmvOV.js +2 -0
- package/dist/chunks/{TeleportProgress-Doucj-50.js → TeleportProgress-C2LQVLav.js} +1 -1
- package/dist/chunks/TeleportRepoMismatchDialog-BZL8Zblz.js +1 -0
- package/dist/chunks/{TeleportResumeWrapper-D6kpr2c6.js → TeleportResumeWrapper-wPiIs8xg.js} +1 -1
- package/dist/chunks/{ThemePicker-DrC8tlp0.js → ThemePicker-BT_NaRQC.js} +1 -1
- package/dist/chunks/{TrustDialog-Fk4m_Sy4.js → TrustDialog-ACaJ_m7A.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-D_OUa4RT.js → ValidationErrorsList-C-hWdy_8.js} +1 -1
- package/dist/chunks/{WelcomeV2-DvfQHnZY.js → WelcomeV2-ZQRKlcT4.js} +1 -1
- package/dist/chunks/add-dir-SAKTkw0S.js +1 -0
- package/dist/chunks/{agentDisplay-B755vMZE.js → agentDisplay-CuSHqgZc.js} +1 -1
- package/dist/chunks/{agents-CIvP8l0s.js → agents-CMC0iQP4.js} +1 -1
- package/dist/chunks/agents-ZgRKpjHv.js +103 -0
- package/dist/chunks/allErrors-_cOQksHC.js +1 -0
- package/dist/chunks/{api-nSHc_GIQ.js → api-BbJfMXRS.js} +1 -1
- package/dist/chunks/api-DS1MiW01.js +1 -0
- package/dist/chunks/{auth-5QB6tsfB.js → auth-7mJGtlZp.js} +2 -2
- package/dist/chunks/auth-DGZzCbU0.js +1 -0
- package/dist/chunks/auth-DN1MUpB8.js +1 -0
- package/dist/chunks/{autoMode-BnUiK9Cu.js → autoMode-CBtY7ACs.js} +6 -6
- package/dist/chunks/{autonomy-Src6sKCp.js → autonomy-DuQmYhq6.js} +9 -9
- package/dist/chunks/{autonomy-C1aSgWPQ.js → autonomy-lJV7yWUl.js} +1 -1
- package/dist/chunks/autonomyPanel-DAQm6lDz.js +1 -0
- package/dist/chunks/backgroundHousekeeping-BTy71bcY.js +1 -0
- package/dist/chunks/backgroundHousekeeping-Cc7Ag7JG.js +17 -0
- package/dist/chunks/{banner-D0P7wXdw.js → banner-1Wyeyawe.js} +1 -1
- package/dist/chunks/{bg-DAPORXF3.js → bg-CJ0YWFli.js} +2 -2
- package/dist/chunks/bg-CeUrRz_7.js +1 -0
- package/dist/chunks/{branch-DFWa4Oxo.js → branch-k3kirqbA.js} +2 -2
- package/dist/chunks/{break-cache-Chj9i9MP.js → break-cache-CAoZ9b72.js} +1 -1
- package/dist/chunks/bridgeConfig-CzRUPn-D.js +1 -0
- package/dist/chunks/{bridgeConfig-Bb6URf4Q.js → bridgeConfig-UgaUfuP6.js} +1 -1
- package/dist/chunks/{bridgeMessaging-C3huGcR3.js → bridgeMessaging-Ci5H68MX.js} +1 -1
- package/dist/chunks/{bridgePointer-DLYyvRKb.js → bridgePointer-BL8-lGvN.js} +1 -1
- package/dist/chunks/{bridgeStatusUtil-DFMftajD.js → bridgeStatusUtil-C36w15ge.js} +1 -1
- package/dist/chunks/btw-nVoVuIae.js +1 -0
- package/dist/chunks/caches-B8sM3Zys.js +1 -0
- package/dist/chunks/caches-Bp9MZ7IE.js +1 -0
- package/dist/chunks/{capacityWake-amzeeBz0.js → capacityWake-BOySRJUJ.js} +1 -1
- package/dist/chunks/ccrClient-Br4LAofR.js +1 -0
- package/dist/chunks/{claudeDesktop-CsJfF1b-.js → claudeDesktop-Bgds1-YT.js} +1 -1
- package/dist/chunks/{clear-ClFDpWVJ.js → clear-C4Vtnbye.js} +1 -1
- package/dist/chunks/{cliLaunch-BWcoyZDP.js → cliLaunch-BTpfAGGI.js} +1 -1
- package/dist/chunks/{client-DFlE4fYh.js → client-B9404qIP.js} +1 -1
- package/dist/chunks/client-BCAbKdNz.js +1 -0
- package/dist/chunks/client-CJE6gEvU.js +1 -0
- package/dist/chunks/commands-DL-BzoMQ.js +1 -0
- package/dist/chunks/compact-Cx7BPXLU.js +2 -0
- package/dist/chunks/config-S5OW4Xqr.js +1 -0
- package/dist/chunks/{config-Do1870_d.js → config-aRiTrtCv.js} +2 -2
- package/dist/chunks/{config-CVHMRMwd.js → config-kB2eazPX.js} +1 -1
- package/dist/chunks/context-BN7DEjoH.js +1 -0
- package/dist/chunks/{context-noninteractive-D5iQhasu.js → context-noninteractive-D91W2B8e.js} +5 -5
- package/dist/chunks/context-noninteractive-DPacEFJ1.js +1 -0
- package/dist/chunks/conversation-D5Nbu9eT.js +1 -0
- package/dist/chunks/conversation-hcUx9e-C.js +1 -0
- package/dist/chunks/{createSSHSession-CJtzNQdZ.js → createSSHSession-DecOR6M5.js} +6 -6
- package/dist/chunks/createSession-D27zvmOs.js +1 -0
- package/dist/chunks/createSession-DRqkLZWt.js +1 -0
- package/dist/chunks/crossProjectResume-Bw3U0Ty6.js +40 -0
- package/dist/chunks/{datadog-DjeJThpV.js → datadog-bm551AVV.js} +1 -1
- package/dist/chunks/debug-BecbSVoN.js +39 -0
- package/dist/chunks/{debugUtils-DX0KAXNK.js → debugUtils-CmJfIUxW.js} +1 -1
- package/dist/chunks/{detached-X_yjYR7x.js → detached-CIyF0M5O.js} +1 -1
- package/dist/chunks/detectRepository-C15umvKN.js +1 -0
- package/dist/chunks/detectRepository-DDfLfKcM.js +1 -0
- package/dist/chunks/{diff-jEJJe58I.js → diff-DeK4bwjw.js} +1 -1
- package/dist/chunks/{directoryCompletion-BbXR2bfy.js → directoryCompletion-BJCu19HJ.js} +1 -1
- package/dist/chunks/doctor-BJORBomU.js +1 -0
- package/dist/chunks/{entry-oIqjxIjQ.js → entry-mdegyj8z.js} +3 -3
- package/dist/chunks/{esm-Cf4nSRjF.js → esm-Ka3lhafK.js} +1 -1
- package/dist/chunks/{execFileNoThrow-Dwu6psHW.js → execFileNoThrow-DHyW8FMX.js} +2 -2
- package/dist/chunks/execSyncWrapper-CDzB0BM1.js +1 -0
- package/dist/chunks/exit-CF3KBl-S.js +1 -0
- package/dist/chunks/{extraUsage-Mi66JwFZ.js → extraUsage-BrKbpBK-.js} +1 -1
- package/dist/chunks/extractMemories-4lBn134y.js +1 -0
- package/dist/chunks/fast-0Vi354KI.js +1 -0
- package/dist/chunks/{fast-BU4iUZ8E.js → fast-DWn40OcQ.js} +1 -1
- package/dist/chunks/{fileSuggestions-BMfQIDdW.js → fileSuggestions-C7Pwq2yj.js} +3 -3
- package/dist/chunks/{firstPartyEventLogger-B3cXgR67.js → firstPartyEventLogger-BHjBQH0J.js} +2 -2
- package/dist/chunks/firstPartyEventLogger-BNBnLYPK.js +1 -0
- package/dist/chunks/{flushGate-DgSDVGKZ.js → flushGate-DdJjxCes.js} +1 -1
- package/dist/chunks/gemini-DHv2iVfy.js +1 -0
- package/dist/chunks/generateSessionName-DhS_6oHd.js +1 -0
- package/dist/chunks/{genericProcessUtils-CmsUPyRz.js → genericProcessUtils-B2HcDYhg.js} +1 -1
- package/dist/chunks/git-DBlOv64X.js +6 -0
- package/dist/chunks/git-DF4RFFaT.js +1 -0
- package/dist/chunks/githubRepoPathMapping-CK56bUDe.js +1 -0
- package/dist/chunks/{goal-ZmSRBx4q.js → goal-BZG4gtnb.js} +3 -3
- package/dist/chunks/{grok-BXMvezWb.js → grok-BS57ZhyW.js} +1 -1
- package/dist/chunks/{grove-CeOjTaY6.js → grove-_zlQ83yR.js} +2 -2
- package/dist/chunks/{help-5DNZO6_H.js → help-C_2tdXHC.js} +1 -1
- package/dist/chunks/{hooks-C637tFtd.js → hooks-C7Bn7MBe.js} +2 -2
- package/dist/chunks/hooks-DT80Arzc.js +1 -0
- package/dist/chunks/{initReplBridge-D1h10vQ9.js → initReplBridge-NkZRcM77.js} +1 -1
- package/dist/chunks/{install-C-6ItpH0.js → install-Du-DSVzj.js} +1 -1
- package/dist/chunks/{instrumentation-DaiPDUst.js → instrumentation-DMs3b82f.js} +5 -5
- package/dist/chunks/{job-BeYzQUiR.js → job-rbX1VZmp.js} +1 -1
- package/dist/chunks/jwtUtils-OzxN2zts.js +1 -0
- package/dist/chunks/keybindings-CwdC_8S0.js +2 -0
- package/dist/chunks/{launchLocalMemory-CE4J98xO.js → launchLocalMemory-BLRCK1_o.js} +2 -2
- package/dist/chunks/{launchOnboarding-BfTdC6vp.js → launchOnboarding-Al_X75Vz.js} +1 -1
- package/dist/chunks/{loadAgentsDir-C7lOqvfh.js → loadAgentsDir-BL93ulMm.js} +619 -619
- package/dist/chunks/loadAgentsDir-eVKq8efm.js +1 -0
- package/dist/chunks/loadPluginHooks-B0au35a4.js +1 -0
- package/dist/chunks/{localSearch-BKrznW5x.js → localSearch-C5ipegd9.js} +1 -1
- package/dist/chunks/localSearch-CZlFfR_X.js +1 -0
- package/dist/chunks/{log-CezCRpAN.js → log-Dauqle-Z.js} +1 -1
- package/dist/chunks/{logoV2Utils-BkQfyQ1-.js → logoV2Utils-CkvOihX7.js} +1 -1
- package/dist/chunks/{magicDocs-BpVcON9o.js → magicDocs-DLav5QK0.js} +3 -3
- package/dist/chunks/main-CVNWNAoh.js +513 -0
- package/dist/chunks/{main-CvOv59-7.js → main-LMyE3jXY.js} +2 -2
- package/dist/chunks/managedEnv-CYepSnm8.js +1 -0
- package/dist/chunks/{managedEnv-DhWRJ5DK.js → managedEnv-DJSCuqCb.js} +1 -1
- package/dist/chunks/{mappers-bOab8ipV.js → mappers-DQxMcezy.js} +1 -1
- package/dist/chunks/mcp-BAbbEaBA.js +1 -0
- package/dist/chunks/mcp-Ct4Sum6A.js +6 -0
- package/dist/chunks/{mcp-VcGPYCkW.js → mcp-D5HkCqUh.js} +2 -2
- package/dist/chunks/{memoize-DsqYrbeR.js → memoize-FeyE7JEh.js} +1 -1
- package/dist/chunks/memory-COa7aUbx.js +1 -0
- package/dist/chunks/{mode-DlKnUM8l.js → mode-Bl2RZC8M.js} +2 -2
- package/dist/chunks/model-B7rtZ7KV.js +1 -0
- package/dist/chunks/{model-BsZ4sP_H.js → model-Bgh_r4lg.js} +1 -1
- package/dist/chunks/model-DiuEAv6h.js +1 -0
- package/dist/chunks/{modelOptions-CxP067Qv.js → modelOptions-BtEZe5BB.js} +1 -1
- package/dist/chunks/nativeInstaller-BEwayifa.js +1 -0
- package/dist/chunks/omit--yH_T4rf.js +1 -0
- package/dist/chunks/onChangeAppState-ZdwI7boX.js +1 -0
- package/dist/chunks/{openai-B9C2XN5Q.js → openai-DWs4D-nQ.js} +3 -3
- package/dist/chunks/panel-CoNfXy3K.js +1 -0
- package/dist/chunks/{parser-BwPXQomy.js → parser-BH4u7QiV.js} +1 -1
- package/dist/chunks/parser-BMIaRErw.js +1 -0
- package/dist/chunks/{partition-D-UhsUCx.js → partition-DLcW5Oo_.js} +1 -1
- package/dist/chunks/permissions-CaucYK3s.js +3 -0
- package/dist/chunks/pidLock-DgOBc1Xo.js +3 -0
- package/dist/chunks/{plan-CyU2zrCK.js → plan-BNYDTnQd.js} +1 -1
- package/dist/chunks/{platform-BMPbglug.js → platform-B0uTQc9P.js} +1 -1
- package/dist/chunks/plugin-BN-of1_H.js +17 -0
- package/dist/chunks/pluginAutoupdate-BBU9Jn4p.js +1 -0
- package/dist/chunks/pluginBlocklist-DXQlbG0P.js +1 -0
- package/dist/chunks/pluginCliCommands-CfdVNs8D.js +1 -0
- package/dist/chunks/pluginFlagging-DcJ_FQuv.js +1 -0
- package/dist/chunks/pluginOperations-DnhzFbYI.js +2 -0
- package/dist/chunks/pluginStartupCheck-CKBFaMFr.js +1 -0
- package/dist/chunks/pluginStartupCheck-CpNB4jxG.js +1 -0
- package/dist/chunks/plugins-CBW7kPyp.js +4 -0
- package/dist/chunks/{poorMode-DEwQOAJt.js → poorMode-B_xEvuEV.js} +1 -1
- package/dist/chunks/poorMode-yH1o41cQ.js +1 -0
- package/dist/chunks/{print-eCRv_Li-.js → print-BZOx09SU.js} +16 -16
- package/dist/chunks/processBashCommand-dcCNCiBp.js +1 -0
- package/dist/chunks/processSlashCommand-YDiM63Qr.js +5 -0
- package/dist/chunks/prompt-CXGy0llt.js +1 -0
- package/dist/chunks/prompt-DovNDmcx.js +1 -0
- package/dist/chunks/{prompt-M2lu8_Oa.js → prompt-Dx7IWhBt.js} +2 -2
- package/dist/chunks/{promptEditor-DhcZY-iu.js → promptEditor-WCkmpejM.js} +2 -2
- package/dist/chunks/{protocolHandler-CkFaJKKo.js → protocolHandler-BiVWrpHi.js} +4 -4
- package/dist/chunks/{proxy-CuMaO_YV.js → proxy-CVn7o19p.js} +3 -3
- package/dist/chunks/reconciler-C2Nd_e4n.js +1 -0
- package/dist/chunks/refresh-B84H2Ezd.js +1 -0
- package/dist/chunks/{registerProtocol-CsNYRZKr.js → registerProtocol-E0Iu5hEx.js} +2 -2
- package/dist/chunks/{reload-plugins-B7JAE3b4.js → reload-plugins-D-3AUT9g.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-CFLJhsB6.js → remoteBridgeCore-CV6we3ZA.js} +1 -1
- package/dist/chunks/remoteManagedSettings-D26Q09-7.js +1 -0
- package/dist/chunks/{rename-BCp2Vtqu.js → rename-CSavuBIE.js} +1 -1
- package/dist/chunks/{renderOptions-Q5oCLFIC.js → renderOptions-DDLbSMQU.js} +1 -1
- package/dist/chunks/resume-CROylN3J.js +2 -0
- package/dist/chunks/ripgrep-2M1GkXqJ.js +1 -0
- package/dist/chunks/{ripgrep-DvOOsDMv.js → ripgrep-C1ydIMzT.js} +5 -5
- package/dist/chunks/{runtimeObserver-CS_3BDNo.js → runtimeObserver-L7pSIWBT.js} +2 -2
- package/dist/chunks/{runtimeObserver-DYUva6g-.js → runtimeObserver-OU8KrZQG.js} +1 -1
- package/dist/chunks/sandbox-adapter-6UwMLh6e.js +1 -0
- package/dist/chunks/{sandbox-toggle--zNSKce_.js → sandbox-toggle-YrQNWGsr.js} +1 -1
- package/dist/chunks/searchExtraTools-Bdv5HJ74.js +1 -0
- package/dist/chunks/{session-CO3gEqQP.js → session-DUYsfPy_.js} +2 -2
- package/dist/chunks/sessionFileAccessHooks-Czen7Ejz.js +1 -0
- package/dist/chunks/sessionObserver-B0zucj_c.js +1 -0
- package/dist/chunks/{sessionObserver-YkRHC-Aa.js → sessionObserver-Dv3Ba8eA.js} +2 -2
- package/dist/chunks/{sessionState-Bifmu95-.js → sessionState-D-SaBzWD.js} +2 -2
- package/dist/chunks/sessionStorage-BM1x51Z7.js +1 -0
- package/dist/chunks/{sessionTitle-COBSgSXS.js → sessionTitle-uCuYaNif.js} +2 -2
- package/dist/chunks/{sessionTracing-BrNx1k2V.js → sessionTracing-Bqb3vJTt.js} +3 -3
- package/dist/chunks/settings-BG15IFYx.js +1 -0
- package/dist/chunks/settings-D4CpDv2y.js +20 -0
- package/dist/chunks/settingsSync-BSrpnyqo.js +1 -0
- package/dist/chunks/setup-C62oq4AZ.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-DEaw-X5j.js → shadowedRuleDetection-BzAZ57p2.js} +1 -1
- package/dist/chunks/{shellQuote-BYeOv3Ip.js → shellQuote-DS6WrivY.js} +2 -2
- package/dist/chunks/{sideQuestion-D0OKljee.js → sideQuestion-CvMBBjI8.js} +2 -2
- package/dist/chunks/sinks-WJ7nzLQs.js +1 -0
- package/dist/chunks/sinks-f7qYjbKJ.js +2 -0
- package/dist/chunks/skillChangeDetector-U5kRU5nd.js +1 -0
- package/dist/chunks/{skillGapStore-N_kmvXML.js → skillGapStore-CqaT8c0C.js} +2 -2
- package/dist/chunks/{skillLifecycle-C4F5RXuh.js → skillLifecycle-CnR8IqJM.js} +2 -2
- package/dist/chunks/skillSearchPanel-D9qrOXpI.js +21 -0
- package/dist/chunks/{skills-C4CTRN9o.js → skills-BgcFh0vy.js} +1 -1
- package/dist/chunks/startupProfiler-B4HBBbHN.js +1 -0
- package/dist/chunks/{startupProfiler-L_UWZ03w.js → startupProfiler-CmH_aVy2.js} +2 -2
- package/dist/chunks/{stats-IzV0_vEc.js → stats-B8uQ-UDi.js} +1 -1
- package/dist/chunks/{status-CeVP_uDT.js → status-BekdWoIj.js} +1 -1
- package/dist/chunks/status-D6KlRJmR.js +2 -0
- package/dist/chunks/{statusNoticeHelpers-Bb9gxdSt.js → statusNoticeHelpers-BMM8_uJ1.js} +1 -1
- package/dist/chunks/{stringUtils-C84IJ91d.js → stringUtils-C8PaYpQF.js} +1 -1
- package/dist/chunks/switcher-Ck9CrXrr.js +1 -0
- package/dist/chunks/{switcher-CCs9xl1z.js → switcher-DnAhkyIn.js} +1 -1
- package/dist/chunks/syncCache-ClP9aBqK.js +1 -0
- package/dist/chunks/{tasks-DZDhgx0w.js → tasks-Dmh6qikm.js} +1 -1
- package/dist/chunks/teleport-DH3IuAUQ.js +1 -0
- package/dist/chunks/{templateJobs-CrNPEKkh.js → templateJobs-CxqU-s5i.js} +1 -1
- package/dist/chunks/{terminalSetup-CBqcwQll.js → terminalSetup-BKGcmlWp.js} +1 -1
- package/dist/chunks/{terminalSetup-D-N8YPiQ.js → terminalSetup-Cy19F1Js.js} +4 -4
- package/dist/chunks/{theme-Dazsirbw.js → theme-U7lMFHQ0.js} +1 -1
- package/dist/chunks/{tmux-DewYVEBm.js → tmux-D5EvHWi3.js} +1 -1
- package/dist/chunks/{toolEventObserver-lnHJ9fLQ.js → toolEventObserver-D9qjoVl5.js} +1 -1
- package/dist/chunks/toolPool-69mfSPAs.js +1 -0
- package/dist/chunks/trustedDevice-B6AKlsl_.js +1 -0
- package/dist/chunks/trustedDevice-DL0pWP4_.js +1 -0
- package/dist/chunks/{types-3j8PS-Du.js → types-DafcFtmb.js} +2 -2
- package/dist/chunks/udsClient-CWnfsgFP.js +1 -0
- package/dist/chunks/{updateCCB-BPe9_FW6.js → updateCCB-C6XftzIG.js} +6 -6
- package/dist/chunks/{upstreamproxy-DF00RzGG.js → upstreamproxy-CXmjxHpl.js} +2 -2
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-ChqBs9Lr.js → useExitOnCtrlCDWithKeybindings-DEEJhm_W.js} +1 -1
- package/dist/chunks/useMainLoopModel-6w7mhwhU.js +1 -0
- package/dist/chunks/useManagePlugins-CjnsO-Of.js +1 -0
- package/dist/chunks/{useMergedTools-Dk5cPqLc.js → useMergedTools-DbhqKk1-.js} +1 -1
- package/dist/chunks/{useSearchInput-C7Y1I9P9.js → useSearchInput-gUDbkLaC.js} +1 -1
- package/dist/chunks/{useSettingsErrors-DAEO7AyB.js → useSettingsErrors-CgPad-H0.js} +1 -1
- package/dist/chunks/{userAgent-CIq27vUR.js → userAgent-CU7Ndh79.js} +1 -1
- package/dist/chunks/util-B4oMhJKh.js +1 -0
- package/dist/chunks/validatePlugin-y_O_tCEL.js +1 -0
- package/dist/chunks/{vim-EYQn94Kx.js → vim-w37BfGZ5.js} +1 -1
- package/dist/chunks/{which-DzFN5TNM.js → which-BRWBO7Gu.js} +1 -1
- package/dist/chunks/windowsPaths-BY-IVNwQ.js +1 -0
- package/dist/chunks/windowsPaths-DtWHLjmE.js +1 -0
- package/dist/chunks/{workSecret-DUqdPy44.js → workSecret-BEhXgH2M.js} +1 -1
- package/dist/chunks/{workerRegistry-C07BcZIw.js → workerRegistry-Bq9bS5pw.js} +5 -5
- package/dist/chunks/worktree-4SUJ4dtz.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +2 -3
- package/dist/chunks/App-C2yQjBgY.js +0 -1
- package/dist/chunks/ApproveApiKey-CKbv5C1x.js +0 -1
- package/dist/chunks/ApproveApiKey-MscC-ssL.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-CL5NWsFL.js +0 -2
- package/dist/chunks/ClaudeMdExternalIncludesDialog-C0-psohX.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-4mOvEer_.js +0 -1
- package/dist/chunks/Doctor-DmgAwce2.js +0 -1
- package/dist/chunks/Doctor-jEs9chPk.js +0 -3
- package/dist/chunks/ExitFlow-DVKxFdpX.js +0 -2
- package/dist/chunks/InvalidConfigDialog-o9DF1REI.js +0 -1
- package/dist/chunks/MCPConnectionManager-CUTuaa8T.js +0 -1
- package/dist/chunks/MCPToolListView-CvqB4nCw.js +0 -1
- package/dist/chunks/MessageSelector-BLzw172f.js +0 -3
- package/dist/chunks/Messages-4K5sLmNh.js +0 -11
- package/dist/chunks/QueryEngine-DPHLSsax.js +0 -1
- package/dist/chunks/REPL-Bf46iQCN.js +0 -1
- package/dist/chunks/REPL-DIaAo9M9.js +0 -133
- package/dist/chunks/ResumeConversation-Br2KsBoe.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-i_YO3QvV.js +0 -1
- package/dist/chunks/Settings-BMXysXIx.js +0 -2
- package/dist/chunks/TeleportRepoMismatchDialog-B5I73j7Y.js +0 -1
- package/dist/chunks/add-dir-CZ6Clvq8.js +0 -1
- package/dist/chunks/agents-DHnNg4h6.js +0 -103
- package/dist/chunks/allErrors-CU89tF-z.js +0 -1
- package/dist/chunks/api-BSeE6MwB.js +0 -1
- package/dist/chunks/auth-BIGJth5U.js +0 -1
- package/dist/chunks/auth-CDQMhIZP.js +0 -1
- package/dist/chunks/autonomyPanel-DnHpuiy4.js +0 -1
- package/dist/chunks/backgroundHousekeeping-B-cw0UcS.js +0 -17
- package/dist/chunks/backgroundHousekeeping-BS_8z3_x.js +0 -1
- package/dist/chunks/bg-50rllUNh.js +0 -1
- package/dist/chunks/bridgeConfig-BeqChxJC.js +0 -1
- package/dist/chunks/btw-DSK9R2C8.js +0 -1
- package/dist/chunks/caches-BTQAW9zc.js +0 -1
- package/dist/chunks/caches-BVtSCnV1.js +0 -1
- package/dist/chunks/ccrClient-Bu7Tf1Z5.js +0 -1
- package/dist/chunks/client-BWQ4-rN7.js +0 -1
- package/dist/chunks/client-c-3-PW1F.js +0 -1
- package/dist/chunks/commands-Bi7k3Wg-.js +0 -1
- package/dist/chunks/compact-J-h0Yf4b.js +0 -2
- package/dist/chunks/config-yyFe87vW.js +0 -1
- package/dist/chunks/context-Tb1Ca2Q-.js +0 -1
- package/dist/chunks/context-noninteractive-soPYKAc9.js +0 -1
- package/dist/chunks/conversation-CSEtUxOY.js +0 -1
- package/dist/chunks/conversation-Dk1WDQuN.js +0 -1
- package/dist/chunks/createSession-DkT1GL8y.js +0 -1
- package/dist/chunks/createSession-eE8mswkv.js +0 -1
- package/dist/chunks/crossProjectResume-04n3Ppy9.js +0 -40
- package/dist/chunks/debug-RAynG_nM.js +0 -39
- package/dist/chunks/detectRepository-DgpNd87p.js +0 -1
- package/dist/chunks/detectRepository-ctF9KDbb.js +0 -1
- package/dist/chunks/doctor-B-Wag4C1.js +0 -1
- package/dist/chunks/execSyncWrapper-BTZJjCuv.js +0 -1
- package/dist/chunks/exit-BtW7LfRX.js +0 -1
- package/dist/chunks/extractMemories-CUrdiNcr.js +0 -1
- package/dist/chunks/fast-C60p6AqJ.js +0 -1
- package/dist/chunks/firstPartyEventLogger-BfCYN7lt.js +0 -1
- package/dist/chunks/gemini-BwvSxGgn.js +0 -1
- package/dist/chunks/generateSessionName-DlrdedOk.js +0 -1
- package/dist/chunks/git-2c7WlGDL.js +0 -6
- package/dist/chunks/git-XtKbtJMc.js +0 -1
- package/dist/chunks/githubRepoPathMapping-DbWG4hFQ.js +0 -1
- package/dist/chunks/hooks-DWg07LmS.js +0 -1
- package/dist/chunks/jwtUtils-CUPXdX3W.js +0 -1
- package/dist/chunks/keybindings-DgIPdBy9.js +0 -2
- package/dist/chunks/loadAgentsDir-zikjxLvn.js +0 -1
- package/dist/chunks/loadPluginHooks-Cp8MSwAc.js +0 -1
- package/dist/chunks/localSearch-ZFyFy5FN.js +0 -1
- package/dist/chunks/main-9r5gLzUW.js +0 -605
- package/dist/chunks/managedEnv-B61yLpwp.js +0 -1
- package/dist/chunks/mcp-BckPBjaM.js +0 -6
- package/dist/chunks/mcp-CS1DA3JL.js +0 -1
- package/dist/chunks/memory-C5ohwh-T.js +0 -1
- package/dist/chunks/model-BGu1AGq0.js +0 -1
- package/dist/chunks/model-D19IIcll.js +0 -1
- package/dist/chunks/nativeInstaller-QB8cEJ18.js +0 -1
- package/dist/chunks/omit-DDUIPHnl.js +0 -1
- package/dist/chunks/onChangeAppState-RBl6H7ho.js +0 -1
- package/dist/chunks/panel-KW-wmEvU.js +0 -1
- package/dist/chunks/parser-xSBaQRLH.js +0 -1
- package/dist/chunks/permissions-BoLXYN1j.js +0 -3
- package/dist/chunks/pidLock-nJHbufJN.js +0 -3
- package/dist/chunks/plugin-C6-GQke5.js +0 -17
- package/dist/chunks/pluginAutoupdate-SlRFJlTT.js +0 -1
- package/dist/chunks/pluginBlocklist-n6Imlh3y.js +0 -1
- package/dist/chunks/pluginCliCommands-Bd96zSOQ.js +0 -1
- package/dist/chunks/pluginFlagging-DZaYzecY.js +0 -1
- package/dist/chunks/pluginOperations-D90IRawu.js +0 -2
- package/dist/chunks/pluginStartupCheck-Bxkxpm4k.js +0 -1
- package/dist/chunks/pluginStartupCheck-CB2q2dLv.js +0 -1
- package/dist/chunks/plugins-B9eSjLSA.js +0 -4
- package/dist/chunks/poorMode-BAnubpn1.js +0 -1
- package/dist/chunks/processBashCommand-B5F2Cl7K.js +0 -1
- package/dist/chunks/processSlashCommand-BC_D3cH5.js +0 -5
- package/dist/chunks/prompt-C1JPqinc.js +0 -1
- package/dist/chunks/prompt-DZhBz_Vu.js +0 -1
- package/dist/chunks/reconciler-B4GDm_iC.js +0 -1
- package/dist/chunks/refresh-DBVizOzg.js +0 -1
- package/dist/chunks/remoteManagedSettings-xh_MViZH.js +0 -1
- package/dist/chunks/resume-DVCSzKvv.js +0 -2
- package/dist/chunks/ripgrep-e-iewvTf.js +0 -1
- package/dist/chunks/sandbox-adapter-BFZFHplu.js +0 -1
- package/dist/chunks/searchExtraTools-ui5y2VSE.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-CZvCqQJ6.js +0 -1
- package/dist/chunks/sessionObserver-Ba7um95p.js +0 -1
- package/dist/chunks/sessionStorage-CedwLLQs.js +0 -1
- package/dist/chunks/settings-DkDH7WQT.js +0 -1
- package/dist/chunks/settings-DnptdP79.js +0 -20
- package/dist/chunks/settingsSync-PmU7SmkU.js +0 -1
- package/dist/chunks/setup-BEsBuzsk.js +0 -3
- package/dist/chunks/sinks-BJHgxz6Y.js +0 -1
- package/dist/chunks/sinks-D5-yhcgU.js +0 -2
- package/dist/chunks/skillChangeDetector-Dd0WPdkO.js +0 -1
- package/dist/chunks/skillSearchPanel-CftorvAM.js +0 -21
- package/dist/chunks/startupProfiler-D4FBdEQr.js +0 -1
- package/dist/chunks/status-Dzuw3hBv.js +0 -2
- package/dist/chunks/switcher-4KzBvuKH.js +0 -1
- package/dist/chunks/syncCache-CBRiRU5x.js +0 -1
- package/dist/chunks/teleport-Bw0jSxe9.js +0 -1
- package/dist/chunks/toolPool-CkXFlqsn.js +0 -1
- package/dist/chunks/trustedDevice-CFf5yaG-.js +0 -1
- package/dist/chunks/trustedDevice-CuwSv8dG.js +0 -1
- package/dist/chunks/udsClient-e9dIkwVA.js +0 -1
- package/dist/chunks/useMainLoopModel-2-eujv0n.js +0 -1
- package/dist/chunks/useManagePlugins-CYBIkaB1.js +0 -1
- package/dist/chunks/util-VO98TdOz.js +0 -1
- package/dist/chunks/validatePlugin-Kk6pxnO2.js +0 -1
- package/dist/chunks/windowsPaths-BU3yQWTB.js +0 -1
- package/dist/chunks/windowsPaths-DgZ3YY4a.js +0 -1
- package/dist/chunks/worktree-dFUkhVE_.js +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{B as i,Ba as a,FT as o,G as s,GC as c,H as l,RT as u,Sg as d,V as f,W as p,ZC as ee,__ as te,ba as m,dd as ne,ed as h,fh as g,g_ as _,p_ as re,ph as ie,td as v,ud as y,wg as ae,xg as b,z as oe}from"./loadAgentsDir-BL93ulMm.js";import{I as x,P as S,Wt as se,Xn as ce,a as C,di as w,fi as T,hn as E,k as D,kt as O,n as k,o as A,ot as le,r as ue,s as de,t as j,ui as M,x as fe,y as N}from"./src-P_wYS_NJ2.js";import{t as P}from"./jsx-runtime-Bb4Xn-E0.js";import{Wt as pe,et as F}from"./state-BemZdQIl.js";import{C as I,x as me}from"./debug-BecbSVoN.js";import{H as L,V as R,g as he,ln as z,o as B,rn as V,z as H}from"./settings-D4CpDv2y.js";import{l as ge,o as _e}from"./stringUtils-C8PaYpQF.js";import{n as ve,t as ye}from"./useExitOnCtrlCDWithKeybindings-DEEJhm_W.js";import{n as be,t as xe}from"./AddWorkspaceDirectory-ag2JTpmU.js";import{t as Se}from"./SearchBox-C9vUA4IM.js";import{n as Ce,t as we}from"./useSearchInput-gUDbkLaC.js";import{n as Te,t as Ee}from"./shadowedRuleDetection-BzAZ57p2.js";import{n as U,t as De}from"./autoModeDenials-BxNzGJdR.js";function Oe({ruleValue:e}){switch(e.toolName){case g.name:return e.ruleContent?e.ruleContent.endsWith(`:*`)?(0,W.jsxs)(S,{dimColor:!0,children:[`Any Bash command starting with `,(0,W.jsx)(S,{bold:!0,children:e.ruleContent.slice(0,-2)})]}):(0,W.jsxs)(S,{dimColor:!0,children:[`The Bash command `,(0,W.jsx)(S,{bold:!0,children:e.ruleContent})]}):(0,W.jsx)(S,{dimColor:!0,children:`Any Bash command`});default:return e.ruleContent?null:(0,W.jsxs)(S,{dimColor:!0,children:[`Any use of the `,(0,W.jsx)(S,{bold:!0,children:e.toolName}),` tool`]})}}var W,ke=e((()=>{T(),j(),ie(),W=P()}));function Ae(e){switch(e){case`localSettings`:return{label:`Project settings (local)`,description:`Saved in ${B(`localSettings`)}`,value:e};case`projectSettings`:return{label:`Project settings`,description:`Checked in at ${B(`projectSettings`)}`,value:e};case`userSettings`:return{label:`User settings`,description:`Saved in at ~/.claude/settings.json`,value:e}}}function je({onAddRules:e,onCancel:t,ruleValues:n,ruleBehavior:r,initialContext:i,setToolPermissionContext:a}){let s=V.map(Ae),c=(0,Me.useCallback)(s=>{if(s===`cancel`){t();return}else if(V.includes(s)){let t=s,c=re(i,{type:`addRules`,rules:n,behavior:r,destination:t});te({type:`addRules`,rules:n,behavior:r,destination:t}),a(c);let l=n.map(e=>({ruleValue:e,ruleBehavior:r,source:t})),u=Ee(c,{sandboxAutoAllowEnabled:o.isSandboxingEnabled()&&o.isAutoAllowBashIfSandboxedEnabled()}).filter(e=>n.some(t=>t.toolName===e.rule.ruleValue.toolName&&t.ruleContent===e.rule.ruleValue.ruleContent));e(l,u.length>0?u:void 0)}},[e,t,n,r,i,a]);return(0,G.jsxs)(N,{title:`Add ${r} permission ${ge(n.length,`rule`)}`,onCancel:t,color:`permission`,children:[(0,G.jsx)(x,{flexDirection:`column`,paddingX:2,children:n.map(e=>(0,G.jsxs)(x,{flexDirection:`column`,children:[(0,G.jsx)(S,{bold:!0,children:L(e)}),(0,G.jsx)(Oe,{ruleValue:e})]},L(e)))}),(0,G.jsxs)(x,{flexDirection:`column`,marginY:1,children:[(0,G.jsx)(S,{children:n.length===1?`Where should this rule be saved?`:`Where should these rules be saved?`}),(0,G.jsx)(h,{options:s,onChange:c})]})]})}var Me,G,Ne=e((()=>{T(),Me=t(T(),1),v(),j(),_(),H(),Te(),u(),z(),he(),_e(),ke(),G=P()}));function Pe({onCancel:e,onSubmit:t,ruleBehavior:n}){let[i,a]=(0,Fe.useState)(``),[o,s]=(0,Fe.useState)(0),c=ve();se(`confirm:no`,e,{context:`Settings`});let{columns:l}=le(),u=l-6;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(x,{flexDirection:`column`,gap:1,borderStyle:`round`,paddingLeft:1,paddingRight:1,borderColor:`permission`,children:[(0,K.jsxs)(S,{bold:!0,color:`permission`,children:[`Add `,n,` permission rule`]}),(0,K.jsxs)(x,{flexDirection:`column`,children:[(0,K.jsxs)(S,{children:[`Permission rules are a tool name, optionally followed by a specifier in parentheses.`,(0,K.jsx)(O,{}),`e.g., `,(0,K.jsx)(S,{bold:!0,children:L({toolName:g.name})}),(0,K.jsx)(S,{bold:!1,children:` or `}),(0,K.jsx)(S,{bold:!0,children:L({toolName:g.name,ruleContent:`ls:*`})})]}),(0,K.jsx)(x,{borderDimColor:!0,borderStyle:`round`,marginY:1,paddingLeft:1,children:(0,K.jsx)(y,{showCursor:!0,value:i,onChange:a,onSubmit:e=>{let r=e.trim();r.length!==0&&t(R(r),n)},placeholder:`Enter permission rule${r.ellipsis}`,columns:u,cursorOffset:o,onChangeCursorOffset:s})})]})]}),(0,K.jsx)(x,{marginLeft:3,children:c.pending?(0,K.jsxs)(S,{dimColor:!0,children:[`Press `,c.keyName,` again to exit`]}):(0,K.jsx)(S,{dimColor:!0,children:`Enter to submit · Esc to cancel`})})]})}var Fe,K,Ie=e((()=>{n(),T(),Fe=t(T(),1),ne(),ye(),ee(),j(),c(),ie(),H(),K=P()}));function Le({onHeaderFocusChange:e,onStateChange:t}){let{headerFocused:n,focusHeader:r}=C();(0,q.useEffect)(()=>{e?.(n)},[n,e]);let[i]=(0,q.useState)(()=>De()),[a,o]=(0,q.useState)(()=>new Set),[s,c]=(0,q.useState)(()=>new Set),[l,u]=(0,q.useState)(0);(0,q.useEffect)(()=>{t({approved:a,retry:s,denials:i})},[a,s,i,t]);let d=(0,q.useCallback)(e=>{let t=Number(e);o(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},[]),f=(0,q.useCallback)(e=>{u(Number(e))},[]);if(E((e,t)=>{e===`r`&&(c(e=>{let t=new Set(e);return t.has(l)?t.delete(l):t.add(l),t}),o(e=>{if(e.has(l))return e;let t=new Set(e);return t.add(l),t}))},{isActive:i.length>0}),i.length===0)return(0,J.jsx)(S,{dimColor:!0,children:`No recent denials. Commands denied by the auto mode classifier will appear here.`});let p=i.map((e,t)=>{let n=a.has(t),r=s.has(t)?` (retry)`:``;return{label:(0,J.jsxs)(S,{children:[(0,J.jsx)(de,{status:n?`success`:`error`,withSpace:!0}),e.display,(0,J.jsx)(S,{dimColor:!0,children:r})]}),value:String(t)}});return(0,J.jsxs)(x,{flexDirection:`column`,children:[(0,J.jsx)(S,{children:`Commands recently denied by the auto mode classifier.`}),(0,J.jsx)(x,{marginTop:1,children:(0,J.jsx)(h,{options:p,onChange:d,onFocus:f,visibleOptionCount:Math.min(10,p.length),isDisabled:n,onUpFromFirstItem:r})})]})}var q,J,Re=e((()=>{T(),q=t(T(),1),j(),U(),v(),J=P()}));function ze({directoryPath:e,onRemove:t,onCancel:n,permissionContext:r,setPermissionContext:i}){let a=(0,Be.useCallback)(()=>{i(re(r,{type:`removeDirectories`,directories:[e],destination:`session`})),t()},[e,r,i,t]),o=(0,Be.useCallback)(e=>{e===`yes`?a():n()},[a,n]);return(0,Y.jsxs)(N,{title:`Remove directory from workspace?`,onCancel:n,color:`error`,children:[(0,Y.jsx)(x,{marginX:2,flexDirection:`column`,children:(0,Y.jsx)(S,{bold:!0,children:e})}),(0,Y.jsx)(S,{children:`Claude Code will no longer have access to files in this directory.`}),(0,Y.jsx)(h,{onChange:o,onCancel:n,options:[{label:`Yes`,value:`yes`},{label:`No`,value:`no`}]})]})}var Be,Y,Ve=e((()=>{T(),Be=t(T(),1),v(),j(),_(),Y=P()}));function He({onExit:e,toolPermissionContext:t,onRequestAddDirectory:n,onRequestRemoveDirectory:i,onHeaderFocusChange:a}){let{headerFocused:o,focusHeader:s}=C();(0,X.useEffect)(()=>{a?.(o)},[o,a]);let c=Ue.useMemo(()=>Array.from(t.additionalWorkingDirectories.keys()).map(e=>({path:e,isCurrent:!1,isDeletable:!0})),[t.additionalWorkingDirectories]),l=(0,X.useCallback)(e=>{if(e===`add-directory`){n();return}let t=c.find(t=>t.path===e);t&&t.isDeletable&&i(t.path)},[c,n,i]),u=(0,X.useCallback)(()=>e(`Workspace dialog dismissed`,{display:`system`}),[e]),d=Ue.useMemo(()=>{let e=c.map(e=>({label:e.path,value:e.path}));return e.push({label:`Add directory${r.ellipsis}`,value:`add-directory`}),e},[c]);return(0,Z.jsxs)(x,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsxs)(x,{flexDirection:`row`,marginTop:1,marginLeft:2,gap:1,children:[(0,Z.jsx)(S,{children:`- ${F()}`}),(0,Z.jsx)(S,{dimColor:!0,children:`(Original working directory)`})]}),(0,Z.jsx)(h,{options:d,onChange:l,onCancel:u,visibleOptionCount:Math.min(10,d.length),onUpFromFirstItem:s,isDisabled:o})]})}var Ue,X,Z,We=e((()=>{n(),Ue=t(T(),1),X=t(T(),1),pe(),v(),j(),Z=P()}));function Ge({rule:e}){return(0,$.jsx)(S,{dimColor:!0,children:`From ${s(e.source)}`})}function Ke(e){switch(e){case`allow`:return`allowed`;case`deny`:return`denied`;case`ask`:return`ask`}}function qe({rule:e,onDelete:t,onCancel:n}){let r=ve();se(`confirm:no`,n,{context:`Confirmation`});let i=(0,$.jsxs)(x,{flexDirection:`column`,marginX:2,children:[(0,$.jsx)(S,{bold:!0,children:L(e.ruleValue)}),(0,$.jsx)(Oe,{ruleValue:e.ruleValue}),(0,$.jsx)(Ge,{rule:e})]}),a=(0,$.jsx)(x,{marginLeft:3,children:r.pending?(0,$.jsxs)(S,{dimColor:!0,children:[`Press `,r.keyName,` again to exit`]}):(0,$.jsx)(S,{dimColor:!0,children:`Esc to cancel`})});return e.source===`policySettings`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(x,{flexDirection:`column`,gap:1,borderStyle:`round`,paddingLeft:1,paddingRight:1,borderColor:`permission`,children:[(0,$.jsx)(S,{bold:!0,color:`permission`,children:`Rule details`}),i,(0,$.jsxs)(S,{italic:!0,children:[`This rule is configured by managed settings and cannot be modified.`,`
|
|
2
|
+
`,`Contact your system administrator for more information.`]})]}),a]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(x,{flexDirection:`column`,gap:1,borderStyle:`round`,paddingLeft:1,paddingRight:1,borderColor:`error`,children:[(0,$.jsxs)(S,{bold:!0,color:`error`,children:[`Delete `,Ke(e.ruleBehavior),` tool?`]}),i,(0,$.jsx)(S,{children:`Are you sure you want to delete this permission rule?`}),(0,$.jsx)(h,{onChange:e=>e===`yes`?t():n(),onCancel:n,options:[{label:`Yes`,value:`yes`},{label:`No`,value:`no`}]})]}),a]})}function Je(e){let{options:t,searchQuery:n,isSearchMode:r,isFocused:i,onSelect:a,onCancel:o,lastFocusedRuleKey:s,cursorOffset:c,onHeaderFocusChange:l}=e,u=A(),{headerFocused:d,focusHeader:f,blurHeader:p}=C();return(0,Q.useEffect)(()=>{r&&d&&p()},[r,d,p]),(0,Q.useEffect)(()=>{l?.(d)},[d,l]),(0,$.jsxs)(x,{flexDirection:`column`,children:[(0,$.jsx)(x,{marginBottom:1,flexDirection:`column`,children:(0,$.jsx)(D,{query:n,isFocused:r&&!d,isTerminalFocused:i,width:u,cursorOffset:c})}),(0,$.jsx)(h,{options:t,onChange:a,onCancel:o,visibleOptionCount:Math.min(10,t.length),isDisabled:r||d,defaultFocusValue:s,onUpFromFirstItem:f})]})}function Ye({tab:e,getRulesOptions:t,handleToolSelect:n,...r}){return(0,$.jsxs)(x,{flexDirection:`column`,flexShrink:e===`allow`?0:void 0,children:[(0,$.jsx)(S,{children:{allow:`Claude Code won't ask before using allowed tools.`,ask:`Claude Code will always ask for confirmation before using these tools.`,deny:`Claude Code will always reject requests to use denied tools.`}[e]}),(0,$.jsx)(Je,{options:t(e,r.searchQuery).options,onSelect:t=>n(t,e),...r})]})}function Xe({onExit:e,initialTab:t,onRetryDenials:n}){let a=De().length>0,o=t??(a?`recent`:`allow`),[s,c]=(0,Q.useState)([]),u=d(e=>e.toolPermissionContext),p=ae(),ee=ce(),m=(0,Q.useRef)({approved:new Set,retry:new Set,denials:[]}),ne=(0,Q.useCallback)(e=>{m.current=e},[]),[h,g]=(0,Q.useState)(),[_,ie]=(0,Q.useState)(),[v,y]=(0,Q.useState)(null),[b,C]=(0,Q.useState)(null),[w,T]=(0,Q.useState)(!1),[E,D]=(0,Q.useState)(null),[O,A]=(0,Q.useState)(!1),[le,de]=(0,Q.useState)(!0),j=(0,Q.useCallback)(e=>{de(e)},[]),N=(0,Q.useMemo)(()=>{let e=new Map;return i(u).forEach(t=>{e.set(I(t),t)}),e},[u]),P=(0,Q.useMemo)(()=>{let e=new Map;return l(u).forEach(t=>{e.set(I(t),t)}),e},[u]),pe=(0,Q.useMemo)(()=>{let e=new Map;return f(u).forEach(t=>{e.set(I(t),t)}),e},[u]),F=(0,Q.useCallback)((e,t=``)=>{let n=(()=>{switch(e){case`allow`:return N;case`deny`:return P;case`ask`:return pe;case`workspace`:case`recent`:return new Map}})(),i=[];e!==`workspace`&&e!==`recent`&&!t&&i.push({label:`Add a new rule${r.ellipsis}`,value:`add-new-rule`});let a=Array.from(n.keys()).sort((e,t)=>{let r=n.get(e),i=n.get(t);if(r&&i){let e=L(r.ruleValue).toLowerCase(),t=L(i.ruleValue).toLowerCase();return e.localeCompare(t)}return 0}),o=t.toLowerCase();for(let e of a){let r=n.get(e);if(r){let n=L(r.ruleValue);if(t&&!n.toLowerCase().includes(o))continue;i.push({label:n,value:e})}}return{options:i,rulesByKey:n}},[N,P,pe]),me=ve(),R=!h&&!v&&!b&&!w&&!E,{query:he,setQuery:z,cursorOffset:B}=Ce({isActive:R&&O,onExit:()=>{A(!1)}}),V=(0,Q.useCallback)(e=>{R&&(O||e.ctrl||e.meta||(e.key===`/`?(e.preventDefault(),A(!0),z(``)):e.key.length===1&&e.key!==`j`&&e.key!==`k`&&e.key!==`m`&&e.key!==`i`&&e.key!==`r`&&e.key!==` `&&(e.preventDefault(),A(!0),z(e.key))))},[R,O,z]),H=(0,Q.useCallback)((e,t)=>{let{rulesByKey:n}=F(t);if(e===`add-new-rule`){y(t);return}else{g(n.get(e));return}},[F]),ge=(0,Q.useCallback)(()=>{y(null)},[]),_e=(0,Q.useCallback)((e,t)=>{C({ruleValue:e,ruleBehavior:t}),y(null)},[]),ye=(0,Q.useCallback)((e,t)=>{C(null);for(let t of e)c(e=>[...e,`Added ${t.ruleBehavior} rule ${M.bold(L(t.ruleValue))}`]);if(t&&t.length>0)for(let e of t){let t=e.shadowType===`deny`?`blocked`:`shadowed`;c(n=>[...n,M.yellow(`${r.warning} Warning: ${L(e.rule.ruleValue)} is ${t}`),M.dim(` ${e.reason}`),M.dim(` Fix: ${e.fix}`)])}},[]),be=(0,Q.useCallback)(()=>{C(null)},[]),Se=(0,Q.useCallback)(()=>T(!0),[]),we=(0,Q.useCallback)(e=>D(e),[]),Te=(0,Q.useCallback)(()=>{let t=m.current,r=e=>Array.from(e).map(e=>t.denials[e]).filter(e=>e!==void 0),i=r(t.retry);if(i.length>0){let t=i.map(e=>e.display);n?.(t),e(void 0,{shouldQuery:!0,metaMessages:[`Permission granted for: ${t.join(`, `)}. You may now retry ${t.length===1?`this command`:`these commands`} if you would like.`]});return}let a=r(t.approved);a.length>0||s.length>0?e([...a.length>0?[`Approved ${a.map(e=>M.bold(e.display)).join(`, `)}`]:[],...s].join(`
|
|
3
|
+
`)):e(`Permissions dialog dismissed`,{display:`system`})},[s,e,n]);se(`confirm:no`,Te,{context:`Settings`,isActive:R&&!O});let Ee=()=>{if(!h)return;let{options:e}=F(h.ruleBehavior),t=I(h),n=e.filter(e=>e.value!==`add-new-rule`).map(e=>e.value),r=n.indexOf(t),i;r!==-1&&(r<n.length-1?i=n[r+1]:r>0&&(i=n[r-1])),ie(i),oe({rule:h,initialContext:u,setToolPermissionContext(e){p(t=>({...t,toolPermissionContext:e}))}}),c(e=>[...e,`Deleted ${h.ruleBehavior} rule ${M.bold(L(h.ruleValue))}`]),g(void 0)};if(h)return(0,$.jsx)(qe,{rule:h,onDelete:Ee,onCancel:()=>g(void 0)});if(v&&v!==`workspace`&&v!==`recent`)return(0,$.jsx)(Pe,{onCancel:ge,onSubmit:_e,ruleBehavior:v});if(b)return(0,$.jsx)(je,{onAddRules:ye,onCancel:be,ruleValues:[b.ruleValue],ruleBehavior:b.ruleBehavior,initialContext:u,setToolPermissionContext:e=>{p(t=>({...t,toolPermissionContext:e}))}});if(w)return(0,$.jsx)(xe,{onAddDirectory:(e,t)=>{let n={type:`addDirectories`,directories:[e],destination:t?`localSettings`:`session`},r=re(u,n);p(e=>({...e,toolPermissionContext:r})),t&&te(n),c(n=>[...n,`Added directory ${M.bold(e)} to workspace${t?` and saved to local settings`:` for this session`}`]),T(!1)},onCancel:()=>T(!1),permissionContext:u});if(E)return(0,$.jsx)(ze,{directoryPath:E,onRemove:()=>{c(e=>[...e,`Removed directory ${M.bold(E)} from workspace`]),D(null)},onCancel:()=>D(null),permissionContext:u,setPermissionContext:e=>{p(t=>({...t,toolPermissionContext:e}))}});let U={searchQuery:he,isSearchMode:O,isFocused:ee,onCancel:Te,lastFocusedRuleKey:_,cursorOffset:B,getRulesOptions:F,handleToolSelect:H,onHeaderFocusChange:j};return(0,$.jsx)(x,{flexDirection:`column`,onKeyDown:V,children:(0,$.jsxs)(fe,{color:`permission`,children:[(0,$.jsxs)(ue,{title:`Permissions:`,color:`permission`,defaultTab:o,hidden:!!h||!!v||!!b||w||!!E,initialHeaderFocused:!a,navFromContent:!O,children:[(0,$.jsx)(k,{id:`recent`,title:`Recently denied`,children:(0,$.jsx)(Le,{onHeaderFocusChange:j,onStateChange:ne})}),(0,$.jsx)(k,{id:`allow`,title:`Allow`,children:(0,$.jsx)(Ye,{tab:`allow`,...U})}),(0,$.jsx)(k,{id:`ask`,title:`Ask`,children:(0,$.jsx)(Ye,{tab:`ask`,...U})}),(0,$.jsx)(k,{id:`deny`,title:`Deny`,children:(0,$.jsx)(Ye,{tab:`deny`,...U})}),(0,$.jsx)(k,{id:`workspace`,title:`Workspace`,children:(0,$.jsxs)(x,{flexDirection:`column`,children:[(0,$.jsx)(S,{children:`Work Mate can read files in the workspace, and make edits when auto-accept edits is on.`}),(0,$.jsx)(He,{onExit:e,toolPermissionContext:u,onRequestAddDirectory:Se,onRequestRemoveDirectory:we,onHeaderFocusChange:j})]})})]}),(0,$.jsx)(x,{marginTop:1,paddingLeft:1,children:(0,$.jsx)(S,{dimColor:!0,children:me.pending?(0,$.jsxs)($.Fragment,{children:[`Press `,me.keyName,` again to exit`]}):le?(0,$.jsx)($.Fragment,{children:`←/→ tab switch · ↓ return · Esc cancel`}):O?(0,$.jsx)($.Fragment,{children:`Type to filter · Enter/↓ select · ↑ tabs · Esc clear`}):a&&o===`recent`?(0,$.jsx)($.Fragment,{children:`Enter approve · r retry · ↑↓ navigate · ←/→ switch · Esc cancel`}):(0,$.jsx)($.Fragment,{children:`↑↓ navigate · Enter select · Type to search · ←/→ switch · Esc cancel`})})})]})})}var Q,$,Ze=e((()=>{w(),n(),T(),Q=t(T(),1),b(),_(),v(),ye(),we(),j(),c(),U(),H(),p(),me(),Se(),Ne(),be(),ke(),Ie(),Re(),Ve(),We(),$=P()})),Qe,$e;e((()=>{Ze(),a(),Qe=P(),$e=async(e,t)=>(0,Qe.jsx)(Xe,{onExit:e,onRetryDenials:e=>{t.setMessages(t=>[...t,m(e)])}})}))();export{$e as call};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{c as r,l as i,n as a,o}from"./envUtils-BDhHQY0-.js";import{n as s,t as c}from"./axios-DaWTGg7G.js";import{FT as l,RT as ee,tf as te}from"./loadAgentsDir-BL93ulMm.js";import{n as ne}from"./cwd-Cfdf7z7s.js";import{B as re,C as ie,D as ae,R as u,S as d,T as oe,U as se,V as ce,c as f,f as p,i as m,u as h,x as g}from"./debug-BecbSVoN.js";import{Kt as le,M as _,P as ue,Qt as de,Xt as fe,Yt as pe,g as me,n as he}from"./settings-D4CpDv2y.js";import{a as ge,c as v,h as y,i as _e}from"./config-aRiTrtCv.js";import{c as ve,n as b,o as ye,r as x,t as S}from"./execFileNoThrow-DHyW8FMX.js";import{o as C,s as w}from"./log-Dauqle-Z.js";import{n as be,t as xe}from"./which-BRWBO7Gu.js";import{i as T,o as E}from"./platform-B0uTQc9P.js";import{n as D,t as Se}from"./bundledMode--fG1S62b.js";import{dt as Ce,ut as we}from"./sessionState-D-SaBzWD.js";import{a as Te,i as Ee}from"./ripgrep-C1ydIMzT.js";import{i as De,r as Oe}from"./genericProcessUtils-B2HcDYhg.js";import{homedir as O}from"os";import{basename as ke,delimiter as Ae,join as k,posix as A,win32 as j}from"path";import{constants as je}from"fs";import{access as M,open as Me,readFile as N,realpath as P,stat as Ne}from"fs/promises";function F(){return k(a(),`local`)}function Pe(){return k(F(),`claude`)}function Fe(){return(process.argv[1]||``).includes(`/.claude/local/node_modules/`)}async function I(){try{return await M(k(F(),`node_modules`,`.bin`,`claude`)),!0}catch{return!1}}function L(){let e=process.env.SHELL||``;return e.includes(`zsh`)?`zsh`:e.includes(`bash`)?`bash`:e.includes(`fish`)?`fish`:`unknown`}var R=e((()=>{y(),o(),u(),x(),p(),C(),g()}));function z(e){let t=e?.homedir??O();return{zsh:k((e?.env??process.env).ZDOTDIR||t,`.zshrc`),bash:k(t,`.bashrc`),fish:k(t,`.config/fish/config.fish`)}}function Ie(e){let t=!1;return{filtered:e.filter(e=>{if(V.test(e)){let n=e.match(/alias\s+claude\s*=\s*["']([^"']+)["']/);if(n||(n=e.match(/alias\s+claude\s*=\s*([^#\n]+)/)),n&&n[1]&&n[1].trim()===Pe())return t=!0,!1}return!0}),hadAlias:t}}async function B(e){try{return(await N(e,{encoding:`utf8`})).split(`
|
|
2
|
+
`)}catch(e){if(ce(e))return null;throw e}}async function Le(e,t){let n=await Me(e,`w`);try{await n.writeFile(t.join(`
|
|
3
|
+
`),{encoding:`utf8`}),await n.datasync()}finally{await n.close()}}async function Re(e){let t=z(e);for(let e of Object.values(t)){let t=await B(e);if(t){for(let e of t)if(V.test(e)){let t=e.match(/alias\s+claude=["']?([^"'\s]+)/);if(t&&t[1])return t[1]}}}return null}async function ze(e){let t=await Re(e);if(!t)return null;let n=e?.homedir??O(),r=t.startsWith(`~`)?t.replace(`~`,n):t;try{let e=await Ne(r);if(e.isFile()||e.isSymbolicLink())return t}catch{}return null}var V,H=e((()=>{u(),R(),V=/^\s*alias\s+claude\s*=/}));async function Be(){}function Ve(e){let t=he()?.minimumVersion;if(!t)return!1;let n=!we(e,t);return n&&f(`Skipping update to ${e} - below minimumVersion ${t}`),n}async function He(){let e=le.isRunningWithBun(),t=null;return t=e?await b(`bun`,[`pm`,`bin`,`-g`],{cwd:O()}):await b(`npm`,[`-g`,`config`,`get`,`prefix`],{cwd:O()}),t.code===0?t.stdout.trim():(w(Error(`Failed to check ${e?`bun`:`npm`} permissions`)),null)}async function Ue(){try{let e=await He();if(!e)return{hasPermissions:!1,npmPrefix:null};try{return await M(e,je.W_OK),{hasPermissions:!0,npmPrefix:e}}catch{return w(new Je(`Insufficient permissions for global npm install.`)),{hasPermissions:!1,npmPrefix:e}}}catch(e){return w(e),{hasPermissions:!1,npmPrefix:null}}}async function We(){let e=await b(`npm`,[`view`,``,`dist-tags`,`--json`,`--prefer-online`],{abortSignal:AbortSignal.timeout(5e3),cwd:O()});if(e.code!==0)return f(`npm view dist-tags failed with code ${e.code}`),{latest:null,stable:null};try{let t=d(e.stdout.trim());return{latest:typeof t.latest==`string`?t.latest:null,stable:typeof t.stable==`string`?t.stable:null}}catch(e){return f(`Failed to parse dist-tags: ${e}`),{latest:null,stable:null}}}async function Ge(e){try{return(await s.get(`${qe}/${e}`,{timeout:5e3,responseType:`text`})).data.trim()}catch(t){return f(`Failed to fetch ${e} from GCS: ${t}`),null}}async function Ke(){let[e,t]=await Promise.all([Ge(`latest`),Ge(`stable`)]);return{latest:e,stable:t}}var qe,Je,Ye=e((()=>{c(),y(),m(),pe(),o(),u(),x(),p(),te(),C(),Ce(),me(),H(),g(),qe=`https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases`,Je=class extends ae{}}));function U(e,t){return t.includes(e.id)||e.idLike.some(e=>t.includes(e))}function Xe(){let e=process.execPath||process.argv[0]||``;return/[/\\]mise[/\\]installs[/\\]/i.test(e)?(f(`Detected mise installation: ${e}`),!0):!1}function Ze(){let e=process.execPath||process.argv[0]||``;return/[/\\]\.?asdf[/\\]installs[/\\]/i.test(e)?(f(`Detected asdf installation: ${e}`),!0):!1}function W(){let e=T();if(e!==`macos`&&e!==`linux`&&e!==`wsl`)return!1;let t=process.execPath||process.argv[0]||``;return t.includes(`/Caskroom/`)?(f(`Detected Homebrew cask installation: ${t}`),!0):!1}function Qe(){if(T()!==`windows`)return!1;let e=process.execPath||process.argv[0]||``;for(let t of[/Microsoft[/\\]WinGet[/\\]Packages/i,/Microsoft[/\\]WinGet[/\\]Links/i])if(t.test(e))return f(`Detected winget installation: ${e}`),!0;return!1}var G,K,q,J,Y,$e,et=e((()=>{n(),m(),x(),E(),G=t(async()=>{try{let e=await N(`/etc/os-release`,`utf8`),t=e.match(/^ID=["']?(\S+?)["']?\s*$/m),n=e.match(/^ID_LIKE=["']?(.+?)["']?\s*$/m);return{id:t?.[1]??``,idLike:n?.[1]?.split(` `)??[]}}catch{return null}}),K=t(async()=>{if(T()!==`linux`)return!1;let e=await G();if(e&&!U(e,[`arch`]))return!1;let t=await S(`pacman`,[`-Qo`,process.execPath||process.argv[0]||``],{timeout:5e3,useCwd:!1});return t.code===0&&t.stdout?(f(`Detected pacman installation: ${t.stdout.trim()}`),!0):!1}),q=t(async()=>{if(T()!==`linux`)return!1;let e=await G();if(e&&!U(e,[`debian`]))return!1;let t=await S(`dpkg`,[`-S`,process.execPath||process.argv[0]||``],{timeout:5e3,useCwd:!1});return t.code===0&&t.stdout?(f(`Detected deb installation: ${t.stdout.trim()}`),!0):!1}),J=t(async()=>{if(T()!==`linux`)return!1;let e=await G();if(e&&!U(e,[`fedora`,`rhel`,`suse`]))return!1;let t=await S(`rpm`,[`-qf`,process.execPath||process.argv[0]||``],{timeout:5e3,useCwd:!1});return t.code===0&&t.stdout?(f(`Detected rpm installation: ${t.stdout.trim()}`),!0):!1}),Y=t(async()=>{if(T()!==`linux`)return!1;let e=await G();if(e&&!U(e,[`alpine`]))return!1;let t=await S(`apk`,[`info`,`--who-owns`,process.execPath||process.argv[0]||``],{timeout:5e3,useCwd:!1});return t.code===0&&t.stdout?(f(`Detected apk installation: ${t.stdout.trim()}`),!0):!1}),$e=t(async()=>W()?`homebrew`:Qe()?`winget`:Xe()?`mise`:Ze()?`asdf`:await K()?`pacman`:await Y()?`apk`:await q()?`deb`:await J()?`rpm`:`unknown`)}));function tt(){let e=process.argv[1]||``,t=process.execPath||process.argv[0]||``;return T()===`windows`&&(e=e.split(j.sep).join(A.sep),t=t.split(j.sep).join(A.sep)),[e,t]}async function nt(){let[e]=tt();if(D())return W()||Qe()||Xe()||Ze()||await K()||await q()||await J()||await Y()?`package-manager`:`native`;if(Fe())return`npm-local`;if([`/usr/local/lib/node_modules`,`/usr/lib/node_modules`,`/opt/homebrew/lib/node_modules`,`/opt/homebrew/bin`,`/usr/local/bin`,`/.nvm/versions/node/`].some(t=>e.includes(t))||e.includes(`/npm/`)||e.includes(`/nvm/`))return`npm-global`;let t=await ye(`npm config get prefix`,{shell:!0,reject:!1}),n=t.exitCode===0?t.stdout.trim():null;return n&&e.startsWith(n)?`npm-global`:`unknown`}async function rt(){if(D()){try{return await P(process.execPath)}catch{}try{let e=await be(`claude`);if(e)return e}catch{}try{return await h().stat(k(O(),`.local/bin/claude`)),k(O(),`.local/bin/claude`)}catch{}return`native`}try{return process.argv[0]||`unknown`}catch{return`unknown`}}function it(){try{return D()?process.execPath||`unknown`:process.argv[1]||`unknown`}catch{return`unknown`}}async function at(){let e=h(),t=[],n=k(O(),`.claude`,`local`);await I()&&t.push({type:`npm-local`,path:n});let r=[`@anthropic-ai/claude-code`],i=await S(`npm`,[`-g`,`config`,`get`,`prefix`]);if(i.code===0&&i.stdout){let n=i.stdout.trim(),a=T()===`windows`,o=a?k(n,`claude`):k(n,`bin`,`claude`),s=!1;try{await e.stat(o),s=!0}catch{}if(s){let e=!1;try{(await P(o)).includes(`/Caskroom/`)&&(e=W())}catch{}e||t.push({type:`npm-global`,path:o})}else for(let i of r){let r=a?k(n,`node_modules`,i):k(n,`lib`,`node_modules`,i);try{await e.stat(r),t.push({type:`npm-global-orphan`,path:r})}catch{}}}let a=k(O(),`.local`,`bin`,`claude`);try{await e.stat(a),t.push({type:`native`,path:a})}catch{}if(v().installMethod===`native`){let n=k(O(),`.local`,`share`,`claude`);try{await e.stat(n),t.some(e=>e.type===`native`)||t.push({type:`native`,path:n})}catch{}}return t}async function ot(e){let t=[];try{let e=d(await N(k(fe(),`managed-settings.json`),`utf-8`)),n=e&&typeof e==`object`?e.strictPluginOnlyCustomization:void 0;if(n!==void 0&&typeof n!=`boolean`)if(!Array.isArray(n))t.push({issue:`managed-settings.json: strictPluginOnlyCustomization has an invalid value (expected true or an array, got ${typeof n})`,fix:`The field is silently ignored (schema .catch rescues it). Set it to true, or an array of: ${_.join(`, `)}.`});else{let e=n.filter(e=>typeof e==`string`&&!_.includes(e));e.length>0&&t.push({issue:`managed-settings.json: strictPluginOnlyCustomization has ${e.length} value(s) this client doesn't recognize: ${e.map(String).join(`, `)}`,fix:`These are silently ignored (forwards-compat). Known surfaces for this version: ${_.join(`, `)}. Either remove them, or this client is older than the managed-settings intended.`})}}catch{}let n=v();if(e===`development`)return t;if(e===`native`){let e=(process.env.PATH||``).split(Ae),n=k(O(),`.local`,`bin`),r=n;if(T()===`windows`&&(r=n.split(j.sep).join(A.sep)),!e.some(e=>{let t=e;T()===`windows`&&(t=e.split(j.sep).join(A.sep));let n=t.replace(/\/+$/,``),i=e.replace(/[/\\]+$/,``);return n===r||i===`~/.local/bin`||i===`$HOME/.local/bin`}))if(T()===`windows`){let e=n.split(A.sep).join(j.sep);t.push({issue:`Native installation exists but ${e} is not in your PATH`,fix:`Add it by opening: System Properties → Environment Variables → Edit User PATH → New → Add the path above. Then restart your terminal.`})}else{let e=L(),n=z()[e],r=n?n.replace(O(),`~`):`your shell config file`;t.push({issue:`Native installation exists but ~/.local/bin is not in your PATH`,fix:`Run: echo 'export PATH="$HOME/.local/bin:$PATH"' >> ${r} then open a new terminal or run: source ${r}`})}}i(process.env.DISABLE_INSTALLATION_CHECKS)||(e===`npm-local`&&n.installMethod!==`local`&&t.push({issue:`Running from local installation but config install method is '${n.installMethod}'`,fix:`Consider using native installation: claude install`}),e===`native`&&n.installMethod!==`native`&&t.push({issue:`Running native installation but config install method is '${n.installMethod}'`,fix:`Run claude install to update configuration`})),e===`npm-global`&&await I()&&t.push({issue:`Local installation exists but not being used`,fix:`Consider using native installation: claude install`});let r=await Re(),a=await ze();return e===`npm-local`&&!await be(`claude`)&&!a&&(r?t.push({issue:`Local installation not accessible`,fix:`Alias exists but points to invalid target: ${r}. Update alias: alias claude="~/.claude/local/claude"`}):t.push({issue:`Local installation not accessible`,fix:`Create alias: alias claude="~/.claude/local/claude"`})),t}function st(){if(T()!==`linux`)return[];let e=[],t=l.getLinuxGlobPatternWarnings();if(t.length>0){let n=t.slice(0,3).join(`, `),r=t.length-3,i=r>0?`${n} (${r} more)`:n;e.push({issue:`Glob patterns in sandbox permission rules are not fully supported on Linux`,fix:`Found ${t.length} pattern(s): ${i}. On Linux, glob patterns in Edit/Read rules will be ignored.`})}return e}async function ct(){let e=await nt(),t=typeof MACRO<`u`?`0.0.11`:`unknown`,n=await rt(),r=it(),i=await at(),a=await ot(e);if(a.push(...st()),e===`native`){let e=i.filter(e=>e.type===`npm-global`||e.type===`npm-global-orphan`||e.type===`npm-local`),t=T()===`windows`;for(let n of e)n.type===`npm-global`?a.push({issue:`Leftover npm global installation at ${n.path}`,fix:`Run: npm -g uninstall @anthropic-ai/claude-code`}):n.type===`npm-global-orphan`?a.push({issue:`Orphaned npm global package at ${n.path}`,fix:t?`Run: rmdir /s /q "${n.path}"`:`Run: rm -rf ${n.path}`}):n.type===`npm-local`&&a.push({issue:`Leftover npm local installation at ${n.path}`,fix:t?`Run: rmdir /s /q "${n.path}"`:`Run: rm -rf ${n.path}`})}let o=v().installMethod||`not set`,s=null;e===`npm-global`&&(s=(await Ue()).hasPermissions,!s&&!ge()&&a.push({issue:`Insufficient permissions for auto-updates`,fix:"Do one of: (1) Re-install node without sudo, or (2) Use `claude install` for native installation"}));let c=Ee(),l={working:c.working??!0,mode:c.mode,systemPath:c.mode===`system`?c.path:null,note:c.note??null},ee=e===`package-manager`?await $e():void 0;return{installationType:e,version:t,installationPath:n,invokedBinary:r,configInstallMethod:o,autoUpdates:(()=>{let e=ge();return e?`disabled (${_e(e)})`:`enabled`})(),hasUpdatePermissions:s,multipleInstallations:i,warnings:a,packageManager:ee,ripgrepStatus:l}}var lt=e((()=>{ve(),Ye(),Se(),y(),ne(),o(),x(),p(),R(),et(),E(),Te(),ee(),de(),ue(),H(),g(),xe()}));function ut(){let e=process.env.ENABLE_PID_BASED_VERSION_LOCKING;return i(e)?!0:(r(e),!1)}function X(e){if(e<=1)return!1;try{return process.kill(e,0),!0}catch{return!1}}function dt(e,t){if(!X(e))return!1;if(e===process.pid)return!0;try{let n=Oe(e);if(!n)return!0;let r=n.toLowerCase(),i=t.toLowerCase();return r.includes(`claude`)||r.includes(i)}catch{return!0}}function Z(e){let t=h();try{let n=t.readFileSync(e,{encoding:`utf8`});if(!n||n.trim()===``)return null;let r=d(n);return typeof r.pid!=`number`||!r.version||!r.execPath?null:r}catch{return null}}function Q(e){let t=Z(e);if(!t)return!1;let{pid:n,execPath:r}=t;if(!X(n))return!1;if(!dt(n,r))return f(`Lock PID ${n} is running but does not appear to be Claude - treating as stale`),!1;let i=h();try{let t=i.statSync(e);if(Date.now()-t.mtimeMs>$&&!X(n))return!1}catch{}return!0}function ft(e,t){let n=h(),r=`${e}.tmp.${process.pid}.${Date.now()}`;try{oe(r,ie(t,null,2),{encoding:`utf8`,flush:!0}),n.renameSync(r,e)}catch(e){try{n.unlinkSync(r)}catch{}throw e}}async function pt(e,t){let n=h(),r=ke(e);if(Q(t))return f(`Cannot acquire lock for ${r} - held by PID ${Z(t)?.pid}`),null;let i={pid:process.pid,version:r,execPath:process.execPath,acquiredAt:Date.now()};try{return ft(t,i),Z(t)?.pid===process.pid?(f(`Acquired PID lock for ${r} (PID ${process.pid})`),()=>{try{Z(t)?.pid===process.pid&&(n.unlinkSync(t),f(`Released PID lock for ${r}`))}catch(e){f(`Failed to release lock for ${r}: ${e}`)}}):null}catch(e){return f(`Failed to acquire lock for ${r}: ${e}`),null}}async function mt(e,t){let n=await pt(e,t);if(!n)return!1;let r=()=>{try{n()}catch{}};return process.on(`exit`,r),process.on(`SIGINT`,r),process.on(`SIGTERM`,r),!0}async function ht(e,t,n){let r=await pt(e,t);if(!r)return!1;try{return await n(),!0}finally{r()}}function gt(e){let t=h(),n=[];try{let r=t.readdirStringSync(e).filter(e=>e.endsWith(`.lock`));for(let t of r){let r=k(e,t),i=Z(r);i&&n.push({version:i.version,pid:i.pid,isProcessRunning:X(i.pid),execPath:i.execPath,acquiredAt:new Date(i.acquiredAt),lockFilePath:r})}}catch(e){if(re(e))return n;w(se(e))}return n}function _t(e){let t=h(),n=0;try{let r=t.readdirStringSync(e).filter(e=>e.endsWith(`.lock`));for(let i of r){let r=k(e,i);try{t.lstatSync(r).isDirectory()?(t.rmSync(r,{recursive:!0,force:!0}),n++,f(`Cleaned up legacy directory lock: ${i}`)):Q(r)||(t.unlinkSync(r),n++,f(`Cleaned up stale lock: ${i}`))}catch{}}}catch(e){if(re(e))return 0;w(se(e))}return n}var $,vt=e((()=>{m(),o(),u(),p(),De(),C(),g(),$=7200*1e3}));export{R as C,L as S,Ie as _,Q as a,B as b,ht as c,lt as d,Ke as f,Ve as g,Ye as h,vt as i,nt as l,We as m,_t as n,ut as o,Be as p,gt as r,Z as s,mt as t,ct as u,z as v,Le as x,H as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{A as t,
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{A as t,C as n,ME as r,OE as i,g_ as a,kE as o,p_ as s,qb as c,zb as l}from"./loadAgentsDir-BL93ulMm.js";import{I as u,P as d,fi as f,t as p}from"./src-P_wYS_NJ2.js";import{t as m}from"./jsx-runtime-Bb4Xn-E0.js";import{Wt as h,zt as g}from"./state-BemZdQIl.js";import{a as _,i as v,r as y,t as b}from"./promptEditor-WCkmpejM.js";import{r as x,t as S}from"./staticRender-DrU6eWoq.js";function C({planContent:e,planPath:t,editorName:n}){return(0,T.jsxs)(u,{flexDirection:`column`,children:[(0,T.jsx)(d,{bold:!0,children:`Current Plan`}),(0,T.jsx)(d,{dimColor:!0,children:t}),(0,T.jsx)(u,{marginTop:1,children:(0,T.jsx)(d,{children:e})}),n&&(0,T.jsxs)(u,{marginTop:1,children:[(0,T.jsx)(d,{dimColor:!0,children:`"/plan open"`}),(0,T.jsx)(d,{dimColor:!0,children:` to edit this plan in `}),(0,T.jsx)(d,{bold:!0,dimColor:!0,children:n})]})]})}async function w(e,n,r){let{getAppState:a,setAppState:l}=n,u=a().toolPermissionContext.mode;if(u!==`plan`){g(u,`plan`),l(e=>({...e,toolPermissionContext:s(t(e.toolPermissionContext),{type:`setMode`,mode:`plan`,destination:`session`})}));let n=r.trim();return n&&n!==`open`?e(`Enabled plan mode`,{shouldQuery:!0}):e(`Enabled plan mode`),null}let d=i(),f=o();if(!d)return e(`Already in plan mode. No plan written yet.`),null;if(r.trim().split(/\s+/)[0]===`open`){let t=await b(f);return t.error?e(`Failed to open plan in editor: ${t.error}`):e(`Opened plan in editor: ${f}`),null}let p=v();return e(await x((0,T.jsx)(C,{planContent:d,planPath:f,editorName:p?c(p):void 0}))),null}var T;e((()=>{f(),h(),p(),_(),l(),a(),n(),r(),y(),S(),T=m()}))();export{w as call};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{f as r,u as i}from"./debug-BecbSVoN.js";import{o as a,s as o}from"./log-Dauqle-Z.js";import{release as s}from"os";import{readFile as c,readdir as l}from"fs/promises";async function u(e){let t=new Set;process.env.P4PORT&&t.add(`perforce`);try{let n=e??i().cwd(),r=new Set(await l(n));for(let[e,n]of h)r.has(e)&&t.add(n)}catch{}return[...t]}var d,f,p,m,h,g=e((()=>{n(),r(),a(),d=[`macos`,`wsl`],f=t(()=>{try{if(process.platform===`darwin`)return`macos`;if(process.platform===`win32`)return`windows`;if(process.platform===`linux`){try{let e=i().readFileSync(`/proc/version`,{encoding:`utf8`});if(e.toLowerCase().includes(`microsoft`)||e.toLowerCase().includes(`wsl`))return`wsl`}catch(e){o(e)}return`linux`}return`unknown`}catch(e){return o(e),`unknown`}}),p=t(()=>{if(process.platform===`linux`)try{let e=i().readFileSync(`/proc/version`,{encoding:`utf8`}),t=e.match(/WSL(\d+)/i);return t&&t[1]?t[1]:e.toLowerCase().includes(`microsoft`)?`1`:void 0}catch(e){o(e);return}}),m=t(async()=>{if(process.platform!==`linux`)return;let e={linuxKernel:s()};try{let t=await c(`/etc/os-release`,`utf8`);for(let n of t.split(`
|
|
2
2
|
`)){let t=n.match(/^(ID|VERSION_ID)=(.*)$/);if(t&&t[1]&&t[2]){let n=t[2].replace(/^"|"$/g,``);t[1]===`ID`?e.linuxDistroId=n:e.linuxDistroVersion=n}}}catch{}return e}),h=[[`.git`,`git`],[`.hg`,`mercurial`],[`.svn`,`svn`],[`.p4config`,`perforce`],[`$tf`,`tfs`],[`.tfvc`,`tfs`],[`.jj`,`jujutsu`],[`.sl`,`sapling`]]}));export{p as a,f as i,u as n,g as o,m as r,d as t};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{l as n,o as r}from"./envUtils-BDhHQY0-.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{$o as o,$x as s,AS as c,Ao as l,Bo as u,CS as d,DS as f,Do as p,ES as m,FS as h,Fg as g,Fp as _,GC as v,Go as y,IS as b,Ig as ee,Io as te,Iu as x,Jo as S,Kw as ne,MS as C,NS as w,No as T,OS as E,Oo as re,PS as D,Pp as O,Pu as k,Qo as ie,SS as A,Sg as j,Uo as M,Xw as ae,Xx as oe,Yw as se,ZC as N,Zo as ce,_o as P,aT as le,as as ue,cs as de,dT as fe,dd as pe,do as F,es as me,fo as he,gT as ge,hT as _e,jS as ve,kS as ye,lT as be,ns as xe,qo as Se,rs as Ce,ss as we,ts as I,ud as Te,vT as Ee,vo as De,wg as Oe,wo as ke,xg as Ae,yT as je,zo as Me}from"./loadAgentsDir-BL93ulMm.js";import{D as Ne,Gr as Pe,Gt as L,H as Fe,I as R,P as z,T as B,Wt as Ie,Xn as Le,fi as V,hn as Re,j as ze,k as Be,n as Ve,ot as He,r as Ue,t as We,x as Ge,y as Ke}from"./src-P_wYS_NJ2.js";import{t as qe}from"./jsx-runtime-Bb4Xn-E0.js";import{P as Je,R as Ye,S as Xe,U as Ze,c as Qe,i as $e,x as et}from"./debug-BecbSVoN.js";import{Ln as tt,Rn as nt,c as rt,f as it,g as at,vt as ot,x as st,xt as ct}from"./settings-D4CpDv2y.js";import{b as lt,h as ut}from"./config-aRiTrtCv.js";import{o as dt,s as ft}from"./log-Dauqle-Z.js";import{n as pt,r as mt}from"./analytics-DJobLaWP.js";import{C as ht,y as gt}from"./startupProfiler-CmH_aVy2.js";import{l as H,o as _t}from"./stringUtils-C8PaYpQF.js";import{n as vt,t as yt}from"./pluginStartupCheck-CKBFaMFr.js";import{a as bt,d as xt,f as St,i as Ct,l as wt,o as Tt,s as Et,u as Dt}from"./pluginOperations-DnhzFbYI.js";import{a as Ot,c as kt,i as At,n as jt,o as Mt,s as Nt,t as Pt}from"./validatePlugin-y_O_tCEL.js";import{a as Ft,n as It,o as Lt,r as Rt}from"./pluginFlagging-DcJ_FQuv.js";import{i as zt,n as Bt}from"./MCPConnectionManager-B9n4SXN4.js";import{n as Vt,t as Ht}from"./useExitOnCtrlCDWithKeybindings-DEEJhm_W.js";import{t as Ut}from"./SearchBox-C9vUA4IM.js";import{n as Wt,t as Gt}from"./useSearchInput-gUDbkLaC.js";import{a as Kt,c as qt,i as Jt,n as Yt,o as Xt,r as Zt,s as Qt,t as $t}from"./MCPToolListView-DJ06N1DG.js";import{i as en,n as tn}from"./pluginAutoupdate-BBU9Jn4p.js";import*as nn from"path";import*as rn from"fs/promises";function an({inputValue:e,setInputValue:t,cursorOffset:n,setCursorOffset:r,error:i,setError:a,result:o,setResult:s,setViewState:c,onAddComplete:l,cliMode:u=!1}){let d=(0,on.useRef)(!1),[f,p]=(0,on.useState)(!1),[m,h]=(0,on.useState)(``),g=async()=>{let t=e.trim();if(!t){a(`Please enter a marketplace source`);return}let n=await Ot(t);if(!n){a(`Invalid marketplace source format. Try: owner/repo, https://..., or ./path`);return}if(`error`in n){a(n.error);return}a(null);try{p(!0),h(``);let{name:e,resolvedSource:t}=await T(n,e=>{h(e)});Se(e,{source:t}),we();let r=n.source;n.source===`github`&&(r=n.repo),mt(`tengu_marketplace_added`,{source_type:r}),l&&await l(),h(``),p(!1),u?s(`Successfully added marketplace: ${e}`):c({type:`browse-marketplace`,targetMarketplace:e})}catch(e){let t=Ze(e);ft(t),a(t.message),h(``),p(!1),s(u?`Error: ${t.message}`:null)}};return(0,on.useEffect)(()=>{e&&!d.current&&!i&&!o&&(d.current=!0,g())},[]),(0,U.jsxs)(R,{flexDirection:`column`,children:[(0,U.jsxs)(R,{flexDirection:`column`,paddingX:1,borderStyle:`round`,children:[(0,U.jsx)(R,{marginBottom:1,children:(0,U.jsx)(z,{bold:!0,children:`Add Marketplace`})}),(0,U.jsxs)(R,{flexDirection:`column`,children:[(0,U.jsx)(z,{children:`Enter marketplace source:`}),(0,U.jsx)(z,{dimColor:!0,children:`Examples:`}),(0,U.jsx)(z,{dimColor:!0,children:` · owner/repo (GitHub)`}),(0,U.jsx)(z,{dimColor:!0,children:` · git@github.com:owner/repo.git (SSH)`}),(0,U.jsx)(z,{dimColor:!0,children:` · https://example.com/marketplace.json`}),(0,U.jsx)(z,{dimColor:!0,children:` · ./path/to/marketplace`}),(0,U.jsx)(R,{marginTop:1,children:(0,U.jsx)(Te,{value:e,onChange:t,onSubmit:g,columns:80,cursorOffset:n,onChangeCursorOffset:r,focus:!0,showCursor:!0})})]}),f&&(0,U.jsxs)(R,{marginTop:1,children:[(0,U.jsx)(k,{}),(0,U.jsx)(z,{children:m||`Adding marketplace to configuration…`})]}),i&&(0,U.jsx)(R,{marginTop:1,children:(0,U.jsx)(z,{color:`error`,children:i})}),o&&(0,U.jsx)(R,{marginTop:1,children:(0,U.jsx)(z,{children:o})})]}),(0,U.jsx)(R,{marginLeft:3,children:(0,U.jsx)(z,{dimColor:!0,italic:!0,children:(0,U.jsxs)(B,{children:[(0,U.jsx)(Ne,{shortcut:`Enter`,action:`add`}),(0,U.jsx)(O,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})})]})}var on,U,sn=e((()=>{V(),on=t(V(),1),pt(),_(),We(),x(),pe(),Ye(),dt(),de(),Me(),At(),U=qe()}));function cn(e,t,r,i){let a={};for(let o of e){let e=r[o],s=t[o]??``;if(!(e?.sensitive===!0&&s===``&&i?.[o]!==void 0))if(e?.type===`number`){if(s.trim()===``)continue;let e=Number(s);a[o]=Number.isNaN(e)?s:e}else e?.type===`boolean`?a[o]=n(s):a[o]=s}return a}function ln({title:e,subtitle:t,configSchema:n,initialValues:r,onSave:i,onCancel:o}){let s=Object.keys(n),c=(0,un.useCallback)(e=>{if(n[e]?.sensitive===!0)return``;let t=r?.[e];return t===void 0?``:String(t)},[n,r]),[l,u]=(0,un.useState)(0),[d,f]=(0,un.useState)({}),[p,m]=(0,un.useState)(()=>s[0]?c(s[0]):``),h=s[l],g=h?n[h]:null;if(Ie(`confirm:no`,o,{context:`Settings`}),L({"confirm:nextField":(0,un.useCallback)(()=>{if(l<s.length-1&&h){f(e=>({...e,[h]:p})),u(e=>e+1);let e=s[l+1];m(e?c(e):``)}},[l,s,h,p,c]),"confirm:yes":(0,un.useCallback)(()=>{if(!h)return;let e={...d,[h]:p};if(l===s.length-1)i(cn(s,e,n,r));else{f(e),u(e=>e+1);let t=s[l+1];m(t?c(t):``)}},[h,d,p,l,s,n,i,c,r])},{context:`Confirmation`}),Re((e,t)=>{if(t.backspace||t.delete){m(e=>e.slice(0,-1));return}e&&!t.ctrl&&!t.meta&&!t.tab&&!t.return&&m(t=>t+e)}),!g||!h)return null;let _=g.sensitive===!0,v=g.required===!0,y=_?`*`.repeat(Pe(p)):p;return(0,dn.jsxs)(Ke,{title:e,subtitle:t,onCancel:o,isCancelActive:!1,children:[(0,dn.jsxs)(R,{flexDirection:`column`,children:[(0,dn.jsxs)(z,{bold:!0,children:[g.title||h,v&&(0,dn.jsx)(z,{color:`error`,children:` *`})]}),g.description&&(0,dn.jsx)(z,{dimColor:!0,children:g.description}),(0,dn.jsxs)(R,{marginTop:1,children:[(0,dn.jsxs)(z,{children:[a.pointerSmall,` `]}),(0,dn.jsx)(z,{children:y}),(0,dn.jsx)(z,{children:`█`})]})]}),(0,dn.jsxs)(R,{flexDirection:`column`,children:[(0,dn.jsxs)(z,{dimColor:!0,children:[`Field `,l+1,` of `,s.length]}),l<s.length-1&&(0,dn.jsx)(z,{dimColor:!0,children:`Tab: Next field · Enter: Save and continue`}),l===s.length-1&&(0,dn.jsx)(z,{dimColor:!0,children:`Enter: Save configuration`})]})]})}var un,dn,fn=e((()=>{i(),un=t(V(),1),We(),v(),r(),dn=qe()}));async function pn(e){let{enabled:t,disabled:n}=await he();return[...t,...n].find(t=>t.repository===e||t.source===e)}function mn({plugin:e,pluginId:t,onDone:n}){let[r]=hn.useState(()=>{let n=[],r=m(e);Object.keys(r).length>0&&n.push({key:`top-level`,title:`Configure ${e.name}`,subtitle:`Plugin options`,schema:r,load:()=>E(t),save:n=>ye(t,n,e.manifest.userConfig)});let i=A(e);for(let r of i)n.push({key:`channel:${r.server}`,title:`Configure ${r.displayName}`,subtitle:`Plugin: ${e.name}`,schema:r.configSchema,load:()=>C(t,r.server)??void 0,save:e=>D(t,r.server,e,r.configSchema)});return n}),[i,a]=hn.useState(0),o=hn.useRef(n);if(o.current=n,hn.useEffect(()=>{r.length===0&&o.current(`skipped`)},[r.length]),r.length===0)return null;let s=r[i];function c(e){try{s.save(e)}catch(e){n(`error`,Je(e));return}let t=i+1;t<r.length?a(t):n(`configured`)}return(0,gn.jsx)(ln,{title:s.title,subtitle:s.subtitle,configSchema:s.schema,initialValues:s.load(),onSave:c,onCancel:()=>n(`skipped`)},s.key)}var hn,gn,_n=e((()=>{hn=t(V(),1),Ye(),c(),d(),F(),f(),fn(),gn=qe()}));function vn(){let e=xe();return(0,yn.jsxs)(R,{marginBottom:1,children:[(0,yn.jsxs)(z,{color:`claude`,children:[a.warning,` `]}),(0,yn.jsxs)(z,{dimColor:!0,italic:!0,children:[`Make sure you trust a plugin before installing, updating, or using it. We do not control what MCP servers, files, or other software are included in plugins and cannot verify that they will work as intended or that they won't change. See each plugin's homepage for more information.`,e?` ${e}`:``]})]})}var yn,bn=e((()=>{i(),V(),We(),Ce(),yn=qe()}));function xn(e){return e.entry.source&&typeof e.entry.source==`object`&&`source`in e.entry.source&&e.entry.source.source===`github`&&typeof e.entry.source==`object`&&`repo`in e.entry.source?e.entry.source.repo:null}function Sn(e,t){let n=[{label:`Install for you (user scope)`,action:`install-user`},{label:`Install for all collaborators on this repository (project scope)`,action:`install-project`},{label:`Install for you, in this repo only (local scope)`,action:`install-local`}];return e&&n.push({label:`Open homepage`,action:`homepage`}),t&&n.push({label:`View on GitHub`,action:`github`}),n.push({label:`Back to plugin list`,action:`back`}),n}function Cn({hasSelection:e}){return(0,wn.jsx)(R,{marginTop:1,children:(0,wn.jsx)(z,{dimColor:!0,italic:!0,children:(0,wn.jsxs)(B,{children:[e&&(0,wn.jsx)(O,{action:`plugin:install`,context:`Plugin`,fallback:`i`,description:`install`,bold:!0}),(0,wn.jsx)(O,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,wn.jsx)(O,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,wn.jsx)(O,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})}var wn,Tn=e((()=>{V(),_(),We(),wn=qe()}));function En({totalItems:e,maxVisible:t=On,selectedIndex:n=0}){let r=e>t,i=(0,Dn.useRef)(0),a=(0,Dn.useMemo)(()=>{if(!r)return 0;let a=i.current;if(n<a)return i.current=n,n;if(n>=a+t){let e=n-t+1;return i.current=e,e}let o=Math.max(0,e-t),s=Math.min(a,o);return i.current=s,s},[n,t,r,e]),o=a,s=Math.min(a+t,e),c=(0,Dn.useCallback)(e=>r?e.slice(o,s):e,[r,o,s]),l=(0,Dn.useCallback)(e=>o+e,[o]),u=(0,Dn.useCallback)(e=>e>=o&&e<s,[o,s]),d=(0,Dn.useCallback)(e=>{},[]),f=(0,Dn.useCallback)(()=>{},[]),p=(0,Dn.useCallback)(()=>{},[]),m=(0,Dn.useCallback)((t,n)=>{n(Math.max(0,Math.min(t,e-1)))},[e]),h=(0,Dn.useCallback)((e,t)=>!1,[]),g=Math.max(1,Math.ceil(e/t));return{currentPage:Math.floor(a/t),totalPages:g,startIndex:o,endIndex:s,needsPagination:r,pageSize:t,getVisibleItems:c,toActualIndex:l,isOnCurrentPage:u,goToPage:d,nextPage:f,prevPage:p,handleSelectionChange:m,handlePageNavigation:h,scrollPosition:{current:n+1,total:e,canScrollUp:a>0,canScrollDown:a+t<e}}}var Dn,On,kn=e((()=>{Dn=t(V(),1),On=5}));function An({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:s,targetMarketplace:c,targetPlugin:l}){let[d,f]=(0,W.useState)(`marketplace-list`),[m,h]=(0,W.useState)(null),[g,_]=(0,W.useState)(null),[v,y]=(0,W.useState)([]),[x,S]=(0,W.useState)([]),[ne,C]=(0,W.useState)(!0),[w,T]=(0,W.useState)(null),[E,D]=(0,W.useState)(0),[k,ie]=(0,W.useState)(new Set),[A,j]=(0,W.useState)(new Set),M=En({totalItems:x.length,selectedIndex:E}),[ae,oe]=(0,W.useState)(0),[se,N]=(0,W.useState)(!1),[P,le]=(0,W.useState)(null),[de,fe]=(0,W.useState)(null);Ie(`confirm:no`,jn.useCallback(()=>{d===`plugin-list`?c?i({type:`manage-marketplaces`,targetMarketplace:c}):v.length===1?i({type:`menu`}):(f(`marketplace-list`),h(null),ie(new Set)):d===`plugin-details`?(f(`plugin-list`),_(null)):i({type:`menu`})},[d,c,i,v.length]),{context:`Confirmation`}),(0,W.useEffect)(()=>{async function e(){try{let e=await u(),{marketplaces:n,failures:r}=await ue(e),i=[];for(let{name:e,config:t,data:r}of n)if(r){let n=tt(r.plugins,t=>re(ce(t.name,e)));i.push({name:e,totalPlugins:r.plugins.length,installedCount:n,source:I(t.source)})}i.sort((e,t)=>e.name===`claude-plugin-directory`?-1:+(t.name===`claude-plugin-directory`)),y(i);let a=me(r,tt(n,e=>e.data!==null));if(a)if(a.type===`warning`)fe(a.message+`. Showing available marketplaces.`);else throw Error(a.message);if(i.length===1&&!c&&!l){let e=i[0];e&&(h(e.name),f(`plugin-list`))}if(l){let n=null,r=null;for(let[t]of Object.entries(e)){let e=await te(t);if(e){let i=e.plugins.find(e=>e.name===l);if(i){let e=ce(i.name,t);n={entry:i,marketplaceName:t,pluginId:e,isInstalled:p(e)},r=t;break}}}if(n&&r){let e=n.pluginId;p(e)?t(`Plugin '${e}' is already installed globally. Use '/plugin' to manage existing plugins.`):(h(r),_(n),f(`plugin-details`))}else t(`Plugin "${l}" not found in any marketplace`)}else c&&(i.some(e=>e.name===c)?(h(c),f(`plugin-list`)):t(`Marketplace "${c}" not found`))}catch(e){t(e instanceof Error?e.message:`Failed to load marketplaces`)}finally{C(!1)}}e()},[t,c,l]),(0,W.useEffect)(()=>{if(!m)return;let e=!1;async function n(n){C(!0);try{let t=await te(n);if(e)return;if(!t)throw Error(`Failed to load marketplace: ${n}`);let r=[];for(let e of t.plugins){let t=ce(e.name,n);ee(t)||r.push({entry:e,marketplaceName:n,pluginId:t,isInstalled:p(t)})}try{let t=await Nt();if(e)return;T(t),t?r.sort((e,n)=>{let r=t.get(e.pluginId)??0,i=t.get(n.pluginId)??0;return r===i?e.entry.name.localeCompare(n.entry.name):i-r}):r.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}catch(t){if(e)return;Qe(`Failed to fetch install counts: ${Je(t)}`),r.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}S(r),D(0),ie(new Set)}catch(n){if(e)return;t(n instanceof Error?n.message:`Failed to load plugins`)}finally{C(!1)}}return n(m),()=>{e=!0}},[m,t]);let pe=async()=>{if(k.size===0)return;let e=x.filter(e=>k.has(e.pluginId));j(new Set(e.map(e=>e.pluginId)));let n=0,a=0,c=[];for(let t of e){let e=await De({pluginId:t.pluginId,entry:t.entry,marketplaceName:t.marketplaceName,scope:`user`});e.success?n++:(a++,c.push({name:t.entry.name,reason:e.error}))}j(new Set),ie(new Set),we(),a===0?r(`✓ Installed ${n} ${H(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${o(c,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${o(c,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&s&&await s(),i({type:`menu`})},F=async(e,t=`user`)=>{N(!0),le(null);let n=await De({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await pn(e.pluginId);if(t){N(!1),f({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),s&&await s(),i({type:`menu`})}else N(!1),le(n.error)};(0,W.useEffect)(()=>{e&&r(e)},[e,r]),L({"select:previous":()=>{E>0&&D(E-1)},"select:next":()=>{E<v.length-1&&D(E+1)},"select:accept":()=>{let e=v[E];e&&(h(e.name),f(`plugin-list`))}},{context:`Select`,isActive:d===`marketplace-list`}),L({"select:previous":()=>{E>0&&M.handleSelectionChange(E-1,D)},"select:next":()=>{E<x.length-1&&M.handleSelectionChange(E+1,D)},"select:accept":()=>{if(E===x.length&&k.size>0)pe();else if(E<x.length){let e=x[E];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(_(e),f(`plugin-details`),oe(0),le(null)))}}},{context:`Select`,isActive:d===`plugin-list`}),L({"plugin:toggle":()=>{if(E<x.length){let e=x[E];if(e&&!e.isInstalled){let t=new Set(k);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),ie(t)}}},"plugin:install":()=>{k.size>0&&pe()}},{context:`Plugin`,isActive:d===`plugin-list`});let he=jn.useMemo(()=>{if(!g)return[];let e=g.entry.homepage;return Sn(e,xn(g))},[g]);if(L({"select:previous":()=>{ae>0&&oe(ae-1)},"select:next":()=>{ae<he.length-1&&oe(ae+1)},"select:accept":()=>{if(!g)return;let e=he[ae]?.action,t=g.entry.homepage,n=xn(g);e===`install-user`?F(g,`user`):e===`install-project`?F(g,`project`):e===`install-local`?F(g,`local`):e===`homepage`&&t?b(t):e===`github`&&n?b(`https://github.com/${n}`):e===`back`&&(f(`plugin-list`),_(null))}},{context:`Select`,isActive:d===`plugin-details`&&!!g}),typeof d==`object`&&d.type===`plugin-options`){let{plugin:e,pluginId:t}=d;function n(e){r(e),s&&s(),i({type:`menu`})}return(0,G.jsx)(mn,{plugin:e,pluginId:t,onDone:(t,r)=>{switch(t){case`configured`:n(`✓ Installed and configured ${e.name}. Run /reload-plugins to apply.`);break;case`skipped`:n(`✓ Installed ${e.name}. Run /reload-plugins to apply.`);break;case`error`:n(`Installed but failed to save config: ${r}`);break}}})}if(ne)return(0,G.jsx)(z,{children:`Loading…`});if(e)return(0,G.jsx)(z,{color:`error`,children:e});if(d===`marketplace-list`)return v.length===0?(0,G.jsxs)(R,{flexDirection:`column`,children:[(0,G.jsx)(R,{marginBottom:1,children:(0,G.jsx)(z,{bold:!0,children:`Select marketplace`})}),(0,G.jsx)(z,{children:`No marketplaces configured.`}),(0,G.jsxs)(z,{dimColor:!0,children:[`Add a marketplace first using `,`'Add marketplace'`,`.`]}),(0,G.jsx)(R,{marginTop:1,paddingLeft:1,children:(0,G.jsx)(z,{dimColor:!0,children:(0,G.jsx)(O,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})})})]}):(0,G.jsxs)(R,{flexDirection:`column`,children:[(0,G.jsx)(R,{marginBottom:1,children:(0,G.jsx)(z,{bold:!0,children:`Select marketplace`})}),de&&(0,G.jsx)(R,{marginBottom:1,flexDirection:`column`,children:(0,G.jsxs)(z,{color:`warning`,children:[a.warning,` `,de]})}),v.map((e,t)=>(0,G.jsxs)(R,{flexDirection:`column`,marginBottom:+(t<v.length-1),children:[(0,G.jsx)(R,{children:(0,G.jsxs)(z,{color:E===t?`suggestion`:void 0,children:[E===t?a.pointer:` `,` `,e.name]})}),(0,G.jsx)(R,{marginLeft:2,children:(0,G.jsxs)(z,{dimColor:!0,children:[e.totalPlugins,` `,H(e.totalPlugins,`plugin`),` available`,e.installedCount>0&&` · ${e.installedCount} already installed`,e.source&&` · ${e.source}`]})})]},e.name)),(0,G.jsx)(R,{marginTop:1,children:(0,G.jsx)(z,{dimColor:!0,italic:!0,children:(0,G.jsxs)(B,{children:[(0,G.jsx)(O,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,G.jsx)(O,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]});if(d===`plugin-details`&&g){let e=g.entry.homepage,t=Sn(e,xn(g));return(0,G.jsxs)(R,{flexDirection:`column`,children:[(0,G.jsx)(R,{marginBottom:1,children:(0,G.jsx)(z,{bold:!0,children:`Plugin Details`})}),(0,G.jsxs)(R,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(z,{bold:!0,children:g.entry.name}),g.entry.version&&(0,G.jsxs)(z,{dimColor:!0,children:[`Version: `,g.entry.version]}),g.entry.description&&(0,G.jsx)(R,{marginTop:1,children:(0,G.jsx)(z,{children:g.entry.description})}),g.entry.author&&(0,G.jsx)(R,{marginTop:1,children:(0,G.jsxs)(z,{dimColor:!0,children:[`By:`,` `,typeof g.entry.author==`string`?g.entry.author:g.entry.author.name]})})]}),(0,G.jsxs)(R,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(z,{bold:!0,children:`Will install:`}),g.entry.commands&&(0,G.jsxs)(z,{dimColor:!0,children:[`· Commands:`,` `,Array.isArray(g.entry.commands)?g.entry.commands.join(`, `):Object.keys(g.entry.commands).join(`, `)]}),g.entry.agents&&(0,G.jsxs)(z,{dimColor:!0,children:[`· Agents:`,` `,Array.isArray(g.entry.agents)?g.entry.agents.join(`, `):Object.keys(g.entry.agents).join(`, `)]}),g.entry.hooks&&(0,G.jsxs)(z,{dimColor:!0,children:[`· Hooks: `,Object.keys(g.entry.hooks).join(`, `)]}),g.entry.mcpServers&&(0,G.jsxs)(z,{dimColor:!0,children:[`· MCP Servers:`,` `,Array.isArray(g.entry.mcpServers)?g.entry.mcpServers.join(`, `):typeof g.entry.mcpServers==`object`?Object.keys(g.entry.mcpServers).join(`, `):`configured`]}),!g.entry.commands&&!g.entry.agents&&!g.entry.hooks&&!g.entry.mcpServers&&(0,G.jsx)(G.Fragment,{children:typeof g.entry.source==`object`&&`source`in g.entry.source&&(g.entry.source.source===`github`||g.entry.source.source===`url`||g.entry.source.source===`npm`||g.entry.source.source===`pip`)?(0,G.jsx)(z,{dimColor:!0,children:`· Component summary not available for remote plugin`}):(0,G.jsx)(z,{dimColor:!0,children:`· Components will be discovered at installation`})})]}),(0,G.jsx)(vn,{}),P&&(0,G.jsx)(R,{marginBottom:1,children:(0,G.jsxs)(z,{color:`error`,children:[`Error: `,P]})}),(0,G.jsx)(R,{flexDirection:`column`,children:t.map((e,t)=>(0,G.jsxs)(R,{children:[ae===t&&(0,G.jsx)(z,{children:`> `}),ae!==t&&(0,G.jsx)(z,{children:` `}),(0,G.jsx)(z,{bold:ae===t,children:se&&e.action===`install`?`Installing…`:e.label})]},e.action))}),(0,G.jsx)(R,{marginTop:1,paddingLeft:1,children:(0,G.jsx)(z,{dimColor:!0,children:(0,G.jsxs)(B,{children:[(0,G.jsx)(O,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,G.jsx)(O,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(x.length===0)return(0,G.jsxs)(R,{flexDirection:`column`,children:[(0,G.jsx)(R,{marginBottom:1,children:(0,G.jsx)(z,{bold:!0,children:`Install plugins`})}),(0,G.jsx)(z,{dimColor:!0,children:`No new plugins available to install.`}),(0,G.jsx)(z,{dimColor:!0,children:`All plugins from this marketplace are already installed.`}),(0,G.jsx)(R,{marginLeft:3,children:(0,G.jsx)(z,{dimColor:!0,italic:!0,children:(0,G.jsx)(O,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})})})]});let ge=M.getVisibleItems(x);return(0,G.jsxs)(R,{flexDirection:`column`,children:[(0,G.jsx)(R,{marginBottom:1,children:(0,G.jsx)(z,{bold:!0,children:`Install Plugins`})}),M.scrollPosition.canScrollUp&&(0,G.jsx)(R,{children:(0,G.jsxs)(z,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),ge.map((t,n)=>{let r=M.toActualIndex(n),i=E===r,o=k.has(t.pluginId),s=A.has(t.pluginId);return(0,G.jsxs)(R,{flexDirection:`column`,marginBottom:n===ge.length-1&&!e?0:1,children:[(0,G.jsxs)(R,{children:[(0,G.jsxs)(z,{color:i?`suggestion`:void 0,children:[i?a.pointer:` `,` `]}),(0,G.jsxs)(z,{color:t.isInstalled?`success`:void 0,children:[t.isInstalled?a.tick:s?a.ellipsis:o?a.radioOn:a.radioOff,` `,t.entry.name,t.entry.category&&(0,G.jsxs)(z,{dimColor:!0,children:[` [`,t.entry.category,`]`]}),t.entry.tags?.includes(`community-managed`)&&(0,G.jsx)(z,{dimColor:!0,children:` [Community Managed]`}),t.isInstalled&&(0,G.jsx)(z,{dimColor:!0,children:` (installed)`}),w&&m===`claude-plugins-official`&&(0,G.jsxs)(z,{dimColor:!0,children:[` · `,Mt(w.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,G.jsxs)(R,{marginLeft:4,children:[(0,G.jsx)(z,{dimColor:!0,children:ht(t.entry.description,60)}),t.entry.version&&(0,G.jsxs)(z,{dimColor:!0,children:[` · v`,t.entry.version]})]})]},t.pluginId)}),M.scrollPosition.canScrollDown&&(0,G.jsx)(R,{children:(0,G.jsxs)(z,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,G.jsx)(R,{marginTop:1,children:(0,G.jsxs)(z,{color:`error`,children:[a.cross,` `,e]})}),(0,G.jsx)(Cn,{hasSelection:k.size>0})]})}var jn,W,G,Mn=e((()=>{i(),jn=t(V(),1),W=t(V(),1),_(),We(),v(),nt(),h(),$e(),Ye(),de(),kt(),ke(),Ce(),Me(),le(),P(),g(),_t(),gt(),_n(),bn(),Tn(),kn(),G=qe()}));function Nn({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:s,onSearchModeChange:c,targetPlugin:l}){let[d,f]=(0,K.useState)(`plugin-list`),[m,h]=(0,K.useState)(null),[g,_]=(0,K.useState)([]),[v,y]=(0,K.useState)(!0),[te,x]=(0,K.useState)(null),[S,ne]=(0,K.useState)(!1),C=(0,K.useCallback)(e=>{ne(e),c?.(e)},[c]),{query:w,setQuery:T,cursorOffset:E}=Wt({isActive:d===`plugin-list`&&S&&!v,onExit:()=>{C(!1)}}),re=Le(),{columns:D}=He(),k=(0,K.useMemo)(()=>{if(!w)return g;let e=w.toLowerCase();return g.filter(t=>t.entry.name.toLowerCase().includes(e)||t.entry.description?.toLowerCase().includes(e)||t.marketplaceName.toLowerCase().includes(e))},[g,w]),[A,j]=(0,K.useState)(0),[M,ae]=(0,K.useState)(new Set),[oe,se]=(0,K.useState)(new Set),N=En({totalItems:k.length,selectedIndex:A});(0,K.useEffect)(()=>{j(0)},[w]);let[P,le]=(0,K.useState)(0),[de,fe]=(0,K.useState)(!1),[pe,F]=(0,K.useState)(null),[he,ge]=(0,K.useState)(null),[_e,ve]=(0,K.useState)(null);(0,K.useEffect)(()=>{async function e(){try{let e=await u(),{marketplaces:n,failures:r}=await ue(e),i=[];for(let{name:e,data:t}of n)if(t)for(let n of t.plugins){let t=ce(n.name,e);i.push({entry:n,marketplaceName:e,pluginId:t,isInstalled:p(t)})}let a=i.filter(e=>!e.isInstalled&&!ee(e.pluginId));try{let e=await Nt();x(e),e?a.sort((t,n)=>{let r=e.get(t.pluginId)??0,i=e.get(n.pluginId)??0;return r===i?t.entry.name.localeCompare(n.entry.name):i-r}):a.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}catch(e){Qe(`Failed to fetch install counts: ${Je(e)}`),a.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}_(a);let o=Object.keys(e).length;if(a.length===0){let e=await ie({configuredMarketplaceCount:o,failedMarketplaceCount:r.length});ve(e)}let s=me(r,tt(n,e=>e.data!==null));if(s)if(s.type===`warning`)ge(s.message+`. Showing available plugins.`);else throw Error(s.message);if(l){let e=i.find(e=>e.entry.name===l);e?e.isInstalled?t(`Plugin '${e.pluginId}' is already installed. Use '/plugin' to manage existing plugins.`):(h(e),f(`plugin-details`)):t(`Plugin "${l}" not found in any marketplace`)}}catch(e){t(e instanceof Error?e.message:`Failed to load plugins`)}finally{y(!1)}}e()},[t,l]);let ye=async()=>{if(M.size===0)return;let e=g.filter(e=>M.has(e.pluginId));se(new Set(e.map(e=>e.pluginId)));let n=0,a=0,c=[];for(let t of e){let e=await De({pluginId:t.pluginId,entry:t.entry,marketplaceName:t.marketplaceName,scope:`user`});e.success?n++:(a++,c.push({name:t.entry.name,reason:e.error}))}se(new Set),ae(new Set),we(),a===0?r(`✓ Installed ${n} ${H(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${o(c,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${o(c,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&s&&await s(),i({type:`menu`})},be=async(e,t=`user`)=>{fe(!0),F(null);let n=await De({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await pn(e.pluginId);if(t){fe(!1),f({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),s&&await s(),i({type:`menu`})}else fe(!1),F(n.error)};(0,K.useEffect)(()=>{e&&r(e)},[e,r]),Ie(`confirm:no`,()=>{f(`plugin-list`),h(null)},{context:`Confirmation`,isActive:d===`plugin-details`}),Ie(`confirm:no`,()=>{i({type:`menu`})},{context:`Confirmation`,isActive:d===`plugin-list`&&!S}),Re((e,t)=>{let n=!t.ctrl&&!t.meta;S||(e===`/`&&n?(C(!0),T(``)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==`i`&&(C(!0),T(e)))},{isActive:d===`plugin-list`&&!v}),L({"select:previous":()=>{A===0?C(!0):N.handleSelectionChange(A-1,j)},"select:next":()=>{A<k.length-1&&N.handleSelectionChange(A+1,j)},"select:accept":()=>{if(A===k.length&&M.size>0)ye();else if(A<k.length){let e=k[A];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(h(e),f(`plugin-details`),le(0),F(null)))}}},{context:`Select`,isActive:d===`plugin-list`&&!S}),L({"plugin:toggle":()=>{if(A<k.length){let e=k[A];if(e&&!e.isInstalled){let t=new Set(M);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),ae(t)}}},"plugin:install":()=>{M.size>0&&ye()}},{context:`Plugin`,isActive:d===`plugin-list`&&!S});let xe=In.useMemo(()=>{if(!m)return[];let e=m.entry.homepage;return Sn(e,xn(m))},[m]);if(L({"select:previous":()=>{P>0&&le(P-1)},"select:next":()=>{P<xe.length-1&&le(P+1)},"select:accept":()=>{if(!m)return;let e=xe[P]?.action,t=m.entry.homepage,n=xn(m);e===`install-user`?be(m,`user`):e===`install-project`?be(m,`project`):e===`install-local`?be(m,`local`):e===`homepage`&&t?b(t):e===`github`&&n?b(`https://github.com/${n}`):e===`back`&&(f(`plugin-list`),h(null))}},{context:`Select`,isActive:d===`plugin-details`&&!!m}),typeof d==`object`&&d.type===`plugin-options`){let{plugin:e,pluginId:t}=d;function n(e){r(e),s&&s(),i({type:`menu`})}return(0,q.jsx)(mn,{plugin:e,pluginId:t,onDone:(t,r)=>{switch(t){case`configured`:n(`✓ Installed and configured ${e.name}. Run /reload-plugins to apply.`);break;case`skipped`:n(`✓ Installed ${e.name}. Run /reload-plugins to apply.`);break;case`error`:n(`Installed but failed to save config: ${r}`);break}}})}if(v)return(0,q.jsx)(z,{children:`Loading…`});if(e)return(0,q.jsx)(z,{color:`error`,children:e});if(d===`plugin-details`&&m){let e=m.entry.homepage,t=Sn(e,xn(m));return(0,q.jsxs)(R,{flexDirection:`column`,children:[(0,q.jsx)(R,{marginBottom:1,children:(0,q.jsx)(z,{bold:!0,children:`Plugin details`})}),(0,q.jsxs)(R,{flexDirection:`column`,marginBottom:1,children:[(0,q.jsx)(z,{bold:!0,children:m.entry.name}),(0,q.jsxs)(z,{dimColor:!0,children:[`from `,m.marketplaceName]}),m.entry.version&&(0,q.jsxs)(z,{dimColor:!0,children:[`Version: `,m.entry.version]}),m.entry.description&&(0,q.jsx)(R,{marginTop:1,children:(0,q.jsx)(z,{children:m.entry.description})}),m.entry.author&&(0,q.jsx)(R,{marginTop:1,children:(0,q.jsxs)(z,{dimColor:!0,children:[`By:`,` `,typeof m.entry.author==`string`?m.entry.author:m.entry.author.name]})})]}),(0,q.jsx)(vn,{}),pe&&(0,q.jsx)(R,{marginBottom:1,children:(0,q.jsxs)(z,{color:`error`,children:[`Error: `,pe]})}),(0,q.jsx)(R,{flexDirection:`column`,children:t.map((e,t)=>(0,q.jsxs)(R,{children:[P===t&&(0,q.jsx)(z,{children:`> `}),P!==t&&(0,q.jsx)(z,{children:` `}),(0,q.jsx)(z,{bold:P===t,children:de&&e.action.startsWith(`install-`)?`Installing…`:e.label})]},e.action))}),(0,q.jsx)(R,{marginTop:1,children:(0,q.jsx)(z,{dimColor:!0,children:(0,q.jsxs)(B,{children:[(0,q.jsx)(O,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,q.jsx)(O,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(g.length===0)return(0,q.jsxs)(R,{flexDirection:`column`,children:[(0,q.jsx)(R,{marginBottom:1,children:(0,q.jsx)(z,{bold:!0,children:`Discover plugins`})}),(0,q.jsx)(Fn,{reason:_e}),(0,q.jsx)(R,{marginTop:1,children:(0,q.jsx)(z,{dimColor:!0,italic:!0,children:`Esc to go back`})})]});let Se=N.getVisibleItems(k);return(0,q.jsxs)(R,{flexDirection:`column`,children:[(0,q.jsxs)(R,{children:[(0,q.jsx)(z,{bold:!0,children:`Discover plugins`}),N.needsPagination&&(0,q.jsxs)(z,{dimColor:!0,children:[` `,`(`,N.scrollPosition.current,`/`,N.scrollPosition.total,`)`]})]}),(0,q.jsx)(R,{marginBottom:1,children:(0,q.jsx)(Be,{query:w,isFocused:S,isTerminalFocused:re,width:D-4,cursorOffset:E})}),he&&(0,q.jsx)(R,{marginBottom:1,children:(0,q.jsxs)(z,{color:`warning`,children:[a.warning,` `,he]})}),k.length===0&&w&&(0,q.jsx)(R,{marginBottom:1,children:(0,q.jsxs)(z,{dimColor:!0,children:[`No plugins match "`,w,`"`]})}),N.scrollPosition.canScrollUp&&(0,q.jsx)(R,{children:(0,q.jsxs)(z,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),Se.map((t,n)=>{let r=N.toActualIndex(n),i=A===r,o=M.has(t.pluginId),s=oe.has(t.pluginId);return(0,q.jsxs)(R,{flexDirection:`column`,marginBottom:n===Se.length-1&&!e?0:1,children:[(0,q.jsxs)(R,{children:[(0,q.jsxs)(z,{color:i&&!S?`suggestion`:void 0,children:[i&&!S?a.pointer:` `,` `]}),(0,q.jsxs)(z,{children:[s?a.ellipsis:o?a.radioOn:a.radioOff,` `,t.entry.name,(0,q.jsxs)(z,{dimColor:!0,children:[` · `,t.marketplaceName]}),t.entry.tags?.includes(`community-managed`)&&(0,q.jsx)(z,{dimColor:!0,children:` [Community Managed]`}),te&&t.marketplaceName===`claude-plugins-official`&&(0,q.jsxs)(z,{dimColor:!0,children:[` · `,Mt(te.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,q.jsx)(R,{marginLeft:4,children:(0,q.jsx)(z,{dimColor:!0,children:ht(t.entry.description,60)})})]},`${N.startIndex}-${t.pluginId}`)}),N.scrollPosition.canScrollDown&&(0,q.jsx)(R,{children:(0,q.jsxs)(z,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,q.jsx)(R,{marginTop:1,children:(0,q.jsxs)(z,{color:`error`,children:[a.cross,` `,e]})}),(0,q.jsx)(Pn,{hasSelection:M.size>0,canToggle:A<k.length&&!k[A]?.isInstalled})]})}function Pn({hasSelection:e,canToggle:t}){return(0,q.jsx)(R,{marginTop:1,children:(0,q.jsx)(z,{dimColor:!0,italic:!0,children:(0,q.jsxs)(B,{children:[e&&(0,q.jsx)(O,{action:`plugin:install`,context:`Plugin`,fallback:`i`,description:`install`,bold:!0}),(0,q.jsx)(z,{children:`type to search`}),t&&(0,q.jsx)(O,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,q.jsx)(O,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,q.jsx)(O,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})}function Fn({reason:e}){switch(e){case`git-not-installed`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(z,{dimColor:!0,children:`Git is required to install marketplaces.`}),(0,q.jsx)(z,{dimColor:!0,children:`Please install git and restart Work Mate.`})]});case`all-blocked-by-policy`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(z,{dimColor:!0,children:`Your organization policy does not allow any external marketplaces.`}),(0,q.jsx)(z,{dimColor:!0,children:`Contact your administrator.`})]});case`policy-restricts-sources`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(z,{dimColor:!0,children:`Your organization restricts which marketplaces can be added.`}),(0,q.jsx)(z,{dimColor:!0,children:`Switch to the Marketplaces tab to view allowed sources.`})]});case`all-marketplaces-failed`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(z,{dimColor:!0,children:`Failed to load marketplace data.`}),(0,q.jsx)(z,{dimColor:!0,children:`Check your network connection.`})]});case`all-plugins-installed`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(z,{dimColor:!0,children:`All available plugins are already installed.`}),(0,q.jsx)(z,{dimColor:!0,children:`Check for new plugins later or add more marketplaces.`})]});default:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(z,{dimColor:!0,children:`No plugins available.`}),(0,q.jsx)(z,{dimColor:!0,children:`Add a marketplace first using the Marketplaces tab.`})]})}}var In,K,q,Ln=e((()=>{i(),In=t(V(),1),K=t(V(),1),_(),Ut(),We(),Gt(),N(),v(),nt(),h(),$e(),Ye(),de(),kt(),ke(),Ce(),Me(),le(),P(),g(),_t(),gt(),_n(),bn(),Tn(),kn(),q=qe()}));function Rn({setViewState:e,error:t,setError:n,setResult:r,exitState:i,onManageComplete:o,targetMarketplace:s,action:c}){let[l,d]=(0,Bn.useState)([]),[f,p]=(0,Bn.useState)(!0),[m,h]=(0,Bn.useState)(0),[g,_]=(0,Bn.useState)(!1),[v,b]=(0,Bn.useState)(null),[ee,te]=(0,Bn.useState)(null),[x,ne]=(0,Bn.useState)(null),[C,w]=(0,Bn.useState)(`list`),[T,E]=(0,Bn.useState)(null),[re,D]=(0,Bn.useState)(0),k=(0,Bn.useRef)(!1);(0,Bn.useEffect)(()=>{async function e(){try{let e=await u(),{enabled:r,disabled:i}=await he(),a=[...r,...i],{marketplaces:o,failures:l}=await ue(e),f=[];for(let{name:e,config:t,data:n}of o){let r=a.filter(t=>t.source.endsWith(`@${e}`));f.push({name:e,source:I(t.source),lastUpdated:t.lastUpdated,pluginCount:n?.plugins.length,installedPlugins:r,pendingUpdate:!1,pendingRemove:!1,autoUpdate:ct(e,t)})}f.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),d(f);let p=me(l,tt(o,e=>e.data!==null));if(p)if(p.type===`warning`)b(p.message);else throw Error(p.message);if(s&&!k.current&&!t){k.current=!0;let e=f.findIndex(e=>e.name===s);if(e>=0){let t=f[e];if(c){h(e+1);let t=[...f];c===`update`?t[e].pendingUpdate=!0:c===`remove`&&(t[e].pendingRemove=!0),d(t),setTimeout(j,100,t)}else t&&(h(e+1),E(t),w(`details`))}else n&&n(`Marketplace not found: ${s}`)}}catch(e){n&&n(e instanceof Error?e.message:`Failed to load marketplaces`),b(e instanceof Error?e.message:`Failed to load marketplaces`)}finally{p(!1)}}e()},[s,c,t]);let ie=()=>l.some(e=>e.pendingUpdate||e.pendingRemove),A=()=>({updateCount:tt(l,e=>e.pendingUpdate),removeCount:tt(l,e=>e.pendingRemove)}),j=async t=>{let i=t||l,s=C===`details`;_(!0),b(null),te(null),ne(null);try{let t=rt(`userSettings`),n=0,c=0,l=new Set;for(let e of i){if(e.pendingRemove){if(e.installedPlugins&&e.installedPlugins.length>0){let n={...t?.enabledPlugins};for(let t of e.installedPlugins){let r=ce(t.name,e.name);n[r]=!1}st(`userSettings`,{enabledPlugins:n})}await y(e.name),c++,mt(`tengu_marketplace_removed`,{marketplace_name:e.name,plugins_uninstalled:e.installedPlugins?.length||0});continue}e.pendingUpdate&&(await M(e.name,e=>{ne(e)}),n++,l.add(e.name.toLowerCase()),mt(`tengu_marketplace_updated`,{marketplace_name:e.name}))}let f=0;l.size>0&&(f=(await en(l)).length),we(),o&&await o();let p=await u(),{enabled:m,disabled:h}=await he(),g=[...m,...h],{marketplaces:_}=await ue(p),v=[];for(let{name:e,config:t,data:n}of _){let r=g.filter(t=>t.source.endsWith(`@${e}`));v.push({name:e,source:I(t.source),lastUpdated:t.lastUpdated,pluginCount:n?.plugins.length,installedPlugins:r,pendingUpdate:!1,pendingRemove:!1,autoUpdate:ct(e,t)})}if(v.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),d(v),s&&T){let e=v.find(e=>e.name===T.name);e&&E(e)}let b=[];if(n>0){let e=f>0?` (${f} ${H(f,`plugin`)} bumped)`:``;b.push(`Updated ${n} ${H(n,`marketplace`)}${e}`)}if(c>0&&b.push(`Removed ${c} ${H(c,`marketplace`)}`),b.length>0){let t=`${a.tick} ${b.join(`, `)}`;s?te(t):(r(t),setTimeout(e,2e3,{type:`menu`}))}else s||e({type:`menu`})}catch(e){let t=Je(e);b(t),n&&n(t)}finally{_(!1),ne(null)}},ae=async()=>{if(!T)return;let e=l.map(e=>e.name===T.name?{...e,pendingRemove:!0}:e);d(e),await j(e)},oe=e=>{if(!e)return[];let t=[{label:`Browse plugins (${e.pluginCount??0})`,value:`browse`},{label:`Update marketplace`,secondaryLabel:e.lastUpdated?`(last updated ${new Date(e.lastUpdated).toLocaleDateString()})`:void 0,value:`update`}];return lt()||t.push({label:e.autoUpdate?`Disable auto-update`:`Enable auto-update`,value:`toggle-auto-update`}),t.push({label:`Remove marketplace`,value:`remove`}),t},se=async e=>{let t=!e.autoUpdate;try{await S(e.name,t),d(n=>n.map(n=>n.name===e.name?{...n,autoUpdate:t}:n)),E(e=>e&&{...e,autoUpdate:t})}catch(e){b(e instanceof Error?e.message:`Failed to update setting`)}};if(Ie(`confirm:no`,()=>{w(`list`),D(0)},{context:`Confirmation`,isActive:!g&&(C===`details`||C===`confirm-remove`)}),Ie(`confirm:no`,()=>{d(e=>e.map(e=>({...e,pendingUpdate:!1,pendingRemove:!1}))),h(0)},{context:`Confirmation`,isActive:!g&&C===`list`&&ie()}),Ie(`confirm:no`,()=>{e({type:`menu`})},{context:`Confirmation`,isActive:!g&&C===`list`&&!ie()}),L({"select:previous":()=>h(e=>Math.max(0,e-1)),"select:next":()=>{let e=l.length+1;h(t=>Math.min(e-1,t+1))},"select:accept":()=>{let t=m-1;if(m===0)e({type:`add-marketplace`});else if(ie())j();else{let e=l[t];e&&(E(e),w(`details`),D(0))}}},{context:`Select`,isActive:!g&&C===`list`}),Re(e=>{let t=m-1;if((e===`u`||e===`U`)&&t>=0)d(e=>e.map((e,n)=>n===t?{...e,pendingUpdate:!e.pendingUpdate,pendingRemove:e.pendingUpdate?e.pendingRemove:!1}:e));else if((e===`r`||e===`R`)&&t>=0){let e=l[t];e&&(E(e),w(`confirm-remove`))}},{isActive:!g&&C===`list`}),L({"select:previous":()=>D(e=>Math.max(0,e-1)),"select:next":()=>{let e=oe(T);D(t=>Math.min(e.length-1,t+1))},"select:accept":()=>{if(!T)return;let t=oe(T)[re];if(t?.value===`browse`)e({type:`browse-marketplace`,targetMarketplace:T.name});else if(t?.value===`update`){let e=l.map(e=>e.name===T.name?{...e,pendingUpdate:!0}:e);d(e),j(e)}else t?.value===`toggle-auto-update`?se(T):t?.value===`remove`&&w(`confirm-remove`)}},{context:`Select`,isActive:!g&&C===`details`}),Re(e=>{e===`y`||e===`Y`?ae():(e===`n`||e===`N`)&&(w(`list`),E(null))},{isActive:!g&&C===`confirm-remove`}),f)return(0,J.jsx)(z,{children:`Loading marketplaces…`});if(l.length===0)return(0,J.jsxs)(R,{flexDirection:`column`,children:[(0,J.jsx)(R,{marginBottom:1,children:(0,J.jsx)(z,{bold:!0,children:`Manage marketplaces`})}),(0,J.jsxs)(R,{flexDirection:`row`,gap:1,children:[(0,J.jsxs)(z,{color:`suggestion`,children:[a.pointer,` +`]}),(0,J.jsx)(z,{bold:!0,color:`suggestion`,children:`Add Marketplace`})]}),(0,J.jsx)(R,{marginLeft:3,children:(0,J.jsx)(z,{dimColor:!0,italic:!0,children:i.pending?(0,J.jsxs)(J.Fragment,{children:[`Press `,i.keyName,` again to go back`]}):(0,J.jsxs)(B,{children:[(0,J.jsx)(O,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,J.jsx)(O,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]});if(C===`confirm-remove`&&T){let e=T.installedPlugins?.length||0;return(0,J.jsxs)(R,{flexDirection:`column`,children:[(0,J.jsxs)(z,{bold:!0,color:`warning`,children:[`Remove marketplace `,(0,J.jsx)(z,{italic:!0,children:T.name}),`?`]}),(0,J.jsxs)(R,{flexDirection:`column`,children:[e>0&&(0,J.jsx)(R,{marginTop:1,children:(0,J.jsxs)(z,{color:`warning`,children:[`This will also uninstall `,e,` `,H(e,`plugin`),` from this marketplace:`]})}),T.installedPlugins&&T.installedPlugins.length>0&&(0,J.jsx)(R,{flexDirection:`column`,marginTop:1,marginLeft:2,children:T.installedPlugins.map(e=>(0,J.jsxs)(z,{dimColor:!0,children:[`• `,e.name]},e.name))}),(0,J.jsx)(R,{marginTop:1,children:(0,J.jsxs)(z,{children:[`Press `,(0,J.jsx)(z,{bold:!0,children:`y`}),` to confirm or `,(0,J.jsx)(z,{bold:!0,children:`n`}),` to cancel`]})})]})]})}if(C===`details`&&T){let e=T.pendingUpdate||g,t=oe(T);return(0,J.jsxs)(R,{flexDirection:`column`,children:[(0,J.jsx)(z,{bold:!0,children:T.name}),(0,J.jsx)(z,{dimColor:!0,children:T.source}),(0,J.jsx)(R,{marginTop:1,children:(0,J.jsxs)(z,{children:[T.pluginCount||0,` available `,H(T.pluginCount||0,`plugin`)]})}),T.installedPlugins&&T.installedPlugins.length>0&&(0,J.jsxs)(R,{flexDirection:`column`,marginTop:1,children:[(0,J.jsxs)(z,{bold:!0,children:[`Installed plugins (`,T.installedPlugins.length,`):`]}),(0,J.jsx)(R,{flexDirection:`column`,marginLeft:1,children:T.installedPlugins.map(e=>(0,J.jsxs)(R,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(z,{children:a.bullet}),(0,J.jsxs)(R,{flexDirection:`column`,children:[(0,J.jsx)(z,{children:e.name}),(0,J.jsx)(z,{dimColor:!0,children:e.manifest.description})]})]},e.name))})]}),e&&(0,J.jsxs)(R,{marginTop:1,flexDirection:`column`,children:[(0,J.jsx)(z,{color:`claude`,children:`Updating marketplace…`}),x&&(0,J.jsx)(z,{dimColor:!0,children:x})]}),!e&&ee&&(0,J.jsx)(R,{marginTop:1,children:(0,J.jsx)(z,{color:`claude`,children:ee})}),!e&&v&&(0,J.jsx)(R,{marginTop:1,children:(0,J.jsx)(z,{color:`error`,children:v})}),!e&&(0,J.jsx)(R,{flexDirection:`column`,marginTop:1,children:t.map((e,t)=>{if(!e)return null;let n=t===re;return(0,J.jsxs)(R,{children:[(0,J.jsxs)(z,{color:n?`suggestion`:void 0,children:[n?a.pointer:` `,` `,e.label]}),e.secondaryLabel&&(0,J.jsxs)(z,{dimColor:!0,children:[` `,e.secondaryLabel]})]},e.value)})}),!e&&!lt()&&T.autoUpdate&&(0,J.jsx)(R,{marginTop:1,children:(0,J.jsx)(z,{dimColor:!0,children:`Auto-update enabled. Work Mate will automatically update this marketplace and its installed plugins.`})}),(0,J.jsx)(R,{marginLeft:3,children:(0,J.jsx)(z,{dimColor:!0,italic:!0,children:e?(0,J.jsx)(J.Fragment,{children:`Please wait…`}):(0,J.jsxs)(B,{children:[(0,J.jsx)(O,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,J.jsx)(O,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]})}let{updateCount:N,removeCount:P}=A();return(0,J.jsxs)(R,{flexDirection:`column`,children:[(0,J.jsx)(R,{marginBottom:1,children:(0,J.jsx)(z,{bold:!0,children:`Manage marketplaces`})}),(0,J.jsxs)(R,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(z,{color:m===0?`suggestion`:void 0,children:[m===0?a.pointer:` `,` +`]}),(0,J.jsx)(z,{bold:!0,color:m===0?`suggestion`:void 0,children:`Add Marketplace`})]}),(0,J.jsx)(R,{flexDirection:`column`,children:l.map((e,t)=>{let n=t+1===m,r=[];return e.pendingUpdate&&r.push(`UPDATE`),e.pendingRemove&&r.push(`REMOVE`),(0,J.jsxs)(R,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(z,{color:n?`suggestion`:void 0,children:[n?a.pointer:` `,` `,e.pendingRemove?a.cross:a.bullet]}),(0,J.jsxs)(R,{flexDirection:`column`,flexGrow:1,children:[(0,J.jsxs)(R,{flexDirection:`row`,gap:1,children:[(0,J.jsxs)(z,{bold:!0,strikethrough:e.pendingRemove,dimColor:e.pendingRemove,children:[e.name===`claude-plugins-official`&&(0,J.jsx)(z,{color:`claude`,children:`✻ `}),e.name,e.name===`claude-plugins-official`&&(0,J.jsx)(z,{color:`claude`,children:` ✻`})]}),r.length>0&&(0,J.jsxs)(z,{color:`warning`,children:[`[`,r.join(`, `),`]`]})]}),(0,J.jsx)(z,{dimColor:!0,children:e.source}),(0,J.jsxs)(z,{dimColor:!0,children:[e.pluginCount!==void 0&&(0,J.jsxs)(J.Fragment,{children:[e.pluginCount,` available`]}),e.installedPlugins&&e.installedPlugins.length>0&&(0,J.jsxs)(J.Fragment,{children:[` • `,e.installedPlugins.length,` installed`]}),e.lastUpdated&&(0,J.jsxs)(J.Fragment,{children:[` • Updated `,new Date(e.lastUpdated).toLocaleDateString()]})]})]})]},e.name)})}),ie()&&(0,J.jsxs)(R,{marginTop:1,flexDirection:`column`,children:[(0,J.jsxs)(z,{children:[(0,J.jsx)(z,{bold:!0,children:`Pending changes:`}),` `,(0,J.jsx)(z,{dimColor:!0,children:`Enter to apply`})]}),N>0&&(0,J.jsxs)(z,{children:[`• Update `,N,` `,H(N,`marketplace`)]}),P>0&&(0,J.jsxs)(z,{color:`warning`,children:[`• Remove `,P,` `,H(P,`marketplace`)]})]}),g&&(0,J.jsx)(R,{marginTop:1,children:(0,J.jsx)(z,{color:`claude`,children:`Processing changes…`})}),v&&(0,J.jsx)(R,{marginTop:1,children:(0,J.jsx)(z,{color:`error`,children:v})}),(0,J.jsx)(zn,{exitState:i,hasPendingActions:ie()})]})}function zn({exitState:e,hasPendingActions:t}){return e.pending?(0,J.jsx)(R,{marginTop:1,children:(0,J.jsxs)(z,{dimColor:!0,italic:!0,children:[`Press `,e.keyName,` again to go back`]})}):(0,J.jsx)(R,{marginTop:1,children:(0,J.jsx)(z,{dimColor:!0,italic:!0,children:(0,J.jsxs)(B,{children:[t&&(0,J.jsx)(O,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`apply changes`}),!t&&(0,J.jsx)(O,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),!t&&(0,J.jsx)(Ne,{shortcut:`u`,action:`update`}),!t&&(0,J.jsx)(Ne,{shortcut:`r`,action:`remove`}),(0,J.jsx)(O,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:t?`cancel`:`go back`})]})})})}var Bn,J,Vn=e((()=>{i(),V(),Bn=t(V(),1),pt(),_(),We(),v(),nt(),ut(),Ye(),de(),Ce(),Me(),tn(),F(),ot(),at(),_t(),J=qe()}));function Hn(e){switch(e.type){case`path-not-found`:return`${e.component} path not found: ${e.path}`;case`git-auth-failed`:return`Git ${e.authType.toUpperCase()} authentication failed for ${e.gitUrl}`;case`git-timeout`:return`Git ${e.operation} timed out for ${e.gitUrl}`;case`network-error`:return`Network error accessing ${e.url}${e.details?`: ${e.details}`:``}`;case`manifest-parse-error`:return`Failed to parse manifest at ${e.manifestPath}: ${e.parseError}`;case`manifest-validation-error`:return`Invalid manifest at ${e.manifestPath}: ${e.validationErrors.join(`, `)}`;case`plugin-not-found`:return`Plugin "${e.pluginId}" not found in marketplace "${e.marketplace}"`;case`marketplace-not-found`:return`Marketplace "${e.marketplace}" not found`;case`marketplace-load-failed`:return`Failed to load marketplace "${e.marketplace}": ${e.reason}`;case`mcp-config-invalid`:return`Invalid MCP server config for "${e.serverName}": ${e.validationError}`;case`mcp-server-suppressed-duplicate`:{let t=e.duplicateOf.startsWith(`plugin:`)?`server provided by plugin "${e.duplicateOf.split(`:`)[1]??`?`}"`:`already-configured "${e.duplicateOf}"`;return`MCP server "${e.serverName}" skipped — same command/URL as ${t}`}case`hook-load-failed`:return`Failed to load hooks from ${e.hookPath}: ${e.reason}`;case`component-load-failed`:return`Failed to load ${e.component} from ${e.path}: ${e.reason}`;case`mcpb-download-failed`:return`Failed to download MCPB from ${e.url}: ${e.reason}`;case`mcpb-extract-failed`:return`Failed to extract MCPB ${e.mcpbPath}: ${e.reason}`;case`mcpb-invalid-manifest`:return`MCPB manifest invalid at ${e.mcpbPath}: ${e.validationError}`;case`marketplace-blocked-by-policy`:return e.blockedByBlocklist?`Marketplace "${e.marketplace}" is blocked by enterprise policy`:`Marketplace "${e.marketplace}" is not in the allowed marketplace list`;case`dependency-unsatisfied`:return e.reason===`not-enabled`?`Dependency "${e.dependency}" is disabled`:`Dependency "${e.dependency}" is not installed`;case`lsp-config-invalid`:return`Invalid LSP server config for "${e.serverName}": ${e.validationError}`;case`lsp-server-start-failed`:return`LSP server "${e.serverName}" failed to start: ${e.reason}`;case`lsp-server-crashed`:return e.signal?`LSP server "${e.serverName}" crashed with signal ${e.signal}`:`LSP server "${e.serverName}" crashed with exit code ${e.exitCode??`unknown`}`;case`lsp-request-timeout`:return`LSP server "${e.serverName}" timed out on ${e.method} after ${e.timeoutMs}ms`;case`lsp-request-failed`:return`LSP server "${e.serverName}" ${e.method} failed: ${e.error}`;case`plugin-cache-miss`:return`Plugin "${e.plugin}" not cached at ${e.installPath}`;case`generic-error`:return e.error}return Ee(e)}function Un(e){switch(e.type){case`path-not-found`:return`Check that the path in your manifest or marketplace config is correct`;case`git-auth-failed`:return e.authType===`ssh`?`Configure SSH keys or use HTTPS URL instead`:`Configure credentials or use SSH URL instead`;case`git-timeout`:case`network-error`:return`Check your internet connection and try again`;case`manifest-parse-error`:return`Check manifest file syntax in the plugin directory`;case`manifest-validation-error`:return`Check manifest file follows the required schema`;case`plugin-not-found`:return`Plugin may not exist in marketplace "${e.marketplace}"`;case`marketplace-not-found`:return e.availableMarketplaces.length>0?`Available marketplaces: ${e.availableMarketplaces.join(`, `)}`:`Add the marketplace first using /plugin marketplace add`;case`mcp-config-invalid`:return`Check MCP server configuration in .mcp.json or manifest`;case`mcp-server-suppressed-duplicate`:return e.duplicateOf.startsWith(`plugin:`)?`Disable plugin "${e.duplicateOf.split(`:`)[1]??`the other plugin`}" if you want this plugin's version instead`:`Remove "${e.duplicateOf}" from your MCP config if you want the plugin's version instead`;case`hook-load-failed`:return`Check hooks.json file syntax and structure`;case`component-load-failed`:return`Check ${e.component} directory structure and file permissions`;case`mcpb-download-failed`:return`Check your internet connection and URL accessibility`;case`mcpb-extract-failed`:return`Verify the MCPB file is valid and not corrupted`;case`mcpb-invalid-manifest`:return`Contact the plugin author about the invalid manifest`;case`marketplace-blocked-by-policy`:return e.blockedByBlocklist?`This marketplace source is explicitly blocked by your administrator`:e.allowedSources.length>0?`Allowed sources: ${e.allowedSources.join(`, `)}`:`Contact your administrator to configure allowed marketplace sources`;case`dependency-unsatisfied`:return e.reason===`not-enabled`?`Enable "${e.dependency}" or uninstall "${e.plugin}"`:`Install "${e.dependency}" or uninstall "${e.plugin}"`;case`lsp-config-invalid`:return`Check LSP server configuration in the plugin manifest`;case`lsp-server-start-failed`:case`lsp-server-crashed`:case`lsp-request-timeout`:case`lsp-request-failed`:return`Check LSP server logs with --debug for details`;case`plugin-cache-miss`:return`Run /plugins to refresh the plugin cache`;case`marketplace-load-failed`:case`generic-error`:return null}return null}var Wn=e((()=>{je()}));function Gn({item:e,isSelected:t}){let[n]=Fe();if(e.type===`plugin`){let r,i;return e.pendingToggle?(r=ze(`suggestion`,n)(a.arrowRight),i=e.pendingToggle===`will-enable`?`will enable`:`will disable`):e.errorCount>0?(r=ze(`error`,n)(a.cross),i=`${e.errorCount} ${H(e.errorCount,`error`)}`):e.isEnabled?(r=ze(`success`,n)(a.tick),i=`enabled`):(r=ze(`inactive`,n)(a.radioOff),i=`disabled`),(0,Y.jsxs)(R,{children:[(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(z,{dimColor:!t,children:[` `,(0,Y.jsx)(z,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(z,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(z,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(z,{dimColor:!t,children:i})]})}if(e.type===`flagged-plugin`){let r=ze(`warning`,n)(a.warning);return(0,Y.jsxs)(R,{children:[(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(z,{dimColor:!t,children:[` `,(0,Y.jsx)(z,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(z,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(z,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(z,{dimColor:!t,children:`removed`})]})}if(e.type===`failed-plugin`){let r=ze(`error`,n)(a.cross),i=`failed to load · ${e.errorCount} ${H(e.errorCount,`error`)}`;return(0,Y.jsxs)(R,{children:[(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(z,{dimColor:!t,children:[` `,(0,Y.jsx)(z,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(z,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(z,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(z,{dimColor:!t,children:i})]})}let r,i;return e.status===`connected`?(r=ze(`success`,n)(a.tick),i=`connected`):e.status===`disabled`?(r=ze(`inactive`,n)(a.radioOff),i=`disabled`):e.status===`pending`?(r=ze(`inactive`,n)(a.radioOff),i=`connecting…`):e.status===`needs-auth`?(r=ze(`warning`,n)(a.triangleUpOutline),i=`Enter to auth`):(r=ze(`error`,n)(a.cross),i=`failed`),e.indented?(0,Y.jsxs)(R,{children:[(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(z,{dimColor:!t,children:`└ `}),(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(z,{dimColor:!t,children:[` `,(0,Y.jsx)(z,{backgroundColor:`userMessageBackground`,children:`MCP`})]}),(0,Y.jsxs)(z,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(z,{dimColor:!t,children:i})]}):(0,Y.jsxs)(R,{children:[(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(z,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(z,{dimColor:!t,children:[` `,(0,Y.jsx)(z,{backgroundColor:`userMessageBackground`,children:`MCP`})]}),(0,Y.jsxs)(z,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(z,{dimColor:!t,children:i})]})}var Y,Kn=e((()=>{i(),V(),We(),_t(),Y=qe()}));async function qn(e){try{return(await rn.readdir(e,{withFileTypes:!0})).filter(e=>e.isFile()&&e.name.endsWith(`.md`)).map(e=>nn.basename(e.name,`.md`))}catch(t){return Qe(`Failed to read plugin components from ${e}: ${Je(t)}`,{level:`error`}),ft(Ze(t)),[]}}async function Jn(e){try{let t=await rn.readdir(e,{withFileTypes:!0}),n=[];for(let r of t)if(r.isDirectory()||r.isSymbolicLink()){let t=nn.join(e,r.name,`SKILL.md`);try{(await rn.stat(t)).isFile()&&n.push(r.name)}catch{}}return n}catch(t){return Qe(`Failed to read skill directories from ${e}: ${Je(t)}`,{level:`error`}),ft(Ze(t)),[]}}function Yn({plugin:e,marketplace:t}){let[n,r]=(0,X.useState)(null),[i,a]=(0,X.useState)(!0),[o,s]=(0,X.useState)(null);return(0,X.useEffect)(()=>{async function n(){try{if(t===`builtin`){let t=_e(e.name);if(t){let e=t.skills?.map(e=>e.name)??[],n=t.hooks?Object.keys(t.hooks):[],i=t.mcpServers?Object.keys(t.mcpServers):[];r({commands:null,agents:null,skills:e.length>0?e:null,hooks:n.length>0?n:null,mcpServers:i.length>0?i:null})}else s(`Built-in plugin ${e.name} not found`);a(!1);return}let n=(await te(t)).plugins.find(t=>t.name===e.name);if(n){let t=[];e.commandsPath&&t.push(e.commandsPath),e.commandsPaths&&t.push(...e.commandsPaths);let i=[];for(let e of t)if(typeof e==`string`){let t=await qn(e);i.push(...t)}let a=[];e.agentsPath&&a.push(e.agentsPath),e.agentsPaths&&a.push(...e.agentsPaths);let o=[];for(let e of a)if(typeof e==`string`){let t=await qn(e);o.push(...t)}let s=[];e.skillsPath&&s.push(e.skillsPath),e.skillsPaths&&s.push(...e.skillsPaths);let c=[];for(let e of s)if(typeof e==`string`){let t=await Jn(e);c.push(...t)}let l=[];e.hooksConfig&&l.push(Object.keys(e.hooksConfig)),n.hooks&&l.push(n.hooks);let u=[];e.mcpServers&&u.push(Object.keys(e.mcpServers)),n.mcpServers&&u.push(n.mcpServers),r({commands:i.length>0?i:null,agents:o.length>0?o:null,skills:c.length>0?c:null,hooks:l.length>0?l:null,mcpServers:u.length>0?u:null})}else s(`Plugin ${e.name} not found in marketplace`)}catch(e){s(e instanceof Error?e.message:`Failed to load components`)}finally{a(!1)}}n()},[e.name,e.commandsPath,e.commandsPaths,e.agentsPath,e.agentsPaths,e.skillsPath,e.skillsPaths,e.hooksConfig,e.mcpServers,t]),i?null:o?(0,Z.jsxs)(R,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsx)(z,{bold:!0,children:`Components:`}),(0,Z.jsxs)(z,{dimColor:!0,children:[`Error: `,o]})]}):!n||!(n.commands||n.agents||n.skills||n.hooks||n.mcpServers)?null:(0,Z.jsxs)(R,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsx)(z,{bold:!0,children:`Installed components:`}),n.commands?(0,Z.jsxs)(z,{dimColor:!0,children:[`• Commands:`,` `,typeof n.commands==`string`?n.commands:Array.isArray(n.commands)?n.commands.join(`, `):Object.keys(n.commands).join(`, `)]}):null,n.agents?(0,Z.jsxs)(z,{dimColor:!0,children:[`• Agents:`,` `,typeof n.agents==`string`?n.agents:Array.isArray(n.agents)?n.agents.join(`, `):Object.keys(n.agents).join(`, `)]}):null,n.skills?(0,Z.jsxs)(z,{dimColor:!0,children:[`• Skills:`,` `,typeof n.skills==`string`?n.skills:Array.isArray(n.skills)?n.skills.join(`, `):Object.keys(n.skills).join(`, `)]}):null,n.hooks?(0,Z.jsxs)(z,{dimColor:!0,children:[`• Hooks:`,` `,typeof n.hooks==`string`?n.hooks:Array.isArray(n.hooks)?n.hooks.map(String).join(`, `):typeof n.hooks==`object`&&n.hooks!==null?Object.keys(n.hooks).join(`, `):String(n.hooks)]}):null,n.mcpServers?(0,Z.jsxs)(z,{dimColor:!0,children:[`• MCP Servers:`,` `,typeof n.mcpServers==`string`?n.mcpServers:Array.isArray(n.mcpServers)?n.mcpServers.map(String).join(`, `):typeof n.mcpServers==`object`&&n.mcpServers!==null?Object.keys(n.mcpServers).join(`, `):String(n.mcpServers)]}):null]})}async function Xn(e,t){let n=(await te(t))?.plugins.find(t=>t.name===e);return n&&typeof n.source==`string`?`Local plugins cannot be updated remotely. To update, modify the source at: ${n.source}`:null}function Zn(e){return e.filter(e=>{let t=e.source.split(`@`)[1]||`local`;return!ee(`${e.name}@${t}`)})}function Qn({setViewState:e,setResult:t,onManageComplete:n,onSearchModeChange:r,targetPlugin:i,targetMarketplace:o,action:s}){let c=j(e=>e.mcp.clients),u=j(e=>e.mcp.tools),d=j(e=>e.plugins.errors),f=It(),[p,m]=(0,X.useState)(!1),h=(0,X.useCallback)(e=>{m(e),r?.(e)},[r]),g=Le(),{columns:_}=He(),[v,y]=(0,X.useState)(`plugin-list`),{query:ee,setQuery:te,cursorOffset:x}=Wt({isActive:v===`plugin-list`&&p,onExit:()=>{h(!1)}}),[S,C]=(0,X.useState)(null),[T,re]=(0,X.useState)([]),[D,k]=(0,X.useState)([]),[ie,A]=(0,X.useState)(!0),[M,se]=(0,X.useState)(new Map),N=(0,X.useRef)(!1),ce=(0,X.useRef)(void 0),P=zt();Ie(`confirm:no`,$n.useCallback(()=>{if(v===`plugin-details`)y(`plugin-list`),C(null),I(null);else if(typeof v==`object`&&v.type===`failed-plugin-details`)y(`plugin-list`),I(null);else if(v===`configuring`)y(`plugin-details`),Ee(null);else if(typeof v==`object`&&(v.type===`plugin-options`||v.type===`configuring-options`))y(`plugin-list`),C(null),t(`Plugin enabled. Configuration skipped — run /reload-plugins to apply.`),n&&n();else if(typeof v==`object`&&v.type===`flagged-detail`)y(`plugin-list`),I(null);else if(typeof v==`object`&&v.type===`mcp-detail`)y(`plugin-list`),I(null);else if(typeof v==`object`&&v.type===`mcp-tools`)y({type:`mcp-detail`,client:v.client});else if(typeof v==`object`&&v.type===`mcp-tool-detail`)y({type:`mcp-tools`,client:v.client});else{if(M.size>0){t(`Run /reload-plugins to apply plugin changes.`);return}e({type:`menu`})}},[v,e,M,t]),{context:`Confirmation`,isActive:(v!==`plugin-list`||!p)&&v!==`confirm-project-uninstall`&&!(typeof v==`object`&&v.type===`confirm-data-cleanup`)});let le=e=>e.type===`connected`?`connected`:e.type===`disabled`?`disabled`:e.type===`pending`?`pending`:e.type===`needs-auth`?`needs-auth`:`failed`,ue=(0,X.useMemo)(()=>{let e=it(),t=new Map;for(let e of c)if(e.name.startsWith(`plugin:`)){let n=e.name.split(`:`);if(n.length>=3){let r=n[1],i=n.slice(2).join(`:`),a=t.get(r)||[];a.push({displayName:i,client:e}),t.set(r,a)}}let n=[];for(let r of D){let i=`${r.plugin.name}@${r.marketplace}`,a=e?.enabledPlugins?.[i]!==!1,o=d.filter(e=>`plugin`in e&&e.plugin===r.plugin.name||e.source===i||e.source.startsWith(`${r.plugin.name}@`)),s=r.plugin.isBuiltin?`builtin`:r.scope||`user`;n.push({item:{type:`plugin`,id:i,name:r.plugin.name,description:r.plugin.manifest.description,marketplace:r.marketplace,scope:s,isEnabled:a,errorCount:o.length,errors:o,plugin:r.plugin,pendingEnable:r.pendingEnable,pendingUpdate:r.pendingUpdate,pendingToggle:M.get(i)},originalScope:s,childMcps:t.get(r.plugin.name)||[]})}let r=new Set(n.map(({item:e})=>e.id)),i=new Set(n.map(({item:e})=>e.name)),a=new Map;for(let e of d){if(r.has(e.source)||`plugin`in e&&typeof e.plugin==`string`&&i.has(e.plugin))continue;let t=a.get(e.source)||[];t.push(e),a.set(e.source,t)}let o=yt(),s=[];for(let[e,t]of a){if(e in f)continue;let n=fe(e),r=n.name||e,i=n.marketplace||`unknown`,a=o.get(e),c=a===`flag`||a===void 0?`user`:a;s.push({type:`failed-plugin`,id:e,name:r,marketplace:i,scope:c,errorCount:t.length,errors:t})}let l=[];for(let e of c)e.name!==`ide`&&(e.name.startsWith(`plugin:`)||l.push({type:`mcp`,id:`mcp:${e.name}`,name:e.name,description:void 0,scope:e.config.scope,status:le(e),client:e}));let u={flagged:-1,project:0,local:1,user:2,enterprise:3,managed:4,dynamic:5,builtin:6},p=[],m=new Map;for(let{item:e,originalScope:t,childMcps:r}of n){let n=e.scope;m.has(n)||m.set(n,[]),m.get(n).push(e);for(let{displayName:e,client:n}of r){let r=t===`builtin`?`user`:t;m.has(r)||m.set(r,[]),m.get(r).push({type:`mcp`,id:`mcp:${n.name}`,name:e,description:void 0,scope:r,status:le(n),client:n,indented:!0})}}for(let e of l){let t=e.scope;m.has(t)||m.set(t,[]),m.get(t).push(e)}for(let e of s){let t=e.scope;m.has(t)||m.set(t,[]),m.get(t).push(e)}for(let[e,t]of Object.entries(f)){let n=fe(e),r=n.name||e,i=n.marketplace||`unknown`;m.has(`flagged`)||m.set(`flagged`,[]),m.get(`flagged`).push({type:`flagged-plugin`,id:e,name:r,marketplace:i,scope:`flagged`,reason:`delisted`,text:`Removed from marketplace`,flaggedAt:t.flaggedAt})}let h=[...m.keys()].sort((e,t)=>(u[e]??99)-(u[t]??99));for(let e of h){let t=m.get(e),n=[],r=[],i=0;for(;i<t.length;){let e=t[i];if(e.type===`plugin`||e.type===`failed-plugin`||e.type===`flagged-plugin`){let r=[e];i++;let a=t[i];for(;a?.type===`mcp`&&a.indented;)r.push(a),i++,a=t[i];n.push(r)}else e.type===`mcp`&&!e.indented&&r.push(e),i++}n.sort((e,t)=>e[0].name.localeCompare(t[0].name)),r.sort((e,t)=>e.name.localeCompare(t.name));for(let e of n)p.push(...e);p.push(...r)}return p},[D,c,d,M,f]),de=(0,X.useMemo)(()=>ue.filter(e=>e.type===`flagged-plugin`).map(e=>e.id),[ue]);(0,X.useEffect)(()=>{de.length>0&&Ft(de)},[de]);let pe=(0,X.useMemo)(()=>{if(!ee)return ue;let e=ee.toLowerCase();return ue.filter(t=>t.name.toLowerCase().includes(e)||`description`in t&&t.description?.toLowerCase().includes(e))},[ue,ee]),[F,me]=(0,X.useState)(0),ge=En({totalItems:pe.length,selectedIndex:F,maxVisible:8}),[_e,be]=(0,X.useState)(0),[xe,Se]=(0,X.useState)(!1),[Ce,I]=(0,X.useState)(null),[Te,Ee]=(0,X.useState)(null),[De,Oe]=(0,X.useState)(!1),[ke,Ae]=(0,X.useState)(!1);(0,X.useEffect)(()=>{if(!S){Ae(!1);return}async function e(){let e=S.plugin.manifest.mcpServers,t=!1;if(e&&(t=typeof e==`string`&&ve(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&&ve(e))),!t)try{let e=nn.join(S.plugin.path,`..`),n=nn.join(e,`.claude-plugin`,`marketplace.json`),r=Xe(await rn.readFile(n,`utf-8`)).plugins?.find(e=>e.name===S.plugin.name);if(r?.mcpServers){let e=r.mcpServers;t=typeof e==`string`&&ve(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&&ve(e))}}catch(e){Qe(`Failed to read raw marketplace.json: ${e}`)}Ae(t)}e()},[S]),(0,X.useEffect)(()=>{async function e(){A(!0);try{let{enabled:e,disabled:t}=await he(),n=it(),r=Zn([...e,...t]),i={};for(let e of r){let t=e.source.split(`@`)[1]||`local`;i[t]||(i[t]=[]),i[t].push(e)}let a=[];for(let[e,t]of Object.entries(i)){let r=tt(t,t=>{let r=`${t.name}@${e}`;return n?.enabledPlugins?.[r]!==!1}),i=t.length-r;a.push({name:e,installedPlugins:t,enabledCount:r,disabledCount:i})}a.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),re(a);let o=[];for(let e of a)for(let t of e.installedPlugins){let n=`${t.name}@${e.name}`,r=t.isBuiltin?`builtin`:Tt(n).scope;o.push({plugin:t,marketplace:e.name,scope:r,pendingEnable:void 0,pendingUpdate:!1})}k(o),me(0)}finally{A(!1)}}e()},[]),(0,X.useEffect)(()=>{if(!N.current&&i&&T.length>0&&!ie){let{name:e,marketplace:n}=fe(i),r=o??n,a=r?T.filter(e=>e.name===r):T;for(let t of a){let n=t.installedPlugins.find(t=>t.name===e);if(n){let{scope:e}=Tt(`${n.name}@${t.name}`),r={plugin:n,marketplace:t.name,scope:e,pendingEnable:void 0,pendingUpdate:!1};C(r),y(`plugin-details`),ce.current=s,N.current=!0;return}}let c=ue.find(t=>t.type===`failed-plugin`&&t.name===e);c&&c.type===`failed-plugin`&&(y({type:`failed-plugin-details`,plugin:{id:c.id,name:c.name,marketplace:c.marketplace,errors:c.errors,scope:c.scope}}),N.current=!0),!N.current&&s&&(N.current=!0,t(`Plugin "${i}" is not installed in this project`))}},[i,o,T,ie,ue,s,t]);let je=async r=>{if(!S)return;let i=S.scope||`user`,a=i===`builtin`;if(a&&(r===`update`||r===`uninstall`)){I(`Built-in plugins cannot be updated or uninstalled.`);return}if(!a&&!wt(i)&&r!==`update`){I(`This plugin is managed by your organization. Contact your admin to disable it.`);return}Se(!0),I(null);try{let o=`${S.plugin.name}@${S.marketplace}`,s;switch(r){case`enable`:{let e=await bt(o);if(!e.success)throw Error(e.message);break}case`disable`:{let e=await Ct(o);if(!e.success)throw Error(e.message);s=e.reverseDependents;break}case`uninstall`:{if(a||!wt(i))break;if(Dt(o)){Se(!1),y(`confirm-project-uninstall`);return}let e=l().plugins[o],t=!e||e.length<=1?await ne(o):null;if(t){Se(!1),y({type:`confirm-data-cleanup`,size:t});return}let n=await xt(o,i);if(!n.success)throw Error(n.message);s=n.reverseDependents;break}case`update`:{if(a)break;let r=await St(o,i);if(!r.success)throw Error(r.message);if(r.alreadyUpToDate){t(`${S.plugin.name} is already at the latest version (${r.newVersion}).`),n&&await n(),e({type:`menu`});return}break}}we();let c=`${S.plugin.name}@${S.marketplace}`;if(it()?.enabledPlugins?.[c]!==!1){Se(!1),y({type:`plugin-options`});return}let u=r===`enable`?`Enabled`:r===`disable`?`Disabled`:r===`update`?`Updated`:`Uninstalled`,d=s&&s.length>0?` · required by ${s.join(`, `)}`:``;t(`✓ ${u} ${S.plugin.name}${d}. Run /reload-plugins to apply.`),n&&await n(),e({type:`menu`})}catch(e){Se(!1);let t=e instanceof Error?e.message:String(e);I(`Failed to ${r}: ${t}`),ft(Ze(e))}},Me=(0,X.useRef)(je);Me.current=je,(0,X.useEffect)(()=>{if(v===`plugin-details`&&S&&ce.current){let e=ce.current;ce.current=void 0,Me.current(e)}},[v,S]);let Ne=$n.useCallback(()=>{if(F>=pe.length)return;let e=pe[F];if(e?.type!==`flagged-plugin`)if(e?.type===`plugin`){let t=`${e.plugin.name}@${e.marketplace}`,n=it(),r=M.get(t),i=n?.enabledPlugins?.[t]!==!1,a=e.scope;if(a===`builtin`||wt(a)){let e=new Map(M);r?(e.delete(t),(async()=>{try{r===`will-disable`?await bt(t):await Ct(t),we()}catch(e){ft(e)}})()):(e.set(t,i?`will-disable`:`will-enable`),(async()=>{try{i?await Ct(t):await bt(t),we()}catch(e){ft(e)}})()),se(e)}}else e?.type===`mcp`&&P(e.client.name)},[F,pe,M,D,P]);L({"select:previous":()=>{F===0?h(!0):ge.handleSelectionChange(F-1,me)},"select:next":()=>{F<pe.length-1&&ge.handleSelectionChange(F+1,me)},"select:accept":$n.useCallback(()=>{if(F>=pe.length)return;let e=pe[F];if(e?.type===`plugin`){let t=D.find(t=>t.plugin.name===e.plugin.name&&t.marketplace===e.marketplace);t&&(C(t),y(`plugin-details`),be(0),I(null))}else e?.type===`flagged-plugin`?(y({type:`flagged-detail`,plugin:{id:e.id,name:e.name,marketplace:e.marketplace,reason:e.reason,text:e.text,flaggedAt:e.flaggedAt}}),I(null)):e?.type===`failed-plugin`?(y({type:`failed-plugin-details`,plugin:{id:e.id,name:e.name,marketplace:e.marketplace,errors:e.errors,scope:e.scope}}),be(0),I(null)):e?.type===`mcp`&&(y({type:`mcp-detail`,client:e.client}),I(null))},[F,pe,D])},{context:`Select`,isActive:v===`plugin-list`&&!p}),L({"plugin:toggle":Ne},{context:`Plugin`,isActive:v===`plugin-list`&&!p}),L({"select:accept":$n.useCallback(()=>{typeof v!=`object`||v.type!==`flagged-detail`||(Lt(v.plugin.id),y(`plugin-list`))},[v])},{context:`Select`,isActive:typeof v==`object`&&v.type===`flagged-detail`});let Pe=$n.useMemo(()=>{if(v!==`plugin-details`||!S)return[];let e=it(),t=`${S.plugin.name}@${S.marketplace}`,n=e?.enabledPlugins?.[t]!==!1,r=S.marketplace===`builtin`,i=[];return i.push({label:n?`Disable plugin`:`Enable plugin`,action:()=>void je(n?`disable`:`enable`)}),r||(i.push({label:S.pendingUpdate?`Unmark for update`:`Mark for update`,action:async()=>{try{let e=await Xn(S.plugin.name,S.marketplace);if(e){I(e);return}let t=[...D],n=t.findIndex(e=>e.plugin.name===S.plugin.name&&e.marketplace===S.marketplace);n!==-1&&(t[n].pendingUpdate=!S.pendingUpdate,k(t),C({...S,pendingUpdate:!S.pendingUpdate}))}catch(e){I(e instanceof Error?e.message:`Failed to check plugin update availability`)}}}),ke&&i.push({label:`Configure`,action:async()=>{Oe(!0);try{let e=S.plugin.manifest.mcpServers,t=null;if(typeof e==`string`&&ve(e))t=e;else if(Array.isArray(e)){for(let n of e)if(typeof n==`string`&&ve(n)){t=n;break}}if(!t){I(`No MCPB file found in plugin`),Oe(!1);return}let n=`${S.plugin.name}@${S.marketplace}`,r=await w(t,S.plugin.path,n,void 0,void 0,!0);`status`in r&&r.status===`needs-config`?(Ee(r),y(`configuring`)):I(`Failed to load MCPB for configuration`)}catch(e){let t=Je(e);I(`Failed to load configuration: ${t}`)}finally{Oe(!1)}}}),S.plugin.manifest.userConfig&&Object.keys(S.plugin.manifest.userConfig).length>0&&i.push({label:`Configure options`,action:()=>{y({type:`configuring-options`,schema:S.plugin.manifest.userConfig})}}),i.push({label:`Update now`,action:()=>void je(`update`)}),i.push({label:`Uninstall`,action:()=>void je(`uninstall`)})),S.plugin.manifest.homepage&&i.push({label:`Open homepage`,action:()=>void b(S.plugin.manifest.homepage)}),S.plugin.manifest.repository&&i.push({label:`View repository`,action:()=>void b(S.plugin.manifest.repository)}),i.push({label:`Back to plugin list`,action:()=>{y(`plugin-list`),C(null),I(null)}}),i},[v,S,ke,D]);if(L({"select:previous":()=>{_e>0&&be(_e-1)},"select:next":()=>{_e<Pe.length-1&&be(_e+1)},"select:accept":()=>{Pe[_e]&&Pe[_e].action()}},{context:`Select`,isActive:v===`plugin-details`&&!!S}),L({"select:accept":()=>{typeof v==`object`&&v.type===`failed-plugin-details`&&(async()=>{Se(!0),I(null);let e=v.plugin.id,t=v.plugin.scope,r=wt(t)?await xt(e,t,!1):await xt(e,`user`,!1),i=r.success;if(!i){for(let t of[`userSettings`,`projectSettings`,`localSettings`]){let n=rt(t);n?.enabledPlugins?.[e]!==void 0&&(st(t,{enabledPlugins:{...n.enabledPlugins,[e]:void 0}}),i=!0)}we()}i?(n&&await n(),Se(!1),y(`plugin-list`)):(Se(!1),I(r.message))})()}},{context:`Select`,isActive:typeof v==`object`&&v.type===`failed-plugin-details`&&v.plugin.scope!==`managed`}),L({"confirm:yes":()=>{if(!S)return;Se(!0),I(null);let r=`${S.plugin.name}@${S.marketplace}`,{error:i}=st(`localSettings`,{enabledPlugins:{...rt(`localSettings`)?.enabledPlugins,[r]:!1}});if(i){Se(!1),I(`Failed to write settings: ${i.message}`);return}we(),t(`✓ Disabled ${S.plugin.name} in .claude/settings.local.json. Run /reload-plugins to apply.`),n&&n(),e({type:`menu`})},"confirm:no":()=>{y(`plugin-details`),I(null)}},{context:`Confirmation`,isActive:v===`confirm-project-uninstall`&&!!S&&!xe}),Re((r,i)=>{if(!S)return;let o=`${S.plugin.name}@${S.marketplace}`,s=S.scope;if(!s||s===`builtin`||!wt(s))return;let c=async r=>{Se(!0),I(null);try{let i=await xt(o,s,r);if(!i.success)throw Error(i.message);we();let c=r?``:` · data preserved`;t(`${a.tick} ${i.message}${c}`),n&&n(),e({type:`menu`})}catch(e){Se(!1),I(e instanceof Error?e.message:String(e))}};r===`y`||r===`Y`?c(!0):r===`n`||r===`N`?c(!1):i.escape&&(y(`plugin-details`),I(null))},{isActive:typeof v==`object`&&v.type===`confirm-data-cleanup`&&!!S&&!xe}),$n.useEffect(()=>{me(0)},[ee]),Re((e,t)=>{let n=!t.ctrl&&!t.meta;p||(e===`/`&&n?(h(!0),te(``),me(0)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==` `&&(h(!0),te(e),me(0)))},{isActive:v===`plugin-list`}),ie)return(0,Z.jsx)(z,{children:`Loading installed plugins…`});if(ue.length===0)return(0,Z.jsxs)(R,{flexDirection:`column`,children:[(0,Z.jsx)(R,{marginBottom:1,children:(0,Z.jsx)(z,{bold:!0,children:`Manage plugins`})}),(0,Z.jsx)(z,{children:`No plugins or MCP servers installed.`}),(0,Z.jsx)(R,{marginTop:1,children:(0,Z.jsx)(z,{dimColor:!0,children:`Esc to go back`})})]});if(typeof v==`object`&&v.type===`plugin-options`&&S){let r=`${S.plugin.name}@${S.marketplace}`;function i(r){t(r),n&&n(),e({type:`menu`})}return(0,Z.jsx)(mn,{plugin:S.plugin,pluginId:r,onDone:(e,t)=>{switch(e){case`configured`:i(`✓ Enabled and configured ${S.plugin.name}. Run /reload-plugins to apply.`);break;case`skipped`:i(`✓ Enabled ${S.plugin.name}. Run /reload-plugins to apply.`);break;case`error`:i(`Failed to save configuration: ${t}`);break}}})}if(typeof v==`object`&&v.type===`configuring-options`&&S){let e=`${S.plugin.name}@${S.marketplace}`;return(0,Z.jsx)(ln,{title:`Configure ${S.plugin.name}`,subtitle:`Plugin options`,configSchema:v.schema,initialValues:E(e),onSave:n=>{try{ye(e,n,v.schema),we(),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){I(`Failed to save configuration: ${Je(e)}`)}y(`plugin-details`)},onCancel:()=>y(`plugin-details`)})}if(v===`configuring`&&Te&&S){let e=`${S.plugin.name}@${S.marketplace}`;async function n(n){if(!(!Te||!S))try{let r=S.plugin.manifest.mcpServers,i=null;if(typeof r==`string`&&ve(r))i=r;else if(Array.isArray(r)){for(let e of r)if(typeof e==`string`&&ve(e)){i=e;break}}if(!i){I(`No MCPB file found`),y(`plugin-details`);return}await w(i,S.plugin.path,e,void 0,n),I(null),Ee(null),y(`plugin-details`),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){let t=Je(e);I(`Failed to save configuration: ${t}`),y(`plugin-details`)}}function r(){Ee(null),y(`plugin-details`)}return(0,Z.jsx)(ln,{title:`Configure ${Te.manifest.name}`,subtitle:`Plugin: ${S.plugin.name}`,configSchema:Te.configSchema,initialValues:Te.existingConfig,onSave:n,onCancel:r})}if(typeof v==`object`&&v.type===`flagged-detail`){let e=v.plugin;return(0,Z.jsxs)(R,{flexDirection:`column`,children:[(0,Z.jsx)(R,{children:(0,Z.jsxs)(z,{bold:!0,children:[e.name,` @ `,e.marketplace]})}),(0,Z.jsxs)(R,{marginBottom:1,children:[(0,Z.jsx)(z,{dimColor:!0,children:`Status: `}),(0,Z.jsx)(z,{color:`error`,children:`Removed`})]}),(0,Z.jsxs)(R,{marginBottom:1,flexDirection:`column`,children:[(0,Z.jsxs)(z,{color:`error`,children:[`Removed from marketplace · reason: `,e.reason]}),(0,Z.jsx)(z,{children:e.text}),(0,Z.jsxs)(z,{dimColor:!0,children:[`Flagged on `,new Date(e.flaggedAt).toLocaleDateString()]})]}),(0,Z.jsx)(R,{marginTop:1,flexDirection:`column`,children:(0,Z.jsxs)(R,{children:[(0,Z.jsxs)(z,{children:[a.pointer,` `]}),(0,Z.jsx)(z,{color:`suggestion`,children:`Dismiss`})]})}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(O,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`dismiss`}),(0,Z.jsx)(O,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})]})}if(v===`confirm-project-uninstall`&&S)return(0,Z.jsxs)(R,{flexDirection:`column`,children:[(0,Z.jsxs)(z,{bold:!0,color:`warning`,children:[S.plugin.name,` is enabled in .claude/settings.json (shared with your team)`]}),(0,Z.jsxs)(R,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(z,{children:`Disable it just for you in .claude/settings.local.json?`}),(0,Z.jsx)(z,{dimColor:!0,children:`This has the same effect as uninstalling, without affecting other contributors.`})]}),Ce&&(0,Z.jsx)(R,{marginTop:1,children:(0,Z.jsx)(z,{color:`error`,children:Ce})}),(0,Z.jsx)(R,{marginTop:1,children:xe?(0,Z.jsx)(z,{dimColor:!0,children:`Disabling…`}):(0,Z.jsxs)(B,{children:[(0,Z.jsx)(O,{action:`confirm:yes`,context:`Confirmation`,fallback:`y`,description:`disable`}),(0,Z.jsx)(O,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]});if(typeof v==`object`&&v.type===`confirm-data-cleanup`&&S)return(0,Z.jsxs)(R,{flexDirection:`column`,children:[(0,Z.jsxs)(z,{bold:!0,children:[S.plugin.name,` has `,v.size.human,` of persistent data`]}),(0,Z.jsxs)(R,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(z,{children:`Delete it along with the plugin?`}),(0,Z.jsx)(z,{dimColor:!0,children:ae(`${S.plugin.name}@${S.marketplace}`)})]}),Ce&&(0,Z.jsx)(R,{marginTop:1,children:(0,Z.jsx)(z,{color:`error`,children:Ce})}),(0,Z.jsx)(R,{marginTop:1,children:xe?(0,Z.jsx)(z,{dimColor:!0,children:`Uninstalling…`}):(0,Z.jsxs)(z,{children:[(0,Z.jsx)(z,{bold:!0,children:`y`}),` to delete · `,(0,Z.jsx)(z,{bold:!0,children:`n`}),` to keep · `,(0,Z.jsx)(z,{bold:!0,children:`esc`}),` to cancel`]})})]});if(v===`plugin-details`&&S){let e=it(),t=`${S.plugin.name}@${S.marketplace}`,n=e?.enabledPlugins?.[t]!==!1,r=d.filter(e=>`plugin`in e&&e.plugin===S.plugin.name||e.source===t||e.source.startsWith(`${S.plugin.name}@`)),i=r.length===0?null:(0,Z.jsxs)(R,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsxs)(z,{bold:!0,color:`error`,children:[r.length,` `,H(r.length,`error`),`:`]}),r.map((e,t)=>{let n=Un(e);return(0,Z.jsxs)(R,{flexDirection:`column`,marginLeft:2,children:[(0,Z.jsx)(z,{color:`error`,children:Hn(e)}),n&&(0,Z.jsxs)(z,{dimColor:!0,italic:!0,children:[a.arrowRight,` `,n]})]},t)})]});return(0,Z.jsxs)(R,{flexDirection:`column`,children:[(0,Z.jsx)(R,{children:(0,Z.jsxs)(z,{bold:!0,children:[S.plugin.name,` @ `,S.marketplace]})}),(0,Z.jsxs)(R,{children:[(0,Z.jsx)(z,{dimColor:!0,children:`Scope: `}),(0,Z.jsx)(z,{children:S.scope||`user`})]}),S.plugin.manifest.version&&(0,Z.jsxs)(R,{children:[(0,Z.jsx)(z,{dimColor:!0,children:`Version: `}),(0,Z.jsx)(z,{children:S.plugin.manifest.version})]}),S.plugin.manifest.description&&(0,Z.jsx)(R,{marginBottom:1,children:(0,Z.jsx)(z,{children:S.plugin.manifest.description})}),S.plugin.manifest.author&&(0,Z.jsxs)(R,{children:[(0,Z.jsx)(z,{dimColor:!0,children:`Author: `}),(0,Z.jsx)(z,{children:S.plugin.manifest.author.name})]}),(0,Z.jsxs)(R,{marginBottom:1,children:[(0,Z.jsx)(z,{dimColor:!0,children:`Status: `}),(0,Z.jsx)(z,{color:n?`success`:`warning`,children:n?`Enabled`:`Disabled`}),S.pendingUpdate&&(0,Z.jsx)(z,{color:`suggestion`,children:` · Marked for update`})]}),(0,Z.jsx)(Yn,{plugin:S.plugin,marketplace:S.marketplace}),i,(0,Z.jsx)(R,{marginTop:1,flexDirection:`column`,children:Pe.map((e,t)=>{let n=t===_e;return(0,Z.jsxs)(R,{children:[n&&(0,Z.jsxs)(z,{children:[a.pointer,` `]}),!n&&(0,Z.jsx)(z,{children:` `}),(0,Z.jsx)(z,{bold:n,color:e.label.includes(`Uninstall`)?`error`:e.label.includes(`Update`)?`suggestion`:void 0,children:e.label})]},t)})}),xe&&(0,Z.jsx)(R,{marginTop:1,children:(0,Z.jsx)(z,{children:`Processing…`})}),Ce&&(0,Z.jsx)(R,{marginTop:1,children:(0,Z.jsx)(z,{color:`error`,children:Ce})}),(0,Z.jsx)(R,{marginTop:1,children:(0,Z.jsx)(z,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(B,{children:[(0,Z.jsx)(O,{action:`select:previous`,context:`Select`,fallback:`↑`,description:`navigate`}),(0,Z.jsx)(O,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,Z.jsx)(O,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(typeof v==`object`&&v.type===`failed-plugin-details`){let e=v.plugin,t=e.errors[0],n=t?Hn(t):`Failed to load`;return(0,Z.jsxs)(R,{flexDirection:`column`,children:[(0,Z.jsxs)(z,{children:[(0,Z.jsx)(z,{bold:!0,children:e.name}),(0,Z.jsxs)(z,{dimColor:!0,children:[` @ `,e.marketplace]}),(0,Z.jsxs)(z,{dimColor:!0,children:[` (`,e.scope,`)`]})]}),(0,Z.jsx)(z,{color:`error`,children:n}),e.scope===`managed`?(0,Z.jsx)(R,{marginTop:1,children:(0,Z.jsx)(z,{dimColor:!0,children:`Managed by your organization — contact your admin`})}):(0,Z.jsxs)(R,{marginTop:1,children:[(0,Z.jsxs)(z,{color:`suggestion`,children:[a.pointer,` `]}),(0,Z.jsx)(z,{bold:!0,children:`Remove`})]}),xe&&(0,Z.jsx)(z,{children:`Processing…`}),Ce&&(0,Z.jsx)(z,{color:`error`,children:Ce}),(0,Z.jsx)(R,{marginTop:1,children:(0,Z.jsx)(z,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(B,{children:[e.scope!==`managed`&&(0,Z.jsx)(O,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`remove`}),(0,Z.jsx)(O,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(typeof v==`object`&&v.type===`mcp-detail`){let e=v.client,n=oe(u,e.name).length,r=()=>{y({type:`mcp-tools`,client:e})},i=()=>{y(`plugin-list`)},a=e=>{e&&t(e),y(`plugin-list`)},o=e.config.scope,s=e.config.type;return s===`stdio`?(0,Z.jsx)(Kt,{server:{name:e.name,client:e,scope:o,transport:`stdio`,config:e.config},serverToolsCount:n,onViewTools:r,onCancel:i,onComplete:a,borderless:!0}):s===`sse`?(0,Z.jsx)(Qt,{server:{name:e.name,client:e,scope:o,transport:`sse`,isAuthenticated:void 0,config:e.config},serverToolsCount:n,onViewTools:r,onCancel:i,onComplete:a,borderless:!0}):s===`http`?(0,Z.jsx)(Qt,{server:{name:e.name,client:e,scope:o,transport:`http`,isAuthenticated:void 0,config:e.config},serverToolsCount:n,onViewTools:r,onCancel:i,onComplete:a,borderless:!0}):s===`claudeai-proxy`?(0,Z.jsx)(Qt,{server:{name:e.name,client:e,scope:o,transport:`claudeai-proxy`,isAuthenticated:void 0,config:e.config},serverToolsCount:n,onViewTools:r,onCancel:i,onComplete:a,borderless:!0}):(y(`plugin-list`),null)}if(typeof v==`object`&&v.type===`mcp-tools`){let e=v.client,t=e.config.scope,n=e.config.type,r;return r=n===`stdio`?{name:e.name,client:e,scope:t,transport:`stdio`,config:e.config}:n===`sse`?{name:e.name,client:e,scope:t,transport:`sse`,isAuthenticated:void 0,config:e.config}:n===`http`?{name:e.name,client:e,scope:t,transport:`http`,isAuthenticated:void 0,config:e.config}:{name:e.name,client:e,scope:t,transport:`claudeai-proxy`,isAuthenticated:void 0,config:e.config},(0,Z.jsx)($t,{server:r,onSelectTool:t=>{y({type:`mcp-tool-detail`,client:e,tool:t})},onBack:()=>y({type:`mcp-detail`,client:e})})}if(typeof v==`object`&&v.type===`mcp-tool-detail`){let{client:e,tool:t}=v,n=e.config.scope,r=e.config.type,i;return i=r===`stdio`?{name:e.name,client:e,scope:n,transport:`stdio`,config:e.config}:r===`sse`?{name:e.name,client:e,scope:n,transport:`sse`,isAuthenticated:void 0,config:e.config}:r===`http`?{name:e.name,client:e,scope:n,transport:`http`,isAuthenticated:void 0,config:e.config}:{name:e.name,client:e,scope:n,transport:`claudeai-proxy`,isAuthenticated:void 0,config:e.config},(0,Z.jsx)(Zt,{tool:t,server:i,onBack:()=>y({type:`mcp-tools`,client:e})})}let Fe=ge.getVisibleItems(pe);return(0,Z.jsxs)(R,{flexDirection:`column`,children:[(0,Z.jsx)(R,{marginBottom:1,children:(0,Z.jsx)(Be,{query:ee,isFocused:p,isTerminalFocused:g,width:_-4,cursorOffset:x})}),pe.length===0&&ee&&(0,Z.jsx)(R,{marginBottom:1,children:(0,Z.jsxs)(z,{dimColor:!0,children:[`No items match "`,ee,`"`]})}),ge.scrollPosition.canScrollUp&&(0,Z.jsx)(R,{children:(0,Z.jsxs)(z,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),Fe.map((e,t)=>{let n=ge.toActualIndex(t)===F&&!p,r=t>0?Fe[t-1]:null,i=!r||r.scope!==e.scope;return(0,Z.jsxs)($n.Fragment,{children:[i&&(0,Z.jsx)(R,{marginTop:+(t>0),paddingLeft:2,children:(0,Z.jsx)(z,{dimColor:e.scope!==`flagged`,color:e.scope===`flagged`?`warning`:void 0,bold:e.scope===`flagged`,children:(e=>{switch(e){case`flagged`:return`Flagged`;case`project`:return`Project`;case`local`:return`Local`;case`user`:return`User`;case`enterprise`:return`Enterprise`;case`managed`:return`Managed`;case`builtin`:return`Built-in`;case`dynamic`:return`Built-in`;default:return e}})(e.scope)})}),(0,Z.jsx)(Gn,{item:e,isSelected:n})]},e.id)}),ge.scrollPosition.canScrollDown&&(0,Z.jsx)(R,{children:(0,Z.jsxs)(z,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),(0,Z.jsx)(R,{marginTop:1,marginLeft:1,children:(0,Z.jsx)(z,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(B,{children:[(0,Z.jsx)(z,{children:`type to search`}),(0,Z.jsx)(O,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,Z.jsx)(O,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,Z.jsx)(O,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})}),M.size>0&&(0,Z.jsx)(R,{marginLeft:1,children:(0,Z.jsx)(z,{dimColor:!0,italic:!0,children:`Run /reload-plugins to apply changes`})})]})}var $n,X,Z,er=e((()=>{i(),$n=t(V(),1),X=t(V(),1),_(),We(),qt(),Xt(),Jt(),Yt(),Ut(),Gt(),N(),v(),ge(),Bt(),s(),Et(),Ae(),nt(),h(),$e(),Ye(),dt(),de(),ke(),Me(),c(),se(),Rt(),be(),F(),f(),g(),vt(),at(),et(),_t(),Wn(),fn(),_n(),Kn(),kn(),Z=qe()}));function tr(e){if(!e)return{type:`menu`};let t=e.trim().split(/\s+/);switch(t[0]?.toLowerCase()){case`help`:case`--help`:case`-h`:return{type:`help`};case`install`:case`i`:{let e=t[1];if(!e)return{type:`install`};if(e.includes(`@`)){let[t,n]=e.split(`@`);return{type:`install`,plugin:t,marketplace:n}}return e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`file://`)||e.includes(`/`)||e.includes(`\\`)?{type:`install`,marketplace:e}:{type:`install`,plugin:e}}case`manage`:return{type:`manage`};case`uninstall`:return{type:`uninstall`,plugin:t[1]};case`enable`:return{type:`enable`,plugin:t[1]};case`disable`:return{type:`disable`,plugin:t[1]};case`validate`:return{type:`validate`,path:t.slice(1).join(` `).trim()||void 0};case`marketplace`:case`market`:{let e=t[1]?.toLowerCase(),n=t.slice(2).join(` `);switch(e){case`add`:return{type:`marketplace`,action:`add`,target:n};case`remove`:case`rm`:return{type:`marketplace`,action:`remove`,target:n};case`update`:return{type:`marketplace`,action:`update`,target:n};case`list`:return{type:`marketplace`,action:`list`};default:return{type:`marketplace`}}}default:return{type:`menu`}}}var nr=e((()=>{}));function rr({onComplete:e,path:t}){return(0,ir.useEffect)(()=>{async function n(){if(!t){e(`Usage: /plugin validate <path>
|
|
2
|
+
|
|
3
|
+
Validate a plugin or marketplace manifest file or directory.
|
|
4
|
+
|
|
5
|
+
Examples:
|
|
6
|
+
/plugin validate .claude-plugin/plugin.json
|
|
7
|
+
/plugin validate /path/to/plugin-directory
|
|
8
|
+
/plugin validate .
|
|
9
|
+
|
|
10
|
+
When given a directory, automatically validates .claude-plugin/marketplace.json
|
|
11
|
+
or .claude-plugin/plugin.json (prefers marketplace if both exist).
|
|
12
|
+
|
|
13
|
+
Or from the command line:
|
|
14
|
+
claude plugin validate <path>`);return}try{let n=await jt(t),r=``;r+=`Validating ${n.fileType} manifest: ${n.filePath}\n\n`,n.errors.length>0&&(r+=`${a.cross} Found ${n.errors.length} ${H(n.errors.length,`error`)}:\n\n`,n.errors.forEach(e=>{r+=` ${a.pointer} ${e.path}: ${e.message}\n`}),r+=`
|
|
15
|
+
`),n.warnings.length>0&&(r+=`${a.warning} Found ${n.warnings.length} ${H(n.warnings.length,`warning`)}:\n\n`,n.warnings.forEach(e=>{r+=` ${a.pointer} ${e.path}: ${e.message}\n`}),r+=`
|
|
16
|
+
`),n.success?(n.warnings.length>0?r+=`${a.tick} Validation passed with warnings\n`:r+=`${a.tick} Validation passed\n`,process.exitCode=0):(r+=`${a.cross} Validation failed\n`,process.exitCode=1),e(r)}catch(t){process.exitCode=2,ft(t),e(`${a.cross} Unexpected error during validation: ${Je(t)}`)}}n()},[e,t]),(0,ar.jsx)(R,{flexDirection:`column`,children:(0,ar.jsx)(z,{children:`Running validation...`})})}var ir,ar,or=e((()=>{i(),V(),ir=t(V(),1),We(),Ye(),dt(),Pt(),_t(),ar=qe()}));function sr({onComplete:e}){return(0,Q.useEffect)(()=>{async function t(){try{let t=await u(),n=Object.keys(t);n.length===0?e(`No marketplaces configured`):e(`Configured marketplaces:\n${n.map(e=>` • ${e}`).join(`
|
|
17
|
+
`)}`)}catch(t){e(`Error loading marketplaces: ${Je(t)}`)}}t()},[e]),(0,$.jsx)(z,{children:`Loading marketplaces...`})}function cr(e){let t=[];for(let{source:n,scope:r}of[{source:`userSettings`,scope:`user`},{source:`projectSettings`,scope:`project`},{source:`localSettings`,scope:`local`}])rt(n)?.extraKnownMarketplaces?.[e]&&t.push({source:n,scope:r});return{editableSources:t,isInPolicy:!!rt(`policySettings`)?.extraKnownMarketplaces?.[e]}}function lr(e){let{editableSources:t,isInPolicy:n}=cr(e);return t.length>0?{kind:`remove-extra-marketplace`,name:e,sources:t}:n?{kind:`managed-only`,name:e}:{kind:`navigate`,tab:`marketplaces`,viewState:{type:`manage-marketplaces`,targetMarketplace:e,action:`remove`}}}function ur(e){return{kind:`navigate`,tab:`installed`,viewState:{type:`manage-plugins`,targetPlugin:e,action:`uninstall`}}}function dr(e){return yr.has(e.type)}function fr(e){if(`pluginId`in e&&e.pluginId)return e.pluginId;if(`plugin`in e&&e.plugin)return e.plugin;if(e.source.includes(`@`))return e.source.split(`@`)[0]}function pr(e,t,n,r,i,a,o){let s=[];for(let e of a){let t=`pluginId`in e?e.pluginId:`plugin`in e?e.plugin:void 0;s.push({label:t??e.source,message:Hn(e),guidance:`Restart to retry loading plugins`,action:{kind:`none`}})}let c=new Set;for(let t of e){c.add(t.name);let e=lr(t.name),n=cr(t.name),r=n.isInPolicy?`managed`:n.editableSources[0]?.scope;s.push({label:t.name,message:t.error??`Installation failed`,guidance:e.kind===`managed-only`?`Managed by your organization — contact your admin`:void 0,action:e,scope:r})}for(let e of t){let t=`marketplace`in e?e.marketplace:e.source;if(c.has(t))continue;c.add(t);let n=lr(t),r=cr(t),i=r.isInPolicy?`managed`:r.editableSources[0]?.scope;s.push({label:t,message:Hn(e),guidance:n.kind===`managed-only`?`Managed by your organization — contact your admin`:Un(e),action:n,scope:i})}for(let e of i)c.has(e.name)||(c.add(e.name),s.push({label:e.name,message:e.error,action:{kind:`remove-installed-marketplace`,name:e.name}}));let l=new Set;for(let e of n){let t=fr(e);if(t&&l.has(t))continue;t&&l.add(t);let n=`marketplace`in e?e.marketplace:void 0,r=t?o.get(e.source)??o.get(t):void 0;s.push({label:t?n?`${t} @ ${n}`:t:e.source,message:Hn(e),guidance:Un(e),action:t?ur(t):{kind:`none`},scope:r})}for(let e of r)s.push({label:e.source,message:Hn(e),guidance:Un(e),action:{kind:`none`}});return s}function mr(e,t){for(let{source:n}of t){let t=rt(n);if(!t)continue;let r={};if(t.extraKnownMarketplaces?.[e]&&(r.extraKnownMarketplaces={...t.extraKnownMarketplaces,[e]:void 0}),t.enabledPlugins){let n=`@${e}`,i=!1,a={...t.enabledPlugins};for(let e in a)e.endsWith(n)&&(a[e]=void 0,i=!0);i&&(r.enabledPlugins=a)}Object.keys(r).length>0&&st(n,r)}}function hr({setViewState:e,setActiveTab:t,markPluginsChanged:n}){let r=j(e=>e.plugins.errors),i=j(e=>e.plugins.installationStatus),o=Oe(),[s,c]=(0,Q.useState)(0),[l,d]=(0,Q.useState)(null),[f,p]=(0,Q.useState)([]);(0,Q.useEffect)(()=>{(async()=>{try{let{failures:e}=await ue(await u());p(e)}catch{}})()},[]);let m=i.marketplaces.filter(e=>e.status===`failed`),h=new Set(m.map(e=>e.name)),g=r.filter(dr),_=pr(m,r.filter(e=>(e.type===`marketplace-not-found`||e.type===`marketplace-load-failed`||e.type===`marketplace-blocked-by-policy`)&&!h.has(e.marketplace)),r.filter(e=>dr(e)||e.type===`marketplace-not-found`||e.type===`marketplace-load-failed`||e.type===`marketplace-blocked-by-policy`?!1:fr(e)!==void 0),r.filter(e=>dr(e)||e.type===`marketplace-not-found`||e.type===`marketplace-load-failed`||e.type===`marketplace-blocked-by-policy`?!1:fr(e)===void 0),f,g,yt());Ie(`confirm:no`,()=>{e({type:`menu`})},{context:`Confirmation`}),L({"select:previous":()=>c(e=>Math.max(0,e-1)),"select:next":()=>c(e=>Math.min(_.length-1,e+1)),"select:accept":()=>{let r=_[s];if(!r)return;let{action:i}=r;switch(i.kind){case`navigate`:t(i.tab),e(i.viewState);break;case`remove-extra-marketplace`:{let e=i.sources.map(e=>e.scope).join(`, `);mr(i.name,i.sources),we(),o(e=>({...e,plugins:{...e.plugins,errors:e.plugins.errors.filter(e=>!(`marketplace`in e&&e.marketplace===i.name)),installationStatus:{...e.plugins.installationStatus,marketplaces:e.plugins.installationStatus.marketplaces.filter(e=>e.name!==i.name)}}})),d(`${a.tick} Removed "${i.name}" from ${e} settings`),n();break}case`remove-installed-marketplace`:(async()=>{try{await y(i.name),we(),p(e=>e.filter(e=>e.name!==i.name)),d(`${a.tick} Removed marketplace "${i.name}"`),n()}catch(e){d(`Failed to remove "${i.name}": ${e instanceof Error?e.message:String(e)}`)}})();break;case`managed-only`:break;case`none`:break}}},{context:`Select`,isActive:_.length>0});let v=Math.min(s,Math.max(0,_.length-1));v!==s&&c(v);let b=_[v]?.action,ee=b&&b.kind!==`none`&&b.kind!==`managed-only`;return _.length===0?(0,$.jsxs)(R,{flexDirection:`column`,children:[(0,$.jsx)(R,{marginLeft:1,children:(0,$.jsx)(z,{dimColor:!0,children:`No plugin errors`})}),(0,$.jsx)(R,{marginTop:1,children:(0,$.jsx)(z,{dimColor:!0,italic:!0,children:(0,$.jsx)(O,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})})]}):(0,$.jsxs)(R,{flexDirection:`column`,children:[_.map((e,t)=>{let n=t===v;return(0,$.jsxs)(R,{marginLeft:1,flexDirection:`column`,marginBottom:1,children:[(0,$.jsxs)(z,{children:[(0,$.jsxs)(z,{color:n?`suggestion`:`error`,children:[n?a.pointer:a.cross,` `]}),(0,$.jsx)(z,{bold:n,children:e.label}),e.scope&&(0,$.jsxs)(z,{dimColor:!0,children:[` (`,e.scope,`)`]})]}),(0,$.jsx)(R,{marginLeft:3,children:(0,$.jsx)(z,{color:`error`,children:e.message})}),e.guidance&&(0,$.jsx)(R,{marginLeft:3,children:(0,$.jsx)(z,{dimColor:!0,italic:!0,children:e.guidance})})]},t)}),l&&(0,$.jsx)(R,{marginTop:1,marginLeft:1,children:(0,$.jsx)(z,{color:`claude`,children:l})}),(0,$.jsx)(R,{marginTop:1,children:(0,$.jsx)(z,{dimColor:!0,italic:!0,children:(0,$.jsxs)(B,{children:[(0,$.jsx)(O,{action:`select:previous`,context:`Select`,fallback:`↑`,description:`navigate`}),ee&&(0,$.jsx)(O,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`resolve`}),(0,$.jsx)(O,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}function gr(e){switch(e.type){case`help`:return{type:`help`};case`validate`:return{type:`validate`,path:e.path};case`install`:return e.marketplace?{type:`browse-marketplace`,targetMarketplace:e.marketplace,targetPlugin:e.plugin}:e.plugin?{type:`discover-plugins`,targetPlugin:e.plugin}:{type:`discover-plugins`};case`manage`:return{type:`manage-plugins`};case`uninstall`:return{type:`manage-plugins`,targetPlugin:e.plugin,action:`uninstall`};case`enable`:return{type:`manage-plugins`,targetPlugin:e.plugin,action:`enable`};case`disable`:return{type:`manage-plugins`,targetPlugin:e.plugin,action:`disable`};case`marketplace`:return e.action===`list`?{type:`marketplace-list`}:e.action===`add`?{type:`add-marketplace`,initialValue:e.target}:e.action===`remove`?{type:`manage-marketplaces`,targetMarketplace:e.target,action:`remove`}:e.action===`update`?{type:`manage-marketplaces`,targetMarketplace:e.target,action:`update`}:{type:`marketplace-menu`};default:return{type:`discover-plugins`}}}function _r(e){return e.type===`manage-plugins`?`installed`:e.type===`manage-marketplaces`?`marketplaces`:`discover`}function vr({onComplete:e,args:t}){let n=tr(t),r=gr(n),[i,a]=(0,Q.useState)(r),[o,s]=(0,Q.useState)(_r(r)),[c,l]=(0,Q.useState)(i.type===`add-marketplace`&&i.initialValue||``),[u,d]=(0,Q.useState)(0),[f,p]=(0,Q.useState)(null),[m,h]=(0,Q.useState)(null),[g,_]=(0,Q.useState)(!1),v=Oe(),y=j(e=>{let t=e.plugins.errors.length;for(let n of e.plugins.installationStatus.marketplaces)n.status===`failed`&&t++;return t}),b=y>0?`Errors (${y})`:`Errors`,ee=Vt(),te=n.type===`marketplace`&&n.action===`add`&&n.target!==void 0,x=(0,Q.useCallback)(()=>{v(e=>e.plugins.needsRefresh?e:{...e,plugins:{...e.plugins,needsRefresh:!0}})},[v]),S=(0,Q.useCallback)(e=>{let t=e;switch(s(t),p(null),t){case`discover`:a({type:`discover-plugins`});break;case`installed`:a({type:`manage-plugins`});break;case`marketplaces`:a({type:`manage-marketplaces`});break;case`errors`:break}},[]);return(0,Q.useEffect)(()=>{i.type===`menu`&&!m&&e()},[i.type,m,e]),(0,Q.useEffect)(()=>{i.type===`browse-marketplace`&&o!==`discover`&&s(`discover`)},[i.type,o]),Ie(`confirm:no`,(0,Q.useCallback)(()=>{s(`marketplaces`),a({type:`manage-marketplaces`}),l(``),p(null)},[]),{context:`Settings`,isActive:i.type===`add-marketplace`}),(0,Q.useEffect)(()=>{m&&e(m)},[m,e]),(0,Q.useEffect)(()=>{i.type===`help`&&e()},[i.type,e]),i.type===`help`?(0,$.jsxs)(R,{flexDirection:`column`,children:[(0,$.jsx)(z,{bold:!0,children:`Plugin Command Usage:`}),(0,$.jsx)(z,{children:` `}),(0,$.jsx)(z,{dimColor:!0,children:`Installation:`}),(0,$.jsx)(z,{children:` /plugin install - Browse and install plugins`}),(0,$.jsx)(z,{children:` /plugin install <marketplace> - Install from specific marketplace`}),(0,$.jsx)(z,{children:` /plugin install <plugin> - Install specific plugin`}),(0,$.jsx)(z,{children:` /plugin install <plugin>@<market> - Install plugin from marketplace`}),(0,$.jsx)(z,{children:` `}),(0,$.jsx)(z,{dimColor:!0,children:`Management:`}),(0,$.jsx)(z,{children:` /plugin manage - Manage installed plugins`}),(0,$.jsx)(z,{children:` /plugin enable <plugin> - Enable a plugin`}),(0,$.jsx)(z,{children:` /plugin disable <plugin> - Disable a plugin`}),(0,$.jsx)(z,{children:` /plugin uninstall <plugin> - Uninstall a plugin`}),(0,$.jsx)(z,{children:` `}),(0,$.jsx)(z,{dimColor:!0,children:`Marketplaces:`}),(0,$.jsx)(z,{children:` /plugin marketplace - Marketplace management menu`}),(0,$.jsx)(z,{children:` /plugin marketplace add - Add a marketplace`}),(0,$.jsx)(z,{children:` /plugin marketplace add <path/url> - Add marketplace directly`}),(0,$.jsx)(z,{children:` /plugin marketplace update - Update marketplaces`}),(0,$.jsx)(z,{children:` /plugin marketplace update <name> - Update specific marketplace`}),(0,$.jsx)(z,{children:` /plugin marketplace remove - Remove a marketplace`}),(0,$.jsx)(z,{children:` /plugin marketplace remove <name> - Remove specific marketplace`}),(0,$.jsx)(z,{children:` /plugin marketplace list - List all marketplaces`}),(0,$.jsx)(z,{children:` `}),(0,$.jsx)(z,{dimColor:!0,children:`Validation:`}),(0,$.jsx)(z,{children:` /plugin validate <path> - Validate a manifest file or directory`}),(0,$.jsx)(z,{children:` `}),(0,$.jsx)(z,{dimColor:!0,children:`Other:`}),(0,$.jsx)(z,{children:` /plugin - Main plugin menu`}),(0,$.jsx)(z,{children:` /plugin help - Show this help`}),(0,$.jsx)(z,{children:` /plugins - Alias for /plugin`})]}):i.type===`validate`?(0,$.jsx)(rr,{onComplete:e,path:i.path}):i.type===`marketplace-menu`?(a({type:`menu`}),null):i.type===`marketplace-list`?(0,$.jsx)(sr,{onComplete:e}):i.type===`add-marketplace`?(0,$.jsx)(an,{inputValue:c,setInputValue:l,cursorOffset:u,setCursorOffset:d,error:f,setError:p,result:m,setResult:h,setViewState:a,onAddComplete:x,cliMode:te}):(0,$.jsx)(Ge,{color:`suggestion`,children:(0,$.jsxs)(Ue,{title:`Plugins`,selectedTab:o,onTabChange:S,color:`suggestion`,disableNavigation:g,children:[(0,$.jsx)(Ve,{id:`discover`,title:`Discover`,children:i.type===`browse-marketplace`?(0,$.jsx)(An,{error:f,setError:p,result:m,setResult:h,setViewState:a,onInstallComplete:x,targetMarketplace:i.targetMarketplace,targetPlugin:i.targetPlugin}):(0,$.jsx)(Nn,{error:f,setError:p,result:m,setResult:h,setViewState:a,onInstallComplete:x,onSearchModeChange:_,targetPlugin:i.type===`discover-plugins`?i.targetPlugin:void 0})}),(0,$.jsx)(Ve,{id:`installed`,title:`Installed`,children:(0,$.jsx)(Qn,{setViewState:a,setResult:h,onManageComplete:x,onSearchModeChange:_,targetPlugin:i.type===`manage-plugins`?i.targetPlugin:void 0,targetMarketplace:i.type===`manage-plugins`?i.targetMarketplace:void 0,action:i.type===`manage-plugins`?i.action:void 0})}),(0,$.jsx)(Ve,{id:`marketplaces`,title:`Marketplaces`,children:(0,$.jsx)(Rn,{setViewState:a,error:f,setError:p,setResult:h,exitState:ee,onManageComplete:x,targetMarketplace:i.type===`manage-marketplaces`?i.targetMarketplace:void 0,action:i.type===`manage-marketplaces`?i.action:void 0})}),(0,$.jsx)(Ve,{id:`errors`,title:b,children:(0,$.jsx)(hr,{setViewState:a,setActiveTab:s,markPluginsChanged:x})})]})})}var Q,$,yr,br=e((()=>{i(),V(),Q=t(V(),1),_(),We(),Ht(),v(),Ae(),Ye(),de(),Ce(),Me(),vt(),at(),sn(),Mn(),Ln(),Vn(),er(),Wn(),nr(),or(),$=qe(),yr=new Set([`git-auth-failed`,`git-timeout`,`network-error`])}));async function xr(e,t,n){return(0,Sr.jsx)(vr,{onComplete:e,args:n})}var Sr;e((()=>{V(),br(),Sr=qe()}))();export{xr as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Bo as t,Eo as n,Fo as r,Uo as i,dT as a,ko as o,lT as s,wo as c,zo as l}from"./loadAgentsDir-BL93ulMm.js";import{P as u,R as d,c as f,i as p}from"./debug-BecbSVoN.js";import{vt as m,xt as h}from"./settings-D4CpDv2y.js";import{b as g,h as _}from"./config-aRiTrtCv.js";import{o as v,s as y}from"./log-Dauqle-Z.js";import{f as b,s as x}from"./pluginOperations-DnhzFbYI.js";function S(e){return O=e,k!==null&&k.length>0&&(e(k),k=null),()=>{O=null}}async function C(){let e=await t(),n=r(),i=new Set;for(let[t,r]of Object.entries(e)){let e=n[t]?.autoUpdate;(e===void 0?h(t,r):e)&&i.add(t.toLowerCase())}return i}async function w(e,t){let n=!1;for(let{scope:r}of t)try{let t=await b(e,r);t.success&&!t.alreadyUpToDate?(n=!0,f(`Plugin autoupdate: updated ${e} from ${t.oldVersion} to ${t.newVersion}`)):t.alreadyUpToDate||f(`Plugin autoupdate: failed to update ${e}: ${t.message}`,{level:`warn`})}catch(t){f(`Plugin autoupdate: error updating ${e}: ${u(t)}`,{level:`warn`})}return n?e:null}async function T(e){let t=o(),r=Object.keys(t.plugins);return r.length===0?[]:(await Promise.allSettled(r.map(async r=>{let{marketplace:i}=a(r);if(!i||!e.has(i.toLowerCase()))return null;let o=t.plugins[r];if(!o||o.length===0)return null;let s=o.filter(n);return s.length===0?null:w(r,s)}))).filter(e=>e.status===`fulfilled`&&e.value!==null).map(e=>e.value)}async function E(e){return T(e)}function D(){(async()=>{if(g()){f(`Plugin autoupdate: skipped (auto-updater disabled)`);return}try{let e=await C();if(e.size===0)return;let t=(await Promise.allSettled(Array.from(e).map(async e=>{try{await i(e,void 0,{disableCredentialHelper:!0})}catch(t){f(`Plugin autoupdate: failed to refresh marketplace ${e}: ${u(t)}`,{level:`warn`})}}))).filter(e=>e.status===`rejected`);t.length>0&&f(`Plugin autoupdate: ${t.length} marketplace refresh(es) failed`,{level:`warn`}),f(`Plugin autoupdate: checking installed plugins`);let n=await E(e);n.length>0&&(O?O(n):k=n)}catch(e){y(e)}})()}var O,k,A=e((()=>{x(),_(),p(),d(),v(),c(),l(),s(),m(),O=null,k=null}));export{T as i,A as n,S as r,D as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ao as e,Io as t,Vo as n,wo as r,zo as i}from"./loadAgentsDir-BL93ulMm.js";import{P as a,R as o,c as s,i as c}from"./debug-BecbSVoN.js";import{d as l,s as u}from"./pluginOperations-DnhzFbYI.js";import{i as d,n as f,r as p,t as m}from"./pluginFlagging-DcJ_FQuv.js";u(),c(),o(),r(),i(),p();function h(e,t,n){let r=new Set(t.plugins.map(e=>e.name)),i=`@${n}`,a=[];for(let t of Object.keys(e.plugins)){if(!t.endsWith(i))continue;let e=t.slice(0,-i.length);r.has(e)||a.push(t)}return a}async function g(){await d();let r=e(),i=f(),o=await n(),c=[];for(let e of Object.keys(o))try{let n=await t(e);if(!n.forceRemoveDeletedPlugins)continue;let o=h(r,n,e);for(let e of o){if(e in i)continue;let t=r.plugins[e]??[];if(t.some(e=>e.scope===`user`||e.scope===`project`||e.scope===`local`)){for(let n of t){let{scope:t}=n;if(!(t!==`user`&&t!==`project`&&t!==`local`))try{await l(e,t)}catch(n){s(`Failed to auto-uninstall delisted plugin ${e} from ${t}: ${a(n)}`,{level:`error`})}}await m(e),c.push(e)}}}catch(t){s(`Failed to check for delisted plugins in "${e}": ${a(t)}`,{level:`warn`})}return c}export{g as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./figures-5ThXQEtq.js";import{$d as n,Af as r,Co as i,Mf as a,So as o,dT as s,jf as c,lT as l,tf as u}from"./loadAgentsDir-BL93ulMm.js";import{P as d,R as f}from"./debug-BecbSVoN.js";import{n as p,o as m}from"./process-gEbdy6uY.js";import{o as h,s as g}from"./log-Dauqle-Z.js";import{n as _,r as v}from"./analytics-DJobLaWP.js";import{a as y,c as b,d as x,f as S,i as C,r as w,s as T}from"./pluginOperations-DnhzFbYI.js";e(),f(),u(),h(),i(),l(),p(),a(),_(),T();function E(e,n,i){g(e);let a=i?`${n} plugin "${i}"`:n===`disable-all`?`disable all plugins`:`${n} plugins`;console.error(`${t.cross} Failed to ${a}: ${d(e)}`);let l=i?(()=>{let{name:e,marketplace:t}=s(i);return{_PROTO_plugin_name:e,...t&&{_PROTO_marketplace_name:t},...r(e,t,o())}})():{};v(`tengu_plugin_command_failed`,{command:n,error_category:c(e),...l}),process.exit(1)}async function D(e,n=`user`){try{console.log(`Installing plugin "${e}"...`);let i=await b(e,n);if(!i.success)throw Error(i.message);console.log(`${t.tick} ${i.message}`);let{name:a,marketplace:c}=s(i.pluginId||e);v(`tengu_plugin_installed_cli`,{_PROTO_plugin_name:a,...c&&{_PROTO_marketplace_name:c},scope:i.scope||n,install_source:`cli-explicit`,...r(a,c,o())}),process.exit(0)}catch(t){E(t,`install`,e)}}async function O(e,n=`user`,i=!1){try{let a=await x(e,n,!i);if(!a.success)throw Error(a.message);console.log(`${t.tick} ${a.message}`);let{name:c,marketplace:l}=s(a.pluginId||e);v(`tengu_plugin_uninstalled_cli`,{_PROTO_plugin_name:c,...l&&{_PROTO_marketplace_name:l},scope:a.scope||n,...r(c,l,o())}),process.exit(0)}catch(t){E(t,`uninstall`,e)}}async function k(e,n){try{let i=await y(e,n);if(!i.success)throw Error(i.message);console.log(`${t.tick} ${i.message}`);let{name:a,marketplace:c}=s(i.pluginId||e);v(`tengu_plugin_enabled_cli`,{_PROTO_plugin_name:a,...c&&{_PROTO_marketplace_name:c},scope:i.scope,...r(a,c,o())}),process.exit(0)}catch(t){E(t,`enable`,e)}}async function A(e,n){try{let i=await C(e,n);if(!i.success)throw Error(i.message);console.log(`${t.tick} ${i.message}`);let{name:a,marketplace:c}=s(i.pluginId||e);v(`tengu_plugin_disabled_cli`,{_PROTO_plugin_name:a,...c&&{_PROTO_marketplace_name:c},scope:i.scope,...r(a,c,o())}),process.exit(0)}catch(t){E(t,`disable`,e)}}async function j(){try{let e=await w();if(!e.success)throw Error(e.message);console.log(`${t.tick} ${e.message}`),v(`tengu_plugin_disabled_all_cli`,{}),process.exit(0)}catch(e){E(e,`disable-all`)}}async function M(e,i){try{m(`Checking for updates for plugin "${e}" at ${i} scope…\n`);let a=await S(e,i);if(!a.success)throw Error(a.message);if(m(`${t.tick} ${a.message}\n`),!a.alreadyUpToDate){let{name:t,marketplace:n}=s(a.pluginId||e);v(`tengu_plugin_updated_cli`,{_PROTO_plugin_name:t,...n&&{_PROTO_marketplace_name:n},old_version:a.oldVersion||`unknown`,new_version:a.newVersion||`unknown`,...r(t,n,o())})}await n(0)}catch(t){E(t,`update`,e)}}export{O as a,D as i,A as n,M as o,k as r,j as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Jw as t,Yw as n}from"./loadAgentsDir-BL93ulMm.js";import{C as r,S as i,c as a,f as o,i as s,u as c,x as l}from"./debug-BecbSVoN.js";import{o as u,s as d}from"./log-Dauqle-Z.js";import{join as f}from"path";import{randomBytes as p}from"crypto";import{readFile as m,rename as h,unlink as g,writeFile as _}from"fs/promises";function v(){return f(t(),D)}function y(e){let t=i(e);if(typeof t!=`object`||!t||!(`plugins`in t)||typeof t.plugins!=`object`||t.plugins===null)return{};let n=t.plugins,r={};for(let[e,t]of Object.entries(n))if(t&&typeof t==`object`&&`flaggedAt`in t&&typeof t.flaggedAt==`string`){let n={flaggedAt:t.flaggedAt};`seenAt`in t&&typeof t.seenAt==`string`&&(n.seenAt=t.seenAt),r[e]=n}return r}async function b(){try{return y(await m(v(),{encoding:`utf-8`}))}catch{return{}}}async function x(e){let n=v(),i=`${n}.${p(8).toString(`hex`)}.tmp`;try{await c().mkdir(t()),await _(i,r({plugins:e},null,2),{encoding:`utf-8`,mode:384}),await h(i,n),k=e}catch(e){d(e);try{await g(i)}catch{}}}async function S(){let e=await b(),t=Date.now(),n=!1;for(let[r,i]of Object.entries(e))i.seenAt&&t-new Date(i.seenAt).getTime()>=O&&(delete e[r],n=!0);k=e,n&&await x(e)}function C(){return k??{}}async function w(e){k===null&&(k=await b()),await x({...k,[e]:{flaggedAt:new Date().toISOString()}}),a(`Flagged plugin: ${e}`)}async function T(e){k===null&&(k=await b());let t=new Date().toISOString(),n=!1,r={...k};for(let i of e){let e=r[i];e&&!e.seenAt&&(r[i]={...e,seenAt:t},n=!0)}n&&await x(r)}async function E(e){if(k===null&&(k=await b()),!(e in k))return;let{[e]:t,...n}=k;k=n,await x(n)}var D,O,k,A=e((()=>{s(),o(),u(),l(),n(),D=`flagged-plugins.json`,O=2880*60*1e3,k=null}));export{T as a,S as i,C as n,E as o,A as r,w as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ao as t,Bo as n,DS as r,Fg as i,Gw as a,Ig as o,Io as s,Mo as c,Ro as l,TS as u,Yw as d,_T as f,_o as p,bo as m,cT as h,co as g,cs as _,dT as v,do as y,fT as b,fo as x,gT as S,go as C,jo as ee,ko as w,lT as T,lo as E,ls as D,mo as O,oT as k,oo as te,sT as A,ss as j,uo as M,wo as ne,xo as re,yo as ie,zo as ae}from"./loadAgentsDir-BL93ulMm.js";import{Wt as oe,et as N}from"./state-BemZdQIl.js";import{B as P,R as se,U as ce,f as F,u as I}from"./debug-BecbSVoN.js";import{c as L,g as R,x as z}from"./settings-D4CpDv2y.js";import{o as B,s as V}from"./log-Dauqle-Z.js";import{l as H,o as U}from"./stringUtils-C8PaYpQF.js";import{n as W,t as G}from"./pluginStartupCheck-CKBFaMFr.js";import{dirname as le,join as K}from"path";function q(e){if(!Q.includes(e))throw Error(`Invalid scope "${e}". Must be one of: ${Q.join(`, `)}`)}function ue(e){return Q.includes(e)}function J(e){return e===`project`||e===`local`?N():void 0}function de(e){return L(`projectSettings`)?.enabledPlugins?.[e]===!0}function fe(e){let t=e.includes(`@`);for(let n of[`local`,`project`,`user`]){let r=L(b(n))?.enabledPlugins;if(r){for(let i of Object.keys(r))if(t?i===e:i.startsWith(`${e}@`))return{pluginId:i,scope:n}}}return null}function pe(e,t){let{name:n,marketplace:r}=v(e);return t.find(t=>t.name===e||t.name===n?!0:r&&t.source?t.name===n&&t.source.includes(`@${r}`):!1)}function me(e){let{name:n}=v(e),r=t();if(r.plugins[e]?.length)return{pluginId:e,pluginName:n};let i=Object.keys(r.plugins).find(e=>{let{name:t}=v(e);return t===n&&(r.plugins[e]?.length??0)>0});return i?{pluginId:i,pluginName:n}:null}function Y(e){let n=t().plugins[e];if(!n||n.length===0)return{scope:`user`};let r=N(),i=n.find(e=>e.scope===`local`&&e.projectPath===r);if(i)return{scope:i.scope,projectPath:i.projectPath};let a=n.find(e=>e.scope===`project`&&e.projectPath===r);if(a)return{scope:a.scope,projectPath:a.projectPath};let o=n.find(e=>e.scope===`user`);return o?{scope:o.scope}:{scope:n[0].scope,projectPath:n[0].projectPath}}async function he(e,t=`user`){q(t);let{name:r,marketplace:i}=v(e),a,o,c;if(i){let t=await l(e);t&&(a=t.entry,o=i,c=t.marketplaceInstallLocation)}else{let e=await n();for(let[t,n]of Object.entries(e))try{let e=(await s(t)).plugins.find(e=>e.name===r);if(e){a=e,o=t,c=n.installLocation;break}}catch(e){V(ce(e))}}if(!a||!o)return{success:!1,message:`Plugin "${r}" not found in ${i?`marketplace "${i}"`:`any configured marketplace`}`};let u=a,d=`${u.name}@${o}`,f=await ie({pluginId:d,entry:u,scope:t,marketplaceInstallLocation:c});if(!f.ok){let e=f;switch(e.reason){case`local-source-no-location`:return{success:!1,message:`Cannot install local plugin "${e.pluginName}" without marketplace install location`};case`settings-write-failed`:return{success:!1,message:`Failed to update settings: ${e.message}`};case`resolution-failed`:return{success:!1,message:C(e.resolution)};case`blocked-by-policy`:return{success:!1,message:`Plugin "${e.pluginName}" is blocked by your organization's policy and cannot be installed`};case`dependency-blocked-by-policy`:return{success:!1,message:`Plugin "${e.pluginName}" depends on "${e.blockedDependency}", which is blocked by your organization's policy`}}}return{success:!0,message:`Successfully installed plugin: ${d} (scope: ${t})${f.depNote}`,pluginId:d,pluginName:u.name,scope:t}}async function ge(e,n=`user`,r=!0){q(n);let{enabled:i,disabled:o}=await x(),s=[...i,...o],c=pe(e,s),l=b(n),d=L(l),f,p;if(c)f=Object.keys(d?.enabledPlugins??{}).find(t=>t===e||t===c.name||t.startsWith(`${c.name}@`))??(e.includes(`@`)?e:c.name),p=c.name;else{let t=me(e);if(!t)return{success:!1,message:`Plugin "${e}" not found in installed plugins`};f=t.pluginId,p=t.pluginName}let m=J(n),h=t().plugins[f],g=h?.find(e=>e.scope===n&&e.projectPath===m);if(!g){let{scope:t}=Y(f);return t!==n&&h&&h.length>0?t===`project`?{success:!1,message:`Plugin "${e}" is enabled at project scope (.claude/settings.json, shared with your team). To disable just for you: claude plugin disable ${e} --scope local`}:{success:!1,message:`Plugin "${e}" is installed in ${t} scope, not ${n}. Use --scope ${t} to uninstall.`}:{success:!1,message:`Plugin "${e}" is not installed in ${n} scope. Use --scope to specify the correct scope.`}}let _=g.installPath,v={...d?.enabledPlugins};v[f]=void 0,z(l,{enabledPlugins:v}),j(),ee(f,n,m);let y=t().plugins[f],S=!y||y.length===0;S&&_&&await D(_),S&&(u(f),r&&await a(f));let C=k(f,s),w=A(C);return{success:!0,message:`Successfully uninstalled plugin: ${p} (scope: ${n})${w}`,pluginId:f,pluginName:p,scope:n,reverseDependents:C.length>0?C:void 0}}async function X(e,t,n){let r=t?`enable`:`disable`;if(f(e)){let{error:n}=z(`userSettings`,{enabledPlugins:{...L(`userSettings`)?.enabledPlugins,[e]:t}});if(n)return{success:!1,message:`Failed to ${r} built-in plugin: ${n.message}`};j();let{name:i}=v(e);return{success:!0,message:`Successfully ${r}d built-in plugin: ${i}`,pluginId:e,pluginName:i,scope:`user`}}n&&q(n);let i,a,s=fe(e);if(n)if(a=n,s)i=s.pluginId;else if(e.includes(`@`))i=e;else return{success:!1,message:`Plugin "${e}" not found in settings. Use plugin@marketplace format.`};else if(s)i=s.pluginId,a=s.scope;else if(e.includes(`@`))i=e,a=`user`;else return{success:!1,message:`Plugin "${e}" not found in any editable settings scope. Use plugin@marketplace format.`};if(t&&o(i))return{success:!1,message:`Plugin "${i}" is blocked by your organization's policy and cannot be enabled`};let c=b(a),l=L(c)?.enabledPlugins?.[i],u={user:0,project:1,local:2},d=n&&s&&u[n]>u[s.scope];if(n&&l===void 0&&s&&s.scope!==n&&!d)return{success:!1,message:`Plugin "${e}" is installed at ${s.scope} scope, not ${n}. Use --scope ${s.scope} or omit --scope to auto-detect.`};if(t===(n&&!d?l===!0:G().has(i)))return{success:!1,message:`Plugin "${e}" is already ${t?`enabled`:`disabled`}${n?` at ${n} scope`:``}`};let p;if(!t){let{enabled:e,disabled:t}=await x(),n=k(i,[...e,...t]);n.length>0&&(p=n)}let{error:m}=z(c,{enabledPlugins:{...L(c)?.enabledPlugins,[i]:t}});if(m)return{success:!1,message:`Failed to ${r} plugin: ${m.message}`};j();let{name:h}=v(i),g=A(p);return{success:!0,message:`Successfully ${r}d plugin: ${h} (scope: ${a})${g}`,pluginId:i,pluginName:h,scope:a,reverseDependents:p}}async function _e(e,t){return X(e,!0,t)}async function ve(e,t){return X(e,!1,t)}async function Z(){let e=G();if(e.size===0)return{success:!0,message:`No enabled plugins to disable`};let t=[],n=[];for(let[r]of e){let e=await X(r,!1);e.success?t.push(r):n.push(`${r}: ${e.message}`)}return n.length>0?{success:!1,message:`Disabled ${t.length} ${H(t.length,`plugin`)}, ${n.length} failed:\n${n.join(`
|
|
2
|
+
`)}`}:{success:!0,message:`Disabled ${t.length} ${H(t.length,`plugin`)}`}}async function ye(e,t){let{name:n,marketplace:r}=v(e),i=r?`${n}@${r}`:e,a=await l(e);if(!a)return{success:!1,message:`Plugin "${n}" not found`,pluginId:i,scope:t};let{entry:o,marketplaceInstallLocation:s}=a,c=w().plugins[i];if(!c||c.length===0)return{success:!1,message:`Plugin "${n}" is not installed`,pluginId:i,scope:t};let u=J(t),d=c.find(e=>e.scope===t&&e.projectPath===u);return d?be({pluginId:i,pluginName:n,entry:o,marketplaceInstallLocation:s,installation:d,scope:t,projectPath:u}):{success:!1,message:`Plugin "${n}" is not installed at scope ${u?`${t} (${u})`:t}`,pluginId:i,scope:t}}async function be({pluginId:e,pluginName:t,entry:n,marketplaceInstallLocation:r,installation:i,scope:a,projectPath:o}){let s=I(),l=i.version,u,d,f=!1,p;if(typeof n.source!=`string`){let t=await te(n.source,{manifest:{name:n.name}});u=t.path,f=!0,p=t.gitCommitSha,d=await m(e,n.source,t.manifest,t.path,n.version,t.gitCommitSha)}else{let t;try{t=await s.stat(r)}catch(t){if(P(t))return{success:!1,message:`Marketplace directory not found at ${r}`,pluginId:e,scope:a};throw t}u=K(t.isDirectory()?r:le(r),n.source);try{await s.stat(u)}catch(t){if(P(t))return{success:!1,message:`Plugin source not found at ${u}`,pluginId:e,scope:a};throw t}let i,o=K(u,`.claude-plugin`,`plugin.json`);try{i=await O(o,n.name,n.source)}catch{}d=await m(e,n.source,i,u,n.version)}try{let r=E(e,d),s=M(e,d);if(i.version===d||i.installPath===r||i.installPath===s)return{success:!0,message:`${t} is already at the latest version (${d}).`,pluginId:e,newVersion:d,oldVersion:l,alreadyUpToDate:!0,scope:a};r=await g(u,e,d,n);let f=i.installPath;if(c(e,a,o,r,d,p),f&&f!==r){let e=w();Object.values(e.plugins).some(e=>e.some(e=>e.installPath===f))||await D(f)}let m=o?`${a} (${o})`:a;return{success:!0,message:`Plugin "${t}" updated from ${l||`unknown`} to ${d} for scope ${m}. Restart to apply changes.`,pluginId:e,newVersion:d,oldVersion:l,scope:a}}finally{f&&u!==E(e,d)&&await s.rm(u,{recursive:!0,force:!0})}}var Q,$,xe=e((()=>{oe(),S(),se(),F(),B(),_(),h(),ne(),ae(),d(),T(),p(),y(),r(),i(),W(),re(),R(),U(),Q=[`user`,`project`,`local`],$=[`user`,`project`,`local`,`managed`]}));export{_e as a,he as c,ge as d,ye as f,ve as i,ue as l,$ as n,Y as o,Z as r,xe as s,Q as t,de as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{_o as t,lT as n,mT as r,pT as i,wo as a,zo as o}from"./loadAgentsDir-BL93ulMm.js";import{n as s}from"./cwd-Cfdf7z7s.js";import{c,i as l}from"./debug-BecbSVoN.js";import{c as u,g as d,vt as f}from"./settings-D4CpDv2y.js";import{o as p}from"./log-Dauqle-Z.js";import"path";function m(){let e=new Map,t=i();for(let[n,r]of Object.entries(t))n.includes(`@`)&&(r===!0?e.set(n,`flag`):r===!1&&e.delete(n));for(let{scope:n,source:r}of[{scope:`managed`,source:`policySettings`},{scope:`user`,source:`userSettings`},{scope:`project`,source:`projectSettings`},{scope:`local`,source:`localSettings`},{scope:`flag`,source:`flagSettings`}]){let i=u(r);if(i?.enabledPlugins)for(let[a,o]of Object.entries(i.enabledPlugins))a.includes(`@`)&&(a in t&&t[a]!==o&&c(`Plugin ${a} from --add-dir (${t[a]}) overridden by ${r} (${o})`),o===!0?e.set(a,n):o===!1&&e.delete(a))}return c(`Found ${e.size} enabled plugins with scopes: ${Array.from(e.entries()).map(([e,t])=>`${e}(${t})`).join(`, `)}`),e}var h=e((()=>{s(),l(),p(),d(),r(),a(),o(),n(),t(),f()}));export{h as n,m as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./pluginStartupCheck-CKBFaMFr.js";e();export{t as getPluginEditableScopes};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{n as e,t}from"./figures-5ThXQEtq.js";import{Ao as n,Bo as r,CS as i,Go as a,Ho as o,No as s,Oo as c,Uo as l,Zo as u,as as d,cs as f,dT as p,do as m,fT as h,fo as g,lT as _,qo as v,rs as ee,ss as y,vT as b,wS as x,wo as S,yT as C,zo as te}from"./loadAgentsDir-BL93ulMm.js";import{Wt as w,ir as T}from"./state-BemZdQIl.js";import{C as E,P as D,R as O,x as k}from"./debug-BecbSVoN.js";import{o as A,s as j}from"./log-Dauqle-Z.js";import{n as ne,r as M}from"./analytics-DJobLaWP.js";import{l as N,o as P}from"./stringUtils-C8PaYpQF.js";import{n as F,t as I}from"./exit-BOhGfSlm.js";import{n as L,s as R,t as z}from"./pluginOperations-DnhzFbYI.js";import{a as B,i as V,n as H,o as U,r as W,t as G}from"./pluginCliCommands-CfdVNs8D.js";import{a as K,c as q,i as re,n as J,r as Y,s as X,t as ie}from"./validatePlugin-y_O_tCEL.js";import{basename as ae,dirname as Z}from"path";e(),w(),ne(),R(),C(),O(),A(),f(),q(),S(),ee(),te(),i(),re(),_(),m(),ie(),k(),P();function Q(e,n){j(e),I(`${t.cross} Failed to ${n}: ${D(e)}`)}function $(e){e.errors.length>0&&(console.log(`${t.cross} Found ${e.errors.length} ${N(e.errors.length,`error`)}:\n`),e.errors.forEach(e=>{console.log(` ${t.pointer} ${e.path}: ${e.message}`)}),console.log(``)),e.warnings.length>0&&(console.log(`${t.warning} Found ${e.warnings.length} ${N(e.warnings.length,`warning`)}:\n`),e.warnings.forEach(e=>{console.log(` ${t.pointer} ${e.path}: ${e.message}`)}),console.log(``))}async function oe(e,n){n.cowork&&T(!0);try{let n=await J(e);console.log(`Validating ${n.fileType} manifest: ${n.filePath}\n`),$(n);let r=[];if(n.fileType===`plugin`){let e=Z(n.filePath);if(ae(e)===`.claude-plugin`){r=await Y(Z(e));for(let e of r)console.log(`Validating ${e.fileType}: ${e.filePath}\n`),$(e)}}let i=n.success&&r.every(e=>e.success),a=n.warnings.length>0||r.some(e=>e.warnings.length>0);i?F(a?`${t.tick} Validation passed with warnings`:`${t.tick} Validation passed`):(console.log(`${t.cross} Validation failed`),process.exit(1))}catch(e){j(e),console.error(`${t.cross} Unexpected error during validation: ${D(e)}`),process.exit(2)}}async function se(e){e.cowork&&T(!0),M(`tengu_plugin_list_command`,{});let i=n(),{getPluginEditableScopes:a}=await import(`./pluginStartupCheck-CpNB4jxG.js`),o=a(),s=Object.keys(i.plugins),{enabled:l,disabled:f,errors:m}=await g(),h=[...l,...f],_=h.filter(e=>e.source.endsWith(`@inline`)),v=m.filter(e=>e.source.endsWith(`@inline`)||e.source.startsWith(`inline[`));if(e.json){let t=new Map(h.map(e=>[e.source,e])),n=[];for(let e of s.sort()){let r=i.plugins[e];if(!r||r.length===0)continue;let a=p(e).name,s=m.filter(t=>t.source===e||`plugin`in t&&t.plugin===a).map(b);for(let i of r){let r=t.get(e),a;if(r){let e=r.mcpServers||await x(r);e&&Object.keys(e).length>0&&(a=e)}n.push({id:e,version:i.version||`unknown`,scope:i.scope,enabled:o.has(e),installPath:i.installPath,installedAt:i.installedAt,lastUpdated:i.lastUpdated,projectPath:i.projectPath,mcpServers:a,errors:s.length>0?s:void 0})}}for(let e of _){let t=e.mcpServers||await x(e),r=v.filter(t=>t.source===e.source||`plugin`in t&&t.plugin===e.name).map(b);n.push({id:e.source,version:e.manifest.version??`unknown`,scope:`session`,enabled:e.enabled!==!1,installPath:e.path,mcpServers:t&&Object.keys(t).length>0?t:void 0,errors:r.length>0?r:void 0})}for(let e of v.filter(e=>e.source.startsWith(`inline[`)))n.push({id:e.source,version:`unknown`,scope:`session`,enabled:!1,installPath:`path`in e?e.path:``,errors:[b(e)]});if(e.available){let e=[];try{let[t,n]=await Promise.all([r(),X()]),{marketplaces:i}=await d(t);for(let{name:t,data:r}of i)if(r)for(let i of r.plugins){let r=u(i.name,t);c(r)||e.push({pluginId:r,name:i.name,description:i.description,marketplaceName:t,version:i.version,source:i.source,installCount:n?.get(r)})}}catch{}F(E({installed:n,available:e},null,2))}else F(E(n,null,2))}s.length===0&&_.length===0&&v.length===0&&F("No plugins installed. Use `claude plugin install` to install a plugin."),s.length>0&&console.log(`Installed plugins:
|
|
2
|
+
`);for(let e of s.sort()){let n=i.plugins[e];if(!n||n.length===0)continue;let r=p(e).name,a=m.filter(t=>t.source===e||`plugin`in t&&t.plugin===r);for(let r of n){let n=o.has(e),i=a.length>0?`${t.cross} failed to load`:n?`${t.tick} enabled`:`${t.cross} disabled`,s=r.version||`unknown`,c=r.scope;console.log(` ${t.pointer} ${e}`),console.log(` Version: ${s}`),console.log(` Scope: ${c}`),console.log(` Status: ${i}`);for(let e of a)console.log(` Error: ${b(e)}`);console.log(``)}}if(_.length>0||v.length>0){console.log(`Session-only plugins (--plugin-dir):
|
|
3
|
+
`);for(let e of _){let n=v.filter(t=>t.source===e.source||`plugin`in t&&t.plugin===e.name),r=n.length>0?`${t.cross} loaded with errors`:`${t.tick} loaded`;console.log(` ${t.pointer} ${e.source}`),console.log(` Version: ${e.manifest.version??`unknown`}`),console.log(` Path: ${e.path}`),console.log(` Status: ${r}`);for(let e of n)console.log(` Error: ${b(e)}`);console.log(``)}for(let e of v.filter(e=>e.source.startsWith(`inline[`)))console.log(` ${t.pointer} ${e.source}: ${t.cross} ${b(e)}\n`)}F()}async function ce(e,n){n.cowork&&T(!0);try{let r=await K(e);r||I(`${t.cross} Invalid marketplace source format. Try: owner/repo, https://..., or ./path`),`error`in r&&I(`${t.cross} ${r.error}`);let i=n.scope??`user`;i!==`user`&&i!==`project`&&i!==`local`&&I(`${t.cross} Invalid scope '${i}'. Use: user, project, or local`);let a=h(i),o=r;n.sparse&&n.sparse.length>0&&(o.source===`github`||o.source===`git`?o={...o,sparsePaths:n.sparse}:I(`${t.cross} --sparse is only supported for github and git marketplace sources (got: ${o.source})`)),console.log(`Adding marketplace...`);let{name:c,alreadyMaterialized:l,resolvedSource:u}=await s(o,e=>{console.log(e)});v(c,{source:u},a),y();let d=o.source;o.source===`github`&&(d=o.repo),M(`tengu_marketplace_added`,{source_type:d}),F(l?`${t.tick} Marketplace '${c}' already on disk — declared in ${i} settings`:`${t.tick} Successfully added marketplace: ${c} (declared in ${i} settings)`)}catch(e){Q(e,`add marketplace`)}}async function le(e){e.cowork&&T(!0);try{let n=await r(),i=Object.keys(n);e.json&&F(E(i.sort().map(e=>{let t=n[e],r=t?.source;return{name:e,source:r?.source,...r?.source===`github`&&{repo:r.repo},...r?.source===`git`&&{url:r.url},...r?.source===`url`&&{url:r.url},...r?.source===`directory`&&{path:r.path},...r?.source===`file`&&{path:r.path},installLocation:t?.installLocation}}),null,2)),i.length===0&&F(`No marketplaces configured`),console.log(`Configured marketplaces:
|
|
4
|
+
`),i.forEach(e=>{let r=n[e];if(console.log(` ${t.pointer} ${e}`),r?.source){let e=r.source;e.source===`github`?console.log(` Source: GitHub (${e.repo})`):e.source===`git`?console.log(` Source: Git (${e.url})`):e.source===`url`?console.log(` Source: URL (${e.url})`):e.source===`directory`?console.log(` Source: Directory (${e.path})`):e.source===`file`&&console.log(` Source: File (${e.path})`)}console.log(``)}),F()}catch(e){Q(e,`list marketplaces`)}}async function ue(e,n){n.cowork&&T(!0);try{await a(e),y(),M(`tengu_marketplace_removed`,{marketplace_name:e}),F(`${t.tick} Successfully removed marketplace: ${e}`)}catch(e){Q(e,`remove marketplace`)}}async function de(e,n){n.cowork&&T(!0);try{if(e)console.log(`Updating marketplace: ${e}...`),await l(e,e=>{console.log(e)}),y(),M(`tengu_marketplace_updated`,{marketplace_name:e}),F(`${t.tick} Successfully updated marketplace: ${e}`);else{let e=await r(),n=Object.keys(e);n.length===0&&F(`No marketplaces configured`),console.log(`Updating ${n.length} marketplace(s)...`),await o(),y(),M(`tengu_marketplace_updated_all`,{count:n.length}),F(`${t.tick} Successfully updated ${n.length} marketplace(s)`)}}catch(e){Q(e,`update marketplace(s)`)}}async function fe(e,t){t.cowork&&T(!0);let n=t.scope||`user`;t.cowork&&n!==`user`&&I(`--cowork can only be used with user scope`),z.includes(n)||I(`Invalid scope: ${n}. Must be one of: ${z.join(`, `)}.`);let{name:r,marketplace:i}=p(e);M(`tengu_plugin_install_command`,{_PROTO_plugin_name:r,...i&&{_PROTO_marketplace_name:i},scope:n}),await V(e,n)}async function pe(e,t){t.cowork&&T(!0);let n=t.scope||`user`;t.cowork&&n!==`user`&&I(`--cowork can only be used with user scope`),z.includes(n)||I(`Invalid scope: ${n}. Must be one of: ${z.join(`, `)}.`);let{name:r,marketplace:i}=p(e);M(`tengu_plugin_uninstall_command`,{_PROTO_plugin_name:r,...i&&{_PROTO_marketplace_name:i},scope:n}),await B(e,n,t.keepData)}async function me(e,t){t.cowork&&T(!0);let n;t.scope&&(z.includes(t.scope)||I(`Invalid scope "${t.scope}". Valid scopes: ${z.join(`, `)}`),n=t.scope),t.cowork&&n!==void 0&&n!==`user`&&I(`--cowork can only be used with user scope`),t.cowork&&n===void 0&&(n=`user`);let{name:r,marketplace:i}=p(e);M(`tengu_plugin_enable_command`,{_PROTO_plugin_name:r,...i&&{_PROTO_marketplace_name:i},scope:n??`auto`}),await W(e,n)}async function he(e,t){if(t.all&&e&&I(`Cannot use --all with a specific plugin`),!t.all&&!e&&I(`Please specify a plugin name or use --all to disable all plugins`),t.cowork&&T(!0),t.all){t.scope&&I(`Cannot use --scope with --all`),M(`tengu_plugin_disable_command`,{}),await G();return}let n;t.scope&&(z.includes(t.scope)||I(`Invalid scope "${t.scope}". Valid scopes: ${z.join(`, `)}`),n=t.scope),t.cowork&&n!==void 0&&n!==`user`&&I(`--cowork can only be used with user scope`),t.cowork&&n===void 0&&(n=`user`);let{name:r,marketplace:i}=p(e);M(`tengu_plugin_disable_command`,{_PROTO_plugin_name:r,...i&&{_PROTO_marketplace_name:i},scope:n??`auto`}),await H(e,n)}async function ge(e,t){t.cowork&&T(!0);let{name:n,marketplace:r}=p(e);M(`tengu_plugin_update_command`,{_PROTO_plugin_name:n,...r&&{_PROTO_marketplace_name:r}});let i=`user`;t.scope&&(L.includes(t.scope)||I(`Invalid scope "${t.scope}". Valid scopes: ${L.join(`, `)}`),i=t.scope),t.cowork&&i!==`user`&&I(`--cowork can only be used with user scope`),await U(e,i)}export{ce as marketplaceAddHandler,le as marketplaceListHandler,ue as marketplaceRemoveHandler,de as marketplaceUpdateHandler,he as pluginDisableHandler,me as pluginEnableHandler,fe as pluginInstallHandler,se as pluginListHandler,pe as pluginUninstallHandler,ge as pluginUpdateHandler,oe as pluginValidateHandler};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,r as t}from"./rolldown-runtime-DaDcL9Zw.js";import{g as n,n as r,x as i}from"./settings-
|
|
1
|
+
import{n as e,r as t}from"./rolldown-runtime-DaDcL9Zw.js";import{g as n,n as r,x as i}from"./settings-D4CpDv2y.js";var a=t({isPoorModeActive:()=>o,setPoorMode:()=>s});function o(){return c===null&&(c=r().poorMode===!0),c}function s(e){c=e,i(`userSettings`,{poorMode:e||void 0})}var c,l=e((()=>{n(),c=null}));export{s as i,o as n,a as r,l as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./poorMode-B_xEvuEV.js";t();export{e as isPoorModeActive};
|