@readmagic/workmate 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AddWorkspaceDirectory-BSLHrjbt.js → AddWorkspaceDirectory-BgNp7glC.js} +1 -1
- package/dist/chunks/{App-DY5O6IKw.js → App-Coboqa8H.js} +1 -1
- package/dist/chunks/ApproveApiKey-CQsQdQBC.js +1 -0
- package/dist/chunks/{ApproveApiKey-BEzfC6r3.js → ApproveApiKey-CYpBbj0k.js} +1 -1
- package/dist/chunks/{AssistantSessionChooser-Ce3PraaD.js → AssistantSessionChooser-DxKsTdqj.js} +1 -1
- package/dist/chunks/{BackgroundTasksDialog-Dvhcgahe.js → BackgroundTasksDialog-AiVi-1pI.js} +1 -1
- package/dist/chunks/{BypassPermissionsModeDialog-B68V1bCq.js → BypassPermissionsModeDialog-Cx3QGFz-.js} +1 -1
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-CTWhpIm8.js → ClaudeMdExternalIncludesDialog-BAK9fxwg.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-DUu6iRJk.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-DVTPwR5I.js +1 -0
- package/dist/chunks/{DesktopHandoff-BRbU4is4.js → DesktopHandoff-BsHgLlTy.js} +1 -1
- package/dist/chunks/{DiffDialog-CBluIK-x.js → DiffDialog-BgTW2Znv.js} +1 -1
- package/dist/chunks/{Doctor-WxNv49HC.js → Doctor-BXhz8eUa.js} +1 -1
- package/dist/chunks/Doctor-D75dsEyb.js +1 -0
- package/dist/chunks/{ExitFlow-CRPgptCN.js → ExitFlow-B1XNACQP.js} +1 -1
- package/dist/chunks/{Feedback-CEtzaLr3.js → Feedback-Cvz80lAn.js} +1 -1
- package/dist/chunks/Grove-B7hhBvFw.js +1 -0
- package/dist/chunks/{Grove--kttLxvs.js → Grove-Dsi4yU08.js} +1 -1
- package/dist/chunks/{HybridTransport-BgV5_7Az.js → HybridTransport-8qA64lCx.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-DCGwXW_p.js → InvalidConfigDialog-CAZ1z5WG.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-jTwsdXWr.js → InvalidSettingsDialog-D82Qk_MR.js} +1 -1
- package/dist/chunks/{MCPConnectionManager-BX0LMz9J.js → MCPConnectionManager-BLfKm4H2.js} +1 -1
- package/dist/chunks/{McpParsingWarnings-WQrWJeWP.js → McpParsingWarnings-8ZueNqAd.js} +1 -1
- package/dist/chunks/{MessageSelector-_UZB8cGb.js → MessageSelector-DmKtBYX9.js} +1 -1
- package/dist/chunks/Messages-CaFdI1kk.js +11 -0
- package/dist/chunks/{Onboarding-BoIVNCgc.js → Onboarding-CUztnbbv.js} +1 -1
- package/dist/chunks/{OverageCreditUpsell-1FCN8bH3.js → OverageCreditUpsell-DSgrZvMv.js} +1 -1
- package/dist/chunks/{PluginSettings-BD9JLV9-.js → PluginSettings-0FSNch8O.js} +1 -1
- package/dist/chunks/{PromptInputFooterSuggestions-CrGST0Cq.js → PromptInputFooterSuggestions-IaihWay3.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-B2TDpbpw.js → PromptInputHelpMenu-okS2rQ4k.js} +1 -1
- package/dist/chunks/{QueryEngine-D2HUnwmU.js → QueryEngine-WYDWzQuY.js} +1 -1
- package/dist/chunks/{REPL-BV4WyYMg.js → REPL-Dto012J0.js} +7 -7
- package/dist/chunks/REPL-vV_jzAVx.js +1 -0
- package/dist/chunks/{RemoteCallout-DS_EV6Fh.js → RemoteCallout-C_UIYnuT.js} +1 -1
- package/dist/chunks/RemoteSessionManager-CuSSHAXN.js +2 -0
- package/dist/chunks/{ResumeConversation-Cw3vP4G8.js → ResumeConversation-g_JyOWbl.js} +1 -1
- package/dist/chunks/{SSETransport-BXiEBMpb.js → SSETransport-Chj_yfPv.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-Daedym7_.js +1 -0
- package/dist/chunks/{Settings-ns6mRsDc.js → Settings-DUXA-qac.js} +2 -2
- package/dist/chunks/{TeleportProgress-CcDzMC5L.js → TeleportProgress-DP1a8jit.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-DZbxl4sD.js → TeleportRepoMismatchDialog-B6sTwXuZ.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-EowJO5nm.js → TeleportResumeWrapper-CKUuRQSG.js} +1 -1
- package/dist/chunks/{ThemePicker-BYbChJpu.js → ThemePicker-Dyq1YVhb.js} +1 -1
- package/dist/chunks/{TrustDialog-DA3YTk_k.js → TrustDialog-CdZS9t-T.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-Cx-hoRwG.js → ValidationErrorsList-DUNh4BNa.js} +1 -1
- package/dist/chunks/WelcomeV2-TPbOXGrO.js +1 -0
- package/dist/chunks/{add-dir-CWt69NAZ.js → add-dir-Bf_5tCeR.js} +1 -1
- package/dist/chunks/{agentDisplay-CQ4mZWFH.js → agentDisplay-CCeYiAta.js} +1 -1
- package/dist/chunks/{agents-D4clhuCl.js → agents-Bt72Gz1v.js} +1 -1
- package/dist/chunks/{agents-C6jzKOit.js → agents-T8xHY5Wk.js} +1 -1
- package/dist/chunks/{allErrors-HMPqE0jK.js → allErrors-CDWTJcMw.js} +1 -1
- package/dist/chunks/{ant-9Z5bppVC.js → ant-DRF-v5bA.js} +1 -1
- package/dist/chunks/api-CLLIHLpn.js +1 -0
- package/dist/chunks/api-DMpNA1s8.js +1 -0
- package/dist/chunks/asciicast-BIr75_x9.js +1 -0
- package/dist/chunks/{asciicast-n-BBfgDq.js → asciicast-CQJlNTae.js} +1 -1
- package/dist/chunks/{assistant-BA9_Mo9U.js → assistant-C83quuNj.js} +1 -1
- package/dist/chunks/{assistant-BiNOSla3.js → assistant-z1ojxEET.js} +1 -1
- package/dist/chunks/assistant-z2o4-UJe.js +1 -0
- package/dist/chunks/auth-Ce0jllLf.js +1 -0
- package/dist/chunks/auth-DV3P8Qup.js +1 -0
- package/dist/chunks/{auth-DHyCIxCk.js → auth-DpFfHy1W.js} +1 -1
- package/dist/chunks/{autoMode-Db4QrgFr.js → autoMode-DW_H3i37.js} +3 -3
- package/dist/chunks/{autonomy-BkAMA7du.js → autonomy-46hnmyAi.js} +1 -1
- package/dist/chunks/{autonomy-D4Vy-RPQ.js → autonomy-OxhciwYa.js} +1 -1
- package/dist/chunks/{autonomyPanel-EjfO8jvg.js → autonomyPanel-CTEjq0Bd.js} +1 -1
- package/dist/chunks/backgroundHousekeeping-BycL9lOe.js +1 -0
- package/dist/chunks/{backgroundHousekeeping-hDDE8mJC.js → backgroundHousekeeping-Cpxq4krt.js} +2 -2
- package/dist/chunks/{banner-hD6wZygx.js → banner-BVkLvJiB.js} +1 -1
- package/dist/chunks/bg-H849G7Sc.js +1 -0
- package/dist/chunks/{bg-DQ0Q3Qv-.js → bg-zWGqkcST.js} +2 -2
- package/dist/chunks/{branch-CeQ9IyZk.js → branch-DJzijRGm.js} +1 -1
- package/dist/chunks/{break-cache-Bd0clV2N.js → break-cache-BQfgkNAo.js} +2 -2
- package/dist/chunks/{bridge-yerAiaK2.js → bridge-Dpr2AWpc.js} +2 -2
- package/dist/chunks/bridgeConfig-CcANVX0P.js +1 -0
- package/dist/chunks/{bridgeConfig-CCtXe8ak.js → bridgeConfig-DDF3teRE.js} +1 -1
- package/dist/chunks/bridgeEnabled-Cn-u7P4_.js +1 -0
- package/dist/chunks/{bridgeEnabled--F-6TUi4.js → bridgeEnabled-D4JDZd0y.js} +1 -1
- package/dist/chunks/{bridgeMain--R1HFbOv.js → bridgeMain-CtgVyLjI.js} +7 -7
- package/dist/chunks/bridgeMain-Dh0gWRVo.js +1 -0
- package/dist/chunks/{bridgeMessaging-CqbLTDcx.js → bridgeMessaging-CRG6HqUb.js} +1 -1
- package/dist/chunks/{bridgePointer-W_jdQ8zf.js → bridgePointer-Cug5fQ3e.js} +1 -1
- package/dist/chunks/{browser-Bd7GeBH1.js → browser-BKiu1max.js} +1 -1
- package/dist/chunks/{btw-CVGRmL9a.js → btw-DG9CCeq4.js} +1 -1
- package/dist/chunks/{caches-BtmAri4e.js → caches-BB5_91gU.js} +2 -2
- package/dist/chunks/caches-C3NINY3K.js +1 -0
- package/dist/chunks/{ccrClient-HqMi5Kfu.js → ccrClient-CRXGlUCe.js} +1 -1
- package/dist/chunks/{claudeDesktop-aUMx06RK.js → claudeDesktop-9xfIgkzE.js} +1 -1
- package/dist/chunks/{clear-C6nRzIQE.js → clear-ueMvDelv.js} +1 -1
- package/dist/chunks/{cliLaunch-2AUoMnqx.js → cliLaunch-BJ9o-rIV.js} +1 -1
- package/dist/chunks/client-AnWHs0gW.js +1 -0
- package/dist/chunks/{color-DXI_4ibU.js → color-B0-MIfsq.js} +1 -1
- package/dist/chunks/commands-DsKH3ogN.js +1 -0
- package/dist/chunks/commitAttribution-D7NrwLhc.js +1 -0
- package/dist/chunks/{commitAttribution-Cm40fdNU.js → commitAttribution-DKun9CeU.js} +1 -1
- package/dist/chunks/{compact-DPTVpJ4D.js → compact-BhWCO-oD.js} +1 -1
- package/dist/chunks/completionCache-C9zlWBRz.js +1 -0
- package/dist/chunks/{completionCache-BQaLkB4d.js → completionCache-CdHCuiqq.js} +2 -2
- package/dist/chunks/{config-C7YHKCPV.js → config-662VDD70.js} +1 -1
- package/dist/chunks/config-CUN8YbOa.js +1 -0
- package/dist/chunks/{config-CLmFk-5V.js → config-DklnhNx1.js} +1 -1
- package/dist/chunks/config-Wk3svGdH.js +1 -0
- package/dist/chunks/{context-C_cKrBUn.js → context-DBswG0EY.js} +1 -1
- package/dist/chunks/context-noninteractive-C3dICmA9.js +1 -0
- package/dist/chunks/{context-noninteractive-DnH6Q9Lu.js → context-noninteractive-CTvyNimw.js} +1 -1
- package/dist/chunks/{conversation-GJxfkr6M.js → conversation-CooSju3g.js} +1 -1
- package/dist/chunks/conversation-DLLIOKYV.js +1 -0
- package/dist/chunks/{createSSHSession--bWmmIk9.js → createSSHSession-BdO35H6o.js} +1 -1
- package/dist/chunks/{createSession-DIr4sUp6.js → createSession-Br1g8qSD.js} +1 -1
- package/dist/chunks/createSession-CVG8SiEm.js +1 -0
- package/dist/chunks/{crossProjectResume-DKrtjTpm.js → crossProjectResume-DiKJb83I.js} +1 -1
- package/dist/chunks/cwd--nvsx73T.js +1 -0
- package/dist/chunks/{cwd-BuJhkTrc.js → cwd-CYmmnQVS.js} +1 -1
- package/dist/chunks/{daemon-B9lBPdBJ.js → daemon-BQiSFjc-.js} +1 -1
- package/dist/chunks/{datadog-DNCsyfSO.js → datadog-BE6D_6m0.js} +1 -1
- package/dist/chunks/datadog-C69i7cfI.js +1 -0
- package/dist/chunks/debug-8kgDrUfj.js +1 -0
- package/dist/chunks/{debug-IKW-jE7K.js → debug-DiuXEmUq.js} +1 -1
- package/dist/chunks/{debugUtils-D2981c0Z.js → debugUtils-3YYWvb3H.js} +1 -1
- package/dist/chunks/{desktop-B5cvrcOQ.js → desktop-W7SA8BFk.js} +1 -1
- package/dist/chunks/{detached-rfIUyc-B.js → detached-Cv9gAylK.js} +1 -1
- package/dist/chunks/{detectRepository-ReZ0Fz8Z.js → detectRepository-B1PMTLAU.js} +1 -1
- package/dist/chunks/detectRepository-_Kj817Vi.js +1 -0
- package/dist/chunks/{diff-cXAp9cNN.js → diff-CMtRjFUb.js} +1 -1
- package/dist/chunks/{directoryCompletion-DBM2o5kx.js → directoryCompletion-CeV63gvu.js} +1 -1
- package/dist/chunks/doctor-DEz8BHAz.js +1 -0
- package/dist/chunks/{effort-Br8KKHdx.js → effort-BAlVDBHq.js} +1 -1
- package/dist/chunks/{entry-4lIRMrLI.js → entry-DLqeVq5C.js} +2 -2
- package/dist/chunks/envLessBridgeConfig-3kCrKZl7.js +1 -0
- package/dist/chunks/envLessBridgeConfig-BfgXw47_.js +1 -0
- package/dist/chunks/{execFileNoThrow-COKYqVQj.js → execFileNoThrow-DResQRvR.js} +1 -1
- package/dist/chunks/{execSyncWrapper-DZJ3tNWF.js → execSyncWrapper-CWxMek26.js} +1 -1
- package/dist/chunks/{exit-Z9oWrqE4.js → exit-cyepwuyy.js} +1 -1
- package/dist/chunks/extra-usage-DlFeNGQD.js +1 -0
- package/dist/chunks/{extra-usage-core-CdL1ltqq.js → extra-usage-core-Dh4rVUI-.js} +1 -1
- package/dist/chunks/{extra-usage-DtAIhW74.js → extra-usage-nRFfBiXh.js} +1 -1
- package/dist/chunks/{extra-usage-noninteractive-DxxRI0Yx.js → extra-usage-noninteractive-D4Ya5KPm.js} +1 -1
- package/dist/chunks/{extraUsage-BYZdi44Y.js → extraUsage-DtWi8E78.js} +1 -1
- package/dist/chunks/extractMemories-BqN8fWZ5.js +1 -0
- package/dist/chunks/{fast-DKqiojzf.js → fast-DkUxqWhE.js} +1 -1
- package/dist/chunks/fast-NvqW2-t1.js +1 -0
- package/dist/chunks/{feedback-yB19xph5.js → feedback-Cn7Sbqxa.js} +1 -1
- package/dist/chunks/{file-D1cN3LMK.js → file-BZriE-XU.js} +1 -1
- package/dist/chunks/{files-DAzGtmzz.js → files-Cz1-PK3r.js} +1 -1
- package/dist/chunks/firstPartyEventLogger-AhXYSrkP.js +1 -0
- package/dist/chunks/{firstPartyEventLogger-hU-LPkje.js → firstPartyEventLogger-BQYrBdvD.js} +2 -2
- package/dist/chunks/{flushGate-ZFr8yv7F.js → flushGate-ebqQZF1t.js} +1 -1
- package/dist/chunks/{gemini-DqAv8_GY.js → gemini-Sr_00TsL.js} +1 -1
- package/dist/chunks/{generateRecap-lO2PDlx8.js → generateRecap-5d4l_ODy.js} +1 -1
- package/dist/chunks/{generateSessionName-48veu5dv.js → generateSessionName-DEAw5x_h.js} +1 -1
- package/dist/chunks/{genericProcessUtils-F1Qcb1sO.js → genericProcessUtils-DO7Fy0RJ.js} +1 -1
- package/dist/chunks/git-Cc1jAz6r.js +1 -0
- package/dist/chunks/{git-tyaWOgRL.js → git-Cgc8X5l2.js} +2 -2
- package/dist/chunks/{githubRepoPathMapping-BlR0BphY.js → githubRepoPathMapping-Tt-LdYFZ.js} +1 -1
- package/dist/chunks/{goal-Bn8Kz2Dp.js → goal-DCaI1NPN.js} +1 -1
- package/dist/chunks/{grok-DhnO_KDC.js → grok-CKlngG3b.js} +1 -1
- package/dist/chunks/{grove-DotW04-v.js → grove-DSWe6psK.js} +1 -1
- package/dist/chunks/{heapdump-DkZSKNbp.js → heapdump-OVbV05On.js} +1 -1
- package/dist/chunks/{help-DU_BcZtU.js → help-CRtX5VX9.js} +1 -1
- package/dist/chunks/hooks-DvtnNoYE.js +1 -0
- package/dist/chunks/{hooks-BTMWE5Qx.js → hooks-tpf90xd5.js} +1 -1
- package/dist/chunks/{hostGuard-Dh296c6q.js → hostGuard-t7QfbijF.js} +1 -1
- package/dist/chunks/{inboundAttachments-DVs3_m48.js → inboundAttachments-BZ6MKpxd.js} +1 -1
- package/dist/chunks/inboundAttachments-D5Ux2kCl.js +1 -0
- package/dist/chunks/{initReplBridge-D0Xec8S-.js → initReplBridge-CjuO6in6.js} +1 -1
- package/dist/chunks/{install-BkfXeXpv.js → install-DqpM2brU.js} +1 -1
- package/dist/chunks/{instrumentation-H0XRS1yG.js → instrumentation--Sx0y1Gk.js} +3 -3
- package/dist/chunks/{job-DKtLkF8V.js → job-D7B35Usp.js} +1 -1
- package/dist/chunks/{jwtUtils-C-ojmb8W.js → jwtUtils-CqXPjf-a.js} +1 -1
- package/dist/chunks/{keybindings-ez51eHHp.js → keybindings-JvAmBpLt.js} +1 -1
- package/dist/chunks/{language-BuRSO2sR.js → language-8Rnu_qxl.js} +1 -1
- package/dist/chunks/language-DaxZe0Xw.js +1 -0
- package/dist/chunks/{launchAgentsPlatform-BQyPdrHp.js → launchAgentsPlatform-CNPkOVzu.js} +1 -1
- package/dist/chunks/{launchLocalMemory-CWHAj7CX.js → launchLocalMemory-BxmDhENs.js} +1 -1
- package/dist/chunks/{launchLocalVault-D8iJdtsP.js → launchLocalVault-DQlTGA-g.js} +1 -1
- package/dist/chunks/{launchMemoryStores-W7jWG2uH.js → launchMemoryStores-EYAwxI8i.js} +1 -1
- package/dist/chunks/{launchOnboarding-q__LaLy1.js → launchOnboarding-CTu5Zf4E.js} +1 -1
- package/dist/chunks/{launchSchedule-BWi9F5vh.js → launchSchedule-CeHHSvO7.js} +1 -1
- package/dist/chunks/{launchSkillStore-4wd4MQBc.js → launchSkillStore-Bqh2Fru2.js} +1 -1
- package/dist/chunks/{launchTeleport-BlCf2QM_.js → launchTeleport-Crc3XVZX.js} +1 -1
- package/dist/chunks/{launchVault-C7u7LZV7.js → launchVault-BHLgpth_.js} +1 -1
- package/dist/chunks/loadAgentsDir-D7npVvsj.js +1 -0
- package/dist/chunks/{loadAgentsDir-nzr38hai.js → loadAgentsDir-ZQwvbURI.js} +66 -66
- package/dist/chunks/{loadPluginHooks-z1-zvBLw.js → loadPluginHooks-CaKvZVZI.js} +1 -1
- package/dist/chunks/localSearch-BU5oulbF.js +1 -0
- package/dist/chunks/{localSearch-B-L_ldos.js → localSearch-H0LchlTi.js} +1 -1
- package/dist/chunks/{log-B3eB4EFv.js → log-Duzb4o6h.js} +1 -1
- package/dist/chunks/{logoV2Utils-RQ160dI2.js → logoV2Utils-5lcUu53m.js} +1 -1
- package/dist/chunks/{magicDocs-BqZ0GewA.js → magicDocs-D1FIPmYg.js} +1 -1
- package/dist/chunks/main-B8XtFN2P.js +859 -0
- package/dist/chunks/{main-DeFMhaFE.js → main-CR7cXdgy.js} +3 -3
- package/dist/chunks/{mappers-CWykjGfP.js → mappers-DKU4RgE3.js} +1 -1
- package/dist/chunks/{mcp-DBwT4pa9.js → mcp-B06Mqsur.js} +4 -4
- package/dist/chunks/{mcp-DvZTaHZE.js → mcp-C0AjA07u.js} +1 -1
- package/dist/chunks/{mcp-CSFPAfaW.js → mcp-ghioDl7W.js} +1 -1
- package/dist/chunks/{memoize-BO31Ws9Q.js → memoize-DgMjqLtn.js} +1 -1
- package/dist/chunks/{memory-DcpPpYN0.js → memory-D-Q62bJ7.js} +1 -1
- package/dist/chunks/{metadata-BRLJvh61.js → metadata-CIx5CsoY.js} +1 -1
- package/dist/chunks/{mode-BkViT_0o.js → mode-DFZgqKBd.js} +1 -1
- package/dist/chunks/{model-DfFA3qMO.js → model-BgrLt7P7.js} +1 -1
- package/dist/chunks/model-aVc5c3Lz.js +1 -0
- package/dist/chunks/{model-CZktWw6o.js → model-fDWtIRVr.js} +1 -1
- package/dist/chunks/{nativeInstaller-GcIk7G2Y.js → nativeInstaller-DKe1pWoL.js} +1 -1
- package/dist/chunks/{onChangeAppState-DwGVi-BC.js → onChangeAppState-DaQ0R9Tw.js} +1 -1
- package/dist/chunks/{openai-B2wxZDQx.js → openai-DNS0-ivj.js} +1 -1
- package/dist/chunks/{overageCreditGrant-CjK49axw.js → overageCreditGrant-qHN3tnp2.js} +1 -1
- package/dist/chunks/{panel-R4ue6pSW.js → panel-Be-OxtqL.js} +1 -1
- package/dist/chunks/{panel-B-nrcHpm.js → panel-CrTPqXCv.js} +1 -1
- package/dist/chunks/{panelCall-I_fbgub5.js → panelCall-BvKpHquo.js} +1 -1
- package/dist/chunks/parser-Bj3gOqFv.js +1 -0
- package/dist/chunks/{parser-CQrasoUB.js → parser-TYEkLFgh.js} +1 -1
- package/dist/chunks/{partition-CxRF7T-f.js → partition-Cv11dD5P.js} +1 -1
- package/dist/chunks/{passes-U_h-hNu-.js → passes-DQdM2Ssq.js} +1 -1
- package/dist/chunks/{path-BCSE0S-c.js → path-Cu_AKqg6.js} +1 -1
- package/dist/chunks/{permissions-B8epy16o.js → permissions-DB_2mmCl.js} +1 -1
- package/dist/chunks/{pidLock-CBJDnBG_.js → pidLock-DchmaAK6.js} +2 -2
- package/dist/chunks/{pipeTransport-D3Qx9v1V.js → pipeTransport-7GIO6GCA.js} +1 -1
- package/dist/chunks/{plan-BAhStVci.js → plan-D8dQDl8W.js} +1 -1
- package/dist/chunks/{platform-EtecGacO.js → platform-B5dCGT8t.js} +1 -1
- package/dist/chunks/{plugin-D9huNnv6.js → plugin-w8MqsKHn.js} +1 -1
- package/dist/chunks/{pluginAutoupdate-BfmyxR5g.js → pluginAutoupdate-7FFHzSRz.js} +1 -1
- package/dist/chunks/{pluginBlocklist-03sZaZa6.js → pluginBlocklist-Cw_l-yal.js} +1 -1
- package/dist/chunks/{pluginCliCommands-P2Ndi1r1.js → pluginCliCommands-BtYWRxhS.js} +1 -1
- package/dist/chunks/{pluginFlagging-BVy7Xv_0.js → pluginFlagging-_WUQP3Lq.js} +1 -1
- package/dist/chunks/{pluginOperations-Cz37qcjF.js → pluginOperations-BOkST1qE.js} +1 -1
- package/dist/chunks/{pluginStartupCheck-w24D-wwk.js → pluginStartupCheck-BelpzwZI.js} +1 -1
- package/dist/chunks/pluginStartupCheck-XBLJZZys.js +1 -0
- package/dist/chunks/{plugins-B0hiIN4q.js → plugins-6px6K1fh.js} +1 -1
- package/dist/chunks/policyLimits-C07tQ0Wr.js +1 -0
- package/dist/chunks/{poor-CfbMKZNJ.js → poor-D3T_8wwf.js} +1 -1
- package/dist/chunks/poorMode-BdBDiOFD.js +1 -0
- package/dist/chunks/{poorMode-Bsw2V-V_.js → poorMode-BqyVuBu-.js} +1 -1
- package/dist/chunks/{print-ozjC0Mhg.js → print-DcQSuK0v.js} +4 -4
- package/dist/chunks/{privacy-settings-DeGoBRrZ.js → privacy-settings-D5zxu4Aa.js} +1 -1
- package/dist/chunks/{processBashCommand-loWZ8MSE.js → processBashCommand-CEqA4QZi.js} +1 -1
- package/dist/chunks/{processSlashCommand-BdouajZb.js → processSlashCommand-DMpFk59M.js} +1 -1
- package/dist/chunks/prompt-CKvoqUC3.js +1 -0
- package/dist/chunks/prompt-aXZPR3q8.js +1 -0
- package/dist/chunks/{prompt-Bef63FhB.js → prompt-wys9CwDo.js} +1 -1
- package/dist/chunks/{promptEditor-foiayhdY.js → promptEditor-D6HzjcMS.js} +1 -1
- package/dist/chunks/{protocolHandler-BsiB1oW_.js → protocolHandler-BXlx1N7v.js} +1 -1
- package/dist/chunks/{proxy-Cn2YwITp.js → proxy-CHnxhNZI.js} +1 -1
- package/dist/chunks/{rate-limit-options-DTJPDcTr.js → rate-limit-options-1hc-RyNR.js} +1 -1
- package/dist/chunks/{rcDebugLog-BUuD-X1D.js → rcDebugLog-CivJaJ3V.js} +1 -1
- package/dist/chunks/{reconciler-DqXTmV3J.js → reconciler-BKX4jh34.js} +1 -1
- package/dist/chunks/{referral-DP_GshTS.js → referral-Cu9bEOFE.js} +1 -1
- package/dist/chunks/{refresh-CNzXPAFw.js → refresh-vJbxW4a1.js} +1 -1
- package/dist/chunks/{registerProtocol-CjxlFsKw.js → registerProtocol-B_XbLDQO.js} +3 -3
- package/dist/chunks/{release-notes-BxgK8zWO.js → release-notes-CavWoMQR.js} +1 -1
- package/dist/chunks/{releaseNotes-CbSktIJW.js → releaseNotes-Di6OaHF7.js} +2 -2
- package/dist/chunks/{reload-plugins-CDu6yU5-.js → reload-plugins-ofeLn07p.js} +1 -1
- package/dist/chunks/{remote-env-B4HnhISc.js → remote-env-dXzHAuD6.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-D-wG5jau.js → remoteBridgeCore-CmwkjiTK.js} +1 -1
- package/dist/chunks/{remoteManagedSettings-B7gt0VAX.js → remoteManagedSettings-Co-CxR67.js} +1 -1
- package/dist/chunks/{rename-DlbMb24l.js → rename-CtjP0lop.js} +1 -1
- package/dist/chunks/{renderOptions-5kWQpVr2.js → renderOptions-DOXmueQV.js} +1 -1
- package/dist/chunks/{resume-BB5iBogS.js → resume-C5h5JvY1.js} +1 -1
- package/dist/chunks/{ripgrep-BvDwiKJ3.js → ripgrep-BN_g-F7X.js} +1 -1
- package/dist/chunks/ripgrep-hOjrgpMp.js +1 -0
- package/dist/chunks/{runtimeObserver-Ci-5gvYg.js → runtimeObserver-B93v1AxE.js} +2 -2
- package/dist/chunks/{runtimeObserver-BNH2WGE3.js → runtimeObserver-DOZFrqJu.js} +1 -1
- package/dist/chunks/sandbox-adapter-CO5GuywY.js +1 -0
- package/dist/chunks/{sandbox-toggle-B2Yk4y2V.js → sandbox-toggle-TiLGFwaZ.js} +1 -1
- package/dist/chunks/searchExtraTools-CXZJU2Kv.js +1 -0
- package/dist/chunks/{session-Bmx7L3Mt.js → session-v9tKHhU9.js} +1 -1
- package/dist/chunks/{sessionDiscovery-DcEAr5vJ.js → sessionDiscovery-4byQKOnc.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-BUyIQVzL.js +1 -0
- package/dist/chunks/sessionMemory-ZsxCLHYd.js +1 -0
- package/dist/chunks/{sessionMemory-Bsg2unYX.js → sessionMemory-e6YpTUhW.js} +1 -1
- package/dist/chunks/sessionMemoryUtils-BD_dqyYB.js +1 -0
- package/dist/chunks/sessionObserver-DNItJztR.js +1 -0
- package/dist/chunks/{sessionObserver-DQwHsDrM.js → sessionObserver-OgY9BUP4.js} +1 -1
- package/dist/chunks/sessionStorage-xvxpRETp.js +1 -0
- package/dist/chunks/{sessionTitle-B8jcexkQ.js → sessionTitle-Bph6GO4F.js} +1 -1
- package/dist/chunks/{sessionTracing-BuLsL6qA.js → sessionTracing-BBxhPccY.js} +1 -1
- package/dist/chunks/{settings-5PQdphqC.js → settings-BhvhCpVh.js} +2 -2
- package/dist/chunks/settingsSync-D2B5K4BT.js +1 -0
- package/dist/chunks/{setup-BKEnSLR9.js → setup-CEnNEK6Z.js} +2 -2
- package/dist/chunks/{shadowedRuleDetection-7Z8ezTKF.js → shadowedRuleDetection-DDSOFi1W.js} +1 -1
- package/dist/chunks/{shellQuote-fB02N16J.js → shellQuote-yXoC_y5m.js} +1 -1
- package/dist/chunks/{sideQuestion-CYdNATPW.js → sideQuestion-CAiA6jAf.js} +1 -1
- package/dist/chunks/sink-CyKOf5TT.js +1 -0
- package/dist/chunks/{sink-DjKoYMsA.js → sink-DxPJ4khU.js} +1 -1
- package/dist/chunks/{sinks-GryGVRT8.js → sinks-BNo3DvxO.js} +2 -2
- package/dist/chunks/sinks-CHgtwDha.js +1 -0
- package/dist/chunks/{skill-learning-E8tQed-Q.js → skill-learning-Dx1o4mMo.js} +1 -1
- package/dist/chunks/{skillChangeDetector-A8SAuyo9.js → skillChangeDetector-BRBCwQ2w.js} +1 -1
- package/dist/chunks/{skillGapStore-B5rl12bV.js → skillGapStore-BV_6qzxU.js} +1 -1
- package/dist/chunks/{skillGapStore-CjJrxxjk.js → skillGapStore-Zvqiyxds.js} +2 -2
- package/dist/chunks/{skillGenerator-BDR_z3-X.js → skillGenerator-jJQDphQ8.js} +2 -2
- package/dist/chunks/skillLearning-BH7EAU1m.js +1 -0
- package/dist/chunks/{skillLearning-BQtfFE0g.js → skillLearning-BTT3_yGc.js} +1 -1
- package/dist/chunks/{skillPanel-yR8Oi-mO.js → skillPanel-OW2M6SZr.js} +3 -3
- package/dist/chunks/{skillSearchPanel-DUQQUCUS.js → skillSearchPanel-C0Y56c5N.js} +4 -4
- package/dist/chunks/{skills-NAZQ3j-t.js → skills-BFsyLP33.js} +1 -1
- package/dist/chunks/{startupProfiler-DxRQteII.js → startupProfiler-BquH_Yqm.js} +1 -1
- package/dist/chunks/startupProfiler-CYCH-qos.js +1 -0
- package/dist/chunks/state-BOa-3Av3.js +1 -0
- package/dist/chunks/{state-4KQ3kaqz.js → state-ix0xIunV.js} +1 -1
- package/dist/chunks/{stats-h4yu84Q-.js → stats-CrPmPT8f.js} +1 -1
- package/dist/chunks/{status-BbdeubJG.js → status-BO5J2MAe.js} +1 -1
- package/dist/chunks/{status-is_Bg_IB.js → status-DHJbK4pV.js} +1 -1
- package/dist/chunks/{statusNoticeHelpers-CQ7CUugR.js → statusNoticeHelpers-CqeUBySi.js} +1 -1
- package/dist/chunks/{stickers-qJoNhPk4.js → stickers-BLFmyHZV.js} +1 -1
- package/dist/chunks/{stringUtils-CvXbHQRH.js → stringUtils-D_g2L6A4.js} +1 -1
- package/dist/chunks/systemPromptSections-CR_AoPIX.js +1 -0
- package/dist/chunks/{systemPromptSections-CgpggIYX.js → systemPromptSections-DN0HGVye.js} +1 -1
- package/dist/chunks/{tag-i3HZ4lhj.js → tag-M2AEtXjW.js} +1 -1
- package/dist/chunks/{tasks-HzsYNTZ1.js → tasks-CoOs_Qkj.js} +1 -1
- package/dist/chunks/{teleport-hN3cAbYC.js → teleport-DjIgQeBB.js} +1 -1
- package/dist/chunks/{templateJobs-CIv_ysje.js → templateJobs-Cl50Qw0s.js} +1 -1
- package/dist/chunks/{terminalSetup-CxniwSF-.js → terminalSetup-Bdh9K31U.js} +1 -1
- package/dist/chunks/{terminalSetup-C0PF87iu.js → terminalSetup-nvS3KCDG.js} +1 -1
- package/dist/chunks/{theme-BKIHX_Dx.js → theme-DgCIr0jU.js} +1 -1
- package/dist/chunks/thinkback-BSv_fvbV.js +1 -0
- package/dist/chunks/{thinkback-mT-8FIT-.js → thinkback-ERCQ86CR.js} +1 -1
- package/dist/chunks/{thinkback-play-Cfk49mvF.js → thinkback-play-DNB0IWYt.js} +1 -1
- package/dist/chunks/{tmux-CbsW-VDJ.js → tmux-ZZk68JBq.js} +1 -1
- package/dist/chunks/{toolEventObserver-8FQtxeVv.js → toolEventObserver-9-5Ne25Z.js} +1 -1
- package/dist/chunks/{toolEventObserver-B1xvyKdE.js → toolEventObserver-9XCQXiMx.js} +1 -1
- package/dist/chunks/{toolPool-CHVDZqh7.js → toolPool-uQKZRMKg.js} +1 -1
- package/dist/chunks/trustedDevice-0ej6e3nx.js +1 -0
- package/dist/chunks/{trustedDevice-BYCh1ff7.js → trustedDevice-nqhuw4tp.js} +1 -1
- package/dist/chunks/{tui-fTa_pzdA.js → tui-C2yuCuOU.js} +3 -3
- package/dist/chunks/{types-a7X-tJpJ.js → types-Cnorfsss.js} +1 -1
- package/dist/chunks/{udsClient-Cg9bBD0p.js → udsClient-CiFj4M_h.js} +1 -1
- package/dist/chunks/{ultrareviewCommand-DCFRZsKp.js → ultrareviewCommand-BMBHepdu.js} +1 -1
- package/dist/chunks/undercover-6UUO38fQ.js +1 -0
- package/dist/chunks/{undercover-CsLPQb-a.js → undercover-DDgIKbO5.js} +3 -3
- package/dist/chunks/{up-dO5BcPaq.js → up-D6bNw_tT.js} +1 -1
- package/dist/chunks/{updateCCB-CfUnkOLT.js → updateCCB-B-OlpLjA.js} +1 -1
- package/dist/chunks/{upgrade-kpttjebY.js → upgrade-BN20nsCH.js} +1 -1
- package/dist/chunks/upgrade-DYqlCH80.js +1 -0
- package/dist/chunks/{upload-DDhQqV8n.js → upload-BQGByiXE.js} +1 -1
- package/dist/chunks/{upstreamproxy-CvcjNY7J.js → upstreamproxy-os5rw0Vg.js} +1 -1
- package/dist/chunks/{usage-CJ5w0907.js → usage-D_sqm8us.js} +1 -1
- package/dist/chunks/usage-DolSCKGi.js +1 -0
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-yAroCqu4.js → useExitOnCtrlCDWithKeybindings-vzUoPY51.js} +1 -1
- package/dist/chunks/useMainLoopModel-cZd8EKo5.js +1 -0
- package/dist/chunks/{useManagePlugins-CTtPaQRP.js → useManagePlugins-DgGZBvXV.js} +1 -1
- package/dist/chunks/{useMergedTools-CZJffsmf.js → useMergedTools-Bb4XbC9d.js} +1 -1
- package/dist/chunks/{useSearchInput-C-CqUK6w.js → useSearchInput-B1UOjxAI.js} +1 -1
- package/dist/chunks/{useSettingsErrors-BWlJCgYF.js → useSettingsErrors-BLbvu4--.js} +1 -1
- package/dist/chunks/{util-DJV0joAW.js → util-CxlfALM4.js} +1 -1
- package/dist/chunks/validatePlugin-n8a4W_jI.js +1 -0
- package/dist/chunks/{vim-n8-UT5w-.js → vim-DLWBHwVM.js} +1 -1
- package/dist/chunks/{which-BBCjXfI2.js → which-sEFQXpaX.js} +1 -1
- package/dist/chunks/windowsPaths-BLevJOlm.js +1 -0
- package/dist/chunks/{windowsPaths-D6T_3XaU.js → windowsPaths-N_YmYY6k.js} +1 -1
- package/dist/chunks/{workSecret-C_lv0dRh.js → workSecret-DvniZR71.js} +1 -1
- package/dist/chunks/{workerRegistry-BdHi7_sN.js → workerRegistry-CFnGtb3L.js} +1 -1
- package/dist/chunks/worktree-Dr_WzlXs.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/ApproveApiKey-DfAPwDix.js +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-BV7HHcgL.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-CU5fCPKq.js +0 -1
- package/dist/chunks/Doctor-B0CRtxi2.js +0 -1
- package/dist/chunks/Grove-CelgLWH4.js +0 -1
- package/dist/chunks/Messages-jCoW_1Rr.js +0 -11
- package/dist/chunks/REPL-DcpN3MRC.js +0 -1
- package/dist/chunks/RemoteSessionManager-Tx1N2uVL.js +0 -2
- package/dist/chunks/SearchExtraToolsTool-D3VOFq9R.js +0 -1
- package/dist/chunks/WelcomeV2-BTfttGcv.js +0 -1
- package/dist/chunks/api-L2IgleTV.js +0 -1
- package/dist/chunks/api-TgV7fl9V.js +0 -1
- package/dist/chunks/asciicast-DYbkzGCN.js +0 -1
- package/dist/chunks/assistant-YvbVKjVh.js +0 -1
- package/dist/chunks/auth-CEig4Gxp.js +0 -1
- package/dist/chunks/auth-CbGDlhyO.js +0 -1
- package/dist/chunks/backgroundHousekeeping-BNEKWHhH.js +0 -1
- package/dist/chunks/bg-BzG63WOm.js +0 -1
- package/dist/chunks/bridgeConfig-D5dB38xD.js +0 -1
- package/dist/chunks/bridgeEnabled-DKX8-T_H.js +0 -1
- package/dist/chunks/bridgeMain-d06JByZn.js +0 -1
- package/dist/chunks/caches-BuTIAOtY.js +0 -1
- package/dist/chunks/client-BeET1hnC.js +0 -1
- package/dist/chunks/commands-VjcG4qFq.js +0 -1
- package/dist/chunks/commitAttribution-Lb3qUlAR.js +0 -1
- package/dist/chunks/completionCache-CW8lKIgy.js +0 -1
- package/dist/chunks/config-0cRberzR.js +0 -1
- package/dist/chunks/config-BrxKpHpR.js +0 -1
- package/dist/chunks/context-noninteractive-rUZ3ydmJ.js +0 -1
- package/dist/chunks/conversation-oK3aFzqO.js +0 -1
- package/dist/chunks/createSession-DM4acqaC.js +0 -1
- package/dist/chunks/cwd-D-tY2NKc.js +0 -1
- package/dist/chunks/datadog-ByS7LGGa.js +0 -1
- package/dist/chunks/debug-DzZUT2Wv.js +0 -1
- package/dist/chunks/detectRepository-6nw-Aw3v.js +0 -1
- package/dist/chunks/doctor-CTMHXZvQ.js +0 -1
- package/dist/chunks/envLessBridgeConfig-CGuIxFzJ.js +0 -1
- package/dist/chunks/envLessBridgeConfig-D_Jg4fJy.js +0 -1
- package/dist/chunks/extra-usage-BS4aVOt5.js +0 -1
- package/dist/chunks/extractMemories-C4f9JWuI.js +0 -1
- package/dist/chunks/fast-B0OB4x7K.js +0 -1
- package/dist/chunks/firstPartyEventLogger-CdUpe6Lh.js +0 -1
- package/dist/chunks/git-BE_FiJZp.js +0 -1
- package/dist/chunks/hooks-DONAb_nq.js +0 -1
- package/dist/chunks/inboundAttachments-BcEgi49j.js +0 -1
- package/dist/chunks/language-Da4KNbjm.js +0 -1
- package/dist/chunks/loadAgentsDir-Dgd-fzNt.js +0 -1
- package/dist/chunks/localSearch-D-FprOMr.js +0 -1
- package/dist/chunks/main-y7LJ5qUc.js +0 -1243
- package/dist/chunks/model--z4Di9QO.js +0 -1
- package/dist/chunks/parser-BlM_Fk4J.js +0 -1
- package/dist/chunks/pluginStartupCheck-BqUwHcMD.js +0 -1
- package/dist/chunks/policyLimits-Dem-XJ_h.js +0 -1
- package/dist/chunks/poorMode-jvImnkty.js +0 -1
- package/dist/chunks/prompt-C7wd1H_i.js +0 -1
- package/dist/chunks/prompt-DIoNqZvO.js +0 -1
- package/dist/chunks/ripgrep-BQgJ02F9.js +0 -1
- package/dist/chunks/sandbox-adapter-Coe1GDAE.js +0 -1
- package/dist/chunks/searchExtraTools-BnWZ9roi.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-BhdOmW9o.js +0 -1
- package/dist/chunks/sessionMemory-CIbCojm-.js +0 -1
- package/dist/chunks/sessionMemoryUtils-Cjb57wtC.js +0 -1
- package/dist/chunks/sessionObserver-CRU1qWnP.js +0 -1
- package/dist/chunks/sessionStorage-BxDN8qRc.js +0 -1
- package/dist/chunks/settingsSync-BDeuErb5.js +0 -1
- package/dist/chunks/sink-iYxWapbU.js +0 -1
- package/dist/chunks/sinks-jfaIjsRJ.js +0 -1
- package/dist/chunks/skillLearning-C8ihdryM.js +0 -1
- package/dist/chunks/startupProfiler-B0m6crkd.js +0 -1
- package/dist/chunks/state-53JDbNQM.js +0 -1
- package/dist/chunks/systemPromptSections-IePG5K8r.js +0 -1
- package/dist/chunks/thinkback-BA4cMz4D.js +0 -1
- package/dist/chunks/trustedDevice-DnIWErCt.js +0 -1
- package/dist/chunks/undercover-B-kKUWtK.js +0 -1
- package/dist/chunks/upgrade-CngUwvY4.js +0 -1
- package/dist/chunks/usage-eZRwLa77.js +0 -1
- package/dist/chunks/useMainLoopModel-BNFW-g8E.js +0 -1
- package/dist/chunks/validatePlugin-CRmpIGLV.js +0 -1
- package/dist/chunks/windowsPaths-DUKTzBck.js +0 -1
- package/dist/chunks/worktree-YDeHMlHZ.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{l as n,o as r}from"./envUtils-DSxRz_kt.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{D as o,Gr as s,Gt as c,H as l,I as u,Lt as d,P as f,T as p,Wt as ee,Xn as m,dr as h,fi as g,hn as _,j as v,k as y,n as b,ot as x,r as S,t as C,x as te,y as w}from"./src-CDCSSo0U2.js";import{t as T}from"./jsx-runtime-Bb4Xn-E0.js";import{$s as ne,$y as E,AD as D,As as O,C_ as k,ED as A,E_ as re,Es as j,Fs as ie,G_ as M,Gs as N,H_ as ae,Hb as P,Hs as oe,ME as se,M_ as ce,Mb as le,Ms as F,Nb as ue,OE as de,O_ as fe,Qg as pe,Rs as I,TD as me,TS as he,Vb as L,Vs as ge,Xs as _e,Ys as ve,ac as ye,am as R,av as be,b_ as z,cv as xe,dg as Se,dv as Ce,ec as we,ex as Te,fS as Ee,fs as De,fv as Oe,hD as ke,i_ as Ae,ic as je,ig as Me,jE as Ne,kD as Pe,k_ as Fe,ks as Ie,lS as Le,lc as Re,lv as ze,nc as Be,nv as Ve,o_ as He,om as Ue,ov as We,ps as Ge,pv as Ke,qs as qe,r_ as Je,rc as Ye,sc as Xe,sv as Ze,tb as Qe,tc as $e,tv as et,tx as tt,uS as nt,uc as rt,uv as it,vs as at,w_ as ot,xD as st,yD as ct,ys as lt}from"./loadAgentsDir-nzr38hai.js";import{D as ut,E as dt,J as ft,U as pt,l as mt,p as ht,z as gt}from"./debug-IKW-jE7K.js";import{St as _t,Tt as vt,_n as yt,at as bt,c as xt,ct as St,f as Ct,g as wt,gn as Tt,it as Et,y as Dt}from"./settings-5PQdphqC.js";import{g as Ot,x as kt}from"./config-C7YHKCPV.js";import{c as At,o as jt,s as Mt}from"./log-B3eB4EFv.js";import{n as Nt,r as Pt}from"./analytics-BotDBGh0.js";import{T as Ft,x as It}from"./startupProfiler-DxRQteII.js";import{l as Lt,u as Rt}from"./oauth-BqJqV-2M.js";import{l as zt,n as Bt,o as Vt}from"./stringUtils-CvXbHQRH.js";import{Mt as Ht,Vt as Ut}from"./model-DfFA3qMO.js";import{a as Wt,n as Gt,o as Kt,r as qt}from"./pluginFlagging-BVy7Xv_0.js";import{u as Jt}from"./referral-DP_GshTS.js";import{n as Yt,t as Xt}from"./browser-Bd7GeBH1.js";import{n as Zt,t as Qt}from"./pluginStartupCheck-w24D-wwk.js";import{a as $t,d as en,f as tn,i as nn,l as rn,o as an,s as on,u as sn}from"./pluginOperations-Cz37qcjF.js";import{a as cn,c as ln,i as un,n as dn,o as fn,s as pn,t as mn}from"./validatePlugin-CRmpIGLV.js";import{i as hn,n as gn,r as _n}from"./MCPConnectionManager-BX0LMz9J.js";import{n as vn,t as yn}from"./useExitOnCtrlCDWithKeybindings-yAroCqu4.js";import{t as bn}from"./SearchBox-vfLXEPed.js";import{n as xn,t as Sn}from"./useSearchInput-C-CqUK6w.js";import{i as Cn,n as wn}from"./pluginAutoupdate-BfmyxR5g.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)(u,{children:[(0,On.jsx)(f,{bold:!0,children:`Capabilities: `}),(0,On.jsx)(f,{color:`text`,children:r.length>0?(0,On.jsx)(p,{children:r}):`none`})]})}var On,kn=e((()=>{g(),C(),On=T()}));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:s=!1}){let[c]=l(),m=vn(),{columns:g}=x(),[y,b]=B.useState(!1),[S,C]=B.useState(null),te=nt(e=>e.mcp),w=Ee(),[T,ne]=B.useState(null),[D,O]=(0,B.useState)(!1),A=(0,B.useRef)(null),[j,ie]=(0,B.useState)(!1),[M,N]=(0,B.useState)(null),[ae,P]=(0,B.useState)(!1),[oe,se]=(0,B.useState)(null),[ce,le]=(0,B.useState)(!1),[F,de]=(0,B.useState)(!1),I=(0,B.useRef)(void 0),me=(0,B.useRef)(!1),[he,ge]=(0,B.useState)(``),[_e,ve]=(0,B.useState)(0),[ye,R]=(0,B.useState)(null);(0,B.useEffect)(()=>()=>{me.current=!0,A.current?.abort(),I.current!==void 0&&clearTimeout(I.current)},[]);let be=e.isAuthenticated||e.client.type===`connected`&&t>0,xe=_n(),Se=B.useCallback(async()=>{ie(!1),N(null),O(!0);try{let t=await xe(e.name),n=t.client.type===`connected`;Pt(`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){Pt(`tengu_claudeai_mcp_auth_completed`,{success:!1}),i?.(jn(t,e.name))}finally{O(!1)}},[xe,e.name,i]),Ce=B.useCallback(async()=>{await Me(e.name,{...e.config,scope:e.scope}),w(t=>{let n=t.mcp.clients.map(t=>t.name===e.name?{...t,type:`needs-auth`}:t),r=re(t.mcp.tools,e.name),i=k(t.mcp.commands,e.name),a=ot(t.mcp.resources,e.name);return{...t,mcp:{...t.mcp,clients:n,tools:r,commands:i,resources:a}}}),Pt(`tengu_claudeai_mcp_clear_auth_completed`,{}),i?.(`Disconnected from ${e.name}.`),P(!1),se(null),le(!1)},[e.name,e.config,e.scope,w,i]);ee(`confirm:no`,()=>{A.current?.abort(),A.current=null,b(!1),ne(null)},{context:`Confirmation`,isActive:y}),ee(`confirm:no`,()=>{ie(!1),N(null)},{context:`Confirmation`,isActive:j}),ee(`confirm:no`,()=>{P(!1),se(null),le(!1)},{context:`Confirmation`,isActive:ae}),_((e,t)=>{if(t.return&&j&&Se(),t.return&&ae)if(ce)Ce();else{let e=`${Lt().CLAUDE_AI_ORIGIN}/settings/connectors`;se(e),le(!0),Yt(e)}if(e===`c`&&!F){let e=T||M||oe;e&&h(e).then(e=>{me.current||(e&&process.stdout.write(e),de(!0),I.current!==void 0&&clearTimeout(I.current),I.current=setTimeout(de,2e3,!1))})}});let we=Bt(String(e.name)),De=fe(te.commands,e.name).length,Oe=hn(),ke=B.useCallback(async()=>{let t=Lt().CLAUDE_AI_ORIGIN,n=Ht()?.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`,N(r),ie(!0),Pt(`tengu_claudeai_mcp_auth_started`,{}),await Yt(r)},[e.config]),je=B.useCallback(()=>{P(!0),Pt(`tengu_claudeai_mcp_clear_auth_started`,{})},[]),Ne=B.useCallback(async()=>{let t=e.client.type!==`disabled`;try{await Oe(e.name),e.config.type===`claudeai-proxy`&&Pt(`tengu_claudeai_mcp_toggle`,{new_state:t?`disabled`:`enabled`}),r()}catch(n){i?.(`Failed to ${t?`disable`:`enable`} MCP server '${e.name}': ${gt(n)}`)}},[e.client.type,e.config.type,e.name,Oe,r,i]),Pe=B.useCallback(async()=>{if(e.config.type===`claudeai-proxy`)return;b(!0),C(null);let t=new AbortController;A.current=t;try{if(e.isAuthenticated&&e.config&&await He(e.name,e.config,{preserveStepUpState:!0}),e.config){await Ae(e.name,e.config,ne,t.signal,{onWaitingForCallback:e=>{R(()=>e)}}),Pt(`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.`):(At(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 pe)&&C(e.message)}finally{b(!1),A.current=null,R(null),ge(``)}},[e.isAuthenticated,e.config,e.name,i,xe,be]),Fe=async()=>{e.config.type!==`claudeai-proxy`&&e.config&&(await He(e.name,e.config),Pt(`tengu_mcp_auth_config_clear`,{}),await Me(e.name,{...e.config,scope:e.scope}),w(t=>{let n=t.mcp.clients.map(t=>t.name===e.name?{...t,type:`failed`}:t),r=re(t.mcp.tools,e.name),i=k(t.mcp.commands,e.name),a=ot(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(y){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)(u,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(f,{color:`claude`,children:[`Authenticating with `,e.name,`…`]}),(0,V.jsxs)(u,{children:[(0,V.jsx)(E,{}),(0,V.jsx)(f,{children:t})]}),T&&(0,V.jsxs)(u,{flexDirection:`column`,children:[(0,V.jsxs)(u,{children:[(0,V.jsx)(f,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL manually `}),F?(0,V.jsx)(f,{color:`success`,children:`(Copied!)`}):(0,V.jsx)(f,{dimColor:!0,children:(0,V.jsx)(o,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,V.jsx)(d,{url:T})]}),y&&T&&ye&&(0,V.jsxs)(u,{flexDirection:`column`,marginTop:1,children:[(0,V.jsx)(f,{dimColor:!0,children:`If the redirect page shows a connection error, paste the URL from your browser's address bar:`}),(0,V.jsxs)(u,{children:[(0,V.jsxs)(f,{dimColor:!0,children:[`URL `,`>`,` `]}),(0,V.jsx)(Te,{value:he,onChange:ge,onSubmit:e=>{ye(e.trim()),ge(``)},cursorOffset:_e,onChangeCursorOffset:ve,columns:g-8})]})]}),(0,V.jsx)(u,{marginLeft:3,children:(0,V.jsx)(f,{dimColor:!0,children:`Return here after authenticating in your browser. Press Esc to go back.`})})]})}if(j)return(0,V.jsxs)(u,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(f,{color:`claude`,children:[`Authenticating with `,e.name,`…`]}),(0,V.jsxs)(u,{children:[(0,V.jsx)(E,{}),(0,V.jsx)(f,{children:` A browser window will open for authentication`})]}),M&&(0,V.jsxs)(u,{flexDirection:`column`,children:[(0,V.jsxs)(u,{children:[(0,V.jsx)(f,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL manually `}),F?(0,V.jsx)(f,{color:`success`,children:`(Copied!)`}):(0,V.jsx)(f,{dimColor:!0,children:(0,V.jsx)(o,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,V.jsx)(d,{url:M})]}),(0,V.jsxs)(u,{marginLeft:3,flexDirection:`column`,children:[(0,V.jsxs)(f,{color:`permission`,children:[`Press `,(0,V.jsx)(f,{bold:!0,children:`Enter`}),` after authenticating in your browser.`]}),(0,V.jsx)(f,{dimColor:!0,italic:!0,children:(0,V.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})]})]});if(ae)return(0,V.jsxs)(u,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(f,{color:`claude`,children:[`Clear authentication for `,e.name]}),ce?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(f,{children:`Find the MCP server in the browser and click "Disconnect".`}),oe&&(0,V.jsxs)(u,{flexDirection:`column`,children:[(0,V.jsxs)(u,{children:[(0,V.jsx)(f,{dimColor:!0,children:`If your browser didn't open automatically, copy this URL manually `}),F?(0,V.jsx)(f,{color:`success`,children:`(Copied!)`}):(0,V.jsx)(f,{dimColor:!0,children:(0,V.jsx)(o,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,V.jsx)(d,{url:oe})]}),(0,V.jsxs)(u,{marginLeft:3,flexDirection:`column`,children:[(0,V.jsxs)(f,{color:`permission`,children:[`Press `,(0,V.jsx)(f,{bold:!0,children:`Enter`}),` when done.`]}),(0,V.jsx)(f,{dimColor:!0,italic:!0,children:(0,V.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})]})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(f,{children:`This will open claude.ai in the browser. Find the MCP server in the list and click "Disconnect".`}),(0,V.jsxs)(u,{marginLeft:3,flexDirection:`column`,children:[(0,V.jsxs)(f,{color:`permission`,children:[`Press `,(0,V.jsx)(f,{bold:!0,children:`Enter`}),` to open the browser.`]}),(0,V.jsx)(f,{dimColor:!0,italic:!0,children:(0,V.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})]})]})]});if(D)return(0,V.jsxs)(u,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(f,{color:`text`,children:[`Connecting to `,(0,V.jsx)(f,{bold:!0,children:e.name}),`…`]}),(0,V.jsxs)(u,{children:[(0,V.jsx)(E,{}),(0,V.jsx)(f,{children:` Establishing connection to MCP server`})]}),(0,V.jsx)(f,{dimColor:!0,children:`This may take a few moments.`})]});let Ie=[];return e.client.type===`disabled`&&Ie.push({label:`Enable`,value:`toggle-enabled`}),e.client.type===`connected`&&t>0&&Ie.push({label:`View tools`,value:`tools`}),e.config.type===`claudeai-proxy`?e.client.type===`connected`?Ie.push({label:`Clear authentication`,value:`claudeai-clear-auth`}):e.client.type!==`disabled`&&Ie.push({label:`Authenticate`,value:`claudeai-auth`}):(be&&(Ie.push({label:`Re-authenticate`,value:`reauth`}),Ie.push({label:`Clear authentication`,value:`clear-auth`})),be||Ie.push({label:`Authenticate`,value:`auth`})),e.client.type!==`disabled`&&(e.client.type!==`needs-auth`&&Ie.push({label:`Reconnect`,value:`reconnectMcpServer`}),Ie.push({label:`Disable`,value:`toggle-enabled`})),Ie.length===0&&Ie.push({label:`Back`,value:`back`}),(0,V.jsxs)(u,{flexDirection:`column`,children:[(0,V.jsxs)(u,{flexDirection:`column`,paddingX:1,borderStyle:s?void 0:`round`,children:[(0,V.jsx)(u,{marginBottom:1,children:(0,V.jsxs)(f,{bold:!0,children:[we,` MCP Server`]})}),(0,V.jsxs)(u,{flexDirection:`column`,gap:0,children:[(0,V.jsxs)(u,{children:[(0,V.jsx)(f,{bold:!0,children:`Status: `}),e.client.type===`disabled`?(0,V.jsxs)(f,{children:[v(`inactive`,c)(a.radioOff),` disabled`]}):e.client.type===`connected`?(0,V.jsxs)(f,{children:[v(`success`,c)(a.tick),` connected`]}):e.client.type===`pending`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(f,{dimColor:!0,children:a.radioOff}),(0,V.jsx)(f,{children:` connecting…`})]}):e.client.type===`needs-auth`?(0,V.jsxs)(f,{children:[v(`warning`,c)(a.triangleUpOutline),` needs authentication`]}):(0,V.jsxs)(f,{children:[v(`error`,c)(a.cross),` failed`]})]}),e.transport!==`claudeai-proxy`&&(0,V.jsxs)(u,{children:[(0,V.jsx)(f,{bold:!0,children:`Auth: `}),be?(0,V.jsxs)(f,{children:[v(`success`,c)(a.tick),` authenticated`]}):(0,V.jsxs)(f,{children:[v(`error`,c)(a.cross),` not authenticated`]})]}),(0,V.jsxs)(u,{children:[(0,V.jsx)(f,{bold:!0,children:`URL: `}),(0,V.jsx)(f,{dimColor:!0,children:e.config.url})]}),(0,V.jsxs)(u,{children:[(0,V.jsx)(f,{bold:!0,children:`Config location: `}),(0,V.jsx)(f,{dimColor:!0,children:z(e.scope)})]}),e.client.type===`connected`&&(0,V.jsx)(Dn,{serverToolsCount:t,serverPromptsCount:De,serverResourcesCount:te.resources[e.name]?.length||0}),e.client.type===`connected`&&t>0&&(0,V.jsxs)(u,{children:[(0,V.jsx)(f,{bold:!0,children:`Tools: `}),(0,V.jsxs)(f,{dimColor:!0,children:[t,` tools`]})]})]}),S&&(0,V.jsx)(u,{marginTop:1,children:(0,V.jsxs)(f,{color:`error`,children:[`Error: `,S]})}),Ie.length>0&&(0,V.jsx)(u,{marginTop:1,children:(0,V.jsx)(ue,{options:Ie,onChange:async t=>{switch(t){case`tools`:n();break;case`auth`:case`reauth`:await Pe();break;case`clear-auth`:await Fe();break;case`claudeai-auth`:await ke();break;case`claudeai-clear-auth`:je();break;case`reconnectMcpServer`:O(!0);try{let t=await xe(e.name);e.config.type===`claudeai-proxy`&&Pt(`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`&&Pt(`tengu_claudeai_mcp_reconnect`,{success:!1}),i?.(jn(t,e.name))}finally{O(!1)}break;case`toggle-enabled`:await Ne();break;case`back`:r();break}},onCancel:r})})]}),(0,V.jsx)(u,{marginTop:1,children:(0,V.jsx)(f,{dimColor:!0,italic:!0,children:m.pending?(0,V.jsxs)(V.Fragment,{children:[`Press `,m.keyName,` again to exit`]}):(0,V.jsxs)(p,{children:[(0,V.jsx)(o,{shortcut:`↑↓`,action:`navigate`}),(0,V.jsx)(o,{shortcut:`Enter`,action:`select`}),(0,V.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}var B,V,Pn=e((()=>{i(),B=t(g(),1),Nt(),Rt(),yn(),he(),C(),Jt(),Je(),Se(),gn(),ce(),Le(),Ut(),Xt(),pt(),jt(),Vt(),P(),le(),Qe(),tt(),kn(),Mn(),V=T()}));function Fn({server:e,serverToolsCount:t,onViewTools:n,onCancel:r,onComplete:i,borderless:s=!1}){let[c]=l(),d=vn(),ee=nt(e=>e.mcp),m=_n(),h=hn(),[g,_]=(0,In.useState)(!1),y=In.useCallback(async()=>{let t=e.client.type!==`disabled`;try{await h(e.name),r()}catch(n){i(`Failed to ${t?`disable`:`enable`} MCP server '${e.name}': ${gt(n)}`)}},[e.client.type,e.name,h,r,i]),b=Bt(String(e.name)),x=fe(ee.commands,e.name).length,S=[];return e.client.type!==`disabled`&&t>0&&S.push({label:`View tools`,value:`tools`}),e.client.type!==`disabled`&&S.push({label:`Reconnect`,value:`reconnectMcpServer`}),S.push({label:e.client.type===`disabled`?`Enable`:`Disable`,value:`toggle-enabled`}),S.length===0&&S.push({label:`Back`,value:`back`}),g?(0,H.jsxs)(u,{flexDirection:`column`,gap:1,padding:1,children:[(0,H.jsxs)(f,{color:`text`,children:[`Reconnecting to `,(0,H.jsx)(f,{bold:!0,children:e.name})]}),(0,H.jsxs)(u,{children:[(0,H.jsx)(E,{}),(0,H.jsx)(f,{children:` Restarting MCP server process`})]}),(0,H.jsx)(f,{dimColor:!0,children:`This may take a few moments.`})]}):(0,H.jsxs)(u,{flexDirection:`column`,children:[(0,H.jsxs)(u,{flexDirection:`column`,paddingX:1,borderStyle:s?void 0:`round`,children:[(0,H.jsx)(u,{marginBottom:1,children:(0,H.jsxs)(f,{bold:!0,children:[b,` MCP Server`]})}),(0,H.jsxs)(u,{flexDirection:`column`,gap:0,children:[(0,H.jsxs)(u,{children:[(0,H.jsx)(f,{bold:!0,children:`Status: `}),e.client.type===`disabled`?(0,H.jsxs)(f,{children:[v(`inactive`,c)(a.radioOff),` disabled`]}):e.client.type===`connected`?(0,H.jsxs)(f,{children:[v(`success`,c)(a.tick),` connected`]}):e.client.type===`pending`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(f,{dimColor:!0,children:a.radioOff}),(0,H.jsx)(f,{children:` connecting…`})]}):(0,H.jsxs)(f,{children:[v(`error`,c)(a.cross),` failed`]})]}),(0,H.jsxs)(u,{children:[(0,H.jsx)(f,{bold:!0,children:`Command: `}),(0,H.jsx)(f,{dimColor:!0,children:e.config.command})]}),e.config.args&&e.config.args.length>0&&(0,H.jsxs)(u,{children:[(0,H.jsx)(f,{bold:!0,children:`Args: `}),(0,H.jsx)(f,{dimColor:!0,children:e.config.args.join(` `)})]}),(0,H.jsxs)(u,{children:[(0,H.jsx)(f,{bold:!0,children:`Config location: `}),(0,H.jsx)(f,{dimColor:!0,children:z(ae(e.name)?.scope??`dynamic`)})]}),e.client.type===`connected`&&(0,H.jsx)(Dn,{serverToolsCount:t,serverPromptsCount:x,serverResourcesCount:ee.resources[e.name]?.length||0}),e.client.type===`connected`&&t>0&&(0,H.jsxs)(u,{children:[(0,H.jsx)(f,{bold:!0,children:`Tools: `}),(0,H.jsxs)(f,{dimColor:!0,children:[t,` tools`]})]})]}),S.length>0&&(0,H.jsx)(u,{marginTop:1,children:(0,H.jsx)(ue,{options:S,onChange:async t=>{if(t===`tools`)n();else if(t===`reconnectMcpServer`){_(!0);try{let{message:t}=An(await m(e.name),e.name);i?.(t)}catch(t){i?.(jn(t,e.name))}finally{_(!1)}}else t===`toggle-enabled`?await y():t===`back`&&r()},onCancel:r})})]}),(0,H.jsx)(u,{marginTop:1,children:(0,H.jsx)(f,{dimColor:!0,italic:!0,children:d.pending?(0,H.jsxs)(H.Fragment,{children:[`Press `,d.keyName,` again to exit`]}):(0,H.jsxs)(p,{children:[(0,H.jsx)(o,{shortcut:`↑↓`,action:`navigate`}),(0,H.jsx)(o,{shortcut:`Enter`,action:`select`}),(0,H.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}var In,H,Ln=e((()=>{i(),In=t(g(),1),yn(),C(),M(),gn(),ce(),Le(),pt(),Vt(),P(),le(),Qe(),kn(),Mn(),H=T()}));function Rn({tool:e,server:t,onBack:n}){let[r,i]=zn.useState(``),a=bt(e.name,t.name),o=Et(e.userFacingName?e.userFacingName({}):a),s=e.isReadOnly?.({})??!1,c=e.isDestructive?.({})??!1,l=e.isOpenWorld?.({})??!1;return zn.useEffect(()=>{async function t(){try{let t=await e.description({},{isNonInteractiveSession:!1,toolPermissionContext:{mode:`default`,additionalWorkingDirectories:new Map,alwaysAllowRules:{},alwaysDenyRules:{},alwaysAskRules:{},isBypassPermissionsModeAvailable:!1},tools:[]});i(t)}catch{i(`Failed to load description`)}}t()},[e]),(0,U.jsx)(w,{title:(0,U.jsxs)(U.Fragment,{children:[o,s&&(0,U.jsx)(f,{color:`success`,children:` [read-only]`}),c&&(0,U.jsx)(f,{color:`error`,children:` [destructive]`}),l&&(0,U.jsx)(f,{dimColor:!0,children:` [open-world]`})]}),subtitle:t.name,onCancel:n,inputGuide:e=>e.pending?(0,U.jsxs)(f,{children:[`Press `,e.keyName,` again to exit`]}):(0,U.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`}),children:(0,U.jsxs)(u,{flexDirection:`column`,children:[(0,U.jsxs)(u,{children:[(0,U.jsx)(f,{bold:!0,children:`Tool name: `}),(0,U.jsx)(f,{dimColor:!0,children:a})]}),(0,U.jsxs)(u,{children:[(0,U.jsx)(f,{bold:!0,children:`Full name: `}),(0,U.jsx)(f,{dimColor:!0,children:e.name})]}),r&&(0,U.jsxs)(u,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(f,{bold:!0,children:`Description:`}),(0,U.jsx)(f,{wrap:`wrap`,children:r})]}),e.inputJSONSchema&&e.inputJSONSchema.properties&&Object.keys(e.inputJSONSchema.properties).length>0&&(0,U.jsxs)(u,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(f,{bold:!0,children:`Parameters:`}),(0,U.jsx)(u,{marginLeft:2,flexDirection:`column`,children:Object.entries(e.inputJSONSchema.properties).map(([t,n])=>{let r=(e.inputJSONSchema?.required)?.includes(t);return(0,U.jsxs)(f,{children:[`• `,t,r&&(0,U.jsx)(f,{dimColor:!0,children:` (required)`}),`:`,` `,(0,U.jsx)(f,{dimColor:!0,children:typeof n==`object`&&n&&`type`in n?String(n.type):`unknown`}),typeof n==`object`&&n&&`description`in n&&(0,U.jsxs)(f,{dimColor:!0,children:[` - `,String(n.description)]})]},t)})})]})]})})}var zn,U,Bn=e((()=>{zn=t(g(),1),C(),St(),P(),U=T()}));function Vn({server:e,onSelectTool:t,onBack:n}){let r=nt(e=>e.mcp.tools),i=Hn.useMemo(()=>e.client.type===`connected`?Fe(r,e.name):[],[e,r]),a=i.map((t,n)=>{let r=bt(t.name,e.name),i=Et(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)(w,{title:`Tools for ${e.name}`,subtitle:`${i.length} ${zt(i.length,`tool`)}`,onCancel:n,inputGuide:e=>e.pending?(0,Un.jsxs)(f,{children:[`Press `,e.keyName,` again to exit`]}):(0,Un.jsxs)(p,{children:[(0,Un.jsx)(o,{shortcut:`↑↓`,action:`navigate`}),(0,Un.jsx)(o,{shortcut:`Enter`,action:`select`}),(0,Un.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]}),children:i.length===0?(0,Un.jsx)(f,{dimColor:!0,children:`No tools available`}):(0,Un.jsx)(ue,{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(g(),1),C(),St(),ce(),Le(),Vt(),P(),le(),Un=T()}));function Gn({inputValue:e,setInputValue:t,cursorOffset:n,setCursorOffset:r,error:i,setError:a,result:s,setResult:c,setViewState:l,onAddComplete:d,cliMode:ee=!1}){let m=(0,Kn.useRef)(!1),[h,g]=(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 cn(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{g(!0),v(``);let{name:e,resolvedSource:t}=await ie(n,e=>{v(e)});ve(e,{source:t}),Re();let r=n.source;n.source===`github`&&(r=n.repo),Pt(`tengu_marketplace_added`,{source_type:r}),d&&await d(),v(``),g(!1),ee?c(`Successfully added marketplace: ${e}`):l({type:`browse-marketplace`,targetMarketplace:e})}catch(e){let t=ft(e);Mt(t),a(t.message),v(``),g(!1),c(ee?`Error: ${t.message}`:null)}};return(0,Kn.useEffect)(()=>{e&&!m.current&&!i&&!s&&(m.current=!0,y())},[]),(0,W.jsxs)(u,{flexDirection:`column`,children:[(0,W.jsxs)(u,{flexDirection:`column`,paddingX:1,borderStyle:`round`,children:[(0,W.jsx)(u,{marginBottom:1,children:(0,W.jsx)(f,{bold:!0,children:`Add Marketplace`})}),(0,W.jsxs)(u,{flexDirection:`column`,children:[(0,W.jsx)(f,{children:`Enter marketplace source:`}),(0,W.jsx)(f,{dimColor:!0,children:`Examples:`}),(0,W.jsx)(f,{dimColor:!0,children:` · owner/repo (GitHub)`}),(0,W.jsx)(f,{dimColor:!0,children:` · git@github.com:owner/repo.git (SSH)`}),(0,W.jsx)(f,{dimColor:!0,children:` · https://example.com/marketplace.json`}),(0,W.jsx)(f,{dimColor:!0,children:` · ./path/to/marketplace`}),(0,W.jsx)(u,{marginTop:1,children:(0,W.jsx)(Te,{value:e,onChange:t,onSubmit:y,columns:80,cursorOffset:n,onChangeCursorOffset:r,focus:!0,showCursor:!0})})]}),h&&(0,W.jsxs)(u,{marginTop:1,children:[(0,W.jsx)(E,{}),(0,W.jsx)(f,{children:_||`Adding marketplace to configuration…`})]}),i&&(0,W.jsx)(u,{marginTop:1,children:(0,W.jsx)(f,{color:`error`,children:i})}),s&&(0,W.jsx)(u,{marginTop:1,children:(0,W.jsx)(f,{children:s})})]}),(0,W.jsx)(u,{marginLeft:3,children:(0,W.jsx)(f,{dimColor:!0,italic:!0,children:(0,W.jsxs)(p,{children:[(0,W.jsx)(o,{shortcut:`Enter`,action:`add`}),(0,W.jsx)(L,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})})]})}var Kn,W,qn=e((()=>{g(),Kn=t(g(),1),Nt(),P(),C(),Qe(),tt(),pt(),jt(),rt(),ge(),un(),W=T()}));function Jn(e,t,r,i){let a={};for(let o of e){let e=r[o],s=t[o]??``;if(!(e?.sensitive===!0&&s===``&&i?.[o]!==void 0))if(e?.type===`number`){if(s.trim()===``)continue;let e=Number(s);a[o]=Number.isNaN(e)?s:e}else e?.type===`boolean`?a[o]=n(s):a[o]=s}return a}function Yn({title:e,subtitle:t,configSchema:n,initialValues:r,onSave:i,onCancel:o}){let l=Object.keys(n),d=(0,Xn.useCallback)(e=>{if(n[e]?.sensitive===!0)return``;let t=r?.[e];return t===void 0?``:String(t)},[n,r]),[p,m]=(0,Xn.useState)(0),[h,g]=(0,Xn.useState)({}),[v,y]=(0,Xn.useState)(()=>l[0]?d(l[0]):``),b=l[p],x=b?n[b]:null;if(ee(`confirm:no`,o,{context:`Settings`}),c({"confirm:nextField":(0,Xn.useCallback)(()=>{if(p<l.length-1&&b){g(e=>({...e,[b]:v})),m(e=>e+1);let e=l[p+1];y(e?d(e):``)}},[p,l,b,v,d]),"confirm:yes":(0,Xn.useCallback)(()=>{if(!b)return;let e={...h,[b]:v};if(p===l.length-1)i(Jn(l,e,n,r));else{g(e),m(e=>e+1);let t=l[p+1];y(t?d(t):``)}},[b,h,v,p,l,n,i,d,r])},{context:`Confirmation`}),_((e,t)=>{if(t.backspace||t.delete){y(e=>e.slice(0,-1));return}e&&!t.ctrl&&!t.meta&&!t.tab&&!t.return&&y(t=>t+e)}),!x||!b)return null;let S=x.sensitive===!0,C=x.required===!0,te=S?`*`.repeat(s(v)):v;return(0,Zn.jsxs)(w,{title:e,subtitle:t,onCancel:o,isCancelActive:!1,children:[(0,Zn.jsxs)(u,{flexDirection:`column`,children:[(0,Zn.jsxs)(f,{bold:!0,children:[x.title||b,C&&(0,Zn.jsx)(f,{color:`error`,children:` *`})]}),x.description&&(0,Zn.jsx)(f,{dimColor:!0,children:x.description}),(0,Zn.jsxs)(u,{marginTop:1,children:[(0,Zn.jsxs)(f,{children:[a.pointerSmall,` `]}),(0,Zn.jsx)(f,{children:te}),(0,Zn.jsx)(f,{children:`█`})]})]}),(0,Zn.jsxs)(u,{flexDirection:`column`,children:[(0,Zn.jsxs)(f,{dimColor:!0,children:[`Field `,p+1,` of `,l.length]}),p<l.length-1&&(0,Zn.jsx)(f,{dimColor:!0,children:`Tab: Next field · Enter: Save and continue`}),p===l.length-1&&(0,Zn.jsx)(f,{dimColor:!0,children:`Enter: Save configuration`})]})]})}var Xn,Zn,Qn=e((()=>{i(),Xn=t(g(),1),C(),Jt(),r(),Zn=T()}));async function $n(e){let{enabled:t,disabled:n}=await Ge();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=be(e);Object.keys(r).length>0&&n.push({key:`top-level`,title:`Configure ${e.name}`,subtitle:`Plugin options`,schema:r,load:()=>Ze(t),save:n=>xe(t,n,e.manifest.userConfig)});let i=et(e);for(let r of i)n.push({key:`channel:${r.server}`,title:`Configure ${r.displayName}`,subtitle:`Plugin: ${e.name}`,schema:r.configSchema,load:()=>Ce(t,r.server)??void 0,save:e=>Ke(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`,gt(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(g(),1),pt(),ze(),Ve(),De(),We(),Qn(),nr=T()}));function ir(){let e=je();return(0,ar.jsxs)(u,{marginBottom:1,children:[(0,ar.jsxs)(f,{color:`claude`,children:[a.warning,` `]}),(0,ar.jsxs)(f,{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(),g(),C(),ye(),ar=T()}));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)(u,{marginTop:1,children:(0,ur.jsx)(f,{dimColor:!0,italic:!0,children:(0,ur.jsxs)(p,{children:[e&&(0,ur.jsx)(L,{action:`plugin:install`,context:`Plugin`,fallback:`i`,description:`install`,bold:!0}),(0,ur.jsx)(L,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,ur.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,ur.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})}var ur,dr=e((()=>{g(),P(),C(),ur=T()}));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)(()=>{},[]),ee=(0,pr.useCallback)((t,n)=>{n(Math.max(0,Math.min(t,e-1)))},[e]),m=(0,pr.useCallback)((e,t)=>!1,[]),h=Math.max(1,Math.ceil(e/t));return{currentPage:Math.floor(a/t),totalPages:h,startIndex:o,endIndex:s,needsPagination:r,pageSize:t,getVisibleItems:c,toActualIndex:l,isOnCurrentPage:u,goToPage:d,nextPage:f,prevPage:p,handleSelectionChange:ee,handlePageNavigation:m,scrollPosition:{current:n+1,total:e,canScrollUp:a>0,canScrollDown:a+t<e}}}var pr,mr,hr=e((()=>{pr=t(g(),1),mr=5}));function gr({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:o,targetMarketplace:s,targetPlugin:l}){let[d,m]=(0,vr.useState)(`marketplace-list`),[h,g]=(0,vr.useState)(null),[_,v]=(0,vr.useState)(null),[y,b]=(0,vr.useState)([]),[x,S]=(0,vr.useState)([]),[C,te]=(0,vr.useState)(!0),[w,T]=(0,vr.useState)(null),[E,D]=(0,vr.useState)(0),[k,A]=(0,vr.useState)(new Set),[re,j]=(0,vr.useState)(new Set),ie=fr({totalItems:x.length,selectedIndex:E}),[M,N]=(0,vr.useState)(0),[ae,P]=(0,vr.useState)(!1),[se,ce]=(0,vr.useState)(null),[le,F]=(0,vr.useState)(null);ee(`confirm:no`,_r.useCallback(()=>{d===`plugin-list`?s?i({type:`manage-marketplaces`,targetMarketplace:s}):y.length===1?i({type:`menu`}):(m(`marketplace-list`),g(null),A(new Set)):d===`plugin-details`?(m(`plugin-list`),v(null)):i({type:`menu`})},[d,s,i,y.length]),{context:`Confirmation`}),(0,vr.useEffect)(()=>{async function e(){try{let e=await oe(),{marketplaces:n,failures:r}=await Xe(e),i=[];for(let{name:e,config:t,data:r}of n)if(r){let n=Tt(r.plugins,t=>O(ne(t.name,e)));i.push({name:e,totalPlugins:r.plugins.length,installedCount:n,source:Ye(t.source)})}i.sort((e,t)=>e.name===`claude-plugin-directory`?-1:+(t.name===`claude-plugin-directory`)),b(i);let a=Be(r,Tt(n,e=>e.data!==null));if(a)if(a.type===`warning`)F(a.message+`. Showing available marketplaces.`);else throw Error(a.message);if(i.length===1&&!s&&!l){let e=i[0];e&&(g(e.name),m(`plugin-list`))}if(l){let n=null,r=null;for(let[t]of Object.entries(e)){let e=await I(t);if(e){let i=e.plugins.find(e=>e.name===l);if(i){let e=ne(i.name,t);n={entry:i,marketplaceName:t,pluginId:e,isInstalled:Ie(e)},r=t;break}}}if(n&&r){let e=n.pluginId;Ie(e)?t(`Plugin '${e}' is already installed globally. Use '/plugin' to manage existing plugins.`):(g(r),v(n),m(`plugin-details`))}else t(`Plugin "${l}" not found in any marketplace`)}else s&&(i.some(e=>e.name===s)?(g(s),m(`plugin-list`)):t(`Marketplace "${s}" not found`))}catch(e){t(e instanceof Error?e.message:`Failed to load marketplaces`)}finally{te(!1)}}e()},[t,s,l]),(0,vr.useEffect)(()=>{if(!h)return;let e=!1;async function n(n){te(!0);try{let t=await I(n);if(e)return;if(!t)throw Error(`Failed to load marketplace: ${n}`);let r=[];for(let e of t.plugins){let t=ne(e.name,n);Ue(t)||r.push({entry:e,marketplaceName:n,pluginId:t,isInstalled:Ie(t)})}try{let t=await pn();if(e)return;T(t),t?r.sort((e,n)=>{let r=t.get(e.pluginId)??0,i=t.get(n.pluginId)??0;return r===i?e.entry.name.localeCompare(n.entry.name):i-r}):r.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}catch(t){if(e)return;ht(`Failed to fetch install counts: ${gt(t)}`),r.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}S(r),D(0),A(new Set)}catch(n){if(e)return;t(n instanceof Error?n.message:`Failed to load plugins`)}finally{te(!1)}}return n(h),()=>{e=!0}},[h,t]);let ue=async()=>{if(k.size===0)return;let e=x.filter(e=>k.has(e.pluginId));j(new Set(e.map(e=>e.pluginId)));let n=0,a=0,s=[];for(let t of e){let e=await lt({pluginId:t.pluginId,entry:t.entry,marketplaceName:t.marketplaceName,scope:`user`});e.success?n++:(a++,s.push({name:t.entry.name,reason:e.error}))}j(new Set),A(new Set),Re(),a===0?r(`✓ Installed ${n} ${zt(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${$e(s,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${$e(s,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&o&&await o(),i({type:`menu`})},de=async(e,t=`user`)=>{P(!0),ce(null);let n=await lt({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await $n(e.pluginId);if(t){P(!1),m({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),o&&await o(),i({type:`menu`})}else P(!1),ce(n.error)};(0,vr.useEffect)(()=>{e&&r(e)},[e,r]),c({"select:previous":()=>{E>0&&D(E-1)},"select:next":()=>{E<y.length-1&&D(E+1)},"select:accept":()=>{let e=y[E];e&&(g(e.name),m(`plugin-list`))}},{context:`Select`,isActive:d===`marketplace-list`}),c({"select:previous":()=>{E>0&&ie.handleSelectionChange(E-1,D)},"select:next":()=>{E<x.length-1&&ie.handleSelectionChange(E+1,D)},"select:accept":()=>{if(E===x.length&&k.size>0)ue();else if(E<x.length){let e=x[E];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(v(e),m(`plugin-details`),N(0),ce(null)))}}},{context:`Select`,isActive:d===`plugin-list`}),c({"plugin:toggle":()=>{if(E<x.length){let e=x[E];if(e&&!e.isInstalled){let t=new Set(k);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),A(t)}}},"plugin:install":()=>{k.size>0&&ue()}},{context:`Plugin`,isActive:d===`plugin-list`});let fe=_r.useMemo(()=>{if(!_)return[];let e=_.entry.homepage;return cr(e,sr(_))},[_]);if(c({"select:previous":()=>{M>0&&N(M-1)},"select:next":()=>{M<fe.length-1&&N(M+1)},"select:accept":()=>{if(!_)return;let e=fe[M]?.action,t=_.entry.homepage,n=sr(_);e===`install-user`?de(_,`user`):e===`install-project`?de(_,`project`):e===`install-local`?de(_,`local`):e===`homepage`&&t?Yt(t):e===`github`&&n?Yt(`https://github.com/${n}`):e===`back`&&(m(`plugin-list`),v(null))}},{context:`Select`,isActive:d===`plugin-details`&&!!_}),typeof d==`object`&&d.type===`plugin-options`){let{plugin:e,pluginId:t}=d;function n(e){r(e),o&&o(),i({type:`menu`})}return(0,G.jsx)(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(C)return(0,G.jsx)(f,{children:`Loading…`});if(e)return(0,G.jsx)(f,{color:`error`,children:e});if(d===`marketplace-list`)return y.length===0?(0,G.jsxs)(u,{flexDirection:`column`,children:[(0,G.jsx)(u,{marginBottom:1,children:(0,G.jsx)(f,{bold:!0,children:`Select marketplace`})}),(0,G.jsx)(f,{children:`No marketplaces configured.`}),(0,G.jsxs)(f,{dimColor:!0,children:[`Add a marketplace first using `,`'Add marketplace'`,`.`]}),(0,G.jsx)(u,{marginTop:1,paddingLeft:1,children:(0,G.jsx)(f,{dimColor:!0,children:(0,G.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})})})]}):(0,G.jsxs)(u,{flexDirection:`column`,children:[(0,G.jsx)(u,{marginBottom:1,children:(0,G.jsx)(f,{bold:!0,children:`Select marketplace`})}),le&&(0,G.jsx)(u,{marginBottom:1,flexDirection:`column`,children:(0,G.jsxs)(f,{color:`warning`,children:[a.warning,` `,le]})}),y.map((e,t)=>(0,G.jsxs)(u,{flexDirection:`column`,marginBottom:+(t<y.length-1),children:[(0,G.jsx)(u,{children:(0,G.jsxs)(f,{color:E===t?`suggestion`:void 0,children:[E===t?a.pointer:` `,` `,e.name]})}),(0,G.jsx)(u,{marginLeft:2,children:(0,G.jsxs)(f,{dimColor:!0,children:[e.totalPlugins,` `,zt(e.totalPlugins,`plugin`),` available`,e.installedCount>0&&` · ${e.installedCount} already installed`,e.source&&` · ${e.source}`]})})]},e.name)),(0,G.jsx)(u,{marginTop:1,children:(0,G.jsx)(f,{dimColor:!0,italic:!0,children:(0,G.jsxs)(p,{children:[(0,G.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,G.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]});if(d===`plugin-details`&&_){let e=_.entry.homepage,t=cr(e,sr(_));return(0,G.jsxs)(u,{flexDirection:`column`,children:[(0,G.jsx)(u,{marginBottom:1,children:(0,G.jsx)(f,{bold:!0,children:`Plugin Details`})}),(0,G.jsxs)(u,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(f,{bold:!0,children:_.entry.name}),_.entry.version&&(0,G.jsxs)(f,{dimColor:!0,children:[`Version: `,_.entry.version]}),_.entry.description&&(0,G.jsx)(u,{marginTop:1,children:(0,G.jsx)(f,{children:_.entry.description})}),_.entry.author&&(0,G.jsx)(u,{marginTop:1,children:(0,G.jsxs)(f,{dimColor:!0,children:[`By:`,` `,typeof _.entry.author==`string`?_.entry.author:_.entry.author.name]})})]}),(0,G.jsxs)(u,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(f,{bold:!0,children:`Will install:`}),_.entry.commands&&(0,G.jsxs)(f,{dimColor:!0,children:[`· Commands:`,` `,Array.isArray(_.entry.commands)?_.entry.commands.join(`, `):Object.keys(_.entry.commands).join(`, `)]}),_.entry.agents&&(0,G.jsxs)(f,{dimColor:!0,children:[`· Agents:`,` `,Array.isArray(_.entry.agents)?_.entry.agents.join(`, `):Object.keys(_.entry.agents).join(`, `)]}),_.entry.hooks&&(0,G.jsxs)(f,{dimColor:!0,children:[`· Hooks: `,Object.keys(_.entry.hooks).join(`, `)]}),_.entry.mcpServers&&(0,G.jsxs)(f,{dimColor:!0,children:[`· MCP Servers:`,` `,Array.isArray(_.entry.mcpServers)?_.entry.mcpServers.join(`, `):typeof _.entry.mcpServers==`object`?Object.keys(_.entry.mcpServers).join(`, `):`configured`]}),!_.entry.commands&&!_.entry.agents&&!_.entry.hooks&&!_.entry.mcpServers&&(0,G.jsx)(G.Fragment,{children:typeof _.entry.source==`object`&&`source`in _.entry.source&&(_.entry.source.source===`github`||_.entry.source.source===`url`||_.entry.source.source===`npm`||_.entry.source.source===`pip`)?(0,G.jsx)(f,{dimColor:!0,children:`· Component summary not available for remote plugin`}):(0,G.jsx)(f,{dimColor:!0,children:`· Components will be discovered at installation`})})]}),(0,G.jsx)(ir,{}),se&&(0,G.jsx)(u,{marginBottom:1,children:(0,G.jsxs)(f,{color:`error`,children:[`Error: `,se]})}),(0,G.jsx)(u,{flexDirection:`column`,children:t.map((e,t)=>(0,G.jsxs)(u,{children:[M===t&&(0,G.jsx)(f,{children:`> `}),M!==t&&(0,G.jsx)(f,{children:` `}),(0,G.jsx)(f,{bold:M===t,children:ae&&e.action===`install`?`Installing…`:e.label})]},e.action))}),(0,G.jsx)(u,{marginTop:1,paddingLeft:1,children:(0,G.jsx)(f,{dimColor:!0,children:(0,G.jsxs)(p,{children:[(0,G.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,G.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(x.length===0)return(0,G.jsxs)(u,{flexDirection:`column`,children:[(0,G.jsx)(u,{marginBottom:1,children:(0,G.jsx)(f,{bold:!0,children:`Install plugins`})}),(0,G.jsx)(f,{dimColor:!0,children:`No new plugins available to install.`}),(0,G.jsx)(f,{dimColor:!0,children:`All plugins from this marketplace are already installed.`}),(0,G.jsx)(u,{marginLeft:3,children:(0,G.jsx)(f,{dimColor:!0,italic:!0,children:(0,G.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})})})]});let pe=ie.getVisibleItems(x);return(0,G.jsxs)(u,{flexDirection:`column`,children:[(0,G.jsx)(u,{marginBottom:1,children:(0,G.jsx)(f,{bold:!0,children:`Install Plugins`})}),ie.scrollPosition.canScrollUp&&(0,G.jsx)(u,{children:(0,G.jsxs)(f,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),pe.map((t,n)=>{let r=ie.toActualIndex(n),i=E===r,o=k.has(t.pluginId),s=re.has(t.pluginId);return(0,G.jsxs)(u,{flexDirection:`column`,marginBottom:n===pe.length-1&&!e?0:1,children:[(0,G.jsxs)(u,{children:[(0,G.jsxs)(f,{color:i?`suggestion`:void 0,children:[i?a.pointer:` `,` `]}),(0,G.jsxs)(f,{color:t.isInstalled?`success`:void 0,children:[t.isInstalled?a.tick:s?a.ellipsis:o?a.radioOn:a.radioOff,` `,t.entry.name,t.entry.category&&(0,G.jsxs)(f,{dimColor:!0,children:[` [`,t.entry.category,`]`]}),t.entry.tags?.includes(`community-managed`)&&(0,G.jsx)(f,{dimColor:!0,children:` [Community Managed]`}),t.isInstalled&&(0,G.jsx)(f,{dimColor:!0,children:` (installed)`}),w&&h===`claude-plugins-official`&&(0,G.jsxs)(f,{dimColor:!0,children:[` · `,fn(w.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,G.jsxs)(u,{marginLeft:4,children:[(0,G.jsx)(f,{dimColor:!0,children:Ft(t.entry.description,60)}),t.entry.version&&(0,G.jsxs)(f,{dimColor:!0,children:[` · v`,t.entry.version]})]})]},t.pluginId)}),ie.scrollPosition.canScrollDown&&(0,G.jsx)(u,{children:(0,G.jsxs)(f,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,G.jsx)(u,{marginTop:1,children:(0,G.jsxs)(f,{color:`error`,children:[a.cross,` `,e]})}),(0,G.jsx)(lr,{hasSelection:k.size>0})]})}var _r,vr,G,yr=e((()=>{i(),_r=t(g(),1),vr=t(g(),1),P(),C(),Jt(),yt(),Xt(),mt(),pt(),rt(),ln(),j(),ye(),ge(),ke(),at(),R(),Vt(),It(),rr(),or(),dr(),hr(),G=T()}));function br({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:o,onSearchModeChange:s,targetPlugin:l}){let[d,h]=(0,K.useState)(`plugin-list`),[g,v]=(0,K.useState)(null),[b,S]=(0,K.useState)([]),[C,te]=(0,K.useState)(!0),[w,T]=(0,K.useState)(null),[E,D]=(0,K.useState)(!1),O=(0,K.useCallback)(e=>{D(e),s?.(e)},[s]),{query:k,setQuery:A,cursorOffset:re}=xn({isActive:d===`plugin-list`&&E&&!C,onExit:()=>{O(!1)}}),j=m(),{columns:ie}=x(),M=(0,K.useMemo)(()=>{if(!k)return b;let e=k.toLowerCase();return b.filter(t=>t.entry.name.toLowerCase().includes(e)||t.entry.description?.toLowerCase().includes(e)||t.marketplaceName.toLowerCase().includes(e))},[b,k]),[N,ae]=(0,K.useState)(0),[P,se]=(0,K.useState)(new Set),[ce,le]=(0,K.useState)(new Set),F=fr({totalItems:M.length,selectedIndex:N});(0,K.useEffect)(()=>{ae(0)},[k]);let[ue,de]=(0,K.useState)(0),[fe,pe]=(0,K.useState)(!1),[I,me]=(0,K.useState)(null),[he,ge]=(0,K.useState)(null),[_e,ve]=(0,K.useState)(null);(0,K.useEffect)(()=>{async function e(){try{let e=await oe(),{marketplaces:n,failures:r}=await Xe(e),i=[];for(let{name:e,data:t}of n)if(t)for(let n of t.plugins){let t=ne(n.name,e);i.push({entry:n,marketplaceName:e,pluginId:t,isInstalled:Ie(t)})}let a=i.filter(e=>!e.isInstalled&&!Ue(e.pluginId));try{let e=await pn();T(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){ht(`Failed to fetch install counts: ${gt(e)}`),a.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}S(a);let o=Object.keys(e).length;if(a.length===0){let e=await we({configuredMarketplaceCount:o,failedMarketplaceCount:r.length});ve(e)}let s=Be(r,Tt(n,e=>e.data!==null));if(s)if(s.type===`warning`)ge(s.message+`. Showing available plugins.`);else throw Error(s.message);if(l){let e=i.find(e=>e.entry.name===l);e?e.isInstalled?t(`Plugin '${e.pluginId}' is already installed. Use '/plugin' to manage existing plugins.`):(v(e),h(`plugin-details`)):t(`Plugin "${l}" not found in any marketplace`)}}catch(e){t(e instanceof Error?e.message:`Failed to load plugins`)}finally{te(!1)}}e()},[t,l]);let ye=async()=>{if(P.size===0)return;let e=b.filter(e=>P.has(e.pluginId));le(new Set(e.map(e=>e.pluginId)));let n=0,a=0,s=[];for(let t of e){let e=await lt({pluginId:t.pluginId,entry:t.entry,marketplaceName:t.marketplaceName,scope:`user`});e.success?n++:(a++,s.push({name:t.entry.name,reason:e.error}))}le(new Set),se(new Set),Re(),a===0?r(`✓ Installed ${n} ${zt(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${$e(s,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${$e(s,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&o&&await o(),i({type:`menu`})},R=async(e,t=`user`)=>{pe(!0),me(null);let n=await lt({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await $n(e.pluginId);if(t){pe(!1),h({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),o&&await o(),i({type:`menu`})}else pe(!1),me(n.error)};(0,K.useEffect)(()=>{e&&r(e)},[e,r]),ee(`confirm:no`,()=>{h(`plugin-list`),v(null)},{context:`Confirmation`,isActive:d===`plugin-details`}),ee(`confirm:no`,()=>{i({type:`menu`})},{context:`Confirmation`,isActive:d===`plugin-list`&&!E}),_((e,t)=>{let n=!t.ctrl&&!t.meta;E||(e===`/`&&n?(O(!0),A(``)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==`i`&&(O(!0),A(e)))},{isActive:d===`plugin-list`&&!C}),c({"select:previous":()=>{N===0?O(!0):F.handleSelectionChange(N-1,ae)},"select:next":()=>{N<M.length-1&&F.handleSelectionChange(N+1,ae)},"select:accept":()=>{if(N===M.length&&P.size>0)ye();else if(N<M.length){let e=M[N];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(v(e),h(`plugin-details`),de(0),me(null)))}}},{context:`Select`,isActive:d===`plugin-list`&&!E}),c({"plugin:toggle":()=>{if(N<M.length){let e=M[N];if(e&&!e.isInstalled){let t=new Set(P);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),se(t)}}},"plugin:install":()=>{P.size>0&&ye()}},{context:`Plugin`,isActive:d===`plugin-list`&&!E});let be=Cr.useMemo(()=>{if(!g)return[];let e=g.entry.homepage;return cr(e,sr(g))},[g]);if(c({"select:previous":()=>{ue>0&&de(ue-1)},"select:next":()=>{ue<be.length-1&&de(ue+1)},"select:accept":()=>{if(!g)return;let e=be[ue]?.action,t=g.entry.homepage,n=sr(g);e===`install-user`?R(g,`user`):e===`install-project`?R(g,`project`):e===`install-local`?R(g,`local`):e===`homepage`&&t?Yt(t):e===`github`&&n?Yt(`https://github.com/${n}`):e===`back`&&(h(`plugin-list`),v(null))}},{context:`Select`,isActive:d===`plugin-details`&&!!g}),typeof d==`object`&&d.type===`plugin-options`){let{plugin:e,pluginId:t}=d;function n(e){r(e),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(C)return(0,q.jsx)(f,{children:`Loading…`});if(e)return(0,q.jsx)(f,{color:`error`,children:e});if(d===`plugin-details`&&g){let e=g.entry.homepage,t=cr(e,sr(g));return(0,q.jsxs)(u,{flexDirection:`column`,children:[(0,q.jsx)(u,{marginBottom:1,children:(0,q.jsx)(f,{bold:!0,children:`Plugin details`})}),(0,q.jsxs)(u,{flexDirection:`column`,marginBottom:1,children:[(0,q.jsx)(f,{bold:!0,children:g.entry.name}),(0,q.jsxs)(f,{dimColor:!0,children:[`from `,g.marketplaceName]}),g.entry.version&&(0,q.jsxs)(f,{dimColor:!0,children:[`Version: `,g.entry.version]}),g.entry.description&&(0,q.jsx)(u,{marginTop:1,children:(0,q.jsx)(f,{children:g.entry.description})}),g.entry.author&&(0,q.jsx)(u,{marginTop:1,children:(0,q.jsxs)(f,{dimColor:!0,children:[`By:`,` `,typeof g.entry.author==`string`?g.entry.author:g.entry.author.name]})})]}),(0,q.jsx)(ir,{}),I&&(0,q.jsx)(u,{marginBottom:1,children:(0,q.jsxs)(f,{color:`error`,children:[`Error: `,I]})}),(0,q.jsx)(u,{flexDirection:`column`,children:t.map((e,t)=>(0,q.jsxs)(u,{children:[ue===t&&(0,q.jsx)(f,{children:`> `}),ue!==t&&(0,q.jsx)(f,{children:` `}),(0,q.jsx)(f,{bold:ue===t,children:fe&&e.action.startsWith(`install-`)?`Installing…`:e.label})]},e.action))}),(0,q.jsx)(u,{marginTop:1,children:(0,q.jsx)(f,{dimColor:!0,children:(0,q.jsxs)(p,{children:[(0,q.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,q.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(b.length===0)return(0,q.jsxs)(u,{flexDirection:`column`,children:[(0,q.jsx)(u,{marginBottom:1,children:(0,q.jsx)(f,{bold:!0,children:`Discover plugins`})}),(0,q.jsx)(Sr,{reason:_e}),(0,q.jsx)(u,{marginTop:1,children:(0,q.jsx)(f,{dimColor:!0,italic:!0,children:`Esc to go back`})})]});let z=F.getVisibleItems(M);return(0,q.jsxs)(u,{flexDirection:`column`,children:[(0,q.jsxs)(u,{children:[(0,q.jsx)(f,{bold:!0,children:`Discover plugins`}),F.needsPagination&&(0,q.jsxs)(f,{dimColor:!0,children:[` `,`(`,F.scrollPosition.current,`/`,F.scrollPosition.total,`)`]})]}),(0,q.jsx)(u,{marginBottom:1,children:(0,q.jsx)(y,{query:k,isFocused:E,isTerminalFocused:j,width:ie-4,cursorOffset:re})}),he&&(0,q.jsx)(u,{marginBottom:1,children:(0,q.jsxs)(f,{color:`warning`,children:[a.warning,` `,he]})}),M.length===0&&k&&(0,q.jsx)(u,{marginBottom:1,children:(0,q.jsxs)(f,{dimColor:!0,children:[`No plugins match "`,k,`"`]})}),F.scrollPosition.canScrollUp&&(0,q.jsx)(u,{children:(0,q.jsxs)(f,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),z.map((t,n)=>{let r=F.toActualIndex(n),i=N===r,o=P.has(t.pluginId),s=ce.has(t.pluginId);return(0,q.jsxs)(u,{flexDirection:`column`,marginBottom:n===z.length-1&&!e?0:1,children:[(0,q.jsxs)(u,{children:[(0,q.jsxs)(f,{color:i&&!E?`suggestion`:void 0,children:[i&&!E?a.pointer:` `,` `]}),(0,q.jsxs)(f,{children:[s?a.ellipsis:o?a.radioOn:a.radioOff,` `,t.entry.name,(0,q.jsxs)(f,{dimColor:!0,children:[` · `,t.marketplaceName]}),t.entry.tags?.includes(`community-managed`)&&(0,q.jsx)(f,{dimColor:!0,children:` [Community Managed]`}),w&&t.marketplaceName===`claude-plugins-official`&&(0,q.jsxs)(f,{dimColor:!0,children:[` · `,fn(w.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,q.jsx)(u,{marginLeft:4,children:(0,q.jsx)(f,{dimColor:!0,children:Ft(t.entry.description,60)})})]},`${F.startIndex}-${t.pluginId}`)}),F.scrollPosition.canScrollDown&&(0,q.jsx)(u,{children:(0,q.jsxs)(f,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,q.jsx)(u,{marginTop:1,children:(0,q.jsxs)(f,{color:`error`,children:[a.cross,` `,e]})}),(0,q.jsx)(xr,{hasSelection:P.size>0,canToggle:N<M.length&&!M[N]?.isInstalled})]})}function xr({hasSelection:e,canToggle:t}){return(0,q.jsx)(u,{marginTop:1,children:(0,q.jsx)(f,{dimColor:!0,italic:!0,children:(0,q.jsxs)(p,{children:[e&&(0,q.jsx)(L,{action:`plugin:install`,context:`Plugin`,fallback:`i`,description:`install`,bold:!0}),(0,q.jsx)(f,{children:`type to search`}),t&&(0,q.jsx)(L,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,q.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,q.jsx)(L,{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)(f,{dimColor:!0,children:`Git is required to install marketplaces.`}),(0,q.jsx)(f,{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)(f,{dimColor:!0,children:`Your organization policy does not allow any external marketplaces.`}),(0,q.jsx)(f,{dimColor:!0,children:`Contact your administrator.`})]});case`policy-restricts-sources`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(f,{dimColor:!0,children:`Your organization restricts which marketplaces can be added.`}),(0,q.jsx)(f,{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)(f,{dimColor:!0,children:`Failed to load marketplace data.`}),(0,q.jsx)(f,{dimColor:!0,children:`Check your network connection.`})]});case`all-plugins-installed`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(f,{dimColor:!0,children:`All available plugins are already installed.`}),(0,q.jsx)(f,{dimColor:!0,children:`Check for new plugins later or add more marketplaces.`})]});default:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(f,{dimColor:!0,children:`No plugins available.`}),(0,q.jsx)(f,{dimColor:!0,children:`Add a marketplace first using the Marketplaces tab.`})]})}}var Cr,K,q,wr=e((()=>{i(),Cr=t(g(),1),K=t(g(),1),P(),bn(),C(),Sn(),he(),Jt(),yt(),Xt(),mt(),pt(),rt(),ln(),j(),ye(),ge(),ke(),at(),R(),Vt(),It(),rr(),or(),dr(),hr(),q=T()}));function Tr({setViewState:e,error:t,setError:n,setResult:r,exitState:i,onManageComplete:o,targetMarketplace:s,action:l}){let[d,m]=(0,Dr.useState)([]),[h,g]=(0,Dr.useState)(!0),[v,y]=(0,Dr.useState)(0),[b,x]=(0,Dr.useState)(!1),[S,C]=(0,Dr.useState)(null),[te,w]=(0,Dr.useState)(null),[T,E]=(0,Dr.useState)(null),[D,O]=(0,Dr.useState)(`list`),[k,A]=(0,Dr.useState)(null),[re,j]=(0,Dr.useState)(0),ie=(0,Dr.useRef)(!1);(0,Dr.useEffect)(()=>{async function e(){try{let e=await oe(),{enabled:r,disabled:i}=await Ge(),a=[...r,...i],{marketplaces:o,failures:c}=await Xe(e),u=[];for(let{name:e,config:t,data:n}of o){let r=a.filter(t=>t.source.endsWith(`@${e}`));u.push({name:e,source:Ye(t.source),lastUpdated:t.lastUpdated,pluginCount:n?.plugins.length,installedPlugins:r,pendingUpdate:!1,pendingRemove:!1,autoUpdate:vt(e,t)})}u.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),m(u);let d=Be(c,Tt(o,e=>e.data!==null));if(d)if(d.type===`warning`)C(d.message);else throw Error(d.message);if(s&&!ie.current&&!t){ie.current=!0;let e=u.findIndex(e=>e.name===s);if(e>=0){let t=u[e];if(l){y(e+1);let t=[...u];l===`update`?t[e].pendingUpdate=!0:l===`remove`&&(t[e].pendingRemove=!0),m(t),setTimeout(P,100,t)}else t&&(y(e+1),A(t),O(`details`))}else n&&n(`Marketplace not found: ${s}`)}}catch(e){n&&n(e instanceof Error?e.message:`Failed to load marketplaces`),C(e instanceof Error?e.message:`Failed to load marketplaces`)}finally{g(!1)}}e()},[s,l,t]);let M=()=>d.some(e=>e.pendingUpdate||e.pendingRemove),ae=()=>({updateCount:Tt(d,e=>e.pendingUpdate),removeCount:Tt(d,e=>e.pendingRemove)}),P=async t=>{let i=t||d,s=D===`details`;x(!0),C(null),w(null),E(null);try{let t=xt(`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=ne(t.name,e.name);n[r]=!1}Dt(`userSettings`,{enabledPlugins:n})}await qe(e.name),c++,Pt(`tengu_marketplace_removed`,{marketplace_name:e.name,plugins_uninstalled:e.installedPlugins?.length||0});continue}e.pendingUpdate&&(await N(e.name,e=>{E(e)}),n++,l.add(e.name.toLowerCase()),Pt(`tengu_marketplace_updated`,{marketplace_name:e.name}))}let u=0;l.size>0&&(u=(await Cn(l)).length),Re(),o&&await o();let d=await oe(),{enabled:f,disabled:p}=await Ge(),ee=[...f,...p],{marketplaces:h}=await Xe(d),g=[];for(let{name:e,config:t,data:n}of h){let r=ee.filter(t=>t.source.endsWith(`@${e}`));g.push({name:e,source:Ye(t.source),lastUpdated:t.lastUpdated,pluginCount:n?.plugins.length,installedPlugins:r,pendingUpdate:!1,pendingRemove:!1,autoUpdate:vt(e,t)})}if(g.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),m(g),s&&k){let e=g.find(e=>e.name===k.name);e&&A(e)}let _=[];if(n>0){let e=u>0?` (${u} ${zt(u,`plugin`)} bumped)`:``;_.push(`Updated ${n} ${zt(n,`marketplace`)}${e}`)}if(c>0&&_.push(`Removed ${c} ${zt(c,`marketplace`)}`),_.length>0){let t=`${a.tick} ${_.join(`, `)}`;s?w(t):(r(t),setTimeout(e,2e3,{type:`menu`}))}else s||e({type:`menu`})}catch(e){let t=gt(e);C(t),n&&n(t)}finally{x(!1),E(null)}},se=async()=>{if(!k)return;let e=d.map(e=>e.name===k.name?{...e,pendingRemove:!0}:e);m(e),await P(e)},ce=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 kt()||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 _e(e.name,t),m(n=>n.map(n=>n.name===e.name?{...n,autoUpdate:t}:n)),A(e=>e&&{...e,autoUpdate:t})}catch(e){C(e instanceof Error?e.message:`Failed to update setting`)}};if(ee(`confirm:no`,()=>{O(`list`),j(0)},{context:`Confirmation`,isActive:!b&&(D===`details`||D===`confirm-remove`)}),ee(`confirm:no`,()=>{m(e=>e.map(e=>({...e,pendingUpdate:!1,pendingRemove:!1}))),y(0)},{context:`Confirmation`,isActive:!b&&D===`list`&&M()}),ee(`confirm:no`,()=>{e({type:`menu`})},{context:`Confirmation`,isActive:!b&&D===`list`&&!M()}),c({"select:previous":()=>y(e=>Math.max(0,e-1)),"select:next":()=>{let e=d.length+1;y(t=>Math.min(e-1,t+1))},"select:accept":()=>{let t=v-1;if(v===0)e({type:`add-marketplace`});else if(M())P();else{let e=d[t];e&&(A(e),O(`details`),j(0))}}},{context:`Select`,isActive:!b&&D===`list`}),_(e=>{let t=v-1;if((e===`u`||e===`U`)&&t>=0)m(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=d[t];e&&(A(e),O(`confirm-remove`))}},{isActive:!b&&D===`list`}),c({"select:previous":()=>j(e=>Math.max(0,e-1)),"select:next":()=>{let e=ce(k);j(t=>Math.min(e.length-1,t+1))},"select:accept":()=>{if(!k)return;let t=ce(k)[re];if(t?.value===`browse`)e({type:`browse-marketplace`,targetMarketplace:k.name});else if(t?.value===`update`){let e=d.map(e=>e.name===k.name?{...e,pendingUpdate:!0}:e);m(e),P(e)}else t?.value===`toggle-auto-update`?le(k):t?.value===`remove`&&O(`confirm-remove`)}},{context:`Select`,isActive:!b&&D===`details`}),_(e=>{e===`y`||e===`Y`?se():(e===`n`||e===`N`)&&(O(`list`),A(null))},{isActive:!b&&D===`confirm-remove`}),h)return(0,J.jsx)(f,{children:`Loading marketplaces…`});if(d.length===0)return(0,J.jsxs)(u,{flexDirection:`column`,children:[(0,J.jsx)(u,{marginBottom:1,children:(0,J.jsx)(f,{bold:!0,children:`Manage marketplaces`})}),(0,J.jsxs)(u,{flexDirection:`row`,gap:1,children:[(0,J.jsxs)(f,{color:`suggestion`,children:[a.pointer,` +`]}),(0,J.jsx)(f,{bold:!0,color:`suggestion`,children:`Add Marketplace`})]}),(0,J.jsx)(u,{marginLeft:3,children:(0,J.jsx)(f,{dimColor:!0,italic:!0,children:i.pending?(0,J.jsxs)(J.Fragment,{children:[`Press `,i.keyName,` again to go back`]}):(0,J.jsxs)(p,{children:[(0,J.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,J.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]});if(D===`confirm-remove`&&k){let e=k.installedPlugins?.length||0;return(0,J.jsxs)(u,{flexDirection:`column`,children:[(0,J.jsxs)(f,{bold:!0,color:`warning`,children:[`Remove marketplace `,(0,J.jsx)(f,{italic:!0,children:k.name}),`?`]}),(0,J.jsxs)(u,{flexDirection:`column`,children:[e>0&&(0,J.jsx)(u,{marginTop:1,children:(0,J.jsxs)(f,{color:`warning`,children:[`This will also uninstall `,e,` `,zt(e,`plugin`),` from this marketplace:`]})}),k.installedPlugins&&k.installedPlugins.length>0&&(0,J.jsx)(u,{flexDirection:`column`,marginTop:1,marginLeft:2,children:k.installedPlugins.map(e=>(0,J.jsxs)(f,{dimColor:!0,children:[`• `,e.name]},e.name))}),(0,J.jsx)(u,{marginTop:1,children:(0,J.jsxs)(f,{children:[`Press `,(0,J.jsx)(f,{bold:!0,children:`y`}),` to confirm or `,(0,J.jsx)(f,{bold:!0,children:`n`}),` to cancel`]})})]})]})}if(D===`details`&&k){let e=k.pendingUpdate||b,t=ce(k);return(0,J.jsxs)(u,{flexDirection:`column`,children:[(0,J.jsx)(f,{bold:!0,children:k.name}),(0,J.jsx)(f,{dimColor:!0,children:k.source}),(0,J.jsx)(u,{marginTop:1,children:(0,J.jsxs)(f,{children:[k.pluginCount||0,` available `,zt(k.pluginCount||0,`plugin`)]})}),k.installedPlugins&&k.installedPlugins.length>0&&(0,J.jsxs)(u,{flexDirection:`column`,marginTop:1,children:[(0,J.jsxs)(f,{bold:!0,children:[`Installed plugins (`,k.installedPlugins.length,`):`]}),(0,J.jsx)(u,{flexDirection:`column`,marginLeft:1,children:k.installedPlugins.map(e=>(0,J.jsxs)(u,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(f,{children:a.bullet}),(0,J.jsxs)(u,{flexDirection:`column`,children:[(0,J.jsx)(f,{children:e.name}),(0,J.jsx)(f,{dimColor:!0,children:e.manifest.description})]})]},e.name))})]}),e&&(0,J.jsxs)(u,{marginTop:1,flexDirection:`column`,children:[(0,J.jsx)(f,{color:`claude`,children:`Updating marketplace…`}),T&&(0,J.jsx)(f,{dimColor:!0,children:T})]}),!e&&te&&(0,J.jsx)(u,{marginTop:1,children:(0,J.jsx)(f,{color:`claude`,children:te})}),!e&&S&&(0,J.jsx)(u,{marginTop:1,children:(0,J.jsx)(f,{color:`error`,children:S})}),!e&&(0,J.jsx)(u,{flexDirection:`column`,marginTop:1,children:t.map((e,t)=>{if(!e)return null;let n=t===re;return(0,J.jsxs)(u,{children:[(0,J.jsxs)(f,{color:n?`suggestion`:void 0,children:[n?a.pointer:` `,` `,e.label]}),e.secondaryLabel&&(0,J.jsxs)(f,{dimColor:!0,children:[` `,e.secondaryLabel]})]},e.value)})}),!e&&!kt()&&k.autoUpdate&&(0,J.jsx)(u,{marginTop:1,children:(0,J.jsx)(f,{dimColor:!0,children:`Auto-update enabled. Claude Code will automatically update this marketplace and its installed plugins.`})}),(0,J.jsx)(u,{marginLeft:3,children:(0,J.jsx)(f,{dimColor:!0,italic:!0,children:e?(0,J.jsx)(J.Fragment,{children:`Please wait…`}):(0,J.jsxs)(p,{children:[(0,J.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,J.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]})}let{updateCount:F,removeCount:ue}=ae();return(0,J.jsxs)(u,{flexDirection:`column`,children:[(0,J.jsx)(u,{marginBottom:1,children:(0,J.jsx)(f,{bold:!0,children:`Manage marketplaces`})}),(0,J.jsxs)(u,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(f,{color:v===0?`suggestion`:void 0,children:[v===0?a.pointer:` `,` +`]}),(0,J.jsx)(f,{bold:!0,color:v===0?`suggestion`:void 0,children:`Add Marketplace`})]}),(0,J.jsx)(u,{flexDirection:`column`,children:d.map((e,t)=>{let n=t+1===v,r=[];return e.pendingUpdate&&r.push(`UPDATE`),e.pendingRemove&&r.push(`REMOVE`),(0,J.jsxs)(u,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(f,{color:n?`suggestion`:void 0,children:[n?a.pointer:` `,` `,e.pendingRemove?a.cross:a.bullet]}),(0,J.jsxs)(u,{flexDirection:`column`,flexGrow:1,children:[(0,J.jsxs)(u,{flexDirection:`row`,gap:1,children:[(0,J.jsxs)(f,{bold:!0,strikethrough:e.pendingRemove,dimColor:e.pendingRemove,children:[e.name===`claude-plugins-official`&&(0,J.jsx)(f,{color:`claude`,children:`✻ `}),e.name,e.name===`claude-plugins-official`&&(0,J.jsx)(f,{color:`claude`,children:` ✻`})]}),r.length>0&&(0,J.jsxs)(f,{color:`warning`,children:[`[`,r.join(`, `),`]`]})]}),(0,J.jsx)(f,{dimColor:!0,children:e.source}),(0,J.jsxs)(f,{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)})}),M()&&(0,J.jsxs)(u,{marginTop:1,flexDirection:`column`,children:[(0,J.jsxs)(f,{children:[(0,J.jsx)(f,{bold:!0,children:`Pending changes:`}),` `,(0,J.jsx)(f,{dimColor:!0,children:`Enter to apply`})]}),F>0&&(0,J.jsxs)(f,{children:[`• Update `,F,` `,zt(F,`marketplace`)]}),ue>0&&(0,J.jsxs)(f,{color:`warning`,children:[`• Remove `,ue,` `,zt(ue,`marketplace`)]})]}),b&&(0,J.jsx)(u,{marginTop:1,children:(0,J.jsx)(f,{color:`claude`,children:`Processing changes…`})}),S&&(0,J.jsx)(u,{marginTop:1,children:(0,J.jsx)(f,{color:`error`,children:S})}),(0,J.jsx)(Er,{exitState:i,hasPendingActions:M()})]})}function Er({exitState:e,hasPendingActions:t}){return e.pending?(0,J.jsx)(u,{marginTop:1,children:(0,J.jsxs)(f,{dimColor:!0,italic:!0,children:[`Press `,e.keyName,` again to go back`]})}):(0,J.jsx)(u,{marginTop:1,children:(0,J.jsx)(f,{dimColor:!0,italic:!0,children:(0,J.jsxs)(p,{children:[t&&(0,J.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`apply changes`}),!t&&(0,J.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),!t&&(0,J.jsx)(o,{shortcut:`u`,action:`update`}),!t&&(0,J.jsx)(o,{shortcut:`r`,action:`remove`}),(0,J.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:t?`cancel`:`go back`})]})})})}var Dr,J,Or=e((()=>{i(),g(),Dr=t(g(),1),Nt(),P(),C(),Jt(),yt(),Ot(),pt(),rt(),ye(),ge(),wn(),De(),_t(),wt(),Vt(),J=T()}));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 Pe(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((()=>{D()}));function Mr({item:e,isSelected:t}){let[n]=l();if(e.type===`plugin`){let r,i;return e.pendingToggle?(r=v(`suggestion`,n)(a.arrowRight),i=e.pendingToggle===`will-enable`?`will enable`:`will disable`):e.errorCount>0?(r=v(`error`,n)(a.cross),i=`${e.errorCount} ${zt(e.errorCount,`error`)}`):e.isEnabled?(r=v(`success`,n)(a.tick),i=`enabled`):(r=v(`inactive`,n)(a.radioOff),i=`disabled`),(0,Y.jsxs)(u,{children:[(0,Y.jsx)(f,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(f,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(f,{dimColor:!t,children:[` `,(0,Y.jsx)(f,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(f,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(f,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(f,{dimColor:!t,children:i})]})}if(e.type===`flagged-plugin`){let r=v(`warning`,n)(a.warning);return(0,Y.jsxs)(u,{children:[(0,Y.jsx)(f,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(f,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(f,{dimColor:!t,children:[` `,(0,Y.jsx)(f,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(f,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(f,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(f,{dimColor:!t,children:`removed`})]})}if(e.type===`failed-plugin`){let r=v(`error`,n)(a.cross),i=`failed to load · ${e.errorCount} ${zt(e.errorCount,`error`)}`;return(0,Y.jsxs)(u,{children:[(0,Y.jsx)(f,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(f,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(f,{dimColor:!t,children:[` `,(0,Y.jsx)(f,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(f,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(f,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(f,{dimColor:!t,children:i})]})}let r,i;return e.status===`connected`?(r=v(`success`,n)(a.tick),i=`connected`):e.status===`disabled`?(r=v(`inactive`,n)(a.radioOff),i=`disabled`):e.status===`pending`?(r=v(`inactive`,n)(a.radioOff),i=`connecting…`):e.status===`needs-auth`?(r=v(`warning`,n)(a.triangleUpOutline),i=`Enter to auth`):(r=v(`error`,n)(a.cross),i=`failed`),e.indented?(0,Y.jsxs)(u,{children:[(0,Y.jsx)(f,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(f,{dimColor:!t,children:`└ `}),(0,Y.jsx)(f,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(f,{dimColor:!t,children:[` `,(0,Y.jsx)(f,{backgroundColor:`userMessageBackground`,children:`MCP`})]}),(0,Y.jsxs)(f,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(f,{dimColor:!t,children:i})]}):(0,Y.jsxs)(u,{children:[(0,Y.jsx)(f,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(f,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(f,{dimColor:!t,children:[` `,(0,Y.jsx)(f,{backgroundColor:`userMessageBackground`,children:`MCP`})]}),(0,Y.jsxs)(f,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(f,{dimColor:!t,children:i})]})}var Y,Nr=e((()=>{i(),g(),C(),Vt(),Y=T()}));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 ht(`Failed to read plugin components from ${e}: ${gt(t)}`,{level:`error`}),Mt(ft(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 ht(`Failed to read skill directories from ${e}: ${gt(t)}`,{level:`error`}),Mt(ft(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=me(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 I(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)(u,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsx)(f,{bold:!0,children:`Components:`}),(0,Z.jsxs)(f,{dimColor:!0,children:[`Error: `,o]})]}):!n||!(n.commands||n.agents||n.skills||n.hooks||n.mcpServers)?null:(0,Z.jsxs)(u,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsx)(f,{bold:!0,children:`Installed components:`}),n.commands?(0,Z.jsxs)(f,{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)(f,{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)(f,{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)(f,{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)(f,{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 I(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!Ue(`${e.name}@${t}`)})}function zr({setViewState:e,setResult:t,onManageComplete:n,onSearchModeChange:r,targetPlugin:i,targetMarketplace:o,action:s}){let l=nt(e=>e.mcp.clients),d=nt(e=>e.mcp.tools),h=nt(e=>e.plugins.errors),g=Gt(),[v,b]=(0,X.useState)(!1),S=(0,X.useCallback)(e=>{b(e),r?.(e)},[r]),C=m(),{columns:te}=x(),[w,T]=(0,X.useState)(`plugin-list`),{query:ne,setQuery:E,cursorOffset:D}=xn({isActive:w===`plugin-list`&&v,onExit:()=>{S(!1)}}),[O,k]=(0,X.useState)(null),[A,re]=(0,X.useState)([]),[j,ie]=(0,X.useState)([]),[M,N]=(0,X.useState)(!0),[ae,P]=(0,X.useState)(new Map),oe=(0,X.useRef)(!1),ce=(0,X.useRef)(void 0),le=hn();ee(`confirm:no`,Br.useCallback(()=>{if(w===`plugin-details`)T(`plugin-list`),k(null),z(null);else if(typeof w==`object`&&w.type===`failed-plugin-details`)T(`plugin-list`),z(null);else if(w===`configuring`)T(`plugin-details`),Ce(null);else if(typeof w==`object`&&(w.type===`plugin-options`||w.type===`configuring-options`))T(`plugin-list`),k(null),t(`Plugin enabled. Configuration skipped — run /reload-plugins to apply.`),n&&n();else if(typeof w==`object`&&w.type===`flagged-detail`)T(`plugin-list`),z(null);else if(typeof w==`object`&&w.type===`mcp-detail`)T(`plugin-list`),z(null);else if(typeof w==`object`&&w.type===`mcp-tools`)T({type:`mcp-detail`,client:w.client});else if(typeof w==`object`&&w.type===`mcp-tool-detail`)T({type:`mcp-tools`,client:w.client});else{if(ae.size>0){t(`Run /reload-plugins to apply plugin changes.`);return}e({type:`menu`})}},[w,e,ae,t]),{context:`Confirmation`,isActive:(w!==`plugin-list`||!v)&&w!==`confirm-project-uninstall`&&!(typeof w==`object`&&w.type===`confirm-data-cleanup`)});let ue=e=>e.type===`connected`?`connected`:e.type===`disabled`?`disabled`:e.type===`pending`?`pending`:e.type===`needs-auth`?`needs-auth`:`failed`,fe=(0,X.useMemo)(()=>{let e=Ct(),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 j){let i=`${r.plugin.name}@${r.marketplace}`,a=e?.enabledPlugins?.[i]!==!1,o=h.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:ae.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 h){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=Qt(),s=[];for(let[e,t]of a){if(e in g)continue;let n=st(e),r=n.name||e,i=n.marketplace||`unknown`,a=o.get(e),c=a===`flag`||a===void 0?`user`:a;s.push({type:`failed-plugin`,id:e,name:r,marketplace:i,scope:c,errorCount:t.length,errors:t})}let c=[];for(let e of l)e.name!==`ide`&&(e.name.startsWith(`plugin:`)||c.push({type:`mcp`,id:`mcp:${e.name}`,name:e.name,description:void 0,scope:e.config.scope,status:ue(e),client:e}));let u={flagged:-1,project:0,local:1,user:2,enterprise:3,managed:4,dynamic:5,builtin:6},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:ue(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(g)){let n=st(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},[j,l,h,ae,g]),pe=(0,X.useMemo)(()=>fe.filter(e=>e.type===`flagged-plugin`).map(e=>e.id),[fe]);(0,X.useEffect)(()=>{pe.length>0&&Wt(pe)},[pe]);let I=(0,X.useMemo)(()=>{if(!ne)return fe;let e=ne.toLowerCase();return fe.filter(t=>t.name.toLowerCase().includes(e)||`description`in t&&t.description?.toLowerCase().includes(e))},[fe,ne]),[me,he]=(0,X.useState)(0),ge=fr({totalItems:I.length,selectedIndex:me,maxVisible:8}),[_e,ve]=(0,X.useState)(0),[ye,R]=(0,X.useState)(!1),[be,z]=(0,X.useState)(null),[Se,Ce]=(0,X.useState)(null),[we,Te]=(0,X.useState)(!1),[Ee,De]=(0,X.useState)(!1);(0,X.useEffect)(()=>{if(!O){De(!1);return}async function e(){let e=O.plugin.manifest.mcpServers,t=!1;if(e&&(t=typeof e==`string`&&it(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&&it(e))),!t)try{let e=Tn.join(O.plugin.path,`..`),n=Tn.join(e,`.claude-plugin`,`marketplace.json`),r=ut(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`&&it(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&&it(e))}}catch(e){ht(`Failed to read raw marketplace.json: ${e}`)}De(t)}e()},[O]),(0,X.useEffect)(()=>{async function e(){N(!0);try{let{enabled:e,disabled:t}=await Ge(),n=Ct(),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=Tt(t,t=>{let r=`${t.name}@${e}`;return n?.enabledPlugins?.[r]!==!1}),i=t.length-r;a.push({name:e,installedPlugins:t,enabledCount:r,disabledCount:i})}a.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),re(a);let o=[];for(let e of a)for(let t of e.installedPlugins){let n=`${t.name}@${e.name}`,r=t.isBuiltin?`builtin`:an(n).scope;o.push({plugin:t,marketplace:e.name,scope:r,pendingEnable:void 0,pendingUpdate:!1})}ie(o),he(0)}finally{N(!1)}}e()},[]),(0,X.useEffect)(()=>{if(!oe.current&&i&&A.length>0&&!M){let{name:e,marketplace:n}=st(i),r=o??n,a=r?A.filter(e=>e.name===r):A;for(let t of a){let n=t.installedPlugins.find(t=>t.name===e);if(n){let{scope:e}=an(`${n.name}@${t.name}`),r={plugin:n,marketplace:t.name,scope:e,pendingEnable:void 0,pendingUpdate:!1};k(r),T(`plugin-details`),ce.current=s,oe.current=!0;return}}let c=fe.find(t=>t.type===`failed-plugin`&&t.name===e);c&&c.type===`failed-plugin`&&(T({type:`failed-plugin-details`,plugin:{id:c.id,name:c.name,marketplace:c.marketplace,errors:c.errors,scope:c.scope}}),oe.current=!0),!oe.current&&s&&(oe.current=!0,t(`Plugin "${i}" is not installed in this project`))}},[i,o,A,M,fe,s,t]);let ke=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&&!rn(i)&&r!==`update`){z(`This plugin is managed by your organization. Contact your admin to disable it.`);return}R(!0),z(null);try{let o=`${O.plugin.name}@${O.marketplace}`,s;switch(r){case`enable`:{let e=await $t(o);if(!e.success)throw Error(e.message);break}case`disable`:{let e=await nn(o);if(!e.success)throw Error(e.message);s=e.reverseDependents;break}case`uninstall`:{if(a||!rn(i))break;if(sn(o)){R(!1),T(`confirm-project-uninstall`);return}let e=F().plugins[o],t=!e||e.length<=1?await de(o):null;if(t){R(!1),T({type:`confirm-data-cleanup`,size:t});return}let n=await en(o,i);if(!n.success)throw Error(n.message);s=n.reverseDependents;break}case`update`:{if(a)break;let r=await tn(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}}Re();let c=`${O.plugin.name}@${O.marketplace}`;if(Ct()?.enabledPlugins?.[c]!==!1){R(!1),T({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){R(!1);let t=e instanceof Error?e.message:String(e);z(`Failed to ${r}: ${t}`),Mt(ft(e))}},Ae=(0,X.useRef)(ke);Ae.current=ke,(0,X.useEffect)(()=>{if(w===`plugin-details`&&O&&ce.current){let e=ce.current;ce.current=void 0,Ae.current(e)}},[w,O]);let je=Br.useCallback(()=>{if(me>=I.length)return;let e=I[me];if(e?.type!==`flagged-plugin`)if(e?.type===`plugin`){let t=`${e.plugin.name}@${e.marketplace}`,n=Ct(),r=ae.get(t),i=n?.enabledPlugins?.[t]!==!1,a=e.scope;if(a===`builtin`||rn(a)){let e=new Map(ae);r?(e.delete(t),(async()=>{try{r===`will-disable`?await $t(t):await nn(t),Re()}catch(e){Mt(e)}})()):(e.set(t,i?`will-disable`:`will-enable`),(async()=>{try{i?await nn(t):await $t(t),Re()}catch(e){Mt(e)}})()),P(e)}}else e?.type===`mcp`&&le(e.client.name)},[me,I,ae,j,le]);c({"select:previous":()=>{me===0?S(!0):ge.handleSelectionChange(me-1,he)},"select:next":()=>{me<I.length-1&&ge.handleSelectionChange(me+1,he)},"select:accept":Br.useCallback(()=>{if(me>=I.length)return;let e=I[me];if(e?.type===`plugin`){let t=j.find(t=>t.plugin.name===e.plugin.name&&t.marketplace===e.marketplace);t&&(k(t),T(`plugin-details`),ve(0),z(null))}else e?.type===`flagged-plugin`?(T({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`?(T({type:`failed-plugin-details`,plugin:{id:e.id,name:e.name,marketplace:e.marketplace,errors:e.errors,scope:e.scope}}),ve(0),z(null)):e?.type===`mcp`&&(T({type:`mcp-detail`,client:e.client}),z(null))},[me,I,j])},{context:`Select`,isActive:w===`plugin-list`&&!v}),c({"plugin:toggle":je},{context:`Plugin`,isActive:w===`plugin-list`&&!v}),c({"select:accept":Br.useCallback(()=>{typeof w!=`object`||w.type!==`flagged-detail`||(Kt(w.plugin.id),T(`plugin-list`))},[w])},{context:`Select`,isActive:typeof w==`object`&&w.type===`flagged-detail`});let Me=Br.useMemo(()=>{if(w!==`plugin-details`||!O)return[];let e=Ct(),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 ke(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=[...j],n=t.findIndex(e=>e.plugin.name===O.plugin.name&&e.marketplace===O.marketplace);n!==-1&&(t[n].pendingUpdate=!O.pendingUpdate,ie(t),k({...O,pendingUpdate:!O.pendingUpdate}))}catch(e){z(e instanceof Error?e.message:`Failed to check plugin update availability`)}}}),Ee&&i.push({label:`Configure`,action:async()=>{Te(!0);try{let e=O.plugin.manifest.mcpServers,t=null;if(typeof e==`string`&&it(e))t=e;else if(Array.isArray(e)){for(let n of e)if(typeof n==`string`&&it(n)){t=n;break}}if(!t){z(`No MCPB file found in plugin`),Te(!1);return}let n=`${O.plugin.name}@${O.marketplace}`,r=await Oe(t,O.plugin.path,n,void 0,void 0,!0);`status`in r&&r.status===`needs-config`?(Ce(r),T(`configuring`)):z(`Failed to load MCPB for configuration`)}catch(e){let t=gt(e);z(`Failed to load configuration: ${t}`)}finally{Te(!1)}}}),O.plugin.manifest.userConfig&&Object.keys(O.plugin.manifest.userConfig).length>0&&i.push({label:`Configure options`,action:()=>{T({type:`configuring-options`,schema:O.plugin.manifest.userConfig})}}),i.push({label:`Update now`,action:()=>void ke(`update`)}),i.push({label:`Uninstall`,action:()=>void ke(`uninstall`)})),O.plugin.manifest.homepage&&i.push({label:`Open homepage`,action:()=>void Yt(O.plugin.manifest.homepage)}),O.plugin.manifest.repository&&i.push({label:`View repository`,action:()=>void Yt(O.plugin.manifest.repository)}),i.push({label:`Back to plugin list`,action:()=>{T(`plugin-list`),k(null),z(null)}}),i},[w,O,Ee,j]);if(c({"select:previous":()=>{_e>0&&ve(_e-1)},"select:next":()=>{_e<Me.length-1&&ve(_e+1)},"select:accept":()=>{Me[_e]&&Me[_e].action()}},{context:`Select`,isActive:w===`plugin-details`&&!!O}),c({"select:accept":()=>{typeof w==`object`&&w.type===`failed-plugin-details`&&(async()=>{R(!0),z(null);let e=w.plugin.id,t=w.plugin.scope,r=rn(t)?await en(e,t,!1):await en(e,`user`,!1),i=r.success;if(!i){for(let t of[`userSettings`,`projectSettings`,`localSettings`]){let n=xt(t);n?.enabledPlugins?.[e]!==void 0&&(Dt(t,{enabledPlugins:{...n.enabledPlugins,[e]:void 0}}),i=!0)}Re()}i?(n&&await n(),R(!1),T(`plugin-list`)):(R(!1),z(r.message))})()}},{context:`Select`,isActive:typeof w==`object`&&w.type===`failed-plugin-details`&&w.plugin.scope!==`managed`}),c({"confirm:yes":()=>{if(!O)return;R(!0),z(null);let r=`${O.plugin.name}@${O.marketplace}`,{error:i}=Dt(`localSettings`,{enabledPlugins:{...xt(`localSettings`)?.enabledPlugins,[r]:!1}});if(i){R(!1),z(`Failed to write settings: ${i.message}`);return}Re(),t(`✓ Disabled ${O.plugin.name} in .claude/settings.local.json. Run /reload-plugins to apply.`),n&&n(),e({type:`menu`})},"confirm:no":()=>{T(`plugin-details`),z(null)}},{context:`Confirmation`,isActive:w===`confirm-project-uninstall`&&!!O&&!ye}),_((r,i)=>{if(!O)return;let o=`${O.plugin.name}@${O.marketplace}`,s=O.scope;if(!s||s===`builtin`||!rn(s))return;let c=async r=>{R(!0),z(null);try{let i=await en(o,s,r);if(!i.success)throw Error(i.message);Re();let c=r?``:` · data preserved`;t(`${a.tick} ${i.message}${c}`),n&&n(),e({type:`menu`})}catch(e){R(!1),z(e instanceof Error?e.message:String(e))}};r===`y`||r===`Y`?c(!0):r===`n`||r===`N`?c(!1):i.escape&&(T(`plugin-details`),z(null))},{isActive:typeof w==`object`&&w.type===`confirm-data-cleanup`&&!!O&&!ye}),Br.useEffect(()=>{he(0)},[ne]),_((e,t)=>{let n=!t.ctrl&&!t.meta;v||(e===`/`&&n?(S(!0),E(``),he(0)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==` `&&(S(!0),E(e),he(0)))},{isActive:w===`plugin-list`}),M)return(0,Z.jsx)(f,{children:`Loading installed plugins…`});if(fe.length===0)return(0,Z.jsxs)(u,{flexDirection:`column`,children:[(0,Z.jsx)(u,{marginBottom:1,children:(0,Z.jsx)(f,{bold:!0,children:`Manage plugins`})}),(0,Z.jsx)(f,{children:`No plugins or MCP servers installed.`}),(0,Z.jsx)(u,{marginTop:1,children:(0,Z.jsx)(f,{dimColor:!0,children:`Esc to go back`})})]});if(typeof w==`object`&&w.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 w==`object`&&w.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:w.schema,initialValues:Ze(e),onSave:n=>{try{xe(e,n,w.schema),Re(),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){z(`Failed to save configuration: ${gt(e)}`)}T(`plugin-details`)},onCancel:()=>T(`plugin-details`)})}if(w===`configuring`&&Se&&O){let e=`${O.plugin.name}@${O.marketplace}`;async function n(n){if(!(!Se||!O))try{let r=O.plugin.manifest.mcpServers,i=null;if(typeof r==`string`&&it(r))i=r;else if(Array.isArray(r)){for(let e of r)if(typeof e==`string`&&it(e)){i=e;break}}if(!i){z(`No MCPB file found`),T(`plugin-details`);return}await Oe(i,O.plugin.path,e,void 0,n),z(null),Ce(null),T(`plugin-details`),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){let t=gt(e);z(`Failed to save configuration: ${t}`),T(`plugin-details`)}}function r(){Ce(null),T(`plugin-details`)}return(0,Z.jsx)(Yn,{title:`Configure ${Se.manifest.name}`,subtitle:`Plugin: ${O.plugin.name}`,configSchema:Se.configSchema,initialValues:Se.existingConfig,onSave:n,onCancel:r})}if(typeof w==`object`&&w.type===`flagged-detail`){let e=w.plugin;return(0,Z.jsxs)(u,{flexDirection:`column`,children:[(0,Z.jsx)(u,{children:(0,Z.jsxs)(f,{bold:!0,children:[e.name,` @ `,e.marketplace]})}),(0,Z.jsxs)(u,{marginBottom:1,children:[(0,Z.jsx)(f,{dimColor:!0,children:`Status: `}),(0,Z.jsx)(f,{color:`error`,children:`Removed`})]}),(0,Z.jsxs)(u,{marginBottom:1,flexDirection:`column`,children:[(0,Z.jsxs)(f,{color:`error`,children:[`Removed from marketplace · reason: `,e.reason]}),(0,Z.jsx)(f,{children:e.text}),(0,Z.jsxs)(f,{dimColor:!0,children:[`Flagged on `,new Date(e.flaggedAt).toLocaleDateString()]})]}),(0,Z.jsx)(u,{marginTop:1,flexDirection:`column`,children:(0,Z.jsxs)(u,{children:[(0,Z.jsxs)(f,{children:[a.pointer,` `]}),(0,Z.jsx)(f,{color:`suggestion`,children:`Dismiss`})]})}),(0,Z.jsxs)(p,{children:[(0,Z.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`dismiss`}),(0,Z.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})]})}if(w===`confirm-project-uninstall`&&O)return(0,Z.jsxs)(u,{flexDirection:`column`,children:[(0,Z.jsxs)(f,{bold:!0,color:`warning`,children:[O.plugin.name,` is enabled in .claude/settings.json (shared with your team)`]}),(0,Z.jsxs)(u,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(f,{children:`Disable it just for you in .claude/settings.local.json?`}),(0,Z.jsx)(f,{dimColor:!0,children:`This has the same effect as uninstalling, without affecting other contributors.`})]}),be&&(0,Z.jsx)(u,{marginTop:1,children:(0,Z.jsx)(f,{color:`error`,children:be})}),(0,Z.jsx)(u,{marginTop:1,children:ye?(0,Z.jsx)(f,{dimColor:!0,children:`Disabling…`}):(0,Z.jsxs)(p,{children:[(0,Z.jsx)(L,{action:`confirm:yes`,context:`Confirmation`,fallback:`y`,description:`disable`}),(0,Z.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]});if(typeof w==`object`&&w.type===`confirm-data-cleanup`&&O)return(0,Z.jsxs)(u,{flexDirection:`column`,children:[(0,Z.jsxs)(f,{bold:!0,children:[O.plugin.name,` has `,w.size.human,` of persistent data`]}),(0,Z.jsxs)(u,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(f,{children:`Delete it along with the plugin?`}),(0,Z.jsx)(f,{dimColor:!0,children:se(`${O.plugin.name}@${O.marketplace}`)})]}),be&&(0,Z.jsx)(u,{marginTop:1,children:(0,Z.jsx)(f,{color:`error`,children:be})}),(0,Z.jsx)(u,{marginTop:1,children:ye?(0,Z.jsx)(f,{dimColor:!0,children:`Uninstalling…`}):(0,Z.jsxs)(f,{children:[(0,Z.jsx)(f,{bold:!0,children:`y`}),` to delete · `,(0,Z.jsx)(f,{bold:!0,children:`n`}),` to keep · `,(0,Z.jsx)(f,{bold:!0,children:`esc`}),` to cancel`]})})]});if(w===`plugin-details`&&O){let e=Ct(),t=`${O.plugin.name}@${O.marketplace}`,n=e?.enabledPlugins?.[t]!==!1,r=h.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)(u,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsxs)(f,{bold:!0,color:`error`,children:[r.length,` `,zt(r.length,`error`),`:`]}),r.map((e,t)=>{let n=Ar(e);return(0,Z.jsxs)(u,{flexDirection:`column`,marginLeft:2,children:[(0,Z.jsx)(f,{color:`error`,children:kr(e)}),n&&(0,Z.jsxs)(f,{dimColor:!0,italic:!0,children:[a.arrowRight,` `,n]})]},t)})]});return(0,Z.jsxs)(u,{flexDirection:`column`,children:[(0,Z.jsx)(u,{children:(0,Z.jsxs)(f,{bold:!0,children:[O.plugin.name,` @ `,O.marketplace]})}),(0,Z.jsxs)(u,{children:[(0,Z.jsx)(f,{dimColor:!0,children:`Scope: `}),(0,Z.jsx)(f,{children:O.scope||`user`})]}),O.plugin.manifest.version&&(0,Z.jsxs)(u,{children:[(0,Z.jsx)(f,{dimColor:!0,children:`Version: `}),(0,Z.jsx)(f,{children:O.plugin.manifest.version})]}),O.plugin.manifest.description&&(0,Z.jsx)(u,{marginBottom:1,children:(0,Z.jsx)(f,{children:O.plugin.manifest.description})}),O.plugin.manifest.author&&(0,Z.jsxs)(u,{children:[(0,Z.jsx)(f,{dimColor:!0,children:`Author: `}),(0,Z.jsx)(f,{children:O.plugin.manifest.author.name})]}),(0,Z.jsxs)(u,{marginBottom:1,children:[(0,Z.jsx)(f,{dimColor:!0,children:`Status: `}),(0,Z.jsx)(f,{color:n?`success`:`warning`,children:n?`Enabled`:`Disabled`}),O.pendingUpdate&&(0,Z.jsx)(f,{color:`suggestion`,children:` · Marked for update`})]}),(0,Z.jsx)(Ir,{plugin:O.plugin,marketplace:O.marketplace}),i,(0,Z.jsx)(u,{marginTop:1,flexDirection:`column`,children:Me.map((e,t)=>{let n=t===_e;return(0,Z.jsxs)(u,{children:[n&&(0,Z.jsxs)(f,{children:[a.pointer,` `]}),!n&&(0,Z.jsx)(f,{children:` `}),(0,Z.jsx)(f,{bold:n,color:e.label.includes(`Uninstall`)?`error`:e.label.includes(`Update`)?`suggestion`:void 0,children:e.label})]},t)})}),ye&&(0,Z.jsx)(u,{marginTop:1,children:(0,Z.jsx)(f,{children:`Processing…`})}),be&&(0,Z.jsx)(u,{marginTop:1,children:(0,Z.jsx)(f,{color:`error`,children:be})}),(0,Z.jsx)(u,{marginTop:1,children:(0,Z.jsx)(f,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(L,{action:`select:previous`,context:`Select`,fallback:`↑`,description:`navigate`}),(0,Z.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,Z.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(typeof w==`object`&&w.type===`failed-plugin-details`){let e=w.plugin,t=e.errors[0],n=t?kr(t):`Failed to load`;return(0,Z.jsxs)(u,{flexDirection:`column`,children:[(0,Z.jsxs)(f,{children:[(0,Z.jsx)(f,{bold:!0,children:e.name}),(0,Z.jsxs)(f,{dimColor:!0,children:[` @ `,e.marketplace]}),(0,Z.jsxs)(f,{dimColor:!0,children:[` (`,e.scope,`)`]})]}),(0,Z.jsx)(f,{color:`error`,children:n}),e.scope===`managed`?(0,Z.jsx)(u,{marginTop:1,children:(0,Z.jsx)(f,{dimColor:!0,children:`Managed by your organization — contact your admin`})}):(0,Z.jsxs)(u,{marginTop:1,children:[(0,Z.jsxs)(f,{color:`suggestion`,children:[a.pointer,` `]}),(0,Z.jsx)(f,{bold:!0,children:`Remove`})]}),ye&&(0,Z.jsx)(f,{children:`Processing…`}),be&&(0,Z.jsx)(f,{color:`error`,children:be}),(0,Z.jsx)(u,{marginTop:1,children:(0,Z.jsx)(f,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(p,{children:[e.scope!==`managed`&&(0,Z.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`remove`}),(0,Z.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(typeof w==`object`&&w.type===`mcp-detail`){let e=w.client,n=Fe(d,e.name).length,r=()=>{T({type:`mcp-tools`,client:e})},i=()=>{T(`plugin-list`)},a=e=>{e&&t(e),T(`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}):(T(`plugin-list`),null)}if(typeof w==`object`&&w.type===`mcp-tools`){let e=w.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=>{T({type:`mcp-tool-detail`,client:e,tool:t})},onBack:()=>T({type:`mcp-detail`,client:e})})}if(typeof w==`object`&&w.type===`mcp-tool-detail`){let{client:e,tool:t}=w,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:()=>T({type:`mcp-tools`,client:e})})}let Ne=ge.getVisibleItems(I);return(0,Z.jsxs)(u,{flexDirection:`column`,children:[(0,Z.jsx)(u,{marginBottom:1,children:(0,Z.jsx)(y,{query:ne,isFocused:v,isTerminalFocused:C,width:te-4,cursorOffset:D})}),I.length===0&&ne&&(0,Z.jsx)(u,{marginBottom:1,children:(0,Z.jsxs)(f,{dimColor:!0,children:[`No items match "`,ne,`"`]})}),ge.scrollPosition.canScrollUp&&(0,Z.jsx)(u,{children:(0,Z.jsxs)(f,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),Ne.map((e,t)=>{let n=ge.toActualIndex(t)===me&&!v,r=t>0?Ne[t-1]:null,i=!r||r.scope!==e.scope;return(0,Z.jsxs)(Br.Fragment,{children:[i&&(0,Z.jsx)(u,{marginTop:+(t>0),paddingLeft:2,children:(0,Z.jsx)(f,{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)}),ge.scrollPosition.canScrollDown&&(0,Z.jsx)(u,{children:(0,Z.jsxs)(f,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),(0,Z.jsx)(u,{marginTop:1,marginLeft:1,children:(0,Z.jsx)(f,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(f,{children:`type to search`}),(0,Z.jsx)(L,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,Z.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,Z.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})}),ae.size>0&&(0,Z.jsx)(u,{marginLeft:1,children:(0,Z.jsx)(f,{dimColor:!0,italic:!0,children:`Run /reload-plugins to apply changes`})})]})}var Br,X,Z,Vr=e((()=>{i(),Br=t(g(),1),X=t(g(),1),P(),C(),Pn(),Ln(),Bn(),Wn(),bn(),Sn(),he(),Jt(),A(),gn(),ce(),on(),Le(),yt(),Xt(),mt(),pt(),jt(),rt(),j(),ge(),ze(),Ne(),qt(),ct(),De(),We(),R(),Zt(),wt(),dt(),Vt(),jr(),Qn(),rr(),Nr(),hr(),Z=T()}));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"./rolldown-runtime-DaDcL9Zw.js";import{l as n,o as r}from"./envUtils-DSxRz_kt.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{D as o,Gr as s,Gt as c,H as l,I as u,Lt as d,P as f,T as p,Wt as ee,Xn as m,dr as h,fi as g,hn as _,j as v,k as y,n as b,ot as x,r as S,t as C,x as te,y as w}from"./src-CDCSSo0U2.js";import{t as T}from"./jsx-runtime-Bb4Xn-E0.js";import{$s as ne,$y as E,AD as D,As as O,C_ as k,ED as A,E_ as re,Es as j,Fs as ie,G_ as M,Gs as N,H_ as ae,Hb as P,Hs as oe,ME as se,M_ as ce,Mb as le,Ms as F,Nb as ue,OE as de,O_ as fe,Qg as pe,Rs as I,TD as me,TS as he,Vb as L,Vs as ge,Xs as _e,Ys as ve,ac as ye,am as R,av as be,b_ as z,cv as xe,dg as Se,dv as Ce,ec as we,ex as Te,fS as Ee,fs as De,fv as Oe,hD as ke,i_ as Ae,ic as je,ig as Me,jE as Ne,kD as Pe,k_ as Fe,ks as Ie,lS as Le,lc as Re,lv as ze,nc as Be,nv as Ve,o_ as He,om as Ue,ov as We,ps as Ge,pv as Ke,qs as qe,r_ as Je,rc as Ye,sc as Xe,sv as Ze,tb as Qe,tc as $e,tv as et,tx as tt,uS as nt,uc as rt,uv as it,vs as at,w_ as ot,xD as st,yD as ct,ys as lt}from"./loadAgentsDir-ZQwvbURI.js";import{D as ut,E as dt,J as ft,U as pt,l as mt,p as ht,z as gt}from"./debug-DiuXEmUq.js";import{St as _t,Tt as vt,_n as yt,at as bt,c as xt,ct as St,f as Ct,g as wt,gn as Tt,it as Et,y as Dt}from"./settings-BhvhCpVh.js";import{g as Ot,x as kt}from"./config-662VDD70.js";import{c as At,o as jt,s as Mt}from"./log-Duzb4o6h.js";import{n as Nt,r as Pt}from"./analytics-BotDBGh0.js";import{T as Ft,x as It}from"./startupProfiler-BquH_Yqm.js";import{l as Lt,u as Rt}from"./oauth-BqJqV-2M.js";import{l as zt,n as Bt,o as Vt}from"./stringUtils-D_g2L6A4.js";import{Mt as Ht,Vt as Ut}from"./model-BgrLt7P7.js";import{a as Wt,n as Gt,o as Kt,r as qt}from"./pluginFlagging-_WUQP3Lq.js";import{u as Jt}from"./referral-Cu9bEOFE.js";import{n as Yt,t as Xt}from"./browser-BKiu1max.js";import{n as Zt,t as Qt}from"./pluginStartupCheck-BelpzwZI.js";import{a as $t,d as en,f as tn,i as nn,l as rn,o as an,s as on,u as sn}from"./pluginOperations-BOkST1qE.js";import{a as cn,c as ln,i as un,n as dn,o as fn,s as pn,t as mn}from"./validatePlugin-n8a4W_jI.js";import{i as hn,n as gn,r as _n}from"./MCPConnectionManager-BLfKm4H2.js";import{n as vn,t as yn}from"./useExitOnCtrlCDWithKeybindings-vzUoPY51.js";import{t as bn}from"./SearchBox-vfLXEPed.js";import{n as xn,t as Sn}from"./useSearchInput-B1UOjxAI.js";import{i as Cn,n as wn}from"./pluginAutoupdate-7FFHzSRz.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)(u,{children:[(0,On.jsx)(f,{bold:!0,children:`Capabilities: `}),(0,On.jsx)(f,{color:`text`,children:r.length>0?(0,On.jsx)(p,{children:r}):`none`})]})}var On,kn=e((()=>{g(),C(),On=T()}));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:s=!1}){let[c]=l(),m=vn(),{columns:g}=x(),[y,b]=B.useState(!1),[S,C]=B.useState(null),te=nt(e=>e.mcp),w=Ee(),[T,ne]=B.useState(null),[D,O]=(0,B.useState)(!1),A=(0,B.useRef)(null),[j,ie]=(0,B.useState)(!1),[M,N]=(0,B.useState)(null),[ae,P]=(0,B.useState)(!1),[oe,se]=(0,B.useState)(null),[ce,le]=(0,B.useState)(!1),[F,de]=(0,B.useState)(!1),I=(0,B.useRef)(void 0),me=(0,B.useRef)(!1),[he,ge]=(0,B.useState)(``),[_e,ve]=(0,B.useState)(0),[ye,R]=(0,B.useState)(null);(0,B.useEffect)(()=>()=>{me.current=!0,A.current?.abort(),I.current!==void 0&&clearTimeout(I.current)},[]);let be=e.isAuthenticated||e.client.type===`connected`&&t>0,xe=_n(),Se=B.useCallback(async()=>{ie(!1),N(null),O(!0);try{let t=await xe(e.name),n=t.client.type===`connected`;Pt(`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){Pt(`tengu_claudeai_mcp_auth_completed`,{success:!1}),i?.(jn(t,e.name))}finally{O(!1)}},[xe,e.name,i]),Ce=B.useCallback(async()=>{await Me(e.name,{...e.config,scope:e.scope}),w(t=>{let n=t.mcp.clients.map(t=>t.name===e.name?{...t,type:`needs-auth`}:t),r=re(t.mcp.tools,e.name),i=k(t.mcp.commands,e.name),a=ot(t.mcp.resources,e.name);return{...t,mcp:{...t.mcp,clients:n,tools:r,commands:i,resources:a}}}),Pt(`tengu_claudeai_mcp_clear_auth_completed`,{}),i?.(`Disconnected from ${e.name}.`),P(!1),se(null),le(!1)},[e.name,e.config,e.scope,w,i]);ee(`confirm:no`,()=>{A.current?.abort(),A.current=null,b(!1),ne(null)},{context:`Confirmation`,isActive:y}),ee(`confirm:no`,()=>{ie(!1),N(null)},{context:`Confirmation`,isActive:j}),ee(`confirm:no`,()=>{P(!1),se(null),le(!1)},{context:`Confirmation`,isActive:ae}),_((e,t)=>{if(t.return&&j&&Se(),t.return&&ae)if(ce)Ce();else{let e=`${Lt().CLAUDE_AI_ORIGIN}/settings/connectors`;se(e),le(!0),Yt(e)}if(e===`c`&&!F){let e=T||M||oe;e&&h(e).then(e=>{me.current||(e&&process.stdout.write(e),de(!0),I.current!==void 0&&clearTimeout(I.current),I.current=setTimeout(de,2e3,!1))})}});let we=Bt(String(e.name)),De=fe(te.commands,e.name).length,Oe=hn(),ke=B.useCallback(async()=>{let t=Lt().CLAUDE_AI_ORIGIN,n=Ht()?.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`,N(r),ie(!0),Pt(`tengu_claudeai_mcp_auth_started`,{}),await Yt(r)},[e.config]),je=B.useCallback(()=>{P(!0),Pt(`tengu_claudeai_mcp_clear_auth_started`,{})},[]),Ne=B.useCallback(async()=>{let t=e.client.type!==`disabled`;try{await Oe(e.name),e.config.type===`claudeai-proxy`&&Pt(`tengu_claudeai_mcp_toggle`,{new_state:t?`disabled`:`enabled`}),r()}catch(n){i?.(`Failed to ${t?`disable`:`enable`} MCP server '${e.name}': ${gt(n)}`)}},[e.client.type,e.config.type,e.name,Oe,r,i]),Pe=B.useCallback(async()=>{if(e.config.type===`claudeai-proxy`)return;b(!0),C(null);let t=new AbortController;A.current=t;try{if(e.isAuthenticated&&e.config&&await He(e.name,e.config,{preserveStepUpState:!0}),e.config){await Ae(e.name,e.config,ne,t.signal,{onWaitingForCallback:e=>{R(()=>e)}}),Pt(`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.`):(At(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 pe)&&C(e.message)}finally{b(!1),A.current=null,R(null),ge(``)}},[e.isAuthenticated,e.config,e.name,i,xe,be]),Fe=async()=>{e.config.type!==`claudeai-proxy`&&e.config&&(await He(e.name,e.config),Pt(`tengu_mcp_auth_config_clear`,{}),await Me(e.name,{...e.config,scope:e.scope}),w(t=>{let n=t.mcp.clients.map(t=>t.name===e.name?{...t,type:`failed`}:t),r=re(t.mcp.tools,e.name),i=k(t.mcp.commands,e.name),a=ot(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(y){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)(u,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(f,{color:`claude`,children:[`Authenticating with `,e.name,`…`]}),(0,V.jsxs)(u,{children:[(0,V.jsx)(E,{}),(0,V.jsx)(f,{children:t})]}),T&&(0,V.jsxs)(u,{flexDirection:`column`,children:[(0,V.jsxs)(u,{children:[(0,V.jsx)(f,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL manually `}),F?(0,V.jsx)(f,{color:`success`,children:`(Copied!)`}):(0,V.jsx)(f,{dimColor:!0,children:(0,V.jsx)(o,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,V.jsx)(d,{url:T})]}),y&&T&&ye&&(0,V.jsxs)(u,{flexDirection:`column`,marginTop:1,children:[(0,V.jsx)(f,{dimColor:!0,children:`If the redirect page shows a connection error, paste the URL from your browser's address bar:`}),(0,V.jsxs)(u,{children:[(0,V.jsxs)(f,{dimColor:!0,children:[`URL `,`>`,` `]}),(0,V.jsx)(Te,{value:he,onChange:ge,onSubmit:e=>{ye(e.trim()),ge(``)},cursorOffset:_e,onChangeCursorOffset:ve,columns:g-8})]})]}),(0,V.jsx)(u,{marginLeft:3,children:(0,V.jsx)(f,{dimColor:!0,children:`Return here after authenticating in your browser. Press Esc to go back.`})})]})}if(j)return(0,V.jsxs)(u,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(f,{color:`claude`,children:[`Authenticating with `,e.name,`…`]}),(0,V.jsxs)(u,{children:[(0,V.jsx)(E,{}),(0,V.jsx)(f,{children:` A browser window will open for authentication`})]}),M&&(0,V.jsxs)(u,{flexDirection:`column`,children:[(0,V.jsxs)(u,{children:[(0,V.jsx)(f,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL manually `}),F?(0,V.jsx)(f,{color:`success`,children:`(Copied!)`}):(0,V.jsx)(f,{dimColor:!0,children:(0,V.jsx)(o,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,V.jsx)(d,{url:M})]}),(0,V.jsxs)(u,{marginLeft:3,flexDirection:`column`,children:[(0,V.jsxs)(f,{color:`permission`,children:[`Press `,(0,V.jsx)(f,{bold:!0,children:`Enter`}),` after authenticating in your browser.`]}),(0,V.jsx)(f,{dimColor:!0,italic:!0,children:(0,V.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})]})]});if(ae)return(0,V.jsxs)(u,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(f,{color:`claude`,children:[`Clear authentication for `,e.name]}),ce?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(f,{children:`Find the MCP server in the browser and click "Disconnect".`}),oe&&(0,V.jsxs)(u,{flexDirection:`column`,children:[(0,V.jsxs)(u,{children:[(0,V.jsx)(f,{dimColor:!0,children:`If your browser didn't open automatically, copy this URL manually `}),F?(0,V.jsx)(f,{color:`success`,children:`(Copied!)`}):(0,V.jsx)(f,{dimColor:!0,children:(0,V.jsx)(o,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,V.jsx)(d,{url:oe})]}),(0,V.jsxs)(u,{marginLeft:3,flexDirection:`column`,children:[(0,V.jsxs)(f,{color:`permission`,children:[`Press `,(0,V.jsx)(f,{bold:!0,children:`Enter`}),` when done.`]}),(0,V.jsx)(f,{dimColor:!0,italic:!0,children:(0,V.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})]})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(f,{children:`This will open claude.ai in the browser. Find the MCP server in the list and click "Disconnect".`}),(0,V.jsxs)(u,{marginLeft:3,flexDirection:`column`,children:[(0,V.jsxs)(f,{color:`permission`,children:[`Press `,(0,V.jsx)(f,{bold:!0,children:`Enter`}),` to open the browser.`]}),(0,V.jsx)(f,{dimColor:!0,italic:!0,children:(0,V.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})]})]})]});if(D)return(0,V.jsxs)(u,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(f,{color:`text`,children:[`Connecting to `,(0,V.jsx)(f,{bold:!0,children:e.name}),`…`]}),(0,V.jsxs)(u,{children:[(0,V.jsx)(E,{}),(0,V.jsx)(f,{children:` Establishing connection to MCP server`})]}),(0,V.jsx)(f,{dimColor:!0,children:`This may take a few moments.`})]});let Ie=[];return e.client.type===`disabled`&&Ie.push({label:`Enable`,value:`toggle-enabled`}),e.client.type===`connected`&&t>0&&Ie.push({label:`View tools`,value:`tools`}),e.config.type===`claudeai-proxy`?e.client.type===`connected`?Ie.push({label:`Clear authentication`,value:`claudeai-clear-auth`}):e.client.type!==`disabled`&&Ie.push({label:`Authenticate`,value:`claudeai-auth`}):(be&&(Ie.push({label:`Re-authenticate`,value:`reauth`}),Ie.push({label:`Clear authentication`,value:`clear-auth`})),be||Ie.push({label:`Authenticate`,value:`auth`})),e.client.type!==`disabled`&&(e.client.type!==`needs-auth`&&Ie.push({label:`Reconnect`,value:`reconnectMcpServer`}),Ie.push({label:`Disable`,value:`toggle-enabled`})),Ie.length===0&&Ie.push({label:`Back`,value:`back`}),(0,V.jsxs)(u,{flexDirection:`column`,children:[(0,V.jsxs)(u,{flexDirection:`column`,paddingX:1,borderStyle:s?void 0:`round`,children:[(0,V.jsx)(u,{marginBottom:1,children:(0,V.jsxs)(f,{bold:!0,children:[we,` MCP Server`]})}),(0,V.jsxs)(u,{flexDirection:`column`,gap:0,children:[(0,V.jsxs)(u,{children:[(0,V.jsx)(f,{bold:!0,children:`Status: `}),e.client.type===`disabled`?(0,V.jsxs)(f,{children:[v(`inactive`,c)(a.radioOff),` disabled`]}):e.client.type===`connected`?(0,V.jsxs)(f,{children:[v(`success`,c)(a.tick),` connected`]}):e.client.type===`pending`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(f,{dimColor:!0,children:a.radioOff}),(0,V.jsx)(f,{children:` connecting…`})]}):e.client.type===`needs-auth`?(0,V.jsxs)(f,{children:[v(`warning`,c)(a.triangleUpOutline),` needs authentication`]}):(0,V.jsxs)(f,{children:[v(`error`,c)(a.cross),` failed`]})]}),e.transport!==`claudeai-proxy`&&(0,V.jsxs)(u,{children:[(0,V.jsx)(f,{bold:!0,children:`Auth: `}),be?(0,V.jsxs)(f,{children:[v(`success`,c)(a.tick),` authenticated`]}):(0,V.jsxs)(f,{children:[v(`error`,c)(a.cross),` not authenticated`]})]}),(0,V.jsxs)(u,{children:[(0,V.jsx)(f,{bold:!0,children:`URL: `}),(0,V.jsx)(f,{dimColor:!0,children:e.config.url})]}),(0,V.jsxs)(u,{children:[(0,V.jsx)(f,{bold:!0,children:`Config location: `}),(0,V.jsx)(f,{dimColor:!0,children:z(e.scope)})]}),e.client.type===`connected`&&(0,V.jsx)(Dn,{serverToolsCount:t,serverPromptsCount:De,serverResourcesCount:te.resources[e.name]?.length||0}),e.client.type===`connected`&&t>0&&(0,V.jsxs)(u,{children:[(0,V.jsx)(f,{bold:!0,children:`Tools: `}),(0,V.jsxs)(f,{dimColor:!0,children:[t,` tools`]})]})]}),S&&(0,V.jsx)(u,{marginTop:1,children:(0,V.jsxs)(f,{color:`error`,children:[`Error: `,S]})}),Ie.length>0&&(0,V.jsx)(u,{marginTop:1,children:(0,V.jsx)(ue,{options:Ie,onChange:async t=>{switch(t){case`tools`:n();break;case`auth`:case`reauth`:await Pe();break;case`clear-auth`:await Fe();break;case`claudeai-auth`:await ke();break;case`claudeai-clear-auth`:je();break;case`reconnectMcpServer`:O(!0);try{let t=await xe(e.name);e.config.type===`claudeai-proxy`&&Pt(`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`&&Pt(`tengu_claudeai_mcp_reconnect`,{success:!1}),i?.(jn(t,e.name))}finally{O(!1)}break;case`toggle-enabled`:await Ne();break;case`back`:r();break}},onCancel:r})})]}),(0,V.jsx)(u,{marginTop:1,children:(0,V.jsx)(f,{dimColor:!0,italic:!0,children:m.pending?(0,V.jsxs)(V.Fragment,{children:[`Press `,m.keyName,` again to exit`]}):(0,V.jsxs)(p,{children:[(0,V.jsx)(o,{shortcut:`↑↓`,action:`navigate`}),(0,V.jsx)(o,{shortcut:`Enter`,action:`select`}),(0,V.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}var B,V,Pn=e((()=>{i(),B=t(g(),1),Nt(),Rt(),yn(),he(),C(),Jt(),Je(),Se(),gn(),ce(),Le(),Ut(),Xt(),pt(),jt(),Vt(),P(),le(),Qe(),tt(),kn(),Mn(),V=T()}));function Fn({server:e,serverToolsCount:t,onViewTools:n,onCancel:r,onComplete:i,borderless:s=!1}){let[c]=l(),d=vn(),ee=nt(e=>e.mcp),m=_n(),h=hn(),[g,_]=(0,In.useState)(!1),y=In.useCallback(async()=>{let t=e.client.type!==`disabled`;try{await h(e.name),r()}catch(n){i(`Failed to ${t?`disable`:`enable`} MCP server '${e.name}': ${gt(n)}`)}},[e.client.type,e.name,h,r,i]),b=Bt(String(e.name)),x=fe(ee.commands,e.name).length,S=[];return e.client.type!==`disabled`&&t>0&&S.push({label:`View tools`,value:`tools`}),e.client.type!==`disabled`&&S.push({label:`Reconnect`,value:`reconnectMcpServer`}),S.push({label:e.client.type===`disabled`?`Enable`:`Disable`,value:`toggle-enabled`}),S.length===0&&S.push({label:`Back`,value:`back`}),g?(0,H.jsxs)(u,{flexDirection:`column`,gap:1,padding:1,children:[(0,H.jsxs)(f,{color:`text`,children:[`Reconnecting to `,(0,H.jsx)(f,{bold:!0,children:e.name})]}),(0,H.jsxs)(u,{children:[(0,H.jsx)(E,{}),(0,H.jsx)(f,{children:` Restarting MCP server process`})]}),(0,H.jsx)(f,{dimColor:!0,children:`This may take a few moments.`})]}):(0,H.jsxs)(u,{flexDirection:`column`,children:[(0,H.jsxs)(u,{flexDirection:`column`,paddingX:1,borderStyle:s?void 0:`round`,children:[(0,H.jsx)(u,{marginBottom:1,children:(0,H.jsxs)(f,{bold:!0,children:[b,` MCP Server`]})}),(0,H.jsxs)(u,{flexDirection:`column`,gap:0,children:[(0,H.jsxs)(u,{children:[(0,H.jsx)(f,{bold:!0,children:`Status: `}),e.client.type===`disabled`?(0,H.jsxs)(f,{children:[v(`inactive`,c)(a.radioOff),` disabled`]}):e.client.type===`connected`?(0,H.jsxs)(f,{children:[v(`success`,c)(a.tick),` connected`]}):e.client.type===`pending`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(f,{dimColor:!0,children:a.radioOff}),(0,H.jsx)(f,{children:` connecting…`})]}):(0,H.jsxs)(f,{children:[v(`error`,c)(a.cross),` failed`]})]}),(0,H.jsxs)(u,{children:[(0,H.jsx)(f,{bold:!0,children:`Command: `}),(0,H.jsx)(f,{dimColor:!0,children:e.config.command})]}),e.config.args&&e.config.args.length>0&&(0,H.jsxs)(u,{children:[(0,H.jsx)(f,{bold:!0,children:`Args: `}),(0,H.jsx)(f,{dimColor:!0,children:e.config.args.join(` `)})]}),(0,H.jsxs)(u,{children:[(0,H.jsx)(f,{bold:!0,children:`Config location: `}),(0,H.jsx)(f,{dimColor:!0,children:z(ae(e.name)?.scope??`dynamic`)})]}),e.client.type===`connected`&&(0,H.jsx)(Dn,{serverToolsCount:t,serverPromptsCount:x,serverResourcesCount:ee.resources[e.name]?.length||0}),e.client.type===`connected`&&t>0&&(0,H.jsxs)(u,{children:[(0,H.jsx)(f,{bold:!0,children:`Tools: `}),(0,H.jsxs)(f,{dimColor:!0,children:[t,` tools`]})]})]}),S.length>0&&(0,H.jsx)(u,{marginTop:1,children:(0,H.jsx)(ue,{options:S,onChange:async t=>{if(t===`tools`)n();else if(t===`reconnectMcpServer`){_(!0);try{let{message:t}=An(await m(e.name),e.name);i?.(t)}catch(t){i?.(jn(t,e.name))}finally{_(!1)}}else t===`toggle-enabled`?await y():t===`back`&&r()},onCancel:r})})]}),(0,H.jsx)(u,{marginTop:1,children:(0,H.jsx)(f,{dimColor:!0,italic:!0,children:d.pending?(0,H.jsxs)(H.Fragment,{children:[`Press `,d.keyName,` again to exit`]}):(0,H.jsxs)(p,{children:[(0,H.jsx)(o,{shortcut:`↑↓`,action:`navigate`}),(0,H.jsx)(o,{shortcut:`Enter`,action:`select`}),(0,H.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}var In,H,Ln=e((()=>{i(),In=t(g(),1),yn(),C(),M(),gn(),ce(),Le(),pt(),Vt(),P(),le(),Qe(),kn(),Mn(),H=T()}));function Rn({tool:e,server:t,onBack:n}){let[r,i]=zn.useState(``),a=bt(e.name,t.name),o=Et(e.userFacingName?e.userFacingName({}):a),s=e.isReadOnly?.({})??!1,c=e.isDestructive?.({})??!1,l=e.isOpenWorld?.({})??!1;return zn.useEffect(()=>{async function t(){try{let t=await e.description({},{isNonInteractiveSession:!1,toolPermissionContext:{mode:`default`,additionalWorkingDirectories:new Map,alwaysAllowRules:{},alwaysDenyRules:{},alwaysAskRules:{},isBypassPermissionsModeAvailable:!1},tools:[]});i(t)}catch{i(`Failed to load description`)}}t()},[e]),(0,U.jsx)(w,{title:(0,U.jsxs)(U.Fragment,{children:[o,s&&(0,U.jsx)(f,{color:`success`,children:` [read-only]`}),c&&(0,U.jsx)(f,{color:`error`,children:` [destructive]`}),l&&(0,U.jsx)(f,{dimColor:!0,children:` [open-world]`})]}),subtitle:t.name,onCancel:n,inputGuide:e=>e.pending?(0,U.jsxs)(f,{children:[`Press `,e.keyName,` again to exit`]}):(0,U.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`}),children:(0,U.jsxs)(u,{flexDirection:`column`,children:[(0,U.jsxs)(u,{children:[(0,U.jsx)(f,{bold:!0,children:`Tool name: `}),(0,U.jsx)(f,{dimColor:!0,children:a})]}),(0,U.jsxs)(u,{children:[(0,U.jsx)(f,{bold:!0,children:`Full name: `}),(0,U.jsx)(f,{dimColor:!0,children:e.name})]}),r&&(0,U.jsxs)(u,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(f,{bold:!0,children:`Description:`}),(0,U.jsx)(f,{wrap:`wrap`,children:r})]}),e.inputJSONSchema&&e.inputJSONSchema.properties&&Object.keys(e.inputJSONSchema.properties).length>0&&(0,U.jsxs)(u,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(f,{bold:!0,children:`Parameters:`}),(0,U.jsx)(u,{marginLeft:2,flexDirection:`column`,children:Object.entries(e.inputJSONSchema.properties).map(([t,n])=>{let r=(e.inputJSONSchema?.required)?.includes(t);return(0,U.jsxs)(f,{children:[`• `,t,r&&(0,U.jsx)(f,{dimColor:!0,children:` (required)`}),`:`,` `,(0,U.jsx)(f,{dimColor:!0,children:typeof n==`object`&&n&&`type`in n?String(n.type):`unknown`}),typeof n==`object`&&n&&`description`in n&&(0,U.jsxs)(f,{dimColor:!0,children:[` - `,String(n.description)]})]},t)})})]})]})})}var zn,U,Bn=e((()=>{zn=t(g(),1),C(),St(),P(),U=T()}));function Vn({server:e,onSelectTool:t,onBack:n}){let r=nt(e=>e.mcp.tools),i=Hn.useMemo(()=>e.client.type===`connected`?Fe(r,e.name):[],[e,r]),a=i.map((t,n)=>{let r=bt(t.name,e.name),i=Et(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)(w,{title:`Tools for ${e.name}`,subtitle:`${i.length} ${zt(i.length,`tool`)}`,onCancel:n,inputGuide:e=>e.pending?(0,Un.jsxs)(f,{children:[`Press `,e.keyName,` again to exit`]}):(0,Un.jsxs)(p,{children:[(0,Un.jsx)(o,{shortcut:`↑↓`,action:`navigate`}),(0,Un.jsx)(o,{shortcut:`Enter`,action:`select`}),(0,Un.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]}),children:i.length===0?(0,Un.jsx)(f,{dimColor:!0,children:`No tools available`}):(0,Un.jsx)(ue,{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(g(),1),C(),St(),ce(),Le(),Vt(),P(),le(),Un=T()}));function Gn({inputValue:e,setInputValue:t,cursorOffset:n,setCursorOffset:r,error:i,setError:a,result:s,setResult:c,setViewState:l,onAddComplete:d,cliMode:ee=!1}){let m=(0,Kn.useRef)(!1),[h,g]=(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 cn(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{g(!0),v(``);let{name:e,resolvedSource:t}=await ie(n,e=>{v(e)});ve(e,{source:t}),Re();let r=n.source;n.source===`github`&&(r=n.repo),Pt(`tengu_marketplace_added`,{source_type:r}),d&&await d(),v(``),g(!1),ee?c(`Successfully added marketplace: ${e}`):l({type:`browse-marketplace`,targetMarketplace:e})}catch(e){let t=ft(e);Mt(t),a(t.message),v(``),g(!1),c(ee?`Error: ${t.message}`:null)}};return(0,Kn.useEffect)(()=>{e&&!m.current&&!i&&!s&&(m.current=!0,y())},[]),(0,W.jsxs)(u,{flexDirection:`column`,children:[(0,W.jsxs)(u,{flexDirection:`column`,paddingX:1,borderStyle:`round`,children:[(0,W.jsx)(u,{marginBottom:1,children:(0,W.jsx)(f,{bold:!0,children:`Add Marketplace`})}),(0,W.jsxs)(u,{flexDirection:`column`,children:[(0,W.jsx)(f,{children:`Enter marketplace source:`}),(0,W.jsx)(f,{dimColor:!0,children:`Examples:`}),(0,W.jsx)(f,{dimColor:!0,children:` · owner/repo (GitHub)`}),(0,W.jsx)(f,{dimColor:!0,children:` · git@github.com:owner/repo.git (SSH)`}),(0,W.jsx)(f,{dimColor:!0,children:` · https://example.com/marketplace.json`}),(0,W.jsx)(f,{dimColor:!0,children:` · ./path/to/marketplace`}),(0,W.jsx)(u,{marginTop:1,children:(0,W.jsx)(Te,{value:e,onChange:t,onSubmit:y,columns:80,cursorOffset:n,onChangeCursorOffset:r,focus:!0,showCursor:!0})})]}),h&&(0,W.jsxs)(u,{marginTop:1,children:[(0,W.jsx)(E,{}),(0,W.jsx)(f,{children:_||`Adding marketplace to configuration…`})]}),i&&(0,W.jsx)(u,{marginTop:1,children:(0,W.jsx)(f,{color:`error`,children:i})}),s&&(0,W.jsx)(u,{marginTop:1,children:(0,W.jsx)(f,{children:s})})]}),(0,W.jsx)(u,{marginLeft:3,children:(0,W.jsx)(f,{dimColor:!0,italic:!0,children:(0,W.jsxs)(p,{children:[(0,W.jsx)(o,{shortcut:`Enter`,action:`add`}),(0,W.jsx)(L,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})})]})}var Kn,W,qn=e((()=>{g(),Kn=t(g(),1),Nt(),P(),C(),Qe(),tt(),pt(),jt(),rt(),ge(),un(),W=T()}));function Jn(e,t,r,i){let a={};for(let o of e){let e=r[o],s=t[o]??``;if(!(e?.sensitive===!0&&s===``&&i?.[o]!==void 0))if(e?.type===`number`){if(s.trim()===``)continue;let e=Number(s);a[o]=Number.isNaN(e)?s:e}else e?.type===`boolean`?a[o]=n(s):a[o]=s}return a}function Yn({title:e,subtitle:t,configSchema:n,initialValues:r,onSave:i,onCancel:o}){let l=Object.keys(n),d=(0,Xn.useCallback)(e=>{if(n[e]?.sensitive===!0)return``;let t=r?.[e];return t===void 0?``:String(t)},[n,r]),[p,m]=(0,Xn.useState)(0),[h,g]=(0,Xn.useState)({}),[v,y]=(0,Xn.useState)(()=>l[0]?d(l[0]):``),b=l[p],x=b?n[b]:null;if(ee(`confirm:no`,o,{context:`Settings`}),c({"confirm:nextField":(0,Xn.useCallback)(()=>{if(p<l.length-1&&b){g(e=>({...e,[b]:v})),m(e=>e+1);let e=l[p+1];y(e?d(e):``)}},[p,l,b,v,d]),"confirm:yes":(0,Xn.useCallback)(()=>{if(!b)return;let e={...h,[b]:v};if(p===l.length-1)i(Jn(l,e,n,r));else{g(e),m(e=>e+1);let t=l[p+1];y(t?d(t):``)}},[b,h,v,p,l,n,i,d,r])},{context:`Confirmation`}),_((e,t)=>{if(t.backspace||t.delete){y(e=>e.slice(0,-1));return}e&&!t.ctrl&&!t.meta&&!t.tab&&!t.return&&y(t=>t+e)}),!x||!b)return null;let S=x.sensitive===!0,C=x.required===!0,te=S?`*`.repeat(s(v)):v;return(0,Zn.jsxs)(w,{title:e,subtitle:t,onCancel:o,isCancelActive:!1,children:[(0,Zn.jsxs)(u,{flexDirection:`column`,children:[(0,Zn.jsxs)(f,{bold:!0,children:[x.title||b,C&&(0,Zn.jsx)(f,{color:`error`,children:` *`})]}),x.description&&(0,Zn.jsx)(f,{dimColor:!0,children:x.description}),(0,Zn.jsxs)(u,{marginTop:1,children:[(0,Zn.jsxs)(f,{children:[a.pointerSmall,` `]}),(0,Zn.jsx)(f,{children:te}),(0,Zn.jsx)(f,{children:`█`})]})]}),(0,Zn.jsxs)(u,{flexDirection:`column`,children:[(0,Zn.jsxs)(f,{dimColor:!0,children:[`Field `,p+1,` of `,l.length]}),p<l.length-1&&(0,Zn.jsx)(f,{dimColor:!0,children:`Tab: Next field · Enter: Save and continue`}),p===l.length-1&&(0,Zn.jsx)(f,{dimColor:!0,children:`Enter: Save configuration`})]})]})}var Xn,Zn,Qn=e((()=>{i(),Xn=t(g(),1),C(),Jt(),r(),Zn=T()}));async function $n(e){let{enabled:t,disabled:n}=await Ge();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=be(e);Object.keys(r).length>0&&n.push({key:`top-level`,title:`Configure ${e.name}`,subtitle:`Plugin options`,schema:r,load:()=>Ze(t),save:n=>xe(t,n,e.manifest.userConfig)});let i=et(e);for(let r of i)n.push({key:`channel:${r.server}`,title:`Configure ${r.displayName}`,subtitle:`Plugin: ${e.name}`,schema:r.configSchema,load:()=>Ce(t,r.server)??void 0,save:e=>Ke(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`,gt(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(g(),1),pt(),ze(),Ve(),De(),We(),Qn(),nr=T()}));function ir(){let e=je();return(0,ar.jsxs)(u,{marginBottom:1,children:[(0,ar.jsxs)(f,{color:`claude`,children:[a.warning,` `]}),(0,ar.jsxs)(f,{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(),g(),C(),ye(),ar=T()}));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)(u,{marginTop:1,children:(0,ur.jsx)(f,{dimColor:!0,italic:!0,children:(0,ur.jsxs)(p,{children:[e&&(0,ur.jsx)(L,{action:`plugin:install`,context:`Plugin`,fallback:`i`,description:`install`,bold:!0}),(0,ur.jsx)(L,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,ur.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,ur.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})}var ur,dr=e((()=>{g(),P(),C(),ur=T()}));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)(()=>{},[]),ee=(0,pr.useCallback)((t,n)=>{n(Math.max(0,Math.min(t,e-1)))},[e]),m=(0,pr.useCallback)((e,t)=>!1,[]),h=Math.max(1,Math.ceil(e/t));return{currentPage:Math.floor(a/t),totalPages:h,startIndex:o,endIndex:s,needsPagination:r,pageSize:t,getVisibleItems:c,toActualIndex:l,isOnCurrentPage:u,goToPage:d,nextPage:f,prevPage:p,handleSelectionChange:ee,handlePageNavigation:m,scrollPosition:{current:n+1,total:e,canScrollUp:a>0,canScrollDown:a+t<e}}}var pr,mr,hr=e((()=>{pr=t(g(),1),mr=5}));function gr({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:o,targetMarketplace:s,targetPlugin:l}){let[d,m]=(0,vr.useState)(`marketplace-list`),[h,g]=(0,vr.useState)(null),[_,v]=(0,vr.useState)(null),[y,b]=(0,vr.useState)([]),[x,S]=(0,vr.useState)([]),[C,te]=(0,vr.useState)(!0),[w,T]=(0,vr.useState)(null),[E,D]=(0,vr.useState)(0),[k,A]=(0,vr.useState)(new Set),[re,j]=(0,vr.useState)(new Set),ie=fr({totalItems:x.length,selectedIndex:E}),[M,N]=(0,vr.useState)(0),[ae,P]=(0,vr.useState)(!1),[se,ce]=(0,vr.useState)(null),[le,F]=(0,vr.useState)(null);ee(`confirm:no`,_r.useCallback(()=>{d===`plugin-list`?s?i({type:`manage-marketplaces`,targetMarketplace:s}):y.length===1?i({type:`menu`}):(m(`marketplace-list`),g(null),A(new Set)):d===`plugin-details`?(m(`plugin-list`),v(null)):i({type:`menu`})},[d,s,i,y.length]),{context:`Confirmation`}),(0,vr.useEffect)(()=>{async function e(){try{let e=await oe(),{marketplaces:n,failures:r}=await Xe(e),i=[];for(let{name:e,config:t,data:r}of n)if(r){let n=Tt(r.plugins,t=>O(ne(t.name,e)));i.push({name:e,totalPlugins:r.plugins.length,installedCount:n,source:Ye(t.source)})}i.sort((e,t)=>e.name===`claude-plugin-directory`?-1:+(t.name===`claude-plugin-directory`)),b(i);let a=Be(r,Tt(n,e=>e.data!==null));if(a)if(a.type===`warning`)F(a.message+`. Showing available marketplaces.`);else throw Error(a.message);if(i.length===1&&!s&&!l){let e=i[0];e&&(g(e.name),m(`plugin-list`))}if(l){let n=null,r=null;for(let[t]of Object.entries(e)){let e=await I(t);if(e){let i=e.plugins.find(e=>e.name===l);if(i){let e=ne(i.name,t);n={entry:i,marketplaceName:t,pluginId:e,isInstalled:Ie(e)},r=t;break}}}if(n&&r){let e=n.pluginId;Ie(e)?t(`Plugin '${e}' is already installed globally. Use '/plugin' to manage existing plugins.`):(g(r),v(n),m(`plugin-details`))}else t(`Plugin "${l}" not found in any marketplace`)}else s&&(i.some(e=>e.name===s)?(g(s),m(`plugin-list`)):t(`Marketplace "${s}" not found`))}catch(e){t(e instanceof Error?e.message:`Failed to load marketplaces`)}finally{te(!1)}}e()},[t,s,l]),(0,vr.useEffect)(()=>{if(!h)return;let e=!1;async function n(n){te(!0);try{let t=await I(n);if(e)return;if(!t)throw Error(`Failed to load marketplace: ${n}`);let r=[];for(let e of t.plugins){let t=ne(e.name,n);Ue(t)||r.push({entry:e,marketplaceName:n,pluginId:t,isInstalled:Ie(t)})}try{let t=await pn();if(e)return;T(t),t?r.sort((e,n)=>{let r=t.get(e.pluginId)??0,i=t.get(n.pluginId)??0;return r===i?e.entry.name.localeCompare(n.entry.name):i-r}):r.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}catch(t){if(e)return;ht(`Failed to fetch install counts: ${gt(t)}`),r.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}S(r),D(0),A(new Set)}catch(n){if(e)return;t(n instanceof Error?n.message:`Failed to load plugins`)}finally{te(!1)}}return n(h),()=>{e=!0}},[h,t]);let ue=async()=>{if(k.size===0)return;let e=x.filter(e=>k.has(e.pluginId));j(new Set(e.map(e=>e.pluginId)));let n=0,a=0,s=[];for(let t of e){let e=await lt({pluginId:t.pluginId,entry:t.entry,marketplaceName:t.marketplaceName,scope:`user`});e.success?n++:(a++,s.push({name:t.entry.name,reason:e.error}))}j(new Set),A(new Set),Re(),a===0?r(`✓ Installed ${n} ${zt(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${$e(s,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${$e(s,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&o&&await o(),i({type:`menu`})},de=async(e,t=`user`)=>{P(!0),ce(null);let n=await lt({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await $n(e.pluginId);if(t){P(!1),m({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),o&&await o(),i({type:`menu`})}else P(!1),ce(n.error)};(0,vr.useEffect)(()=>{e&&r(e)},[e,r]),c({"select:previous":()=>{E>0&&D(E-1)},"select:next":()=>{E<y.length-1&&D(E+1)},"select:accept":()=>{let e=y[E];e&&(g(e.name),m(`plugin-list`))}},{context:`Select`,isActive:d===`marketplace-list`}),c({"select:previous":()=>{E>0&&ie.handleSelectionChange(E-1,D)},"select:next":()=>{E<x.length-1&&ie.handleSelectionChange(E+1,D)},"select:accept":()=>{if(E===x.length&&k.size>0)ue();else if(E<x.length){let e=x[E];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(v(e),m(`plugin-details`),N(0),ce(null)))}}},{context:`Select`,isActive:d===`plugin-list`}),c({"plugin:toggle":()=>{if(E<x.length){let e=x[E];if(e&&!e.isInstalled){let t=new Set(k);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),A(t)}}},"plugin:install":()=>{k.size>0&&ue()}},{context:`Plugin`,isActive:d===`plugin-list`});let fe=_r.useMemo(()=>{if(!_)return[];let e=_.entry.homepage;return cr(e,sr(_))},[_]);if(c({"select:previous":()=>{M>0&&N(M-1)},"select:next":()=>{M<fe.length-1&&N(M+1)},"select:accept":()=>{if(!_)return;let e=fe[M]?.action,t=_.entry.homepage,n=sr(_);e===`install-user`?de(_,`user`):e===`install-project`?de(_,`project`):e===`install-local`?de(_,`local`):e===`homepage`&&t?Yt(t):e===`github`&&n?Yt(`https://github.com/${n}`):e===`back`&&(m(`plugin-list`),v(null))}},{context:`Select`,isActive:d===`plugin-details`&&!!_}),typeof d==`object`&&d.type===`plugin-options`){let{plugin:e,pluginId:t}=d;function n(e){r(e),o&&o(),i({type:`menu`})}return(0,G.jsx)(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(C)return(0,G.jsx)(f,{children:`Loading…`});if(e)return(0,G.jsx)(f,{color:`error`,children:e});if(d===`marketplace-list`)return y.length===0?(0,G.jsxs)(u,{flexDirection:`column`,children:[(0,G.jsx)(u,{marginBottom:1,children:(0,G.jsx)(f,{bold:!0,children:`Select marketplace`})}),(0,G.jsx)(f,{children:`No marketplaces configured.`}),(0,G.jsxs)(f,{dimColor:!0,children:[`Add a marketplace first using `,`'Add marketplace'`,`.`]}),(0,G.jsx)(u,{marginTop:1,paddingLeft:1,children:(0,G.jsx)(f,{dimColor:!0,children:(0,G.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})})})]}):(0,G.jsxs)(u,{flexDirection:`column`,children:[(0,G.jsx)(u,{marginBottom:1,children:(0,G.jsx)(f,{bold:!0,children:`Select marketplace`})}),le&&(0,G.jsx)(u,{marginBottom:1,flexDirection:`column`,children:(0,G.jsxs)(f,{color:`warning`,children:[a.warning,` `,le]})}),y.map((e,t)=>(0,G.jsxs)(u,{flexDirection:`column`,marginBottom:+(t<y.length-1),children:[(0,G.jsx)(u,{children:(0,G.jsxs)(f,{color:E===t?`suggestion`:void 0,children:[E===t?a.pointer:` `,` `,e.name]})}),(0,G.jsx)(u,{marginLeft:2,children:(0,G.jsxs)(f,{dimColor:!0,children:[e.totalPlugins,` `,zt(e.totalPlugins,`plugin`),` available`,e.installedCount>0&&` · ${e.installedCount} already installed`,e.source&&` · ${e.source}`]})})]},e.name)),(0,G.jsx)(u,{marginTop:1,children:(0,G.jsx)(f,{dimColor:!0,italic:!0,children:(0,G.jsxs)(p,{children:[(0,G.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,G.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]});if(d===`plugin-details`&&_){let e=_.entry.homepage,t=cr(e,sr(_));return(0,G.jsxs)(u,{flexDirection:`column`,children:[(0,G.jsx)(u,{marginBottom:1,children:(0,G.jsx)(f,{bold:!0,children:`Plugin Details`})}),(0,G.jsxs)(u,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(f,{bold:!0,children:_.entry.name}),_.entry.version&&(0,G.jsxs)(f,{dimColor:!0,children:[`Version: `,_.entry.version]}),_.entry.description&&(0,G.jsx)(u,{marginTop:1,children:(0,G.jsx)(f,{children:_.entry.description})}),_.entry.author&&(0,G.jsx)(u,{marginTop:1,children:(0,G.jsxs)(f,{dimColor:!0,children:[`By:`,` `,typeof _.entry.author==`string`?_.entry.author:_.entry.author.name]})})]}),(0,G.jsxs)(u,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(f,{bold:!0,children:`Will install:`}),_.entry.commands&&(0,G.jsxs)(f,{dimColor:!0,children:[`· Commands:`,` `,Array.isArray(_.entry.commands)?_.entry.commands.join(`, `):Object.keys(_.entry.commands).join(`, `)]}),_.entry.agents&&(0,G.jsxs)(f,{dimColor:!0,children:[`· Agents:`,` `,Array.isArray(_.entry.agents)?_.entry.agents.join(`, `):Object.keys(_.entry.agents).join(`, `)]}),_.entry.hooks&&(0,G.jsxs)(f,{dimColor:!0,children:[`· Hooks: `,Object.keys(_.entry.hooks).join(`, `)]}),_.entry.mcpServers&&(0,G.jsxs)(f,{dimColor:!0,children:[`· MCP Servers:`,` `,Array.isArray(_.entry.mcpServers)?_.entry.mcpServers.join(`, `):typeof _.entry.mcpServers==`object`?Object.keys(_.entry.mcpServers).join(`, `):`configured`]}),!_.entry.commands&&!_.entry.agents&&!_.entry.hooks&&!_.entry.mcpServers&&(0,G.jsx)(G.Fragment,{children:typeof _.entry.source==`object`&&`source`in _.entry.source&&(_.entry.source.source===`github`||_.entry.source.source===`url`||_.entry.source.source===`npm`||_.entry.source.source===`pip`)?(0,G.jsx)(f,{dimColor:!0,children:`· Component summary not available for remote plugin`}):(0,G.jsx)(f,{dimColor:!0,children:`· Components will be discovered at installation`})})]}),(0,G.jsx)(ir,{}),se&&(0,G.jsx)(u,{marginBottom:1,children:(0,G.jsxs)(f,{color:`error`,children:[`Error: `,se]})}),(0,G.jsx)(u,{flexDirection:`column`,children:t.map((e,t)=>(0,G.jsxs)(u,{children:[M===t&&(0,G.jsx)(f,{children:`> `}),M!==t&&(0,G.jsx)(f,{children:` `}),(0,G.jsx)(f,{bold:M===t,children:ae&&e.action===`install`?`Installing…`:e.label})]},e.action))}),(0,G.jsx)(u,{marginTop:1,paddingLeft:1,children:(0,G.jsx)(f,{dimColor:!0,children:(0,G.jsxs)(p,{children:[(0,G.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,G.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(x.length===0)return(0,G.jsxs)(u,{flexDirection:`column`,children:[(0,G.jsx)(u,{marginBottom:1,children:(0,G.jsx)(f,{bold:!0,children:`Install plugins`})}),(0,G.jsx)(f,{dimColor:!0,children:`No new plugins available to install.`}),(0,G.jsx)(f,{dimColor:!0,children:`All plugins from this marketplace are already installed.`}),(0,G.jsx)(u,{marginLeft:3,children:(0,G.jsx)(f,{dimColor:!0,italic:!0,children:(0,G.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})})})]});let pe=ie.getVisibleItems(x);return(0,G.jsxs)(u,{flexDirection:`column`,children:[(0,G.jsx)(u,{marginBottom:1,children:(0,G.jsx)(f,{bold:!0,children:`Install Plugins`})}),ie.scrollPosition.canScrollUp&&(0,G.jsx)(u,{children:(0,G.jsxs)(f,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),pe.map((t,n)=>{let r=ie.toActualIndex(n),i=E===r,o=k.has(t.pluginId),s=re.has(t.pluginId);return(0,G.jsxs)(u,{flexDirection:`column`,marginBottom:n===pe.length-1&&!e?0:1,children:[(0,G.jsxs)(u,{children:[(0,G.jsxs)(f,{color:i?`suggestion`:void 0,children:[i?a.pointer:` `,` `]}),(0,G.jsxs)(f,{color:t.isInstalled?`success`:void 0,children:[t.isInstalled?a.tick:s?a.ellipsis:o?a.radioOn:a.radioOff,` `,t.entry.name,t.entry.category&&(0,G.jsxs)(f,{dimColor:!0,children:[` [`,t.entry.category,`]`]}),t.entry.tags?.includes(`community-managed`)&&(0,G.jsx)(f,{dimColor:!0,children:` [Community Managed]`}),t.isInstalled&&(0,G.jsx)(f,{dimColor:!0,children:` (installed)`}),w&&h===`claude-plugins-official`&&(0,G.jsxs)(f,{dimColor:!0,children:[` · `,fn(w.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,G.jsxs)(u,{marginLeft:4,children:[(0,G.jsx)(f,{dimColor:!0,children:Ft(t.entry.description,60)}),t.entry.version&&(0,G.jsxs)(f,{dimColor:!0,children:[` · v`,t.entry.version]})]})]},t.pluginId)}),ie.scrollPosition.canScrollDown&&(0,G.jsx)(u,{children:(0,G.jsxs)(f,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,G.jsx)(u,{marginTop:1,children:(0,G.jsxs)(f,{color:`error`,children:[a.cross,` `,e]})}),(0,G.jsx)(lr,{hasSelection:k.size>0})]})}var _r,vr,G,yr=e((()=>{i(),_r=t(g(),1),vr=t(g(),1),P(),C(),Jt(),yt(),Xt(),mt(),pt(),rt(),ln(),j(),ye(),ge(),ke(),at(),R(),Vt(),It(),rr(),or(),dr(),hr(),G=T()}));function br({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:o,onSearchModeChange:s,targetPlugin:l}){let[d,h]=(0,K.useState)(`plugin-list`),[g,v]=(0,K.useState)(null),[b,S]=(0,K.useState)([]),[C,te]=(0,K.useState)(!0),[w,T]=(0,K.useState)(null),[E,D]=(0,K.useState)(!1),O=(0,K.useCallback)(e=>{D(e),s?.(e)},[s]),{query:k,setQuery:A,cursorOffset:re}=xn({isActive:d===`plugin-list`&&E&&!C,onExit:()=>{O(!1)}}),j=m(),{columns:ie}=x(),M=(0,K.useMemo)(()=>{if(!k)return b;let e=k.toLowerCase();return b.filter(t=>t.entry.name.toLowerCase().includes(e)||t.entry.description?.toLowerCase().includes(e)||t.marketplaceName.toLowerCase().includes(e))},[b,k]),[N,ae]=(0,K.useState)(0),[P,se]=(0,K.useState)(new Set),[ce,le]=(0,K.useState)(new Set),F=fr({totalItems:M.length,selectedIndex:N});(0,K.useEffect)(()=>{ae(0)},[k]);let[ue,de]=(0,K.useState)(0),[fe,pe]=(0,K.useState)(!1),[I,me]=(0,K.useState)(null),[he,ge]=(0,K.useState)(null),[_e,ve]=(0,K.useState)(null);(0,K.useEffect)(()=>{async function e(){try{let e=await oe(),{marketplaces:n,failures:r}=await Xe(e),i=[];for(let{name:e,data:t}of n)if(t)for(let n of t.plugins){let t=ne(n.name,e);i.push({entry:n,marketplaceName:e,pluginId:t,isInstalled:Ie(t)})}let a=i.filter(e=>!e.isInstalled&&!Ue(e.pluginId));try{let e=await pn();T(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){ht(`Failed to fetch install counts: ${gt(e)}`),a.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}S(a);let o=Object.keys(e).length;if(a.length===0){let e=await we({configuredMarketplaceCount:o,failedMarketplaceCount:r.length});ve(e)}let s=Be(r,Tt(n,e=>e.data!==null));if(s)if(s.type===`warning`)ge(s.message+`. Showing available plugins.`);else throw Error(s.message);if(l){let e=i.find(e=>e.entry.name===l);e?e.isInstalled?t(`Plugin '${e.pluginId}' is already installed. Use '/plugin' to manage existing plugins.`):(v(e),h(`plugin-details`)):t(`Plugin "${l}" not found in any marketplace`)}}catch(e){t(e instanceof Error?e.message:`Failed to load plugins`)}finally{te(!1)}}e()},[t,l]);let ye=async()=>{if(P.size===0)return;let e=b.filter(e=>P.has(e.pluginId));le(new Set(e.map(e=>e.pluginId)));let n=0,a=0,s=[];for(let t of e){let e=await lt({pluginId:t.pluginId,entry:t.entry,marketplaceName:t.marketplaceName,scope:`user`});e.success?n++:(a++,s.push({name:t.entry.name,reason:e.error}))}le(new Set),se(new Set),Re(),a===0?r(`✓ Installed ${n} ${zt(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${$e(s,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${$e(s,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&o&&await o(),i({type:`menu`})},R=async(e,t=`user`)=>{pe(!0),me(null);let n=await lt({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await $n(e.pluginId);if(t){pe(!1),h({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),o&&await o(),i({type:`menu`})}else pe(!1),me(n.error)};(0,K.useEffect)(()=>{e&&r(e)},[e,r]),ee(`confirm:no`,()=>{h(`plugin-list`),v(null)},{context:`Confirmation`,isActive:d===`plugin-details`}),ee(`confirm:no`,()=>{i({type:`menu`})},{context:`Confirmation`,isActive:d===`plugin-list`&&!E}),_((e,t)=>{let n=!t.ctrl&&!t.meta;E||(e===`/`&&n?(O(!0),A(``)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==`i`&&(O(!0),A(e)))},{isActive:d===`plugin-list`&&!C}),c({"select:previous":()=>{N===0?O(!0):F.handleSelectionChange(N-1,ae)},"select:next":()=>{N<M.length-1&&F.handleSelectionChange(N+1,ae)},"select:accept":()=>{if(N===M.length&&P.size>0)ye();else if(N<M.length){let e=M[N];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(v(e),h(`plugin-details`),de(0),me(null)))}}},{context:`Select`,isActive:d===`plugin-list`&&!E}),c({"plugin:toggle":()=>{if(N<M.length){let e=M[N];if(e&&!e.isInstalled){let t=new Set(P);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),se(t)}}},"plugin:install":()=>{P.size>0&&ye()}},{context:`Plugin`,isActive:d===`plugin-list`&&!E});let be=Cr.useMemo(()=>{if(!g)return[];let e=g.entry.homepage;return cr(e,sr(g))},[g]);if(c({"select:previous":()=>{ue>0&&de(ue-1)},"select:next":()=>{ue<be.length-1&&de(ue+1)},"select:accept":()=>{if(!g)return;let e=be[ue]?.action,t=g.entry.homepage,n=sr(g);e===`install-user`?R(g,`user`):e===`install-project`?R(g,`project`):e===`install-local`?R(g,`local`):e===`homepage`&&t?Yt(t):e===`github`&&n?Yt(`https://github.com/${n}`):e===`back`&&(h(`plugin-list`),v(null))}},{context:`Select`,isActive:d===`plugin-details`&&!!g}),typeof d==`object`&&d.type===`plugin-options`){let{plugin:e,pluginId:t}=d;function n(e){r(e),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(C)return(0,q.jsx)(f,{children:`Loading…`});if(e)return(0,q.jsx)(f,{color:`error`,children:e});if(d===`plugin-details`&&g){let e=g.entry.homepage,t=cr(e,sr(g));return(0,q.jsxs)(u,{flexDirection:`column`,children:[(0,q.jsx)(u,{marginBottom:1,children:(0,q.jsx)(f,{bold:!0,children:`Plugin details`})}),(0,q.jsxs)(u,{flexDirection:`column`,marginBottom:1,children:[(0,q.jsx)(f,{bold:!0,children:g.entry.name}),(0,q.jsxs)(f,{dimColor:!0,children:[`from `,g.marketplaceName]}),g.entry.version&&(0,q.jsxs)(f,{dimColor:!0,children:[`Version: `,g.entry.version]}),g.entry.description&&(0,q.jsx)(u,{marginTop:1,children:(0,q.jsx)(f,{children:g.entry.description})}),g.entry.author&&(0,q.jsx)(u,{marginTop:1,children:(0,q.jsxs)(f,{dimColor:!0,children:[`By:`,` `,typeof g.entry.author==`string`?g.entry.author:g.entry.author.name]})})]}),(0,q.jsx)(ir,{}),I&&(0,q.jsx)(u,{marginBottom:1,children:(0,q.jsxs)(f,{color:`error`,children:[`Error: `,I]})}),(0,q.jsx)(u,{flexDirection:`column`,children:t.map((e,t)=>(0,q.jsxs)(u,{children:[ue===t&&(0,q.jsx)(f,{children:`> `}),ue!==t&&(0,q.jsx)(f,{children:` `}),(0,q.jsx)(f,{bold:ue===t,children:fe&&e.action.startsWith(`install-`)?`Installing…`:e.label})]},e.action))}),(0,q.jsx)(u,{marginTop:1,children:(0,q.jsx)(f,{dimColor:!0,children:(0,q.jsxs)(p,{children:[(0,q.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,q.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(b.length===0)return(0,q.jsxs)(u,{flexDirection:`column`,children:[(0,q.jsx)(u,{marginBottom:1,children:(0,q.jsx)(f,{bold:!0,children:`Discover plugins`})}),(0,q.jsx)(Sr,{reason:_e}),(0,q.jsx)(u,{marginTop:1,children:(0,q.jsx)(f,{dimColor:!0,italic:!0,children:`Esc to go back`})})]});let z=F.getVisibleItems(M);return(0,q.jsxs)(u,{flexDirection:`column`,children:[(0,q.jsxs)(u,{children:[(0,q.jsx)(f,{bold:!0,children:`Discover plugins`}),F.needsPagination&&(0,q.jsxs)(f,{dimColor:!0,children:[` `,`(`,F.scrollPosition.current,`/`,F.scrollPosition.total,`)`]})]}),(0,q.jsx)(u,{marginBottom:1,children:(0,q.jsx)(y,{query:k,isFocused:E,isTerminalFocused:j,width:ie-4,cursorOffset:re})}),he&&(0,q.jsx)(u,{marginBottom:1,children:(0,q.jsxs)(f,{color:`warning`,children:[a.warning,` `,he]})}),M.length===0&&k&&(0,q.jsx)(u,{marginBottom:1,children:(0,q.jsxs)(f,{dimColor:!0,children:[`No plugins match "`,k,`"`]})}),F.scrollPosition.canScrollUp&&(0,q.jsx)(u,{children:(0,q.jsxs)(f,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),z.map((t,n)=>{let r=F.toActualIndex(n),i=N===r,o=P.has(t.pluginId),s=ce.has(t.pluginId);return(0,q.jsxs)(u,{flexDirection:`column`,marginBottom:n===z.length-1&&!e?0:1,children:[(0,q.jsxs)(u,{children:[(0,q.jsxs)(f,{color:i&&!E?`suggestion`:void 0,children:[i&&!E?a.pointer:` `,` `]}),(0,q.jsxs)(f,{children:[s?a.ellipsis:o?a.radioOn:a.radioOff,` `,t.entry.name,(0,q.jsxs)(f,{dimColor:!0,children:[` · `,t.marketplaceName]}),t.entry.tags?.includes(`community-managed`)&&(0,q.jsx)(f,{dimColor:!0,children:` [Community Managed]`}),w&&t.marketplaceName===`claude-plugins-official`&&(0,q.jsxs)(f,{dimColor:!0,children:[` · `,fn(w.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,q.jsx)(u,{marginLeft:4,children:(0,q.jsx)(f,{dimColor:!0,children:Ft(t.entry.description,60)})})]},`${F.startIndex}-${t.pluginId}`)}),F.scrollPosition.canScrollDown&&(0,q.jsx)(u,{children:(0,q.jsxs)(f,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,q.jsx)(u,{marginTop:1,children:(0,q.jsxs)(f,{color:`error`,children:[a.cross,` `,e]})}),(0,q.jsx)(xr,{hasSelection:P.size>0,canToggle:N<M.length&&!M[N]?.isInstalled})]})}function xr({hasSelection:e,canToggle:t}){return(0,q.jsx)(u,{marginTop:1,children:(0,q.jsx)(f,{dimColor:!0,italic:!0,children:(0,q.jsxs)(p,{children:[e&&(0,q.jsx)(L,{action:`plugin:install`,context:`Plugin`,fallback:`i`,description:`install`,bold:!0}),(0,q.jsx)(f,{children:`type to search`}),t&&(0,q.jsx)(L,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,q.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,q.jsx)(L,{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)(f,{dimColor:!0,children:`Git is required to install marketplaces.`}),(0,q.jsx)(f,{dimColor:!0,children:`Please install git and restart Work Mate.`})]});case`all-blocked-by-policy`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(f,{dimColor:!0,children:`Your organization policy does not allow any external marketplaces.`}),(0,q.jsx)(f,{dimColor:!0,children:`Contact your administrator.`})]});case`policy-restricts-sources`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(f,{dimColor:!0,children:`Your organization restricts which marketplaces can be added.`}),(0,q.jsx)(f,{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)(f,{dimColor:!0,children:`Failed to load marketplace data.`}),(0,q.jsx)(f,{dimColor:!0,children:`Check your network connection.`})]});case`all-plugins-installed`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(f,{dimColor:!0,children:`All available plugins are already installed.`}),(0,q.jsx)(f,{dimColor:!0,children:`Check for new plugins later or add more marketplaces.`})]});default:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(f,{dimColor:!0,children:`No plugins available.`}),(0,q.jsx)(f,{dimColor:!0,children:`Add a marketplace first using the Marketplaces tab.`})]})}}var Cr,K,q,wr=e((()=>{i(),Cr=t(g(),1),K=t(g(),1),P(),bn(),C(),Sn(),he(),Jt(),yt(),Xt(),mt(),pt(),rt(),ln(),j(),ye(),ge(),ke(),at(),R(),Vt(),It(),rr(),or(),dr(),hr(),q=T()}));function Tr({setViewState:e,error:t,setError:n,setResult:r,exitState:i,onManageComplete:o,targetMarketplace:s,action:l}){let[d,m]=(0,Dr.useState)([]),[h,g]=(0,Dr.useState)(!0),[v,y]=(0,Dr.useState)(0),[b,x]=(0,Dr.useState)(!1),[S,C]=(0,Dr.useState)(null),[te,w]=(0,Dr.useState)(null),[T,E]=(0,Dr.useState)(null),[D,O]=(0,Dr.useState)(`list`),[k,A]=(0,Dr.useState)(null),[re,j]=(0,Dr.useState)(0),ie=(0,Dr.useRef)(!1);(0,Dr.useEffect)(()=>{async function e(){try{let e=await oe(),{enabled:r,disabled:i}=await Ge(),a=[...r,...i],{marketplaces:o,failures:c}=await Xe(e),u=[];for(let{name:e,config:t,data:n}of o){let r=a.filter(t=>t.source.endsWith(`@${e}`));u.push({name:e,source:Ye(t.source),lastUpdated:t.lastUpdated,pluginCount:n?.plugins.length,installedPlugins:r,pendingUpdate:!1,pendingRemove:!1,autoUpdate:vt(e,t)})}u.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),m(u);let d=Be(c,Tt(o,e=>e.data!==null));if(d)if(d.type===`warning`)C(d.message);else throw Error(d.message);if(s&&!ie.current&&!t){ie.current=!0;let e=u.findIndex(e=>e.name===s);if(e>=0){let t=u[e];if(l){y(e+1);let t=[...u];l===`update`?t[e].pendingUpdate=!0:l===`remove`&&(t[e].pendingRemove=!0),m(t),setTimeout(P,100,t)}else t&&(y(e+1),A(t),O(`details`))}else n&&n(`Marketplace not found: ${s}`)}}catch(e){n&&n(e instanceof Error?e.message:`Failed to load marketplaces`),C(e instanceof Error?e.message:`Failed to load marketplaces`)}finally{g(!1)}}e()},[s,l,t]);let M=()=>d.some(e=>e.pendingUpdate||e.pendingRemove),ae=()=>({updateCount:Tt(d,e=>e.pendingUpdate),removeCount:Tt(d,e=>e.pendingRemove)}),P=async t=>{let i=t||d,s=D===`details`;x(!0),C(null),w(null),E(null);try{let t=xt(`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=ne(t.name,e.name);n[r]=!1}Dt(`userSettings`,{enabledPlugins:n})}await qe(e.name),c++,Pt(`tengu_marketplace_removed`,{marketplace_name:e.name,plugins_uninstalled:e.installedPlugins?.length||0});continue}e.pendingUpdate&&(await N(e.name,e=>{E(e)}),n++,l.add(e.name.toLowerCase()),Pt(`tengu_marketplace_updated`,{marketplace_name:e.name}))}let u=0;l.size>0&&(u=(await Cn(l)).length),Re(),o&&await o();let d=await oe(),{enabled:f,disabled:p}=await Ge(),ee=[...f,...p],{marketplaces:h}=await Xe(d),g=[];for(let{name:e,config:t,data:n}of h){let r=ee.filter(t=>t.source.endsWith(`@${e}`));g.push({name:e,source:Ye(t.source),lastUpdated:t.lastUpdated,pluginCount:n?.plugins.length,installedPlugins:r,pendingUpdate:!1,pendingRemove:!1,autoUpdate:vt(e,t)})}if(g.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),m(g),s&&k){let e=g.find(e=>e.name===k.name);e&&A(e)}let _=[];if(n>0){let e=u>0?` (${u} ${zt(u,`plugin`)} bumped)`:``;_.push(`Updated ${n} ${zt(n,`marketplace`)}${e}`)}if(c>0&&_.push(`Removed ${c} ${zt(c,`marketplace`)}`),_.length>0){let t=`${a.tick} ${_.join(`, `)}`;s?w(t):(r(t),setTimeout(e,2e3,{type:`menu`}))}else s||e({type:`menu`})}catch(e){let t=gt(e);C(t),n&&n(t)}finally{x(!1),E(null)}},se=async()=>{if(!k)return;let e=d.map(e=>e.name===k.name?{...e,pendingRemove:!0}:e);m(e),await P(e)},ce=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 kt()||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 _e(e.name,t),m(n=>n.map(n=>n.name===e.name?{...n,autoUpdate:t}:n)),A(e=>e&&{...e,autoUpdate:t})}catch(e){C(e instanceof Error?e.message:`Failed to update setting`)}};if(ee(`confirm:no`,()=>{O(`list`),j(0)},{context:`Confirmation`,isActive:!b&&(D===`details`||D===`confirm-remove`)}),ee(`confirm:no`,()=>{m(e=>e.map(e=>({...e,pendingUpdate:!1,pendingRemove:!1}))),y(0)},{context:`Confirmation`,isActive:!b&&D===`list`&&M()}),ee(`confirm:no`,()=>{e({type:`menu`})},{context:`Confirmation`,isActive:!b&&D===`list`&&!M()}),c({"select:previous":()=>y(e=>Math.max(0,e-1)),"select:next":()=>{let e=d.length+1;y(t=>Math.min(e-1,t+1))},"select:accept":()=>{let t=v-1;if(v===0)e({type:`add-marketplace`});else if(M())P();else{let e=d[t];e&&(A(e),O(`details`),j(0))}}},{context:`Select`,isActive:!b&&D===`list`}),_(e=>{let t=v-1;if((e===`u`||e===`U`)&&t>=0)m(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=d[t];e&&(A(e),O(`confirm-remove`))}},{isActive:!b&&D===`list`}),c({"select:previous":()=>j(e=>Math.max(0,e-1)),"select:next":()=>{let e=ce(k);j(t=>Math.min(e.length-1,t+1))},"select:accept":()=>{if(!k)return;let t=ce(k)[re];if(t?.value===`browse`)e({type:`browse-marketplace`,targetMarketplace:k.name});else if(t?.value===`update`){let e=d.map(e=>e.name===k.name?{...e,pendingUpdate:!0}:e);m(e),P(e)}else t?.value===`toggle-auto-update`?le(k):t?.value===`remove`&&O(`confirm-remove`)}},{context:`Select`,isActive:!b&&D===`details`}),_(e=>{e===`y`||e===`Y`?se():(e===`n`||e===`N`)&&(O(`list`),A(null))},{isActive:!b&&D===`confirm-remove`}),h)return(0,J.jsx)(f,{children:`Loading marketplaces…`});if(d.length===0)return(0,J.jsxs)(u,{flexDirection:`column`,children:[(0,J.jsx)(u,{marginBottom:1,children:(0,J.jsx)(f,{bold:!0,children:`Manage marketplaces`})}),(0,J.jsxs)(u,{flexDirection:`row`,gap:1,children:[(0,J.jsxs)(f,{color:`suggestion`,children:[a.pointer,` +`]}),(0,J.jsx)(f,{bold:!0,color:`suggestion`,children:`Add Marketplace`})]}),(0,J.jsx)(u,{marginLeft:3,children:(0,J.jsx)(f,{dimColor:!0,italic:!0,children:i.pending?(0,J.jsxs)(J.Fragment,{children:[`Press `,i.keyName,` again to go back`]}):(0,J.jsxs)(p,{children:[(0,J.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,J.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]});if(D===`confirm-remove`&&k){let e=k.installedPlugins?.length||0;return(0,J.jsxs)(u,{flexDirection:`column`,children:[(0,J.jsxs)(f,{bold:!0,color:`warning`,children:[`Remove marketplace `,(0,J.jsx)(f,{italic:!0,children:k.name}),`?`]}),(0,J.jsxs)(u,{flexDirection:`column`,children:[e>0&&(0,J.jsx)(u,{marginTop:1,children:(0,J.jsxs)(f,{color:`warning`,children:[`This will also uninstall `,e,` `,zt(e,`plugin`),` from this marketplace:`]})}),k.installedPlugins&&k.installedPlugins.length>0&&(0,J.jsx)(u,{flexDirection:`column`,marginTop:1,marginLeft:2,children:k.installedPlugins.map(e=>(0,J.jsxs)(f,{dimColor:!0,children:[`• `,e.name]},e.name))}),(0,J.jsx)(u,{marginTop:1,children:(0,J.jsxs)(f,{children:[`Press `,(0,J.jsx)(f,{bold:!0,children:`y`}),` to confirm or `,(0,J.jsx)(f,{bold:!0,children:`n`}),` to cancel`]})})]})]})}if(D===`details`&&k){let e=k.pendingUpdate||b,t=ce(k);return(0,J.jsxs)(u,{flexDirection:`column`,children:[(0,J.jsx)(f,{bold:!0,children:k.name}),(0,J.jsx)(f,{dimColor:!0,children:k.source}),(0,J.jsx)(u,{marginTop:1,children:(0,J.jsxs)(f,{children:[k.pluginCount||0,` available `,zt(k.pluginCount||0,`plugin`)]})}),k.installedPlugins&&k.installedPlugins.length>0&&(0,J.jsxs)(u,{flexDirection:`column`,marginTop:1,children:[(0,J.jsxs)(f,{bold:!0,children:[`Installed plugins (`,k.installedPlugins.length,`):`]}),(0,J.jsx)(u,{flexDirection:`column`,marginLeft:1,children:k.installedPlugins.map(e=>(0,J.jsxs)(u,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(f,{children:a.bullet}),(0,J.jsxs)(u,{flexDirection:`column`,children:[(0,J.jsx)(f,{children:e.name}),(0,J.jsx)(f,{dimColor:!0,children:e.manifest.description})]})]},e.name))})]}),e&&(0,J.jsxs)(u,{marginTop:1,flexDirection:`column`,children:[(0,J.jsx)(f,{color:`claude`,children:`Updating marketplace…`}),T&&(0,J.jsx)(f,{dimColor:!0,children:T})]}),!e&&te&&(0,J.jsx)(u,{marginTop:1,children:(0,J.jsx)(f,{color:`claude`,children:te})}),!e&&S&&(0,J.jsx)(u,{marginTop:1,children:(0,J.jsx)(f,{color:`error`,children:S})}),!e&&(0,J.jsx)(u,{flexDirection:`column`,marginTop:1,children:t.map((e,t)=>{if(!e)return null;let n=t===re;return(0,J.jsxs)(u,{children:[(0,J.jsxs)(f,{color:n?`suggestion`:void 0,children:[n?a.pointer:` `,` `,e.label]}),e.secondaryLabel&&(0,J.jsxs)(f,{dimColor:!0,children:[` `,e.secondaryLabel]})]},e.value)})}),!e&&!kt()&&k.autoUpdate&&(0,J.jsx)(u,{marginTop:1,children:(0,J.jsx)(f,{dimColor:!0,children:`Auto-update enabled. Work Mate will automatically update this marketplace and its installed plugins.`})}),(0,J.jsx)(u,{marginLeft:3,children:(0,J.jsx)(f,{dimColor:!0,italic:!0,children:e?(0,J.jsx)(J.Fragment,{children:`Please wait…`}):(0,J.jsxs)(p,{children:[(0,J.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,J.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]})}let{updateCount:F,removeCount:ue}=ae();return(0,J.jsxs)(u,{flexDirection:`column`,children:[(0,J.jsx)(u,{marginBottom:1,children:(0,J.jsx)(f,{bold:!0,children:`Manage marketplaces`})}),(0,J.jsxs)(u,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(f,{color:v===0?`suggestion`:void 0,children:[v===0?a.pointer:` `,` +`]}),(0,J.jsx)(f,{bold:!0,color:v===0?`suggestion`:void 0,children:`Add Marketplace`})]}),(0,J.jsx)(u,{flexDirection:`column`,children:d.map((e,t)=>{let n=t+1===v,r=[];return e.pendingUpdate&&r.push(`UPDATE`),e.pendingRemove&&r.push(`REMOVE`),(0,J.jsxs)(u,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(f,{color:n?`suggestion`:void 0,children:[n?a.pointer:` `,` `,e.pendingRemove?a.cross:a.bullet]}),(0,J.jsxs)(u,{flexDirection:`column`,flexGrow:1,children:[(0,J.jsxs)(u,{flexDirection:`row`,gap:1,children:[(0,J.jsxs)(f,{bold:!0,strikethrough:e.pendingRemove,dimColor:e.pendingRemove,children:[e.name===`claude-plugins-official`&&(0,J.jsx)(f,{color:`claude`,children:`✻ `}),e.name,e.name===`claude-plugins-official`&&(0,J.jsx)(f,{color:`claude`,children:` ✻`})]}),r.length>0&&(0,J.jsxs)(f,{color:`warning`,children:[`[`,r.join(`, `),`]`]})]}),(0,J.jsx)(f,{dimColor:!0,children:e.source}),(0,J.jsxs)(f,{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)})}),M()&&(0,J.jsxs)(u,{marginTop:1,flexDirection:`column`,children:[(0,J.jsxs)(f,{children:[(0,J.jsx)(f,{bold:!0,children:`Pending changes:`}),` `,(0,J.jsx)(f,{dimColor:!0,children:`Enter to apply`})]}),F>0&&(0,J.jsxs)(f,{children:[`• Update `,F,` `,zt(F,`marketplace`)]}),ue>0&&(0,J.jsxs)(f,{color:`warning`,children:[`• Remove `,ue,` `,zt(ue,`marketplace`)]})]}),b&&(0,J.jsx)(u,{marginTop:1,children:(0,J.jsx)(f,{color:`claude`,children:`Processing changes…`})}),S&&(0,J.jsx)(u,{marginTop:1,children:(0,J.jsx)(f,{color:`error`,children:S})}),(0,J.jsx)(Er,{exitState:i,hasPendingActions:M()})]})}function Er({exitState:e,hasPendingActions:t}){return e.pending?(0,J.jsx)(u,{marginTop:1,children:(0,J.jsxs)(f,{dimColor:!0,italic:!0,children:[`Press `,e.keyName,` again to go back`]})}):(0,J.jsx)(u,{marginTop:1,children:(0,J.jsx)(f,{dimColor:!0,italic:!0,children:(0,J.jsxs)(p,{children:[t&&(0,J.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`apply changes`}),!t&&(0,J.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),!t&&(0,J.jsx)(o,{shortcut:`u`,action:`update`}),!t&&(0,J.jsx)(o,{shortcut:`r`,action:`remove`}),(0,J.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:t?`cancel`:`go back`})]})})})}var Dr,J,Or=e((()=>{i(),g(),Dr=t(g(),1),Nt(),P(),C(),Jt(),yt(),Ot(),pt(),rt(),ye(),ge(),wn(),De(),_t(),wt(),Vt(),J=T()}));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 Pe(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((()=>{D()}));function Mr({item:e,isSelected:t}){let[n]=l();if(e.type===`plugin`){let r,i;return e.pendingToggle?(r=v(`suggestion`,n)(a.arrowRight),i=e.pendingToggle===`will-enable`?`will enable`:`will disable`):e.errorCount>0?(r=v(`error`,n)(a.cross),i=`${e.errorCount} ${zt(e.errorCount,`error`)}`):e.isEnabled?(r=v(`success`,n)(a.tick),i=`enabled`):(r=v(`inactive`,n)(a.radioOff),i=`disabled`),(0,Y.jsxs)(u,{children:[(0,Y.jsx)(f,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(f,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(f,{dimColor:!t,children:[` `,(0,Y.jsx)(f,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(f,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(f,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(f,{dimColor:!t,children:i})]})}if(e.type===`flagged-plugin`){let r=v(`warning`,n)(a.warning);return(0,Y.jsxs)(u,{children:[(0,Y.jsx)(f,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(f,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(f,{dimColor:!t,children:[` `,(0,Y.jsx)(f,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(f,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(f,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(f,{dimColor:!t,children:`removed`})]})}if(e.type===`failed-plugin`){let r=v(`error`,n)(a.cross),i=`failed to load · ${e.errorCount} ${zt(e.errorCount,`error`)}`;return(0,Y.jsxs)(u,{children:[(0,Y.jsx)(f,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(f,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(f,{dimColor:!t,children:[` `,(0,Y.jsx)(f,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(f,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(f,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(f,{dimColor:!t,children:i})]})}let r,i;return e.status===`connected`?(r=v(`success`,n)(a.tick),i=`connected`):e.status===`disabled`?(r=v(`inactive`,n)(a.radioOff),i=`disabled`):e.status===`pending`?(r=v(`inactive`,n)(a.radioOff),i=`connecting…`):e.status===`needs-auth`?(r=v(`warning`,n)(a.triangleUpOutline),i=`Enter to auth`):(r=v(`error`,n)(a.cross),i=`failed`),e.indented?(0,Y.jsxs)(u,{children:[(0,Y.jsx)(f,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(f,{dimColor:!t,children:`└ `}),(0,Y.jsx)(f,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(f,{dimColor:!t,children:[` `,(0,Y.jsx)(f,{backgroundColor:`userMessageBackground`,children:`MCP`})]}),(0,Y.jsxs)(f,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(f,{dimColor:!t,children:i})]}):(0,Y.jsxs)(u,{children:[(0,Y.jsx)(f,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(f,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(f,{dimColor:!t,children:[` `,(0,Y.jsx)(f,{backgroundColor:`userMessageBackground`,children:`MCP`})]}),(0,Y.jsxs)(f,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(f,{dimColor:!t,children:i})]})}var Y,Nr=e((()=>{i(),g(),C(),Vt(),Y=T()}));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 ht(`Failed to read plugin components from ${e}: ${gt(t)}`,{level:`error`}),Mt(ft(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 ht(`Failed to read skill directories from ${e}: ${gt(t)}`,{level:`error`}),Mt(ft(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=me(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 I(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)(u,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsx)(f,{bold:!0,children:`Components:`}),(0,Z.jsxs)(f,{dimColor:!0,children:[`Error: `,o]})]}):!n||!(n.commands||n.agents||n.skills||n.hooks||n.mcpServers)?null:(0,Z.jsxs)(u,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsx)(f,{bold:!0,children:`Installed components:`}),n.commands?(0,Z.jsxs)(f,{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)(f,{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)(f,{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)(f,{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)(f,{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 I(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!Ue(`${e.name}@${t}`)})}function zr({setViewState:e,setResult:t,onManageComplete:n,onSearchModeChange:r,targetPlugin:i,targetMarketplace:o,action:s}){let l=nt(e=>e.mcp.clients),d=nt(e=>e.mcp.tools),h=nt(e=>e.plugins.errors),g=Gt(),[v,b]=(0,X.useState)(!1),S=(0,X.useCallback)(e=>{b(e),r?.(e)},[r]),C=m(),{columns:te}=x(),[w,T]=(0,X.useState)(`plugin-list`),{query:ne,setQuery:E,cursorOffset:D}=xn({isActive:w===`plugin-list`&&v,onExit:()=>{S(!1)}}),[O,k]=(0,X.useState)(null),[A,re]=(0,X.useState)([]),[j,ie]=(0,X.useState)([]),[M,N]=(0,X.useState)(!0),[ae,P]=(0,X.useState)(new Map),oe=(0,X.useRef)(!1),ce=(0,X.useRef)(void 0),le=hn();ee(`confirm:no`,Br.useCallback(()=>{if(w===`plugin-details`)T(`plugin-list`),k(null),z(null);else if(typeof w==`object`&&w.type===`failed-plugin-details`)T(`plugin-list`),z(null);else if(w===`configuring`)T(`plugin-details`),Ce(null);else if(typeof w==`object`&&(w.type===`plugin-options`||w.type===`configuring-options`))T(`plugin-list`),k(null),t(`Plugin enabled. Configuration skipped — run /reload-plugins to apply.`),n&&n();else if(typeof w==`object`&&w.type===`flagged-detail`)T(`plugin-list`),z(null);else if(typeof w==`object`&&w.type===`mcp-detail`)T(`plugin-list`),z(null);else if(typeof w==`object`&&w.type===`mcp-tools`)T({type:`mcp-detail`,client:w.client});else if(typeof w==`object`&&w.type===`mcp-tool-detail`)T({type:`mcp-tools`,client:w.client});else{if(ae.size>0){t(`Run /reload-plugins to apply plugin changes.`);return}e({type:`menu`})}},[w,e,ae,t]),{context:`Confirmation`,isActive:(w!==`plugin-list`||!v)&&w!==`confirm-project-uninstall`&&!(typeof w==`object`&&w.type===`confirm-data-cleanup`)});let ue=e=>e.type===`connected`?`connected`:e.type===`disabled`?`disabled`:e.type===`pending`?`pending`:e.type===`needs-auth`?`needs-auth`:`failed`,fe=(0,X.useMemo)(()=>{let e=Ct(),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 j){let i=`${r.plugin.name}@${r.marketplace}`,a=e?.enabledPlugins?.[i]!==!1,o=h.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:ae.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 h){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=Qt(),s=[];for(let[e,t]of a){if(e in g)continue;let n=st(e),r=n.name||e,i=n.marketplace||`unknown`,a=o.get(e),c=a===`flag`||a===void 0?`user`:a;s.push({type:`failed-plugin`,id:e,name:r,marketplace:i,scope:c,errorCount:t.length,errors:t})}let c=[];for(let e of l)e.name!==`ide`&&(e.name.startsWith(`plugin:`)||c.push({type:`mcp`,id:`mcp:${e.name}`,name:e.name,description:void 0,scope:e.config.scope,status:ue(e),client:e}));let u={flagged:-1,project:0,local:1,user:2,enterprise:3,managed:4,dynamic:5,builtin:6},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:ue(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(g)){let n=st(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},[j,l,h,ae,g]),pe=(0,X.useMemo)(()=>fe.filter(e=>e.type===`flagged-plugin`).map(e=>e.id),[fe]);(0,X.useEffect)(()=>{pe.length>0&&Wt(pe)},[pe]);let I=(0,X.useMemo)(()=>{if(!ne)return fe;let e=ne.toLowerCase();return fe.filter(t=>t.name.toLowerCase().includes(e)||`description`in t&&t.description?.toLowerCase().includes(e))},[fe,ne]),[me,he]=(0,X.useState)(0),ge=fr({totalItems:I.length,selectedIndex:me,maxVisible:8}),[_e,ve]=(0,X.useState)(0),[ye,R]=(0,X.useState)(!1),[be,z]=(0,X.useState)(null),[Se,Ce]=(0,X.useState)(null),[we,Te]=(0,X.useState)(!1),[Ee,De]=(0,X.useState)(!1);(0,X.useEffect)(()=>{if(!O){De(!1);return}async function e(){let e=O.plugin.manifest.mcpServers,t=!1;if(e&&(t=typeof e==`string`&&it(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&&it(e))),!t)try{let e=Tn.join(O.plugin.path,`..`),n=Tn.join(e,`.claude-plugin`,`marketplace.json`),r=ut(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`&&it(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&&it(e))}}catch(e){ht(`Failed to read raw marketplace.json: ${e}`)}De(t)}e()},[O]),(0,X.useEffect)(()=>{async function e(){N(!0);try{let{enabled:e,disabled:t}=await Ge(),n=Ct(),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=Tt(t,t=>{let r=`${t.name}@${e}`;return n?.enabledPlugins?.[r]!==!1}),i=t.length-r;a.push({name:e,installedPlugins:t,enabledCount:r,disabledCount:i})}a.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),re(a);let o=[];for(let e of a)for(let t of e.installedPlugins){let n=`${t.name}@${e.name}`,r=t.isBuiltin?`builtin`:an(n).scope;o.push({plugin:t,marketplace:e.name,scope:r,pendingEnable:void 0,pendingUpdate:!1})}ie(o),he(0)}finally{N(!1)}}e()},[]),(0,X.useEffect)(()=>{if(!oe.current&&i&&A.length>0&&!M){let{name:e,marketplace:n}=st(i),r=o??n,a=r?A.filter(e=>e.name===r):A;for(let t of a){let n=t.installedPlugins.find(t=>t.name===e);if(n){let{scope:e}=an(`${n.name}@${t.name}`),r={plugin:n,marketplace:t.name,scope:e,pendingEnable:void 0,pendingUpdate:!1};k(r),T(`plugin-details`),ce.current=s,oe.current=!0;return}}let c=fe.find(t=>t.type===`failed-plugin`&&t.name===e);c&&c.type===`failed-plugin`&&(T({type:`failed-plugin-details`,plugin:{id:c.id,name:c.name,marketplace:c.marketplace,errors:c.errors,scope:c.scope}}),oe.current=!0),!oe.current&&s&&(oe.current=!0,t(`Plugin "${i}" is not installed in this project`))}},[i,o,A,M,fe,s,t]);let ke=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&&!rn(i)&&r!==`update`){z(`This plugin is managed by your organization. Contact your admin to disable it.`);return}R(!0),z(null);try{let o=`${O.plugin.name}@${O.marketplace}`,s;switch(r){case`enable`:{let e=await $t(o);if(!e.success)throw Error(e.message);break}case`disable`:{let e=await nn(o);if(!e.success)throw Error(e.message);s=e.reverseDependents;break}case`uninstall`:{if(a||!rn(i))break;if(sn(o)){R(!1),T(`confirm-project-uninstall`);return}let e=F().plugins[o],t=!e||e.length<=1?await de(o):null;if(t){R(!1),T({type:`confirm-data-cleanup`,size:t});return}let n=await en(o,i);if(!n.success)throw Error(n.message);s=n.reverseDependents;break}case`update`:{if(a)break;let r=await tn(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}}Re();let c=`${O.plugin.name}@${O.marketplace}`;if(Ct()?.enabledPlugins?.[c]!==!1){R(!1),T({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){R(!1);let t=e instanceof Error?e.message:String(e);z(`Failed to ${r}: ${t}`),Mt(ft(e))}},Ae=(0,X.useRef)(ke);Ae.current=ke,(0,X.useEffect)(()=>{if(w===`plugin-details`&&O&&ce.current){let e=ce.current;ce.current=void 0,Ae.current(e)}},[w,O]);let je=Br.useCallback(()=>{if(me>=I.length)return;let e=I[me];if(e?.type!==`flagged-plugin`)if(e?.type===`plugin`){let t=`${e.plugin.name}@${e.marketplace}`,n=Ct(),r=ae.get(t),i=n?.enabledPlugins?.[t]!==!1,a=e.scope;if(a===`builtin`||rn(a)){let e=new Map(ae);r?(e.delete(t),(async()=>{try{r===`will-disable`?await $t(t):await nn(t),Re()}catch(e){Mt(e)}})()):(e.set(t,i?`will-disable`:`will-enable`),(async()=>{try{i?await nn(t):await $t(t),Re()}catch(e){Mt(e)}})()),P(e)}}else e?.type===`mcp`&&le(e.client.name)},[me,I,ae,j,le]);c({"select:previous":()=>{me===0?S(!0):ge.handleSelectionChange(me-1,he)},"select:next":()=>{me<I.length-1&&ge.handleSelectionChange(me+1,he)},"select:accept":Br.useCallback(()=>{if(me>=I.length)return;let e=I[me];if(e?.type===`plugin`){let t=j.find(t=>t.plugin.name===e.plugin.name&&t.marketplace===e.marketplace);t&&(k(t),T(`plugin-details`),ve(0),z(null))}else e?.type===`flagged-plugin`?(T({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`?(T({type:`failed-plugin-details`,plugin:{id:e.id,name:e.name,marketplace:e.marketplace,errors:e.errors,scope:e.scope}}),ve(0),z(null)):e?.type===`mcp`&&(T({type:`mcp-detail`,client:e.client}),z(null))},[me,I,j])},{context:`Select`,isActive:w===`plugin-list`&&!v}),c({"plugin:toggle":je},{context:`Plugin`,isActive:w===`plugin-list`&&!v}),c({"select:accept":Br.useCallback(()=>{typeof w!=`object`||w.type!==`flagged-detail`||(Kt(w.plugin.id),T(`plugin-list`))},[w])},{context:`Select`,isActive:typeof w==`object`&&w.type===`flagged-detail`});let Me=Br.useMemo(()=>{if(w!==`plugin-details`||!O)return[];let e=Ct(),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 ke(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=[...j],n=t.findIndex(e=>e.plugin.name===O.plugin.name&&e.marketplace===O.marketplace);n!==-1&&(t[n].pendingUpdate=!O.pendingUpdate,ie(t),k({...O,pendingUpdate:!O.pendingUpdate}))}catch(e){z(e instanceof Error?e.message:`Failed to check plugin update availability`)}}}),Ee&&i.push({label:`Configure`,action:async()=>{Te(!0);try{let e=O.plugin.manifest.mcpServers,t=null;if(typeof e==`string`&&it(e))t=e;else if(Array.isArray(e)){for(let n of e)if(typeof n==`string`&&it(n)){t=n;break}}if(!t){z(`No MCPB file found in plugin`),Te(!1);return}let n=`${O.plugin.name}@${O.marketplace}`,r=await Oe(t,O.plugin.path,n,void 0,void 0,!0);`status`in r&&r.status===`needs-config`?(Ce(r),T(`configuring`)):z(`Failed to load MCPB for configuration`)}catch(e){let t=gt(e);z(`Failed to load configuration: ${t}`)}finally{Te(!1)}}}),O.plugin.manifest.userConfig&&Object.keys(O.plugin.manifest.userConfig).length>0&&i.push({label:`Configure options`,action:()=>{T({type:`configuring-options`,schema:O.plugin.manifest.userConfig})}}),i.push({label:`Update now`,action:()=>void ke(`update`)}),i.push({label:`Uninstall`,action:()=>void ke(`uninstall`)})),O.plugin.manifest.homepage&&i.push({label:`Open homepage`,action:()=>void Yt(O.plugin.manifest.homepage)}),O.plugin.manifest.repository&&i.push({label:`View repository`,action:()=>void Yt(O.plugin.manifest.repository)}),i.push({label:`Back to plugin list`,action:()=>{T(`plugin-list`),k(null),z(null)}}),i},[w,O,Ee,j]);if(c({"select:previous":()=>{_e>0&&ve(_e-1)},"select:next":()=>{_e<Me.length-1&&ve(_e+1)},"select:accept":()=>{Me[_e]&&Me[_e].action()}},{context:`Select`,isActive:w===`plugin-details`&&!!O}),c({"select:accept":()=>{typeof w==`object`&&w.type===`failed-plugin-details`&&(async()=>{R(!0),z(null);let e=w.plugin.id,t=w.plugin.scope,r=rn(t)?await en(e,t,!1):await en(e,`user`,!1),i=r.success;if(!i){for(let t of[`userSettings`,`projectSettings`,`localSettings`]){let n=xt(t);n?.enabledPlugins?.[e]!==void 0&&(Dt(t,{enabledPlugins:{...n.enabledPlugins,[e]:void 0}}),i=!0)}Re()}i?(n&&await n(),R(!1),T(`plugin-list`)):(R(!1),z(r.message))})()}},{context:`Select`,isActive:typeof w==`object`&&w.type===`failed-plugin-details`&&w.plugin.scope!==`managed`}),c({"confirm:yes":()=>{if(!O)return;R(!0),z(null);let r=`${O.plugin.name}@${O.marketplace}`,{error:i}=Dt(`localSettings`,{enabledPlugins:{...xt(`localSettings`)?.enabledPlugins,[r]:!1}});if(i){R(!1),z(`Failed to write settings: ${i.message}`);return}Re(),t(`✓ Disabled ${O.plugin.name} in .claude/settings.local.json. Run /reload-plugins to apply.`),n&&n(),e({type:`menu`})},"confirm:no":()=>{T(`plugin-details`),z(null)}},{context:`Confirmation`,isActive:w===`confirm-project-uninstall`&&!!O&&!ye}),_((r,i)=>{if(!O)return;let o=`${O.plugin.name}@${O.marketplace}`,s=O.scope;if(!s||s===`builtin`||!rn(s))return;let c=async r=>{R(!0),z(null);try{let i=await en(o,s,r);if(!i.success)throw Error(i.message);Re();let c=r?``:` · data preserved`;t(`${a.tick} ${i.message}${c}`),n&&n(),e({type:`menu`})}catch(e){R(!1),z(e instanceof Error?e.message:String(e))}};r===`y`||r===`Y`?c(!0):r===`n`||r===`N`?c(!1):i.escape&&(T(`plugin-details`),z(null))},{isActive:typeof w==`object`&&w.type===`confirm-data-cleanup`&&!!O&&!ye}),Br.useEffect(()=>{he(0)},[ne]),_((e,t)=>{let n=!t.ctrl&&!t.meta;v||(e===`/`&&n?(S(!0),E(``),he(0)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==` `&&(S(!0),E(e),he(0)))},{isActive:w===`plugin-list`}),M)return(0,Z.jsx)(f,{children:`Loading installed plugins…`});if(fe.length===0)return(0,Z.jsxs)(u,{flexDirection:`column`,children:[(0,Z.jsx)(u,{marginBottom:1,children:(0,Z.jsx)(f,{bold:!0,children:`Manage plugins`})}),(0,Z.jsx)(f,{children:`No plugins or MCP servers installed.`}),(0,Z.jsx)(u,{marginTop:1,children:(0,Z.jsx)(f,{dimColor:!0,children:`Esc to go back`})})]});if(typeof w==`object`&&w.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 w==`object`&&w.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:w.schema,initialValues:Ze(e),onSave:n=>{try{xe(e,n,w.schema),Re(),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){z(`Failed to save configuration: ${gt(e)}`)}T(`plugin-details`)},onCancel:()=>T(`plugin-details`)})}if(w===`configuring`&&Se&&O){let e=`${O.plugin.name}@${O.marketplace}`;async function n(n){if(!(!Se||!O))try{let r=O.plugin.manifest.mcpServers,i=null;if(typeof r==`string`&&it(r))i=r;else if(Array.isArray(r)){for(let e of r)if(typeof e==`string`&&it(e)){i=e;break}}if(!i){z(`No MCPB file found`),T(`plugin-details`);return}await Oe(i,O.plugin.path,e,void 0,n),z(null),Ce(null),T(`plugin-details`),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){let t=gt(e);z(`Failed to save configuration: ${t}`),T(`plugin-details`)}}function r(){Ce(null),T(`plugin-details`)}return(0,Z.jsx)(Yn,{title:`Configure ${Se.manifest.name}`,subtitle:`Plugin: ${O.plugin.name}`,configSchema:Se.configSchema,initialValues:Se.existingConfig,onSave:n,onCancel:r})}if(typeof w==`object`&&w.type===`flagged-detail`){let e=w.plugin;return(0,Z.jsxs)(u,{flexDirection:`column`,children:[(0,Z.jsx)(u,{children:(0,Z.jsxs)(f,{bold:!0,children:[e.name,` @ `,e.marketplace]})}),(0,Z.jsxs)(u,{marginBottom:1,children:[(0,Z.jsx)(f,{dimColor:!0,children:`Status: `}),(0,Z.jsx)(f,{color:`error`,children:`Removed`})]}),(0,Z.jsxs)(u,{marginBottom:1,flexDirection:`column`,children:[(0,Z.jsxs)(f,{color:`error`,children:[`Removed from marketplace · reason: `,e.reason]}),(0,Z.jsx)(f,{children:e.text}),(0,Z.jsxs)(f,{dimColor:!0,children:[`Flagged on `,new Date(e.flaggedAt).toLocaleDateString()]})]}),(0,Z.jsx)(u,{marginTop:1,flexDirection:`column`,children:(0,Z.jsxs)(u,{children:[(0,Z.jsxs)(f,{children:[a.pointer,` `]}),(0,Z.jsx)(f,{color:`suggestion`,children:`Dismiss`})]})}),(0,Z.jsxs)(p,{children:[(0,Z.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`dismiss`}),(0,Z.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})]})}if(w===`confirm-project-uninstall`&&O)return(0,Z.jsxs)(u,{flexDirection:`column`,children:[(0,Z.jsxs)(f,{bold:!0,color:`warning`,children:[O.plugin.name,` is enabled in .claude/settings.json (shared with your team)`]}),(0,Z.jsxs)(u,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(f,{children:`Disable it just for you in .claude/settings.local.json?`}),(0,Z.jsx)(f,{dimColor:!0,children:`This has the same effect as uninstalling, without affecting other contributors.`})]}),be&&(0,Z.jsx)(u,{marginTop:1,children:(0,Z.jsx)(f,{color:`error`,children:be})}),(0,Z.jsx)(u,{marginTop:1,children:ye?(0,Z.jsx)(f,{dimColor:!0,children:`Disabling…`}):(0,Z.jsxs)(p,{children:[(0,Z.jsx)(L,{action:`confirm:yes`,context:`Confirmation`,fallback:`y`,description:`disable`}),(0,Z.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]});if(typeof w==`object`&&w.type===`confirm-data-cleanup`&&O)return(0,Z.jsxs)(u,{flexDirection:`column`,children:[(0,Z.jsxs)(f,{bold:!0,children:[O.plugin.name,` has `,w.size.human,` of persistent data`]}),(0,Z.jsxs)(u,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(f,{children:`Delete it along with the plugin?`}),(0,Z.jsx)(f,{dimColor:!0,children:se(`${O.plugin.name}@${O.marketplace}`)})]}),be&&(0,Z.jsx)(u,{marginTop:1,children:(0,Z.jsx)(f,{color:`error`,children:be})}),(0,Z.jsx)(u,{marginTop:1,children:ye?(0,Z.jsx)(f,{dimColor:!0,children:`Uninstalling…`}):(0,Z.jsxs)(f,{children:[(0,Z.jsx)(f,{bold:!0,children:`y`}),` to delete · `,(0,Z.jsx)(f,{bold:!0,children:`n`}),` to keep · `,(0,Z.jsx)(f,{bold:!0,children:`esc`}),` to cancel`]})})]});if(w===`plugin-details`&&O){let e=Ct(),t=`${O.plugin.name}@${O.marketplace}`,n=e?.enabledPlugins?.[t]!==!1,r=h.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)(u,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsxs)(f,{bold:!0,color:`error`,children:[r.length,` `,zt(r.length,`error`),`:`]}),r.map((e,t)=>{let n=Ar(e);return(0,Z.jsxs)(u,{flexDirection:`column`,marginLeft:2,children:[(0,Z.jsx)(f,{color:`error`,children:kr(e)}),n&&(0,Z.jsxs)(f,{dimColor:!0,italic:!0,children:[a.arrowRight,` `,n]})]},t)})]});return(0,Z.jsxs)(u,{flexDirection:`column`,children:[(0,Z.jsx)(u,{children:(0,Z.jsxs)(f,{bold:!0,children:[O.plugin.name,` @ `,O.marketplace]})}),(0,Z.jsxs)(u,{children:[(0,Z.jsx)(f,{dimColor:!0,children:`Scope: `}),(0,Z.jsx)(f,{children:O.scope||`user`})]}),O.plugin.manifest.version&&(0,Z.jsxs)(u,{children:[(0,Z.jsx)(f,{dimColor:!0,children:`Version: `}),(0,Z.jsx)(f,{children:O.plugin.manifest.version})]}),O.plugin.manifest.description&&(0,Z.jsx)(u,{marginBottom:1,children:(0,Z.jsx)(f,{children:O.plugin.manifest.description})}),O.plugin.manifest.author&&(0,Z.jsxs)(u,{children:[(0,Z.jsx)(f,{dimColor:!0,children:`Author: `}),(0,Z.jsx)(f,{children:O.plugin.manifest.author.name})]}),(0,Z.jsxs)(u,{marginBottom:1,children:[(0,Z.jsx)(f,{dimColor:!0,children:`Status: `}),(0,Z.jsx)(f,{color:n?`success`:`warning`,children:n?`Enabled`:`Disabled`}),O.pendingUpdate&&(0,Z.jsx)(f,{color:`suggestion`,children:` · Marked for update`})]}),(0,Z.jsx)(Ir,{plugin:O.plugin,marketplace:O.marketplace}),i,(0,Z.jsx)(u,{marginTop:1,flexDirection:`column`,children:Me.map((e,t)=>{let n=t===_e;return(0,Z.jsxs)(u,{children:[n&&(0,Z.jsxs)(f,{children:[a.pointer,` `]}),!n&&(0,Z.jsx)(f,{children:` `}),(0,Z.jsx)(f,{bold:n,color:e.label.includes(`Uninstall`)?`error`:e.label.includes(`Update`)?`suggestion`:void 0,children:e.label})]},t)})}),ye&&(0,Z.jsx)(u,{marginTop:1,children:(0,Z.jsx)(f,{children:`Processing…`})}),be&&(0,Z.jsx)(u,{marginTop:1,children:(0,Z.jsx)(f,{color:`error`,children:be})}),(0,Z.jsx)(u,{marginTop:1,children:(0,Z.jsx)(f,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(L,{action:`select:previous`,context:`Select`,fallback:`↑`,description:`navigate`}),(0,Z.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,Z.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(typeof w==`object`&&w.type===`failed-plugin-details`){let e=w.plugin,t=e.errors[0],n=t?kr(t):`Failed to load`;return(0,Z.jsxs)(u,{flexDirection:`column`,children:[(0,Z.jsxs)(f,{children:[(0,Z.jsx)(f,{bold:!0,children:e.name}),(0,Z.jsxs)(f,{dimColor:!0,children:[` @ `,e.marketplace]}),(0,Z.jsxs)(f,{dimColor:!0,children:[` (`,e.scope,`)`]})]}),(0,Z.jsx)(f,{color:`error`,children:n}),e.scope===`managed`?(0,Z.jsx)(u,{marginTop:1,children:(0,Z.jsx)(f,{dimColor:!0,children:`Managed by your organization — contact your admin`})}):(0,Z.jsxs)(u,{marginTop:1,children:[(0,Z.jsxs)(f,{color:`suggestion`,children:[a.pointer,` `]}),(0,Z.jsx)(f,{bold:!0,children:`Remove`})]}),ye&&(0,Z.jsx)(f,{children:`Processing…`}),be&&(0,Z.jsx)(f,{color:`error`,children:be}),(0,Z.jsx)(u,{marginTop:1,children:(0,Z.jsx)(f,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(p,{children:[e.scope!==`managed`&&(0,Z.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`remove`}),(0,Z.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(typeof w==`object`&&w.type===`mcp-detail`){let e=w.client,n=Fe(d,e.name).length,r=()=>{T({type:`mcp-tools`,client:e})},i=()=>{T(`plugin-list`)},a=e=>{e&&t(e),T(`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}):(T(`plugin-list`),null)}if(typeof w==`object`&&w.type===`mcp-tools`){let e=w.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=>{T({type:`mcp-tool-detail`,client:e,tool:t})},onBack:()=>T({type:`mcp-detail`,client:e})})}if(typeof w==`object`&&w.type===`mcp-tool-detail`){let{client:e,tool:t}=w,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:()=>T({type:`mcp-tools`,client:e})})}let Ne=ge.getVisibleItems(I);return(0,Z.jsxs)(u,{flexDirection:`column`,children:[(0,Z.jsx)(u,{marginBottom:1,children:(0,Z.jsx)(y,{query:ne,isFocused:v,isTerminalFocused:C,width:te-4,cursorOffset:D})}),I.length===0&&ne&&(0,Z.jsx)(u,{marginBottom:1,children:(0,Z.jsxs)(f,{dimColor:!0,children:[`No items match "`,ne,`"`]})}),ge.scrollPosition.canScrollUp&&(0,Z.jsx)(u,{children:(0,Z.jsxs)(f,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),Ne.map((e,t)=>{let n=ge.toActualIndex(t)===me&&!v,r=t>0?Ne[t-1]:null,i=!r||r.scope!==e.scope;return(0,Z.jsxs)(Br.Fragment,{children:[i&&(0,Z.jsx)(u,{marginTop:+(t>0),paddingLeft:2,children:(0,Z.jsx)(f,{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)}),ge.scrollPosition.canScrollDown&&(0,Z.jsx)(u,{children:(0,Z.jsxs)(f,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),(0,Z.jsx)(u,{marginTop:1,marginLeft:1,children:(0,Z.jsx)(f,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(f,{children:`type to search`}),(0,Z.jsx)(L,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,Z.jsx)(L,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,Z.jsx)(L,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})}),ae.size>0&&(0,Z.jsx)(u,{marginLeft:1,children:(0,Z.jsx)(f,{dimColor:!0,italic:!0,children:`Run /reload-plugins to apply changes`})})]})}var Br,X,Z,Vr=e((()=>{i(),Br=t(g(),1),X=t(g(),1),P(),C(),Pn(),Ln(),Bn(),Wn(),bn(),Sn(),he(),Jt(),A(),gn(),ce(),on(),Le(),yt(),Xt(),mt(),pt(),jt(),rt(),j(),ge(),ze(),Ne(),qt(),ct(),De(),We(),R(),Zt(),wt(),dt(),Vt(),jr(),Qn(),rr(),Nr(),hr(),Z=T()}));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,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gr as n,I as r,P as i,fi as a,ot as o,t as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{TS as l}from"./loadAgentsDir-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gr as n,I as r,P as i,fi as a,ot as o,t as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{TS as l}from"./loadAgentsDir-ZQwvbURI.js";import{C as u,T as d,b as f}from"./startupProfiler-BquH_Yqm.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:s}=o(),c=a?5:Math.min(6,Math.max(1,s-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)(r,{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(a(),1),l(),s(),f(),_=c(),v=(0,g.memo)(function({item:e,maxColumnWidth:t,isSelected:r}){let a=o().columns;if(m(e.id)){let t=p(e.id),o=r?`suggestion`:void 0,s=!r,c=e.id.startsWith(`file-`),l=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=a-2-4-f-t;m=u(e.displayText,r)}else m=l?d(e.displayText,30):e.displayText;let h=a-2-n(m)-f-4,g;if(e.description){let n=Math.max(0,h),r=d(e.description.replace(/\s+/g,` `),n);g=`${t} ${m} – ${r}`}else g=`${t} ${m}`;return(0,_.jsx)(i,{color:o,dimColor:s,wrap:`truncate`,children:g})}let s=Math.floor(a*.4),c=Math.min(t??n(e.displayText)+5,s),l=e.color||(r?`suggestion`:void 0),f=!r,h=e.displayText;n(h)>c-2&&(h=d(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,a-c-y-4),x=e.description?d(e.description.replace(/\s+/g,` `),b):``;return(0,_.jsxs)(i,{wrap:`truncate`,children:[(0,_.jsx)(i,{color:l,dimColor:f,children:g}),v?(0,_.jsx)(i,{color:e.tag===`local`?`ansi:yellow`:void 0,dimColor:e.tag!==`local`,children:v}):null,(0,_.jsx)(i,{color:r?`suggestion`:void 0,dimColor:!r,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"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,fi as r,t as i}from"./src-CDCSSo0U2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{Ub as o,Wb as s,Xx as c,Zx as l}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,fi as r,t as i}from"./src-CDCSSo0U2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{Ub as o,Wb as s,Xx as c,Zx as l}from"./loadAgentsDir-ZQwvbURI.js";import{Jt as u,Zt as d}from"./settings-BhvhCpVh.js";import{c as f,g as p}from"./config-662VDD70.js";import{i as m,o as h}from"./platform-B5dCGT8t.js";import{it as g,nt as _,tt as v}from"./model-BgrLt7P7.js";import{a as y,i as b,r as x}from"./terminalSetup-nvS3KCDG.js";function S(){return f().editorMode===`vim`}function C(){return u.terminal===`Apple_Terminal`&&process.platform===`darwin`||y()?`shift + ⏎ for newline`:x()?`\\⏎ for newline`:`backslash (\\) + return (⏎) for newline`}function w(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 T=e((()=>{b(),p(),d()}));function E(e){return e.replace(/\+/g,` + `)}function D(e){let{dimColor:r,fixedWidth:i,gap:a,paddingX:o}=e,c=E(s(`app:toggleTranscript`,`Global`,`ctrl+o`)),u=E(s(`app:toggleTodos`,`Global`,`ctrl+t`)),d=E(s(`chat:undo`,`Chat`,`ctrl+_`)),f=E(s(`chat:stash`,`Chat`,`ctrl+s`)),p=E(s(`chat:cycleMode`,`Chat`,`shift+tab`)),h=E(s(`chat:modelPicker`,`Chat`,`alt+p`)),v=E(s(`chat:fastMode`,`Chat`,`alt+o`)),y=E(s(`chat:externalEditor`,`Chat`,`ctrl+g`));E(s(`app:toggleTerminal`,`Global`,`meta+j`));let b=E(s(`chat:imagePaste`,`Chat`,`ctrl+v`));return(0,O.jsxs)(t,{paddingX:o,flexDirection:`row`,gap:a,children:[(0,O.jsxs)(t,{flexDirection:`column`,width:i?24:void 0,children:[(0,O.jsx)(t,{children:(0,O.jsx)(n,{dimColor:r,children:`! for bash mode`})}),(0,O.jsx)(t,{children:(0,O.jsx)(n,{dimColor:r,children:`/ for commands`})}),(0,O.jsx)(t,{children:(0,O.jsx)(n,{dimColor:r,children:`@ for file paths`})}),(0,O.jsx)(t,{children:(0,O.jsx)(n,{dimColor:r,children:`& for background`})}),(0,O.jsx)(t,{children:(0,O.jsx)(n,{dimColor:r,children:`/btw for side question`})})]}),(0,O.jsxs)(t,{flexDirection:`column`,width:i?35:void 0,children:[(0,O.jsx)(t,{children:(0,O.jsx)(n,{dimColor:r,children:`double tap esc to clear input`})}),(0,O.jsx)(t,{children:(0,O.jsxs)(n,{dimColor:r,children:[p,` `,process.env.USER_TYPE===`ant`?`to cycle modes`:`to auto-accept edits`]})}),(0,O.jsx)(t,{children:(0,O.jsxs)(n,{dimColor:r,children:[c,` for verbose output`]})}),(0,O.jsx)(t,{children:(0,O.jsxs)(n,{dimColor:r,children:[u,` to toggle tasks`]})}),null,(0,O.jsx)(t,{children:(0,O.jsx)(n,{dimColor:r,children:C()})})]}),(0,O.jsxs)(t,{flexDirection:`column`,children:[(0,O.jsx)(t,{children:(0,O.jsxs)(n,{dimColor:r,children:[d,` to undo`]})}),m()!==`windows`&&(0,O.jsx)(t,{children:(0,O.jsx)(n,{dimColor:r,children:`ctrl + z to suspend`})}),(0,O.jsx)(t,{children:(0,O.jsxs)(n,{dimColor:r,children:[b,` to paste images`]})}),(0,O.jsx)(t,{children:(0,O.jsxs)(n,{dimColor:r,children:[h,` to switch model`]})}),g()&&_()&&(0,O.jsx)(t,{children:(0,O.jsxs)(n,{dimColor:r,children:[v,` to toggle fast mode`]})}),(0,O.jsx)(t,{children:(0,O.jsxs)(n,{dimColor:r,children:[f,` to stash prompt`]})}),(0,O.jsx)(t,{children:(0,O.jsxs)(n,{dimColor:r,children:[y,` to edit in $EDITOR`]})}),l()&&(0,O.jsx)(t,{children:(0,O.jsx)(n,{dimColor:r,children:`/keybindings to customize`})})]})]})}var O,k=e((()=>{r(),i(),h(),c(),o(),v(),T(),O=a()}));export{S as a,w as i,k as n,T as r,D as t};
|