claude-code-best 2.8.0 → 2.8.1
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/README.md +3 -0
- package/dist/chunks/{AddWorkspaceDirectory-DRO4tbYd.js → AddWorkspaceDirectory-CNyPaerF.js} +1 -1
- package/dist/chunks/{App-DJyiiVKi.js → App-hiKxO6UA.js} +1 -1
- package/dist/chunks/{ApproveApiKey-DygOEAkM.js → ApproveApiKey-Cd43j9Wa.js} +1 -1
- package/dist/chunks/ApproveApiKey-DUoUTxFp.js +1 -0
- package/dist/chunks/{AssistantSessionChooser-C67mOxVi.js → AssistantSessionChooser-C8OxwSGM.js} +1 -1
- package/dist/chunks/{BackgroundTasksDialog-Bqk_Cn3j.js → BackgroundTasksDialog-VKhuyQLe.js} +2 -2
- package/dist/chunks/{BypassPermissionsModeDialog-C4z7RkFV.js → BypassPermissionsModeDialog-Ddjzluka.js} +1 -1
- package/dist/chunks/{ClaudeInChromeOnboarding-CyVFdjBe.js → ClaudeInChromeOnboarding-BhvrEJlm.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-COO2W0ij.js +1 -0
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-IpqqBuJs.js → ClaudeMdExternalIncludesDialog-DoNd72PS.js} +1 -1
- package/dist/chunks/ConsoleOAuthFlow-CPWq7O57.js +1 -0
- package/dist/chunks/{DesktopHandoff-CJpa8Xy-.js → DesktopHandoff-DVUOZjb0.js} +1 -1
- package/dist/chunks/{DevChannelsDialog-CfAuHVRL.js → DevChannelsDialog-DJbRHAIy.js} +1 -1
- package/dist/chunks/Dialog-91X6ZGg9.js +1 -0
- package/dist/chunks/{DiffDialog-CV3brWsG.js → DiffDialog-D0RK4t-9.js} +2 -2
- package/dist/chunks/{Doctor-D3GysagF.js → Doctor-0Nv3L1Oy.js} +1 -1
- package/dist/chunks/Doctor-Ba9zhV0V.js +1 -0
- package/dist/chunks/{ExitFlow-L2sh80sm.js → ExitFlow-BPbtGcEg.js} +1 -1
- package/dist/chunks/{Feedback-DfkBCvva.js → Feedback-BSagYjmf.js} +1 -1
- package/dist/chunks/{Grove-Bo74aZx-.js → Grove-BrP9JNpK.js} +1 -1
- package/dist/chunks/Grove-DyvIToPa.js +1 -0
- package/dist/chunks/{HybridTransport-BItIDJyC.js → HybridTransport-DLaxmXCR.js} +1 -1
- package/dist/chunks/{ITermBackend-3iS8Bvmo.js → ITermBackend-tXN55G2D.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-6lPGcuOX.js → InvalidConfigDialog-BzFQdfwu.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-D8DwHiys.js → InvalidSettingsDialog-KFg61s41.js} +1 -1
- package/dist/chunks/ListItem-DCQhApdJ.js +1 -0
- package/dist/chunks/{MCPConnectionManager-CsPizxTx.js → MCPConnectionManager-N-oJu3qn.js} +1 -1
- package/dist/chunks/{McpParsingWarnings-Cepe7RPZ.js → McpParsingWarnings-DsHSSgsx.js} +1 -1
- package/dist/chunks/{MessageSelector-BzUQUeDn.js → MessageSelector-D10JMnsc.js} +2 -2
- package/dist/chunks/Messages-CQdQJ2AA.js +11 -0
- package/dist/chunks/{Onboarding-BZUXID6q.js → Onboarding-DBJX6Cnf.js} +1 -1
- package/dist/chunks/{OverageCreditUpsell-Dhm7HBuD.js → OverageCreditUpsell-B4beCEX2.js} +1 -1
- package/dist/chunks/{PermissionDialog-BrRBxx5o.js → PermissionDialog-R-Vl4Tk-.js} +1 -1
- package/dist/chunks/{PluginSettings-BZ-PX9Tg.js → PluginSettings-BBrFCSpQ.js} +1 -1
- package/dist/chunks/{PressEnterToContinue-DtA_p3X6.js → PressEnterToContinue-BYdiZwYD.js} +1 -1
- package/dist/chunks/{PromptInputFooterSuggestions-Da8Fty6P.js → PromptInputFooterSuggestions-DAFZfAT0.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-Bz7EPzzq.js → PromptInputHelpMenu-Bjjr3tYl.js} +1 -1
- package/dist/chunks/{QueryEngine-CmJK27jU.js → QueryEngine-BSk8-8vB.js} +1 -1
- package/dist/chunks/{REPL-DxEJZpIp.js → REPL-CXcCBQuz.js} +13 -13
- package/dist/chunks/REPL-D-akKdFc.js +1 -0
- package/dist/chunks/{RemoteCallout-DONJj8l2.js → RemoteCallout-CuxqarhC.js} +1 -1
- package/dist/chunks/{RemoteSessionManager-BvvNspY8.js → RemoteSessionManager-BhPF41Wn.js} +1 -1
- package/dist/chunks/{ResumeConversation-EpjJdFHu.js → ResumeConversation-hmIOkZ2U.js} +1 -1
- package/dist/chunks/{SSETransport-D51Jfdaj.js → SSETransport-8yaTbdSK.js} +1 -1
- package/dist/chunks/SearchBox-Bu4gYF0J.js +1 -0
- package/dist/chunks/SearchExtraToolsTool-wDSdfnRo.js +1 -0
- package/dist/chunks/SentryErrorBoundary-Duyg6HeT.js +1 -0
- package/dist/chunks/{SentryErrorBoundary-nYTimi4l.js → SentryErrorBoundary-ydwbrVTx.js} +1 -1
- package/dist/chunks/{Settings-C2vEJjLx.js → Settings-BSbzT25q.js} +2 -2
- package/dist/chunks/{TeleportProgress--jgrqIfW.js → TeleportProgress-CNcl_DxR.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-BKDaFT_L.js → TeleportRepoMismatchDialog-DJc8_mjE.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-CxlpiHIz.js → TeleportResumeWrapper-Cw438s-J.js} +1 -1
- package/dist/chunks/{ThemePicker-CYL4C-F-.js → ThemePicker-8X6yAwuQ.js} +1 -1
- package/dist/chunks/{TmuxBackend-C_N4ww8i.js → TmuxBackend-CqAnVFoI.js} +1 -1
- package/dist/chunks/{TrustDialog-CYdftZ1M.js → TrustDialog-Ch1FJzxi.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-CaTwOP3f.js → ValidationErrorsList-sgfvJPWZ.js} +1 -1
- package/dist/chunks/{WelcomeV2-5rgKm4Mz.js → WelcomeV2-Bu8l3w90.js} +1 -1
- package/dist/chunks/{WindowsTerminalBackend-BzoSs0VA.js → WindowsTerminalBackend-Bvq7nHOp.js} +1 -1
- package/dist/chunks/{add-dir-RNzFR3XZ.js → add-dir-DqrRNnxe.js} +1 -1
- package/dist/chunks/{agentDisplay-DgeOQY1E.js → agentDisplay-DcxzWi1v.js} +1 -1
- package/dist/chunks/{agents-D7cgzb3f.js → agents-Do1ynqiW.js} +1 -1
- package/dist/chunks/{agents-iMtFurok.js → agents-QqLm1wcM.js} +1 -1
- package/dist/chunks/{ant-CF1iRpXD.js → ant-D5gD6O-r.js} +1 -1
- package/dist/chunks/api-VMfJpk1G.js +1 -0
- package/dist/chunks/{api-DMbWqJlK.js → api-hcsOinLV.js} +1 -1
- package/dist/chunks/{artifacts-D2kY_AMp.js → artifacts-DH8c2yG0.js} +1 -1
- package/dist/chunks/{assistant-JAqAZqaE.js → assistant-CemNvrYr.js} +1 -1
- package/dist/chunks/assistant-D7D1sqTB.js +1 -0
- package/dist/chunks/{assistant-CZ4VXgzH.js → assistant-DkECAILU.js} +1 -1
- package/dist/chunks/auth-CGdLe3rq.js +1 -0
- package/dist/chunks/{auth-BemPA3ot.js → auth-Dm8aWPRh.js} +1 -1
- package/dist/chunks/{autoMode-CGovMAzJ.js → autoMode-dygqoN_C.js} +1 -1
- package/dist/chunks/{autonomy-BVXyNEj0.js → autonomy-BdxnxJnk.js} +1 -1
- package/dist/chunks/{autonomy-BnAHLZWH.js → autonomy-DPeEmb00.js} +1 -1
- package/dist/chunks/{autonomyPanel-COMI2iR0.js → autonomyPanel-Bocl2taZ.js} +1 -1
- package/dist/chunks/backgroundHousekeeping-4H6yTjsj.js +1 -0
- package/dist/chunks/{backgroundHousekeeping-BRtG20l2.js → backgroundHousekeeping-zf-tDimg.js} +2 -2
- package/dist/chunks/{banner-D_rqe2XQ.js → banner-DUL-7A0b.js} +1 -1
- package/dist/chunks/{branch-BnKwIQtC.js → branch-DwdVgun5.js} +1 -1
- package/dist/chunks/{break-cache-CDzQDHwY.js → break-cache-DjCRzxDv.js} +1 -1
- package/dist/chunks/{bridge-ChVjEHVq.js → bridge-DkkMogD_.js} +2 -2
- package/dist/chunks/bridgeConfig-CTJBoASk.js +1 -0
- package/dist/chunks/{bridgeConfig-e0MGfed6.js → bridgeConfig-l6Ldi_hk.js} +1 -1
- package/dist/chunks/{bridgeEnabled-DR-v8AXw.js → bridgeEnabled-DYclTb9d.js} +1 -1
- package/dist/chunks/bridgeEnabled-SMuWz3Is.js +1 -0
- package/dist/chunks/{bridgeMain-OsR-_PRp.js → bridgeMain-Ct5oDosG.js} +11 -11
- package/dist/chunks/bridgeMain-UqwOi37W.js +1 -0
- package/dist/chunks/{bridgeMessaging-BvBnxgD4.js → bridgeMessaging-CYe1Cixl.js} +1 -1
- package/dist/chunks/{btw-_b16RGoh.js → btw-CyOlY5R-.js} +1 -1
- package/dist/chunks/{buddy-DJ3QSQyd.js → buddy-q-utA1_5.js} +1 -1
- package/dist/chunks/{bypassPermissionsKillswitch-OhGSWZrB.js → bypassPermissionsKillswitch-CTrRxzdz.js} +1 -1
- package/dist/chunks/{caches-Bp4F7tZ5.js → caches-Bz4yVQyE.js} +2 -2
- package/dist/chunks/caches-DKMoKTAZ.js +1 -0
- package/dist/chunks/{ccrClient-D7pEGzQa.js → ccrClient-DXiEw9xU.js} +1 -1
- package/dist/chunks/changeDetector--KPj2maX.js +1 -0
- package/dist/chunks/{channelNotification-BZFMAWln.js → channelNotification-CLPdvxGZ.js} +1 -1
- package/dist/chunks/channelNotification-fJgjqRMx.js +1 -0
- package/dist/chunks/{chrome-B5IxDA16.js → chrome-DxbhLWDW.js} +1 -1
- package/dist/chunks/clear-CYVCwiwu.js +1 -0
- package/dist/chunks/client-DvWRsIpi.js +1 -0
- package/dist/chunks/{color-BYVWpzI8.js → color-DiLtK8_L.js} +1 -1
- package/dist/chunks/commands-BT2_ICaW.js +1 -0
- package/dist/chunks/commitAttribution-Bpbro1a4.js +1 -0
- package/dist/chunks/{commitAttribution-ClSlXMPG.js → commitAttribution-CJXF8wMs.js} +1 -1
- package/dist/chunks/{compact-B9c12JXf.js → compact-C6xm1N5a.js} +1 -1
- package/dist/chunks/{companion-C8e7dVlu.js → companion-rXSt0nmz.js} +1 -1
- package/dist/chunks/completionCache-BQgiR45Q.js +1 -0
- package/dist/chunks/{completionCache-Br6OwASx.js → completionCache-C7hDqIDL.js} +1 -1
- package/dist/chunks/{config-C-yz-f4W.js → config-BE3jrcr-.js} +1 -1
- package/dist/chunks/{config-Bxgfx_nO.js → config-CzC08IjE.js} +1 -1
- package/dist/chunks/{context-Bf5t6C-a.js → context-BHE99SMA.js} +1 -1
- package/dist/chunks/context-noninteractive-BQDOgVUW.js +1 -0
- package/dist/chunks/{context-noninteractive-CJu7hZCM.js → context-noninteractive-BZQIUH_y.js} +13 -13
- package/dist/chunks/conversation-Bt6QdGd-.js +1 -0
- package/dist/chunks/{conversation-BYMS5Hqa.js → conversation-CBPRFDod.js} +1 -1
- package/dist/chunks/{copy-C0BZ7Gm0.js → copy-TgphIVzy.js} +1 -1
- package/dist/chunks/{createSSHSession-DNXCWneI.js → createSSHSession-CSKEZ4ic.js} +1 -1
- package/dist/chunks/createSession-BaHXBnfG.js +1 -0
- package/dist/chunks/{createSession-DjM6Ev45.js → createSession-Ce218tQj.js} +1 -1
- package/dist/chunks/{cronJitterConfig-CaFkPXKB.js → cronJitterConfig-CnKed5Gi.js} +1 -1
- package/dist/chunks/crossProjectResume-BFlsTYOq.js +40 -0
- package/dist/chunks/{datadog-ClZjR-jM.js → datadog-D5jSRybW.js} +1 -1
- package/dist/chunks/datadog-DgYqUGa-.js +1 -0
- package/dist/chunks/desktop-cjA0tGOa.js +1 -0
- package/dist/chunks/{diff-D9hjPq4W.js → diff-DMd61IjE.js} +1 -1
- package/dist/chunks/{doctor-4-im_J_h.js → doctor-ueUYyjyL.js} +1 -1
- package/dist/chunks/{effort-Bz-9GIpe.js → effort-B9IvAstG.js} +1 -1
- package/dist/chunks/entry-Bq_KRMWs.js +14 -0
- package/dist/chunks/{envLessBridgeConfig-DW4-nPbZ.js → envLessBridgeConfig-CpjlwmvF.js} +1 -1
- package/dist/chunks/envLessBridgeConfig-D_GCqhTu.js +1 -0
- package/dist/chunks/{exit-DBNDTR4b.js → exit-DtjFIrvJ.js} +1 -1
- package/dist/chunks/{export-CQHUM_Nv.js → export-CP638-TO.js} +1 -1
- package/dist/chunks/{exportRenderer-CuIDQBLH.js → exportRenderer-B5emJDvn.js} +1 -1
- package/dist/chunks/extra-usage-C4dUWLhg.js +1 -0
- package/dist/chunks/{extra-usage-DTr6gExD.js → extra-usage-DIm8nrKj.js} +1 -1
- package/dist/chunks/{extra-usage-core-D3CwYO_8.js → extra-usage-core-DERKSEe1.js} +1 -1
- package/dist/chunks/{extra-usage-noninteractive-d-QVg1D5.js → extra-usage-noninteractive-Dq5dog_-.js} +1 -1
- package/dist/chunks/{extraUsage-BNRQOkgU.js → extraUsage-BMvDY0Sk.js} +1 -1
- package/dist/chunks/extractMemories-DS7XXeEo.js +1 -0
- package/dist/chunks/{fast-bkGXbuHX.js → fast-BP2t1xDM.js} +1 -1
- package/dist/chunks/fast-D1xIHYaN.js +1 -0
- package/dist/chunks/{feedback-BvFgE_FF.js → feedback-C-mR6zJr.js} +1 -1
- package/dist/chunks/{firstPartyEventLogger-D-ifHvWu.js → firstPartyEventLogger-sMmHdYjg.js} +1 -1
- package/dist/chunks/{flushGate-BA24vFBg.js → flushGate-C18XwNsa.js} +1 -1
- package/dist/chunks/{fpsMetrics-CBFlAGTS.js → fpsMetrics-DH78PzGr.js} +1 -1
- package/dist/chunks/{gates-C66Nz9b2.js → gates-Be5r2kKS.js} +1 -1
- package/dist/chunks/gates-CUAwAhPL.js +1 -0
- package/dist/chunks/{gemini-DuQl4hTA.js → gemini-BberPcp1.js} +1 -1
- package/dist/chunks/{generateRecap-CwBU76xi.js → generateRecap-B76UcVUS.js} +1 -1
- package/dist/chunks/{generateSessionName-LnmjE9jh.js → generateSessionName-BwtXd8TC.js} +1 -1
- package/dist/chunks/{githubRepoPathMapping-DrreQj47.js → githubRepoPathMapping-5IlVgR2l.js} +1 -1
- package/dist/chunks/{goal-BIvjF6B7.js → goal-DQ0jNcLO.js} +1 -1
- package/dist/chunks/{grok-KNLYSRBQ.js → grok-Dh_thT2_.js} +1 -1
- package/dist/chunks/{growthbook-ksjGAskq.js → growthbook-4ADV3CAt.js} +1 -1
- package/dist/chunks/{heapdump-Cz8vkcOr.js → heapdump-Dwqmh4SX.js} +1 -1
- package/dist/chunks/{help-Cx9OordP.js → help-Bznaywoi.js} +1 -1
- package/dist/chunks/hooks-DynUngv2.js +1 -0
- package/dist/chunks/{hooks-BW-d9Bdu.js → hooks-F-82cg6M.js} +1 -1
- package/dist/chunks/{hostAdapter-DLmaB6eN.js → hostAdapter-DpfLr3hX.js} +1 -1
- package/dist/chunks/{ide-CECrIg1r.js → ide-BfAKWufQ.js} +1 -1
- package/dist/chunks/{inboundAttachments-B0sGIu79.js → inboundAttachments-CFV_eqMu.js} +1 -1
- package/dist/chunks/inboundAttachments-Cug-8Xdy.js +1 -0
- package/dist/chunks/{initReplBridge-BAEMZEcg.js → initReplBridge-DV9KhSic.js} +1 -1
- package/dist/chunks/{insights-DeWggLxC.js → insights-BNsCwNYa.js} +1 -1
- package/dist/chunks/{install-pxH_HR1p.js → install-Bszzs98N.js} +1 -1
- package/dist/chunks/{install-github-app-DqKEiHQ1.js → install-github-app-DVxGR2rp.js} +1 -1
- package/dist/chunks/{install-slack-app-P1L9x-YI.js → install-slack-app-CjlRL19o.js} +1 -1
- package/dist/chunks/{instrumentation-Dx0s2jzr.js → instrumentation-BOYPOtyu.js} +3 -3
- package/dist/chunks/{job-CbxxkPgE.js → job-BvD5_lGz.js} +1 -1
- package/dist/chunks/{keybindings-BBPC7FAc.js → keybindings-RPmPPGhp.js} +1 -1
- package/dist/chunks/{lang-CKp0Tn76.js → lang-9VNaOJMz.js} +1 -1
- package/dist/chunks/language-CjFs6_la.js +1 -0
- package/dist/chunks/{language-iERMuOEu.js → language-Ct5Nkqm6.js} +1 -1
- package/dist/chunks/{launchAgentsPlatform-DQvKVtl2.js → launchAgentsPlatform-CnoxFIXV.js} +1 -1
- package/dist/chunks/{launchAutofixPr-B7hu9C8h.js → launchAutofixPr-ChaDUtvx.js} +1 -1
- package/dist/chunks/{launchCommand-CJsikSlW.js → launchCommand-9eYsPG7W.js} +1 -1
- package/dist/chunks/{launchLocalMemory-Cpz7L5j5.js → launchLocalMemory-MwZfEJxz.js} +1 -1
- package/dist/chunks/{launchLocalVault-XLfOQtP7.js → launchLocalVault-B6Ib5WXx.js} +1 -1
- package/dist/chunks/{launchMemoryStores-Cz04PaDE.js → launchMemoryStores-D6xyGwQ1.js} +1 -1
- package/dist/chunks/{launchOnboarding-XPbUNdHS.js → launchOnboarding-BtdAOO3p.js} +1 -1
- package/dist/chunks/{launchSchedule-B1VEe3o-.js → launchSchedule-XVljzNKg.js} +1 -1
- package/dist/chunks/{launchSkillStore-Cy59z5xx.js → launchSkillStore-QT8Qcc5N.js} +1 -1
- package/dist/chunks/{launchTeleport-ZPM_DvzK.js → launchTeleport-DwxPesKQ.js} +1 -1
- package/dist/chunks/{launchVault-BhnTOZq8.js → launchVault-Dbti6pph.js} +1 -1
- package/dist/chunks/{loadAgentsDir-CQF8qhne.js → loadAgentsDir-BYWykYwn.js} +777 -777
- package/dist/chunks/loadAgentsDir-tPgCg0WD.js +1 -0
- package/dist/chunks/{loadPluginHooks-TyULD8KH.js → loadPluginHooks-2U3UO__Q.js} +1 -1
- package/dist/chunks/localSearch-CxwxzM8W.js +1 -0
- package/dist/chunks/{localSearch-BNYypHsK.js → localSearch-eWjZxMc8.js} +1 -1
- package/dist/chunks/login-CVVFklZw.js +1 -0
- package/dist/chunks/{login-CxbcJk9_.js → login-D1aQCqp0.js} +1 -1
- package/dist/chunks/{logoV2Utils-Br_w1z39.js → logoV2Utils-CPNvLtol.js} +1 -1
- package/dist/chunks/logout-BYsszpXx.js +1 -0
- package/dist/chunks/{magicDocs-DnxdS9yV.js → magicDocs-DAvjAbAJ.js} +1 -1
- package/dist/chunks/{main-FBmdv32j.js → main-BKlQiSuc.js} +31 -31
- package/dist/chunks/{mappers-BNI_df3v.js → mappers-BBkM1aA5.js} +1 -1
- package/dist/chunks/{mcp-esqdO_lV.js → mcp-C3jlClk0.js} +3 -3
- package/dist/chunks/{mcp-BhAGhDQE.js → mcp-Cmw8ecKk.js} +1 -1
- package/dist/chunks/{mcp-DbqUZ1Cf.js → mcp-ya96irNP.js} +1 -1
- package/dist/chunks/{mcpServer-DeL2ADSF.js → mcpServer-B1q9blAc.js} +1 -1
- package/dist/chunks/{mcpServer-Ct-GVL-y.js → mcpServer-BJB5g6j2.js} +1 -1
- package/dist/chunks/{memory-DwapBEsD.js → memory-CxiukAGg.js} +1 -1
- package/dist/chunks/{mobile-D7MSmMhc.js → mobile-DLGq6g08.js} +1 -1
- package/dist/chunks/{modalContext-DxfeT_3m.js → modalContext-CuTwi_eD.js} +1 -1
- package/dist/chunks/{mode-B5cmHCvz.js → mode-DqAJ2y6R.js} +1 -1
- package/dist/chunks/{model-BePO0VaC.js → model-C8TW-qjl.js} +1 -1
- package/dist/chunks/model-VB4ItNVB.js +1 -0
- package/dist/chunks/{onChangeAppState-B3d5iy6T.js → onChangeAppState-BG1pF7ht.js} +1 -1
- package/dist/chunks/{openai-fRhGOIQq.js → openai-CHoRhRtf.js} +1 -1
- package/dist/chunks/{overageCreditGrant-B6sx7IFi.js → overageCreditGrant-DYMg1lV4.js} +1 -1
- package/dist/chunks/{panel-CAVG5BOM.js → panel-BY6q16am.js} +1 -1
- package/dist/chunks/{panel-DU8y_jcf.js → panel-BdRBXAv3.js} +1 -1
- package/dist/chunks/panelCall-SYrmrKt9.js +1 -0
- package/dist/chunks/{passes-CWPPUigp.js → passes-CSV-SZJc.js} +1 -1
- package/dist/chunks/{paths-4ZWdjPP4.js → paths-BZjPDxMm.js} +3 -3
- package/dist/chunks/{permissions-DW8CRuJp.js → permissions-DBddT2NP.js} +1 -1
- package/dist/chunks/{pipeTransport-CUeYRWJn.js → pipeTransport-uK7GxbSG.js} +1 -1
- package/dist/chunks/{plan-Cf-tHvGq.js → plan-DEbo-Adi.js} +1 -1
- package/dist/chunks/plugin-Cops24hg.js +1 -0
- package/dist/chunks/{pluginAutoupdate-CdmKzIRf.js → pluginAutoupdate-Bg7JMOHN.js} +1 -1
- package/dist/chunks/{pluginBlocklist-C9XwbFSo.js → pluginBlocklist-DEM_RWc2.js} +1 -1
- package/dist/chunks/{pluginCliCommands-CmY_maYg.js → pluginCliCommands-DyYEg7Cv.js} +1 -1
- package/dist/chunks/{pluginFlagging-DyzxZolj.js → pluginFlagging-DwChUZMJ.js} +1 -1
- package/dist/chunks/{pluginOperations-mr4I7Jw9.js → pluginOperations-COyT4tHs.js} +1 -1
- package/dist/chunks/{pluginStartupCheck-B6OdK29Z.js → pluginStartupCheck-DCxJJkYs.js} +1 -1
- package/dist/chunks/pluginStartupCheck-DjfIaOch.js +1 -0
- package/dist/chunks/{plugins-rdPgpjF8.js → plugins-BanQjHmw.js} +1 -1
- package/dist/chunks/policyLimits-D-Y_soHx.js +1 -0
- package/dist/chunks/{pollConfig-DLbuHBse.js → pollConfig-DBNHhvHf.js} +1 -1
- package/dist/chunks/{poor-pmz2b7zu.js → poor-aPQce502.js} +1 -1
- package/dist/chunks/{poorMode-DD-q_w6Z.js → poorMode-CFRuV-nB.js} +1 -1
- package/dist/chunks/poorMode-DQagHYWe.js +1 -0
- package/dist/chunks/{print-luaON-Cg.js → print-Cf2tY__0.js} +4 -4
- package/dist/chunks/{privacy-settings-BpigC4oX.js → privacy-settings-CYkM3Aem.js} +1 -1
- package/dist/chunks/{processBashCommand-f_84bSlP.js → processBashCommand-BLSC8o8M.js} +1 -1
- package/dist/chunks/{processSlashCommand-BkBqV3Jd.js → processSlashCommand-Ch9B-6nh.js} +1 -1
- package/dist/chunks/projectContext-2CzYVggO.js +1 -0
- package/dist/chunks/projectContext-CVk2Ix1r.js +1 -0
- package/dist/chunks/{prompt-CogZQuTN.js → prompt-BGNhFY1n.js} +1 -1
- package/dist/chunks/prompt-CrNwH5kr.js +1 -0
- package/dist/chunks/prompt-dH0MMivt.js +1 -0
- package/dist/chunks/{promptEditor-C___2FFs.js → promptEditor-U03qQWbq.js} +1 -1
- package/dist/chunks/{protocolHandler-qwll5gSY.js → protocolHandler-3yBj9w5N.js} +1 -1
- package/dist/chunks/{rate-limit-options-nQcTipEp.js → rate-limit-options-D-xl_9PO.js} +1 -1
- package/dist/chunks/{rcDebugLog-DOXxIr8l.js → rcDebugLog-ClX1msJX.js} +1 -1
- package/dist/chunks/{referral-CMPZjf3I.js → referral-qe-yqXJE.js} +1 -1
- package/dist/chunks/{refresh-CP7Dnjp4.js → refresh-CO_P3WKA.js} +1 -1
- package/dist/chunks/{registerProtocol-DCNuqdCC.js → registerProtocol-CClQph00.js} +1 -1
- package/dist/chunks/{registry-DLqZJleQ.js → registry-C0zdU2Hb.js} +1 -1
- package/dist/chunks/{release-notes-BsDW6T9f.js → release-notes-CyZHxWTF.js} +1 -1
- package/dist/chunks/{releaseNotes-Tbd018Qz.js → releaseNotes-BtxL5R5Q.js} +2 -2
- package/dist/chunks/{reload-plugins-iG9ZE9wF.js → reload-plugins-B0eR8JHH.js} +1 -1
- package/dist/chunks/{remote-env-BFntnltf.js → remote-env-B_sIjY87.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-Dpko9c-J.js → remoteBridgeCore-C3WRaLpU.js} +1 -1
- package/dist/chunks/{remoteControlServer-D3P82kVF.js → remoteControlServer-BOj9qmgH.js} +1 -1
- package/dist/chunks/{rename-Codm2nfB.js → rename-BFAC3WLD.js} +1 -1
- package/dist/chunks/{resume-BB1ceL_x.js → resume-CpivBr9S.js} +1 -1
- package/dist/chunks/{runtimeObserver-BpRn0RiL.js → runtimeObserver-C2_7Vsnd.js} +1 -1
- package/dist/chunks/{runtimeObserver-D6aF77Dq.js → runtimeObserver-sOnfVR7t.js} +2 -2
- package/dist/chunks/sandbox-adapter-jX_WzvnK.js +1 -0
- package/dist/chunks/{sandbox-toggle-DZ-8qXDS.js → sandbox-toggle-Bv68-Ca7.js} +1 -1
- package/dist/chunks/searchExtraTools-xPuOKDpi.js +1 -0
- package/dist/chunks/{sentry-CVdHlmNQ.js → sentry-BBCn6RGP.js} +1 -1
- package/dist/chunks/{session-B4j1ViVc.js → session-DfvxYP8o.js} +1 -1
- package/dist/chunks/{sessionDiscovery-DkIIFsWX.js → sessionDiscovery-CyuRBTAm.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-DiKsr7H7.js +1 -0
- package/dist/chunks/sessionMemory-C34-eFnJ.js +1 -0
- package/dist/chunks/{sessionMemory-CnT3-Mj7.js → sessionMemory-kYQnpcyG.js} +1 -1
- package/dist/chunks/sessionMemoryUtils-CcJcgftx.js +1 -0
- package/dist/chunks/sessionObserver-B73s6yu8.js +1 -0
- package/dist/chunks/{sessionObserver-gjdJ91cv.js → sessionObserver-CTkIYplM.js} +1 -1
- package/dist/chunks/sessionStorage-BHi7PKs-.js +1 -0
- package/dist/chunks/{sessionTitle-CSU5-VK9.js → sessionTitle-ePQRpeV2.js} +1 -1
- package/dist/chunks/{sessionTracing-BDN64fWh.js → sessionTracing-81-RIJBo.js} +1 -1
- package/dist/chunks/{settingsSync-Nixbcaox.js → settingsSync-DEFWnE1o.js} +1 -1
- package/dist/chunks/{setup-CZxLEcQh.js → setup-2611vmGJ.js} +1 -1
- package/dist/chunks/{setup-n3Ixr_gs.js → setup-BJSk1czd.js} +2 -2
- package/dist/chunks/{setup-9nXlu56r.js → setup-CTfYsKsz.js} +1 -1
- package/dist/chunks/{shadowedRuleDetection-CCS7R7F1.js → shadowedRuleDetection-CGD7Nx03.js} +1 -1
- package/dist/chunks/{sideQuestion-MzExGTvn.js → sideQuestion-BcP9Mm-5.js} +1 -1
- package/dist/chunks/{sink-BL75jACh.js → sink-D_t1TIt9.js} +1 -1
- package/dist/chunks/sink-i8NmYch9.js +1 -0
- package/dist/chunks/sinks-3w0mLszx.js +1 -0
- package/dist/chunks/{sinks-C-gxj_Eu.js → sinks-DXsozhmS.js} +2 -2
- package/dist/chunks/{skill-learning-B9Msm4jG.js → skill-learning-CZm2iMik.js} +2 -2
- package/dist/chunks/{skillChangeDetector-DlWPJTny.js → skillChangeDetector-1aFn40GC.js} +1 -1
- package/dist/chunks/{skillGapStore-Cpmbwyo3.js → skillGapStore-DzHv8v-D.js} +1 -1
- package/dist/chunks/{skillGapStore-CsADiV5a.js → skillGapStore-cWo6Ra90.js} +2 -2
- package/dist/chunks/{skillGenerator-_khb-Gmc.js → skillGenerator-D_W1IeP3.js} +2 -2
- package/dist/chunks/skillLearning-Bddmbx8E.js +1 -0
- package/dist/chunks/skillLearning-C-uI_jZB.js +1 -0
- package/dist/chunks/{skillPanel-DQmj3Yh1.js → skillPanel-ChmOZu4F.js} +3 -3
- package/dist/chunks/{skillSearchPanel-6w_zzoI3.js → skillSearchPanel-CVx2b4Pr.js} +2 -2
- package/dist/chunks/{skills-B3LN9tp9.js → skills-CWX1SydA.js} +1 -1
- package/dist/chunks/{sprites-8JVWnXzp.js → sprites-BuvEFwW6.js} +1 -1
- package/dist/chunks/{src-KjMLauwe.js → src-Di342QoJ.js} +1 -1
- package/dist/chunks/{src-BJM0zMNO.js → src-poaoYkuc.js} +1 -1
- package/dist/chunks/startupProfiler-CBcN1Chw.js +3 -0
- package/dist/chunks/startupProfiler-DtTgsdnI.js +1 -0
- package/dist/chunks/{staticRender-DboURbK0.js → staticRender-DKFIRhkH.js} +1 -1
- package/dist/chunks/{stats-BDlygx5X.js → stats-wjMQA-CA.js} +1 -1
- package/dist/chunks/status-CyU7IQhO.js +1 -0
- package/dist/chunks/{statusNoticeHelpers-Cd_LDPvn.js → statusNoticeHelpers-JNibsI_v.js} +1 -1
- package/dist/chunks/{tag-BLPgXlQZ.js → tag-opEEZI5B.js} +1 -1
- package/dist/chunks/tasks-CCtnU5u1.js +1 -0
- package/dist/chunks/{teamHelpers-B-poMJeE.js → teamHelpers-BJJs8taN.js} +1 -1
- package/dist/chunks/teamHelpers-D41zdxpl.js +1 -0
- package/dist/chunks/{teammateModeSnapshot-B1_3D1CQ.js → teammateModeSnapshot-CLiiOCkO.js} +1 -1
- package/dist/chunks/teammateModeSnapshot-q-bARbLL.js +1 -0
- package/dist/chunks/{teleport-CSo3PT05.js → teleport-ClxQigSQ.js} +1 -1
- package/dist/chunks/{templateJobs-BVebX2BK.js → templateJobs-C6D7GC-Q.js} +1 -1
- package/dist/chunks/{terminalSetup-DHWL0gnz.js → terminalSetup-2ioFcRAA.js} +1 -1
- package/dist/chunks/{terminalSetup-DZTEKKne.js → terminalSetup-B3bN4Cj8.js} +1 -1
- package/dist/chunks/{theme-BHQSNwSe.js → theme-Dgq_Og2P.js} +1 -1
- package/dist/chunks/thinkback-BE8NNmAo.js +1 -0
- package/dist/chunks/{thinkback-DOzxcgMy.js → thinkback-C43WBHis.js} +1 -1
- package/dist/chunks/{thinkback-play-CK1C_F7G.js → thinkback-play-D2_n_aoQ.js} +1 -1
- package/dist/chunks/{toolEventObserver-BIjUIh4k.js → toolEventObserver-B7EA-nNa.js} +1 -1
- package/dist/chunks/{toolEventObserver-XPorjjtG.js → toolEventObserver-BG_3sGCL.js} +1 -1
- package/dist/chunks/toolPool-BLshLuvo.js +1 -0
- package/dist/chunks/{toolPool-hQlvQn-j.js → toolPool-HYKCHxDA.js} +1 -1
- package/dist/chunks/{trustedDevice-D-L5uAor.js → trustedDevice-DeNxe6bl.js} +1 -1
- package/dist/chunks/{trustedDevice-CyfQd_GU.js → trustedDevice-S34i6Jc9.js} +1 -1
- package/dist/chunks/{tui-C7aBeORE.js → tui-DcXIK0fP.js} +1 -1
- package/dist/chunks/{ultrareviewCommand-rnMsUWTn.js → ultrareviewCommand-C45bmZqN.js} +1 -1
- package/dist/chunks/undercover-B4sdXe12.js +1 -0
- package/dist/chunks/{undercover-ClLYK52H.js → undercover-DoUSM8d6.js} +1 -1
- package/dist/chunks/{updateCCB-pqkACWbs.js → updateCCB-BuAm25MX.js} +1 -1
- package/dist/chunks/{upgrade-DpfZlPyC.js → upgrade-BDKg286g.js} +1 -1
- package/dist/chunks/upgrade-BiWGhm2d.js +1 -0
- package/dist/chunks/{upload-D98tqZnO.js → upload-CMptZXZs.js} +1 -1
- package/dist/chunks/{usage-CRquq5_O.js → usage-Bw_LK9YI.js} +1 -1
- package/dist/chunks/{usage-BWd5R6DU.js → usage-DEWsKPXj.js} +1 -1
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-Dkcp6EkA.js → useExitOnCtrlCDWithKeybindings-BHi41Ku_.js} +1 -1
- package/dist/chunks/useKeybinding-DPOUuymz.js +1 -0
- package/dist/chunks/useMainLoopModel-D0PmGDuy.js +1 -0
- package/dist/chunks/{useManagePlugins-DMY74XAk.js → useManagePlugins-B-ejJsXy.js} +1 -1
- package/dist/chunks/{useMergedTools-NN58Kguw.js → useMergedTools-B6x9qtfj.js} +1 -1
- package/dist/chunks/{useSearchInput-CodP_5SB.js → useSearchInput-BpMLsxaS.js} +1 -1
- package/dist/chunks/{useSettingsErrors-BRxaYl6B.js → useSettingsErrors-DUe4k_RK.js} +1 -1
- package/dist/chunks/useTerminalSize-Du-EamDN.js +1 -0
- package/dist/chunks/{useVoice-ByU-q_w4.js → useVoice-C3ryR2HE.js} +1 -1
- package/dist/chunks/{util-SpgBY5_I.js → util-DWl5gjmI.js} +1 -1
- package/dist/chunks/utils-DP3EtI6F.js +1 -0
- package/dist/chunks/{validatePlugin-CxCXNV8o.js → validatePlugin-8EMSASvV.js} +1 -1
- package/dist/chunks/{vim-ByXlYzf9.js → vim-CaZ20SrQ.js} +1 -1
- package/dist/chunks/{voice-BnLS_SdQ.js → voice-BrnKguEV.js} +1 -1
- package/dist/chunks/{voiceModeEnabled-D070o6QK.js → voiceModeEnabled-3eg8vSqy.js} +1 -1
- package/dist/chunks/voiceModeEnabled-B1ARFTcz.js +1 -0
- package/dist/chunks/voiceStreamSTT-CONK4g-B.js +1 -0
- package/dist/chunks/{voiceStreamSTT-vkQ-Aop7.js → voiceStreamSTT-D7jWIYwz.js} +1 -1
- package/dist/chunks/{web-tools-1yM0ZBfA.js → web-tools-BT3TbzG5.js} +1 -1
- package/dist/chunks/{workerRegistry-7xGv_sNB.js → workerRegistry-C_i5wwjL.js} +1 -1
- package/dist/chunks/worktree-CFNQKVGn.js +1 -0
- package/dist/chunks/{xml-BUaEXGXx.js → xml-DOXio8vw.js} +1 -1
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/ApproveApiKey-oTZKoMvB.js +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-5FCT81WS.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-BmGziW64.js +0 -1
- package/dist/chunks/Dialog-C8eGKH-e.js +0 -1
- package/dist/chunks/Doctor-DohPtIKu.js +0 -1
- package/dist/chunks/Grove-C_ocvHd3.js +0 -1
- package/dist/chunks/ListItem-DDMe4CJ3.js +0 -1
- package/dist/chunks/Messages-KmeXIJqL.js +0 -11
- package/dist/chunks/REPL-BBmn_itf.js +0 -1
- package/dist/chunks/SearchBox-CciJ8giD.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-kjVFsFkT.js +0 -1
- package/dist/chunks/SentryErrorBoundary-DsrmgmKF.js +0 -1
- package/dist/chunks/api-DkgaFAzq.js +0 -1
- package/dist/chunks/assistant-CiNV3Q0f.js +0 -1
- package/dist/chunks/auth-CbQCc9vz.js +0 -1
- package/dist/chunks/backgroundHousekeeping-LYpOamcN.js +0 -1
- package/dist/chunks/bridgeConfig-Budgp2Go.js +0 -1
- package/dist/chunks/bridgeEnabled-DmvmwuUY.js +0 -1
- package/dist/chunks/bridgeMain-KYR5iq6H.js +0 -1
- package/dist/chunks/caches-CkH9F-Fd.js +0 -1
- package/dist/chunks/ccshareResume-DPP1blaU.js +0 -1
- package/dist/chunks/changeDetector-IFbty4jj.js +0 -1
- package/dist/chunks/channelNotification-CIyWY0hs.js +0 -1
- package/dist/chunks/clear-BVjSQsUL.js +0 -1
- package/dist/chunks/client-BUUsZdSe.js +0 -1
- package/dist/chunks/commands-pTQdOvN6.js +0 -1
- package/dist/chunks/commitAttribution-QPrKt_BF.js +0 -1
- package/dist/chunks/completionCache-BB7-y2BX.js +0 -1
- package/dist/chunks/context-noninteractive-OUTZ6BKj.js +0 -1
- package/dist/chunks/conversation-Bs8l0KNl.js +0 -1
- package/dist/chunks/createSession-DpqtD4ML.js +0 -1
- package/dist/chunks/crossProjectResume-BCr6jfGz.js +0 -40
- package/dist/chunks/datadog-DlzPb5oG.js +0 -1
- package/dist/chunks/desktop-WH8s-9-6.js +0 -1
- package/dist/chunks/entry-CEBaLwEG.js +0 -14
- package/dist/chunks/envLessBridgeConfig-izoVnE8s.js +0 -1
- package/dist/chunks/extra-usage-VSASGlte.js +0 -1
- package/dist/chunks/extractMemories-hQlhiVOD.js +0 -1
- package/dist/chunks/fast-2gWrhEFZ.js +0 -1
- package/dist/chunks/gates-dO6m4Hdp.js +0 -1
- package/dist/chunks/hooks-BWoN0nQP.js +0 -1
- package/dist/chunks/inboundAttachments-D8vq1NQO.js +0 -1
- package/dist/chunks/language-CSDpzbTz.js +0 -1
- package/dist/chunks/loadAgentsDir-B-4D2dVE.js +0 -1
- package/dist/chunks/localSearch-DsFH9yls.js +0 -1
- package/dist/chunks/login-CEJEl2mW.js +0 -1
- package/dist/chunks/logout-BXr4jzNY.js +0 -1
- package/dist/chunks/model-CgH43-hO.js +0 -1
- package/dist/chunks/panelCall-DUQdjDee.js +0 -1
- package/dist/chunks/plugin-DXhCgoNC.js +0 -1
- package/dist/chunks/pluginStartupCheck-BFuZqpnX.js +0 -1
- package/dist/chunks/policyLimits-B3dtp_Fe.js +0 -1
- package/dist/chunks/poorMode-BPIUnFFi.js +0 -1
- package/dist/chunks/projectContext-2Z2w8AI8.js +0 -1
- package/dist/chunks/projectContext-fS1t-xRh.js +0 -1
- package/dist/chunks/prompt-CriAIdkT.js +0 -1
- package/dist/chunks/prompt-TGc_H1cL.js +0 -1
- package/dist/chunks/sandbox-adapter-DrHD1mch.js +0 -1
- package/dist/chunks/searchExtraTools-Dwg6ZafS.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-n7HcOfZ7.js +0 -1
- package/dist/chunks/sessionMemory-DVq43VXP.js +0 -1
- package/dist/chunks/sessionMemoryUtils-BjkdLRvh.js +0 -1
- package/dist/chunks/sessionObserver-CrfmnMzL.js +0 -1
- package/dist/chunks/sessionStorage-BTbr9wkZ.js +0 -1
- package/dist/chunks/sink-CoUVbLFs.js +0 -1
- package/dist/chunks/sinks-wuo1yQ_m.js +0 -1
- package/dist/chunks/skillLearning-CFnZiM5J.js +0 -1
- package/dist/chunks/skillLearning-D6mvGN90.js +0 -1
- package/dist/chunks/startupProfiler-BmnoJtfF.js +0 -1
- package/dist/chunks/startupProfiler-rCtNuhXz.js +0 -3
- package/dist/chunks/status-DlT1tUmc.js +0 -1
- package/dist/chunks/tasks-Bf1Nf3WX.js +0 -1
- package/dist/chunks/teamHelpers-DeQCfdgu.js +0 -1
- package/dist/chunks/teammateModeSnapshot-BRuKcJNr.js +0 -1
- package/dist/chunks/thinkback-CVYpxAyO.js +0 -1
- package/dist/chunks/toolPool-CDEeuQd2.js +0 -1
- package/dist/chunks/undercover-BviGW-bQ.js +0 -1
- package/dist/chunks/upgrade-DAuhXFVI.js +0 -1
- package/dist/chunks/useKeybinding-DOjEx42R.js +0 -1
- package/dist/chunks/useMainLoopModel-BZoZdEdj.js +0 -1
- package/dist/chunks/useTerminalSize-mqo2Swmk.js +0 -1
- package/dist/chunks/utils-CM5oEyAY.js +0 -1
- package/dist/chunks/voiceModeEnabled-B3njLfhA.js +0 -1
- package/dist/chunks/voiceStreamSTT-BkeyhhFJ.js +0 -1
- package/dist/chunks/worktree-UA9gKCwL.js +0 -1
- /package/dist/chunks/{chromeNativeHost-DfYuJafI.js → chromeNativeHost-BldB1Zzi.js} +0 -0
- /package/dist/chunks/{claudeDesktop-CEQCLZmG.js → claudeDesktop-BqTW_pbB.js} +0 -0
- /package/dist/chunks/{cleanup-DUVwlFl7.js → cleanup-rCLlo4w8.js} +0 -0
- /package/dist/chunks/{eventLoopStallDetector-MNrFR4OH.js → eventLoopStallDetector-bYy0fesH.js} +0 -0
- /package/dist/chunks/{postCommitAttribution-Br4g4R6h.js → postCommitAttribution-D8MoHFoz.js} +0 -0
- /package/dist/chunks/{sdkHeapDumpMonitor-DTHI5WbD.js → sdkHeapDumpMonitor-DLMMNeqo.js} +0 -0
- /package/dist/chunks/{sessionDataUploader-BgmJTXQr.js → sessionDataUploader-CsNePsOb.js} +0 -0
- /package/dist/chunks/{udsClient-B85rNglp.js → udsClient-CBF_cZFW.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{s as n,u as r}from"./envUtils-BWeoiL4Y.js";import{n as i,t as a}from"./figures-gfT9mM8P.js";import{Cn as o,F as s,Q as c,Rn as l,T as u,Ut as d,_ as f,b as p,f as m,g as h,h as g,n as _,nt as v,p as y,r as b,t as x,tn as ee,tt as te,v as S,x as C,xt as ne}from"./src-KjMLauwe.js";import{t as w}from"./jsx-runtime-D-D469L8.js";import{Jo as T,Qa as re,Qo as E,Yo as D,Zt as O,lo as ie,no as k,on as A,oo as j,ps as M,us as N,wc as ae,yc as oe}from"./paths-4ZWdjPP4.js";import{D as se,E as ce,J as P,U as F,l as le,p as ue,z as de}from"./debug-otxXY3j-.js";import{n as fe,r as I}from"./analytics-DqMQntaB.js";import{l as pe,u as me}from"./oauth-CdZEzMww.js";import{c as he,o as ge,s as _e}from"./log-DSV4Ht5l.js";import{b as ve,x as ye}from"./teammate-CbskW5G9.js";import{E as be,S as xe}from"./startupProfiler-rCtNuhXz.js";import{l as Se,n as Ce,o as we}from"./stringUtils-KZoO4GUd.js";import{$C as Te,$s as Ee,AA as De,DA as Oe,DC as L,EC as R,Fs as z,Is as ke,JC as Ae,Js as je,Jx as Me,Ky as Ne,Ms as Pe,Oh as Fe,Ow as Ie,Rs as Le,Rw as Re,Ry as ze,Sw as Be,Ts as Ve,Tw as He,Vs as Ue,Vw as We,Ws as Ge,Wy as Ke,Zs as qe,aS as Je,aT as Ye,ac as Xe,bw as Ze,cT as Qe,cc as $e,cj as et,dS as tt,dT as nt,dc as rt,eT as it,ew as at,fC as ot,fS as st,fT as ct,gc as lt,gw as ut,hc as dt,iT as ft,jA as pt,kh as mt,lC as ht,lT as gt,lc as _t,nc as vt,nw as yt,oT as bt,oc as xt,pc as St,qs as Ct,sT as wt,sc as Tt,sj as Et,tS as Dt,tT as Ot,tc as kt,tj as At,uC as jt,uT as Mt,uc as Nt,vs as Pt,ws as Ft,ww as It,ys as Lt,yw as Rt}from"./loadAgentsDir-CQF8qhne.js";import{i as zt,o as Bt,p as Vt,u as Ht}from"./xml-BUaEXGXx.js";import{n as Ut,t as Wt}from"./browser-Bt-ckCaU.js";import{t as Gt}from"./useKeybinding-DOjEx42R.js";import{t as Kt}from"./useTerminalSize-mqo2Swmk.js";import{n as qt,t as Jt}from"./useExitOnCtrlCDWithKeybindings-Dkcp6EkA.js";import{n as Yt,t as Xt}from"./pluginStartupCheck-B6OdK29Z.js";import{a as Zt,d as Qt,f as $t,i as en,l as tn,o as nn,s as rn,u as an}from"./pluginOperations-mr4I7Jw9.js";import{a as on,c as sn,i as cn,n as ln,o as un,s as dn,t as fn}from"./validatePlugin-CxCXNV8o.js";import{a as pn,n as mn,o as hn,r as gn}from"./pluginFlagging-DyzxZolj.js";import{i as _n,n as vn,r as yn}from"./MCPConnectionManager-CsPizxTx.js";import{t as bn}from"./SearchBox-CciJ8giD.js";import{n as xn,t as Sn}from"./useSearchInput-CodP_5SB.js";import{i as Cn,n as wn}from"./pluginAutoupdate-CdmKzIRf.js";import*as Tn from"path";import*as En from"fs/promises";function Dn({serverToolsCount:e,serverPromptsCount:t,serverResourcesCount:n}){let r=[];return e>0&&r.push(`tools`),n>0&&r.push(`resources`),t>0&&r.push(`prompts`),(0,On.jsxs)(C,{children:[(0,On.jsx)(p,{bold:!0,children:`Capabilities: `}),(0,On.jsx)(p,{color:`text`,children:r.length>0?(0,On.jsx)(g,{children:r}):`none`})]})}var On,kn=e((()=>{l(),x(),On=w()}));function An(e,t){switch(e.client.type){case`connected`:return{message:`Reconnected to ${t}.`,success:!0};case`needs-auth`:return{message:`${t} requires authentication. Use the 'Authenticate' option.`,success:!1};case`failed`:return{message:`Failed to reconnect to ${t}.`,success:!1};default:return{message:`Unknown result when reconnecting to ${t}.`,success:!1}}}function jn(e,t){return`Error reconnecting to ${t}: ${e instanceof Error?e.message:String(e)}`}var Mn=e((()=>{}));function Nn({server:e,serverToolsCount:t,onViewTools:n,onCancel:r,onComplete:i,borderless:o=!1}){let[l]=u(),d=qt(),{columns:f}=s(),[m,_]=B.useState(!1),[v,y]=B.useState(null),b=jt(e=>e.mcp),x=ot(),[w,T]=B.useState(null),[re,E]=(0,B.useState)(!1),D=(0,B.useRef)(null),[ie,k]=(0,B.useState)(!1),[A,j]=(0,B.useState)(null),[M,N]=(0,B.useState)(!1),[ae,oe]=(0,B.useState)(null),[se,ce]=(0,B.useState)(!1),[P,F]=(0,B.useState)(!1),le=(0,B.useRef)(void 0),ue=(0,B.useRef)(!1),[fe,me]=(0,B.useState)(``),[ge,_e]=(0,B.useState)(0),[ve,ye]=(0,B.useState)(null);(0,B.useEffect)(()=>()=>{ue.current=!0,D.current?.abort(),le.current!==void 0&&clearTimeout(le.current)},[]);let be=e.isAuthenticated||e.client.type===`connected`&&t>0,xe=yn(),Se=B.useCallback(async()=>{k(!1),j(null),E(!0);try{let t=await xe(e.name),n=t.client.type===`connected`;I(`tengu_claudeai_mcp_auth_completed`,{success:n}),n?i?.(`Authentication successful. Connected to ${e.name}.`):t.client.type===`needs-auth`?i?.(`Authentication successful, but server still requires authentication. You may need to manually restart Claude Code.`):i?.(`Authentication successful, but server reconnection failed. You may need to manually restart Claude Code for the changes to take effect.`)}catch(t){I(`tengu_claudeai_mcp_auth_completed`,{success:!1}),i?.(jn(t,e.name))}finally{E(!1)}},[xe,e.name,i]),we=B.useCallback(async()=>{await Me(e.name,{...e.config,scope:e.scope}),x(t=>{let n=t.mcp.clients.map(t=>t.name===e.name?{...t,type:`needs-auth`}:t),r=Be(t.mcp.tools,e.name),i=Rt(t.mcp.commands,e.name),a=Ze(t.mcp.resources,e.name);return{...t,mcp:{...t.mcp,clients:n,tools:r,commands:i,resources:a}}}),I(`tengu_claudeai_mcp_clear_auth_completed`,{}),i?.(`Disconnected from ${e.name}.`),N(!1),oe(null),ce(!1)},[e.name,e.config,e.scope,x,i]);te(`confirm:no`,()=>{D.current?.abort(),D.current=null,_(!1),T(null)},{context:`Confirmation`,isActive:m}),te(`confirm:no`,()=>{k(!1),j(null)},{context:`Confirmation`,isActive:ie}),te(`confirm:no`,()=>{N(!1),oe(null),ce(!1)},{context:`Confirmation`,isActive:M}),ne((e,t)=>{if(t.return&&ie&&Se(),t.return&&M)if(se)we();else{let e=`${pe().CLAUDE_AI_ORIGIN}/settings/connectors`;oe(e),ce(!0),Ut(e)}if(e===`c`&&!P){let e=w||A||ae;e&&ee(e).then(e=>{ue.current||(e&&process.stdout.write(e),F(!0),le.current!==void 0&&clearTimeout(le.current),le.current=setTimeout(F,2e3,!1))})}});let Te=Ce(String(e.name)),Ee=It(b.commands,e.name).length,De=_n(),Oe=B.useCallback(async()=>{let t=pe().CLAUDE_AI_ORIGIN,n=O()?.organizationUuid,r;r=n&&e.config.type===`claudeai-proxy`&&e.config.id?`${t}/api/organizations/${n}/mcp/start-auth/${e.config.id.startsWith(`mcprs`)?`mcpsrv`+e.config.id.slice(5):e.config.id}?product_surface=${encodeURIComponent(process.env.CLAUDE_CODE_ENTRYPOINT||`cli`)}`:`${t}/settings/connectors`,j(r),k(!0),I(`tengu_claudeai_mcp_auth_started`,{}),await Ut(r)},[e.config]),L=B.useCallback(()=>{N(!0),I(`tengu_claudeai_mcp_clear_auth_started`,{})},[]),z=B.useCallback(async()=>{let t=e.client.type!==`disabled`;try{await De(e.name),e.config.type===`claudeai-proxy`&&I(`tengu_claudeai_mcp_toggle`,{new_state:t?`disabled`:`enabled`}),r()}catch(n){i?.(`Failed to ${t?`disable`:`enable`} MCP server '${e.name}': ${de(n)}`)}},[e.client.type,e.config.type,e.name,De,r,i]),ke=B.useCallback(async()=>{if(e.config.type===`claudeai-proxy`)return;_(!0),y(null);let t=new AbortController;D.current=t;try{if(e.isAuthenticated&&e.config&&await yt(e.name,e.config,{preserveStepUpState:!0}),e.config){await at(e.name,e.config,T,t.signal,{onWaitingForCallback:e=>{ye(()=>e)}}),I(`tengu_mcp_auth_config_authenticate`,{wasAuthenticated:e.isAuthenticated});let n=await xe(e.name);if(n.client.type===`connected`){let t=be?`Authentication successful. Reconnected to ${e.name}.`:`Authentication successful. Connected to ${e.name}.`;i?.(t)}else n.client.type===`needs-auth`?i?.(`Authentication successful, but server still requires authentication. You may need to manually restart Claude Code.`):(he(e.name,`Reconnection failed after authentication`),i?.(`Authentication successful, but server reconnection failed. You may need to manually restart Claude Code for the changes to take effect.`))}}catch(e){e instanceof Error&&!(e instanceof Ae)&&y(e.message)}finally{_(!1),D.current=null,ye(null),me(``)}},[e.isAuthenticated,e.config,e.name,i,xe,be]),je=async()=>{e.config.type!==`claudeai-proxy`&&e.config&&(await yt(e.name,e.config),I(`tengu_mcp_auth_config_clear`,{}),await Me(e.name,{...e.config,scope:e.scope}),x(t=>{let n=t.mcp.clients.map(t=>t.name===e.name?{...t,type:`failed`}:t),r=Be(t.mcp.tools,e.name),i=Rt(t.mcp.commands,e.name),a=Ze(t.mcp.resources,e.name);return{...t,mcp:{...t.mcp,clients:n,tools:r,commands:i,resources:a}}}),i?.(`Authentication cleared for ${e.name}.`))};if(m){let t=e.config.type!==`claudeai-proxy`&&e.config.oauth?.xaa?` Authenticating via your identity provider`:` A browser window will open for authentication`;return(0,V.jsxs)(C,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(p,{color:`claude`,children:[`Authenticating with `,e.name,`…`]}),(0,V.jsxs)(C,{children:[(0,V.jsx)(Ke,{}),(0,V.jsx)(p,{children:t})]}),w&&(0,V.jsxs)(C,{flexDirection:`column`,children:[(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL manually `}),P?(0,V.jsx)(p,{color:`success`,children:`(Copied!)`}):(0,V.jsx)(p,{dimColor:!0,children:(0,V.jsx)(h,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,V.jsx)(c,{url:w})]}),m&&w&&ve&&(0,V.jsxs)(C,{flexDirection:`column`,marginTop:1,children:[(0,V.jsx)(p,{dimColor:!0,children:`If the redirect page shows a connection error, paste the URL from your browser's address bar:`}),(0,V.jsxs)(C,{children:[(0,V.jsxs)(p,{dimColor:!0,children:[`URL `,`>`,` `]}),(0,V.jsx)(tt,{value:fe,onChange:me,onSubmit:e=>{ve(e.trim()),me(``)},cursorOffset:ge,onChangeCursorOffset:_e,columns:f-8})]})]}),(0,V.jsx)(C,{marginLeft:3,children:(0,V.jsx)(p,{dimColor:!0,children:`Return here after authenticating in your browser. Press Esc to go back.`})})]})}if(ie)return(0,V.jsxs)(C,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(p,{color:`claude`,children:[`Authenticating with `,e.name,`…`]}),(0,V.jsxs)(C,{children:[(0,V.jsx)(Ke,{}),(0,V.jsx)(p,{children:` A browser window will open for authentication`})]}),A&&(0,V.jsxs)(C,{flexDirection:`column`,children:[(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL manually `}),P?(0,V.jsx)(p,{color:`success`,children:`(Copied!)`}):(0,V.jsx)(p,{dimColor:!0,children:(0,V.jsx)(h,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,V.jsx)(c,{url:A})]}),(0,V.jsxs)(C,{marginLeft:3,flexDirection:`column`,children:[(0,V.jsxs)(p,{color:`permission`,children:[`Press `,(0,V.jsx)(p,{bold:!0,children:`Enter`}),` after authenticating in your browser.`]}),(0,V.jsx)(p,{dimColor:!0,italic:!0,children:(0,V.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})]})]});if(M)return(0,V.jsxs)(C,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(p,{color:`claude`,children:[`Clear authentication for `,e.name]}),se?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(p,{children:`Find the MCP server in the browser and click "Disconnect".`}),ae&&(0,V.jsxs)(C,{flexDirection:`column`,children:[(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{dimColor:!0,children:`If your browser didn't open automatically, copy this URL manually `}),P?(0,V.jsx)(p,{color:`success`,children:`(Copied!)`}):(0,V.jsx)(p,{dimColor:!0,children:(0,V.jsx)(h,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,V.jsx)(c,{url:ae})]}),(0,V.jsxs)(C,{marginLeft:3,flexDirection:`column`,children:[(0,V.jsxs)(p,{color:`permission`,children:[`Press `,(0,V.jsx)(p,{bold:!0,children:`Enter`}),` when done.`]}),(0,V.jsx)(p,{dimColor:!0,italic:!0,children:(0,V.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})]})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(p,{children:`This will open claude.ai in the browser. Find the MCP server in the list and click "Disconnect".`}),(0,V.jsxs)(C,{marginLeft:3,flexDirection:`column`,children:[(0,V.jsxs)(p,{color:`permission`,children:[`Press `,(0,V.jsx)(p,{bold:!0,children:`Enter`}),` to open the browser.`]}),(0,V.jsx)(p,{dimColor:!0,italic:!0,children:(0,V.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})]})]})]});if(re)return(0,V.jsxs)(C,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(p,{color:`text`,children:[`Connecting to `,(0,V.jsx)(p,{bold:!0,children:e.name}),`…`]}),(0,V.jsxs)(C,{children:[(0,V.jsx)(Ke,{}),(0,V.jsx)(p,{children:` Establishing connection to MCP server`})]}),(0,V.jsx)(p,{dimColor:!0,children:`This may take a few moments.`})]});let Ne=[];return e.client.type===`disabled`&&Ne.push({label:`Enable`,value:`toggle-enabled`}),e.client.type===`connected`&&t>0&&Ne.push({label:`View tools`,value:`tools`}),e.config.type===`claudeai-proxy`?e.client.type===`connected`?Ne.push({label:`Clear authentication`,value:`claudeai-clear-auth`}):e.client.type!==`disabled`&&Ne.push({label:`Authenticate`,value:`claudeai-auth`}):(be&&(Ne.push({label:`Re-authenticate`,value:`reauth`}),Ne.push({label:`Clear authentication`,value:`clear-auth`})),be||Ne.push({label:`Authenticate`,value:`auth`})),e.client.type!==`disabled`&&(e.client.type!==`needs-auth`&&Ne.push({label:`Reconnect`,value:`reconnectMcpServer`}),Ne.push({label:`Disable`,value:`toggle-enabled`})),Ne.length===0&&Ne.push({label:`Back`,value:`back`}),(0,V.jsxs)(C,{flexDirection:`column`,children:[(0,V.jsxs)(C,{flexDirection:`column`,paddingX:1,borderStyle:o?void 0:`round`,children:[(0,V.jsx)(C,{marginBottom:1,children:(0,V.jsxs)(p,{bold:!0,children:[Te,` MCP Server`]})}),(0,V.jsxs)(C,{flexDirection:`column`,gap:0,children:[(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{bold:!0,children:`Status: `}),e.client.type===`disabled`?(0,V.jsxs)(p,{children:[S(`inactive`,l)(a.radioOff),` disabled`]}):e.client.type===`connected`?(0,V.jsxs)(p,{children:[S(`success`,l)(a.tick),` connected`]}):e.client.type===`pending`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(p,{dimColor:!0,children:a.radioOff}),(0,V.jsx)(p,{children:` connecting…`})]}):e.client.type===`needs-auth`?(0,V.jsxs)(p,{children:[S(`warning`,l)(a.triangleUpOutline),` needs authentication`]}):(0,V.jsxs)(p,{children:[S(`error`,l)(a.cross),` failed`]})]}),e.transport!==`claudeai-proxy`&&(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{bold:!0,children:`Auth: `}),be?(0,V.jsxs)(p,{children:[S(`success`,l)(a.tick),` authenticated`]}):(0,V.jsxs)(p,{children:[S(`error`,l)(a.cross),` not authenticated`]})]}),(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{bold:!0,children:`URL: `}),(0,V.jsx)(p,{dimColor:!0,children:e.config.url})]}),(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{bold:!0,children:`Config location: `}),(0,V.jsx)(p,{dimColor:!0,children:ut(e.scope)})]}),e.client.type===`connected`&&(0,V.jsx)(Dn,{serverToolsCount:t,serverPromptsCount:Ee,serverResourcesCount:b.resources[e.name]?.length||0}),e.client.type===`connected`&&t>0&&(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{bold:!0,children:`Tools: `}),(0,V.jsxs)(p,{dimColor:!0,children:[t,` tools`]})]})]}),v&&(0,V.jsx)(C,{marginTop:1,children:(0,V.jsxs)(p,{color:`error`,children:[`Error: `,v]})}),Ne.length>0&&(0,V.jsx)(C,{marginTop:1,children:(0,V.jsx)(Je,{options:Ne,onChange:async t=>{switch(t){case`tools`:n();break;case`auth`:case`reauth`:await ke();break;case`clear-auth`:await je();break;case`claudeai-auth`:await Oe();break;case`claudeai-clear-auth`:L();break;case`reconnectMcpServer`:E(!0);try{let t=await xe(e.name);e.config.type===`claudeai-proxy`&&I(`tengu_claudeai_mcp_reconnect`,{success:t.client.type===`connected`});let{message:n}=An(t,e.name);i?.(n)}catch(t){e.config.type===`claudeai-proxy`&&I(`tengu_claudeai_mcp_reconnect`,{success:!1}),i?.(jn(t,e.name))}finally{E(!1)}break;case`toggle-enabled`:await z();break;case`back`:r();break}},onCancel:r})})]}),(0,V.jsx)(C,{marginTop:1,children:(0,V.jsx)(p,{dimColor:!0,italic:!0,children:d.pending?(0,V.jsxs)(V.Fragment,{children:[`Press `,d.keyName,` again to exit`]}):(0,V.jsxs)(g,{children:[(0,V.jsx)(h,{shortcut:`↑↓`,action:`navigate`}),(0,V.jsx)(h,{shortcut:`Enter`,action:`select`}),(0,V.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}var B,V,Pn=e((()=>{i(),B=t(l(),1),fe(),me(),Jt(),Kt(),x(),Gt(),Te(),Dt(),vn(),Ie(),ht(),A(),Wt(),F(),ge(),we(),L(),ze(),Ne(),st(),kn(),Mn(),V=w()}));function Fn({server:e,serverToolsCount:t,onViewTools:n,onCancel:r,onComplete:i,borderless:o=!1}){let[s]=u(),c=qt(),l=jt(e=>e.mcp),d=yn(),f=_n(),[m,_]=(0,In.useState)(!1),v=In.useCallback(async()=>{let t=e.client.type!==`disabled`;try{await f(e.name),r()}catch(n){i(`Failed to ${t?`disable`:`enable`} MCP server '${e.name}': ${de(n)}`)}},[e.client.type,e.name,f,r,i]),y=Ce(String(e.name)),b=It(l.commands,e.name).length,x=[];return e.client.type!==`disabled`&&t>0&&x.push({label:`View tools`,value:`tools`}),e.client.type!==`disabled`&&x.push({label:`Reconnect`,value:`reconnectMcpServer`}),x.push({label:e.client.type===`disabled`?`Enable`:`Disable`,value:`toggle-enabled`}),x.length===0&&x.push({label:`Back`,value:`back`}),m?(0,H.jsxs)(C,{flexDirection:`column`,gap:1,padding:1,children:[(0,H.jsxs)(p,{color:`text`,children:[`Reconnecting to `,(0,H.jsx)(p,{bold:!0,children:e.name})]}),(0,H.jsxs)(C,{children:[(0,H.jsx)(Ke,{}),(0,H.jsx)(p,{children:` Restarting MCP server process`})]}),(0,H.jsx)(p,{dimColor:!0,children:`This may take a few moments.`})]}):(0,H.jsxs)(C,{flexDirection:`column`,children:[(0,H.jsxs)(C,{flexDirection:`column`,paddingX:1,borderStyle:o?void 0:`round`,children:[(0,H.jsx)(C,{marginBottom:1,children:(0,H.jsxs)(p,{bold:!0,children:[y,` MCP Server`]})}),(0,H.jsxs)(C,{flexDirection:`column`,gap:0,children:[(0,H.jsxs)(C,{children:[(0,H.jsx)(p,{bold:!0,children:`Status: `}),e.client.type===`disabled`?(0,H.jsxs)(p,{children:[S(`inactive`,s)(a.radioOff),` disabled`]}):e.client.type===`connected`?(0,H.jsxs)(p,{children:[S(`success`,s)(a.tick),` connected`]}):e.client.type===`pending`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(p,{dimColor:!0,children:a.radioOff}),(0,H.jsx)(p,{children:` connecting…`})]}):(0,H.jsxs)(p,{children:[S(`error`,s)(a.cross),` failed`]})]}),(0,H.jsxs)(C,{children:[(0,H.jsx)(p,{bold:!0,children:`Command: `}),(0,H.jsx)(p,{dimColor:!0,children:e.config.command})]}),e.config.args&&e.config.args.length>0&&(0,H.jsxs)(C,{children:[(0,H.jsx)(p,{bold:!0,children:`Args: `}),(0,H.jsx)(p,{dimColor:!0,children:e.config.args.join(` `)})]}),(0,H.jsxs)(C,{children:[(0,H.jsx)(p,{bold:!0,children:`Config location: `}),(0,H.jsx)(p,{dimColor:!0,children:ut(Re(e.name)?.scope??`dynamic`)})]}),e.client.type===`connected`&&(0,H.jsx)(Dn,{serverToolsCount:t,serverPromptsCount:b,serverResourcesCount:l.resources[e.name]?.length||0}),e.client.type===`connected`&&t>0&&(0,H.jsxs)(C,{children:[(0,H.jsx)(p,{bold:!0,children:`Tools: `}),(0,H.jsxs)(p,{dimColor:!0,children:[t,` tools`]})]})]}),x.length>0&&(0,H.jsx)(C,{marginTop:1,children:(0,H.jsx)(Je,{options:x,onChange:async t=>{if(t===`tools`)n();else if(t===`reconnectMcpServer`){_(!0);try{let{message:t}=An(await d(e.name),e.name);i?.(t)}catch(t){i?.(jn(t,e.name))}finally{_(!1)}}else t===`toggle-enabled`?await v():t===`back`&&r()},onCancel:r})})]}),(0,H.jsx)(C,{marginTop:1,children:(0,H.jsx)(p,{dimColor:!0,italic:!0,children:c.pending?(0,H.jsxs)(H.Fragment,{children:[`Press `,c.keyName,` again to exit`]}):(0,H.jsxs)(g,{children:[(0,H.jsx)(h,{shortcut:`↑↓`,action:`navigate`}),(0,H.jsx)(h,{shortcut:`Enter`,action:`select`}),(0,H.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}var In,H,Ln=e((()=>{i(),In=t(l(),1),Jt(),x(),We(),vn(),Ie(),ht(),F(),we(),L(),ze(),Ne(),kn(),Mn(),H=w()}));function Rn({tool:e,server:t,onBack:n}){let[r,i]=zn.useState(``),a=D(e.name,t.name),o=T(e.userFacingName?e.userFacingName({}):a),s=e.isReadOnly?.({})??!1,c=e.isDestructive?.({})??!1,l=e.isOpenWorld?.({})??!1;return zn.useEffect(()=>{async function t(){try{i(await e.description({},{isNonInteractiveSession:!1,toolPermissionContext:{mode:`default`,additionalWorkingDirectories:new Map,alwaysAllowRules:{},alwaysDenyRules:{},alwaysAskRules:{},isBypassPermissionsModeAvailable:!1},tools:[]}))}catch{i(`Failed to load description`)}}t()},[e]),(0,U.jsx)(m,{title:(0,U.jsxs)(U.Fragment,{children:[o,s&&(0,U.jsx)(p,{color:`success`,children:` [read-only]`}),c&&(0,U.jsx)(p,{color:`error`,children:` [destructive]`}),l&&(0,U.jsx)(p,{dimColor:!0,children:` [open-world]`})]}),subtitle:t.name,onCancel:n,inputGuide:e=>e.pending?(0,U.jsxs)(p,{children:[`Press `,e.keyName,` again to exit`]}):(0,U.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`}),children:(0,U.jsxs)(C,{flexDirection:`column`,children:[(0,U.jsxs)(C,{children:[(0,U.jsx)(p,{bold:!0,children:`Tool name: `}),(0,U.jsx)(p,{dimColor:!0,children:a})]}),(0,U.jsxs)(C,{children:[(0,U.jsx)(p,{bold:!0,children:`Full name: `}),(0,U.jsx)(p,{dimColor:!0,children:e.name})]}),r&&(0,U.jsxs)(C,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(p,{bold:!0,children:`Description:`}),(0,U.jsx)(p,{wrap:`wrap`,children:r})]}),e.inputJSONSchema&&e.inputJSONSchema.properties&&Object.keys(e.inputJSONSchema.properties).length>0&&(0,U.jsxs)(C,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(p,{bold:!0,children:`Parameters:`}),(0,U.jsx)(C,{marginLeft:2,flexDirection:`column`,children:Object.entries(e.inputJSONSchema.properties).map(([t,n])=>{let r=(e.inputJSONSchema?.required)?.includes(t);return(0,U.jsxs)(p,{children:[`• `,t,r&&(0,U.jsx)(p,{dimColor:!0,children:` (required)`}),`:`,` `,(0,U.jsx)(p,{dimColor:!0,children:typeof n==`object`&&n&&`type`in n?String(n.type):`unknown`}),typeof n==`object`&&n&&`description`in n&&(0,U.jsxs)(p,{dimColor:!0,children:[` - `,String(n.description)]})]},t)})})]})]})})}var zn,U,Bn=e((()=>{zn=t(l(),1),x(),E(),L(),U=w()}));function Vn({server:e,onSelectTool:t,onBack:n}){let r=jt(e=>e.mcp.tools),i=Hn.useMemo(()=>e.client.type===`connected`?He(r,e.name):[],[e,r]),a=i.map((t,n)=>{let r=D(t.name,e.name),i=T(t.userFacingName?t.userFacingName({}):r),a=t.isReadOnly?.({})??!1,o=t.isDestructive?.({})??!1,s=t.isOpenWorld?.({})??!1,c=[];return a&&c.push(`read-only`),o&&c.push(`destructive`),s&&c.push(`open-world`),{label:i,value:n.toString(),description:c.length>0?c.join(`, `):void 0,descriptionColor:o?`error`:a?`success`:void 0}});return(0,Un.jsx)(m,{title:`Tools for ${e.name}`,subtitle:`${i.length} ${Se(i.length,`tool`)}`,onCancel:n,inputGuide:e=>e.pending?(0,Un.jsxs)(p,{children:[`Press `,e.keyName,` again to exit`]}):(0,Un.jsxs)(g,{children:[(0,Un.jsx)(h,{shortcut:`↑↓`,action:`navigate`}),(0,Un.jsx)(h,{shortcut:`Enter`,action:`select`}),(0,Un.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]}),children:i.length===0?(0,Un.jsx)(p,{dimColor:!0,children:`No tools available`}):(0,Un.jsx)(Je,{options:a,onChange:e=>{let n=parseInt(e,10),r=i[n];r&&t(r,n)},onCancel:n})})}var Hn,Un,Wn=e((()=>{Hn=t(l(),1),x(),E(),Ie(),ht(),we(),L(),ze(),Un=w()}));function Gn({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,Kn.useRef)(!1),[f,m]=(0,Kn.useState)(!1),[_,v]=(0,Kn.useState)(``),y=async()=>{let t=e.trim();if(!t){a(`Please enter a marketplace source`);return}let n=await on(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{m(!0),v(``);let{name:e,resolvedSource:t}=await Ue(n,e=>{v(e)});kt(e,{source:t}),dt();let r=n.source;n.source===`github`&&(r=n.repo),I(`tengu_marketplace_added`,{source_type:r}),l&&await l(),v(``),m(!1),u?s(`Successfully added marketplace: ${e}`):c({type:`browse-marketplace`,targetMarketplace:e})}catch(e){let t=P(e);_e(t),a(t.message),v(``),m(!1),s(u?`Error: ${t.message}`:null)}};return(0,Kn.useEffect)(()=>{e&&!d.current&&!i&&!o&&(d.current=!0,y())},[]),(0,W.jsxs)(C,{flexDirection:`column`,children:[(0,W.jsxs)(C,{flexDirection:`column`,paddingX:1,borderStyle:`round`,children:[(0,W.jsx)(C,{marginBottom:1,children:(0,W.jsx)(p,{bold:!0,children:`Add Marketplace`})}),(0,W.jsxs)(C,{flexDirection:`column`,children:[(0,W.jsx)(p,{children:`Enter marketplace source:`}),(0,W.jsx)(p,{dimColor:!0,children:`Examples:`}),(0,W.jsx)(p,{dimColor:!0,children:` · owner/repo (GitHub)`}),(0,W.jsx)(p,{dimColor:!0,children:` · git@github.com:owner/repo.git (SSH)`}),(0,W.jsx)(p,{dimColor:!0,children:` · https://example.com/marketplace.json`}),(0,W.jsx)(p,{dimColor:!0,children:` · ./path/to/marketplace`}),(0,W.jsx)(C,{marginTop:1,children:(0,W.jsx)(tt,{value:e,onChange:t,onSubmit:y,columns:80,cursorOffset:n,onChangeCursorOffset:r,focus:!0,showCursor:!0})})]}),f&&(0,W.jsxs)(C,{marginTop:1,children:[(0,W.jsx)(Ke,{}),(0,W.jsx)(p,{children:_||`Adding marketplace to configuration…`})]}),i&&(0,W.jsx)(C,{marginTop:1,children:(0,W.jsx)(p,{color:`error`,children:i})}),o&&(0,W.jsx)(C,{marginTop:1,children:(0,W.jsx)(p,{children:o})})]}),(0,W.jsx)(C,{marginLeft:3,children:(0,W.jsx)(p,{dimColor:!0,italic:!0,children:(0,W.jsxs)(g,{children:[(0,W.jsx)(h,{shortcut:`Enter`,action:`add`}),(0,W.jsx)(R,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})})]})}var Kn,W,qn=e((()=>{l(),Kn=t(l(),1),fe(),L(),x(),Ne(),st(),F(),ge(),lt(),Ct(),cn(),W=w()}));function Jn(e,t,n,i){let a={};for(let o of e){let e=n[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]=r(s):a[o]=s}return a}function Yn({title:e,subtitle:t,configSchema:n,initialValues:r,onSave:i,onCancel:s}){let c=Object.keys(n),l=(0,Xn.useCallback)(e=>{if(n[e]?.sensitive===!0)return``;let t=r?.[e];return t===void 0?``:String(t)},[n,r]),[u,d]=(0,Xn.useState)(0),[f,h]=(0,Xn.useState)({}),[g,_]=(0,Xn.useState)(()=>c[0]?l(c[0]):``),y=c[u],b=y?n[y]:null;if(te(`confirm:no`,s,{context:`Settings`}),v({"confirm:nextField":(0,Xn.useCallback)(()=>{if(u<c.length-1&&y){h(e=>({...e,[y]:g})),d(e=>e+1);let e=c[u+1];_(e?l(e):``)}},[u,c,y,g,l]),"confirm:yes":(0,Xn.useCallback)(()=>{if(!y)return;let e={...f,[y]:g};if(u===c.length-1)i(Jn(c,e,n,r));else{h(e),d(e=>e+1);let t=c[u+1];_(t?l(t):``)}},[y,f,g,u,c,n,i,l,r])},{context:`Confirmation`}),ne((e,t)=>{if(t.backspace||t.delete){_(e=>e.slice(0,-1));return}e&&!t.ctrl&&!t.meta&&!t.tab&&!t.return&&_(t=>t+e)}),!b||!y)return null;let x=b.sensitive===!0,ee=b.required===!0,S=x?`*`.repeat(o(g)):g;return(0,Zn.jsxs)(m,{title:e,subtitle:t,onCancel:s,isCancelActive:!1,children:[(0,Zn.jsxs)(C,{flexDirection:`column`,children:[(0,Zn.jsxs)(p,{bold:!0,children:[b.title||y,ee&&(0,Zn.jsx)(p,{color:`error`,children:` *`})]}),b.description&&(0,Zn.jsx)(p,{dimColor:!0,children:b.description}),(0,Zn.jsxs)(C,{marginTop:1,children:[(0,Zn.jsxs)(p,{children:[a.pointerSmall,` `]}),(0,Zn.jsx)(p,{children:S}),(0,Zn.jsx)(p,{children:`█`})]})]}),(0,Zn.jsxs)(C,{flexDirection:`column`,children:[(0,Zn.jsxs)(p,{dimColor:!0,children:[`Field `,u+1,` of `,c.length]}),u<c.length-1&&(0,Zn.jsx)(p,{dimColor:!0,children:`Tab: Next field · Enter: Save and continue`}),u===c.length-1&&(0,Zn.jsx)(p,{dimColor:!0,children:`Enter: Save configuration`})]})]})}var Xn,Zn,Qn=e((()=>{i(),Xn=t(l(),1),x(),Gt(),n(),Zn=w()}));async function $n(e){let{enabled:t,disabled:n}=await Lt();return[...t,...n].find(t=>t.repository===e||t.source===e)}function er({plugin:e,pluginId:t,onDone:n}){let[r]=tr.useState(()=>{let n=[],r=ft(e);Object.keys(r).length>0&&n.push({key:`top-level`,title:`Configure ${e.name}`,subtitle:`Plugin options`,schema:r,load:()=>bt(t),save:n=>wt(t,n,e.manifest.userConfig)});let i=it(e);for(let r of i)n.push({key:`channel:${r.server}`,title:`Configure ${r.displayName}`,subtitle:`Plugin: ${e.name}`,schema:r.configSchema,load:()=>Mt(t,r.server)??void 0,save:e=>ct(t,r.server,e,r.configSchema)});return n}),[i,a]=tr.useState(0),o=tr.useRef(n);if(o.current=n,tr.useEffect(()=>{r.length===0&&o.current(`skipped`)},[r.length]),r.length===0)return null;let s=r[i];function c(e){try{s.save(e)}catch(e){n(`error`,de(e));return}let t=i+1;t<r.length?a(t):n(`configured`)}return(0,nr.jsx)(Yn,{title:s.title,subtitle:s.subtitle,configSchema:s.schema,initialValues:s.load(),onSave:c,onCancel:()=>n(`skipped`)},s.key)}var tr,nr,rr=e((()=>{tr=t(l(),1),F(),Qe(),Ot(),Pt(),Ye(),Qn(),nr=w()}));function ir(){let e=Nt();return(0,ar.jsxs)(C,{marginBottom:1,children:[(0,ar.jsxs)(p,{color:`claude`,children:[a.warning,` `]}),(0,ar.jsxs)(p,{dimColor:!0,italic:!0,children:[`Make sure you trust a plugin before installing, updating, or using it. Anthropic does 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 ar,or=e((()=>{i(),l(),x(),rt(),ar=w()}));function sr(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 cr(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 lr({hasSelection:e}){return(0,ur.jsx)(C,{marginTop:1,children:(0,ur.jsx)(p,{dimColor:!0,italic:!0,children:(0,ur.jsxs)(g,{children:[e&&(0,ur.jsx)(R,{action:`plugin:install`,context:`Plugin`,fallback:`i`,description:`install`,bold:!0}),(0,ur.jsx)(R,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,ur.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,ur.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})}var ur,dr=e((()=>{l(),L(),x(),ur=w()}));function fr({totalItems:e,maxVisible:t=mr,selectedIndex:n=0}){let r=e>t,i=(0,pr.useRef)(0),a=(0,pr.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,pr.useCallback)(e=>r?e.slice(o,s):e,[r,o,s]),l=(0,pr.useCallback)(e=>o+e,[o]),u=(0,pr.useCallback)(e=>e>=o&&e<s,[o,s]),d=(0,pr.useCallback)(e=>{},[]),f=(0,pr.useCallback)(()=>{},[]),p=(0,pr.useCallback)(()=>{},[]),m=(0,pr.useCallback)((t,n)=>{n(Math.max(0,Math.min(t,e-1)))},[e]),h=(0,pr.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 pr,mr,hr=e((()=>{pr=t(l(),1),mr=5}));function gr({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:o,targetMarketplace:s,targetPlugin:c}){let[l,u]=(0,vr.useState)(`marketplace-list`),[d,f]=(0,vr.useState)(null),[m,h]=(0,vr.useState)(null),[_,y]=(0,vr.useState)([]),[b,x]=(0,vr.useState)([]),[ee,S]=(0,vr.useState)(!0),[ne,w]=(0,vr.useState)(null),[T,re]=(0,vr.useState)(0),[E,D]=(0,vr.useState)(new Set),[O,ie]=(0,vr.useState)(new Set),k=fr({totalItems:b.length,selectedIndex:T}),[A,j]=(0,vr.useState)(0),[M,N]=(0,vr.useState)(!1),[ae,oe]=(0,vr.useState)(null),[se,ce]=(0,vr.useState)(null);te(`confirm:no`,_r.useCallback(()=>{l===`plugin-list`?s?i({type:`manage-marketplaces`,targetMarketplace:s}):_.length===1?i({type:`menu`}):(u(`marketplace-list`),f(null),D(new Set)):l===`plugin-details`?(u(`plugin-list`),h(null)):i({type:`menu`})},[l,s,i,_.length]),{context:`Confirmation`}),(0,vr.useEffect)(()=>{async function e(){try{let e=await je(),{marketplaces:n,failures:r}=await St(e),i=[];for(let{name:e,config:t,data:r}of n)if(r){let n=ve(r.plugins,t=>ke(Xe(t.name,e)));i.push({name:e,totalPlugins:r.plugins.length,installedCount:n,source:_t(t.source)})}i.sort((e,t)=>e.name===`claude-plugin-directory`?-1:+(t.name===`claude-plugin-directory`)),y(i);let a=$e(r,ve(n,e=>e.data!==null));if(a)if(a.type===`warning`)ce(a.message+`. Showing available marketplaces.`);else throw Error(a.message);if(i.length===1&&!s&&!c){let e=i[0];e&&(f(e.name),u(`plugin-list`))}if(c){let n=null,r=null;for(let[t]of Object.entries(e)){let e=await Ge(t);if(e){let i=e.plugins.find(e=>e.name===c);if(i){let e=Xe(i.name,t);n={entry:i,marketplaceName:t,pluginId:e,isInstalled:z(e)},r=t;break}}}if(n&&r){let e=n.pluginId;z(e)?t(`Plugin '${e}' is already installed globally. Use '/plugin' to manage existing plugins.`):(f(r),h(n),u(`plugin-details`))}else t(`Plugin "${c}" not found in any marketplace`)}else s&&(i.some(e=>e.name===s)?(f(s),u(`plugin-list`)):t(`Marketplace "${s}" not found`))}catch(e){t(e instanceof Error?e.message:`Failed to load marketplaces`)}finally{S(!1)}}e()},[t,s,c]),(0,vr.useEffect)(()=>{if(!d)return;let e=!1;async function n(n){S(!0);try{let t=await Ge(n);if(e)return;if(!t)throw Error(`Failed to load marketplace: ${n}`);let r=[];for(let e of t.plugins){let t=Xe(e.name,n);mt(t)||r.push({entry:e,marketplaceName:n,pluginId:t,isInstalled:z(t)})}try{let t=await dn();if(e)return;w(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;ue(`Failed to fetch install counts: ${de(t)}`),r.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}x(r),re(0),D(new Set)}catch(n){if(e)return;t(n instanceof Error?n.message:`Failed to load plugins`)}finally{S(!1)}}return n(d),()=>{e=!0}},[d,t]);let P=async()=>{if(E.size===0)return;let e=b.filter(e=>E.has(e.pluginId));ie(new Set(e.map(e=>e.pluginId)));let n=0,a=0,s=[];for(let t of e){let e=await Ve({pluginId:t.pluginId,entry:t.entry,marketplaceName:t.marketplaceName,scope:`user`});e.success?n++:(a++,s.push({name:t.entry.name,reason:e.error}))}ie(new Set),D(new Set),dt(),a===0?r(`✓ Installed ${n} ${Se(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${Tt(s,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${Tt(s,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&o&&await o(),i({type:`menu`})},F=async(e,t=`user`)=>{N(!0),oe(null);let n=await Ve({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await $n(e.pluginId);if(t){N(!1),u({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),o&&await o(),i({type:`menu`})}else N(!1),oe(n.error)};(0,vr.useEffect)(()=>{e&&r(e)},[e,r]),v({"select:previous":()=>{T>0&&re(T-1)},"select:next":()=>{T<_.length-1&&re(T+1)},"select:accept":()=>{let e=_[T];e&&(f(e.name),u(`plugin-list`))}},{context:`Select`,isActive:l===`marketplace-list`}),v({"select:previous":()=>{T>0&&k.handleSelectionChange(T-1,re)},"select:next":()=>{T<b.length-1&&k.handleSelectionChange(T+1,re)},"select:accept":()=>{if(T===b.length&&E.size>0)P();else if(T<b.length){let e=b[T];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(h(e),u(`plugin-details`),j(0),oe(null)))}}},{context:`Select`,isActive:l===`plugin-list`}),v({"plugin:toggle":()=>{if(T<b.length){let e=b[T];if(e&&!e.isInstalled){let t=new Set(E);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),D(t)}}},"plugin:install":()=>{E.size>0&&P()}},{context:`Plugin`,isActive:l===`plugin-list`});let le=_r.useMemo(()=>{if(!m)return[];let e=m.entry.homepage;return cr(e,sr(m))},[m]);if(v({"select:previous":()=>{A>0&&j(A-1)},"select:next":()=>{A<le.length-1&&j(A+1)},"select:accept":()=>{if(!m)return;let e=le[A]?.action,t=m.entry.homepage,n=sr(m);e===`install-user`?F(m,`user`):e===`install-project`?F(m,`project`):e===`install-local`?F(m,`local`):e===`homepage`&&t?Ut(t):e===`github`&&n?Ut(`https://github.com/${n}`):e===`back`&&(u(`plugin-list`),h(null))}},{context:`Select`,isActive:l===`plugin-details`&&!!m}),typeof l==`object`&&l.type===`plugin-options`){let{plugin:e,pluginId:t}=l;function n(e){r(e),o&&o(),i({type:`menu`})}return(0,G.jsx)(er,{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(ee)return(0,G.jsx)(p,{children:`Loading…`});if(e)return(0,G.jsx)(p,{color:`error`,children:e});if(l===`marketplace-list`)return _.length===0?(0,G.jsxs)(C,{flexDirection:`column`,children:[(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsx)(p,{bold:!0,children:`Select marketplace`})}),(0,G.jsx)(p,{children:`No marketplaces configured.`}),(0,G.jsxs)(p,{dimColor:!0,children:[`Add a marketplace first using `,`'Add marketplace'`,`.`]}),(0,G.jsx)(C,{marginTop:1,paddingLeft:1,children:(0,G.jsx)(p,{dimColor:!0,children:(0,G.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})})})]}):(0,G.jsxs)(C,{flexDirection:`column`,children:[(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsx)(p,{bold:!0,children:`Select marketplace`})}),se&&(0,G.jsx)(C,{marginBottom:1,flexDirection:`column`,children:(0,G.jsxs)(p,{color:`warning`,children:[a.warning,` `,se]})}),_.map((e,t)=>(0,G.jsxs)(C,{flexDirection:`column`,marginBottom:+(t<_.length-1),children:[(0,G.jsx)(C,{children:(0,G.jsxs)(p,{color:T===t?`suggestion`:void 0,children:[T===t?a.pointer:` `,` `,e.name]})}),(0,G.jsx)(C,{marginLeft:2,children:(0,G.jsxs)(p,{dimColor:!0,children:[e.totalPlugins,` `,Se(e.totalPlugins,`plugin`),` available`,e.installedCount>0&&` · ${e.installedCount} already installed`,e.source&&` · ${e.source}`]})})]},e.name)),(0,G.jsx)(C,{marginTop:1,children:(0,G.jsx)(p,{dimColor:!0,italic:!0,children:(0,G.jsxs)(g,{children:[(0,G.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,G.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]});if(l===`plugin-details`&&m){let e=m.entry.homepage,t=cr(e,sr(m));return(0,G.jsxs)(C,{flexDirection:`column`,children:[(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsx)(p,{bold:!0,children:`Plugin Details`})}),(0,G.jsxs)(C,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(p,{bold:!0,children:m.entry.name}),m.entry.version&&(0,G.jsxs)(p,{dimColor:!0,children:[`Version: `,m.entry.version]}),m.entry.description&&(0,G.jsx)(C,{marginTop:1,children:(0,G.jsx)(p,{children:m.entry.description})}),m.entry.author&&(0,G.jsx)(C,{marginTop:1,children:(0,G.jsxs)(p,{dimColor:!0,children:[`By:`,` `,typeof m.entry.author==`string`?m.entry.author:m.entry.author.name]})})]}),(0,G.jsxs)(C,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(p,{bold:!0,children:`Will install:`}),m.entry.commands&&(0,G.jsxs)(p,{dimColor:!0,children:[`· Commands:`,` `,Array.isArray(m.entry.commands)?m.entry.commands.join(`, `):Object.keys(m.entry.commands).join(`, `)]}),m.entry.agents&&(0,G.jsxs)(p,{dimColor:!0,children:[`· Agents:`,` `,Array.isArray(m.entry.agents)?m.entry.agents.join(`, `):Object.keys(m.entry.agents).join(`, `)]}),m.entry.hooks&&(0,G.jsxs)(p,{dimColor:!0,children:[`· Hooks: `,Object.keys(m.entry.hooks).join(`, `)]}),m.entry.mcpServers&&(0,G.jsxs)(p,{dimColor:!0,children:[`· MCP Servers:`,` `,Array.isArray(m.entry.mcpServers)?m.entry.mcpServers.join(`, `):typeof m.entry.mcpServers==`object`?Object.keys(m.entry.mcpServers).join(`, `):`configured`]}),!m.entry.commands&&!m.entry.agents&&!m.entry.hooks&&!m.entry.mcpServers&&(0,G.jsx)(G.Fragment,{children:typeof m.entry.source==`object`&&`source`in m.entry.source&&(m.entry.source.source===`github`||m.entry.source.source===`url`||m.entry.source.source===`npm`||m.entry.source.source===`pip`)?(0,G.jsx)(p,{dimColor:!0,children:`· Component summary not available for remote plugin`}):(0,G.jsx)(p,{dimColor:!0,children:`· Components will be discovered at installation`})})]}),(0,G.jsx)(ir,{}),ae&&(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsxs)(p,{color:`error`,children:[`Error: `,ae]})}),(0,G.jsx)(C,{flexDirection:`column`,children:t.map((e,t)=>(0,G.jsxs)(C,{children:[A===t&&(0,G.jsx)(p,{children:`> `}),A!==t&&(0,G.jsx)(p,{children:` `}),(0,G.jsx)(p,{bold:A===t,children:M&&e.action===`install`?`Installing…`:e.label})]},e.action))}),(0,G.jsx)(C,{marginTop:1,paddingLeft:1,children:(0,G.jsx)(p,{dimColor:!0,children:(0,G.jsxs)(g,{children:[(0,G.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,G.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(b.length===0)return(0,G.jsxs)(C,{flexDirection:`column`,children:[(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsx)(p,{bold:!0,children:`Install plugins`})}),(0,G.jsx)(p,{dimColor:!0,children:`No new plugins available to install.`}),(0,G.jsx)(p,{dimColor:!0,children:`All plugins from this marketplace are already installed.`}),(0,G.jsx)(C,{marginLeft:3,children:(0,G.jsx)(p,{dimColor:!0,italic:!0,children:(0,G.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})})})]});let fe=k.getVisibleItems(b);return(0,G.jsxs)(C,{flexDirection:`column`,children:[(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsx)(p,{bold:!0,children:`Install Plugins`})}),k.scrollPosition.canScrollUp&&(0,G.jsx)(C,{children:(0,G.jsxs)(p,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),fe.map((t,n)=>{let r=T===k.toActualIndex(n),i=E.has(t.pluginId),o=O.has(t.pluginId);return(0,G.jsxs)(C,{flexDirection:`column`,marginBottom:n===fe.length-1&&!e?0:1,children:[(0,G.jsxs)(C,{children:[(0,G.jsxs)(p,{color:r?`suggestion`:void 0,children:[r?a.pointer:` `,` `]}),(0,G.jsxs)(p,{color:t.isInstalled?`success`:void 0,children:[t.isInstalled?a.tick:o?a.ellipsis:i?a.radioOn:a.radioOff,` `,t.entry.name,t.entry.category&&(0,G.jsxs)(p,{dimColor:!0,children:[` [`,t.entry.category,`]`]}),t.entry.tags?.includes(`community-managed`)&&(0,G.jsx)(p,{dimColor:!0,children:` [Community Managed]`}),t.isInstalled&&(0,G.jsx)(p,{dimColor:!0,children:` (installed)`}),ne&&d===`claude-plugins-official`&&(0,G.jsxs)(p,{dimColor:!0,children:[` · `,un(ne.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,G.jsxs)(C,{marginLeft:4,children:[(0,G.jsx)(p,{dimColor:!0,children:be(t.entry.description,60)}),t.entry.version&&(0,G.jsxs)(p,{dimColor:!0,children:[` · v`,t.entry.version]})]})]},t.pluginId)}),k.scrollPosition.canScrollDown&&(0,G.jsx)(C,{children:(0,G.jsxs)(p,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,G.jsx)(C,{marginTop:1,children:(0,G.jsxs)(p,{color:`error`,children:[a.cross,` `,e]})}),(0,G.jsx)(lr,{hasSelection:E.size>0})]})}var _r,vr,G,yr=e((()=>{i(),_r=t(l(),1),vr=t(l(),1),L(),x(),Gt(),ye(),Wt(),le(),F(),lt(),sn(),Pe(),rt(),Ct(),At(),Ft(),Fe(),we(),xe(),rr(),or(),dr(),hr(),G=w()}));function br({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:o,onSearchModeChange:c,targetPlugin:l}){let[u,m]=(0,K.useState)(`plugin-list`),[h,_]=(0,K.useState)(null),[y,b]=(0,K.useState)([]),[x,ee]=(0,K.useState)(!0),[S,w]=(0,K.useState)(null),[T,re]=(0,K.useState)(!1),E=(0,K.useCallback)(e=>{re(e),c?.(e)},[c]),{query:D,setQuery:O,cursorOffset:ie}=xn({isActive:u===`plugin-list`&&T&&!x,onExit:()=>{E(!1)}}),k=d(),{columns:A}=s(),j=(0,K.useMemo)(()=>{if(!D)return y;let e=D.toLowerCase();return y.filter(t=>t.entry.name.toLowerCase().includes(e)||t.entry.description?.toLowerCase().includes(e)||t.marketplaceName.toLowerCase().includes(e))},[y,D]),[M,N]=(0,K.useState)(0),[ae,oe]=(0,K.useState)(new Set),[se,ce]=(0,K.useState)(new Set),P=fr({totalItems:j.length,selectedIndex:M});(0,K.useEffect)(()=>{N(0)},[D]);let[F,le]=(0,K.useState)(0),[fe,I]=(0,K.useState)(!1),[pe,me]=(0,K.useState)(null),[he,ge]=(0,K.useState)(null),[_e,ye]=(0,K.useState)(null);(0,K.useEffect)(()=>{async function e(){try{let e=await je(),{marketplaces:n,failures:r}=await St(e),i=[];for(let{name:e,data:t}of n)if(t)for(let n of t.plugins){let t=Xe(n.name,e);i.push({entry:n,marketplaceName:e,pluginId:t,isInstalled:z(t)})}let a=i.filter(e=>!e.isInstalled&&!mt(e.pluginId));try{let e=await dn();w(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){ue(`Failed to fetch install counts: ${de(e)}`),a.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}b(a);let o=Object.keys(e).length;a.length===0&&ye(await xt({configuredMarketplaceCount:o,failedMarketplaceCount:r.length}));let s=$e(r,ve(n,e=>e.data!==null));if(s)if(s.type===`warning`)ge(s.message+`. Showing available plugins.`);else throw Error(s.message);if(l){let e=i.find(e=>e.entry.name===l);e?e.isInstalled?t(`Plugin '${e.pluginId}' is already installed. Use '/plugin' to manage existing plugins.`):(_(e),m(`plugin-details`)):t(`Plugin "${l}" not found in any marketplace`)}}catch(e){t(e instanceof Error?e.message:`Failed to load plugins`)}finally{ee(!1)}}e()},[t,l]);let xe=async()=>{if(ae.size===0)return;let e=y.filter(e=>ae.has(e.pluginId));ce(new Set(e.map(e=>e.pluginId)));let n=0,a=0,s=[];for(let t of e){let e=await Ve({pluginId:t.pluginId,entry:t.entry,marketplaceName:t.marketplaceName,scope:`user`});e.success?n++:(a++,s.push({name:t.entry.name,reason:e.error}))}ce(new Set),oe(new Set),dt(),a===0?r(`✓ Installed ${n} ${Se(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${Tt(s,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${Tt(s,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&o&&await o(),i({type:`menu`})},Ce=async(e,t=`user`)=>{I(!0),me(null);let n=await Ve({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await $n(e.pluginId);if(t){I(!1),m({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),o&&await o(),i({type:`menu`})}else I(!1),me(n.error)};(0,K.useEffect)(()=>{e&&r(e)},[e,r]),te(`confirm:no`,()=>{m(`plugin-list`),_(null)},{context:`Confirmation`,isActive:u===`plugin-details`}),te(`confirm:no`,()=>{i({type:`menu`})},{context:`Confirmation`,isActive:u===`plugin-list`&&!T}),ne((e,t)=>{let n=!t.ctrl&&!t.meta;T||(e===`/`&&n?(E(!0),O(``)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==`i`&&(E(!0),O(e)))},{isActive:u===`plugin-list`&&!x}),v({"select:previous":()=>{M===0?E(!0):P.handleSelectionChange(M-1,N)},"select:next":()=>{M<j.length-1&&P.handleSelectionChange(M+1,N)},"select:accept":()=>{if(M===j.length&&ae.size>0)xe();else if(M<j.length){let e=j[M];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(_(e),m(`plugin-details`),le(0),me(null)))}}},{context:`Select`,isActive:u===`plugin-list`&&!T}),v({"plugin:toggle":()=>{if(M<j.length){let e=j[M];if(e&&!e.isInstalled){let t=new Set(ae);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),oe(t)}}},"plugin:install":()=>{ae.size>0&&xe()}},{context:`Plugin`,isActive:u===`plugin-list`&&!T});let we=Cr.useMemo(()=>{if(!h)return[];let e=h.entry.homepage;return cr(e,sr(h))},[h]);if(v({"select:previous":()=>{F>0&&le(F-1)},"select:next":()=>{F<we.length-1&&le(F+1)},"select:accept":()=>{if(!h)return;let e=we[F]?.action,t=h.entry.homepage,n=sr(h);e===`install-user`?Ce(h,`user`):e===`install-project`?Ce(h,`project`):e===`install-local`?Ce(h,`local`):e===`homepage`&&t?Ut(t):e===`github`&&n?Ut(`https://github.com/${n}`):e===`back`&&(m(`plugin-list`),_(null))}},{context:`Select`,isActive:u===`plugin-details`&&!!h}),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)(er,{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(x)return(0,q.jsx)(p,{children:`Loading…`});if(e)return(0,q.jsx)(p,{color:`error`,children:e});if(u===`plugin-details`&&h){let e=h.entry.homepage,t=cr(e,sr(h));return(0,q.jsxs)(C,{flexDirection:`column`,children:[(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsx)(p,{bold:!0,children:`Plugin details`})}),(0,q.jsxs)(C,{flexDirection:`column`,marginBottom:1,children:[(0,q.jsx)(p,{bold:!0,children:h.entry.name}),(0,q.jsxs)(p,{dimColor:!0,children:[`from `,h.marketplaceName]}),h.entry.version&&(0,q.jsxs)(p,{dimColor:!0,children:[`Version: `,h.entry.version]}),h.entry.description&&(0,q.jsx)(C,{marginTop:1,children:(0,q.jsx)(p,{children:h.entry.description})}),h.entry.author&&(0,q.jsx)(C,{marginTop:1,children:(0,q.jsxs)(p,{dimColor:!0,children:[`By:`,` `,typeof h.entry.author==`string`?h.entry.author:h.entry.author.name]})})]}),(0,q.jsx)(ir,{}),pe&&(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsxs)(p,{color:`error`,children:[`Error: `,pe]})}),(0,q.jsx)(C,{flexDirection:`column`,children:t.map((e,t)=>(0,q.jsxs)(C,{children:[F===t&&(0,q.jsx)(p,{children:`> `}),F!==t&&(0,q.jsx)(p,{children:` `}),(0,q.jsx)(p,{bold:F===t,children:fe&&e.action.startsWith(`install-`)?`Installing…`:e.label})]},e.action))}),(0,q.jsx)(C,{marginTop:1,children:(0,q.jsx)(p,{dimColor:!0,children:(0,q.jsxs)(g,{children:[(0,q.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,q.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(y.length===0)return(0,q.jsxs)(C,{flexDirection:`column`,children:[(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsx)(p,{bold:!0,children:`Discover plugins`})}),(0,q.jsx)(Sr,{reason:_e}),(0,q.jsx)(C,{marginTop:1,children:(0,q.jsx)(p,{dimColor:!0,italic:!0,children:`Esc to go back`})})]});let Te=P.getVisibleItems(j);return(0,q.jsxs)(C,{flexDirection:`column`,children:[(0,q.jsxs)(C,{children:[(0,q.jsx)(p,{bold:!0,children:`Discover plugins`}),P.needsPagination&&(0,q.jsxs)(p,{dimColor:!0,children:[` `,`(`,P.scrollPosition.current,`/`,P.scrollPosition.total,`)`]})]}),(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsx)(f,{query:D,isFocused:T,isTerminalFocused:k,width:A-4,cursorOffset:ie})}),he&&(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsxs)(p,{color:`warning`,children:[a.warning,` `,he]})}),j.length===0&&D&&(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsxs)(p,{dimColor:!0,children:[`No plugins match "`,D,`"`]})}),P.scrollPosition.canScrollUp&&(0,q.jsx)(C,{children:(0,q.jsxs)(p,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),Te.map((t,n)=>{let r=M===P.toActualIndex(n),i=ae.has(t.pluginId),o=se.has(t.pluginId);return(0,q.jsxs)(C,{flexDirection:`column`,marginBottom:n===Te.length-1&&!e?0:1,children:[(0,q.jsxs)(C,{children:[(0,q.jsxs)(p,{color:r&&!T?`suggestion`:void 0,children:[r&&!T?a.pointer:` `,` `]}),(0,q.jsxs)(p,{children:[o?a.ellipsis:i?a.radioOn:a.radioOff,` `,t.entry.name,(0,q.jsxs)(p,{dimColor:!0,children:[` · `,t.marketplaceName]}),t.entry.tags?.includes(`community-managed`)&&(0,q.jsx)(p,{dimColor:!0,children:` [Community Managed]`}),S&&t.marketplaceName===`claude-plugins-official`&&(0,q.jsxs)(p,{dimColor:!0,children:[` · `,un(S.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,q.jsx)(C,{marginLeft:4,children:(0,q.jsx)(p,{dimColor:!0,children:be(t.entry.description,60)})})]},`${P.startIndex}-${t.pluginId}`)}),P.scrollPosition.canScrollDown&&(0,q.jsx)(C,{children:(0,q.jsxs)(p,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,q.jsx)(C,{marginTop:1,children:(0,q.jsxs)(p,{color:`error`,children:[a.cross,` `,e]})}),(0,q.jsx)(xr,{hasSelection:ae.size>0,canToggle:M<j.length&&!j[M]?.isInstalled})]})}function xr({hasSelection:e,canToggle:t}){return(0,q.jsx)(C,{marginTop:1,children:(0,q.jsx)(p,{dimColor:!0,italic:!0,children:(0,q.jsxs)(g,{children:[e&&(0,q.jsx)(R,{action:`plugin:install`,context:`Plugin`,fallback:`i`,description:`install`,bold:!0}),(0,q.jsx)(p,{children:`type to search`}),t&&(0,q.jsx)(R,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,q.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,q.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})}function Sr({reason:e}){switch(e){case`git-not-installed`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(p,{dimColor:!0,children:`Git is required to install marketplaces.`}),(0,q.jsx)(p,{dimColor:!0,children:`Please install git and restart Claude Code.`})]});case`all-blocked-by-policy`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(p,{dimColor:!0,children:`Your organization policy does not allow any external marketplaces.`}),(0,q.jsx)(p,{dimColor:!0,children:`Contact your administrator.`})]});case`policy-restricts-sources`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(p,{dimColor:!0,children:`Your organization restricts which marketplaces can be added.`}),(0,q.jsx)(p,{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)(p,{dimColor:!0,children:`Failed to load marketplace data.`}),(0,q.jsx)(p,{dimColor:!0,children:`Check your network connection.`})]});case`all-plugins-installed`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(p,{dimColor:!0,children:`All available plugins are already installed.`}),(0,q.jsx)(p,{dimColor:!0,children:`Check for new plugins later or add more marketplaces.`})]});default:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(p,{dimColor:!0,children:`No plugins available.`}),(0,q.jsx)(p,{dimColor:!0,children:`Add a marketplace first using the Marketplaces tab.`})]})}}var Cr,K,q,wr=e((()=>{i(),Cr=t(l(),1),K=t(l(),1),L(),bn(),x(),Sn(),Kt(),Gt(),ye(),Wt(),le(),F(),lt(),sn(),Pe(),rt(),Ct(),At(),Ft(),Fe(),we(),xe(),rr(),or(),dr(),hr(),q=w()}));function Tr({setViewState:e,error:t,setError:n,setResult:r,exitState:i,onManageComplete:o,targetMarketplace:s,action:c}){let[l,u]=(0,Dr.useState)([]),[d,f]=(0,Dr.useState)(!0),[m,h]=(0,Dr.useState)(0),[_,y]=(0,Dr.useState)(!1),[b,x]=(0,Dr.useState)(null),[ee,S]=(0,Dr.useState)(null),[w,T]=(0,Dr.useState)(null),[E,D]=(0,Dr.useState)(`list`),[O,k]=(0,Dr.useState)(null),[A,j]=(0,Dr.useState)(0),N=(0,Dr.useRef)(!1);(0,Dr.useEffect)(()=>{async function e(){try{let e=await je(),{enabled:r,disabled:i}=await Lt(),a=[...r,...i],{marketplaces:o,failures:l}=await St(e),d=[];for(let{name:e,config:t,data:n}of o){let r=a.filter(t=>t.source.endsWith(`@${e}`));d.push({name:e,source:_t(t.source),lastUpdated:t.lastUpdated,pluginCount:n?.plugins.length,installedPlugins:r,pendingUpdate:!1,pendingRemove:!1,autoUpdate:M(e,t)})}d.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),u(d);let f=$e(l,ve(o,e=>e.data!==null));if(f)if(f.type===`warning`)x(f.message);else throw Error(f.message);if(s&&!N.current&&!t){N.current=!0;let e=d.findIndex(e=>e.name===s);if(e>=0){let t=d[e];if(c){h(e+1);let t=[...d];c===`update`?t[e].pendingUpdate=!0:c===`remove`&&(t[e].pendingRemove=!0),u(t),setTimeout(ce,100,t)}else t&&(h(e+1),k(t),D(`details`))}else n&&n(`Marketplace not found: ${s}`)}}catch(e){n&&n(e instanceof Error?e.message:`Failed to load marketplaces`),x(e instanceof Error?e.message:`Failed to load marketplaces`)}finally{f(!1)}}e()},[s,c,t]);let oe=()=>l.some(e=>e.pendingUpdate||e.pendingRemove),se=()=>({updateCount:ve(l,e=>e.pendingUpdate),removeCount:ve(l,e=>e.pendingRemove)}),ce=async t=>{let i=t||l,s=E===`details`;y(!0),x(null),S(null),T(null);try{let t=re(`userSettings`),n=0,c=0,l=new Set;for(let e of i){if(e.pendingRemove){if(e.installedPlugins&&e.installedPlugins.length>0){let n={...t?.enabledPlugins};for(let t of e.installedPlugins){let r=Xe(t.name,e.name);n[r]=!1}ie(`userSettings`,{enabledPlugins:n})}await Ee(e.name),c++,I(`tengu_marketplace_removed`,{marketplace_name:e.name,plugins_uninstalled:e.installedPlugins?.length||0});continue}e.pendingUpdate&&(await qe(e.name,e=>{T(e)}),n++,l.add(e.name.toLowerCase()),I(`tengu_marketplace_updated`,{marketplace_name:e.name}))}let d=0;l.size>0&&(d=(await Cn(l)).length),dt(),o&&await o();let f=await je(),{enabled:p,disabled:m}=await Lt(),h=[...p,...m],{marketplaces:g}=await St(f),_=[];for(let{name:e,config:t,data:n}of g){let r=h.filter(t=>t.source.endsWith(`@${e}`));_.push({name:e,source:_t(t.source),lastUpdated:t.lastUpdated,pluginCount:n?.plugins.length,installedPlugins:r,pendingUpdate:!1,pendingRemove:!1,autoUpdate:M(e,t)})}if(_.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),u(_),s&&O){let e=_.find(e=>e.name===O.name);e&&k(e)}let v=[];if(n>0){let e=d>0?` (${d} ${Se(d,`plugin`)} bumped)`:``;v.push(`Updated ${n} ${Se(n,`marketplace`)}${e}`)}if(c>0&&v.push(`Removed ${c} ${Se(c,`marketplace`)}`),v.length>0){let t=`${a.tick} ${v.join(`, `)}`;s?S(t):(r(t),setTimeout(e,2e3,{type:`menu`}))}else s||e({type:`menu`})}catch(e){let t=de(e);x(t),n&&n(t)}finally{y(!1),T(null)}},P=async()=>{if(!O)return;let e=l.map(e=>e.name===O.name?{...e,pendingRemove:!0}:e);u(e),await ce(e)},F=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 ae()||t.push({label:e.autoUpdate?`Disable auto-update`:`Enable auto-update`,value:`toggle-auto-update`}),t.push({label:`Remove marketplace`,value:`remove`}),t},le=async e=>{let t=!e.autoUpdate;try{await vt(e.name,t),u(n=>n.map(n=>n.name===e.name?{...n,autoUpdate:t}:n)),k(e=>e&&{...e,autoUpdate:t})}catch(e){x(e instanceof Error?e.message:`Failed to update setting`)}};if(te(`confirm:no`,()=>{D(`list`),j(0)},{context:`Confirmation`,isActive:!_&&(E===`details`||E===`confirm-remove`)}),te(`confirm:no`,()=>{u(e=>e.map(e=>({...e,pendingUpdate:!1,pendingRemove:!1}))),h(0)},{context:`Confirmation`,isActive:!_&&E===`list`&&oe()}),te(`confirm:no`,()=>{e({type:`menu`})},{context:`Confirmation`,isActive:!_&&E===`list`&&!oe()}),v({"select:previous":()=>h(e=>Math.max(0,e-1)),"select:next":()=>{let e=l.length+1;h(t=>Math.min(e-1,t+1))},"select:accept":()=>{let t=m-1;if(m===0)e({type:`add-marketplace`});else if(oe())ce();else{let e=l[t];e&&(k(e),D(`details`),j(0))}}},{context:`Select`,isActive:!_&&E===`list`}),ne(e=>{let t=m-1;if((e===`u`||e===`U`)&&t>=0)u(e=>e.map((e,n)=>n===t?{...e,pendingUpdate:!e.pendingUpdate,pendingRemove:e.pendingUpdate?e.pendingRemove:!1}:e));else if((e===`r`||e===`R`)&&t>=0){let e=l[t];e&&(k(e),D(`confirm-remove`))}},{isActive:!_&&E===`list`}),v({"select:previous":()=>j(e=>Math.max(0,e-1)),"select:next":()=>{let e=F(O);j(t=>Math.min(e.length-1,t+1))},"select:accept":()=>{if(!O)return;let t=F(O)[A];if(t?.value===`browse`)e({type:`browse-marketplace`,targetMarketplace:O.name});else if(t?.value===`update`){let e=l.map(e=>e.name===O.name?{...e,pendingUpdate:!0}:e);u(e),ce(e)}else t?.value===`toggle-auto-update`?le(O):t?.value===`remove`&&D(`confirm-remove`)}},{context:`Select`,isActive:!_&&E===`details`}),ne(e=>{e===`y`||e===`Y`?P():(e===`n`||e===`N`)&&(D(`list`),k(null))},{isActive:!_&&E===`confirm-remove`}),d)return(0,J.jsx)(p,{children:`Loading marketplaces…`});if(l.length===0)return(0,J.jsxs)(C,{flexDirection:`column`,children:[(0,J.jsx)(C,{marginBottom:1,children:(0,J.jsx)(p,{bold:!0,children:`Manage marketplaces`})}),(0,J.jsxs)(C,{flexDirection:`row`,gap:1,children:[(0,J.jsxs)(p,{color:`suggestion`,children:[a.pointer,` +`]}),(0,J.jsx)(p,{bold:!0,color:`suggestion`,children:`Add Marketplace`})]}),(0,J.jsx)(C,{marginLeft:3,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:i.pending?(0,J.jsxs)(J.Fragment,{children:[`Press `,i.keyName,` again to go back`]}):(0,J.jsxs)(g,{children:[(0,J.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,J.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]});if(E===`confirm-remove`&&O){let e=O.installedPlugins?.length||0;return(0,J.jsxs)(C,{flexDirection:`column`,children:[(0,J.jsxs)(p,{bold:!0,color:`warning`,children:[`Remove marketplace `,(0,J.jsx)(p,{italic:!0,children:O.name}),`?`]}),(0,J.jsxs)(C,{flexDirection:`column`,children:[e>0&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsxs)(p,{color:`warning`,children:[`This will also uninstall `,e,` `,Se(e,`plugin`),` from this marketplace:`]})}),O.installedPlugins&&O.installedPlugins.length>0&&(0,J.jsx)(C,{flexDirection:`column`,marginTop:1,marginLeft:2,children:O.installedPlugins.map(e=>(0,J.jsxs)(p,{dimColor:!0,children:[`• `,e.name]},e.name))}),(0,J.jsx)(C,{marginTop:1,children:(0,J.jsxs)(p,{children:[`Press `,(0,J.jsx)(p,{bold:!0,children:`y`}),` to confirm or `,(0,J.jsx)(p,{bold:!0,children:`n`}),` to cancel`]})})]})]})}if(E===`details`&&O){let e=O.pendingUpdate||_,t=F(O);return(0,J.jsxs)(C,{flexDirection:`column`,children:[(0,J.jsx)(p,{bold:!0,children:O.name}),(0,J.jsx)(p,{dimColor:!0,children:O.source}),(0,J.jsx)(C,{marginTop:1,children:(0,J.jsxs)(p,{children:[O.pluginCount||0,` available `,Se(O.pluginCount||0,`plugin`)]})}),O.installedPlugins&&O.installedPlugins.length>0&&(0,J.jsxs)(C,{flexDirection:`column`,marginTop:1,children:[(0,J.jsxs)(p,{bold:!0,children:[`Installed plugins (`,O.installedPlugins.length,`):`]}),(0,J.jsx)(C,{flexDirection:`column`,marginLeft:1,children:O.installedPlugins.map(e=>(0,J.jsxs)(C,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(p,{children:a.bullet}),(0,J.jsxs)(C,{flexDirection:`column`,children:[(0,J.jsx)(p,{children:e.name}),(0,J.jsx)(p,{dimColor:!0,children:e.manifest.description})]})]},e.name))})]}),e&&(0,J.jsxs)(C,{marginTop:1,flexDirection:`column`,children:[(0,J.jsx)(p,{color:`claude`,children:`Updating marketplace…`}),w&&(0,J.jsx)(p,{dimColor:!0,children:w})]}),!e&&ee&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{color:`claude`,children:ee})}),!e&&b&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{color:`error`,children:b})}),!e&&(0,J.jsx)(C,{flexDirection:`column`,marginTop:1,children:t.map((e,t)=>{if(!e)return null;let n=t===A;return(0,J.jsxs)(C,{children:[(0,J.jsxs)(p,{color:n?`suggestion`:void 0,children:[n?a.pointer:` `,` `,e.label]}),e.secondaryLabel&&(0,J.jsxs)(p,{dimColor:!0,children:[` `,e.secondaryLabel]})]},e.value)})}),!e&&!ae()&&O.autoUpdate&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{dimColor:!0,children:`Auto-update enabled. Claude Code will automatically update this marketplace and its installed plugins.`})}),(0,J.jsx)(C,{marginLeft:3,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:e?(0,J.jsx)(J.Fragment,{children:`Please wait…`}):(0,J.jsxs)(g,{children:[(0,J.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,J.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]})}let{updateCount:ue,removeCount:fe}=se();return(0,J.jsxs)(C,{flexDirection:`column`,children:[(0,J.jsx)(C,{marginBottom:1,children:(0,J.jsx)(p,{bold:!0,children:`Manage marketplaces`})}),(0,J.jsxs)(C,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(p,{color:m===0?`suggestion`:void 0,children:[m===0?a.pointer:` `,` +`]}),(0,J.jsx)(p,{bold:!0,color:m===0?`suggestion`:void 0,children:`Add Marketplace`})]}),(0,J.jsx)(C,{flexDirection:`column`,children:l.map((e,t)=>{let n=t+1===m,r=[];return e.pendingUpdate&&r.push(`UPDATE`),e.pendingRemove&&r.push(`REMOVE`),(0,J.jsxs)(C,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(p,{color:n?`suggestion`:void 0,children:[n?a.pointer:` `,` `,e.pendingRemove?a.cross:a.bullet]}),(0,J.jsxs)(C,{flexDirection:`column`,flexGrow:1,children:[(0,J.jsxs)(C,{flexDirection:`row`,gap:1,children:[(0,J.jsxs)(p,{bold:!0,strikethrough:e.pendingRemove,dimColor:e.pendingRemove,children:[e.name===`claude-plugins-official`&&(0,J.jsx)(p,{color:`claude`,children:`✻ `}),e.name,e.name===`claude-plugins-official`&&(0,J.jsx)(p,{color:`claude`,children:` ✻`})]}),r.length>0&&(0,J.jsxs)(p,{color:`warning`,children:[`[`,r.join(`, `),`]`]})]}),(0,J.jsx)(p,{dimColor:!0,children:e.source}),(0,J.jsxs)(p,{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)})}),oe()&&(0,J.jsxs)(C,{marginTop:1,flexDirection:`column`,children:[(0,J.jsxs)(p,{children:[(0,J.jsx)(p,{bold:!0,children:`Pending changes:`}),` `,(0,J.jsx)(p,{dimColor:!0,children:`Enter to apply`})]}),ue>0&&(0,J.jsxs)(p,{children:[`• Update `,ue,` `,Se(ue,`marketplace`)]}),fe>0&&(0,J.jsxs)(p,{color:`warning`,children:[`• Remove `,fe,` `,Se(fe,`marketplace`)]})]}),_&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{color:`claude`,children:`Processing changes…`})}),b&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{color:`error`,children:b})}),(0,J.jsx)(Er,{exitState:i,hasPendingActions:oe()})]})}function Er({exitState:e,hasPendingActions:t}){return e.pending?(0,J.jsx)(C,{marginTop:1,children:(0,J.jsxs)(p,{dimColor:!0,italic:!0,children:[`Press `,e.keyName,` again to go back`]})}):(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:(0,J.jsxs)(g,{children:[t&&(0,J.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`apply changes`}),!t&&(0,J.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),!t&&(0,J.jsx)(h,{shortcut:`u`,action:`update`}),!t&&(0,J.jsx)(h,{shortcut:`r`,action:`remove`}),(0,J.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:t?`cancel`:`go back`})]})})})}var Dr,J,Or=e((()=>{i(),l(),Dr=t(l(),1),fe(),L(),x(),Gt(),ye(),oe(),F(),lt(),rt(),Ct(),wn(),Pt(),N(),j(),we(),J=w()}));function kr(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 Et(e)}function Ar(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 jr=e((()=>{et()}));function Mr({item:e,isSelected:t}){let[n]=u();if(e.type===`plugin`){let r,i;return e.pendingToggle?(r=S(`suggestion`,n)(a.arrowRight),i=e.pendingToggle===`will-enable`?`will enable`:`will disable`):e.errorCount>0?(r=S(`error`,n)(a.cross),i=`${e.errorCount} ${Se(e.errorCount,`error`)}`):e.isEnabled?(r=S(`success`,n)(a.tick),i=`enabled`):(r=S(`inactive`,n)(a.radioOff),i=`disabled`),(0,Y.jsxs)(C,{children:[(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(p,{dimColor:!t,children:[` `,(0,Y.jsx)(p,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(p,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(p,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(p,{dimColor:!t,children:i})]})}if(e.type===`flagged-plugin`){let r=S(`warning`,n)(a.warning);return(0,Y.jsxs)(C,{children:[(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(p,{dimColor:!t,children:[` `,(0,Y.jsx)(p,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(p,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(p,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(p,{dimColor:!t,children:`removed`})]})}if(e.type===`failed-plugin`){let r=S(`error`,n)(a.cross),i=`failed to load · ${e.errorCount} ${Se(e.errorCount,`error`)}`;return(0,Y.jsxs)(C,{children:[(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(p,{dimColor:!t,children:[` `,(0,Y.jsx)(p,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(p,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(p,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(p,{dimColor:!t,children:i})]})}let r,i;return e.status===`connected`?(r=S(`success`,n)(a.tick),i=`connected`):e.status===`disabled`?(r=S(`inactive`,n)(a.radioOff),i=`disabled`):e.status===`pending`?(r=S(`inactive`,n)(a.radioOff),i=`connecting…`):e.status===`needs-auth`?(r=S(`warning`,n)(a.triangleUpOutline),i=`Enter to auth`):(r=S(`error`,n)(a.cross),i=`failed`),e.indented?(0,Y.jsxs)(C,{children:[(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(p,{dimColor:!t,children:`└ `}),(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(p,{dimColor:!t,children:[` `,(0,Y.jsx)(p,{backgroundColor:`userMessageBackground`,children:`MCP`})]}),(0,Y.jsxs)(p,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(p,{dimColor:!t,children:i})]}):(0,Y.jsxs)(C,{children:[(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(p,{dimColor:!t,children:[` `,(0,Y.jsx)(p,{backgroundColor:`userMessageBackground`,children:`MCP`})]}),(0,Y.jsxs)(p,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(p,{dimColor:!t,children:i})]})}var Y,Nr=e((()=>{i(),l(),x(),we(),Y=w()}));async function Pr(e){try{return(await En.readdir(e,{withFileTypes:!0})).filter(e=>e.isFile()&&e.name.endsWith(`.md`)).map(e=>Tn.basename(e.name,`.md`))}catch(t){return ue(`Failed to read plugin components from ${e}: ${de(t)}`,{level:`error`}),_e(P(t)),[]}}async function Fr(e){try{let t=await En.readdir(e,{withFileTypes:!0}),n=[];for(let r of t)if(r.isDirectory()||r.isSymbolicLink()){let t=Tn.join(e,r.name,`SKILL.md`);try{(await En.stat(t)).isFile()&&n.push(r.name)}catch{}}return n}catch(t){return ue(`Failed to read skill directories from ${e}: ${de(t)}`,{level:`error`}),_e(P(t)),[]}}function Ir({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=Ht(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 Ge(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 Pr(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 Pr(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 Fr(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)(C,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsx)(p,{bold:!0,children:`Components:`}),(0,Z.jsxs)(p,{dimColor:!0,children:[`Error: `,o]})]}):!n||!(n.commands||n.agents||n.skills||n.hooks||n.mcpServers)?null:(0,Z.jsxs)(C,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsx)(p,{bold:!0,children:`Installed components:`}),n.commands?(0,Z.jsxs)(p,{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)(p,{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)(p,{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)(p,{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)(p,{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 Lr(e,t){let n=(await Ge(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 Rr(e){return e.filter(e=>{let t=e.source.split(`@`)[1]||`local`;return!mt(`${e.name}@${t}`)})}function zr({setViewState:e,setResult:t,onManageComplete:n,onSearchModeChange:r,targetPlugin:i,targetMarketplace:o,action:c}){let l=jt(e=>e.mcp.clients),u=jt(e=>e.mcp.tools),m=jt(e=>e.plugins.errors),h=mn(),[_,y]=(0,X.useState)(!1),b=(0,X.useCallback)(e=>{y(e),r?.(e)},[r]),x=d(),{columns:ee}=s(),[S,w]=(0,X.useState)(`plugin-list`),{query:T,setQuery:E,cursorOffset:D}=xn({isActive:S===`plugin-list`&&_,onExit:()=>{b(!1)}}),[O,A]=(0,X.useState)(null),[j,M]=(0,X.useState)([]),[N,ae]=(0,X.useState)([]),[oe,ce]=(0,X.useState)(!0),[F,le]=(0,X.useState)(new Map),fe=(0,X.useRef)(!1),I=(0,X.useRef)(void 0),pe=_n();te(`confirm:no`,Br.useCallback(()=>{if(S===`plugin-details`)w(`plugin-list`),A(null),z(null);else if(typeof S==`object`&&S.type===`failed-plugin-details`)w(`plugin-list`),z(null);else if(S===`configuring`)w(`plugin-details`),Ae(null);else if(typeof S==`object`&&(S.type===`plugin-options`||S.type===`configuring-options`))w(`plugin-list`),A(null),t(`Plugin enabled. Configuration skipped — run /reload-plugins to apply.`),n&&n();else if(typeof S==`object`&&S.type===`flagged-detail`)w(`plugin-list`),z(null);else if(typeof S==`object`&&S.type===`mcp-detail`)w(`plugin-list`),z(null);else if(typeof S==`object`&&S.type===`mcp-tools`)w({type:`mcp-detail`,client:S.client});else if(typeof S==`object`&&S.type===`mcp-tool-detail`)w({type:`mcp-tools`,client:S.client});else{if(F.size>0){t(`Run /reload-plugins to apply plugin changes.`);return}e({type:`menu`})}},[S,e,F,t]),{context:`Confirmation`,isActive:(S!==`plugin-list`||!_)&&S!==`confirm-project-uninstall`&&!(typeof S==`object`&&S.type===`confirm-data-cleanup`)});let me=e=>e.type===`connected`?`connected`:e.type===`disabled`?`disabled`:e.type===`pending`?`pending`:e.type===`needs-auth`?`needs-auth`:`failed`,he=(0,X.useMemo)(()=>{let e=k(),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 N){let i=`${r.plugin.name}@${r.marketplace}`,a=e?.enabledPlugins?.[i]!==!1,o=m.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:F.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 m){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=Xt(),s=[];for(let[e,t]of a){if(e in h)continue;let n=Bt(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:me(e),client:e}));let u={flagged:-1,project:0,local:1,user:2,enterprise:3,managed:4,dynamic:5,builtin:6},d=[],f=new Map;for(let{item:e,originalScope:t,childMcps:r}of n){let n=e.scope;f.has(n)||f.set(n,[]),f.get(n).push(e);for(let{displayName:e,client:n}of r){let r=t===`builtin`?`user`:t;f.has(r)||f.set(r,[]),f.get(r).push({type:`mcp`,id:`mcp:${n.name}`,name:e,description:void 0,scope:r,status:me(n),client:n,indented:!0})}}for(let e of c){let t=e.scope;f.has(t)||f.set(t,[]),f.get(t).push(e)}for(let e of s){let t=e.scope;f.has(t)||f.set(t,[]),f.get(t).push(e)}for(let[e,t]of Object.entries(h)){let n=Bt(e),r=n.name||e,i=n.marketplace||`unknown`;f.has(`flagged`)||f.set(`flagged`,[]),f.get(`flagged`).push({type:`flagged-plugin`,id:e,name:r,marketplace:i,scope:`flagged`,reason:`delisted`,text:`Removed from marketplace`,flaggedAt:t.flaggedAt})}let p=[...f.keys()].sort((e,t)=>(u[e]??99)-(u[t]??99));for(let e of p){let t=f.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)d.push(...e);d.push(...r)}return d},[N,l,m,F,h]),ge=(0,X.useMemo)(()=>he.filter(e=>e.type===`flagged-plugin`).map(e=>e.id),[he]);(0,X.useEffect)(()=>{ge.length>0&&pn(ge)},[ge]);let ye=(0,X.useMemo)(()=>{if(!T)return he;let e=T.toLowerCase();return he.filter(t=>t.name.toLowerCase().includes(e)||`description`in t&&t.description?.toLowerCase().includes(e))},[he,T]),[be,xe]=(0,X.useState)(0),Ce=fr({totalItems:ye.length,selectedIndex:be,maxVisible:8}),[we,Te]=(0,X.useState)(0),[Ee,De]=(0,X.useState)(!1),[L,z]=(0,X.useState)(null),[ke,Ae]=(0,X.useState)(null),[je,Me]=(0,X.useState)(!1),[Ne,Pe]=(0,X.useState)(!1);(0,X.useEffect)(()=>{if(!O){Pe(!1);return}async function e(){let e=O.plugin.manifest.mcpServers,t=!1;if(e&&(t=typeof e==`string`&>(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&>(e))),!t)try{let e=Tn.join(O.plugin.path,`..`),n=Tn.join(e,`.claude-plugin`,`marketplace.json`),r=se(await En.readFile(n,`utf-8`)).plugins?.find(e=>e.name===O.plugin.name);if(r?.mcpServers){let e=r.mcpServers;t=typeof e==`string`&>(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&>(e))}}catch(e){ue(`Failed to read raw marketplace.json: ${e}`)}Pe(t)}e()},[O]),(0,X.useEffect)(()=>{async function e(){ce(!0);try{let{enabled:e,disabled:t}=await Lt(),n=k(),r=Rr([...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=ve(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)),M(a);let o=[];for(let e of a)for(let t of e.installedPlugins){let n=`${t.name}@${e.name}`,r=t.isBuiltin?`builtin`:nn(n).scope;o.push({plugin:t,marketplace:e.name,scope:r,pendingEnable:void 0,pendingUpdate:!1})}ae(o),xe(0)}finally{ce(!1)}}e()},[]),(0,X.useEffect)(()=>{if(!fe.current&&i&&j.length>0&&!oe){let{name:e,marketplace:n}=Bt(i),r=o??n,a=r?j.filter(e=>e.name===r):j;for(let t of a){let n=t.installedPlugins.find(t=>t.name===e);if(n){let{scope:e}=nn(`${n.name}@${t.name}`);A({plugin:n,marketplace:t.name,scope:e,pendingEnable:void 0,pendingUpdate:!1}),w(`plugin-details`),I.current=c,fe.current=!0;return}}let s=he.find(t=>t.type===`failed-plugin`&&t.name===e);s&&s.type===`failed-plugin`&&(w({type:`failed-plugin-details`,plugin:{id:s.id,name:s.name,marketplace:s.marketplace,errors:s.errors,scope:s.scope}}),fe.current=!0),!fe.current&&c&&(fe.current=!0,t(`Plugin "${i}" is not installed in this project`))}},[i,o,j,oe,he,c,t]);let Fe=async r=>{if(!O)return;let i=O.scope||`user`,a=i===`builtin`;if(a&&(r===`update`||r===`uninstall`)){z(`Built-in plugins cannot be updated or uninstalled.`);return}if(!a&&!tn(i)&&r!==`update`){z(`This plugin is managed by your organization. Contact your admin to disable it.`);return}De(!0),z(null);try{let o=`${O.plugin.name}@${O.marketplace}`,s;switch(r){case`enable`:{let e=await Zt(o);if(!e.success)throw Error(e.message);break}case`disable`:{let e=await en(o);if(!e.success)throw Error(e.message);s=e.reverseDependents;break}case`uninstall`:{if(a||!tn(i))break;if(an(o)){De(!1),w(`confirm-project-uninstall`);return}let e=Le().plugins[o],t=!e||e.length<=1?await Oe(o):null;if(t){De(!1),w({type:`confirm-data-cleanup`,size:t});return}let n=await Qt(o,i);if(!n.success)throw Error(n.message);s=n.reverseDependents;break}case`update`:{if(a)break;let r=await $t(o,i);if(!r.success)throw Error(r.message);if(r.alreadyUpToDate){t(`${O.plugin.name} is already at the latest version (${r.newVersion}).`),n&&await n(),e({type:`menu`});return}break}}dt();let c=`${O.plugin.name}@${O.marketplace}`;if(k()?.enabledPlugins?.[c]!==!1){De(!1),w({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} ${O.plugin.name}${u}. Run /reload-plugins to apply.`),n&&await n(),e({type:`menu`})}catch(e){De(!1),z(`Failed to ${r}: ${e instanceof Error?e.message:String(e)}`),_e(P(e))}},Ie=(0,X.useRef)(Fe);Ie.current=Fe,(0,X.useEffect)(()=>{if(S===`plugin-details`&&O&&I.current){let e=I.current;I.current=void 0,Ie.current(e)}},[S,O]);let Re=Br.useCallback(()=>{if(be>=ye.length)return;let e=ye[be];if(e?.type!==`flagged-plugin`)if(e?.type===`plugin`){let t=`${e.plugin.name}@${e.marketplace}`,n=k(),r=F.get(t),i=n?.enabledPlugins?.[t]!==!1,a=e.scope;if(a===`builtin`||tn(a)){let e=new Map(F);r?(e.delete(t),(async()=>{try{r===`will-disable`?await Zt(t):await en(t),dt()}catch(e){_e(e)}})()):(e.set(t,i?`will-disable`:`will-enable`),(async()=>{try{i?await en(t):await Zt(t),dt()}catch(e){_e(e)}})()),le(e)}}else e?.type===`mcp`&&pe(e.client.name)},[be,ye,F,N,pe]);v({"select:previous":()=>{be===0?b(!0):Ce.handleSelectionChange(be-1,xe)},"select:next":()=>{be<ye.length-1&&Ce.handleSelectionChange(be+1,xe)},"select:accept":Br.useCallback(()=>{if(be>=ye.length)return;let e=ye[be];if(e?.type===`plugin`){let t=N.find(t=>t.plugin.name===e.plugin.name&&t.marketplace===e.marketplace);t&&(A(t),w(`plugin-details`),Te(0),z(null))}else e?.type===`flagged-plugin`?(w({type:`flagged-detail`,plugin:{id:e.id,name:e.name,marketplace:e.marketplace,reason:e.reason,text:e.text,flaggedAt:e.flaggedAt}}),z(null)):e?.type===`failed-plugin`?(w({type:`failed-plugin-details`,plugin:{id:e.id,name:e.name,marketplace:e.marketplace,errors:e.errors,scope:e.scope}}),Te(0),z(null)):e?.type===`mcp`&&(w({type:`mcp-detail`,client:e.client}),z(null))},[be,ye,N])},{context:`Select`,isActive:S===`plugin-list`&&!_}),v({"plugin:toggle":Re},{context:`Plugin`,isActive:S===`plugin-list`&&!_}),v({"select:accept":Br.useCallback(()=>{typeof S!=`object`||S.type!==`flagged-detail`||(hn(S.plugin.id),w(`plugin-list`))},[S])},{context:`Select`,isActive:typeof S==`object`&&S.type===`flagged-detail`});let ze=Br.useMemo(()=>{if(S!==`plugin-details`||!O)return[];let e=k(),t=`${O.plugin.name}@${O.marketplace}`,n=e?.enabledPlugins?.[t]!==!1,r=O.marketplace===`builtin`,i=[];return i.push({label:n?`Disable plugin`:`Enable plugin`,action:()=>void Fe(n?`disable`:`enable`)}),r||(i.push({label:O.pendingUpdate?`Unmark for update`:`Mark for update`,action:async()=>{try{let e=await Lr(O.plugin.name,O.marketplace);if(e){z(e);return}let t=[...N],n=t.findIndex(e=>e.plugin.name===O.plugin.name&&e.marketplace===O.marketplace);n!==-1&&(t[n].pendingUpdate=!O.pendingUpdate,ae(t),A({...O,pendingUpdate:!O.pendingUpdate}))}catch(e){z(e instanceof Error?e.message:`Failed to check plugin update availability`)}}}),Ne&&i.push({label:`Configure`,action:async()=>{Me(!0);try{let e=O.plugin.manifest.mcpServers,t=null;if(typeof e==`string`&>(e))t=e;else if(Array.isArray(e)){for(let n of e)if(typeof n==`string`&>(n)){t=n;break}}if(!t){z(`No MCPB file found in plugin`),Me(!1);return}let n=`${O.plugin.name}@${O.marketplace}`,r=await nt(t,O.plugin.path,n,void 0,void 0,!0);`status`in r&&r.status===`needs-config`?(Ae(r),w(`configuring`)):z(`Failed to load MCPB for configuration`)}catch(e){z(`Failed to load configuration: ${de(e)}`)}finally{Me(!1)}}}),O.plugin.manifest.userConfig&&Object.keys(O.plugin.manifest.userConfig).length>0&&i.push({label:`Configure options`,action:()=>{w({type:`configuring-options`,schema:O.plugin.manifest.userConfig})}}),i.push({label:`Update now`,action:()=>void Fe(`update`)}),i.push({label:`Uninstall`,action:()=>void Fe(`uninstall`)})),O.plugin.manifest.homepage&&i.push({label:`Open homepage`,action:()=>void Ut(O.plugin.manifest.homepage)}),O.plugin.manifest.repository&&i.push({label:`View repository`,action:()=>void Ut(O.plugin.manifest.repository)}),i.push({label:`Back to plugin list`,action:()=>{w(`plugin-list`),A(null),z(null)}}),i},[S,O,Ne,N]);if(v({"select:previous":()=>{we>0&&Te(we-1)},"select:next":()=>{we<ze.length-1&&Te(we+1)},"select:accept":()=>{ze[we]&&ze[we].action()}},{context:`Select`,isActive:S===`plugin-details`&&!!O}),v({"select:accept":()=>{typeof S==`object`&&S.type===`failed-plugin-details`&&(async()=>{De(!0),z(null);let e=S.plugin.id,t=S.plugin.scope,r=tn(t)?await Qt(e,t,!1):await Qt(e,`user`,!1),i=r.success;if(!i){for(let t of[`userSettings`,`projectSettings`,`localSettings`]){let n=re(t);n?.enabledPlugins?.[e]!==void 0&&(ie(t,{enabledPlugins:{...n.enabledPlugins,[e]:void 0}}),i=!0)}dt()}i?(n&&await n(),De(!1),w(`plugin-list`)):(De(!1),z(r.message))})()}},{context:`Select`,isActive:typeof S==`object`&&S.type===`failed-plugin-details`&&S.plugin.scope!==`managed`}),v({"confirm:yes":()=>{if(!O)return;De(!0),z(null);let r=`${O.plugin.name}@${O.marketplace}`,{error:i}=ie(`localSettings`,{enabledPlugins:{...re(`localSettings`)?.enabledPlugins,[r]:!1}});if(i){De(!1),z(`Failed to write settings: ${i.message}`);return}dt(),t(`✓ Disabled ${O.plugin.name} in .claude/settings.local.json. Run /reload-plugins to apply.`),n&&n(),e({type:`menu`})},"confirm:no":()=>{w(`plugin-details`),z(null)}},{context:`Confirmation`,isActive:S===`confirm-project-uninstall`&&!!O&&!Ee}),ne((r,i)=>{if(!O)return;let o=`${O.plugin.name}@${O.marketplace}`,s=O.scope;if(!s||s===`builtin`||!tn(s))return;let c=async r=>{De(!0),z(null);try{let i=await Qt(o,s,r);if(!i.success)throw Error(i.message);dt();let c=r?``:` · data preserved`;t(`${a.tick} ${i.message}${c}`),n&&n(),e({type:`menu`})}catch(e){De(!1),z(e instanceof Error?e.message:String(e))}};r===`y`||r===`Y`?c(!0):r===`n`||r===`N`?c(!1):i.escape&&(w(`plugin-details`),z(null))},{isActive:typeof S==`object`&&S.type===`confirm-data-cleanup`&&!!O&&!Ee}),Br.useEffect(()=>{xe(0)},[T]),ne((e,t)=>{let n=!t.ctrl&&!t.meta;_||(e===`/`&&n?(b(!0),E(``),xe(0)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==` `&&(b(!0),E(e),xe(0)))},{isActive:S===`plugin-list`}),oe)return(0,Z.jsx)(p,{children:`Loading installed plugins…`});if(he.length===0)return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsx)(C,{marginBottom:1,children:(0,Z.jsx)(p,{bold:!0,children:`Manage plugins`})}),(0,Z.jsx)(p,{children:`No plugins or MCP servers installed.`}),(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{dimColor:!0,children:`Esc to go back`})})]});if(typeof S==`object`&&S.type===`plugin-options`&&O){let r=`${O.plugin.name}@${O.marketplace}`;function i(r){t(r),n&&n(),e({type:`menu`})}return(0,Z.jsx)(er,{plugin:O.plugin,pluginId:r,onDone:(e,t)=>{switch(e){case`configured`:i(`✓ Enabled and configured ${O.plugin.name}. Run /reload-plugins to apply.`);break;case`skipped`:i(`✓ Enabled ${O.plugin.name}. Run /reload-plugins to apply.`);break;case`error`:i(`Failed to save configuration: ${t}`);break}}})}if(typeof S==`object`&&S.type===`configuring-options`&&O){let e=`${O.plugin.name}@${O.marketplace}`;return(0,Z.jsx)(Yn,{title:`Configure ${O.plugin.name}`,subtitle:`Plugin options`,configSchema:S.schema,initialValues:bt(e),onSave:n=>{try{wt(e,n,S.schema),dt(),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){z(`Failed to save configuration: ${de(e)}`)}w(`plugin-details`)},onCancel:()=>w(`plugin-details`)})}if(S===`configuring`&&ke&&O){let e=`${O.plugin.name}@${O.marketplace}`;async function n(n){if(!(!ke||!O))try{let r=O.plugin.manifest.mcpServers,i=null;if(typeof r==`string`&>(r))i=r;else if(Array.isArray(r)){for(let e of r)if(typeof e==`string`&>(e)){i=e;break}}if(!i){z(`No MCPB file found`),w(`plugin-details`);return}await nt(i,O.plugin.path,e,void 0,n),z(null),Ae(null),w(`plugin-details`),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){z(`Failed to save configuration: ${de(e)}`),w(`plugin-details`)}}function r(){Ae(null),w(`plugin-details`)}return(0,Z.jsx)(Yn,{title:`Configure ${ke.manifest.name}`,subtitle:`Plugin: ${O.plugin.name}`,configSchema:ke.configSchema,initialValues:ke.existingConfig,onSave:n,onCancel:r})}if(typeof S==`object`&&S.type===`flagged-detail`){let e=S.plugin;return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsx)(C,{children:(0,Z.jsxs)(p,{bold:!0,children:[e.name,` @ `,e.marketplace]})}),(0,Z.jsxs)(C,{marginBottom:1,children:[(0,Z.jsx)(p,{dimColor:!0,children:`Status: `}),(0,Z.jsx)(p,{color:`error`,children:`Removed`})]}),(0,Z.jsxs)(C,{marginBottom:1,flexDirection:`column`,children:[(0,Z.jsxs)(p,{color:`error`,children:[`Removed from marketplace · reason: `,e.reason]}),(0,Z.jsx)(p,{children:e.text}),(0,Z.jsxs)(p,{dimColor:!0,children:[`Flagged on `,new Date(e.flaggedAt).toLocaleDateString()]})]}),(0,Z.jsx)(C,{marginTop:1,flexDirection:`column`,children:(0,Z.jsxs)(C,{children:[(0,Z.jsxs)(p,{children:[a.pointer,` `]}),(0,Z.jsx)(p,{color:`suggestion`,children:`Dismiss`})]})}),(0,Z.jsxs)(g,{children:[(0,Z.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`dismiss`}),(0,Z.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})]})}if(S===`confirm-project-uninstall`&&O)return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsxs)(p,{bold:!0,color:`warning`,children:[O.plugin.name,` is enabled in .claude/settings.json (shared with your team)`]}),(0,Z.jsxs)(C,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(p,{children:`Disable it just for you in .claude/settings.local.json?`}),(0,Z.jsx)(p,{dimColor:!0,children:`This has the same effect as uninstalling, without affecting other contributors.`})]}),L&&(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{color:`error`,children:L})}),(0,Z.jsx)(C,{marginTop:1,children:Ee?(0,Z.jsx)(p,{dimColor:!0,children:`Disabling…`}):(0,Z.jsxs)(g,{children:[(0,Z.jsx)(R,{action:`confirm:yes`,context:`Confirmation`,fallback:`y`,description:`disable`}),(0,Z.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]});if(typeof S==`object`&&S.type===`confirm-data-cleanup`&&O)return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsxs)(p,{bold:!0,children:[O.plugin.name,` has `,S.size.human,` of persistent data`]}),(0,Z.jsxs)(C,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(p,{children:`Delete it along with the plugin?`}),(0,Z.jsx)(p,{dimColor:!0,children:pt(`${O.plugin.name}@${O.marketplace}`)})]}),L&&(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{color:`error`,children:L})}),(0,Z.jsx)(C,{marginTop:1,children:Ee?(0,Z.jsx)(p,{dimColor:!0,children:`Uninstalling…`}):(0,Z.jsxs)(p,{children:[(0,Z.jsx)(p,{bold:!0,children:`y`}),` to delete · `,(0,Z.jsx)(p,{bold:!0,children:`n`}),` to keep · `,(0,Z.jsx)(p,{bold:!0,children:`esc`}),` to cancel`]})})]});if(S===`plugin-details`&&O){let e=k(),t=`${O.plugin.name}@${O.marketplace}`,n=e?.enabledPlugins?.[t]!==!1,r=m.filter(e=>`plugin`in e&&e.plugin===O.plugin.name||e.source===t||e.source.startsWith(`${O.plugin.name}@`)),i=r.length===0?null:(0,Z.jsxs)(C,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsxs)(p,{bold:!0,color:`error`,children:[r.length,` `,Se(r.length,`error`),`:`]}),r.map((e,t)=>{let n=Ar(e);return(0,Z.jsxs)(C,{flexDirection:`column`,marginLeft:2,children:[(0,Z.jsx)(p,{color:`error`,children:kr(e)}),n&&(0,Z.jsxs)(p,{dimColor:!0,italic:!0,children:[a.arrowRight,` `,n]})]},t)})]});return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsx)(C,{children:(0,Z.jsxs)(p,{bold:!0,children:[O.plugin.name,` @ `,O.marketplace]})}),(0,Z.jsxs)(C,{children:[(0,Z.jsx)(p,{dimColor:!0,children:`Scope: `}),(0,Z.jsx)(p,{children:O.scope||`user`})]}),O.plugin.manifest.version&&(0,Z.jsxs)(C,{children:[(0,Z.jsx)(p,{dimColor:!0,children:`Version: `}),(0,Z.jsx)(p,{children:O.plugin.manifest.version})]}),O.plugin.manifest.description&&(0,Z.jsx)(C,{marginBottom:1,children:(0,Z.jsx)(p,{children:O.plugin.manifest.description})}),O.plugin.manifest.author&&(0,Z.jsxs)(C,{children:[(0,Z.jsx)(p,{dimColor:!0,children:`Author: `}),(0,Z.jsx)(p,{children:O.plugin.manifest.author.name})]}),(0,Z.jsxs)(C,{marginBottom:1,children:[(0,Z.jsx)(p,{dimColor:!0,children:`Status: `}),(0,Z.jsx)(p,{color:n?`success`:`warning`,children:n?`Enabled`:`Disabled`}),O.pendingUpdate&&(0,Z.jsx)(p,{color:`suggestion`,children:` · Marked for update`})]}),(0,Z.jsx)(Ir,{plugin:O.plugin,marketplace:O.marketplace}),i,(0,Z.jsx)(C,{marginTop:1,flexDirection:`column`,children:ze.map((e,t)=>{let n=t===we;return(0,Z.jsxs)(C,{children:[n&&(0,Z.jsxs)(p,{children:[a.pointer,` `]}),!n&&(0,Z.jsx)(p,{children:` `}),(0,Z.jsx)(p,{bold:n,color:e.label.includes(`Uninstall`)?`error`:e.label.includes(`Update`)?`suggestion`:void 0,children:e.label})]},t)})}),Ee&&(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{children:`Processing…`})}),L&&(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{color:`error`,children:L})}),(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(g,{children:[(0,Z.jsx)(R,{action:`select:previous`,context:`Select`,fallback:`↑`,description:`navigate`}),(0,Z.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,Z.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(typeof S==`object`&&S.type===`failed-plugin-details`){let e=S.plugin,t=e.errors[0],n=t?kr(t):`Failed to load`;return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsxs)(p,{children:[(0,Z.jsx)(p,{bold:!0,children:e.name}),(0,Z.jsxs)(p,{dimColor:!0,children:[` @ `,e.marketplace]}),(0,Z.jsxs)(p,{dimColor:!0,children:[` (`,e.scope,`)`]})]}),(0,Z.jsx)(p,{color:`error`,children:n}),e.scope===`managed`?(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{dimColor:!0,children:`Managed by your organization — contact your admin`})}):(0,Z.jsxs)(C,{marginTop:1,children:[(0,Z.jsxs)(p,{color:`suggestion`,children:[a.pointer,` `]}),(0,Z.jsx)(p,{bold:!0,children:`Remove`})]}),Ee&&(0,Z.jsx)(p,{children:`Processing…`}),L&&(0,Z.jsx)(p,{color:`error`,children:L}),(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(g,{children:[e.scope!==`managed`&&(0,Z.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`remove`}),(0,Z.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(typeof S==`object`&&S.type===`mcp-detail`){let e=S.client,n=He(u,e.name).length,r=()=>{w({type:`mcp-tools`,client:e})},i=()=>{w(`plugin-list`)},a=e=>{e&&t(e),w(`plugin-list`)},o=e.config.scope,s=e.config.type;return s===`stdio`?(0,Z.jsx)(Fn,{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)(Nn,{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)(Nn,{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)(Nn,{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}):(w(`plugin-list`),null)}if(typeof S==`object`&&S.type===`mcp-tools`){let e=S.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)(Vn,{server:r,onSelectTool:t=>{w({type:`mcp-tool-detail`,client:e,tool:t})},onBack:()=>w({type:`mcp-detail`,client:e})})}if(typeof S==`object`&&S.type===`mcp-tool-detail`){let{client:e,tool:t}=S,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)(Rn,{tool:t,server:i,onBack:()=>w({type:`mcp-tools`,client:e})})}let Be=Ce.getVisibleItems(ye);return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsx)(C,{marginBottom:1,children:(0,Z.jsx)(f,{query:T,isFocused:_,isTerminalFocused:x,width:ee-4,cursorOffset:D})}),ye.length===0&&T&&(0,Z.jsx)(C,{marginBottom:1,children:(0,Z.jsxs)(p,{dimColor:!0,children:[`No items match "`,T,`"`]})}),Ce.scrollPosition.canScrollUp&&(0,Z.jsx)(C,{children:(0,Z.jsxs)(p,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),Be.map((e,t)=>{let n=Ce.toActualIndex(t)===be&&!_,r=t>0?Be[t-1]:null,i=!r||r.scope!==e.scope;return(0,Z.jsxs)(Br.Fragment,{children:[i&&(0,Z.jsx)(C,{marginTop:+(t>0),paddingLeft:2,children:(0,Z.jsx)(p,{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)(Mr,{item:e,isSelected:n})]},e.id)}),Ce.scrollPosition.canScrollDown&&(0,Z.jsx)(C,{children:(0,Z.jsxs)(p,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),(0,Z.jsx)(C,{marginTop:1,marginLeft:1,children:(0,Z.jsx)(p,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(g,{children:[(0,Z.jsx)(p,{children:`type to search`}),(0,Z.jsx)(R,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,Z.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,Z.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})}),F.size>0&&(0,Z.jsx)(C,{marginLeft:1,children:(0,Z.jsx)(p,{dimColor:!0,italic:!0,children:`Run /reload-plugins to apply changes`})})]})}var Br,X,Z,Vr=e((()=>{i(),Br=t(l(),1),X=t(l(),1),L(),x(),Pn(),Ln(),Bn(),Wn(),bn(),Sn(),Kt(),Gt(),Vt(),vn(),Ie(),rn(),ht(),ye(),Wt(),le(),F(),ge(),lt(),Pe(),Ct(),Qe(),De(),gn(),zt(),Pt(),Ye(),Fe(),Yt(),j(),ce(),we(),jr(),Qn(),rr(),Nr(),hr(),Z=w()}));function Hr(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 Ur=e((()=>{}));function Wr({onComplete:e,path:t}){return(0,Gr.useEffect)(()=>{async function n(){if(!t){e(`Usage: /plugin validate <path>
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{s as n,u as r}from"./envUtils-BWeoiL4Y.js";import{n as i,t as a}from"./figures-gfT9mM8P.js";import{Cn as o,F as s,Q as c,Rn as l,T as u,Ut as d,_ as f,b as p,f as m,g as h,h as g,n as _,nt as v,p as y,r as b,t as x,tn as ee,tt as te,v as S,x as C,xt as ne}from"./src-Di342QoJ.js";import{t as w}from"./jsx-runtime-D-D469L8.js";import{Jo as T,Qa as re,Qo as E,Yo as D,Zt as O,lo as ie,no as k,on as A,oo as j,ps as M,us as N,wc as ae,yc as oe}from"./paths-BZjPDxMm.js";import{D as se,E as ce,J as P,U as F,l as le,p as ue,z as de}from"./debug-otxXY3j-.js";import{n as fe,r as I}from"./analytics-DqMQntaB.js";import{l as pe,u as me}from"./oauth-CdZEzMww.js";import{c as he,o as ge,s as _e}from"./log-DSV4Ht5l.js";import{b as ve,x as ye}from"./teammate-CbskW5G9.js";import{T as be,x as xe}from"./startupProfiler-CBcN1Chw.js";import{l as Se,n as Ce,o as we}from"./stringUtils-KZoO4GUd.js";import{$C as Te,$s as Ee,AA as De,DA as Oe,DC as L,EC as R,Fs as z,Is as ke,JC as Ae,Js as je,Jx as Me,Ky as Ne,Ms as Pe,Oh as Fe,Ow as Ie,Rs as Le,Rw as Re,Ry as ze,Sw as Be,Ts as Ve,Tw as He,Vs as Ue,Vw as We,Ws as Ge,Wy as Ke,Zs as qe,aS as Je,aT as Ye,ac as Xe,bw as Ze,cT as Qe,cc as $e,cj as et,dS as tt,dT as nt,dc as rt,eT as it,ew as at,fC as ot,fS as st,fT as ct,gc as lt,gw as ut,hc as dt,iT as ft,jA as pt,kh as mt,lC as ht,lT as gt,lc as _t,nc as vt,nw as yt,oT as bt,oc as xt,pc as St,qs as Ct,sT as wt,sc as Tt,sj as Et,tS as Dt,tT as Ot,tc as kt,tj as At,uC as jt,uT as Mt,uc as Nt,vs as Pt,ws as Ft,ww as It,ys as Lt,yw as Rt}from"./loadAgentsDir-BYWykYwn.js";import{i as zt,o as Bt,p as Vt,u as Ht}from"./xml-DOXio8vw.js";import{n as Ut,t as Wt}from"./browser-Bt-ckCaU.js";import{t as Gt}from"./useKeybinding-DPOUuymz.js";import{t as Kt}from"./useTerminalSize-Du-EamDN.js";import{n as qt,t as Jt}from"./useExitOnCtrlCDWithKeybindings-BHi41Ku_.js";import{n as Yt,t as Xt}from"./pluginStartupCheck-DCxJJkYs.js";import{a as Zt,d as Qt,f as $t,i as en,l as tn,o as nn,s as rn,u as an}from"./pluginOperations-COyT4tHs.js";import{a as on,c as sn,i as cn,n as ln,o as un,s as dn,t as fn}from"./validatePlugin-8EMSASvV.js";import{a as pn,n as mn,o as hn,r as gn}from"./pluginFlagging-DwChUZMJ.js";import{i as _n,n as vn,r as yn}from"./MCPConnectionManager-N-oJu3qn.js";import{t as bn}from"./SearchBox-Bu4gYF0J.js";import{n as xn,t as Sn}from"./useSearchInput-BpMLsxaS.js";import{i as Cn,n as wn}from"./pluginAutoupdate-Bg7JMOHN.js";import*as Tn from"path";import*as En from"fs/promises";function Dn({serverToolsCount:e,serverPromptsCount:t,serverResourcesCount:n}){let r=[];return e>0&&r.push(`tools`),n>0&&r.push(`resources`),t>0&&r.push(`prompts`),(0,On.jsxs)(C,{children:[(0,On.jsx)(p,{bold:!0,children:`Capabilities: `}),(0,On.jsx)(p,{color:`text`,children:r.length>0?(0,On.jsx)(g,{children:r}):`none`})]})}var On,kn=e((()=>{l(),x(),On=w()}));function An(e,t){switch(e.client.type){case`connected`:return{message:`Reconnected to ${t}.`,success:!0};case`needs-auth`:return{message:`${t} requires authentication. Use the 'Authenticate' option.`,success:!1};case`failed`:return{message:`Failed to reconnect to ${t}.`,success:!1};default:return{message:`Unknown result when reconnecting to ${t}.`,success:!1}}}function jn(e,t){return`Error reconnecting to ${t}: ${e instanceof Error?e.message:String(e)}`}var Mn=e((()=>{}));function Nn({server:e,serverToolsCount:t,onViewTools:n,onCancel:r,onComplete:i,borderless:o=!1}){let[l]=u(),d=qt(),{columns:f}=s(),[m,_]=B.useState(!1),[v,y]=B.useState(null),b=jt(e=>e.mcp),x=ot(),[w,T]=B.useState(null),[re,E]=(0,B.useState)(!1),D=(0,B.useRef)(null),[ie,k]=(0,B.useState)(!1),[A,j]=(0,B.useState)(null),[M,N]=(0,B.useState)(!1),[ae,oe]=(0,B.useState)(null),[se,ce]=(0,B.useState)(!1),[P,F]=(0,B.useState)(!1),le=(0,B.useRef)(void 0),ue=(0,B.useRef)(!1),[fe,me]=(0,B.useState)(``),[ge,_e]=(0,B.useState)(0),[ve,ye]=(0,B.useState)(null);(0,B.useEffect)(()=>()=>{ue.current=!0,D.current?.abort(),le.current!==void 0&&clearTimeout(le.current)},[]);let be=e.isAuthenticated||e.client.type===`connected`&&t>0,xe=yn(),Se=B.useCallback(async()=>{k(!1),j(null),E(!0);try{let t=await xe(e.name),n=t.client.type===`connected`;I(`tengu_claudeai_mcp_auth_completed`,{success:n}),n?i?.(`Authentication successful. Connected to ${e.name}.`):t.client.type===`needs-auth`?i?.(`Authentication successful, but server still requires authentication. You may need to manually restart Claude Code.`):i?.(`Authentication successful, but server reconnection failed. You may need to manually restart Claude Code for the changes to take effect.`)}catch(t){I(`tengu_claudeai_mcp_auth_completed`,{success:!1}),i?.(jn(t,e.name))}finally{E(!1)}},[xe,e.name,i]),we=B.useCallback(async()=>{await Me(e.name,{...e.config,scope:e.scope}),x(t=>{let n=t.mcp.clients.map(t=>t.name===e.name?{...t,type:`needs-auth`}:t),r=Be(t.mcp.tools,e.name),i=Rt(t.mcp.commands,e.name),a=Ze(t.mcp.resources,e.name);return{...t,mcp:{...t.mcp,clients:n,tools:r,commands:i,resources:a}}}),I(`tengu_claudeai_mcp_clear_auth_completed`,{}),i?.(`Disconnected from ${e.name}.`),N(!1),oe(null),ce(!1)},[e.name,e.config,e.scope,x,i]);te(`confirm:no`,()=>{D.current?.abort(),D.current=null,_(!1),T(null)},{context:`Confirmation`,isActive:m}),te(`confirm:no`,()=>{k(!1),j(null)},{context:`Confirmation`,isActive:ie}),te(`confirm:no`,()=>{N(!1),oe(null),ce(!1)},{context:`Confirmation`,isActive:M}),ne((e,t)=>{if(t.return&&ie&&Se(),t.return&&M)if(se)we();else{let e=`${pe().CLAUDE_AI_ORIGIN}/settings/connectors`;oe(e),ce(!0),Ut(e)}if(e===`c`&&!P){let e=w||A||ae;e&&ee(e).then(e=>{ue.current||(e&&process.stdout.write(e),F(!0),le.current!==void 0&&clearTimeout(le.current),le.current=setTimeout(F,2e3,!1))})}});let Te=Ce(String(e.name)),Ee=It(b.commands,e.name).length,De=_n(),Oe=B.useCallback(async()=>{let t=pe().CLAUDE_AI_ORIGIN,n=O()?.organizationUuid,r;r=n&&e.config.type===`claudeai-proxy`&&e.config.id?`${t}/api/organizations/${n}/mcp/start-auth/${e.config.id.startsWith(`mcprs`)?`mcpsrv`+e.config.id.slice(5):e.config.id}?product_surface=${encodeURIComponent(process.env.CLAUDE_CODE_ENTRYPOINT||`cli`)}`:`${t}/settings/connectors`,j(r),k(!0),I(`tengu_claudeai_mcp_auth_started`,{}),await Ut(r)},[e.config]),L=B.useCallback(()=>{N(!0),I(`tengu_claudeai_mcp_clear_auth_started`,{})},[]),z=B.useCallback(async()=>{let t=e.client.type!==`disabled`;try{await De(e.name),e.config.type===`claudeai-proxy`&&I(`tengu_claudeai_mcp_toggle`,{new_state:t?`disabled`:`enabled`}),r()}catch(n){i?.(`Failed to ${t?`disable`:`enable`} MCP server '${e.name}': ${de(n)}`)}},[e.client.type,e.config.type,e.name,De,r,i]),ke=B.useCallback(async()=>{if(e.config.type===`claudeai-proxy`)return;_(!0),y(null);let t=new AbortController;D.current=t;try{if(e.isAuthenticated&&e.config&&await yt(e.name,e.config,{preserveStepUpState:!0}),e.config){await at(e.name,e.config,T,t.signal,{onWaitingForCallback:e=>{ye(()=>e)}}),I(`tengu_mcp_auth_config_authenticate`,{wasAuthenticated:e.isAuthenticated});let n=await xe(e.name);if(n.client.type===`connected`){let t=be?`Authentication successful. Reconnected to ${e.name}.`:`Authentication successful. Connected to ${e.name}.`;i?.(t)}else n.client.type===`needs-auth`?i?.(`Authentication successful, but server still requires authentication. You may need to manually restart Claude Code.`):(he(e.name,`Reconnection failed after authentication`),i?.(`Authentication successful, but server reconnection failed. You may need to manually restart Claude Code for the changes to take effect.`))}}catch(e){e instanceof Error&&!(e instanceof Ae)&&y(e.message)}finally{_(!1),D.current=null,ye(null),me(``)}},[e.isAuthenticated,e.config,e.name,i,xe,be]),je=async()=>{e.config.type!==`claudeai-proxy`&&e.config&&(await yt(e.name,e.config),I(`tengu_mcp_auth_config_clear`,{}),await Me(e.name,{...e.config,scope:e.scope}),x(t=>{let n=t.mcp.clients.map(t=>t.name===e.name?{...t,type:`failed`}:t),r=Be(t.mcp.tools,e.name),i=Rt(t.mcp.commands,e.name),a=Ze(t.mcp.resources,e.name);return{...t,mcp:{...t.mcp,clients:n,tools:r,commands:i,resources:a}}}),i?.(`Authentication cleared for ${e.name}.`))};if(m){let t=e.config.type!==`claudeai-proxy`&&e.config.oauth?.xaa?` Authenticating via your identity provider`:` A browser window will open for authentication`;return(0,V.jsxs)(C,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(p,{color:`claude`,children:[`Authenticating with `,e.name,`…`]}),(0,V.jsxs)(C,{children:[(0,V.jsx)(Ke,{}),(0,V.jsx)(p,{children:t})]}),w&&(0,V.jsxs)(C,{flexDirection:`column`,children:[(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL manually `}),P?(0,V.jsx)(p,{color:`success`,children:`(Copied!)`}):(0,V.jsx)(p,{dimColor:!0,children:(0,V.jsx)(h,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,V.jsx)(c,{url:w})]}),m&&w&&ve&&(0,V.jsxs)(C,{flexDirection:`column`,marginTop:1,children:[(0,V.jsx)(p,{dimColor:!0,children:`If the redirect page shows a connection error, paste the URL from your browser's address bar:`}),(0,V.jsxs)(C,{children:[(0,V.jsxs)(p,{dimColor:!0,children:[`URL `,`>`,` `]}),(0,V.jsx)(tt,{value:fe,onChange:me,onSubmit:e=>{ve(e.trim()),me(``)},cursorOffset:ge,onChangeCursorOffset:_e,columns:f-8})]})]}),(0,V.jsx)(C,{marginLeft:3,children:(0,V.jsx)(p,{dimColor:!0,children:`Return here after authenticating in your browser. Press Esc to go back.`})})]})}if(ie)return(0,V.jsxs)(C,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(p,{color:`claude`,children:[`Authenticating with `,e.name,`…`]}),(0,V.jsxs)(C,{children:[(0,V.jsx)(Ke,{}),(0,V.jsx)(p,{children:` A browser window will open for authentication`})]}),A&&(0,V.jsxs)(C,{flexDirection:`column`,children:[(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL manually `}),P?(0,V.jsx)(p,{color:`success`,children:`(Copied!)`}):(0,V.jsx)(p,{dimColor:!0,children:(0,V.jsx)(h,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,V.jsx)(c,{url:A})]}),(0,V.jsxs)(C,{marginLeft:3,flexDirection:`column`,children:[(0,V.jsxs)(p,{color:`permission`,children:[`Press `,(0,V.jsx)(p,{bold:!0,children:`Enter`}),` after authenticating in your browser.`]}),(0,V.jsx)(p,{dimColor:!0,italic:!0,children:(0,V.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})]})]});if(M)return(0,V.jsxs)(C,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(p,{color:`claude`,children:[`Clear authentication for `,e.name]}),se?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(p,{children:`Find the MCP server in the browser and click "Disconnect".`}),ae&&(0,V.jsxs)(C,{flexDirection:`column`,children:[(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{dimColor:!0,children:`If your browser didn't open automatically, copy this URL manually `}),P?(0,V.jsx)(p,{color:`success`,children:`(Copied!)`}):(0,V.jsx)(p,{dimColor:!0,children:(0,V.jsx)(h,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,V.jsx)(c,{url:ae})]}),(0,V.jsxs)(C,{marginLeft:3,flexDirection:`column`,children:[(0,V.jsxs)(p,{color:`permission`,children:[`Press `,(0,V.jsx)(p,{bold:!0,children:`Enter`}),` when done.`]}),(0,V.jsx)(p,{dimColor:!0,italic:!0,children:(0,V.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})]})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(p,{children:`This will open claude.ai in the browser. Find the MCP server in the list and click "Disconnect".`}),(0,V.jsxs)(C,{marginLeft:3,flexDirection:`column`,children:[(0,V.jsxs)(p,{color:`permission`,children:[`Press `,(0,V.jsx)(p,{bold:!0,children:`Enter`}),` to open the browser.`]}),(0,V.jsx)(p,{dimColor:!0,italic:!0,children:(0,V.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})]})]})]});if(re)return(0,V.jsxs)(C,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(p,{color:`text`,children:[`Connecting to `,(0,V.jsx)(p,{bold:!0,children:e.name}),`…`]}),(0,V.jsxs)(C,{children:[(0,V.jsx)(Ke,{}),(0,V.jsx)(p,{children:` Establishing connection to MCP server`})]}),(0,V.jsx)(p,{dimColor:!0,children:`This may take a few moments.`})]});let Ne=[];return e.client.type===`disabled`&&Ne.push({label:`Enable`,value:`toggle-enabled`}),e.client.type===`connected`&&t>0&&Ne.push({label:`View tools`,value:`tools`}),e.config.type===`claudeai-proxy`?e.client.type===`connected`?Ne.push({label:`Clear authentication`,value:`claudeai-clear-auth`}):e.client.type!==`disabled`&&Ne.push({label:`Authenticate`,value:`claudeai-auth`}):(be&&(Ne.push({label:`Re-authenticate`,value:`reauth`}),Ne.push({label:`Clear authentication`,value:`clear-auth`})),be||Ne.push({label:`Authenticate`,value:`auth`})),e.client.type!==`disabled`&&(e.client.type!==`needs-auth`&&Ne.push({label:`Reconnect`,value:`reconnectMcpServer`}),Ne.push({label:`Disable`,value:`toggle-enabled`})),Ne.length===0&&Ne.push({label:`Back`,value:`back`}),(0,V.jsxs)(C,{flexDirection:`column`,children:[(0,V.jsxs)(C,{flexDirection:`column`,paddingX:1,borderStyle:o?void 0:`round`,children:[(0,V.jsx)(C,{marginBottom:1,children:(0,V.jsxs)(p,{bold:!0,children:[Te,` MCP Server`]})}),(0,V.jsxs)(C,{flexDirection:`column`,gap:0,children:[(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{bold:!0,children:`Status: `}),e.client.type===`disabled`?(0,V.jsxs)(p,{children:[S(`inactive`,l)(a.radioOff),` disabled`]}):e.client.type===`connected`?(0,V.jsxs)(p,{children:[S(`success`,l)(a.tick),` connected`]}):e.client.type===`pending`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(p,{dimColor:!0,children:a.radioOff}),(0,V.jsx)(p,{children:` connecting…`})]}):e.client.type===`needs-auth`?(0,V.jsxs)(p,{children:[S(`warning`,l)(a.triangleUpOutline),` needs authentication`]}):(0,V.jsxs)(p,{children:[S(`error`,l)(a.cross),` failed`]})]}),e.transport!==`claudeai-proxy`&&(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{bold:!0,children:`Auth: `}),be?(0,V.jsxs)(p,{children:[S(`success`,l)(a.tick),` authenticated`]}):(0,V.jsxs)(p,{children:[S(`error`,l)(a.cross),` not authenticated`]})]}),(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{bold:!0,children:`URL: `}),(0,V.jsx)(p,{dimColor:!0,children:e.config.url})]}),(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{bold:!0,children:`Config location: `}),(0,V.jsx)(p,{dimColor:!0,children:ut(e.scope)})]}),e.client.type===`connected`&&(0,V.jsx)(Dn,{serverToolsCount:t,serverPromptsCount:Ee,serverResourcesCount:b.resources[e.name]?.length||0}),e.client.type===`connected`&&t>0&&(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{bold:!0,children:`Tools: `}),(0,V.jsxs)(p,{dimColor:!0,children:[t,` tools`]})]})]}),v&&(0,V.jsx)(C,{marginTop:1,children:(0,V.jsxs)(p,{color:`error`,children:[`Error: `,v]})}),Ne.length>0&&(0,V.jsx)(C,{marginTop:1,children:(0,V.jsx)(Je,{options:Ne,onChange:async t=>{switch(t){case`tools`:n();break;case`auth`:case`reauth`:await ke();break;case`clear-auth`:await je();break;case`claudeai-auth`:await Oe();break;case`claudeai-clear-auth`:L();break;case`reconnectMcpServer`:E(!0);try{let t=await xe(e.name);e.config.type===`claudeai-proxy`&&I(`tengu_claudeai_mcp_reconnect`,{success:t.client.type===`connected`});let{message:n}=An(t,e.name);i?.(n)}catch(t){e.config.type===`claudeai-proxy`&&I(`tengu_claudeai_mcp_reconnect`,{success:!1}),i?.(jn(t,e.name))}finally{E(!1)}break;case`toggle-enabled`:await z();break;case`back`:r();break}},onCancel:r})})]}),(0,V.jsx)(C,{marginTop:1,children:(0,V.jsx)(p,{dimColor:!0,italic:!0,children:d.pending?(0,V.jsxs)(V.Fragment,{children:[`Press `,d.keyName,` again to exit`]}):(0,V.jsxs)(g,{children:[(0,V.jsx)(h,{shortcut:`↑↓`,action:`navigate`}),(0,V.jsx)(h,{shortcut:`Enter`,action:`select`}),(0,V.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}var B,V,Pn=e((()=>{i(),B=t(l(),1),fe(),me(),Jt(),Kt(),x(),Gt(),Te(),Dt(),vn(),Ie(),ht(),A(),Wt(),F(),ge(),we(),L(),ze(),Ne(),st(),kn(),Mn(),V=w()}));function Fn({server:e,serverToolsCount:t,onViewTools:n,onCancel:r,onComplete:i,borderless:o=!1}){let[s]=u(),c=qt(),l=jt(e=>e.mcp),d=yn(),f=_n(),[m,_]=(0,In.useState)(!1),v=In.useCallback(async()=>{let t=e.client.type!==`disabled`;try{await f(e.name),r()}catch(n){i(`Failed to ${t?`disable`:`enable`} MCP server '${e.name}': ${de(n)}`)}},[e.client.type,e.name,f,r,i]),y=Ce(String(e.name)),b=It(l.commands,e.name).length,x=[];return e.client.type!==`disabled`&&t>0&&x.push({label:`View tools`,value:`tools`}),e.client.type!==`disabled`&&x.push({label:`Reconnect`,value:`reconnectMcpServer`}),x.push({label:e.client.type===`disabled`?`Enable`:`Disable`,value:`toggle-enabled`}),x.length===0&&x.push({label:`Back`,value:`back`}),m?(0,H.jsxs)(C,{flexDirection:`column`,gap:1,padding:1,children:[(0,H.jsxs)(p,{color:`text`,children:[`Reconnecting to `,(0,H.jsx)(p,{bold:!0,children:e.name})]}),(0,H.jsxs)(C,{children:[(0,H.jsx)(Ke,{}),(0,H.jsx)(p,{children:` Restarting MCP server process`})]}),(0,H.jsx)(p,{dimColor:!0,children:`This may take a few moments.`})]}):(0,H.jsxs)(C,{flexDirection:`column`,children:[(0,H.jsxs)(C,{flexDirection:`column`,paddingX:1,borderStyle:o?void 0:`round`,children:[(0,H.jsx)(C,{marginBottom:1,children:(0,H.jsxs)(p,{bold:!0,children:[y,` MCP Server`]})}),(0,H.jsxs)(C,{flexDirection:`column`,gap:0,children:[(0,H.jsxs)(C,{children:[(0,H.jsx)(p,{bold:!0,children:`Status: `}),e.client.type===`disabled`?(0,H.jsxs)(p,{children:[S(`inactive`,s)(a.radioOff),` disabled`]}):e.client.type===`connected`?(0,H.jsxs)(p,{children:[S(`success`,s)(a.tick),` connected`]}):e.client.type===`pending`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(p,{dimColor:!0,children:a.radioOff}),(0,H.jsx)(p,{children:` connecting…`})]}):(0,H.jsxs)(p,{children:[S(`error`,s)(a.cross),` failed`]})]}),(0,H.jsxs)(C,{children:[(0,H.jsx)(p,{bold:!0,children:`Command: `}),(0,H.jsx)(p,{dimColor:!0,children:e.config.command})]}),e.config.args&&e.config.args.length>0&&(0,H.jsxs)(C,{children:[(0,H.jsx)(p,{bold:!0,children:`Args: `}),(0,H.jsx)(p,{dimColor:!0,children:e.config.args.join(` `)})]}),(0,H.jsxs)(C,{children:[(0,H.jsx)(p,{bold:!0,children:`Config location: `}),(0,H.jsx)(p,{dimColor:!0,children:ut(Re(e.name)?.scope??`dynamic`)})]}),e.client.type===`connected`&&(0,H.jsx)(Dn,{serverToolsCount:t,serverPromptsCount:b,serverResourcesCount:l.resources[e.name]?.length||0}),e.client.type===`connected`&&t>0&&(0,H.jsxs)(C,{children:[(0,H.jsx)(p,{bold:!0,children:`Tools: `}),(0,H.jsxs)(p,{dimColor:!0,children:[t,` tools`]})]})]}),x.length>0&&(0,H.jsx)(C,{marginTop:1,children:(0,H.jsx)(Je,{options:x,onChange:async t=>{if(t===`tools`)n();else if(t===`reconnectMcpServer`){_(!0);try{let{message:t}=An(await d(e.name),e.name);i?.(t)}catch(t){i?.(jn(t,e.name))}finally{_(!1)}}else t===`toggle-enabled`?await v():t===`back`&&r()},onCancel:r})})]}),(0,H.jsx)(C,{marginTop:1,children:(0,H.jsx)(p,{dimColor:!0,italic:!0,children:c.pending?(0,H.jsxs)(H.Fragment,{children:[`Press `,c.keyName,` again to exit`]}):(0,H.jsxs)(g,{children:[(0,H.jsx)(h,{shortcut:`↑↓`,action:`navigate`}),(0,H.jsx)(h,{shortcut:`Enter`,action:`select`}),(0,H.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}var In,H,Ln=e((()=>{i(),In=t(l(),1),Jt(),x(),We(),vn(),Ie(),ht(),F(),we(),L(),ze(),Ne(),kn(),Mn(),H=w()}));function Rn({tool:e,server:t,onBack:n}){let[r,i]=zn.useState(``),a=D(e.name,t.name),o=T(e.userFacingName?e.userFacingName({}):a),s=e.isReadOnly?.({})??!1,c=e.isDestructive?.({})??!1,l=e.isOpenWorld?.({})??!1;return zn.useEffect(()=>{async function t(){try{i(await e.description({},{isNonInteractiveSession:!1,toolPermissionContext:{mode:`default`,additionalWorkingDirectories:new Map,alwaysAllowRules:{},alwaysDenyRules:{},alwaysAskRules:{},isBypassPermissionsModeAvailable:!1},tools:[]}))}catch{i(`Failed to load description`)}}t()},[e]),(0,U.jsx)(m,{title:(0,U.jsxs)(U.Fragment,{children:[o,s&&(0,U.jsx)(p,{color:`success`,children:` [read-only]`}),c&&(0,U.jsx)(p,{color:`error`,children:` [destructive]`}),l&&(0,U.jsx)(p,{dimColor:!0,children:` [open-world]`})]}),subtitle:t.name,onCancel:n,inputGuide:e=>e.pending?(0,U.jsxs)(p,{children:[`Press `,e.keyName,` again to exit`]}):(0,U.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`}),children:(0,U.jsxs)(C,{flexDirection:`column`,children:[(0,U.jsxs)(C,{children:[(0,U.jsx)(p,{bold:!0,children:`Tool name: `}),(0,U.jsx)(p,{dimColor:!0,children:a})]}),(0,U.jsxs)(C,{children:[(0,U.jsx)(p,{bold:!0,children:`Full name: `}),(0,U.jsx)(p,{dimColor:!0,children:e.name})]}),r&&(0,U.jsxs)(C,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(p,{bold:!0,children:`Description:`}),(0,U.jsx)(p,{wrap:`wrap`,children:r})]}),e.inputJSONSchema&&e.inputJSONSchema.properties&&Object.keys(e.inputJSONSchema.properties).length>0&&(0,U.jsxs)(C,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(p,{bold:!0,children:`Parameters:`}),(0,U.jsx)(C,{marginLeft:2,flexDirection:`column`,children:Object.entries(e.inputJSONSchema.properties).map(([t,n])=>{let r=(e.inputJSONSchema?.required)?.includes(t);return(0,U.jsxs)(p,{children:[`• `,t,r&&(0,U.jsx)(p,{dimColor:!0,children:` (required)`}),`:`,` `,(0,U.jsx)(p,{dimColor:!0,children:typeof n==`object`&&n&&`type`in n?String(n.type):`unknown`}),typeof n==`object`&&n&&`description`in n&&(0,U.jsxs)(p,{dimColor:!0,children:[` - `,String(n.description)]})]},t)})})]})]})})}var zn,U,Bn=e((()=>{zn=t(l(),1),x(),E(),L(),U=w()}));function Vn({server:e,onSelectTool:t,onBack:n}){let r=jt(e=>e.mcp.tools),i=Hn.useMemo(()=>e.client.type===`connected`?He(r,e.name):[],[e,r]),a=i.map((t,n)=>{let r=D(t.name,e.name),i=T(t.userFacingName?t.userFacingName({}):r),a=t.isReadOnly?.({})??!1,o=t.isDestructive?.({})??!1,s=t.isOpenWorld?.({})??!1,c=[];return a&&c.push(`read-only`),o&&c.push(`destructive`),s&&c.push(`open-world`),{label:i,value:n.toString(),description:c.length>0?c.join(`, `):void 0,descriptionColor:o?`error`:a?`success`:void 0}});return(0,Un.jsx)(m,{title:`Tools for ${e.name}`,subtitle:`${i.length} ${Se(i.length,`tool`)}`,onCancel:n,inputGuide:e=>e.pending?(0,Un.jsxs)(p,{children:[`Press `,e.keyName,` again to exit`]}):(0,Un.jsxs)(g,{children:[(0,Un.jsx)(h,{shortcut:`↑↓`,action:`navigate`}),(0,Un.jsx)(h,{shortcut:`Enter`,action:`select`}),(0,Un.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]}),children:i.length===0?(0,Un.jsx)(p,{dimColor:!0,children:`No tools available`}):(0,Un.jsx)(Je,{options:a,onChange:e=>{let n=parseInt(e,10),r=i[n];r&&t(r,n)},onCancel:n})})}var Hn,Un,Wn=e((()=>{Hn=t(l(),1),x(),E(),Ie(),ht(),we(),L(),ze(),Un=w()}));function Gn({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,Kn.useRef)(!1),[f,m]=(0,Kn.useState)(!1),[_,v]=(0,Kn.useState)(``),y=async()=>{let t=e.trim();if(!t){a(`Please enter a marketplace source`);return}let n=await on(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{m(!0),v(``);let{name:e,resolvedSource:t}=await Ue(n,e=>{v(e)});kt(e,{source:t}),dt();let r=n.source;n.source===`github`&&(r=n.repo),I(`tengu_marketplace_added`,{source_type:r}),l&&await l(),v(``),m(!1),u?s(`Successfully added marketplace: ${e}`):c({type:`browse-marketplace`,targetMarketplace:e})}catch(e){let t=P(e);_e(t),a(t.message),v(``),m(!1),s(u?`Error: ${t.message}`:null)}};return(0,Kn.useEffect)(()=>{e&&!d.current&&!i&&!o&&(d.current=!0,y())},[]),(0,W.jsxs)(C,{flexDirection:`column`,children:[(0,W.jsxs)(C,{flexDirection:`column`,paddingX:1,borderStyle:`round`,children:[(0,W.jsx)(C,{marginBottom:1,children:(0,W.jsx)(p,{bold:!0,children:`Add Marketplace`})}),(0,W.jsxs)(C,{flexDirection:`column`,children:[(0,W.jsx)(p,{children:`Enter marketplace source:`}),(0,W.jsx)(p,{dimColor:!0,children:`Examples:`}),(0,W.jsx)(p,{dimColor:!0,children:` · owner/repo (GitHub)`}),(0,W.jsx)(p,{dimColor:!0,children:` · git@github.com:owner/repo.git (SSH)`}),(0,W.jsx)(p,{dimColor:!0,children:` · https://example.com/marketplace.json`}),(0,W.jsx)(p,{dimColor:!0,children:` · ./path/to/marketplace`}),(0,W.jsx)(C,{marginTop:1,children:(0,W.jsx)(tt,{value:e,onChange:t,onSubmit:y,columns:80,cursorOffset:n,onChangeCursorOffset:r,focus:!0,showCursor:!0})})]}),f&&(0,W.jsxs)(C,{marginTop:1,children:[(0,W.jsx)(Ke,{}),(0,W.jsx)(p,{children:_||`Adding marketplace to configuration…`})]}),i&&(0,W.jsx)(C,{marginTop:1,children:(0,W.jsx)(p,{color:`error`,children:i})}),o&&(0,W.jsx)(C,{marginTop:1,children:(0,W.jsx)(p,{children:o})})]}),(0,W.jsx)(C,{marginLeft:3,children:(0,W.jsx)(p,{dimColor:!0,italic:!0,children:(0,W.jsxs)(g,{children:[(0,W.jsx)(h,{shortcut:`Enter`,action:`add`}),(0,W.jsx)(R,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})})]})}var Kn,W,qn=e((()=>{l(),Kn=t(l(),1),fe(),L(),x(),Ne(),st(),F(),ge(),lt(),Ct(),cn(),W=w()}));function Jn(e,t,n,i){let a={};for(let o of e){let e=n[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]=r(s):a[o]=s}return a}function Yn({title:e,subtitle:t,configSchema:n,initialValues:r,onSave:i,onCancel:s}){let c=Object.keys(n),l=(0,Xn.useCallback)(e=>{if(n[e]?.sensitive===!0)return``;let t=r?.[e];return t===void 0?``:String(t)},[n,r]),[u,d]=(0,Xn.useState)(0),[f,h]=(0,Xn.useState)({}),[g,_]=(0,Xn.useState)(()=>c[0]?l(c[0]):``),y=c[u],b=y?n[y]:null;if(te(`confirm:no`,s,{context:`Settings`}),v({"confirm:nextField":(0,Xn.useCallback)(()=>{if(u<c.length-1&&y){h(e=>({...e,[y]:g})),d(e=>e+1);let e=c[u+1];_(e?l(e):``)}},[u,c,y,g,l]),"confirm:yes":(0,Xn.useCallback)(()=>{if(!y)return;let e={...f,[y]:g};if(u===c.length-1)i(Jn(c,e,n,r));else{h(e),d(e=>e+1);let t=c[u+1];_(t?l(t):``)}},[y,f,g,u,c,n,i,l,r])},{context:`Confirmation`}),ne((e,t)=>{if(t.backspace||t.delete){_(e=>e.slice(0,-1));return}e&&!t.ctrl&&!t.meta&&!t.tab&&!t.return&&_(t=>t+e)}),!b||!y)return null;let x=b.sensitive===!0,ee=b.required===!0,S=x?`*`.repeat(o(g)):g;return(0,Zn.jsxs)(m,{title:e,subtitle:t,onCancel:s,isCancelActive:!1,children:[(0,Zn.jsxs)(C,{flexDirection:`column`,children:[(0,Zn.jsxs)(p,{bold:!0,children:[b.title||y,ee&&(0,Zn.jsx)(p,{color:`error`,children:` *`})]}),b.description&&(0,Zn.jsx)(p,{dimColor:!0,children:b.description}),(0,Zn.jsxs)(C,{marginTop:1,children:[(0,Zn.jsxs)(p,{children:[a.pointerSmall,` `]}),(0,Zn.jsx)(p,{children:S}),(0,Zn.jsx)(p,{children:`█`})]})]}),(0,Zn.jsxs)(C,{flexDirection:`column`,children:[(0,Zn.jsxs)(p,{dimColor:!0,children:[`Field `,u+1,` of `,c.length]}),u<c.length-1&&(0,Zn.jsx)(p,{dimColor:!0,children:`Tab: Next field · Enter: Save and continue`}),u===c.length-1&&(0,Zn.jsx)(p,{dimColor:!0,children:`Enter: Save configuration`})]})]})}var Xn,Zn,Qn=e((()=>{i(),Xn=t(l(),1),x(),Gt(),n(),Zn=w()}));async function $n(e){let{enabled:t,disabled:n}=await Lt();return[...t,...n].find(t=>t.repository===e||t.source===e)}function er({plugin:e,pluginId:t,onDone:n}){let[r]=tr.useState(()=>{let n=[],r=ft(e);Object.keys(r).length>0&&n.push({key:`top-level`,title:`Configure ${e.name}`,subtitle:`Plugin options`,schema:r,load:()=>bt(t),save:n=>wt(t,n,e.manifest.userConfig)});let i=it(e);for(let r of i)n.push({key:`channel:${r.server}`,title:`Configure ${r.displayName}`,subtitle:`Plugin: ${e.name}`,schema:r.configSchema,load:()=>Mt(t,r.server)??void 0,save:e=>ct(t,r.server,e,r.configSchema)});return n}),[i,a]=tr.useState(0),o=tr.useRef(n);if(o.current=n,tr.useEffect(()=>{r.length===0&&o.current(`skipped`)},[r.length]),r.length===0)return null;let s=r[i];function c(e){try{s.save(e)}catch(e){n(`error`,de(e));return}let t=i+1;t<r.length?a(t):n(`configured`)}return(0,nr.jsx)(Yn,{title:s.title,subtitle:s.subtitle,configSchema:s.schema,initialValues:s.load(),onSave:c,onCancel:()=>n(`skipped`)},s.key)}var tr,nr,rr=e((()=>{tr=t(l(),1),F(),Qe(),Ot(),Pt(),Ye(),Qn(),nr=w()}));function ir(){let e=Nt();return(0,ar.jsxs)(C,{marginBottom:1,children:[(0,ar.jsxs)(p,{color:`claude`,children:[a.warning,` `]}),(0,ar.jsxs)(p,{dimColor:!0,italic:!0,children:[`Make sure you trust a plugin before installing, updating, or using it. Anthropic does 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 ar,or=e((()=>{i(),l(),x(),rt(),ar=w()}));function sr(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 cr(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 lr({hasSelection:e}){return(0,ur.jsx)(C,{marginTop:1,children:(0,ur.jsx)(p,{dimColor:!0,italic:!0,children:(0,ur.jsxs)(g,{children:[e&&(0,ur.jsx)(R,{action:`plugin:install`,context:`Plugin`,fallback:`i`,description:`install`,bold:!0}),(0,ur.jsx)(R,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,ur.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,ur.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})}var ur,dr=e((()=>{l(),L(),x(),ur=w()}));function fr({totalItems:e,maxVisible:t=mr,selectedIndex:n=0}){let r=e>t,i=(0,pr.useRef)(0),a=(0,pr.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,pr.useCallback)(e=>r?e.slice(o,s):e,[r,o,s]),l=(0,pr.useCallback)(e=>o+e,[o]),u=(0,pr.useCallback)(e=>e>=o&&e<s,[o,s]),d=(0,pr.useCallback)(e=>{},[]),f=(0,pr.useCallback)(()=>{},[]),p=(0,pr.useCallback)(()=>{},[]),m=(0,pr.useCallback)((t,n)=>{n(Math.max(0,Math.min(t,e-1)))},[e]),h=(0,pr.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 pr,mr,hr=e((()=>{pr=t(l(),1),mr=5}));function gr({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:o,targetMarketplace:s,targetPlugin:c}){let[l,u]=(0,vr.useState)(`marketplace-list`),[d,f]=(0,vr.useState)(null),[m,h]=(0,vr.useState)(null),[_,y]=(0,vr.useState)([]),[b,x]=(0,vr.useState)([]),[ee,S]=(0,vr.useState)(!0),[ne,w]=(0,vr.useState)(null),[T,re]=(0,vr.useState)(0),[E,D]=(0,vr.useState)(new Set),[O,ie]=(0,vr.useState)(new Set),k=fr({totalItems:b.length,selectedIndex:T}),[A,j]=(0,vr.useState)(0),[M,N]=(0,vr.useState)(!1),[ae,oe]=(0,vr.useState)(null),[se,ce]=(0,vr.useState)(null);te(`confirm:no`,_r.useCallback(()=>{l===`plugin-list`?s?i({type:`manage-marketplaces`,targetMarketplace:s}):_.length===1?i({type:`menu`}):(u(`marketplace-list`),f(null),D(new Set)):l===`plugin-details`?(u(`plugin-list`),h(null)):i({type:`menu`})},[l,s,i,_.length]),{context:`Confirmation`}),(0,vr.useEffect)(()=>{async function e(){try{let e=await je(),{marketplaces:n,failures:r}=await St(e),i=[];for(let{name:e,config:t,data:r}of n)if(r){let n=ve(r.plugins,t=>ke(Xe(t.name,e)));i.push({name:e,totalPlugins:r.plugins.length,installedCount:n,source:_t(t.source)})}i.sort((e,t)=>e.name===`claude-plugin-directory`?-1:+(t.name===`claude-plugin-directory`)),y(i);let a=$e(r,ve(n,e=>e.data!==null));if(a)if(a.type===`warning`)ce(a.message+`. Showing available marketplaces.`);else throw Error(a.message);if(i.length===1&&!s&&!c){let e=i[0];e&&(f(e.name),u(`plugin-list`))}if(c){let n=null,r=null;for(let[t]of Object.entries(e)){let e=await Ge(t);if(e){let i=e.plugins.find(e=>e.name===c);if(i){let e=Xe(i.name,t);n={entry:i,marketplaceName:t,pluginId:e,isInstalled:z(e)},r=t;break}}}if(n&&r){let e=n.pluginId;z(e)?t(`Plugin '${e}' is already installed globally. Use '/plugin' to manage existing plugins.`):(f(r),h(n),u(`plugin-details`))}else t(`Plugin "${c}" not found in any marketplace`)}else s&&(i.some(e=>e.name===s)?(f(s),u(`plugin-list`)):t(`Marketplace "${s}" not found`))}catch(e){t(e instanceof Error?e.message:`Failed to load marketplaces`)}finally{S(!1)}}e()},[t,s,c]),(0,vr.useEffect)(()=>{if(!d)return;let e=!1;async function n(n){S(!0);try{let t=await Ge(n);if(e)return;if(!t)throw Error(`Failed to load marketplace: ${n}`);let r=[];for(let e of t.plugins){let t=Xe(e.name,n);mt(t)||r.push({entry:e,marketplaceName:n,pluginId:t,isInstalled:z(t)})}try{let t=await dn();if(e)return;w(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;ue(`Failed to fetch install counts: ${de(t)}`),r.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}x(r),re(0),D(new Set)}catch(n){if(e)return;t(n instanceof Error?n.message:`Failed to load plugins`)}finally{S(!1)}}return n(d),()=>{e=!0}},[d,t]);let P=async()=>{if(E.size===0)return;let e=b.filter(e=>E.has(e.pluginId));ie(new Set(e.map(e=>e.pluginId)));let n=0,a=0,s=[];for(let t of e){let e=await Ve({pluginId:t.pluginId,entry:t.entry,marketplaceName:t.marketplaceName,scope:`user`});e.success?n++:(a++,s.push({name:t.entry.name,reason:e.error}))}ie(new Set),D(new Set),dt(),a===0?r(`✓ Installed ${n} ${Se(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${Tt(s,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${Tt(s,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&o&&await o(),i({type:`menu`})},F=async(e,t=`user`)=>{N(!0),oe(null);let n=await Ve({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await $n(e.pluginId);if(t){N(!1),u({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),o&&await o(),i({type:`menu`})}else N(!1),oe(n.error)};(0,vr.useEffect)(()=>{e&&r(e)},[e,r]),v({"select:previous":()=>{T>0&&re(T-1)},"select:next":()=>{T<_.length-1&&re(T+1)},"select:accept":()=>{let e=_[T];e&&(f(e.name),u(`plugin-list`))}},{context:`Select`,isActive:l===`marketplace-list`}),v({"select:previous":()=>{T>0&&k.handleSelectionChange(T-1,re)},"select:next":()=>{T<b.length-1&&k.handleSelectionChange(T+1,re)},"select:accept":()=>{if(T===b.length&&E.size>0)P();else if(T<b.length){let e=b[T];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(h(e),u(`plugin-details`),j(0),oe(null)))}}},{context:`Select`,isActive:l===`plugin-list`}),v({"plugin:toggle":()=>{if(T<b.length){let e=b[T];if(e&&!e.isInstalled){let t=new Set(E);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),D(t)}}},"plugin:install":()=>{E.size>0&&P()}},{context:`Plugin`,isActive:l===`plugin-list`});let le=_r.useMemo(()=>{if(!m)return[];let e=m.entry.homepage;return cr(e,sr(m))},[m]);if(v({"select:previous":()=>{A>0&&j(A-1)},"select:next":()=>{A<le.length-1&&j(A+1)},"select:accept":()=>{if(!m)return;let e=le[A]?.action,t=m.entry.homepage,n=sr(m);e===`install-user`?F(m,`user`):e===`install-project`?F(m,`project`):e===`install-local`?F(m,`local`):e===`homepage`&&t?Ut(t):e===`github`&&n?Ut(`https://github.com/${n}`):e===`back`&&(u(`plugin-list`),h(null))}},{context:`Select`,isActive:l===`plugin-details`&&!!m}),typeof l==`object`&&l.type===`plugin-options`){let{plugin:e,pluginId:t}=l;function n(e){r(e),o&&o(),i({type:`menu`})}return(0,G.jsx)(er,{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(ee)return(0,G.jsx)(p,{children:`Loading…`});if(e)return(0,G.jsx)(p,{color:`error`,children:e});if(l===`marketplace-list`)return _.length===0?(0,G.jsxs)(C,{flexDirection:`column`,children:[(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsx)(p,{bold:!0,children:`Select marketplace`})}),(0,G.jsx)(p,{children:`No marketplaces configured.`}),(0,G.jsxs)(p,{dimColor:!0,children:[`Add a marketplace first using `,`'Add marketplace'`,`.`]}),(0,G.jsx)(C,{marginTop:1,paddingLeft:1,children:(0,G.jsx)(p,{dimColor:!0,children:(0,G.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})})})]}):(0,G.jsxs)(C,{flexDirection:`column`,children:[(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsx)(p,{bold:!0,children:`Select marketplace`})}),se&&(0,G.jsx)(C,{marginBottom:1,flexDirection:`column`,children:(0,G.jsxs)(p,{color:`warning`,children:[a.warning,` `,se]})}),_.map((e,t)=>(0,G.jsxs)(C,{flexDirection:`column`,marginBottom:+(t<_.length-1),children:[(0,G.jsx)(C,{children:(0,G.jsxs)(p,{color:T===t?`suggestion`:void 0,children:[T===t?a.pointer:` `,` `,e.name]})}),(0,G.jsx)(C,{marginLeft:2,children:(0,G.jsxs)(p,{dimColor:!0,children:[e.totalPlugins,` `,Se(e.totalPlugins,`plugin`),` available`,e.installedCount>0&&` · ${e.installedCount} already installed`,e.source&&` · ${e.source}`]})})]},e.name)),(0,G.jsx)(C,{marginTop:1,children:(0,G.jsx)(p,{dimColor:!0,italic:!0,children:(0,G.jsxs)(g,{children:[(0,G.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,G.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]});if(l===`plugin-details`&&m){let e=m.entry.homepage,t=cr(e,sr(m));return(0,G.jsxs)(C,{flexDirection:`column`,children:[(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsx)(p,{bold:!0,children:`Plugin Details`})}),(0,G.jsxs)(C,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(p,{bold:!0,children:m.entry.name}),m.entry.version&&(0,G.jsxs)(p,{dimColor:!0,children:[`Version: `,m.entry.version]}),m.entry.description&&(0,G.jsx)(C,{marginTop:1,children:(0,G.jsx)(p,{children:m.entry.description})}),m.entry.author&&(0,G.jsx)(C,{marginTop:1,children:(0,G.jsxs)(p,{dimColor:!0,children:[`By:`,` `,typeof m.entry.author==`string`?m.entry.author:m.entry.author.name]})})]}),(0,G.jsxs)(C,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(p,{bold:!0,children:`Will install:`}),m.entry.commands&&(0,G.jsxs)(p,{dimColor:!0,children:[`· Commands:`,` `,Array.isArray(m.entry.commands)?m.entry.commands.join(`, `):Object.keys(m.entry.commands).join(`, `)]}),m.entry.agents&&(0,G.jsxs)(p,{dimColor:!0,children:[`· Agents:`,` `,Array.isArray(m.entry.agents)?m.entry.agents.join(`, `):Object.keys(m.entry.agents).join(`, `)]}),m.entry.hooks&&(0,G.jsxs)(p,{dimColor:!0,children:[`· Hooks: `,Object.keys(m.entry.hooks).join(`, `)]}),m.entry.mcpServers&&(0,G.jsxs)(p,{dimColor:!0,children:[`· MCP Servers:`,` `,Array.isArray(m.entry.mcpServers)?m.entry.mcpServers.join(`, `):typeof m.entry.mcpServers==`object`?Object.keys(m.entry.mcpServers).join(`, `):`configured`]}),!m.entry.commands&&!m.entry.agents&&!m.entry.hooks&&!m.entry.mcpServers&&(0,G.jsx)(G.Fragment,{children:typeof m.entry.source==`object`&&`source`in m.entry.source&&(m.entry.source.source===`github`||m.entry.source.source===`url`||m.entry.source.source===`npm`||m.entry.source.source===`pip`)?(0,G.jsx)(p,{dimColor:!0,children:`· Component summary not available for remote plugin`}):(0,G.jsx)(p,{dimColor:!0,children:`· Components will be discovered at installation`})})]}),(0,G.jsx)(ir,{}),ae&&(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsxs)(p,{color:`error`,children:[`Error: `,ae]})}),(0,G.jsx)(C,{flexDirection:`column`,children:t.map((e,t)=>(0,G.jsxs)(C,{children:[A===t&&(0,G.jsx)(p,{children:`> `}),A!==t&&(0,G.jsx)(p,{children:` `}),(0,G.jsx)(p,{bold:A===t,children:M&&e.action===`install`?`Installing…`:e.label})]},e.action))}),(0,G.jsx)(C,{marginTop:1,paddingLeft:1,children:(0,G.jsx)(p,{dimColor:!0,children:(0,G.jsxs)(g,{children:[(0,G.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,G.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(b.length===0)return(0,G.jsxs)(C,{flexDirection:`column`,children:[(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsx)(p,{bold:!0,children:`Install plugins`})}),(0,G.jsx)(p,{dimColor:!0,children:`No new plugins available to install.`}),(0,G.jsx)(p,{dimColor:!0,children:`All plugins from this marketplace are already installed.`}),(0,G.jsx)(C,{marginLeft:3,children:(0,G.jsx)(p,{dimColor:!0,italic:!0,children:(0,G.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})})})]});let fe=k.getVisibleItems(b);return(0,G.jsxs)(C,{flexDirection:`column`,children:[(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsx)(p,{bold:!0,children:`Install Plugins`})}),k.scrollPosition.canScrollUp&&(0,G.jsx)(C,{children:(0,G.jsxs)(p,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),fe.map((t,n)=>{let r=T===k.toActualIndex(n),i=E.has(t.pluginId),o=O.has(t.pluginId);return(0,G.jsxs)(C,{flexDirection:`column`,marginBottom:n===fe.length-1&&!e?0:1,children:[(0,G.jsxs)(C,{children:[(0,G.jsxs)(p,{color:r?`suggestion`:void 0,children:[r?a.pointer:` `,` `]}),(0,G.jsxs)(p,{color:t.isInstalled?`success`:void 0,children:[t.isInstalled?a.tick:o?a.ellipsis:i?a.radioOn:a.radioOff,` `,t.entry.name,t.entry.category&&(0,G.jsxs)(p,{dimColor:!0,children:[` [`,t.entry.category,`]`]}),t.entry.tags?.includes(`community-managed`)&&(0,G.jsx)(p,{dimColor:!0,children:` [Community Managed]`}),t.isInstalled&&(0,G.jsx)(p,{dimColor:!0,children:` (installed)`}),ne&&d===`claude-plugins-official`&&(0,G.jsxs)(p,{dimColor:!0,children:[` · `,un(ne.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,G.jsxs)(C,{marginLeft:4,children:[(0,G.jsx)(p,{dimColor:!0,children:be(t.entry.description,60)}),t.entry.version&&(0,G.jsxs)(p,{dimColor:!0,children:[` · v`,t.entry.version]})]})]},t.pluginId)}),k.scrollPosition.canScrollDown&&(0,G.jsx)(C,{children:(0,G.jsxs)(p,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,G.jsx)(C,{marginTop:1,children:(0,G.jsxs)(p,{color:`error`,children:[a.cross,` `,e]})}),(0,G.jsx)(lr,{hasSelection:E.size>0})]})}var _r,vr,G,yr=e((()=>{i(),_r=t(l(),1),vr=t(l(),1),L(),x(),Gt(),ye(),Wt(),le(),F(),lt(),sn(),Pe(),rt(),Ct(),At(),Ft(),Fe(),we(),xe(),rr(),or(),dr(),hr(),G=w()}));function br({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:o,onSearchModeChange:c,targetPlugin:l}){let[u,m]=(0,K.useState)(`plugin-list`),[h,_]=(0,K.useState)(null),[y,b]=(0,K.useState)([]),[x,ee]=(0,K.useState)(!0),[S,w]=(0,K.useState)(null),[T,re]=(0,K.useState)(!1),E=(0,K.useCallback)(e=>{re(e),c?.(e)},[c]),{query:D,setQuery:O,cursorOffset:ie}=xn({isActive:u===`plugin-list`&&T&&!x,onExit:()=>{E(!1)}}),k=d(),{columns:A}=s(),j=(0,K.useMemo)(()=>{if(!D)return y;let e=D.toLowerCase();return y.filter(t=>t.entry.name.toLowerCase().includes(e)||t.entry.description?.toLowerCase().includes(e)||t.marketplaceName.toLowerCase().includes(e))},[y,D]),[M,N]=(0,K.useState)(0),[ae,oe]=(0,K.useState)(new Set),[se,ce]=(0,K.useState)(new Set),P=fr({totalItems:j.length,selectedIndex:M});(0,K.useEffect)(()=>{N(0)},[D]);let[F,le]=(0,K.useState)(0),[fe,I]=(0,K.useState)(!1),[pe,me]=(0,K.useState)(null),[he,ge]=(0,K.useState)(null),[_e,ye]=(0,K.useState)(null);(0,K.useEffect)(()=>{async function e(){try{let e=await je(),{marketplaces:n,failures:r}=await St(e),i=[];for(let{name:e,data:t}of n)if(t)for(let n of t.plugins){let t=Xe(n.name,e);i.push({entry:n,marketplaceName:e,pluginId:t,isInstalled:z(t)})}let a=i.filter(e=>!e.isInstalled&&!mt(e.pluginId));try{let e=await dn();w(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){ue(`Failed to fetch install counts: ${de(e)}`),a.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}b(a);let o=Object.keys(e).length;a.length===0&&ye(await xt({configuredMarketplaceCount:o,failedMarketplaceCount:r.length}));let s=$e(r,ve(n,e=>e.data!==null));if(s)if(s.type===`warning`)ge(s.message+`. Showing available plugins.`);else throw Error(s.message);if(l){let e=i.find(e=>e.entry.name===l);e?e.isInstalled?t(`Plugin '${e.pluginId}' is already installed. Use '/plugin' to manage existing plugins.`):(_(e),m(`plugin-details`)):t(`Plugin "${l}" not found in any marketplace`)}}catch(e){t(e instanceof Error?e.message:`Failed to load plugins`)}finally{ee(!1)}}e()},[t,l]);let xe=async()=>{if(ae.size===0)return;let e=y.filter(e=>ae.has(e.pluginId));ce(new Set(e.map(e=>e.pluginId)));let n=0,a=0,s=[];for(let t of e){let e=await Ve({pluginId:t.pluginId,entry:t.entry,marketplaceName:t.marketplaceName,scope:`user`});e.success?n++:(a++,s.push({name:t.entry.name,reason:e.error}))}ce(new Set),oe(new Set),dt(),a===0?r(`✓ Installed ${n} ${Se(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${Tt(s,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${Tt(s,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&o&&await o(),i({type:`menu`})},Ce=async(e,t=`user`)=>{I(!0),me(null);let n=await Ve({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await $n(e.pluginId);if(t){I(!1),m({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),o&&await o(),i({type:`menu`})}else I(!1),me(n.error)};(0,K.useEffect)(()=>{e&&r(e)},[e,r]),te(`confirm:no`,()=>{m(`plugin-list`),_(null)},{context:`Confirmation`,isActive:u===`plugin-details`}),te(`confirm:no`,()=>{i({type:`menu`})},{context:`Confirmation`,isActive:u===`plugin-list`&&!T}),ne((e,t)=>{let n=!t.ctrl&&!t.meta;T||(e===`/`&&n?(E(!0),O(``)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==`i`&&(E(!0),O(e)))},{isActive:u===`plugin-list`&&!x}),v({"select:previous":()=>{M===0?E(!0):P.handleSelectionChange(M-1,N)},"select:next":()=>{M<j.length-1&&P.handleSelectionChange(M+1,N)},"select:accept":()=>{if(M===j.length&&ae.size>0)xe();else if(M<j.length){let e=j[M];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(_(e),m(`plugin-details`),le(0),me(null)))}}},{context:`Select`,isActive:u===`plugin-list`&&!T}),v({"plugin:toggle":()=>{if(M<j.length){let e=j[M];if(e&&!e.isInstalled){let t=new Set(ae);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),oe(t)}}},"plugin:install":()=>{ae.size>0&&xe()}},{context:`Plugin`,isActive:u===`plugin-list`&&!T});let we=Cr.useMemo(()=>{if(!h)return[];let e=h.entry.homepage;return cr(e,sr(h))},[h]);if(v({"select:previous":()=>{F>0&&le(F-1)},"select:next":()=>{F<we.length-1&&le(F+1)},"select:accept":()=>{if(!h)return;let e=we[F]?.action,t=h.entry.homepage,n=sr(h);e===`install-user`?Ce(h,`user`):e===`install-project`?Ce(h,`project`):e===`install-local`?Ce(h,`local`):e===`homepage`&&t?Ut(t):e===`github`&&n?Ut(`https://github.com/${n}`):e===`back`&&(m(`plugin-list`),_(null))}},{context:`Select`,isActive:u===`plugin-details`&&!!h}),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)(er,{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(x)return(0,q.jsx)(p,{children:`Loading…`});if(e)return(0,q.jsx)(p,{color:`error`,children:e});if(u===`plugin-details`&&h){let e=h.entry.homepage,t=cr(e,sr(h));return(0,q.jsxs)(C,{flexDirection:`column`,children:[(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsx)(p,{bold:!0,children:`Plugin details`})}),(0,q.jsxs)(C,{flexDirection:`column`,marginBottom:1,children:[(0,q.jsx)(p,{bold:!0,children:h.entry.name}),(0,q.jsxs)(p,{dimColor:!0,children:[`from `,h.marketplaceName]}),h.entry.version&&(0,q.jsxs)(p,{dimColor:!0,children:[`Version: `,h.entry.version]}),h.entry.description&&(0,q.jsx)(C,{marginTop:1,children:(0,q.jsx)(p,{children:h.entry.description})}),h.entry.author&&(0,q.jsx)(C,{marginTop:1,children:(0,q.jsxs)(p,{dimColor:!0,children:[`By:`,` `,typeof h.entry.author==`string`?h.entry.author:h.entry.author.name]})})]}),(0,q.jsx)(ir,{}),pe&&(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsxs)(p,{color:`error`,children:[`Error: `,pe]})}),(0,q.jsx)(C,{flexDirection:`column`,children:t.map((e,t)=>(0,q.jsxs)(C,{children:[F===t&&(0,q.jsx)(p,{children:`> `}),F!==t&&(0,q.jsx)(p,{children:` `}),(0,q.jsx)(p,{bold:F===t,children:fe&&e.action.startsWith(`install-`)?`Installing…`:e.label})]},e.action))}),(0,q.jsx)(C,{marginTop:1,children:(0,q.jsx)(p,{dimColor:!0,children:(0,q.jsxs)(g,{children:[(0,q.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,q.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(y.length===0)return(0,q.jsxs)(C,{flexDirection:`column`,children:[(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsx)(p,{bold:!0,children:`Discover plugins`})}),(0,q.jsx)(Sr,{reason:_e}),(0,q.jsx)(C,{marginTop:1,children:(0,q.jsx)(p,{dimColor:!0,italic:!0,children:`Esc to go back`})})]});let Te=P.getVisibleItems(j);return(0,q.jsxs)(C,{flexDirection:`column`,children:[(0,q.jsxs)(C,{children:[(0,q.jsx)(p,{bold:!0,children:`Discover plugins`}),P.needsPagination&&(0,q.jsxs)(p,{dimColor:!0,children:[` `,`(`,P.scrollPosition.current,`/`,P.scrollPosition.total,`)`]})]}),(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsx)(f,{query:D,isFocused:T,isTerminalFocused:k,width:A-4,cursorOffset:ie})}),he&&(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsxs)(p,{color:`warning`,children:[a.warning,` `,he]})}),j.length===0&&D&&(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsxs)(p,{dimColor:!0,children:[`No plugins match "`,D,`"`]})}),P.scrollPosition.canScrollUp&&(0,q.jsx)(C,{children:(0,q.jsxs)(p,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),Te.map((t,n)=>{let r=M===P.toActualIndex(n),i=ae.has(t.pluginId),o=se.has(t.pluginId);return(0,q.jsxs)(C,{flexDirection:`column`,marginBottom:n===Te.length-1&&!e?0:1,children:[(0,q.jsxs)(C,{children:[(0,q.jsxs)(p,{color:r&&!T?`suggestion`:void 0,children:[r&&!T?a.pointer:` `,` `]}),(0,q.jsxs)(p,{children:[o?a.ellipsis:i?a.radioOn:a.radioOff,` `,t.entry.name,(0,q.jsxs)(p,{dimColor:!0,children:[` · `,t.marketplaceName]}),t.entry.tags?.includes(`community-managed`)&&(0,q.jsx)(p,{dimColor:!0,children:` [Community Managed]`}),S&&t.marketplaceName===`claude-plugins-official`&&(0,q.jsxs)(p,{dimColor:!0,children:[` · `,un(S.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,q.jsx)(C,{marginLeft:4,children:(0,q.jsx)(p,{dimColor:!0,children:be(t.entry.description,60)})})]},`${P.startIndex}-${t.pluginId}`)}),P.scrollPosition.canScrollDown&&(0,q.jsx)(C,{children:(0,q.jsxs)(p,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,q.jsx)(C,{marginTop:1,children:(0,q.jsxs)(p,{color:`error`,children:[a.cross,` `,e]})}),(0,q.jsx)(xr,{hasSelection:ae.size>0,canToggle:M<j.length&&!j[M]?.isInstalled})]})}function xr({hasSelection:e,canToggle:t}){return(0,q.jsx)(C,{marginTop:1,children:(0,q.jsx)(p,{dimColor:!0,italic:!0,children:(0,q.jsxs)(g,{children:[e&&(0,q.jsx)(R,{action:`plugin:install`,context:`Plugin`,fallback:`i`,description:`install`,bold:!0}),(0,q.jsx)(p,{children:`type to search`}),t&&(0,q.jsx)(R,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,q.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,q.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})}function Sr({reason:e}){switch(e){case`git-not-installed`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(p,{dimColor:!0,children:`Git is required to install marketplaces.`}),(0,q.jsx)(p,{dimColor:!0,children:`Please install git and restart Claude Code.`})]});case`all-blocked-by-policy`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(p,{dimColor:!0,children:`Your organization policy does not allow any external marketplaces.`}),(0,q.jsx)(p,{dimColor:!0,children:`Contact your administrator.`})]});case`policy-restricts-sources`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(p,{dimColor:!0,children:`Your organization restricts which marketplaces can be added.`}),(0,q.jsx)(p,{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)(p,{dimColor:!0,children:`Failed to load marketplace data.`}),(0,q.jsx)(p,{dimColor:!0,children:`Check your network connection.`})]});case`all-plugins-installed`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(p,{dimColor:!0,children:`All available plugins are already installed.`}),(0,q.jsx)(p,{dimColor:!0,children:`Check for new plugins later or add more marketplaces.`})]});default:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(p,{dimColor:!0,children:`No plugins available.`}),(0,q.jsx)(p,{dimColor:!0,children:`Add a marketplace first using the Marketplaces tab.`})]})}}var Cr,K,q,wr=e((()=>{i(),Cr=t(l(),1),K=t(l(),1),L(),bn(),x(),Sn(),Kt(),Gt(),ye(),Wt(),le(),F(),lt(),sn(),Pe(),rt(),Ct(),At(),Ft(),Fe(),we(),xe(),rr(),or(),dr(),hr(),q=w()}));function Tr({setViewState:e,error:t,setError:n,setResult:r,exitState:i,onManageComplete:o,targetMarketplace:s,action:c}){let[l,u]=(0,Dr.useState)([]),[d,f]=(0,Dr.useState)(!0),[m,h]=(0,Dr.useState)(0),[_,y]=(0,Dr.useState)(!1),[b,x]=(0,Dr.useState)(null),[ee,S]=(0,Dr.useState)(null),[w,T]=(0,Dr.useState)(null),[E,D]=(0,Dr.useState)(`list`),[O,k]=(0,Dr.useState)(null),[A,j]=(0,Dr.useState)(0),N=(0,Dr.useRef)(!1);(0,Dr.useEffect)(()=>{async function e(){try{let e=await je(),{enabled:r,disabled:i}=await Lt(),a=[...r,...i],{marketplaces:o,failures:l}=await St(e),d=[];for(let{name:e,config:t,data:n}of o){let r=a.filter(t=>t.source.endsWith(`@${e}`));d.push({name:e,source:_t(t.source),lastUpdated:t.lastUpdated,pluginCount:n?.plugins.length,installedPlugins:r,pendingUpdate:!1,pendingRemove:!1,autoUpdate:M(e,t)})}d.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),u(d);let f=$e(l,ve(o,e=>e.data!==null));if(f)if(f.type===`warning`)x(f.message);else throw Error(f.message);if(s&&!N.current&&!t){N.current=!0;let e=d.findIndex(e=>e.name===s);if(e>=0){let t=d[e];if(c){h(e+1);let t=[...d];c===`update`?t[e].pendingUpdate=!0:c===`remove`&&(t[e].pendingRemove=!0),u(t),setTimeout(ce,100,t)}else t&&(h(e+1),k(t),D(`details`))}else n&&n(`Marketplace not found: ${s}`)}}catch(e){n&&n(e instanceof Error?e.message:`Failed to load marketplaces`),x(e instanceof Error?e.message:`Failed to load marketplaces`)}finally{f(!1)}}e()},[s,c,t]);let oe=()=>l.some(e=>e.pendingUpdate||e.pendingRemove),se=()=>({updateCount:ve(l,e=>e.pendingUpdate),removeCount:ve(l,e=>e.pendingRemove)}),ce=async t=>{let i=t||l,s=E===`details`;y(!0),x(null),S(null),T(null);try{let t=re(`userSettings`),n=0,c=0,l=new Set;for(let e of i){if(e.pendingRemove){if(e.installedPlugins&&e.installedPlugins.length>0){let n={...t?.enabledPlugins};for(let t of e.installedPlugins){let r=Xe(t.name,e.name);n[r]=!1}ie(`userSettings`,{enabledPlugins:n})}await Ee(e.name),c++,I(`tengu_marketplace_removed`,{marketplace_name:e.name,plugins_uninstalled:e.installedPlugins?.length||0});continue}e.pendingUpdate&&(await qe(e.name,e=>{T(e)}),n++,l.add(e.name.toLowerCase()),I(`tengu_marketplace_updated`,{marketplace_name:e.name}))}let d=0;l.size>0&&(d=(await Cn(l)).length),dt(),o&&await o();let f=await je(),{enabled:p,disabled:m}=await Lt(),h=[...p,...m],{marketplaces:g}=await St(f),_=[];for(let{name:e,config:t,data:n}of g){let r=h.filter(t=>t.source.endsWith(`@${e}`));_.push({name:e,source:_t(t.source),lastUpdated:t.lastUpdated,pluginCount:n?.plugins.length,installedPlugins:r,pendingUpdate:!1,pendingRemove:!1,autoUpdate:M(e,t)})}if(_.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),u(_),s&&O){let e=_.find(e=>e.name===O.name);e&&k(e)}let v=[];if(n>0){let e=d>0?` (${d} ${Se(d,`plugin`)} bumped)`:``;v.push(`Updated ${n} ${Se(n,`marketplace`)}${e}`)}if(c>0&&v.push(`Removed ${c} ${Se(c,`marketplace`)}`),v.length>0){let t=`${a.tick} ${v.join(`, `)}`;s?S(t):(r(t),setTimeout(e,2e3,{type:`menu`}))}else s||e({type:`menu`})}catch(e){let t=de(e);x(t),n&&n(t)}finally{y(!1),T(null)}},P=async()=>{if(!O)return;let e=l.map(e=>e.name===O.name?{...e,pendingRemove:!0}:e);u(e),await ce(e)},F=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 ae()||t.push({label:e.autoUpdate?`Disable auto-update`:`Enable auto-update`,value:`toggle-auto-update`}),t.push({label:`Remove marketplace`,value:`remove`}),t},le=async e=>{let t=!e.autoUpdate;try{await vt(e.name,t),u(n=>n.map(n=>n.name===e.name?{...n,autoUpdate:t}:n)),k(e=>e&&{...e,autoUpdate:t})}catch(e){x(e instanceof Error?e.message:`Failed to update setting`)}};if(te(`confirm:no`,()=>{D(`list`),j(0)},{context:`Confirmation`,isActive:!_&&(E===`details`||E===`confirm-remove`)}),te(`confirm:no`,()=>{u(e=>e.map(e=>({...e,pendingUpdate:!1,pendingRemove:!1}))),h(0)},{context:`Confirmation`,isActive:!_&&E===`list`&&oe()}),te(`confirm:no`,()=>{e({type:`menu`})},{context:`Confirmation`,isActive:!_&&E===`list`&&!oe()}),v({"select:previous":()=>h(e=>Math.max(0,e-1)),"select:next":()=>{let e=l.length+1;h(t=>Math.min(e-1,t+1))},"select:accept":()=>{let t=m-1;if(m===0)e({type:`add-marketplace`});else if(oe())ce();else{let e=l[t];e&&(k(e),D(`details`),j(0))}}},{context:`Select`,isActive:!_&&E===`list`}),ne(e=>{let t=m-1;if((e===`u`||e===`U`)&&t>=0)u(e=>e.map((e,n)=>n===t?{...e,pendingUpdate:!e.pendingUpdate,pendingRemove:e.pendingUpdate?e.pendingRemove:!1}:e));else if((e===`r`||e===`R`)&&t>=0){let e=l[t];e&&(k(e),D(`confirm-remove`))}},{isActive:!_&&E===`list`}),v({"select:previous":()=>j(e=>Math.max(0,e-1)),"select:next":()=>{let e=F(O);j(t=>Math.min(e.length-1,t+1))},"select:accept":()=>{if(!O)return;let t=F(O)[A];if(t?.value===`browse`)e({type:`browse-marketplace`,targetMarketplace:O.name});else if(t?.value===`update`){let e=l.map(e=>e.name===O.name?{...e,pendingUpdate:!0}:e);u(e),ce(e)}else t?.value===`toggle-auto-update`?le(O):t?.value===`remove`&&D(`confirm-remove`)}},{context:`Select`,isActive:!_&&E===`details`}),ne(e=>{e===`y`||e===`Y`?P():(e===`n`||e===`N`)&&(D(`list`),k(null))},{isActive:!_&&E===`confirm-remove`}),d)return(0,J.jsx)(p,{children:`Loading marketplaces…`});if(l.length===0)return(0,J.jsxs)(C,{flexDirection:`column`,children:[(0,J.jsx)(C,{marginBottom:1,children:(0,J.jsx)(p,{bold:!0,children:`Manage marketplaces`})}),(0,J.jsxs)(C,{flexDirection:`row`,gap:1,children:[(0,J.jsxs)(p,{color:`suggestion`,children:[a.pointer,` +`]}),(0,J.jsx)(p,{bold:!0,color:`suggestion`,children:`Add Marketplace`})]}),(0,J.jsx)(C,{marginLeft:3,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:i.pending?(0,J.jsxs)(J.Fragment,{children:[`Press `,i.keyName,` again to go back`]}):(0,J.jsxs)(g,{children:[(0,J.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,J.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]});if(E===`confirm-remove`&&O){let e=O.installedPlugins?.length||0;return(0,J.jsxs)(C,{flexDirection:`column`,children:[(0,J.jsxs)(p,{bold:!0,color:`warning`,children:[`Remove marketplace `,(0,J.jsx)(p,{italic:!0,children:O.name}),`?`]}),(0,J.jsxs)(C,{flexDirection:`column`,children:[e>0&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsxs)(p,{color:`warning`,children:[`This will also uninstall `,e,` `,Se(e,`plugin`),` from this marketplace:`]})}),O.installedPlugins&&O.installedPlugins.length>0&&(0,J.jsx)(C,{flexDirection:`column`,marginTop:1,marginLeft:2,children:O.installedPlugins.map(e=>(0,J.jsxs)(p,{dimColor:!0,children:[`• `,e.name]},e.name))}),(0,J.jsx)(C,{marginTop:1,children:(0,J.jsxs)(p,{children:[`Press `,(0,J.jsx)(p,{bold:!0,children:`y`}),` to confirm or `,(0,J.jsx)(p,{bold:!0,children:`n`}),` to cancel`]})})]})]})}if(E===`details`&&O){let e=O.pendingUpdate||_,t=F(O);return(0,J.jsxs)(C,{flexDirection:`column`,children:[(0,J.jsx)(p,{bold:!0,children:O.name}),(0,J.jsx)(p,{dimColor:!0,children:O.source}),(0,J.jsx)(C,{marginTop:1,children:(0,J.jsxs)(p,{children:[O.pluginCount||0,` available `,Se(O.pluginCount||0,`plugin`)]})}),O.installedPlugins&&O.installedPlugins.length>0&&(0,J.jsxs)(C,{flexDirection:`column`,marginTop:1,children:[(0,J.jsxs)(p,{bold:!0,children:[`Installed plugins (`,O.installedPlugins.length,`):`]}),(0,J.jsx)(C,{flexDirection:`column`,marginLeft:1,children:O.installedPlugins.map(e=>(0,J.jsxs)(C,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(p,{children:a.bullet}),(0,J.jsxs)(C,{flexDirection:`column`,children:[(0,J.jsx)(p,{children:e.name}),(0,J.jsx)(p,{dimColor:!0,children:e.manifest.description})]})]},e.name))})]}),e&&(0,J.jsxs)(C,{marginTop:1,flexDirection:`column`,children:[(0,J.jsx)(p,{color:`claude`,children:`Updating marketplace…`}),w&&(0,J.jsx)(p,{dimColor:!0,children:w})]}),!e&&ee&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{color:`claude`,children:ee})}),!e&&b&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{color:`error`,children:b})}),!e&&(0,J.jsx)(C,{flexDirection:`column`,marginTop:1,children:t.map((e,t)=>{if(!e)return null;let n=t===A;return(0,J.jsxs)(C,{children:[(0,J.jsxs)(p,{color:n?`suggestion`:void 0,children:[n?a.pointer:` `,` `,e.label]}),e.secondaryLabel&&(0,J.jsxs)(p,{dimColor:!0,children:[` `,e.secondaryLabel]})]},e.value)})}),!e&&!ae()&&O.autoUpdate&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{dimColor:!0,children:`Auto-update enabled. Claude Code will automatically update this marketplace and its installed plugins.`})}),(0,J.jsx)(C,{marginLeft:3,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:e?(0,J.jsx)(J.Fragment,{children:`Please wait…`}):(0,J.jsxs)(g,{children:[(0,J.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,J.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]})}let{updateCount:ue,removeCount:fe}=se();return(0,J.jsxs)(C,{flexDirection:`column`,children:[(0,J.jsx)(C,{marginBottom:1,children:(0,J.jsx)(p,{bold:!0,children:`Manage marketplaces`})}),(0,J.jsxs)(C,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(p,{color:m===0?`suggestion`:void 0,children:[m===0?a.pointer:` `,` +`]}),(0,J.jsx)(p,{bold:!0,color:m===0?`suggestion`:void 0,children:`Add Marketplace`})]}),(0,J.jsx)(C,{flexDirection:`column`,children:l.map((e,t)=>{let n=t+1===m,r=[];return e.pendingUpdate&&r.push(`UPDATE`),e.pendingRemove&&r.push(`REMOVE`),(0,J.jsxs)(C,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(p,{color:n?`suggestion`:void 0,children:[n?a.pointer:` `,` `,e.pendingRemove?a.cross:a.bullet]}),(0,J.jsxs)(C,{flexDirection:`column`,flexGrow:1,children:[(0,J.jsxs)(C,{flexDirection:`row`,gap:1,children:[(0,J.jsxs)(p,{bold:!0,strikethrough:e.pendingRemove,dimColor:e.pendingRemove,children:[e.name===`claude-plugins-official`&&(0,J.jsx)(p,{color:`claude`,children:`✻ `}),e.name,e.name===`claude-plugins-official`&&(0,J.jsx)(p,{color:`claude`,children:` ✻`})]}),r.length>0&&(0,J.jsxs)(p,{color:`warning`,children:[`[`,r.join(`, `),`]`]})]}),(0,J.jsx)(p,{dimColor:!0,children:e.source}),(0,J.jsxs)(p,{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)})}),oe()&&(0,J.jsxs)(C,{marginTop:1,flexDirection:`column`,children:[(0,J.jsxs)(p,{children:[(0,J.jsx)(p,{bold:!0,children:`Pending changes:`}),` `,(0,J.jsx)(p,{dimColor:!0,children:`Enter to apply`})]}),ue>0&&(0,J.jsxs)(p,{children:[`• Update `,ue,` `,Se(ue,`marketplace`)]}),fe>0&&(0,J.jsxs)(p,{color:`warning`,children:[`• Remove `,fe,` `,Se(fe,`marketplace`)]})]}),_&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{color:`claude`,children:`Processing changes…`})}),b&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{color:`error`,children:b})}),(0,J.jsx)(Er,{exitState:i,hasPendingActions:oe()})]})}function Er({exitState:e,hasPendingActions:t}){return e.pending?(0,J.jsx)(C,{marginTop:1,children:(0,J.jsxs)(p,{dimColor:!0,italic:!0,children:[`Press `,e.keyName,` again to go back`]})}):(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:(0,J.jsxs)(g,{children:[t&&(0,J.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`apply changes`}),!t&&(0,J.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),!t&&(0,J.jsx)(h,{shortcut:`u`,action:`update`}),!t&&(0,J.jsx)(h,{shortcut:`r`,action:`remove`}),(0,J.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:t?`cancel`:`go back`})]})})})}var Dr,J,Or=e((()=>{i(),l(),Dr=t(l(),1),fe(),L(),x(),Gt(),ye(),oe(),F(),lt(),rt(),Ct(),wn(),Pt(),N(),j(),we(),J=w()}));function kr(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 Et(e)}function Ar(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 jr=e((()=>{et()}));function Mr({item:e,isSelected:t}){let[n]=u();if(e.type===`plugin`){let r,i;return e.pendingToggle?(r=S(`suggestion`,n)(a.arrowRight),i=e.pendingToggle===`will-enable`?`will enable`:`will disable`):e.errorCount>0?(r=S(`error`,n)(a.cross),i=`${e.errorCount} ${Se(e.errorCount,`error`)}`):e.isEnabled?(r=S(`success`,n)(a.tick),i=`enabled`):(r=S(`inactive`,n)(a.radioOff),i=`disabled`),(0,Y.jsxs)(C,{children:[(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(p,{dimColor:!t,children:[` `,(0,Y.jsx)(p,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(p,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(p,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(p,{dimColor:!t,children:i})]})}if(e.type===`flagged-plugin`){let r=S(`warning`,n)(a.warning);return(0,Y.jsxs)(C,{children:[(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(p,{dimColor:!t,children:[` `,(0,Y.jsx)(p,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(p,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(p,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(p,{dimColor:!t,children:`removed`})]})}if(e.type===`failed-plugin`){let r=S(`error`,n)(a.cross),i=`failed to load · ${e.errorCount} ${Se(e.errorCount,`error`)}`;return(0,Y.jsxs)(C,{children:[(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(p,{dimColor:!t,children:[` `,(0,Y.jsx)(p,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(p,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(p,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(p,{dimColor:!t,children:i})]})}let r,i;return e.status===`connected`?(r=S(`success`,n)(a.tick),i=`connected`):e.status===`disabled`?(r=S(`inactive`,n)(a.radioOff),i=`disabled`):e.status===`pending`?(r=S(`inactive`,n)(a.radioOff),i=`connecting…`):e.status===`needs-auth`?(r=S(`warning`,n)(a.triangleUpOutline),i=`Enter to auth`):(r=S(`error`,n)(a.cross),i=`failed`),e.indented?(0,Y.jsxs)(C,{children:[(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(p,{dimColor:!t,children:`└ `}),(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(p,{dimColor:!t,children:[` `,(0,Y.jsx)(p,{backgroundColor:`userMessageBackground`,children:`MCP`})]}),(0,Y.jsxs)(p,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(p,{dimColor:!t,children:i})]}):(0,Y.jsxs)(C,{children:[(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(p,{dimColor:!t,children:[` `,(0,Y.jsx)(p,{backgroundColor:`userMessageBackground`,children:`MCP`})]}),(0,Y.jsxs)(p,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(p,{dimColor:!t,children:i})]})}var Y,Nr=e((()=>{i(),l(),x(),we(),Y=w()}));async function Pr(e){try{return(await En.readdir(e,{withFileTypes:!0})).filter(e=>e.isFile()&&e.name.endsWith(`.md`)).map(e=>Tn.basename(e.name,`.md`))}catch(t){return ue(`Failed to read plugin components from ${e}: ${de(t)}`,{level:`error`}),_e(P(t)),[]}}async function Fr(e){try{let t=await En.readdir(e,{withFileTypes:!0}),n=[];for(let r of t)if(r.isDirectory()||r.isSymbolicLink()){let t=Tn.join(e,r.name,`SKILL.md`);try{(await En.stat(t)).isFile()&&n.push(r.name)}catch{}}return n}catch(t){return ue(`Failed to read skill directories from ${e}: ${de(t)}`,{level:`error`}),_e(P(t)),[]}}function Ir({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=Ht(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 Ge(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 Pr(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 Pr(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 Fr(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)(C,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsx)(p,{bold:!0,children:`Components:`}),(0,Z.jsxs)(p,{dimColor:!0,children:[`Error: `,o]})]}):!n||!(n.commands||n.agents||n.skills||n.hooks||n.mcpServers)?null:(0,Z.jsxs)(C,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsx)(p,{bold:!0,children:`Installed components:`}),n.commands?(0,Z.jsxs)(p,{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)(p,{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)(p,{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)(p,{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)(p,{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 Lr(e,t){let n=(await Ge(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 Rr(e){return e.filter(e=>{let t=e.source.split(`@`)[1]||`local`;return!mt(`${e.name}@${t}`)})}function zr({setViewState:e,setResult:t,onManageComplete:n,onSearchModeChange:r,targetPlugin:i,targetMarketplace:o,action:c}){let l=jt(e=>e.mcp.clients),u=jt(e=>e.mcp.tools),m=jt(e=>e.plugins.errors),h=mn(),[_,y]=(0,X.useState)(!1),b=(0,X.useCallback)(e=>{y(e),r?.(e)},[r]),x=d(),{columns:ee}=s(),[S,w]=(0,X.useState)(`plugin-list`),{query:T,setQuery:E,cursorOffset:D}=xn({isActive:S===`plugin-list`&&_,onExit:()=>{b(!1)}}),[O,A]=(0,X.useState)(null),[j,M]=(0,X.useState)([]),[N,ae]=(0,X.useState)([]),[oe,ce]=(0,X.useState)(!0),[F,le]=(0,X.useState)(new Map),fe=(0,X.useRef)(!1),I=(0,X.useRef)(void 0),pe=_n();te(`confirm:no`,Br.useCallback(()=>{if(S===`plugin-details`)w(`plugin-list`),A(null),z(null);else if(typeof S==`object`&&S.type===`failed-plugin-details`)w(`plugin-list`),z(null);else if(S===`configuring`)w(`plugin-details`),Ae(null);else if(typeof S==`object`&&(S.type===`plugin-options`||S.type===`configuring-options`))w(`plugin-list`),A(null),t(`Plugin enabled. Configuration skipped — run /reload-plugins to apply.`),n&&n();else if(typeof S==`object`&&S.type===`flagged-detail`)w(`plugin-list`),z(null);else if(typeof S==`object`&&S.type===`mcp-detail`)w(`plugin-list`),z(null);else if(typeof S==`object`&&S.type===`mcp-tools`)w({type:`mcp-detail`,client:S.client});else if(typeof S==`object`&&S.type===`mcp-tool-detail`)w({type:`mcp-tools`,client:S.client});else{if(F.size>0){t(`Run /reload-plugins to apply plugin changes.`);return}e({type:`menu`})}},[S,e,F,t]),{context:`Confirmation`,isActive:(S!==`plugin-list`||!_)&&S!==`confirm-project-uninstall`&&!(typeof S==`object`&&S.type===`confirm-data-cleanup`)});let me=e=>e.type===`connected`?`connected`:e.type===`disabled`?`disabled`:e.type===`pending`?`pending`:e.type===`needs-auth`?`needs-auth`:`failed`,he=(0,X.useMemo)(()=>{let e=k(),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 N){let i=`${r.plugin.name}@${r.marketplace}`,a=e?.enabledPlugins?.[i]!==!1,o=m.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:F.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 m){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=Xt(),s=[];for(let[e,t]of a){if(e in h)continue;let n=Bt(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:me(e),client:e}));let u={flagged:-1,project:0,local:1,user:2,enterprise:3,managed:4,dynamic:5,builtin:6},d=[],f=new Map;for(let{item:e,originalScope:t,childMcps:r}of n){let n=e.scope;f.has(n)||f.set(n,[]),f.get(n).push(e);for(let{displayName:e,client:n}of r){let r=t===`builtin`?`user`:t;f.has(r)||f.set(r,[]),f.get(r).push({type:`mcp`,id:`mcp:${n.name}`,name:e,description:void 0,scope:r,status:me(n),client:n,indented:!0})}}for(let e of c){let t=e.scope;f.has(t)||f.set(t,[]),f.get(t).push(e)}for(let e of s){let t=e.scope;f.has(t)||f.set(t,[]),f.get(t).push(e)}for(let[e,t]of Object.entries(h)){let n=Bt(e),r=n.name||e,i=n.marketplace||`unknown`;f.has(`flagged`)||f.set(`flagged`,[]),f.get(`flagged`).push({type:`flagged-plugin`,id:e,name:r,marketplace:i,scope:`flagged`,reason:`delisted`,text:`Removed from marketplace`,flaggedAt:t.flaggedAt})}let p=[...f.keys()].sort((e,t)=>(u[e]??99)-(u[t]??99));for(let e of p){let t=f.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)d.push(...e);d.push(...r)}return d},[N,l,m,F,h]),ge=(0,X.useMemo)(()=>he.filter(e=>e.type===`flagged-plugin`).map(e=>e.id),[he]);(0,X.useEffect)(()=>{ge.length>0&&pn(ge)},[ge]);let ye=(0,X.useMemo)(()=>{if(!T)return he;let e=T.toLowerCase();return he.filter(t=>t.name.toLowerCase().includes(e)||`description`in t&&t.description?.toLowerCase().includes(e))},[he,T]),[be,xe]=(0,X.useState)(0),Ce=fr({totalItems:ye.length,selectedIndex:be,maxVisible:8}),[we,Te]=(0,X.useState)(0),[Ee,De]=(0,X.useState)(!1),[L,z]=(0,X.useState)(null),[ke,Ae]=(0,X.useState)(null),[je,Me]=(0,X.useState)(!1),[Ne,Pe]=(0,X.useState)(!1);(0,X.useEffect)(()=>{if(!O){Pe(!1);return}async function e(){let e=O.plugin.manifest.mcpServers,t=!1;if(e&&(t=typeof e==`string`&>(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&>(e))),!t)try{let e=Tn.join(O.plugin.path,`..`),n=Tn.join(e,`.claude-plugin`,`marketplace.json`),r=se(await En.readFile(n,`utf-8`)).plugins?.find(e=>e.name===O.plugin.name);if(r?.mcpServers){let e=r.mcpServers;t=typeof e==`string`&>(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&>(e))}}catch(e){ue(`Failed to read raw marketplace.json: ${e}`)}Pe(t)}e()},[O]),(0,X.useEffect)(()=>{async function e(){ce(!0);try{let{enabled:e,disabled:t}=await Lt(),n=k(),r=Rr([...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=ve(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)),M(a);let o=[];for(let e of a)for(let t of e.installedPlugins){let n=`${t.name}@${e.name}`,r=t.isBuiltin?`builtin`:nn(n).scope;o.push({plugin:t,marketplace:e.name,scope:r,pendingEnable:void 0,pendingUpdate:!1})}ae(o),xe(0)}finally{ce(!1)}}e()},[]),(0,X.useEffect)(()=>{if(!fe.current&&i&&j.length>0&&!oe){let{name:e,marketplace:n}=Bt(i),r=o??n,a=r?j.filter(e=>e.name===r):j;for(let t of a){let n=t.installedPlugins.find(t=>t.name===e);if(n){let{scope:e}=nn(`${n.name}@${t.name}`);A({plugin:n,marketplace:t.name,scope:e,pendingEnable:void 0,pendingUpdate:!1}),w(`plugin-details`),I.current=c,fe.current=!0;return}}let s=he.find(t=>t.type===`failed-plugin`&&t.name===e);s&&s.type===`failed-plugin`&&(w({type:`failed-plugin-details`,plugin:{id:s.id,name:s.name,marketplace:s.marketplace,errors:s.errors,scope:s.scope}}),fe.current=!0),!fe.current&&c&&(fe.current=!0,t(`Plugin "${i}" is not installed in this project`))}},[i,o,j,oe,he,c,t]);let Fe=async r=>{if(!O)return;let i=O.scope||`user`,a=i===`builtin`;if(a&&(r===`update`||r===`uninstall`)){z(`Built-in plugins cannot be updated or uninstalled.`);return}if(!a&&!tn(i)&&r!==`update`){z(`This plugin is managed by your organization. Contact your admin to disable it.`);return}De(!0),z(null);try{let o=`${O.plugin.name}@${O.marketplace}`,s;switch(r){case`enable`:{let e=await Zt(o);if(!e.success)throw Error(e.message);break}case`disable`:{let e=await en(o);if(!e.success)throw Error(e.message);s=e.reverseDependents;break}case`uninstall`:{if(a||!tn(i))break;if(an(o)){De(!1),w(`confirm-project-uninstall`);return}let e=Le().plugins[o],t=!e||e.length<=1?await Oe(o):null;if(t){De(!1),w({type:`confirm-data-cleanup`,size:t});return}let n=await Qt(o,i);if(!n.success)throw Error(n.message);s=n.reverseDependents;break}case`update`:{if(a)break;let r=await $t(o,i);if(!r.success)throw Error(r.message);if(r.alreadyUpToDate){t(`${O.plugin.name} is already at the latest version (${r.newVersion}).`),n&&await n(),e({type:`menu`});return}break}}dt();let c=`${O.plugin.name}@${O.marketplace}`;if(k()?.enabledPlugins?.[c]!==!1){De(!1),w({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} ${O.plugin.name}${u}. Run /reload-plugins to apply.`),n&&await n(),e({type:`menu`})}catch(e){De(!1),z(`Failed to ${r}: ${e instanceof Error?e.message:String(e)}`),_e(P(e))}},Ie=(0,X.useRef)(Fe);Ie.current=Fe,(0,X.useEffect)(()=>{if(S===`plugin-details`&&O&&I.current){let e=I.current;I.current=void 0,Ie.current(e)}},[S,O]);let Re=Br.useCallback(()=>{if(be>=ye.length)return;let e=ye[be];if(e?.type!==`flagged-plugin`)if(e?.type===`plugin`){let t=`${e.plugin.name}@${e.marketplace}`,n=k(),r=F.get(t),i=n?.enabledPlugins?.[t]!==!1,a=e.scope;if(a===`builtin`||tn(a)){let e=new Map(F);r?(e.delete(t),(async()=>{try{r===`will-disable`?await Zt(t):await en(t),dt()}catch(e){_e(e)}})()):(e.set(t,i?`will-disable`:`will-enable`),(async()=>{try{i?await en(t):await Zt(t),dt()}catch(e){_e(e)}})()),le(e)}}else e?.type===`mcp`&&pe(e.client.name)},[be,ye,F,N,pe]);v({"select:previous":()=>{be===0?b(!0):Ce.handleSelectionChange(be-1,xe)},"select:next":()=>{be<ye.length-1&&Ce.handleSelectionChange(be+1,xe)},"select:accept":Br.useCallback(()=>{if(be>=ye.length)return;let e=ye[be];if(e?.type===`plugin`){let t=N.find(t=>t.plugin.name===e.plugin.name&&t.marketplace===e.marketplace);t&&(A(t),w(`plugin-details`),Te(0),z(null))}else e?.type===`flagged-plugin`?(w({type:`flagged-detail`,plugin:{id:e.id,name:e.name,marketplace:e.marketplace,reason:e.reason,text:e.text,flaggedAt:e.flaggedAt}}),z(null)):e?.type===`failed-plugin`?(w({type:`failed-plugin-details`,plugin:{id:e.id,name:e.name,marketplace:e.marketplace,errors:e.errors,scope:e.scope}}),Te(0),z(null)):e?.type===`mcp`&&(w({type:`mcp-detail`,client:e.client}),z(null))},[be,ye,N])},{context:`Select`,isActive:S===`plugin-list`&&!_}),v({"plugin:toggle":Re},{context:`Plugin`,isActive:S===`plugin-list`&&!_}),v({"select:accept":Br.useCallback(()=>{typeof S!=`object`||S.type!==`flagged-detail`||(hn(S.plugin.id),w(`plugin-list`))},[S])},{context:`Select`,isActive:typeof S==`object`&&S.type===`flagged-detail`});let ze=Br.useMemo(()=>{if(S!==`plugin-details`||!O)return[];let e=k(),t=`${O.plugin.name}@${O.marketplace}`,n=e?.enabledPlugins?.[t]!==!1,r=O.marketplace===`builtin`,i=[];return i.push({label:n?`Disable plugin`:`Enable plugin`,action:()=>void Fe(n?`disable`:`enable`)}),r||(i.push({label:O.pendingUpdate?`Unmark for update`:`Mark for update`,action:async()=>{try{let e=await Lr(O.plugin.name,O.marketplace);if(e){z(e);return}let t=[...N],n=t.findIndex(e=>e.plugin.name===O.plugin.name&&e.marketplace===O.marketplace);n!==-1&&(t[n].pendingUpdate=!O.pendingUpdate,ae(t),A({...O,pendingUpdate:!O.pendingUpdate}))}catch(e){z(e instanceof Error?e.message:`Failed to check plugin update availability`)}}}),Ne&&i.push({label:`Configure`,action:async()=>{Me(!0);try{let e=O.plugin.manifest.mcpServers,t=null;if(typeof e==`string`&>(e))t=e;else if(Array.isArray(e)){for(let n of e)if(typeof n==`string`&>(n)){t=n;break}}if(!t){z(`No MCPB file found in plugin`),Me(!1);return}let n=`${O.plugin.name}@${O.marketplace}`,r=await nt(t,O.plugin.path,n,void 0,void 0,!0);`status`in r&&r.status===`needs-config`?(Ae(r),w(`configuring`)):z(`Failed to load MCPB for configuration`)}catch(e){z(`Failed to load configuration: ${de(e)}`)}finally{Me(!1)}}}),O.plugin.manifest.userConfig&&Object.keys(O.plugin.manifest.userConfig).length>0&&i.push({label:`Configure options`,action:()=>{w({type:`configuring-options`,schema:O.plugin.manifest.userConfig})}}),i.push({label:`Update now`,action:()=>void Fe(`update`)}),i.push({label:`Uninstall`,action:()=>void Fe(`uninstall`)})),O.plugin.manifest.homepage&&i.push({label:`Open homepage`,action:()=>void Ut(O.plugin.manifest.homepage)}),O.plugin.manifest.repository&&i.push({label:`View repository`,action:()=>void Ut(O.plugin.manifest.repository)}),i.push({label:`Back to plugin list`,action:()=>{w(`plugin-list`),A(null),z(null)}}),i},[S,O,Ne,N]);if(v({"select:previous":()=>{we>0&&Te(we-1)},"select:next":()=>{we<ze.length-1&&Te(we+1)},"select:accept":()=>{ze[we]&&ze[we].action()}},{context:`Select`,isActive:S===`plugin-details`&&!!O}),v({"select:accept":()=>{typeof S==`object`&&S.type===`failed-plugin-details`&&(async()=>{De(!0),z(null);let e=S.plugin.id,t=S.plugin.scope,r=tn(t)?await Qt(e,t,!1):await Qt(e,`user`,!1),i=r.success;if(!i){for(let t of[`userSettings`,`projectSettings`,`localSettings`]){let n=re(t);n?.enabledPlugins?.[e]!==void 0&&(ie(t,{enabledPlugins:{...n.enabledPlugins,[e]:void 0}}),i=!0)}dt()}i?(n&&await n(),De(!1),w(`plugin-list`)):(De(!1),z(r.message))})()}},{context:`Select`,isActive:typeof S==`object`&&S.type===`failed-plugin-details`&&S.plugin.scope!==`managed`}),v({"confirm:yes":()=>{if(!O)return;De(!0),z(null);let r=`${O.plugin.name}@${O.marketplace}`,{error:i}=ie(`localSettings`,{enabledPlugins:{...re(`localSettings`)?.enabledPlugins,[r]:!1}});if(i){De(!1),z(`Failed to write settings: ${i.message}`);return}dt(),t(`✓ Disabled ${O.plugin.name} in .claude/settings.local.json. Run /reload-plugins to apply.`),n&&n(),e({type:`menu`})},"confirm:no":()=>{w(`plugin-details`),z(null)}},{context:`Confirmation`,isActive:S===`confirm-project-uninstall`&&!!O&&!Ee}),ne((r,i)=>{if(!O)return;let o=`${O.plugin.name}@${O.marketplace}`,s=O.scope;if(!s||s===`builtin`||!tn(s))return;let c=async r=>{De(!0),z(null);try{let i=await Qt(o,s,r);if(!i.success)throw Error(i.message);dt();let c=r?``:` · data preserved`;t(`${a.tick} ${i.message}${c}`),n&&n(),e({type:`menu`})}catch(e){De(!1),z(e instanceof Error?e.message:String(e))}};r===`y`||r===`Y`?c(!0):r===`n`||r===`N`?c(!1):i.escape&&(w(`plugin-details`),z(null))},{isActive:typeof S==`object`&&S.type===`confirm-data-cleanup`&&!!O&&!Ee}),Br.useEffect(()=>{xe(0)},[T]),ne((e,t)=>{let n=!t.ctrl&&!t.meta;_||(e===`/`&&n?(b(!0),E(``),xe(0)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==` `&&(b(!0),E(e),xe(0)))},{isActive:S===`plugin-list`}),oe)return(0,Z.jsx)(p,{children:`Loading installed plugins…`});if(he.length===0)return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsx)(C,{marginBottom:1,children:(0,Z.jsx)(p,{bold:!0,children:`Manage plugins`})}),(0,Z.jsx)(p,{children:`No plugins or MCP servers installed.`}),(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{dimColor:!0,children:`Esc to go back`})})]});if(typeof S==`object`&&S.type===`plugin-options`&&O){let r=`${O.plugin.name}@${O.marketplace}`;function i(r){t(r),n&&n(),e({type:`menu`})}return(0,Z.jsx)(er,{plugin:O.plugin,pluginId:r,onDone:(e,t)=>{switch(e){case`configured`:i(`✓ Enabled and configured ${O.plugin.name}. Run /reload-plugins to apply.`);break;case`skipped`:i(`✓ Enabled ${O.plugin.name}. Run /reload-plugins to apply.`);break;case`error`:i(`Failed to save configuration: ${t}`);break}}})}if(typeof S==`object`&&S.type===`configuring-options`&&O){let e=`${O.plugin.name}@${O.marketplace}`;return(0,Z.jsx)(Yn,{title:`Configure ${O.plugin.name}`,subtitle:`Plugin options`,configSchema:S.schema,initialValues:bt(e),onSave:n=>{try{wt(e,n,S.schema),dt(),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){z(`Failed to save configuration: ${de(e)}`)}w(`plugin-details`)},onCancel:()=>w(`plugin-details`)})}if(S===`configuring`&&ke&&O){let e=`${O.plugin.name}@${O.marketplace}`;async function n(n){if(!(!ke||!O))try{let r=O.plugin.manifest.mcpServers,i=null;if(typeof r==`string`&>(r))i=r;else if(Array.isArray(r)){for(let e of r)if(typeof e==`string`&>(e)){i=e;break}}if(!i){z(`No MCPB file found`),w(`plugin-details`);return}await nt(i,O.plugin.path,e,void 0,n),z(null),Ae(null),w(`plugin-details`),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){z(`Failed to save configuration: ${de(e)}`),w(`plugin-details`)}}function r(){Ae(null),w(`plugin-details`)}return(0,Z.jsx)(Yn,{title:`Configure ${ke.manifest.name}`,subtitle:`Plugin: ${O.plugin.name}`,configSchema:ke.configSchema,initialValues:ke.existingConfig,onSave:n,onCancel:r})}if(typeof S==`object`&&S.type===`flagged-detail`){let e=S.plugin;return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsx)(C,{children:(0,Z.jsxs)(p,{bold:!0,children:[e.name,` @ `,e.marketplace]})}),(0,Z.jsxs)(C,{marginBottom:1,children:[(0,Z.jsx)(p,{dimColor:!0,children:`Status: `}),(0,Z.jsx)(p,{color:`error`,children:`Removed`})]}),(0,Z.jsxs)(C,{marginBottom:1,flexDirection:`column`,children:[(0,Z.jsxs)(p,{color:`error`,children:[`Removed from marketplace · reason: `,e.reason]}),(0,Z.jsx)(p,{children:e.text}),(0,Z.jsxs)(p,{dimColor:!0,children:[`Flagged on `,new Date(e.flaggedAt).toLocaleDateString()]})]}),(0,Z.jsx)(C,{marginTop:1,flexDirection:`column`,children:(0,Z.jsxs)(C,{children:[(0,Z.jsxs)(p,{children:[a.pointer,` `]}),(0,Z.jsx)(p,{color:`suggestion`,children:`Dismiss`})]})}),(0,Z.jsxs)(g,{children:[(0,Z.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`dismiss`}),(0,Z.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})]})}if(S===`confirm-project-uninstall`&&O)return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsxs)(p,{bold:!0,color:`warning`,children:[O.plugin.name,` is enabled in .claude/settings.json (shared with your team)`]}),(0,Z.jsxs)(C,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(p,{children:`Disable it just for you in .claude/settings.local.json?`}),(0,Z.jsx)(p,{dimColor:!0,children:`This has the same effect as uninstalling, without affecting other contributors.`})]}),L&&(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{color:`error`,children:L})}),(0,Z.jsx)(C,{marginTop:1,children:Ee?(0,Z.jsx)(p,{dimColor:!0,children:`Disabling…`}):(0,Z.jsxs)(g,{children:[(0,Z.jsx)(R,{action:`confirm:yes`,context:`Confirmation`,fallback:`y`,description:`disable`}),(0,Z.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]});if(typeof S==`object`&&S.type===`confirm-data-cleanup`&&O)return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsxs)(p,{bold:!0,children:[O.plugin.name,` has `,S.size.human,` of persistent data`]}),(0,Z.jsxs)(C,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(p,{children:`Delete it along with the plugin?`}),(0,Z.jsx)(p,{dimColor:!0,children:pt(`${O.plugin.name}@${O.marketplace}`)})]}),L&&(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{color:`error`,children:L})}),(0,Z.jsx)(C,{marginTop:1,children:Ee?(0,Z.jsx)(p,{dimColor:!0,children:`Uninstalling…`}):(0,Z.jsxs)(p,{children:[(0,Z.jsx)(p,{bold:!0,children:`y`}),` to delete · `,(0,Z.jsx)(p,{bold:!0,children:`n`}),` to keep · `,(0,Z.jsx)(p,{bold:!0,children:`esc`}),` to cancel`]})})]});if(S===`plugin-details`&&O){let e=k(),t=`${O.plugin.name}@${O.marketplace}`,n=e?.enabledPlugins?.[t]!==!1,r=m.filter(e=>`plugin`in e&&e.plugin===O.plugin.name||e.source===t||e.source.startsWith(`${O.plugin.name}@`)),i=r.length===0?null:(0,Z.jsxs)(C,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsxs)(p,{bold:!0,color:`error`,children:[r.length,` `,Se(r.length,`error`),`:`]}),r.map((e,t)=>{let n=Ar(e);return(0,Z.jsxs)(C,{flexDirection:`column`,marginLeft:2,children:[(0,Z.jsx)(p,{color:`error`,children:kr(e)}),n&&(0,Z.jsxs)(p,{dimColor:!0,italic:!0,children:[a.arrowRight,` `,n]})]},t)})]});return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsx)(C,{children:(0,Z.jsxs)(p,{bold:!0,children:[O.plugin.name,` @ `,O.marketplace]})}),(0,Z.jsxs)(C,{children:[(0,Z.jsx)(p,{dimColor:!0,children:`Scope: `}),(0,Z.jsx)(p,{children:O.scope||`user`})]}),O.plugin.manifest.version&&(0,Z.jsxs)(C,{children:[(0,Z.jsx)(p,{dimColor:!0,children:`Version: `}),(0,Z.jsx)(p,{children:O.plugin.manifest.version})]}),O.plugin.manifest.description&&(0,Z.jsx)(C,{marginBottom:1,children:(0,Z.jsx)(p,{children:O.plugin.manifest.description})}),O.plugin.manifest.author&&(0,Z.jsxs)(C,{children:[(0,Z.jsx)(p,{dimColor:!0,children:`Author: `}),(0,Z.jsx)(p,{children:O.plugin.manifest.author.name})]}),(0,Z.jsxs)(C,{marginBottom:1,children:[(0,Z.jsx)(p,{dimColor:!0,children:`Status: `}),(0,Z.jsx)(p,{color:n?`success`:`warning`,children:n?`Enabled`:`Disabled`}),O.pendingUpdate&&(0,Z.jsx)(p,{color:`suggestion`,children:` · Marked for update`})]}),(0,Z.jsx)(Ir,{plugin:O.plugin,marketplace:O.marketplace}),i,(0,Z.jsx)(C,{marginTop:1,flexDirection:`column`,children:ze.map((e,t)=>{let n=t===we;return(0,Z.jsxs)(C,{children:[n&&(0,Z.jsxs)(p,{children:[a.pointer,` `]}),!n&&(0,Z.jsx)(p,{children:` `}),(0,Z.jsx)(p,{bold:n,color:e.label.includes(`Uninstall`)?`error`:e.label.includes(`Update`)?`suggestion`:void 0,children:e.label})]},t)})}),Ee&&(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{children:`Processing…`})}),L&&(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{color:`error`,children:L})}),(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(g,{children:[(0,Z.jsx)(R,{action:`select:previous`,context:`Select`,fallback:`↑`,description:`navigate`}),(0,Z.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,Z.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(typeof S==`object`&&S.type===`failed-plugin-details`){let e=S.plugin,t=e.errors[0],n=t?kr(t):`Failed to load`;return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsxs)(p,{children:[(0,Z.jsx)(p,{bold:!0,children:e.name}),(0,Z.jsxs)(p,{dimColor:!0,children:[` @ `,e.marketplace]}),(0,Z.jsxs)(p,{dimColor:!0,children:[` (`,e.scope,`)`]})]}),(0,Z.jsx)(p,{color:`error`,children:n}),e.scope===`managed`?(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{dimColor:!0,children:`Managed by your organization — contact your admin`})}):(0,Z.jsxs)(C,{marginTop:1,children:[(0,Z.jsxs)(p,{color:`suggestion`,children:[a.pointer,` `]}),(0,Z.jsx)(p,{bold:!0,children:`Remove`})]}),Ee&&(0,Z.jsx)(p,{children:`Processing…`}),L&&(0,Z.jsx)(p,{color:`error`,children:L}),(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(g,{children:[e.scope!==`managed`&&(0,Z.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`remove`}),(0,Z.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(typeof S==`object`&&S.type===`mcp-detail`){let e=S.client,n=He(u,e.name).length,r=()=>{w({type:`mcp-tools`,client:e})},i=()=>{w(`plugin-list`)},a=e=>{e&&t(e),w(`plugin-list`)},o=e.config.scope,s=e.config.type;return s===`stdio`?(0,Z.jsx)(Fn,{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)(Nn,{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)(Nn,{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)(Nn,{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}):(w(`plugin-list`),null)}if(typeof S==`object`&&S.type===`mcp-tools`){let e=S.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)(Vn,{server:r,onSelectTool:t=>{w({type:`mcp-tool-detail`,client:e,tool:t})},onBack:()=>w({type:`mcp-detail`,client:e})})}if(typeof S==`object`&&S.type===`mcp-tool-detail`){let{client:e,tool:t}=S,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)(Rn,{tool:t,server:i,onBack:()=>w({type:`mcp-tools`,client:e})})}let Be=Ce.getVisibleItems(ye);return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsx)(C,{marginBottom:1,children:(0,Z.jsx)(f,{query:T,isFocused:_,isTerminalFocused:x,width:ee-4,cursorOffset:D})}),ye.length===0&&T&&(0,Z.jsx)(C,{marginBottom:1,children:(0,Z.jsxs)(p,{dimColor:!0,children:[`No items match "`,T,`"`]})}),Ce.scrollPosition.canScrollUp&&(0,Z.jsx)(C,{children:(0,Z.jsxs)(p,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),Be.map((e,t)=>{let n=Ce.toActualIndex(t)===be&&!_,r=t>0?Be[t-1]:null,i=!r||r.scope!==e.scope;return(0,Z.jsxs)(Br.Fragment,{children:[i&&(0,Z.jsx)(C,{marginTop:+(t>0),paddingLeft:2,children:(0,Z.jsx)(p,{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)(Mr,{item:e,isSelected:n})]},e.id)}),Ce.scrollPosition.canScrollDown&&(0,Z.jsx)(C,{children:(0,Z.jsxs)(p,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),(0,Z.jsx)(C,{marginTop:1,marginLeft:1,children:(0,Z.jsx)(p,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(g,{children:[(0,Z.jsx)(p,{children:`type to search`}),(0,Z.jsx)(R,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,Z.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,Z.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})}),F.size>0&&(0,Z.jsx)(C,{marginLeft:1,children:(0,Z.jsx)(p,{dimColor:!0,italic:!0,children:`Run /reload-plugins to apply changes`})})]})}var Br,X,Z,Vr=e((()=>{i(),Br=t(l(),1),X=t(l(),1),L(),x(),Pn(),Ln(),Bn(),Wn(),bn(),Sn(),Kt(),Gt(),Vt(),vn(),Ie(),rn(),ht(),ye(),Wt(),le(),F(),ge(),lt(),Pe(),Ct(),Qe(),De(),gn(),zt(),Pt(),Ye(),Fe(),Yt(),j(),ce(),we(),jr(),Qn(),rr(),Nr(),hr(),Z=w()}));function Hr(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 Ur=e((()=>{}));function Wr({onComplete:e,path:t}){return(0,Gr.useEffect)(()=>{async function n(){if(!t){e(`Usage: /plugin validate <path>
|
|
2
2
|
|
|
3
3
|
Validate a plugin or marketplace manifest file or directory.
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t,b as n,t as r}from"./src-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t,b as n,t as r}from"./src-Di342QoJ.js";import{t as i}from"./jsx-runtime-D-D469L8.js";function a(){return(0,o.jsxs)(n,{color:`permission`,children:[`Press `,(0,o.jsx)(n,{bold:!0,children:`Enter`}),` to continue…`]})}var o,s=e((()=>{t(),r(),o=i()}));export{s as n,a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Cn as n,F as r,Rn as i,b as a,t as o,x as s}from"./src-
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Cn as n,F as r,Rn as i,b as a,t as o,x as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{C as l,T as u,b as d}from"./startupProfiler-CBcN1Chw.js";import{t as f}from"./useTerminalSize-Du-EamDN.js";function p(e){return e.startsWith(`file-`)?`+`:e.startsWith(`mcp-resource-`)?`◇`:e.startsWith(`agent-`)?`*`:`+`}function m(e){return e.startsWith(`file-`)||e.startsWith(`mcp-resource-`)||e.startsWith(`agent-`)}function h({suggestions:e,selectedSuggestion:t,maxColumnWidth:i,overlay:a}){let{rows:o}=r(),c=a?5:Math.min(6,Math.max(1,o-3));if(e.length===0)return null;let l=i??Math.max(...e.map(e=>n(e.displayText)))+5,u=Math.max(0,Math.min(t-Math.floor(c/2),e.length-c)),d=Math.min(u+c,e.length),f=e.slice(u,d);return(0,_.jsx)(s,{flexDirection:`column`,justifyContent:a?void 0:`flex-end`,children:f.map(n=>(0,_.jsx)(v,{item:n,maxColumnWidth:l,isSelected:n.id===e[t]?.id},n.id))})}var g,_,v,y,b=e((()=>{g=t(i(),1),f(),o(),d(),_=c(),v=(0,g.memo)(function({item:e,maxColumnWidth:t,isSelected:i}){let o=r().columns;if(m(e.id)){let t=p(e.id),r=i?`suggestion`:void 0,s=!i,c=e.id.startsWith(`file-`),d=e.id.startsWith(`mcp-resource-`),f=e.description?3:0,m;if(c){let t=e.description?Math.min(20,n(e.description)):0,r=o-2-4-f-t;m=l(e.displayText,r)}else m=d?u(e.displayText,30):e.displayText;let h=o-2-n(m)-f-4,g;if(e.description){let n=Math.max(0,h),r=u(e.description.replace(/\s+/g,` `),n);g=`${t} ${m} – ${r}`}else g=`${t} ${m}`;return(0,_.jsx)(a,{color:r,dimColor:s,wrap:`truncate`,children:g})}let s=Math.floor(o*.4),c=Math.min(t??n(e.displayText)+5,s),d=e.color||(i?`suggestion`:void 0),f=!i,h=e.displayText;n(h)>c-2&&(h=u(h,c-2));let g=h+` `.repeat(Math.max(0,c-n(h))),v=e.tag?`[${e.tag}] `:``,y=n(v),b=Math.max(0,o-c-y-4),x=e.description?u(e.description.replace(/\s+/g,` `),b):``;return(0,_.jsxs)(a,{wrap:`truncate`,children:[(0,_.jsx)(a,{color:d,dimColor:f,children:g}),v?(0,_.jsx)(a,{color:e.tag===`local`?`ansi:yellow`:void 0,dimColor:e.tag!==`local`,children:v}):null,(0,_.jsx)(a,{color:i?`suggestion`:void 0,dimColor:!i,children:x})]})}),y=(0,g.memo)(h)}));export{y as n,b as r,h as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t,b as n,t as r,x as i}from"./src-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t,b as n,t as r,x as i}from"./src-Di342QoJ.js";import{t as a}from"./jsx-runtime-D-D469L8.js";import{S as o,dc as s,vi as c,xi as l,yc as u,yi as d}from"./paths-BZjPDxMm.js";import{a as f,n as p}from"./env-C2A9gV_G.js";import{i as m,o as h}from"./platform-mh9ypxS8.js";import{DT as g,FT as _,IT as v,OT as y}from"./loadAgentsDir-BYWykYwn.js";import{a as b,i as x,r as S}from"./terminalSetup-2ioFcRAA.js";function C(){return s().editorMode===`vim`}function w(){return p.terminal===`Apple_Terminal`&&process.platform===`darwin`||b()?`shift + ⏎ for newline`:S()?`\\⏎ for newline`:`backslash (\\) + return (⏎) for newline`}function T(e,t){return t.ctrl||t.meta||t.escape||t.return||t.tab||t.backspace||t.delete||t.upArrow||t.downArrow||t.leftArrow||t.rightArrow||t.pageUp||t.pageDown||t.home||t.end?!1:e.length>0&&!/^\s/.test(e)&&!e.startsWith(`\x1B`)}var E=e((()=>{x(),u(),f()}));function D(e){return e.replace(/\+/g,` + `)}function O(e){let{dimColor:t,fixedWidth:r,gap:a,paddingX:o}=e,s=D(y(`app:toggleTranscript`,`Global`,`ctrl+o`)),c=D(y(`app:toggleTodos`,`Global`,`ctrl+t`)),u=D(y(`chat:undo`,`Chat`,`ctrl+_`)),f=D(y(`chat:stash`,`Chat`,`ctrl+s`)),p=D(y(`chat:cycleMode`,`Chat`,`shift+tab`)),h=D(y(`chat:modelPicker`,`Chat`,`alt+p`)),g=D(y(`chat:fastMode`,`Chat`,`alt+o`)),_=D(y(`chat:externalEditor`,`Chat`,`ctrl+g`));D(y(`app:toggleTerminal`,`Global`,`meta+j`));let b=D(y(`chat:imagePaste`,`Chat`,`ctrl+v`));return(0,k.jsxs)(i,{paddingX:o,flexDirection:`row`,gap:a,children:[(0,k.jsxs)(i,{flexDirection:`column`,width:r?24:void 0,children:[(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:`! for bash mode`})}),(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:`/ for commands`})}),(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:`@ for file paths`})}),(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:`& for background`})}),(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:`/btw for side question`})})]}),(0,k.jsxs)(i,{flexDirection:`column`,width:r?35:void 0,children:[(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:`double tap esc to clear input`})}),(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[p,` `,process.env.USER_TYPE===`ant`?`to cycle modes`:`to auto-accept edits`]})}),(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[s,` for verbose output`]})}),(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[c,` to toggle tasks`]})}),null,(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:w()})})]}),(0,k.jsxs)(i,{flexDirection:`column`,children:[(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[u,` to undo`]})}),m()!==`windows`&&(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:`ctrl + z to suspend`})}),(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[b,` to paste images`]})}),(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[h,` to switch model`]})}),l()&&d()&&(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[g,` to toggle fast mode`]})}),(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[f,` to stash prompt`]})}),(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[_,` to edit in $EDITOR`]})}),v()&&(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:`/keybindings to customize`})})]})]})}var k,A=e((()=>{t(),r(),h(),_(),g(),o(),c(),E(),k=a()}));export{C as a,T as i,A as n,E as r,O as t};
|