claude-code-best 2.6.5 → 2.6.6
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-BYyM_V0q.js → AddWorkspaceDirectory-Bb6crGWh.js} +1 -1
- package/dist/chunks/{App-BboadKdn.js → App-CW0Y4ceR.js} +1 -1
- package/dist/chunks/{ApproveApiKey-BLp4742y.js → ApproveApiKey-9rkwQfgT.js} +1 -1
- package/dist/chunks/ApproveApiKey-BhMr2Y5F.js +1 -0
- package/dist/chunks/{AssistantSessionChooser-B88DM0Oq.js → AssistantSessionChooser-XzXZZdiH.js} +1 -1
- package/dist/chunks/BackgroundTasksDialog-BL_dfbZP.js +2 -0
- package/dist/chunks/BypassPermissionsModeDialog-DlLWAKw2.js +1 -0
- package/dist/chunks/{ClaudeInChromeOnboarding-B6XNhFqq.js → ClaudeInChromeOnboarding-CjGydpBk.js} +1 -1
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-BNhlq7_K.js → ClaudeMdExternalIncludesDialog-B04cjDwX.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-DPki55Xa.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-D_j1NebK.js +1 -0
- package/dist/chunks/{DesktopHandoff-S-w4bs5T.js → DesktopHandoff-CFBUqcCf.js} +1 -1
- package/dist/chunks/DevChannelsDialog-ByTf41du.js +1 -0
- package/dist/chunks/DiffDialog-CY-8kw_Q.js +3 -0
- package/dist/chunks/Doctor-2D5Wz58o.js +1 -0
- package/dist/chunks/Doctor-CDez_u_U.js +3 -0
- package/dist/chunks/{ExitFlow-CSBDxw9H.js → ExitFlow-BlON8IgH.js} +2 -2
- package/dist/chunks/Feedback-CSeD3k4M.js +2 -0
- package/dist/chunks/Grove-Dwu_0zRw.js +1 -0
- package/dist/chunks/{Grove-DSXRnXKv.js → Grove-Tp_UtIMg.js} +1 -1
- package/dist/chunks/{HybridTransport-CuT3KI5e.js → HybridTransport-CAko699F.js} +2 -2
- package/dist/chunks/{ITermBackend-mokGZVH_.js → ITermBackend-5P3WJumD.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-Bi4RKYlk.js → InvalidConfigDialog-CVcdra9v.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-0zKo4-so.js → InvalidSettingsDialog-CfLdbmSI.js} +1 -1
- package/dist/chunks/MCPConnectionManager-BK_3uwQj.js +1 -0
- package/dist/chunks/{McpParsingWarnings-EzgsOoHw.js → McpParsingWarnings-BOj-T8F3.js} +1 -1
- package/dist/chunks/MessageSelector-BRkxpO1O.js +3 -0
- package/dist/chunks/Messages-wyMyMP7U.js +11 -0
- package/dist/chunks/{Onboarding-odmthwzz.js → Onboarding-C06Mxlf-.js} +1 -1
- package/dist/chunks/{OverageCreditUpsell-Cpk_5Lv0.js → OverageCreditUpsell-abcPm3PB.js} +1 -1
- package/dist/chunks/PluginSettings-DGpIVGvV.js +17 -0
- package/dist/chunks/{PromptInputFooterSuggestions-DrrkNOuS.js → PromptInputFooterSuggestions-ihnbjU0K.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-DMsF4D6d.js → PromptInputHelpMenu-CMm8z7Gk.js} +1 -1
- package/dist/chunks/QueryEngine-I3Bqzbiz.js +1 -0
- package/dist/chunks/REPL-BxAsVlx3.js +1 -0
- package/dist/chunks/REPL-CBFcgD4r.js +97 -0
- package/dist/chunks/{RemoteCallout-CnpCWRPk.js → RemoteCallout-Cy6lH-CZ.js} +1 -1
- package/dist/chunks/{RemoteSessionManager-OWg_Yccq.js → RemoteSessionManager-C7iGd5Og.js} +2 -2
- package/dist/chunks/ResumeConversation-AdLtgdVB.js +1 -0
- package/dist/chunks/{SSETransport-BpnapvlK.js → SSETransport-B5xlXeAN.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-BJ8Nx_Nu.js +1 -0
- package/dist/chunks/SentryErrorBoundary-Bs7mtkPb.js +1 -0
- package/dist/chunks/{SentryErrorBoundary-C-NlfQZw.js → SentryErrorBoundary-iih9eFpM.js} +1 -1
- package/dist/chunks/Settings-PioHwsvg.js +2 -0
- package/dist/chunks/{TeleportProgress-CYXay2ZL.js → TeleportProgress-BX-uLwuL.js} +1 -1
- package/dist/chunks/TeleportRepoMismatchDialog-D8oPPTWd.js +1 -0
- package/dist/chunks/{TeleportResumeWrapper-DiHQeZIM.js → TeleportResumeWrapper-B_CvNDbr.js} +1 -1
- package/dist/chunks/{ThemePicker-BRh027fA.js → ThemePicker-BG1ykSpX.js} +1 -1
- package/dist/chunks/{TmuxBackend-BaX2U7iZ.js → TmuxBackend-CnMCWNS4.js} +1 -1
- package/dist/chunks/TrustDialog-Z_maAYj8.js +1 -0
- package/dist/chunks/{ValidationErrorsList-CdCUgfIl.js → ValidationErrorsList-C9swVkZ-.js} +1 -1
- package/dist/chunks/{WelcomeV2-DCXcYd2x.js → WelcomeV2-Au_5ddlT.js} +1 -1
- package/dist/chunks/WindowsTerminalBackend-CGxaYH74.js +2 -0
- package/dist/chunks/{add-dir-ldGd3Ppz.js → add-dir-Cm9u56YX.js} +1 -1
- package/dist/chunks/{agentDisplay-CVnAeURF.js → agentDisplay-Bi_bEyEn.js} +1 -1
- package/dist/chunks/{agents-DH5fmbVw.js → agents-CMF9fLzV.js} +7 -7
- package/dist/chunks/{agents-C08NzRZx.js → agents-CbjR7hNr.js} +1 -1
- package/dist/chunks/{ant-DJren1Aa.js → ant-Bu1Gs4WJ.js} +1 -1
- package/dist/chunks/api-CFNGoLoL.js +1 -0
- package/dist/chunks/{api-CGOR_Xfl.js → api-D_t0nHsS.js} +1 -1
- package/dist/chunks/assistant-BLd4y2FJ.js +1 -0
- package/dist/chunks/{assistant-aWkDcurV.js → assistant-C_pfWe2a.js} +1 -1
- package/dist/chunks/{assistant-BlzrMSkM.js → assistant-EA-MHNQ-.js} +1 -1
- package/dist/chunks/{auth-CSB2RDKF.js → auth-D7PZvVPf.js} +1 -1
- package/dist/chunks/auth-DGfZCD_B.js +1 -0
- package/dist/chunks/{autoMode-CWvZs1jO.js → autoMode-B8iO05xy.js} +6 -6
- package/dist/chunks/{autonomy-BkVcSMCZ.js → autonomy-CaLvE5N6.js} +12 -12
- package/dist/chunks/{autonomy-DK42aJYt.js → autonomy-dQVtSiCJ.js} +1 -1
- package/dist/chunks/{autonomyPanel-Cn4IhXgE.js → autonomyPanel-DSswVlCF.js} +1 -1
- package/dist/chunks/backgroundHousekeeping-Ckj8W3RO.js +1 -0
- package/dist/chunks/backgroundHousekeeping-D2_Uopt7.js +17 -0
- package/dist/chunks/{branch-juox_fko.js → branch-C7pM8Sjh.js} +1 -1
- package/dist/chunks/{bridge-DudsCZkh.js → bridge-CTYdzSWg.js} +2 -2
- package/dist/chunks/bridgeConfig-7c07tJm9.js +1 -0
- package/dist/chunks/{bridgeConfig-lRZfQqmA.js → bridgeConfig-Df6uyp3q.js} +1 -1
- package/dist/chunks/{bridgeEnabled-D2IykaHE.js → bridgeEnabled-A-_xJ94c.js} +1 -1
- package/dist/chunks/bridgeEnabled-Z2S8lk0l.js +1 -0
- package/dist/chunks/bridgeMain-B7FZpvo0.js +68 -0
- package/dist/chunks/bridgeMain-C5UxF8ST.js +1 -0
- package/dist/chunks/{bridgeMessaging-CqNURC4-.js → bridgeMessaging-DPVLAIzl.js} +1 -1
- package/dist/chunks/{btw-DKlE3Dea.js → btw-CqgjLlFN.js} +1 -1
- package/dist/chunks/{buddy-DQYgHR63.js → buddy-DCGBAqF2.js} +1 -1
- package/dist/chunks/{bypassPermissionsKillswitch-Bof-UtM-.js → bypassPermissionsKillswitch-CK0jeZTW.js} +1 -1
- package/dist/chunks/{caches-B5QZDncQ.js → caches-CdVW8fYV.js} +2 -2
- package/dist/chunks/caches-Dt52PedI.js +1 -0
- package/dist/chunks/{ccrClient-BaWg4E9-.js → ccrClient-B_3AmY7K.js} +1 -1
- package/dist/chunks/changeDetector-uO9CBvut.js +1 -0
- package/dist/chunks/{channelNotification-B7A-9DIl.js → channelNotification-BbDQdLZC.js} +1 -1
- package/dist/chunks/channelNotification-DzTzUrCe.js +1 -0
- package/dist/chunks/{chrome-jMAks7-w.js → chrome-CGyqsCkL.js} +1 -1
- package/dist/chunks/clear-B_cVk64B.js +1 -0
- package/dist/chunks/client-BcqXgcrx.js +1 -0
- package/dist/chunks/{color-DG_R5-hl.js → color-DEXUx7gE.js} +1 -1
- package/dist/chunks/commands-BX0_wEGw.js +1 -0
- package/dist/chunks/commitAttribution-CSVDcgTO.js +1 -0
- package/dist/chunks/{commitAttribution-C22a3OCi.js → commitAttribution-e0kkanVT.js} +1 -1
- package/dist/chunks/{compact-BWvnb4or.js → compact-Dh9RewNA.js} +3 -3
- package/dist/chunks/{companion-Bkn2lSLj.js → companion-DVFacTUw.js} +1 -1
- package/dist/chunks/{config-BvpTbJ5p.js → config-CkSmYDJY.js} +1 -1
- package/dist/chunks/{config-D-dzD6n-.js → config-DwiVCSrY.js} +1 -1
- package/dist/chunks/{context-DzNahdyP.js → context-B8VDDHTv.js} +1 -1
- package/dist/chunks/{context-noninteractive-yiyJriiw.js → context-noninteractive-IZfWniex.js} +2 -2
- package/dist/chunks/context-noninteractive-SBxqQ3iu.js +1 -0
- package/dist/chunks/conversation-CQBl9Yy2.js +1 -0
- package/dist/chunks/conversation-DVZplNag.js +1 -0
- package/dist/chunks/{copy-9k9JPRqW.js → copy-CIjrYoFa.js} +2 -2
- package/dist/chunks/{createSSHSession-BZf-Loo5.js → createSSHSession-ArNlbIZB.js} +1 -1
- package/dist/chunks/{createSession-kiTHYXSL.js → createSession-CBheIT_G.js} +1 -1
- package/dist/chunks/createSession-DfEQy2dZ.js +1 -0
- package/dist/chunks/cronJitterConfig-DcMGWOa-.js +6 -0
- package/dist/chunks/crossProjectResume-Z-aR2q-d.js +40 -0
- package/dist/chunks/{datadog-Bg-zL-i7.js → datadog-BK8eJz8B.js} +1 -1
- package/dist/chunks/datadog-Uj6FjEuU.js +1 -0
- package/dist/chunks/{desktop-DpaStjc-.js → desktop-B9vWJeRu.js} +1 -1
- package/dist/chunks/{diff-N_VSBo3Z.js → diff-BTV7_Dca.js} +1 -1
- package/dist/chunks/{doctor-CUWjbh1X.js → doctor-Dpbh0aRz.js} +1 -1
- package/dist/chunks/{effort-loH1TUvE.js → effort-Czlwa5qF.js} +2 -2
- package/dist/chunks/{entry-D58E-E6Y.js → entry-CdfuWjKu.js} +3 -3
- package/dist/chunks/{envLessBridgeConfig-SPEr9oqO.js → envLessBridgeConfig-BAFYaZ0E.js} +1 -1
- package/dist/chunks/envLessBridgeConfig-DOO9eX07.js +1 -0
- package/dist/chunks/{exit-D-tuPpbx.js → exit-DzOm62Dn.js} +1 -1
- package/dist/chunks/{export-BIZ_SPXJ.js → export-DHOR3z3Z.js} +1 -1
- package/dist/chunks/{exportRenderer-CWPSMaqM.js → exportRenderer-CiNXeNr9.js} +1 -1
- package/dist/chunks/extra-usage-CJcyfVCt.js +1 -0
- package/dist/chunks/{extra-usage-CCMwIa85.js → extra-usage-DIYR_3ZR.js} +1 -1
- package/dist/chunks/{extra-usage-core-BNW4VT7o.js → extra-usage-core-C3uM9bOP.js} +1 -1
- package/dist/chunks/{extra-usage-noninteractive-B_WjXO1E.js → extra-usage-noninteractive-Ctz9TfY8.js} +1 -1
- package/dist/chunks/{extraUsage-CNMMTNJi.js → extraUsage-CBwIvl73.js} +1 -1
- package/dist/chunks/extractMemories-C3SU-Osb.js +1 -0
- package/dist/chunks/fast-7iinMwk-.js +1 -0
- package/dist/chunks/{fast-CG1v3fRr.js → fast-BpBwjbSD.js} +1 -1
- package/dist/chunks/{feedback-CG4mS_-B.js → feedback-BkVnsZVx.js} +1 -1
- package/dist/chunks/{firstPartyEventLogger-Y_jAnHoR.js → firstPartyEventLogger-BCzGkdpd.js} +1 -1
- package/dist/chunks/{flushGate-COPcye5f.js → flushGate-CQsnMw8g.js} +1 -1
- package/dist/chunks/{gates-CSKxLmMJ.js → gates-CxWIWtmd.js} +1 -1
- package/dist/chunks/gates-qgzva-fO.js +1 -0
- package/dist/chunks/{gemini-B3uSLiNp.js → gemini-BbV8D2SS.js} +1 -1
- package/dist/chunks/{generateRecap-D7rG3jIm.js → generateRecap-B3j2nUgh.js} +1 -1
- package/dist/chunks/{generateSessionName-zbqanivg.js → generateSessionName-aGnXSNgN.js} +1 -1
- package/dist/chunks/{githubRepoPathMapping-B04nEUDG.js → githubRepoPathMapping-DCJLSTLl.js} +1 -1
- package/dist/chunks/{grok-CDOpos8E.js → grok-C4QFXJnR.js} +1 -1
- package/dist/chunks/{growthbook-C_EY78Sn.js → growthbook-prtWhMRg.js} +1 -1
- package/dist/chunks/{heapdump-CpmhJ55b.js → heapdump-Czm-2XiG.js} +1 -1
- package/dist/chunks/{help-EHn2neTv.js → help-CSAFsN0-.js} +1 -1
- package/dist/chunks/hooks-Ch2vPE8u.js +1 -0
- package/dist/chunks/{hooks-BV6HqbU4.js → hooks-DkbOP-bI.js} +2 -2
- package/dist/chunks/{hostAdapter-_SmFAVNf.js → hostAdapter-BcdDPVTj.js} +1 -1
- package/dist/chunks/{ide-DkN0KdTR.js → ide-BXERRFZF.js} +2 -2
- package/dist/chunks/{inboundAttachments-DnGQw7Pf.js → inboundAttachments-7rXrAtkb.js} +1 -1
- package/dist/chunks/inboundAttachments-C0rkLl2x.js +1 -0
- package/dist/chunks/initReplBridge-tXqkba08.js +1 -0
- package/dist/chunks/{insights-Bs9kJDG6.js → insights-DrvqJgF8.js} +25 -25
- package/dist/chunks/{install-CFX_ph9z.js → install-BGnxwO00.js} +1 -1
- package/dist/chunks/{install-github-app-CvRjY1Wi.js → install-github-app-CIpBHlr9.js} +2 -2
- package/dist/chunks/{install-slack-app-DjhnVSe0.js → install-slack-app-By4Lh7ww.js} +1 -1
- package/dist/chunks/{instrumentation-c5zlOWom.js → instrumentation-D9y7Ph_R.js} +3 -3
- package/dist/chunks/{job-3QwLq609.js → job-BPVIMW_P.js} +1 -1
- package/dist/chunks/{keybindings-7mDm3UKD.js → keybindings-Ce6AHMLI.js} +2 -2
- package/dist/chunks/{lang-DyyjY20G.js → lang-DfDG_fSa.js} +1 -1
- package/dist/chunks/language-B1yHC1d6.js +1 -0
- package/dist/chunks/{language-CPRGmY8Q.js → language-yGoDFP3X.js} +1 -1
- package/dist/chunks/{launchAgentsPlatform-CpsMsTqQ.js → launchAgentsPlatform-DT01xZM7.js} +1 -1
- package/dist/chunks/launchAutofixPr-DrYd7WVf.js +18 -0
- package/dist/chunks/{launchLocalMemory-DlYQcEQJ.js → launchLocalMemory-Bt3tMYVJ.js} +1 -1
- package/dist/chunks/{launchLocalVault-CP0AyPjj.js → launchLocalVault-jyRHEa_Y.js} +1 -1
- package/dist/chunks/{launchMemoryStores-BHoDFkJ5.js → launchMemoryStores-cmXnLAF5.js} +1 -1
- package/dist/chunks/{launchOnboarding-CFTNXcnc.js → launchOnboarding-BPTNFftb.js} +1 -1
- package/dist/chunks/{launchSchedule-5KQr6x_A.js → launchSchedule-141GqGC8.js} +1 -1
- package/dist/chunks/{launchSkillStore-D0yGuE68.js → launchSkillStore-Bz0lok_o.js} +1 -1
- package/dist/chunks/{launchTeleport-DRKnXOwY.js → launchTeleport-BMquJxIq.js} +2 -2
- package/dist/chunks/{launchVault-XA-zAswX.js → launchVault-Bsuwqad6.js} +1 -1
- package/dist/chunks/{loadAgentsDir-DI1a76pd.js → loadAgentsDir-D7kapZB5.js} +506 -498
- package/dist/chunks/loadAgentsDir-DxPE2bIO.js +1 -0
- package/dist/chunks/{loadPluginHooks-C0Ei-0E2.js → loadPluginHooks-CL5aGDrb.js} +1 -1
- package/dist/chunks/localSearch-iozuZZhZ.js +1 -0
- package/dist/chunks/{localSearch-CDOJNc_E.js → localSearch-r1_G8kfV.js} +1 -1
- package/dist/chunks/{login-nwTOoyxv.js → login-7MvpaOkt.js} +1 -1
- package/dist/chunks/login-Dxza_KNT.js +1 -0
- package/dist/chunks/{logoV2Utils-DDUoPClc.js → logoV2Utils-DjThKW15.js} +1 -1
- package/dist/chunks/logout-BeGQR78E.js +1 -0
- package/dist/chunks/{magicDocs-CmUlOWjI.js → magicDocs-Dy72LHIj.js} +2 -2
- package/dist/chunks/{main-CeG_nUsC.js → main-CF6Im-LV.js} +46 -46
- package/dist/chunks/{mappers-CJ8IO1o1.js → mappers-CkMESMy7.js} +1 -1
- package/dist/chunks/mcp-BTgHgOhR.js +2 -0
- package/dist/chunks/mcp-UJZ22IDJ.js +6 -0
- package/dist/chunks/mcp-fHf8Uc7h.js +1 -0
- package/dist/chunks/{mcpServer-lIneUZ5p.js → mcpServer-BueM5fWI.js} +1 -1
- package/dist/chunks/{mcpServer-DPHQVYdC.js → mcpServer-Dqm2PQQx.js} +1 -1
- package/dist/chunks/{memory-BcWBkKV8.js → memory-BNZmqma1.js} +1 -1
- package/dist/chunks/model-D3g2QdU-.js +1 -0
- package/dist/chunks/{model-DJLzVvcF.js → model-DOw7wIKQ.js} +1 -1
- package/dist/chunks/{onChangeAppState-Dxbl8fvk.js → onChangeAppState-Cb9_yIuW.js} +1 -1
- package/dist/chunks/{openai-DkYK4THc.js → openai-Bvo0Gcec.js} +3 -3
- package/dist/chunks/{overageCreditGrant-DLKadMYU.js → overageCreditGrant-BrN7dk3d.js} +1 -1
- package/dist/chunks/{passes-BIfuerjL.js → passes-vgcY8_l8.js} +1 -1
- package/dist/chunks/{paths-BBvuDQl9.js → paths-1ngPRtu3.js} +2 -2
- package/dist/chunks/permissions-BDbIjTT6.js +3 -0
- package/dist/chunks/{pipeTransport-DVoIA1uN.js → pipeTransport-KU8psPDI.js} +1 -1
- package/dist/chunks/{plan--lnWxB3Q.js → plan-5NVPuxp6.js} +1 -1
- package/dist/chunks/{plugin-DWLyrLw4.js → plugin-t8jMqdsY.js} +1 -1
- package/dist/chunks/{pluginAutoupdate-CGXIWBrb.js → pluginAutoupdate-CAa4KLro.js} +1 -1
- package/dist/chunks/{pluginBlocklist-DJrMdzT0.js → pluginBlocklist-BG2LkLq1.js} +1 -1
- package/dist/chunks/{pluginCliCommands-C08q9dHk.js → pluginCliCommands-vqAtVibb.js} +1 -1
- package/dist/chunks/{pluginFlagging-Dggxke70.js → pluginFlagging-BFCtv3kY.js} +1 -1
- package/dist/chunks/{pluginOperations-CNCImIe8.js → pluginOperations-C9XP-mko.js} +2 -2
- package/dist/chunks/pluginStartupCheck-DZp0wnXP.js +1 -0
- package/dist/chunks/{pluginStartupCheck-BW2fjg2P.js → pluginStartupCheck-RRcAbKfx.js} +1 -1
- package/dist/chunks/plugins-0SyID4Kx.js +4 -0
- package/dist/chunks/policyLimits-Cmmzuv-E.js +1 -0
- package/dist/chunks/{pollConfig-DAQ-ives.js → pollConfig-DTYIJ8lQ.js} +1 -1
- package/dist/chunks/{poor-DqfrQT61.js → poor-Dw5dMZpM.js} +1 -1
- package/dist/chunks/{poorMode-DzYT47KW.js → poorMode-CsGLI_hm.js} +1 -1
- package/dist/chunks/poorMode-D_hB-rDf.js +1 -0
- package/dist/chunks/{print-GGVp62vj.js → print-Ct8N4PYT.js} +12 -12
- package/dist/chunks/{privacy-settings-agwqjYJo.js → privacy-settings-P2r-kg2i.js} +1 -1
- package/dist/chunks/processBashCommand-a8W8aTRu.js +1 -0
- package/dist/chunks/{processSlashCommand-COtIO6Jy.js → processSlashCommand-BaUdUg3T.js} +3 -3
- package/dist/chunks/prompt-B1Qy8mi4.js +1 -0
- package/dist/chunks/{prompt-CjFAtm3w.js → prompt-BBg3jtfc.js} +1 -1
- package/dist/chunks/prompt-D4kWWEZC.js +1 -0
- package/dist/chunks/{promptEditor-EgosPsy-.js → promptEditor-CvaugNTt.js} +2 -2
- package/dist/chunks/{protocolHandler-mtPUT9U0.js → protocolHandler-DxBaHlaD.js} +1 -1
- package/dist/chunks/{rate-limit-options-C6SFOHue.js → rate-limit-options-Df_sgE0b.js} +1 -1
- package/dist/chunks/rcDebugLog-CPGWJbI4.js +11 -0
- package/dist/chunks/{referral-DeDr9zAE.js → referral-BKeCKnOJ.js} +1 -1
- package/dist/chunks/{refresh-D7pdoY_X.js → refresh-Cjv4jA6L.js} +1 -1
- package/dist/chunks/{registerProtocol-BZBH8Zgl.js → registerProtocol-DLuRm0mf.js} +1 -1
- package/dist/chunks/{registry-Dz6AbiYP.js → registry-DVSgtCq5.js} +1 -1
- package/dist/chunks/{release-notes-DiUNOrg9.js → release-notes-CZcf8zB7.js} +1 -1
- package/dist/chunks/{releaseNotes-CnhQit0y.js → releaseNotes-CvfZb3fZ.js} +2 -2
- package/dist/chunks/{reload-plugins-Dx52GcaG.js → reload-plugins-pSlDLk3b.js} +1 -1
- package/dist/chunks/{remote-env-B67Oo3sI.js → remote-env-BH89NuwC.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-BzSUgPbt.js → remoteBridgeCore-CrXlWEL1.js} +1 -1
- package/dist/chunks/{remoteControlServer-L8smP7Zu.js → remoteControlServer-BSOnq4yY.js} +1 -1
- package/dist/chunks/{rename-C4PauyTZ.js → rename-DNGvNQm2.js} +1 -1
- package/dist/chunks/{resume-CrSn26xq.js → resume-6UL38yL3.js} +2 -2
- package/dist/chunks/{runtimeObserver-nAhH4Wca.js → runtimeObserver-BhvHeiwD.js} +4 -4
- package/dist/chunks/{runtimeObserver-YNy3mIb7.js → runtimeObserver-Cp-DN8fP.js} +1 -1
- package/dist/chunks/sandbox-adapter-DGVtPPD0.js +1 -0
- package/dist/chunks/{sandbox-toggle-BYqbcI5d.js → sandbox-toggle-D19YbI5G.js} +1 -1
- package/dist/chunks/searchExtraTools-DXWkpOIg.js +1 -0
- package/dist/chunks/{sentry-BNVxoVLS.js → sentry-BZmpC-iI.js} +1 -1
- package/dist/chunks/{session-BuEmHrqM.js → session-lLpGqp0B.js} +2 -2
- package/dist/chunks/{sessionDiscovery-Mcsfa0g-.js → sessionDiscovery-BX3fjgzD.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-BeuS4m7a.js +1 -0
- package/dist/chunks/sessionMemory-LMOQk90c.js +1 -0
- package/dist/chunks/sessionMemory-UpILj5ww.js +1 -0
- package/dist/chunks/sessionMemoryUtils-DE7AezA0.js +1 -0
- package/dist/chunks/{sessionObserver-DG2zQgfi.js → sessionObserver-CujNIWks.js} +1 -1
- package/dist/chunks/sessionObserver-HqvTXhs9.js +1 -0
- package/dist/chunks/sessionStorage-BN56DAAd.js +1 -0
- package/dist/chunks/{sessionTitle-zUVSAHO7.js → sessionTitle-QxXslbJY.js} +1 -1
- package/dist/chunks/{sessionTracing-DoRJ4nSa.js → sessionTracing-DognYcDf.js} +1 -1
- package/dist/chunks/{settingsSync-B9bz77E1.js → settingsSync-DEPET5O1.js} +1 -1
- package/dist/chunks/{setup-B1JbPepL.js → setup-BUBUidOg.js} +1 -1
- package/dist/chunks/setup-BZMVuIIx.js +2 -0
- package/dist/chunks/{setup-CCOLlRtP.js → setup-C6G0lasE.js} +1 -1
- package/dist/chunks/{shadowedRuleDetection-BBR3uEgx.js → shadowedRuleDetection-CQayPrmM.js} +1 -1
- package/dist/chunks/{sideQuestion-DHW5rgKz.js → sideQuestion-B9EE1vTM.js} +1 -1
- package/dist/chunks/sink-BRrEbL6h.js +1 -0
- package/dist/chunks/{sink-DxDOsLa2.js → sink-Cugto5We.js} +1 -1
- package/dist/chunks/{sinks-BrrTUxkC.js → sinks-B9A94oIj.js} +2 -2
- package/dist/chunks/sinks-CKaSBvU8.js +1 -0
- package/dist/chunks/{skill-learning-C0nOKZfg.js → skill-learning-CroDcatu.js} +1 -1
- package/dist/chunks/skillChangeDetector-DnyEQqe6.js +1 -0
- package/dist/chunks/{skillGapStore-_YuJP5KI.js → skillGapStore-91Mb3xDY.js} +2 -2
- package/dist/chunks/{skillGapStore-Czi5jKjJ.js → skillGapStore-LKwap3o4.js} +1 -1
- package/dist/chunks/{skillGenerator-kbaRbpqJ.js → skillGenerator-B9GM0LHk.js} +2 -2
- package/dist/chunks/skillLearning-D6latSKi.js +1 -0
- package/dist/chunks/skillLearning-DbOOqb6b.js +1 -0
- package/dist/chunks/{skillPanel-BxDvlPzd.js → skillPanel-rIIYgnBE.js} +3 -3
- package/dist/chunks/{skillSearchPanel-D-MX6Qgt.js → skillSearchPanel-xAL-6uJF.js} +4 -4
- package/dist/chunks/{skills-NpEgFkFZ.js → skills-Doe47wxK.js} +1 -1
- package/dist/chunks/{sprites-DD4eIkN7.js → sprites-D11F3i1M.js} +1 -1
- package/dist/chunks/{stats-xL3NHwhp.js → stats-WNUyieG-.js} +1 -1
- package/dist/chunks/{status-B5E70xRv.js → status-CjBS9SkF.js} +1 -1
- package/dist/chunks/{statusNoticeHelpers-DcssRhLw.js → statusNoticeHelpers-cnI4TiGw.js} +1 -1
- package/dist/chunks/{tag-BELr-qIa.js → tag-Gfb8vTAR.js} +2 -2
- package/dist/chunks/{tasks-CrdWcSt-.js → tasks-BwX1rzOD.js} +1 -1
- package/dist/chunks/{teamHelpers--3ZyNDlv.js → teamHelpers-DEgaCpta.js} +1 -1
- package/dist/chunks/teamHelpers-EJxTXoTV.js +1 -0
- package/dist/chunks/teammateModeSnapshot-BgUQ4Phz.js +1 -0
- package/dist/chunks/{teammateModeSnapshot-DOQMTKbQ.js → teammateModeSnapshot-Dyukgtp9.js} +1 -1
- package/dist/chunks/teleport-B4p8XlAv.js +1 -0
- package/dist/chunks/{templateJobs-8IY2Cgig.js → templateJobs-DQXuFnkl.js} +1 -1
- package/dist/chunks/{terminalSetup-C4psrmpb.js → terminalSetup-CTEIn08j.js} +1 -1
- package/dist/chunks/{terminalSetup-Lyg4NbGA.js → terminalSetup-bSbq4LE7.js} +1 -1
- package/dist/chunks/{theme-B8GNnJ_q.js → theme-DazaKPy8.js} +1 -1
- package/dist/chunks/thinkback-BOfZP_QG.js +1 -0
- package/dist/chunks/{thinkback-DPXwEK3B.js → thinkback-CxWZV2Oz.js} +1 -1
- package/dist/chunks/{thinkback-play-BMOE-ceh.js → thinkback-play-CHe1x2Hc.js} +1 -1
- package/dist/chunks/{toolEventObserver-DzLd0MSn.js → toolEventObserver-D4h-QqVP.js} +1 -1
- package/dist/chunks/{toolEventObserver-D0TSHm01.js → toolEventObserver-Dfvv2trb.js} +1 -1
- package/dist/chunks/toolPool-BHChMuLr.js +1 -0
- package/dist/chunks/toolPool-C5K43w4_.js +1 -0
- package/dist/chunks/{trustedDevice-1iTu4LEm.js → trustedDevice-CQ9PK-8m.js} +1 -1
- package/dist/chunks/{trustedDevice-BvYYXfd8.js → trustedDevice-rdvUkS1W.js} +1 -1
- package/dist/chunks/{ultrareviewCommand-BTXAN2wP.js → ultrareviewCommand-Zf9hO4wr.js} +2 -2
- package/dist/chunks/{undercover-DvvnEmsX.js → undercover-DLyKv5TE.js} +1 -1
- package/dist/chunks/undercover-DNS9V_JT.js +1 -0
- package/dist/chunks/{updateCCB-C-qfLi0j.js → updateCCB-7WQRz9lW.js} +4 -4
- package/dist/chunks/{upgrade-DTBZSxwv.js → upgrade-ByIumMQe.js} +1 -1
- package/dist/chunks/upgrade-bK4x32Ma.js +1 -0
- package/dist/chunks/{upload-BF8tf_Eo.js → upload-CvOMbA9_.js} +1 -1
- package/dist/chunks/{usage-DvSTXEYY.js → usage-C_d-Z-eb.js} +1 -1
- package/dist/chunks/{usage-BRYRRgNt.js → usage-DE4PSQiF.js} +1 -1
- package/dist/chunks/useMainLoopModel-Os8Ao8-x.js +1 -0
- package/dist/chunks/{useManagePlugins-GmnI9K53.js → useManagePlugins-BYBubfHU.js} +1 -1
- package/dist/chunks/{useMergedTools-Dah5KDMi.js → useMergedTools-BJAn2i-F.js} +1 -1
- package/dist/chunks/{useSearchInput-BV_azHiA.js → useSearchInput-CF77X2OV.js} +1 -1
- package/dist/chunks/useSettingsErrors-DD7fQ-fU.js +1 -0
- package/dist/chunks/{useVoice-DR69NLxp.js → useVoice-DwzMN0fq.js} +1 -1
- package/dist/chunks/{util-BpyJ4Bom.js → util-DD30Y4o8.js} +1 -1
- package/dist/chunks/utils-D44M8obg.js +1 -0
- package/dist/chunks/validatePlugin-DpHiJRsT.js +1 -0
- package/dist/chunks/{vim-DvOw8dfR.js → vim-zc9EiMil.js} +1 -1
- package/dist/chunks/{voice-B3BZs53f.js → voice-BRhZt4jW.js} +2 -2
- package/dist/chunks/{voiceModeEnabled-DA76xN1Q.js → voiceModeEnabled-168-1Ocs.js} +1 -1
- package/dist/chunks/voiceModeEnabled-CTT25yFj.js +1 -0
- package/dist/chunks/{voiceStreamSTT-_w1VjIOs.js → voiceStreamSTT-B80UegKG.js} +1 -1
- package/dist/chunks/voiceStreamSTT-BpYhKo2H.js +1 -0
- package/dist/chunks/{workerRegistry-2_MZVih1.js → workerRegistry-s8nnpmUO.js} +1 -1
- package/dist/chunks/worktree-CkB4jLXK.js +1 -0
- package/dist/chunks/{xml-Dx--sNE1.js → xml-DTMvLcPg.js} +1 -1
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/ApproveApiKey-DiEe4eui.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-ByraVuXh.js +0 -2
- package/dist/chunks/BypassPermissionsModeDialog-BDvmz12S.js +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-B4ocUjev.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-BvaB9b0y.js +0 -1
- package/dist/chunks/DevChannelsDialog-BljR0X9X.js +0 -1
- package/dist/chunks/DiffDialog-BhQ2QaLW.js +0 -3
- package/dist/chunks/Doctor-BXb0qv6n.js +0 -3
- package/dist/chunks/Doctor-C5DYPEGl.js +0 -1
- package/dist/chunks/Feedback-DwHzc4UT.js +0 -2
- package/dist/chunks/Grove-DnTo982-.js +0 -1
- package/dist/chunks/MCPConnectionManager-DYGoS1Ht.js +0 -1
- package/dist/chunks/MessageSelector-DTmUuEKJ.js +0 -3
- package/dist/chunks/Messages-DWiKTx5o.js +0 -11
- package/dist/chunks/PluginSettings-eYcWehI8.js +0 -17
- package/dist/chunks/QueryEngine-C_KZts4y.js +0 -1
- package/dist/chunks/REPL-C6YR0VKU.js +0 -1
- package/dist/chunks/REPL-DzHz-LOY.js +0 -97
- package/dist/chunks/ResumeConversation-BktSnsCm.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-CqFD8vVS.js +0 -1
- package/dist/chunks/SentryErrorBoundary-BUirJRWU.js +0 -1
- package/dist/chunks/Settings-vfFvcweR.js +0 -2
- package/dist/chunks/TeleportRepoMismatchDialog-_zbZTvcJ.js +0 -1
- package/dist/chunks/TrustDialog-CVbzrv6g.js +0 -1
- package/dist/chunks/WindowsTerminalBackend-BE9NX5IH.js +0 -2
- package/dist/chunks/api-6tcwJlf_.js +0 -1
- package/dist/chunks/assistant-CwbhlCM-.js +0 -1
- package/dist/chunks/auth-GxZhOvQ1.js +0 -1
- package/dist/chunks/backgroundHousekeeping-BIZTAYho.js +0 -17
- package/dist/chunks/backgroundHousekeeping-Csh58CxV.js +0 -1
- package/dist/chunks/bridgeConfig-D4tpc568.js +0 -1
- package/dist/chunks/bridgeEnabled-B8_c_Ppq.js +0 -1
- package/dist/chunks/bridgeMain-C5RDihlX.js +0 -68
- package/dist/chunks/bridgeMain-D7_lg2iJ.js +0 -1
- package/dist/chunks/caches-dGk7xsDu.js +0 -1
- package/dist/chunks/changeDetector-DoLfg8a6.js +0 -1
- package/dist/chunks/channelNotification-DDErroWn.js +0 -1
- package/dist/chunks/clear-OudnCGa7.js +0 -1
- package/dist/chunks/client-DxDmXXTh.js +0 -1
- package/dist/chunks/commands-BWIOEBPs.js +0 -1
- package/dist/chunks/commitAttribution-BA4fcbHf.js +0 -1
- package/dist/chunks/context-noninteractive-CM1-lUSe.js +0 -1
- package/dist/chunks/conversation-DKlz47xf.js +0 -1
- package/dist/chunks/conversation-cUxdb8MN.js +0 -1
- package/dist/chunks/createSession-BuJcoBAj.js +0 -1
- package/dist/chunks/cronJitterConfig-CYP7yrQu.js +0 -6
- package/dist/chunks/crossProjectResume-BJisir9Z.js +0 -40
- package/dist/chunks/datadog-CVeFkaQu.js +0 -1
- package/dist/chunks/envLessBridgeConfig-CT8sdmFu.js +0 -1
- package/dist/chunks/extra-usage-rdJ7ecEb.js +0 -1
- package/dist/chunks/extractMemories-BrvZVsmM.js +0 -1
- package/dist/chunks/fast-CLKKsx2H.js +0 -1
- package/dist/chunks/gates-CSHuXnUx.js +0 -1
- package/dist/chunks/hooks-BFdX17Za.js +0 -1
- package/dist/chunks/inboundAttachments-BVUunfAX.js +0 -1
- package/dist/chunks/initReplBridge-tPRGPBq7.js +0 -1
- package/dist/chunks/language-Cf6bMI4N.js +0 -1
- package/dist/chunks/launchAutofixPr-D9h6YAZY.js +0 -2
- package/dist/chunks/loadAgentsDir-DCyiY0MN.js +0 -1
- package/dist/chunks/localSearch-MBx7KzC2.js +0 -1
- package/dist/chunks/login-D8UKKaud.js +0 -1
- package/dist/chunks/logout-B0BjqlGi.js +0 -1
- package/dist/chunks/mcp-CanCqnch.js +0 -2
- package/dist/chunks/mcp-Dq0kxZFx.js +0 -6
- package/dist/chunks/mcp-zbxZM9BP.js +0 -1
- package/dist/chunks/model-H3rtl6eR.js +0 -1
- package/dist/chunks/permissions-S2EvIRKj.js +0 -3
- package/dist/chunks/pluginStartupCheck-DpxQPXJE.js +0 -1
- package/dist/chunks/plugins-DQ3CRWWO.js +0 -4
- package/dist/chunks/policyLimits-BotYrS-v.js +0 -1
- package/dist/chunks/poorMode-DEAe3hiK.js +0 -1
- package/dist/chunks/processBashCommand-DHHN8Ca4.js +0 -1
- package/dist/chunks/prompt-CO160cIr.js +0 -1
- package/dist/chunks/prompt-GY9hlRvI.js +0 -1
- package/dist/chunks/rcDebugLog-CPKZCtR8.js +0 -11
- package/dist/chunks/sandbox-adapter-CzwHes1i.js +0 -1
- package/dist/chunks/searchExtraTools-CcpdCO6l.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-qnNiGMnE.js +0 -1
- package/dist/chunks/sessionMemory-CMahwDdW.js +0 -1
- package/dist/chunks/sessionMemory-pFSn4HSN.js +0 -1
- package/dist/chunks/sessionMemoryUtils-Du5jUl7M.js +0 -1
- package/dist/chunks/sessionObserver-Je868MC9.js +0 -1
- package/dist/chunks/sessionStorage-D3FhAADV.js +0 -1
- package/dist/chunks/setup-DWkSjA49.js +0 -2
- package/dist/chunks/sink-cQOgsnw3.js +0 -1
- package/dist/chunks/sinks-Djiz_5-Z.js +0 -1
- package/dist/chunks/skillChangeDetector-D8C-uQSQ.js +0 -1
- package/dist/chunks/skillLearning-3KWrBczS.js +0 -1
- package/dist/chunks/skillLearning-DBbdGbk-.js +0 -1
- package/dist/chunks/teamHelpers-CUAiXng3.js +0 -1
- package/dist/chunks/teammateModeSnapshot-C6EWhR0X.js +0 -1
- package/dist/chunks/teleport-LXFOan9C.js +0 -1
- package/dist/chunks/thinkback-DZW3Mcx_.js +0 -1
- package/dist/chunks/toolPool-DVOfpjDz.js +0 -1
- package/dist/chunks/toolPool-Dq-Vtvrj.js +0 -1
- package/dist/chunks/undercover-C_44e3oN.js +0 -1
- package/dist/chunks/upgrade-CGXa5Dwy.js +0 -1
- package/dist/chunks/useMainLoopModel-CwvuTRXn.js +0 -1
- package/dist/chunks/useSettingsErrors-C-j_Zt7g.js +0 -1
- package/dist/chunks/utils-CrZcpypC.js +0 -1
- package/dist/chunks/validatePlugin-vptAYuYu.js +0 -1
- package/dist/chunks/voiceModeEnabled-DIveLYGb.js +0 -1
- package/dist/chunks/voiceStreamSTT-hpzWd_zl.js +0 -1
- package/dist/chunks/worktree-CCuDwRmS.js +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{n as e,o as t,r as n}from"./chunk-DR8-3Aex.js";import{n as r,t as i}from"./figures-gfT9mM8P.js";import{F as a,Rn as o,b as s,m as c,nt as l,t as u,tt as d,x as f}from"./src-Di342QoJ.js";import{t as p}from"./jsx-runtime-D-D469L8.js";import{Ct as m,cn as h,mr as g,vt as _}from"./state-sIHsFpDu.js";import{Ht as v,es as y,no as b,on as x,oo as S,pi as C,rs as w,vi as T}from"./paths-1ngPRtu3.js";import{n as E,r as D}from"./analytics-DqMQntaB.js";import{n as O,t as k}from"./cwd--iizewsn.js";import{O as A,et as j,h as ee,m as te,o as ne,s as M}from"./log-CzsijfHZ.js";import{b as N,x as re}from"./teammate-DMYOtLTK.js";import{C as ie,g as ae,x as oe}from"./startupProfiler-DnXZaX4A.js";import{Ax as se,Dc as P,Ec as ce,Eo as F,HE as le,IO as ue,LO as I,Lo as L,NS as de,PO as R,PS as fe,Qv as pe,Rc as z,So as B,Ui as V,Uo as H,VE as me,Vi as he,Vo as ge,Xi as _e,Xv as ve,Zv as ye,_o as be,an as xe,bo as U,fo as Se,gy as Ce,hn as we,iu as W,kc as Te,kx as Ee,la as De,nu as Oe,os as ke,rC as Ae,ry as je,tC as Me,vy as Ne,yn as Pe,zc as Fe,zo as Ie,zw as Le}from"./loadAgentsDir-D7kapZB5.js";import{E as Re,T as ze,c as Be,d as Ve,w as He}from"./sessionTracing-DognYcDf.js";import{t as Ue}from"./useKeybinding-FsOnjW6T.js";import{l as We,u as Ge}from"./referral-BKeCKnOJ.js";import{n as Ke,t as qe}from"./slashCommandParsing-Cari0pNg.js";import*as G from"path";import{randomUUID as K}from"crypto";o();var q=p();r(),u(),h(),E(),O(),j(),te(),ne(),re(),oe(),w(),S(),x(),ue(),He(),me(),Me(),Be(),Oe(),z(),Te(),ke(),L(),_e(),Pe(),qe();var Je={"`":"`",'"':`"`,"<":`>`,"{":`}`,"[":`]`,"(":`)`,"'":`'`};function Ye(e,t){if(!new RegExp(t,`i`).test(e)||e.startsWith(`/`))return[];let n=[],r=null,i=0,a=e=>!!e&&/[\p{L}\p{N}_]/u.test(e);for(let t=0;t<e.length;t++){let o=e[t];if(r){if(r===`[`&&o===`[`){i=t;continue}if(o!==Je[r]||r===`'`&&a(e[t+1]))continue;n.push({start:i,end:t+1}),r=null}else (o===`<`&&t+1<e.length&&/[a-zA-Z/]/.test(e[t+1])||o===`'`&&!a(e[t-1])||o!==`<`&&o!==`'`&&o in Je)&&(r=o,i=t)}let o=[],s=RegExp(`\\b${t}\\b`,`gi`),c=e.matchAll(s);for(let t of c){if(t.index===void 0)continue;let r=t.index,i=r+t[0].length;if(n.some(e=>r>=e.start&&r<e.end))continue;let s=e[r-1],c=e[i];s===`/`||s===`\\`||s===`-`||c===`/`||c===`\\`||c===`-`||c===`?`||c===`.`&&a(e[i+1])||o.push({word:t[0],start:r,end:i})}return o}function J(e){return Ye(e,`ultraplan`)}function Xe(e){return Ye(e,`ultrareview`)}function Ze(e){return J(e).length>0}function Qe(e){let[t]=J(e);if(!t)return e;let n=e.slice(0,t.start),r=e.slice(t.end);return(n+r).trim()?n+t.word.slice(5)+r:``}function $e(e){let t=e.toLowerCase();return/\b(wtf|wth|ffs|omfg|shit(ty|tiest)?|dumbass|horrible|awful|piss(ed|ing)? off|piece of (shit|crap|junk)|what the (fuck|hell)|fucking? (broken|useless|terrible|awful|horrible)|fuck you|screw (this|you)|so frustrating|this sucks|damn it)\b/.test(t)}function et(e){let t=e.toLowerCase().trim();return t===`continue`?!0:/\b(keep going|go on)\b/.test(t)}function tt(e,t,n,r,i,a,o){let s=K();g(s);let c=typeof e==`string`?e:e.find(e=>e.type===`text`)?.text||``;Ve(c);let l=typeof e==`string`?e:e.findLast(e=>e.type===`text`)?.text||``;return l&&ze(`user_prompt`,{prompt_length:String(l.length),prompt:Re(l),"prompt.id":s}),D(`tengu_input_prompt`,{is_negative:$e(c),is_keep_going:et(c)}),t.length>0?{messages:[U({content:[...typeof e==`string`?e.trim()?[{type:`text`,text:e}]:[]:e,...t],uuid:i,imagePasteIds:n.length>0?n:void 0,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}:{messages:[U({content:e,uuid:i,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}}E(),L();async function nt({input:e,preExpansionInput:t,mode:n,setToolJSX:r,context:i,pastedContents:a,ideSelection:o,messages:s,setUserInputOnProcessing:c,uuid:l,isAlreadyProcessing:u,querySource:d,canUseTool:f,skipSlashCommands:p,bridgeOrigin:m,isMeta:h,skipAttachments:g,autonomy:_}){let v=typeof e==`string`?e:null;n===`prompt`&&v!==null&&!h&&c?.(v),W(`query_process_user_input_base_start`);let y=i.getAppState(),b=await it(e,n,r,i,a,o,s,l,u,d,f,y.toolPermissionContext.mode,p,m,h,g,t,_);if(W(`query_process_user_input_base_end`),!b.shouldQuery)return b;W(`query_hooks_start`);let x=F(e)||``;for await(let t of xe(x,y.toolPermissionContext.mode,i,i.requestPrompt))if(t.message?.type!==`progress`){if(t.blockingError)return{messages:[be(`${we(t.blockingError)}\n\nOriginal prompt: ${e}`,`warning`)],shouldQuery:!1,allowedTools:b.allowedTools};if(t.preventContinuation){let e=t.stopReason?`Operation stopped by hook: ${t.stopReason}`:`Operation stopped by hook`;return b.messages.push(U({content:e})),b.shouldQuery=!1,b}if(t.additionalContexts&&t.additionalContexts.length>0&&b.messages.push(ce({type:`hook_additional_context`,content:t.additionalContexts.map(rt),hookName:`UserPromptSubmit`,toolUseID:`hook-${K()}`,hookEvent:`UserPromptSubmit`})),t.message)switch(t.message.attachment.type){case`hook_success`:if(!t.message.attachment.content)break;b.messages.push({...t.message,attachment:{...t.message.attachment,content:rt(t.message.attachment.content)}});break;default:b.messages.push(t.message);break}}return W(`query_hooks_end`),b}var Y=1e4;function rt(e){return e.length>Y?`${e.substring(0,Y)}… [output truncated - exceeded ${Y} characters]`:e}async function it(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_){let v=null,y=[],b=[],x=e;if(typeof e==`string`)v=e;else if(e.length>0){W(`query_image_processing_start`);let t=[];for(let n of e)if(n.type===`image`){let e=await I(n);if(e.dimensions){let t=R(e.dimensions);t&&b.push(t)}t.push(e.block)}else t.push(n);x=t,W(`query_image_processing_end`);let n=t[t.length-1];n?.type===`text`?(v=n.text,y=t.slice(0,-1)):y=t}if(v===null&&t!==`prompt`)throw Error(`Mode: ${t} requires a string input.`);let S=i?Object.values(i).filter(Fe):[],C=S.map(e=>e.id),w=i?await Ae(i):new Map;W(`query_pasted_image_processing_start`);let T=await Promise.all(S.map(async e=>{let t={type:`image`,source:{type:`base64`,media_type:e.mediaType||`image/png`,data:e.content}};return D(`tengu_pasted_image_resize_attempt`,{original_size_bytes:e.content.length}),{resized:await I(t),originalDimensions:e.dimensions,sourcePath:e.sourcePath??w.get(e.id)}})),E=[];for(let{resized:e,originalDimensions:t,sourcePath:n}of T){if(e.dimensions){let t=R(e.dimensions,n);t&&b.push(t)}else if(t){let e=R(t,n);e&&b.push(e)}else n&&b.push(`[Image source: ${n}]`);E.push(e.block)}W(`query_pasted_image_processing_end`);let O=f;if(p&&v!==null&&v.startsWith(`/`)){let e=Ke(v),t=e?he(e.commandName,r.options.commands):void 0;if(t){let n=V(t,e?.args??``);if(n.ok)O=!1;else{let e=n.reason??`/${De(t)} isn't available over Remote Control.`;return{messages:[U({content:v,uuid:s}),Se(`<local-command-stdout>${e}</local-command-stdout>`)],shouldQuery:!1,resultText:e}}}}if(t===`prompt`&&!r.options.isNonInteractiveSession&&v!==null&&!O&&!v.startsWith(`/`)&&!r.getAppState().ultraplanSessionUrl&&!r.getAppState().ultraplanLaunching&&Ze(g??v)){D(`tengu_ultraplan_keyword`,{});let e=Qe(v).trim(),{processSlashCommand:t}=await import(`./processSlashCommand-BaUdUg3T.js`);return X(await t(`/ultraplan ${e}`,y,E,[],r,n,s,c,u,_),b)}let k=!h&&v!==null&&(t!==`prompt`||O||!v.startsWith(`/`));W(`query_attachment_loading_start`);let A=k?await le(P(v,r,a??null,[],o,l)):[];if(W(`query_attachment_loading_end`),v!==null&&t===`bash`){let{processBashCommand:e}=await import(`./processBashCommand-a8W8aTRu.js`);return X(await e(v,y,A,r,n),b)}if(v!==null&&!O&&v.startsWith(`/`)){let{processSlashCommand:e}=await import(`./processSlashCommand-BaUdUg3T.js`);return X(await e(v,y,E,A,r,n,s,c,u,_),b)}if(v!==null&&t===`prompt`){let e=v.trim(),t=A.find(e=>e.attachment.type===`agent_mention`);if(t){let n=`@agent-${t.attachment.agentType}`,r=e===n;D(`tengu_subagent_at_mention`,{is_subagent_only:r,is_prefix:e.startsWith(n)&&!r})}}return X(tt(x,E,C,A,s,d,m),b)}function X(e,t){return t.length>0&&e.messages.push(U({content:t.map(e=>({type:`text`,text:e})),isMeta:!0})),e}h(),T();function at(e){return e===`Agent`?y:e}function ot(e){let t=b()?.outputStyle??`default`,n={type:`system`,subtype:`init`,cwd:k(),session_id:m(),tools:e.tools.map(e=>at(e.name)),mcp_servers:e.mcpClients.map(e=>({name:e.name,status:e.type})),model:e.model,permissionMode:e.permissionMode,slash_commands:e.commands.filter(e=>e.userInvocable!==!1).map(e=>e.name),apiKeySource:v().source,betas:_(),claude_code_version:`2.6.6`,output_style:t,agents:e.agents.map(e=>e.agentType),skills:e.skills.filter(e=>e.userInvocable!==!1).map(e=>e.name),plugins:e.plugins.map(e=>({name:e.name,path:e.path,source:e.source})),uuid:K()};return n.fast_mode_state=C(e.model,e.fastMode),n}var st=n({MessageSelector:()=>lt,messagesAfterAreOnlySynthetic:()=>_t,selectableUserMessagesFilter:()=>gt});function ct(e){return e.type===`text`}function Z(e){return e===`summarize`||e===`summarize_up_to`}function lt({messages:e,onPreRestore:t,onRestoreMessage:n,onRestoreCode:r,onSummarize:a,onClose:o,preselectedMessage:u}){let p=fe(e=>e.fileHistory),[m,h]=(0,Q.useState)(void 0),g=ye(),_=(0,Q.useMemo)(K,[]),v=(0,Q.useMemo)(()=>[...e.filter(gt),{...U({content:``}),uuid:_}],[e,_]),[y,b]=(0,Q.useState)(v.length-1),x=Math.max(0,Math.min(y-Math.floor($/2),v.length-$)),S=v.length>1,[C,w]=(0,Q.useState)(u),[T,E]=(0,Q.useState)(void 0);(0,Q.useEffect)(()=>{if(!u||!g)return;let e=!1;return pe(p,u.uuid).then(t=>{e||E(t)}),()=>{e=!0}},[u,g,p]);let[O,k]=(0,Q.useState)(!1),[A,j]=(0,Q.useState)(null),[ee,te]=(0,Q.useState)(`both`),[ne,N]=(0,Q.useState)(``),[re,ie]=(0,Q.useState)(``);function oe(e){let t=e?[{value:`both`,label:`Restore code and conversation`},{value:`conversation`,label:`Restore conversation`},{value:`code`,label:`Restore code`}]:[{value:`conversation`,label:`Restore conversation`}],n={type:`input`,placeholder:`add context (optional)`,initialValue:``,allowEmptySubmitToCancel:!0,showLabelWithValue:!0,labelValueSeparator:`: `};return t.push({value:`summarize`,label:`Summarize from here`,...n,onChange:N}),process.env.USER_TYPE===`ant`&&t.push({value:`summarize_up_to`,label:`Summarize up to here`,...n,onChange:ie}),t.push({value:`nevermind`,label:`Never mind`}),t}(0,Q.useEffect)(()=>{D(`tengu_message_selector_opened`,{})},[]);async function se(e){t(),k(!0);try{await n(e),k(!1),o()}catch(e){M(e),k(!1),h(`Failed to restore the conversation:\n${e}`)}}async function P(t){let n=e.indexOf(t);if(D(`tengu_message_selector_selected`,{index_from_end:e.length-1-n,message_type:t.type,is_current_prompt:!1}),!e.includes(t)){o();return}if(!g){await se(t);return}let r=await pe(p,t.uuid);w(t),E(r)}async function ce(e){if(D(`tengu_message_selector_restore_option_selected`,{option:e}),!C){h(`Message not found.`);return}if(e===`nevermind`){u?o():w(void 0);return}if(Z(e)){t(),k(!0),j(e),h(void 0);try{let t=e===`summarize_up_to`?`up_to`:`from`;await a(C,(t===`up_to`?re:ne).trim()||void 0,t),k(!1),j(null),w(void 0),o()}catch(e){M(e),k(!1),j(null),w(void 0),h(`Failed to summarize:\n${e}`)}return}t(),k(!0),h(void 0);let i=null,s=null;if(e===`code`||e===`both`)try{await r(C)}catch(e){i=e,M(i)}if(e===`conversation`||e===`both`)try{await n(C)}catch(e){s=e,M(s)}k(!1),w(void 0),s&&i?h(`Failed to restore the conversation and code:\n${s}\n${i}`):s?h(`Failed to restore the conversation:\n${s}`):i?h(`Failed to restore the code:\n${i}`):o()}let F=Ge(),le=(0,Q.useCallback)(()=>{if(C&&!u){w(void 0);return}D(`tengu_message_selector_cancelled`,{}),o()},[o,C,u]),ue=(0,Q.useCallback)(()=>b(e=>Math.max(0,e-1)),[]),I=(0,Q.useCallback)(()=>b(e=>Math.min(v.length-1,e+1)),[v.length]),L=(0,Q.useCallback)(()=>b(0),[]),de=(0,Q.useCallback)(()=>b(v.length-1),[v.length]),R=(0,Q.useCallback)(()=>{let e=v[y];e&&P(e)},[v,y,P]);d(`confirm:no`,le,{context:`Confirmation`,isActive:!C}),l({"messageSelector:up":ue,"messageSelector:down":I,"messageSelector:top":L,"messageSelector:bottom":de,"messageSelector:select":R},{context:`MessageSelector`,isActive:!O&&!m&&!C&&S});let[z,B]=(0,Q.useState)({});(0,Q.useEffect)(()=>{async function t(){g&&Promise.all(v.map(async(t,n)=>{if(t.uuid!==_){let r=ve(p,t.uuid),i=v.at(n+1),a=r?ht(e,t.uuid,i?.uuid===_?void 0:i?.uuid):void 0;B(a===void 0?e=>({...e,[n]:void 0}):e=>({...e,[n]:a}))}}))}t()},[v,e,_,p,g]);let V=g&&T?.filesChanged&&T.filesChanged.length>0,H=!m&&!C&&!u&&S;return(0,q.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,q.jsx)(c,{color:`suggestion`}),(0,q.jsxs)(f,{flexDirection:`column`,marginX:1,gap:1,children:[(0,q.jsx)(s,{bold:!0,color:`suggestion`,children:`Rewind`}),m&&(0,q.jsx)(q.Fragment,{children:(0,q.jsxs)(s,{color:`error`,children:[`Error: `,m]})}),!S&&(0,q.jsx)(q.Fragment,{children:(0,q.jsx)(s,{children:`Nothing to rewind to yet.`})}),!m&&C&&S&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(s,{children:[`Confirm you want to restore `,!T&&`the conversation `,`to the point before you sent this message:`]}),(0,q.jsxs)(f,{flexDirection:`column`,paddingLeft:1,borderStyle:`single`,borderRight:!1,borderTop:!1,borderBottom:!1,borderLeft:!0,borderLeftDimColor:!0,children:[(0,q.jsx)(mt,{userMessage:C,color:`text`,isCurrent:!1}),(0,q.jsxs)(s,{dimColor:!0,children:[`(`,ae(new Date(C.timestamp)),`)`]})]}),(0,q.jsx)(dt,{selectedRestoreOption:ee,canRestoreCode:!!V,diffStatsForRestore:T}),O&&Z(A)?(0,q.jsxs)(f,{flexDirection:`row`,gap:1,children:[(0,q.jsx)(Ce,{}),(0,q.jsx)(s,{children:`Summarizing…`})]}):(0,q.jsx)(Ee,{isDisabled:O,options:oe(!!V),defaultFocusValue:V?`both`:`conversation`,onFocus:e=>te(e),onChange:e=>ce(e),onCancel:()=>u?o():w(void 0)}),V&&(0,q.jsx)(f,{marginBottom:1,children:(0,q.jsxs)(s,{dimColor:!0,children:[i.warning,` Rewinding does not affect files edited manually or via bash.`]})})]}),H&&(0,q.jsxs)(q.Fragment,{children:[g?(0,q.jsx)(s,{children:`Restore the code and/or conversation to the point before…`}):(0,q.jsx)(s,{children:`Restore and fork the conversation to the point before…`}),(0,q.jsx)(f,{width:`100%`,flexDirection:`column`,children:v.slice(x,x+$).map((e,t)=>{let n=x+t,r=n===y,a=e.uuid===_,o=n in z,c=z[n],l=c?.filesChanged&&c.filesChanged.length;return(0,q.jsxs)(f,{height:g?3:2,overflow:`hidden`,width:`100%`,flexDirection:`row`,children:[(0,q.jsx)(f,{width:2,minWidth:2,children:r?(0,q.jsxs)(s,{color:`permission`,bold:!0,children:[i.pointer,` `]}):(0,q.jsx)(s,{children:` `})}),(0,q.jsxs)(f,{flexDirection:`column`,children:[(0,q.jsx)(f,{flexShrink:1,height:1,overflow:`hidden`,children:(0,q.jsx)(mt,{userMessage:e,color:r?`suggestion`:void 0,isCurrent:a,paddingRight:10})}),g&&o&&(0,q.jsx)(f,{height:1,flexDirection:`row`,children:c?(0,q.jsx)(q.Fragment,{children:(0,q.jsx)(s,{dimColor:!r,color:`inactive`,children:l?(0,q.jsxs)(q.Fragment,{children:[l===1&&c.filesChanged[0]?`${G.basename(c.filesChanged[0])} `:`${l} files changed `,(0,q.jsx)(pt,{diffStats:c})]}):(0,q.jsx)(q.Fragment,{children:`No code changes`})})}):(0,q.jsxs)(s,{dimColor:!0,color:`warning`,children:[i.warning,` No code restore`]})})]})]},e.uuid)})})]}),!C&&(0,q.jsx)(s,{dimColor:!0,italic:!0,children:F.pending?(0,q.jsxs)(q.Fragment,{children:[`Press `,F.keyName,` again to exit`]}):(0,q.jsxs)(q.Fragment,{children:[!m&&S&&`Enter to continue · `,`Esc to exit`]})})]})]})}function ut(e){switch(e){case`summarize`:return`Messages after this point will be summarized.`;case`summarize_up_to`:return`Preceding messages will be summarized. This and subsequent messages will remain unchanged — you will stay at the end of the conversation.`;case`both`:case`conversation`:return`The conversation will be forked.`;case`code`:case`nevermind`:return`The conversation will be unchanged.`}}function dt({selectedRestoreOption:e,canRestoreCode:t,diffStatsForRestore:n}){let r=t&&(e===`both`||e===`code`);return(0,q.jsxs)(f,{flexDirection:`column`,children:[(0,q.jsx)(s,{dimColor:!0,children:ut(e)}),!Z(e)&&(r?(0,q.jsx)(ft,{diffStatsForRestore:n}):(0,q.jsx)(s,{dimColor:!0,children:`The code will be unchanged.`}))]})}function ft({diffStatsForRestore:e}){if(e===void 0)return;if(!e.filesChanged||!e.filesChanged[0])return(0,q.jsx)(s,{dimColor:!0,children:`The code has not changed (nothing will be restored).`});let t=e.filesChanged.length,n=``;return n=t===1?G.basename(e.filesChanged[0]||``):t===2?`${G.basename(e.filesChanged[0]||``)} and ${G.basename(e.filesChanged[1]||``)}`:`${G.basename(e.filesChanged[0]||``)} and ${e.filesChanged.length-1} other files`,(0,q.jsx)(q.Fragment,{children:(0,q.jsxs)(s,{dimColor:!0,children:[`The code will be restored `,(0,q.jsx)(pt,{diffStats:e}),` in `,n,`.`]})})}function pt({diffStats:e}){if(!(!e||!e.filesChanged))return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(s,{color:`diffAddedWord`,children:[`+`,e.insertions,` `]}),(0,q.jsxs)(s,{color:`diffRemovedWord`,children:[`-`,e.deletions]})]})}function mt({userMessage:e,color:t,dimColor:n,isCurrent:r,paddingRight:i}){let{columns:o}=a();if(r)return(0,q.jsx)(f,{width:`100%`,children:(0,q.jsx)(s,{italic:!0,color:t,dimColor:n,children:`(current)`})});let c=e.message.content,l=typeof c==`string`?null:c[c.length-1],u=ee(typeof c==`string`?c.trim():l&&ct(l)?l.text.trim():`(no prompt)`);if(Ie(u))return(0,q.jsx)(f,{flexDirection:`row`,width:`100%`,children:(0,q.jsx)(s,{italic:!0,color:t,dimColor:n,children:`((empty message))`})});if(u.includes(`<bash-input>`)){let e=B(u,`bash-input`);if(e)return(0,q.jsxs)(f,{flexDirection:`row`,width:`100%`,children:[(0,q.jsx)(s,{color:`bashBorder`,children:`!`}),(0,q.jsxs)(s,{color:t,dimColor:n,children:[` `,e]})]})}if(u.includes(`<command-message>`)){let e=B(u,A),r=B(u,`command-args`),i=B(u,`skill-format`)===`true`;if(e)return i?(0,q.jsx)(f,{flexDirection:`row`,width:`100%`,children:(0,q.jsxs)(s,{color:t,dimColor:n,children:[`Skill(`,e,`)`]})}):(0,q.jsx)(f,{flexDirection:`row`,width:`100%`,children:(0,q.jsxs)(s,{color:t,dimColor:n,children:[`/`,e,` `,r]})})}return(0,q.jsx)(f,{flexDirection:`row`,width:`100%`,children:(0,q.jsx)(s,{color:t,dimColor:n,children:i?ie(u,o-i,!0):u.slice(0,500).split(`
|
|
2
|
+
`).slice(0,4).join(`
|
|
3
|
+
`)})})}function ht(e,t,n){let r=e.findIndex(e=>e.uuid===t);if(r===-1)return;let i=n?e.findIndex(e=>e.uuid===n):e.length;i===-1&&(i=e.length);let a=[],o=0,s=0;for(let t=r+1;t<i;t++){let n=e[t];if(!n||!H(n))continue;let r=n.toolUseResult;if(!(!r||!r.filePath||!r.structuredPatch)){a.includes(r.filePath)||a.push(r.filePath);try{if(`type`in r&&r.type===`create`)o+=r.content.split(/\r?\n/).length;else for(let e of r.structuredPatch){let t=N(e.lines,e=>e.startsWith(`+`)),n=N(e.lines,e=>e.startsWith(`-`));o+=t,s+=n}}catch{}}}return{filesChanged:a,insertions:o,deletions:s}}function gt(e){if(e.type!==`user`||Array.isArray(e.message.content)&&e.message.content[0]?.type===`tool_result`||ge(e)||e.isMeta||e.isCompactSummary||e.isVisibleInTranscriptOnly)return!1;let t=e.message.content,n=typeof t==`string`?null:t[t.length-1],r=typeof t==`string`?t.trim():n&&ct(n)?n.text.trim():``;return!(r.indexOf(`<local-command-stdout>`)!==-1||r.indexOf(`<local-command-stderr>`)!==-1||r.indexOf(`<bash-stdout>`)!==-1||r.indexOf(`<bash-stderr>`)!==-1||r.indexOf(`<task-notification>`)!==-1||r.indexOf(`<tick>`)!==-1||r.indexOf(`<teammate-message`)!==-1)}function _t(e,t){for(let n=t+1;n<e.length;n++){let t=e[n];if(t&&!ge(t)&&!H(t)&&t.type!==`progress`&&t.type!==`system`&&t.type!==`attachment`&&!(t.type===`user`&&t.isMeta)){if(t.type===`assistant`){let e=t.message.content;if(Array.isArray(e)&&e.some(e=>e.type===`text`&&e.text.trim()||e.type===`tool_use`))return!1;continue}if(t.type===`user`)return!1}}return!0}var Q,$,vt=e((()=>{Q=t(o(),1),E(),de(),je(),We(),Ue(),L(),se(),Ne(),Le(),$=7}));export{gt as a,nt as c,_t as i,J as l,st as n,ot as o,vt as r,at as s,lt as t,Xe as u};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{a as e,n as t,o as n,r}from"./chunk-DR8-3Aex.js";import{s as i,u as a}from"./envUtils-BWeoiL4Y.js";import{n as o,t as s}from"./figures-gfT9mM8P.js";import{B as c,Cn as l,F as u,Ft as d,In as f,Ln as p,Lt as m,Rn as h,W as g,b as _,m as v,t as y,v as b,x,y as S}from"./src-Di342QoJ.js";import{t as C}from"./jsx-runtime-D-D469L8.js";import{L as w,W as ee,cn as T,y as E}from"./state-sIHsFpDu.js";import{Ac as D,Gs as O,Gt as te,Hs as ne,Ht as k,Ka as re,Ko as ie,Lr as A,Pc as j,Po as M,Pr as N,S as ae,Sc as P,Ur as oe,Zc as F,dn as I,el as se,g as L,jo as ce,on as le,oo as ue,qo as de,qt as fe}from"./paths-1ngPRtu3.js";import{c as pe,d as R,i as me,l as he,s as ge}from"./debug-UI3T040K.js";import{n as _e,r as z}from"./analytics-DqMQntaB.js";import{n as ve,t as ye}from"./cwd--iizewsn.js";import{a as be,n as xe}from"./env-chR0gV31.js";import{H as B,V as Se,W as Ce,et as we}from"./log-CzsijfHZ.js";import{C as Te,g as Ee,m as De,n as Oe,r as ke,t as Ae,x as je}from"./startupProfiler-DnXZaX4A.js";import{n as Me,t as Ne}from"./sleep-8Eb9j_Ly.js";import{$A as Pe,$o as Fe,$w as Ie,Ah as Le,Ao as Re,Bg as ze,Bo as Be,Bx as Ve,Ck as He,Cu as Ue,Cv as We,DD as Ge,Dh as Ke,Eh as qe,Es as Je,Fu as Ye,Go as Xe,Io as Ze,Iu as Qe,Jo as $e,Jw as et,Jy as tt,Kw as nt,Lo as rt,Lu as it,Lx as at,Mo as ot,Ms as st,Mu as ct,NS as lt,Ng as ut,Nu as dt,OD as ft,Oh as pt,Oo as mt,PS as ht,Pg as gt,Pu as _t,Qb as vt,Qg as yt,Qw as bt,Rx as xt,So as St,Sv as Ct,Vg as wt,Ww as Tt,Xa as Et,Xw as Dt,YA as Ot,Ya as kt,Yo as At,Yw as jt,Yx as Mt,Za as Nt,Zg as Pt,_k as Ft,bk as It,dw as Lt,ex as Rt,hx as zt,io as Bt,ix as Vt,jo as Ht,kh as Ut,ko as Wt,lo as Gt,lw as Kt,lx as qt,mx as Jt,oA as Yt,qw as Xt,qx as Zt,rA as Qt,ro as $t,xk as en,xo as tn,zw as nn}from"./loadAgentsDir-D7kapZB5.js";import{Vn as rn,zn as an}from"./prompt-BBg3jtfc.js";import{f as on,p as sn}from"./xml-DTMvLcPg.js";import{C as cn,y as ln}from"./rcDebugLog-CPGWJbI4.js";import{n as un,r as dn,t as fn}from"./browser-fLRXxIsQ.js";import{d as pn,f as mn,h as hn,p as gn}from"./terminalSetup-bSbq4LE7.js";import{a as _n,o as vn,r as yn,s as bn,t as xn}from"./referral-BKeCKnOJ.js";import{n as Sn,t as Cn}from"./SentryErrorBoundary-iih9eFpM.js";import{a as wn,n as Tn}from"./voiceModeEnabled-168-1Ocs.js";import{c as En,r as Dn}from"./releaseNotes-CvfZb3fZ.js";import{a as On,c as kn,d as An,i as jn,l as Mn,n as Nn,o as Pn,r as Fn,t as In,u as Ln}from"./logoV2Utils-DjThKW15.js";import{n as Rn,t as zn}from"./systemTheme-dDbitcxB.js";import{n as Bn,r as Vn}from"./PromptInputFooterSuggestions-ihnbjU0K.js";import{n as Hn,t as Un}from"./useMainLoopModel-Os8Ao8-x.js";import{n as Wn,t as Gn}from"./modalContext-CmSKRyea.js";import{i as Kn,n as qn,r as Jn,s as Yn,t as Xn}from"./OverageCreditUpsell-abcPm3PB.js";import{n as Zn,r as Qn,t as $n}from"./statusNoticeHelpers-cnI4TiGw.js";import{homedir as er}from"os";import{relative as tr}from"path";import{fileURLToPath as nr}from"url";function rr(e,t){for(let n of e)if(!t.has(n))return!1;return!0}var ir=t((()=>{}));function ar(e){if(e.type!==`user`)return!1;let t=Array.isArray(e.message.content)?e.message.content[0]:void 0;return!t||typeof t==`string`||t?.type!==`text`||!t.text.includes(`<task-notification`)||St(t.text,`status`)!==`completed`?!1:St(t.text,`summary`)?.startsWith(`Background command `)??!1}function or(e,t){if(!Mt()||t)return e;let n=[],r=0;for(;r<e.length;){let t=e[r];if(ar(t)){let i=0;for(;r<e.length&&ar(e[r]);)i++,r++;i===1?n.push(t):n.push({...t,message:{role:`user`,content:[{type:`text`,text:`<${Ce}><${Se}>completed</${Se}><${B}>${i} background commands completed</${B}></${Ce}>`}]}})}else n.push(t),r++}return n}var sr=t((()=>{we(),Ue(),Zt(),rt()}));function cr(e){return e.type===`system`&&e.subtype===`stop_hook_summary`&&e.hookLabel!==void 0}function lr(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(cr(r)){let i=r.hookLabel,a=[];for(;n<e.length;){let t=e[n];if(!cr(t)||t.hookLabel!==i)break;a.push(t),n++}a.length===1?t.push(r):t.push({...r,hookCount:a.reduce((e,t)=>e+t.hookCount,0),hookInfos:a.flatMap(e=>e.hookInfos),hookErrors:a.flatMap(e=>e.hookErrors),preventedContinuation:a.some(e=>e.preventedContinuation),hasOutput:a.some(e=>e.hasOutput),totalDurationMs:Math.max(...a.map(e=>e.totalDurationMs??0))})}else t.push(r),n++}return t}var ur=t((()=>{}));function dr(e){return e.type===`attachment`&&e.attachment.type===`task_status`&&e.attachment.taskType===`in_process_teammate`&&e.attachment.status===`completed`}function fr(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(dr(r)){let i=0;for(;n<e.length&&dr(e[n]);)i++,n++;i===1?t.push(r):t.push({type:`attachment`,uuid:r.uuid,timestamp:r.timestamp,attachment:{type:`teammate_shutdown_batch`,count:i}})}else t.push(r),n++}return t}var pr=t((()=>{}));function mr(e){let t=_r.get(e);return t||(t=new Set(e.filter(e=>e.renderGroupedToolUse).map(e=>e.name)),_r.set(e,t)),t}function hr(e){if(e.type===`assistant`&&e.message?.content&&Array.isArray(e.message.content)&&e.message.content[0]?.type===`tool_use`){let t=e.message.content[0];return{messageId:e.message.id,toolUseId:t.id,toolName:t.name}}return null}function gr(e,t,n=!1){if(n)return{messages:e};let r=mr(t),i=new Map;for(let t of e){let e=hr(t);if(e&&r.has(e.toolName)){let n=`${e.messageId}:${e.toolName}`,r=i.get(n)??[];r.push(t),i.set(n,r)}}let a=new Map,o=new Set;for(let[e,t]of i)if(t.length>=2){a.set(e,t);for(let e of t){let t=hr(e);t&&o.add(t.toolUseId)}}let s=new Map;for(let t of e)if(t.type===`user`&&t.message?.content&&Array.isArray(t.message.content))for(let e of t.message.content)e.type===`tool_result`&&o.has(e.tool_use_id)&&s.set(e.tool_use_id,t);let c=[],l=new Set;for(let t of e){let e=hr(t);if(e){let t=`${e.messageId}:${e.toolName}`,n=a.get(t);if(n){if(!l.has(t)){l.add(t);let r=n[0],i=[];for(let e of n){let t=e.message.content[0].id,n=s.get(t);n&&i.push(n)}let a={type:`grouped_tool_use`,toolName:e.toolName,messages:n,results:i,displayMessage:r,uuid:`grouped-${r.uuid}`,timestamp:r.timestamp,messageId:e.messageId};c.push(a)}continue}}if(t.type===`user`&&t.message?.content&&Array.isArray(t.message.content)){let e=t.message.content.filter(e=>e.type===`tool_result`);if(e.length>0&&e.every(e=>o.has(e.tool_use_id)))continue}c.push(t)}return{messages:c}}var _r,vr=t((()=>{_r=new WeakMap}));function yr(e){let t=Tr.get(e);if(t!==void 0)return t;let n=br(e).toLowerCase();return Tr.set(e,n),n}function br(e){let t=``;switch(e.type){case`user`:{let n=e.message.content;if(typeof n==`string`)t=wr.has(n)?``:n;else{let r=[];for(let t of n??[])t.type===`text`?wr.has(t.text)||r.push(t.text):t.type===`tool_result`&&r.push(Sr(e.toolUseResult));t=r.join(`
|
|
2
|
+
`)}break}case`assistant`:{let n=e.message.content;Array.isArray(n)&&(t=n.flatMap(e=>e.type===`text`?[e.text]:e.type===`tool_use`?[xr(e.input)]:[]).join(`
|
|
3
|
+
`));break}case`attachment`:if(e.attachment.type===`relevant_memories`)t=(e.attachment.memories??[]).map(e=>e.content).join(`
|
|
4
|
+
`);else if(e.attachment.type===`queued_command`&&e.attachment.commandMode!==`task-notification`&&!e.attachment.isMeta){let n=e.attachment.prompt;t=typeof n==`string`?n:n.flatMap(e=>e.type===`text`?[e.text]:[]).join(`
|
|
5
|
+
`)}break;case`collapsed_read_search`:e.relevantMemories&&(t=e.relevantMemories.map(e=>e.content).join(`
|
|
6
|
+
`));break;default:break}let n=t,r=n.indexOf(`<system-reminder>`);for(;r>=0;){let e=n.indexOf(Cr,r);if(e<0)break;n=n.slice(0,r)+n.slice(e+18),r=n.indexOf(`<system-reminder>`)}return n}function xr(e){if(!e||typeof e!=`object`)return``;let t=e,n=[];for(let e of[`command`,`pattern`,`file_path`,`path`,`prompt`,`description`,`query`,`url`,`skill`]){let r=t[e];typeof r==`string`&&n.push(r)}for(let e of[`args`,`files`]){let r=t[e];Array.isArray(r)&&r.every(e=>typeof e==`string`)&&n.push(r.join(` `))}return n.join(`
|
|
7
|
+
`)}function Sr(e){if(!e||typeof e!=`object`)return typeof e==`string`?e:``;let t=e;if(typeof t.stdout==`string`){let e=typeof t.stderr==`string`?t.stderr:``;return t.stdout+(e?`
|
|
8
|
+
`+e:``)}if(t.file&&typeof t.file==`object`&&typeof t.file.content==`string`)return t.file.content;let n=[];for(let e of[`content`,`output`,`result`,`text`,`message`]){let r=t[e];typeof r==`string`&&n.push(r)}for(let e of[`filenames`,`lines`,`results`]){let r=t[e];Array.isArray(r)&&r.every(e=>typeof e==`string`)&&n.push(r.join(`
|
|
9
|
+
`))}return n.join(`
|
|
10
|
+
`)}var Cr,wr,Tr,Er=t((()=>{rt(),Cr=`</system-reminder>`,wr=new Set([Et,Nt]),Tr=new WeakMap}));function Dr({pose:e=`default`}={}){if(xe.terminal===`Apple_Terminal`)return(0,V.jsx)(Or,{pose:e});let t=kr[e];return(0,V.jsxs)(x,{flexDirection:`column`,children:[(0,V.jsxs)(_,{children:[(0,V.jsx)(_,{color:`clawd_body`,children:t.r1L}),(0,V.jsx)(_,{color:`clawd_body`,backgroundColor:`clawd_background`,children:t.r1E}),(0,V.jsx)(_,{color:`clawd_body`,children:t.r1R})]}),(0,V.jsxs)(_,{children:[(0,V.jsx)(_,{color:`clawd_body`,children:t.r2L}),(0,V.jsx)(_,{color:`clawd_body`,backgroundColor:`clawd_background`,children:`█████`}),(0,V.jsx)(_,{color:`clawd_body`,children:t.r2R})]}),(0,V.jsxs)(_,{color:`clawd_body`,children:[` `,`▘▘ ▝▝`,` `]})]})}function Or({pose:e}){return(0,V.jsxs)(x,{flexDirection:`column`,alignItems:`center`,children:[(0,V.jsxs)(_,{children:[(0,V.jsx)(_,{color:`clawd_body`,children:`▗`}),(0,V.jsx)(_,{color:`clawd_background`,backgroundColor:`clawd_body`,children:Ar[e]}),(0,V.jsx)(_,{color:`clawd_body`,children:`▖`})]}),(0,V.jsx)(_,{backgroundColor:`clawd_body`,children:` `.repeat(7)}),(0,V.jsx)(_,{color:`clawd_body`,children:`▘▘ ▝▝`})]})}var V,kr,Ar,jr=t((()=>{h(),y(),be(),V=C(),kr={default:{r1L:` ▐`,r1E:`▛███▜`,r1R:`▌`,r2L:`▝▜`,r2R:`▛▘`},"look-left":{r1L:` ▐`,r1E:`▟███▟`,r1R:`▌`,r2L:`▝▜`,r2R:`▛▘`},"look-right":{r1L:` ▐`,r1E:`▙███▙`,r1R:`▌`,r2L:`▝▜`,r2R:`▛▘`},"arms-up":{r1L:`▗▟`,r1E:`▛███▜`,r1R:`▙▖`,r2L:` ▜`,r2R:`▛ `}},Ar={default:` ▗ ▖ `,"look-left":` ▘ ▘ `,"look-right":` ▝ ▝ `,"arms-up":` ▗ ▖ `}}));function Mr(e){let{title:t,lines:n,footer:r,emptyMessage:i,customContent:a}=e,o=l(t);if(a!==void 0)o=Math.max(o,a.width);else if(n.length===0&&i)o=Math.max(o,l(i));else{let e=Math.max(0,...n.map(e=>e.timestamp?l(e.timestamp):0));for(let t of n){let n=e>0?e:0,r=l(t.text)+(n>0?n+2:0);o=Math.max(o,r)}}return r&&(o=Math.max(o,l(r))),o}function Nr({config:e,actualWidth:t}){let{title:n,lines:r,footer:i,emptyMessage:a,customContent:o}=e,s=Math.max(0,...r.map(e=>e.timestamp?l(e.timestamp):0));return(0,H.jsxs)(x,{flexDirection:`column`,width:t,children:[(0,H.jsx)(_,{bold:!0,color:`claude`,children:n}),o?(0,H.jsxs)(H.Fragment,{children:[o.content,i&&(0,H.jsx)(_,{dimColor:!0,italic:!0,children:Te(i,t)})]}):r.length===0&&a?(0,H.jsx)(_,{dimColor:!0,children:Te(a,t)}):(0,H.jsxs)(H.Fragment,{children:[r.map((e,n)=>{let r=Math.max(10,t-(s>0?s+2:0));return(0,H.jsxs)(_,{children:[s>0&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(_,{dimColor:!0,children:(e.timestamp||``).padEnd(s)}),` `]}),(0,H.jsx)(_,{children:Te(e.text,r)})]},n)}),i&&(0,H.jsx)(_,{dimColor:!0,italic:!0,children:Te(i,t)})]})]})}var H,Pr=t((()=>{h(),y(),je(),H=C()}));function Fr({feeds:e,maxWidth:t}){let n=e.map(e=>Mr(e)),r=Math.max(...n),i=Math.min(r,t);return(0,Lr.jsx)(x,{flexDirection:`column`,children:e.map((t,n)=>(0,Lr.jsxs)(Ir.Fragment,{children:[(0,Lr.jsx)(Nr,{config:t,actualWidth:i}),n<e.length-1&&(0,Lr.jsx)(v,{color:`claude`,width:i})]},n))})}var Ir,Lr,Rr=t((()=>{Ir=n(h(),1),y(),Pr(),Lr=C()}));function zr(e){let t=e.map(e=>{let t=Ee(e.modified);return{text:(e.summary&&e.summary!==`No prompt`?e.summary:e.firstPrompt)||``,timestamp:t}});return{title:`Recent activity`,lines:t,footer:t.length>0?`/resume for more`:void 0,emptyMessage:`No recent activity`}}function Br(e){let t=e.map(e=>{if(process.env.USER_TYPE===`ant`){let t=e.match(/^(\d+\s+\w+\s+ago)\s+(.+)$/);if(t)return{timestamp:t[1],text:t[2]||``}}return{text:e}}),n=process.env.USER_TYPE===`ant`?`Unable to fetch latest claude-cli-internal commits`:`Check the Claude Code changelog for updates`;return{title:process.env.USER_TYPE===`ant`?`What's new [ANT-ONLY: Latest CC commits]`:`What's new`,lines:t,footer:t.length>0?`/release-notes for more`:void 0,emptyMessage:n}}function Vr(e){let t=e.filter(({isEnabled:e})=>e).sort((e,t)=>Number(e.isComplete)-Number(t.isComplete)).map(({text:e,isComplete:t})=>({text:`${t?`${s.tick} `:``}${e}`})),n=ye()===er()?`Note: You have launched claude in your home directory. For the best experience, launch it in a project directory instead.`:void 0;return n&&t.push({text:n}),{title:`Tips for getting started`,lines:t}}function Hr(){let e=_n(),t=e?`Share Claude Code and earn ${yn(e)} of extra usage`:`Share Claude Code with friends`;return{title:`3 guest passes`,lines:[],customContent:{content:(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)(x,{marginY:1,children:(0,Ur.jsx)(_,{color:`claude`,children:`[✻] [✻] [✻]`})}),(0,Ur.jsx)(_,{dimColor:!0,children:t})]}),width:48},footer:`/passes`}}var Ur,Wr=t((()=>{o(),y(),bn(),ve(),je(),Ur=C()}));function U(e,t,n){return Array.from({length:n},()=>({pose:e,offset:t}))}function Gr(){let{pose:e,bounceOffset:t,onClick:n}=Kr();return(0,Jr.jsx)(x,{height:ei,flexDirection:`column`,onClick:n,children:(0,Jr.jsx)(x,{marginTop:t,flexShrink:0,children:(0,Jr.jsx)(Dr,{pose:e})})})}function Kr(){let[e]=(0,qr.useState)(()=>re().prefersReducedMotion??!1),[t,n]=(0,qr.useState)(-1),r=(0,qr.useRef)(Yr),i=()=>{e||t!==-1||(r.current=Xr[Math.floor(Math.random()*Xr.length)],n(0))};(0,qr.useEffect)(()=>{if(t===-1)return;if(t>=r.current.length){n(-1);return}let e=setTimeout(n,Qr,$r);return()=>clearTimeout(e)},[t]);let a=r.current,o=t>=0&&t<a.length?a[t]:Zr;return{pose:o.pose,bounceOffset:o.offset,onClick:i}}var qr,Jr,Yr,Xr,Zr,Qr,$r,ei,ti=t((()=>{h(),qr=n(h(),1),y(),ue(),jr(),Jr=C(),Yr=[...U(`default`,1,2),...U(`arms-up`,0,3),...U(`default`,0,1),...U(`default`,1,2),...U(`arms-up`,0,3),...U(`default`,0,1)],Xr=[Yr,[...U(`look-right`,0,5),...U(`look-left`,0,5),...U(`default`,0,1)]],Zr={pose:`default`,offset:0},Qr=60,$r=e=>e+1,ei=3}));function ni(){let e=vn();e==null||e<=0||e>(P().passesLastSeenRemaining??0)&&j(t=>({...t,passesUpsellSeenCount:0,hasVisitedPasses:!1,passesLastSeenRemaining:e}))}function ri(){let{eligible:e,hasCache:t}=xn();if(!e||!t)return!1;ni();let n=P();return!((n.passesUpsellSeenCount??0)>=3||n.hasVisitedPasses)}function ii(){let[e]=(0,si.useState)(()=>ri());return e}function ai(){let e=0;j(t=>(e=(t.passesUpsellSeenCount??0)+1,{...t,passesUpsellSeenCount:e})),z(`tengu_guest_passes_upsell_shown`,{seen_count:e})}function oi(){let e=_n();return(0,ci.jsxs)(_,{dimColor:!0,children:[(0,ci.jsx)(_,{color:`claude`,children:`[✻]`}),` `,(0,ci.jsx)(_,{color:`claude`,children:`[✻]`}),` `,(0,ci.jsx)(_,{color:`claude`,children:`[✻]`}),` ·`,` `,e?`Share Claude Code and earn ${yn(e)} of extra usage · /passes`:`3 guest passes at /passes`]})}var si,ci,li=t((()=>{h(),si=n(h(),1),y(),_e(),bn(),D(),ci=C()}));function ui(){let{columns:e}=u(),t=ht(e=>e.agent),n=ht(e=>e.effortValue),r=Hn(),i=oe(r),{version:a,cwd:o,billingType:s,agentName:c}=Pn(),d=t??c,f=ii(),p=Yn();(0,di.useEffect)(()=>{f&&ai()},[f]),(0,di.useEffect)(()=>{p&&!f&&Jn()},[p,f]);let m=Math.max(e-15,20),h=Te(a,Math.max(m-13,6)),{shouldSplit:g,truncatedModel:v,truncatedBilling:y}=Fn(i+Ot(r,n),s,m),b=d?m-1-l(d)-3:m,S=An(o,Math.max(b,10));return(0,W.jsx)(Ut,{children:(0,W.jsxs)(x,{flexDirection:`row`,gap:2,alignItems:`center`,children:[Mt()?(0,W.jsx)(Gr,{}):(0,W.jsx)(Dr,{}),(0,W.jsxs)(x,{flexDirection:`column`,children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(_,{bold:!0,children:`Claude Code`}),` `,(0,W.jsxs)(_,{dimColor:!0,children:[`v`,h]})]}),g?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(_,{dimColor:!0,children:v}),(0,W.jsx)(_,{dimColor:!0,children:y})]}):(0,W.jsxs)(_,{dimColor:!0,children:[v,` · `,y]}),(0,W.jsx)(_,{dimColor:!0,children:d?`@${d} · ${S}`:S}),f&&(0,W.jsx)(oi,{}),!f&&p&&(0,W.jsx)(Xn,{maxWidth:m,twoLine:!0})]})]})})}var di,W,fi=t((()=>{di=n(h(),1),Un(),nn(),y(),lt(),Pe(),je(),Zt(),Ln(),N(),Le(),ti(),jr(),li(),Kn(),W=C()}));function pi(){let e=(0,hi.useMemo)(mi,[]),t=(0,hi.useMemo)(()=>P().lastShownEmergencyTip,[]),n=e.tip&&e.tip!==t;return(0,hi.useEffect)(()=>{n&&j(t=>t.lastShownEmergencyTip===e.tip?t:{...t,lastShownEmergencyTip:e.tip})},[n,e.tip]),n?(0,gi.jsx)(x,{paddingLeft:2,flexDirection:`column`,children:(0,gi.jsx)(_,{...e.color===`warning`?{color:`warning`}:e.color===`error`?{color:`error`}:{dimColor:!0},children:e.tip})}):null}function mi(){return L(_i,vi)}var hi,gi,_i,vi,yi=t((()=>{h(),hi=n(h(),1),y(),ae(),D(),gi=C(),_i=`tengu-top-of-feed-tip`,vi={tip:``,color:`dim`}}));function bi({char:e=`✻`}){let[t]=(0,xi.useState)(()=>re().prefersReducedMotion??!1),[n,r]=(0,xi.useState)(t),i=(0,xi.useRef)(null),[a,o]=c(n?null:50);return(0,xi.useEffect)(()=>{if(n)return;let e=setTimeout(r,wi,!0);return()=>clearTimeout(e)},[n]),n?(0,Si.jsx)(x,{ref:a,children:(0,Si.jsx)(_,{color:Ti,children:e})}):(i.current===null&&(i.current=o),(0,Si.jsx)(x,{ref:a,children:(0,Si.jsx)(_,{color:Ve(at((o-i.current)/Ci*360%360)),children:e})}))}var xi,Si,Ci,wi,Ti,Ei=t((()=>{h(),xi=n(h(),1),O(),y(),ue(),xt(),Si=C(),Ci=1500,wi=Ci*2,Ti=Ve({r:153,g:153,b:153})}));function Di(){return A()&&(P().opus1mMergeNoticeSeenCount??0)<ji}function Oi(){let[e]=(0,ki.useState)(Di);return(0,ki.useEffect)(()=>{if(!e)return;let t=(P().opus1mMergeNoticeSeenCount??0)+1;j(e=>(e.opus1mMergeNoticeSeenCount??0)>=t?e:{...e,opus1mMergeNoticeSeenCount:t})},[e]),e?(0,Ai.jsxs)(x,{paddingLeft:2,children:[(0,Ai.jsx)(bi,{char:`↑`}),(0,Ai.jsx)(_,{dimColor:!0,children:` Opus now defaults to 1M context · 5x more room, same pricing`})]}):null}var ki,Ai,ji,Mi=t((()=>{h(),ki=n(h(),1),O(),y(),D(),N(),Ei(),Ai=C(),ji=6}));function Ni(){return(0,Ii.jsx)(Pi,{})}function Pi(){let[e]=(0,Fi.useState)(()=>wn()&&re().voiceEnabled!==!0&&(P().voiceNoticeSeenCount??0)<Li&&!Di());return(0,Fi.useEffect)(()=>{if(!e)return;let t=(P().voiceNoticeSeenCount??0)+1;j(e=>(e.voiceNoticeSeenCount??0)>=t?e:{...e,voiceNoticeSeenCount:t})},[e]),e?(0,Ii.jsxs)(x,{paddingLeft:2,children:[(0,Ii.jsx)(bi,{}),(0,Ii.jsx)(_,{dimColor:!0,children:` Voice mode is now available · /voice to enable`})]}):null}var Fi,Ii,Li,Ri=t((()=>{h(),Fi=n(h(),1),y(),D(),ue(),Tn(),Ei(),Mi(),Ii=C(),Li=3}));function zi(){return null}var Bi=t((()=>{}));function Vi(){return null}var Hi=t((()=>{})),Ui=r({ChannelsNotice:()=>Wi,findUnmatched:()=>Ki});function Wi(){let[{channels:e,list:t,unmatched:n}]=(0,qi.useState)(()=>{let e=E();return e.length===0?{channels:e,list:``,unmatched:[]}:{channels:e,list:e.map(Gi).join(`, `),unmatched:Ki(e)}});if(e.length===0)return null;let r=e.some(e=>!e.dev),i=w()&&r?`Channels`:w()?`--dangerously-load-development-channels`:`--channels`;return(0,Ji.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,Ji.jsxs)(_,{color:`error`,children:[`Listening for channel messages from: `,t]}),(0,Ji.jsxs)(_,{dimColor:!0,children:[`Experimental · inbound messages will be pushed into this session, this carries prompt injection risks. Restart Claude Code without `,i,` to disable.`]}),n.map(e=>(0,Ji.jsxs)(_,{color:`warning`,children:[Gi(e.entry),` · `,e.why]},`${Gi(e.entry)}:${e.why}`))]})}function Gi(e){return e.kind===`plugin`?`plugin:${e.name}@${e.marketplace}`:`server:${e.name}`}function Ki(e,t){let n=t?.configuredServerNames??(()=>{let e=[`enterprise`,`user`,`project`,`local`],t=new Set;for(let n of e)for(let e of Object.keys(Kt(n).servers))t.add(e);return t})(),r=t?.installedPluginIds??(()=>{let e=new Set(Object.keys(st().plugins)),t=on();for(let n of[...t.enabled,...t.disabled])e.add(n.source);return e})(),i=[];for(let t of e){if(t.kind===`server`){n.has(t.name)||i.push({entry:t,why:`no MCP server configured with that name`});continue}r.has(`${t.name}@${t.marketplace}`)||i.push({entry:t,why:`plugin not installed`})}return i}var qi,Ji,Yi=t((()=>{h(),qi=n(h(),1),T(),sn(),y(),Lt(),Je(),Ji=C()}));function Xi(){let e=kn(),t=P().oauthAccount?.displayName??``,{columns:n}=u(),r=hn(),i=Qt.isSandboxingEnabled(),o=ii(),s=Yn(),c=ht(e=>e.agent),d=ht(e=>e.effortValue),f=P(),p;try{p=Mn(3)}catch{p=[]}let[m]=(0,Zi.useState)(()=>{let e=re().companyAnnouncements;if(!(!e||e.length===0))return f.numStartups===1?e[0]:e[Math.floor(Math.random()*e.length)]}),{hasReleaseNotes:h}=Dn(f.lastReleaseNotesSeen);(0,Zi.useEffect)(()=>{P().lastReleaseNotesSeen!==`2.6.6`&&(j(e=>e.lastReleaseNotesSeen===`2.6.6`?e:{...e,lastReleaseNotesSeen:`2.6.6`}),r&&mn())},[f,r]);let g=!h&&!r&&!a(process.env.CLAUDE_CODE_FORCE_FULL_LOGO);(0,Zi.useEffect)(()=>{o&&!r&&!g&&ai()},[o,r,g]),(0,Zi.useEffect)(()=>{s&&!r&&!o&&!g&&Jn()},[s,r,o,g]);let v=Hn(),y=oe(v),{version:S,cwd:C,billingType:w,agentName:ee}=Pn(),T=c??ee,E=Te(y+Ot(v,d),$i-20);if(!h&&!r&&!a(process.env.CLAUDE_CODE_FORCE_FULL_LOGO))return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(ui,{}),(0,G.jsx)(Ni,{}),(0,G.jsx)(Oi,{}),Qi&&(0,G.jsx)(Qi.ChannelsNotice,{}),pe()&&(0,G.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(_,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(_,{dimColor:!0,children:[`Logging to: `,he()?`stderr`:me()]})]}),(0,G.jsx)(pi,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,G.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(_,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,G.jsx)(_,{dimColor:!0,children:process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),m&&(0,G.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&f.oauthAccount?.organizationName&&(0,G.jsxs)(_,{dimColor:!0,children:[`Message from `,f.oauthAccount.organizationName,`:`]}),(0,G.jsx)(_,{children:m})]}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsx)(x,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(_,{dimColor:!0,children:`Use /issue to report model behavior issues`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(_,{color:`warning`,children:`[ANT-ONLY] Logs:`}),(0,G.jsxs)(_,{dimColor:!0,children:[`API calls: `,F(Ge())]}),(0,G.jsxs)(_,{dimColor:!0,children:[`Debug logs: `,F(me())]}),ke()&&(0,G.jsxs)(_,{dimColor:!0,children:[`Startup Perf: `,F(Ae())]})]}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(zi,{}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Vi,{})]});let D=On(n),O=Rn(P().theme),te=` ${b(`claude`,O)(`Claude Code`)} ${b(`inactive`,O)(`v${S}`)} `,ne=b(`claude`,O)(` Claude Code `);if(D===`compact`){let e=jn(t);l(e)>n-4&&(e=jn(null));let r=T?n-4-1-l(T)-3:n-4,a=An(C,Math.max(r,10));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Ut,{children:(0,G.jsxs)(x,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:ne,position:`top`,align:`start`,offset:1},paddingX:1,paddingY:1,alignItems:`center`,width:n,children:[(0,G.jsx)(_,{bold:!0,children:e}),(0,G.jsx)(x,{marginY:1,children:(0,G.jsx)(Dr,{})}),(0,G.jsx)(_,{dimColor:!0,children:E}),(0,G.jsx)(_,{dimColor:!0,children:w}),(0,G.jsx)(_,{dimColor:!0,children:T?`@${T} · ${a}`:a})]})}),(0,G.jsx)(Ni,{}),(0,G.jsx)(Oi,{}),Qi&&(0,G.jsx)(Qi.ChannelsNotice,{}),i&&(0,G.jsx)(x,{marginTop:1,flexDirection:`column`,children:(0,G.jsx)(_,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(zi,{}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Vi,{})]})}let k=jn(t),ie=!process.env.IS_DEMO&&f.oauthAccount?.organizationName?`${E} · ${w} · ${f.oauthAccount.organizationName}`:`${E} · ${w}`,A=T?$i-1-l(T)-3:$i,M=An(C,Math.max(A,10)),N=T?`@${T} · ${M}`:M,{leftWidth:ae,rightWidth:I}=In(n,D,Nn(k,N,ie));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Ut,{children:(0,G.jsx)(x,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:te,position:`top`,align:`start`,offset:3},children:(0,G.jsxs)(x,{flexDirection:D===`horizontal`?`row`:`column`,paddingX:1,gap:1,children:[(0,G.jsxs)(x,{flexDirection:`column`,width:ae,justifyContent:`space-between`,alignItems:`center`,minHeight:9,children:[(0,G.jsx)(x,{marginTop:1,children:(0,G.jsx)(_,{bold:!0,children:k})}),(0,G.jsx)(Dr,{}),(0,G.jsxs)(x,{flexDirection:`column`,alignItems:`center`,children:[(0,G.jsx)(_,{dimColor:!0,children:ie}),(0,G.jsx)(_,{dimColor:!0,children:N})]})]}),D===`horizontal`&&(0,G.jsx)(x,{height:`100%`,borderStyle:`single`,borderColor:`claude`,borderDimColor:!0,borderTop:!1,borderBottom:!1,borderLeft:!1}),D===`horizontal`&&(0,G.jsx)(Fr,{feeds:r?[Vr(pn()),zr(e)]:o?[zr(e),Hr()]:s?[zr(e),qn()]:[zr(e),Br(p)],maxWidth:I})]})})}),(0,G.jsx)(Ni,{}),(0,G.jsx)(Oi,{}),Qi&&(0,G.jsx)(Qi.ChannelsNotice,{}),pe()&&(0,G.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(_,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(_,{dimColor:!0,children:[`Logging to: `,he()?`stderr`:me()]})]}),(0,G.jsx)(pi,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,G.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(_,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,G.jsx)(_,{dimColor:!0,children:process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),m&&(0,G.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&f.oauthAccount?.organizationName&&(0,G.jsxs)(_,{dimColor:!0,children:[`Message from `,f.oauthAccount.organizationName,`:`]}),(0,G.jsx)(_,{children:m})]}),i&&(0,G.jsx)(x,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(_,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsx)(x,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(_,{dimColor:!0,children:`Use /issue to report model behavior issues`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(_,{color:`warning`,children:`[ANT-ONLY] Logs:`}),(0,G.jsxs)(_,{dimColor:!0,children:[`API calls: `,F(Ge())]}),(0,G.jsxs)(_,{dimColor:!0,children:[`Debug logs: `,F(me())]}),ke()&&(0,G.jsxs)(_,{dimColor:!0,children:[`Startup Perf: `,F(Ae())]})]}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(zi,{}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Vi,{})]})}var Zi,G,Qi,$i,ea=t((()=>{h(),y(),nn(),Ln(),je(),se(),jr(),Rr(),Wr(),D(),zn(),ue(),ge(),Zi=n(h(),1),gn(),fi(),Le(),En(),ft(),i(),Oe(),yi(),Ri(),Mi(),Bi(),Hi(),G=C(),Yt(),li(),Kn(),lt(),Pe(),Un(),N(),Qi=(Yi(),e(Ui)),$i=50}));function ta({message:e,isTranscriptMode:t}){let n=e.message?.content,r=Array.isArray(n)?n:[];if(!(t&&e.type===`assistant`&&e.message?.model&&r.some(e=>e?.type===`text`)))return null;let i=e.message.model;return(0,na.jsx)(x,{minWidth:l(i)+8,children:(0,na.jsx)(_,{dimColor:!0,children:i})})}var na,ra=t((()=>{h(),y(),na=C()}));function ia({message:e,isTranscriptMode:t}){if(!(t&&e.timestamp&&e.type===`assistant`&&Array.isArray(e.message.content)&&e.message.content.some(e=>e.type===`text`)))return null;let n=new Date(e.timestamp).toLocaleTimeString(`en-US`,{hour:`2-digit`,minute:`2-digit`,hour12:!0});return(0,aa.jsx)(x,{minWidth:l(n),children:(0,aa.jsx)(_,{dimColor:!0,children:n})})}var aa,oa=t((()=>{h(),y(),aa=C()}));function sa(e,t,n,r){for(let i=t+1;i<e.length;i++){let t=e[i];if(t?.type===`assistant`){let e=ma(t.message.content);if(e?.type===`thinking`||e?.type===`redacted_thinking`||e?.type===`tool_use`&&(_t(e.name,e.input,n).isCollapsible||r.has(e.id)))continue;return!0}if(!(t?.type===`system`||t?.type===`attachment`)&&!(t?.type===`user`&&ma(t.message.content)?.type===`tool_result`)){if(t?.type===`grouped_tool_use`){let e=ma(t.messages[0]?.message.content)?.input;if(_t(t.toolName,e,n).isCollapsible)continue}return!0}}return!1}function ca({message:e,isUserContinuation:t,hasContentAfter:n,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,streamingToolUseIDs:s,screen:c,canAnimate:l,onOpenRateLimitOptions:u,lastThinkingBlockId:d,latestBashOutputUUID:f,columns:p,isLoading:m,lookups:h,shouldCollapseDiffs:g}){let _=c===`transcript`,v=e.type===`grouped_tool_use`,y=e.type===`collapsed_read_search`,b=y&&(Qe(e,o)||m&&!n),S=v?e.displayMessage:y?dt(e):e,C=v||y?[]:Wt(e,h),w=Mo(e,s,o,v||y?kt:Re(e,h),c,h),ee=!1;if(l)if(v)ee=e.messages.some(e=>{let t=ma(e.message.content);return t?.type===`tool_use`&&o.has(t.id)});else if(y)ee=Qe(e,o);else{let t=Ht(e);ee=!t||o.has(t)}let T=_&&S.type===`assistant`&&Array.isArray(S.message.content)&&S.message.content.some(e=>e.type===`text`)&&(S.timestamp||S.message.model),E=(0,pa.jsx)(qe,{message:e,lookups:h,addMargin:!T,containerWidth:T?void 0:p,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,progressMessagesForMessage:C,shouldAnimate:ee,shouldShowDot:!0,isTranscriptMode:_,isStatic:w,onOpenRateLimitOptions:u,isActiveCollapsedGroup:b,isUserContinuation:t,lastThinkingBlockId:d,latestBashOutputUUID:f,shouldCollapseDiffs:g});return T?(0,pa.jsx)(Ut,{children:(0,pa.jsxs)(x,{width:p,flexDirection:`column`,children:[(0,pa.jsxs)(x,{flexDirection:`row`,justifyContent:`flex-end`,gap:1,marginTop:1,children:[(0,pa.jsx)(ia,{message:S,isTranscriptMode:_}),(0,pa.jsx)(ta,{message:S,isTranscriptMode:_})]}),E]})}):(0,pa.jsx)(Ut,{children:E})}function la(e,t){if(e.type===`grouped_tool_use`)return e.messages.some(e=>{let n=ma(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return Ye(e).some(e=>t.has(e));let n=Ht(e);return!!n&&t.has(n)}function ua(e,t){if(e.type===`grouped_tool_use`)return e.messages.every(e=>{let n=ma(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return Ye(e).every(e=>t.has(e));if(e.type===`assistant`){let n=ma(e.message.content);if(n?.type===`server_tool_use`)return t.has(n.id)}let n=Ht(e);return!n||t.has(n)}function da(e,t){if(e.message!==t.message||e.screen!==t.screen||e.verbose!==t.verbose||e.message.type===`collapsed_read_search`&&t.screen!==`transcript`||e.columns!==t.columns||e.latestBashOutputUUID===e.message.uuid!=(t.latestBashOutputUUID===t.message.uuid)||e.lastThinkingBlockId!==t.lastThinkingBlockId&&Ke(t.message))return!1;let n=la(e.message,e.streamingToolUseIDs),r=ua(e.message,e.lookups.resolvedToolUseIDs);return!(n||!r)}var fa,pa,ma,ha,ga=t((()=>{fa=n(h(),1),y(),it(),rt(),pt(),pa=C(),ra(),Uo(),oa(),Le(),ma=e=>{if(!Array.isArray(e))return;let t=e[0];if(!(t==null||typeof t==`string`))return t},ha=fa.memo(ca,da)}));function _a(e){return e.type===`attachment`&&va.has(e.attachment.type)}var va,ya=t((()=>{va=new Set(`hook_success.hook_additional_context.hook_cancelled.command_permissions.agent_mention.budget_usd.critical_system_reminder.edited_image_file.edited_text_file.opened_file_in_ide.output_style.plan_mode.plan_mode_exit.plan_mode_reentry.structured_output.team_context.todo_reminder.context_efficiency.deferred_tools_delta.mcp_instructions_delta.companion_intro.token_usage.ultrathink_effort.max_turns_reached.task_reminder.auto_mode.auto_mode_exit.output_token_usage.verify_plan_reminder.current_session_memory.compaction_reminder.date_change`.split(`.`))}));function ba(e){return Da.filter(t=>t.isActive(e))}var K,xa,Sa,Ca,wa,Ta,Ea,Da,Oa=t((()=>{y(),h(),He(),o(),ve(),je(),le(),Qn(),Rt(),Jt(),K=C(),xa={id:`large-memory-files`,type:`warning`,isActive:e=>It(e.memoryFiles).length>0,render:e=>(0,K.jsx)(K.Fragment,{children:It(e.memoryFiles).map(e=>{let t=e.path.startsWith(ye())?tr(ye(),e.path):e.path;return(0,K.jsxs)(x,{flexDirection:`row`,children:[(0,K.jsx)(_,{color:`warning`,children:s.warning}),(0,K.jsxs)(_,{color:`warning`,children:[`Large `,(0,K.jsx)(_,{bold:!0,children:t}),` will impact performance (`,De(e.content.length),` chars > `,De(Ft),`)`,(0,K.jsx)(_,{dimColor:!0,children:` · /memory to edit`})]})]},e.path)})})},Sa={id:`claude-ai-external-token`,type:`warning`,isActive:()=>{let e=fe();return I()&&(e.source===`ANTHROPIC_AUTH_TOKEN`||e.source===`apiKeyHelper`)},render:()=>{let e=fe();return(0,K.jsxs)(x,{flexDirection:`row`,marginTop:1,children:[(0,K.jsx)(_,{color:`warning`,children:s.warning}),(0,K.jsxs)(_,{color:`warning`,children:[`Auth conflict: Using `,e.source,` instead of Claude account subscription token. Either unset`,` `,e.source,", or run `claude /logout`."]})]})}},Ca={id:`api-key-conflict`,type:`warning`,isActive:()=>{let{source:e}=k({skipRetrievingKeyFromApiKeyHelper:!0});return!!te()&&(e===`ANTHROPIC_API_KEY`||e===`apiKeyHelper`)},render:()=>{let{source:e}=k({skipRetrievingKeyFromApiKeyHelper:!0});return(0,K.jsxs)(x,{flexDirection:`row`,marginTop:1,children:[(0,K.jsx)(_,{color:`warning`,children:s.warning}),(0,K.jsxs)(_,{color:`warning`,children:[`Auth conflict: Using `,e,` instead of Anthropic Console key. Either unset `,e,", or run `claude /logout`."]})]})}},wa={id:`both-auth-methods`,type:`warning`,isActive:()=>{let{source:e}=k({skipRetrievingKeyFromApiKeyHelper:!0}),t=fe();return e!==`none`&&t.source!==`none`&&!(e===`apiKeyHelper`&&t.source===`apiKeyHelper`)},render:()=>{let{source:e}=k({skipRetrievingKeyFromApiKeyHelper:!0}),t=fe();return(0,K.jsxs)(x,{flexDirection:`column`,marginTop:1,children:[(0,K.jsxs)(x,{flexDirection:`row`,children:[(0,K.jsx)(_,{color:`warning`,children:s.warning}),(0,K.jsxs)(_,{color:`warning`,children:[`Auth conflict: Both a token (`,t.source,`) and an API key (`,e,`) are set. This may lead to unexpected behavior.`]})]}),(0,K.jsxs)(x,{flexDirection:`column`,marginLeft:3,children:[(0,K.jsxs)(_,{color:`warning`,children:[`· Trying to use `,t.source===`claude.ai`?`claude.ai`:t.source,`?`,` `,e===`ANTHROPIC_API_KEY`?`Unset the ANTHROPIC_API_KEY environment variable, or claude /logout then say "No" to the API key approval before login.`:e===`apiKeyHelper`?`Unset the apiKeyHelper setting.`:`claude /logout`]}),(0,K.jsxs)(_,{color:`warning`,children:[`· Trying to use `,e,`?`,` `,t.source===`claude.ai`?`claude /logout to sign out of claude.ai.`:`Unset the ${t.source} environment variable.`]})]})]})}},Ta={id:`large-agent-descriptions`,type:`warning`,isActive:e=>Zn(e.agentDefinitions)>$n,render:e=>{let t=Zn(e.agentDefinitions);return(0,K.jsxs)(x,{flexDirection:`row`,children:[(0,K.jsx)(_,{color:`warning`,children:s.warning}),(0,K.jsxs)(_,{color:`warning`,children:[`Large cumulative agent descriptions will impact performance (~`,De(t),` tokens > `,De($n),`)`,(0,K.jsx)(_,{dimColor:!0,children:` · /agents to manage`})]})]})}},Ea={id:`jetbrains-plugin-install`,type:`info`,isActive:e=>{if(!Vt()||!(e.config.autoInstallIdeExtension??!0))return!1;let t=vt();return t!==null&&!zt(t)},render:()=>{let e=qt(vt());return(0,K.jsxs)(x,{flexDirection:`row`,gap:1,marginLeft:1,children:[(0,K.jsx)(_,{color:`ide`,children:s.arrowUp}),(0,K.jsxs)(_,{children:[`Install the `,(0,K.jsx)(_,{color:`ide`,children:e}),` plugin from the JetBrains Marketplace:`,` `,(0,K.jsx)(_,{bold:!0,children:`https://docs.claude.com/s/claude-code-jetbrains`})]})]})}},Da=[xa,Ta,Sa,Ca,wa,Ea]}));function ka({agentDefinitions:e}={}){let t={config:P(),agentDefinitions:e,memoryFiles:(0,ja.use)(en())},n=ba(t);return n.length===0?null:(0,Ma.jsx)(x,{flexDirection:`column`,paddingLeft:1,children:n.map(e=>(0,Ma.jsx)(Aa.Fragment,{children:e.render(t)},e.id))})}var Aa,ja,Ma,Na=t((()=>{Aa=n(h(),1),ja=n(h(),1),y(),He(),D(),Oa(),Ma=C()}));function Pa(e,t,n){let r=(0,q.useRef)(new Map),i=(0,q.useRef)(0),a=(0,q.useRef)(0),o=(0,q.useRef)({arr:new Float64Array,version:-1,n:-1}),s=(0,q.useRef)(new Map),c=(0,q.useRef)(new Map),l=(0,q.useRef)(n),u=(0,q.useRef)(!1),d=(0,q.useRef)(null),f=(0,q.useRef)(0);if(l.current!==n){let e=l.current/n;l.current=n;for(let[t,n]of r.current)r.current.set(t,Math.max(1,Math.round(n*e)));i.current++,u.current=!0,f.current=2}let p=f.current>0?d.current:null,m=(0,q.useRef)(0),h=(0,q.useRef)(null);(0,q.useSyncExternalStore)((0,q.useCallback)(t=>e.current?.subscribe(t)??Ha,[e]),()=>{let t=e.current;if(!t)return NaN;let n=t.getScrollTop()+t.getPendingDelta(),r=Math.floor(n/Ra);return t.isSticky()?~r:r});let g=e.current?.getScrollTop()??-1,_=e.current?.getPendingDelta()??0,v=e.current?.getViewportHeight()??0,y=e.current?.isSticky()??!0;(0,q.useMemo)(()=>{let e=new Set(t),n=!1;for(let t of r.current.keys())e.has(t)||(r.current.delete(t),n=!0);for(let t of c.current.keys())e.has(t)||c.current.delete(t);n&&i.current++},[t]);let b=t.length;if(o.current.version!==i.current||o.current.n!==b){let e=o.current.arr.length>=b+1?o.current.arr:new Float64Array(b+1);e[0]=0;for(let n=0;n<b;n++)e[n+1]=e[n]+(r.current.get(t[n])??Fa);o.current={arr:e,version:i.current,n:b}}let x=o.current.arr,S=x[b],C,w;if(p)[C,w]=p,C=Math.min(C,b),w=Math.min(w,b);else if(v===0||g<0)C=Math.max(0,b-La),w=b;else{if(y){let e=v+Ia;for(C=b;C>0&&S-x[C-1]<e;)C--;w=b}else{let e=m.current,n=v*3,i=Math.min(g,g+_),a=Math.max(g,g+_),o=a-i,c=o>n&&_<0?a-n:i,l=c+Math.min(o,n),u=Math.max(0,c-e),f=l-e,p=u-Ia;{let e=0,t=b;for(;e<t;){let n=e+t>>1;x[n+1]<=p?e=n+1:t=n}C=e}{let e=d.current;if(e&&e[0]<C)for(let n=e[0];n<Math.min(C,e[1]);n++){let e=t[n];if(s.current.has(e)&&!r.current.has(e)){C=n;break}}}let h=v+2*Ia,y=Math.min(b,C+Ba),S=0;for(w=C;w<y&&(S<h||x[w]<f+v+Ia);)S+=r.current.get(t[w])??za,w++}let e=v+2*Ia,n=Math.max(0,w-Ba),i=0;for(let e=C;e<w;e++)i+=r.current.get(t[e])??za;for(;C>n&&i<e;)C--,i+=r.current.get(t[C])??za;let o=d.current,c=Math.abs(g-a.current)+Math.abs(_);if(o&&c>v*2){let[e,t]=o;C<e-Va&&(C=e-Va),w>t+Va&&(w=t+Va),C>w&&(w=Math.min(C+Va,b))}a.current=g}f.current>0?f.current--:d.current=[C,w];let ee=(0,q.useDeferredValue)(C),T=(0,q.useDeferredValue)(w),E=C<ee?ee:C,D=w>T?T:w;if((E>D||y)&&(E=C,D=w),_>0&&(D=w),D-E>Ba){let e=(x[E]+x[D])/2;g-m.current<e?D=E+Ba:E=D-Ba}let O=m.current,te=x[E],ne=E===0?0:te+O,k=D===b?1/0:Math.max(te,x[D]-v)+O;(0,q.useLayoutEffect)(()=>{y?e.current?.setClampBounds(void 0,void 0):e.current?.setClampBounds(ne,k)}),(0,q.useLayoutEffect)(()=>{let e=h.current?.yogaNode;if(e&&e.getComputedWidth()>0&&(m.current=e.getComputedTop()),u.current){u.current=!1;return}let t=!1;for(let[e,n]of s.current){let i=n.yogaNode;if(!i)continue;let a=i.getComputedHeight(),o=r.current.get(e);a>0?o!==a&&(r.current.set(e,a),t=!0):i.getComputedWidth()>0&&o!==0&&(r.current.set(e,0),t=!0)}t&&i.current++});let re=(0,q.useCallback)(e=>{let t=c.current.get(e);return t||(t=t=>{if(t)s.current.set(e,t);else{let t=s.current.get(e)?.yogaNode;if(t&&!u.current){let n=t.getComputedHeight();(n>0||t.getComputedWidth()>0)&&r.current.get(e)!==n&&(r.current.set(e,n),i.current++)}s.current.delete(e)}},c.current.set(e,t)),t},[]),ie=(0,q.useCallback)(e=>{let n=s.current.get(t[e])?.yogaNode;return!n||n.getComputedWidth()===0?-1:n.getComputedTop()},[t]),A=(0,q.useCallback)(e=>s.current.get(t[e])??null,[t]),j=(0,q.useCallback)(e=>r.current.get(t[e]),[t]),M=(0,q.useCallback)(t=>{let n=o.current;t<0||t>=n.n||e.current?.scrollTo(n.arr[t]+m.current)},[e]),N=S-x[D];return{range:[E,D],topSpacer:te,bottomSpacer:N,measureRef:re,spacerRef:h,offsets:x,getItemTop:ie,getItemElement:A,getItemHeight:j,scrollToIndex:M}}var q,Fa,Ia,La,Ra,za,Ba,Va,Ha,Ua=t((()=>{q=n(h(),1),Fa=3,Ia=40,La=30,Ra=Ia>>1,za=1,Ba=200,Va=25,Ha=()=>{}}));function Wa({children:e}){let[t,n]=(0,J.useState)(null),[r,i]=(0,J.useState)(null);return(0,Ya.jsx)(Za.Provider,{value:n,children:(0,Ya.jsx)($a.Provider,{value:i,children:(0,Ya.jsx)(Xa.Provider,{value:t,children:(0,Ya.jsx)(Qa.Provider,{value:r,children:e})})})})}function Ga(){return(0,J.useContext)(Xa)}function Ka(){return(0,J.useContext)(Qa)}function qa(e){let t=(0,J.useContext)(Za);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}function Ja(e){let t=(0,J.useContext)($a);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}var J,Ya,Xa,Za,Qa,$a,eo=t((()=>{J=n(h(),1),Ya=C(),Xa=(0,J.createContext)(null),Za=(0,J.createContext)(null),Qa=(0,J.createContext)(null),$a=(0,J.createContext)(null)}));function to(e){let[t,n]=(0,Y.useState)(null),r=(0,Y.useRef)(e);r.current=e;let i=(0,Y.useRef)(null),a=(0,Y.useCallback)(()=>{n(null)},[]),o=(0,Y.useCallback)(e=>{let t=Math.max(0,e.getScrollHeight()-e.getViewportHeight());e.getScrollTop()+e.getPendingDelta()>=t||i.current===null&&(i.current=e.getScrollHeight(),n(r.current))},[]),s=(0,Y.useCallback)(e=>{e&&e.scrollToBottom()},[]);return(0,Y.useEffect)(()=>{t===null?i.current=null:e<t&&(i.current=null,n(null))},[e,t]),{dividerIndex:t,dividerYRef:i,onScrollAway:o,onRepin:a,jumpToNew:s,shiftDivider:(0,Y.useCallback)((e,t)=>{n(t=>t===null?null:t+e),i.current!==null&&(i.current+=t)},[])}}function no(e,t){let n=0,r=!1;for(let i=t;i<e.length;i++){let t=e[i];if(t.type===`progress`||t.type===`assistant`&&!ro(t))continue;let a=t.type===`assistant`;a&&!r&&n++,r=a}return n}function ro(e){if(e.type!==`assistant`||!Array.isArray(e.message.content))return!1;for(let t of e.message.content)if(typeof t!=`string`&&t.type===`text`&&t.text.trim()!==``)return!0;return!1}function io(e,t){if(t===null)return;let n=t;for(;n<e.length&&(e[n]?.type===`progress`||_a(e[n]));)n++;let r=e[n]?.uuid;if(!r)return;let i=no(e,t);return{firstUnseenUuid:r,count:Math.max(1,i)}}function ao({scrollable:e,bottom:t,overlay:n,bottomFloat:r,modal:i,modalScrollRef:a,scrollRef:o,dividerYRef:s,hidePill:c=!1,hideSticky:l=!1,newMessageCount:d=0,onPillClick:f}){let{rows:p,columns:h}=u(),[v,y]=(0,Y.useState)(null),b=(0,Y.useMemo)(()=>({setStickyPrompt:y}),[]),S=(0,Y.useSyncExternalStore)((0,Y.useCallback)(e=>o?.current?.subscribe(e)??(()=>{}),[o]),()=>{let e=o?.current,t=s?.current;return!e||t==null?!1:e.getScrollTop()+e.getPendingDelta()+e.getViewportHeight()<t});if((0,Y.useLayoutEffect)(()=>{if(!Mt())return;let e=m.get(process.stdout);if(e)return e.onHyperlinkClick=e=>{if(e.startsWith(`file:`))try{dn(nr(e))}catch{}else un(e)},()=>{e.onHyperlinkClick=void 0}},[]),Mt()){let s=l?null:v,u=s!=null&&s!==`clicked`&&n==null?s:null,m=s!=null&&n==null;return(0,X.jsxs)(Wa,{children:[(0,X.jsx)(x,{flexDirection:`row`,flexGrow:1,overflow:`hidden`,width:`100%`,children:(0,X.jsxs)(x,{flexDirection:`column`,flexGrow:1,width:h,overflow:`hidden`,children:[(0,X.jsxs)(x,{flexGrow:1,flexDirection:`column`,overflow:`hidden`,children:[u&&(0,X.jsx)(so,{text:u.text,onClick:u.scrollTo}),(0,X.jsxs)(g,{ref:o,flexGrow:1,flexDirection:`column`,paddingTop:+!m,stickyScroll:!0,children:[(0,X.jsx)(fo,{value:b,children:e}),n]}),!c&&S&&n==null&&(0,X.jsx)(oo,{count:d,onClick:f}),r!=null&&(0,X.jsx)(x,{position:`absolute`,bottom:0,right:0,opaque:!0,children:r})]}),(0,X.jsxs)(x,{flexDirection:`column`,flexShrink:0,width:`100%`,maxHeight:`50%`,children:[(0,X.jsx)(co,{}),(0,X.jsx)(lo,{}),(0,X.jsx)(x,{flexDirection:`column`,width:`100%`,flexGrow:1,overflowY:`hidden`,children:t})]})]})}),i!=null&&(0,X.jsx)(Gn,{value:{rows:p-uo-1,columns:h-4,scrollRef:a??null},children:(0,X.jsxs)(x,{position:`absolute`,bottom:0,left:0,right:0,maxHeight:p-uo,flexDirection:`column`,overflow:`hidden`,opaque:!0,children:[(0,X.jsx)(x,{flexShrink:0,children:(0,X.jsx)(_,{color:`permission`,children:`▔`.repeat(h)})}),(0,X.jsx)(x,{flexDirection:`column`,paddingX:2,flexShrink:0,overflow:`hidden`,children:i})]})})]})}return(0,X.jsxs)(X.Fragment,{children:[e,t,n,i]})}function oo({count:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(x,{position:`absolute`,bottom:0,left:0,right:0,justifyContent:`center`,children:(0,X.jsx)(x,{onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(_,{backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,dimColor:!0,children:[` `,e>0?`${e} new ${M(e,`message`)}`:`Jump to bottom`,` `,s.arrowDown,` `]})})})}function so({text:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(x,{flexShrink:0,width:`100%`,height:1,paddingRight:1,backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(_,{color:`subtle`,wrap:`truncate-end`,children:[s.pointer,` `,e]})})}function co(){let e=Ga();return!e||e.suggestions.length===0?null:(0,X.jsx)(x,{position:`absolute`,bottom:`100%`,left:0,right:0,paddingX:2,paddingTop:1,flexDirection:`column`,opaque:!0,children:(0,X.jsx)(Bn,{suggestions:e.suggestions,selectedSuggestion:e.selectedSuggestion,maxColumnWidth:e.maxColumnWidth,overlay:!0})})}function lo(){let e=Ka();return e?(0,X.jsx)(x,{position:`absolute`,bottom:`100%`,left:0,right:0,opaque:!0,children:e}):null}var Y,X,uo,fo,po=t((()=>{o(),Y=n(h(),1),Wn(),eo(),nn(),y(),fn(),Zt(),ce(),ya(),Vn(),X=C(),uo=2,fo=(0,Y.createContext)({setStickyPrompt:()=>{}})}));function mo(e){let t=So.get(e);if(t!==void 0)return t;let n=yr(e);return So.set(e,n),n}function ho(e){let t=wo.get(e);if(t!==void 0)return t;let n=go(e);return wo.set(e,n),n}function go(e){let t=null;if(e.type===`user`){if(e.isMeta||e.isVisibleInTranscriptOnly)return null;let n=e.message.content[0];if(n?.type!==`text`)return null;t=n.text??null}else if(e.type===`attachment`&&e.attachment.type===`queued_command`&&e.attachment.commandMode!==`task-notification`&&!e.attachment.isMeta){let n=e.attachment.prompt;t=typeof n==`string`?n:n.flatMap(e=>e.type===`text`?[e.text??``]:[]).join(`
|
|
11
|
+
`)}if(t===null)return null;let n=jt(t);return n.startsWith(`<`)||n===``?null:n}function _o({itemKey:e,msg:t,idx:n,measureRef:r,expanded:i,hovered:a,clickable:o,onClickK:s,onEnterK:c,onLeaveK:l,renderItem:u}){return(0,bo.jsx)(x,{ref:r(e),flexDirection:`column`,backgroundColor:i?`userMessageBackgroundHover`:void 0,paddingBottom:i?1:void 0,onClick:o?e=>s(t,e.cellIsBlank):void 0,onMouseEnter:o?()=>c(e):void 0,onMouseLeave:o?()=>l(e):void 0,children:(0,bo.jsx)(S.Provider,{value:a&&!i?`text`:void 0,children:u(t,n)})})}function vo({messages:e,scrollRef:t,columns:n,itemKey:r,renderItem:i,onItemClick:a,isItemClickable:o,isItemExpanded:s,extractSearchText:c=mo,trackStickyPrompt:l,selectedIndex:u,cursorNavRef:d,setCursor:f,jumpRef:p,onSearchMatchesChange:m,scanElement:h,setPositions:g}){let _=(0,Z.useRef)([]),v=(0,Z.useRef)(e),y=(0,Z.useRef)(r);if(y.current!==r||e.length<_.current.length||e[0]!==v.current[0])_.current=e.map(e=>r(e));else for(let t=_.current.length;t<e.length;t++)_.current.push(r(e[t]));v.current=e,y.current=r;let b=_.current,{range:S,topSpacer:C,bottomSpacer:w,measureRef:ee,spacerRef:T,offsets:E,getItemTop:D,getItemElement:O,getItemHeight:te,scrollToIndex:ne}=Pa(t,b,n),[k,re]=S,ie=(0,Z.useCallback)(t=>te(t)===0?!1:et(e[t]),[te,e]);(0,Z.useImperativeHandle)(d,()=>{let n=e=>f?.({uuid:e.uuid,msgType:e.type,expanded:!1,toolName:Dt(e)?.name}),r=u??-1,i=(t,r,i=ie)=>{for(let a=t;a>=0&&a<e.length;a+=r)if(i(a))return n(e[a]),!0;return!1},a=t=>ie(t)&&e[t].type===`user`;return{enterCursor:()=>i(e.length-1,-1,a),navigatePrev:()=>i(r-1,-1),navigateNext:()=>{i(r+1,1)||(t.current?.scrollToBottom(),f?.(null))},navigatePrevUser:()=>i(r-1,-1,a),navigateNextUser:()=>i(r+1,1,a),navigateTop:()=>i(0,1),navigateBottom:()=>i(e.length-1,-1),getSelected:()=>r>=0?e[r]??null:null}},[e,u,f,ie]);let A=(0,Z.useRef)({offsets:E,start:k,getItemElement:O,getItemTop:D,messages:e,scrollToIndex:ne});A.current={offsets:E,start:k,getItemElement:O,getItemTop:D,messages:e,scrollToIndex:ne},(0,Z.useEffect)(()=>{if(u===void 0)return;let e=A.current,n=e.getItemElement(u);n?t.current?.scrollToElement(n,1):e.scrollToIndex(u)},[u,t]);let j=(0,Z.useRef)(null),M=(0,Z.useRef)({msgIdx:-1,positions:[]}),N=(0,Z.useRef)(-1),ae=(0,Z.useRef)(0),P=(0,Z.useRef)(0),oe=(0,Z.useRef)(()=>{}),F=(0,Z.useRef)(()=>{}),I=(0,Z.useRef)({matches:[],ptr:0,screenOrd:0,prefixSum:[]}),se=(0,Z.useRef)(-1),L=(0,Z.useRef)(!1);function ce(e){let t=A.current.getItemTop(e);return Math.max(0,t-xo)}function le(e){let n=t.current,{msgIdx:r,positions:i}=M.current;if(!n||i.length===0||r<0){g?.(null);return}let a=Math.max(0,Math.min(e,i.length-1)),o=i[a],s=A.current.getItemTop(r),c=n.getViewportTop(),l=s-n.getScrollTop(),u=n.getViewportHeight(),d=c+l+o.row;(d<c||d>=c+u)&&(n.scrollTo(Math.max(0,s+o.row-xo)),l=s-n.getScrollTop(),d=c+l+o.row),g?.({positions:i,rowOffset:c+l,currentIdx:a});let f=I.current,p=f.prefixSum.at(-1)??0,h=(f.prefixSum[f.ptr]??0)+a+1;m?.(p,h),R(`highlight(i=${r}, ord=${a}/${i.length}): pos={row:${o.row},col:${o.col}} lo=${l} screenRow=${d} badge=${h}/${p}`)}F.current=le;let[ue,de]=(0,Z.useState)(0),fe=(0,Z.useCallback)(()=>de(e=>e+1),[]);(0,Z.useEffect)(()=>{let e=j.current;if(!e)return;let{idx:n,wantLast:r,tries:i}=e,a=t.current;if(!a)return;let{getItemElement:o,getItemTop:s,scrollToIndex:c}=A.current,l=o(n),u=l?.yogaNode?.getComputedHeight()??0;if(!l||u===0){if(i>1){j.current=null,R(`seek(i=${n}): no mount after scrollToIndex, skip`),oe.current(r?-1:1);return}j.current={idx:n,wantLast:r,tries:i+1},c(n),fe();return}j.current=null,a.scrollTo(Math.max(0,s(n)-xo));let d=h?.(l)??[];if(M.current={msgIdx:n,positions:d},R(`seek(i=${n} t=${i}): ${d.length} positions`),d.length===0){if(++ae.current>20){ae.current=0;return}oe.current(r?-1:1);return}ae.current=0;let f=r?d.length-1:0;I.current.screenOrd=f,N.current=-1,F.current(f);let p=P.current;p&&(P.current=0,oe.current(p))},[ue]);function pe(e,n){let r=t.current;if(!r)return;let i=A.current,{getItemElement:a,scrollToIndex:o}=i;if(e<0||e>=i.messages.length)return;g?.(null),M.current={msgIdx:-1,positions:[]},j.current={idx:e,wantLast:n,tries:0};let s=a(e),c=s?.yogaNode?.getComputedHeight()??0;s&&c>0?r.scrollTo(ce(e)):o(e),fe()}function me(e){let t=I.current,{matches:n,prefixSum:r}=t,i=r.at(-1)??0;if(n.length===0)return;if(j.current){P.current=e;return}N.current<0&&(N.current=t.ptr);let{positions:a}=M.current,o=t.screenOrd+e;if(o>=0&&o<a.length){t.screenOrd=o,le(o),N.current=-1;return}let s=(t.ptr+e+n.length)%n.length;if(s===N.current){g?.(null),N.current=-1,R(`step: wraparound at ptr=${s}, all ${n.length} msgs phantoms`);return}t.ptr=s,t.screenOrd=0,pe(n[s],e<0);let c=e<0?r[s+1]??i:r[s]+1;m?.(i,c)}oe.current=me,(0,Z.useImperativeHandle)(p,()=>({jumpToIndex:e=>{let n=t.current;n&&n.scrollTo(ce(e))},setSearchQuery:e=>{j.current=null,M.current={msgIdx:-1,positions:[]},N.current=-1,g?.(null);let n=e.toLowerCase(),r=[],i=[0];if(n){let e=A.current.messages;for(let t=0;t<e.length;t++){let a=c(e[t]),o=a.indexOf(n),s=0;for(;o>=0;)s++,o=a.indexOf(n,o+n.length);s>0&&(r.push(t),i.push(i.at(-1)+s))}}let a=i.at(-1),o=0,s=t.current,{offsets:l,start:u,getItemTop:d}=A.current,f=d(u),p=f>=0?f-l[u]:0;if(r.length>0&&s){let t=se.current>=0?se.current:s.getScrollTop(),n=1/0;for(let e=0;e<r.length;e++){let i=Math.abs(p+l[r[e]]-t);i<=n&&(n=i,o=e)}R(`setSearchQuery('${e}'): ${r.length} msgs · ptr=${o} msgIdx=${r[o]} curTop=${t} origin=${p}`)}I.current={matches:r,ptr:o,screenOrd:0,prefixSum:i},r.length>0?pe(r[o],!0):se.current>=0&&s&&s.scrollTo(se.current),m?.(a,r.length>0?i[o+1]??a:0)},nextMatch:()=>me(1),prevMatch:()=>me(-1),setAnchor:()=>{let e=t.current;e&&(se.current=e.getScrollTop())},disarmSearch:()=>{g?.(null),j.current=null,M.current={msgIdx:-1,positions:[]},N.current=-1},warmSearchIndex:async()=>{if(L.current)return 0;let e=A.current.messages,t=0,n=performance.now();for(let n=0;n<e.length;n+=500){await Me(0);let r=performance.now(),i=Math.min(n+500,e.length);for(let t=n;t<i;t++)c(e[t]);t+=performance.now()-r}let r=Math.round(performance.now()-n);return R(`warmSearchIndex: ${e.length} msgs · work=${Math.round(t)}ms wall=${r}ms chunks=${Math.ceil(e.length/500)}`),L.current=!0,Math.round(t)}}),[t]);let[he,ge]=(0,Z.useState)(null),_e=(0,Z.useRef)({onItemClick:a,setHoveredKey:ge});_e.current={onItemClick:a,setHoveredKey:ge};let z=(0,Z.useCallback)((e,t)=>{let n=_e.current;!t&&n.onItemClick&&n.onItemClick(e)},[]),ve=(0,Z.useCallback)(e=>{_e.current.setHoveredKey(e)},[]),ye=(0,Z.useCallback)(e=>{_e.current.setHoveredKey(t=>t===e?null:t)},[]);return(0,bo.jsxs)(bo.Fragment,{children:[(0,bo.jsx)(x,{ref:T,height:C,flexShrink:0}),e.slice(k,re).map((e,t)=>{let n=k+t,r=b[n],c=!!a&&(o?.(e)??!0),l=c&&he===r,u=s?.(e);return(0,bo.jsx)(_o,{itemKey:r,msg:e,idx:n,measureRef:ee,expanded:u,hovered:l,clickable:c,onClickK:z,onEnterK:ve,onLeaveK:ye,renderItem:i},r)}),w>0&&(0,bo.jsx)(x,{height:w,flexShrink:0}),l&&(0,bo.jsx)(yo,{messages:e,start:k,end:re,offsets:E,getItemTop:D,getItemElement:O,scrollRef:t})]})}function yo({messages:e,start:t,end:n,offsets:r,getItemTop:i,getItemElement:a,scrollRef:o}){let{setStickyPrompt:s}=(0,Z.useContext)(fo);(0,Z.useSyncExternalStore)((0,Z.useCallback)(e=>o.current?.subscribe(e)??To,[o]),()=>{let e=o.current;if(!e)return NaN;let t=e.getScrollTop()+e.getPendingDelta();return e.isSticky()?-1-t:t});let c=o.current?.isSticky()??!0,l=Math.max(0,(o.current?.getScrollTop()??0)+(o.current?.getPendingDelta()??0)),u=t,d=-1;for(let e=n-1;e>=t;e--){let t=i(e);if(t>=0){if(t<l)break;d=t}u=e}let f=-1,p=null;if(u>0&&!c)for(let t=u-1;t>=0;t--){let n=ho(e[t]);if(n===null)continue;let r=i(t);if(!(r>=0&&r+1>=l)){f=t,p=n;break}}let m=d>=0?d-r[u]:0,h=f>=0?Math.max(0,m+r[f]):-1,g=(0,Z.useRef)({idx:-1,tries:0}),_=(0,Z.useRef)(`none`),v=(0,Z.useRef)(-1);return(0,Z.useEffect)(()=>{if(g.current.idx>=0)return;if(_.current===`armed`){_.current=`force`;return}let e=_.current===`force`;if(_.current=`none`,!e&&v.current===f)return;if(v.current=f,p===null){s(null);return}let t=p.trimStart(),n=t.search(/\n\s*\n/),r=(n>=0?t.slice(0,n):t).slice(0,Co).replace(/\s+/g,` `).trim();if(r===``){s(null);return}let i=f,c=h;s({text:r,scrollTo:()=>{s(`clicked`),_.current=`armed`;let e=a(i);e?o.current?.scrollToElement(e,1):(o.current?.scrollTo(c),g.current={idx:i,tries:0})}})}),(0,Z.useEffect)(()=>{if(g.current.idx<0)return;let e=a(g.current.idx);e?(o.current?.scrollToElement(e,1),g.current={idx:-1,tries:0}):++g.current.tries>5&&(g.current={idx:-1,tries:0})}),null}var Z,bo,xo,So,Co,wo,To,Eo=t((()=>{h(),Z=n(h(),1),Ua(),y(),tt(),po(),bo=C(),ge(),Ne(),Er(),Xt(),xo=3,So=new WeakMap,Co=500,wo=new WeakMap,To=()=>{}}));function Do(e,t){let n=new Set(t),r=new Set;return e.filter(e=>{if(e.type===`system`)return e.subtype!==`api_metrics`;let t=e.message?.content[0];if(e.type===`assistant`)return e.isApiErrorMessage?!0:t?.type===`tool_use`&&t.name&&n.has(t.name)?(`id`in t&&r.add(t.id),!0):!1;if(e.type===`user`)return t?.type===`tool_result`?t.tool_use_id!==void 0&&r.has(t.tool_use_id):!e.isMeta;if(e.type===`attachment`){let t=e.attachment;return t?.type===`queued_command`&&t.commandMode===`prompt`&&!t.isMeta&&t.origin===void 0}return!1})}function Oo(e,t){let n=new Set(t),r=new Set,i=[],a=0;for(let t=0;t<e.length;t++){let o=e[t],s=o.message?.content[0];if(o.type===`user`&&s?.type!==`tool_result`&&!o.isMeta){a++;continue}o.type===`assistant`&&(s?.type===`text`?i[t]=a:s?.type===`tool_use`&&s.name&&n.has(s.name)&&r.add(a))}return r.size===0?e:e.filter((e,t)=>{let n=i[t];return n===void 0||!r.has(n)})}function ko(e,t,n=zo,r=Bo){let i=t.current,a=i?e.findIndex(e=>e.uuid===i.uuid):-1,o=a>=0?a:i?Math.min(i.idx,Math.max(0,e.length-n)):0;e.length-o>n+r&&(o=e.length-n);let s=e[o];return s&&(i?.uuid!==s.uuid||i.idx!==o)?t.current={uuid:s.uuid,idx:o}:!s&&i&&(t.current=null),o}function Ao(e){return(e.type===`assistant`||e.type===`user`?Ht(e):null)??e.uuid}function jo(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Mo(e,t,n,r,i,a){if(i===`transcript`)return!0;switch(e.type){case`attachment`:case`user`:case`assistant`:{if(e.type===`assistant`){let t=e.message.content[0];if(t?.type===`server_tool_use`)return a.resolvedToolUseIDs.has(t.id)}let i=Ht(e);return i?t.has(i)||n.has(i)||Ze(i,`PostToolUse`,a)?!1:rr(r,a.resolvedToolUseIDs):!0}case`system`:return e.subtype!==`api_error`;case`grouped_tool_use`:return e.messages.every(e=>{let t=e.message.content[0];return t?.type===`tool_use`&&a.resolvedToolUseIDs.has(t.id)});case`collapsed_read_search`:return!1;default:return!0}}var No,Q,$,Po,Fo,Io,Lo,Ro,zo,Bo,Vo,Ho,Uo=t((()=>{p(),Sn(),No=n(h(),1),Q=n(h(),1),ir(),T(),O(),nn(),y(),bt(),rn(),Pt(),sr(),ur(),it(),pr(),D(),i(),Zt(),vr(),rt(),ce(),Er(),ea(),wt(),ga(),Xt(),gt(),ya(),Le(),Na(),$=C(),Eo(),Po=No.memo(function({agentDefinitions:e}){return(0,$.jsx)(Ut,{children:(0,$.jsxs)(x,{flexDirection:`column`,gap:1,children:[(0,$.jsx)(Xi,{}),(0,$.jsx)(No.Suspense,{fallback:null,children:(0,$.jsx)(ka,{agentDefinitions:e})})]})})}),Fo=(ln(),e(cn)),Io=(ie(),e(de)).BRIEF_TOOL_NAME,Lo=(Ct(),e(We)).SEND_USER_FILE_TOOL_NAME,Ro=30,zo=200,Bo=50,Vo=({messages:e,tools:t,commands:n,verbose:r,toolJSX:i,toolUseConfirmQueue:o,inProgressToolUseIDs:s,isMessageSelectorVisible:c,conversationId:l,screen:p,streamingToolUses:m,showAllInTranscript:h=!1,agentDefinitions:g,onOpenRateLimitOptions:y,hideLogo:b=!1,isLoading:S,hidePastThinking:C=!1,streamingThinking:w,streamingText:T,isBriefOnly:E=!1,unseenDivider:D,scrollRef:O,trackStickyPrompt:te,jumpRef:k,onSearchMatchesChange:re,scanElement:ie,setPositions:A,disableRenderCap:j=!1,cursor:N=null,setCursor:ae,cursorNavRef:oe,renderRange:F})=>{let{columns:I}=u(),se=Ie(`transcript:toggleShowAll`,`Transcript`,`Ctrl+E`),L=(0,Q.useMemo)(()=>Xe(e).filter(Be),[e]),ce=(0,Q.useMemo)(()=>w?w.isStreaming?!0:w.streamingEndedAt?Date.now()-w.streamingEndedAt<3e4:!1:!1,[w]),{lastThinkingBlockId:le,latestBashOutputUUID:ue}=(0,Q.useMemo)(()=>{let e=null,t=null,n=C&&!ce;C&&ce&&(e=`streaming`);for(let r=L.length-1;r>=0;r--){let i=L[r];if(i?.type===`user`){let r=i.message.content;if(!t){for(let e of r)if(e.type===`text`){let n=e.text??``;if(n.startsWith(`<bash-stdout`)||n.startsWith(`<bash-stderr`)){t=i.uuid;break}}}n&&!e&&(r.some(e=>e.type===`tool_result`)||(e=`no-thinking`))}else if(i?.type===`assistant`&&n&&!e){let t=i.message.content;for(let n=t.length-1;n>=0;n--)if(t[n]?.type===`thinking`){e=`${i.uuid}:${n}`;break}}if(e!==null&&t)break}return C||(e=null),{lastThinkingBlockId:e,latestBashOutputUUID:t}},[L,C,ce]),de=(0,Q.useMemo)(()=>ot(L),[L]),fe=(0,Q.useMemo)(()=>m.filter(e=>!s.has(e.contentBlock.id)&&!de.has(e.contentBlock.id)),[m,s,de]),pe=(0,Q.useMemo)(()=>fe.flatMap(e=>{let t=Gt({content:[e.contentBlock]});return t.uuid=tn(e.contentBlock.id,0),Xe([t])}),[fe]),R=p===`transcript`,me=(0,Q.useMemo)(()=>a(process.env.CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL),[]),he=O!=null&&!me,ge=R&&!h&&!he,_e=(0,Q.useRef)(null),z=(0,Q.useRef)(null),{collapsed:ve,lookups:ye,hasTruncatedMessages:be,hiddenMessageCount:xe}=(0,Q.useMemo)(()=>{let e=$e((r||Mt()?L:mt(L,{includeSnipped:!0})).filter(e=>e.type!==`progress`&&!_a(e)&&At(e,R)),pe),n=[Io,Lo].filter(e=>e!==null),i=[Io].filter(e=>e!==null),a=n.length>0&&!R?E?Do(e,n):i.length>0?Oo(e,i):e:e,o=ge?a.slice(-Ro):a,s=ge&&a.length>Ro,{messages:c}=gr(o,t,r),l=or(lr(fr(ct(c,t))),r),u=Bt(L,o),d=(()=>{let e=o.at(-1);return e?.type===`assistant`?e.message?.id:void 0})(),f;if(z.current&&z.current.key===u)f=z.current.lookups;else if(z.current&&L.length>=z.current.normalizedCount&&o.length>=z.current.messageCount&&z.current.lastAssistantMsgId===d){let e=Fe(z.current.lookups,z.current.normalizedCount,z.current.messageCount,L,o);e?(f=e,z.current={key:u,lookups:f,normalizedCount:L.length,messageCount:o.length,lastAssistantMsgId:d}):(f=$t(L,o),z.current={key:u,lookups:f,normalizedCount:L.length,messageCount:o.length,lastAssistantMsgId:d})}else f=$t(L,o),z.current={key:u,lookups:f,normalizedCount:L.length,messageCount:o.length,lastAssistantMsgId:d};let p=e.length-Ro;return{collapsed:l,lookups:f,hasTruncatedMessages:s,hiddenMessageCount:p}},[r,L,R,pe,ge,t,E]),B=(0,Q.useMemo)(()=>{let e=!he&&!j?ko(ve,_e):0;return F?ve.slice(F[0],F[1]):e>0?ve.slice(e):ve},[ve,F,he,j]),Se=(0,Q.useMemo)(()=>new Set(m.map(e=>e.contentBlock.id)),[m]),{dividerBeforeIndex:Ce,selectedIdx:we}=(0,Q.useMemo)(()=>{if(!D&&!N)return{dividerBeforeIndex:-1,selectedIdx:-1};let e=-1,t=-1,n=D?.firstUnseenUuid.slice(0,24);for(let r=0;r<B.length;r++){let i=B[r];if(e===-1&&n&&i.uuid.slice(0,24)===n&&(e=r),t===-1&&N&&i.uuid===N.uuid&&(t=r),e!==-1&&t!==-1)break}return{dividerBeforeIndex:e,selectedIdx:t}},[D,N,B]),[Te,Ee]=(0,Q.useState)(()=>new Set),De=(0,Q.useCallback)(e=>{let t=Ao(e);Ee(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},[]),Oe=(0,Q.useCallback)(e=>Te.size>0&&Te.has(Ao(e)),[Te]),ke=(0,Q.useRef)(ye);ke.current=ye;let Ae=(0,Q.useCallback)(e=>{if(e.type===`collapsed_read_search`)return!0;if(e.type===`assistant`){let t=e.message.content,n=Array.isArray(t)?t[0]:void 0;return n!=null&&yt(n)&&n.type===`advisor_tool_result`&&n.content.type===`advisor_result`}if(e.type!==`user`)return!1;let n=e.message.content[0];if(n?.type!==`tool_result`||n.is_error||!e.toolUseResult)return!1;let r=ke.current.toolUseByToolUseID.get(n.tool_use_id??``)?.name;return(r?an(t,r):void 0)?.isResultTruncated?.(e.toolUseResult)??!1},[t]),je=(!i||!!i.shouldContinueAnimation)&&!o.length&&!c,Me=s.size>0,{progress:Ne}=d(),Pe=(0,Q.useRef)(null),Le=P().terminalProgressBarEnabled&&!ee()&&!(Fo?.isProactiveActive()??!1);(0,Q.useEffect)(()=>{let e=Le?Me?`indeterminate`:`completed`:null;Pe.current!==e&&(Pe.current=e,Ne(e))},[Ne,Le,Me]),(0,Q.useEffect)(()=>()=>Ne(null),[Ne]);let Re=(0,Q.useCallback)(e=>`${e.uuid}-${l}`,[l]),Ve=(e,i)=>{let a=i>0?B[i-1]?.type:void 0,o=e.type===`user`&&a===`user`,c=e.type===`collapsed_read_search`&&(!!T||sa(B,i,t,Se)),l=B.length-1-i>0,u=Re(e),d=(0,$.jsx)(ha,{message:e,isUserContinuation:o,hasContentAfter:c,tools:t,commands:n,verbose:r||Oe(e)||N?.expanded===!0&&i===we,inProgressToolUseIDs:s,streamingToolUseIDs:Se,screen:p,canAnimate:je,onOpenRateLimitOptions:y,lastThinkingBlockId:le,latestBashOutputUUID:ue,columns:I,isLoading:S,lookups:ye,shouldCollapseDiffs:l},u),f=(0,$.jsx)(nt.Provider,{value:i===we,children:d},u);return D&&i===Ce?[(0,$.jsx)(x,{marginTop:1,children:(0,$.jsx)(v,{title:`${D.count} new ${M(D.count,`message`)}`,width:I,color:`inactive`})},`unseen-divider`),f]:f},He=(0,Q.useRef)(new WeakMap),Ue=(0,Q.useCallback)(e=>{let n=He.current.get(e);if(n!==void 0)return n;let r=yr(e);if(e.type===`user`&&e.toolUseResult&&Array.isArray(e.message.content)){let n=e.message.content.find(e=>e.type===`tool_result`);if(n&&`tool_use_id`in n){let i=ye.toolUseByToolUseID.get(n.tool_use_id),a=(i&&an(t,i.name))?.extractSearchText?.(e.toolUseResult);a!==void 0&&(r=a)}}let i=r.toLowerCase();return He.current.set(e,i),i},[t,ye]);return(0,$.jsxs)(Cn,{name:`MessagesBoundary`,children:[!b&&!(F&&F[0]>0)&&(0,$.jsx)(Po,{agentDefinitions:g}),be&&(0,$.jsx)(v,{title:`${se} to show ${f.bold(xe)} previous messages`,width:I}),R&&h&&xe>0&&!j&&(0,$.jsx)(v,{title:`${se} to hide ${f.bold(xe)} previous messages`,width:I}),he?(0,$.jsx)(Tt.Provider,{value:!0,children:(0,$.jsx)(vo,{messages:B,scrollRef:O,columns:I,itemKey:Re,renderItem:Ve,onItemClick:De,isItemClickable:Ae,isItemExpanded:Oe,trackStickyPrompt:te,selectedIndex:we>=0?we:void 0,cursorNavRef:oe,setCursor:ae,jumpRef:k,onSearchMatchesChange:re,scanElement:ie,setPositions:A,extractSearchText:Ue})}):B.flatMap(Ve),T&&!E&&(0,$.jsx)(x,{alignItems:`flex-start`,flexDirection:`row`,marginTop:1,width:`100%`,children:(0,$.jsxs)(x,{flexDirection:`row`,children:[(0,$.jsx)(x,{minWidth:2,children:(0,$.jsx)(_,{color:`text`,children:ne})}),(0,$.jsx)(x,{flexDirection:`column`,children:(0,$.jsx)(ze,{children:T})})]})}),ce&&w&&!E&&(0,$.jsx)(x,{marginTop:1,children:(0,$.jsx)(ut,{param:{type:`thinking`,thinking:w.thinking},addMargin:!1,isTranscriptMode:!0,verbose:r,hideInTranscript:!1})})]})},Ho=No.memo(Vo,(e,t)=>{let n=Object.keys(e);for(let r of n)if(!(r===`onOpenRateLimitOptions`||r===`scrollRef`||r===`trackStickyPrompt`||r===`setCursor`||r===`cursorNavRef`||r===`jumpRef`||r===`onSearchMatchesChange`||r===`scanElement`||r===`setPositions`)&&e[r]!==t[r]){if(r===`streamingToolUses`){let n=e.streamingToolUses,r=t.streamingToolUses;if(n.length===r.length&&n.every((e,t)=>e.contentBlock===r[t]?.contentBlock))continue}if(r===`inProgressToolUseIDs`&&jo(e.inProgressToolUseIDs,t.inProgressToolUseIDs))continue;if(r===`unseenDivider`){let n=e.unseenDivider,r=t.unseenDivider;if(n?.firstUnseenUuid===r?.firstUnseenUuid&&n?.count===r?.count)continue}if(r===`tools`){let n=e.tools,r=t.tools;if(n.length===r.length&&n.every((e,t)=>e.name===r[t]?.name))continue}return!1}return!0})}));export{po as a,qa as c,io as i,Ja as l,Uo as n,to as o,ao as r,eo as s,Ho as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-DR8-3Aex.js";import{f as t,s as n}from"./envUtils-BWeoiL4Y.js";import{J as r,Q as i,Rn as a,T as o,b as s,nt as c,t as l,x as u}from"./src-Di342QoJ.js";import{t as d}from"./jsx-runtime-D-D469L8.js";import{Ac as f,Xi as p,Zi as m,cn as h,on as g,xc as _}from"./paths-
|
|
1
|
+
import{o as e}from"./chunk-DR8-3Aex.js";import{f as t,s as n}from"./envUtils-BWeoiL4Y.js";import{J as r,Q as i,Rn as a,T as o,b as s,nt as c,t as l,x as u}from"./src-Di342QoJ.js";import{t as d}from"./jsx-runtime-D-D469L8.js";import{Ac as f,Xi as p,Zi as m,cn as h,on as g,xc as _}from"./paths-1ngPRtu3.js";import{n as v,r as y}from"./analytics-DqMQntaB.js";import{a as b,n as x}from"./env-chR0gV31.js";import{Ax as S,kx as C,my as w,py as T,vy as E}from"./loadAgentsDir-D7kapZB5.js";import{t as D}from"./useKeybinding-FsOnjW6T.js";import{c as O,i as k,s as A}from"./terminalSetup-bSbq4LE7.js";import{l as j,u as M}from"./referral-BKeCKnOJ.js";import{t as N}from"./WelcomeV2-Au_5ddlT.js";import{n as P,t as F}from"./ThemePicker-BG1ykSpX.js";import{n as I,t as L}from"./PressEnterToContinue-BdA9zDGs.js";import{t as R}from"./ApproveApiKey-9rkwQfgT.js";n();var z=e(a(),1),B=d();v(),b(),f(),p(),g(),D(),k(),j(),l(),l(),E(),S(),w(),P(),I(),l();var V=(0,z.createContext)({marker:``});function H({children:e}){let{marker:t}=(0,z.useContext)(V);return(0,B.jsxs)(u,{gap:1,children:[(0,B.jsx)(s,{dimColor:!0,children:t}),(0,B.jsx)(u,{flexDirection:`column`,children:e})]})}l();var U=(0,z.createContext)({marker:``});function W({children:e}){let{marker:t}=(0,z.useContext)(U),n=0;for(let t of z.Children.toArray(e))!(0,z.isValidElement)(t)||t.type!==H||n++;let r=String(n).length;return(0,B.jsx)(u,{flexDirection:`column`,children:z.Children.map(e,(e,n)=>{if(!(0,z.isValidElement)(e)||e.type!==H)return e;let i=`${t}${`${String(n+1).padStart(r)}.`}`;return(0,B.jsx)(U.Provider,{value:{marker:i},children:(0,B.jsx)(V.Provider,{value:{marker:i},children:e})})})})}W.Item=H;var G=W;l();function K({onDone:e}){let[n,a]=(0,z.useState)(0),[l,d]=(0,z.useState)(!1),[f]=(0,z.useState)(()=>h()),[p,g]=o();(0,z.useEffect)(()=>{y(`tengu_began_setup`,{oauthEnabled:f})},[f]);function v(){if(n<j.length-1){let e=n+1;a(e),y(`tengu_onboarding_step`,{oauthEnabled:f,stepId:j[e]?.id})}else e()}function b(e){g(e),v()}let S=M(),w=(0,B.jsx)(u,{marginX:1,children:(0,B.jsx)(F,{onThemeSelect:b,showIntroText:!0,helpText:`To change this later, run /theme`,hideEscToCancel:!0,skipExitHandling:!0})}),E=(0,B.jsxs)(u,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,B.jsx)(s,{bold:!0,children:`Before you start, keep in mind:`}),(0,B.jsx)(u,{flexDirection:`column`,width:70,children:(0,B.jsxs)(G,{children:[(0,B.jsxs)(G.Item,{children:[(0,B.jsx)(s,{children:`Always review changes before accepting`}),(0,B.jsxs)(s,{dimColor:!0,wrap:`wrap`,children:[`Claude can make mistakes — especially when running commands`,(0,B.jsx)(r,{}),`or editing files. You stay in control of every action.`,(0,B.jsx)(r,{})]})]}),(0,B.jsxs)(G.Item,{children:[(0,B.jsx)(s,{children:`Only use Claude Code on projects you trust`}),(0,B.jsxs)(s,{dimColor:!0,wrap:`wrap`,children:[`Untrusted code could contain prompt injection attacks.`,(0,B.jsx)(r,{}),(0,B.jsx)(i,{url:`https://code.claude.com/docs/en/security`})]})]})]})}),(0,B.jsx)(L,{})]}),D=(0,z.useMemo)(()=>{if(!process.env.ANTHROPIC_API_KEY||t())return``;let e=m(process.env.ANTHROPIC_API_KEY);if(_(e)===`new`)return e},[]);function k(e){e&&d(!0),v()}let j=[];j.push({id:`theme`,component:w}),D&&j.push({id:`api-key`,component:(0,B.jsx)(R,{customApiKeyTruncated:D,onDone:k})}),f&&j.push({id:`oauth`,component:(0,B.jsx)(q,{skip:l,onSkip:v,children:(0,B.jsx)(T,{onDone:v})})}),j.push({id:`security`,component:E}),O()&&j.push({id:`terminal-setup`,component:(0,B.jsxs)(u,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,B.jsx)(s,{bold:!0,children:`Use Claude Code's terminal setup?`}),(0,B.jsxs)(u,{flexDirection:`column`,width:70,gap:1,children:[(0,B.jsxs)(s,{children:[`For the optimal coding experience, enable the recommended settings`,(0,B.jsx)(r,{}),`for your terminal:`,` `,x.terminal===`Apple_Terminal`?`Option+Enter for newlines and visual bell`:`Shift+Enter for newlines`]}),(0,B.jsx)(C,{options:[{label:`Yes, use recommended settings`,value:`install`},{label:`No, maybe later with /terminal-setup`,value:`no`}],onChange:e=>{e===`install`?A(p).catch(()=>{}).finally(v):v()},onCancel:()=>v()}),(0,B.jsx)(s,{dimColor:!0,children:S.pending?(0,B.jsxs)(B.Fragment,{children:[`Press `,S.keyName,` again to exit`]}):(0,B.jsx)(B.Fragment,{children:`Enter to confirm · Esc to skip`})})]})]})});let P=j[n],I=(0,z.useCallback)(()=>{n===j.length-1?e():v()},[n,j.length,f,e]),V=(0,z.useCallback)(()=>{v()},[n,j.length,f,e]);return c({"confirm:yes":I},{context:`Confirmation`,isActive:P?.id===`security`}),c({"confirm:no":V},{context:`Confirmation`,isActive:P?.id===`terminal-setup`}),(0,B.jsxs)(u,{flexDirection:`column`,children:[(0,B.jsx)(N,{}),(0,B.jsxs)(u,{flexDirection:`column`,marginTop:1,children:[P?.component,S.pending&&(0,B.jsx)(u,{padding:1,children:(0,B.jsxs)(s,{dimColor:!0,children:[`Press `,S.keyName,` again to exit`]})})]})]})}function q({skip:e,onSkip:t,children:n}){return(0,z.useEffect)(()=>{e&&t()},[e,t]),e?null:n}export{K as Onboarding};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,t as i}from"./src-Di342QoJ.js";import{t as a}from"./jsx-runtime-D-D469L8.js";import{Ac as o,Pc as s,Sc as c}from"./paths-
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,t as i}from"./src-Di342QoJ.js";import{t as a}from"./jsx-runtime-D-D469L8.js";import{Ac as o,Pc as s,Sc as c}from"./paths-1ngPRtu3.js";import{n as l,r as u}from"./analytics-DqMQntaB.js";import{C as d,x as f}from"./startupProfiler-DnXZaX4A.js";import{a as p,n as m,r as h,t as g}from"./overageCreditGrant-BrN7dk3d.js";function _(){let e=m();return!e||!e.available||e.granted?!1:g(e)!==null}function v(){if(!_())return!1;let e=c();return!(e.hasVisitedExtraUsage||(e.overageCreditUpsellSeenCount??0)>=O)}function y(){m()===null&&p()}function b(){let[e]=(0,E.useState)(()=>(y(),v()));return e}function x(){let e=0;s(t=>(e=(t.overageCreditUpsellSeenCount??0)+1,{...t,overageCreditUpsellSeenCount:e})),u(`tengu_overage_credit_upsell_shown`,{seen_count:e})}function S(e){return`${e} in extra usage for third-party apps · /extra-usage`}function C(e){return`${e} in extra usage`}function w({maxWidth:e,twoLine:t}){let n=m();if(!n)return null;let i=g(n);if(!i)return null;if(t){let t=C(i);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(r,{color:`claude`,children:e?d(t,e):t}),(0,D.jsx)(r,{dimColor:!0,children:e?d(k,e):k})]})}let a=S(i),o=e?d(a,e):a,s=Math.min(C(i).length,o.length);return(0,D.jsxs)(r,{dimColor:!0,children:[(0,D.jsx)(r,{color:`claude`,children:o.slice(0,s)}),o.slice(s)]})}function T(){let e=m(),t=e?g(e):null,n=t?C(t):`extra usage credit`;return{title:n,lines:[],customContent:{content:(0,D.jsx)(r,{dimColor:!0,children:k}),width:Math.max(n.length,47)}}}var E,D,O,k,A=e((()=>{n(),E=t(n(),1),i(),l(),h(),o(),f(),D=a(),O=3,k=`On us. Works on third-party apps · /extra-usage`}));export{_ as a,A as i,T as n,v as o,x as r,b as s,w as t};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{s as n,u as r}from"./envUtils-BWeoiL4Y.js";import{n as i,t as a}from"./figures-gfT9mM8P.js";import{Cn as o,F as s,Q as c,Rn as l,T as u,Ut as d,_ as f,b as p,f as m,g as h,h as g,n as _,nt as v,p as y,r as b,t as x,tn as ee,tt as te,v as S,x as C,xt as ne}from"./src-Di342QoJ.js";import{t as w}from"./jsx-runtime-D-D469L8.js";import{Ac as T,Do as E,Fc as D,Po as O,Qa as k,Zt as A,as as j,jo as M,lo as re,ls as N,no as P,on as ie,oo as F,os as ae,ws as oe,xs as se}from"./paths-1ngPRtu3.js";import{K as I,L as ce,T as le,V as L,d as ue,s as de,w as fe}from"./debug-UI3T040K.js";import{n as pe,r as me}from"./analytics-DqMQntaB.js";import{l as he,u as ge}from"./oauth-CdZEzMww.js";import{c as _e,o as ve,s as ye}from"./log-CzsijfHZ.js";import{b as be,x as xe}from"./teammate-DMYOtLTK.js";import{E as Se,S as Ce}from"./startupProfiler-DnXZaX4A.js";import{$s as we,As as Te,Aw as Ee,BC as De,CC as Oe,EC as R,Es as ke,FA as Ae,Fs as je,Fw as Me,Fx as Ne,Gs as Pe,Hs as Fe,IA as Ie,IS as Le,Iw as Re,Ix as ze,JC as Be,KC as Ve,Ms as He,Mw as Ue,NS as We,Nw as Ge,Ow as Ke,PS as qe,Pw as Je,QC as Ye,Qk as Xe,Rs as Ze,Tw as Qe,Tx as $e,UC as et,Vs as tt,WC as nt,XS as z,Xs as rt,YC as it,Ys as at,ZS as ot,ac as st,cw as ct,dw as lt,ec as ut,fs as dt,gy as ft,ic as pt,jw as mt,kA as ht,ks as gt,kw as _t,kx as vt,lc as yt,nA as bt,nc as xt,nh as St,ps as Ct,qs as wt,rc as Tt,rh as Et,sc as Dt,tA as Ot,tc as kt,uc as At,uy as jt,vC as Mt,vs as Nt,vx as Pt,vy as Ft,wC as It,ww as Lt,ys as Rt,zw as zt}from"./loadAgentsDir-D7kapZB5.js";import{i as Bt,o as Vt,p as Ht,u as Ut}from"./xml-DTMvLcPg.js";import{n as Wt,t as Gt}from"./browser-fLRXxIsQ.js";import{t as Kt}from"./useKeybinding-FsOnjW6T.js";import{l as qt,u as Jt}from"./referral-BKeCKnOJ.js";import{n as Yt,t as Xt}from"./pluginStartupCheck-RRcAbKfx.js";import{a as Zt,d as Qt,f as $t,i as en,l as tn,o as nn,s as rn,u as an}from"./pluginOperations-C9XP-mko.js";import{a as on,c as sn,i as cn,n as ln,o as un,s as dn,t as fn}from"./validatePlugin-DpHiJRsT.js";import{a as pn,n as mn,o as hn,r as gn}from"./pluginFlagging-BFCtv3kY.js";import{i as _n,n as vn,r as yn}from"./MCPConnectionManager-BK_3uwQj.js";import{t as bn}from"./SearchBox-DfOmUoaI.js";import{n as xn,t as Sn}from"./useSearchInput-CF77X2OV.js";import{i as Cn,n as wn}from"./pluginAutoupdate-CAa4KLro.js";import*as Tn from"path";import*as En from"fs/promises";function Dn({serverToolsCount:e,serverPromptsCount:t,serverResourcesCount:n}){let r=[];return e>0&&r.push(`tools`),n>0&&r.push(`resources`),t>0&&r.push(`prompts`),(0,On.jsxs)(C,{children:[(0,On.jsx)(p,{bold:!0,children:`Capabilities: `}),(0,On.jsx)(p,{color:`text`,children:r.length>0?(0,On.jsx)(g,{children:r}):`none`})]})}var On,kn=e((()=>{l(),x(),On=w()}));function An(e,t){switch(e.client.type){case`connected`:return{message:`Reconnected to ${t}.`,success:!0};case`needs-auth`:return{message:`${t} requires authentication. Use the 'Authenticate' option.`,success:!1};case`failed`:return{message:`Failed to reconnect to ${t}.`,success:!1};default:return{message:`Unknown result when reconnecting to ${t}.`,success:!1}}}function jn(e,t){return`Error reconnecting to ${t}: ${e instanceof Error?e.message:String(e)}`}var Mn=e((()=>{}));function Nn({server:e,serverToolsCount:t,onViewTools:n,onCancel:r,onComplete:i,borderless:o=!1}){let[l]=u(),d=Jt(),{columns:f}=s(),[m,_]=B.useState(!1),[v,y]=B.useState(null),b=qe(e=>e.mcp),x=Le(),[w,T]=B.useState(null),[D,O]=(0,B.useState)(!1),k=(0,B.useRef)(null),[j,M]=(0,B.useState)(!1),[re,N]=(0,B.useState)(null),[P,ie]=(0,B.useState)(!1),[F,ae]=(0,B.useState)(null),[oe,se]=(0,B.useState)(!1),[I,le]=(0,B.useState)(!1),L=(0,B.useRef)(void 0),ue=(0,B.useRef)(!1),[de,fe]=(0,B.useState)(``),[pe,ge]=(0,B.useState)(0),[ve,ye]=(0,B.useState)(null);(0,B.useEffect)(()=>()=>{ue.current=!0,k.current?.abort(),L.current!==void 0&&clearTimeout(L.current)},[]);let be=e.isAuthenticated||e.client.type===`connected`&&t>0,xe=yn(),Se=B.useCallback(async()=>{M(!1),N(null),O(!0);try{let t=await xe(e.name),n=t.client.type===`connected`;me(`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){me(`tengu_claudeai_mcp_auth_completed`,{success:!1}),i?.(jn(t,e.name))}finally{O(!1)}},[xe,e.name,i]),Ce=B.useCallback(async()=>{await Pt(e.name,{...e.config,scope:e.scope}),x(t=>{let n=t.mcp.clients.map(t=>t.name===e.name?{...t,type:`needs-auth`}:t),r=Ve(t.mcp.tools,e.name),i=et(t.mcp.commands,e.name),a=nt(t.mcp.resources,e.name);return{...t,mcp:{...t.mcp,clients:n,tools:r,commands:i,resources:a}}}),me(`tengu_claudeai_mcp_clear_auth_completed`,{}),i?.(`Disconnected from ${e.name}.`),ie(!1),ae(null),se(!1)},[e.name,e.config,e.scope,x,i]);te(`confirm:no`,()=>{k.current?.abort(),k.current=null,_(!1),T(null)},{context:`Confirmation`,isActive:m}),te(`confirm:no`,()=>{M(!1),N(null)},{context:`Confirmation`,isActive:j}),te(`confirm:no`,()=>{ie(!1),ae(null),se(!1)},{context:`Confirmation`,isActive:P}),ne((e,t)=>{if(t.return&&j&&Se(),t.return&&P)if(oe)Ce();else{let e=`${he().CLAUDE_AI_ORIGIN}/settings/connectors`;ae(e),se(!0),Wt(e)}if(e===`c`&&!I){let e=w||re||F;e&&ee(e).then(e=>{ue.current||(e&&process.stdout.write(e),le(!0),L.current!==void 0&&clearTimeout(L.current),L.current=setTimeout(le,2e3,!1))})}});let we=E(String(e.name)),Te=Be(b.commands,e.name).length,Ee=_n(),Oe=B.useCallback(async()=>{let t=he().CLAUDE_AI_ORIGIN,n=A()?.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),M(!0),me(`tengu_claudeai_mcp_auth_started`,{}),await Wt(r)},[e.config]),ke=B.useCallback(()=>{ie(!0),me(`tengu_claudeai_mcp_clear_auth_started`,{})},[]),Ae=B.useCallback(async()=>{let t=e.client.type!==`disabled`;try{await Ee(e.name),e.config.type===`claudeai-proxy`&&me(`tengu_claudeai_mcp_toggle`,{new_state:t?`disabled`:`enabled`}),r()}catch(n){i?.(`Failed to ${t?`disable`:`enable`} MCP server '${e.name}': ${ce(n)}`)}},[e.client.type,e.config.type,e.name,Ee,r,i]),je=B.useCallback(async()=>{if(e.config.type===`claudeai-proxy`)return;_(!0),y(null);let t=new AbortController;k.current=t;try{if(e.isAuthenticated&&e.config&&await R(e.name,e.config,{preserveStepUpState:!0}),e.config){await It(e.name,e.config,T,t.signal,{onWaitingForCallback:e=>{ye(()=>e)}}),me(`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.`):(_e(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 Mt)&&y(e.message)}finally{_(!1),k.current=null,ye(null),fe(``)}},[e.isAuthenticated,e.config,e.name,i,xe,be]),Me=async()=>{e.config.type!==`claudeai-proxy`&&e.config&&(await R(e.name,e.config),me(`tengu_mcp_auth_config_clear`,{}),await Pt(e.name,{...e.config,scope:e.scope}),x(t=>{let n=t.mcp.clients.map(t=>t.name===e.name?{...t,type:`failed`}:t),r=Ve(t.mcp.tools,e.name),i=et(t.mcp.commands,e.name),a=nt(t.mcp.resources,e.name);return{...t,mcp:{...t.mcp,clients:n,tools:r,commands:i,resources:a}}}),i?.(`Authentication cleared for ${e.name}.`))};if(m){let t=e.config.type!==`claudeai-proxy`&&e.config.oauth?.xaa?` Authenticating via your identity provider`:` A browser window will open for authentication`;return(0,V.jsxs)(C,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(p,{color:`claude`,children:[`Authenticating with `,e.name,`…`]}),(0,V.jsxs)(C,{children:[(0,V.jsx)(ft,{}),(0,V.jsx)(p,{children:t})]}),w&&(0,V.jsxs)(C,{flexDirection:`column`,children:[(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL manually `}),I?(0,V.jsx)(p,{color:`success`,children:`(Copied!)`}):(0,V.jsx)(p,{dimColor:!0,children:(0,V.jsx)(h,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,V.jsx)(c,{url:w})]}),m&&w&&ve&&(0,V.jsxs)(C,{flexDirection:`column`,marginTop:1,children:[(0,V.jsx)(p,{dimColor:!0,children:`If the redirect page shows a connection error, paste the URL from your browser's address bar:`}),(0,V.jsxs)(C,{children:[(0,V.jsxs)(p,{dimColor:!0,children:[`URL `,`>`,` `]}),(0,V.jsx)(Ne,{value:de,onChange:fe,onSubmit:e=>{ve(e.trim()),fe(``)},cursorOffset:pe,onChangeCursorOffset:ge,columns:f-8})]})]}),(0,V.jsx)(C,{marginLeft:3,children:(0,V.jsx)(p,{dimColor:!0,children:`Return here after authenticating in your browser. Press Esc to go back.`})})]})}if(j)return(0,V.jsxs)(C,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(p,{color:`claude`,children:[`Authenticating with `,e.name,`…`]}),(0,V.jsxs)(C,{children:[(0,V.jsx)(ft,{}),(0,V.jsx)(p,{children:` A browser window will open for authentication`})]}),re&&(0,V.jsxs)(C,{flexDirection:`column`,children:[(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL manually `}),I?(0,V.jsx)(p,{color:`success`,children:`(Copied!)`}):(0,V.jsx)(p,{dimColor:!0,children:(0,V.jsx)(h,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,V.jsx)(c,{url:re})]}),(0,V.jsxs)(C,{marginLeft:3,flexDirection:`column`,children:[(0,V.jsxs)(p,{color:`permission`,children:[`Press `,(0,V.jsx)(p,{bold:!0,children:`Enter`}),` after authenticating in your browser.`]}),(0,V.jsx)(p,{dimColor:!0,italic:!0,children:(0,V.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})]})]});if(P)return(0,V.jsxs)(C,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(p,{color:`claude`,children:[`Clear authentication for `,e.name]}),oe?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(p,{children:`Find the MCP server in the browser and click "Disconnect".`}),F&&(0,V.jsxs)(C,{flexDirection:`column`,children:[(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{dimColor:!0,children:`If your browser didn't open automatically, copy this URL manually `}),I?(0,V.jsx)(p,{color:`success`,children:`(Copied!)`}):(0,V.jsx)(p,{dimColor:!0,children:(0,V.jsx)(h,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,V.jsx)(c,{url:F})]}),(0,V.jsxs)(C,{marginLeft:3,flexDirection:`column`,children:[(0,V.jsxs)(p,{color:`permission`,children:[`Press `,(0,V.jsx)(p,{bold:!0,children:`Enter`}),` when done.`]}),(0,V.jsx)(p,{dimColor:!0,italic:!0,children:(0,V.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})]})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(p,{children:`This will open claude.ai in the browser. Find the MCP server in the list and click "Disconnect".`}),(0,V.jsxs)(C,{marginLeft:3,flexDirection:`column`,children:[(0,V.jsxs)(p,{color:`permission`,children:[`Press `,(0,V.jsx)(p,{bold:!0,children:`Enter`}),` to open the browser.`]}),(0,V.jsx)(p,{dimColor:!0,italic:!0,children:(0,V.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})]})]})]});if(D)return(0,V.jsxs)(C,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(p,{color:`text`,children:[`Connecting to `,(0,V.jsx)(p,{bold:!0,children:e.name}),`…`]}),(0,V.jsxs)(C,{children:[(0,V.jsx)(ft,{}),(0,V.jsx)(p,{children:` Establishing connection to MCP server`})]}),(0,V.jsx)(p,{dimColor:!0,children:`This may take a few moments.`})]});let Pe=[];return e.client.type===`disabled`&&Pe.push({label:`Enable`,value:`toggle-enabled`}),e.client.type===`connected`&&t>0&&Pe.push({label:`View tools`,value:`tools`}),e.config.type===`claudeai-proxy`?e.client.type===`connected`?Pe.push({label:`Clear authentication`,value:`claudeai-clear-auth`}):e.client.type!==`disabled`&&Pe.push({label:`Authenticate`,value:`claudeai-auth`}):(be&&(Pe.push({label:`Re-authenticate`,value:`reauth`}),Pe.push({label:`Clear authentication`,value:`clear-auth`})),be||Pe.push({label:`Authenticate`,value:`auth`})),e.client.type!==`disabled`&&(e.client.type!==`needs-auth`&&Pe.push({label:`Reconnect`,value:`reconnectMcpServer`}),Pe.push({label:`Disable`,value:`toggle-enabled`})),Pe.length===0&&Pe.push({label:`Back`,value:`back`}),(0,V.jsxs)(C,{flexDirection:`column`,children:[(0,V.jsxs)(C,{flexDirection:`column`,paddingX:1,borderStyle:o?void 0:`round`,children:[(0,V.jsx)(C,{marginBottom:1,children:(0,V.jsxs)(p,{bold:!0,children:[we,` MCP Server`]})}),(0,V.jsxs)(C,{flexDirection:`column`,gap:0,children:[(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{bold:!0,children:`Status: `}),e.client.type===`disabled`?(0,V.jsxs)(p,{children:[S(`inactive`,l)(a.radioOff),` disabled`]}):e.client.type===`connected`?(0,V.jsxs)(p,{children:[S(`success`,l)(a.tick),` connected`]}):e.client.type===`pending`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(p,{dimColor:!0,children:a.radioOff}),(0,V.jsx)(p,{children:` connecting…`})]}):e.client.type===`needs-auth`?(0,V.jsxs)(p,{children:[S(`warning`,l)(a.triangleUpOutline),` needs authentication`]}):(0,V.jsxs)(p,{children:[S(`error`,l)(a.cross),` failed`]})]}),e.transport!==`claudeai-proxy`&&(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{bold:!0,children:`Auth: `}),be?(0,V.jsxs)(p,{children:[S(`success`,l)(a.tick),` authenticated`]}):(0,V.jsxs)(p,{children:[S(`error`,l)(a.cross),` not authenticated`]})]}),(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{bold:!0,children:`URL: `}),(0,V.jsx)(p,{dimColor:!0,children:e.config.url})]}),(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{bold:!0,children:`Config location: `}),(0,V.jsx)(p,{dimColor:!0,children:De(e.scope)})]}),e.client.type===`connected`&&(0,V.jsx)(Dn,{serverToolsCount:t,serverPromptsCount:Te,serverResourcesCount:b.resources[e.name]?.length||0}),e.client.type===`connected`&&t>0&&(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{bold:!0,children:`Tools: `}),(0,V.jsxs)(p,{dimColor:!0,children:[t,` tools`]})]})]}),v&&(0,V.jsx)(C,{marginTop:1,children:(0,V.jsxs)(p,{color:`error`,children:[`Error: `,v]})}),Pe.length>0&&(0,V.jsx)(C,{marginTop:1,children:(0,V.jsx)(vt,{options:Pe,onChange:async t=>{switch(t){case`tools`:n();break;case`auth`:case`reauth`:await je();break;case`clear-auth`:await Me();break;case`claudeai-auth`:await Oe();break;case`claudeai-clear-auth`:ke();break;case`reconnectMcpServer`:O(!0);try{let t=await xe(e.name);e.config.type===`claudeai-proxy`&&me(`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`&&me(`tengu_claudeai_mcp_reconnect`,{success:!1}),i?.(jn(t,e.name))}finally{O(!1)}break;case`toggle-enabled`:await Ae();break;case`back`:r();break}},onCancel:r})})]}),(0,V.jsx)(C,{marginTop:1,children:(0,V.jsx)(p,{dimColor:!0,italic:!0,children:d.pending?(0,V.jsxs)(V.Fragment,{children:[`Press `,d.keyName,` again to exit`]}):(0,V.jsxs)(g,{children:[(0,V.jsx)(h,{shortcut:`↑↓`,action:`navigate`}),(0,V.jsx)(h,{shortcut:`Enter`,action:`select`}),(0,V.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}var B,V,Pn=e((()=>{i(),B=t(l(),1),pe(),ge(),qt(),zt(),x(),Kt(),Oe(),$e(),vn(),Ye(),We(),ie(),Gt(),L(),ve(),M(),ot(),jt(),Ft(),ze(),kn(),Mn(),V=w()}));function Fn({server:e,serverToolsCount:t,onViewTools:n,onCancel:r,onComplete:i,borderless:o=!1}){let[s]=u(),c=Jt(),l=qe(e=>e.mcp),d=yn(),f=_n(),[m,_]=(0,In.useState)(!1),v=In.useCallback(async()=>{let t=e.client.type!==`disabled`;try{await f(e.name),r()}catch(n){i(`Failed to ${t?`disable`:`enable`} MCP server '${e.name}': ${ce(n)}`)}},[e.client.type,e.name,f,r,i]),y=E(String(e.name)),b=Be(l.commands,e.name).length,x=[];return e.client.type!==`disabled`&&t>0&&x.push({label:`View tools`,value:`tools`}),e.client.type!==`disabled`&&x.push({label:`Reconnect`,value:`reconnectMcpServer`}),x.push({label:e.client.type===`disabled`?`Enable`:`Disable`,value:`toggle-enabled`}),x.length===0&&x.push({label:`Back`,value:`back`}),m?(0,H.jsxs)(C,{flexDirection:`column`,gap:1,padding:1,children:[(0,H.jsxs)(p,{color:`text`,children:[`Reconnecting to `,(0,H.jsx)(p,{bold:!0,children:e.name})]}),(0,H.jsxs)(C,{children:[(0,H.jsx)(ft,{}),(0,H.jsx)(p,{children:` Restarting MCP server process`})]}),(0,H.jsx)(p,{dimColor:!0,children:`This may take a few moments.`})]}):(0,H.jsxs)(C,{flexDirection:`column`,children:[(0,H.jsxs)(C,{flexDirection:`column`,paddingX:1,borderStyle:o?void 0:`round`,children:[(0,H.jsx)(C,{marginBottom:1,children:(0,H.jsxs)(p,{bold:!0,children:[y,` MCP Server`]})}),(0,H.jsxs)(C,{flexDirection:`column`,gap:0,children:[(0,H.jsxs)(C,{children:[(0,H.jsx)(p,{bold:!0,children:`Status: `}),e.client.type===`disabled`?(0,H.jsxs)(p,{children:[S(`inactive`,s)(a.radioOff),` disabled`]}):e.client.type===`connected`?(0,H.jsxs)(p,{children:[S(`success`,s)(a.tick),` connected`]}):e.client.type===`pending`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(p,{dimColor:!0,children:a.radioOff}),(0,H.jsx)(p,{children:` connecting…`})]}):(0,H.jsxs)(p,{children:[S(`error`,s)(a.cross),` failed`]})]}),(0,H.jsxs)(C,{children:[(0,H.jsx)(p,{bold:!0,children:`Command: `}),(0,H.jsx)(p,{dimColor:!0,children:e.config.command})]}),e.config.args&&e.config.args.length>0&&(0,H.jsxs)(C,{children:[(0,H.jsx)(p,{bold:!0,children:`Args: `}),(0,H.jsx)(p,{dimColor:!0,children:e.config.args.join(` `)})]}),(0,H.jsxs)(C,{children:[(0,H.jsx)(p,{bold:!0,children:`Config location: `}),(0,H.jsx)(p,{dimColor:!0,children:De(ct(e.name)?.scope??`dynamic`)})]}),e.client.type===`connected`&&(0,H.jsx)(Dn,{serverToolsCount:t,serverPromptsCount:b,serverResourcesCount:l.resources[e.name]?.length||0}),e.client.type===`connected`&&t>0&&(0,H.jsxs)(C,{children:[(0,H.jsx)(p,{bold:!0,children:`Tools: `}),(0,H.jsxs)(p,{dimColor:!0,children:[t,` tools`]})]})]}),x.length>0&&(0,H.jsx)(C,{marginTop:1,children:(0,H.jsx)(vt,{options:x,onChange:async t=>{if(t===`tools`)n();else if(t===`reconnectMcpServer`){_(!0);try{let{message:t}=An(await d(e.name),e.name);i?.(t)}catch(t){i?.(jn(t,e.name))}finally{_(!1)}}else t===`toggle-enabled`?await v():t===`back`&&r()},onCancel:r})})]}),(0,H.jsx)(C,{marginTop:1,children:(0,H.jsx)(p,{dimColor:!0,italic:!0,children:c.pending?(0,H.jsxs)(H.Fragment,{children:[`Press `,c.keyName,` again to exit`]}):(0,H.jsxs)(g,{children:[(0,H.jsx)(h,{shortcut:`↑↓`,action:`navigate`}),(0,H.jsx)(h,{shortcut:`Enter`,action:`select`}),(0,H.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}var In,H,Ln=e((()=>{i(),In=t(l(),1),qt(),x(),lt(),vn(),Ye(),We(),L(),M(),ot(),jt(),Ft(),kn(),Mn(),H=w()}));function Rn({tool:e,server:t,onBack:n}){let[r,i]=zn.useState(``),a=ae(e.name,t.name),o=j(e.userFacingName?e.userFacingName({}):a),s=e.isReadOnly?.({})??!1,c=e.isDestructive?.({})??!1,l=e.isOpenWorld?.({})??!1;return zn.useEffect(()=>{async function t(){try{i(await e.description({},{isNonInteractiveSession:!1,toolPermissionContext:{mode:`default`,additionalWorkingDirectories:new Map,alwaysAllowRules:{},alwaysDenyRules:{},alwaysAskRules:{},isBypassPermissionsModeAvailable:!1},tools:[]}))}catch{i(`Failed to load description`)}}t()},[e]),(0,U.jsx)(m,{title:(0,U.jsxs)(U.Fragment,{children:[o,s&&(0,U.jsx)(p,{color:`success`,children:` [read-only]`}),c&&(0,U.jsx)(p,{color:`error`,children:` [destructive]`}),l&&(0,U.jsx)(p,{dimColor:!0,children:` [open-world]`})]}),subtitle:t.name,onCancel:n,inputGuide:e=>e.pending?(0,U.jsxs)(p,{children:[`Press `,e.keyName,` again to exit`]}):(0,U.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`}),children:(0,U.jsxs)(C,{flexDirection:`column`,children:[(0,U.jsxs)(C,{children:[(0,U.jsx)(p,{bold:!0,children:`Tool name: `}),(0,U.jsx)(p,{dimColor:!0,children:a})]}),(0,U.jsxs)(C,{children:[(0,U.jsx)(p,{bold:!0,children:`Full name: `}),(0,U.jsx)(p,{dimColor:!0,children:e.name})]}),r&&(0,U.jsxs)(C,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(p,{bold:!0,children:`Description:`}),(0,U.jsx)(p,{wrap:`wrap`,children:r})]}),e.inputJSONSchema&&e.inputJSONSchema.properties&&Object.keys(e.inputJSONSchema.properties).length>0&&(0,U.jsxs)(C,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(p,{bold:!0,children:`Parameters:`}),(0,U.jsx)(C,{marginLeft:2,flexDirection:`column`,children:Object.entries(e.inputJSONSchema.properties).map(([t,n])=>{let r=(e.inputJSONSchema?.required)?.includes(t);return(0,U.jsxs)(p,{children:[`• `,t,r&&(0,U.jsx)(p,{dimColor:!0,children:` (required)`}),`:`,` `,(0,U.jsx)(p,{dimColor:!0,children:typeof n==`object`&&n&&`type`in n?String(n.type):`unknown`}),typeof n==`object`&&n&&`description`in n&&(0,U.jsxs)(p,{dimColor:!0,children:[` - `,String(n.description)]})]},t)})})]})]})})}var zn,U,Bn=e((()=>{zn=t(l(),1),x(),N(),ot(),U=w()}));function Vn({server:e,onSelectTool:t,onBack:n}){let r=qe(e=>e.mcp.tools),i=Hn.useMemo(()=>e.client.type===`connected`?it(r,e.name):[],[e,r]),a=i.map((t,n)=>{let r=ae(t.name,e.name),i=j(t.userFacingName?t.userFacingName({}):r),a=t.isReadOnly?.({})??!1,o=t.isDestructive?.({})??!1,s=t.isOpenWorld?.({})??!1,c=[];return a&&c.push(`read-only`),o&&c.push(`destructive`),s&&c.push(`open-world`),{label:i,value:n.toString(),description:c.length>0?c.join(`, `):void 0,descriptionColor:o?`error`:a?`success`:void 0}});return(0,Un.jsx)(m,{title:`Tools for ${e.name}`,subtitle:`${i.length} ${O(i.length,`tool`)}`,onCancel:n,inputGuide:e=>e.pending?(0,Un.jsxs)(p,{children:[`Press `,e.keyName,` again to exit`]}):(0,Un.jsxs)(g,{children:[(0,Un.jsx)(h,{shortcut:`↑↓`,action:`navigate`}),(0,Un.jsx)(h,{shortcut:`Enter`,action:`select`}),(0,Un.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]}),children:i.length===0?(0,Un.jsx)(p,{dimColor:!0,children:`No tools available`}):(0,Un.jsx)(vt,{options:a,onChange:e=>{let n=parseInt(e,10),r=i[n];r&&t(r,n)},onCancel:n})})}var Hn,Un,Wn=e((()=>{Hn=t(l(),1),x(),N(),Ye(),We(),M(),ot(),jt(),Un=w()}));function Gn({inputValue:e,setInputValue:t,cursorOffset:n,setCursorOffset:r,error:i,setError:a,result:o,setResult:s,setViewState:c,onAddComplete:l,cliMode:u=!1}){let d=(0,Kn.useRef)(!1),[f,m]=(0,Kn.useState)(!1),[_,v]=(0,Kn.useState)(``),y=async()=>{let t=e.trim();if(!t){a(`Please enter a marketplace source`);return}let n=await on(t);if(!n){a(`Invalid marketplace source format. Try: owner/repo, https://..., or ./path`);return}if(`error`in n){a(n.error);return}a(null);try{m(!0),v(``);let{name:e,resolvedSource:t}=await je(n,e=>{v(e)});at(e,{source:t}),yt();let r=n.source;n.source===`github`&&(r=n.repo),me(`tengu_marketplace_added`,{source_type:r}),l&&await l(),v(``),m(!1),u?s(`Successfully added marketplace: ${e}`):c({type:`browse-marketplace`,targetMarketplace:e})}catch(e){let t=I(e);ye(t),a(t.message),v(``),m(!1),s(u?`Error: ${t.message}`:null)}};return(0,Kn.useEffect)(()=>{e&&!d.current&&!i&&!o&&(d.current=!0,y())},[]),(0,W.jsxs)(C,{flexDirection:`column`,children:[(0,W.jsxs)(C,{flexDirection:`column`,paddingX:1,borderStyle:`round`,children:[(0,W.jsx)(C,{marginBottom:1,children:(0,W.jsx)(p,{bold:!0,children:`Add Marketplace`})}),(0,W.jsxs)(C,{flexDirection:`column`,children:[(0,W.jsx)(p,{children:`Enter marketplace source:`}),(0,W.jsx)(p,{dimColor:!0,children:`Examples:`}),(0,W.jsx)(p,{dimColor:!0,children:` · owner/repo (GitHub)`}),(0,W.jsx)(p,{dimColor:!0,children:` · git@github.com:owner/repo.git (SSH)`}),(0,W.jsx)(p,{dimColor:!0,children:` · https://example.com/marketplace.json`}),(0,W.jsx)(p,{dimColor:!0,children:` · ./path/to/marketplace`}),(0,W.jsx)(C,{marginTop:1,children:(0,W.jsx)(Ne,{value:e,onChange:t,onSubmit:y,columns:80,cursorOffset:n,onChangeCursorOffset:r,focus:!0,showCursor:!0})})]}),f&&(0,W.jsxs)(C,{marginTop:1,children:[(0,W.jsx)(ft,{}),(0,W.jsx)(p,{children:_||`Adding marketplace to configuration…`})]}),i&&(0,W.jsx)(C,{marginTop:1,children:(0,W.jsx)(p,{color:`error`,children:i})}),o&&(0,W.jsx)(C,{marginTop:1,children:(0,W.jsx)(p,{children:o})})]}),(0,W.jsx)(C,{marginLeft:3,children:(0,W.jsx)(p,{dimColor:!0,italic:!0,children:(0,W.jsxs)(g,{children:[(0,W.jsx)(h,{shortcut:`Enter`,action:`add`}),(0,W.jsx)(z,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})})]})}var Kn,W,qn=e((()=>{l(),Kn=t(l(),1),pe(),ot(),x(),Ft(),ze(),L(),ve(),At(),tt(),cn(),W=w()}));function Jn(e,t,n,i){let a={};for(let o of e){let e=n[o],s=t[o]??``;if(!(e?.sensitive===!0&&s===``&&i?.[o]!==void 0))if(e?.type===`number`){if(s.trim()===``)continue;let e=Number(s);a[o]=Number.isNaN(e)?s:e}else e?.type===`boolean`?a[o]=r(s):a[o]=s}return a}function Yn({title:e,subtitle:t,configSchema:n,initialValues:r,onSave:i,onCancel:s}){let c=Object.keys(n),l=(0,Xn.useCallback)(e=>{if(n[e]?.sensitive===!0)return``;let t=r?.[e];return t===void 0?``:String(t)},[n,r]),[u,d]=(0,Xn.useState)(0),[f,h]=(0,Xn.useState)({}),[g,_]=(0,Xn.useState)(()=>c[0]?l(c[0]):``),y=c[u],b=y?n[y]:null;if(te(`confirm:no`,s,{context:`Settings`}),v({"confirm:nextField":(0,Xn.useCallback)(()=>{if(u<c.length-1&&y){h(e=>({...e,[y]:g})),d(e=>e+1);let e=c[u+1];_(e?l(e):``)}},[u,c,y,g,l]),"confirm:yes":(0,Xn.useCallback)(()=>{if(!y)return;let e={...f,[y]:g};if(u===c.length-1)i(Jn(c,e,n,r));else{h(e),d(e=>e+1);let t=c[u+1];_(t?l(t):``)}},[y,f,g,u,c,n,i,l,r])},{context:`Confirmation`}),ne((e,t)=>{if(t.backspace||t.delete){_(e=>e.slice(0,-1));return}e&&!t.ctrl&&!t.meta&&!t.tab&&!t.return&&_(t=>t+e)}),!b||!y)return null;let x=b.sensitive===!0,ee=b.required===!0,S=x?`*`.repeat(o(g)):g;return(0,Zn.jsxs)(m,{title:e,subtitle:t,onCancel:s,isCancelActive:!1,children:[(0,Zn.jsxs)(C,{flexDirection:`column`,children:[(0,Zn.jsxs)(p,{bold:!0,children:[b.title||y,ee&&(0,Zn.jsx)(p,{color:`error`,children:` *`})]}),b.description&&(0,Zn.jsx)(p,{dimColor:!0,children:b.description}),(0,Zn.jsxs)(C,{marginTop:1,children:[(0,Zn.jsxs)(p,{children:[a.pointerSmall,` `]}),(0,Zn.jsx)(p,{children:S}),(0,Zn.jsx)(p,{children:`█`})]})]}),(0,Zn.jsxs)(C,{flexDirection:`column`,children:[(0,Zn.jsxs)(p,{dimColor:!0,children:[`Field `,u+1,` of `,c.length]}),u<c.length-1&&(0,Zn.jsx)(p,{dimColor:!0,children:`Tab: Next field · Enter: Save and continue`}),u===c.length-1&&(0,Zn.jsx)(p,{dimColor:!0,children:`Enter: Save configuration`})]})]})}var Xn,Zn,Qn=e((()=>{i(),Xn=t(l(),1),x(),Kt(),n(),Zn=w()}));async function $n(e){let{enabled:t,disabled:n}=await Ct();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=Ke(e);Object.keys(r).length>0&&n.push({key:`top-level`,title:`Configure ${e.name}`,subtitle:`Plugin options`,schema:r,load:()=>Ee(t),save:n=>mt(t,n,e.manifest.userConfig)});let i=Lt(e);for(let r of i)n.push({key:`channel:${r.server}`,title:`Configure ${r.displayName}`,subtitle:`Plugin: ${e.name}`,schema:r.configSchema,load:()=>Je(t,r.server)??void 0,save:e=>Re(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`,ce(e));return}let t=i+1;t<r.length?a(t):n(`configured`)}return(0,nr.jsx)(Yn,{title:s.title,subtitle:s.subtitle,configSchema:s.schema,initialValues:s.load(),onSave:c,onCancel:()=>n(`skipped`)},s.key)}var tr,nr,rr=e((()=>{tr=t(l(),1),L(),Ue(),Qe(),dt(),_t(),Qn(),nr=w()}));function ir(){let e=pt();return(0,ar.jsxs)(C,{marginBottom:1,children:[(0,ar.jsxs)(p,{color:`claude`,children:[a.warning,` `]}),(0,ar.jsxs)(p,{dimColor:!0,italic:!0,children:[`Make sure you trust a plugin before installing, updating, or using it. Anthropic does not control what MCP servers, files, or other software are included in plugins and cannot verify that they will work as intended or that they won't change. See each plugin's homepage for more information.`,e?` ${e}`:``]})]})}var ar,or=e((()=>{i(),l(),x(),st(),ar=w()}));function sr(e){return e.entry.source&&typeof e.entry.source==`object`&&`source`in e.entry.source&&e.entry.source.source===`github`&&typeof e.entry.source==`object`&&`repo`in e.entry.source?e.entry.source.repo:null}function cr(e,t){let n=[{label:`Install for you (user scope)`,action:`install-user`},{label:`Install for all collaborators on this repository (project scope)`,action:`install-project`},{label:`Install for you, in this repo only (local scope)`,action:`install-local`}];return e&&n.push({label:`Open homepage`,action:`homepage`}),t&&n.push({label:`View on GitHub`,action:`github`}),n.push({label:`Back to plugin list`,action:`back`}),n}function lr({hasSelection:e}){return(0,ur.jsx)(C,{marginTop:1,children:(0,ur.jsx)(p,{dimColor:!0,italic:!0,children:(0,ur.jsxs)(g,{children:[e&&(0,ur.jsx)(z,{action:`plugin:install`,context:`Plugin`,fallback:`i`,description:`install`,bold:!0}),(0,ur.jsx)(z,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,ur.jsx)(z,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,ur.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})}var ur,dr=e((()=>{l(),ot(),x(),ur=w()}));function fr({totalItems:e,maxVisible:t=mr,selectedIndex:n=0}){let r=e>t,i=(0,pr.useRef)(0),a=(0,pr.useMemo)(()=>{if(!r)return 0;let a=i.current;if(n<a)return i.current=n,n;if(n>=a+t){let e=n-t+1;return i.current=e,e}let o=Math.max(0,e-t),s=Math.min(a,o);return i.current=s,s},[n,t,r,e]),o=a,s=Math.min(a+t,e),c=(0,pr.useCallback)(e=>r?e.slice(o,s):e,[r,o,s]),l=(0,pr.useCallback)(e=>o+e,[o]),u=(0,pr.useCallback)(e=>e>=o&&e<s,[o,s]),d=(0,pr.useCallback)(e=>{},[]),f=(0,pr.useCallback)(()=>{},[]),p=(0,pr.useCallback)(()=>{},[]),m=(0,pr.useCallback)((t,n)=>{n(Math.max(0,Math.min(t,e-1)))},[e]),h=(0,pr.useCallback)((e,t)=>!1,[]),g=Math.max(1,Math.ceil(e/t));return{currentPage:Math.floor(a/t),totalPages:g,startIndex:o,endIndex:s,needsPagination:r,pageSize:t,getVisibleItems:c,toActualIndex:l,isOnCurrentPage:u,goToPage:d,nextPage:f,prevPage:p,handleSelectionChange:m,handlePageNavigation:h,scrollPosition:{current:n+1,total:e,canScrollUp:a>0,canScrollDown:a+t<e}}}var pr,mr,hr=e((()=>{pr=t(l(),1),mr=5}));function gr({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:o,targetMarketplace:s,targetPlugin:c}){let[l,u]=(0,vr.useState)(`marketplace-list`),[d,f]=(0,vr.useState)(null),[m,h]=(0,vr.useState)(null),[_,y]=(0,vr.useState)([]),[b,x]=(0,vr.useState)([]),[ee,S]=(0,vr.useState)(!0),[ne,w]=(0,vr.useState)(null),[T,E]=(0,vr.useState)(0),[D,k]=(0,vr.useState)(new Set),[A,j]=(0,vr.useState)(new Set),M=fr({totalItems:b.length,selectedIndex:T}),[re,N]=(0,vr.useState)(0),[P,ie]=(0,vr.useState)(!1),[F,ae]=(0,vr.useState)(null),[oe,se]=(0,vr.useState)(null);te(`confirm:no`,_r.useCallback(()=>{l===`plugin-list`?s?i({type:`manage-marketplaces`,targetMarketplace:s}):_.length===1?i({type:`menu`}):(u(`marketplace-list`),f(null),k(new Set)):l===`plugin-details`?(u(`plugin-list`),h(null)):i({type:`menu`})},[l,s,i,_.length]),{context:`Confirmation`}),(0,vr.useEffect)(()=>{async function e(){try{let e=await Fe(),{marketplaces:n,failures:r}=await Dt(e),i=[];for(let{name:e,config:t,data:r}of n)if(r){let n=be(r.plugins,t=>Te(we(t.name,e)));i.push({name:e,totalPlugins:r.plugins.length,installedCount:n,source:Tt(t.source)})}i.sort((e,t)=>e.name===`claude-plugin-directory`?-1:+(t.name===`claude-plugin-directory`)),y(i);let a=xt(r,be(n,e=>e.data!==null));if(a)if(a.type===`warning`)se(a.message+`. Showing available marketplaces.`);else throw Error(a.message);if(i.length===1&&!s&&!c){let e=i[0];e&&(f(e.name),u(`plugin-list`))}if(c){let n=null,r=null;for(let[t]of Object.entries(e)){let e=await Ze(t);if(e){let i=e.plugins.find(e=>e.name===c);if(i){let e=we(i.name,t);n={entry:i,marketplaceName:t,pluginId:e,isInstalled:gt(e)},r=t;break}}}if(n&&r){let e=n.pluginId;gt(e)?t(`Plugin '${e}' is already installed globally. Use '/plugin' to manage existing plugins.`):(f(r),h(n),u(`plugin-details`))}else t(`Plugin "${c}" not found in any marketplace`)}else s&&(i.some(e=>e.name===s)?(f(s),u(`plugin-list`)):t(`Marketplace "${s}" not found`))}catch(e){t(e instanceof Error?e.message:`Failed to load marketplaces`)}finally{S(!1)}}e()},[t,s,c]),(0,vr.useEffect)(()=>{if(!d)return;let e=!1;async function n(n){S(!0);try{let t=await Ze(n);if(e)return;if(!t)throw Error(`Failed to load marketplace: ${n}`);let r=[];for(let e of t.plugins){let t=we(e.name,n);Et(t)||r.push({entry:e,marketplaceName:n,pluginId:t,isInstalled:gt(t)})}try{let t=await dn();if(e)return;w(t),t?r.sort((e,n)=>{let r=t.get(e.pluginId)??0,i=t.get(n.pluginId)??0;return r===i?e.entry.name.localeCompare(n.entry.name):i-r}):r.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}catch(t){if(e)return;ue(`Failed to fetch install counts: ${ce(t)}`),r.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}x(r),E(0),k(new Set)}catch(n){if(e)return;t(n instanceof Error?n.message:`Failed to load plugins`)}finally{S(!1)}}return n(d),()=>{e=!0}},[d,t]);let I=async()=>{if(D.size===0)return;let e=b.filter(e=>D.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 Rt({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),k(new Set),yt(),a===0?r(`✓ Installed ${n} ${O(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${kt(s,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${kt(s,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&o&&await o(),i({type:`menu`})},le=async(e,t=`user`)=>{ie(!0),ae(null);let n=await Rt({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await $n(e.pluginId);if(t){ie(!1),u({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),o&&await o(),i({type:`menu`})}else ie(!1),ae(n.error)};(0,vr.useEffect)(()=>{e&&r(e)},[e,r]),v({"select:previous":()=>{T>0&&E(T-1)},"select:next":()=>{T<_.length-1&&E(T+1)},"select:accept":()=>{let e=_[T];e&&(f(e.name),u(`plugin-list`))}},{context:`Select`,isActive:l===`marketplace-list`}),v({"select:previous":()=>{T>0&&M.handleSelectionChange(T-1,E)},"select:next":()=>{T<b.length-1&&M.handleSelectionChange(T+1,E)},"select:accept":()=>{if(T===b.length&&D.size>0)I();else if(T<b.length){let e=b[T];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(h(e),u(`plugin-details`),N(0),ae(null)))}}},{context:`Select`,isActive:l===`plugin-list`}),v({"plugin:toggle":()=>{if(T<b.length){let e=b[T];if(e&&!e.isInstalled){let t=new Set(D);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),k(t)}}},"plugin:install":()=>{D.size>0&&I()}},{context:`Plugin`,isActive:l===`plugin-list`});let L=_r.useMemo(()=>{if(!m)return[];let e=m.entry.homepage;return cr(e,sr(m))},[m]);if(v({"select:previous":()=>{re>0&&N(re-1)},"select:next":()=>{re<L.length-1&&N(re+1)},"select:accept":()=>{if(!m)return;let e=L[re]?.action,t=m.entry.homepage,n=sr(m);e===`install-user`?le(m,`user`):e===`install-project`?le(m,`project`):e===`install-local`?le(m,`local`):e===`homepage`&&t?Wt(t):e===`github`&&n?Wt(`https://github.com/${n}`):e===`back`&&(u(`plugin-list`),h(null))}},{context:`Select`,isActive:l===`plugin-details`&&!!m}),typeof l==`object`&&l.type===`plugin-options`){let{plugin:e,pluginId:t}=l;function n(e){r(e),o&&o(),i({type:`menu`})}return(0,G.jsx)(er,{plugin:e,pluginId:t,onDone:(t,r)=>{switch(t){case`configured`:n(`✓ Installed and configured ${e.name}. Run /reload-plugins to apply.`);break;case`skipped`:n(`✓ Installed ${e.name}. Run /reload-plugins to apply.`);break;case`error`:n(`Installed but failed to save config: ${r}`);break}}})}if(ee)return(0,G.jsx)(p,{children:`Loading…`});if(e)return(0,G.jsx)(p,{color:`error`,children:e});if(l===`marketplace-list`)return _.length===0?(0,G.jsxs)(C,{flexDirection:`column`,children:[(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsx)(p,{bold:!0,children:`Select marketplace`})}),(0,G.jsx)(p,{children:`No marketplaces configured.`}),(0,G.jsxs)(p,{dimColor:!0,children:[`Add a marketplace first using `,`'Add marketplace'`,`.`]}),(0,G.jsx)(C,{marginTop:1,paddingLeft:1,children:(0,G.jsx)(p,{dimColor:!0,children:(0,G.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})})})]}):(0,G.jsxs)(C,{flexDirection:`column`,children:[(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsx)(p,{bold:!0,children:`Select marketplace`})}),oe&&(0,G.jsx)(C,{marginBottom:1,flexDirection:`column`,children:(0,G.jsxs)(p,{color:`warning`,children:[a.warning,` `,oe]})}),_.map((e,t)=>(0,G.jsxs)(C,{flexDirection:`column`,marginBottom:+(t<_.length-1),children:[(0,G.jsx)(C,{children:(0,G.jsxs)(p,{color:T===t?`suggestion`:void 0,children:[T===t?a.pointer:` `,` `,e.name]})}),(0,G.jsx)(C,{marginLeft:2,children:(0,G.jsxs)(p,{dimColor:!0,children:[e.totalPlugins,` `,O(e.totalPlugins,`plugin`),` available`,e.installedCount>0&&` · ${e.installedCount} already installed`,e.source&&` · ${e.source}`]})})]},e.name)),(0,G.jsx)(C,{marginTop:1,children:(0,G.jsx)(p,{dimColor:!0,italic:!0,children:(0,G.jsxs)(g,{children:[(0,G.jsx)(z,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,G.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]});if(l===`plugin-details`&&m){let e=m.entry.homepage,t=cr(e,sr(m));return(0,G.jsxs)(C,{flexDirection:`column`,children:[(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsx)(p,{bold:!0,children:`Plugin Details`})}),(0,G.jsxs)(C,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(p,{bold:!0,children:m.entry.name}),m.entry.version&&(0,G.jsxs)(p,{dimColor:!0,children:[`Version: `,m.entry.version]}),m.entry.description&&(0,G.jsx)(C,{marginTop:1,children:(0,G.jsx)(p,{children:m.entry.description})}),m.entry.author&&(0,G.jsx)(C,{marginTop:1,children:(0,G.jsxs)(p,{dimColor:!0,children:[`By:`,` `,typeof m.entry.author==`string`?m.entry.author:m.entry.author.name]})})]}),(0,G.jsxs)(C,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(p,{bold:!0,children:`Will install:`}),m.entry.commands&&(0,G.jsxs)(p,{dimColor:!0,children:[`· Commands:`,` `,Array.isArray(m.entry.commands)?m.entry.commands.join(`, `):Object.keys(m.entry.commands).join(`, `)]}),m.entry.agents&&(0,G.jsxs)(p,{dimColor:!0,children:[`· Agents:`,` `,Array.isArray(m.entry.agents)?m.entry.agents.join(`, `):Object.keys(m.entry.agents).join(`, `)]}),m.entry.hooks&&(0,G.jsxs)(p,{dimColor:!0,children:[`· Hooks: `,Object.keys(m.entry.hooks).join(`, `)]}),m.entry.mcpServers&&(0,G.jsxs)(p,{dimColor:!0,children:[`· MCP Servers:`,` `,Array.isArray(m.entry.mcpServers)?m.entry.mcpServers.join(`, `):typeof m.entry.mcpServers==`object`?Object.keys(m.entry.mcpServers).join(`, `):`configured`]}),!m.entry.commands&&!m.entry.agents&&!m.entry.hooks&&!m.entry.mcpServers&&(0,G.jsx)(G.Fragment,{children:typeof m.entry.source==`object`&&`source`in m.entry.source&&(m.entry.source.source===`github`||m.entry.source.source===`url`||m.entry.source.source===`npm`||m.entry.source.source===`pip`)?(0,G.jsx)(p,{dimColor:!0,children:`· Component summary not available for remote plugin`}):(0,G.jsx)(p,{dimColor:!0,children:`· Components will be discovered at installation`})})]}),(0,G.jsx)(ir,{}),F&&(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsxs)(p,{color:`error`,children:[`Error: `,F]})}),(0,G.jsx)(C,{flexDirection:`column`,children:t.map((e,t)=>(0,G.jsxs)(C,{children:[re===t&&(0,G.jsx)(p,{children:`> `}),re!==t&&(0,G.jsx)(p,{children:` `}),(0,G.jsx)(p,{bold:re===t,children:P&&e.action===`install`?`Installing…`:e.label})]},e.action))}),(0,G.jsx)(C,{marginTop:1,paddingLeft:1,children:(0,G.jsx)(p,{dimColor:!0,children:(0,G.jsxs)(g,{children:[(0,G.jsx)(z,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,G.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(b.length===0)return(0,G.jsxs)(C,{flexDirection:`column`,children:[(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsx)(p,{bold:!0,children:`Install plugins`})}),(0,G.jsx)(p,{dimColor:!0,children:`No new plugins available to install.`}),(0,G.jsx)(p,{dimColor:!0,children:`All plugins from this marketplace are already installed.`}),(0,G.jsx)(C,{marginLeft:3,children:(0,G.jsx)(p,{dimColor:!0,italic:!0,children:(0,G.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})})})]});let de=M.getVisibleItems(b);return(0,G.jsxs)(C,{flexDirection:`column`,children:[(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsx)(p,{bold:!0,children:`Install Plugins`})}),M.scrollPosition.canScrollUp&&(0,G.jsx)(C,{children:(0,G.jsxs)(p,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),de.map((t,n)=>{let r=T===M.toActualIndex(n),i=D.has(t.pluginId),o=A.has(t.pluginId);return(0,G.jsxs)(C,{flexDirection:`column`,marginBottom:n===de.length-1&&!e?0:1,children:[(0,G.jsxs)(C,{children:[(0,G.jsxs)(p,{color:r?`suggestion`:void 0,children:[r?a.pointer:` `,` `]}),(0,G.jsxs)(p,{color:t.isInstalled?`success`:void 0,children:[t.isInstalled?a.tick:o?a.ellipsis:i?a.radioOn:a.radioOff,` `,t.entry.name,t.entry.category&&(0,G.jsxs)(p,{dimColor:!0,children:[` [`,t.entry.category,`]`]}),t.entry.tags?.includes(`community-managed`)&&(0,G.jsx)(p,{dimColor:!0,children:` [Community Managed]`}),t.isInstalled&&(0,G.jsx)(p,{dimColor:!0,children:` (installed)`}),ne&&d===`claude-plugins-official`&&(0,G.jsxs)(p,{dimColor:!0,children:[` · `,un(ne.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,G.jsxs)(C,{marginLeft:4,children:[(0,G.jsx)(p,{dimColor:!0,children:Se(t.entry.description,60)}),t.entry.version&&(0,G.jsxs)(p,{dimColor:!0,children:[` · v`,t.entry.version]})]})]},t.pluginId)}),M.scrollPosition.canScrollDown&&(0,G.jsx)(C,{children:(0,G.jsxs)(p,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,G.jsx)(C,{marginTop:1,children:(0,G.jsxs)(p,{color:`error`,children:[a.cross,` `,e]})}),(0,G.jsx)(lr,{hasSelection:D.size>0})]})}var _r,vr,G,yr=e((()=>{i(),_r=t(l(),1),vr=t(l(),1),ot(),x(),Kt(),xe(),Gt(),de(),L(),At(),sn(),ke(),st(),tt(),ht(),Nt(),St(),M(),Ce(),rr(),or(),dr(),hr(),G=w()}));function br({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:o,onSearchModeChange:c,targetPlugin:l}){let[u,m]=(0,K.useState)(`plugin-list`),[h,_]=(0,K.useState)(null),[y,b]=(0,K.useState)([]),[x,ee]=(0,K.useState)(!0),[S,w]=(0,K.useState)(null),[T,E]=(0,K.useState)(!1),D=(0,K.useCallback)(e=>{E(e),c?.(e)},[c]),{query:k,setQuery:A,cursorOffset:j}=xn({isActive:u===`plugin-list`&&T&&!x,onExit:()=>{D(!1)}}),M=d(),{columns:re}=s(),N=(0,K.useMemo)(()=>{if(!k)return y;let e=k.toLowerCase();return y.filter(t=>t.entry.name.toLowerCase().includes(e)||t.entry.description?.toLowerCase().includes(e)||t.marketplaceName.toLowerCase().includes(e))},[y,k]),[P,ie]=(0,K.useState)(0),[F,ae]=(0,K.useState)(new Set),[oe,se]=(0,K.useState)(new Set),I=fr({totalItems:N.length,selectedIndex:P});(0,K.useEffect)(()=>{ie(0)},[k]);let[le,L]=(0,K.useState)(0),[de,fe]=(0,K.useState)(!1),[pe,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 Fe(),{marketplaces:n,failures:r}=await Dt(e),i=[];for(let{name:e,data:t}of n)if(t)for(let n of t.plugins){let t=we(n.name,e);i.push({entry:n,marketplaceName:e,pluginId:t,isInstalled:gt(t)})}let a=i.filter(e=>!e.isInstalled&&!Et(e.pluginId));try{let e=await dn();w(e),e?a.sort((t,n)=>{let r=e.get(t.pluginId)??0,i=e.get(n.pluginId)??0;return r===i?t.entry.name.localeCompare(n.entry.name):i-r}):a.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}catch(e){ue(`Failed to fetch install counts: ${ce(e)}`),a.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}b(a);let o=Object.keys(e).length;a.length===0&&ve(await ut({configuredMarketplaceCount:o,failedMarketplaceCount:r.length}));let s=xt(r,be(n,e=>e.data!==null));if(s)if(s.type===`warning`)ge(s.message+`. Showing available plugins.`);else throw Error(s.message);if(l){let e=i.find(e=>e.entry.name===l);e?e.isInstalled?t(`Plugin '${e.pluginId}' is already installed. Use '/plugin' to manage existing plugins.`):(_(e),m(`plugin-details`)):t(`Plugin "${l}" not found in any marketplace`)}}catch(e){t(e instanceof Error?e.message:`Failed to load plugins`)}finally{ee(!1)}}e()},[t,l]);let ye=async()=>{if(F.size===0)return;let e=y.filter(e=>F.has(e.pluginId));se(new Set(e.map(e=>e.pluginId)));let n=0,a=0,s=[];for(let t of e){let e=await Rt({pluginId:t.pluginId,entry:t.entry,marketplaceName:t.marketplaceName,scope:`user`});e.success?n++:(a++,s.push({name:t.entry.name,reason:e.error}))}se(new Set),ae(new Set),yt(),a===0?r(`✓ Installed ${n} ${O(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${kt(s,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${kt(s,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&o&&await o(),i({type:`menu`})},xe=async(e,t=`user`)=>{fe(!0),me(null);let n=await Rt({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await $n(e.pluginId);if(t){fe(!1),m({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),o&&await o(),i({type:`menu`})}else fe(!1),me(n.error)};(0,K.useEffect)(()=>{e&&r(e)},[e,r]),te(`confirm:no`,()=>{m(`plugin-list`),_(null)},{context:`Confirmation`,isActive:u===`plugin-details`}),te(`confirm:no`,()=>{i({type:`menu`})},{context:`Confirmation`,isActive:u===`plugin-list`&&!T}),ne((e,t)=>{let n=!t.ctrl&&!t.meta;T||(e===`/`&&n?(D(!0),A(``)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==`i`&&(D(!0),A(e)))},{isActive:u===`plugin-list`&&!x}),v({"select:previous":()=>{P===0?D(!0):I.handleSelectionChange(P-1,ie)},"select:next":()=>{P<N.length-1&&I.handleSelectionChange(P+1,ie)},"select:accept":()=>{if(P===N.length&&F.size>0)ye();else if(P<N.length){let e=N[P];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(_(e),m(`plugin-details`),L(0),me(null)))}}},{context:`Select`,isActive:u===`plugin-list`&&!T}),v({"plugin:toggle":()=>{if(P<N.length){let e=N[P];if(e&&!e.isInstalled){let t=new Set(F);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),ae(t)}}},"plugin:install":()=>{F.size>0&&ye()}},{context:`Plugin`,isActive:u===`plugin-list`&&!T});let Ce=Cr.useMemo(()=>{if(!h)return[];let e=h.entry.homepage;return cr(e,sr(h))},[h]);if(v({"select:previous":()=>{le>0&&L(le-1)},"select:next":()=>{le<Ce.length-1&&L(le+1)},"select:accept":()=>{if(!h)return;let e=Ce[le]?.action,t=h.entry.homepage,n=sr(h);e===`install-user`?xe(h,`user`):e===`install-project`?xe(h,`project`):e===`install-local`?xe(h,`local`):e===`homepage`&&t?Wt(t):e===`github`&&n?Wt(`https://github.com/${n}`):e===`back`&&(m(`plugin-list`),_(null))}},{context:`Select`,isActive:u===`plugin-details`&&!!h}),typeof u==`object`&&u.type===`plugin-options`){let{plugin:e,pluginId:t}=u;function n(e){r(e),o&&o(),i({type:`menu`})}return(0,q.jsx)(er,{plugin:e,pluginId:t,onDone:(t,r)=>{switch(t){case`configured`:n(`✓ Installed and configured ${e.name}. Run /reload-plugins to apply.`);break;case`skipped`:n(`✓ Installed ${e.name}. Run /reload-plugins to apply.`);break;case`error`:n(`Installed but failed to save config: ${r}`);break}}})}if(x)return(0,q.jsx)(p,{children:`Loading…`});if(e)return(0,q.jsx)(p,{color:`error`,children:e});if(u===`plugin-details`&&h){let e=h.entry.homepage,t=cr(e,sr(h));return(0,q.jsxs)(C,{flexDirection:`column`,children:[(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsx)(p,{bold:!0,children:`Plugin details`})}),(0,q.jsxs)(C,{flexDirection:`column`,marginBottom:1,children:[(0,q.jsx)(p,{bold:!0,children:h.entry.name}),(0,q.jsxs)(p,{dimColor:!0,children:[`from `,h.marketplaceName]}),h.entry.version&&(0,q.jsxs)(p,{dimColor:!0,children:[`Version: `,h.entry.version]}),h.entry.description&&(0,q.jsx)(C,{marginTop:1,children:(0,q.jsx)(p,{children:h.entry.description})}),h.entry.author&&(0,q.jsx)(C,{marginTop:1,children:(0,q.jsxs)(p,{dimColor:!0,children:[`By:`,` `,typeof h.entry.author==`string`?h.entry.author:h.entry.author.name]})})]}),(0,q.jsx)(ir,{}),pe&&(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsxs)(p,{color:`error`,children:[`Error: `,pe]})}),(0,q.jsx)(C,{flexDirection:`column`,children:t.map((e,t)=>(0,q.jsxs)(C,{children:[le===t&&(0,q.jsx)(p,{children:`> `}),le!==t&&(0,q.jsx)(p,{children:` `}),(0,q.jsx)(p,{bold:le===t,children:de&&e.action.startsWith(`install-`)?`Installing…`:e.label})]},e.action))}),(0,q.jsx)(C,{marginTop:1,children:(0,q.jsx)(p,{dimColor:!0,children:(0,q.jsxs)(g,{children:[(0,q.jsx)(z,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,q.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(y.length===0)return(0,q.jsxs)(C,{flexDirection:`column`,children:[(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsx)(p,{bold:!0,children:`Discover plugins`})}),(0,q.jsx)(Sr,{reason:_e}),(0,q.jsx)(C,{marginTop:1,children:(0,q.jsx)(p,{dimColor:!0,italic:!0,children:`Esc to go back`})})]});let Te=I.getVisibleItems(N);return(0,q.jsxs)(C,{flexDirection:`column`,children:[(0,q.jsxs)(C,{children:[(0,q.jsx)(p,{bold:!0,children:`Discover plugins`}),I.needsPagination&&(0,q.jsxs)(p,{dimColor:!0,children:[` `,`(`,I.scrollPosition.current,`/`,I.scrollPosition.total,`)`]})]}),(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsx)(f,{query:k,isFocused:T,isTerminalFocused:M,width:re-4,cursorOffset:j})}),he&&(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsxs)(p,{color:`warning`,children:[a.warning,` `,he]})}),N.length===0&&k&&(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsxs)(p,{dimColor:!0,children:[`No plugins match "`,k,`"`]})}),I.scrollPosition.canScrollUp&&(0,q.jsx)(C,{children:(0,q.jsxs)(p,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),Te.map((t,n)=>{let r=P===I.toActualIndex(n),i=F.has(t.pluginId),o=oe.has(t.pluginId);return(0,q.jsxs)(C,{flexDirection:`column`,marginBottom:n===Te.length-1&&!e?0:1,children:[(0,q.jsxs)(C,{children:[(0,q.jsxs)(p,{color:r&&!T?`suggestion`:void 0,children:[r&&!T?a.pointer:` `,` `]}),(0,q.jsxs)(p,{children:[o?a.ellipsis:i?a.radioOn:a.radioOff,` `,t.entry.name,(0,q.jsxs)(p,{dimColor:!0,children:[` · `,t.marketplaceName]}),t.entry.tags?.includes(`community-managed`)&&(0,q.jsx)(p,{dimColor:!0,children:` [Community Managed]`}),S&&t.marketplaceName===`claude-plugins-official`&&(0,q.jsxs)(p,{dimColor:!0,children:[` · `,un(S.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,q.jsx)(C,{marginLeft:4,children:(0,q.jsx)(p,{dimColor:!0,children:Se(t.entry.description,60)})})]},`${I.startIndex}-${t.pluginId}`)}),I.scrollPosition.canScrollDown&&(0,q.jsx)(C,{children:(0,q.jsxs)(p,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,q.jsx)(C,{marginTop:1,children:(0,q.jsxs)(p,{color:`error`,children:[a.cross,` `,e]})}),(0,q.jsx)(xr,{hasSelection:F.size>0,canToggle:P<N.length&&!N[P]?.isInstalled})]})}function xr({hasSelection:e,canToggle:t}){return(0,q.jsx)(C,{marginTop:1,children:(0,q.jsx)(p,{dimColor:!0,italic:!0,children:(0,q.jsxs)(g,{children:[e&&(0,q.jsx)(z,{action:`plugin:install`,context:`Plugin`,fallback:`i`,description:`install`,bold:!0}),(0,q.jsx)(p,{children:`type to search`}),t&&(0,q.jsx)(z,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,q.jsx)(z,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,q.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})}function Sr({reason:e}){switch(e){case`git-not-installed`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(p,{dimColor:!0,children:`Git is required to install marketplaces.`}),(0,q.jsx)(p,{dimColor:!0,children:`Please install git and restart Claude Code.`})]});case`all-blocked-by-policy`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(p,{dimColor:!0,children:`Your organization policy does not allow any external marketplaces.`}),(0,q.jsx)(p,{dimColor:!0,children:`Contact your administrator.`})]});case`policy-restricts-sources`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(p,{dimColor:!0,children:`Your organization restricts which marketplaces can be added.`}),(0,q.jsx)(p,{dimColor:!0,children:`Switch to the Marketplaces tab to view allowed sources.`})]});case`all-marketplaces-failed`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(p,{dimColor:!0,children:`Failed to load marketplace data.`}),(0,q.jsx)(p,{dimColor:!0,children:`Check your network connection.`})]});case`all-plugins-installed`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(p,{dimColor:!0,children:`All available plugins are already installed.`}),(0,q.jsx)(p,{dimColor:!0,children:`Check for new plugins later or add more marketplaces.`})]});default:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(p,{dimColor:!0,children:`No plugins available.`}),(0,q.jsx)(p,{dimColor:!0,children:`Add a marketplace first using the Marketplaces tab.`})]})}}var Cr,K,q,wr=e((()=>{i(),Cr=t(l(),1),K=t(l(),1),ot(),bn(),x(),Sn(),zt(),Kt(),xe(),Gt(),de(),L(),At(),sn(),ke(),st(),tt(),ht(),Nt(),St(),M(),Ce(),rr(),or(),dr(),hr(),q=w()}));function Tr({setViewState:e,error:t,setError:n,setResult:r,exitState:i,onManageComplete:o,targetMarketplace:s,action:c}){let[l,u]=(0,Dr.useState)([]),[d,f]=(0,Dr.useState)(!0),[m,h]=(0,Dr.useState)(0),[_,y]=(0,Dr.useState)(!1),[b,x]=(0,Dr.useState)(null),[ee,S]=(0,Dr.useState)(null),[w,T]=(0,Dr.useState)(null),[E,A]=(0,Dr.useState)(`list`),[j,M]=(0,Dr.useState)(null),[N,P]=(0,Dr.useState)(0),ie=(0,Dr.useRef)(!1);(0,Dr.useEffect)(()=>{async function e(){try{let e=await Fe(),{enabled:r,disabled:i}=await Ct(),a=[...r,...i],{marketplaces:o,failures:l}=await Dt(e),d=[];for(let{name:e,config:t,data:n}of o){let r=a.filter(t=>t.source.endsWith(`@${e}`));d.push({name:e,source:Tt(t.source),lastUpdated:t.lastUpdated,pluginCount:n?.plugins.length,installedPlugins:r,pendingUpdate:!1,pendingRemove:!1,autoUpdate:oe(e,t)})}d.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),u(d);let f=xt(l,be(o,e=>e.data!==null));if(f)if(f.type===`warning`)x(f.message);else throw Error(f.message);if(s&&!ie.current&&!t){ie.current=!0;let e=d.findIndex(e=>e.name===s);if(e>=0){let t=d[e];if(c){h(e+1);let t=[...d];c===`update`?t[e].pendingUpdate=!0:c===`remove`&&(t[e].pendingRemove=!0),u(t),setTimeout(se,100,t)}else t&&(h(e+1),M(t),A(`details`))}else n&&n(`Marketplace not found: ${s}`)}}catch(e){n&&n(e instanceof Error?e.message:`Failed to load marketplaces`),x(e instanceof Error?e.message:`Failed to load marketplaces`)}finally{f(!1)}}e()},[s,c,t]);let F=()=>l.some(e=>e.pendingUpdate||e.pendingRemove),ae=()=>({updateCount:be(l,e=>e.pendingUpdate),removeCount:be(l,e=>e.pendingRemove)}),se=async t=>{let i=t||l,s=E===`details`;y(!0),x(null),S(null),T(null);try{let t=k(`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=we(t.name,e.name);n[r]=!1}re(`userSettings`,{enabledPlugins:n})}await wt(e.name),c++,me(`tengu_marketplace_removed`,{marketplace_name:e.name,plugins_uninstalled:e.installedPlugins?.length||0});continue}e.pendingUpdate&&(await Pe(e.name,e=>{T(e)}),n++,l.add(e.name.toLowerCase()),me(`tengu_marketplace_updated`,{marketplace_name:e.name}))}let d=0;l.size>0&&(d=(await Cn(l)).length),yt(),o&&await o();let f=await Fe(),{enabled:p,disabled:m}=await Ct(),h=[...p,...m],{marketplaces:g}=await Dt(f),_=[];for(let{name:e,config:t,data:n}of g){let r=h.filter(t=>t.source.endsWith(`@${e}`));_.push({name:e,source:Tt(t.source),lastUpdated:t.lastUpdated,pluginCount:n?.plugins.length,installedPlugins:r,pendingUpdate:!1,pendingRemove:!1,autoUpdate:oe(e,t)})}if(_.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),u(_),s&&j){let e=_.find(e=>e.name===j.name);e&&M(e)}let v=[];if(n>0){let e=d>0?` (${d} ${O(d,`plugin`)} bumped)`:``;v.push(`Updated ${n} ${O(n,`marketplace`)}${e}`)}if(c>0&&v.push(`Removed ${c} ${O(c,`marketplace`)}`),v.length>0){let t=`${a.tick} ${v.join(`, `)}`;s?S(t):(r(t),setTimeout(e,2e3,{type:`menu`}))}else s||e({type:`menu`})}catch(e){let t=ce(e);x(t),n&&n(t)}finally{y(!1),T(null)}},I=async()=>{if(!j)return;let e=l.map(e=>e.name===j.name?{...e,pendingRemove:!0}:e);u(e),await se(e)},le=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 D()||t.push({label:e.autoUpdate?`Disable auto-update`:`Enable auto-update`,value:`toggle-auto-update`}),t.push({label:`Remove marketplace`,value:`remove`}),t},L=async e=>{let t=!e.autoUpdate;try{await rt(e.name,t),u(n=>n.map(n=>n.name===e.name?{...n,autoUpdate:t}:n)),M(e=>e&&{...e,autoUpdate:t})}catch(e){x(e instanceof Error?e.message:`Failed to update setting`)}};if(te(`confirm:no`,()=>{A(`list`),P(0)},{context:`Confirmation`,isActive:!_&&(E===`details`||E===`confirm-remove`)}),te(`confirm:no`,()=>{u(e=>e.map(e=>({...e,pendingUpdate:!1,pendingRemove:!1}))),h(0)},{context:`Confirmation`,isActive:!_&&E===`list`&&F()}),te(`confirm:no`,()=>{e({type:`menu`})},{context:`Confirmation`,isActive:!_&&E===`list`&&!F()}),v({"select:previous":()=>h(e=>Math.max(0,e-1)),"select:next":()=>{let e=l.length+1;h(t=>Math.min(e-1,t+1))},"select:accept":()=>{let t=m-1;if(m===0)e({type:`add-marketplace`});else if(F())se();else{let e=l[t];e&&(M(e),A(`details`),P(0))}}},{context:`Select`,isActive:!_&&E===`list`}),ne(e=>{let t=m-1;if((e===`u`||e===`U`)&&t>=0)u(e=>e.map((e,n)=>n===t?{...e,pendingUpdate:!e.pendingUpdate,pendingRemove:e.pendingUpdate?e.pendingRemove:!1}:e));else if((e===`r`||e===`R`)&&t>=0){let e=l[t];e&&(M(e),A(`confirm-remove`))}},{isActive:!_&&E===`list`}),v({"select:previous":()=>P(e=>Math.max(0,e-1)),"select:next":()=>{let e=le(j);P(t=>Math.min(e.length-1,t+1))},"select:accept":()=>{if(!j)return;let t=le(j)[N];if(t?.value===`browse`)e({type:`browse-marketplace`,targetMarketplace:j.name});else if(t?.value===`update`){let e=l.map(e=>e.name===j.name?{...e,pendingUpdate:!0}:e);u(e),se(e)}else t?.value===`toggle-auto-update`?L(j):t?.value===`remove`&&A(`confirm-remove`)}},{context:`Select`,isActive:!_&&E===`details`}),ne(e=>{e===`y`||e===`Y`?I():(e===`n`||e===`N`)&&(A(`list`),M(null))},{isActive:!_&&E===`confirm-remove`}),d)return(0,J.jsx)(p,{children:`Loading marketplaces…`});if(l.length===0)return(0,J.jsxs)(C,{flexDirection:`column`,children:[(0,J.jsx)(C,{marginBottom:1,children:(0,J.jsx)(p,{bold:!0,children:`Manage marketplaces`})}),(0,J.jsxs)(C,{flexDirection:`row`,gap:1,children:[(0,J.jsxs)(p,{color:`suggestion`,children:[a.pointer,` +`]}),(0,J.jsx)(p,{bold:!0,color:`suggestion`,children:`Add Marketplace`})]}),(0,J.jsx)(C,{marginLeft:3,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:i.pending?(0,J.jsxs)(J.Fragment,{children:[`Press `,i.keyName,` again to go back`]}):(0,J.jsxs)(g,{children:[(0,J.jsx)(z,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,J.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]});if(E===`confirm-remove`&&j){let e=j.installedPlugins?.length||0;return(0,J.jsxs)(C,{flexDirection:`column`,children:[(0,J.jsxs)(p,{bold:!0,color:`warning`,children:[`Remove marketplace `,(0,J.jsx)(p,{italic:!0,children:j.name}),`?`]}),(0,J.jsxs)(C,{flexDirection:`column`,children:[e>0&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsxs)(p,{color:`warning`,children:[`This will also uninstall `,e,` `,O(e,`plugin`),` from this marketplace:`]})}),j.installedPlugins&&j.installedPlugins.length>0&&(0,J.jsx)(C,{flexDirection:`column`,marginTop:1,marginLeft:2,children:j.installedPlugins.map(e=>(0,J.jsxs)(p,{dimColor:!0,children:[`• `,e.name]},e.name))}),(0,J.jsx)(C,{marginTop:1,children:(0,J.jsxs)(p,{children:[`Press `,(0,J.jsx)(p,{bold:!0,children:`y`}),` to confirm or `,(0,J.jsx)(p,{bold:!0,children:`n`}),` to cancel`]})})]})]})}if(E===`details`&&j){let e=j.pendingUpdate||_,t=le(j);return(0,J.jsxs)(C,{flexDirection:`column`,children:[(0,J.jsx)(p,{bold:!0,children:j.name}),(0,J.jsx)(p,{dimColor:!0,children:j.source}),(0,J.jsx)(C,{marginTop:1,children:(0,J.jsxs)(p,{children:[j.pluginCount||0,` available `,O(j.pluginCount||0,`plugin`)]})}),j.installedPlugins&&j.installedPlugins.length>0&&(0,J.jsxs)(C,{flexDirection:`column`,marginTop:1,children:[(0,J.jsxs)(p,{bold:!0,children:[`Installed plugins (`,j.installedPlugins.length,`):`]}),(0,J.jsx)(C,{flexDirection:`column`,marginLeft:1,children:j.installedPlugins.map(e=>(0,J.jsxs)(C,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(p,{children:a.bullet}),(0,J.jsxs)(C,{flexDirection:`column`,children:[(0,J.jsx)(p,{children:e.name}),(0,J.jsx)(p,{dimColor:!0,children:e.manifest.description})]})]},e.name))})]}),e&&(0,J.jsxs)(C,{marginTop:1,flexDirection:`column`,children:[(0,J.jsx)(p,{color:`claude`,children:`Updating marketplace…`}),w&&(0,J.jsx)(p,{dimColor:!0,children:w})]}),!e&&ee&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{color:`claude`,children:ee})}),!e&&b&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{color:`error`,children:b})}),!e&&(0,J.jsx)(C,{flexDirection:`column`,marginTop:1,children:t.map((e,t)=>{if(!e)return null;let n=t===N;return(0,J.jsxs)(C,{children:[(0,J.jsxs)(p,{color:n?`suggestion`:void 0,children:[n?a.pointer:` `,` `,e.label]}),e.secondaryLabel&&(0,J.jsxs)(p,{dimColor:!0,children:[` `,e.secondaryLabel]})]},e.value)})}),!e&&!D()&&j.autoUpdate&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{dimColor:!0,children:`Auto-update enabled. Claude Code will automatically update this marketplace and its installed plugins.`})}),(0,J.jsx)(C,{marginLeft:3,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:e?(0,J.jsx)(J.Fragment,{children:`Please wait…`}):(0,J.jsxs)(g,{children:[(0,J.jsx)(z,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,J.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]})}let{updateCount:ue,removeCount:de}=ae();return(0,J.jsxs)(C,{flexDirection:`column`,children:[(0,J.jsx)(C,{marginBottom:1,children:(0,J.jsx)(p,{bold:!0,children:`Manage marketplaces`})}),(0,J.jsxs)(C,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(p,{color:m===0?`suggestion`:void 0,children:[m===0?a.pointer:` `,` +`]}),(0,J.jsx)(p,{bold:!0,color:m===0?`suggestion`:void 0,children:`Add Marketplace`})]}),(0,J.jsx)(C,{flexDirection:`column`,children:l.map((e,t)=>{let n=t+1===m,r=[];return e.pendingUpdate&&r.push(`UPDATE`),e.pendingRemove&&r.push(`REMOVE`),(0,J.jsxs)(C,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(p,{color:n?`suggestion`:void 0,children:[n?a.pointer:` `,` `,e.pendingRemove?a.cross:a.bullet]}),(0,J.jsxs)(C,{flexDirection:`column`,flexGrow:1,children:[(0,J.jsxs)(C,{flexDirection:`row`,gap:1,children:[(0,J.jsxs)(p,{bold:!0,strikethrough:e.pendingRemove,dimColor:e.pendingRemove,children:[e.name===`claude-plugins-official`&&(0,J.jsx)(p,{color:`claude`,children:`✻ `}),e.name,e.name===`claude-plugins-official`&&(0,J.jsx)(p,{color:`claude`,children:` ✻`})]}),r.length>0&&(0,J.jsxs)(p,{color:`warning`,children:[`[`,r.join(`, `),`]`]})]}),(0,J.jsx)(p,{dimColor:!0,children:e.source}),(0,J.jsxs)(p,{dimColor:!0,children:[e.pluginCount!==void 0&&(0,J.jsxs)(J.Fragment,{children:[e.pluginCount,` available`]}),e.installedPlugins&&e.installedPlugins.length>0&&(0,J.jsxs)(J.Fragment,{children:[` • `,e.installedPlugins.length,` installed`]}),e.lastUpdated&&(0,J.jsxs)(J.Fragment,{children:[` • Updated `,new Date(e.lastUpdated).toLocaleDateString()]})]})]})]},e.name)})}),F()&&(0,J.jsxs)(C,{marginTop:1,flexDirection:`column`,children:[(0,J.jsxs)(p,{children:[(0,J.jsx)(p,{bold:!0,children:`Pending changes:`}),` `,(0,J.jsx)(p,{dimColor:!0,children:`Enter to apply`})]}),ue>0&&(0,J.jsxs)(p,{children:[`• Update `,ue,` `,O(ue,`marketplace`)]}),de>0&&(0,J.jsxs)(p,{color:`warning`,children:[`• Remove `,de,` `,O(de,`marketplace`)]})]}),_&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{color:`claude`,children:`Processing changes…`})}),b&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{color:`error`,children:b})}),(0,J.jsx)(Er,{exitState:i,hasPendingActions:F()})]})}function Er({exitState:e,hasPendingActions:t}){return e.pending?(0,J.jsx)(C,{marginTop:1,children:(0,J.jsxs)(p,{dimColor:!0,italic:!0,children:[`Press `,e.keyName,` again to go back`]})}):(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:(0,J.jsxs)(g,{children:[t&&(0,J.jsx)(z,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`apply changes`}),!t&&(0,J.jsx)(z,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),!t&&(0,J.jsx)(h,{shortcut:`u`,action:`update`}),!t&&(0,J.jsx)(h,{shortcut:`r`,action:`remove`}),(0,J.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:t?`cancel`:`go back`})]})})})}var Dr,J,Or=e((()=>{i(),l(),Dr=t(l(),1),pe(),ot(),x(),Kt(),xe(),T(),L(),At(),st(),tt(),wn(),dt(),se(),F(),M(),J=w()}));function kr(e){switch(e.type){case`path-not-found`:return`${e.component} path not found: ${e.path}`;case`git-auth-failed`:return`Git ${e.authType.toUpperCase()} authentication failed for ${e.gitUrl}`;case`git-timeout`:return`Git ${e.operation} timed out for ${e.gitUrl}`;case`network-error`:return`Network error accessing ${e.url}${e.details?`: ${e.details}`:``}`;case`manifest-parse-error`:return`Failed to parse manifest at ${e.manifestPath}: ${e.parseError}`;case`manifest-validation-error`:return`Invalid manifest at ${e.manifestPath}: ${e.validationErrors.join(`, `)}`;case`plugin-not-found`:return`Plugin "${e.pluginId}" not found in marketplace "${e.marketplace}"`;case`marketplace-not-found`:return`Marketplace "${e.marketplace}" not found`;case`marketplace-load-failed`:return`Failed to load marketplace "${e.marketplace}": ${e.reason}`;case`mcp-config-invalid`:return`Invalid MCP server config for "${e.serverName}": ${e.validationError}`;case`mcp-server-suppressed-duplicate`:{let t=e.duplicateOf.startsWith(`plugin:`)?`server provided by plugin "${e.duplicateOf.split(`:`)[1]??`?`}"`:`already-configured "${e.duplicateOf}"`;return`MCP server "${e.serverName}" skipped — same command/URL as ${t}`}case`hook-load-failed`:return`Failed to load hooks from ${e.hookPath}: ${e.reason}`;case`component-load-failed`:return`Failed to load ${e.component} from ${e.path}: ${e.reason}`;case`mcpb-download-failed`:return`Failed to download MCPB from ${e.url}: ${e.reason}`;case`mcpb-extract-failed`:return`Failed to extract MCPB ${e.mcpbPath}: ${e.reason}`;case`mcpb-invalid-manifest`:return`MCPB manifest invalid at ${e.mcpbPath}: ${e.validationError}`;case`marketplace-blocked-by-policy`:return e.blockedByBlocklist?`Marketplace "${e.marketplace}" is blocked by enterprise policy`:`Marketplace "${e.marketplace}" is not in the allowed marketplace list`;case`dependency-unsatisfied`:return e.reason===`not-enabled`?`Dependency "${e.dependency}" is disabled`:`Dependency "${e.dependency}" is not installed`;case`lsp-config-invalid`:return`Invalid LSP server config for "${e.serverName}": ${e.validationError}`;case`lsp-server-start-failed`:return`LSP server "${e.serverName}" failed to start: ${e.reason}`;case`lsp-server-crashed`:return e.signal?`LSP server "${e.serverName}" crashed with signal ${e.signal}`:`LSP server "${e.serverName}" crashed with exit code ${e.exitCode??`unknown`}`;case`lsp-request-timeout`:return`LSP server "${e.serverName}" timed out on ${e.method} after ${e.timeoutMs}ms`;case`lsp-request-failed`:return`LSP server "${e.serverName}" ${e.method} failed: ${e.error}`;case`plugin-cache-miss`:return`Plugin "${e.plugin}" not cached at ${e.installPath}`;case`generic-error`:return e.error}return Ae(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((()=>{Ie()}));function Mr({item:e,isSelected:t}){let[n]=u();if(e.type===`plugin`){let r,i;return e.pendingToggle?(r=S(`suggestion`,n)(a.arrowRight),i=e.pendingToggle===`will-enable`?`will enable`:`will disable`):e.errorCount>0?(r=S(`error`,n)(a.cross),i=`${e.errorCount} ${O(e.errorCount,`error`)}`):e.isEnabled?(r=S(`success`,n)(a.tick),i=`enabled`):(r=S(`inactive`,n)(a.radioOff),i=`disabled`),(0,Y.jsxs)(C,{children:[(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(p,{dimColor:!t,children:[` `,(0,Y.jsx)(p,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(p,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(p,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(p,{dimColor:!t,children:i})]})}if(e.type===`flagged-plugin`){let r=S(`warning`,n)(a.warning);return(0,Y.jsxs)(C,{children:[(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(p,{dimColor:!t,children:[` `,(0,Y.jsx)(p,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(p,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(p,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(p,{dimColor:!t,children:`removed`})]})}if(e.type===`failed-plugin`){let r=S(`error`,n)(a.cross),i=`failed to load · ${e.errorCount} ${O(e.errorCount,`error`)}`;return(0,Y.jsxs)(C,{children:[(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(p,{dimColor:!t,children:[` `,(0,Y.jsx)(p,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(p,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(p,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(p,{dimColor:!t,children:i})]})}let r,i;return e.status===`connected`?(r=S(`success`,n)(a.tick),i=`connected`):e.status===`disabled`?(r=S(`inactive`,n)(a.radioOff),i=`disabled`):e.status===`pending`?(r=S(`inactive`,n)(a.radioOff),i=`connecting…`):e.status===`needs-auth`?(r=S(`warning`,n)(a.triangleUpOutline),i=`Enter to auth`):(r=S(`error`,n)(a.cross),i=`failed`),e.indented?(0,Y.jsxs)(C,{children:[(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(p,{dimColor:!t,children:`└ `}),(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(p,{dimColor:!t,children:[` `,(0,Y.jsx)(p,{backgroundColor:`userMessageBackground`,children:`MCP`})]}),(0,Y.jsxs)(p,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(p,{dimColor:!t,children:i})]}):(0,Y.jsxs)(C,{children:[(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(p,{dimColor:!t,children:[` `,(0,Y.jsx)(p,{backgroundColor:`userMessageBackground`,children:`MCP`})]}),(0,Y.jsxs)(p,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(p,{dimColor:!t,children:i})]})}var Y,Nr=e((()=>{i(),l(),x(),M(),Y=w()}));async function Pr(e){try{return(await En.readdir(e,{withFileTypes:!0})).filter(e=>e.isFile()&&e.name.endsWith(`.md`)).map(e=>Tn.basename(e.name,`.md`))}catch(t){return ue(`Failed to read plugin components from ${e}: ${ce(t)}`,{level:`error`}),ye(I(t)),[]}}async function Fr(e){try{let t=await En.readdir(e,{withFileTypes:!0}),n=[];for(let r of t)if(r.isDirectory()||r.isSymbolicLink()){let t=Tn.join(e,r.name,`SKILL.md`);try{(await En.stat(t)).isFile()&&n.push(r.name)}catch{}}return n}catch(t){return ue(`Failed to read skill directories from ${e}: ${ce(t)}`,{level:`error`}),ye(I(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=Ut(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 Ze(t)).plugins.find(t=>t.name===e.name);if(n){let t=[];e.commandsPath&&t.push(e.commandsPath),e.commandsPaths&&t.push(...e.commandsPaths);let i=[];for(let e of t)if(typeof e==`string`){let t=await Pr(e);i.push(...t)}let a=[];e.agentsPath&&a.push(e.agentsPath),e.agentsPaths&&a.push(...e.agentsPaths);let o=[];for(let e of a)if(typeof e==`string`){let t=await Pr(e);o.push(...t)}let s=[];e.skillsPath&&s.push(e.skillsPath),e.skillsPaths&&s.push(...e.skillsPaths);let c=[];for(let e of s)if(typeof e==`string`){let t=await Fr(e);c.push(...t)}let l=[];e.hooksConfig&&l.push(Object.keys(e.hooksConfig)),n.hooks&&l.push(n.hooks);let u=[];e.mcpServers&&u.push(Object.keys(e.mcpServers)),n.mcpServers&&u.push(n.mcpServers),r({commands:i.length>0?i:null,agents:o.length>0?o:null,skills:c.length>0?c:null,hooks:l.length>0?l:null,mcpServers:u.length>0?u:null})}else s(`Plugin ${e.name} not found in marketplace`)}catch(e){s(e instanceof Error?e.message:`Failed to load components`)}finally{a(!1)}}n()},[e.name,e.commandsPath,e.commandsPaths,e.agentsPath,e.agentsPaths,e.skillsPath,e.skillsPaths,e.hooksConfig,e.mcpServers,t]),i?null:o?(0,Z.jsxs)(C,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsx)(p,{bold:!0,children:`Components:`}),(0,Z.jsxs)(p,{dimColor:!0,children:[`Error: `,o]})]}):!n||!(n.commands||n.agents||n.skills||n.hooks||n.mcpServers)?null:(0,Z.jsxs)(C,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsx)(p,{bold:!0,children:`Installed components:`}),n.commands?(0,Z.jsxs)(p,{dimColor:!0,children:[`• Commands:`,` `,typeof n.commands==`string`?n.commands:Array.isArray(n.commands)?n.commands.join(`, `):Object.keys(n.commands).join(`, `)]}):null,n.agents?(0,Z.jsxs)(p,{dimColor:!0,children:[`• Agents:`,` `,typeof n.agents==`string`?n.agents:Array.isArray(n.agents)?n.agents.join(`, `):Object.keys(n.agents).join(`, `)]}):null,n.skills?(0,Z.jsxs)(p,{dimColor:!0,children:[`• Skills:`,` `,typeof n.skills==`string`?n.skills:Array.isArray(n.skills)?n.skills.join(`, `):Object.keys(n.skills).join(`, `)]}):null,n.hooks?(0,Z.jsxs)(p,{dimColor:!0,children:[`• Hooks:`,` `,typeof n.hooks==`string`?n.hooks:Array.isArray(n.hooks)?n.hooks.map(String).join(`, `):typeof n.hooks==`object`&&n.hooks!==null?Object.keys(n.hooks).join(`, `):String(n.hooks)]}):null,n.mcpServers?(0,Z.jsxs)(p,{dimColor:!0,children:[`• MCP Servers:`,` `,typeof n.mcpServers==`string`?n.mcpServers:Array.isArray(n.mcpServers)?n.mcpServers.map(String).join(`, `):typeof n.mcpServers==`object`&&n.mcpServers!==null?Object.keys(n.mcpServers).join(`, `):String(n.mcpServers)]}):null]})}async function Lr(e,t){let n=(await Ze(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!Et(`${e.name}@${t}`)})}function zr({setViewState:e,setResult:t,onManageComplete:n,onSearchModeChange:r,targetPlugin:i,targetMarketplace:o,action:c}){let l=qe(e=>e.mcp.clients),u=qe(e=>e.mcp.tools),m=qe(e=>e.plugins.errors),h=mn(),[_,y]=(0,X.useState)(!1),b=(0,X.useCallback)(e=>{y(e),r?.(e)},[r]),x=d(),{columns:ee}=s(),[S,w]=(0,X.useState)(`plugin-list`),{query:T,setQuery:E,cursorOffset:D}=xn({isActive:S===`plugin-list`&&_,onExit:()=>{b(!1)}}),[A,j]=(0,X.useState)(null),[M,N]=(0,X.useState)([]),[ie,F]=(0,X.useState)([]),[ae,oe]=(0,X.useState)(!0),[se,L]=(0,X.useState)(new Map),de=(0,X.useRef)(!1),fe=(0,X.useRef)(void 0),pe=_n();te(`confirm:no`,Br.useCallback(()=>{if(S===`plugin-details`)w(`plugin-list`),j(null),R(null);else if(typeof S==`object`&&S.type===`failed-plugin-details`)w(`plugin-list`),R(null);else if(S===`configuring`)w(`plugin-details`),Ae(null);else if(typeof S==`object`&&(S.type===`plugin-options`||S.type===`configuring-options`))w(`plugin-list`),j(null),t(`Plugin enabled. Configuration skipped — run /reload-plugins to apply.`),n&&n();else if(typeof S==`object`&&S.type===`flagged-detail`)w(`plugin-list`),R(null);else if(typeof S==`object`&&S.type===`mcp-detail`)w(`plugin-list`),R(null);else if(typeof S==`object`&&S.type===`mcp-tools`)w({type:`mcp-detail`,client:S.client});else if(typeof S==`object`&&S.type===`mcp-tool-detail`)w({type:`mcp-tools`,client:S.client});else{if(se.size>0){t(`Run /reload-plugins to apply plugin changes.`);return}e({type:`menu`})}},[S,e,se,t]),{context:`Confirmation`,isActive:(S!==`plugin-list`||!_)&&S!==`confirm-project-uninstall`&&!(typeof S==`object`&&S.type===`confirm-data-cleanup`)});let me=e=>e.type===`connected`?`connected`:e.type===`disabled`?`disabled`:e.type===`pending`?`pending`:e.type===`needs-auth`?`needs-auth`:`failed`,he=(0,X.useMemo)(()=>{let e=P(),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 ie){let i=`${r.plugin.name}@${r.marketplace}`,a=e?.enabledPlugins?.[i]!==!1,o=m.filter(e=>`plugin`in e&&e.plugin===r.plugin.name||e.source===i||e.source.startsWith(`${r.plugin.name}@`)),s=r.plugin.isBuiltin?`builtin`:r.scope||`user`;n.push({item:{type:`plugin`,id:i,name:r.plugin.name,description:r.plugin.manifest.description,marketplace:r.marketplace,scope:s,isEnabled:a,errorCount:o.length,errors:o,plugin:r.plugin,pendingEnable:r.pendingEnable,pendingUpdate:r.pendingUpdate,pendingToggle:se.get(i)},originalScope:s,childMcps:t.get(r.plugin.name)||[]})}let r=new Set(n.map(({item:e})=>e.id)),i=new Set(n.map(({item:e})=>e.name)),a=new Map;for(let e of m){if(r.has(e.source)||`plugin`in e&&typeof e.plugin==`string`&&i.has(e.plugin))continue;let t=a.get(e.source)||[];t.push(e),a.set(e.source,t)}let o=Xt(),s=[];for(let[e,t]of a){if(e in h)continue;let n=Vt(e),r=n.name||e,i=n.marketplace||`unknown`,a=o.get(e),c=a===`flag`||a===void 0?`user`:a;s.push({type:`failed-plugin`,id:e,name:r,marketplace:i,scope:c,errorCount:t.length,errors:t})}let c=[];for(let e of l)e.name!==`ide`&&(e.name.startsWith(`plugin:`)||c.push({type:`mcp`,id:`mcp:${e.name}`,name:e.name,description:void 0,scope:e.config.scope,status:me(e),client:e}));let u={flagged:-1,project:0,local:1,user:2,enterprise:3,managed:4,dynamic:5,builtin:6},d=[],f=new Map;for(let{item:e,originalScope:t,childMcps:r}of n){let n=e.scope;f.has(n)||f.set(n,[]),f.get(n).push(e);for(let{displayName:e,client:n}of r){let r=t===`builtin`?`user`:t;f.has(r)||f.set(r,[]),f.get(r).push({type:`mcp`,id:`mcp:${n.name}`,name:e,description:void 0,scope:r,status:me(n),client:n,indented:!0})}}for(let e of c){let t=e.scope;f.has(t)||f.set(t,[]),f.get(t).push(e)}for(let e of s){let t=e.scope;f.has(t)||f.set(t,[]),f.get(t).push(e)}for(let[e,t]of Object.entries(h)){let n=Vt(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},[ie,l,m,se,h]),ge=(0,X.useMemo)(()=>he.filter(e=>e.type===`flagged-plugin`).map(e=>e.id),[he]);(0,X.useEffect)(()=>{ge.length>0&&pn(ge)},[ge]);let _e=(0,X.useMemo)(()=>{if(!T)return he;let e=T.toLowerCase();return he.filter(t=>t.name.toLowerCase().includes(e)||`description`in t&&t.description?.toLowerCase().includes(e))},[he,T]),[ve,xe]=(0,X.useState)(0),Se=fr({totalItems:_e.length,selectedIndex:ve,maxVisible:8}),[Ce,we]=(0,X.useState)(0),[Te,De]=(0,X.useState)(!1),[Oe,R]=(0,X.useState)(null),[ke,Ae]=(0,X.useState)(null),[je,Ne]=(0,X.useState)(!1),[Pe,Fe]=(0,X.useState)(!1);(0,X.useEffect)(()=>{if(!A){Fe(!1);return}async function e(){let e=A.plugin.manifest.mcpServers,t=!1;if(e&&(t=typeof e==`string`&&Ge(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&&Ge(e))),!t)try{let e=Tn.join(A.plugin.path,`..`),n=Tn.join(e,`.claude-plugin`,`marketplace.json`),r=le(await En.readFile(n,`utf-8`)).plugins?.find(e=>e.name===A.plugin.name);if(r?.mcpServers){let e=r.mcpServers;t=typeof e==`string`&&Ge(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&&Ge(e))}}catch(e){ue(`Failed to read raw marketplace.json: ${e}`)}Fe(t)}e()},[A]),(0,X.useEffect)(()=>{async function e(){oe(!0);try{let{enabled:e,disabled:t}=await Ct(),n=P(),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=be(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)),N(a);let o=[];for(let e of a)for(let t of e.installedPlugins){let n=`${t.name}@${e.name}`,r=t.isBuiltin?`builtin`:nn(n).scope;o.push({plugin:t,marketplace:e.name,scope:r,pendingEnable:void 0,pendingUpdate:!1})}F(o),xe(0)}finally{oe(!1)}}e()},[]),(0,X.useEffect)(()=>{if(!de.current&&i&&M.length>0&&!ae){let{name:e,marketplace:n}=Vt(i),r=o??n,a=r?M.filter(e=>e.name===r):M;for(let t of a){let n=t.installedPlugins.find(t=>t.name===e);if(n){let{scope:e}=nn(`${n.name}@${t.name}`);j({plugin:n,marketplace:t.name,scope:e,pendingEnable:void 0,pendingUpdate:!1}),w(`plugin-details`),fe.current=c,de.current=!0;return}}let s=he.find(t=>t.type===`failed-plugin`&&t.name===e);s&&s.type===`failed-plugin`&&(w({type:`failed-plugin-details`,plugin:{id:s.id,name:s.name,marketplace:s.marketplace,errors:s.errors,scope:s.scope}}),de.current=!0),!de.current&&c&&(de.current=!0,t(`Plugin "${i}" is not installed in this project`))}},[i,o,M,ae,he,c,t]);let Ie=async r=>{if(!A)return;let i=A.scope||`user`,a=i===`builtin`;if(a&&(r===`update`||r===`uninstall`)){R(`Built-in plugins cannot be updated or uninstalled.`);return}if(!a&&!tn(i)&&r!==`update`){R(`This plugin is managed by your organization. Contact your admin to disable it.`);return}De(!0),R(null);try{let o=`${A.plugin.name}@${A.marketplace}`,s;switch(r){case`enable`:{let e=await Zt(o);if(!e.success)throw Error(e.message);break}case`disable`:{let e=await en(o);if(!e.success)throw Error(e.message);s=e.reverseDependents;break}case`uninstall`:{if(a||!tn(i))break;if(an(o)){De(!1),w(`confirm-project-uninstall`);return}let e=He().plugins[o],t=!e||e.length<=1?await Xe(o):null;if(t){De(!1),w({type:`confirm-data-cleanup`,size:t});return}let n=await Qt(o,i);if(!n.success)throw Error(n.message);s=n.reverseDependents;break}case`update`:{if(a)break;let r=await $t(o,i);if(!r.success)throw Error(r.message);if(r.alreadyUpToDate){t(`${A.plugin.name} is already at the latest version (${r.newVersion}).`),n&&await n(),e({type:`menu`});return}break}}yt();let c=`${A.plugin.name}@${A.marketplace}`;if(P()?.enabledPlugins?.[c]!==!1){De(!1),w({type:`plugin-options`});return}let l=r===`enable`?`Enabled`:r===`disable`?`Disabled`:r===`update`?`Updated`:`Uninstalled`,u=s&&s.length>0?` · required by ${s.join(`, `)}`:``;t(`✓ ${l} ${A.plugin.name}${u}. Run /reload-plugins to apply.`),n&&await n(),e({type:`menu`})}catch(e){De(!1),R(`Failed to ${r}: ${e instanceof Error?e.message:String(e)}`),ye(I(e))}},Le=(0,X.useRef)(Ie);Le.current=Ie,(0,X.useEffect)(()=>{if(S===`plugin-details`&&A&&fe.current){let e=fe.current;fe.current=void 0,Le.current(e)}},[S,A]);let Re=Br.useCallback(()=>{if(ve>=_e.length)return;let e=_e[ve];if(e?.type!==`flagged-plugin`)if(e?.type===`plugin`){let t=`${e.plugin.name}@${e.marketplace}`,n=P(),r=se.get(t),i=n?.enabledPlugins?.[t]!==!1,a=e.scope;if(a===`builtin`||tn(a)){let e=new Map(se);r?(e.delete(t),(async()=>{try{r===`will-disable`?await Zt(t):await en(t),yt()}catch(e){ye(e)}})()):(e.set(t,i?`will-disable`:`will-enable`),(async()=>{try{i?await en(t):await Zt(t),yt()}catch(e){ye(e)}})()),L(e)}}else e?.type===`mcp`&&pe(e.client.name)},[ve,_e,se,ie,pe]);v({"select:previous":()=>{ve===0?b(!0):Se.handleSelectionChange(ve-1,xe)},"select:next":()=>{ve<_e.length-1&&Se.handleSelectionChange(ve+1,xe)},"select:accept":Br.useCallback(()=>{if(ve>=_e.length)return;let e=_e[ve];if(e?.type===`plugin`){let t=ie.find(t=>t.plugin.name===e.plugin.name&&t.marketplace===e.marketplace);t&&(j(t),w(`plugin-details`),we(0),R(null))}else e?.type===`flagged-plugin`?(w({type:`flagged-detail`,plugin:{id:e.id,name:e.name,marketplace:e.marketplace,reason:e.reason,text:e.text,flaggedAt:e.flaggedAt}}),R(null)):e?.type===`failed-plugin`?(w({type:`failed-plugin-details`,plugin:{id:e.id,name:e.name,marketplace:e.marketplace,errors:e.errors,scope:e.scope}}),we(0),R(null)):e?.type===`mcp`&&(w({type:`mcp-detail`,client:e.client}),R(null))},[ve,_e,ie])},{context:`Select`,isActive:S===`plugin-list`&&!_}),v({"plugin:toggle":Re},{context:`Plugin`,isActive:S===`plugin-list`&&!_}),v({"select:accept":Br.useCallback(()=>{typeof S!=`object`||S.type!==`flagged-detail`||(hn(S.plugin.id),w(`plugin-list`))},[S])},{context:`Select`,isActive:typeof S==`object`&&S.type===`flagged-detail`});let ze=Br.useMemo(()=>{if(S!==`plugin-details`||!A)return[];let e=P(),t=`${A.plugin.name}@${A.marketplace}`,n=e?.enabledPlugins?.[t]!==!1,r=A.marketplace===`builtin`,i=[];return i.push({label:n?`Disable plugin`:`Enable plugin`,action:()=>void Ie(n?`disable`:`enable`)}),r||(i.push({label:A.pendingUpdate?`Unmark for update`:`Mark for update`,action:async()=>{try{let e=await Lr(A.plugin.name,A.marketplace);if(e){R(e);return}let t=[...ie],n=t.findIndex(e=>e.plugin.name===A.plugin.name&&e.marketplace===A.marketplace);n!==-1&&(t[n].pendingUpdate=!A.pendingUpdate,F(t),j({...A,pendingUpdate:!A.pendingUpdate}))}catch(e){R(e instanceof Error?e.message:`Failed to check plugin update availability`)}}}),Pe&&i.push({label:`Configure`,action:async()=>{Ne(!0);try{let e=A.plugin.manifest.mcpServers,t=null;if(typeof e==`string`&&Ge(e))t=e;else if(Array.isArray(e)){for(let n of e)if(typeof n==`string`&&Ge(n)){t=n;break}}if(!t){R(`No MCPB file found in plugin`),Ne(!1);return}let n=`${A.plugin.name}@${A.marketplace}`,r=await Me(t,A.plugin.path,n,void 0,void 0,!0);`status`in r&&r.status===`needs-config`?(Ae(r),w(`configuring`)):R(`Failed to load MCPB for configuration`)}catch(e){R(`Failed to load configuration: ${ce(e)}`)}finally{Ne(!1)}}}),A.plugin.manifest.userConfig&&Object.keys(A.plugin.manifest.userConfig).length>0&&i.push({label:`Configure options`,action:()=>{w({type:`configuring-options`,schema:A.plugin.manifest.userConfig})}}),i.push({label:`Update now`,action:()=>void Ie(`update`)}),i.push({label:`Uninstall`,action:()=>void Ie(`uninstall`)})),A.plugin.manifest.homepage&&i.push({label:`Open homepage`,action:()=>void Wt(A.plugin.manifest.homepage)}),A.plugin.manifest.repository&&i.push({label:`View repository`,action:()=>void Wt(A.plugin.manifest.repository)}),i.push({label:`Back to plugin list`,action:()=>{w(`plugin-list`),j(null),R(null)}}),i},[S,A,Pe,ie]);if(v({"select:previous":()=>{Ce>0&&we(Ce-1)},"select:next":()=>{Ce<ze.length-1&&we(Ce+1)},"select:accept":()=>{ze[Ce]&&ze[Ce].action()}},{context:`Select`,isActive:S===`plugin-details`&&!!A}),v({"select:accept":()=>{typeof S==`object`&&S.type===`failed-plugin-details`&&(async()=>{De(!0),R(null);let e=S.plugin.id,t=S.plugin.scope,r=tn(t)?await Qt(e,t,!1):await Qt(e,`user`,!1),i=r.success;if(!i){for(let t of[`userSettings`,`projectSettings`,`localSettings`]){let n=k(t);n?.enabledPlugins?.[e]!==void 0&&(re(t,{enabledPlugins:{...n.enabledPlugins,[e]:void 0}}),i=!0)}yt()}i?(n&&await n(),De(!1),w(`plugin-list`)):(De(!1),R(r.message))})()}},{context:`Select`,isActive:typeof S==`object`&&S.type===`failed-plugin-details`&&S.plugin.scope!==`managed`}),v({"confirm:yes":()=>{if(!A)return;De(!0),R(null);let r=`${A.plugin.name}@${A.marketplace}`,{error:i}=re(`localSettings`,{enabledPlugins:{...k(`localSettings`)?.enabledPlugins,[r]:!1}});if(i){De(!1),R(`Failed to write settings: ${i.message}`);return}yt(),t(`✓ Disabled ${A.plugin.name} in .claude/settings.local.json. Run /reload-plugins to apply.`),n&&n(),e({type:`menu`})},"confirm:no":()=>{w(`plugin-details`),R(null)}},{context:`Confirmation`,isActive:S===`confirm-project-uninstall`&&!!A&&!Te}),ne((r,i)=>{if(!A)return;let o=`${A.plugin.name}@${A.marketplace}`,s=A.scope;if(!s||s===`builtin`||!tn(s))return;let c=async r=>{De(!0),R(null);try{let i=await Qt(o,s,r);if(!i.success)throw Error(i.message);yt();let c=r?``:` · data preserved`;t(`${a.tick} ${i.message}${c}`),n&&n(),e({type:`menu`})}catch(e){De(!1),R(e instanceof Error?e.message:String(e))}};r===`y`||r===`Y`?c(!0):r===`n`||r===`N`?c(!1):i.escape&&(w(`plugin-details`),R(null))},{isActive:typeof S==`object`&&S.type===`confirm-data-cleanup`&&!!A&&!Te}),Br.useEffect(()=>{xe(0)},[T]),ne((e,t)=>{let n=!t.ctrl&&!t.meta;_||(e===`/`&&n?(b(!0),E(``),xe(0)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==` `&&(b(!0),E(e),xe(0)))},{isActive:S===`plugin-list`}),ae)return(0,Z.jsx)(p,{children:`Loading installed plugins…`});if(he.length===0)return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsx)(C,{marginBottom:1,children:(0,Z.jsx)(p,{bold:!0,children:`Manage plugins`})}),(0,Z.jsx)(p,{children:`No plugins or MCP servers installed.`}),(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{dimColor:!0,children:`Esc to go back`})})]});if(typeof S==`object`&&S.type===`plugin-options`&&A){let r=`${A.plugin.name}@${A.marketplace}`;function i(r){t(r),n&&n(),e({type:`menu`})}return(0,Z.jsx)(er,{plugin:A.plugin,pluginId:r,onDone:(e,t)=>{switch(e){case`configured`:i(`✓ Enabled and configured ${A.plugin.name}. Run /reload-plugins to apply.`);break;case`skipped`:i(`✓ Enabled ${A.plugin.name}. Run /reload-plugins to apply.`);break;case`error`:i(`Failed to save configuration: ${t}`);break}}})}if(typeof S==`object`&&S.type===`configuring-options`&&A){let e=`${A.plugin.name}@${A.marketplace}`;return(0,Z.jsx)(Yn,{title:`Configure ${A.plugin.name}`,subtitle:`Plugin options`,configSchema:S.schema,initialValues:Ee(e),onSave:n=>{try{mt(e,n,S.schema),yt(),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){R(`Failed to save configuration: ${ce(e)}`)}w(`plugin-details`)},onCancel:()=>w(`plugin-details`)})}if(S===`configuring`&&ke&&A){let e=`${A.plugin.name}@${A.marketplace}`;async function n(n){if(!(!ke||!A))try{let r=A.plugin.manifest.mcpServers,i=null;if(typeof r==`string`&&Ge(r))i=r;else if(Array.isArray(r)){for(let e of r)if(typeof e==`string`&&Ge(e)){i=e;break}}if(!i){R(`No MCPB file found`),w(`plugin-details`);return}await Me(i,A.plugin.path,e,void 0,n),R(null),Ae(null),w(`plugin-details`),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){R(`Failed to save configuration: ${ce(e)}`),w(`plugin-details`)}}function r(){Ae(null),w(`plugin-details`)}return(0,Z.jsx)(Yn,{title:`Configure ${ke.manifest.name}`,subtitle:`Plugin: ${A.plugin.name}`,configSchema:ke.configSchema,initialValues:ke.existingConfig,onSave:n,onCancel:r})}if(typeof S==`object`&&S.type===`flagged-detail`){let e=S.plugin;return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsx)(C,{children:(0,Z.jsxs)(p,{bold:!0,children:[e.name,` @ `,e.marketplace]})}),(0,Z.jsxs)(C,{marginBottom:1,children:[(0,Z.jsx)(p,{dimColor:!0,children:`Status: `}),(0,Z.jsx)(p,{color:`error`,children:`Removed`})]}),(0,Z.jsxs)(C,{marginBottom:1,flexDirection:`column`,children:[(0,Z.jsxs)(p,{color:`error`,children:[`Removed from marketplace · reason: `,e.reason]}),(0,Z.jsx)(p,{children:e.text}),(0,Z.jsxs)(p,{dimColor:!0,children:[`Flagged on `,new Date(e.flaggedAt).toLocaleDateString()]})]}),(0,Z.jsx)(C,{marginTop:1,flexDirection:`column`,children:(0,Z.jsxs)(C,{children:[(0,Z.jsxs)(p,{children:[a.pointer,` `]}),(0,Z.jsx)(p,{color:`suggestion`,children:`Dismiss`})]})}),(0,Z.jsxs)(g,{children:[(0,Z.jsx)(z,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`dismiss`}),(0,Z.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})]})}if(S===`confirm-project-uninstall`&&A)return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsxs)(p,{bold:!0,color:`warning`,children:[A.plugin.name,` is enabled in .claude/settings.json (shared with your team)`]}),(0,Z.jsxs)(C,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(p,{children:`Disable it just for you in .claude/settings.local.json?`}),(0,Z.jsx)(p,{dimColor:!0,children:`This has the same effect as uninstalling, without affecting other contributors.`})]}),Oe&&(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{color:`error`,children:Oe})}),(0,Z.jsx)(C,{marginTop:1,children:Te?(0,Z.jsx)(p,{dimColor:!0,children:`Disabling…`}):(0,Z.jsxs)(g,{children:[(0,Z.jsx)(z,{action:`confirm:yes`,context:`Confirmation`,fallback:`y`,description:`disable`}),(0,Z.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]});if(typeof S==`object`&&S.type===`confirm-data-cleanup`&&A)return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsxs)(p,{bold:!0,children:[A.plugin.name,` has `,S.size.human,` of persistent data`]}),(0,Z.jsxs)(C,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(p,{children:`Delete it along with the plugin?`}),(0,Z.jsx)(p,{dimColor:!0,children:bt(`${A.plugin.name}@${A.marketplace}`)})]}),Oe&&(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{color:`error`,children:Oe})}),(0,Z.jsx)(C,{marginTop:1,children:Te?(0,Z.jsx)(p,{dimColor:!0,children:`Uninstalling…`}):(0,Z.jsxs)(p,{children:[(0,Z.jsx)(p,{bold:!0,children:`y`}),` to delete · `,(0,Z.jsx)(p,{bold:!0,children:`n`}),` to keep · `,(0,Z.jsx)(p,{bold:!0,children:`esc`}),` to cancel`]})})]});if(S===`plugin-details`&&A){let e=P(),t=`${A.plugin.name}@${A.marketplace}`,n=e?.enabledPlugins?.[t]!==!1,r=m.filter(e=>`plugin`in e&&e.plugin===A.plugin.name||e.source===t||e.source.startsWith(`${A.plugin.name}@`)),i=r.length===0?null:(0,Z.jsxs)(C,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsxs)(p,{bold:!0,color:`error`,children:[r.length,` `,O(r.length,`error`),`:`]}),r.map((e,t)=>{let n=Ar(e);return(0,Z.jsxs)(C,{flexDirection:`column`,marginLeft:2,children:[(0,Z.jsx)(p,{color:`error`,children:kr(e)}),n&&(0,Z.jsxs)(p,{dimColor:!0,italic:!0,children:[a.arrowRight,` `,n]})]},t)})]});return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsx)(C,{children:(0,Z.jsxs)(p,{bold:!0,children:[A.plugin.name,` @ `,A.marketplace]})}),(0,Z.jsxs)(C,{children:[(0,Z.jsx)(p,{dimColor:!0,children:`Scope: `}),(0,Z.jsx)(p,{children:A.scope||`user`})]}),A.plugin.manifest.version&&(0,Z.jsxs)(C,{children:[(0,Z.jsx)(p,{dimColor:!0,children:`Version: `}),(0,Z.jsx)(p,{children:A.plugin.manifest.version})]}),A.plugin.manifest.description&&(0,Z.jsx)(C,{marginBottom:1,children:(0,Z.jsx)(p,{children:A.plugin.manifest.description})}),A.plugin.manifest.author&&(0,Z.jsxs)(C,{children:[(0,Z.jsx)(p,{dimColor:!0,children:`Author: `}),(0,Z.jsx)(p,{children:A.plugin.manifest.author.name})]}),(0,Z.jsxs)(C,{marginBottom:1,children:[(0,Z.jsx)(p,{dimColor:!0,children:`Status: `}),(0,Z.jsx)(p,{color:n?`success`:`warning`,children:n?`Enabled`:`Disabled`}),A.pendingUpdate&&(0,Z.jsx)(p,{color:`suggestion`,children:` · Marked for update`})]}),(0,Z.jsx)(Ir,{plugin:A.plugin,marketplace:A.marketplace}),i,(0,Z.jsx)(C,{marginTop:1,flexDirection:`column`,children:ze.map((e,t)=>{let n=t===Ce;return(0,Z.jsxs)(C,{children:[n&&(0,Z.jsxs)(p,{children:[a.pointer,` `]}),!n&&(0,Z.jsx)(p,{children:` `}),(0,Z.jsx)(p,{bold:n,color:e.label.includes(`Uninstall`)?`error`:e.label.includes(`Update`)?`suggestion`:void 0,children:e.label})]},t)})}),Te&&(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{children:`Processing…`})}),Oe&&(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{color:`error`,children:Oe})}),(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(g,{children:[(0,Z.jsx)(z,{action:`select:previous`,context:`Select`,fallback:`↑`,description:`navigate`}),(0,Z.jsx)(z,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,Z.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(typeof S==`object`&&S.type===`failed-plugin-details`){let e=S.plugin,t=e.errors[0],n=t?kr(t):`Failed to load`;return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsxs)(p,{children:[(0,Z.jsx)(p,{bold:!0,children:e.name}),(0,Z.jsxs)(p,{dimColor:!0,children:[` @ `,e.marketplace]}),(0,Z.jsxs)(p,{dimColor:!0,children:[` (`,e.scope,`)`]})]}),(0,Z.jsx)(p,{color:`error`,children:n}),e.scope===`managed`?(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{dimColor:!0,children:`Managed by your organization — contact your admin`})}):(0,Z.jsxs)(C,{marginTop:1,children:[(0,Z.jsxs)(p,{color:`suggestion`,children:[a.pointer,` `]}),(0,Z.jsx)(p,{bold:!0,children:`Remove`})]}),Te&&(0,Z.jsx)(p,{children:`Processing…`}),Oe&&(0,Z.jsx)(p,{color:`error`,children:Oe}),(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(g,{children:[e.scope!==`managed`&&(0,Z.jsx)(z,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`remove`}),(0,Z.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(typeof S==`object`&&S.type===`mcp-detail`){let e=S.client,n=it(u,e.name).length,r=()=>{w({type:`mcp-tools`,client:e})},i=()=>{w(`plugin-list`)},a=e=>{e&&t(e),w(`plugin-list`)},o=e.config.scope,s=e.config.type;return s===`stdio`?(0,Z.jsx)(Fn,{server:{name:e.name,client:e,scope:o,transport:`stdio`,config:e.config},serverToolsCount:n,onViewTools:r,onCancel:i,onComplete:a,borderless:!0}):s===`sse`?(0,Z.jsx)(Nn,{server:{name:e.name,client:e,scope:o,transport:`sse`,isAuthenticated:void 0,config:e.config},serverToolsCount:n,onViewTools:r,onCancel:i,onComplete:a,borderless:!0}):s===`http`?(0,Z.jsx)(Nn,{server:{name:e.name,client:e,scope:o,transport:`http`,isAuthenticated:void 0,config:e.config},serverToolsCount:n,onViewTools:r,onCancel:i,onComplete:a,borderless:!0}):s===`claudeai-proxy`?(0,Z.jsx)(Nn,{server:{name:e.name,client:e,scope:o,transport:`claudeai-proxy`,isAuthenticated:void 0,config:e.config},serverToolsCount:n,onViewTools:r,onCancel:i,onComplete:a,borderless:!0}):(w(`plugin-list`),null)}if(typeof S==`object`&&S.type===`mcp-tools`){let e=S.client,t=e.config.scope,n=e.config.type,r;return r=n===`stdio`?{name:e.name,client:e,scope:t,transport:`stdio`,config:e.config}:n===`sse`?{name:e.name,client:e,scope:t,transport:`sse`,isAuthenticated:void 0,config:e.config}:n===`http`?{name:e.name,client:e,scope:t,transport:`http`,isAuthenticated:void 0,config:e.config}:{name:e.name,client:e,scope:t,transport:`claudeai-proxy`,isAuthenticated:void 0,config:e.config},(0,Z.jsx)(Vn,{server:r,onSelectTool:t=>{w({type:`mcp-tool-detail`,client:e,tool:t})},onBack:()=>w({type:`mcp-detail`,client:e})})}if(typeof S==`object`&&S.type===`mcp-tool-detail`){let{client:e,tool:t}=S,n=e.config.scope,r=e.config.type,i;return i=r===`stdio`?{name:e.name,client:e,scope:n,transport:`stdio`,config:e.config}:r===`sse`?{name:e.name,client:e,scope:n,transport:`sse`,isAuthenticated:void 0,config:e.config}:r===`http`?{name:e.name,client:e,scope:n,transport:`http`,isAuthenticated:void 0,config:e.config}:{name:e.name,client:e,scope:n,transport:`claudeai-proxy`,isAuthenticated:void 0,config:e.config},(0,Z.jsx)(Rn,{tool:t,server:i,onBack:()=>w({type:`mcp-tools`,client:e})})}let Be=Se.getVisibleItems(_e);return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsx)(C,{marginBottom:1,children:(0,Z.jsx)(f,{query:T,isFocused:_,isTerminalFocused:x,width:ee-4,cursorOffset:D})}),_e.length===0&&T&&(0,Z.jsx)(C,{marginBottom:1,children:(0,Z.jsxs)(p,{dimColor:!0,children:[`No items match "`,T,`"`]})}),Se.scrollPosition.canScrollUp&&(0,Z.jsx)(C,{children:(0,Z.jsxs)(p,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),Be.map((e,t)=>{let n=Se.toActualIndex(t)===ve&&!_,r=t>0?Be[t-1]:null,i=!r||r.scope!==e.scope;return(0,Z.jsxs)(Br.Fragment,{children:[i&&(0,Z.jsx)(C,{marginTop:+(t>0),paddingLeft:2,children:(0,Z.jsx)(p,{dimColor:e.scope!==`flagged`,color:e.scope===`flagged`?`warning`:void 0,bold:e.scope===`flagged`,children:(e=>{switch(e){case`flagged`:return`Flagged`;case`project`:return`Project`;case`local`:return`Local`;case`user`:return`User`;case`enterprise`:return`Enterprise`;case`managed`:return`Managed`;case`builtin`:return`Built-in`;case`dynamic`:return`Built-in`;default:return e}})(e.scope)})}),(0,Z.jsx)(Mr,{item:e,isSelected:n})]},e.id)}),Se.scrollPosition.canScrollDown&&(0,Z.jsx)(C,{children:(0,Z.jsxs)(p,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),(0,Z.jsx)(C,{marginTop:1,marginLeft:1,children:(0,Z.jsx)(p,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(g,{children:[(0,Z.jsx)(p,{children:`type to search`}),(0,Z.jsx)(z,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,Z.jsx)(z,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,Z.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})}),se.size>0&&(0,Z.jsx)(C,{marginLeft:1,children:(0,Z.jsx)(p,{dimColor:!0,italic:!0,children:`Run /reload-plugins to apply changes`})})]})}var Br,X,Z,Vr=e((()=>{i(),Br=t(l(),1),X=t(l(),1),ot(),x(),Pn(),Ln(),Bn(),Wn(),bn(),Sn(),zt(),Kt(),Ht(),vn(),Ye(),rn(),We(),xe(),Gt(),de(),L(),ve(),At(),ke(),tt(),Ue(),Ot(),gn(),Bt(),dt(),_t(),St(),Yt(),F(),fe(),M(),jr(),Qn(),rr(),Nr(),hr(),Z=w()}));function Hr(e){if(!e)return{type:`menu`};let t=e.trim().split(/\s+/);switch(t[0]?.toLowerCase()){case`help`:case`--help`:case`-h`:return{type:`help`};case`install`:case`i`:{let e=t[1];if(!e)return{type:`install`};if(e.includes(`@`)){let[t,n]=e.split(`@`);return{type:`install`,plugin:t,marketplace:n}}return e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`file://`)||e.includes(`/`)||e.includes(`\\`)?{type:`install`,marketplace:e}:{type:`install`,plugin:e}}case`manage`:return{type:`manage`};case`uninstall`:return{type:`uninstall`,plugin:t[1]};case`enable`:return{type:`enable`,plugin:t[1]};case`disable`:return{type:`disable`,plugin:t[1]};case`validate`:return{type:`validate`,path:t.slice(1).join(` `).trim()||void 0};case`marketplace`:case`market`:{let e=t[1]?.toLowerCase(),n=t.slice(2).join(` `);switch(e){case`add`:return{type:`marketplace`,action:`add`,target:n};case`remove`:case`rm`:return{type:`marketplace`,action:`remove`,target:n};case`update`:return{type:`marketplace`,action:`update`,target:n};case`list`:return{type:`marketplace`,action:`list`};default:return{type:`marketplace`}}}default:return{type:`menu`}}}var Ur=e((()=>{}));function Wr({onComplete:e,path:t}){return(0,Gr.useEffect)(()=>{async function n(){if(!t){e(`Usage: /plugin validate <path>
|
|
2
|
+
|
|
3
|
+
Validate a plugin or marketplace manifest file or directory.
|
|
4
|
+
|
|
5
|
+
Examples:
|
|
6
|
+
/plugin validate .claude-plugin/plugin.json
|
|
7
|
+
/plugin validate /path/to/plugin-directory
|
|
8
|
+
/plugin validate .
|
|
9
|
+
|
|
10
|
+
When given a directory, automatically validates .claude-plugin/marketplace.json
|
|
11
|
+
or .claude-plugin/plugin.json (prefers marketplace if both exist).
|
|
12
|
+
|
|
13
|
+
Or from the command line:
|
|
14
|
+
claude plugin validate <path>`);return}try{let n=await ln(t),r=``;r+=`Validating ${n.fileType} manifest: ${n.filePath}\n\n`,n.errors.length>0&&(r+=`${a.cross} Found ${n.errors.length} ${O(n.errors.length,`error`)}:\n\n`,n.errors.forEach(e=>{r+=` ${a.pointer} ${e.path}: ${e.message}\n`}),r+=`
|
|
15
|
+
`),n.warnings.length>0&&(r+=`${a.warning} Found ${n.warnings.length} ${O(n.warnings.length,`warning`)}:\n\n`,n.warnings.forEach(e=>{r+=` ${a.pointer} ${e.path}: ${e.message}\n`}),r+=`
|
|
16
|
+
`),n.success?(n.warnings.length>0?r+=`${a.tick} Validation passed with warnings\n`:r+=`${a.tick} Validation passed\n`,process.exitCode=0):(r+=`${a.cross} Validation failed\n`,process.exitCode=1),e(r)}catch(t){process.exitCode=2,ye(t),e(`${a.cross} Unexpected error during validation: ${ce(t)}`)}}n()},[e,t]),(0,Kr.jsx)(C,{flexDirection:`column`,children:(0,Kr.jsx)(p,{children:`Running validation...`})})}var Gr,Kr,qr=e((()=>{i(),l(),Gr=t(l(),1),x(),L(),ve(),fn(),M(),Kr=w()}));function Jr({onComplete:e}){return(0,Q.useEffect)(()=>{async function t(){try{let t=await Fe(),n=Object.keys(t);n.length===0?e(`No marketplaces configured`):e(`Configured marketplaces:\n${n.map(e=>` • ${e}`).join(`
|
|
17
|
+
`)}`)}catch(t){e(`Error loading marketplaces: ${ce(t)}`)}}t()},[e]),(0,$.jsx)(p,{children:`Loading marketplaces...`})}function Yr(){return process.env.USER_TYPE===`ant`?(0,$.jsxs)(C,{flexDirection:`row`,alignItems:`flex-start`,paddingLeft:1,marginTop:1,borderLeft:!0,borderRight:!1,borderTop:!1,borderBottom:!1,borderColor:`permission`,borderStyle:`single`,children:[(0,$.jsx)(C,{flexShrink:0,children:(0,$.jsxs)(p,{bold:!0,italic:!0,color:`permission`,children:[`i`,` `]})}),(0,$.jsx)(p,{children:`[ANT-ONLY] MCP servers are now managed in /plugins. Use /mcp no-redirect to test old UI`})]}):null}function Xr(e){let t=[];for(let{source:n,scope:r}of[{source:`userSettings`,scope:`user`},{source:`projectSettings`,scope:`project`},{source:`localSettings`,scope:`local`}])k(n)?.extraKnownMarketplaces?.[e]&&t.push({source:n,scope:r});return{editableSources:t,isInPolicy:!!k(`policySettings`)?.extraKnownMarketplaces?.[e]}}function Zr(e){let{editableSources:t,isInPolicy:n}=Xr(e);return t.length>0?{kind:`remove-extra-marketplace`,name:e,sources:t}:n?{kind:`managed-only`,name:e}:{kind:`navigate`,tab:`marketplaces`,viewState:{type:`manage-marketplaces`,targetMarketplace:e,action:`remove`}}}function Qr(e){return{kind:`navigate`,tab:`installed`,viewState:{type:`manage-plugins`,targetPlugin:e,action:`uninstall`}}}function $r(e){return si.has(e.type)}function ei(e){if(`pluginId`in e&&e.pluginId)return e.pluginId;if(`plugin`in e&&e.plugin)return e.plugin;if(e.source.includes(`@`))return e.source.split(`@`)[0]}function ti(e,t,n,r,i,a,o){let s=[];for(let e of a){let t=`pluginId`in e?e.pluginId:`plugin`in e?e.plugin:void 0;s.push({label:t??e.source,message:kr(e),guidance:`Restart to retry loading plugins`,action:{kind:`none`}})}let c=new Set;for(let t of e){c.add(t.name);let e=Zr(t.name),n=Xr(t.name),r=n.isInPolicy?`managed`:n.editableSources[0]?.scope;s.push({label:t.name,message:t.error??`Installation failed`,guidance:e.kind===`managed-only`?`Managed by your organization — contact your admin`:void 0,action:e,scope:r})}for(let e of t){let t=`marketplace`in e?e.marketplace:e.source;if(c.has(t))continue;c.add(t);let n=Zr(t),r=Xr(t),i=r.isInPolicy?`managed`:r.editableSources[0]?.scope;s.push({label:t,message:kr(e),guidance:n.kind===`managed-only`?`Managed by your organization — contact your admin`:Ar(e),action:n,scope:i})}for(let e of i)c.has(e.name)||(c.add(e.name),s.push({label:e.name,message:e.error,action:{kind:`remove-installed-marketplace`,name:e.name}}));let l=new Set;for(let e of n){let t=ei(e);if(t&&l.has(t))continue;t&&l.add(t);let n=`marketplace`in e?e.marketplace:void 0,r=t?o.get(e.source)??o.get(t):void 0;s.push({label:t?n?`${t} @ ${n}`:t:e.source,message:kr(e),guidance:Ar(e),action:t?Qr(t):{kind:`none`},scope:r})}for(let e of r)s.push({label:e.source,message:kr(e),guidance:Ar(e),action:{kind:`none`}});return s}function ni(e,t){for(let{source:n}of t){let t=k(n);if(!t)continue;let r={};if(t.extraKnownMarketplaces?.[e]&&(r.extraKnownMarketplaces={...t.extraKnownMarketplaces,[e]:void 0}),t.enabledPlugins){let n=`@${e}`,i=!1,a={...t.enabledPlugins};for(let e in a)e.endsWith(n)&&(a[e]=void 0,i=!0);i&&(r.enabledPlugins=a)}Object.keys(r).length>0&&re(n,r)}}function ri({setViewState:e,setActiveTab:t,markPluginsChanged:n}){let r=qe(e=>e.plugins.errors),i=qe(e=>e.plugins.installationStatus),o=Le(),[s,c]=(0,Q.useState)(0),[l,u]=(0,Q.useState)(null),[d,f]=(0,Q.useState)([]);(0,Q.useEffect)(()=>{(async()=>{try{let{failures:e}=await Dt(await Fe());f(e)}catch{}})()},[]);let m=i.marketplaces.filter(e=>e.status===`failed`),h=new Set(m.map(e=>e.name)),_=r.filter($r),y=ti(m,r.filter(e=>(e.type===`marketplace-not-found`||e.type===`marketplace-load-failed`||e.type===`marketplace-blocked-by-policy`)&&!h.has(e.marketplace)),r.filter(e=>$r(e)||e.type===`marketplace-not-found`||e.type===`marketplace-load-failed`||e.type===`marketplace-blocked-by-policy`?!1:ei(e)!==void 0),r.filter(e=>$r(e)||e.type===`marketplace-not-found`||e.type===`marketplace-load-failed`||e.type===`marketplace-blocked-by-policy`?!1:ei(e)===void 0),d,_,Xt());te(`confirm:no`,()=>{e({type:`menu`})},{context:`Confirmation`}),v({"select:previous":()=>c(e=>Math.max(0,e-1)),"select:next":()=>c(e=>Math.min(y.length-1,e+1)),"select:accept":()=>{let r=y[s];if(!r)return;let{action:i}=r;switch(i.kind){case`navigate`:t(i.tab),e(i.viewState);break;case`remove-extra-marketplace`:{let e=i.sources.map(e=>e.scope).join(`, `);ni(i.name,i.sources),yt(),o(e=>({...e,plugins:{...e.plugins,errors:e.plugins.errors.filter(e=>!(`marketplace`in e&&e.marketplace===i.name)),installationStatus:{...e.plugins.installationStatus,marketplaces:e.plugins.installationStatus.marketplaces.filter(e=>e.name!==i.name)}}})),u(`${a.tick} Removed "${i.name}" from ${e} settings`),n();break}case`remove-installed-marketplace`:(async()=>{try{await wt(i.name),yt(),f(e=>e.filter(e=>e.name!==i.name)),u(`${a.tick} Removed marketplace "${i.name}"`),n()}catch(e){u(`Failed to remove "${i.name}": ${e instanceof Error?e.message:String(e)}`)}})();break;case`managed-only`:break;case`none`:break}}},{context:`Select`,isActive:y.length>0});let b=Math.min(s,Math.max(0,y.length-1));b!==s&&c(b);let x=y[b]?.action,ee=x&&x.kind!==`none`&&x.kind!==`managed-only`;return y.length===0?(0,$.jsxs)(C,{flexDirection:`column`,children:[(0,$.jsx)(C,{marginLeft:1,children:(0,$.jsx)(p,{dimColor:!0,children:`No plugin errors`})}),(0,$.jsx)(C,{marginTop:1,children:(0,$.jsx)(p,{dimColor:!0,italic:!0,children:(0,$.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})})]}):(0,$.jsxs)(C,{flexDirection:`column`,children:[y.map((e,t)=>{let n=t===b;return(0,$.jsxs)(C,{marginLeft:1,flexDirection:`column`,marginBottom:1,children:[(0,$.jsxs)(p,{children:[(0,$.jsxs)(p,{color:n?`suggestion`:`error`,children:[n?a.pointer:a.cross,` `]}),(0,$.jsx)(p,{bold:n,children:e.label}),e.scope&&(0,$.jsxs)(p,{dimColor:!0,children:[` (`,e.scope,`)`]})]}),(0,$.jsx)(C,{marginLeft:3,children:(0,$.jsx)(p,{color:`error`,children:e.message})}),e.guidance&&(0,$.jsx)(C,{marginLeft:3,children:(0,$.jsx)(p,{dimColor:!0,italic:!0,children:e.guidance})})]},t)}),l&&(0,$.jsx)(C,{marginTop:1,marginLeft:1,children:(0,$.jsx)(p,{color:`claude`,children:l})}),(0,$.jsx)(C,{marginTop:1,children:(0,$.jsx)(p,{dimColor:!0,italic:!0,children:(0,$.jsxs)(g,{children:[(0,$.jsx)(z,{action:`select:previous`,context:`Select`,fallback:`↑`,description:`navigate`}),ee&&(0,$.jsx)(z,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`resolve`}),(0,$.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}function ii(e){switch(e.type){case`help`:return{type:`help`};case`validate`:return{type:`validate`,path:e.path};case`install`:return e.marketplace?{type:`browse-marketplace`,targetMarketplace:e.marketplace,targetPlugin:e.plugin}:e.plugin?{type:`discover-plugins`,targetPlugin:e.plugin}:{type:`discover-plugins`};case`manage`:return{type:`manage-plugins`};case`uninstall`:return{type:`manage-plugins`,targetPlugin:e.plugin,action:`uninstall`};case`enable`:return{type:`manage-plugins`,targetPlugin:e.plugin,action:`enable`};case`disable`:return{type:`manage-plugins`,targetPlugin:e.plugin,action:`disable`};case`marketplace`:return e.action===`list`?{type:`marketplace-list`}:e.action===`add`?{type:`add-marketplace`,initialValue:e.target}:e.action===`remove`?{type:`manage-marketplaces`,targetMarketplace:e.target,action:`remove`}:e.action===`update`?{type:`manage-marketplaces`,targetMarketplace:e.target,action:`update`}:{type:`marketplace-menu`};default:return{type:`discover-plugins`}}}function ai(e){return e.type===`manage-plugins`?`installed`:e.type===`manage-marketplaces`?`marketplaces`:`discover`}function oi({onComplete:e,args:t,showMcpRedirectMessage:n}){let r=Hr(t),i=ii(r),[a,o]=(0,Q.useState)(i),[s,c]=(0,Q.useState)(ai(i)),[l,u]=(0,Q.useState)(a.type===`add-marketplace`&&a.initialValue||``),[d,f]=(0,Q.useState)(0),[m,h]=(0,Q.useState)(null),[g,v]=(0,Q.useState)(null),[x,ee]=(0,Q.useState)(!1),S=Le(),ne=qe(e=>{let t=e.plugins.errors.length;for(let n of e.plugins.installationStatus.marketplaces)n.status===`failed`&&t++;return t}),w=ne>0?`Errors (${ne})`:`Errors`,T=Jt(),E=r.type===`marketplace`&&r.action===`add`&&r.target!==void 0,D=(0,Q.useCallback)(()=>{S(e=>e.plugins.needsRefresh?e:{...e,plugins:{...e.plugins,needsRefresh:!0}})},[S]),O=(0,Q.useCallback)(e=>{let t=e;switch(c(t),h(null),t){case`discover`:o({type:`discover-plugins`});break;case`installed`:o({type:`manage-plugins`});break;case`marketplaces`:o({type:`manage-marketplaces`});break;case`errors`:break}},[]);return(0,Q.useEffect)(()=>{a.type===`menu`&&!g&&e()},[a.type,g,e]),(0,Q.useEffect)(()=>{a.type===`browse-marketplace`&&s!==`discover`&&c(`discover`)},[a.type,s]),te(`confirm:no`,(0,Q.useCallback)(()=>{c(`marketplaces`),o({type:`manage-marketplaces`}),u(``),h(null)},[]),{context:`Settings`,isActive:a.type===`add-marketplace`}),(0,Q.useEffect)(()=>{g&&e(g)},[g,e]),(0,Q.useEffect)(()=>{a.type===`help`&&e()},[a.type,e]),a.type===`help`?(0,$.jsxs)(C,{flexDirection:`column`,children:[(0,$.jsx)(p,{bold:!0,children:`Plugin Command Usage:`}),(0,$.jsx)(p,{children:` `}),(0,$.jsx)(p,{dimColor:!0,children:`Installation:`}),(0,$.jsx)(p,{children:` /plugin install - Browse and install plugins`}),(0,$.jsx)(p,{children:` /plugin install <marketplace> - Install from specific marketplace`}),(0,$.jsx)(p,{children:` /plugin install <plugin> - Install specific plugin`}),(0,$.jsx)(p,{children:` /plugin install <plugin>@<market> - Install plugin from marketplace`}),(0,$.jsx)(p,{children:` `}),(0,$.jsx)(p,{dimColor:!0,children:`Management:`}),(0,$.jsx)(p,{children:` /plugin manage - Manage installed plugins`}),(0,$.jsx)(p,{children:` /plugin enable <plugin> - Enable a plugin`}),(0,$.jsx)(p,{children:` /plugin disable <plugin> - Disable a plugin`}),(0,$.jsx)(p,{children:` /plugin uninstall <plugin> - Uninstall a plugin`}),(0,$.jsx)(p,{children:` `}),(0,$.jsx)(p,{dimColor:!0,children:`Marketplaces:`}),(0,$.jsx)(p,{children:` /plugin marketplace - Marketplace management menu`}),(0,$.jsx)(p,{children:` /plugin marketplace add - Add a marketplace`}),(0,$.jsx)(p,{children:` /plugin marketplace add <path/url> - Add marketplace directly`}),(0,$.jsx)(p,{children:` /plugin marketplace update - Update marketplaces`}),(0,$.jsx)(p,{children:` /plugin marketplace update <name> - Update specific marketplace`}),(0,$.jsx)(p,{children:` /plugin marketplace remove - Remove a marketplace`}),(0,$.jsx)(p,{children:` /plugin marketplace remove <name> - Remove specific marketplace`}),(0,$.jsx)(p,{children:` /plugin marketplace list - List all marketplaces`}),(0,$.jsx)(p,{children:` `}),(0,$.jsx)(p,{dimColor:!0,children:`Validation:`}),(0,$.jsx)(p,{children:` /plugin validate <path> - Validate a manifest file or directory`}),(0,$.jsx)(p,{children:` `}),(0,$.jsx)(p,{dimColor:!0,children:`Other:`}),(0,$.jsx)(p,{children:` /plugin - Main plugin menu`}),(0,$.jsx)(p,{children:` /plugin help - Show this help`}),(0,$.jsx)(p,{children:` /plugins - Alias for /plugin`})]}):a.type===`validate`?(0,$.jsx)(Wr,{onComplete:e,path:a.path}):a.type===`marketplace-menu`?(o({type:`menu`}),null):a.type===`marketplace-list`?(0,$.jsx)(Jr,{onComplete:e}):a.type===`add-marketplace`?(0,$.jsx)(Gn,{inputValue:l,setInputValue:u,cursorOffset:d,setCursorOffset:f,error:m,setError:h,result:g,setResult:v,setViewState:o,onAddComplete:D,cliMode:E}):(0,$.jsx)(y,{color:`suggestion`,children:(0,$.jsxs)(b,{title:`Plugins`,selectedTab:s,onTabChange:O,color:`suggestion`,disableNavigation:x,banner:n&&s===`installed`?(0,$.jsx)(Yr,{}):void 0,children:[(0,$.jsx)(_,{id:`discover`,title:`Discover`,children:a.type===`browse-marketplace`?(0,$.jsx)(gr,{error:m,setError:h,result:g,setResult:v,setViewState:o,onInstallComplete:D,targetMarketplace:a.targetMarketplace,targetPlugin:a.targetPlugin}):(0,$.jsx)(br,{error:m,setError:h,result:g,setResult:v,setViewState:o,onInstallComplete:D,onSearchModeChange:ee,targetPlugin:a.type===`discover-plugins`?a.targetPlugin:void 0})}),(0,$.jsx)(_,{id:`installed`,title:`Installed`,children:(0,$.jsx)(zr,{setViewState:o,setResult:v,onManageComplete:D,onSearchModeChange:ee,targetPlugin:a.type===`manage-plugins`?a.targetPlugin:void 0,targetMarketplace:a.type===`manage-plugins`?a.targetMarketplace:void 0,action:a.type===`manage-plugins`?a.action:void 0})}),(0,$.jsx)(_,{id:`marketplaces`,title:`Marketplaces`,children:(0,$.jsx)(Tr,{setViewState:o,error:m,setError:h,setResult:v,exitState:T,onManageComplete:D,targetMarketplace:a.type===`manage-marketplaces`?a.targetMarketplace:void 0,action:a.type===`manage-marketplaces`?a.action:void 0})}),(0,$.jsx)(_,{id:`errors`,title:w,children:(0,$.jsx)(ri,{setViewState:o,setActiveTab:c,markPluginsChanged:D})})]})})}var Q,$,si,ci=e((()=>{i(),l(),Q=t(l(),1),ot(),x(),qt(),Kt(),We(),L(),At(),st(),tt(),Yt(),F(),qn(),yr(),wr(),Or(),Vr(),jr(),Ur(),qr(),$=w(),si=new Set([`git-auth-failed`,`git-timeout`,`network-error`])}));export{Rn as a,Ln as c,Wn as i,Nn as l,ci as n,Bn as o,Vn as r,Fn as s,oi as t,Pn as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Cn as n,F as r,Rn as i,b as a,t as o,x as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{E as l,w as u,x as d}from"./startupProfiler-DnXZaX4A.js";import{
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Cn as n,F as r,Rn as i,b as a,t as o,x as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{E as l,w as u,x as d}from"./startupProfiler-DnXZaX4A.js";import{zw as f}from"./loadAgentsDir-D7kapZB5.js";function p(e){return e.startsWith(`file-`)?`+`:e.startsWith(`mcp-resource-`)?`◇`:e.startsWith(`agent-`)?`*`:`+`}function m(e){return e.startsWith(`file-`)||e.startsWith(`mcp-resource-`)||e.startsWith(`agent-`)}function h({suggestions:e,selectedSuggestion:t,maxColumnWidth:i,overlay:a}){let{rows:o}=r(),c=a?5:Math.min(6,Math.max(1,o-3));if(e.length===0)return null;let l=i??Math.max(...e.map(e=>n(e.displayText)))+5,u=Math.max(0,Math.min(t-Math.floor(c/2),e.length-c)),d=Math.min(u+c,e.length),f=e.slice(u,d);return(0,_.jsx)(s,{flexDirection:`column`,justifyContent:a?void 0:`flex-end`,children:f.map(n=>(0,_.jsx)(v,{item:n,maxColumnWidth:l,isSelected:n.id===e[t]?.id},n.id))})}var g,_,v,y,b=e((()=>{g=t(i(),1),f(),o(),d(),_=c(),v=(0,g.memo)(function({item:e,maxColumnWidth:t,isSelected:i}){let o=r().columns;if(m(e.id)){let t=p(e.id),r=i?`suggestion`:void 0,s=!i,c=e.id.startsWith(`file-`),d=e.id.startsWith(`mcp-resource-`),f=e.description?3:0,m;if(c){let t=e.description?Math.min(20,n(e.description)):0,r=o-2-4-f-t;m=u(e.displayText,r)}else m=d?l(e.displayText,30):e.displayText;let h=o-2-n(m)-f-4,g;if(e.description){let n=Math.max(0,h),r=l(e.description.replace(/\s+/g,` `),n);g=`${t} ${m} – ${r}`}else g=`${t} ${m}`;return(0,_.jsx)(a,{color:r,dimColor:s,wrap:`truncate`,children:g})}let s=Math.floor(o*.4),c=Math.min(t??n(e.displayText)+5,s),d=e.color||(i?`suggestion`:void 0),f=!i,h=e.displayText;n(h)>c-2&&(h=l(h,c-2));let g=h+` `.repeat(Math.max(0,c-n(h))),v=e.tag?`[${e.tag}] `:``,y=n(v),b=Math.max(0,o-c-y-4),x=e.description?l(e.description.replace(/\s+/g,` `),b):``;return(0,_.jsxs)(a,{wrap:`truncate`,children:[(0,_.jsx)(a,{color:d,dimColor:f,children:g}),v?(0,_.jsx)(a,{color:e.tag===`local`?`ansi:yellow`:void 0,dimColor:e.tag!==`local`,children:v}):null,(0,_.jsx)(a,{color:i?`suggestion`:void 0,dimColor:!i,children:x})]})}),y=(0,g.memo)(h)}));export{y as n,b as r,h as t};
|