@readmagic/workmate 0.0.10 → 0.0.12
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-CtRxzRny.js} +1 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-_bI4jo_P.js +1 -0
- package/dist/chunks/AgentsMdExternalIncludesDialog-_yJJ0wqu.js +1 -0
- package/dist/chunks/App-DoAZ7CYS.js +1 -0
- package/dist/chunks/ApproveApiKey-C8LwmDM2.js +1 -0
- package/dist/chunks/ApproveApiKey-DQP3qmb0.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-CDA2noEk.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-CLSACUmo.js → BypassPermissionsModeDialog-COI_V57z.js} +1 -1
- package/dist/chunks/ConsoleOAuthFlow-Dn8fO-o_.js +1 -0
- package/dist/chunks/{DiffDialog-9AYwtupw.js → DiffDialog-CRWtQ1R5.js} +3 -3
- package/dist/chunks/Doctor-CZ513Df9.js +3 -0
- package/dist/chunks/Doctor-CzPvNZzF.js +1 -0
- package/dist/chunks/ExitFlow-BFeftDv0.js +2 -0
- package/dist/chunks/{Grove-B9-hhkZA.js → Grove-DRZrhbF0.js} +2 -2
- package/dist/chunks/{HybridTransport-MxJ_W_np.js → HybridTransport-BadJQe6u.js} +4 -4
- package/dist/chunks/InvalidConfigDialog-DQaT6aen.js +1 -0
- package/dist/chunks/{InvalidSettingsDialog-YyQcHocx.js → InvalidSettingsDialog-ISzcIGPU.js} +1 -1
- package/dist/chunks/MCPConnectionManager-BpjC7CEo.js +1 -0
- package/dist/chunks/MCPToolListView-Rb1Q--jG.js +1 -0
- package/dist/chunks/{McpParsingWarnings-BCpfHaBK.js → McpParsingWarnings-xv0RZCSL.js} +1 -1
- package/dist/chunks/MessageSelector-BHB55sZb.js +3 -0
- package/dist/chunks/Messages-CPX-nIdA.js +11 -0
- package/dist/chunks/Onboarding-CymgipoF.js +1 -0
- package/dist/chunks/{PromptInputFooterSuggestions-BSA9NrZc.js → PromptInputFooterSuggestions-8-awCxOn.js} +1 -1
- package/dist/chunks/PromptInputHelpMenu-BP3UgCdi.js +1 -0
- package/dist/chunks/QueryEngine-HkswHUNv.js +1 -0
- package/dist/chunks/REPL-CZfg65kg.js +133 -0
- package/dist/chunks/REPL-eZsYNBfl.js +1 -0
- package/dist/chunks/RemoteSessionManager-B4jqKVd3.js +2 -0
- package/dist/chunks/ResumeConversation-B03XN_SP.js +1 -0
- package/dist/chunks/{SSETransport-CoxQ8YpH.js → SSETransport-je346ofV.js} +3 -3
- package/dist/chunks/SearchExtraToolsTool-C85Sanww.js +1 -0
- package/dist/chunks/Settings-C8GKWod1.js +2 -0
- package/dist/chunks/{TeleportProgress-Doucj-50.js → TeleportProgress-zmdAsogZ.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-B5I73j7Y.js → TeleportRepoMismatchDialog-CG32I4cO.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-D6kpr2c6.js → TeleportResumeWrapper-2Yjr74Lq.js} +1 -1
- package/dist/chunks/{ThemePicker-DrC8tlp0.js → ThemePicker-p7_hHk1V.js} +1 -1
- package/dist/chunks/TrustDialog-BVcny9vs.js +1 -0
- package/dist/chunks/{ValidationErrorsList-D_OUa4RT.js → ValidationErrorsList-DSSUWdgd.js} +1 -1
- package/dist/chunks/{WelcomeV2-DvfQHnZY.js → WelcomeV2-BnSYhyfu.js} +1 -1
- package/dist/chunks/add-dir-Bd7pilVx.js +1 -0
- package/dist/chunks/{agentDisplay-B755vMZE.js → agentDisplay-CfMLGPGH.js} +1 -1
- package/dist/chunks/{agents-CIvP8l0s.js → agents-BT82hwBN.js} +1 -1
- package/dist/chunks/agents-qR6r94-F.js +103 -0
- package/dist/chunks/allErrors-CS77lRvU.js +1 -0
- package/dist/chunks/api-C4VflFau.js +1 -0
- package/dist/chunks/{api-nSHc_GIQ.js → api-DAubp5q9.js} +1 -1
- package/dist/chunks/auth-CNCehj7y.js +1 -0
- package/dist/chunks/auth-DrD9DW6X.js +1 -0
- package/dist/chunks/{auth-5QB6tsfB.js → auth-yDsvFcM7.js} +2 -2
- package/dist/chunks/{autoMode-BnUiK9Cu.js → autoMode-C2lnBot9.js} +6 -6
- package/dist/chunks/backgroundHousekeeping-DbpTGbwl.js +1 -0
- package/dist/chunks/backgroundHousekeeping-SpTxViUq.js +17 -0
- package/dist/chunks/{banner-D0P7wXdw.js → banner-BcAM7iSx.js} +1 -1
- package/dist/chunks/bg-Ci7pG4eo.js +9 -0
- package/dist/chunks/{branch-DFWa4Oxo.js → branch-DJiMa8td.js} +2 -2
- package/dist/chunks/{break-cache-Chj9i9MP.js → break-cache-4rlQORVk.js} +2 -2
- package/dist/chunks/{bridgeConfig-Bb6URf4Q.js → bridgeConfig-BB6Hgali.js} +1 -1
- package/dist/chunks/bridgeConfig-Ccm79Jze.js +1 -0
- package/dist/chunks/{bridgeMessaging-C3huGcR3.js → bridgeMessaging-C9D0Lly2.js} +1 -1
- package/dist/chunks/{bridgePointer-DLYyvRKb.js → bridgePointer-DHWK3LEe.js} +1 -1
- package/dist/chunks/{bridgeStatusUtil-DFMftajD.js → bridgeStatusUtil-D8UbcVrZ.js} +1 -1
- package/dist/chunks/{btw-DSK9R2C8.js → btw-BO2B23f-.js} +1 -1
- package/dist/chunks/caches-BQmbXerw.js +1 -0
- package/dist/chunks/caches-Dtjmjm6G.js +1 -0
- package/dist/chunks/{capacityWake-amzeeBz0.js → capacityWake-ByL6fM6I.js} +1 -1
- package/dist/chunks/ccrClient-BG9HU_fW.js +1 -0
- package/dist/chunks/{claudeDesktop-CsJfF1b-.js → claudeDesktop-Ct_hyICL.js} +1 -1
- package/dist/chunks/{clear-ClFDpWVJ.js → clear-B4XN2fib.js} +1 -1
- package/dist/chunks/cliLaunch-OPOtzhvA.js +1 -0
- package/dist/chunks/client-7lIxWcaM.js +1 -0
- package/dist/chunks/client-B-2ccQZk.js +1 -0
- package/dist/chunks/{client-DFlE4fYh.js → client-BMA05FW8.js} +1 -1
- package/dist/chunks/commands-D_-v6_A0.js +1 -0
- package/dist/chunks/compact-kM0ETtB2.js +2 -0
- package/dist/chunks/config-9rLTDOYW.js +3 -0
- package/dist/chunks/config-Crf6Mzu3.js +1 -0
- package/dist/chunks/{config-CVHMRMwd.js → config-DMKtiMzJ.js} +1 -1
- package/dist/chunks/context-BY5oO5is.js +1 -0
- package/dist/chunks/{context-noninteractive-D5iQhasu.js → context-noninteractive-mAQt1p9l.js} +5 -5
- package/dist/chunks/context-noninteractive-tc4KTYfI.js +1 -0
- package/dist/chunks/conversation-CFIn-KsW.js +1 -0
- package/dist/chunks/conversation-DPI7VKBL.js +1 -0
- package/dist/chunks/createSSHSession-DjLSGm-0.js +6 -0
- package/dist/chunks/createSession-CftIZ3aq.js +1 -0
- package/dist/chunks/createSession-CjdLcRec.js +1 -0
- package/dist/chunks/crossProjectResume-BJqXBzkf.js +40 -0
- package/dist/chunks/{cwd-Cfdf7z7s.js → cwd-Besi3Os3.js} +1 -1
- package/dist/chunks/cwd-DpqwaYHw.js +1 -0
- package/dist/chunks/datadog-BGati3aQ.js +1 -0
- package/dist/chunks/debug-Dr1SjdXn.js +39 -0
- package/dist/chunks/{debugUtils-DX0KAXNK.js → debugUtils-cK-iOsEV.js} +1 -1
- package/dist/chunks/detached-CqfQYVOi.js +5 -0
- package/dist/chunks/detectRepository-BsKZDRoI.js +1 -0
- package/dist/chunks/detectRepository-CMEkS5_2.js +1 -0
- package/dist/chunks/{diff-jEJJe58I.js → diff-1HsxKGBh.js} +1 -1
- package/dist/chunks/{directoryCompletion-BbXR2bfy.js → directoryCompletion-ByBTSuLu.js} +1 -1
- package/dist/chunks/doctor-CJfvt9zR.js +1 -0
- package/dist/chunks/entry-CrZCZQQC.js +14 -0
- package/dist/chunks/{envUtils-BDhHQY0-.js → envUtils-DcaKZlRU.js} +1 -1
- package/dist/chunks/{esm-Cf4nSRjF.js → esm-BkOWaWVb.js} +1 -1
- package/dist/chunks/{execFileNoThrow-Dwu6psHW.js → execFileNoThrow-mXq4K0rl.js} +2 -2
- package/dist/chunks/execSyncWrapper-Ne33rRiD.js +1 -0
- package/dist/chunks/exit-B8MA4Ltm.js +1 -0
- package/dist/chunks/{extraUsage-Mi66JwFZ.js → extraUsage-0pUcYexI.js} +1 -1
- package/dist/chunks/extractMemories-DqhN0lba.js +1 -0
- package/dist/chunks/fast-DT5WDe3L.js +1 -0
- package/dist/chunks/{fast-BU4iUZ8E.js → fast-VOu2FUlV.js} +1 -1
- package/dist/chunks/{fileSuggestions-BMfQIDdW.js → fileSuggestions-Be-pyLLq.js} +3 -3
- package/dist/chunks/firstPartyEventLogger-B8RVGBQB.js +1 -0
- package/dist/chunks/{firstPartyEventLogger-B3cXgR67.js → firstPartyEventLogger-aFhcruXA.js} +2 -2
- package/dist/chunks/{flushGate-DgSDVGKZ.js → flushGate-BUSrMj_6.js} +1 -1
- package/dist/chunks/gemini-DB4M-MYv.js +1 -0
- package/dist/chunks/generateSessionName-DhCypqJ_.js +1 -0
- package/dist/chunks/{genericProcessUtils-CmsUPyRz.js → genericProcessUtils-Dc1pfb7J.js} +1 -1
- package/dist/chunks/git-Bs1vtuvX.js +1 -0
- package/dist/chunks/git-CoQQ6YEf.js +6 -0
- package/dist/chunks/githubRepoPathMapping-CmpEaQoo.js +1 -0
- package/dist/chunks/goal-TxXtfkQ6.js +3 -0
- package/dist/chunks/{grok-BXMvezWb.js → grok-D2a_J5wE.js} +1 -1
- package/dist/chunks/{grove-CeOjTaY6.js → grove-BnzBbGsX.js} +1 -1
- package/dist/chunks/{help-5DNZO6_H.js → help-C5ankDi4.js} +1 -1
- package/dist/chunks/{hooks-C637tFtd.js → hooks-BZS105Rd.js} +3 -3
- package/dist/chunks/hooks-D-twhU_z.js +1 -0
- package/dist/chunks/{initReplBridge-D1h10vQ9.js → initReplBridge-DL4klK0C.js} +1 -1
- package/dist/chunks/{install-C-6ItpH0.js → install-NZvHd_40.js} +1 -1
- package/dist/chunks/{instrumentation-DaiPDUst.js → instrumentation-CjBlVlFq.js} +5 -5
- package/dist/chunks/{job-BeYzQUiR.js → job-D502Zf8J.js} +1 -1
- package/dist/chunks/jwtUtils-FQWtM6iM.js +1 -0
- package/dist/chunks/keybindings-D9Boc8FD.js +2 -0
- package/dist/chunks/{launchLocalMemory-CE4J98xO.js → launchLocalMemory-DxC3LojF.js} +2 -2
- package/dist/chunks/{launchOnboarding-BfTdC6vp.js → launchOnboarding-BLp5k_H4.js} +1 -1
- package/dist/chunks/{loadAgentsDir-C7lOqvfh.js → loadAgentsDir-BXtV2jiO.js} +563 -570
- package/dist/chunks/loadAgentsDir-BjsAQWqt.js +1 -0
- package/dist/chunks/loadPluginHooks-Dt3XQ-3N.js +1 -0
- package/dist/chunks/{localSearch-BKrznW5x.js → localSearch-CeP4ef0a.js} +1 -1
- package/dist/chunks/localSearch-Cz8Ot7k2.js +1 -0
- package/dist/chunks/{log-CezCRpAN.js → log-27kCA_9u.js} +1 -1
- package/dist/chunks/{logoV2Utils-BkQfyQ1-.js → logoV2Utils-CEnU8qad.js} +1 -1
- package/dist/chunks/{magicDocs-BpVcON9o.js → magicDocs-YtfrqVC6.js} +4 -4
- package/dist/chunks/main-CGLCy2pM.js +31 -0
- package/dist/chunks/main-CkjTzYj1.js +513 -0
- package/dist/chunks/{managedEnv-DhWRJ5DK.js → managedEnv-B-BNY0xC.js} +1 -1
- package/dist/chunks/managedEnv-K9Si1UuL.js +1 -0
- package/dist/chunks/{mappers-bOab8ipV.js → mappers-IuJeXgvr.js} +1 -1
- package/dist/chunks/mcp-DMBoeQzm.js +6 -0
- package/dist/chunks/mcp-TMOPfLcW.js +1 -0
- package/dist/chunks/mcp-x5rgv-uv.js +2 -0
- package/dist/chunks/{memoize-DsqYrbeR.js → memoize-Co4vS6UF.js} +1 -1
- package/dist/chunks/memory-DDUoR63T.js +1 -0
- package/dist/chunks/{mode-DlKnUM8l.js → mode-GzBwK--u.js} +2 -2
- package/dist/chunks/model-BydaMaPr.js +1 -0
- package/dist/chunks/model-CDnVaVDR.js +1 -0
- package/dist/chunks/model-CIvbC7rW.js +1 -0
- package/dist/chunks/{modelOptions-CxP067Qv.js → modelOptions-ut0xePEe.js} +1 -1
- package/dist/chunks/nativeInstaller-fgCMR_c0.js +1 -0
- package/dist/chunks/oauth-D38aRTUb.js +1 -0
- package/dist/chunks/oauth-U649LV5H.js +1 -0
- package/dist/chunks/{observationStore-BpjlK0pG.js → observationStore-D0rm3GhP.js} +1 -1
- package/dist/chunks/omit-D4Udf-p-.js +1 -0
- package/dist/chunks/onChangeAppState-WbvtqDtk.js +1 -0
- package/dist/chunks/{openai-B9C2XN5Q.js → openai-DaVFXyBB.js} +3 -3
- package/dist/chunks/panel-CoF2a-h4.js +1 -0
- package/dist/chunks/parser-B2PlJg4C.js +1 -0
- package/dist/chunks/{parser-BwPXQomy.js → parser-CUUiH40T.js} +1 -1
- package/dist/chunks/{partition-D-UhsUCx.js → partition-CzW_31Y1.js} +1 -1
- package/dist/chunks/permissions-BT3lxYBM.js +3 -0
- package/dist/chunks/pidLock-d1VPd6CG.js +3 -0
- package/dist/chunks/{plan-CyU2zrCK.js → plan-M9DG3AqN.js} +1 -1
- package/dist/chunks/{platform-BMPbglug.js → platform-Dg1c9F_1.js} +1 -1
- package/dist/chunks/plugin-BiNHuq3h.js +17 -0
- package/dist/chunks/pluginAutoupdate-B5lel6s5.js +1 -0
- package/dist/chunks/pluginBlocklist-CNGmIlwU.js +1 -0
- package/dist/chunks/pluginCliCommands-WLOEhb2M.js +1 -0
- package/dist/chunks/pluginFlagging-CXSSOj4J.js +1 -0
- package/dist/chunks/pluginOperations-BFbty6WT.js +2 -0
- package/dist/chunks/pluginStartupCheck-BEd0VeQC.js +1 -0
- package/dist/chunks/pluginStartupCheck-Bcdxg484.js +1 -0
- package/dist/chunks/plugins-BMZ3aYKP.js +4 -0
- package/dist/chunks/poorMode-Djw0P9Gu.js +1 -0
- package/dist/chunks/{poorMode-DEwQOAJt.js → poorMode-DxgO_bUb.js} +1 -1
- package/dist/chunks/print-DmoLcwVq.js +26 -0
- package/dist/chunks/processBashCommand-B-VqME9O.js +1 -0
- package/dist/chunks/processSlashCommand-D6zEooTy.js +5 -0
- package/dist/chunks/{projectContext-CIxul6vA.js → projectContext-BN2ZWzOG.js} +1 -1
- package/dist/chunks/{projectContext-RUMJB798.js → projectContext-Bw3o5BrN.js} +1 -1
- package/dist/chunks/prompt-C3RRe4kW.js +1 -0
- package/dist/chunks/{prompt-M2lu8_Oa.js → prompt-CRc2QEZ5.js} +5 -5
- package/dist/chunks/prompt-EtAanewG.js +1 -0
- package/dist/chunks/{promptEditor-DhcZY-iu.js → promptEditor-Bo1d8ZLq.js} +2 -2
- package/dist/chunks/{protocolHandler-CkFaJKKo.js → protocolHandler-B83fCYI4.js} +4 -4
- package/dist/chunks/{proxy-CuMaO_YV.js → proxy-BEKNaTXI.js} +3 -3
- package/dist/chunks/rcDebugLog-DSchf3Hs.js +1 -0
- package/dist/chunks/reconciler-BGav_ezX.js +1 -0
- package/dist/chunks/refresh-DumNiLvM.js +1 -0
- package/dist/chunks/{registerProtocol-CsNYRZKr.js → registerProtocol-DduKPsn_.js} +2 -2
- package/dist/chunks/{reload-plugins-B7JAE3b4.js → reload-plugins-DNEgQ5vo.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-CFLJhsB6.js → remoteBridgeCore-BGOqHADF.js} +1 -1
- package/dist/chunks/remoteManagedSettings-26nhzuca.js +1 -0
- package/dist/chunks/{rename-BCp2Vtqu.js → rename-BPknfVGF.js} +1 -1
- package/dist/chunks/{renderOptions-Q5oCLFIC.js → renderOptions-45A-EdsK.js} +1 -1
- package/dist/chunks/resume-DGz04xDh.js +2 -0
- package/dist/chunks/ripgrep-BLQnqPnE.js +1 -0
- package/dist/chunks/{ripgrep-DvOOsDMv.js → ripgrep-DQ_ILUJV.js} +5 -5
- package/dist/chunks/{runtimeObserver-CS_3BDNo.js → runtimeObserver-BZrF3GnQ.js} +4 -4
- package/dist/chunks/{runtimeObserver-DYUva6g-.js → runtimeObserver-CBV-7-w7.js} +1 -1
- package/dist/chunks/sandbox-adapter-DUqeqkQD.js +1 -0
- package/dist/chunks/sandbox-toggle-D61gVqcT.js +1 -0
- package/dist/chunks/searchExtraTools-CgsV6kb1.js +1 -0
- package/dist/chunks/{session-CO3gEqQP.js → session-Dy-_R7KP.js} +2 -2
- package/dist/chunks/sessionFileAccessHooks-BJlrZaRD.js +1 -0
- package/dist/chunks/sessionObserver-BGYoLRGx.js +1 -0
- package/dist/chunks/{sessionObserver-YkRHC-Aa.js → sessionObserver-CyLpHSkw.js} +1 -1
- package/dist/chunks/{sessionState-Bifmu95-.js → sessionState-DSWN4tMV.js} +2 -2
- package/dist/chunks/sessionStorage-zJ1esSCE.js +1 -0
- package/dist/chunks/{sessionStoragePortable-JZnGwqUM.js → sessionStoragePortable-BhkGMZWp.js} +1 -1
- package/dist/chunks/{sessionTitle-COBSgSXS.js → sessionTitle-L5tyJgdU.js} +2 -2
- package/dist/chunks/{sessionTracing-BrNx1k2V.js → sessionTracing-DpHGGIZm.js} +3 -3
- package/dist/chunks/settings-3ionQKNv.js +1 -0
- package/dist/chunks/settings-DiBMs2gM.js +20 -0
- package/dist/chunks/settingsSync-dBqlrbcU.js +1 -0
- package/dist/chunks/setup-zf3v3ICe.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-DEaw-X5j.js → shadowedRuleDetection-DZ0AA2Rw.js} +1 -1
- package/dist/chunks/{shellQuote-BYeOv3Ip.js → shellQuote-C_I6DHLV.js} +2 -2
- package/dist/chunks/{sideQuestion-D0OKljee.js → sideQuestion-BYT8FdPF.js} +2 -2
- package/dist/chunks/sinks-DppGvgz1.js +1 -0
- package/dist/chunks/sinks-mFsijQ_S.js +2 -0
- package/dist/chunks/skillChangeDetector-D-iq09Xs.js +1 -0
- package/dist/chunks/{skillGapStore-N_kmvXML.js → skillGapStore-DQXHqoP7.js} +2 -2
- package/dist/chunks/{skillLifecycle-C4F5RXuh.js → skillLifecycle-BG_RnGSh.js} +2 -2
- package/dist/chunks/skillSearchPanel-DxYP4Q6R.js +21 -0
- package/dist/chunks/skills-BD-2ofXA.js +1 -0
- package/dist/chunks/startupProfiler-CUlV07MD.js +1 -0
- package/dist/chunks/{startupProfiler-L_UWZ03w.js → startupProfiler-Dc5r6LgE.js} +2 -2
- package/dist/chunks/{state-BemZdQIl.js → state-BPFYBqm1.js} +1 -1
- package/dist/chunks/state-CsdHk8n-.js +1 -0
- package/dist/chunks/{stats-IzV0_vEc.js → stats-BkadEKa-.js} +1 -1
- package/dist/chunks/status-BmHu-c7I.js +2 -0
- package/dist/chunks/{status-CeVP_uDT.js → status-CrmnCDIE.js} +1 -1
- package/dist/chunks/{statusNoticeHelpers-Bb9gxdSt.js → statusNoticeHelpers-DakAVtQO.js} +1 -1
- package/dist/chunks/{stringUtils-C84IJ91d.js → stringUtils-Df-Lnjxd.js} +1 -1
- package/dist/chunks/{subprocessEnv-Ci8VV_bi.js → subprocessEnv-CNBOhlDV.js} +1 -1
- package/dist/chunks/subprocessEnv-DtBCqQIo.js +1 -0
- package/dist/chunks/switcher-Dm646gO5.js +1 -0
- package/dist/chunks/switcher-sYTxnJQA.js +1 -0
- package/dist/chunks/syncCache-BofuFJEe.js +1 -0
- package/dist/chunks/{tasks-DZDhgx0w.js → tasks-NpI1iEem.js} +1 -1
- package/dist/chunks/teleport-Bs3kEipi.js +1 -0
- package/dist/chunks/{templateJobs-CrNPEKkh.js → templateJobs-C94jEE6O.js} +2 -2
- package/dist/chunks/{terminalSetup-CBqcwQll.js → terminalSetup-CbXKCpWM.js} +1 -1
- package/dist/chunks/{terminalSetup-D-N8YPiQ.js → terminalSetup-fwhFTxGi.js} +4 -4
- package/dist/chunks/{theme-Dazsirbw.js → theme-CEi3b_8f.js} +1 -1
- package/dist/chunks/tmux-d3cNCIZA.js +1 -0
- package/dist/chunks/{toolEventObserver-lnHJ9fLQ.js → toolEventObserver-DlL9CHmI.js} +1 -1
- package/dist/chunks/toolPool-DIT_uhtD.js +1 -0
- package/dist/chunks/trustedDevice-BokywSKL.js +1 -0
- package/dist/chunks/trustedDevice-Bzz03jCy.js +1 -0
- package/dist/chunks/{types-3j8PS-Du.js → types-BJ7qTz75.js} +2 -2
- package/dist/chunks/udsClient-CF8BmZgN.js +1 -0
- package/dist/chunks/{updateCCB-BPe9_FW6.js → updateCCB-CzBxsuJe.js} +1 -1
- package/dist/chunks/{upstreamproxy-DF00RzGG.js → upstreamproxy-BuBFDFAD.js} +2 -2
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-ChqBs9Lr.js → useExitOnCtrlCDWithKeybindings-BHQfwlAl.js} +1 -1
- package/dist/chunks/useMainLoopModel-BkyIIW9t.js +1 -0
- package/dist/chunks/useManagePlugins-BWROoGDs.js +1 -0
- package/dist/chunks/{useMergedTools-Dk5cPqLc.js → useMergedTools-CHxnwR7R.js} +1 -1
- package/dist/chunks/{useSearchInput-C7Y1I9P9.js → useSearchInput-q2CFPU4W.js} +1 -1
- package/dist/chunks/{useSettingsErrors-DAEO7AyB.js → useSettingsErrors-CPVQbsqq.js} +1 -1
- package/dist/chunks/{userAgent-CIq27vUR.js → userAgent-B7WkjI6I.js} +1 -1
- package/dist/chunks/util-BfqXOA-P.js +1 -0
- package/dist/chunks/{validatePlugin-Kk6pxnO2.js → validatePlugin-jrcrYEIu.js} +1 -1
- package/dist/chunks/{vim-EYQn94Kx.js → vim-C4Hs5U2h.js} +1 -1
- package/dist/chunks/{which-DzFN5TNM.js → which-mplwBbc0.js} +1 -1
- package/dist/chunks/windowsPaths-B8p9tFRF.js +1 -0
- package/dist/chunks/windowsPaths-C7Mdo9aU.js +1 -0
- package/dist/chunks/{workSecret-DUqdPy44.js → workSecret-XLodD7tw.js} +1 -1
- package/dist/chunks/workerRegistry-Cfo7bKlm.js +6 -0
- package/dist/chunks/worktree-D0k_pCEz.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-BqNxQOXJ.js +0 -1
- 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/Onboarding-ClwHS5rh.js +0 -1
- package/dist/chunks/PromptInputHelpMenu-Bb4KdIX_.js +0 -1
- 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/RemoteSessionManager-CS6mywIn.js +0 -2
- 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/TrustDialog-Fk4m_Sy4.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/autonomy-C1aSgWPQ.js +0 -1
- package/dist/chunks/autonomy-Src6sKCp.js +0 -15
- 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/bg-DAPORXF3.js +0 -9
- package/dist/chunks/bridgeConfig-BeqChxJC.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/cliLaunch-BWcoyZDP.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-Do1870_d.js +0 -3
- 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/createSSHSession-CJtzNQdZ.js +0 -6
- 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/cwd-ClLru_7T.js +0 -1
- package/dist/chunks/datadog-DjeJThpV.js +0 -1
- package/dist/chunks/debug-RAynG_nM.js +0 -39
- package/dist/chunks/detached-X_yjYR7x.js +0 -5
- 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/entry-oIqjxIjQ.js +0 -14
- 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/goal-ZmSRBx4q.js +0 -3
- 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/main-CvOv59-7.js +0 -31
- 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/mcp-VcGPYCkW.js +0 -2
- package/dist/chunks/memory-C5ohwh-T.js +0 -1
- package/dist/chunks/model-BGu1AGq0.js +0 -1
- package/dist/chunks/model-BsZ4sP_H.js +0 -1
- package/dist/chunks/model-D19IIcll.js +0 -1
- package/dist/chunks/nativeInstaller-QB8cEJ18.js +0 -1
- package/dist/chunks/oauth-BN2I0_jl.js +0 -1
- package/dist/chunks/oauth-C9VBDB0Y.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/print-eCRv_Li-.js +0 -26
- 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/rcDebugLog-CARUIORE.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/sandbox-toggle--zNSKce_.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/skills-C4CTRN9o.js +0 -1
- package/dist/chunks/startupProfiler-D4FBdEQr.js +0 -1
- package/dist/chunks/state-BAGmpVBn.js +0 -1
- package/dist/chunks/state-D_lk6z-C.js +0 -1
- package/dist/chunks/status-Dzuw3hBv.js +0 -2
- package/dist/chunks/subprocessEnv-CZkA9Cdp.js +0 -1
- package/dist/chunks/switcher-4KzBvuKH.js +0 -1
- package/dist/chunks/switcher-CCs9xl1z.js +0 -1
- package/dist/chunks/syncCache-CBRiRU5x.js +0 -1
- package/dist/chunks/teleport-Bw0jSxe9.js +0 -1
- package/dist/chunks/tmux-DewYVEBm.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/windowsPaths-BU3yQWTB.js +0 -1
- package/dist/chunks/windowsPaths-DgZ3YY4a.js +0 -1
- package/dist/chunks/workerRegistry-C07BcZIw.js +0 -6
- package/dist/chunks/worktree-dFUkhVE_.js +0 -1
|
@@ -1,17 +0,0 @@
|
|
|
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{$C as o,$o as s,AS as c,Ao as l,Cg as u,Eg as d,Eo as f,FS as p,Fo as m,Go as h,Ho as g,IS as _,Ip as v,Iu as y,Jw as b,LS as x,Lg as S,Lp as C,MS as w,Mo as ee,NS as te,OS as T,PS as E,Qw as D,Qx as O,RS as ne,Rg as re,Ro as k,Ru as ie,TS as A,Vo as j,Xo as ae,Yo as oe,Zw as M,_T as se,as as N,bT as ce,bo as le,dT as ue,es as de,fd as fe,is as P,jS as pe,kS as F,ko as me,ls as he,mo as ge,ns as _e,pT as ve,pd as ye,po as be,qC as xe,qo as I,rs as Se,sT as L,ss as Ce,tS as we,ts as Te,us as Ee,vT as De,wS as Oe,wg as ke,xT as Ae,yo as je}from"./loadAgentsDir-C7lOqvfh.js";import{D as Me,Gr as Ne,Gt as R,H as Pe,I as z,P as B,T as V,Wt as Fe,Xn as Ie,fi as H,hn as Le,j as Re,k as ze,n as Be,ot as Ve,r as He,t as Ue,x as We,y as Ge}from"./src-P_wYS_NJ2.js";import{t as Ke}from"./jsx-runtime-Bb4Xn-E0.js";import{C as qe,F as Je,S as Ye,W as Xe,a as Ze,l as Qe,z as $e}from"./debug-RAynG_nM.js";import{In as et,Ln as tt,c as nt,f as rt,g as it,vt as at,x as ot,xt as st}from"./settings-DnptdP79.js";import{b as ct,h as lt}from"./config-Do1870_d.js";import{o as ut,s as dt}from"./log-CezCRpAN.js";import{n as ft,r as pt}from"./analytics-DJobLaWP.js";import{C as mt,y as ht}from"./startupProfiler-L_UWZ03w.js";import{l as gt,o as _t}from"./stringUtils-C84IJ91d.js";import{n as vt,t as yt}from"./pluginStartupCheck-CB2q2dLv.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-D90IRawu.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-Kk6pxnO2.js";import{a as Ft,n as It,o as Lt,r as Rt}from"./pluginFlagging-DZaYzecY.js";import{i as zt,n as Bt}from"./MCPConnectionManager-CUTuaa8T.js";import{n as Vt,t as Ht}from"./useExitOnCtrlCDWithKeybindings-ChqBs9Lr.js";import{t as Ut}from"./SearchBox-C9vUA4IM.js";import{n as Wt,t as Gt}from"./useSearchInput-C7Y1I9P9.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-CvqB4nCw.js";import{i as en,n as tn}from"./pluginAutoupdate-SlRFJlTT.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),[h,g]=(0,on.useState)(``),_=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),g(``);let{name:e,resolvedSource:t}=await m(n,e=>{g(e)});oe(e,{source:t}),he();let r=n.source;n.source===`github`&&(r=n.repo),pt(`tengu_marketplace_added`,{source_type:r}),l&&await l(),g(``),p(!1),u?s(`Successfully added marketplace: ${e}`):c({type:`browse-marketplace`,targetMarketplace:e})}catch(e){let t=Xe(e);dt(t),a(t.message),g(``),p(!1),s(u?`Error: ${t.message}`:null)}};return(0,on.useEffect)(()=>{e&&!d.current&&!i&&!o&&(d.current=!0,_())},[]),(0,U.jsxs)(z,{flexDirection:`column`,children:[(0,U.jsxs)(z,{flexDirection:`column`,paddingX:1,borderStyle:`round`,children:[(0,U.jsx)(z,{marginBottom:1,children:(0,U.jsx)(B,{bold:!0,children:`Add Marketplace`})}),(0,U.jsxs)(z,{flexDirection:`column`,children:[(0,U.jsx)(B,{children:`Enter marketplace source:`}),(0,U.jsx)(B,{dimColor:!0,children:`Examples:`}),(0,U.jsx)(B,{dimColor:!0,children:` · owner/repo (GitHub)`}),(0,U.jsx)(B,{dimColor:!0,children:` · git@github.com:owner/repo.git (SSH)`}),(0,U.jsx)(B,{dimColor:!0,children:` · https://example.com/marketplace.json`}),(0,U.jsx)(B,{dimColor:!0,children:` · ./path/to/marketplace`}),(0,U.jsx)(z,{marginTop:1,children:(0,U.jsx)(fe,{value:e,onChange:t,onSubmit:_,columns:80,cursorOffset:n,onChangeCursorOffset:r,focus:!0,showCursor:!0})})]}),f&&(0,U.jsxs)(z,{marginTop:1,children:[(0,U.jsx)(y,{}),(0,U.jsx)(B,{children:h||`Adding marketplace to configuration…`})]}),i&&(0,U.jsx)(z,{marginTop:1,children:(0,U.jsx)(B,{color:`error`,children:i})}),o&&(0,U.jsx)(z,{marginTop:1,children:(0,U.jsx)(B,{children:o})})]}),(0,U.jsx)(z,{marginLeft:3,children:(0,U.jsx)(B,{dimColor:!0,italic:!0,children:(0,U.jsxs)(V,{children:[(0,U.jsx)(Me,{shortcut:`Enter`,action:`add`}),(0,U.jsx)(v,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})})]})}var on,U,sn=e((()=>{H(),on=t(H(),1),ft(),C(),Ue(),ie(),ye(),$e(),ut(),Ee(),j(),At(),U=Ke()}));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(Fe(`confirm:no`,o,{context:`Settings`}),R({"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`}),Le((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(Ne(p)):p;return(0,dn.jsxs)(Ge,{title:e,subtitle:t,onCancel:o,isCancelActive:!1,children:[(0,dn.jsxs)(z,{flexDirection:`column`,children:[(0,dn.jsxs)(B,{bold:!0,children:[g.title||h,v&&(0,dn.jsx)(B,{color:`error`,children:` *`})]}),g.description&&(0,dn.jsx)(B,{dimColor:!0,children:g.description}),(0,dn.jsxs)(z,{marginTop:1,children:[(0,dn.jsxs)(B,{children:[a.pointerSmall,` `]}),(0,dn.jsx)(B,{children:y}),(0,dn.jsx)(B,{children:`█`})]})]}),(0,dn.jsxs)(z,{flexDirection:`column`,children:[(0,dn.jsxs)(B,{dimColor:!0,children:[`Field `,l+1,` of `,s.length]}),l<s.length-1&&(0,dn.jsx)(B,{dimColor:!0,children:`Tab: Next field · Enter: Save and continue`}),l===s.length-1&&(0,dn.jsx)(B,{dimColor:!0,children:`Enter: Save configuration`})]})]})}var un,dn,fn=e((()=>{i(),un=t(H(),1),Ue(),xe(),r(),dn=Ke()}));async function pn(e){let{enabled:t,disabled:n}=await ge();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=T(e);Object.keys(r).length>0&&n.push({key:`top-level`,title:`Configure ${e.name}`,subtitle:`Plugin options`,schema:r,load:()=>c(t),save:n=>pe(t,n,e.manifest.userConfig)});let i=Oe(e);for(let r of i)n.push({key:`channel:${r.server}`,title:`Configure ${r.displayName}`,subtitle:`Plugin: ${e.name}`,schema:r.configSchema,load:()=>E(t,r.server)??void 0,save:e=>_(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 l(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:l,onCancel:()=>n(`skipped`)},s.key)}var hn,gn,_n=e((()=>{hn=t(H(),1),$e(),w(),A(),be(),F(),fn(),gn=Ke()}));function vn(){let e=P();return(0,yn.jsxs)(z,{marginBottom:1,children:[(0,yn.jsxs)(B,{color:`claude`,children:[a.warning,` `]}),(0,yn.jsxs)(B,{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(),H(),Ue(),N(),yn=Ke()}));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)(z,{marginTop:1,children:(0,wn.jsx)(B,{dimColor:!0,italic:!0,children:(0,wn.jsxs)(V,{children:[e&&(0,wn.jsx)(v,{action:`plugin:install`,context:`Plugin`,fallback:`i`,description:`install`,bold:!0}),(0,wn.jsx)(v,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,wn.jsx)(v,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,wn.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})}var wn,Tn=e((()=>{H(),C(),Ue(),wn=Ke()}));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(H(),1),On=5}));function An({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:o,targetMarketplace:c,targetPlugin:u}){let[d,f]=(0,W.useState)(`marketplace-list`),[p,m]=(0,W.useState)(null),[h,_]=(0,W.useState)(null),[y,b]=(0,W.useState)([]),[x,S]=(0,W.useState)([]),[C,w]=(0,W.useState)(!0),[ee,te]=(0,W.useState)(null),[T,E]=(0,W.useState)(0),[D,O]=(0,W.useState)(new Set),[ie,A]=(0,W.useState)(new Set),j=En({totalItems:x.length,selectedIndex:T}),[ae,oe]=(0,W.useState)(0),[M,se]=(0,W.useState)(!1),[N,ce]=(0,W.useState)(null),[ue,de]=(0,W.useState)(null);Fe(`confirm:no`,jn.useCallback(()=>{d===`plugin-list`?c?i({type:`manage-marketplaces`,targetMarketplace:c}):y.length===1?i({type:`menu`}):(f(`marketplace-list`),m(null),O(new Set)):d===`plugin-details`?(f(`plugin-list`),_(null)):i({type:`menu`})},[d,c,i,y.length]),{context:`Confirmation`}),(0,W.useEffect)(()=>{async function e(){try{let e=await g(),{marketplaces:n,failures:r}=await Ce(e),i=[];for(let{name:e,config:t,data:r}of n)if(r){let n=et(r.plugins,t=>l(s(t.name,e)));i.push({name:e,totalPlugins:r.plugins.length,installedCount:n,source:Se(t.source)})}i.sort((e,t)=>e.name===`claude-plugin-directory`?-1:+(t.name===`claude-plugin-directory`)),b(i);let a=_e(r,et(n,e=>e.data!==null));if(a)if(a.type===`warning`)de(a.message+`. Showing available marketplaces.`);else throw Error(a.message);if(i.length===1&&!c&&!u){let e=i[0];e&&(m(e.name),f(`plugin-list`))}if(u){let n=null,r=null;for(let[t]of Object.entries(e)){let e=await k(t);if(e){let i=e.plugins.find(e=>e.name===u);if(i){let e=s(i.name,t);n={entry:i,marketplaceName:t,pluginId:e,isInstalled:me(e)},r=t;break}}}if(n&&r){let e=n.pluginId;me(e)?t(`Plugin '${e}' is already installed globally. Use '/plugin' to manage existing plugins.`):(m(r),_(n),f(`plugin-details`))}else t(`Plugin "${u}" not found in any marketplace`)}else c&&(i.some(e=>e.name===c)?(m(c),f(`plugin-list`)):t(`Marketplace "${c}" not found`))}catch(e){t(e instanceof Error?e.message:`Failed to load marketplaces`)}finally{w(!1)}}e()},[t,c,u]),(0,W.useEffect)(()=>{if(!p)return;let e=!1;async function n(n){w(!0);try{let t=await k(n);if(e)return;if(!t)throw Error(`Failed to load marketplace: ${n}`);let r=[];for(let e of t.plugins){let t=s(e.name,n);re(t)||r.push({entry:e,marketplaceName:n,pluginId:t,isInstalled:me(t)})}try{let t=await Nt();if(e)return;te(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),E(0),O(new Set)}catch(n){if(e)return;t(n instanceof Error?n.message:`Failed to load plugins`)}finally{w(!1)}}return n(p),()=>{e=!0}},[p,t]);let fe=async()=>{if(D.size===0)return;let e=x.filter(e=>D.has(e.pluginId));A(new Set(e.map(e=>e.pluginId)));let n=0,a=0,s=[];for(let t of e){let e=await le({pluginId:t.pluginId,entry:t.entry,marketplaceName:t.marketplaceName,scope:`user`});e.success?n++:(a++,s.push({name:t.entry.name,reason:e.error}))}A(new Set),O(new Set),he(),a===0?r(`✓ Installed ${n} ${gt(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${Te(s,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${Te(s,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&o&&await o(),i({type:`menu`})},P=async(e,t=`user`)=>{se(!0),ce(null);let n=await le({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await pn(e.pluginId);if(t){se(!1),f({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),o&&await o(),i({type:`menu`})}else se(!1),ce(n.error)};(0,W.useEffect)(()=>{e&&r(e)},[e,r]),R({"select:previous":()=>{T>0&&E(T-1)},"select:next":()=>{T<y.length-1&&E(T+1)},"select:accept":()=>{let e=y[T];e&&(m(e.name),f(`plugin-list`))}},{context:`Select`,isActive:d===`marketplace-list`}),R({"select:previous":()=>{T>0&&j.handleSelectionChange(T-1,E)},"select:next":()=>{T<x.length-1&&j.handleSelectionChange(T+1,E)},"select:accept":()=>{if(T===x.length&&D.size>0)fe();else if(T<x.length){let e=x[T];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(_(e),f(`plugin-details`),oe(0),ce(null)))}}},{context:`Select`,isActive:d===`plugin-list`}),R({"plugin:toggle":()=>{if(T<x.length){let e=x[T];if(e&&!e.isInstalled){let t=new Set(D);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),O(t)}}},"plugin:install":()=>{D.size>0&&fe()}},{context:`Plugin`,isActive:d===`plugin-list`});let pe=jn.useMemo(()=>{if(!h)return[];let e=h.entry.homepage;return Sn(e,xn(h))},[h]);if(R({"select:previous":()=>{ae>0&&oe(ae-1)},"select:next":()=>{ae<pe.length-1&&oe(ae+1)},"select:accept":()=>{if(!h)return;let e=pe[ae]?.action,t=h.entry.homepage,n=xn(h);e===`install-user`?P(h,`user`):e===`install-project`?P(h,`project`):e===`install-local`?P(h,`local`):e===`homepage`&&t?ne(t):e===`github`&&n?ne(`https://github.com/${n}`):e===`back`&&(f(`plugin-list`),_(null))}},{context:`Select`,isActive:d===`plugin-details`&&!!h}),typeof d==`object`&&d.type===`plugin-options`){let{plugin:e,pluginId:t}=d;function n(e){r(e),o&&o(),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(C)return(0,G.jsx)(B,{children:`Loading…`});if(e)return(0,G.jsx)(B,{color:`error`,children:e});if(d===`marketplace-list`)return y.length===0?(0,G.jsxs)(z,{flexDirection:`column`,children:[(0,G.jsx)(z,{marginBottom:1,children:(0,G.jsx)(B,{bold:!0,children:`Select marketplace`})}),(0,G.jsx)(B,{children:`No marketplaces configured.`}),(0,G.jsxs)(B,{dimColor:!0,children:[`Add a marketplace first using `,`'Add marketplace'`,`.`]}),(0,G.jsx)(z,{marginTop:1,paddingLeft:1,children:(0,G.jsx)(B,{dimColor:!0,children:(0,G.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})})})]}):(0,G.jsxs)(z,{flexDirection:`column`,children:[(0,G.jsx)(z,{marginBottom:1,children:(0,G.jsx)(B,{bold:!0,children:`Select marketplace`})}),ue&&(0,G.jsx)(z,{marginBottom:1,flexDirection:`column`,children:(0,G.jsxs)(B,{color:`warning`,children:[a.warning,` `,ue]})}),y.map((e,t)=>(0,G.jsxs)(z,{flexDirection:`column`,marginBottom:+(t<y.length-1),children:[(0,G.jsx)(z,{children:(0,G.jsxs)(B,{color:T===t?`suggestion`:void 0,children:[T===t?a.pointer:` `,` `,e.name]})}),(0,G.jsx)(z,{marginLeft:2,children:(0,G.jsxs)(B,{dimColor:!0,children:[e.totalPlugins,` `,gt(e.totalPlugins,`plugin`),` available`,e.installedCount>0&&` · ${e.installedCount} already installed`,e.source&&` · ${e.source}`]})})]},e.name)),(0,G.jsx)(z,{marginTop:1,children:(0,G.jsx)(B,{dimColor:!0,italic:!0,children:(0,G.jsxs)(V,{children:[(0,G.jsx)(v,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,G.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]});if(d===`plugin-details`&&h){let e=h.entry.homepage,t=Sn(e,xn(h));return(0,G.jsxs)(z,{flexDirection:`column`,children:[(0,G.jsx)(z,{marginBottom:1,children:(0,G.jsx)(B,{bold:!0,children:`Plugin Details`})}),(0,G.jsxs)(z,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(B,{bold:!0,children:h.entry.name}),h.entry.version&&(0,G.jsxs)(B,{dimColor:!0,children:[`Version: `,h.entry.version]}),h.entry.description&&(0,G.jsx)(z,{marginTop:1,children:(0,G.jsx)(B,{children:h.entry.description})}),h.entry.author&&(0,G.jsx)(z,{marginTop:1,children:(0,G.jsxs)(B,{dimColor:!0,children:[`By:`,` `,typeof h.entry.author==`string`?h.entry.author:h.entry.author.name]})})]}),(0,G.jsxs)(z,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(B,{bold:!0,children:`Will install:`}),h.entry.commands&&(0,G.jsxs)(B,{dimColor:!0,children:[`· Commands:`,` `,Array.isArray(h.entry.commands)?h.entry.commands.join(`, `):Object.keys(h.entry.commands).join(`, `)]}),h.entry.agents&&(0,G.jsxs)(B,{dimColor:!0,children:[`· Agents:`,` `,Array.isArray(h.entry.agents)?h.entry.agents.join(`, `):Object.keys(h.entry.agents).join(`, `)]}),h.entry.hooks&&(0,G.jsxs)(B,{dimColor:!0,children:[`· Hooks: `,Object.keys(h.entry.hooks).join(`, `)]}),h.entry.mcpServers&&(0,G.jsxs)(B,{dimColor:!0,children:[`· MCP Servers:`,` `,Array.isArray(h.entry.mcpServers)?h.entry.mcpServers.join(`, `):typeof h.entry.mcpServers==`object`?Object.keys(h.entry.mcpServers).join(`, `):`configured`]}),!h.entry.commands&&!h.entry.agents&&!h.entry.hooks&&!h.entry.mcpServers&&(0,G.jsx)(G.Fragment,{children:typeof h.entry.source==`object`&&`source`in h.entry.source&&(h.entry.source.source===`github`||h.entry.source.source===`url`||h.entry.source.source===`npm`||h.entry.source.source===`pip`)?(0,G.jsx)(B,{dimColor:!0,children:`· Component summary not available for remote plugin`}):(0,G.jsx)(B,{dimColor:!0,children:`· Components will be discovered at installation`})})]}),(0,G.jsx)(vn,{}),N&&(0,G.jsx)(z,{marginBottom:1,children:(0,G.jsxs)(B,{color:`error`,children:[`Error: `,N]})}),(0,G.jsx)(z,{flexDirection:`column`,children:t.map((e,t)=>(0,G.jsxs)(z,{children:[ae===t&&(0,G.jsx)(B,{children:`> `}),ae!==t&&(0,G.jsx)(B,{children:` `}),(0,G.jsx)(B,{bold:ae===t,children:M&&e.action===`install`?`Installing…`:e.label})]},e.action))}),(0,G.jsx)(z,{marginTop:1,paddingLeft:1,children:(0,G.jsx)(B,{dimColor:!0,children:(0,G.jsxs)(V,{children:[(0,G.jsx)(v,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,G.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(x.length===0)return(0,G.jsxs)(z,{flexDirection:`column`,children:[(0,G.jsx)(z,{marginBottom:1,children:(0,G.jsx)(B,{bold:!0,children:`Install plugins`})}),(0,G.jsx)(B,{dimColor:!0,children:`No new plugins available to install.`}),(0,G.jsx)(B,{dimColor:!0,children:`All plugins from this marketplace are already installed.`}),(0,G.jsx)(z,{marginLeft:3,children:(0,G.jsx)(B,{dimColor:!0,italic:!0,children:(0,G.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})})})]});let F=j.getVisibleItems(x);return(0,G.jsxs)(z,{flexDirection:`column`,children:[(0,G.jsx)(z,{marginBottom:1,children:(0,G.jsx)(B,{bold:!0,children:`Install Plugins`})}),j.scrollPosition.canScrollUp&&(0,G.jsx)(z,{children:(0,G.jsxs)(B,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),F.map((t,n)=>{let r=j.toActualIndex(n),i=T===r,o=D.has(t.pluginId),s=ie.has(t.pluginId);return(0,G.jsxs)(z,{flexDirection:`column`,marginBottom:n===F.length-1&&!e?0:1,children:[(0,G.jsxs)(z,{children:[(0,G.jsxs)(B,{color:i?`suggestion`:void 0,children:[i?a.pointer:` `,` `]}),(0,G.jsxs)(B,{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)(B,{dimColor:!0,children:[` [`,t.entry.category,`]`]}),t.entry.tags?.includes(`community-managed`)&&(0,G.jsx)(B,{dimColor:!0,children:` [Community Managed]`}),t.isInstalled&&(0,G.jsx)(B,{dimColor:!0,children:` (installed)`}),ee&&p===`claude-plugins-official`&&(0,G.jsxs)(B,{dimColor:!0,children:[` · `,Mt(ee.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,G.jsxs)(z,{marginLeft:4,children:[(0,G.jsx)(B,{dimColor:!0,children:mt(t.entry.description,60)}),t.entry.version&&(0,G.jsxs)(B,{dimColor:!0,children:[` · v`,t.entry.version]})]})]},t.pluginId)}),j.scrollPosition.canScrollDown&&(0,G.jsx)(z,{children:(0,G.jsxs)(B,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,G.jsx)(z,{marginTop:1,children:(0,G.jsxs)(B,{color:`error`,children:[a.cross,` `,e]})}),(0,G.jsx)(Cn,{hasSelection:D.size>0})]})}var jn,W,G,Mn=e((()=>{i(),jn=t(H(),1),W=t(H(),1),C(),Ue(),xe(),tt(),x(),Ze(),$e(),Ee(),kt(),f(),N(),j(),L(),je(),S(),_t(),ht(),_n(),bn(),Tn(),kn(),G=Ke()}));function Nn({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:o,onSearchModeChange:c,targetPlugin:l}){let[u,d]=(0,K.useState)(`plugin-list`),[f,p]=(0,K.useState)(null),[m,h]=(0,K.useState)([]),[_,y]=(0,K.useState)(!0),[b,x]=(0,K.useState)(null),[S,C]=(0,K.useState)(!1),w=(0,K.useCallback)(e=>{C(e),c?.(e)},[c]),{query:ee,setQuery:te,cursorOffset:T}=Wt({isActive:u===`plugin-list`&&S&&!_,onExit:()=>{w(!1)}}),E=Ie(),{columns:D}=Ve(),O=(0,K.useMemo)(()=>{if(!ee)return m;let e=ee.toLowerCase();return m.filter(t=>t.entry.name.toLowerCase().includes(e)||t.entry.description?.toLowerCase().includes(e)||t.marketplaceName.toLowerCase().includes(e))},[m,ee]),[k,ie]=(0,K.useState)(0),[A,j]=(0,K.useState)(new Set),[ae,oe]=(0,K.useState)(new Set),M=En({totalItems:O.length,selectedIndex:k});(0,K.useEffect)(()=>{ie(0)},[ee]);let[se,N]=(0,K.useState)(0),[ce,ue]=(0,K.useState)(!1),[fe,P]=(0,K.useState)(null),[pe,F]=(0,K.useState)(null),[ge,ve]=(0,K.useState)(null);(0,K.useEffect)(()=>{async function e(){try{let e=await g(),{marketplaces:n,failures:r}=await Ce(e),i=[];for(let{name:e,data:t}of n)if(t)for(let n of t.plugins){let t=s(n.name,e);i.push({entry:n,marketplaceName:e,pluginId:t,isInstalled:me(t)})}let a=i.filter(e=>!e.isInstalled&&!re(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))}h(a);let o=Object.keys(e).length;if(a.length===0){let e=await de({configuredMarketplaceCount:o,failedMarketplaceCount:r.length});ve(e)}let c=_e(r,et(n,e=>e.data!==null));if(c)if(c.type===`warning`)F(c.message+`. Showing available plugins.`);else throw Error(c.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.`):(p(e),d(`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(A.size===0)return;let e=m.filter(e=>A.has(e.pluginId));oe(new Set(e.map(e=>e.pluginId)));let n=0,a=0,s=[];for(let t of e){let e=await le({pluginId:t.pluginId,entry:t.entry,marketplaceName:t.marketplaceName,scope:`user`});e.success?n++:(a++,s.push({name:t.entry.name,reason:e.error}))}oe(new Set),j(new Set),he(),a===0?r(`✓ Installed ${n} ${gt(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${Te(s,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${Te(s,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&o&&await o(),i({type:`menu`})},be=async(e,t=`user`)=>{ue(!0),P(null);let n=await le({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await pn(e.pluginId);if(t){ue(!1),d({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),o&&await o(),i({type:`menu`})}else ue(!1),P(n.error)};(0,K.useEffect)(()=>{e&&r(e)},[e,r]),Fe(`confirm:no`,()=>{d(`plugin-list`),p(null)},{context:`Confirmation`,isActive:u===`plugin-details`}),Fe(`confirm:no`,()=>{i({type:`menu`})},{context:`Confirmation`,isActive:u===`plugin-list`&&!S}),Le((e,t)=>{let n=!t.ctrl&&!t.meta;S||(e===`/`&&n?(w(!0),te(``)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==`i`&&(w(!0),te(e)))},{isActive:u===`plugin-list`&&!_}),R({"select:previous":()=>{k===0?w(!0):M.handleSelectionChange(k-1,ie)},"select:next":()=>{k<O.length-1&&M.handleSelectionChange(k+1,ie)},"select:accept":()=>{if(k===O.length&&A.size>0)ye();else if(k<O.length){let e=O[k];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(p(e),d(`plugin-details`),N(0),P(null)))}}},{context:`Select`,isActive:u===`plugin-list`&&!S}),R({"plugin:toggle":()=>{if(k<O.length){let e=O[k];if(e&&!e.isInstalled){let t=new Set(A);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),j(t)}}},"plugin:install":()=>{A.size>0&&ye()}},{context:`Plugin`,isActive:u===`plugin-list`&&!S});let xe=In.useMemo(()=>{if(!f)return[];let e=f.entry.homepage;return Sn(e,xn(f))},[f]);if(R({"select:previous":()=>{se>0&&N(se-1)},"select:next":()=>{se<xe.length-1&&N(se+1)},"select:accept":()=>{if(!f)return;let e=xe[se]?.action,t=f.entry.homepage,n=xn(f);e===`install-user`?be(f,`user`):e===`install-project`?be(f,`project`):e===`install-local`?be(f,`local`):e===`homepage`&&t?ne(t):e===`github`&&n?ne(`https://github.com/${n}`):e===`back`&&(d(`plugin-list`),p(null))}},{context:`Select`,isActive:u===`plugin-details`&&!!f}),typeof u==`object`&&u.type===`plugin-options`){let{plugin:e,pluginId:t}=u;function n(e){r(e),o&&o(),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(_)return(0,q.jsx)(B,{children:`Loading…`});if(e)return(0,q.jsx)(B,{color:`error`,children:e});if(u===`plugin-details`&&f){let e=f.entry.homepage,t=Sn(e,xn(f));return(0,q.jsxs)(z,{flexDirection:`column`,children:[(0,q.jsx)(z,{marginBottom:1,children:(0,q.jsx)(B,{bold:!0,children:`Plugin details`})}),(0,q.jsxs)(z,{flexDirection:`column`,marginBottom:1,children:[(0,q.jsx)(B,{bold:!0,children:f.entry.name}),(0,q.jsxs)(B,{dimColor:!0,children:[`from `,f.marketplaceName]}),f.entry.version&&(0,q.jsxs)(B,{dimColor:!0,children:[`Version: `,f.entry.version]}),f.entry.description&&(0,q.jsx)(z,{marginTop:1,children:(0,q.jsx)(B,{children:f.entry.description})}),f.entry.author&&(0,q.jsx)(z,{marginTop:1,children:(0,q.jsxs)(B,{dimColor:!0,children:[`By:`,` `,typeof f.entry.author==`string`?f.entry.author:f.entry.author.name]})})]}),(0,q.jsx)(vn,{}),fe&&(0,q.jsx)(z,{marginBottom:1,children:(0,q.jsxs)(B,{color:`error`,children:[`Error: `,fe]})}),(0,q.jsx)(z,{flexDirection:`column`,children:t.map((e,t)=>(0,q.jsxs)(z,{children:[se===t&&(0,q.jsx)(B,{children:`> `}),se!==t&&(0,q.jsx)(B,{children:` `}),(0,q.jsx)(B,{bold:se===t,children:ce&&e.action.startsWith(`install-`)?`Installing…`:e.label})]},e.action))}),(0,q.jsx)(z,{marginTop:1,children:(0,q.jsx)(B,{dimColor:!0,children:(0,q.jsxs)(V,{children:[(0,q.jsx)(v,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,q.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(m.length===0)return(0,q.jsxs)(z,{flexDirection:`column`,children:[(0,q.jsx)(z,{marginBottom:1,children:(0,q.jsx)(B,{bold:!0,children:`Discover plugins`})}),(0,q.jsx)(Fn,{reason:ge}),(0,q.jsx)(z,{marginTop:1,children:(0,q.jsx)(B,{dimColor:!0,italic:!0,children:`Esc to go back`})})]});let I=M.getVisibleItems(O);return(0,q.jsxs)(z,{flexDirection:`column`,children:[(0,q.jsxs)(z,{children:[(0,q.jsx)(B,{bold:!0,children:`Discover plugins`}),M.needsPagination&&(0,q.jsxs)(B,{dimColor:!0,children:[` `,`(`,M.scrollPosition.current,`/`,M.scrollPosition.total,`)`]})]}),(0,q.jsx)(z,{marginBottom:1,children:(0,q.jsx)(ze,{query:ee,isFocused:S,isTerminalFocused:E,width:D-4,cursorOffset:T})}),pe&&(0,q.jsx)(z,{marginBottom:1,children:(0,q.jsxs)(B,{color:`warning`,children:[a.warning,` `,pe]})}),O.length===0&&ee&&(0,q.jsx)(z,{marginBottom:1,children:(0,q.jsxs)(B,{dimColor:!0,children:[`No plugins match "`,ee,`"`]})}),M.scrollPosition.canScrollUp&&(0,q.jsx)(z,{children:(0,q.jsxs)(B,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),I.map((t,n)=>{let r=M.toActualIndex(n),i=k===r,o=A.has(t.pluginId),s=ae.has(t.pluginId);return(0,q.jsxs)(z,{flexDirection:`column`,marginBottom:n===I.length-1&&!e?0:1,children:[(0,q.jsxs)(z,{children:[(0,q.jsxs)(B,{color:i&&!S?`suggestion`:void 0,children:[i&&!S?a.pointer:` `,` `]}),(0,q.jsxs)(B,{children:[s?a.ellipsis:o?a.radioOn:a.radioOff,` `,t.entry.name,(0,q.jsxs)(B,{dimColor:!0,children:[` · `,t.marketplaceName]}),t.entry.tags?.includes(`community-managed`)&&(0,q.jsx)(B,{dimColor:!0,children:` [Community Managed]`}),b&&t.marketplaceName===`claude-plugins-official`&&(0,q.jsxs)(B,{dimColor:!0,children:[` · `,Mt(b.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,q.jsx)(z,{marginLeft:4,children:(0,q.jsx)(B,{dimColor:!0,children:mt(t.entry.description,60)})})]},`${M.startIndex}-${t.pluginId}`)}),M.scrollPosition.canScrollDown&&(0,q.jsx)(z,{children:(0,q.jsxs)(B,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,q.jsx)(z,{marginTop:1,children:(0,q.jsxs)(B,{color:`error`,children:[a.cross,` `,e]})}),(0,q.jsx)(Pn,{hasSelection:A.size>0,canToggle:k<O.length&&!O[k]?.isInstalled})]})}function Pn({hasSelection:e,canToggle:t}){return(0,q.jsx)(z,{marginTop:1,children:(0,q.jsx)(B,{dimColor:!0,italic:!0,children:(0,q.jsxs)(V,{children:[e&&(0,q.jsx)(v,{action:`plugin:install`,context:`Plugin`,fallback:`i`,description:`install`,bold:!0}),(0,q.jsx)(B,{children:`type to search`}),t&&(0,q.jsx)(v,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,q.jsx)(v,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,q.jsx)(v,{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)(B,{dimColor:!0,children:`Git is required to install marketplaces.`}),(0,q.jsx)(B,{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)(B,{dimColor:!0,children:`Your organization policy does not allow any external marketplaces.`}),(0,q.jsx)(B,{dimColor:!0,children:`Contact your administrator.`})]});case`policy-restricts-sources`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(B,{dimColor:!0,children:`Your organization restricts which marketplaces can be added.`}),(0,q.jsx)(B,{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)(B,{dimColor:!0,children:`Failed to load marketplace data.`}),(0,q.jsx)(B,{dimColor:!0,children:`Check your network connection.`})]});case`all-plugins-installed`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(B,{dimColor:!0,children:`All available plugins are already installed.`}),(0,q.jsx)(B,{dimColor:!0,children:`Check for new plugins later or add more marketplaces.`})]});default:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(B,{dimColor:!0,children:`No plugins available.`}),(0,q.jsx)(B,{dimColor:!0,children:`Add a marketplace first using the Marketplaces tab.`})]})}}var In,K,q,Ln=e((()=>{i(),In=t(H(),1),K=t(H(),1),C(),Ut(),Ue(),Gt(),o(),xe(),tt(),x(),Ze(),$e(),Ee(),kt(),f(),N(),j(),L(),je(),S(),_t(),ht(),_n(),bn(),Tn(),kn(),q=Ke()}));function Rn({setViewState:e,error:t,setError:n,setResult:r,exitState:i,onManageComplete:o,targetMarketplace:c,action:l}){let[u,d]=(0,Bn.useState)([]),[f,p]=(0,Bn.useState)(!0),[m,_]=(0,Bn.useState)(0),[y,b]=(0,Bn.useState)(!1),[x,S]=(0,Bn.useState)(null),[C,w]=(0,Bn.useState)(null),[ee,te]=(0,Bn.useState)(null),[T,E]=(0,Bn.useState)(`list`),[D,O]=(0,Bn.useState)(null),[ne,re]=(0,Bn.useState)(0),k=(0,Bn.useRef)(!1);(0,Bn.useEffect)(()=>{async function e(){try{let e=await g(),{enabled:r,disabled:i}=await ge(),a=[...r,...i],{marketplaces:o,failures:s}=await Ce(e),u=[];for(let{name:e,config:t,data:n}of o){let r=a.filter(t=>t.source.endsWith(`@${e}`));u.push({name:e,source:Se(t.source),lastUpdated:t.lastUpdated,pluginCount:n?.plugins.length,installedPlugins:r,pendingUpdate:!1,pendingRemove:!1,autoUpdate:st(e,t)})}u.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),d(u);let f=_e(s,et(o,e=>e.data!==null));if(f)if(f.type===`warning`)S(f.message);else throw Error(f.message);if(c&&!k.current&&!t){k.current=!0;let e=u.findIndex(e=>e.name===c);if(e>=0){let t=u[e];if(l){_(e+1);let t=[...u];l===`update`?t[e].pendingUpdate=!0:l===`remove`&&(t[e].pendingRemove=!0),d(t),setTimeout(j,100,t)}else t&&(_(e+1),O(t),E(`details`))}else n&&n(`Marketplace not found: ${c}`)}}catch(e){n&&n(e instanceof Error?e.message:`Failed to load marketplaces`),S(e instanceof Error?e.message:`Failed to load marketplaces`)}finally{p(!1)}}e()},[c,l,t]);let ie=()=>u.some(e=>e.pendingUpdate||e.pendingRemove),A=()=>({updateCount:et(u,e=>e.pendingUpdate),removeCount:et(u,e=>e.pendingRemove)}),j=async t=>{let i=t||u,c=T===`details`;b(!0),S(null),w(null),te(null);try{let t=nt(`userSettings`),n=0,l=0,u=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=s(t.name,e.name);n[r]=!1}ot(`userSettings`,{enabledPlugins:n})}await I(e.name),l++,pt(`tengu_marketplace_removed`,{marketplace_name:e.name,plugins_uninstalled:e.installedPlugins?.length||0});continue}e.pendingUpdate&&(await h(e.name,e=>{te(e)}),n++,u.add(e.name.toLowerCase()),pt(`tengu_marketplace_updated`,{marketplace_name:e.name}))}let f=0;u.size>0&&(f=(await en(u)).length),he(),o&&await o();let p=await g(),{enabled:m,disabled:_}=await ge(),v=[...m,..._],{marketplaces:y}=await Ce(p),b=[];for(let{name:e,config:t,data:n}of y){let r=v.filter(t=>t.source.endsWith(`@${e}`));b.push({name:e,source:Se(t.source),lastUpdated:t.lastUpdated,pluginCount:n?.plugins.length,installedPlugins:r,pendingUpdate:!1,pendingRemove:!1,autoUpdate:st(e,t)})}if(b.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),d(b),c&&D){let e=b.find(e=>e.name===D.name);e&&O(e)}let x=[];if(n>0){let e=f>0?` (${f} ${gt(f,`plugin`)} bumped)`:``;x.push(`Updated ${n} ${gt(n,`marketplace`)}${e}`)}if(l>0&&x.push(`Removed ${l} ${gt(l,`marketplace`)}`),x.length>0){let t=`${a.tick} ${x.join(`, `)}`;c?w(t):(r(t),setTimeout(e,2e3,{type:`menu`}))}else c||e({type:`menu`})}catch(e){let t=Je(e);S(t),n&&n(t)}finally{b(!1),te(null)}},oe=async()=>{if(!D)return;let e=u.map(e=>e.name===D.name?{...e,pendingRemove:!0}:e);d(e),await j(e)},M=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 ct()||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 ae(e.name,t),d(n=>n.map(n=>n.name===e.name?{...n,autoUpdate:t}:n)),O(e=>e&&{...e,autoUpdate:t})}catch(e){S(e instanceof Error?e.message:`Failed to update setting`)}};if(Fe(`confirm:no`,()=>{E(`list`),re(0)},{context:`Confirmation`,isActive:!y&&(T===`details`||T===`confirm-remove`)}),Fe(`confirm:no`,()=>{d(e=>e.map(e=>({...e,pendingUpdate:!1,pendingRemove:!1}))),_(0)},{context:`Confirmation`,isActive:!y&&T===`list`&&ie()}),Fe(`confirm:no`,()=>{e({type:`menu`})},{context:`Confirmation`,isActive:!y&&T===`list`&&!ie()}),R({"select:previous":()=>_(e=>Math.max(0,e-1)),"select:next":()=>{let e=u.length+1;_(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=u[t];e&&(O(e),E(`details`),re(0))}}},{context:`Select`,isActive:!y&&T===`list`}),Le(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=u[t];e&&(O(e),E(`confirm-remove`))}},{isActive:!y&&T===`list`}),R({"select:previous":()=>re(e=>Math.max(0,e-1)),"select:next":()=>{let e=M(D);re(t=>Math.min(e.length-1,t+1))},"select:accept":()=>{if(!D)return;let t=M(D)[ne];if(t?.value===`browse`)e({type:`browse-marketplace`,targetMarketplace:D.name});else if(t?.value===`update`){let e=u.map(e=>e.name===D.name?{...e,pendingUpdate:!0}:e);d(e),j(e)}else t?.value===`toggle-auto-update`?se(D):t?.value===`remove`&&E(`confirm-remove`)}},{context:`Select`,isActive:!y&&T===`details`}),Le(e=>{e===`y`||e===`Y`?oe():(e===`n`||e===`N`)&&(E(`list`),O(null))},{isActive:!y&&T===`confirm-remove`}),f)return(0,J.jsx)(B,{children:`Loading marketplaces…`});if(u.length===0)return(0,J.jsxs)(z,{flexDirection:`column`,children:[(0,J.jsx)(z,{marginBottom:1,children:(0,J.jsx)(B,{bold:!0,children:`Manage marketplaces`})}),(0,J.jsxs)(z,{flexDirection:`row`,gap:1,children:[(0,J.jsxs)(B,{color:`suggestion`,children:[a.pointer,` +`]}),(0,J.jsx)(B,{bold:!0,color:`suggestion`,children:`Add Marketplace`})]}),(0,J.jsx)(z,{marginLeft:3,children:(0,J.jsx)(B,{dimColor:!0,italic:!0,children:i.pending?(0,J.jsxs)(J.Fragment,{children:[`Press `,i.keyName,` again to go back`]}):(0,J.jsxs)(V,{children:[(0,J.jsx)(v,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,J.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]});if(T===`confirm-remove`&&D){let e=D.installedPlugins?.length||0;return(0,J.jsxs)(z,{flexDirection:`column`,children:[(0,J.jsxs)(B,{bold:!0,color:`warning`,children:[`Remove marketplace `,(0,J.jsx)(B,{italic:!0,children:D.name}),`?`]}),(0,J.jsxs)(z,{flexDirection:`column`,children:[e>0&&(0,J.jsx)(z,{marginTop:1,children:(0,J.jsxs)(B,{color:`warning`,children:[`This will also uninstall `,e,` `,gt(e,`plugin`),` from this marketplace:`]})}),D.installedPlugins&&D.installedPlugins.length>0&&(0,J.jsx)(z,{flexDirection:`column`,marginTop:1,marginLeft:2,children:D.installedPlugins.map(e=>(0,J.jsxs)(B,{dimColor:!0,children:[`• `,e.name]},e.name))}),(0,J.jsx)(z,{marginTop:1,children:(0,J.jsxs)(B,{children:[`Press `,(0,J.jsx)(B,{bold:!0,children:`y`}),` to confirm or `,(0,J.jsx)(B,{bold:!0,children:`n`}),` to cancel`]})})]})]})}if(T===`details`&&D){let e=D.pendingUpdate||y,t=M(D);return(0,J.jsxs)(z,{flexDirection:`column`,children:[(0,J.jsx)(B,{bold:!0,children:D.name}),(0,J.jsx)(B,{dimColor:!0,children:D.source}),(0,J.jsx)(z,{marginTop:1,children:(0,J.jsxs)(B,{children:[D.pluginCount||0,` available `,gt(D.pluginCount||0,`plugin`)]})}),D.installedPlugins&&D.installedPlugins.length>0&&(0,J.jsxs)(z,{flexDirection:`column`,marginTop:1,children:[(0,J.jsxs)(B,{bold:!0,children:[`Installed plugins (`,D.installedPlugins.length,`):`]}),(0,J.jsx)(z,{flexDirection:`column`,marginLeft:1,children:D.installedPlugins.map(e=>(0,J.jsxs)(z,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(B,{children:a.bullet}),(0,J.jsxs)(z,{flexDirection:`column`,children:[(0,J.jsx)(B,{children:e.name}),(0,J.jsx)(B,{dimColor:!0,children:e.manifest.description})]})]},e.name))})]}),e&&(0,J.jsxs)(z,{marginTop:1,flexDirection:`column`,children:[(0,J.jsx)(B,{color:`claude`,children:`Updating marketplace…`}),ee&&(0,J.jsx)(B,{dimColor:!0,children:ee})]}),!e&&C&&(0,J.jsx)(z,{marginTop:1,children:(0,J.jsx)(B,{color:`claude`,children:C})}),!e&&x&&(0,J.jsx)(z,{marginTop:1,children:(0,J.jsx)(B,{color:`error`,children:x})}),!e&&(0,J.jsx)(z,{flexDirection:`column`,marginTop:1,children:t.map((e,t)=>{if(!e)return null;let n=t===ne;return(0,J.jsxs)(z,{children:[(0,J.jsxs)(B,{color:n?`suggestion`:void 0,children:[n?a.pointer:` `,` `,e.label]}),e.secondaryLabel&&(0,J.jsxs)(B,{dimColor:!0,children:[` `,e.secondaryLabel]})]},e.value)})}),!e&&!ct()&&D.autoUpdate&&(0,J.jsx)(z,{marginTop:1,children:(0,J.jsx)(B,{dimColor:!0,children:`Auto-update enabled. Work Mate will automatically update this marketplace and its installed plugins.`})}),(0,J.jsx)(z,{marginLeft:3,children:(0,J.jsx)(B,{dimColor:!0,italic:!0,children:e?(0,J.jsx)(J.Fragment,{children:`Please wait…`}):(0,J.jsxs)(V,{children:[(0,J.jsx)(v,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,J.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]})}let{updateCount:N,removeCount:ce}=A();return(0,J.jsxs)(z,{flexDirection:`column`,children:[(0,J.jsx)(z,{marginBottom:1,children:(0,J.jsx)(B,{bold:!0,children:`Manage marketplaces`})}),(0,J.jsxs)(z,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(B,{color:m===0?`suggestion`:void 0,children:[m===0?a.pointer:` `,` +`]}),(0,J.jsx)(B,{bold:!0,color:m===0?`suggestion`:void 0,children:`Add Marketplace`})]}),(0,J.jsx)(z,{flexDirection:`column`,children:u.map((e,t)=>{let n=t+1===m,r=[];return e.pendingUpdate&&r.push(`UPDATE`),e.pendingRemove&&r.push(`REMOVE`),(0,J.jsxs)(z,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(B,{color:n?`suggestion`:void 0,children:[n?a.pointer:` `,` `,e.pendingRemove?a.cross:a.bullet]}),(0,J.jsxs)(z,{flexDirection:`column`,flexGrow:1,children:[(0,J.jsxs)(z,{flexDirection:`row`,gap:1,children:[(0,J.jsxs)(B,{bold:!0,strikethrough:e.pendingRemove,dimColor:e.pendingRemove,children:[e.name===`claude-plugins-official`&&(0,J.jsx)(B,{color:`claude`,children:`✻ `}),e.name,e.name===`claude-plugins-official`&&(0,J.jsx)(B,{color:`claude`,children:` ✻`})]}),r.length>0&&(0,J.jsxs)(B,{color:`warning`,children:[`[`,r.join(`, `),`]`]})]}),(0,J.jsx)(B,{dimColor:!0,children:e.source}),(0,J.jsxs)(B,{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)(z,{marginTop:1,flexDirection:`column`,children:[(0,J.jsxs)(B,{children:[(0,J.jsx)(B,{bold:!0,children:`Pending changes:`}),` `,(0,J.jsx)(B,{dimColor:!0,children:`Enter to apply`})]}),N>0&&(0,J.jsxs)(B,{children:[`• Update `,N,` `,gt(N,`marketplace`)]}),ce>0&&(0,J.jsxs)(B,{color:`warning`,children:[`• Remove `,ce,` `,gt(ce,`marketplace`)]})]}),y&&(0,J.jsx)(z,{marginTop:1,children:(0,J.jsx)(B,{color:`claude`,children:`Processing changes…`})}),x&&(0,J.jsx)(z,{marginTop:1,children:(0,J.jsx)(B,{color:`error`,children:x})}),(0,J.jsx)(zn,{exitState:i,hasPendingActions:ie()})]})}function zn({exitState:e,hasPendingActions:t}){return e.pending?(0,J.jsx)(z,{marginTop:1,children:(0,J.jsxs)(B,{dimColor:!0,italic:!0,children:[`Press `,e.keyName,` again to go back`]})}):(0,J.jsx)(z,{marginTop:1,children:(0,J.jsx)(B,{dimColor:!0,italic:!0,children:(0,J.jsxs)(V,{children:[t&&(0,J.jsx)(v,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`apply changes`}),!t&&(0,J.jsx)(v,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),!t&&(0,J.jsx)(Me,{shortcut:`u`,action:`update`}),!t&&(0,J.jsx)(Me,{shortcut:`r`,action:`remove`}),(0,J.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:t?`cancel`:`go back`})]})})})}var Bn,J,Vn=e((()=>{i(),H(),Bn=t(H(),1),ft(),C(),Ue(),xe(),tt(),lt(),$e(),Ee(),N(),j(),tn(),be(),at(),it(),_t(),J=Ke()}));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 ce(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((()=>{Ae()}));function Gn({item:e,isSelected:t}){let[n]=Pe();if(e.type===`plugin`){let r,i;return e.pendingToggle?(r=Re(`suggestion`,n)(a.arrowRight),i=e.pendingToggle===`will-enable`?`will enable`:`will disable`):e.errorCount>0?(r=Re(`error`,n)(a.cross),i=`${e.errorCount} ${gt(e.errorCount,`error`)}`):e.isEnabled?(r=Re(`success`,n)(a.tick),i=`enabled`):(r=Re(`inactive`,n)(a.radioOff),i=`disabled`),(0,Y.jsxs)(z,{children:[(0,Y.jsx)(B,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(B,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(B,{dimColor:!t,children:[` `,(0,Y.jsx)(B,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(B,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(B,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(B,{dimColor:!t,children:i})]})}if(e.type===`flagged-plugin`){let r=Re(`warning`,n)(a.warning);return(0,Y.jsxs)(z,{children:[(0,Y.jsx)(B,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(B,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(B,{dimColor:!t,children:[` `,(0,Y.jsx)(B,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(B,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(B,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(B,{dimColor:!t,children:`removed`})]})}if(e.type===`failed-plugin`){let r=Re(`error`,n)(a.cross),i=`failed to load · ${e.errorCount} ${gt(e.errorCount,`error`)}`;return(0,Y.jsxs)(z,{children:[(0,Y.jsx)(B,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(B,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(B,{dimColor:!t,children:[` `,(0,Y.jsx)(B,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(B,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(B,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(B,{dimColor:!t,children:i})]})}let r,i;return e.status===`connected`?(r=Re(`success`,n)(a.tick),i=`connected`):e.status===`disabled`?(r=Re(`inactive`,n)(a.radioOff),i=`disabled`):e.status===`pending`?(r=Re(`inactive`,n)(a.radioOff),i=`connecting…`):e.status===`needs-auth`?(r=Re(`warning`,n)(a.triangleUpOutline),i=`Enter to auth`):(r=Re(`error`,n)(a.cross),i=`failed`),e.indented?(0,Y.jsxs)(z,{children:[(0,Y.jsx)(B,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(B,{dimColor:!t,children:`└ `}),(0,Y.jsx)(B,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(B,{dimColor:!t,children:[` `,(0,Y.jsx)(B,{backgroundColor:`userMessageBackground`,children:`MCP`})]}),(0,Y.jsxs)(B,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(B,{dimColor:!t,children:i})]}):(0,Y.jsxs)(z,{children:[(0,Y.jsx)(B,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(B,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(B,{dimColor:!t,children:[` `,(0,Y.jsx)(B,{backgroundColor:`userMessageBackground`,children:`MCP`})]}),(0,Y.jsxs)(B,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(B,{dimColor:!t,children:i})]})}var Y,Kn=e((()=>{i(),H(),Ue(),_t(),Y=Ke()}));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`}),dt(Xe(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`}),dt(Xe(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=se(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 k(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)(z,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsx)(B,{bold:!0,children:`Components:`}),(0,Z.jsxs)(B,{dimColor:!0,children:[`Error: `,o]})]}):!n||!(n.commands||n.agents||n.skills||n.hooks||n.mcpServers)?null:(0,Z.jsxs)(z,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsx)(B,{bold:!0,children:`Installed components:`}),n.commands?(0,Z.jsxs)(B,{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)(B,{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)(B,{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)(B,{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)(B,{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 k(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!re(`${e.name}@${t}`)})}function Qn({setViewState:e,setResult:t,onManageComplete:n,onSearchModeChange:r,targetPlugin:i,targetMarketplace:o,action:s}){let l=ke(e=>e.mcp.clients),u=ke(e=>e.mcp.tools),d=ke(e=>e.plugins.errors),f=It(),[m,h]=(0,X.useState)(!1),g=(0,X.useCallback)(e=>{h(e),r?.(e)},[r]),_=Ie(),{columns:y}=Ve(),[x,S]=(0,X.useState)(`plugin-list`),{query:C,setQuery:w,cursorOffset:T}=Wt({isActive:x===`plugin-list`&&m,onExit:()=>{g(!1)}}),[E,re]=(0,X.useState)(null),[k,ie]=(0,X.useState)([]),[A,j]=(0,X.useState)([]),[ae,oe]=(0,X.useState)(!0),[M,se]=(0,X.useState)(new Map),N=(0,X.useRef)(!1),ce=(0,X.useRef)(void 0),le=zt();Fe(`confirm:no`,$n.useCallback(()=>{if(x===`plugin-details`)S(`plugin-list`),re(null),L(null);else if(typeof x==`object`&&x.type===`failed-plugin-details`)S(`plugin-list`),L(null);else if(x===`configuring`)S(`plugin-details`),we(null);else if(typeof x==`object`&&(x.type===`plugin-options`||x.type===`configuring-options`))S(`plugin-list`),re(null),t(`Plugin enabled. Configuration skipped — run /reload-plugins to apply.`),n&&n();else if(typeof x==`object`&&x.type===`flagged-detail`)S(`plugin-list`),L(null);else if(typeof x==`object`&&x.type===`mcp-detail`)S(`plugin-list`),L(null);else if(typeof x==`object`&&x.type===`mcp-tools`)S({type:`mcp-detail`,client:x.client});else if(typeof x==`object`&&x.type===`mcp-tool-detail`)S({type:`mcp-tools`,client:x.client});else{if(M.size>0){t(`Run /reload-plugins to apply plugin changes.`);return}e({type:`menu`})}},[x,e,M,t]),{context:`Confirmation`,isActive:(x!==`plugin-list`||!m)&&x!==`confirm-project-uninstall`&&!(typeof x==`object`&&x.type===`confirm-data-cleanup`)});let ue=e=>e.type===`connected`?`connected`:e.type===`disabled`?`disabled`:e.type===`pending`?`pending`:e.type===`needs-auth`?`needs-auth`:`failed`,de=(0,X.useMemo)(()=>{let e=rt(),t=new Map;for(let e of l)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 A){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=ve(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 c=[];for(let e of l)e.name!==`ide`&&(e.name.startsWith(`plugin:`)||c.push({type:`mcp`,id:`mcp:${e.name}`,name:e.name,description:void 0,scope:e.config.scope,status:ue(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:ue(n),client:n,indented:!0})}}for(let e of c){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=ve(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},[A,l,d,M,f]),fe=(0,X.useMemo)(()=>de.filter(e=>e.type===`flagged-plugin`).map(e=>e.id),[de]);(0,X.useEffect)(()=>{fe.length>0&&Ft(fe)},[fe]);let P=(0,X.useMemo)(()=>{if(!C)return de;let e=C.toLowerCase();return de.filter(t=>t.name.toLowerCase().includes(e)||`description`in t&&t.description?.toLowerCase().includes(e))},[de,C]),[F,me]=(0,X.useState)(0),_e=En({totalItems:P.length,selectedIndex:F,maxVisible:8}),[ye,be]=(0,X.useState)(0),[xe,I]=(0,X.useState)(!1),[Se,L]=(0,X.useState)(null),[Ce,we]=(0,X.useState)(null),[Te,Ee]=(0,X.useState)(!1),[De,Oe]=(0,X.useState)(!1);(0,X.useEffect)(()=>{if(!E){Oe(!1);return}async function e(){let e=E.plugin.manifest.mcpServers,t=!1;if(e&&(t=typeof e==`string`&&te(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&&te(e))),!t)try{let e=nn.join(E.plugin.path,`..`),n=nn.join(e,`.claude-plugin`,`marketplace.json`),r=qe(await rn.readFile(n,`utf-8`)).plugins?.find(e=>e.name===E.plugin.name);if(r?.mcpServers){let e=r.mcpServers;t=typeof e==`string`&&te(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&&te(e))}}catch(e){Qe(`Failed to read raw marketplace.json: ${e}`)}Oe(t)}e()},[E]),(0,X.useEffect)(()=>{async function e(){oe(!0);try{let{enabled:e,disabled:t}=await ge(),n=rt(),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=et(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)),ie(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})}j(o),me(0)}finally{oe(!1)}}e()},[]),(0,X.useEffect)(()=>{if(!N.current&&i&&k.length>0&&!ae){let{name:e,marketplace:n}=ve(i),r=o??n,a=r?k.filter(e=>e.name===r):k;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};re(r),S(`plugin-details`),ce.current=s,N.current=!0;return}}let c=de.find(t=>t.type===`failed-plugin`&&t.name===e);c&&c.type===`failed-plugin`&&(S({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,k,ae,de,s,t]);let Ae=async r=>{if(!E)return;let i=E.scope||`user`,a=i===`builtin`;if(a&&(r===`update`||r===`uninstall`)){L(`Built-in plugins cannot be updated or uninstalled.`);return}if(!a&&!wt(i)&&r!==`update`){L(`This plugin is managed by your organization. Contact your admin to disable it.`);return}I(!0),L(null);try{let o=`${E.plugin.name}@${E.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)){I(!1),S(`confirm-project-uninstall`);return}let e=ee().plugins[o],t=!e||e.length<=1?await b(o):null;if(t){I(!1),S({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(`${E.plugin.name} is already at the latest version (${r.newVersion}).`),n&&await n(),e({type:`menu`});return}break}}he();let c=`${E.plugin.name}@${E.marketplace}`;if(rt()?.enabledPlugins?.[c]!==!1){I(!1),S({type:`plugin-options`});return}let l=r===`enable`?`Enabled`:r===`disable`?`Disabled`:r===`update`?`Updated`:`Uninstalled`,u=s&&s.length>0?` · required by ${s.join(`, `)}`:``;t(`✓ ${l} ${E.plugin.name}${u}. Run /reload-plugins to apply.`),n&&await n(),e({type:`menu`})}catch(e){I(!1);let t=e instanceof Error?e.message:String(e);L(`Failed to ${r}: ${t}`),dt(Xe(e))}},je=(0,X.useRef)(Ae);je.current=Ae,(0,X.useEffect)(()=>{if(x===`plugin-details`&&E&&ce.current){let e=ce.current;ce.current=void 0,je.current(e)}},[x,E]);let Me=$n.useCallback(()=>{if(F>=P.length)return;let e=P[F];if(e?.type!==`flagged-plugin`)if(e?.type===`plugin`){let t=`${e.plugin.name}@${e.marketplace}`,n=rt(),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),he()}catch(e){dt(e)}})()):(e.set(t,i?`will-disable`:`will-enable`),(async()=>{try{i?await Ct(t):await bt(t),he()}catch(e){dt(e)}})()),se(e)}}else e?.type===`mcp`&&le(e.client.name)},[F,P,M,A,le]);R({"select:previous":()=>{F===0?g(!0):_e.handleSelectionChange(F-1,me)},"select:next":()=>{F<P.length-1&&_e.handleSelectionChange(F+1,me)},"select:accept":$n.useCallback(()=>{if(F>=P.length)return;let e=P[F];if(e?.type===`plugin`){let t=A.find(t=>t.plugin.name===e.plugin.name&&t.marketplace===e.marketplace);t&&(re(t),S(`plugin-details`),be(0),L(null))}else e?.type===`flagged-plugin`?(S({type:`flagged-detail`,plugin:{id:e.id,name:e.name,marketplace:e.marketplace,reason:e.reason,text:e.text,flaggedAt:e.flaggedAt}}),L(null)):e?.type===`failed-plugin`?(S({type:`failed-plugin-details`,plugin:{id:e.id,name:e.name,marketplace:e.marketplace,errors:e.errors,scope:e.scope}}),be(0),L(null)):e?.type===`mcp`&&(S({type:`mcp-detail`,client:e.client}),L(null))},[F,P,A])},{context:`Select`,isActive:x===`plugin-list`&&!m}),R({"plugin:toggle":Me},{context:`Plugin`,isActive:x===`plugin-list`&&!m}),R({"select:accept":$n.useCallback(()=>{typeof x!=`object`||x.type!==`flagged-detail`||(Lt(x.plugin.id),S(`plugin-list`))},[x])},{context:`Select`,isActive:typeof x==`object`&&x.type===`flagged-detail`});let Ne=$n.useMemo(()=>{if(x!==`plugin-details`||!E)return[];let e=rt(),t=`${E.plugin.name}@${E.marketplace}`,n=e?.enabledPlugins?.[t]!==!1,r=E.marketplace===`builtin`,i=[];return i.push({label:n?`Disable plugin`:`Enable plugin`,action:()=>void Ae(n?`disable`:`enable`)}),r||(i.push({label:E.pendingUpdate?`Unmark for update`:`Mark for update`,action:async()=>{try{let e=await Xn(E.plugin.name,E.marketplace);if(e){L(e);return}let t=[...A],n=t.findIndex(e=>e.plugin.name===E.plugin.name&&e.marketplace===E.marketplace);n!==-1&&(t[n].pendingUpdate=!E.pendingUpdate,j(t),re({...E,pendingUpdate:!E.pendingUpdate}))}catch(e){L(e instanceof Error?e.message:`Failed to check plugin update availability`)}}}),De&&i.push({label:`Configure`,action:async()=>{Ee(!0);try{let e=E.plugin.manifest.mcpServers,t=null;if(typeof e==`string`&&te(e))t=e;else if(Array.isArray(e)){for(let n of e)if(typeof n==`string`&&te(n)){t=n;break}}if(!t){L(`No MCPB file found in plugin`),Ee(!1);return}let n=`${E.plugin.name}@${E.marketplace}`,r=await p(t,E.plugin.path,n,void 0,void 0,!0);`status`in r&&r.status===`needs-config`?(we(r),S(`configuring`)):L(`Failed to load MCPB for configuration`)}catch(e){let t=Je(e);L(`Failed to load configuration: ${t}`)}finally{Ee(!1)}}}),E.plugin.manifest.userConfig&&Object.keys(E.plugin.manifest.userConfig).length>0&&i.push({label:`Configure options`,action:()=>{S({type:`configuring-options`,schema:E.plugin.manifest.userConfig})}}),i.push({label:`Update now`,action:()=>void Ae(`update`)}),i.push({label:`Uninstall`,action:()=>void Ae(`uninstall`)})),E.plugin.manifest.homepage&&i.push({label:`Open homepage`,action:()=>void ne(E.plugin.manifest.homepage)}),E.plugin.manifest.repository&&i.push({label:`View repository`,action:()=>void ne(E.plugin.manifest.repository)}),i.push({label:`Back to plugin list`,action:()=>{S(`plugin-list`),re(null),L(null)}}),i},[x,E,De,A]);if(R({"select:previous":()=>{ye>0&&be(ye-1)},"select:next":()=>{ye<Ne.length-1&&be(ye+1)},"select:accept":()=>{Ne[ye]&&Ne[ye].action()}},{context:`Select`,isActive:x===`plugin-details`&&!!E}),R({"select:accept":()=>{typeof x==`object`&&x.type===`failed-plugin-details`&&(async()=>{I(!0),L(null);let e=x.plugin.id,t=x.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=nt(t);n?.enabledPlugins?.[e]!==void 0&&(ot(t,{enabledPlugins:{...n.enabledPlugins,[e]:void 0}}),i=!0)}he()}i?(n&&await n(),I(!1),S(`plugin-list`)):(I(!1),L(r.message))})()}},{context:`Select`,isActive:typeof x==`object`&&x.type===`failed-plugin-details`&&x.plugin.scope!==`managed`}),R({"confirm:yes":()=>{if(!E)return;I(!0),L(null);let r=`${E.plugin.name}@${E.marketplace}`,{error:i}=ot(`localSettings`,{enabledPlugins:{...nt(`localSettings`)?.enabledPlugins,[r]:!1}});if(i){I(!1),L(`Failed to write settings: ${i.message}`);return}he(),t(`✓ Disabled ${E.plugin.name} in .claude/settings.local.json. Run /reload-plugins to apply.`),n&&n(),e({type:`menu`})},"confirm:no":()=>{S(`plugin-details`),L(null)}},{context:`Confirmation`,isActive:x===`confirm-project-uninstall`&&!!E&&!xe}),Le((r,i)=>{if(!E)return;let o=`${E.plugin.name}@${E.marketplace}`,s=E.scope;if(!s||s===`builtin`||!wt(s))return;let c=async r=>{I(!0),L(null);try{let i=await xt(o,s,r);if(!i.success)throw Error(i.message);he();let c=r?``:` · data preserved`;t(`${a.tick} ${i.message}${c}`),n&&n(),e({type:`menu`})}catch(e){I(!1),L(e instanceof Error?e.message:String(e))}};r===`y`||r===`Y`?c(!0):r===`n`||r===`N`?c(!1):i.escape&&(S(`plugin-details`),L(null))},{isActive:typeof x==`object`&&x.type===`confirm-data-cleanup`&&!!E&&!xe}),$n.useEffect(()=>{me(0)},[C]),Le((e,t)=>{let n=!t.ctrl&&!t.meta;m||(e===`/`&&n?(g(!0),w(``),me(0)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==` `&&(g(!0),w(e),me(0)))},{isActive:x===`plugin-list`}),ae)return(0,Z.jsx)(B,{children:`Loading installed plugins…`});if(de.length===0)return(0,Z.jsxs)(z,{flexDirection:`column`,children:[(0,Z.jsx)(z,{marginBottom:1,children:(0,Z.jsx)(B,{bold:!0,children:`Manage plugins`})}),(0,Z.jsx)(B,{children:`No plugins or MCP servers installed.`}),(0,Z.jsx)(z,{marginTop:1,children:(0,Z.jsx)(B,{dimColor:!0,children:`Esc to go back`})})]});if(typeof x==`object`&&x.type===`plugin-options`&&E){let r=`${E.plugin.name}@${E.marketplace}`;function i(r){t(r),n&&n(),e({type:`menu`})}return(0,Z.jsx)(mn,{plugin:E.plugin,pluginId:r,onDone:(e,t)=>{switch(e){case`configured`:i(`✓ Enabled and configured ${E.plugin.name}. Run /reload-plugins to apply.`);break;case`skipped`:i(`✓ Enabled ${E.plugin.name}. Run /reload-plugins to apply.`);break;case`error`:i(`Failed to save configuration: ${t}`);break}}})}if(typeof x==`object`&&x.type===`configuring-options`&&E){let e=`${E.plugin.name}@${E.marketplace}`;return(0,Z.jsx)(ln,{title:`Configure ${E.plugin.name}`,subtitle:`Plugin options`,configSchema:x.schema,initialValues:c(e),onSave:n=>{try{pe(e,n,x.schema),he(),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){L(`Failed to save configuration: ${Je(e)}`)}S(`plugin-details`)},onCancel:()=>S(`plugin-details`)})}if(x===`configuring`&&Ce&&E){let e=`${E.plugin.name}@${E.marketplace}`;async function n(n){if(!(!Ce||!E))try{let r=E.plugin.manifest.mcpServers,i=null;if(typeof r==`string`&&te(r))i=r;else if(Array.isArray(r)){for(let e of r)if(typeof e==`string`&&te(e)){i=e;break}}if(!i){L(`No MCPB file found`),S(`plugin-details`);return}await p(i,E.plugin.path,e,void 0,n),L(null),we(null),S(`plugin-details`),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){let t=Je(e);L(`Failed to save configuration: ${t}`),S(`plugin-details`)}}function r(){we(null),S(`plugin-details`)}return(0,Z.jsx)(ln,{title:`Configure ${Ce.manifest.name}`,subtitle:`Plugin: ${E.plugin.name}`,configSchema:Ce.configSchema,initialValues:Ce.existingConfig,onSave:n,onCancel:r})}if(typeof x==`object`&&x.type===`flagged-detail`){let e=x.plugin;return(0,Z.jsxs)(z,{flexDirection:`column`,children:[(0,Z.jsx)(z,{children:(0,Z.jsxs)(B,{bold:!0,children:[e.name,` @ `,e.marketplace]})}),(0,Z.jsxs)(z,{marginBottom:1,children:[(0,Z.jsx)(B,{dimColor:!0,children:`Status: `}),(0,Z.jsx)(B,{color:`error`,children:`Removed`})]}),(0,Z.jsxs)(z,{marginBottom:1,flexDirection:`column`,children:[(0,Z.jsxs)(B,{color:`error`,children:[`Removed from marketplace · reason: `,e.reason]}),(0,Z.jsx)(B,{children:e.text}),(0,Z.jsxs)(B,{dimColor:!0,children:[`Flagged on `,new Date(e.flaggedAt).toLocaleDateString()]})]}),(0,Z.jsx)(z,{marginTop:1,flexDirection:`column`,children:(0,Z.jsxs)(z,{children:[(0,Z.jsxs)(B,{children:[a.pointer,` `]}),(0,Z.jsx)(B,{color:`suggestion`,children:`Dismiss`})]})}),(0,Z.jsxs)(V,{children:[(0,Z.jsx)(v,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`dismiss`}),(0,Z.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})]})}if(x===`confirm-project-uninstall`&&E)return(0,Z.jsxs)(z,{flexDirection:`column`,children:[(0,Z.jsxs)(B,{bold:!0,color:`warning`,children:[E.plugin.name,` is enabled in .claude/settings.json (shared with your team)`]}),(0,Z.jsxs)(z,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(B,{children:`Disable it just for you in .claude/settings.local.json?`}),(0,Z.jsx)(B,{dimColor:!0,children:`This has the same effect as uninstalling, without affecting other contributors.`})]}),Se&&(0,Z.jsx)(z,{marginTop:1,children:(0,Z.jsx)(B,{color:`error`,children:Se})}),(0,Z.jsx)(z,{marginTop:1,children:xe?(0,Z.jsx)(B,{dimColor:!0,children:`Disabling…`}):(0,Z.jsxs)(V,{children:[(0,Z.jsx)(v,{action:`confirm:yes`,context:`Confirmation`,fallback:`y`,description:`disable`}),(0,Z.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]});if(typeof x==`object`&&x.type===`confirm-data-cleanup`&&E)return(0,Z.jsxs)(z,{flexDirection:`column`,children:[(0,Z.jsxs)(B,{bold:!0,children:[E.plugin.name,` has `,x.size.human,` of persistent data`]}),(0,Z.jsxs)(z,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(B,{children:`Delete it along with the plugin?`}),(0,Z.jsx)(B,{dimColor:!0,children:D(`${E.plugin.name}@${E.marketplace}`)})]}),Se&&(0,Z.jsx)(z,{marginTop:1,children:(0,Z.jsx)(B,{color:`error`,children:Se})}),(0,Z.jsx)(z,{marginTop:1,children:xe?(0,Z.jsx)(B,{dimColor:!0,children:`Uninstalling…`}):(0,Z.jsxs)(B,{children:[(0,Z.jsx)(B,{bold:!0,children:`y`}),` to delete · `,(0,Z.jsx)(B,{bold:!0,children:`n`}),` to keep · `,(0,Z.jsx)(B,{bold:!0,children:`esc`}),` to cancel`]})})]});if(x===`plugin-details`&&E){let e=rt(),t=`${E.plugin.name}@${E.marketplace}`,n=e?.enabledPlugins?.[t]!==!1,r=d.filter(e=>`plugin`in e&&e.plugin===E.plugin.name||e.source===t||e.source.startsWith(`${E.plugin.name}@`)),i=r.length===0?null:(0,Z.jsxs)(z,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsxs)(B,{bold:!0,color:`error`,children:[r.length,` `,gt(r.length,`error`),`:`]}),r.map((e,t)=>{let n=Un(e);return(0,Z.jsxs)(z,{flexDirection:`column`,marginLeft:2,children:[(0,Z.jsx)(B,{color:`error`,children:Hn(e)}),n&&(0,Z.jsxs)(B,{dimColor:!0,italic:!0,children:[a.arrowRight,` `,n]})]},t)})]});return(0,Z.jsxs)(z,{flexDirection:`column`,children:[(0,Z.jsx)(z,{children:(0,Z.jsxs)(B,{bold:!0,children:[E.plugin.name,` @ `,E.marketplace]})}),(0,Z.jsxs)(z,{children:[(0,Z.jsx)(B,{dimColor:!0,children:`Scope: `}),(0,Z.jsx)(B,{children:E.scope||`user`})]}),E.plugin.manifest.version&&(0,Z.jsxs)(z,{children:[(0,Z.jsx)(B,{dimColor:!0,children:`Version: `}),(0,Z.jsx)(B,{children:E.plugin.manifest.version})]}),E.plugin.manifest.description&&(0,Z.jsx)(z,{marginBottom:1,children:(0,Z.jsx)(B,{children:E.plugin.manifest.description})}),E.plugin.manifest.author&&(0,Z.jsxs)(z,{children:[(0,Z.jsx)(B,{dimColor:!0,children:`Author: `}),(0,Z.jsx)(B,{children:E.plugin.manifest.author.name})]}),(0,Z.jsxs)(z,{marginBottom:1,children:[(0,Z.jsx)(B,{dimColor:!0,children:`Status: `}),(0,Z.jsx)(B,{color:n?`success`:`warning`,children:n?`Enabled`:`Disabled`}),E.pendingUpdate&&(0,Z.jsx)(B,{color:`suggestion`,children:` · Marked for update`})]}),(0,Z.jsx)(Yn,{plugin:E.plugin,marketplace:E.marketplace}),i,(0,Z.jsx)(z,{marginTop:1,flexDirection:`column`,children:Ne.map((e,t)=>{let n=t===ye;return(0,Z.jsxs)(z,{children:[n&&(0,Z.jsxs)(B,{children:[a.pointer,` `]}),!n&&(0,Z.jsx)(B,{children:` `}),(0,Z.jsx)(B,{bold:n,color:e.label.includes(`Uninstall`)?`error`:e.label.includes(`Update`)?`suggestion`:void 0,children:e.label})]},t)})}),xe&&(0,Z.jsx)(z,{marginTop:1,children:(0,Z.jsx)(B,{children:`Processing…`})}),Se&&(0,Z.jsx)(z,{marginTop:1,children:(0,Z.jsx)(B,{color:`error`,children:Se})}),(0,Z.jsx)(z,{marginTop:1,children:(0,Z.jsx)(B,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(V,{children:[(0,Z.jsx)(v,{action:`select:previous`,context:`Select`,fallback:`↑`,description:`navigate`}),(0,Z.jsx)(v,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,Z.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(typeof x==`object`&&x.type===`failed-plugin-details`){let e=x.plugin,t=e.errors[0],n=t?Hn(t):`Failed to load`;return(0,Z.jsxs)(z,{flexDirection:`column`,children:[(0,Z.jsxs)(B,{children:[(0,Z.jsx)(B,{bold:!0,children:e.name}),(0,Z.jsxs)(B,{dimColor:!0,children:[` @ `,e.marketplace]}),(0,Z.jsxs)(B,{dimColor:!0,children:[` (`,e.scope,`)`]})]}),(0,Z.jsx)(B,{color:`error`,children:n}),e.scope===`managed`?(0,Z.jsx)(z,{marginTop:1,children:(0,Z.jsx)(B,{dimColor:!0,children:`Managed by your organization — contact your admin`})}):(0,Z.jsxs)(z,{marginTop:1,children:[(0,Z.jsxs)(B,{color:`suggestion`,children:[a.pointer,` `]}),(0,Z.jsx)(B,{bold:!0,children:`Remove`})]}),xe&&(0,Z.jsx)(B,{children:`Processing…`}),Se&&(0,Z.jsx)(B,{color:`error`,children:Se}),(0,Z.jsx)(z,{marginTop:1,children:(0,Z.jsx)(B,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(V,{children:[e.scope!==`managed`&&(0,Z.jsx)(v,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`remove`}),(0,Z.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(typeof x==`object`&&x.type===`mcp-detail`){let e=x.client,n=O(u,e.name).length,r=()=>{S({type:`mcp-tools`,client:e})},i=()=>{S(`plugin-list`)},a=e=>{e&&t(e),S(`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}):(S(`plugin-list`),null)}if(typeof x==`object`&&x.type===`mcp-tools`){let e=x.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=>{S({type:`mcp-tool-detail`,client:e,tool:t})},onBack:()=>S({type:`mcp-detail`,client:e})})}if(typeof x==`object`&&x.type===`mcp-tool-detail`){let{client:e,tool:t}=x,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:()=>S({type:`mcp-tools`,client:e})})}let Pe=_e.getVisibleItems(P);return(0,Z.jsxs)(z,{flexDirection:`column`,children:[(0,Z.jsx)(z,{marginBottom:1,children:(0,Z.jsx)(ze,{query:C,isFocused:m,isTerminalFocused:_,width:y-4,cursorOffset:T})}),P.length===0&&C&&(0,Z.jsx)(z,{marginBottom:1,children:(0,Z.jsxs)(B,{dimColor:!0,children:[`No items match "`,C,`"`]})}),_e.scrollPosition.canScrollUp&&(0,Z.jsx)(z,{children:(0,Z.jsxs)(B,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),Pe.map((e,t)=>{let n=_e.toActualIndex(t)===F&&!m,r=t>0?Pe[t-1]:null,i=!r||r.scope!==e.scope;return(0,Z.jsxs)($n.Fragment,{children:[i&&(0,Z.jsx)(z,{marginTop:+(t>0),paddingLeft:2,children:(0,Z.jsx)(B,{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)}),_e.scrollPosition.canScrollDown&&(0,Z.jsx)(z,{children:(0,Z.jsxs)(B,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),(0,Z.jsx)(z,{marginTop:1,marginLeft:1,children:(0,Z.jsx)(B,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(V,{children:[(0,Z.jsx)(B,{children:`type to search`}),(0,Z.jsx)(v,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,Z.jsx)(v,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,Z.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})}),M.size>0&&(0,Z.jsx)(z,{marginLeft:1,children:(0,Z.jsx)(B,{dimColor:!0,italic:!0,children:`Run /reload-plugins to apply changes`})})]})}var $n,X,Z,er=e((()=>{i(),$n=t(H(),1),X=t(H(),1),C(),Ue(),qt(),Xt(),Jt(),Yt(),Ut(),Gt(),o(),xe(),De(),Bt(),we(),Et(),u(),tt(),x(),Ze(),$e(),ut(),Ee(),f(),j(),w(),M(),Rt(),ue(),be(),F(),S(),vt(),it(),Ye(),_t(),Wn(),fn(),_n(),Kn(),kn(),Z=Ke()}));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} ${gt(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} ${gt(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,dt(t),e(`${a.cross} Unexpected error during validation: ${Je(t)}`)}}n()},[e,t]),(0,ar.jsx)(z,{flexDirection:`column`,children:(0,ar.jsx)(B,{children:`Running validation...`})})}var ir,ar,or=e((()=>{i(),H(),ir=t(H(),1),Ue(),$e(),ut(),Pt(),_t(),ar=Ke()}));function sr({onComplete:e}){return(0,Q.useEffect)(()=>{async function t(){try{let t=await g(),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)(B,{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`}])nt(n)?.extraKnownMarketplaces?.[e]&&t.push({source:n,scope:r});return{editableSources:t,isInPolicy:!!nt(`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=nt(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&&ot(n,r)}}function hr({setViewState:e,setActiveTab:t,markPluginsChanged:n}){let r=ke(e=>e.plugins.errors),i=ke(e=>e.plugins.installationStatus),o=d(),[s,c]=(0,Q.useState)(0),[l,u]=(0,Q.useState)(null),[f,p]=(0,Q.useState)([]);(0,Q.useEffect)(()=>{(async()=>{try{let{failures:e}=await Ce(await g());p(e)}catch{}})()},[]);let m=i.marketplaces.filter(e=>e.status===`failed`),h=new Set(m.map(e=>e.name)),_=r.filter(dr),y=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,_,yt());Fe(`confirm:no`,()=>{e({type:`menu`})},{context:`Confirmation`}),R({"select:previous":()=>c(e=>Math.max(0,e-1)),"select:next":()=>c(e=>Math.min(y.length-1,e+1)),"select:accept":()=>{let r=y[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),he(),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)}}})),u(`${a.tick} Removed "${i.name}" from ${e} settings`),n();break}case`remove-installed-marketplace`:(async()=>{try{await I(i.name),he(),p(e=>e.filter(e=>e.name!==i.name)),u(`${a.tick} Removed marketplace "${i.name}"`),n()}catch(e){u(`Failed to remove "${i.name}": ${e instanceof Error?e.message:String(e)}`)}})();break;case`managed-only`:break;case`none`:break}}},{context:`Select`,isActive:y.length>0});let b=Math.min(s,Math.max(0,y.length-1));b!==s&&c(b);let x=y[b]?.action,S=x&&x.kind!==`none`&&x.kind!==`managed-only`;return y.length===0?(0,$.jsxs)(z,{flexDirection:`column`,children:[(0,$.jsx)(z,{marginLeft:1,children:(0,$.jsx)(B,{dimColor:!0,children:`No plugin errors`})}),(0,$.jsx)(z,{marginTop:1,children:(0,$.jsx)(B,{dimColor:!0,italic:!0,children:(0,$.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})})]}):(0,$.jsxs)(z,{flexDirection:`column`,children:[y.map((e,t)=>{let n=t===b;return(0,$.jsxs)(z,{marginLeft:1,flexDirection:`column`,marginBottom:1,children:[(0,$.jsxs)(B,{children:[(0,$.jsxs)(B,{color:n?`suggestion`:`error`,children:[n?a.pointer:a.cross,` `]}),(0,$.jsx)(B,{bold:n,children:e.label}),e.scope&&(0,$.jsxs)(B,{dimColor:!0,children:[` (`,e.scope,`)`]})]}),(0,$.jsx)(z,{marginLeft:3,children:(0,$.jsx)(B,{color:`error`,children:e.message})}),e.guidance&&(0,$.jsx)(z,{marginLeft:3,children:(0,$.jsx)(B,{dimColor:!0,italic:!0,children:e.guidance})})]},t)}),l&&(0,$.jsx)(z,{marginTop:1,marginLeft:1,children:(0,$.jsx)(B,{color:`claude`,children:l})}),(0,$.jsx)(z,{marginTop:1,children:(0,$.jsx)(B,{dimColor:!0,italic:!0,children:(0,$.jsxs)(V,{children:[(0,$.jsx)(v,{action:`select:previous`,context:`Select`,fallback:`↑`,description:`navigate`}),S&&(0,$.jsx)(v,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`resolve`}),(0,$.jsx)(v,{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,f]=(0,Q.useState)(0),[p,m]=(0,Q.useState)(null),[h,g]=(0,Q.useState)(null),[_,v]=(0,Q.useState)(!1),y=d(),b=ke(e=>{let t=e.plugins.errors.length;for(let n of e.plugins.installationStatus.marketplaces)n.status===`failed`&&t++;return t}),x=b>0?`Errors (${b})`:`Errors`,S=Vt(),C=n.type===`marketplace`&&n.action===`add`&&n.target!==void 0,w=(0,Q.useCallback)(()=>{y(e=>e.plugins.needsRefresh?e:{...e,plugins:{...e.plugins,needsRefresh:!0}})},[y]),ee=(0,Q.useCallback)(e=>{let t=e;switch(s(t),m(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`&&!h&&e()},[i.type,h,e]),(0,Q.useEffect)(()=>{i.type===`browse-marketplace`&&o!==`discover`&&s(`discover`)},[i.type,o]),Fe(`confirm:no`,(0,Q.useCallback)(()=>{s(`marketplaces`),a({type:`manage-marketplaces`}),l(``),m(null)},[]),{context:`Settings`,isActive:i.type===`add-marketplace`}),(0,Q.useEffect)(()=>{h&&e(h)},[h,e]),(0,Q.useEffect)(()=>{i.type===`help`&&e()},[i.type,e]),i.type===`help`?(0,$.jsxs)(z,{flexDirection:`column`,children:[(0,$.jsx)(B,{bold:!0,children:`Plugin Command Usage:`}),(0,$.jsx)(B,{children:` `}),(0,$.jsx)(B,{dimColor:!0,children:`Installation:`}),(0,$.jsx)(B,{children:` /plugin install - Browse and install plugins`}),(0,$.jsx)(B,{children:` /plugin install <marketplace> - Install from specific marketplace`}),(0,$.jsx)(B,{children:` /plugin install <plugin> - Install specific plugin`}),(0,$.jsx)(B,{children:` /plugin install <plugin>@<market> - Install plugin from marketplace`}),(0,$.jsx)(B,{children:` `}),(0,$.jsx)(B,{dimColor:!0,children:`Management:`}),(0,$.jsx)(B,{children:` /plugin manage - Manage installed plugins`}),(0,$.jsx)(B,{children:` /plugin enable <plugin> - Enable a plugin`}),(0,$.jsx)(B,{children:` /plugin disable <plugin> - Disable a plugin`}),(0,$.jsx)(B,{children:` /plugin uninstall <plugin> - Uninstall a plugin`}),(0,$.jsx)(B,{children:` `}),(0,$.jsx)(B,{dimColor:!0,children:`Marketplaces:`}),(0,$.jsx)(B,{children:` /plugin marketplace - Marketplace management menu`}),(0,$.jsx)(B,{children:` /plugin marketplace add - Add a marketplace`}),(0,$.jsx)(B,{children:` /plugin marketplace add <path/url> - Add marketplace directly`}),(0,$.jsx)(B,{children:` /plugin marketplace update - Update marketplaces`}),(0,$.jsx)(B,{children:` /plugin marketplace update <name> - Update specific marketplace`}),(0,$.jsx)(B,{children:` /plugin marketplace remove - Remove a marketplace`}),(0,$.jsx)(B,{children:` /plugin marketplace remove <name> - Remove specific marketplace`}),(0,$.jsx)(B,{children:` /plugin marketplace list - List all marketplaces`}),(0,$.jsx)(B,{children:` `}),(0,$.jsx)(B,{dimColor:!0,children:`Validation:`}),(0,$.jsx)(B,{children:` /plugin validate <path> - Validate a manifest file or directory`}),(0,$.jsx)(B,{children:` `}),(0,$.jsx)(B,{dimColor:!0,children:`Other:`}),(0,$.jsx)(B,{children:` /plugin - Main plugin menu`}),(0,$.jsx)(B,{children:` /plugin help - Show this help`}),(0,$.jsx)(B,{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:f,error:p,setError:m,result:h,setResult:g,setViewState:a,onAddComplete:w,cliMode:C}):(0,$.jsx)(We,{color:`suggestion`,children:(0,$.jsxs)(He,{title:`Plugins`,selectedTab:o,onTabChange:ee,color:`suggestion`,disableNavigation:_,children:[(0,$.jsx)(Be,{id:`discover`,title:`Discover`,children:i.type===`browse-marketplace`?(0,$.jsx)(An,{error:p,setError:m,result:h,setResult:g,setViewState:a,onInstallComplete:w,targetMarketplace:i.targetMarketplace,targetPlugin:i.targetPlugin}):(0,$.jsx)(Nn,{error:p,setError:m,result:h,setResult:g,setViewState:a,onInstallComplete:w,onSearchModeChange:v,targetPlugin:i.type===`discover-plugins`?i.targetPlugin:void 0})}),(0,$.jsx)(Be,{id:`installed`,title:`Installed`,children:(0,$.jsx)(Qn,{setViewState:a,setResult:g,onManageComplete:w,onSearchModeChange:v,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)(Be,{id:`marketplaces`,title:`Marketplaces`,children:(0,$.jsx)(Rn,{setViewState:a,error:p,setError:m,setResult:g,exitState:S,onManageComplete:w,targetMarketplace:i.type===`manage-marketplaces`?i.targetMarketplace:void 0,action:i.type===`manage-marketplaces`?i.action:void 0})}),(0,$.jsx)(Be,{id:`errors`,title:x,children:(0,$.jsx)(hr,{setViewState:a,setActiveTab:s,markPluginsChanged:w})})]})})}var Q,$,yr,br=e((()=>{i(),H(),Q=t(H(),1),C(),Ue(),Ht(),xe(),u(),$e(),Ee(),N(),j(),vt(),it(),sn(),Mn(),Ln(),Vn(),er(),Wn(),nr(),or(),$=Ke(),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((()=>{H(),br(),Sr=Ke()}))();export{xr as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Eo as t,Go as n,Ho as r,Lo as i,Oo as a,Vo as o,dT as s,jo as c,pT as l}from"./loadAgentsDir-C7lOqvfh.js";import{F as u,a as d,l as f,z as p}from"./debug-RAynG_nM.js";import{vt as m,xt as h}from"./settings-DnptdP79.js";import{b as g,h as _}from"./config-Do1870_d.js";import{o as v,s as y}from"./log-CezCRpAN.js";import{f as b,s as x}from"./pluginOperations-D90IRawu.js";function S(e){return O=e,k!==null&&k.length>0&&(e(k),k=null),()=>{O=null}}async function C(){let e=await r(),t=i(),n=new Set;for(let[r,i]of Object.entries(e)){let e=t[r]?.autoUpdate;(e===void 0?h(r,i):e)&&n.add(r.toLowerCase())}return n}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=c(),n=Object.keys(t.plugins);return n.length===0?[]:(await Promise.allSettled(n.map(async n=>{let{marketplace:r}=l(n);if(!r||!e.has(r.toLowerCase()))return null;let i=t.plugins[n];if(!i||i.length===0)return null;let o=i.filter(a);return o.length===0?null:w(n,o)}))).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 n(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 r=await E(e);r.length>0&&(O?O(r):k=r)}catch(e){y(e)}})()}var O,k,A=e((()=>{x(),_(),d(),p(),v(),t(),o(),s(),m(),O=null,k=null}));export{T as i,A as n,S as r,D as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Eo as e,Mo as t,Ro as n,Uo as r,Vo as i}from"./loadAgentsDir-C7lOqvfh.js";import{F as a,a as o,l as s,z as c}from"./debug-RAynG_nM.js";import{d as l,s as u}from"./pluginOperations-D90IRawu.js";import{i as d,n as f,r as p,t as m}from"./pluginFlagging-DZaYzecY.js";u(),o(),c(),e(),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 e=t(),i=f(),o=await r(),c=[];for(let t of Object.keys(o))try{let r=await n(t);if(!r.forceRemoveDeletedPlugins)continue;let o=h(e,r,t);for(let t of o){if(t in i)continue;let n=e.plugins[t]??[];if(n.some(e=>e.scope===`user`||e.scope===`project`||e.scope===`local`)){for(let e of n){let{scope:n}=e;if(!(n!==`user`&&n!==`project`&&n!==`local`))try{await l(t,n)}catch(e){s(`Failed to auto-uninstall delisted plugin ${t} from ${n}: ${a(e)}`,{level:`error`})}}await m(t),c.push(t)}}}catch(e){s(`Failed to check for delisted plugins in "${t}": ${a(e)}`,{level:`warn`})}return c}export{g as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./figures-5ThXQEtq.js";import{Mf as n,Nf as r,Pf as i,To as a,dT as o,pT as s,rf as c,tf as l,wo as u}from"./loadAgentsDir-C7lOqvfh.js";import{F as d,z as f}from"./debug-RAynG_nM.js";import{n as p,o as m}from"./process-gEbdy6uY.js";import{o as h,s as g}from"./log-CezCRpAN.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-D90IRawu.js";e(),f(),c(),h(),a(),o(),p(),i(),_(),T();function E(e,i,a){g(e);let o=a?`${i} plugin "${a}"`:i===`disable-all`?`disable all plugins`:`${i} plugins`;console.error(`${t.cross} Failed to ${o}: ${d(e)}`);let c=a?(()=>{let{name:e,marketplace:t}=s(a);return{_PROTO_plugin_name:e,...t&&{_PROTO_marketplace_name:t},...n(e,t,u())}})():{};v(`tengu_plugin_command_failed`,{command:i,error_category:r(e),...c}),process.exit(1)}async function D(e,r=`user`){try{console.log(`Installing plugin "${e}"...`);let i=await b(e,r);if(!i.success)throw Error(i.message);console.log(`${t.tick} ${i.message}`);let{name:a,marketplace:o}=s(i.pluginId||e);v(`tengu_plugin_installed_cli`,{_PROTO_plugin_name:a,...o&&{_PROTO_marketplace_name:o},scope:i.scope||r,install_source:`cli-explicit`,...n(a,o,u())}),process.exit(0)}catch(t){E(t,`install`,e)}}async function O(e,r=`user`,i=!1){try{let a=await x(e,r,!i);if(!a.success)throw Error(a.message);console.log(`${t.tick} ${a.message}`);let{name:o,marketplace:c}=s(a.pluginId||e);v(`tengu_plugin_uninstalled_cli`,{_PROTO_plugin_name:o,...c&&{_PROTO_marketplace_name:c},scope:a.scope||r,...n(o,c,u())}),process.exit(0)}catch(t){E(t,`uninstall`,e)}}async function k(e,r){try{let i=await y(e,r);if(!i.success)throw Error(i.message);console.log(`${t.tick} ${i.message}`);let{name:a,marketplace:o}=s(i.pluginId||e);v(`tengu_plugin_enabled_cli`,{_PROTO_plugin_name:a,...o&&{_PROTO_marketplace_name:o},scope:i.scope,...n(a,o,u())}),process.exit(0)}catch(t){E(t,`enable`,e)}}async function A(e,r){try{let i=await C(e,r);if(!i.success)throw Error(i.message);console.log(`${t.tick} ${i.message}`);let{name:a,marketplace:o}=s(i.pluginId||e);v(`tengu_plugin_disabled_cli`,{_PROTO_plugin_name:a,...o&&{_PROTO_marketplace_name:o},scope:i.scope,...n(a,o,u())}),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,r){try{m(`Checking for updates for plugin "${e}" at ${r} scope…\n`);let i=await S(e,r);if(!i.success)throw Error(i.message);if(m(`${t.tick} ${i.message}\n`),!i.alreadyUpToDate){let{name:t,marketplace:r}=s(i.pluginId||e);v(`tengu_plugin_updated_cli`,{_PROTO_plugin_name:t,...r&&{_PROTO_marketplace_name:r},old_version:i.oldVersion||`unknown`,new_version:i.newVersion||`unknown`,...n(t,r,u())})}await l(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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Xw as t,Zw as n}from"./loadAgentsDir-C7lOqvfh.js";import{C as r,S as i,a,d as o,l as s,p as c,w as l}from"./debug-RAynG_nM.js";import{o as u,s as d}from"./log-CezCRpAN.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=r(e);if(typeof t!=`object`||!t||!(`plugins`in t)||typeof t.plugins!=`object`||t.plugins===null)return{};let n=t.plugins,i={};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),i[e]=n}return i}async function b(){try{return y(await m(v(),{encoding:`utf-8`}))}catch{return{}}}async function x(e){let n=v(),r=`${n}.${p(8).toString(`hex`)}.tmp`;try{await o().mkdir(t()),await _(r,l({plugins:e},null,2),{encoding:`utf-8`,mode:384}),await h(r,n),k=e}catch(e){d(e);try{await g(r)}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()}}),s(`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((()=>{a(),c(),u(),i(),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};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Bo as t,Co as n,DS as r,Eo as i,Ho as a,Lg as o,Mo as s,No as c,Po as l,Rg as u,Ro as d,So as f,Vo as p,Zw as m,cT as h,co as g,dT as _,do as v,ds as y,fo as b,go as x,jo as S,kS as C,lT as w,ls as T,mT as E,mo as D,pT as O,po as ee,qw as te,uT as k,uo as A,us as j,vT as M,vo as ne,xo as re,yT as ie,yo as ae}from"./loadAgentsDir-C7lOqvfh.js";import{Wt as oe,et as N}from"./state-BemZdQIl.js";import{V as P,W as se,d as ce,p as F,z as I}from"./debug-RAynG_nM.js";import{c as L,g as R,x as z}from"./settings-DnptdP79.js";import{o as B,s as V}from"./log-CezCRpAN.js";import{l as H,o as U}from"./stringUtils-C84IJ91d.js";import{n as W,t as G}from"./pluginStartupCheck-CB2q2dLv.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(E(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}=O(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:t}=O(e),n=s();if(n.plugins[e]?.length)return{pluginId:e,pluginName:t};let r=Object.keys(n.plugins).find(e=>{let{name:r}=O(e);return r===t&&(n.plugins[e]?.length??0)>0});return r?{pluginId:r,pluginName:t}:null}function Y(e){let t=s().plugins[e];if(!t||t.length===0)return{scope:`user`};let n=N(),r=t.find(e=>e.scope===`local`&&e.projectPath===n);if(r)return{scope:r.scope,projectPath:r.projectPath};let i=t.find(e=>e.scope===`project`&&e.projectPath===n);if(i)return{scope:i.scope,projectPath:i.projectPath};let a=t.find(e=>e.scope===`user`);return a?{scope:a.scope}:{scope:t[0].scope,projectPath:t[0].projectPath}}async function he(e,n=`user`){q(n);let{name:r,marketplace:i}=O(e),o,s,c;if(i){let n=await t(e);n&&(o=n.entry,s=i,c=n.marketplaceInstallLocation)}else{let e=await a();for(let[t,n]of Object.entries(e))try{let e=(await d(t)).plugins.find(e=>e.name===r);if(e){o=e,s=t,c=n.installLocation;break}}catch(e){V(se(e))}}if(!o||!s)return{success:!1,message:`Plugin "${r}" not found in ${i?`marketplace "${i}"`:`any configured marketplace`}`};let l=o,u=`${l.name}@${s}`,f=await re({pluginId:u,entry:l,scope:n,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:ne(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: ${u} (scope: ${n})${f.depNote}`,pluginId:u,pluginName:l.name,scope:n}}async function ge(e,t=`user`,n=!0){q(t);let{enabled:i,disabled:a}=await D(),o=[...i,...a],l=pe(e,o),u=E(t),d=L(u),f,p;if(l)f=Object.keys(d?.enabledPlugins??{}).find(t=>t===e||t===l.name||t.startsWith(`${l.name}@`))??(e.includes(`@`)?e:l.name),p=l.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(t),g=s().plugins[f],_=g?.find(e=>e.scope===t&&e.projectPath===m);if(!_){let{scope:n}=Y(f);return n!==t&&g&&g.length>0?n===`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 ${n} scope, not ${t}. Use --scope ${n} to uninstall.`}:{success:!1,message:`Plugin "${e}" is not installed in ${t} scope. Use --scope to specify the correct scope.`}}let v=_.installPath,b={...d?.enabledPlugins};b[f]=void 0,z(u,{enabledPlugins:b}),T(),c(f,t,m);let x=s().plugins[f],S=!x||x.length===0;S&&v&&await y(v),S&&(r(f),n&&await te(f));let C=h(f,o),O=w(C);return{success:!0,message:`Successfully uninstalled plugin: ${p} (scope: ${t})${O}`,pluginId:f,pluginName:p,scope:t,reverseDependents:C.length>0?C:void 0}}async function X(e,t,n){let r=t?`enable`:`disable`;if(ie(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}`};T();let{name:i}=O(e);return{success:!0,message:`Successfully ${r}d built-in plugin: ${i}`,pluginId:e,pluginName:i,scope:`user`}}n&&q(n);let i,a,o=fe(e);if(n)if(a=n,o)i=o.pluginId;else if(e.includes(`@`))i=e;else return{success:!1,message:`Plugin "${e}" not found in settings. Use plugin@marketplace format.`};else if(o)i=o.pluginId,a=o.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&&u(i))return{success:!1,message:`Plugin "${i}" is blocked by your organization's policy and cannot be enabled`};let s=E(a),c=L(s)?.enabledPlugins?.[i],l={user:0,project:1,local:2},d=n&&o&&l[n]>l[o.scope];if(n&&c===void 0&&o&&o.scope!==n&&!d)return{success:!1,message:`Plugin "${e}" is installed at ${o.scope} scope, not ${n}. Use --scope ${o.scope} or omit --scope to auto-detect.`};if(t===(n&&!d?c===!0:G().has(i)))return{success:!1,message:`Plugin "${e}" is already ${t?`enabled`:`disabled`}${n?` at ${n} scope`:``}`};let f;if(!t){let{enabled:e,disabled:t}=await D(),n=h(i,[...e,...t]);n.length>0&&(f=n)}let{error:p}=z(s,{enabledPlugins:{...L(s)?.enabledPlugins,[i]:t}});if(p)return{success:!1,message:`Failed to ${r} plugin: ${p.message}`};T();let{name:m}=O(i),g=w(f);return{success:!0,message:`Successfully ${r}d plugin: ${m} (scope: ${a})${g}`,pluginId:i,pluginName:m,scope:a,reverseDependents:f}}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,n){let{name:r,marketplace:i}=O(e),a=i?`${r}@${i}`:e,o=await t(e);if(!o)return{success:!1,message:`Plugin "${r}" not found`,pluginId:a,scope:n};let{entry:s,marketplaceInstallLocation:c}=o,l=S().plugins[a];if(!l||l.length===0)return{success:!1,message:`Plugin "${r}" is not installed`,pluginId:a,scope:n};let u=J(n),d=l.find(e=>e.scope===n&&e.projectPath===u);return d?be({pluginId:a,pluginName:r,entry:s,marketplaceInstallLocation:c,installation:d,scope:n,projectPath:u}):{success:!1,message:`Plugin "${r}" is not installed at scope ${u?`${n} (${u})`:n}`,pluginId:a,scope:n}}async function be({pluginId:e,pluginName:t,entry:n,marketplaceInstallLocation:r,installation:i,scope:a,projectPath:o}){let s=ce(),c=i.version,u,d,p=!1,m;if(typeof n.source!=`string`){let t=await g(n.source,{manifest:{name:n.name}});u=t.path,p=!0,m=t.gitCommitSha,d=await f(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 x(o,n.name,n.source)}catch{}d=await f(e,n.source,i,u,n.version)}try{let r=v(e,d),s=b(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:c,alreadyUpToDate:!0,scope:a};r=await A(u,e,d,n);let f=i.installPath;if(l(e,a,o,r,d,m),f&&f!==r){let e=S();Object.values(e.plugins).some(e=>e.some(e=>e.installPath===f))||await y(f)}let p=o?`${a} (${o})`:a;return{success:!0,message:`Plugin "${t}" updated from ${c||`unknown`} to ${d} for scope ${p}. Restart to apply changes.`,pluginId:e,newVersion:d,oldVersion:c,scope:a}}finally{p&&u!==v(e,d)&&await s.rm(u,{recursive:!0,force:!0})}}var Q,$,xe=e((()=>{oe(),M(),I(),F(),B(),j(),k(),i(),p(),m(),_(),ae(),ee(),C(),o(),W(),n(),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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./pluginStartupCheck-CB2q2dLv.js";e();export{t as getPluginEditableScopes};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Eo as t,Vo as n,dT as r,gT as i,hT as a,yo as o}from"./loadAgentsDir-C7lOqvfh.js";import{n as s}from"./cwd-Cfdf7z7s.js";import{a as c,l}from"./debug-RAynG_nM.js";import{c as u,g as d,vt as f}from"./settings-DnptdP79.js";import{o as p}from"./log-CezCRpAN.js";import"path";function m(){let e=new Map,t=a();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&&l(`Plugin ${a} from --add-dir (${t[a]}) overridden by ${r} (${o})`),o===!0?e.set(a,n):o===!1&&e.delete(a))}return l(`Found ${e.size} enabled plugins with scopes: ${Array.from(e.entries()).map(([e,t])=>`${e}(${t})`).join(`, `)}`),e}var h=e((()=>{s(),c(),p(),d(),i(),t(),n(),r(),o(),f()}));export{h as n,m as t};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./figures-5ThXQEtq.js";import{$o as n,Ao as r,ES as i,Eo as a,Fo as o,Go as s,Ho as c,Mo as l,TS as u,Vo as d,Wo as f,Yo as p,as as m,bT as h,dT as g,ls as _,mT as v,mo as y,pT as b,po as x,qo as S,ss as C,us as ee,xT as w}from"./loadAgentsDir-C7lOqvfh.js";import{Wt as T,ir as E}from"./state-BemZdQIl.js";import{F as D,S as te,w as O,z as k}from"./debug-RAynG_nM.js";import{o as ne,s as A}from"./log-CezCRpAN.js";import{n as j,r as M}from"./analytics-DJobLaWP.js";import{l as N,o as P}from"./stringUtils-C84IJ91d.js";import{n as F,t as I}from"./exit-BOhGfSlm.js";import{n as L,s as R,t as z}from"./pluginOperations-D90IRawu.js";import{a as B,i as V,n as H,o as U,r as W,t as G}from"./pluginCliCommands-Bd96zSOQ.js";import{a as re,c as K,i as q,n as J,r as Y,s as X,t as ie}from"./validatePlugin-Kk6pxnO2.js";import{basename as ae,dirname as Z}from"path";e(),T(),j(),R(),w(),k(),ne(),ee(),K(),a(),m(),d(),u(),q(),g(),x(),ie(),te(),P();function Q(e,n){A(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&&E(!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){A(e),console.error(`${t.cross} Unexpected error during validation: ${D(e)}`),process.exit(2)}}async function se(e){e.cowork&&E(!0),M(`tengu_plugin_list_command`,{});let a=l(),{getPluginEditableScopes:o}=await import(`./pluginStartupCheck-Bxkxpm4k.js`),s=o(),u=Object.keys(a.plugins),{enabled:d,disabled:f,errors:p}=await y(),m=[...d,...f],g=m.filter(e=>e.source.endsWith(`@inline`)),_=p.filter(e=>e.source.endsWith(`@inline`)||e.source.startsWith(`inline[`));if(e.json){let t=new Map(m.map(e=>[e.source,e])),o=[];for(let e of u.sort()){let n=a.plugins[e];if(!n||n.length===0)continue;let r=b(e).name,c=p.filter(t=>t.source===e||`plugin`in t&&t.plugin===r).map(h);for(let r of n){let n=t.get(e),a;if(n){let e=n.mcpServers||await i(n);e&&Object.keys(e).length>0&&(a=e)}o.push({id:e,version:r.version||`unknown`,scope:r.scope,enabled:s.has(e),installPath:r.installPath,installedAt:r.installedAt,lastUpdated:r.lastUpdated,projectPath:r.projectPath,mcpServers:a,errors:c.length>0?c:void 0})}}for(let e of g){let t=e.mcpServers||await i(e),n=_.filter(t=>t.source===e.source||`plugin`in t&&t.plugin===e.name).map(h);o.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:n.length>0?n:void 0})}for(let e of _.filter(e=>e.source.startsWith(`inline[`)))o.push({id:e.source,version:`unknown`,scope:`session`,enabled:!1,installPath:`path`in e?e.path:``,errors:[h(e)]});if(e.available){let e=[];try{let[t,i]=await Promise.all([c(),X()]),{marketplaces:a}=await C(t);for(let{name:t,data:o}of a)if(o)for(let a of o.plugins){let o=n(a.name,t);r(o)||e.push({pluginId:o,name:a.name,description:a.description,marketplaceName:t,version:a.version,source:a.source,installCount:i?.get(o)})}}catch{}F(O({installed:o,available:e},null,2))}else F(O(o,null,2))}u.length===0&&g.length===0&&_.length===0&&F("No plugins installed. Use `claude plugin install` to install a plugin."),u.length>0&&console.log(`Installed plugins:
|
|
2
|
-
`);for(let e of u.sort()){let n=a.plugins[e];if(!n||n.length===0)continue;let r=b(e).name,i=p.filter(t=>t.source===e||`plugin`in t&&t.plugin===r);for(let r of n){let n=s.has(e),a=i.length>0?`${t.cross} failed to load`:n?`${t.tick} enabled`:`${t.cross} disabled`,o=r.version||`unknown`,c=r.scope;console.log(` ${t.pointer} ${e}`),console.log(` Version: ${o}`),console.log(` Scope: ${c}`),console.log(` Status: ${a}`);for(let e of i)console.log(` Error: ${h(e)}`);console.log(``)}}if(g.length>0||_.length>0){console.log(`Session-only plugins (--plugin-dir):
|
|
3
|
-
`);for(let e of g){let n=_.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: ${h(e)}`);console.log(``)}for(let e of _.filter(e=>e.source.startsWith(`inline[`)))console.log(` ${t.pointer} ${e.source}: ${t.cross} ${h(e)}\n`)}F()}async function ce(e,n){n.cowork&&E(!0);try{let r=await re(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=v(i),s=r;n.sparse&&n.sparse.length>0&&(s.source===`github`||s.source===`git`?s={...s,sparsePaths:n.sparse}:I(`${t.cross} --sparse is only supported for github and git marketplace sources (got: ${s.source})`)),console.log(`Adding marketplace...`);let{name:c,alreadyMaterialized:l,resolvedSource:u}=await o(s,e=>{console.log(e)});p(c,{source:u},a),_();let d=s.source;s.source===`github`&&(d=s.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&&E(!0);try{let n=await c(),r=Object.keys(n);e.json&&F(O(r.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)),r.length===0&&F(`No marketplaces configured`),console.log(`Configured marketplaces:
|
|
4
|
-
`),r.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&&E(!0);try{await S(e),_(),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&&E(!0);try{if(e)console.log(`Updating marketplace: ${e}...`),await s(e,e=>{console.log(e)}),_(),M(`tengu_marketplace_updated`,{marketplace_name:e}),F(`${t.tick} Successfully updated marketplace: ${e}`);else{let e=await c(),n=Object.keys(e);n.length===0&&F(`No marketplaces configured`),console.log(`Updating ${n.length} marketplace(s)...`),await f(),_(),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&&E(!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}=b(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&&E(!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}=b(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&&E(!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}=b(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&&E(!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}=b(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&&E(!0);let{name:n,marketplace:r}=b(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 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./poorMode-DEwQOAJt.js";t();export{e as isPoorModeActive};
|