claude-code-best 2.6.0 → 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-Cj5bvJgD.js → AddWorkspaceDirectory-Bb6crGWh.js} +1 -1
- package/dist/chunks/{App-2tgSv9lb.js → App-CW0Y4ceR.js} +1 -1
- package/dist/chunks/{ApproveApiKey-DWa-XTLb.js → ApproveApiKey-9rkwQfgT.js} +1 -1
- package/dist/chunks/ApproveApiKey-BhMr2Y5F.js +1 -0
- package/dist/chunks/{AssistantSessionChooser-DF9eeJZS.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-BW4XHmkw.js → ClaudeInChromeOnboarding-CjGydpBk.js} +1 -1
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-Bz0JyaOG.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-CcsM_OAS.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-C4ybxKPn.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-CKVpREDU.js → Grove-Tp_UtIMg.js} +1 -1
- package/dist/chunks/{HybridTransport-Byjvz-DL.js → HybridTransport-CAko699F.js} +2 -2
- package/dist/chunks/{ITermBackend-Co9XpeS4.js → ITermBackend-5P3WJumD.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-CNsqbNU3.js → InvalidConfigDialog-CVcdra9v.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-ClnZaN6b.js → InvalidSettingsDialog-CfLdbmSI.js} +1 -1
- package/dist/chunks/MCPConnectionManager-BK_3uwQj.js +1 -0
- package/dist/chunks/{McpParsingWarnings-DZkzoeZf.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-BwoGQB4g.js → Onboarding-C06Mxlf-.js} +1 -1
- package/dist/chunks/{OverageCreditUpsell-Q5g2YjQw.js → OverageCreditUpsell-abcPm3PB.js} +1 -1
- package/dist/chunks/PluginSettings-DGpIVGvV.js +17 -0
- package/dist/chunks/{PromptInputFooterSuggestions-D4lMVCqj.js → PromptInputFooterSuggestions-ihnbjU0K.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-BvLtS6an.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-BV_hoz98.js → RemoteCallout-Cy6lH-CZ.js} +1 -1
- package/dist/chunks/{RemoteSessionManager-Cxoy1ud2.js → RemoteSessionManager-C7iGd5Og.js} +2 -2
- package/dist/chunks/ResumeConversation-AdLtgdVB.js +1 -0
- package/dist/chunks/{SSETransport-pIm26VJq.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-B6EWoJml.js → SentryErrorBoundary-iih9eFpM.js} +1 -1
- package/dist/chunks/Settings-PioHwsvg.js +2 -0
- package/dist/chunks/{TeleportProgress-DPzGpyyM.js → TeleportProgress-BX-uLwuL.js} +1 -1
- package/dist/chunks/TeleportRepoMismatchDialog-D8oPPTWd.js +1 -0
- package/dist/chunks/{TeleportResumeWrapper-DPSO0S49.js → TeleportResumeWrapper-B_CvNDbr.js} +1 -1
- package/dist/chunks/{ThemePicker-DueihHcy.js → ThemePicker-BG1ykSpX.js} +1 -1
- package/dist/chunks/{TmuxBackend-BNaZNAeP.js → TmuxBackend-CnMCWNS4.js} +1 -1
- package/dist/chunks/TrustDialog-Z_maAYj8.js +1 -0
- package/dist/chunks/{ValidationErrorsList-1k1qbsRo.js → ValidationErrorsList-C9swVkZ-.js} +1 -1
- package/dist/chunks/{WelcomeV2-CR6TtXXM.js → WelcomeV2-Au_5ddlT.js} +1 -1
- package/dist/chunks/WindowsTerminalBackend-CGxaYH74.js +2 -0
- package/dist/chunks/{add-dir-DAMizKzF.js → add-dir-Cm9u56YX.js} +1 -1
- package/dist/chunks/{agentDisplay-B9z7i8b_.js → agentDisplay-Bi_bEyEn.js} +1 -1
- package/dist/chunks/{agents-D5u0p1UC.js → agents-CMF9fLzV.js} +7 -7
- package/dist/chunks/{agents-DCh_gEvJ.js → agents-CbjR7hNr.js} +1 -1
- package/dist/chunks/{ant-DRJq-cEg.js → ant-Bu1Gs4WJ.js} +1 -1
- package/dist/chunks/api-CFNGoLoL.js +1 -0
- package/dist/chunks/{api-B6URs6nc.js → api-D_t0nHsS.js} +1 -1
- package/dist/chunks/assistant-BLd4y2FJ.js +1 -0
- package/dist/chunks/{assistant-tPxOUa-Z.js → assistant-C_pfWe2a.js} +1 -1
- package/dist/chunks/{assistant-BRGDWkKB.js → assistant-EA-MHNQ-.js} +1 -1
- package/dist/chunks/{auth-CqURlg4d.js → auth-D7PZvVPf.js} +1 -1
- package/dist/chunks/auth-DGfZCD_B.js +1 -0
- package/dist/chunks/{autoMode-DVt4K4I2.js → autoMode-B8iO05xy.js} +6 -6
- package/dist/chunks/{autonomy-Ffv0QIyl.js → autonomy-CaLvE5N6.js} +12 -12
- package/dist/chunks/{autonomy-BZzW8QJZ.js → autonomy-dQVtSiCJ.js} +1 -1
- package/dist/chunks/{autonomyPanel-MwuzDvv_.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-DXefFdDE.js → branch-C7pM8Sjh.js} +1 -1
- package/dist/chunks/{bridge-qr4GQW_c.js → bridge-CTYdzSWg.js} +2 -2
- package/dist/chunks/bridgeConfig-7c07tJm9.js +1 -0
- package/dist/chunks/{bridgeConfig-CJ-KznTS.js → bridgeConfig-Df6uyp3q.js} +1 -1
- package/dist/chunks/{bridgeEnabled-5vsPrjuq.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-BiE0CTqq.js → bridgeMessaging-DPVLAIzl.js} +1 -1
- package/dist/chunks/{btw-FpimqEqk.js → btw-CqgjLlFN.js} +1 -1
- package/dist/chunks/{buddy-BA3Cr067.js → buddy-DCGBAqF2.js} +1 -1
- package/dist/chunks/{bypassPermissionsKillswitch-CSC9p8mO.js → bypassPermissionsKillswitch-CK0jeZTW.js} +1 -1
- package/dist/chunks/{caches-BUBkfP2Q.js → caches-CdVW8fYV.js} +2 -2
- package/dist/chunks/caches-Dt52PedI.js +1 -0
- package/dist/chunks/{ccrClient-BOxUn9EJ.js → ccrClient-B_3AmY7K.js} +1 -1
- package/dist/chunks/changeDetector-uO9CBvut.js +1 -0
- package/dist/chunks/{channelNotification-l3EXKDNB.js → channelNotification-BbDQdLZC.js} +1 -1
- package/dist/chunks/channelNotification-DzTzUrCe.js +1 -0
- package/dist/chunks/{chrome-BnKyWWQL.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-D5MCzz9h.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-BFshsh2H.js → commitAttribution-e0kkanVT.js} +1 -1
- package/dist/chunks/{compact-DWNaf1wR.js → compact-Dh9RewNA.js} +3 -3
- package/dist/chunks/{companion-CyK_Dr1U.js → companion-DVFacTUw.js} +1 -1
- package/dist/chunks/{config-DNz6Eitr.js → config-CkSmYDJY.js} +1 -1
- package/dist/chunks/{config-BdCuh6eA.js → config-DwiVCSrY.js} +1 -1
- package/dist/chunks/{context-BOjdTj0i.js → context-B8VDDHTv.js} +1 -1
- package/dist/chunks/{context-noninteractive-k2ibficU.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-B0VUJ2rH.js → copy-CIjrYoFa.js} +2 -2
- package/dist/chunks/{createSSHSession-DqmkCS_k.js → createSSHSession-ArNlbIZB.js} +1 -1
- package/dist/chunks/{createSession-CJEsHz58.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-Bd1s_VFj.js → datadog-BK8eJz8B.js} +1 -1
- package/dist/chunks/datadog-Uj6FjEuU.js +1 -0
- package/dist/chunks/{desktop-BDowrzvG.js → desktop-B9vWJeRu.js} +1 -1
- package/dist/chunks/{diff-auU5sUOw.js → diff-BTV7_Dca.js} +1 -1
- package/dist/chunks/{doctor-bKPp6AeL.js → doctor-Dpbh0aRz.js} +1 -1
- package/dist/chunks/{effort-BQj2QnnA.js → effort-Czlwa5qF.js} +4 -4
- package/dist/chunks/{entry-CUu6-QhT.js → entry-CdfuWjKu.js} +3 -3
- package/dist/chunks/{envLessBridgeConfig-Ju4W58xf.js → envLessBridgeConfig-BAFYaZ0E.js} +1 -1
- package/dist/chunks/envLessBridgeConfig-DOO9eX07.js +1 -0
- package/dist/chunks/{exit-DijkO8eo.js → exit-DzOm62Dn.js} +1 -1
- package/dist/chunks/{export-DA-bBZkX.js → export-DHOR3z3Z.js} +1 -1
- package/dist/chunks/{exportRenderer-3y4tGdSB.js → exportRenderer-CiNXeNr9.js} +1 -1
- package/dist/chunks/extra-usage-CJcyfVCt.js +1 -0
- package/dist/chunks/{extra-usage-CS6VwKJt.js → extra-usage-DIYR_3ZR.js} +1 -1
- package/dist/chunks/{extra-usage-core-DOgT4u4i.js → extra-usage-core-C3uM9bOP.js} +1 -1
- package/dist/chunks/{extra-usage-noninteractive-DYnfiRlV.js → extra-usage-noninteractive-Ctz9TfY8.js} +1 -1
- package/dist/chunks/{extraUsage-CfxgfpX_.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-CzRUJBTK.js → fast-BpBwjbSD.js} +1 -1
- package/dist/chunks/{feedback-FoXtdHAV.js → feedback-BkVnsZVx.js} +1 -1
- package/dist/chunks/{firstPartyEventLogger-KIwaBY-E.js → firstPartyEventLogger-BCzGkdpd.js} +1 -1
- package/dist/chunks/{flushGate-C2Icy43G.js → flushGate-CQsnMw8g.js} +1 -1
- package/dist/chunks/{gates-CbQLZHtm.js → gates-CxWIWtmd.js} +1 -1
- package/dist/chunks/gates-qgzva-fO.js +1 -0
- package/dist/chunks/{gemini-BrNJGX4k.js → gemini-BbV8D2SS.js} +1 -1
- package/dist/chunks/{generateRecap-B0fvSCjo.js → generateRecap-B3j2nUgh.js} +1 -1
- package/dist/chunks/{generateSessionName-DvRYa39O.js → generateSessionName-aGnXSNgN.js} +1 -1
- package/dist/chunks/{githubRepoPathMapping-Dut3d6nn.js → githubRepoPathMapping-DCJLSTLl.js} +1 -1
- package/dist/chunks/{grok-Ftoheab3.js → grok-C4QFXJnR.js} +1 -1
- package/dist/chunks/{growthbook-BynnuVTn.js → growthbook-prtWhMRg.js} +1 -1
- package/dist/chunks/{heapdump-hQ_w0LPC.js → heapdump-Czm-2XiG.js} +1 -1
- package/dist/chunks/{help-DQsHHv6r.js → help-CSAFsN0-.js} +1 -1
- package/dist/chunks/hooks-Ch2vPE8u.js +1 -0
- package/dist/chunks/{hooks-BhVDc8yb.js → hooks-DkbOP-bI.js} +2 -2
- package/dist/chunks/{hostAdapter-D1eWmmhu.js → hostAdapter-BcdDPVTj.js} +1 -1
- package/dist/chunks/{ide-CPmMXLL-.js → ide-BXERRFZF.js} +2 -2
- package/dist/chunks/{inboundAttachments-Bmf6vYsE.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-CTlTyvjj.js → insights-DrvqJgF8.js} +25 -25
- package/dist/chunks/{install-IPuD3Lq8.js → install-BGnxwO00.js} +1 -1
- package/dist/chunks/{install-github-app-Bmu_sA9e.js → install-github-app-CIpBHlr9.js} +2 -2
- package/dist/chunks/{install-slack-app-Rfl81Jqo.js → install-slack-app-By4Lh7ww.js} +1 -1
- package/dist/chunks/{instrumentation-DWwmOmr0.js → instrumentation-D9y7Ph_R.js} +3 -3
- package/dist/chunks/{job-BXEt0izn.js → job-BPVIMW_P.js} +1 -1
- package/dist/chunks/{keybindings-DRDgVvqz.js → keybindings-Ce6AHMLI.js} +2 -2
- package/dist/chunks/{lang-D3ZHlfT6.js → lang-DfDG_fSa.js} +1 -1
- package/dist/chunks/language-B1yHC1d6.js +1 -0
- package/dist/chunks/{language-DcSjogBx.js → language-yGoDFP3X.js} +1 -1
- package/dist/chunks/{launchAgentsPlatform-BPm_VMln.js → launchAgentsPlatform-DT01xZM7.js} +1 -1
- package/dist/chunks/launchAutofixPr-DrYd7WVf.js +18 -0
- package/dist/chunks/{launchLocalMemory-D_hBbXKE.js → launchLocalMemory-Bt3tMYVJ.js} +1 -1
- package/dist/chunks/{launchLocalVault-CPzNWvQ9.js → launchLocalVault-jyRHEa_Y.js} +1 -1
- package/dist/chunks/{launchMemoryStores-Djq2KhKb.js → launchMemoryStores-cmXnLAF5.js} +1 -1
- package/dist/chunks/{launchOnboarding-Bh6E7vdc.js → launchOnboarding-BPTNFftb.js} +1 -1
- package/dist/chunks/{launchSchedule-C988bQ-5.js → launchSchedule-141GqGC8.js} +1 -1
- package/dist/chunks/{launchSkillStore-DqrP6Gme.js → launchSkillStore-Bz0lok_o.js} +1 -1
- package/dist/chunks/{launchTeleport-DFhybaq_.js → launchTeleport-BMquJxIq.js} +2 -2
- package/dist/chunks/{launchVault-p_CSK4ZQ.js → launchVault-Bsuwqad6.js} +1 -1
- package/dist/chunks/{loadAgentsDir-Ci5mr0vm.js → loadAgentsDir-D7kapZB5.js} +717 -709
- package/dist/chunks/loadAgentsDir-DxPE2bIO.js +1 -0
- package/dist/chunks/{loadPluginHooks-xYCEZ6t5.js → loadPluginHooks-CL5aGDrb.js} +1 -1
- package/dist/chunks/localSearch-iozuZZhZ.js +1 -0
- package/dist/chunks/{localSearch-Vpn6W5aY.js → localSearch-r1_G8kfV.js} +1 -1
- package/dist/chunks/{login-D9IWjvza.js → login-7MvpaOkt.js} +1 -1
- package/dist/chunks/login-Dxza_KNT.js +1 -0
- package/dist/chunks/{logoV2Utils-SAulcC5x.js → logoV2Utils-DjThKW15.js} +1 -1
- package/dist/chunks/logout-BeGQR78E.js +1 -0
- package/dist/chunks/{magicDocs-BfoeYhin.js → magicDocs-Dy72LHIj.js} +2 -2
- package/dist/chunks/{main-DhMlhVj3.js → main-CF6Im-LV.js} +46 -46
- package/dist/chunks/{mappers-uIrAj-Wd.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-1SnOWb8_.js → mcpServer-BueM5fWI.js} +1 -1
- package/dist/chunks/{mcpServer-DXvS3v4x.js → mcpServer-Dqm2PQQx.js} +1 -1
- package/dist/chunks/{memory-XccPLQLt.js → memory-BNZmqma1.js} +1 -1
- package/dist/chunks/model-D3g2QdU-.js +1 -0
- package/dist/chunks/{model-CbiDGGJU.js → model-DOw7wIKQ.js} +1 -1
- package/dist/chunks/{onChangeAppState-Dp0JIXd8.js → onChangeAppState-Cb9_yIuW.js} +1 -1
- package/dist/chunks/{openai-6KcHd4Hw.js → openai-Bvo0Gcec.js} +3 -3
- package/dist/chunks/{overageCreditGrant-DYiB4sr-.js → overageCreditGrant-BrN7dk3d.js} +1 -1
- package/dist/chunks/{passes-Cbc6T_Tj.js → passes-vgcY8_l8.js} +1 -1
- package/dist/chunks/{paths-Q2255dD7.js → paths-1ngPRtu3.js} +2 -2
- package/dist/chunks/permissions-BDbIjTT6.js +3 -0
- package/dist/chunks/{pipeTransport-D7NIp3aA.js → pipeTransport-KU8psPDI.js} +1 -1
- package/dist/chunks/{plan-DloFVJK7.js → plan-5NVPuxp6.js} +1 -1
- package/dist/chunks/{plugin-XR9IBPMM.js → plugin-t8jMqdsY.js} +1 -1
- package/dist/chunks/{pluginAutoupdate-Cr9hP0zG.js → pluginAutoupdate-CAa4KLro.js} +1 -1
- package/dist/chunks/{pluginBlocklist-CM9uP8CY.js → pluginBlocklist-BG2LkLq1.js} +1 -1
- package/dist/chunks/{pluginCliCommands-BQkrvES5.js → pluginCliCommands-vqAtVibb.js} +1 -1
- package/dist/chunks/{pluginFlagging-CJ1--2Kw.js → pluginFlagging-BFCtv3kY.js} +1 -1
- package/dist/chunks/{pluginOperations-B0rLuSvo.js → pluginOperations-C9XP-mko.js} +2 -2
- package/dist/chunks/pluginStartupCheck-DZp0wnXP.js +1 -0
- package/dist/chunks/{pluginStartupCheck-Bjdc8zhz.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-DhptuhFw.js → pollConfig-DTYIJ8lQ.js} +1 -1
- package/dist/chunks/{poor-DF0aqXDx.js → poor-Dw5dMZpM.js} +1 -1
- package/dist/chunks/{poorMode-C5Frra4j.js → poorMode-CsGLI_hm.js} +1 -1
- package/dist/chunks/poorMode-D_hB-rDf.js +1 -0
- package/dist/chunks/{print-CPtR0KTa.js → print-Ct8N4PYT.js} +12 -12
- package/dist/chunks/{privacy-settings-e-7lc7Un.js → privacy-settings-P2r-kg2i.js} +1 -1
- package/dist/chunks/processBashCommand-a8W8aTRu.js +1 -0
- package/dist/chunks/{processSlashCommand-DHRUtZ-C.js → processSlashCommand-BaUdUg3T.js} +3 -3
- package/dist/chunks/prompt-B1Qy8mi4.js +1 -0
- package/dist/chunks/{prompt-DEPUnJdB.js → prompt-BBg3jtfc.js} +1 -1
- package/dist/chunks/prompt-D4kWWEZC.js +1 -0
- package/dist/chunks/{promptEditor-Ci-h04-5.js → promptEditor-CvaugNTt.js} +2 -2
- package/dist/chunks/{protocolHandler-DhqM32qE.js → protocolHandler-DxBaHlaD.js} +1 -1
- package/dist/chunks/{rate-limit-options-B0l29Zx8.js → rate-limit-options-Df_sgE0b.js} +1 -1
- package/dist/chunks/rcDebugLog-CPGWJbI4.js +11 -0
- package/dist/chunks/{referral-ByevBJrE.js → referral-BKeCKnOJ.js} +1 -1
- package/dist/chunks/{refresh-B_CwwIRX.js → refresh-Cjv4jA6L.js} +1 -1
- package/dist/chunks/{registerProtocol-DzhaQH02.js → registerProtocol-DLuRm0mf.js} +1 -1
- package/dist/chunks/{registry-DkHA4cRu.js → registry-DVSgtCq5.js} +1 -1
- package/dist/chunks/{release-notes-CZthYkei.js → release-notes-CZcf8zB7.js} +1 -1
- package/dist/chunks/{releaseNotes-CwKpIsyd.js → releaseNotes-CvfZb3fZ.js} +2 -2
- package/dist/chunks/{reload-plugins-DxWfXvrN.js → reload-plugins-pSlDLk3b.js} +1 -1
- package/dist/chunks/{remote-env-BiRLWIrh.js → remote-env-BH89NuwC.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-nz1fPY1U.js → remoteBridgeCore-CrXlWEL1.js} +1 -1
- package/dist/chunks/{remoteControlServer-FzLUxh2B.js → remoteControlServer-BSOnq4yY.js} +1 -1
- package/dist/chunks/{rename-DmGuyncE.js → rename-DNGvNQm2.js} +1 -1
- package/dist/chunks/{resume-7GeU7RMS.js → resume-6UL38yL3.js} +2 -2
- package/dist/chunks/{runtimeObserver-Duod-ign.js → runtimeObserver-BhvHeiwD.js} +4 -4
- package/dist/chunks/{runtimeObserver-OgM9ZYxZ.js → runtimeObserver-Cp-DN8fP.js} +1 -1
- package/dist/chunks/sandbox-adapter-DGVtPPD0.js +1 -0
- package/dist/chunks/{sandbox-toggle-Cc96R6Ox.js → sandbox-toggle-D19YbI5G.js} +1 -1
- package/dist/chunks/searchExtraTools-DXWkpOIg.js +1 -0
- package/dist/chunks/{sentry-BUHYuYGj.js → sentry-BZmpC-iI.js} +1 -1
- package/dist/chunks/{session-DgLqm7ZI.js → session-lLpGqp0B.js} +2 -2
- package/dist/chunks/{sessionDiscovery-DgNea6qa.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-CuWMVPlT.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-DzkMzHer.js → sessionTitle-QxXslbJY.js} +1 -1
- package/dist/chunks/{sessionTracing-DTjmc0EF.js → sessionTracing-DognYcDf.js} +1 -1
- package/dist/chunks/{settingsSync-CfYDkakY.js → settingsSync-DEPET5O1.js} +1 -1
- package/dist/chunks/{setup-BKUG46jQ.js → setup-BUBUidOg.js} +1 -1
- package/dist/chunks/setup-BZMVuIIx.js +2 -0
- package/dist/chunks/{setup-CmLngvpJ.js → setup-C6G0lasE.js} +1 -1
- package/dist/chunks/{shadowedRuleDetection-DesT0yKM.js → shadowedRuleDetection-CQayPrmM.js} +1 -1
- package/dist/chunks/{sideQuestion-BAq0YyKY.js → sideQuestion-B9EE1vTM.js} +1 -1
- package/dist/chunks/sink-BRrEbL6h.js +1 -0
- package/dist/chunks/{sink-B3uP8Cf8.js → sink-Cugto5We.js} +1 -1
- package/dist/chunks/{sinks-COcy5GnB.js → sinks-B9A94oIj.js} +2 -2
- package/dist/chunks/sinks-CKaSBvU8.js +1 -0
- package/dist/chunks/{skill-learning-DOIMPtWE.js → skill-learning-CroDcatu.js} +1 -1
- package/dist/chunks/skillChangeDetector-DnyEQqe6.js +1 -0
- package/dist/chunks/{skillGapStore-DpEoKhn-.js → skillGapStore-91Mb3xDY.js} +2 -2
- package/dist/chunks/{skillGapStore-CWuw1dYh.js → skillGapStore-LKwap3o4.js} +1 -1
- package/dist/chunks/{skillGenerator-9y3Q4YoO.js → skillGenerator-B9GM0LHk.js} +2 -2
- package/dist/chunks/skillLearning-D6latSKi.js +1 -0
- package/dist/chunks/{skillLearning-BhM09bQD.js → skillLearning-DbOOqb6b.js} +1 -1
- package/dist/chunks/{skillPanel-Dt24mZTZ.js → skillPanel-rIIYgnBE.js} +3 -3
- package/dist/chunks/{skillSearchPanel-gaXN64Fu.js → skillSearchPanel-xAL-6uJF.js} +4 -4
- package/dist/chunks/{skills-Dx3dMHYk.js → skills-Doe47wxK.js} +1 -1
- package/dist/chunks/{sprites-5OAB-Ui2.js → sprites-D11F3i1M.js} +1 -1
- package/dist/chunks/{stats-TUExo9iU.js → stats-WNUyieG-.js} +1 -1
- package/dist/chunks/{status-Dghaz1my.js → status-CjBS9SkF.js} +1 -1
- package/dist/chunks/{statusNoticeHelpers-DVZSSXeK.js → statusNoticeHelpers-cnI4TiGw.js} +1 -1
- package/dist/chunks/{tag-ZcVkzFjz.js → tag-Gfb8vTAR.js} +2 -2
- package/dist/chunks/{tasks-DbB33ekt.js → tasks-BwX1rzOD.js} +1 -1
- package/dist/chunks/{teamHelpers-BmN9nKz-.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-CPjJJDL1.js → teammateModeSnapshot-Dyukgtp9.js} +1 -1
- package/dist/chunks/teleport-B4p8XlAv.js +1 -0
- package/dist/chunks/{templateJobs-Db630FZD.js → templateJobs-DQXuFnkl.js} +1 -1
- package/dist/chunks/{terminalSetup-ygKHrVKR.js → terminalSetup-CTEIn08j.js} +1 -1
- package/dist/chunks/{terminalSetup-DJqWE8fc.js → terminalSetup-bSbq4LE7.js} +1 -1
- package/dist/chunks/{theme-MmfFhdTD.js → theme-DazaKPy8.js} +1 -1
- package/dist/chunks/thinkback-BOfZP_QG.js +1 -0
- package/dist/chunks/{thinkback-CrNirB0V.js → thinkback-CxWZV2Oz.js} +1 -1
- package/dist/chunks/{thinkback-play-CQ1s7oqg.js → thinkback-play-CHe1x2Hc.js} +1 -1
- package/dist/chunks/{toolEventObserver-BqMplcIk.js → toolEventObserver-D4h-QqVP.js} +1 -1
- package/dist/chunks/{toolEventObserver-DBq2XBYY.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-DEuQUTbz.js → trustedDevice-CQ9PK-8m.js} +1 -1
- package/dist/chunks/{trustedDevice-C9Zevohz.js → trustedDevice-rdvUkS1W.js} +1 -1
- package/dist/chunks/{ultrareviewCommand-DrlfRrXq.js → ultrareviewCommand-Zf9hO4wr.js} +2 -2
- package/dist/chunks/{undercover-DKn95mh9.js → undercover-DLyKv5TE.js} +1 -1
- package/dist/chunks/undercover-DNS9V_JT.js +1 -0
- package/dist/chunks/{updateCCB-CJ7dCUan.js → updateCCB-7WQRz9lW.js} +4 -4
- package/dist/chunks/{upgrade-Degqbu8S.js → upgrade-ByIumMQe.js} +1 -1
- package/dist/chunks/upgrade-bK4x32Ma.js +1 -0
- package/dist/chunks/{upload-pTZQCPLt.js → upload-CvOMbA9_.js} +1 -1
- package/dist/chunks/{usage-D96a7Cke.js → usage-C_d-Z-eb.js} +1 -1
- package/dist/chunks/{usage-DVQMUMcC.js → usage-DE4PSQiF.js} +1 -1
- package/dist/chunks/useMainLoopModel-Os8Ao8-x.js +1 -0
- package/dist/chunks/{useManagePlugins-BfGzHMvO.js → useManagePlugins-BYBubfHU.js} +1 -1
- package/dist/chunks/{useMergedTools-TemEvCrX.js → useMergedTools-BJAn2i-F.js} +1 -1
- package/dist/chunks/{useSearchInput-B-V4kIa-.js → useSearchInput-CF77X2OV.js} +1 -1
- package/dist/chunks/useSettingsErrors-DD7fQ-fU.js +1 -0
- package/dist/chunks/{useVoice-BuwYDm2U.js → useVoice-DwzMN0fq.js} +1 -1
- package/dist/chunks/{util-CeIKZmj9.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-DUZQCWUP.js → vim-zc9EiMil.js} +1 -1
- package/dist/chunks/{voice-BkRIHZiM.js → voice-BRhZt4jW.js} +2 -2
- package/dist/chunks/{voiceModeEnabled-CPQUE3PU.js → voiceModeEnabled-168-1Ocs.js} +1 -1
- package/dist/chunks/voiceModeEnabled-CTT25yFj.js +1 -0
- package/dist/chunks/{voiceStreamSTT-Dr_wH1Kh.js → voiceStreamSTT-B80UegKG.js} +1 -1
- package/dist/chunks/voiceStreamSTT-BpYhKo2H.js +1 -0
- package/dist/chunks/{workerRegistry-CT7_kjvY.js → workerRegistry-s8nnpmUO.js} +1 -1
- package/dist/chunks/worktree-CkB4jLXK.js +1 -0
- package/dist/chunks/{xml-DD_ldd3X.js → xml-DTMvLcPg.js} +1 -1
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/ApproveApiKey-SIUwkD8j.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-DXJdube9.js +0 -2
- package/dist/chunks/BypassPermissionsModeDialog-BOSW4Zdy.js +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-B8oAAHSI.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-DYhmGSkx.js +0 -1
- package/dist/chunks/DevChannelsDialog-DXRgY00D.js +0 -1
- package/dist/chunks/DiffDialog-PvNZfZby.js +0 -3
- package/dist/chunks/Doctor--B1HUENo.js +0 -1
- package/dist/chunks/Doctor-CE_jL9jC.js +0 -3
- package/dist/chunks/Feedback-B5rPGl_C.js +0 -2
- package/dist/chunks/Grove-C2YjB3zL.js +0 -1
- package/dist/chunks/MCPConnectionManager-CDsa79pu.js +0 -1
- package/dist/chunks/MessageSelector-CkeGQPNM.js +0 -3
- package/dist/chunks/Messages-PfbzLYOU.js +0 -11
- package/dist/chunks/PluginSettings-B2ASJ0Rx.js +0 -17
- package/dist/chunks/QueryEngine-Av0G5fze.js +0 -1
- package/dist/chunks/REPL-DCwqua0C.js +0 -1
- package/dist/chunks/REPL-Dh8vzGmF.js +0 -97
- package/dist/chunks/ResumeConversation-B3WuB8rs.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-D70C-cmA.js +0 -1
- package/dist/chunks/SentryErrorBoundary-oJUBarGg.js +0 -1
- package/dist/chunks/Settings-CreAhCsb.js +0 -2
- package/dist/chunks/TeleportRepoMismatchDialog-DqWQX6j8.js +0 -1
- package/dist/chunks/TrustDialog-CIzAlGn9.js +0 -1
- package/dist/chunks/WindowsTerminalBackend-C5SeTXqC.js +0 -2
- package/dist/chunks/api-Dz_3z1kl.js +0 -1
- package/dist/chunks/assistant-zVegFdAO.js +0 -1
- package/dist/chunks/auth-D4isgfuK.js +0 -1
- package/dist/chunks/backgroundHousekeeping-CYnAG60-.js +0 -17
- package/dist/chunks/backgroundHousekeeping-DUmxC6h0.js +0 -1
- package/dist/chunks/bridgeConfig-CNbOKpAg.js +0 -1
- package/dist/chunks/bridgeEnabled-BUJTCUHY.js +0 -1
- package/dist/chunks/bridgeMain-BimZwc2P.js +0 -68
- package/dist/chunks/bridgeMain-DYL4fl6A.js +0 -1
- package/dist/chunks/caches-CTfNpKhW.js +0 -1
- package/dist/chunks/changeDetector-Y9KV5LgG.js +0 -1
- package/dist/chunks/channelNotification-CC7Xb06W.js +0 -1
- package/dist/chunks/clear-OUVFUt8Z.js +0 -1
- package/dist/chunks/client-B47ZvTMo.js +0 -1
- package/dist/chunks/commands-FJGWgQsa.js +0 -1
- package/dist/chunks/commitAttribution-DSv9FggK.js +0 -1
- package/dist/chunks/context-noninteractive-Bd2HO-vU.js +0 -1
- package/dist/chunks/conversation-BP0phkOY.js +0 -1
- package/dist/chunks/conversation-Ci8O_eZ-.js +0 -1
- package/dist/chunks/createSession-B9MhWusY.js +0 -1
- package/dist/chunks/cronJitterConfig-BzPaa52I.js +0 -6
- package/dist/chunks/crossProjectResume-tWsqBUHc.js +0 -40
- package/dist/chunks/datadog-DJowkWhh.js +0 -1
- package/dist/chunks/envLessBridgeConfig-CixkwbRF.js +0 -1
- package/dist/chunks/extra-usage-DGHEQOrY.js +0 -1
- package/dist/chunks/extractMemories-jvjCvtpC.js +0 -1
- package/dist/chunks/fast-Bbtx_Bs1.js +0 -1
- package/dist/chunks/gates-DSI3vpwO.js +0 -1
- package/dist/chunks/hooks-BLLL4iPv.js +0 -1
- package/dist/chunks/inboundAttachments-D-p91z3w.js +0 -1
- package/dist/chunks/initReplBridge-BiHXpDEY.js +0 -1
- package/dist/chunks/language-B_-BfBT4.js +0 -1
- package/dist/chunks/launchAutofixPr-D2qac07g.js +0 -2
- package/dist/chunks/loadAgentsDir-vB1QEZ7H.js +0 -1
- package/dist/chunks/localSearch-DtVqtfvk.js +0 -1
- package/dist/chunks/login-D-N78G6r.js +0 -1
- package/dist/chunks/logout-CFggVS-9.js +0 -1
- package/dist/chunks/mcp-CAYGNxCb.js +0 -1
- package/dist/chunks/mcp-COQap0SM.js +0 -6
- package/dist/chunks/mcp-DlM0OC6R.js +0 -2
- package/dist/chunks/model-DdbcxKub.js +0 -1
- package/dist/chunks/permissions-BLzPHh_3.js +0 -3
- package/dist/chunks/pluginStartupCheck-Cu2ezD51.js +0 -1
- package/dist/chunks/plugins-BgOP_8TX.js +0 -4
- package/dist/chunks/policyLimits-CKy_gTEt.js +0 -1
- package/dist/chunks/poorMode-DJvjO2nW.js +0 -1
- package/dist/chunks/processBashCommand-D5dC6Mya.js +0 -1
- package/dist/chunks/prompt-CQC-mh6u.js +0 -1
- package/dist/chunks/prompt-DawxLANl.js +0 -1
- package/dist/chunks/rcDebugLog-BbPkkigY.js +0 -11
- package/dist/chunks/sandbox-adapter-CxkhKgaa.js +0 -1
- package/dist/chunks/searchExtraTools-DQ6e601b.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-7Svz-7S-.js +0 -1
- package/dist/chunks/sessionMemory-DIrR3zvb.js +0 -1
- package/dist/chunks/sessionMemory-_dmj8lcH.js +0 -1
- package/dist/chunks/sessionMemoryUtils-BdQtSkRx.js +0 -1
- package/dist/chunks/sessionObserver-_adufOGQ.js +0 -1
- package/dist/chunks/sessionStorage-W7okgAlQ.js +0 -1
- package/dist/chunks/setup-TqJ7-Nxh.js +0 -2
- package/dist/chunks/sink-CaWMZBw_.js +0 -1
- package/dist/chunks/sinks-oFfsKySL.js +0 -1
- package/dist/chunks/skillChangeDetector-CA_Tdx8N.js +0 -1
- package/dist/chunks/skillLearning-_o2D06yM.js +0 -1
- package/dist/chunks/teamHelpers-yeTNtZbb.js +0 -1
- package/dist/chunks/teammateModeSnapshot-CsNIJTKi.js +0 -1
- package/dist/chunks/teleport-JHgpwZIh.js +0 -1
- package/dist/chunks/thinkback-Quc7KPmi.js +0 -1
- package/dist/chunks/toolPool-BkCtTKXz.js +0 -1
- package/dist/chunks/toolPool-C7bOwJfR.js +0 -1
- package/dist/chunks/undercover-CBeHiWUd.js +0 -1
- package/dist/chunks/upgrade-ucJ-lnlY.js +0 -1
- package/dist/chunks/useMainLoopModel-B7ch2o9K.js +0 -1
- package/dist/chunks/useSettingsErrors-B2JGz1s8.js +0 -1
- package/dist/chunks/utils-CwhszpkT.js +0 -1
- package/dist/chunks/validatePlugin-BlVho93x.js +0 -1
- package/dist/chunks/voiceModeEnabled-DB8GCzAF.js +0 -1
- package/dist/chunks/voiceStreamSTT-DgoDscHn.js +0 -1
- package/dist/chunks/worktree-DU3xtwKW.js +0 -1
|
@@ -1,11 +0,0 @@
|
|
|
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-Q2255dD7.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{$g as Pe,$o as Fe,Ah as Ie,Ao as Le,Bo as Re,Cu as ze,Dh as Be,ED as Ve,Es as He,Fg as Ue,Fu as We,Fx as Ge,Go as Ke,Gw as qe,Gx as Je,Hg as Ye,Hw as Xe,Io as Ze,Iu as Qe,Ix as $e,Jo as et,Jw as tt,Kw as nt,Ky as rt,Lo as it,Lu as at,Lw as ot,MS as st,Mo as ct,Ms as lt,Mu as ut,Nu as dt,Oh as ft,Oo as pt,Pg as mt,Pu as ht,Qb as gt,Qg as _t,Rx as vt,So as yt,TD as bt,Vg as xt,Ww as St,Xa as Ct,Xb as wt,Xw as Tt,Ya as Et,Yo as Dt,ZA as Ot,Za as kt,Zw as At,bv as jt,fx as Mt,hk as Nt,iA as Pt,io as Ft,jS as It,jh as Lt,jo as Rt,kh as zt,ko as Bt,lo as Vt,lw as Ht,nx as Ut,px as Wt,qA as Gt,qw as Kt,qx as qt,ro as Jt,sw as Yt,sx as Xt,tA as Zt,vk as Qt,xk as $t,xo as en,xv as tn,yk as nn}from"./loadAgentsDir-Ci5mr0vm.js";import{Vn as rn,zn as an}from"./prompt-DEPUnJdB.js";import{f as on,p as sn}from"./xml-DD_ldd3X.js";import{C as cn,y as ln}from"./rcDebugLog-BbPkkigY.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-DJqWE8fc.js";import{a as _n,o as vn,r as yn,s as bn,t as xn}from"./referral-ByevBJrE.js";import{n as Sn,t as Cn}from"./SentryErrorBoundary-B6EWoJml.js";import{a as wn,n as Tn}from"./voiceModeEnabled-CPQUE3PU.js";import{c as En,r as Dn}from"./releaseNotes-CwKpIsyd.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-SAulcC5x.js";import{n as Rn,t as zn}from"./systemTheme-dDbitcxB.js";import{n as Bn,r as Vn}from"./PromptInputFooterSuggestions-D4lMVCqj.js";import{n as Hn,t as Un}from"./useMainLoopModel-B7ch2o9K.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-Q5g2YjQw.js";import{n as Zn,r as Qn,t as $n}from"./statusNoticeHelpers-DVZSSXeK.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`)||yt(t.text,`status`)!==`completed`?!1:yt(t.text,`summary`)?.startsWith(`Background command `)??!1}function or(e,t){if(!qt()||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(),ze(),Je(),it()}));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((()=>{it(),Cr=`</system-reminder>`,wr=new Set([Ct,kt]),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 Gr(e,t,n){return Array.from({length:n},()=>({pose:e,offset:t}))}function Kr(){let{pose:e,bounceOffset:t,onClick:n}=qr();return(0,Yr.jsx)(x,{height:ti,flexDirection:`column`,onClick:n,children:(0,Yr.jsx)(x,{marginTop:t,flexShrink:0,children:(0,Yr.jsx)(Dr,{pose:e})})})}function qr(){let[e]=(0,Jr.useState)(()=>re().prefersReducedMotion??!1),[t,n]=(0,Jr.useState)(-1),r=(0,Jr.useRef)(Xr),i=()=>{e||t!==-1||(r.current=Zr[Math.floor(Math.random()*Zr.length)],n(0))};(0,Jr.useEffect)(()=>{if(t===-1)return;if(t>=r.current.length){n(-1);return}let e=setTimeout(n,$r,ei);return()=>clearTimeout(e)},[t]);let a=r.current,o=t>=0&&t<a.length?a[t]:Qr;return{pose:o.pose,bounceOffset:o.offset,onClick:i}}var Jr,Yr,Xr,Zr,Qr,$r,ei,ti,ni=t((()=>{h(),Jr=n(h(),1),y(),ue(),jr(),Yr=C(),Xr=[...Gr(`default`,1,2),...Gr(`arms-up`,0,3),...Gr(`default`,0,1),...Gr(`default`,1,2),...Gr(`arms-up`,0,3),...Gr(`default`,0,1)],Zr=[Xr,[...Gr(`look-right`,0,5),...Gr(`look-left`,0,5),...Gr(`default`,0,1)]],Qr={pose:`default`,offset:0},$r=60,ei=e=>e+1,ti=3}));function ri(){let e=vn();e==null||e<=0||e>(P().passesLastSeenRemaining??0)&&j(t=>({...t,passesUpsellSeenCount:0,hasVisitedPasses:!1,passesLastSeenRemaining:e}))}function ii(){let{eligible:e,hasCache:t}=xn();if(!e||!t)return!1;ri();let n=P();return!((n.passesUpsellSeenCount??0)>=3||n.hasVisitedPasses)}function ai(){let[e]=(0,ci.useState)(()=>ii());return e}function oi(){let e=0;j(t=>(e=(t.passesUpsellSeenCount??0)+1,{...t,passesUpsellSeenCount:e})),z(`tengu_guest_passes_upsell_shown`,{seen_count:e})}function si(){let e=_n();return(0,li.jsxs)(_,{dimColor:!0,children:[(0,li.jsx)(_,{color:`claude`,children:`[✻]`}),` `,(0,li.jsx)(_,{color:`claude`,children:`[✻]`}),` `,(0,li.jsx)(_,{color:`claude`,children:`[✻]`}),` ·`,` `,e?`Share Claude Code and earn ${yn(e)} of extra usage · /passes`:`3 guest passes at /passes`]})}var ci,li,ui=t((()=>{h(),ci=n(h(),1),y(),_e(),bn(),D(),li=C()}));function di(){let{columns:e}=u(),t=st(e=>e.agent),n=st(e=>e.effortValue),r=Hn(),i=oe(r),{version:a,cwd:o,billingType:s,agentName:c}=Pn(),d=t??c,f=ai(),p=Yn();(0,fi.useEffect)(()=>{f&&oi()},[f]),(0,fi.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+Gt(r,n),s,m),b=d?m-1-l(d)-3:m,S=An(o,Math.max(b,10));return(0,U.jsx)(Ie,{children:(0,U.jsxs)(x,{flexDirection:`row`,gap:2,alignItems:`center`,children:[qt()?(0,U.jsx)(Kr,{}):(0,U.jsx)(Dr,{}),(0,U.jsxs)(x,{flexDirection:`column`,children:[(0,U.jsxs)(_,{children:[(0,U.jsx)(_,{bold:!0,children:`Claude Code`}),` `,(0,U.jsxs)(_,{dimColor:!0,children:[`v`,h]})]}),g?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(_,{dimColor:!0,children:v}),(0,U.jsx)(_,{dimColor:!0,children:y})]}):(0,U.jsxs)(_,{dimColor:!0,children:[v,` · `,y]}),(0,U.jsx)(_,{dimColor:!0,children:d?`@${d} · ${S}`:S}),f&&(0,U.jsx)(si,{}),!f&&p&&(0,U.jsx)(Xn,{maxWidth:m,twoLine:!0})]})]})})}var fi,U,pi=t((()=>{fi=n(h(),1),Un(),ot(),y(),It(),Ot(),je(),Je(),Ln(),N(),Lt(),ni(),jr(),ui(),Kn(),U=C()}));function mi(){let e=(0,gi.useMemo)(hi,[]),t=(0,gi.useMemo)(()=>P().lastShownEmergencyTip,[]),n=e.tip&&e.tip!==t;return(0,gi.useEffect)(()=>{n&&j(t=>t.lastShownEmergencyTip===e.tip?t:{...t,lastShownEmergencyTip:e.tip})},[n,e.tip]),n?(0,_i.jsx)(x,{paddingLeft:2,flexDirection:`column`,children:(0,_i.jsx)(_,{...e.color===`warning`?{color:`warning`}:e.color===`error`?{color:`error`}:{dimColor:!0},children:e.tip})}):null}function hi(){return L(vi,yi)}var gi,_i,vi,yi,bi=t((()=>{h(),gi=n(h(),1),y(),ae(),D(),_i=C(),vi=`tengu-top-of-feed-tip`,yi={tip:``,color:`dim`}}));function xi({char:e=`✻`}){let[t]=(0,Si.useState)(()=>re().prefersReducedMotion??!1),[n,r]=(0,Si.useState)(t),i=(0,Si.useRef)(null),[a,o]=c(n?null:50);return(0,Si.useEffect)(()=>{if(n)return;let e=setTimeout(r,Ti,!0);return()=>clearTimeout(e)},[n]),n?(0,Ci.jsx)(x,{ref:a,children:(0,Ci.jsx)(_,{color:Ei,children:e})}):(i.current===null&&(i.current=o),(0,Ci.jsx)(x,{ref:a,children:(0,Ci.jsx)(_,{color:vt(Ge((o-i.current)/wi*360%360)),children:e})}))}var Si,Ci,wi,Ti,Ei,Di=t((()=>{h(),Si=n(h(),1),O(),y(),ue(),$e(),Ci=C(),wi=1500,Ti=wi*2,Ei=vt({r:153,g:153,b:153})}));function Oi(){return A()&&(P().opus1mMergeNoticeSeenCount??0)<Mi}function ki(){let[e]=(0,Ai.useState)(Oi);return(0,Ai.useEffect)(()=>{if(!e)return;let t=(P().opus1mMergeNoticeSeenCount??0)+1;j(e=>(e.opus1mMergeNoticeSeenCount??0)>=t?e:{...e,opus1mMergeNoticeSeenCount:t})},[e]),e?(0,ji.jsxs)(x,{paddingLeft:2,children:[(0,ji.jsx)(xi,{char:`↑`}),(0,ji.jsx)(_,{dimColor:!0,children:` Opus now defaults to 1M context · 5x more room, same pricing`})]}):null}var Ai,ji,Mi,Ni=t((()=>{h(),Ai=n(h(),1),O(),y(),D(),N(),Di(),ji=C(),Mi=6}));function Pi(){return(0,Li.jsx)(Fi,{})}function Fi(){let[e]=(0,Ii.useState)(()=>wn()&&re().voiceEnabled!==!0&&(P().voiceNoticeSeenCount??0)<Ri&&!Oi());return(0,Ii.useEffect)(()=>{if(!e)return;let t=(P().voiceNoticeSeenCount??0)+1;j(e=>(e.voiceNoticeSeenCount??0)>=t?e:{...e,voiceNoticeSeenCount:t})},[e]),e?(0,Li.jsxs)(x,{paddingLeft:2,children:[(0,Li.jsx)(xi,{}),(0,Li.jsx)(_,{dimColor:!0,children:` Voice mode is now available · /voice to enable`})]}):null}var Ii,Li,Ri,zi=t((()=>{h(),Ii=n(h(),1),y(),D(),ue(),Tn(),Di(),Ni(),Li=C(),Ri=3}));function Bi(){return null}var Vi=t((()=>{}));function Hi(){return null}var Ui=t((()=>{})),Wi=r({ChannelsNotice:()=>Gi,findUnmatched:()=>qi});function Gi(){let[{channels:e,list:t,unmatched:n}]=(0,Ji.useState)(()=>{let e=E();return e.length===0?{channels:e,list:``,unmatched:[]}:{channels:e,list:e.map(Ki).join(`, `),unmatched:qi(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,Yi.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,Yi.jsxs)(_,{color:`error`,children:[`Listening for channel messages from: `,t]}),(0,Yi.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,Yi.jsxs)(_,{color:`warning`,children:[Ki(e.entry),` · `,e.why]},`${Ki(e.entry)}:${e.why}`))]})}function Ki(e){return e.kind===`plugin`?`plugin:${e.name}@${e.marketplace}`:`server:${e.name}`}function qi(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(Yt(n).servers))t.add(e);return t})(),r=t?.installedPluginIds??(()=>{let e=new Set(Object.keys(lt().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 Ji,Yi,Xi=t((()=>{h(),Ji=n(h(),1),T(),sn(),y(),Ht(),He(),Yi=C()}));function Zi(){let e=kn(),t=P().oauthAccount?.displayName??``,{columns:n}=u(),r=hn(),i=Zt.isSandboxingEnabled(),o=ai(),s=Yn(),c=st(e=>e.agent),d=st(e=>e.effortValue),f=P(),p;try{p=Mn(3)}catch{p=[]}let[m]=(0,Qi.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,Qi.useEffect)(()=>{P().lastReleaseNotesSeen!==`2.6.0`&&(j(e=>e.lastReleaseNotesSeen===`2.6.0`?e:{...e,lastReleaseNotesSeen:`2.6.0`}),r&&mn())},[f,r]);let g=!h&&!r&&!a(process.env.CLAUDE_CODE_FORCE_FULL_LOGO);(0,Qi.useEffect)(()=>{o&&!r&&!g&&oi()},[o,r,g]),(0,Qi.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+Gt(v,d),ea-20);if(!h&&!r&&!a(process.env.CLAUDE_CODE_FORCE_FULL_LOGO))return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(di,{}),(0,W.jsx)(Pi,{}),(0,W.jsx)(ki,{}),$i&&(0,W.jsx)($i.ChannelsNotice,{}),pe()&&(0,W.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,W.jsx)(_,{color:`warning`,children:`Debug mode enabled`}),(0,W.jsxs)(_,{dimColor:!0,children:[`Logging to: `,he()?`stderr`:me()]})]}),(0,W.jsx)(mi,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,W.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,W.jsxs)(_,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,W.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,W.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&f.oauthAccount?.organizationName&&(0,W.jsxs)(_,{dimColor:!0,children:[`Message from `,f.oauthAccount.organizationName,`:`]}),(0,W.jsx)(_,{children:m})]}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,W.jsx)(x,{paddingLeft:2,flexDirection:`column`,children:(0,W.jsx)(_,{dimColor:!0,children:`Use /issue to report model behavior issues`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,W.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,W.jsx)(_,{color:`warning`,children:`[ANT-ONLY] Logs:`}),(0,W.jsxs)(_,{dimColor:!0,children:[`API calls: `,F(bt())]}),(0,W.jsxs)(_,{dimColor:!0,children:[`Debug logs: `,F(me())]}),ke()&&(0,W.jsxs)(_,{dimColor:!0,children:[`Startup Perf: `,F(Ae())]})]}),process.env.USER_TYPE===`ant`&&(0,W.jsx)(Bi,{}),process.env.USER_TYPE===`ant`&&(0,W.jsx)(Hi,{})]});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,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Ie,{children:(0,W.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,W.jsx)(_,{bold:!0,children:e}),(0,W.jsx)(x,{marginY:1,children:(0,W.jsx)(Dr,{})}),(0,W.jsx)(_,{dimColor:!0,children:E}),(0,W.jsx)(_,{dimColor:!0,children:w}),(0,W.jsx)(_,{dimColor:!0,children:T?`@${T} · ${a}`:a})]})}),(0,W.jsx)(Pi,{}),(0,W.jsx)(ki,{}),$i&&(0,W.jsx)($i.ChannelsNotice,{}),i&&(0,W.jsx)(x,{marginTop:1,flexDirection:`column`,children:(0,W.jsx)(_,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})}),process.env.USER_TYPE===`ant`&&(0,W.jsx)(Bi,{}),process.env.USER_TYPE===`ant`&&(0,W.jsx)(Hi,{})]})}let k=jn(t),ie=!process.env.IS_DEMO&&f.oauthAccount?.organizationName?`${E} · ${w} · ${f.oauthAccount.organizationName}`:`${E} · ${w}`,A=T?ea-1-l(T)-3:ea,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,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Ie,{children:(0,W.jsx)(x,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:te,position:`top`,align:`start`,offset:3},children:(0,W.jsxs)(x,{flexDirection:D===`horizontal`?`row`:`column`,paddingX:1,gap:1,children:[(0,W.jsxs)(x,{flexDirection:`column`,width:ae,justifyContent:`space-between`,alignItems:`center`,minHeight:9,children:[(0,W.jsx)(x,{marginTop:1,children:(0,W.jsx)(_,{bold:!0,children:k})}),(0,W.jsx)(Dr,{}),(0,W.jsxs)(x,{flexDirection:`column`,alignItems:`center`,children:[(0,W.jsx)(_,{dimColor:!0,children:ie}),(0,W.jsx)(_,{dimColor:!0,children:N})]})]}),D===`horizontal`&&(0,W.jsx)(x,{height:`100%`,borderStyle:`single`,borderColor:`claude`,borderDimColor:!0,borderTop:!1,borderBottom:!1,borderLeft:!1}),D===`horizontal`&&(0,W.jsx)(Fr,{feeds:r?[Vr(pn()),zr(e)]:o?[zr(e),Hr()]:s?[zr(e),qn()]:[zr(e),Br(p)],maxWidth:I})]})})}),(0,W.jsx)(Pi,{}),(0,W.jsx)(ki,{}),$i&&(0,W.jsx)($i.ChannelsNotice,{}),pe()&&(0,W.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,W.jsx)(_,{color:`warning`,children:`Debug mode enabled`}),(0,W.jsxs)(_,{dimColor:!0,children:[`Logging to: `,he()?`stderr`:me()]})]}),(0,W.jsx)(mi,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,W.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,W.jsxs)(_,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,W.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,W.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&f.oauthAccount?.organizationName&&(0,W.jsxs)(_,{dimColor:!0,children:[`Message from `,f.oauthAccount.organizationName,`:`]}),(0,W.jsx)(_,{children:m})]}),i&&(0,W.jsx)(x,{paddingLeft:2,flexDirection:`column`,children:(0,W.jsx)(_,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,W.jsx)(x,{paddingLeft:2,flexDirection:`column`,children:(0,W.jsx)(_,{dimColor:!0,children:`Use /issue to report model behavior issues`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,W.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,W.jsx)(_,{color:`warning`,children:`[ANT-ONLY] Logs:`}),(0,W.jsxs)(_,{dimColor:!0,children:[`API calls: `,F(bt())]}),(0,W.jsxs)(_,{dimColor:!0,children:[`Debug logs: `,F(me())]}),ke()&&(0,W.jsxs)(_,{dimColor:!0,children:[`Startup Perf: `,F(Ae())]})]}),process.env.USER_TYPE===`ant`&&(0,W.jsx)(Bi,{}),process.env.USER_TYPE===`ant`&&(0,W.jsx)(Hi,{})]})}var Qi,W,$i,ea,ta=t((()=>{h(),y(),ot(),Ln(),je(),se(),jr(),Rr(),Wr(),D(),zn(),ue(),ge(),Qi=n(h(),1),gn(),pi(),Lt(),En(),Ve(),i(),Oe(),bi(),zi(),Ni(),Vi(),Ui(),W=C(),Pt(),ui(),Kn(),It(),Ot(),Un(),N(),$i=(Xi(),e(Wi)),ea=50}));function na({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,ra.jsx)(x,{minWidth:l(i)+8,children:(0,ra.jsx)(_,{dimColor:!0,children:i})})}var ra,ia=t((()=>{h(),y(),ra=C()}));function aa({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,oa.jsx)(x,{minWidth:l(n),children:(0,oa.jsx)(_,{dimColor:!0,children:n})})}var oa,sa=t((()=>{h(),y(),oa=C()}));function ca(e,t,n,r){for(let i=t+1;i<e.length;i++){let t=e[i];if(t?.type===`assistant`){let e=ha(t.message.content);if(e?.type===`thinking`||e?.type===`redacted_thinking`||e?.type===`tool_use`&&(ht(e.name,e.input,n).isCollapsible||r.has(e.id)))continue;return!0}if(!(t?.type===`system`||t?.type===`attachment`)&&!(t?.type===`user`&&ha(t.message.content)?.type===`tool_result`)){if(t?.type===`grouped_tool_use`){let e=ha(t.messages[0]?.message.content)?.input;if(ht(t.toolName,e,n).isCollapsible)continue}return!0}}return!1}function la({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?[]:Bt(e,h),w=Mo(e,s,o,v||y?Et:Le(e,h),c,h),ee=!1;if(l)if(v)ee=e.messages.some(e=>{let t=ha(e.message.content);return t?.type===`tool_use`&&o.has(t.id)});else if(y)ee=Qe(e,o);else{let t=Rt(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,ma.jsx)(Be,{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,ma.jsx)(Ie,{children:(0,ma.jsxs)(x,{width:p,flexDirection:`column`,children:[(0,ma.jsxs)(x,{flexDirection:`row`,justifyContent:`flex-end`,gap:1,marginTop:1,children:[(0,ma.jsx)(aa,{message:S,isTranscriptMode:_}),(0,ma.jsx)(na,{message:S,isTranscriptMode:_})]}),E]})}):(0,ma.jsx)(Ie,{children:E})}function ua(e,t){if(e.type===`grouped_tool_use`)return e.messages.some(e=>{let n=ha(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return We(e).some(e=>t.has(e));let n=Rt(e);return!!n&&t.has(n)}function da(e,t){if(e.type===`grouped_tool_use`)return e.messages.every(e=>{let n=ha(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return We(e).every(e=>t.has(e));if(e.type===`assistant`){let n=ha(e.message.content);if(n?.type===`server_tool_use`)return t.has(n.id)}let n=Rt(e);return!n||t.has(n)}function fa(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&&ft(t.message))return!1;let n=ua(e.message,e.streamingToolUseIDs),r=da(e.message,e.lookups.resolvedToolUseIDs);return!(n||!r)}var pa,ma,ha,ga,_a=t((()=>{pa=n(h(),1),y(),at(),it(),zt(),ma=C(),ia(),Uo(),sa(),Lt(),ha=e=>{if(!Array.isArray(e))return;let t=e[0];if(!(t==null||typeof t==`string`))return t},ga=pa.memo(la,fa)}));function va(e){return e.type===`attachment`&&ya.has(e.attachment.type)}var ya,ba=t((()=>{ya=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 xa(e){return Oa.filter(t=>t.isActive(e))}var G,Sa,Ca,wa,Ta,Ea,Da,Oa,ka=t((()=>{y(),h(),$t(),o(),ve(),je(),le(),Qn(),gt(),Mt(),G=C(),Sa={id:`large-memory-files`,type:`warning`,isActive:e=>Qt(e.memoryFiles).length>0,render:e=>(0,G.jsx)(G.Fragment,{children:Qt(e.memoryFiles).map(e=>{let t=e.path.startsWith(ye())?tr(ye(),e.path):e.path;return(0,G.jsxs)(x,{flexDirection:`row`,children:[(0,G.jsx)(_,{color:`warning`,children:s.warning}),(0,G.jsxs)(_,{color:`warning`,children:[`Large `,(0,G.jsx)(_,{bold:!0,children:t}),` will impact performance (`,De(e.content.length),` chars > `,De(Nt),`)`,(0,G.jsx)(_,{dimColor:!0,children:` · /memory to edit`})]})]},e.path)})})},Ca={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,G.jsxs)(x,{flexDirection:`row`,marginTop:1,children:[(0,G.jsx)(_,{color:`warning`,children:s.warning}),(0,G.jsxs)(_,{color:`warning`,children:[`Auth conflict: Using `,e.source,` instead of Claude account subscription token. Either unset`,` `,e.source,", or run `claude /logout`."]})]})}},wa={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,G.jsxs)(x,{flexDirection:`row`,marginTop:1,children:[(0,G.jsx)(_,{color:`warning`,children:s.warning}),(0,G.jsxs)(_,{color:`warning`,children:[`Auth conflict: Using `,e,` instead of Anthropic Console key. Either unset `,e,", or run `claude /logout`."]})]})}},Ta={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,G.jsxs)(x,{flexDirection:`column`,marginTop:1,children:[(0,G.jsxs)(x,{flexDirection:`row`,children:[(0,G.jsx)(_,{color:`warning`,children:s.warning}),(0,G.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,G.jsxs)(x,{flexDirection:`column`,marginLeft:3,children:[(0,G.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,G.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.`]})]})]})}},Ea={id:`large-agent-descriptions`,type:`warning`,isActive:e=>Zn(e.agentDefinitions)>$n,render:e=>{let t=Zn(e.agentDefinitions);return(0,G.jsxs)(x,{flexDirection:`row`,children:[(0,G.jsx)(_,{color:`warning`,children:s.warning}),(0,G.jsxs)(_,{color:`warning`,children:[`Large cumulative agent descriptions will impact performance (~`,De(t),` tokens > `,De($n),`)`,(0,G.jsx)(_,{dimColor:!0,children:` · /agents to manage`})]})]})}},Da={id:`jetbrains-plugin-install`,type:`info`,isActive:e=>{if(!Ut()||!(e.config.autoInstallIdeExtension??!0))return!1;let t=wt();return t!==null&&!Wt(t)},render:()=>{let e=Xt(wt());return(0,G.jsxs)(x,{flexDirection:`row`,gap:1,marginLeft:1,children:[(0,G.jsx)(_,{color:`ide`,children:s.arrowUp}),(0,G.jsxs)(_,{children:[`Install the `,(0,G.jsx)(_,{color:`ide`,children:e}),` plugin from the JetBrains Marketplace:`,` `,(0,G.jsx)(_,{bold:!0,children:`https://docs.claude.com/s/claude-code-jetbrains`})]})]})}},Oa=[Sa,Ea,Ca,wa,Ta,Da]}));function Aa({agentDefinitions:e}={}){let t={config:P(),agentDefinitions:e,memoryFiles:(0,Ma.use)(nn())},n=xa(t);return n.length===0?null:(0,Na.jsx)(x,{flexDirection:`column`,paddingLeft:1,children:n.map(e=>(0,Na.jsx)(ja.Fragment,{children:e.render(t)},e.id))})}var ja,Ma,Na,Pa=t((()=>{ja=n(h(),1),Ma=n(h(),1),y(),$t(),D(),ka(),Na=C()}));function Fa(e,t,n){let r=(0,K.useRef)(new Map),i=(0,K.useRef)(0),a=(0,K.useRef)(0),o=(0,K.useRef)({arr:new Float64Array,version:-1,n:-1}),s=(0,K.useRef)(new Map),c=(0,K.useRef)(new Map),l=(0,K.useRef)(n),u=(0,K.useRef)(!1),d=(0,K.useRef)(null),f=(0,K.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,K.useRef)(0),h=(0,K.useRef)(null);(0,K.useSyncExternalStore)((0,K.useCallback)(t=>e.current?.subscribe(t)??Ua,[e]),()=>{let t=e.current;if(!t)return NaN;let n=t.getScrollTop()+t.getPendingDelta(),r=Math.floor(n/za);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,K.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])??Ia);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-Ra),w=b;else{if(y){let e=v+La;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-La;{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*La,y=Math.min(b,C+Va),S=0;for(w=C;w<y&&(S<h||x[w]<f+v+La);)S+=r.current.get(t[w])??Ba,w++}let e=v+2*La,n=Math.max(0,w-Va),i=0;for(let e=C;e<w;e++)i+=r.current.get(t[e])??Ba;for(;C>n&&i<e;)C--,i+=r.current.get(t[C])??Ba;let o=d.current,c=Math.abs(g-a.current)+Math.abs(_);if(o&&c>v*2){let[e,t]=o;C<e-Ha&&(C=e-Ha),w>t+Ha&&(w=t+Ha),C>w&&(w=Math.min(C+Ha,b))}a.current=g}f.current>0?f.current--:d.current=[C,w];let ee=(0,K.useDeferredValue)(C),T=(0,K.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>Va){let e=(x[E]+x[D])/2;g-m.current<e?D=E+Va:E=D-Va}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,K.useLayoutEffect)(()=>{y?e.current?.setClampBounds(void 0,void 0):e.current?.setClampBounds(ne,k)}),(0,K.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,K.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,K.useCallback)(e=>{let n=s.current.get(t[e])?.yogaNode;return!n||n.getComputedWidth()===0?-1:n.getComputedTop()},[t]),A=(0,K.useCallback)(e=>s.current.get(t[e])??null,[t]),j=(0,K.useCallback)(e=>r.current.get(t[e]),[t]),M=(0,K.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 K,Ia,La,Ra,za,Ba,Va,Ha,Ua,Wa=t((()=>{K=n(h(),1),Ia=3,La=40,Ra=30,za=La>>1,Ba=1,Va=200,Ha=25,Ua=()=>{}}));function Ga({children:e}){let[t,n]=(0,q.useState)(null),[r,i]=(0,q.useState)(null);return(0,Xa.jsx)(Qa.Provider,{value:n,children:(0,Xa.jsx)(eo.Provider,{value:i,children:(0,Xa.jsx)(Za.Provider,{value:t,children:(0,Xa.jsx)($a.Provider,{value:r,children:e})})})})}function Ka(){return(0,q.useContext)(Za)}function qa(){return(0,q.useContext)($a)}function Ja(e){let t=(0,q.useContext)(Qa);(0,q.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}function Ya(e){let t=(0,q.useContext)(eo);(0,q.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}var q,Xa,Za,Qa,$a,eo,to=t((()=>{q=n(h(),1),Xa=C(),Za=(0,q.createContext)(null),Qa=(0,q.createContext)(null),$a=(0,q.createContext)(null),eo=(0,q.createContext)(null)}));function no(e){let[t,n]=(0,J.useState)(null),r=(0,J.useRef)(e);r.current=e;let i=(0,J.useRef)(null),a=(0,J.useCallback)(()=>{n(null)},[]),o=(0,J.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,J.useCallback)(e=>{e&&e.scrollToBottom()},[]);return(0,J.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,J.useCallback)((e,t)=>{n(t=>t===null?null:t+e),i.current!==null&&(i.current+=t)},[])}}function ro(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`&&!io(t))continue;let a=t.type===`assistant`;a&&!r&&n++,r=a}return n}function io(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 ao(e,t){if(t===null)return;let n=t;for(;n<e.length&&(e[n]?.type===`progress`||va(e[n]));)n++;let r=e[n]?.uuid;if(!r)return;let i=ro(e,t);return{firstUnseenUuid:r,count:Math.max(1,i)}}function oo({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,J.useState)(null),b=(0,J.useMemo)(()=>({setStickyPrompt:y}),[]),S=(0,J.useSyncExternalStore)((0,J.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,J.useLayoutEffect)(()=>{if(!qt())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}},[]),qt()){let s=l?null:v,u=s!=null&&s!==`clicked`&&n==null?s:null,m=s!=null&&n==null;return(0,Y.jsxs)(Ga,{children:[(0,Y.jsx)(x,{flexDirection:`row`,flexGrow:1,overflow:`hidden`,width:`100%`,children:(0,Y.jsxs)(x,{flexDirection:`column`,flexGrow:1,width:h,overflow:`hidden`,children:[(0,Y.jsxs)(x,{flexGrow:1,flexDirection:`column`,overflow:`hidden`,children:[u&&(0,Y.jsx)(co,{text:u.text,onClick:u.scrollTo}),(0,Y.jsxs)(g,{ref:o,flexGrow:1,flexDirection:`column`,paddingTop:+!m,stickyScroll:!0,children:[(0,Y.jsx)(po,{value:b,children:e}),n]}),!c&&S&&n==null&&(0,Y.jsx)(so,{count:d,onClick:f}),r!=null&&(0,Y.jsx)(x,{position:`absolute`,bottom:0,right:0,opaque:!0,children:r})]}),(0,Y.jsxs)(x,{flexDirection:`column`,flexShrink:0,width:`100%`,maxHeight:`50%`,children:[(0,Y.jsx)(lo,{}),(0,Y.jsx)(uo,{}),(0,Y.jsx)(x,{flexDirection:`column`,width:`100%`,flexGrow:1,overflowY:`hidden`,children:t})]})]})}),i!=null&&(0,Y.jsx)(Gn,{value:{rows:p-fo-1,columns:h-4,scrollRef:a??null},children:(0,Y.jsxs)(x,{position:`absolute`,bottom:0,left:0,right:0,maxHeight:p-fo,flexDirection:`column`,overflow:`hidden`,opaque:!0,children:[(0,Y.jsx)(x,{flexShrink:0,children:(0,Y.jsx)(_,{color:`permission`,children:`▔`.repeat(h)})}),(0,Y.jsx)(x,{flexDirection:`column`,paddingX:2,flexShrink:0,overflow:`hidden`,children:i})]})})]})}return(0,Y.jsxs)(Y.Fragment,{children:[e,t,n,i]})}function so({count:e,onClick:t}){let[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(x,{position:`absolute`,bottom:0,left:0,right:0,justifyContent:`center`,children:(0,Y.jsx)(x,{onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,Y.jsxs)(_,{backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,dimColor:!0,children:[` `,e>0?`${e} new ${M(e,`message`)}`:`Jump to bottom`,` `,s.arrowDown,` `]})})})}function co({text:e,onClick:t}){let[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(x,{flexShrink:0,width:`100%`,height:1,paddingRight:1,backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,Y.jsxs)(_,{color:`subtle`,wrap:`truncate-end`,children:[s.pointer,` `,e]})})}function lo(){let e=Ka();return!e||e.suggestions.length===0?null:(0,Y.jsx)(x,{position:`absolute`,bottom:`100%`,left:0,right:0,paddingX:2,paddingTop:1,flexDirection:`column`,opaque:!0,children:(0,Y.jsx)(Bn,{suggestions:e.suggestions,selectedSuggestion:e.selectedSuggestion,maxColumnWidth:e.maxColumnWidth,overlay:!0})})}function uo(){let e=qa();return e?(0,Y.jsx)(x,{position:`absolute`,bottom:`100%`,left:0,right:0,opaque:!0,children:e}):null}var J,Y,fo,po,mo=t((()=>{o(),J=n(h(),1),Wn(),to(),ot(),y(),fn(),Je(),ce(),ba(),Vn(),Y=C(),fo=2,po=(0,J.createContext)({setStickyPrompt:()=>{}})}));function ho(e){let t=So.get(e);if(t!==void 0)return t;let n=yr(e);return So.set(e,n),n}function go(e){let t=wo.get(e);if(t!==void 0)return t;let n=_o(e);return wo.set(e,n),n}function _o(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=Kt(t);return n.startsWith(`<`)||n===``?null:n}function vo({itemKey:e,msg:t,idx:n,measureRef:r,expanded:i,hovered:a,clickable:o,onClickK:s,onEnterK:c,onLeaveK:l,renderItem:u}){return(0,Z.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,Z.jsx)(S.Provider,{value:a&&!i?`text`:void 0,children:u(t,n)})})}function yo({messages:e,scrollRef:t,columns:n,itemKey:r,renderItem:i,onItemClick:a,isItemClickable:o,isItemExpanded:s,extractSearchText:c=ho,trackStickyPrompt:l,selectedIndex:u,cursorNavRef:d,setCursor:f,jumpRef:p,onSearchMatchesChange:m,scanElement:h,setPositions:g}){let _=(0,X.useRef)([]),v=(0,X.useRef)(e),y=(0,X.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}=Fa(t,b,n),[k,re]=S,ie=(0,X.useCallback)(t=>te(t)===0?!1:nt(e[t]),[te,e]);(0,X.useImperativeHandle)(d,()=>{let n=e=>f?.({uuid:e.uuid,msgType:e.type,expanded:!1,toolName:tt(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,X.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,X.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,X.useRef)(null),M=(0,X.useRef)({msgIdx:-1,positions:[]}),N=(0,X.useRef)(-1),ae=(0,X.useRef)(0),P=(0,X.useRef)(0),oe=(0,X.useRef)(()=>{}),F=(0,X.useRef)(()=>{}),I=(0,X.useRef)({matches:[],ptr:0,screenOrd:0,prefixSum:[]}),se=(0,X.useRef)(-1),L=(0,X.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,X.useState)(0),fe=(0,X.useCallback)(()=>de(e=>e+1),[]);(0,X.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,X.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,X.useState)(null),_e=(0,X.useRef)({onItemClick:a,setHoveredKey:ge});_e.current={onItemClick:a,setHoveredKey:ge};let z=(0,X.useCallback)((e,t)=>{let n=_e.current;!t&&n.onItemClick&&n.onItemClick(e)},[]),ve=(0,X.useCallback)(e=>{_e.current.setHoveredKey(e)},[]),ye=(0,X.useCallback)(e=>{_e.current.setHoveredKey(t=>t===e?null:t)},[]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.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,Z.jsx)(vo,{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,Z.jsx)(x,{height:w,flexShrink:0}),l&&(0,Z.jsx)(bo,{messages:e,start:k,end:re,offsets:E,getItemTop:D,getItemElement:O,scrollRef:t})]})}function bo({messages:e,start:t,end:n,offsets:r,getItemTop:i,getItemElement:a,scrollRef:o}){let{setStickyPrompt:s}=(0,X.useContext)(po);(0,X.useSyncExternalStore)((0,X.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=go(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,X.useRef)({idx:-1,tries:0}),_=(0,X.useRef)(`none`),v=(0,X.useRef)(-1);return(0,X.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,X.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 X,Z,xo,So,Co,wo,To,Eo=t((()=>{h(),X=n(h(),1),Wa(),y(),rt(),mo(),Z=C(),ge(),Ne(),Er(),qe(),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`?Rt(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=Rt(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(),ot(),y(),Tt(),rn(),_t(),sr(),ur(),at(),pr(),D(),i(),Je(),vr(),it(),ce(),Er(),ta(),Ye(),_a(),qe(),Ue(),ba(),Lt(),Pa(),$=C(),Eo(),Po=No.memo(function({agentDefinitions:e}){return(0,$.jsx)(Ie,{children:(0,$.jsxs)(x,{flexDirection:`column`,gap:1,children:[(0,$.jsx)(Zi,{}),(0,$.jsx)(No.Suspense,{fallback:null,children:(0,$.jsx)(Aa,{agentDefinitions:e})})]})})}),Fo=(ln(),e(cn)),Io=(ie(),e(de)).BRIEF_TOOL_NAME,Lo=(jt(),e(tn)).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=At(`transcript:toggleShowAll`,`Transcript`,`Ctrl+E`),L=(0,Q.useMemo)(()=>Ke(e).filter(Re),[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)(()=>ct(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=Vt({content:[e.contentBlock]});return t.uuid=en(e.contentBlock.id,0),Ke([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=et((r||qt()?L:pt(L,{includeSnipped:!0})).filter(e=>e.type!==`progress`&&!va(e)&&Dt(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(ut(c,t))),r),u=Ft(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=Jt(L,o),z.current={key:u,lookups:f,normalizedCount:L.length,messageCount:o.length,lastAssistantMsgId:d})}else f=Jt(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&&Pe(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(),Ie=(0,Q.useRef)(null),Le=P().terminalProgressBarEnabled&&!ee()&&!(Fo?.isProactiveActive()??!1);(0,Q.useEffect)(()=>{let e=Le?Me?`indeterminate`:`completed`:null;Ie.current!==e&&(Ie.current=e,Ne(e))},[Ne,Le,Me]),(0,Q.useEffect)(()=>()=>Ne(null),[Ne]);let ze=(0,Q.useCallback)(e=>`${e.uuid}-${l}`,[l]),Be=(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||ca(B,i,t,Se)),l=B.length-1-i>0,u=ze(e),d=(0,$.jsx)(ga,{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)(St.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},Ve=(0,Q.useRef)(new WeakMap),He=(0,Q.useCallback)(e=>{let n=Ve.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 Ve.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)(Xe.Provider,{value:!0,children:(0,$.jsx)(yo,{messages:B,scrollRef:O,columns:I,itemKey:ze,renderItem:Be,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:He})}):B.flatMap(Be),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)(xt,{children:T})})]})}),ce&&w&&!E&&(0,$.jsx)(x,{marginTop:1,children:(0,$.jsx)(mt,{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{mo as a,Ja as c,ao as i,Ya as l,Uo as n,no as o,oo as r,to as s,Ho as t};
|
|
@@ -1,17 +0,0 @@
|
|
|
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-Q2255dD7.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{$k as we,$s as Te,As as Ee,Aw as De,Cw as R,Cx as Oe,DA as ke,Dw as Ae,Dx as je,Es as Me,Ew as Ne,Fs as Pe,Gs as Fe,HC as Ie,Hs as Le,JS as z,KC as Re,Lw as ze,MS as Be,Ms as Ve,Mw as He,NA as Ue,Nw as We,Nx as Ge,Ow as Ke,PA as qe,PS as Je,Pw as Ye,Px as Xe,RC as Ze,Rs as Qe,SC as $e,Sw as et,VC as tt,Vs as nt,WC as rt,XC as it,Xk as at,Xs as ot,YS as st,Ys as ct,ac as lt,cy as ut,eA as dt,ec as ft,fs as pt,gC as mt,gx as ht,gy as gt,ic as _t,ih as vt,jS as yt,jw as bt,ks as xt,kw as St,lc as Ct,lw as wt,my as Tt,nc as Et,ow as Dt,ps as Ot,qC as kt,qs as At,rc as jt,rh as Mt,sc as Nt,tc as Pt,uc as Ft,vs as It,wC as Lt,xC as Rt,ys as zt}from"./loadAgentsDir-Ci5mr0vm.js";import{i as Bt,o as Vt,p as Ht,u as Ut}from"./xml-DD_ldd3X.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-ByevBJrE.js";import{n as Yt,t as Xt}from"./pluginStartupCheck-Bjdc8zhz.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-B0rLuSvo.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-BlVho93x.js";import{a as pn,n as mn,o as hn,r as gn}from"./pluginFlagging-CJ1--2Kw.js";import{i as _n,n as vn,r as yn}from"./MCPConnectionManager-CDsa79pu.js";import{t as bn}from"./SearchBox-DfOmUoaI.js";import{n as xn,t as Sn}from"./useSearchInput-B-V4kIa-.js";import{i as Cn,n as wn}from"./pluginAutoupdate-Cr9hP0zG.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=Be(e=>e.mcp),x=Je(),[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 ht(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=rt(t.mcp.tools,e.name),i=tt(t.mcp.commands,e.name),a=Ie(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=Re(b.commands,e.name).length,Ee=_n(),De=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]),R=B.useCallback(()=>{ie(!0),me(`tengu_claudeai_mcp_clear_auth_started`,{})},[]),Oe=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]),ke=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 Lt(e.name,e.config,{preserveStepUpState:!0}),e.config){await $e(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]),Ae=async()=>{e.config.type!==`claudeai-proxy`&&e.config&&(await Lt(e.name,e.config),me(`tengu_mcp_auth_config_clear`,{}),await ht(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=rt(t.mcp.tools,e.name),i=tt(t.mcp.commands,e.name),a=Ie(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)(Tt,{}),(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)(Ge,{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)(Tt,{}),(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)(Tt,{}),(0,V.jsx)(p,{children:` Establishing connection to MCP server`})]}),(0,V.jsx)(p,{dimColor:!0,children:`This may take a few moments.`})]});let Me=[];return e.client.type===`disabled`&&Me.push({label:`Enable`,value:`toggle-enabled`}),e.client.type===`connected`&&t>0&&Me.push({label:`View tools`,value:`tools`}),e.config.type===`claudeai-proxy`?e.client.type===`connected`?Me.push({label:`Clear authentication`,value:`claudeai-clear-auth`}):e.client.type!==`disabled`&&Me.push({label:`Authenticate`,value:`claudeai-auth`}):(be&&(Me.push({label:`Re-authenticate`,value:`reauth`}),Me.push({label:`Clear authentication`,value:`clear-auth`})),be||Me.push({label:`Authenticate`,value:`auth`})),e.client.type!==`disabled`&&(e.client.type!==`needs-auth`&&Me.push({label:`Reconnect`,value:`reconnectMcpServer`}),Me.push({label:`Disable`,value:`toggle-enabled`})),Me.length===0&&Me.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:Ze(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]})}),Me.length>0&&(0,V.jsx)(C,{marginTop:1,children:(0,V.jsx)(je,{options:Me,onChange:async t=>{switch(t){case`tools`:n();break;case`auth`:case`reauth`:await ke();break;case`clear-auth`:await Ae();break;case`claudeai-auth`:await De();break;case`claudeai-clear-auth`:R();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 Oe();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(),ze(),x(),Kt(),Rt(),Oe(),vn(),it(),yt(),ie(),Gt(),L(),ve(),M(),st(),ut(),gt(),Xe(),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=Be(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=Re(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)(Tt,{}),(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:Ze(Dt(e.name)?.scope??`dynamic`)})]}),e.client.type===`connected`&&(0,H.jsx)(Dn,{serverToolsCount:t,serverPromptsCount:b,serverResourcesCount:l.resources[e.name]?.length||0}),e.client.type===`connected`&&t>0&&(0,H.jsxs)(C,{children:[(0,H.jsx)(p,{bold:!0,children:`Tools: `}),(0,H.jsxs)(p,{dimColor:!0,children:[t,` tools`]})]})]}),x.length>0&&(0,H.jsx)(C,{marginTop:1,children:(0,H.jsx)(je,{options:x,onChange:async t=>{if(t===`tools`)n();else if(t===`reconnectMcpServer`){_(!0);try{let{message:t}=An(await d(e.name),e.name);i?.(t)}catch(t){i?.(jn(t,e.name))}finally{_(!1)}}else t===`toggle-enabled`?await v():t===`back`&&r()},onCancel:r})})]}),(0,H.jsx)(C,{marginTop:1,children:(0,H.jsx)(p,{dimColor:!0,italic:!0,children:c.pending?(0,H.jsxs)(H.Fragment,{children:[`Press `,c.keyName,` again to exit`]}):(0,H.jsxs)(g,{children:[(0,H.jsx)(h,{shortcut:`↑↓`,action:`navigate`}),(0,H.jsx)(h,{shortcut:`Enter`,action:`select`}),(0,H.jsx)(z,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}var In,H,Ln=e((()=>{i(),In=t(l(),1),qt(),x(),wt(),vn(),it(),yt(),L(),M(),st(),ut(),gt(),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(),st(),U=w()}));function Vn({server:e,onSelectTool:t,onBack:n}){let r=Be(e=>e.mcp.tools),i=Hn.useMemo(()=>e.client.type===`connected`?kt(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)(je,{options:a,onChange:e=>{let n=parseInt(e,10),r=i[n];r&&t(r,n)},onCancel:n})})}var Hn,Un,Wn=e((()=>{Hn=t(l(),1),x(),N(),it(),yt(),M(),st(),ut(),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 Pe(n,e=>{v(e)});ct(e,{source:t}),Ct();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)(Ge,{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)(Tt,{}),(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(),st(),x(),gt(),Xe(),L(),ve(),Ft(),nt(),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 Ot();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=Ne(e);Object.keys(r).length>0&&n.push({key:`top-level`,title:`Configure ${e.name}`,subtitle:`Plugin options`,schema:r,load:()=>Ke(t),save:n=>St(t,n,e.manifest.userConfig)});let i=et(e);for(let r of i)n.push({key:`channel:${r.server}`,title:`Configure ${r.displayName}`,subtitle:`Plugin: ${e.name}`,schema:r.configSchema,load:()=>He(t,r.server)??void 0,save:e=>Ye(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(),De(),R(),pt(),Ae(),Qn(),nr=w()}));function ir(){let e=_t();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(),lt(),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(),st(),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 Le(),{marketplaces:n,failures:r}=await Nt(e),i=[];for(let{name:e,config:t,data:r}of n)if(r){let n=be(r.plugins,t=>Ee(Te(t.name,e)));i.push({name:e,totalPlugins:r.plugins.length,installedCount:n,source:jt(t.source)})}i.sort((e,t)=>e.name===`claude-plugin-directory`?-1:+(t.name===`claude-plugin-directory`)),y(i);let a=Et(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 Qe(t);if(e){let i=e.plugins.find(e=>e.name===c);if(i){let e=Te(i.name,t);n={entry:i,marketplaceName:t,pluginId:e,isInstalled:xt(e)},r=t;break}}}if(n&&r){let e=n.pluginId;xt(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 Qe(n);if(e)return;if(!t)throw Error(`Failed to load marketplace: ${n}`);let r=[];for(let e of t.plugins){let t=Te(e.name,n);vt(t)||r.push({entry:e,marketplaceName:n,pluginId:t,isInstalled:xt(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 zt({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),Ct(),a===0?r(`✓ Installed ${n} ${O(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${Pt(s,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${Pt(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 zt({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),st(),x(),Kt(),xe(),Gt(),de(),L(),Ft(),sn(),Me(),lt(),nt(),ke(),It(),Mt(),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 Le(),{marketplaces:n,failures:r}=await Nt(e),i=[];for(let{name:e,data:t}of n)if(t)for(let n of t.plugins){let t=Te(n.name,e);i.push({entry:n,marketplaceName:e,pluginId:t,isInstalled:xt(t)})}let a=i.filter(e=>!e.isInstalled&&!vt(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 ft({configuredMarketplaceCount:o,failedMarketplaceCount:r.length}));let s=Et(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 zt({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),Ct(),a===0?r(`✓ Installed ${n} ${O(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${Pt(s,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${Pt(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 zt({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 we=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`]})}),we.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===we.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),st(),bn(),x(),Sn(),ze(),Kt(),xe(),Gt(),de(),L(),Ft(),sn(),Me(),lt(),nt(),ke(),It(),Mt(),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 Le(),{enabled:r,disabled:i}=await Ot(),a=[...r,...i],{marketplaces:o,failures:l}=await Nt(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:jt(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=Et(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=Te(t.name,e.name);n[r]=!1}re(`userSettings`,{enabledPlugins:n})}await At(e.name),c++,me(`tengu_marketplace_removed`,{marketplace_name:e.name,plugins_uninstalled:e.installedPlugins?.length||0});continue}e.pendingUpdate&&(await Fe(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),Ct(),o&&await o();let f=await Le(),{enabled:p,disabled:m}=await Ot(),h=[...p,...m],{marketplaces:g}=await Nt(f),_=[];for(let{name:e,config:t,data:n}of g){let r=h.filter(t=>t.source.endsWith(`@${e}`));_.push({name:e,source:jt(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 ot(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(),st(),x(),Kt(),xe(),T(),L(),Ft(),lt(),nt(),wn(),pt(),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 Ue(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((()=>{qe()}));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 Qe(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 Qe(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!vt(`${e.name}@${t}`)})}function zr({setViewState:e,setResult:t,onManageComplete:n,onSearchModeChange:r,targetPlugin:i,targetMarketplace:o,action:c}){let l=Be(e=>e.mcp.clients),u=Be(e=>e.mcp.tools),m=Be(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`),ke(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,Ee]=(0,X.useState)(!1),[De,R]=(0,X.useState)(null),[Oe,ke]=(0,X.useState)(null),[Ae,je]=(0,X.useState)(!1),[Me,Ne]=(0,X.useState)(!1);(0,X.useEffect)(()=>{if(!A){Ne(!1);return}async function e(){let e=A.plugin.manifest.mcpServers,t=!1;if(e&&(t=typeof e==`string`&&bt(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&&bt(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`&&bt(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&&bt(e))}}catch(e){ue(`Failed to read raw marketplace.json: ${e}`)}Ne(t)}e()},[A]),(0,X.useEffect)(()=>{async function e(){oe(!0);try{let{enabled:e,disabled:t}=await Ot(),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 Pe=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}Ee(!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)){Ee(!1),w(`confirm-project-uninstall`);return}let e=Ve().plugins[o],t=!e||e.length<=1?await at(o):null;if(t){Ee(!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}}Ct();let c=`${A.plugin.name}@${A.marketplace}`;if(P()?.enabledPlugins?.[c]!==!1){Ee(!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){Ee(!1),R(`Failed to ${r}: ${e instanceof Error?e.message:String(e)}`),ye(I(e))}},Fe=(0,X.useRef)(Pe);Fe.current=Pe,(0,X.useEffect)(()=>{if(S===`plugin-details`&&A&&fe.current){let e=fe.current;fe.current=void 0,Fe.current(e)}},[S,A]);let Ie=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),Ct()}catch(e){ye(e)}})()):(e.set(t,i?`will-disable`:`will-enable`),(async()=>{try{i?await en(t):await Zt(t),Ct()}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":Ie},{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 Le=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 Pe(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`)}}}),Me&&i.push({label:`Configure`,action:async()=>{je(!0);try{let e=A.plugin.manifest.mcpServers,t=null;if(typeof e==`string`&&bt(e))t=e;else if(Array.isArray(e)){for(let n of e)if(typeof n==`string`&&bt(n)){t=n;break}}if(!t){R(`No MCPB file found in plugin`),je(!1);return}let n=`${A.plugin.name}@${A.marketplace}`,r=await We(t,A.plugin.path,n,void 0,void 0,!0);`status`in r&&r.status===`needs-config`?(ke(r),w(`configuring`)):R(`Failed to load MCPB for configuration`)}catch(e){R(`Failed to load configuration: ${ce(e)}`)}finally{je(!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 Pe(`update`)}),i.push({label:`Uninstall`,action:()=>void Pe(`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,Me,ie]);if(v({"select:previous":()=>{Ce>0&&we(Ce-1)},"select:next":()=>{Ce<Le.length-1&&we(Ce+1)},"select:accept":()=>{Le[Ce]&&Le[Ce].action()}},{context:`Select`,isActive:S===`plugin-details`&&!!A}),v({"select:accept":()=>{typeof S==`object`&&S.type===`failed-plugin-details`&&(async()=>{Ee(!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)}Ct()}i?(n&&await n(),Ee(!1),w(`plugin-list`)):(Ee(!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;Ee(!0),R(null);let r=`${A.plugin.name}@${A.marketplace}`,{error:i}=re(`localSettings`,{enabledPlugins:{...k(`localSettings`)?.enabledPlugins,[r]:!1}});if(i){Ee(!1),R(`Failed to write settings: ${i.message}`);return}Ct(),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=>{Ee(!0),R(null);try{let i=await Qt(o,s,r);if(!i.success)throw Error(i.message);Ct();let c=r?``:` · data preserved`;t(`${a.tick} ${i.message}${c}`),n&&n(),e({type:`menu`})}catch(e){Ee(!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:Ke(e),onSave:n=>{try{St(e,n,S.schema),Ct(),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`&&Oe&&A){let e=`${A.plugin.name}@${A.marketplace}`;async function n(n){if(!(!Oe||!A))try{let r=A.plugin.manifest.mcpServers,i=null;if(typeof r==`string`&&bt(r))i=r;else if(Array.isArray(r)){for(let e of r)if(typeof e==`string`&&bt(e)){i=e;break}}if(!i){R(`No MCPB file found`),w(`plugin-details`);return}await We(i,A.plugin.path,e,void 0,n),R(null),ke(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(){ke(null),w(`plugin-details`)}return(0,Z.jsx)(Yn,{title:`Configure ${Oe.manifest.name}`,subtitle:`Plugin: ${A.plugin.name}`,configSchema:Oe.configSchema,initialValues:Oe.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.`})]}),De&&(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{color:`error`,children:De})}),(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:dt(`${A.plugin.name}@${A.marketplace}`)})]}),De&&(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{color:`error`,children:De})}),(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:Le.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…`})}),De&&(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{color:`error`,children:De})}),(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…`}),De&&(0,Z.jsx)(p,{color:`error`,children:De}),(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=kt(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 Re=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`]})}),Re.map((e,t)=>{let n=Se.toActualIndex(t)===ve&&!_,r=t>0?Re[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),st(),x(),Pn(),Ln(),Bn(),Wn(),bn(),Sn(),ze(),Kt(),Ht(),vn(),it(),rn(),yt(),xe(),Gt(),de(),L(),ve(),Ft(),Me(),nt(),De(),we(),gn(),Bt(),pt(),Ae(),Mt(),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 Le(),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=Be(e=>e.plugins.errors),i=Be(e=>e.plugins.installationStatus),o=Je(),[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 Nt(await Le());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),Ct(),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 At(i.name),Ct(),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=Je(),ne=Be(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),st(),x(),qt(),Kt(),yt(),L(),Ft(),lt(),nt(),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 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-DR8-3Aex.js";import{c as t,s as n,u as r}from"./envUtils-BWeoiL4Y.js";import{n as i,t as a}from"./defineProperty-80gRi2ZW.js";import{Tn as o,wn as s}from"./src-Di342QoJ.js";import{Ct as c,Lt as l,Nt as u,cn as d,it as f,ln as ee}from"./state-sIHsFpDu.js";import{Ac as p,Br as m,Dr as h,Ll as g,Pr as _,Rl as v,Sc as y,a as b,i as te,pi as x,vi as ne}from"./paths-Q2255dD7.js";import{n as re,t as ie}from"./cwd--iizewsn.js";import{et as S,i as ae,o as C}from"./log-CzsijfHZ.js";import{Ar as w,CD as T,CO as E,DE as D,EE as oe,Fl as O,Fn as se,Hm as ce,Il as le,Ji as ue,Kn as de,Lo as k,OE as fe,Qv as pe,Rn as A,SD as j,SO as me,Sn as he,Um as ge,Xi as M,Yv as _e,_m as N,ao as ve,at as ye,cE as be,cj as P,dj as xe,dk as F,dt as I,et as Se,fk as L,fs as Ce,ft as we,jD as Te,jO as R,kD as z,kE as B,ms as Ee,no as De,oi as V,pk as H,qn as Oe,sE as ke,tt as Ae,ty as U,ur as W,xn as G,zn as je}from"./loadAgentsDir-Ci5mr0vm.js";import{Hn as Me,Vn as Ne,ht as K,vt as Pe}from"./prompt-DEPUnJdB.js";import{i as Fe,o as Ie}from"./fileStateCache-C7-TxF8G.js";import{P as q,X as Le,Z as Re}from"./rcDebugLog-BbPkkigY.js";import{a as ze,n as Be,r as Ve}from"./mappers-uIrAj-Wd.js";import{c as He,n as Ue,o as We,r as Ge,s as Ke}from"./MessageSelector-CkeGQPNM.js";import{n as qe,t as J}from"./systemTheme-dDbitcxB.js";import{randomUUID as Y}from"crypto";n(),i(),s(),d(),g(),re(),S(),C(),p(),ne(),b(),Ne(),Pe(),Ie(),q(),E(),Te(),U(),N(),O(),Ce(),k(),M(),w(),de(),G(),Ae(),we(),H(),T(),_(),R(),P();async function Je({tools:e,mainLoopModel:t,additionalWorkingDirectories:n,mcpClients:r,customSystemPrompt:i}){let[a,o,s]=await Promise.all([i===void 0?I(e,t,n,r):Promise.resolve([]),L(),i===void 0?F():Promise.resolve({})]);return{defaultSystemPrompt:a,userContext:o,systemContext:s}}async function Ye({tools:e,commands:t,mcpClients:n,messages:r,readFileState:i,getAppState:a,setAppState:o,customSystemPrompt:s,appendSystemPrompt:c,thinkingConfig:l,agents:u}){let d=h(),f=a(),{defaultSystemPrompt:ee,userContext:p,systemContext:m}=await Je({tools:e,mainLoopModel:d,additionalWorkingDirectories:Array.from(f.toolPermissionContext.additionalWorkingDirectories.keys()),mcpClients:n,customSystemPrompt:s}),g=Le([...s===void 0?ee:[s],...c?[c]:[]]),_=r.at(-1),v=_?.type===`assistant`&&_.message.stop_reason===null?r.slice(0,-1):r;return{systemPrompt:g,userContext:p,systemContext:m,toolUseContext:{options:{commands:t,debug:!1,mainLoopModel:d,tools:e,verbose:!1,thinkingConfig:l??(xe()===!1?{type:`disabled`}:{type:`adaptive`}),mcpClients:n,mcpResources:{},isNonInteractiveSession:!0,agentDefinitions:{activeAgents:u,allAgents:[]},customSystemPrompt:s,appendSystemPrompt:c},abortController:j(),readFileState:i,getAppState:a,setAppState:o,messages:v,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:()=>{},updateAttributionState:()=>{}},forkContextMessages:v}}T(),_(),ce(),R(),J(),P(),Be(),A(),D();var Xe=()=>{try{return Ge(),e(Ue)}catch{return null}},Ze=(be(),e(ke)).getCoordinatorUserContext,Qe=class{constructor(e){a(this,`config`,void 0),a(this,`mutableMessages`,void 0),a(this,`abortController`,void 0),a(this,`permissionDenials`,void 0),a(this,`totalUsage`,void 0),a(this,`hasHandledOrphanedPermission`,!1),a(this,`readFileState`,void 0),a(this,`discoveredSkillNames`,new Set),a(this,`loadedNestedMemoryPaths`,new Set),this.config=e,this.mutableMessages=e.initialMessages??[],this.abortController=e.abortController??j(),this.permissionDenials=[],this.readFileState=e.readFileCache,this.totalUsage=Re}async*submitMessage(e,n){let{cwd:i,commands:a,tools:s,mcpClients:d,verbose:p=!1,thinkingConfig:g,maxTurns:_,maxBudgetUsd:b,taskBudget:ne,canUseTool:re,customSystemPrompt:S,appendSystemPrompt:C,userSpecifiedModel:w,fallbackModel:T,jsonSchema:E,getAppState:D,setAppState:O,replayUserMessages:ce=!1,includePartialMessages:de=!1,agents:k=[],setSDKStatus:A,orphanedPermission:j}=this.config;this.discoveredSkillNames.clear(),this.permissionDenials=[],ge(i);let M=!ee(),N=Date.now(),be=async(e,t,n,r,i,a)=>{let o=await re(e,t,n,r,i,a);return o.behavior!==`allow`&&this.permissionDenials.push({type:`permission_denial`,tool_name:Ke(e.name),tool_use_id:i,tool_input:t}),o},P=D(),F=w?m(w):h(),I=g||(xe()===!1?{type:`disabled`}:{type:`adaptive`});z(`before_getSystemPrompt`);let L=typeof S==`string`?S:void 0,{defaultSystemPrompt:Ce,userContext:we,systemContext:Te}=await Je({tools:s,mainLoopModel:F,additionalWorkingDirectories:Array.from(P.toolPermissionContext.additionalWorkingDirectories.keys()),mcpClients:d,customSystemPrompt:L});z(`after_getSystemPrompt`);let R={...we,...Ze(d,je()?se():void 0)},H=L!==void 0&&te()?await Oe():null,ke=Le([...L===void 0?Ce:[L],...H?[H]:[],...C?[C]:[]]),Ae=s.some(e=>Me(e,K));E&&Ae&&he(O,c());let U={messages:this.mutableMessages,setMessages:e=>{this.mutableMessages=e(this.mutableMessages)},onChangeAPIKey:()=>{},handleElicitation:this.config.handleElicitation,options:{commands:a,debug:!1,tools:s,verbose:p,mainLoopModel:F,thinkingConfig:I,mcpClients:d,mcpResources:{},ideInstallationStatus:null,isNonInteractiveSession:!0,customSystemPrompt:S,appendSystemPrompt:C,agentDefinitions:{activeAgents:k,allAgents:[]},theme:qe(y().theme),maxBudgetUsd:b},getAppState:D,setAppState:O,abortController:this.abortController,readFileState:this.readFileState,nestedMemoryAttachmentTriggers:new Set,loadedNestedMemoryPaths:this.loadedNestedMemoryPaths,dynamicSkillDirTriggers:new Set,discoveredSkillNames:this.discoveredSkillNames,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:e=>{O(t=>{let n=e(t.fileHistory);return n===t.fileHistory?t:{...t,fileHistory:n}})},updateAttributionState:e=>{O(t=>{let n=e(t.attribution);return n===t.attribution?t:{...t,attribution:n}})},setSDKStatus:A};if(j&&!this.hasHandledOrphanedPermission){this.hasHandledOrphanedPermission=!0;for await(let e of oe(j,s,this.mutableMessages,U))yield e}let{messages:G,shouldQuery:Ne,allowedTools:Pe,model:Fe,resultText:Ie}=await He({input:e,mode:`prompt`,setToolJSX:()=>{},context:{...U,messages:this.mutableMessages},messages:this.mutableMessages,uuid:n?.uuid,isMeta:n?.isMeta,querySource:`sdk`});this.mutableMessages.push(...G);let q=[...this.mutableMessages];if(M&&G.length>0){let e=V(q);t()||(await e,(r(process.env.CLAUDE_CODE_EAGER_FLUSH)||r(process.env.CLAUDE_CODE_IS_COWORK))&&await W())}let Be=Xe(),Ue=G.filter(e=>e.type===`user`&&!e.isMeta&&!e.toolUseResult&&(Be?.selectableUserMessagesFilter(e)??!0)||e.type===`system`&&e.subtype===`compact_boundary`),Ge=ce?Ue:[];O(e=>({...e,toolPermissionContext:{...e.toolPermissionContext,alwaysAllowRules:{...e.toolPermissionContext.alwaysAllowRules,command:Pe}}}));let J=Fe??F;U={messages:q,setMessages:()=>{},onChangeAPIKey:()=>{},handleElicitation:this.config.handleElicitation,options:{commands:a,debug:!1,tools:s,verbose:p,mainLoopModel:J,thinkingConfig:I,mcpClients:d,mcpResources:{},ideInstallationStatus:null,isNonInteractiveSession:!0,customSystemPrompt:S,appendSystemPrompt:C,theme:qe(y().theme),agentDefinitions:{activeAgents:k,allAgents:[]},maxBudgetUsd:b},getAppState:D,setAppState:O,abortController:this.abortController,readFileState:this.readFileState,nestedMemoryAttachmentTriggers:new Set,loadedNestedMemoryPaths:this.loadedNestedMemoryPaths,dynamicSkillDirTriggers:new Set,discoveredSkillNames:this.discoveredSkillNames,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:U.updateFileHistoryState,updateAttributionState:U.updateAttributionState,setSDKStatus:A},z(`before_skills_plugins`);let[Ye,{enabled:Qe}]=await Promise.all([ue(ie()),Ee()]);if(z(`after_skills_plugins`),yield We({tools:s,mcpClients:d,model:J,permissionMode:P.toolPermissionContext.mode,commands:a,agents:k,skills:Ye,plugins:Qe,fastMode:P.fastMode}),z(`system_message_yielded`),!Ne){for(let e of G)if(e.type===`user`&&typeof e.message.content==`string`&&(e.message.content.includes(`<local-command-stdout>`)||e.message.content.includes(`<local-command-stderr>`)||e.isCompactSummary)&&(yield{type:`user`,message:{...e.message,content:o(e.message.content)},session_id:c(),parent_tool_use_id:null,uuid:e.uuid,timestamp:e.timestamp,isReplay:!e.isCompactSummary,isSynthetic:e.isMeta||e.isVisibleInTranscriptOnly}),e.type===`system`&&e.subtype===`local_command`&&typeof e.content==`string`&&(e.content.includes(`<local-command-stdout>`)||e.content.includes(`<local-command-stderr>`))&&(yield Ve(e.content,e.uuid)),e.type===`system`&&e.subtype===`compact_boundary`){let t=e;yield{type:`system`,subtype:`compact_boundary`,session_id:c(),uuid:e.uuid,compact_metadata:ze(t.compactMetadata)}}M&&(await V(q),(r(process.env.CLAUDE_CODE_EAGER_FLUSH)||r(process.env.CLAUDE_CODE_IS_COWORK))&&await W()),yield{type:`result`,subtype:`success`,is_error:!1,duration_ms:Date.now()-N,duration_api_ms:u(),num_turns:q.length-1,result:Ie??``,stop_reason:null,session_id:c(),total_cost_usd:l(),usage:this.totalUsage,modelUsage:f(),permission_denials:this.permissionDenials,fast_mode_state:x(J,P.fastMode),uuid:Y()};return}if(_e()&&M){let e=Xe()?.selectableUserMessagesFilter??(e=>!0);G.filter(e).forEach(e=>{pe(e=>{O(t=>({...t,fileHistory:e(t.fileHistory)}))},e.uuid)})}let X=Re,Z=1,$e=!1,et,Q=null,tt=ae().at(-1),nt=E?ve(this.mutableMessages,K):0;for await(let e of le({messages:q,systemPrompt:ke,userContext:R,systemContext:Te,canUseTool:be,toolUseContext:U,fallbackModel:T,querySource:`sdk`,maxTurns:_,taskBudget:ne})){if(e.type===`assistant`||e.type===`user`||e.type===`system`&&e.subtype===`compact_boundary`){if(M&&e.type===`system`&&e.subtype===`compact_boundary`){let t=e.compactMetadata?.preservedSegment?.tailUuid;if(t){let e=this.mutableMessages.findLastIndex(e=>e.uuid===t);e!==-1&&await V(this.mutableMessages.slice(0,e+1))}}if(q.push(e),M&&(e.type===`assistant`?V(q):await V(q)),!$e&&Ge.length>0){$e=!0;for(let e of Ge)e.type===`user`&&(yield{type:`user`,message:e.message,session_id:c(),parent_tool_use_id:null,uuid:e.uuid,timestamp:e.timestamp,isReplay:!0})}}switch(e.type===`user`&&Z++,e.type){case`tombstone`:break;case`assistant`:{let t=e,n=t.message?.stop_reason;n!=null&&(Q=n),this.mutableMessages.push(t),yield*B(t);break}case`progress`:{let t=e;this.mutableMessages.push(t),M&&(q.push(t),V(q)),yield*B(t);break}case`user`:{let t=e;this.mutableMessages.push(t),yield*B(t);break}case`stream_event`:{let t=e.event;if(t.type===`message_start`){X=Re;let e=t.message;X=ye(X,e.usage)}if(t.type===`message_delta`){X=ye(X,t.usage);let e=t.delta;e.stop_reason!=null&&(Q=e.stop_reason)}t.type===`message_stop`&&(this.totalUsage=Se(this.totalUsage,X)),de&&(yield{type:`stream_event`,event:t,session_id:c(),parent_tool_use_id:null,uuid:Y()});break}case`attachment`:{let t=e;this.mutableMessages.push(t),M&&(q.push(t),V(q));let n=t.attachment;if(n.type===`structured_output`)et=n.data;else if(n.type===`max_turns_reached`){M&&(r(process.env.CLAUDE_CODE_EAGER_FLUSH)||r(process.env.CLAUDE_CODE_IS_COWORK))&&await W(),yield{type:`result`,subtype:`error_max_turns`,duration_ms:Date.now()-N,duration_api_ms:u(),is_error:!0,num_turns:n.turnCount,stop_reason:Q,session_id:c(),total_cost_usd:l(),usage:this.totalUsage,modelUsage:f(),permission_denials:this.permissionDenials,fast_mode_state:x(J,P.fastMode),uuid:Y(),errors:[`Reached maximum number of turns (${n.maxTurns})`]};return}else ce&&n.type===`queued_command`&&(yield{type:`user`,message:{role:`user`,content:n.prompt},session_id:c(),parent_tool_use_id:null,uuid:n.source_uuid||t.uuid,timestamp:t.timestamp,isReplay:!0});break}case`stream_request_start`:break;case`system`:{let t=e,n=this.config.snipReplay?.(t,this.mutableMessages);if(n!==void 0){n.executed&&(this.mutableMessages.length=0,this.mutableMessages.push(...n.messages));break}if(this.mutableMessages.push(t),t.subtype===`compact_boundary`&&t.compactMetadata){let e=t,n=this.mutableMessages.length-1;n>0&&this.mutableMessages.splice(0,n);let r=q.length-1;r>0&&q.splice(0,r),yield{type:`system`,subtype:`compact_boundary`,session_id:c(),uuid:t.uuid,compact_metadata:ze(e.compactMetadata)}}if(t.subtype===`api_error`){let e=t;yield{type:`system`,subtype:`api_retry`,attempt:e.retryAttempt,max_retries:e.maxRetries,retry_delay_ms:e.retryInMs,error_status:e.error.status??null,error:me(e.error),session_id:c(),uuid:t.uuid}}break}case`tool_use_summary`:{let t=e;yield{type:`tool_use_summary`,summary:t.summary,preceding_tool_use_ids:t.precedingToolUseIds,session_id:c(),uuid:t.uuid};break}}if(b!==void 0&&l()>=b){M&&(r(process.env.CLAUDE_CODE_EAGER_FLUSH)||r(process.env.CLAUDE_CODE_IS_COWORK))&&await W(),yield{type:`result`,subtype:`error_max_budget_usd`,duration_ms:Date.now()-N,duration_api_ms:u(),is_error:!0,num_turns:Z,stop_reason:Q,session_id:c(),total_cost_usd:l(),usage:this.totalUsage,modelUsage:f(),permission_denials:this.permissionDenials,fast_mode_state:x(J,P.fastMode),uuid:Y(),errors:[`Reached maximum budget ($${b}). Increase the limit with --max-budget-usd or start a new session.`]};return}if(e.type===`user`&&E){let e=ve(this.mutableMessages,K)-nt,t=parseInt(process.env.MAX_STRUCTURED_OUTPUT_RETRIES||`5`,10);if(e>=t){M&&(r(process.env.CLAUDE_CODE_EAGER_FLUSH)||r(process.env.CLAUDE_CODE_IS_COWORK))&&await W(),yield{type:`result`,subtype:`error_max_structured_output_retries`,duration_ms:Date.now()-N,duration_api_ms:u(),is_error:!0,num_turns:Z,stop_reason:Q,session_id:c(),total_cost_usd:l(),usage:this.totalUsage,modelUsage:f(),permission_denials:this.permissionDenials,fast_mode_state:x(J,P.fastMode),uuid:Y(),errors:[`Failed to provide valid structured output after ${t} attempts`]};return}}}let $=q.findLast(e=>e.type===`assistant`||e.type===`user`),rt=$?.type??`undefined`,it=$?.type===`assistant`?v($.message.content)?.type??`none`:`n/a`;if(M&&(r(process.env.CLAUDE_CODE_EAGER_FLUSH)||r(process.env.CLAUDE_CODE_IS_COWORK))&&await W(),!fe($,Q)){yield{type:`result`,subtype:`error_during_execution`,duration_ms:Date.now()-N,duration_api_ms:u(),is_error:!0,num_turns:Z,stop_reason:Q,session_id:c(),total_cost_usd:l(),usage:this.totalUsage,modelUsage:f(),permission_denials:this.permissionDenials,fast_mode_state:x(J,P.fastMode),uuid:Y(),errors:(()=>{let e=ae(),t=tt?e.lastIndexOf(tt)+1:0;return[`[ede_diagnostic] result_type=${rt} last_content_type=${it} stop_reason=${Q}`,...e.slice(t).map(e=>e.error)]})()};return}let at=``,ot=!1;if($.type===`assistant`){let e=v($.message.content);e?.type===`text`&&!De.has(e.text)&&(at=e.text),ot=!!$.isApiErrorMessage}yield{type:`result`,subtype:`success`,is_error:ot,duration_ms:Date.now()-N,duration_api_ms:u(),num_turns:Z,result:at,stop_reason:Q,session_id:c(),total_cost_usd:l(),usage:this.totalUsage,modelUsage:f(),permission_denials:this.permissionDenials,structured_output:et,fast_mode_state:x(J,P.fastMode),uuid:Y()}}interrupt(){this.abortController.abort()}resetAbortController(){this.abortController=j()}getAbortSignal(){return this.abortController.signal}getMessages(){return this.mutableMessages}getReadFileState(){return this.readFileState}getSessionId(){return c()}setModel(e){this.config.userSpecifiedModel=e}};async function*X({commands:e,prompt:t,promptUuid:n,isMeta:r,cwd:i,tools:a,mcpClients:o,verbose:s=!1,thinkingConfig:c,maxTurns:l,maxBudgetUsd:u,taskBudget:d,canUseTool:f,mutableMessages:ee=[],getReadFileCache:p,setReadFileCache:m,customSystemPrompt:h,appendSystemPrompt:g,userSpecifiedModel:_,fallbackModel:v,jsonSchema:y,getAppState:b,setAppState:te,abortController:x,replayUserMessages:ne=!1,includePartialMessages:re=!1,handleElicitation:ie,agents:S=[],setSDKStatus:ae,orphanedPermission:C}){let w=new Qe({cwd:i,tools:a,commands:e,mcpClients:o,agents:S??[],canUseTool:f,getAppState:b,setAppState:te,initialMessages:ee,readFileCache:Fe(p()),customSystemPrompt:h,appendSystemPrompt:g,userSpecifiedModel:_,fallbackModel:v,thinkingConfig:c,maxTurns:l,maxBudgetUsd:u,taskBudget:d,jsonSchema:y,verbose:s,handleElicitation:ie,replayUserMessages:ne,includePartialMessages:re,setSDKStatus:ae,abortController:x,orphanedPermission:C});try{yield*w.submitMessage(t,{uuid:n,isMeta:r})}finally{m(w.getReadFileState())}}export{X as n,Ye as r,Qe as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./REPL-Dh8vzGmF.js";export{e as REPL};
|