claude-code-zanii 2.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +146 -0
- package/dist/chunks/AddWorkspaceDirectory-y_rd6sRl.js +1 -0
- package/dist/chunks/App-DgWSavG1.js +1 -0
- package/dist/chunks/ApproveApiKey-CJKWha-a.js +1 -0
- package/dist/chunks/ApproveApiKey-DTs2ExZH.js +1 -0
- package/dist/chunks/AssistantSessionChooser-BAhVk4id.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-XU_JPh7R.js +2 -0
- package/dist/chunks/BypassPermissionsModeDialog-DV0Pi7ys.js +1 -0
- package/dist/chunks/ClaudeInChromeOnboarding-6erm_8Fn.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-CjBvzB5s.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-ts0XnWwl.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-DySPdSqQ.js +1 -0
- package/dist/chunks/CustomSelect-DqZxzBZP.js +1 -0
- package/dist/chunks/DesktopHandoff-5c90JK88.js +1 -0
- package/dist/chunks/DevChannelsDialog-DCMderzu.js +1 -0
- package/dist/chunks/Dialog-Dgg8bqcG.js +1 -0
- package/dist/chunks/DiffDialog-BU765aqh.js +6 -0
- package/dist/chunks/Doctor-B73iDB-d.js +3 -0
- package/dist/chunks/Doctor-CLZDdNRo.js +1 -0
- package/dist/chunks/ExitFlow-DBqn2mUf.js +2 -0
- package/dist/chunks/Feedback-D-JHabwi.js +2 -0
- package/dist/chunks/Grove-D-uQNMMo.js +11 -0
- package/dist/chunks/HybridTransport-B-G4QJcy.js +4 -0
- package/dist/chunks/ITermBackend-KP1vKsRN.js +1 -0
- package/dist/chunks/InProcessTransport-ByBEKxrQ.js +1 -0
- package/dist/chunks/InvalidConfigDialog-CMqiZ5nG.js +1 -0
- package/dist/chunks/InvalidSettingsDialog-CjPCKzVZ.js +1 -0
- package/dist/chunks/ListItem-B6MyhHvM.js +1 -0
- package/dist/chunks/MCPConnectionManager-BJ8PcYPe.js +1 -0
- package/dist/chunks/Message-DNxJ_tMS.js +1 -0
- package/dist/chunks/MessageSelector-D79Ug71B.js +3 -0
- package/dist/chunks/Messages-CtIbkB2M.js +11 -0
- package/dist/chunks/Onboarding-DVrgKrI9.js +1 -0
- package/dist/chunks/OverageCreditUpsell-D_td1ss4.js +1 -0
- package/dist/chunks/PermissionDialog-BCS22yEO.js +1 -0
- package/dist/chunks/PermissionDialog-C5O1fL53.js +1 -0
- package/dist/chunks/PermissionRequestTitle-CtlbBU9t.js +1 -0
- package/dist/chunks/PluginSettings-OPrg-_3N.js +17 -0
- package/dist/chunks/PressEnterToContinue-DmzxIgbZ.js +1 -0
- package/dist/chunks/PromptInputFooterSuggestions-CcsKj5DK.js +1 -0
- package/dist/chunks/PromptInputHelpMenu-JedFdsxU.js +1 -0
- package/dist/chunks/REPL-ByhyIRnf.js +1 -0
- package/dist/chunks/REPL-Clve-8zC.js +157 -0
- package/dist/chunks/RemoteCallout-BZcabEKb.js +1 -0
- package/dist/chunks/RemoteSessionManager-C2PIFDHt.js +1 -0
- package/dist/chunks/ResumeConversation-D3ZRTFcF.js +1 -0
- package/dist/chunks/SSETransport-DmZWnH0k.js +4 -0
- package/dist/chunks/SearchBox-DQg2Ph0V.js +1 -0
- package/dist/chunks/SearchExtraToolsTool-CLO4nt6N.js +1 -0
- package/dist/chunks/SentryErrorBoundary-BVfBaOOU.js +2 -0
- package/dist/chunks/SentryErrorBoundary-DIaVFad-.js +1 -0
- package/dist/chunks/Settings-rOCxQdS8.js +2 -0
- package/dist/chunks/TeleportProgress-CP8IY6bz.js +1 -0
- package/dist/chunks/TeleportRepoMismatchDialog-DMmHgBqo.js +1 -0
- package/dist/chunks/TeleportResumeWrapper-D5wEAW1-.js +1 -0
- package/dist/chunks/ThemePicker-Bgr7yOQB.js +1 -0
- package/dist/chunks/TmuxBackend-BzbtUtP1.js +9 -0
- package/dist/chunks/TrustDialog-BI5U3BQ0.js +1 -0
- package/dist/chunks/TungstenTool-CiQclNwj.js +1 -0
- package/dist/chunks/TungstenTool-kMqy-ifa.js +1 -0
- package/dist/chunks/ValidationErrorsList-DprGtB2w.js +2 -0
- package/dist/chunks/WelcomeV2-C4vfBnIy.js +1 -0
- package/dist/chunks/WindowsTerminalBackend-BSoezOCE.js +2 -0
- package/dist/chunks/add-dir-DpOmv6kv.js +1 -0
- package/dist/chunks/agentDisplay-DuYEwOwO.js +1 -0
- package/dist/chunks/agents-BlurXZrF.js +2 -0
- package/dist/chunks/agents-DhZf7ftU.js +103 -0
- package/dist/chunks/ajv-CDrSAj3O.js +8 -0
- package/dist/chunks/analytics-i6X1et4O.js +1 -0
- package/dist/chunks/ant-D9hd_iYy.js +1 -0
- package/dist/chunks/api-CoaOHwDQ.js +4 -0
- package/dist/chunks/api-DvyGR-L7.js +1 -0
- package/dist/chunks/api-YHYC4Zdk.js +1 -0
- package/dist/chunks/artifacts-BMAYdaqh.js +1 -0
- package/dist/chunks/asciicast-DpHRoebc.js +1 -0
- package/dist/chunks/asciicast-HG1EoAQe.js +4 -0
- package/dist/chunks/assistant-D4-qcNT1.js +1 -0
- package/dist/chunks/assistant-DO2ZmZn1.js +1 -0
- package/dist/chunks/assistant-Dd86NmJM.js +1 -0
- package/dist/chunks/attributionHooks-BUmHrLhB.js +1 -0
- package/dist/chunks/attributionTrailer-r2Pbpu2N.js +1 -0
- package/dist/chunks/auth-CF3BGNYT.js +1 -0
- package/dist/chunks/auth-DwWwG43F.js +1 -0
- package/dist/chunks/auth-V_Xk2iea.js +1 -0
- package/dist/chunks/autoMode-DUksX5_i.js +45 -0
- package/dist/chunks/autoModeDenials-0CPO-Jbu.js +1 -0
- package/dist/chunks/autonomy-C5mNhAdz.js +21 -0
- package/dist/chunks/autonomy-CLt1dWaC.js +1 -0
- package/dist/chunks/autonomyPanel-rioFnrQO.js +1 -0
- package/dist/chunks/axios-DPuSPBlH.js +1 -0
- package/dist/chunks/axios-Zh7qGPze.js +12 -0
- package/dist/chunks/backgroundHousekeeping-BGtfqu-J.js +1 -0
- package/dist/chunks/backgroundHousekeeping-BqKZEvy0.js +17 -0
- package/dist/chunks/banner-BGLr3KYQ.js +2 -0
- package/dist/chunks/base64-js-B1tFNiG0.js +1 -0
- package/dist/chunks/bedrockClient-BFzWuhQK.js +15 -0
- package/dist/chunks/bg-B-YgGwLj.js +9 -0
- package/dist/chunks/bg-IU4gG3jc.js +1 -0
- package/dist/chunks/branch-BWY5W7hf.js +3 -0
- package/dist/chunks/break-cache-CY-O23fJ.js +8 -0
- package/dist/chunks/bridge-CqWd70vK.js +2 -0
- package/dist/chunks/bridgeConfig-CWO8AmCY.js +1 -0
- package/dist/chunks/bridgeConfig-D38y9eXn.js +1 -0
- package/dist/chunks/bridgeConfig-EwUq__ct.js +1 -0
- package/dist/chunks/bridgeConfig-GYR-LUiu.js +1 -0
- package/dist/chunks/bridgeEnabled-DKqmLnKO.js +1 -0
- package/dist/chunks/bridgeEnabled-DZIGDtfY.js +1 -0
- package/dist/chunks/bridgeMain-CXVks2ND.js +1 -0
- package/dist/chunks/bridgeMain-D4nsECwJ.js +68 -0
- package/dist/chunks/bridgeMessaging-BUOZU_ba.js +1 -0
- package/dist/chunks/bridgePointer-BpzIEsD_.js +1 -0
- package/dist/chunks/browser-D1vC3BNd.js +1 -0
- package/dist/chunks/btw-CVXJwoXo.js +1 -0
- package/dist/chunks/buddy-BLcvL8lP.js +3 -0
- package/dist/chunks/bundledMode-DQNSSQbt.js +1 -0
- package/dist/chunks/caches-BrfvzKn5.js +1 -0
- package/dist/chunks/caches-CkSv3MfC.js +3 -0
- package/dist/chunks/capacityWake-BWCSatN6.js +1 -0
- package/dist/chunks/changeDetector-DEZU6tum.js +1 -0
- package/dist/chunks/changeDetector-Df7c6U3d.js +1 -0
- package/dist/chunks/channelAllowlist-BApjAS0V.js +1 -0
- package/dist/chunks/channelNotification-BjWwF85R.js +1 -0
- package/dist/chunks/channelNotification-D01YVwNj.js +1 -0
- package/dist/chunks/chokidar-DPwMBcWI.js +1 -0
- package/dist/chunks/chokidar-DkDXNCTz.js +1 -0
- package/dist/chunks/chrome-D7coxEOI.js +1 -0
- package/dist/chunks/chromeNativeHost-CPj9M_4-.js +1 -0
- package/dist/chunks/chunk-DR8-3Aex.js +1 -0
- package/dist/chunks/classPrivateFieldSet2-DZkxcFPS.js +1 -0
- package/dist/chunks/claudeAiLimitsHook-ATshVrOH.js +1 -0
- package/dist/chunks/claudeDesktop-PVa9tWsM.js +1 -0
- package/dist/chunks/cleanup-C-PGmKpV.js +1 -0
- package/dist/chunks/clear-CxGE9Ntr.js +1 -0
- package/dist/chunks/cliLaunch-CMXoY_LO.js +1 -0
- package/dist/chunks/client-BWED8Tbu.js +35 -0
- package/dist/chunks/client-CinDjeSq.js +7 -0
- package/dist/chunks/client-CpXGg9e0.js +1 -0
- package/dist/chunks/color-B3w_VQTn.js +1 -0
- package/dist/chunks/color-convert-BQZnVz_5.js +1 -0
- package/dist/chunks/commands-DFp48zwy.js +1 -0
- package/dist/chunks/commitAttribution-B0cXmbvv.js +2 -0
- package/dist/chunks/commitAttribution-DRSKRoH6.js +1 -0
- package/dist/chunks/common-BX7bn3hg.js +1 -0
- package/dist/chunks/common-Ce3LanTX.js +1 -0
- package/dist/chunks/common-DdLQuE2_.js +1 -0
- package/dist/chunks/common-HfKcqOYK.js +1 -0
- package/dist/chunks/compact-C8ljGMdo.js +3 -0
- package/dist/chunks/companion-mD1jw6xX.js +1 -0
- package/dist/chunks/completionCache-BqQXVTa9.js +1 -0
- package/dist/chunks/completionCache-BtP4vfAi.js +4 -0
- package/dist/chunks/computerUseLock-ADE_PhIK.js +1 -0
- package/dist/chunks/config-CmyaIIOY.js +1 -0
- package/dist/chunks/config-Rl1Y_Dtq.js +1 -0
- package/dist/chunks/connectHeadless-MFABhXpz.js +1 -0
- package/dist/chunks/constants-BM62Vf_X.js +1 -0
- package/dist/chunks/constants-BfXy-5cI.js +1 -0
- package/dist/chunks/context-BeiZkUNq.js +1 -0
- package/dist/chunks/context-noninteractive-CRdF3iv8.js +54 -0
- package/dist/chunks/controlMessageCompat-591iGHUK.js +1 -0
- package/dist/chunks/conversation-BoguXZEI.js +1 -0
- package/dist/chunks/conversation-yhs7tT-g.js +1 -0
- package/dist/chunks/copy-BpeUcqku.js +7 -0
- package/dist/chunks/createSSHSession-B3JOB4TE.js +6 -0
- package/dist/chunks/createSession-BJSnFBGt.js +1 -0
- package/dist/chunks/createSession-CnRHI3RU.js +1 -0
- package/dist/chunks/cron-iqTFGIos.js +1 -0
- package/dist/chunks/cronScheduler-zRXhgEEU.js +6 -0
- package/dist/chunks/cronTasks-CMJldfoP.js +2 -0
- package/dist/chunks/crossProjectResume-DxO6TX30.js +40 -0
- package/dist/chunks/cwd-B2guYBbl.js +1 -0
- package/dist/chunks/cwd-B5bbyUwz.js +1 -0
- package/dist/chunks/cwd-BXiaJzLh.js +1 -0
- package/dist/chunks/daemon-B3v4OoOu.js +2 -0
- package/dist/chunks/dangerousBackend-OmCzoW35.js +1 -0
- package/dist/chunks/datadog-3-Vvz0yz.js +1 -0
- package/dist/chunks/datadog-BQlp3bTs.js +1 -0
- package/dist/chunks/debug-BDBIipC1.js +2 -0
- package/dist/chunks/debug-C7tW7DFW.js +1 -0
- package/dist/chunks/debug-CjIaNjpK.js +5 -0
- package/dist/chunks/debugUtils-Dsg-UHeg.js +1 -0
- package/dist/chunks/defineProperty-CaCI0a5T.js +1 -0
- package/dist/chunks/desktop-C_SS0068.js +1 -0
- package/dist/chunks/detached-B7RNZeyl.js +5 -0
- package/dist/chunks/detect-libc-DFFGDzPC.js +1 -0
- package/dist/chunks/detectRepository-BnTCJAXR.js +1 -0
- package/dist/chunks/detectRepository-Gobn9eFt.js +1 -0
- package/dist/chunks/detection-CN_uLGU2.js +1 -0
- package/dist/chunks/detection-DW6grIlc.js +1 -0
- package/dist/chunks/diff-B8YmRG5T.js +1 -0
- package/dist/chunks/directoryCompletion-J560aATd.js +1 -0
- package/dist/chunks/dist-B1wOprSs.js +29 -0
- package/dist/chunks/dist-DZQOarNX.js +5 -0
- package/dist/chunks/dist-HZfkKiUF.js +20 -0
- package/dist/chunks/dist-es-4xyrZoNc2.js +1 -0
- package/dist/chunks/dist-es-6kjvVbJd.js +1 -0
- package/dist/chunks/dist-es-BJldFHbt.js +3 -0
- package/dist/chunks/dist-es-BM013UFT.js +1 -0
- package/dist/chunks/dist-es-BPPewn1A.js +1 -0
- package/dist/chunks/dist-es-BZGG3Hnm.js +1 -0
- package/dist/chunks/dist-es-BZjJL64k2.js +1 -0
- package/dist/chunks/dist-es-BctcPxLN.js +1 -0
- package/dist/chunks/dist-es-Bf2jR30y.js +1 -0
- package/dist/chunks/dist-es-BgLoR-hQ.js +1 -0
- package/dist/chunks/dist-es-BismPcTW.js +1 -0
- package/dist/chunks/dist-es-BrPzXmSP.js +1 -0
- package/dist/chunks/dist-es-Bu21Wvhs.js +1 -0
- package/dist/chunks/dist-es-BuWNNAXW.js +1 -0
- package/dist/chunks/dist-es-Bz11sFiK2.js +1 -0
- package/dist/chunks/dist-es-C5VplyPL2.js +5 -0
- package/dist/chunks/dist-es-C66BuLgn.js +1 -0
- package/dist/chunks/dist-es-CCIzgNln2.js +1 -0
- package/dist/chunks/dist-es-CLyx7Kge2.js +1 -0
- package/dist/chunks/dist-es-CUbatGdn.js +1 -0
- package/dist/chunks/dist-es-CYe_-TbD.js +1 -0
- package/dist/chunks/dist-es-C_IHUdzL.js +1 -0
- package/dist/chunks/dist-es-Ci_rKlMr.js +1 -0
- package/dist/chunks/dist-es-ClDZBAj7.js +1 -0
- package/dist/chunks/dist-es-Cp--qjOi.js +1 -0
- package/dist/chunks/dist-es-CzE4kW1L.js +9 -0
- package/dist/chunks/dist-es-DUg5w7-v.js +1 -0
- package/dist/chunks/dist-es-Dl0ZRczY.js +1 -0
- package/dist/chunks/dist-es-Do_155z5.js +1 -0
- package/dist/chunks/dist-es-DxIM0jd82.js +1 -0
- package/dist/chunks/dist-es-Fav2oBDs.js +1 -0
- package/dist/chunks/dist-es-TZjwPaGn.js +1 -0
- package/dist/chunks/dist-es-W22ud2el2.js +1 -0
- package/dist/chunks/dist-es-aU8-02YH.js +1 -0
- package/dist/chunks/dist-es-b3yZSGx82.js +1 -0
- package/dist/chunks/dist-es-dIP5JtXz.js +5 -0
- package/dist/chunks/dist-es-mQ4HvnYs2.js +1 -0
- package/dist/chunks/distRoot-CJaacAHy.js +1 -0
- package/dist/chunks/doctor-DLZPF4iY.js +1 -0
- package/dist/chunks/earlyInput-BTI1CSNt.js +2 -0
- package/dist/chunks/earlyInput-BwGtzhhP.js +1 -0
- package/dist/chunks/effort-BaHvpBWr.js +9 -0
- package/dist/chunks/entry-_e-lyRwv.js +14 -0
- package/dist/chunks/env-CesrOJJq.js +1 -0
- package/dist/chunks/envLessBridgeConfig-4oys0_9A.js +1 -0
- package/dist/chunks/envLessBridgeConfig-DJ1Sts3F.js +1 -0
- package/dist/chunks/envUtils-CFG7IQID.js +1 -0
- package/dist/chunks/errorLogSink-Ti4Suoz6.js +2 -0
- package/dist/chunks/escHotkey-CVn_80xM.js +259 -0
- package/dist/chunks/esm-BFnjHW38.js +1 -0
- package/dist/chunks/esm-BQg_LX3V.js +1 -0
- package/dist/chunks/esm-BtC6CMmM.js +1 -0
- package/dist/chunks/esm-BwzC0MQp.js +1 -0
- package/dist/chunks/esm-CFybeQ_Q.js +1 -0
- package/dist/chunks/esm-CK-5CT5X.js +1 -0
- package/dist/chunks/esm-CL1OwlZB.js +1 -0
- package/dist/chunks/esm-CMzgSTAl.js +1 -0
- package/dist/chunks/esm-CPE_H2Lx.js +1 -0
- package/dist/chunks/esm-CcWquv5a.js +10 -0
- package/dist/chunks/esm-CeNEpRZt.js +1 -0
- package/dist/chunks/esm-D7hykoRB.js +1 -0
- package/dist/chunks/esm-DUtcefEV.js +1 -0
- package/dist/chunks/esm-DhrUwJBp.js +1 -0
- package/dist/chunks/esm-Duu1fRQ8.js +1 -0
- package/dist/chunks/esm-Ght2BaU2.js +1 -0
- package/dist/chunks/esm-Q6Yz2GMx.js +56 -0
- package/dist/chunks/esm-WONEiurY.js +13 -0
- package/dist/chunks/event-streams-BumpU1aB.js +1 -0
- package/dist/chunks/eventLoopStallDetector-DxyFdg1h.js +1 -0
- package/dist/chunks/execAsync-ChKxDZ8C.js +1 -0
- package/dist/chunks/execFileNoThrow-DdmR1mBS.js +1 -0
- package/dist/chunks/execSyncWrapper-Ch4TNj8u.js +1 -0
- package/dist/chunks/execa-BMaINL7N.js +34 -0
- package/dist/chunks/executor-C7INr19-.js +1 -0
- package/dist/chunks/executor-Dnf3YYma.js +1604 -0
- package/dist/chunks/exit-BakzsOD0.js +1 -0
- package/dist/chunks/exit-CiDn2tN9.js +2 -0
- package/dist/chunks/export-b-6pqMqz.js +2 -0
- package/dist/chunks/exportRenderer-RxtEIyTm.js +1 -0
- package/dist/chunks/extra-usage-7EPJNjNW.js +1 -0
- package/dist/chunks/extra-usage-ChvuewCq.js +1 -0
- package/dist/chunks/extra-usage-core-BVhLtoDF.js +1 -0
- package/dist/chunks/extra-usage-noninteractive-_Njh6q-q.js +1 -0
- package/dist/chunks/extraUsage-qOBMQB6g.js +1 -0
- package/dist/chunks/extractMemories-CRBVNiG1.js +1 -0
- package/dist/chunks/fast-C4uw_g7o.js +1 -0
- package/dist/chunks/fast-CEaIzaPl.js +1 -0
- package/dist/chunks/featureCheck-B1GSTyhh.js +1 -0
- package/dist/chunks/featureCheck-DKigAPal.js +1 -0
- package/dist/chunks/feedback-Bf3TjjuD.js +1 -0
- package/dist/chunks/figures-fES5sASd.js +1 -0
- package/dist/chunks/fileStateCache-DAsLEZau.js +1 -0
- package/dist/chunks/files-B-m_4X8b.js +2 -0
- package/dist/chunks/findExecutable-D8vJrFnO.js +1 -0
- package/dist/chunks/firstPartyEventLogger-BtrGagNa.js +1 -0
- package/dist/chunks/flushGate-2zqab-Pp.js +1 -0
- package/dist/chunks/foundry-sdk-CtX8C0x3.js +1 -0
- package/dist/chunks/fpsMetrics-ts_jaF3g.js +1 -0
- package/dist/chunks/fuse-ivQ_eRwF.js +1 -0
- package/dist/chunks/gates-CmKoQ0O-.js +1 -0
- package/dist/chunks/gates-_wbPDQ3M.js +1 -0
- package/dist/chunks/gemini-DRx495gn.js +3 -0
- package/dist/chunks/generateRecap-Cv8gd_QF.js +1 -0
- package/dist/chunks/generateSessionName-Dpjg-u_x.js +1 -0
- package/dist/chunks/genericProcessUtils-BFJMxLqn.js +23 -0
- package/dist/chunks/getMachineId-bsd-C9pL9Ajr.js +1 -0
- package/dist/chunks/getMachineId-darwin-Ma4F9rJg.js +2 -0
- package/dist/chunks/getMachineId-linux-C0lXMqsj.js +1 -0
- package/dist/chunks/getMachineId-unsupported-ByHQTXat.js +1 -0
- package/dist/chunks/getMachineId-win-DZsXZmTz.js +1 -0
- package/dist/chunks/git-Bj8Ow4pJ.js +6 -0
- package/dist/chunks/git-Q_b4oZ17.js +1 -0
- package/dist/chunks/githubRepoPathMapping-DGivBX9h.js +1 -0
- package/dist/chunks/goal-BrHEJv8o.js +3 -0
- package/dist/chunks/goalStorage-CsuPOQbk.js +1 -0
- package/dist/chunks/graceful-fs-BuPWC-vB.js +2 -0
- package/dist/chunks/grok-CDkDDaY_.js +1 -0
- package/dist/chunks/growthbook-D3_Cr9n-.js +1 -0
- package/dist/chunks/growthbook-p4aJ_UMv.js +32 -0
- package/dist/chunks/hash-KW-tVnPp.js +1 -0
- package/dist/chunks/heapdump-CloylIZ9.js +5 -0
- package/dist/chunks/help-DpSJlHIc.js +1 -0
- package/dist/chunks/hooks-2pogt8nv.js +79 -0
- package/dist/chunks/hooks-BBODdwnE.js +1 -0
- package/dist/chunks/hostAdapter-B5KTUqhv.js +1 -0
- package/dist/chunks/hostGuard-DyWr2TwE.js +1 -0
- package/dist/chunks/httpAuthSchemes-CgPbtGos.js +13 -0
- package/dist/chunks/ide-CJEcfBZq.js +2 -0
- package/dist/chunks/inboundAttachments-RNpYpRTO.js +1 -0
- package/dist/chunks/index.min-DCDiLq-j.js +1 -0
- package/dist/chunks/initReplBridge-D2E6IM2B.js +1 -0
- package/dist/chunks/initReplBridge-p2uwDBPx.js +1 -0
- package/dist/chunks/insights-DnpZScKs.js +822 -0
- package/dist/chunks/install-D_vTxUlG.js +1 -0
- package/dist/chunks/install-github-app-BK8A7g3i.js +147 -0
- package/dist/chunks/install-slack-app-C47R9VoI.js +1 -0
- package/dist/chunks/instinctParser-DxKdI3JC.js +1 -0
- package/dist/chunks/instrumentation-DkdAJFrZ.js +12 -0
- package/dist/chunks/intl-Pse97ORk.js +1 -0
- package/dist/chunks/isObject-DaxDnPKm.js +1 -0
- package/dist/chunks/isSymbol-D7QeUnS5.js +1 -0
- package/dist/chunks/job-opl00C4l.js +2 -0
- package/dist/chunks/json-bigint-BRRVs1dv.js +8 -0
- package/dist/chunks/jsx-runtime-BTgGEFjL.js +1 -0
- package/dist/chunks/jws-B_ieuaZg.js +3 -0
- package/dist/chunks/jwtUtils-D-tJzoJY.js +1 -0
- package/dist/chunks/keybindings-mRf9VSe8.js +2 -0
- package/dist/chunks/lang-eH4EJErj.js +1 -0
- package/dist/chunks/language-DD9ar6RA.js +1 -0
- package/dist/chunks/language-EZLNdETg.js +1 -0
- package/dist/chunks/launchAgentsPlatform-Cq0_7-IM.js +1 -0
- package/dist/chunks/launchAutofixPr-Bw7aUHUs.js +18 -0
- package/dist/chunks/launchCommand-Bk1Fn-qZ.js +1 -0
- package/dist/chunks/launchLocalMemory-CLBCUgwd.js +3 -0
- package/dist/chunks/launchLocalVault-BfWJWrBg.js +3 -0
- package/dist/chunks/launchMemoryStores-DdnSVSDZ.js +1 -0
- package/dist/chunks/launchOnboarding-ziCEX3GI.js +8 -0
- package/dist/chunks/launchSchedule-G_c7sgmy.js +1 -0
- package/dist/chunks/launchSkillStore-Z1Kd7nCg.js +1 -0
- package/dist/chunks/launchTeleport-Dp9AFbPx.js +3 -0
- package/dist/chunks/launchVault-hwK-Ljek.js +1 -0
- package/dist/chunks/lazySchema-2sOku3cX.js +1 -0
- package/dist/chunks/lib-BHRYgENJ.js +8 -0
- package/dist/chunks/lib-DRyNc7xD.js +2 -0
- package/dist/chunks/lib-Ddq71jM5.js +14 -0
- package/dist/chunks/loadAgentsDir-Bz0FfcVt.js +5620 -0
- package/dist/chunks/loadAgentsDir-CLM0ws7u.js +1 -0
- package/dist/chunks/loadPluginHooks-B5SIS2uo.js +1 -0
- package/dist/chunks/loadSso-RY87rrJO.js +1 -0
- package/dist/chunks/localSearch-BLF6PSv2.js +1 -0
- package/dist/chunks/localSearch-CTycGe3E.js +1 -0
- package/dist/chunks/localSearch-inDahM8I.js +1 -0
- package/dist/chunks/lockfile--gk1HDM6.js +1 -0
- package/dist/chunks/log-B-Nj3Yed.js +1 -0
- package/dist/chunks/log-DVv8YiNo.js +1 -0
- package/dist/chunks/login-BeLvLowc.js +1 -0
- package/dist/chunks/login-DUUOeNoz.js +1 -0
- package/dist/chunks/logoV2Utils-D5SpeZ3C.js +1 -0
- package/dist/chunks/logout-C2QuTBdS.js +1 -0
- package/dist/chunks/magicDocs-CUXKi-Wv.js +57 -0
- package/dist/chunks/main-CFhpWtpC.js +1420 -0
- package/dist/chunks/main-sboa5RKc.js +31 -0
- package/dist/chunks/mappers-DLkk0PZz.js +1 -0
- package/dist/chunks/mcp-C2f6IgAp.js +2 -0
- package/dist/chunks/mcp-Djui9m3_.js +6 -0
- package/dist/chunks/mcp-DvTSxrJ4.js +1 -0
- package/dist/chunks/mcpServer-DMA0bdFC.js +1 -0
- package/dist/chunks/mcpServer-DxEHfW2v.js +1 -0
- package/dist/chunks/memoize-Bg2dXTzV.js +1 -0
- package/dist/chunks/memoize-DNnuA2aU.js +1 -0
- package/dist/chunks/memory-B9io9Zcv.js +1 -0
- package/dist/chunks/mobile-CPnnvkQV.js +2 -0
- package/dist/chunks/modalContext-B1b0Gsro.js +1 -0
- package/dist/chunks/mode-BDgwh_Xb.js +2 -0
- package/dist/chunks/model-B6cpEh-s.js +1 -0
- package/dist/chunks/model-BcunOCC9.js +1 -0
- package/dist/chunks/modelOptions-CHUHQ9WG.js +1 -0
- package/dist/chunks/normalization-cjPqid31.js +1 -0
- package/dist/chunks/oauth-CnBLewrU.js +1 -0
- package/dist/chunks/oauth-DMPGYAoZ.js +1 -0
- package/dist/chunks/observationStore-DVBxrSdI.js +4 -0
- package/dist/chunks/onChangeAppState-M61XDN6V.js +1 -0
- package/dist/chunks/open-CsUNPSNx.js +1 -0
- package/dist/chunks/openai-BHvlYW3m.js +2 -0
- package/dist/chunks/output-style-BtKuBrs4.js +1 -0
- package/dist/chunks/outputStyles-hHuIBkRB.js +84 -0
- package/dist/chunks/overageCreditGrant-BLFT-rF3.js +1 -0
- package/dist/chunks/p-map-C-WNcN6g.js +1 -0
- package/dist/chunks/p-map-CQ2NythB.js +1 -0
- package/dist/chunks/package-9IAs5Qf0.js +1 -0
- package/dist/chunks/panel-27xLZI7c.js +1 -0
- package/dist/chunks/panel-NoDfShEZ.js +1 -0
- package/dist/chunks/panelCall-CEOWVNCM.js +1 -0
- package/dist/chunks/parseConnectUrl-CxU4IX9o.js +1 -0
- package/dist/chunks/parser-DGlAnaNj.js +1 -0
- package/dist/chunks/parser-DGoLe2RS.js +1 -0
- package/dist/chunks/passes-CExcqu66.js +1 -0
- package/dist/chunks/path-uaxlnhva.js +1 -0
- package/dist/chunks/permissions-B3PceQul.js +1 -0
- package/dist/chunks/permissions-DezIL2xF.js +3 -0
- package/dist/chunks/permissions-DnpI8Whh.js +1 -0
- package/dist/chunks/pipeTransport-CB_Wq_Kx.js +1 -0
- package/dist/chunks/plan-cfZBclh9.js +1 -0
- package/dist/chunks/platform-BXz_rgpy.js +2 -0
- package/dist/chunks/plist-DLGDWBD6.js +6 -0
- package/dist/chunks/plugin-CuhENLRs.js +1 -0
- package/dist/chunks/pluginAutoupdate-wTeOXfQe.js +1 -0
- package/dist/chunks/pluginBlocklist-D6pkKfXr.js +1 -0
- package/dist/chunks/pluginCliCommands-DqxdCwsq.js +1 -0
- package/dist/chunks/pluginFlagging-CjH48f-K.js +1 -0
- package/dist/chunks/pluginOperations-DMFYB3pK.js +2 -0
- package/dist/chunks/pluginStartupCheck-BW3_KfZz.js +1 -0
- package/dist/chunks/pluginStartupCheck-Cj2BMjVw.js +1 -0
- package/dist/chunks/plugins-CarsG2v8.js +4 -0
- package/dist/chunks/policyLimits-DFn1vHkN.js +1 -0
- package/dist/chunks/pollConfig-C8nODJY1.js +1 -0
- package/dist/chunks/poller-DXZJ-dUP.js +1 -0
- package/dist/chunks/poor-C7GQ4a5X.js +1 -0
- package/dist/chunks/poorMode-CBe0rfxB.js +1 -0
- package/dist/chunks/poorMode-CbZTudtw.js +1 -0
- package/dist/chunks/postCommitAttribution--vvAWIqD.js +1 -0
- package/dist/chunks/print-CwwtGSbK.js +114 -0
- package/dist/chunks/privacy-settings-Bz8cAVp5.js +11 -0
- package/dist/chunks/privacyLevel-CRCHhztk.js +1 -0
- package/dist/chunks/process-CnhUplBr.js +1 -0
- package/dist/chunks/process-X4vCP9x0.js +1 -0
- package/dist/chunks/processBashCommand-NL0YEUqW.js +3 -0
- package/dist/chunks/processSlashCommand-FPMWElsI.js +6 -0
- package/dist/chunks/processSlashCommand-_oJs6_w8.js +6 -0
- package/dist/chunks/processUserInput-QAJK0XSn.js +1 -0
- package/dist/chunks/projectContext-B21hXj9q.js +1 -0
- package/dist/chunks/projectContext-DbTQHQS3.js +1 -0
- package/dist/chunks/prompt-C6eleu4x.js +1 -0
- package/dist/chunks/prompt-CUdoQXyN.js +1 -0
- package/dist/chunks/prompt-CsBCtw4l.js +228 -0
- package/dist/chunks/prompt-hnIDYhP4.js +54 -0
- package/dist/chunks/promptEditor-CrlVcc17.js +4 -0
- package/dist/chunks/protectedNamespace-Cn4901XG.js +1 -0
- package/dist/chunks/protocolHandler-DM_w7sJ5.js +13 -0
- package/dist/chunks/protocols-CpoQzjyI.js +7 -0
- package/dist/chunks/proxy-9WvtUy8E.js +99 -0
- package/dist/chunks/rate-limit-options-BehQ3MoX.js +1 -0
- package/dist/chunks/rcDebugLog-BbHlIxCm.js +11 -0
- package/dist/chunks/referral-BfAZEIZL.js +1 -0
- package/dist/chunks/refresh-Bl3Miver.js +1 -0
- package/dist/chunks/registerProtocol-BHZ3vZED.js +36 -0
- package/dist/chunks/registerSkillHooks-BR7v5qDA.js +1 -0
- package/dist/chunks/registry-C2igpRd-.js +1 -0
- package/dist/chunks/release-notes-C_Cou6ye.js +4 -0
- package/dist/chunks/releaseNotes-DveQShyB.js +2 -0
- package/dist/chunks/reload-plugins-D-pAUoB5.js +1 -0
- package/dist/chunks/remote-env-C_dBgbgo.js +1 -0
- package/dist/chunks/remoteBridgeCore-BxWhTy1u.js +1 -0
- package/dist/chunks/remoteControlServer-D3OjUlB-.js +3 -0
- package/dist/chunks/rename-f3m0ETSt.js +1 -0
- package/dist/chunks/renderOptions-QZLxGnh_.js +1 -0
- package/dist/chunks/replBridge-qeVmCJOb.js +1 -0
- package/dist/chunks/resume-CM_8p9Iu.js +2 -0
- package/dist/chunks/rewind-0cB7o6fx.js +1 -0
- package/dist/chunks/ripgrep-BEWqxrpl.js +5 -0
- package/dist/chunks/ripgrep-G82m12Ng.js +1 -0
- package/dist/chunks/rollback-CVo2gqgR.js +11 -0
- package/dist/chunks/runtimeObserver-1EdvvoYw.js +1 -0
- package/dist/chunks/runtimeObserver-CX6vepq9.js +10 -0
- package/dist/chunks/sandbox-adapter-DzHfW2tH.js +1 -0
- package/dist/chunks/sandbox-toggle-N6KgmH2T.js +1 -0
- package/dist/chunks/sanitization-CIBpY9KT.js +1 -0
- package/dist/chunks/satisfies-B7ZvBUQP.js +1 -0
- package/dist/chunks/schemas-Bwt-7U5W.js +40 -0
- package/dist/chunks/sdk-Drp69kIx.js +1 -0
- package/dist/chunks/sdkHeapDumpMonitor-B9GVkISU.js +1 -0
- package/dist/chunks/searchExtraTools-BphNJsl8.js +1 -0
- package/dist/chunks/semver-BsItM2Z4.js +1 -0
- package/dist/chunks/semver-D3lOjiBN.js +1 -0
- package/dist/chunks/sentry-ySzRCXGd.js +1 -0
- package/dist/chunks/server-C8nMDji6.js +1 -0
- package/dist/chunks/server-XZG51Slr.js +1 -0
- package/dist/chunks/serverBanner-D68EBGzH.js +1 -0
- package/dist/chunks/serverLog-hv2hc5US.js +1 -0
- package/dist/chunks/session-CVoGFb8a.js +2 -0
- package/dist/chunks/sessionDataUploader-BaD1Q7v3.js +1 -0
- package/dist/chunks/sessionDiscovery-D7g66TX6.js +1 -0
- package/dist/chunks/sessionFileAccessHooks-9lPjspRX.js +1 -0
- package/dist/chunks/sessionManager-BhOjMNAP.js +1 -0
- package/dist/chunks/sessionMemory-BA6cdxqP.js +1 -0
- package/dist/chunks/sessionMemory-CtEhIRGF.js +1 -0
- package/dist/chunks/sessionMemoryUtils-D_B92ypa.js +1 -0
- package/dist/chunks/sessionObserver-CESI-uVZ.js +1 -0
- package/dist/chunks/sessionObserver-SpE_eglb.js +20 -0
- package/dist/chunks/sessionRestore-DqsqYK4K.js +1 -0
- package/dist/chunks/sessionState-Dgky34M4.js +1 -0
- package/dist/chunks/sessionStorage-DJb5HKhQ.js +1 -0
- package/dist/chunks/sessionStorage-DSMfHTcg.js +1 -0
- package/dist/chunks/sessionStoragePortable-DyM_hZnp.js +3 -0
- package/dist/chunks/sessionTitle-Bzxk_EW9.js +14 -0
- package/dist/chunks/sessionTracing-DR8O0686.js +12 -0
- package/dist/chunks/setup-BHNS9sBS.js +9 -0
- package/dist/chunks/setup-BafJxZ0F.js +4 -0
- package/dist/chunks/setup-MLNNYLi6.js +1 -0
- package/dist/chunks/shadowedRuleDetection-Ch9gTxfD.js +1 -0
- package/dist/chunks/shellQuote-3s6tV-hK.js +1 -0
- package/dist/chunks/sideQuestion-BBn6XIOD.js +20 -0
- package/dist/chunks/signal-BTxmab6r.js +1 -0
- package/dist/chunks/signin-ChbUAEGq.js +1 -0
- package/dist/chunks/sink-B1qICbRh.js +1 -0
- package/dist/chunks/sink-yBIcxQf1.js +1 -0
- package/dist/chunks/sinks-C7weduDR.js +1 -0
- package/dist/chunks/skill-learning-08nEdOJ2.js +5 -0
- package/dist/chunks/skillGapStore-CuvWGqFb.js +5 -0
- package/dist/chunks/skillGapStore-DmMuDXKO.js +1 -0
- package/dist/chunks/skillGenerator-mEMjcmmm.js +8 -0
- package/dist/chunks/skillLearning-B3a-8Ys3.js +1 -0
- package/dist/chunks/skillLearning-q5T6o0mH.js +1 -0
- package/dist/chunks/skillPanel-BuUMhONI.js +28 -0
- package/dist/chunks/skillSearchPanel-BUEv7Sm9.js +21 -0
- package/dist/chunks/skillUsageTracking-BBTiWOKB.js +1 -0
- package/dist/chunks/skills-DvQuQfDW.js +1 -0
- package/dist/chunks/slashCommandParsing-BkTC3GRb.js +1 -0
- package/dist/chunks/sleep-CC8jykQd.js +1 -0
- package/dist/chunks/slowOperations-niPqC54V.js +1 -0
- package/dist/chunks/sprites-C5X62Vyh.js +1 -0
- package/dist/chunks/src-58uAJYF_.js +6 -0
- package/dist/chunks/src-7Y8fx6gl.js +2 -0
- package/dist/chunks/src-BuserDTl.js +1 -0
- package/dist/chunks/src-CMY4XoRy.js +1 -0
- package/dist/chunks/src-CfeAM1FB.js +1 -0
- package/dist/chunks/src-CxT2FDXy.js +1 -0
- package/dist/chunks/src-CyQf7rVu.js +26 -0
- package/dist/chunks/src-DJLbU8sT.js +1 -0
- package/dist/chunks/src-DJQlyVK6.js +5 -0
- package/dist/chunks/src-DNHWYkls.js +53 -0
- package/dist/chunks/src-DU_g0n_Q.js +1 -0
- package/dist/chunks/src-DhqzQjMg.js +19 -0
- package/dist/chunks/src-Duzv1Znh.js +1 -0
- package/dist/chunks/src-OBx6GAig.js +1 -0
- package/dist/chunks/src-WjnK2Dbo.js +1 -0
- package/dist/chunks/src-hjAMxWFj.js +7 -0
- package/dist/chunks/src-lLwoqdC0.js +9 -0
- package/dist/chunks/src-yRsWbJp_.js +2 -0
- package/dist/chunks/sso-oidc-yfC-A2A2.js +1 -0
- package/dist/chunks/startupProfiler-4P7GdVw6.js +3 -0
- package/dist/chunks/startupProfiler-CipS0otN.js +1 -0
- package/dist/chunks/state-9wSimHaL.js +1 -0
- package/dist/chunks/state-BQkyHx88.js +1 -0
- package/dist/chunks/state-CEAUTY3A.js +1 -0
- package/dist/chunks/state-CUZTq6r0.js +1 -0
- package/dist/chunks/state-U0HNbTx8.js +1 -0
- package/dist/chunks/staticRender-BB3CisKd.js +1 -0
- package/dist/chunks/stats-Dyi2U_mq.js +1 -0
- package/dist/chunks/status-CSL-GMou.js +1 -0
- package/dist/chunks/statusNoticeHelpers-BaXE951d.js +1 -0
- package/dist/chunks/stdio-BuUJYJFs.js +3 -0
- package/dist/chunks/stdio-iX0TTmbp.js +1 -0
- package/dist/chunks/stickers-2CRSckfH.js +1 -0
- package/dist/chunks/store-DdfsZvtr.js +1 -0
- package/dist/chunks/stringUtils-U7kMYMJq.js +4 -0
- package/dist/chunks/sts-CJmdeT7s.js +1 -0
- package/dist/chunks/subprocessEnv-DKTILev5.js +1 -0
- package/dist/chunks/subprocessEnv-WjRguKWf.js +1 -0
- package/dist/chunks/supports-color-DaytqqjM.js +1 -0
- package/dist/chunks/systemPromptSections-BnrxBWdc.js +1 -0
- package/dist/chunks/systemPromptSections-Dk6azdAb.js +1 -0
- package/dist/chunks/systemTheme-C1GNqIfy.js +1 -0
- package/dist/chunks/tag-C4cH016L.js +11 -0
- package/dist/chunks/tasks-CEdUW3RQ.js +1 -0
- package/dist/chunks/teamHelpers-CTA_CtTT.js +1 -0
- package/dist/chunks/teamHelpers-D65qZInv.js +1 -0
- package/dist/chunks/teammate-C-FiRloZ.js +1 -0
- package/dist/chunks/teammateModeSnapshot-DWRG5-Us.js +1 -0
- package/dist/chunks/teammateModeSnapshot-DtgsNj1G.js +1 -0
- package/dist/chunks/teleport-C_UgMy0V.js +1 -0
- package/dist/chunks/templateJobs-CMbS0tuk.js +12 -0
- package/dist/chunks/terminalSetup--jwGVap8.js +33 -0
- package/dist/chunks/terminalSetup-zID-wokH.js +1 -0
- package/dist/chunks/theme-C6XwTpVy.js +1 -0
- package/dist/chunks/thinkback-CVLnmLAT.js +1 -0
- package/dist/chunks/thinkback-MeOOO7gf.js +1 -0
- package/dist/chunks/thinkback-play-D7G260F4.js +1 -0
- package/dist/chunks/tmux-DtYJuTWh.js +1 -0
- package/dist/chunks/toolEventObserver-BtC9xDYY.js +1 -0
- package/dist/chunks/toolEventObserver-MfsHAt8h.js +1 -0
- package/dist/chunks/toolPool-CEi_2xIH.js +1 -0
- package/dist/chunks/toolPool-CdYJcCnc.js +1 -0
- package/dist/chunks/trustedDevice-CjQTGAa4.js +1 -0
- package/dist/chunks/trustedDevice-DADcxAAs.js +1 -0
- package/dist/chunks/tui-B8Ijq4Pk.js +6 -0
- package/dist/chunks/turndown.es-T-Xe93nc.js +69 -0
- package/dist/chunks/types-BVelRhgb.js +17 -0
- package/dist/chunks/types-Bqp3meR4.js +1 -0
- package/dist/chunks/types-CNmINIu3.js +1 -0
- package/dist/chunks/types-DgzOOCDl.js +3 -0
- package/dist/chunks/udsClient-ClY_0CKr.js +1 -0
- package/dist/chunks/ultrareviewCommand-CqvHj9Io.js +3 -0
- package/dist/chunks/undercover-CVCVOSrs.js +1 -0
- package/dist/chunks/undercover-CbxiJO2b.js +31 -0
- package/dist/chunks/up-CBJhVVbd.js +12 -0
- package/dist/chunks/updateCCB-DPPpquAw.js +11 -0
- package/dist/chunks/upgrade-DaaHOvft.js +1 -0
- package/dist/chunks/upgrade-k7ZvAWZ0.js +1 -0
- package/dist/chunks/upload-CEDxwMa1.js +1 -0
- package/dist/chunks/upstreamproxy-BtGJ2LRi.js +11 -0
- package/dist/chunks/usage-CsUSu4fb.js +1 -0
- package/dist/chunks/usage-oABvixCs.js +1 -0
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-CBce_-hb.js +1 -0
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-CLYjTZXb.js +1 -0
- package/dist/chunks/useKeybinding-DAQL_dB_.js +1 -0
- package/dist/chunks/useMainLoopModel-QC_H3esG.js +1 -0
- package/dist/chunks/useManageMCPConnections-bf-VfJGD.js +1 -0
- package/dist/chunks/useManagePlugins-CXdYUpit.js +1 -0
- package/dist/chunks/useMergedTools-DERzhQOJ.js +1 -0
- package/dist/chunks/useSearchInput-nqhdILI2.js +1 -0
- package/dist/chunks/useTerminalSize-DzV4aaTi.js +1 -0
- package/dist/chunks/useVoice-CO69xtWC.js +1 -0
- package/dist/chunks/util-C8wqPqv0.js +1 -0
- package/dist/chunks/utils-CDFsSXHr.js +1 -0
- package/dist/chunks/utils-ZO5TryVH.js +1 -0
- package/dist/chunks/v4-DLhvDPkt.js +1 -0
- package/dist/chunks/validatePlugin-C4cd71Yz.js +1 -0
- package/dist/chunks/vertex-sdk-CC3U26o7.js +9 -0
- package/dist/chunks/vim-BNiQx5Vf.js +1 -0
- package/dist/chunks/voice-BCbnJzYL.js +8 -0
- package/dist/chunks/voice-BJyz9KZO.js +8 -0
- package/dist/chunks/voice-CP2ULpju.js +2 -0
- package/dist/chunks/voiceModeEnabled-C-pa8B3Q.js +1 -0
- package/dist/chunks/voiceModeEnabled-CMtRN2pa.js +1 -0
- package/dist/chunks/voiceStreamSTT-31b2u0rj.js +1 -0
- package/dist/chunks/voiceStreamSTT-Fkhm6Ftg.js +1 -0
- package/dist/chunks/voiceStreamSTT-sI-hg-aP.js +1 -0
- package/dist/chunks/web-tools-CLmlPgLk.js +1 -0
- package/dist/chunks/which-C0ex-06E.js +1 -0
- package/dist/chunks/windowsPaths-C5TNvKYu.js +1 -0
- package/dist/chunks/windowsPaths-Kue_7s52.js +1 -0
- package/dist/chunks/workSecret-Dh5Ayceu.js +1 -0
- package/dist/chunks/workerRegistry-B5iWYqpK.js +1 -0
- package/dist/chunks/worktree-BypJA0GB.js +1 -0
- package/dist/chunks/worktreeModeEnabled-DPTdK3JV.js +1 -0
- package/dist/chunks/worktreeModeEnabled-Dtrcn7eD.js +1 -0
- package/dist/chunks/wrapper-BDPb4PTV.js +6 -0
- package/dist/chunks/wrapper-DRTs77RK.js +1 -0
- package/dist/chunks/xdg-BaVL-FHd.js +1 -0
- package/dist/chunks/xml-E8VMPwdJ.js +1 -0
- package/dist/chunks/zod-B_P2Eo_D.js +1 -0
- package/dist/cli-bun.js +2 -0
- package/dist/cli-node.js +2 -0
- package/dist/cli.js +2 -0
- package/dist/vendor/audio-capture/arm64-darwin/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/arm64-linux/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/arm64-win32/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/x64-darwin/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/x64-linux/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/x64-win32/audio-capture.node +0 -0
- package/dist/vendor/ripgrep/x64-win32/rg.exe +0 -0
- package/package.json +233 -0
- package/scripts/postinstall.cjs +389 -0
- package/scripts/run-parallel.mjs +10 -0
- package/scripts/setup-chrome-mcp.mjs +70 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{n as e,o as t,r as n}from"./chunk-DR8-3Aex.js";import{n as r,t as i}from"./figures-fES5sASd.js";import{F as a,Rn as o,b as s,m as c,nt as l,t as u,tt as ee,x as d}from"./src-DNHWYkls.js";import{t as f}from"./jsx-runtime-BTgGEFjL.js";import{Jr as p}from"./growthbook-p4aJ_UMv.js";import{G as m,a as h,o as g,y as _}from"./privacyLevel-CRCHhztk.js";import{D as v,O as y}from"./teammate-C-FiRloZ.js";import{d as b,f as x}from"./stringUtils-U7kMYMJq.js";import{m as te,x as S,y as C}from"./startupProfiler-4P7GdVw6.js";import{n as w,r as T}from"./log-B-Nj3Yed.js";import{$c as E,Ew as D,Fy as ne,GN as O,Iy as re,JE as ie,KN as k,Ly as A,Nc as j,RT as ae,Zc as M,dN as N,dm as oe,hL as se,jc as ce,jy as P,qE as le,qN as F,rl as I,tl as L,um as R,ww as ue,zT as z,zy as B}from"./loadAgentsDir-Bz0FfcVt.js";import{t as V}from"./useKeybinding-DAQL_dB_.js";import{n as de,t as H}from"./useExitOnCtrlCDWithKeybindings-CBce_-hb.js";import*as U from"path";import{randomUUID as fe}from"crypto";oe(),F(),p(),N(),se();async function W({tools:e,mainLoopModel:t,additionalWorkingDirectories:n,mcpClients:r,customSystemPrompt:i}){let[a,o,s]=await Promise.all([i===void 0?R(e,t,n,r):Promise.resolve([]),k(),i===void 0?O():Promise.resolve({})]);return{defaultSystemPrompt:a,userContext:o,systemContext:s}}var G=n({MessageSelector:()=>J,messagesAfterAreOnlySynthetic:()=>X,selectableUserMessagesFilter:()=>ve});function K(e){return e.type===`text`}function q(e){return e===`summarize`||e===`summarize_up_to`}function J({messages:e,onPreRestore:t,onRestoreMessage:n,onRestoreCode:r,onSummarize:a,onClose:o,preselectedMessage:u}){let f=ie(e=>e.fileHistory),[p,m]=(0,Z.useState)(void 0),h=re(),g=(0,Z.useMemo)(fe,[]),_=(0,Z.useMemo)(()=>[...e.filter(ve),{...ce({content:``}),uuid:g}],[e,g]),[v,y]=(0,Z.useState)(_.length-1),b=Math.max(0,Math.min(v-Math.floor($/2),_.length-$)),S=_.length>1,[C,w]=(0,Z.useState)(u),[E,D]=(0,Z.useState)(void 0);(0,Z.useEffect)(()=>{if(!u||!h)return;let e=!1;return A(f,u.uuid).then(t=>{e||D(t)}),()=>{e=!0}},[u,h,f]);let[O,k]=(0,Z.useState)(!1),[j,M]=(0,Z.useState)(null),[N,oe]=(0,Z.useState)(`both`),[se,P]=(0,Z.useState)(``),[le,F]=(0,Z.useState)(``);function I(e){let t=e?[{value:`both`,label:`Restore code and conversation`},{value:`conversation`,label:`Restore conversation`},{value:`code`,label:`Restore code`}]:[{value:`conversation`,label:`Restore conversation`}],n={type:`input`,placeholder:`add context (optional)`,initialValue:``,allowEmptySubmitToCancel:!0,showLabelWithValue:!0,labelValueSeparator:`: `};return t.push({value:`summarize`,label:`Summarize from here`,...n,onChange:P}),process.env.USER_TYPE===`ant`&&t.push({value:`summarize_up_to`,label:`Summarize up to here`,...n,onChange:F}),t.push({value:`nevermind`,label:`Never mind`}),t}(0,Z.useEffect)(()=>{x(`tengu_message_selector_opened`,{})},[]);async function L(e){t(),k(!0);try{await n(e),k(!1),o()}catch(e){T(e),k(!1),m(`Failed to restore the conversation:\n${e}`)}}async function R(t){let n=e.indexOf(t);if(x(`tengu_message_selector_selected`,{index_from_end:e.length-1-n,message_type:t.type,is_current_prompt:!1}),!e.includes(t)){o();return}if(!h){await L(t);return}let r=await A(f,t.uuid);w(t),D(r)}async function z(e){if(x(`tengu_message_selector_restore_option_selected`,{option:e}),!C){m(`Message not found.`);return}if(e===`nevermind`){u?o():w(void 0);return}if(q(e)){t(),k(!0),M(e),m(void 0);try{let t=e===`summarize_up_to`?`up_to`:`from`;await a(C,(t===`up_to`?le:se).trim()||void 0,t),k(!1),M(null),w(void 0),o()}catch(e){T(e),k(!1),M(null),w(void 0),m(`Failed to summarize:\n${e}`)}return}t(),k(!0),m(void 0);let i=null,s=null;if(e===`code`||e===`both`)try{await r(C)}catch(e){i=e,T(i)}if(e===`conversation`||e===`both`)try{await n(C)}catch(e){s=e,T(s)}k(!1),w(void 0),s&&i?m(`Failed to restore the conversation and code:\n${s}\n${i}`):s?m(`Failed to restore the conversation:\n${s}`):i?m(`Failed to restore the code:\n${i}`):o()}let B=de(),V=(0,Z.useCallback)(()=>{if(C&&!u){w(void 0);return}x(`tengu_message_selector_cancelled`,{}),o()},[o,C,u]),H=(0,Z.useCallback)(()=>y(e=>Math.max(0,e-1)),[]),W=(0,Z.useCallback)(()=>y(e=>Math.min(_.length-1,e+1)),[_.length]),G=(0,Z.useCallback)(()=>y(0),[]),K=(0,Z.useCallback)(()=>y(_.length-1),[_.length]),J=(0,Z.useCallback)(()=>{let e=_[v];e&&R(e)},[_,v,R]);ee(`confirm:no`,V,{context:`Confirmation`,isActive:!C}),l({"messageSelector:up":H,"messageSelector:down":W,"messageSelector:top":G,"messageSelector:bottom":K,"messageSelector:select":J},{context:`MessageSelector`,isActive:!O&&!p&&!C&&S});let[Y,me]=(0,Z.useState)({});(0,Z.useEffect)(()=>{async function t(){h&&Promise.all(_.map(async(t,n)=>{if(t.uuid!==g){let r=ne(f,t.uuid),i=_.at(n+1),a=r?_e(e,t.uuid,i?.uuid===g?void 0:i?.uuid):void 0;me(a===void 0?e=>({...e,[n]:void 0}):e=>({...e,[n]:a}))}}))}t()},[_,e,g,f,h]);let X=h&&E?.filesChanged&&E.filesChanged.length>0,ye=!p&&!C&&!u&&S;return(0,Q.jsxs)(d,{flexDirection:`column`,width:`100%`,children:[(0,Q.jsx)(c,{color:`suggestion`}),(0,Q.jsxs)(d,{flexDirection:`column`,marginX:1,gap:1,children:[(0,Q.jsx)(s,{bold:!0,color:`suggestion`,children:`Rewind`}),p&&(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsxs)(s,{color:`error`,children:[`Error: `,p]})}),!S&&(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsx)(s,{children:`Nothing to rewind to yet.`})}),!p&&C&&S&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(s,{children:[`Confirm you want to restore `,!E&&`the conversation `,`to the point before you sent this message:`]}),(0,Q.jsxs)(d,{flexDirection:`column`,paddingLeft:1,borderStyle:`single`,borderRight:!1,borderTop:!1,borderBottom:!1,borderLeft:!0,borderLeftDimColor:!0,children:[(0,Q.jsx)(ge,{userMessage:C,color:`text`,isCurrent:!1}),(0,Q.jsxs)(s,{dimColor:!0,children:[`(`,te(new Date(C.timestamp)),`)`]})]}),(0,Q.jsx)(pe,{selectedRestoreOption:N,canRestoreCode:!!X,diffStatsForRestore:E}),O&&q(j)?(0,Q.jsxs)(d,{flexDirection:`row`,gap:1,children:[(0,Q.jsx)(ue,{}),(0,Q.jsx)(s,{children:`Summarizing…`})]}):(0,Q.jsx)(ae,{isDisabled:O,options:I(!!X),defaultFocusValue:X?`both`:`conversation`,onFocus:e=>oe(e),onChange:e=>z(e),onCancel:()=>u?o():w(void 0)}),X&&(0,Q.jsx)(d,{marginBottom:1,children:(0,Q.jsxs)(s,{dimColor:!0,children:[i.warning,` Rewinding does not affect files edited manually or via bash.`]})})]}),ye&&(0,Q.jsxs)(Q.Fragment,{children:[h?(0,Q.jsx)(s,{children:`Restore the code and/or conversation to the point before…`}):(0,Q.jsx)(s,{children:`Restore and fork the conversation to the point before…`}),(0,Q.jsx)(d,{width:`100%`,flexDirection:`column`,children:_.slice(b,b+$).map((e,t)=>{let n=b+t,r=n===v,a=e.uuid===g,o=n in Y,c=Y[n],l=c?.filesChanged&&c.filesChanged.length;return(0,Q.jsxs)(d,{height:h?3:2,overflow:`hidden`,width:`100%`,flexDirection:`row`,children:[(0,Q.jsx)(d,{width:2,minWidth:2,children:r?(0,Q.jsxs)(s,{color:`permission`,bold:!0,children:[i.pointer,` `]}):(0,Q.jsx)(s,{children:` `})}),(0,Q.jsxs)(d,{flexDirection:`column`,children:[(0,Q.jsx)(d,{flexShrink:1,height:1,overflow:`hidden`,children:(0,Q.jsx)(ge,{userMessage:e,color:r?`suggestion`:void 0,isCurrent:a,paddingRight:10})}),h&&o&&(0,Q.jsx)(d,{height:1,flexDirection:`row`,children:c?(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsx)(s,{dimColor:!r,color:`inactive`,children:l?(0,Q.jsxs)(Q.Fragment,{children:[l===1&&c.filesChanged[0]?`${U.basename(c.filesChanged[0])} `:`${l} files changed `,(0,Q.jsx)(he,{diffStats:c})]}):(0,Q.jsx)(Q.Fragment,{children:`No code changes`})})}):(0,Q.jsxs)(s,{dimColor:!0,color:`warning`,children:[i.warning,` No code restore`]})})]})]},e.uuid)})})]}),!C&&(0,Q.jsx)(s,{dimColor:!0,italic:!0,children:B.pending?(0,Q.jsxs)(Q.Fragment,{children:[`Press `,B.keyName,` again to exit`]}):(0,Q.jsxs)(Q.Fragment,{children:[!p&&S&&`Enter to continue · `,`Esc to exit`]})})]})]})}function Y(e){switch(e){case`summarize`:return`Messages after this point will be summarized.`;case`summarize_up_to`:return`Preceding messages will be summarized. This and subsequent messages will remain unchanged — you will stay at the end of the conversation.`;case`both`:case`conversation`:return`The conversation will be forked.`;case`code`:case`nevermind`:return`The conversation will be unchanged.`}}function pe({selectedRestoreOption:e,canRestoreCode:t,diffStatsForRestore:n}){let r=t&&(e===`both`||e===`code`);return(0,Q.jsxs)(d,{flexDirection:`column`,children:[(0,Q.jsx)(s,{dimColor:!0,children:Y(e)}),!q(e)&&(r?(0,Q.jsx)(me,{diffStatsForRestore:n}):(0,Q.jsx)(s,{dimColor:!0,children:`The code will be unchanged.`}))]})}function me({diffStatsForRestore:e}){if(e===void 0)return;if(!e.filesChanged||!e.filesChanged[0])return(0,Q.jsx)(s,{dimColor:!0,children:`The code has not changed (nothing will be restored).`});let t=e.filesChanged.length,n=``;return n=t===1?U.basename(e.filesChanged[0]||``):t===2?`${U.basename(e.filesChanged[0]||``)} and ${U.basename(e.filesChanged[1]||``)}`:`${U.basename(e.filesChanged[0]||``)} and ${e.filesChanged.length-1} other files`,(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsxs)(s,{dimColor:!0,children:[`The code will be restored `,(0,Q.jsx)(he,{diffStats:e}),` in `,n,`.`]})})}function he({diffStats:e}){if(!(!e||!e.filesChanged))return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(s,{color:`diffAddedWord`,children:[`+`,e.insertions,` `]}),(0,Q.jsxs)(s,{color:`diffRemovedWord`,children:[`-`,e.deletions]})]})}function ge({userMessage:e,color:t,dimColor:n,isCurrent:r,paddingRight:i}){let{columns:o}=a();if(r)return(0,Q.jsx)(d,{width:`100%`,children:(0,Q.jsx)(s,{italic:!0,color:t,dimColor:n,children:`(current)`})});let c=e.message.content,l=typeof c==`string`?null:c[c.length-1],u=g(typeof c==`string`?c.trim():l&&K(l)?l.text.trim():`(no prompt)`);if(E(u))return(0,Q.jsx)(d,{flexDirection:`row`,width:`100%`,children:(0,Q.jsx)(s,{italic:!0,color:t,dimColor:n,children:`((empty message))`})});if(u.includes(`<bash-input>`)){let e=j(u,`bash-input`);if(e)return(0,Q.jsxs)(d,{flexDirection:`row`,width:`100%`,children:[(0,Q.jsx)(s,{color:`bashBorder`,children:`!`}),(0,Q.jsxs)(s,{color:t,dimColor:n,children:[` `,e]})]})}if(u.includes(`<command-message>`)){let e=j(u,_),r=j(u,`command-args`),i=j(u,`skill-format`)===`true`;if(e)return i?(0,Q.jsx)(d,{flexDirection:`row`,width:`100%`,children:(0,Q.jsxs)(s,{color:t,dimColor:n,children:[`Skill(`,e,`)`]})}):(0,Q.jsx)(d,{flexDirection:`row`,width:`100%`,children:(0,Q.jsxs)(s,{color:t,dimColor:n,children:[`/`,e,` `,r]})})}return(0,Q.jsx)(d,{flexDirection:`row`,width:`100%`,children:(0,Q.jsx)(s,{color:t,dimColor:n,children:i?S(u,o-i,!0):u.slice(0,500).split(`
|
|
2
|
+
`).slice(0,4).join(`
|
|
3
|
+
`)})})}function _e(e,t,n){let r=e.findIndex(e=>e.uuid===t);if(r===-1)return;let i=n?e.findIndex(e=>e.uuid===n):e.length;i===-1&&(i=e.length);let a=[],o=0,s=0;for(let t=r+1;t<i;t++){let n=e[t];if(!n||!I(n))continue;let r=n.toolUseResult;if(!(!r||!r.filePath||!r.structuredPatch)){a.includes(r.filePath)||a.push(r.filePath);try{if(`type`in r&&r.type===`create`)o+=r.content.split(/\r?\n/).length;else for(let e of r.structuredPatch){let t=v(e.lines,e=>e.startsWith(`+`)),n=v(e.lines,e=>e.startsWith(`-`));o+=t,s+=n}}catch{}}}return{filesChanged:a,insertions:o,deletions:s}}function ve(e){if(e.type!==`user`||Array.isArray(e.message.content)&&e.message.content[0]?.type===`tool_result`||L(e)||e.isMeta||e.isCompactSummary||e.isVisibleInTranscriptOnly)return!1;let t=e.message.content,n=typeof t==`string`?null:t[t.length-1],r=typeof t==`string`?t.trim():n&&K(n)?n.text.trim():``;return!(r.indexOf(`<local-command-stdout>`)!==-1||r.indexOf(`<local-command-stderr>`)!==-1||r.indexOf(`<bash-stdout>`)!==-1||r.indexOf(`<bash-stderr>`)!==-1||r.indexOf(`<task-notification>`)!==-1||r.indexOf(`<tick>`)!==-1||r.indexOf(`<teammate-message`)!==-1)}function X(e,t){for(let n=t+1;n<e.length;n++){let t=e[n];if(t&&!L(t)&&!I(t)&&t.type!==`progress`&&t.type!==`system`&&t.type!==`attachment`&&!(t.type===`user`&&t.isMeta)){if(t.type===`assistant`){let e=t.message.content;if(Array.isArray(e)&&e.some(e=>e.type===`text`&&e.text.trim()||e.type===`tool_use`))return!1;continue}if(t.type===`user`)return!1}}return!0}var Z,Q,$,ye=e((()=>{r(),o(),Z=t(o()),b(),le(),B(),w(),H(),u(),V(),h(),M(),z(),D(),Q=f(),P(),m(),y(),C(),$=7}));export{ye as n,W as r,G as t};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{a as e,n as t,o as n,r}from"./chunk-DR8-3Aex.js";import{n as i,s as a,u as o}from"./envUtils-CFG7IQID.js";import{n as s,t as c}from"./figures-fES5sASd.js";import{B as l,Cn as u,F as d,Ft as f,In as p,Ln as m,Lt as h,Rn as g,W as _,b as v,m as y,t as b,v as x,x as S,y as C}from"./src-DNHWYkls.js";import{t as w}from"./jsx-runtime-BTgGEFjL.js";import{Ht as T,O as E,P as D,m as O}from"./state-CUZTq6r0.js";import{Gs as k,Gt as A,Jr as ee,Jt as te,Ms as ne,Ql as re,R as j,Tc as M,U as N,V as P,Yl as F,Zr as ie,_s as I,ir as L,ls as R,nt as z,qt as ae,ri as oe,sr as se,st as ce,wc as le,wl as B,xl as ue,xs as de}from"./growthbook-p4aJ_UMv.js";import{E as fe,_ as pe,l as me,p as V}from"./debug-CjIaNjpK.js";import{n as he,t as ge}from"./cwd-B2guYBbl.js";import{L as _e,j as ve}from"./state-BQkyHx88.js";import{F as ye,G as be,M as xe,N as Se}from"./privacyLevel-CRCHhztk.js";import{a as Ce,c as we}from"./stringUtils-U7kMYMJq.js";import{n as Te,r as Ee}from"./analytics-i6X1et4O.js";import{c as De,f as Oe,m as ke,s as Ae,x as je,y as Me}from"./startupProfiler-4P7GdVw6.js";import{f as Ne,m as Pe}from"./oauth-DMPGYAoZ.js";import{a as Fe,n as Ie}from"./env-CesrOJJq.js";import{n as Le,t as Re}from"./sleep-CC8jykQd.js";import{$I as ze,$N as Be,BA as Ve,BE as He,Bw as Ue,FF as We,Gc as Ge,IF as Ke,Iw as qe,JP as Je,J_ as Ye,KP as Xe,KT as Ze,Kc as Qe,Mc as $e,Ml as et,Nc as tt,Pl as nt,QN as rt,QP as it,Ra as at,Rl as ot,UC as st,UD as ct,Uc as lt,Ul as ut,VA as dt,WC as ft,WD as pt,Wa as mt,Wc as ht,XP as gt,Xc as _t,Xj as vt,Xl as yt,YN as bt,YP as xt,YT as St,Yj as Ct,Yl as wt,ZI as Tt,ZP as Et,Zc as Dt,al as Ot,cc as kt,cl as At,d_ as jt,db as Mt,df as Nt,eF as Pt,eP as Ft,e_ as It,el as Lt,f_ as Rt,ff as zt,gc as Bt,gf as Vt,hc as Ht,hf as Ut,hs as Wt,iA as Gt,iE as Kt,ll as qt,mf as Jt,nE as Yt,oc as Xt,oy as Zt,pf as Qt,pl as $t,qT as en,rA as tn,sc as nn,tF as rn,t_ as an,ty as on,ub as sn,vT as cn,vs as ln,xc as un,zE as dn}from"./loadAgentsDir-Bz0FfcVt.js";import{a as fn,i as pn,n as mn,r as hn}from"./debug-BDBIipC1.js";import{f as gn,p as _n}from"./xml-E8VMPwdJ.js";import{r as vn,s as yn}from"./rcDebugLog-BbHlIxCm.js";import{t as bn}from"./useTerminalSize-DzV4aaTi.js";import{n as xn,r as Sn,t as Cn}from"./browser-D1vC3BNd.js";import{d as wn,f as Tn,h as En,p as Dn}from"./terminalSetup--jwGVap8.js";import{n as On,t as kn}from"./SentryErrorBoundary-BVfBaOOU.js";import{a as An,o as jn,r as Mn,s as Nn,t as Pn}from"./referral-BfAZEIZL.js";import{n as Fn,s as In}from"./releaseNotes-DveQShyB.js";import{a as Ln,c as Rn,d as zn,i as Bn,l as Vn,n as Hn,o as Un,r as Wn,t as Gn,u as Kn}from"./logoV2Utils-D5SpeZ3C.js";import{n as qn,r as Jn}from"./PromptInputFooterSuggestions-CcsKj5DK.js";import{n as Yn,t as Xn}from"./useMainLoopModel-QC_H3esG.js";import{n as Zn,t as Qn}from"./modalContext-B1b0Gsro.js";import{i as $n,n as er,r as tr,s as nr,t as rr}from"./OverageCreditUpsell-D_td1ss4.js";import{n as ir,r as ar,t as or}from"./statusNoticeHelpers-BaXE951d.js";import{n as sr,r as cr,t as lr}from"./Message-DNxJ_tMS.js";import{homedir as ur}from"os";import{join as dr,relative as fr}from"path";import{fileURLToPath as pr}from"url";function mr(e,t){for(let n of e)if(!t.has(n))return!1;return!0}var hr=t((()=>{}));function gr(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`)||tt(t.text,`status`)!==`completed`?!1:tt(t.text,`summary`)?.startsWith(`Background command `)??!1}function _r(e,t){if(!Kt()||t)return e;let n=[],r=0;for(;r<e.length;){let t=e[r];if(gr(t)){let i=0;for(;r<e.length&&gr(e[r]);)i++,r++;i===1?n.push(t):n.push({...t,message:{role:`user`,content:[{type:`text`,text:`<${ye}><${xe}>completed</${xe}><${Se}>${i} background commands completed</${Se}></${ye}>`}]}})}else n.push(t),r++}return n}var vr=t((()=>{be(),Ye(),Yt(),Dt()}));function yr(e){return e.type===`system`&&e.subtype===`stop_hook_summary`&&e.hookLabel!==void 0}function br(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(yr(r)){let i=r.hookLabel,a=[];for(;n<e.length;){let t=e[n];if(!yr(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 xr=t((()=>{}));function Sr(e){return e.type===`attachment`&&e.attachment.type===`task_status`&&e.attachment.taskType===`in_process_teammate`&&e.attachment.status===`completed`}function Cr(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(Sr(r)){let i=0;for(;n<e.length&&Sr(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 wr=t((()=>{}));function Tr(e){let t=Or.get(e);return t||(t=new Set(e.filter(e=>e.renderGroupedToolUse).map(e=>e.name)),Or.set(e,t)),t}function Er(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 Dr(e,t,n=!1){if(n)return{messages:e};let r=Tr(t),i=new Map;for(let t of e){let e=Er(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=Er(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=Er(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 Or,kr=t((()=>{Or=new WeakMap}));function Ar(e){let t=Ir.get(e);if(t!==void 0)return t;let n=jr(e).toLowerCase();return Ir.set(e,n),n}function jr(e){let t=``;switch(e.type){case`user`:{let n=e.message.content;if(typeof n==`string`)t=Fr.has(n)?``:n;else{let r=[];for(let t of n??[])t.type===`text`?Fr.has(t.text)||r.push(t.text):t.type===`tool_result`&&r.push(Nr(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`?[Mr(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(Pr,r);if(e<0)break;n=n.slice(0,r)+n.slice(e+18),r=n.indexOf(`<system-reminder>`)}return n}function Mr(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 Nr(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 Pr,Fr,Ir,Lr=t((()=>{Dt(),Pr=`</system-reminder>`,Fr=new Set([nn,kt]),Ir=new WeakMap}));function Rr({pose:e=`default`}={}){if(Ie.terminal===`Apple_Terminal`)return(0,H.jsx)(zr,{pose:e});let t=Br[e];return(0,H.jsxs)(S,{flexDirection:`column`,children:[(0,H.jsxs)(v,{children:[(0,H.jsx)(v,{color:`clawd_body`,children:t.r1L}),(0,H.jsx)(v,{color:`clawd_body`,backgroundColor:`clawd_background`,children:t.r1E}),(0,H.jsx)(v,{color:`clawd_body`,children:t.r1R})]}),(0,H.jsxs)(v,{children:[(0,H.jsx)(v,{color:`clawd_body`,children:t.r2L}),(0,H.jsx)(v,{color:`clawd_body`,backgroundColor:`clawd_background`,children:`█████`}),(0,H.jsx)(v,{color:`clawd_body`,children:t.r2R})]}),(0,H.jsxs)(v,{color:`clawd_body`,children:[` `,`▘▘ ▝▝`,` `]})]})}function zr({pose:e}){return(0,H.jsxs)(S,{flexDirection:`column`,alignItems:`center`,children:[(0,H.jsxs)(v,{children:[(0,H.jsx)(v,{color:`clawd_body`,children:`▗`}),(0,H.jsx)(v,{color:`clawd_background`,backgroundColor:`clawd_body`,children:Vr[e]}),(0,H.jsx)(v,{color:`clawd_body`,children:`▖`})]}),(0,H.jsx)(v,{backgroundColor:`clawd_body`,children:` `.repeat(7)}),(0,H.jsx)(v,{color:`clawd_body`,children:`▘▘ ▝▝`})]})}var H,Br,Vr,Hr=t((()=>{g(),b(),Fe(),H=w(),Br={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:`▛ `}},Vr={default:` ▗ ▖ `,"look-left":` ▘ ▘ `,"look-right":` ▝ ▝ `,"arms-up":` ▗ ▖ `}}));function Ur(){let[e,t]=(0,Wr.useState)(null);return(0,Wr.useEffect)(()=>{let e=!0;return vt().then(n=>{e&&t(n)}).catch(()=>{}),()=>{e=!1}},[]),!e||e.kind===`off`?null:e.kind===`verified`?(0,Gr.jsxs)(v,{dimColor:!0,children:[`zanii ✓ proof verified · log #`,e.size,` · root `,e.root]}):(0,Gr.jsxs)(v,{dimColor:!0,children:[`zanii ledger live · `,e.receipts??e.size,` receipts · root `,e.root]})}var Wr,Gr,Kr=t((()=>{g(),b(),Wr=n(g(),1),Ct(),Gr=w()}));function qr(e){let{title:t,lines:n,footer:r,emptyMessage:i,customContent:a}=e,o=u(t);if(a!==void 0)o=Math.max(o,a.width);else if(n.length===0&&i)o=Math.max(o,u(i));else{let e=Math.max(0,...n.map(e=>e.timestamp?u(e.timestamp):0));for(let t of n){let n=e>0?e:0,r=u(t.text)+(n>0?n+2:0);o=Math.max(o,r)}}return r&&(o=Math.max(o,u(r))),o}function Jr({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?u(e.timestamp):0));return(0,U.jsxs)(S,{flexDirection:`column`,width:t,children:[(0,U.jsx)(v,{bold:!0,color:`claude`,children:n}),o?(0,U.jsxs)(U.Fragment,{children:[o.content,i&&(0,U.jsx)(v,{dimColor:!0,italic:!0,children:je(i,t)})]}):r.length===0&&a?(0,U.jsx)(v,{dimColor:!0,children:je(a,t)}):(0,U.jsxs)(U.Fragment,{children:[r.map((e,n)=>{let r=Math.max(10,t-(s>0?s+2:0));return(0,U.jsxs)(v,{children:[s>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(v,{dimColor:!0,children:(e.timestamp||``).padEnd(s)}),` `]}),(0,U.jsx)(v,{children:je(e.text,r)})]},n)}),i&&(0,U.jsx)(v,{dimColor:!0,italic:!0,children:je(i,t)})]})]})}var U,Yr=t((()=>{g(),b(),Me(),U=w()}));function Xr({feeds:e,maxWidth:t}){let n=e.map(e=>qr(e)),r=Math.max(...n),i=Math.min(r,t);return(0,Qr.jsx)(S,{flexDirection:`column`,children:e.map((t,n)=>(0,Qr.jsxs)(Zr.Fragment,{children:[(0,Qr.jsx)(Jr,{config:t,actualWidth:i}),n<e.length-1&&(0,Qr.jsx)(y,{color:`claude`,width:i})]},n))})}var Zr,Qr,$r=t((()=>{Zr=n(g(),1),b(),Yr(),Qr=w()}));function ei(e){let t=e.map(e=>{let t=ke(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 ti(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 ni(e){let t=e.filter(({isEnabled:e})=>e).sort((e,t)=>Number(e.isComplete)-Number(t.isComplete)).map(({text:e,isComplete:t})=>({text:`${t?`${c.tick} `:``}${e}`})),n=ge()===ur()?`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 ri(){let e=An(),t=e?`Share Claude Code and earn ${Mn(e)} of extra usage`:`Share Claude Code with friends`;return{title:`3 guest passes`,lines:[],customContent:{content:(0,ii.jsxs)(ii.Fragment,{children:[(0,ii.jsx)(S,{marginY:1,children:(0,ii.jsx)(v,{color:`claude`,children:`[✻] [✻] [✻]`})}),(0,ii.jsx)(v,{dimColor:!0,children:t})]}),width:48},footer:`/passes`}}var ii,ai=t((()=>{s(),b(),Nn(),he(),Me(),ii=w()}));function oi(){return li===void 0&&(li=ci()??`dark`),li}function si(e){return e===`auto`?oi():e}function ci(){let e=process.env.COLORFGBG;if(!e)return;let t=e.split(`;`),n=t[t.length-1];if(n===void 0||n===``)return;let r=Number(n);if(!(!Number.isInteger(r)||r<0||r>15))return r<=6||r===8?`dark`:`light`}var li,ui=t((()=>{}));function di(e,t,n){return Array.from({length:n},()=>({pose:e,offset:t}))}function fi(){let{pose:e,bounceOffset:t,onClick:n}=pi();return(0,hi.jsx)(S,{height:xi,flexDirection:`column`,onClick:n,children:(0,hi.jsx)(S,{marginTop:t,flexShrink:0,children:(0,hi.jsx)(Rr,{pose:e})})})}function pi(){let[e]=(0,mi.useState)(()=>ne().prefersReducedMotion??!1),[t,n]=(0,mi.useState)(-1),r=(0,mi.useRef)(gi),i=()=>{e||t!==-1||(r.current=_i[Math.floor(Math.random()*_i.length)],n(0))};(0,mi.useEffect)(()=>{if(t===-1)return;if(t>=r.current.length){n(-1);return}let e=setTimeout(n,yi,bi);return()=>clearTimeout(e)},[t]);let a=r.current,o=t>=0&&t<a.length?a[t]:vi;return{pose:o.pose,bounceOffset:o.offset,onClick:i}}var mi,hi,gi,_i,vi,yi,bi,xi,Si=t((()=>{g(),mi=n(g(),1),b(),k(),Hr(),hi=w(),gi=[...di(`default`,1,2),...di(`arms-up`,0,3),...di(`default`,0,1),...di(`default`,1,2),...di(`arms-up`,0,3),...di(`default`,0,1)],_i=[gi,[...di(`look-right`,0,5),...di(`look-left`,0,5),...di(`default`,0,1)]],vi={pose:`default`,offset:0},yi=60,bi=e=>e+1,xi=3}));function Ci(){let e=jn();e==null||e<=0||e>(R().passesLastSeenRemaining??0)&&de(t=>({...t,passesUpsellSeenCount:0,hasVisitedPasses:!1,passesLastSeenRemaining:e}))}function wi(){let{eligible:e,hasCache:t}=Pn();if(!e||!t)return!1;Ci();let n=R();return!((n.passesUpsellSeenCount??0)>=3||n.hasVisitedPasses)}function Ti(){let[e]=(0,Oi.useState)(()=>wi());return e}function Ei(){let e=0;de(t=>(e=(t.passesUpsellSeenCount??0)+1,{...t,passesUpsellSeenCount:e})),Ee(`tengu_guest_passes_upsell_shown`,{seen_count:e})}function Di(){let e=An();return(0,ki.jsxs)(v,{dimColor:!0,children:[(0,ki.jsx)(v,{color:`claude`,children:`[✻]`}),` `,(0,ki.jsx)(v,{color:`claude`,children:`[✻]`}),` `,(0,ki.jsx)(v,{color:`claude`,children:`[✻]`}),` ·`,` `,e?`Share Claude Code and earn ${Mn(e)} of extra usage · /passes`:`3 guest passes at /passes`]})}var Oi,ki,Ai=t((()=>{g(),Oi=n(g(),1),b(),Te(),Nn(),I(),ki=w()}));function ji(){let{columns:e}=d(),t=He(e=>e.agent),n=He(e=>e.effortValue),r=Yn(),i=oe(r),{version:a,cwd:o,billingType:s,agentName:c}=Un(),l=t??c,f=Ti(),p=nr();(0,Mi.useEffect)(()=>{f&&Ei()},[f]),(0,Mi.useEffect)(()=>{p&&!f&&tr()},[p,f]);let m=Math.max(e-15,20),h=je(a,Math.max(m-13,6)),{shouldSplit:g,truncatedModel:_,truncatedBilling:y}=Wn(i+qe(r,n),s,m),b=l?m-1-u(l)-3:m,x=zn(o,Math.max(b,10));return(0,W.jsx)(sn,{children:(0,W.jsxs)(S,{flexDirection:`row`,gap:2,alignItems:`center`,children:[Kt()?(0,W.jsx)(fi,{}):(0,W.jsx)(Rr,{}),(0,W.jsxs)(S,{flexDirection:`column`,children:[(0,W.jsxs)(v,{children:[(0,W.jsx)(v,{bold:!0,children:`Claude Code`}),` `,(0,W.jsxs)(v,{dimColor:!0,children:[`v`,h]})]}),g?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(v,{dimColor:!0,children:_}),(0,W.jsx)(v,{dimColor:!0,children:y})]}):(0,W.jsxs)(v,{dimColor:!0,children:[_,` · `,y]}),(0,W.jsx)(v,{dimColor:!0,children:l?`@${l} · ${x}`:x}),f&&(0,W.jsx)(Di,{}),!f&&p&&(0,W.jsx)(rr,{maxWidth:m,twoLine:!0})]})]})})}var Mi,W,Ni=t((()=>{Mi=n(g(),1),Xn(),bn(),b(),dn(),Ue(),Me(),Yt(),Kn(),ee(),Mt(),Si(),Hr(),Ai(),$n(),W=w()}));function Pi(e){zi&&(Ae().mark(e),Li&&Bi.push(process.memoryUsage()))}function Fi(){return Li}function Ii(){return dr(i(),`startup-perf`,`${ve()}.txt`)}var Li,Ri,zi,Bi,Vi=t((()=>{_e(),me(),a(),pe(),De(),fe(),Li=o(process.env.CLAUDE_CODE_PROFILE_STARTUP),Ri=process.env.USER_TYPE===`ant`||Math.random()<.005,zi=Li||Ri,Bi=[],zi&&Pi(`profiler_initialized`)}));function Hi(){let e=(0,Wi.useMemo)(Ui,[]),t=(0,Wi.useMemo)(()=>A().lastShownEmergencyTip,[]),n=e.tip&&e.tip!==t;return(0,Wi.useEffect)(()=>{n&&te(t=>t.lastShownEmergencyTip===e.tip?t:{...t,lastShownEmergencyTip:e.tip})},[n,e.tip]),n?(0,Gi.jsx)(S,{paddingLeft:2,flexDirection:`column`,children:(0,Gi.jsx)(v,{...e.color===`warning`?{color:`warning`}:e.color===`error`?{color:`error`}:{dimColor:!0},children:e.tip})}):null}function Ui(){return L(Ki,qi)}var Wi,Gi,Ki,qi,Ji=t((()=>{g(),Wi=n(g(),1),b(),se(),ae(),Gi=w(),Ki=`tengu-top-of-feed-tip`,qi={tip:``,color:`dim`}}));function Yi({char:e=`✻`}){let[t]=(0,Xi.useState)(()=>ne().prefersReducedMotion??!1),[n,r]=(0,Xi.useState)(t),i=(0,Xi.useRef)(null),[a,o]=l(n?null:50);return(0,Xi.useEffect)(()=>{if(n)return;let e=setTimeout(r,$i,!0);return()=>clearTimeout(e)},[n]),n?(0,Zi.jsx)(S,{ref:a,children:(0,Zi.jsx)(v,{color:ea,children:e})}):(i.current===null&&(i.current=o),(0,Zi.jsx)(S,{ref:a,children:(0,Zi.jsx)(v,{color:St(Ze((o-i.current)/Qi*360%360)),children:e})}))}var Xi,Zi,Qi,$i,ea,ta=t((()=>{g(),Xi=n(g(),1),B(),b(),k(),en(),Zi=w(),Qi=1500,$i=Qi*2,ea=St({r:153,g:153,b:153})}));function na(){return ie()&&(R().opus1mMergeNoticeSeenCount??0)<oa}function ra(){let[e]=(0,ia.useState)(na);return(0,ia.useEffect)(()=>{if(!e)return;let t=(R().opus1mMergeNoticeSeenCount??0)+1;de(e=>(e.opus1mMergeNoticeSeenCount??0)>=t?e:{...e,opus1mMergeNoticeSeenCount:t})},[e]),e?(0,aa.jsxs)(S,{paddingLeft:2,children:[(0,aa.jsx)(Yi,{char:`↑`}),(0,aa.jsx)(v,{dimColor:!0,children:` Opus now defaults to 1M context · 5x more room, same pricing`})]}):null}var ia,aa,oa,sa=t((()=>{g(),ia=n(g(),1),B(),b(),I(),ee(),ta(),aa=w(),oa=6}));function ca(){return(0,da.jsx)(la,{})}function la(){let[e]=(0,ua.useState)(()=>ln()&&ne().voiceEnabled!==!0&&(R().voiceNoticeSeenCount??0)<fa&&!na());return(0,ua.useEffect)(()=>{if(!e)return;let t=(R().voiceNoticeSeenCount??0)+1;de(e=>(e.voiceNoticeSeenCount??0)>=t?e:{...e,voiceNoticeSeenCount:t})},[e]),e?(0,da.jsxs)(S,{paddingLeft:2,children:[(0,da.jsx)(Yi,{}),(0,da.jsx)(v,{dimColor:!0,children:` Voice mode is now available · /voice to enable`})]}):null}var ua,da,fa,pa=t((()=>{g(),ua=n(g(),1),b(),I(),k(),Wt(),ta(),sa(),da=w(),fa=3}));function ma(){return null}var ha=t((()=>{}));function ga(){return null}var _a=t((()=>{})),va=r({ChannelsNotice:()=>ya,findUnmatched:()=>xa});function ya(){let[{channels:e,list:t,unmatched:n}]=(0,Sa.useState)(()=>{let e=O();return e.length===0?{channels:e,list:``,unmatched:[]}:{channels:e,list:e.map(ba).join(`, `),unmatched:xa(e)}});if(e.length===0)return null;let r=e.some(e=>!e.dev),i=E()&&r?`Channels`:E()?`--dangerously-load-development-channels`:`--channels`;return(0,Ca.jsxs)(S,{paddingLeft:2,flexDirection:`column`,children:[(0,Ca.jsxs)(v,{color:`error`,children:[`Listening for channel messages from: `,t]}),(0,Ca.jsxs)(v,{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,Ca.jsxs)(v,{color:`warning`,children:[ba(e.entry),` · `,e.why]},`${ba(e.entry)}:${e.why}`))]})}function ba(e){return e.kind===`plugin`?`plugin:${e.name}@${e.marketplace}`:`server:${e.name}`}function xa(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(ct(n).servers))t.add(e);return t})(),r=t?.installedPluginIds??(()=>{let e=new Set(Object.keys(mt().plugins)),t=gn();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 Sa,Ca,wa=t((()=>{g(),Sa=n(g(),1),T(),_n(),b(),pt(),at(),Ca=w()}));function Ta(){let e=Rn(),t=A().oauthAccount?.displayName??``,{columns:n}=d(),r=En(),i=Ve.isSandboxingEnabled(),a=Ti(),o=nr(),s=He(e=>e.agent),c=He(e=>e.effortValue),l=A(),f;try{f=Vn(3)}catch{f=[]}let[p]=(0,Ea.useState)(()=>{let e=on().companyAnnouncements;if(!(!e||e.length===0))return l.numStartups===1?e[0]:e[Math.floor(Math.random()*e.length)]}),{hasReleaseNotes:m}=Fn(l.lastReleaseNotesSeen);(0,Ea.useEffect)(()=>{A().lastReleaseNotesSeen!==`2.8.4`&&(te(e=>e.lastReleaseNotesSeen===`2.8.4`?e:{...e,lastReleaseNotesSeen:`2.8.4`}),r&&Tn())},[l,r]);let h=!m&&!r&&!Pe(process.env.CLAUDE_CODE_FORCE_FULL_LOGO);(0,Ea.useEffect)(()=>{a&&!r&&!h&&Ei()},[a,r,h]),(0,Ea.useEffect)(()=>{o&&!r&&!a&&!h&&tr()},[o,r,a,h]);let g=Yn(),_=oe(g),{version:y,cwd:b,billingType:C,agentName:w}=Un(),T=s??w,E=je(_+qe(g,c),Oa-20);if(!m&&!r&&!Pe(process.env.CLAUDE_CODE_FORCE_FULL_LOGO))return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(ji,{}),(0,G.jsx)(ca,{}),(0,G.jsx)(ra,{}),Da&&(0,G.jsx)(Da.ChannelsNotice,{}),pn()&&(0,G.jsxs)(S,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(v,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(v,{dimColor:!0,children:[`Logging to: `,fn()?`stderr`:mn()]})]}),(0,G.jsx)(Hi,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,G.jsxs)(S,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(v,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,G.jsx)(v,{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`})]}),p&&(0,G.jsxs)(S,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&l.oauthAccount?.organizationName&&(0,G.jsxs)(v,{dimColor:!0,children:[`Message from `,l.oauthAccount.organizationName,`:`]}),(0,G.jsx)(v,{children:p})]}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsx)(S,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(v,{dimColor:!0,children:`Use /issue to report model behavior issues`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsxs)(S,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(v,{color:`warning`,children:`[ANT-ONLY] Logs:`}),(0,G.jsxs)(v,{dimColor:!0,children:[`API calls: `,F(tn())]}),(0,G.jsxs)(v,{dimColor:!0,children:[`Debug logs: `,F(mn())]}),Fi()&&(0,G.jsxs)(v,{dimColor:!0,children:[`Startup Perf: `,F(Ii())]})]}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(ma,{}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(ga,{})]});let D=Ln(n),O=si(A().theme),k=` ${x(`claude`,O)(`Claude Code Zanii`)} ${x(`inactive`,O)(`v${y}`)} `,ee=x(`claude`,O)(` Claude Code Zanii `);if(D===`compact`){let e=Bn(t);u(e)>n-4&&(e=Bn(null));let r=T?n-4-1-u(T)-3:n-4,a=zn(b,Math.max(r,10));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(sn,{children:(0,G.jsxs)(S,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:ee,position:`top`,align:`start`,offset:1},paddingX:1,paddingY:1,alignItems:`center`,width:n,children:[(0,G.jsx)(v,{bold:!0,children:e}),(0,G.jsx)(S,{marginY:1,children:(0,G.jsx)(Rr,{})}),(0,G.jsx)(v,{dimColor:!0,children:E}),(0,G.jsx)(v,{dimColor:!0,children:C}),(0,G.jsx)(v,{dimColor:!0,children:T?`@${T} · ${a}`:a}),(0,G.jsx)(Ur,{})]})}),(0,G.jsx)(ca,{}),(0,G.jsx)(ra,{}),Da&&(0,G.jsx)(Da.ChannelsNotice,{}),i&&(0,G.jsx)(S,{marginTop:1,flexDirection:`column`,children:(0,G.jsx)(v,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(ma,{}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(ga,{})]})}let ne=Bn(t),re=!process.env.IS_DEMO&&l.oauthAccount?.organizationName?`${E} · ${C} · ${l.oauthAccount.organizationName}`:`${E} · ${C}`,j=T?Oa-1-u(T)-3:Oa,M=zn(b,Math.max(j,10)),N=T?`@${T} · ${M}`:M,{leftWidth:P,rightWidth:ie}=Gn(n,D,Hn(ne,N,re));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(sn,{children:(0,G.jsx)(S,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:k,position:`top`,align:`start`,offset:3},children:(0,G.jsxs)(S,{flexDirection:D===`horizontal`?`row`:`column`,paddingX:1,gap:1,children:[(0,G.jsxs)(S,{flexDirection:`column`,width:P,justifyContent:`space-between`,alignItems:`center`,minHeight:9,children:[(0,G.jsx)(S,{marginTop:1,children:(0,G.jsx)(v,{bold:!0,children:ne})}),(0,G.jsx)(Rr,{}),(0,G.jsxs)(S,{flexDirection:`column`,alignItems:`center`,children:[(0,G.jsx)(v,{dimColor:!0,children:re}),(0,G.jsx)(v,{dimColor:!0,children:N}),(0,G.jsx)(Ur,{})]})]}),D===`horizontal`&&(0,G.jsx)(S,{height:`100%`,borderStyle:`single`,borderColor:`claude`,borderDimColor:!0,borderTop:!1,borderBottom:!1,borderLeft:!1}),D===`horizontal`&&(0,G.jsx)(Xr,{feeds:r?[ni(wn()),ei(e)]:a?[ei(e),ri()]:o?[ei(e),er()]:[ei(e),ti(f)],maxWidth:ie})]})})}),(0,G.jsx)(ca,{}),(0,G.jsx)(ra,{}),Da&&(0,G.jsx)(Da.ChannelsNotice,{}),pn()&&(0,G.jsxs)(S,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(v,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(v,{dimColor:!0,children:[`Logging to: `,fn()?`stderr`:mn()]})]}),(0,G.jsx)(Hi,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,G.jsxs)(S,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(v,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,G.jsx)(v,{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`})]}),p&&(0,G.jsxs)(S,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&l.oauthAccount?.organizationName&&(0,G.jsxs)(v,{dimColor:!0,children:[`Message from `,l.oauthAccount.organizationName,`:`]}),(0,G.jsx)(v,{children:p})]}),i&&(0,G.jsx)(S,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(v,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsx)(S,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(v,{dimColor:!0,children:`Use /issue to report model behavior issues`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsxs)(S,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(v,{color:`warning`,children:`[ANT-ONLY] Logs:`}),(0,G.jsxs)(v,{dimColor:!0,children:[`API calls: `,F(tn())]}),(0,G.jsxs)(v,{dimColor:!0,children:[`Debug logs: `,F(mn())]}),Fi()&&(0,G.jsxs)(v,{dimColor:!0,children:[`Startup Perf: `,F(Ii())]})]}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(ma,{}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(ga,{})]})}var Ea,G,Da,Oa,ka=t((()=>{g(),b(),bn(),Kn(),Me(),re(),Hr(),Kr(),$r(),ai(),ae(),ui(),Zt(),hn(),Ea=n(g(),1),Dn(),Ni(),Mt(),In(),Gt(),Ne(),Vi(),Ji(),pa(),sa(),ha(),_a(),G=w(),dt(),Ai(),$n(),dn(),Ue(),Xn(),ee(),Da=(wa(),e(va)),Oa=50}));function Aa({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,ja.jsx)(S,{minWidth:u(i)+8,children:(0,ja.jsx)(v,{dimColor:!0,children:i})})}var ja,Ma=t((()=>{g(),b(),ja=w()}));function Na({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,Pa.jsx)(S,{minWidth:u(n),children:(0,Pa.jsx)(v,{dimColor:!0,children:n})})}var Pa,Fa=t((()=>{g(),b(),Pa=w()}));function Ia(e,t,n,r){for(let i=t+1;i<e.length;i++){let t=e[i];if(t?.type===`assistant`){let e=Ua(t.message.content);if(e?.type===`thinking`||e?.type===`redacted_thinking`||e?.type===`tool_use`&&(Qt(e.name,e.input,n).isCollapsible||r.has(e.id)))continue;return!0}if(!(t?.type===`system`||t?.type===`attachment`)&&!(t?.type===`user`&&Ua(t.message.content)?.type===`tool_result`)){if(t?.type===`grouped_tool_use`){let e=Ua(t.messages[0]?.message.content)?.input;if(Qt(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&&(Ut(e,o)||m&&!n),x=v?e.displayMessage:y?zt(e):e,C=v||y?[]:lt(e,h),w=ss(e,s,o,v||y?Xt:ht(e,h),c,h),T=!1;if(l)if(v)T=e.messages.some(e=>{let t=Ua(e.message.content);return t?.type===`tool_use`&&o.has(t.id)});else if(y)T=Ut(e,o);else{let t=Ge(e);T=!t||o.has(t)}let E=_&&x.type===`assistant`&&Array.isArray(x.message.content)&&x.message.content.some(e=>e.type===`text`)&&(x.timestamp||x.message.model),D=(0,Ha.jsx)(lr,{message:e,lookups:h,addMargin:!E,containerWidth:E?void 0:p,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,progressMessagesForMessage:C,shouldAnimate:T,shouldShowDot:!0,isTranscriptMode:_,isStatic:w,onOpenRateLimitOptions:u,isActiveCollapsedGroup:b,isUserContinuation:t,lastThinkingBlockId:d,latestBashOutputUUID:f,shouldCollapseDiffs:g});return E?(0,Ha.jsx)(sn,{children:(0,Ha.jsxs)(S,{width:p,flexDirection:`column`,children:[(0,Ha.jsxs)(S,{flexDirection:`row`,justifyContent:`flex-end`,gap:1,marginTop:1,children:[(0,Ha.jsx)(Na,{message:x,isTranscriptMode:_}),(0,Ha.jsx)(Aa,{message:x,isTranscriptMode:_})]}),D]})}):(0,Ha.jsx)(sn,{children:D})}function Ra(e,t){if(e.type===`grouped_tool_use`)return e.messages.some(e=>{let n=Ua(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return Jt(e).some(e=>t.has(e));let n=Ge(e);return!!n&&t.has(n)}function za(e,t){if(e.type===`grouped_tool_use`)return e.messages.every(e=>{let n=Ua(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return Jt(e).every(e=>t.has(e));if(e.type===`assistant`){let n=Ua(e.message.content);if(n?.type===`server_tool_use`)return t.has(n.id)}let n=Ge(e);return!n||t.has(n)}function Ba(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&&sr(t.message))return!1;let n=Ra(e.message,e.streamingToolUseIDs),r=za(e.message,e.lookups.resolvedToolUseIDs);return!(n||!r)}var Va,Ha,Ua,Wa,Ga=t((()=>{Va=n(g(),1),b(),Vt(),Dt(),cr(),Ha=w(),Ma(),vs(),Fa(),Mt(),Ua=e=>{if(!Array.isArray(e))return;let t=e[0];if(!(t==null||typeof t==`string`))return t},Wa=Va.memo(La,Ba)}));function Ka(e){return e.type===`attachment`&&qa.has(e.attachment.type)}var qa,Ja=t((()=>{qa=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 Ya(e){return no.filter(t=>t.isActive(e))}var K,Xa,Za,Qa,$a,eo,to,no,ro=t((()=>{b(),g(),Ft(),s(),he(),Me(),z(),ar(),nt(),wt(),K=w(),Xa={id:`large-memory-files`,type:`warning`,isActive:e=>rt(e.memoryFiles).length>0,render:e=>(0,K.jsx)(K.Fragment,{children:rt(e.memoryFiles).map(e=>{let t=e.path.startsWith(ge())?fr(ge(),e.path):e.path;return(0,K.jsxs)(S,{flexDirection:`row`,children:[(0,K.jsx)(v,{color:`warning`,children:c.warning}),(0,K.jsxs)(v,{color:`warning`,children:[`Large `,(0,K.jsx)(v,{bold:!0,children:t}),` will impact performance (`,Oe(e.content.length),` chars > `,Oe(bt),`)`,(0,K.jsx)(v,{dimColor:!0,children:` · /memory to edit`})]})]},e.path)})})},Za={id:`claude-ai-external-token`,type:`warning`,isActive:()=>{let e=N();return ce()&&(e.source===`ANTHROPIC_AUTH_TOKEN`||e.source===`apiKeyHelper`)},render:()=>{let e=N();return(0,K.jsxs)(S,{flexDirection:`row`,marginTop:1,children:[(0,K.jsx)(v,{color:`warning`,children:c.warning}),(0,K.jsxs)(v,{color:`warning`,children:[`Auth conflict: Using `,e.source,` instead of Claude account subscription token. Either unset`,` `,e.source,", or run `claude /logout`."]})]})}},Qa={id:`api-key-conflict`,type:`warning`,isActive:()=>{let{source:e}=j({skipRetrievingKeyFromApiKeyHelper:!0});return!!P()&&(e===`ANTHROPIC_API_KEY`||e===`apiKeyHelper`)},render:()=>{let{source:e}=j({skipRetrievingKeyFromApiKeyHelper:!0});return(0,K.jsxs)(S,{flexDirection:`row`,marginTop:1,children:[(0,K.jsx)(v,{color:`warning`,children:c.warning}),(0,K.jsxs)(v,{color:`warning`,children:[`Auth conflict: Using `,e,` instead of Anthropic Console key. Either unset `,e,", or run `claude /logout`."]})]})}},$a={id:`both-auth-methods`,type:`warning`,isActive:()=>{let{source:e}=j({skipRetrievingKeyFromApiKeyHelper:!0}),t=N();return e!==`none`&&t.source!==`none`&&!(e===`apiKeyHelper`&&t.source===`apiKeyHelper`)},render:()=>{let{source:e}=j({skipRetrievingKeyFromApiKeyHelper:!0}),t=N();return(0,K.jsxs)(S,{flexDirection:`column`,marginTop:1,children:[(0,K.jsxs)(S,{flexDirection:`row`,children:[(0,K.jsx)(v,{color:`warning`,children:c.warning}),(0,K.jsxs)(v,{color:`warning`,children:[`Auth conflict: Both a token (`,t.source,`) and an API key (`,e,`) are set. This may lead to unexpected behavior.`]})]}),(0,K.jsxs)(S,{flexDirection:`column`,marginLeft:3,children:[(0,K.jsxs)(v,{color:`warning`,children:[`· Trying to use `,t.source===`claude.ai`?`claude.ai`:t.source,`?`,` `,e===`ANTHROPIC_API_KEY`?`Unset the ANTHROPIC_API_KEY environment variable, or claude /logout then say "No" to the API key approval before login.`:e===`apiKeyHelper`?`Unset the apiKeyHelper setting.`:`claude /logout`]}),(0,K.jsxs)(v,{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.`]})]})]})}},eo={id:`large-agent-descriptions`,type:`warning`,isActive:e=>ir(e.agentDefinitions)>or,render:e=>{let t=ir(e.agentDefinitions);return(0,K.jsxs)(S,{flexDirection:`row`,children:[(0,K.jsx)(v,{color:`warning`,children:c.warning}),(0,K.jsxs)(v,{color:`warning`,children:[`Large cumulative agent descriptions will impact performance (~`,Oe(t),` tokens > `,Oe(or),`)`,(0,K.jsx)(v,{dimColor:!0,children:` · /agents to manage`})]})]})}},to={id:`jetbrains-plugin-install`,type:`info`,isActive:e=>{if(!ot()||!(e.config.autoInstallIdeExtension??!0))return!1;let t=et();return t!==null&&!yt(t)},render:()=>{let e=ut(et());return(0,K.jsxs)(S,{flexDirection:`row`,gap:1,marginLeft:1,children:[(0,K.jsx)(v,{color:`ide`,children:c.arrowUp}),(0,K.jsxs)(v,{children:[`Install the `,(0,K.jsx)(v,{color:`ide`,children:e}),` plugin from the JetBrains Marketplace:`,` `,(0,K.jsx)(v,{bold:!0,children:`https://docs.claude.com/s/claude-code-jetbrains`})]})]})}},no=[Xa,eo,Za,Qa,$a,to]}));function io({agentDefinitions:e}={}){let t={config:R(),agentDefinitions:e,memoryFiles:(0,oo.use)(Be())},n=Ya(t);return n.length===0?null:(0,so.jsx)(S,{flexDirection:`column`,paddingLeft:1,children:n.map(e=>(0,so.jsx)(ao.Fragment,{children:e.render(t)},e.id))})}var ao,oo,so,co=t((()=>{ao=n(g(),1),oo=n(g(),1),b(),Ft(),I(),ro(),so=w()}));function lo(e,t,n){let r=(0,q.useRef)(new Map),i=(0,q.useRef)(0),a=(0,q.useRef)(0),o=(0,q.useRef)({arr:new Float64Array,version:-1,n:-1}),s=(0,q.useRef)(new Map),c=(0,q.useRef)(new Map),l=(0,q.useRef)(n),u=(0,q.useRef)(!1),d=(0,q.useRef)(null),f=(0,q.useRef)(0);if(l.current!==n){let e=l.current/n;l.current=n;for(let[t,n]of r.current)r.current.set(t,Math.max(1,Math.round(n*e)));i.current++,u.current=!0,f.current=2}let p=f.current>0?d.current:null,m=(0,q.useRef)(0),h=(0,q.useRef)(null);(0,q.useSyncExternalStore)((0,q.useCallback)(t=>e.current?.subscribe(t)??vo,[e]),()=>{let t=e.current;if(!t)return NaN;let n=t.getScrollTop()+t.getPendingDelta(),r=Math.floor(n/mo);return t.isSticky()?~r:r});let g=e.current?.getScrollTop()??-1,_=e.current?.getPendingDelta()??0,v=e.current?.getViewportHeight()??0,y=e.current?.isSticky()??!0;(0,q.useMemo)(()=>{let e=new Set(t),n=!1;for(let t of r.current.keys())e.has(t)||(r.current.delete(t),n=!0);for(let t of c.current.keys())e.has(t)||c.current.delete(t);n&&i.current++},[t]);let b=t.length;if(o.current.version!==i.current||o.current.n!==b){let e=o.current.arr.length>=b+1?o.current.arr:new Float64Array(b+1);e[0]=0;for(let n=0;n<b;n++)e[n+1]=e[n]+(r.current.get(t[n])??uo);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-po),w=b;else{if(y){let e=v+fo;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-fo;{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*fo,y=Math.min(b,C+go),S=0;for(w=C;w<y&&(S<h||x[w]<f+v+fo);)S+=r.current.get(t[w])??ho,w++}let e=v+2*fo,n=Math.max(0,w-go),i=0;for(let e=C;e<w;e++)i+=r.current.get(t[e])??ho;for(;C>n&&i<e;)C--,i+=r.current.get(t[C])??ho;let o=d.current,c=Math.abs(g-a.current)+Math.abs(_);if(o&&c>v*2){let[e,t]=o;C<e-_o&&(C=e-_o),w>t+_o&&(w=t+_o),C>w&&(w=Math.min(C+_o,b))}a.current=g}f.current>0?f.current--:d.current=[C,w];let T=(0,q.useDeferredValue)(C),E=(0,q.useDeferredValue)(w),D=C<T?T:C,O=w>E?E:w;if((D>O||y)&&(D=C,O=w),_>0&&(O=w),O-D>go){let e=(x[D]+x[O])/2;g-m.current<e?O=D+go:D=O-go}let k=m.current,A=x[D],ee=D===0?0:A+k,te=O===b?1/0:Math.max(A,x[O]-v)+k;(0,q.useLayoutEffect)(()=>{y?e.current?.setClampBounds(void 0,void 0):e.current?.setClampBounds(ee,te)}),(0,q.useLayoutEffect)(()=>{let e=h.current?.yogaNode;if(e&&e.getComputedWidth()>0&&(m.current=e.getComputedTop()),u.current){u.current=!1;return}let t=!1;for(let[e,n]of s.current){let i=n.yogaNode;if(!i)continue;let a=i.getComputedHeight(),o=r.current.get(e);a>0?o!==a&&(r.current.set(e,a),t=!0):i.getComputedWidth()>0&&o!==0&&(r.current.set(e,0),t=!0)}t&&i.current++});let ne=(0,q.useCallback)(e=>{let t=c.current.get(e);return t||(t=t=>{if(t)s.current.set(e,t);else{let t=s.current.get(e)?.yogaNode;if(t&&!u.current){let n=t.getComputedHeight();(n>0||t.getComputedWidth()>0)&&r.current.get(e)!==n&&(r.current.set(e,n),i.current++)}s.current.delete(e)}},c.current.set(e,t)),t},[]),re=(0,q.useCallback)(e=>{let n=s.current.get(t[e])?.yogaNode;return!n||n.getComputedWidth()===0?-1:n.getComputedTop()},[t]),j=(0,q.useCallback)(e=>s.current.get(t[e])??null,[t]),M=(0,q.useCallback)(e=>r.current.get(t[e]),[t]),N=(0,q.useCallback)(t=>{let n=o.current;t<0||t>=n.n||e.current?.scrollTo(n.arr[t]+m.current)},[e]),P=S-x[O];return{range:[D,O],topSpacer:A,bottomSpacer:P,measureRef:ne,spacerRef:h,offsets:x,getItemTop:re,getItemElement:j,getItemHeight:M,scrollToIndex:N}}var q,uo,fo,po,mo,ho,go,_o,vo,yo=t((()=>{q=n(g(),1),uo=3,fo=40,po=30,mo=fo>>1,ho=1,go=200,_o=25,vo=()=>{}}));function bo({children:e}){let[t,n]=(0,J.useState)(null),[r,i]=(0,J.useState)(null);return(0,To.jsx)(Do.Provider,{value:n,children:(0,To.jsx)(ko.Provider,{value:i,children:(0,To.jsx)(Eo.Provider,{value:t,children:(0,To.jsx)(Oo.Provider,{value:r,children:e})})})})}function xo(){return(0,J.useContext)(Eo)}function So(){return(0,J.useContext)(Oo)}function Co(e){let t=(0,J.useContext)(Do);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}function wo(e){let t=(0,J.useContext)(ko);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}var J,To,Eo,Do,Oo,ko,Ao=t((()=>{J=n(g(),1),To=w(),Eo=(0,J.createContext)(null),Do=(0,J.createContext)(null),Oo=(0,J.createContext)(null),ko=(0,J.createContext)(null)}));function jo(e){let[t,n]=(0,Y.useState)(null),r=(0,Y.useRef)(e);r.current=e;let i=(0,Y.useRef)(null),a=(0,Y.useCallback)(()=>{n(null)},[]),o=(0,Y.useCallback)(e=>{let t=Math.max(0,e.getScrollHeight()-e.getViewportHeight());e.getScrollTop()+e.getPendingDelta()>=t||i.current===null&&(i.current=e.getScrollHeight(),n(r.current))},[]),s=(0,Y.useCallback)(e=>{e&&e.scrollToBottom()},[]);return(0,Y.useEffect)(()=>{t===null?i.current=null:e<t&&(i.current=null,n(null))},[e,t]),{dividerIndex:t,dividerYRef:i,onScrollAway:o,onRepin:a,jumpToNew:s,shiftDivider:(0,Y.useCallback)((e,t)=>{n(t=>t===null?null:t+e),i.current!==null&&(i.current+=t)},[])}}function Mo(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`&&!No(t))continue;let a=t.type===`assistant`;a&&!r&&n++,r=a}return n}function No(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 Po(e,t){if(t===null)return;let n=t;for(;n<e.length&&(e[n]?.type===`progress`||Ka(e[n]));)n++;let r=e[n]?.uuid;if(!r)return;let i=Mo(e,t);return{firstUnseenUuid:r,count:Math.max(1,i)}}function Fo({scrollable:e,bottom:t,overlay:n,bottomFloat:r,modal:i,modalScrollRef:a,scrollRef:o,dividerYRef:s,hidePill:c=!1,hideSticky:l=!1,newMessageCount:u=0,onPillClick:f}){let{rows:p,columns:m}=d(),[g,y]=(0,Y.useState)(null),b=(0,Y.useMemo)(()=>({setStickyPrompt:y}),[]),x=(0,Y.useSyncExternalStore)((0,Y.useCallback)(e=>o?.current?.subscribe(e)??(()=>{}),[o]),()=>{let e=o?.current,t=s?.current;return!e||t==null?!1:e.getScrollTop()+e.getPendingDelta()+e.getViewportHeight()<t});if((0,Y.useLayoutEffect)(()=>{if(!Kt())return;let e=h.get(process.stdout);if(e)return e.onHyperlinkClick=e=>{if(e.startsWith(`file:`))try{Sn(pr(e))}catch{}else xn(e)},()=>{e.onHyperlinkClick=void 0}},[]),Kt()){let s=l?null:g,d=s!=null&&s!==`clicked`&&n==null?s:null,h=s!=null&&n==null;return(0,X.jsxs)(bo,{children:[(0,X.jsx)(S,{flexDirection:`row`,flexGrow:1,overflow:`hidden`,width:`100%`,children:(0,X.jsxs)(S,{flexDirection:`column`,flexGrow:1,width:m,overflow:`hidden`,children:[(0,X.jsxs)(S,{flexGrow:1,flexDirection:`column`,overflow:`hidden`,children:[d&&(0,X.jsx)(Lo,{text:d.text,onClick:d.scrollTo}),(0,X.jsxs)(_,{ref:o,flexGrow:1,flexDirection:`column`,paddingTop:+!h,stickyScroll:!0,children:[(0,X.jsx)(Vo,{value:b,children:e}),n]}),!c&&x&&n==null&&(0,X.jsx)(Io,{count:u,onClick:f}),r!=null&&(0,X.jsx)(S,{position:`absolute`,bottom:0,right:0,opaque:!0,children:r})]}),(0,X.jsxs)(S,{flexDirection:`column`,flexShrink:0,width:`100%`,maxHeight:`50%`,children:[(0,X.jsx)(Ro,{}),(0,X.jsx)(zo,{}),(0,X.jsx)(S,{flexDirection:`column`,width:`100%`,flexGrow:1,overflowY:`hidden`,children:t})]})]})}),i!=null&&(0,X.jsx)(Qn,{value:{rows:p-Bo-1,columns:m-4,scrollRef:a??null},children:(0,X.jsxs)(S,{position:`absolute`,bottom:0,left:0,right:0,maxHeight:p-Bo,flexDirection:`column`,overflow:`hidden`,opaque:!0,children:[(0,X.jsx)(S,{flexShrink:0,children:(0,X.jsx)(v,{color:`permission`,children:`▔`.repeat(m)})}),(0,X.jsx)(S,{flexDirection:`column`,paddingX:2,flexShrink:0,overflow:`hidden`,children:i})]})})]})}return(0,X.jsxs)(X.Fragment,{children:[e,t,n,i]})}function Io({count:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(S,{position:`absolute`,bottom:0,left:0,right:0,justifyContent:`center`,children:(0,X.jsx)(S,{onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(v,{backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,dimColor:!0,children:[` `,e>0?`${e} new ${we(e,`message`)}`:`Jump to bottom`,` `,c.arrowDown,` `]})})})}function Lo({text:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(S,{flexShrink:0,width:`100%`,height:1,paddingRight:1,backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(v,{color:`subtle`,wrap:`truncate-end`,children:[c.pointer,` `,e]})})}function Ro(){let e=xo();return!e||e.suggestions.length===0?null:(0,X.jsx)(S,{position:`absolute`,bottom:`100%`,left:0,right:0,paddingX:2,paddingTop:1,flexDirection:`column`,opaque:!0,children:(0,X.jsx)(qn,{suggestions:e.suggestions,selectedSuggestion:e.selectedSuggestion,maxColumnWidth:e.maxColumnWidth,overlay:!0})})}function zo(){let e=So();return e?(0,X.jsx)(S,{position:`absolute`,bottom:`100%`,left:0,right:0,opaque:!0,children:e}):null}var Y,X,Bo,Vo,Ho=t((()=>{s(),Y=n(g(),1),Zn(),Ao(),bn(),b(),Cn(),Yt(),Ce(),Ja(),Jn(),X=w(),Bo=2,Vo=(0,Y.createContext)({setStickyPrompt:()=>{}})}));function Uo(e){let t=Zo.get(e);if(t!==void 0)return t;let n=Ar(e);return Zo.set(e,n),n}function Wo(e){let t=$o.get(e);if(t!==void 0)return t;let n=Go(e);return $o.set(e,n),n}function Go(e){let t=null;if(e.type===`user`){if(e.isMeta||e.isVisibleInTranscriptOnly)return null;let n=e.message.content[0];if(n?.type!==`text`)return null;t=n.text??null}else if(e.type===`attachment`&&e.attachment.type===`queued_command`&&e.attachment.commandMode!==`task-notification`&&!e.attachment.isMeta){let n=e.attachment.prompt;t=typeof n==`string`?n:n.flatMap(e=>e.type===`text`?[e.text??``]:[]).join(`
|
|
11
|
+
`)}if(t===null)return null;let n=Et(t);return n.startsWith(`<`)||n===``?null:n}function Ko({itemKey:e,msg:t,idx:n,measureRef:r,expanded:i,hovered:a,clickable:o,onClickK:s,onEnterK:c,onLeaveK:l,renderItem:u}){return(0,Yo.jsx)(S,{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,Yo.jsx)(C.Provider,{value:a&&!i?`text`:void 0,children:u(t,n)})})}function qo({messages:e,scrollRef:t,columns:n,itemKey:r,renderItem:i,onItemClick:a,isItemClickable:o,isItemExpanded:s,extractSearchText:c=Uo,trackStickyPrompt:l,selectedIndex:u,cursorNavRef:d,setCursor:f,jumpRef:p,onSearchMatchesChange:m,scanElement:h,setPositions:g}){let _=(0,Z.useRef)([]),v=(0,Z.useRef)(e),y=(0,Z.useRef)(r);if(y.current!==r||e.length<_.current.length||e[0]!==v.current[0])_.current=e.map(e=>r(e));else for(let t=_.current.length;t<e.length;t++)_.current.push(r(e[t]));v.current=e,y.current=r;let b=_.current,{range:x,topSpacer:C,bottomSpacer:w,measureRef:T,spacerRef:E,offsets:D,getItemTop:O,getItemElement:k,getItemHeight:A,scrollToIndex:ee}=lo(t,b,n),[te,ne]=x,re=(0,Z.useCallback)(t=>A(t)===0?!1:gt(e[t]),[A,e]);(0,Z.useImperativeHandle)(d,()=>{let n=e=>f?.({uuid:e.uuid,msgType:e.type,expanded:!1,toolName:it(e)?.name}),r=u??-1,i=(t,r,i=re)=>{for(let a=t;a>=0&&a<e.length;a+=r)if(i(a))return n(e[a]),!0;return!1},a=t=>re(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,re]);let j=(0,Z.useRef)({offsets:D,start:te,getItemElement:k,getItemTop:O,messages:e,scrollToIndex:ee});j.current={offsets:D,start:te,getItemElement:k,getItemTop:O,messages:e,scrollToIndex:ee},(0,Z.useEffect)(()=>{if(u===void 0)return;let e=j.current,n=e.getItemElement(u);n?t.current?.scrollToElement(n,1):e.scrollToIndex(u)},[u,t]);let M=(0,Z.useRef)(null),N=(0,Z.useRef)({msgIdx:-1,positions:[]}),P=(0,Z.useRef)(-1),F=(0,Z.useRef)(0),ie=(0,Z.useRef)(0),I=(0,Z.useRef)(()=>{}),L=(0,Z.useRef)(()=>{}),R=(0,Z.useRef)({matches:[],ptr:0,screenOrd:0,prefixSum:[]}),z=(0,Z.useRef)(-1),ae=(0,Z.useRef)(!1);function oe(e){let t=j.current.getItemTop(e);return Math.max(0,t-Xo)}function se(e){let n=t.current,{msgIdx:r,positions:i}=N.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=j.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=R.current,p=f.prefixSum.at(-1)??0,h=(f.prefixSum[f.ptr]??0)+a+1;m?.(p,h),V(`highlight(i=${r}, ord=${a}/${i.length}): pos={row:${o.row},col:${o.col}} lo=${l} screenRow=${d} badge=${h}/${p}`)}L.current=se;let[ce,le]=(0,Z.useState)(0),B=(0,Z.useCallback)(()=>le(e=>e+1),[]);(0,Z.useEffect)(()=>{let e=M.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}=j.current,l=o(n),u=l?.yogaNode?.getComputedHeight()??0;if(!l||u===0){if(i>1){M.current=null,V(`seek(i=${n}): no mount after scrollToIndex, skip`),I.current(r?-1:1);return}M.current={idx:n,wantLast:r,tries:i+1},c(n),B();return}M.current=null,a.scrollTo(Math.max(0,s(n)-Xo));let d=h?.(l)??[];if(N.current={msgIdx:n,positions:d},V(`seek(i=${n} t=${i}): ${d.length} positions`),d.length===0){if(++F.current>20){F.current=0;return}I.current(r?-1:1);return}F.current=0;let f=r?d.length-1:0;R.current.screenOrd=f,P.current=-1,L.current(f);let p=ie.current;p&&(ie.current=0,I.current(p))},[ce]);function ue(e,n){let r=t.current;if(!r)return;let i=j.current,{getItemElement:a,scrollToIndex:o}=i;if(e<0||e>=i.messages.length)return;g?.(null),N.current={msgIdx:-1,positions:[]},M.current={idx:e,wantLast:n,tries:0};let s=a(e),c=s?.yogaNode?.getComputedHeight()??0;s&&c>0?r.scrollTo(oe(e)):o(e),B()}function de(e){let t=R.current,{matches:n,prefixSum:r}=t,i=r.at(-1)??0;if(n.length===0)return;if(M.current){ie.current=e;return}P.current<0&&(P.current=t.ptr);let{positions:a}=N.current,o=t.screenOrd+e;if(o>=0&&o<a.length){t.screenOrd=o,se(o),P.current=-1;return}let s=(t.ptr+e+n.length)%n.length;if(s===P.current){g?.(null),P.current=-1,V(`step: wraparound at ptr=${s}, all ${n.length} msgs phantoms`);return}t.ptr=s,t.screenOrd=0,ue(n[s],e<0);let c=e<0?r[s+1]??i:r[s]+1;m?.(i,c)}I.current=de,(0,Z.useImperativeHandle)(p,()=>({jumpToIndex:e=>{let n=t.current;n&&n.scrollTo(oe(e))},setSearchQuery:e=>{M.current=null,N.current={msgIdx:-1,positions:[]},P.current=-1,g?.(null);let n=e.toLowerCase(),r=[],i=[0];if(n){let e=j.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}=j.current,f=d(u),p=f>=0?f-l[u]:0;if(r.length>0&&s){let t=z.current>=0?z.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)}V(`setSearchQuery('${e}'): ${r.length} msgs · ptr=${o} msgIdx=${r[o]} curTop=${t} origin=${p}`)}R.current={matches:r,ptr:o,screenOrd:0,prefixSum:i},r.length>0?ue(r[o],!0):z.current>=0&&s&&s.scrollTo(z.current),m?.(a,r.length>0?i[o+1]??a:0)},nextMatch:()=>de(1),prevMatch:()=>de(-1),setAnchor:()=>{let e=t.current;e&&(z.current=e.getScrollTop())},disarmSearch:()=>{g?.(null),M.current=null,N.current={msgIdx:-1,positions:[]},P.current=-1},warmSearchIndex:async()=>{if(ae.current)return 0;let e=j.current.messages,t=0,n=performance.now();for(let n=0;n<e.length;n+=500){await Le(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 V(`warmSearchIndex: ${e.length} msgs · work=${Math.round(t)}ms wall=${r}ms chunks=${Math.ceil(e.length/500)}`),ae.current=!0,Math.round(t)}}),[t]);let[fe,pe]=(0,Z.useState)(null),me=(0,Z.useRef)({onItemClick:a,setHoveredKey:pe});me.current={onItemClick:a,setHoveredKey:pe};let he=(0,Z.useCallback)((e,t)=>{let n=me.current;!t&&n.onItemClick&&n.onItemClick(e)},[]),ge=(0,Z.useCallback)(e=>{me.current.setHoveredKey(e)},[]),_e=(0,Z.useCallback)(e=>{me.current.setHoveredKey(t=>t===e?null:t)},[]);return(0,Yo.jsxs)(Yo.Fragment,{children:[(0,Yo.jsx)(S,{ref:E,height:C,flexShrink:0}),e.slice(te,ne).map((e,t)=>{let n=te+t,r=b[n],c=!!a&&(o?.(e)??!0),l=c&&fe===r,u=s?.(e);return(0,Yo.jsx)(Ko,{itemKey:r,msg:e,idx:n,measureRef:T,expanded:u,hovered:l,clickable:c,onClickK:he,onEnterK:ge,onLeaveK:_e,renderItem:i},r)}),w>0&&(0,Yo.jsx)(S,{height:w,flexShrink:0}),l&&(0,Yo.jsx)(Jo,{messages:e,start:te,end:ne,offsets:D,getItemTop:O,getItemElement:k,scrollRef:t})]})}function Jo({messages:e,start:t,end:n,offsets:r,getItemTop:i,getItemElement:a,scrollRef:o}){let{setStickyPrompt:s}=(0,Z.useContext)(Vo);(0,Z.useSyncExternalStore)((0,Z.useCallback)(e=>o.current?.subscribe(e)??es,[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=Wo(e[t]);if(n===null)continue;let r=i(t);if(!(r>=0&&r+1>=l)){f=t,p=n;break}}let m=d>=0?d-r[u]:0,h=f>=0?Math.max(0,m+r[f]):-1,g=(0,Z.useRef)({idx:-1,tries:0}),_=(0,Z.useRef)(`none`),v=(0,Z.useRef)(-1);return(0,Z.useEffect)(()=>{if(g.current.idx>=0)return;if(_.current===`armed`){_.current=`force`;return}let e=_.current===`force`;if(_.current=`none`,!e&&v.current===f)return;if(v.current=f,p===null){s(null);return}let t=p.trimStart(),n=t.search(/\n\s*\n/),r=(n>=0?t.slice(0,n):t).slice(0,Qo).replace(/\s+/g,` `).trim();if(r===``){s(null);return}let i=f,c=h;s({text:r,scrollTo:()=>{s(`clicked`),_.current=`armed`;let e=a(i);e?o.current?.scrollToElement(e,1):(o.current?.scrollTo(c),g.current={idx:i,tries:0})}})}),(0,Z.useEffect)(()=>{if(g.current.idx<0)return;let e=a(g.current.idx);e?(o.current?.scrollToElement(e,1),g.current={idx:-1,tries:0}):++g.current.tries>5&&(g.current={idx:-1,tries:0})}),null}var Z,Yo,Xo,Zo,Qo,$o,es,ts=t((()=>{g(),Z=n(g(),1),yo(),b(),cn(),Ho(),Yo=w(),me(),Re(),Lr(),xt(),Xo=3,Zo=new WeakMap,Qo=500,$o=new WeakMap,es=()=>{}}));function ns(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 rs(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 is(e,t,n=ms,r=hs){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 as(e){return(e.type===`assistant`||e.type===`user`?Ge(e):null)??e.uuid}function os(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function ss(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=Ge(e);return i?t.has(i)||n.has(i)||_t(i,`PostToolUse`,a)?!1:mr(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 cs,Q,$,ls,us,ds,fs,ps,ms,hs,gs,_s,vs=t((()=>{m(),On(),cs=n(g(),1),Q=n(g(),1),hr(),T(),B(),bn(),b(),Pt(),ze(),We(),vr(),xr(),Vt(),wr(),I(),a(),kr(),Dt(),Ce(),Lr(),ka(),Rt(),Ga(),xt(),an(),Ja(),Mt(),co(),$=w(),ts(),ls=cs.memo(function({agentDefinitions:e}){return(0,$.jsx)(sn,{children:(0,$.jsxs)(S,{flexDirection:`column`,gap:1,children:[(0,$.jsx)(Ta,{}),(0,$.jsx)(cs.Suspense,{fallback:null,children:(0,$.jsx)(io,{agentDefinitions:e})})]})})}),us=(vn(),e(yn)),ds=(le(),e(M)).BRIEF_TOOL_NAME,fs=(st(),e(ft)).SEND_USER_FILE_TOOL_NAME,ps=30,ms=200,hs=50,gs=({messages:e,tools:t,commands:n,verbose:r,toolJSX:i,toolUseConfirmQueue:a,inProgressToolUseIDs:s,isMessageSelectorVisible:c,conversationId:l,screen:u,streamingToolUses:m,showAllInTranscript:h=!1,agentDefinitions:g,onOpenRateLimitOptions:_,hideLogo:b=!1,isLoading:x,hidePastThinking:C=!1,streamingThinking:w,streamingText:T,isBriefOnly:E=!1,unseenDivider:O,scrollRef:k,trackStickyPrompt:A,jumpRef:ee,onSearchMatchesChange:te,scanElement:ne,setPositions:re,disableRenderCap:j=!1,cursor:M=null,setCursor:N,cursorNavRef:P,renderRange:F})=>{let{columns:ie}=d(),I=rn(`transcript:toggleShowAll`,`Transcript`,`Ctrl+E`),L=(0,Q.useMemo)(()=>Ot(e).filter(Lt),[e]),z=(0,Q.useMemo)(()=>w?w.isStreaming?!0:w.streamingEndedAt?Date.now()-w.streamingEndedAt<3e4:!1:!1,[w]),{lastThinkingBlockId:ae,latestBashOutputUUID:oe}=(0,Q.useMemo)(()=>{let e=null,t=null,n=C&&!z;C&&z&&(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,z]),se=(0,Q.useMemo)(()=>Qe(L),[L]),ce=(0,Q.useMemo)(()=>m.filter(e=>!s.has(e.contentBlock.id)&&!se.has(e.contentBlock.id)),[m,s,se]),le=(0,Q.useMemo)(()=>ce.flatMap(e=>{let t=un({content:[e.contentBlock]});return t.uuid=$e(e.contentBlock.id,0),Ot([t])}),[ce]),B=u===`transcript`,de=(0,Q.useMemo)(()=>o(process.env.CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL),[]),fe=k!=null&&!de,pe=B&&!h&&!fe,me=(0,Q.useRef)(null),V=(0,Q.useRef)(null),{collapsed:he,lookups:ge,hasTruncatedMessages:_e,hiddenMessageCount:ve}=(0,Q.useMemo)(()=>{let e=At(L.filter(e=>e.type!==`progress`&&!Ka(e)&&qt(e,B)),le),n=[ds,fs].filter(e=>e!==null),i=[ds].filter(e=>e!==null),a=n.length>0&&!B?E?ns(e,n):i.length>0?rs(e,i):e:e,o=pe?a.slice(-ps):a,s=pe&&a.length>ps,{messages:c}=Dr(o,t,r),l=_r(br(Cr(Nt(c,t))),r),u=Bt(L,o),d=(()=>{let e=o.at(-1);return e?.type===`assistant`?e.message?.id:void 0})(),f;if(V.current&&V.current.key===u)f=V.current.lookups;else if(V.current&&L.length>=V.current.normalizedCount&&o.length>=V.current.messageCount&&V.current.lastAssistantMsgId===d){let e=$t(V.current.lookups,V.current.normalizedCount,V.current.messageCount,L,o);e?(f=e,V.current={key:u,lookups:f,normalizedCount:L.length,messageCount:o.length,lastAssistantMsgId:d}):(f=Ht(L,o),V.current={key:u,lookups:f,normalizedCount:L.length,messageCount:o.length,lastAssistantMsgId:d})}else f=Ht(L,o),V.current={key:u,lookups:f,normalizedCount:L.length,messageCount:o.length,lastAssistantMsgId:d};let p=e.length-ps;return{collapsed:l,lookups:f,hasTruncatedMessages:s,hiddenMessageCount:p}},[r,L,B,le,pe,t,E]),ye=(0,Q.useMemo)(()=>{let e=!fe&&!j?is(he,me):0;return F?he.slice(F[0],F[1]):e>0?he.slice(e):he},[he,F,fe,j]),be=(0,Q.useMemo)(()=>new Set(m.map(e=>e.contentBlock.id)),[m]),{dividerBeforeIndex:xe,selectedIdx:Se}=(0,Q.useMemo)(()=>{if(!O&&!M)return{dividerBeforeIndex:-1,selectedIdx:-1};let e=-1,t=-1,n=O?.firstUnseenUuid.slice(0,24);for(let r=0;r<ye.length;r++){let i=ye[r];if(e===-1&&n&&i.uuid.slice(0,24)===n&&(e=r),t===-1&&M&&i.uuid===M.uuid&&(t=r),e!==-1&&t!==-1)break}return{dividerBeforeIndex:e,selectedIdx:t}},[O,M,ye]),[Ce,Te]=(0,Q.useState)(()=>new Set),Ee=(0,Q.useCallback)(e=>{let t=as(e);Te(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},[]),De=(0,Q.useCallback)(e=>Ce.size>0&&Ce.has(as(e)),[Ce]),Oe=(0,Q.useRef)(ge);Oe.current=ge;let ke=(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&&Ke(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=Oe.current.toolUseByToolUseID.get(n.tool_use_id??``)?.name;return(r?Tt(t,r):void 0)?.isResultTruncated?.(e.toolUseResult)??!1},[t]),Ae=(!i||!!i.shouldContinueAnimation)&&!a.length&&!c,je=s.size>0,{progress:Me}=f(),Ne=(0,Q.useRef)(null),Pe=R().terminalProgressBarEnabled&&!D()&&!(us?.isProactiveActive()??!1);(0,Q.useEffect)(()=>{let e=Pe?je?`indeterminate`:`completed`:null;Ne.current!==e&&(Ne.current=e,Me(e))},[Me,Pe,je]),(0,Q.useEffect)(()=>()=>Me(null),[Me]);let Fe=(0,Q.useCallback)(e=>`${e.uuid}-${l}`,[l]),Ie=(e,i)=>{let a=i>0?ye[i-1]?.type:void 0,o=e.type===`user`&&a===`user`,c=e.type===`collapsed_read_search`&&(!!T||Ia(ye,i,t,be)),l=ye.length-1-i>0,d=Fe(e),f=(0,$.jsx)(Wa,{message:e,isUserContinuation:o,hasContentAfter:c,tools:t,commands:n,verbose:r||De(e)||M?.expanded===!0&&i===Se,inProgressToolUseIDs:s,streamingToolUseIDs:be,screen:u,canAnimate:Ae,onOpenRateLimitOptions:_,lastThinkingBlockId:ae,latestBashOutputUUID:oe,columns:ie,isLoading:x,lookups:ge,shouldCollapseDiffs:l},d),p=(0,$.jsx)(Je.Provider,{value:i===Se,children:f},d);return O&&i===xe?[(0,$.jsx)(S,{marginTop:1,children:(0,$.jsx)(y,{title:`${O.count} new ${we(O.count,`message`)}`,width:ie,color:`inactive`})},`unseen-divider`),p]:p},Le=(0,Q.useRef)(new WeakMap),Re=(0,Q.useCallback)(e=>{let n=Le.current.get(e);if(n!==void 0)return n;let r=Ar(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=ge.toolUseByToolUseID.get(n.tool_use_id),a=(i&&Tt(t,i.name))?.extractSearchText?.(e.toolUseResult);a!==void 0&&(r=a)}}let i=r.toLowerCase();return Le.current.set(e,i),i},[t,ge]);return(0,$.jsxs)(kn,{name:`MessagesBoundary`,children:[!b&&!(F&&F[0]>0)&&(0,$.jsx)(ls,{agentDefinitions:g}),_e&&(0,$.jsx)(y,{title:`${I} to show ${p.bold(ve)} previous messages`,width:ie}),B&&h&&ve>0&&!j&&(0,$.jsx)(y,{title:`${I} to hide ${p.bold(ve)} previous messages`,width:ie}),fe?(0,$.jsx)(Xe.Provider,{value:!0,children:(0,$.jsx)(qo,{messages:ye,scrollRef:k,columns:ie,itemKey:Fe,renderItem:Ie,onItemClick:Ee,isItemClickable:ke,isItemExpanded:De,trackStickyPrompt:A,selectedIndex:Se>=0?Se:void 0,cursorNavRef:P,setCursor:N,jumpRef:ee,onSearchMatchesChange:te,scanElement:ne,setPositions:re,extractSearchText:Re})}):ye.flatMap(Ie),T&&!E&&(0,$.jsx)(S,{alignItems:`flex-start`,flexDirection:`row`,marginTop:1,width:`100%`,children:(0,$.jsxs)(S,{flexDirection:`row`,children:[(0,$.jsx)(S,{minWidth:2,children:(0,$.jsx)(v,{color:`text`,children:ue})}),(0,$.jsx)(S,{flexDirection:`column`,children:(0,$.jsx)(jt,{children:T})})]})}),z&&w&&!E&&(0,$.jsx)(S,{marginTop:1,children:(0,$.jsx)(It,{param:{type:`thinking`,thinking:w.thinking},addMargin:!1,isTranscriptMode:!0,verbose:r,hideInTranscript:!1})})]})},_s=cs.memo(gs,(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`&&os(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{Ho as a,Co as c,Po as i,wo as l,vs as n,jo as o,Fo as r,Ao as s,_s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-DR8-3Aex.js";import{f as t,s as n}from"./envUtils-CFG7IQID.js";import{J as r,Q as i,Rn as a,T as o,b as s,nt as c,t as l,x as u}from"./src-DNHWYkls.js";import{t as d}from"./jsx-runtime-BTgGEFjL.js";import{_s as f,cs as p,it as m,nt as h,oo as g,so as _}from"./growthbook-p4aJ_UMv.js";import{d as v,f as y}from"./stringUtils-U7kMYMJq.js";import{a as b,n as x}from"./env-CesrOJJq.js";import{Ew as S,RT as C,Sw as w,xw as T,zT as E}from"./loadAgentsDir-Bz0FfcVt.js";import{t as D}from"./useKeybinding-DAQL_dB_.js";import{c as O,i as k,s as A}from"./terminalSetup--jwGVap8.js";import{n as j,t as M}from"./useExitOnCtrlCDWithKeybindings-CBce_-hb.js";import{t as N}from"./WelcomeV2-C4vfBnIy.js";import{n as P,t as F}from"./ThemePicker-Bgr7yOQB.js";import{n as I,t as L}from"./PressEnterToContinue-DmzxIgbZ.js";import{t as R}from"./ApproveApiKey-DTs2ExZH.js";n();var z=e(a(),1),B=d();v(),b(),f(),g(),h(),D(),k(),M(),l(),l(),S(),E(),w(),P(),I(),l();var V=(0,z.createContext)({marker:``});function H({children:e}){let{marker:t}=(0,z.useContext)(V);return(0,B.jsxs)(u,{gap:1,children:[(0,B.jsx)(s,{dimColor:!0,children:t}),(0,B.jsx)(u,{flexDirection:`column`,children:e})]})}l();var U=(0,z.createContext)({marker:``});function W({children:e}){let{marker:t}=(0,z.useContext)(U),n=0;for(let t of z.Children.toArray(e))!(0,z.isValidElement)(t)||t.type!==H||n++;let r=String(n).length;return(0,B.jsx)(u,{flexDirection:`column`,children:z.Children.map(e,(e,n)=>{if(!(0,z.isValidElement)(e)||e.type!==H)return e;let i=`${t}${`${String(n+1).padStart(r)}.`}`;return(0,B.jsx)(U.Provider,{value:{marker:i},children:(0,B.jsx)(V.Provider,{value:{marker:i},children:e})})})})}W.Item=H;var G=W;l();function K({onDone:e}){let[n,a]=(0,z.useState)(0),[l,d]=(0,z.useState)(!1),[f]=(0,z.useState)(()=>m()),[h,g]=o();(0,z.useEffect)(()=>{y(`tengu_began_setup`,{oauthEnabled:f})},[f]);function v(){if(n<M.length-1){let e=n+1;a(e),y(`tengu_onboarding_step`,{oauthEnabled:f,stepId:M[e]?.id})}else e()}function b(e){g(e),v()}let S=j(),w=(0,B.jsx)(u,{marginX:1,children:(0,B.jsx)(F,{onThemeSelect:b,showIntroText:!0,helpText:`To change this later, run /theme`,hideEscToCancel:!0,skipExitHandling:!0})}),E=(0,B.jsxs)(u,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,B.jsx)(s,{bold:!0,children:`Before you start, keep in mind:`}),(0,B.jsx)(u,{flexDirection:`column`,width:70,children:(0,B.jsxs)(G,{children:[(0,B.jsxs)(G.Item,{children:[(0,B.jsx)(s,{children:`Always review changes before accepting`}),(0,B.jsxs)(s,{dimColor:!0,wrap:`wrap`,children:[`Claude can make mistakes — especially when running commands`,(0,B.jsx)(r,{}),`or editing files. You stay in control of every action.`,(0,B.jsx)(r,{})]})]}),(0,B.jsxs)(G.Item,{children:[(0,B.jsx)(s,{children:`Only use Claude Code on projects you trust`}),(0,B.jsxs)(s,{dimColor:!0,wrap:`wrap`,children:[`Untrusted code could contain prompt injection attacks.`,(0,B.jsx)(r,{}),(0,B.jsx)(i,{url:`https://code.claude.com/docs/en/security`})]})]})]})}),(0,B.jsx)(L,{})]}),D=(0,z.useMemo)(()=>{if(!process.env.ANTHROPIC_API_KEY||t())return``;let e=_(process.env.ANTHROPIC_API_KEY);if(p(e)===`new`)return e},[]);function k(e){e&&d(!0),v()}let M=[];M.push({id:`theme`,component:w}),D&&M.push({id:`api-key`,component:(0,B.jsx)(R,{customApiKeyTruncated:D,onDone:k})}),f&&M.push({id:`oauth`,component:(0,B.jsx)(q,{skip:l,onSkip:v,children:(0,B.jsx)(T,{onDone:v})})}),M.push({id:`security`,component:E}),O()&&M.push({id:`terminal-setup`,component:(0,B.jsxs)(u,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,B.jsx)(s,{bold:!0,children:`Use Claude Code's terminal setup?`}),(0,B.jsxs)(u,{flexDirection:`column`,width:70,gap:1,children:[(0,B.jsxs)(s,{children:[`For the optimal coding experience, enable the recommended settings`,(0,B.jsx)(r,{}),`for your terminal:`,` `,x.terminal===`Apple_Terminal`?`Option+Enter for newlines and visual bell`:`Shift+Enter for newlines`]}),(0,B.jsx)(C,{options:[{label:`Yes, use recommended settings`,value:`install`},{label:`No, maybe later with /terminal-setup`,value:`no`}],onChange:e=>{e===`install`?A(h).catch(()=>{}).finally(v):v()},onCancel:()=>v()}),(0,B.jsx)(s,{dimColor:!0,children:S.pending?(0,B.jsxs)(B.Fragment,{children:[`Press `,S.keyName,` again to exit`]}):(0,B.jsx)(B.Fragment,{children:`Enter to confirm · Esc to skip`})})]})]})});let P=M[n],I=(0,z.useCallback)(()=>{n===M.length-1?e():v()},[n,M.length,f,e]),V=(0,z.useCallback)(()=>{v()},[n,M.length,f,e]);return c({"confirm:yes":I},{context:`Confirmation`,isActive:P?.id===`security`}),c({"confirm:no":V},{context:`Confirmation`,isActive:P?.id===`terminal-setup`}),(0,B.jsxs)(u,{flexDirection:`column`,children:[(0,B.jsx)(N,{}),(0,B.jsxs)(u,{flexDirection:`column`,marginTop:1,children:[P?.component,S.pending&&(0,B.jsx)(u,{padding:1,children:(0,B.jsxs)(s,{dimColor:!0,children:[`Press `,S.keyName,` again to exit`]})})]})]})}function q({skip:e,onSkip:t,children:n}){return(0,z.useEffect)(()=>{e&&t()},[e,t]),e?null:n}export{K as Onboarding};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,t as i}from"./src-DNHWYkls.js";import{t as a}from"./jsx-runtime-BTgGEFjL.js";import{_s as o,ls as s,xs as c}from"./growthbook-p4aJ_UMv.js";import{n as l,r as u}from"./analytics-i6X1et4O.js";import{x as d,y as f}from"./startupProfiler-4P7GdVw6.js";import{a as p,n as m,r as h,t as g}from"./overageCreditGrant-BLFT-rF3.js";function _(){let e=m();return!e||!e.available||e.granted?!1:g(e)!==null}function v(){if(!_())return!1;let e=s();return!(e.hasVisitedExtraUsage||(e.overageCreditUpsellSeenCount??0)>=O)}function y(){m()===null&&p()}function b(){let[e]=(0,E.useState)(()=>(y(),v()));return e}function x(){let e=0;c(t=>(e=(t.overageCreditUpsellSeenCount??0)+1,{...t,overageCreditUpsellSeenCount:e})),u(`tengu_overage_credit_upsell_shown`,{seen_count:e})}function S(e){return`${e} in extra usage for third-party apps · /extra-usage`}function C(e){return`${e} in extra usage`}function w({maxWidth:e,twoLine:t}){let n=m();if(!n)return null;let i=g(n);if(!i)return null;if(t){let t=C(i);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(r,{color:`claude`,children:e?d(t,e):t}),(0,D.jsx)(r,{dimColor:!0,children:e?d(k,e):k})]})}let a=S(i),o=e?d(a,e):a,s=Math.min(C(i).length,o.length);return(0,D.jsxs)(r,{dimColor:!0,children:[(0,D.jsx)(r,{color:`claude`,children:o.slice(0,s)}),o.slice(s)]})}function T(){let e=m(),t=e?g(e):null,n=t?C(t):`extra usage credit`;return{title:n,lines:[],customContent:{content:(0,D.jsx)(r,{dimColor:!0,children:k}),width:Math.max(n.length,47)}}}var E,D,O,k,A=e((()=>{n(),E=t(n(),1),i(),l(),h(),o(),f(),D=a(),O=3,k=`On us. Works on third-party apps · /extra-usage`}));export{_ as a,A as i,T as n,v as o,x as r,b as s,w as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t,t as n,x as r}from"./src-DNHWYkls.js";import{t as i}from"./jsx-runtime-BTgGEFjL.js";import{n as a,t as o}from"./PermissionRequestTitle-CtlbBU9t.js";function s({title:e,subtitle:t,color:n=`permission`,titleColor:i,innerPaddingX:a=1,workerBadge:s,titleRight:l,children:u}){return(0,c.jsxs)(r,{flexDirection:`column`,borderStyle:`round`,borderColor:n,borderLeft:!1,borderRight:!1,borderBottom:!1,marginTop:1,children:[(0,c.jsx)(r,{paddingX:1,flexDirection:`column`,children:(0,c.jsxs)(r,{justifyContent:`space-between`,children:[(0,c.jsx)(o,{title:e,subtitle:t,color:i,workerBadge:s}),l]})}),(0,c.jsx)(r,{flexDirection:`column`,paddingX:a,children:u})]})}var c,l=e((()=>{t(),n(),a(),c=i()}));export{l as n,s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t,t as n,x as r}from"./src-DNHWYkls.js";import{t as i}from"./jsx-runtime-BTgGEFjL.js";import{n as a,t as o}from"./PermissionRequestTitle-CtlbBU9t.js";function s({title:e,subtitle:t,color:n=`permission`,titleColor:i,innerPaddingX:a=1,workerBadge:s,titleRight:l,children:u}){return(0,c.jsxs)(r,{flexDirection:`column`,borderStyle:`round`,borderColor:n,borderLeft:!1,borderRight:!1,borderBottom:!1,marginTop:1,children:[(0,c.jsx)(r,{paddingX:1,flexDirection:`column`,children:(0,c.jsxs)(r,{justifyContent:`space-between`,children:[(0,c.jsx)(o,{title:e,subtitle:t,color:i,workerBadge:s}),l]})}),(0,c.jsx)(r,{flexDirection:`column`,paddingX:a,children:u})]})}var c,l=e((()=>{t(),n(),a(),c=i()}));export{l as n,s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t,b as n,t as r,x as i}from"./src-DNHWYkls.js";import{t as a}from"./jsx-runtime-BTgGEFjL.js";function o({title:e,subtitle:t,color:r=`permission`,workerBadge:a}){return(0,s.jsxs)(i,{flexDirection:`column`,children:[(0,s.jsxs)(i,{flexDirection:`row`,gap:1,children:[(0,s.jsx)(n,{bold:!0,color:r,children:e}),a&&(0,s.jsxs)(n,{dimColor:!0,children:[`· `,`@`,a.name]})]}),t!=null&&(typeof t==`string`?(0,s.jsx)(n,{dimColor:!0,wrap:`truncate-start`,children:t}):t)]})}var s,c=e((()=>{t(),r(),s=a()}));export{c as n,o as t};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{s as n,u as r}from"./envUtils-CFG7IQID.js";import{n as i,t as a}from"./figures-fES5sASd.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-DNHWYkls.js";import{t as w}from"./jsx-runtime-BTgGEFjL.js";import{Gs as T,Js as re,Lc as E,Rc as D,Rs as ie,Ss as O,Vc as k,Vs as A,_s as j,el as M,nt as N,q as ae,rl as oe}from"./growthbook-p4aJ_UMv.js";import{D as se,E as ce,J as P,U as F,l as le,p as ue,z as de}from"./debug-CjIaNjpK.js";import{c as fe,o as pe,s as me}from"./log-DVv8YiNo.js";import{D as he,O as ge}from"./teammate-C-FiRloZ.js";import{a as _e,c as ve,d as ye,f as be,t as xe}from"./stringUtils-U7kMYMJq.js";import{b as I,w as Se}from"./startupProfiler-4P7GdVw6.js";import{l as Ce,u as we}from"./oauth-DMPGYAoZ.js";import{$D as Te,$a as Ee,BE as De,CO as Oe,Cu as ke,Eu as Ae,Ew as L,GT as je,HD as Me,HE as Ne,Ha as Pe,LI as Fe,Ql as Ie,RI as R,RT as Le,Ra as Re,SO as ze,So as Be,Ta as Ve,Va as He,WD as Ue,WT as We,Wa as Ge,XD as Ke,Xa as qe,ZD as Je,_O as Ye,_o as Xe,aO as Ze,ao as Qe,au as $e,bO as et,cI as tt,co as nt,dI as rt,do as it,eo as at,fI as ot,fO as st,fo as ct,gO as lt,go as ut,hb as dt,ho as ft,jI as pt,lD as z,mb as mt,mo as ht,nO as gt,pO as _t,po as vt,qD as yt,qa as bt,ro as xt,so as St,tO as Ct,uD as wt,vO as Tt,va as Et,vu as Dt,vw as Ot,wO as kt,wa as At,wu as jt,ww as Mt,xO as Nt,xo as Pt,yO as Ft,ya as It,yo as Lt,zE as Rt}from"./loadAgentsDir-Bz0FfcVt.js";import{i as zt,o as Bt,p as Vt,u as Ht}from"./xml-E8VMPwdJ.js";import{t as Ut}from"./useKeybinding-DAQL_dB_.js";import{t as Wt}from"./useTerminalSize-DzV4aaTi.js";import{n as Gt,t as Kt}from"./browser-D1vC3BNd.js";import{n as qt,t as Jt}from"./useExitOnCtrlCDWithKeybindings-CBce_-hb.js";import{n as Yt,t as Xt}from"./pluginStartupCheck-Cj2BMjVw.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-DMFYB3pK.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-C4cd71Yz.js";import{a as pn,n as mn,o as hn,r as gn}from"./pluginFlagging-CjH48f-K.js";import{i as _n,n as vn,r as yn}from"./MCPConnectionManager-BJ8PcYPe.js";import{t as bn}from"./SearchBox-DQg2Ph0V.js";import{n as xn,t as Sn}from"./useSearchInput-nqhdILI2.js";import{i as Cn,n as wn}from"./pluginAutoupdate-wTeOXfQe.js";import*as Tn from"path";import*as En from"fs/promises";function Dn({serverToolsCount:e,serverPromptsCount:t,serverResourcesCount:n}){let r=[];return e>0&&r.push(`tools`),n>0&&r.push(`resources`),t>0&&r.push(`prompts`),(0,On.jsxs)(C,{children:[(0,On.jsx)(p,{bold:!0,children:`Capabilities: `}),(0,On.jsx)(p,{color:`text`,children:r.length>0?(0,On.jsx)(g,{children:r}):`none`})]})}var On,kn=e((()=>{l(),x(),On=w()}));function An(e,t){switch(e.client.type){case`connected`:return{message:`Reconnected to ${t}.`,success:!0};case`needs-auth`:return{message:`${t} requires authentication. Use the 'Authenticate' option.`,success:!1};case`failed`:return{message:`Failed to reconnect to ${t}.`,success:!1};default:return{message:`Unknown result when reconnecting to ${t}.`,success:!1}}}function jn(e,t){return`Error reconnecting to ${t}: ${e instanceof Error?e.message:String(e)}`}var Mn=e((()=>{}));function Nn({server:e,serverToolsCount:t,onViewTools:n,onCancel:r,onComplete:i,borderless:o=!1}){let[l]=u(),d=qt(),{columns:f}=s(),[m,_]=B.useState(!1),[v,y]=B.useState(null),b=De(e=>e.mcp),x=Ne(),[w,T]=B.useState(null),[re,E]=(0,B.useState)(!1),D=(0,B.useRef)(null),[ie,O]=(0,B.useState)(!1),[k,A]=(0,B.useState)(null),[j,M]=(0,B.useState)(!1),[N,oe]=(0,B.useState)(null),[se,ce]=(0,B.useState)(!1),[P,F]=(0,B.useState)(!1),le=(0,B.useRef)(void 0),ue=(0,B.useRef)(!1),[pe,me]=(0,B.useState)(``),[he,ge]=(0,B.useState)(0),[_e,ve]=(0,B.useState)(null);(0,B.useEffect)(()=>()=>{ue.current=!0,D.current?.abort(),le.current!==void 0&&clearTimeout(le.current)},[]);let ye=e.isAuthenticated||e.client.type===`connected`&&t>0,I=yn(),Se=B.useCallback(async()=>{O(!1),A(null),E(!0);try{let t=await I(e.name),n=t.client.type===`connected`;be(`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){be(`tengu_claudeai_mcp_auth_completed`,{success:!1}),i?.(jn(t,e.name))}finally{E(!1)}},[I,e.name,i]),we=B.useCallback(async()=>{await Ie(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=Te(t.mcp.tools,e.name),i=Ke(t.mcp.commands,e.name),a=Je(t.mcp.resources,e.name);return{...t,mcp:{...t.mcp,clients:n,tools:r,commands:i,resources:a}}}),be(`tengu_claudeai_mcp_clear_auth_completed`,{}),i?.(`Disconnected from ${e.name}.`),M(!1),oe(null),ce(!1)},[e.name,e.config,e.scope,x,i]);te(`confirm:no`,()=>{D.current?.abort(),D.current=null,_(!1),T(null)},{context:`Confirmation`,isActive:m}),te(`confirm:no`,()=>{O(!1),A(null)},{context:`Confirmation`,isActive:ie}),te(`confirm:no`,()=>{M(!1),oe(null),ce(!1)},{context:`Confirmation`,isActive:j}),ne((e,t)=>{if(t.return&&ie&&Se(),t.return&&j)if(se)we();else{let e=`${Ce().CLAUDE_AI_ORIGIN}/settings/connectors`;oe(e),ce(!0),Gt(e)}if(e===`c`&&!P){let e=w||k||N;e&&ee(e).then(e=>{ue.current||(e&&process.stdout.write(e),F(!0),le.current!==void 0&&clearTimeout(le.current),le.current=setTimeout(F,2e3,!1))})}});let Ee=xe(String(e.name)),Oe=Ct(b.commands,e.name).length,ke=_n(),L=B.useCallback(async()=>{let t=Ce().CLAUDE_AI_ORIGIN,n=ae()?.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`,A(r),O(!0),be(`tengu_claudeai_mcp_auth_started`,{}),await Gt(r)},[e.config]),je=B.useCallback(()=>{M(!0),be(`tengu_claudeai_mcp_clear_auth_started`,{})},[]),Me=B.useCallback(async()=>{let t=e.client.type!==`disabled`;try{await ke(e.name),e.config.type===`claudeai-proxy`&&be(`tengu_claudeai_mcp_toggle`,{new_state:t?`disabled`:`enabled`}),r()}catch(n){i?.(`Failed to ${t?`disable`:`enable`} MCP server '${e.name}': ${de(n)}`)}},[e.client.type,e.config.type,e.name,ke,r,i]),Pe=B.useCallback(async()=>{if(e.config.type===`claudeai-proxy`)return;_(!0),y(null);let t=new AbortController;D.current=t;try{if(e.isAuthenticated&&e.config&&await Ae(e.name,e.config,{preserveStepUpState:!0}),e.config){await jt(e.name,e.config,T,t.signal,{onWaitingForCallback:e=>{ve(()=>e)}}),be(`tengu_mcp_auth_config_authenticate`,{wasAuthenticated:e.isAuthenticated});let n=await I(e.name);if(n.client.type===`connected`){let t=ye?`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.`):(fe(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 Dt)&&y(e.message)}finally{_(!1),D.current=null,ve(null),me(``)}},[e.isAuthenticated,e.config,e.name,i,I,ye]),Fe=async()=>{e.config.type!==`claudeai-proxy`&&e.config&&(await Ae(e.name,e.config),be(`tengu_mcp_auth_config_clear`,{}),await Ie(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=Te(t.mcp.tools,e.name),i=Ke(t.mcp.commands,e.name),a=Je(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)(Mt,{}),(0,V.jsx)(p,{children:t})]}),w&&(0,V.jsxs)(C,{flexDirection:`column`,children:[(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL manually `}),P?(0,V.jsx)(p,{color:`success`,children:`(Copied!)`}):(0,V.jsx)(p,{dimColor:!0,children:(0,V.jsx)(h,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,V.jsx)(c,{url:w})]}),m&&w&&_e&&(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)(We,{value:pe,onChange:me,onSubmit:e=>{_e(e.trim()),me(``)},cursorOffset:he,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(ie)return(0,V.jsxs)(C,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(p,{color:`claude`,children:[`Authenticating with `,e.name,`…`]}),(0,V.jsxs)(C,{children:[(0,V.jsx)(Mt,{}),(0,V.jsx)(p,{children:` A browser window will open for authentication`})]}),k&&(0,V.jsxs)(C,{flexDirection:`column`,children:[(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL manually `}),P?(0,V.jsx)(p,{color:`success`,children:`(Copied!)`}):(0,V.jsx)(p,{dimColor:!0,children:(0,V.jsx)(h,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,V.jsx)(c,{url:k})]}),(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(j)return(0,V.jsxs)(C,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(p,{color:`claude`,children:[`Clear authentication for `,e.name]}),se?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(p,{children:`Find the MCP server in the browser and click "Disconnect".`}),N&&(0,V.jsxs)(C,{flexDirection:`column`,children:[(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{dimColor:!0,children:`If your browser didn't open automatically, copy this URL manually `}),P?(0,V.jsx)(p,{color:`success`,children:`(Copied!)`}):(0,V.jsx)(p,{dimColor:!0,children:(0,V.jsx)(h,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,V.jsx)(c,{url:N})]}),(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(re)return(0,V.jsxs)(C,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(p,{color:`text`,children:[`Connecting to `,(0,V.jsx)(p,{bold:!0,children:e.name}),`…`]}),(0,V.jsxs)(C,{children:[(0,V.jsx)(Mt,{}),(0,V.jsx)(p,{children:` Establishing connection to MCP server`})]}),(0,V.jsx)(p,{dimColor:!0,children:`This may take a few moments.`})]});let R=[];return e.client.type===`disabled`&&R.push({label:`Enable`,value:`toggle-enabled`}),e.client.type===`connected`&&t>0&&R.push({label:`View tools`,value:`tools`}),e.config.type===`claudeai-proxy`?e.client.type===`connected`?R.push({label:`Clear authentication`,value:`claudeai-clear-auth`}):e.client.type!==`disabled`&&R.push({label:`Authenticate`,value:`claudeai-auth`}):(ye&&(R.push({label:`Re-authenticate`,value:`reauth`}),R.push({label:`Clear authentication`,value:`clear-auth`})),ye||R.push({label:`Authenticate`,value:`auth`})),e.client.type!==`disabled`&&(e.client.type!==`needs-auth`&&R.push({label:`Reconnect`,value:`reconnectMcpServer`}),R.push({label:`Disable`,value:`toggle-enabled`})),R.length===0&&R.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:[Ee,` 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: `}),ye?(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:yt(e.scope)})]}),e.client.type===`connected`&&(0,V.jsx)(Dn,{serverToolsCount:t,serverPromptsCount:Oe,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]})}),R.length>0&&(0,V.jsx)(C,{marginTop:1,children:(0,V.jsx)(Le,{options:R,onChange:async t=>{switch(t){case`tools`:n();break;case`auth`:case`reauth`:await Pe();break;case`clear-auth`:await Fe();break;case`claudeai-auth`:await L();break;case`claudeai-clear-auth`:je();break;case`reconnectMcpServer`:E(!0);try{let t=await I(e.name);e.config.type===`claudeai-proxy`&&be(`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`&&be(`tengu_claudeai_mcp_reconnect`,{success:!1}),i?.(jn(t,e.name))}finally{E(!1)}break;case`toggle-enabled`:await Me();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),ye(),we(),Jt(),Wt(),x(),Ut(),ke(),$e(),vn(),Ze(),Rt(),N(),Kt(),F(),pe(),_e(),wt(),Ot(),L(),je(),kn(),Mn(),V=w()}));function Fn({server:e,serverToolsCount:t,onViewTools:n,onCancel:r,onComplete:i,borderless:o=!1}){let[s]=u(),c=qt(),l=De(e=>e.mcp),d=yn(),f=_n(),[m,_]=(0,In.useState)(!1),v=In.useCallback(async()=>{let t=e.client.type!==`disabled`;try{await f(e.name),r()}catch(n){i(`Failed to ${t?`disable`:`enable`} MCP server '${e.name}': ${de(n)}`)}},[e.client.type,e.name,f,r,i]),y=xe(String(e.name)),b=Ct(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)(Mt,{}),(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:yt(Me(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)(Le,{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),Jt(),x(),Ue(),vn(),Ze(),Rt(),F(),_e(),wt(),Ot(),L(),kn(),Mn(),H=w()}));function Rn({tool:e,server:t,onBack:n}){let[r,i]=zn.useState(``),a=D(e.name,t.name),o=E(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(),k(),wt(),U=w()}));function Vn({server:e,onSelectTool:t,onBack:n}){let r=De(e=>e.mcp.tools),i=Hn.useMemo(()=>e.client.type===`connected`?gt(r,e.name):[],[e,r]),a=i.map((t,n)=>{let r=D(t.name,e.name),i=E(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} ${ve(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)(Le,{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(),k(),Ze(),Rt(),_e(),wt(),Ot(),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 bt(n,e=>{v(e)});St(e,{source:t}),Pt();let r=n.source;n.source===`github`&&(r=n.repo),be(`tengu_marketplace_added`,{source_type:r}),l&&await l(),v(``),m(!1),u?s(`Successfully added marketplace: ${e}`):c({type:`browse-marketplace`,targetMarketplace:e})}catch(e){let t=P(e);me(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)(We,{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)(Mt,{}),(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),ye(),wt(),x(),L(),je(),F(),pe(),Be(),Ee(),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(),Ut(),n(),Zn=w()}));async function $n(e){let{enabled:t,disabled:n}=await It();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=lt(e);Object.keys(r).length>0&&n.push({key:`top-level`,title:`Configure ${e.name}`,subtitle:`Plugin options`,schema:r,load:()=>Tt(t),save:n=>Ft(t,n,e.manifest.userConfig)});let i=st(e);for(let r of i)n.push({key:`channel:${r.server}`,title:`Configure ${r.displayName}`,subtitle:`Plugin: ${e.name}`,schema:r.configSchema,load:()=>ze(t,r.server)??void 0,save:e=>kt(t,r.server,e,r.configSchema)});return n}),[i,a]=tr.useState(0),o=tr.useRef(n);if(o.current=n,tr.useEffect(()=>{r.length===0&&o.current(`skipped`)},[r.length]),r.length===0)return null;let s=r[i];function c(e){try{s.save(e)}catch(e){n(`error`,de(e));return}let t=i+1;t<r.length?a(t):n(`configured`)}return(0,nr.jsx)(Yn,{title:s.title,subtitle:s.subtitle,configSchema:s.schema,initialValues:s.load(),onSave:c,onCancel:()=>n(`skipped`)},s.key)}var tr,nr,rr=e((()=>{tr=t(l(),1),F(),et(),_t(),Et(),Ye(),Qn(),nr=w()}));function ir(){let e=ut();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(),Xe(),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(),wt(),x(),ur=w()}));function fr({totalItems:e,maxVisible:t=mr,selectedIndex:n=0}){let r=e>t,i=(0,pr.useRef)(0),a=(0,pr.useMemo)(()=>{if(!r)return 0;let a=i.current;if(n<a)return i.current=n,n;if(n>=a+t){let e=n-t+1;return i.current=e,e}let o=Math.max(0,e-t),s=Math.min(a,o);return i.current=s,s},[n,t,r,e]),o=a,s=Math.min(a+t,e),c=(0,pr.useCallback)(e=>r?e.slice(o,s):e,[r,o,s]),l=(0,pr.useCallback)(e=>o+e,[o]),u=(0,pr.useCallback)(e=>e>=o&&e<s,[o,s]),d=(0,pr.useCallback)(e=>{},[]),f=(0,pr.useCallback)(()=>{},[]),p=(0,pr.useCallback)(()=>{},[]),m=(0,pr.useCallback)((t,n)=>{n(Math.max(0,Math.min(t,e-1)))},[e]),h=(0,pr.useCallback)((e,t)=>!1,[]),g=Math.max(1,Math.ceil(e/t));return{currentPage:Math.floor(a/t),totalPages:g,startIndex:o,endIndex:s,needsPagination:r,pageSize:t,getVisibleItems:c,toActualIndex:l,isOnCurrentPage:u,goToPage:d,nextPage:f,prevPage:p,handleSelectionChange:m,handlePageNavigation:h,scrollPosition:{current:n+1,total:e,canScrollUp:a>0,canScrollDown:a+t<e}}}var pr,mr,hr=e((()=>{pr=t(l(),1),mr=5}));function gr({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:o,targetMarketplace:s,targetPlugin:c}){let[l,u]=(0,vr.useState)(`marketplace-list`),[d,f]=(0,vr.useState)(null),[m,h]=(0,vr.useState)(null),[_,y]=(0,vr.useState)([]),[b,x]=(0,vr.useState)([]),[ee,S]=(0,vr.useState)(!0),[ne,w]=(0,vr.useState)(null),[T,re]=(0,vr.useState)(0),[E,D]=(0,vr.useState)(new Set),[ie,O]=(0,vr.useState)(new Set),k=fr({totalItems:b.length,selectedIndex:T}),[A,j]=(0,vr.useState)(0),[M,N]=(0,vr.useState)(!1),[ae,oe]=(0,vr.useState)(null),[se,ce]=(0,vr.useState)(null);te(`confirm:no`,_r.useCallback(()=>{l===`plugin-list`?s?i({type:`manage-marketplaces`,targetMarketplace:s}):_.length===1?i({type:`menu`}):(u(`marketplace-list`),f(null),D(new Set)):l===`plugin-details`?(u(`plugin-list`),h(null)):i({type:`menu`})},[l,s,i,_.length]),{context:`Confirmation`}),(0,vr.useEffect)(()=>{async function e(){try{let e=await at(),{marketplaces:n,failures:r}=await Lt(e),i=[];for(let{name:e,config:t,data:r}of n)if(r){let n=he(r.plugins,t=>Pe(it(t.name,e)));i.push({name:e,totalPlugins:r.plugins.length,installedCount:n,source:ft(t.source)})}i.sort((e,t)=>e.name===`claude-plugin-directory`?-1:+(t.name===`claude-plugin-directory`)),y(i);let a=ht(r,he(n,e=>e.data!==null));if(a)if(a.type===`warning`)ce(a.message+`. Showing available marketplaces.`);else throw Error(a.message);if(i.length===1&&!s&&!c){let e=i[0];e&&(f(e.name),u(`plugin-list`))}if(c){let n=null,r=null;for(let[t]of Object.entries(e)){let e=await qe(t);if(e){let i=e.plugins.find(e=>e.name===c);if(i){let e=it(i.name,t);n={entry:i,marketplaceName:t,pluginId:e,isInstalled:He(e)},r=t;break}}}if(n&&r){let e=n.pluginId;He(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=it(e.name,n);dt(t)||r.push({entry:e,marketplaceName:n,pluginId:t,isInstalled:He(t)})}try{let t=await dn();if(e)return;w(t),t?r.sort((e,n)=>{let r=t.get(e.pluginId)??0,i=t.get(n.pluginId)??0;return r===i?e.entry.name.localeCompare(n.entry.name):i-r}):r.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}catch(t){if(e)return;ue(`Failed to fetch install counts: ${de(t)}`),r.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}x(r),re(0),D(new Set)}catch(n){if(e)return;t(n instanceof Error?n.message:`Failed to load plugins`)}finally{S(!1)}}return n(d),()=>{e=!0}},[d,t]);let P=async()=>{if(E.size===0)return;let e=b.filter(e=>E.has(e.pluginId));O(new Set(e.map(e=>e.pluginId)));let n=0,a=0,s=[];for(let t of e){let e=await Ve({pluginId:t.pluginId,entry:t.entry,marketplaceName:t.marketplaceName,scope:`user`});e.success?n++:(a++,s.push({name:t.entry.name,reason:e.error}))}O(new Set),D(new Set),Pt(),a===0?r(`✓ Installed ${n} ${ve(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${vt(s,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${vt(s,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&o&&await o(),i({type:`menu`})},F=async(e,t=`user`)=>{N(!0),oe(null);let n=await Ve({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await $n(e.pluginId);if(t){N(!1),u({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),o&&await o(),i({type:`menu`})}else N(!1),oe(n.error)};(0,vr.useEffect)(()=>{e&&r(e)},[e,r]),v({"select:previous":()=>{T>0&&re(T-1)},"select:next":()=>{T<_.length-1&&re(T+1)},"select:accept":()=>{let e=_[T];e&&(f(e.name),u(`plugin-list`))}},{context:`Select`,isActive:l===`marketplace-list`}),v({"select:previous":()=>{T>0&&k.handleSelectionChange(T-1,re)},"select:next":()=>{T<b.length-1&&k.handleSelectionChange(T+1,re)},"select:accept":()=>{if(T===b.length&&E.size>0)P();else if(T<b.length){let e=b[T];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(h(e),u(`plugin-details`),j(0),oe(null)))}}},{context:`Select`,isActive:l===`plugin-list`}),v({"plugin:toggle":()=>{if(T<b.length){let e=b[T];if(e&&!e.isInstalled){let t=new Set(E);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),D(t)}}},"plugin:install":()=>{E.size>0&&P()}},{context:`Plugin`,isActive:l===`plugin-list`});let le=_r.useMemo(()=>{if(!m)return[];let e=m.entry.homepage;return cr(e,sr(m))},[m]);if(v({"select:previous":()=>{A>0&&j(A-1)},"select:next":()=>{A<le.length-1&&j(A+1)},"select:accept":()=>{if(!m)return;let e=le[A]?.action,t=m.entry.homepage,n=sr(m);e===`install-user`?F(m,`user`):e===`install-project`?F(m,`project`):e===`install-local`?F(m,`local`):e===`homepage`&&t?Gt(t):e===`github`&&n?Gt(`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`})}),se&&(0,G.jsx)(C,{marginBottom:1,flexDirection:`column`,children:(0,G.jsxs)(p,{color:`warning`,children:[a.warning,` `,se]})}),_.map((e,t)=>(0,G.jsxs)(C,{flexDirection:`column`,marginBottom:+(t<_.length-1),children:[(0,G.jsx)(C,{children:(0,G.jsxs)(p,{color:T===t?`suggestion`:void 0,children:[T===t?a.pointer:` `,` `,e.name]})}),(0,G.jsx)(C,{marginLeft:2,children:(0,G.jsxs)(p,{dimColor:!0,children:[e.totalPlugins,` `,ve(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,{}),ae&&(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsxs)(p,{color:`error`,children:[`Error: `,ae]})}),(0,G.jsx)(C,{flexDirection:`column`,children:t.map((e,t)=>(0,G.jsxs)(C,{children:[A===t&&(0,G.jsx)(p,{children:`> `}),A!==t&&(0,G.jsx)(p,{children:` `}),(0,G.jsx)(p,{bold:A===t,children:M&&e.action===`install`?`Installing…`:e.label})]},e.action))}),(0,G.jsx)(C,{marginTop:1,paddingLeft:1,children:(0,G.jsx)(p,{dimColor:!0,children:(0,G.jsxs)(g,{children:[(0,G.jsx)(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 fe=k.getVisibleItems(b);return(0,G.jsxs)(C,{flexDirection:`column`,children:[(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsx)(p,{bold:!0,children:`Install Plugins`})}),k.scrollPosition.canScrollUp&&(0,G.jsx)(C,{children:(0,G.jsxs)(p,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),fe.map((t,n)=>{let r=T===k.toActualIndex(n),i=E.has(t.pluginId),o=ie.has(t.pluginId);return(0,G.jsxs)(C,{flexDirection:`column`,marginBottom:n===fe.length-1&&!e?0:1,children:[(0,G.jsxs)(C,{children:[(0,G.jsxs)(p,{color:r?`suggestion`:void 0,children:[r?a.pointer:` `,` `]}),(0,G.jsxs)(p,{color:t.isInstalled?`success`:void 0,children:[t.isInstalled?a.tick:o?a.ellipsis:i?a.radioOn:a.radioOff,` `,t.entry.name,t.entry.category&&(0,G.jsxs)(p,{dimColor:!0,children:[` [`,t.entry.category,`]`]}),t.entry.tags?.includes(`community-managed`)&&(0,G.jsx)(p,{dimColor:!0,children:` [Community Managed]`}),t.isInstalled&&(0,G.jsx)(p,{dimColor:!0,children:` (installed)`}),ne&&d===`claude-plugins-official`&&(0,G.jsxs)(p,{dimColor:!0,children:[` · `,un(ne.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,G.jsxs)(C,{marginLeft:4,children:[(0,G.jsx)(p,{dimColor:!0,children:Se(t.entry.description,60)}),t.entry.version&&(0,G.jsxs)(p,{dimColor:!0,children:[` · v`,t.entry.version]})]})]},t.pluginId)}),k.scrollPosition.canScrollDown&&(0,G.jsx)(C,{children:(0,G.jsxs)(p,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,G.jsx)(C,{marginTop:1,children:(0,G.jsxs)(p,{color:`error`,children:[a.cross,` `,e]})}),(0,G.jsx)(lr,{hasSelection:E.size>0})]})}var _r,vr,G,yr=e((()=>{i(),_r=t(l(),1),vr=t(l(),1),wt(),x(),Ut(),ge(),Kt(),le(),F(),Be(),sn(),Re(),Xe(),Ee(),pt(),At(),mt(),_e(),I(),rr(),or(),dr(),hr(),G=w()}));function br({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:o,onSearchModeChange:c,targetPlugin:l}){let[u,m]=(0,K.useState)(`plugin-list`),[h,_]=(0,K.useState)(null),[y,b]=(0,K.useState)([]),[x,ee]=(0,K.useState)(!0),[S,w]=(0,K.useState)(null),[T,re]=(0,K.useState)(!1),E=(0,K.useCallback)(e=>{re(e),c?.(e)},[c]),{query:D,setQuery:ie,cursorOffset:O}=xn({isActive:u===`plugin-list`&&T&&!x,onExit:()=>{E(!1)}}),k=d(),{columns:A}=s(),j=(0,K.useMemo)(()=>{if(!D)return y;let e=D.toLowerCase();return y.filter(t=>t.entry.name.toLowerCase().includes(e)||t.entry.description?.toLowerCase().includes(e)||t.marketplaceName.toLowerCase().includes(e))},[y,D]),[M,N]=(0,K.useState)(0),[ae,oe]=(0,K.useState)(new Set),[se,ce]=(0,K.useState)(new Set),P=fr({totalItems:j.length,selectedIndex:M});(0,K.useEffect)(()=>{N(0)},[D]);let[F,le]=(0,K.useState)(0),[fe,pe]=(0,K.useState)(!1),[me,ge]=(0,K.useState)(null),[_e,ye]=(0,K.useState)(null),[be,xe]=(0,K.useState)(null);(0,K.useEffect)(()=>{async function e(){try{let e=await at(),{marketplaces:n,failures:r}=await Lt(e),i=[];for(let{name:e,data:t}of n)if(t)for(let n of t.plugins){let t=it(n.name,e);i.push({entry:n,marketplaceName:e,pluginId:t,isInstalled:He(t)})}let a=i.filter(e=>!e.isInstalled&&!dt(e.pluginId));try{let e=await dn();w(e),e?a.sort((t,n)=>{let r=e.get(t.pluginId)??0,i=e.get(n.pluginId)??0;return r===i?t.entry.name.localeCompare(n.entry.name):i-r}):a.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}catch(e){ue(`Failed to fetch install counts: ${de(e)}`),a.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}b(a);let o=Object.keys(e).length;a.length===0&&xe(await ct({configuredMarketplaceCount:o,failedMarketplaceCount:r.length}));let s=ht(r,he(n,e=>e.data!==null));if(s)if(s.type===`warning`)ye(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 I=async()=>{if(ae.size===0)return;let e=y.filter(e=>ae.has(e.pluginId));ce(new Set(e.map(e=>e.pluginId)));let n=0,a=0,s=[];for(let t of e){let e=await Ve({pluginId:t.pluginId,entry:t.entry,marketplaceName:t.marketplaceName,scope:`user`});e.success?n++:(a++,s.push({name:t.entry.name,reason:e.error}))}ce(new Set),oe(new Set),Pt(),a===0?r(`✓ Installed ${n} ${ve(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${vt(s,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${vt(s,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&o&&await o(),i({type:`menu`})},Ce=async(e,t=`user`)=>{pe(!0),ge(null);let n=await Ve({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await $n(e.pluginId);if(t){pe(!1),m({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),o&&await o(),i({type:`menu`})}else pe(!1),ge(n.error)};(0,K.useEffect)(()=>{e&&r(e)},[e,r]),te(`confirm:no`,()=>{m(`plugin-list`),_(null)},{context:`Confirmation`,isActive:u===`plugin-details`}),te(`confirm:no`,()=>{i({type:`menu`})},{context:`Confirmation`,isActive:u===`plugin-list`&&!T}),ne((e,t)=>{let n=!t.ctrl&&!t.meta;T||(e===`/`&&n?(E(!0),ie(``)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==`i`&&(E(!0),ie(e)))},{isActive:u===`plugin-list`&&!x}),v({"select:previous":()=>{M===0?E(!0):P.handleSelectionChange(M-1,N)},"select:next":()=>{M<j.length-1&&P.handleSelectionChange(M+1,N)},"select:accept":()=>{if(M===j.length&&ae.size>0)I();else if(M<j.length){let e=j[M];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(_(e),m(`plugin-details`),le(0),ge(null)))}}},{context:`Select`,isActive:u===`plugin-list`&&!T}),v({"plugin:toggle":()=>{if(M<j.length){let e=j[M];if(e&&!e.isInstalled){let t=new Set(ae);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),oe(t)}}},"plugin:install":()=>{ae.size>0&&I()}},{context:`Plugin`,isActive:u===`plugin-list`&&!T});let we=Cr.useMemo(()=>{if(!h)return[];let e=h.entry.homepage;return cr(e,sr(h))},[h]);if(v({"select:previous":()=>{F>0&&le(F-1)},"select:next":()=>{F<we.length-1&&le(F+1)},"select:accept":()=>{if(!h)return;let e=we[F]?.action,t=h.entry.homepage,n=sr(h);e===`install-user`?Ce(h,`user`):e===`install-project`?Ce(h,`project`):e===`install-local`?Ce(h,`local`):e===`homepage`&&t?Gt(t):e===`github`&&n?Gt(`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,{}),me&&(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsxs)(p,{color:`error`,children:[`Error: `,me]})}),(0,q.jsx)(C,{flexDirection:`column`,children:t.map((e,t)=>(0,q.jsxs)(C,{children:[F===t&&(0,q.jsx)(p,{children:`> `}),F!==t&&(0,q.jsx)(p,{children:` `}),(0,q.jsx)(p,{bold:F===t,children:fe&&e.action.startsWith(`install-`)?`Installing…`:e.label})]},e.action))}),(0,q.jsx)(C,{marginTop:1,children:(0,q.jsx)(p,{dimColor:!0,children:(0,q.jsxs)(g,{children:[(0,q.jsx)(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:be}),(0,q.jsx)(C,{marginTop:1,children:(0,q.jsx)(p,{dimColor:!0,italic:!0,children:`Esc to go back`})})]});let Te=P.getVisibleItems(j);return(0,q.jsxs)(C,{flexDirection:`column`,children:[(0,q.jsxs)(C,{children:[(0,q.jsx)(p,{bold:!0,children:`Discover plugins`}),P.needsPagination&&(0,q.jsxs)(p,{dimColor:!0,children:[` `,`(`,P.scrollPosition.current,`/`,P.scrollPosition.total,`)`]})]}),(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsx)(f,{query:D,isFocused:T,isTerminalFocused:k,width:A-4,cursorOffset:O})}),_e&&(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsxs)(p,{color:`warning`,children:[a.warning,` `,_e]})}),j.length===0&&D&&(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsxs)(p,{dimColor:!0,children:[`No plugins match "`,D,`"`]})}),P.scrollPosition.canScrollUp&&(0,q.jsx)(C,{children:(0,q.jsxs)(p,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),Te.map((t,n)=>{let r=M===P.toActualIndex(n),i=ae.has(t.pluginId),o=se.has(t.pluginId);return(0,q.jsxs)(C,{flexDirection:`column`,marginBottom:n===Te.length-1&&!e?0:1,children:[(0,q.jsxs)(C,{children:[(0,q.jsxs)(p,{color:r&&!T?`suggestion`:void 0,children:[r&&!T?a.pointer:` `,` `]}),(0,q.jsxs)(p,{children:[o?a.ellipsis:i?a.radioOn:a.radioOff,` `,t.entry.name,(0,q.jsxs)(p,{dimColor:!0,children:[` · `,t.marketplaceName]}),t.entry.tags?.includes(`community-managed`)&&(0,q.jsx)(p,{dimColor:!0,children:` [Community Managed]`}),S&&t.marketplaceName===`claude-plugins-official`&&(0,q.jsxs)(p,{dimColor:!0,children:[` · `,un(S.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,q.jsx)(C,{marginLeft:4,children:(0,q.jsx)(p,{dimColor:!0,children:Se(t.entry.description,60)})})]},`${P.startIndex}-${t.pluginId}`)}),P.scrollPosition.canScrollDown&&(0,q.jsx)(C,{children:(0,q.jsxs)(p,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,q.jsx)(C,{marginTop:1,children:(0,q.jsxs)(p,{color:`error`,children:[a.cross,` `,e]})}),(0,q.jsx)(xr,{hasSelection:ae.size>0,canToggle:M<j.length&&!j[M]?.isInstalled})]})}function xr({hasSelection:e,canToggle:t}){return(0,q.jsx)(C,{marginTop:1,children:(0,q.jsx)(p,{dimColor:!0,italic:!0,children:(0,q.jsxs)(g,{children:[e&&(0,q.jsx)(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),wt(),bn(),x(),Sn(),Wt(),Ut(),ge(),Kt(),le(),F(),Be(),sn(),Re(),Xe(),Ee(),pt(),At(),mt(),_e(),I(),rr(),or(),dr(),hr(),q=w()}));function Tr({setViewState:e,error:t,setError:n,setResult:r,exitState:i,onManageComplete:o,targetMarketplace:s,action:c}){let[l,u]=(0,Dr.useState)([]),[d,f]=(0,Dr.useState)(!0),[m,h]=(0,Dr.useState)(0),[_,y]=(0,Dr.useState)(!1),[b,x]=(0,Dr.useState)(null),[ee,S]=(0,Dr.useState)(null),[w,T]=(0,Dr.useState)(null),[E,D]=(0,Dr.useState)(`list`),[k,A]=(0,Dr.useState)(null),[j,M]=(0,Dr.useState)(0),N=(0,Dr.useRef)(!1);(0,Dr.useEffect)(()=>{async function e(){try{let e=await at(),{enabled:r,disabled:i}=await It(),a=[...r,...i],{marketplaces:o,failures:l}=await Lt(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:ft(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=ht(l,he(o,e=>e.data!==null));if(f)if(f.type===`warning`)x(f.message);else throw Error(f.message);if(s&&!N.current&&!t){N.current=!0;let e=d.findIndex(e=>e.name===s);if(e>=0){let t=d[e];if(c){h(e+1);let t=[...d];c===`update`?t[e].pendingUpdate=!0:c===`remove`&&(t[e].pendingRemove=!0),u(t),setTimeout(ce,100,t)}else t&&(h(e+1),A(t),D(`details`))}else n&&n(`Marketplace not found: ${s}`)}}catch(e){n&&n(e instanceof Error?e.message:`Failed to load marketplaces`),x(e instanceof Error?e.message:`Failed to load marketplaces`)}finally{f(!1)}}e()},[s,c,t]);let ae=()=>l.some(e=>e.pendingUpdate||e.pendingRemove),se=()=>({updateCount:he(l,e=>e.pendingUpdate),removeCount:he(l,e=>e.pendingRemove)}),ce=async t=>{let i=t||l,s=E===`details`;y(!0),x(null),S(null),T(null);try{let t=ie(`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=it(t.name,e.name);n[r]=!1}re(`userSettings`,{enabledPlugins:n})}await Qe(e.name),c++,be(`tengu_marketplace_removed`,{marketplace_name:e.name,plugins_uninstalled:e.installedPlugins?.length||0});continue}e.pendingUpdate&&(await xt(e.name,e=>{T(e)}),n++,l.add(e.name.toLowerCase()),be(`tengu_marketplace_updated`,{marketplace_name:e.name}))}let d=0;l.size>0&&(d=(await Cn(l)).length),Pt(),o&&await o();let f=await at(),{enabled:p,disabled:m}=await It(),h=[...p,...m],{marketplaces:g}=await Lt(f),_=[];for(let{name:e,config:t,data:n}of g){let r=h.filter(t=>t.source.endsWith(`@${e}`));_.push({name:e,source:ft(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&&k){let e=_.find(e=>e.name===k.name);e&&A(e)}let v=[];if(n>0){let e=d>0?` (${d} ${ve(d,`plugin`)} bumped)`:``;v.push(`Updated ${n} ${ve(n,`marketplace`)}${e}`)}if(c>0&&v.push(`Removed ${c} ${ve(c,`marketplace`)}`),v.length>0){let t=`${a.tick} ${v.join(`, `)}`;s?S(t):(r(t),setTimeout(e,2e3,{type:`menu`}))}else s||e({type:`menu`})}catch(e){let t=de(e);x(t),n&&n(t)}finally{y(!1),T(null)}},P=async()=>{if(!k)return;let e=l.map(e=>e.name===k.name?{...e,pendingRemove:!0}:e);u(e),await ce(e)},F=e=>{if(!e)return[];let t=[{label:`Browse plugins (${e.pluginCount??0})`,value:`browse`},{label:`Update marketplace`,secondaryLabel:e.lastUpdated?`(last updated ${new Date(e.lastUpdated).toLocaleDateString()})`:void 0,value:`update`}];return O()||t.push({label:e.autoUpdate?`Disable auto-update`:`Enable auto-update`,value:`toggle-auto-update`}),t.push({label:`Remove marketplace`,value:`remove`}),t},le=async e=>{let t=!e.autoUpdate;try{await nt(e.name,t),u(n=>n.map(n=>n.name===e.name?{...n,autoUpdate:t}:n)),A(e=>e&&{...e,autoUpdate:t})}catch(e){x(e instanceof Error?e.message:`Failed to update setting`)}};if(te(`confirm:no`,()=>{D(`list`),M(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`&&ae()}),te(`confirm:no`,()=>{e({type:`menu`})},{context:`Confirmation`,isActive:!_&&E===`list`&&!ae()}),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(ae())ce();else{let e=l[t];e&&(A(e),D(`details`),M(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&&(A(e),D(`confirm-remove`))}},{isActive:!_&&E===`list`}),v({"select:previous":()=>M(e=>Math.max(0,e-1)),"select:next":()=>{let e=F(k);M(t=>Math.min(e.length-1,t+1))},"select:accept":()=>{if(!k)return;let t=F(k)[j];if(t?.value===`browse`)e({type:`browse-marketplace`,targetMarketplace:k.name});else if(t?.value===`update`){let e=l.map(e=>e.name===k.name?{...e,pendingUpdate:!0}:e);u(e),ce(e)}else t?.value===`toggle-auto-update`?le(k):t?.value===`remove`&&D(`confirm-remove`)}},{context:`Select`,isActive:!_&&E===`details`}),ne(e=>{e===`y`||e===`Y`?P():(e===`n`||e===`N`)&&(D(`list`),A(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`&&k){let e=k.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:k.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,` `,ve(e,`plugin`),` from this marketplace:`]})}),k.installedPlugins&&k.installedPlugins.length>0&&(0,J.jsx)(C,{flexDirection:`column`,marginTop:1,marginLeft:2,children:k.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`&&k){let e=k.pendingUpdate||_,t=F(k);return(0,J.jsxs)(C,{flexDirection:`column`,children:[(0,J.jsx)(p,{bold:!0,children:k.name}),(0,J.jsx)(p,{dimColor:!0,children:k.source}),(0,J.jsx)(C,{marginTop:1,children:(0,J.jsxs)(p,{children:[k.pluginCount||0,` available `,ve(k.pluginCount||0,`plugin`)]})}),k.installedPlugins&&k.installedPlugins.length>0&&(0,J.jsxs)(C,{flexDirection:`column`,marginTop:1,children:[(0,J.jsxs)(p,{bold:!0,children:[`Installed plugins (`,k.installedPlugins.length,`):`]}),(0,J.jsx)(C,{flexDirection:`column`,marginLeft:1,children:k.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===j;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&&!O()&&k.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:fe}=se();return(0,J.jsxs)(C,{flexDirection:`column`,children:[(0,J.jsx)(C,{marginBottom:1,children:(0,J.jsx)(p,{bold:!0,children:`Manage marketplaces`})}),(0,J.jsxs)(C,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(p,{color:m===0?`suggestion`:void 0,children:[m===0?a.pointer:` `,` +`]}),(0,J.jsx)(p,{bold:!0,color:m===0?`suggestion`:void 0,children:`Add Marketplace`})]}),(0,J.jsx)(C,{flexDirection:`column`,children:l.map((e,t)=>{let n=t+1===m,r=[];return e.pendingUpdate&&r.push(`UPDATE`),e.pendingRemove&&r.push(`REMOVE`),(0,J.jsxs)(C,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(p,{color:n?`suggestion`:void 0,children:[n?a.pointer:` `,` `,e.pendingRemove?a.cross:a.bullet]}),(0,J.jsxs)(C,{flexDirection:`column`,flexGrow:1,children:[(0,J.jsxs)(C,{flexDirection:`row`,gap:1,children:[(0,J.jsxs)(p,{bold:!0,strikethrough:e.pendingRemove,dimColor:e.pendingRemove,children:[e.name===`claude-plugins-official`&&(0,J.jsx)(p,{color:`claude`,children:`✻ `}),e.name,e.name===`claude-plugins-official`&&(0,J.jsx)(p,{color:`claude`,children:` ✻`})]}),r.length>0&&(0,J.jsxs)(p,{color:`warning`,children:[`[`,r.join(`, `),`]`]})]}),(0,J.jsx)(p,{dimColor:!0,children:e.source}),(0,J.jsxs)(p,{dimColor:!0,children:[e.pluginCount!==void 0&&(0,J.jsxs)(J.Fragment,{children:[e.pluginCount,` available`]}),e.installedPlugins&&e.installedPlugins.length>0&&(0,J.jsxs)(J.Fragment,{children:[` • `,e.installedPlugins.length,` installed`]}),e.lastUpdated&&(0,J.jsxs)(J.Fragment,{children:[` • Updated `,new Date(e.lastUpdated).toLocaleDateString()]})]})]})]},e.name)})}),ae()&&(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,` `,ve(ue,`marketplace`)]}),fe>0&&(0,J.jsxs)(p,{color:`warning`,children:[`• Remove `,fe,` `,ve(fe,`marketplace`)]})]}),_&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{color:`claude`,children:`Processing changes…`})}),b&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{color:`error`,children:b})}),(0,J.jsx)(Er,{exitState:i,hasPendingActions:ae()})]})}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),ye(),wt(),x(),Ut(),ge(),j(),F(),Be(),Xe(),Ee(),wn(),Et(),M(),T(),_e(),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 Fe(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((()=>{R()}));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} ${ve(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} ${ve(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(),_e(),Y=w()}));async function Pr(e){try{return(await En.readdir(e,{withFileTypes:!0})).filter(e=>e.isFile()&&e.name.endsWith(`.md`)).map(e=>Tn.basename(e.name,`.md`))}catch(t){return ue(`Failed to read plugin components from ${e}: ${de(t)}`,{level:`error`}),me(P(t)),[]}}async function Fr(e){try{let t=await En.readdir(e,{withFileTypes:!0}),n=[];for(let r of t)if(r.isDirectory()||r.isSymbolicLink()){let t=Tn.join(e,r.name,`SKILL.md`);try{(await En.stat(t)).isFile()&&n.push(r.name)}catch{}}return n}catch(t){return ue(`Failed to read skill directories from ${e}: ${de(t)}`,{level:`error`}),me(P(t)),[]}}function Ir({plugin:e,marketplace:t}){let[n,r]=(0,X.useState)(null),[i,a]=(0,X.useState)(!0),[o,s]=(0,X.useState)(null);return(0,X.useEffect)(()=>{async function n(){try{if(t===`builtin`){let t=Ht(e.name);if(t){let e=t.skills?.map(e=>e.name)??[],n=t.hooks?Object.keys(t.hooks):[],i=t.mcpServers?Object.keys(t.mcpServers):[];r({commands:null,agents:null,skills:e.length>0?e:null,hooks:n.length>0?n:null,mcpServers:i.length>0?i:null})}else s(`Built-in plugin ${e.name} not found`);a(!1);return}let n=(await 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!dt(`${e.name}@${t}`)})}function zr({setViewState:e,setResult:t,onManageComplete:n,onSearchModeChange:r,targetPlugin:i,targetMarketplace:o,action:c}){let l=De(e=>e.mcp.clients),u=De(e=>e.mcp.tools),m=De(e=>e.plugins.errors),h=mn(),[_,y]=(0,X.useState)(!1),b=(0,X.useCallback)(e=>{y(e),r?.(e)},[r]),x=d(),{columns:ee}=s(),[S,w]=(0,X.useState)(`plugin-list`),{query:T,setQuery:E,cursorOffset:D}=xn({isActive:S===`plugin-list`&&_,onExit:()=>{b(!1)}}),[O,k]=(0,X.useState)(null),[j,M]=(0,X.useState)([]),[N,ae]=(0,X.useState)([]),[oe,ce]=(0,X.useState)(!0),[F,le]=(0,X.useState)(new Map),fe=(0,X.useRef)(!1),pe=(0,X.useRef)(void 0),ge=_n();te(`confirm:no`,Br.useCallback(()=>{if(S===`plugin-details`)w(`plugin-list`),k(null),L(null);else if(typeof S==`object`&&S.type===`failed-plugin-details`)w(`plugin-list`),L(null);else if(S===`configuring`)w(`plugin-details`),Me(null);else if(typeof S==`object`&&(S.type===`plugin-options`||S.type===`configuring-options`))w(`plugin-list`),k(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`),L(null);else if(typeof S==`object`&&S.type===`mcp-detail`)w(`plugin-list`),L(null);else if(typeof S==`object`&&S.type===`mcp-tools`)w({type:`mcp-detail`,client:S.client});else if(typeof S==`object`&&S.type===`mcp-tool-detail`)w({type:`mcp-tools`,client:S.client});else{if(F.size>0){t(`Run /reload-plugins to apply plugin changes.`);return}e({type:`menu`})}},[S,e,F,t]),{context:`Confirmation`,isActive:(S!==`plugin-list`||!_)&&S!==`confirm-project-uninstall`&&!(typeof S==`object`&&S.type===`confirm-data-cleanup`)});let _e=e=>e.type===`connected`?`connected`:e.type===`disabled`?`disabled`:e.type===`pending`?`pending`:e.type===`needs-auth`?`needs-auth`:`failed`,ye=(0,X.useMemo)(()=>{let e=A(),t=new Map;for(let e of l)if(e.name.startsWith(`plugin:`)){let n=e.name.split(`:`);if(n.length>=3){let r=n[1],i=n.slice(2).join(`:`),a=t.get(r)||[];a.push({displayName:i,client:e}),t.set(r,a)}}let n=[];for(let r of N){let i=`${r.plugin.name}@${r.marketplace}`,a=e?.enabledPlugins?.[i]!==!1,o=m.filter(e=>`plugin`in e&&e.plugin===r.plugin.name||e.source===i||e.source.startsWith(`${r.plugin.name}@`)),s=r.plugin.isBuiltin?`builtin`:r.scope||`user`;n.push({item:{type:`plugin`,id:i,name:r.plugin.name,description:r.plugin.manifest.description,marketplace:r.marketplace,scope:s,isEnabled:a,errorCount:o.length,errors:o,plugin:r.plugin,pendingEnable:r.pendingEnable,pendingUpdate:r.pendingUpdate,pendingToggle:F.get(i)},originalScope:s,childMcps:t.get(r.plugin.name)||[]})}let r=new Set(n.map(({item:e})=>e.id)),i=new Set(n.map(({item:e})=>e.name)),a=new Map;for(let e of m){if(r.has(e.source)||`plugin`in e&&typeof e.plugin==`string`&&i.has(e.plugin))continue;let t=a.get(e.source)||[];t.push(e),a.set(e.source,t)}let o=Xt(),s=[];for(let[e,t]of a){if(e in h)continue;let n=Bt(e),r=n.name||e,i=n.marketplace||`unknown`,a=o.get(e),c=a===`flag`||a===void 0?`user`:a;s.push({type:`failed-plugin`,id:e,name:r,marketplace:i,scope:c,errorCount:t.length,errors:t})}let c=[];for(let e of l)e.name!==`ide`&&(e.name.startsWith(`plugin:`)||c.push({type:`mcp`,id:`mcp:${e.name}`,name:e.name,description:void 0,scope:e.config.scope,status:_e(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:_e(n),client:n,indented:!0})}}for(let e of c){let t=e.scope;f.has(t)||f.set(t,[]),f.get(t).push(e)}for(let e of s){let t=e.scope;f.has(t)||f.set(t,[]),f.get(t).push(e)}for(let[e,t]of Object.entries(h)){let n=Bt(e),r=n.name||e,i=n.marketplace||`unknown`;f.has(`flagged`)||f.set(`flagged`,[]),f.get(`flagged`).push({type:`flagged-plugin`,id:e,name:r,marketplace:i,scope:`flagged`,reason:`delisted`,text:`Removed from marketplace`,flaggedAt:t.flaggedAt})}let p=[...f.keys()].sort((e,t)=>(u[e]??99)-(u[t]??99));for(let e of p){let t=f.get(e),n=[],r=[],i=0;for(;i<t.length;){let e=t[i];if(e.type===`plugin`||e.type===`failed-plugin`||e.type===`flagged-plugin`){let r=[e];i++;let a=t[i];for(;a?.type===`mcp`&&a.indented;)r.push(a),i++,a=t[i];n.push(r)}else e.type===`mcp`&&!e.indented&&r.push(e),i++}n.sort((e,t)=>e[0].name.localeCompare(t[0].name)),r.sort((e,t)=>e.name.localeCompare(t.name));for(let e of n)d.push(...e);d.push(...r)}return d},[N,l,m,F,h]),be=(0,X.useMemo)(()=>ye.filter(e=>e.type===`flagged-plugin`).map(e=>e.id),[ye]);(0,X.useEffect)(()=>{be.length>0&&pn(be)},[be]);let xe=(0,X.useMemo)(()=>{if(!T)return ye;let e=T.toLowerCase();return ye.filter(t=>t.name.toLowerCase().includes(e)||`description`in t&&t.description?.toLowerCase().includes(e))},[ye,T]),[I,Se]=(0,X.useState)(0),Ce=fr({totalItems:xe.length,selectedIndex:I,maxVisible:8}),[we,Te]=(0,X.useState)(0),[Ee,ke]=(0,X.useState)(!1),[Ae,L]=(0,X.useState)(null),[je,Me]=(0,X.useState)(null),[Ne,Pe]=(0,X.useState)(!1),[Fe,Ie]=(0,X.useState)(!1);(0,X.useEffect)(()=>{if(!O){Ie(!1);return}async function e(){let e=O.plugin.manifest.mcpServers,t=!1;if(e&&(t=typeof e==`string`&&Nt(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&&Nt(e))),!t)try{let e=Tn.join(O.plugin.path,`..`),n=Tn.join(e,`.claude-plugin`,`marketplace.json`),r=se(await En.readFile(n,`utf-8`)).plugins?.find(e=>e.name===O.plugin.name);if(r?.mcpServers){let e=r.mcpServers;t=typeof e==`string`&&Nt(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&&Nt(e))}}catch(e){ue(`Failed to read raw marketplace.json: ${e}`)}Ie(t)}e()},[O]),(0,X.useEffect)(()=>{async function e(){ce(!0);try{let{enabled:e,disabled:t}=await It(),n=A(),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=he(t,t=>{let r=`${t.name}@${e}`;return n?.enabledPlugins?.[r]!==!1}),i=t.length-r;a.push({name:e,installedPlugins:t,enabledCount:r,disabledCount:i})}a.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),M(a);let o=[];for(let e of a)for(let t of e.installedPlugins){let n=`${t.name}@${e.name}`,r=t.isBuiltin?`builtin`:nn(n).scope;o.push({plugin:t,marketplace:e.name,scope:r,pendingEnable:void 0,pendingUpdate:!1})}ae(o),Se(0)}finally{ce(!1)}}e()},[]),(0,X.useEffect)(()=>{if(!fe.current&&i&&j.length>0&&!oe){let{name:e,marketplace:n}=Bt(i),r=o??n,a=r?j.filter(e=>e.name===r):j;for(let t of a){let n=t.installedPlugins.find(t=>t.name===e);if(n){let{scope:e}=nn(`${n.name}@${t.name}`);k({plugin:n,marketplace:t.name,scope:e,pendingEnable:void 0,pendingUpdate:!1}),w(`plugin-details`),pe.current=c,fe.current=!0;return}}let s=ye.find(t=>t.type===`failed-plugin`&&t.name===e);s&&s.type===`failed-plugin`&&(w({type:`failed-plugin-details`,plugin:{id:s.id,name:s.name,marketplace:s.marketplace,errors:s.errors,scope:s.scope}}),fe.current=!0),!fe.current&&c&&(fe.current=!0,t(`Plugin "${i}" is not installed in this project`))}},[i,o,j,oe,ye,c,t]);let R=async r=>{if(!O)return;let i=O.scope||`user`,a=i===`builtin`;if(a&&(r===`update`||r===`uninstall`)){L(`Built-in plugins cannot be updated or uninstalled.`);return}if(!a&&!tn(i)&&r!==`update`){L(`This plugin is managed by your organization. Contact your admin to disable it.`);return}ke(!0),L(null);try{let o=`${O.plugin.name}@${O.marketplace}`,s;switch(r){case`enable`:{let e=await Zt(o);if(!e.success)throw Error(e.message);break}case`disable`:{let e=await en(o);if(!e.success)throw Error(e.message);s=e.reverseDependents;break}case`uninstall`:{if(a||!tn(i))break;if(an(o)){ke(!1),w(`confirm-project-uninstall`);return}let e=Ge().plugins[o],t=!e||e.length<=1?await tt(o):null;if(t){ke(!1),w({type:`confirm-data-cleanup`,size:t});return}let n=await Qt(o,i);if(!n.success)throw Error(n.message);s=n.reverseDependents;break}case`update`:{if(a)break;let r=await $t(o,i);if(!r.success)throw Error(r.message);if(r.alreadyUpToDate){t(`${O.plugin.name} is already at the latest version (${r.newVersion}).`),n&&await n(),e({type:`menu`});return}break}}Pt();let c=`${O.plugin.name}@${O.marketplace}`;if(A()?.enabledPlugins?.[c]!==!1){ke(!1),w({type:`plugin-options`});return}let l=r===`enable`?`Enabled`:r===`disable`?`Disabled`:r===`update`?`Updated`:`Uninstalled`,u=s&&s.length>0?` · required by ${s.join(`, `)}`:``;t(`✓ ${l} ${O.plugin.name}${u}. Run /reload-plugins to apply.`),n&&await n(),e({type:`menu`})}catch(e){ke(!1),L(`Failed to ${r}: ${e instanceof Error?e.message:String(e)}`),me(P(e))}},Le=(0,X.useRef)(R);Le.current=R,(0,X.useEffect)(()=>{if(S===`plugin-details`&&O&&pe.current){let e=pe.current;pe.current=void 0,Le.current(e)}},[S,O]);let Re=Br.useCallback(()=>{if(I>=xe.length)return;let e=xe[I];if(e?.type!==`flagged-plugin`)if(e?.type===`plugin`){let t=`${e.plugin.name}@${e.marketplace}`,n=A(),r=F.get(t),i=n?.enabledPlugins?.[t]!==!1,a=e.scope;if(a===`builtin`||tn(a)){let e=new Map(F);r?(e.delete(t),(async()=>{try{r===`will-disable`?await Zt(t):await en(t),Pt()}catch(e){me(e)}})()):(e.set(t,i?`will-disable`:`will-enable`),(async()=>{try{i?await en(t):await Zt(t),Pt()}catch(e){me(e)}})()),le(e)}}else e?.type===`mcp`&&ge(e.client.name)},[I,xe,F,N,ge]);v({"select:previous":()=>{I===0?b(!0):Ce.handleSelectionChange(I-1,Se)},"select:next":()=>{I<xe.length-1&&Ce.handleSelectionChange(I+1,Se)},"select:accept":Br.useCallback(()=>{if(I>=xe.length)return;let e=xe[I];if(e?.type===`plugin`){let t=N.find(t=>t.plugin.name===e.plugin.name&&t.marketplace===e.marketplace);t&&(k(t),w(`plugin-details`),Te(0),L(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}}),L(null)):e?.type===`failed-plugin`?(w({type:`failed-plugin-details`,plugin:{id:e.id,name:e.name,marketplace:e.marketplace,errors:e.errors,scope:e.scope}}),Te(0),L(null)):e?.type===`mcp`&&(w({type:`mcp-detail`,client:e.client}),L(null))},[I,xe,N])},{context:`Select`,isActive:S===`plugin-list`&&!_}),v({"plugin:toggle":Re},{context:`Plugin`,isActive:S===`plugin-list`&&!_}),v({"select:accept":Br.useCallback(()=>{typeof S!=`object`||S.type!==`flagged-detail`||(hn(S.plugin.id),w(`plugin-list`))},[S])},{context:`Select`,isActive:typeof S==`object`&&S.type===`flagged-detail`});let ze=Br.useMemo(()=>{if(S!==`plugin-details`||!O)return[];let e=A(),t=`${O.plugin.name}@${O.marketplace}`,n=e?.enabledPlugins?.[t]!==!1,r=O.marketplace===`builtin`,i=[];return i.push({label:n?`Disable plugin`:`Enable plugin`,action:()=>void R(n?`disable`:`enable`)}),r||(i.push({label:O.pendingUpdate?`Unmark for update`:`Mark for update`,action:async()=>{try{let e=await Lr(O.plugin.name,O.marketplace);if(e){L(e);return}let t=[...N],n=t.findIndex(e=>e.plugin.name===O.plugin.name&&e.marketplace===O.marketplace);n!==-1&&(t[n].pendingUpdate=!O.pendingUpdate,ae(t),k({...O,pendingUpdate:!O.pendingUpdate}))}catch(e){L(e instanceof Error?e.message:`Failed to check plugin update availability`)}}}),Fe&&i.push({label:`Configure`,action:async()=>{Pe(!0);try{let e=O.plugin.manifest.mcpServers,t=null;if(typeof e==`string`&&Nt(e))t=e;else if(Array.isArray(e)){for(let n of e)if(typeof n==`string`&&Nt(n)){t=n;break}}if(!t){L(`No MCPB file found in plugin`),Pe(!1);return}let n=`${O.plugin.name}@${O.marketplace}`,r=await Oe(t,O.plugin.path,n,void 0,void 0,!0);`status`in r&&r.status===`needs-config`?(Me(r),w(`configuring`)):L(`Failed to load MCPB for configuration`)}catch(e){L(`Failed to load configuration: ${de(e)}`)}finally{Pe(!1)}}}),O.plugin.manifest.userConfig&&Object.keys(O.plugin.manifest.userConfig).length>0&&i.push({label:`Configure options`,action:()=>{w({type:`configuring-options`,schema:O.plugin.manifest.userConfig})}}),i.push({label:`Update now`,action:()=>void R(`update`)}),i.push({label:`Uninstall`,action:()=>void R(`uninstall`)})),O.plugin.manifest.homepage&&i.push({label:`Open homepage`,action:()=>void Gt(O.plugin.manifest.homepage)}),O.plugin.manifest.repository&&i.push({label:`View repository`,action:()=>void Gt(O.plugin.manifest.repository)}),i.push({label:`Back to plugin list`,action:()=>{w(`plugin-list`),k(null),L(null)}}),i},[S,O,Fe,N]);if(v({"select:previous":()=>{we>0&&Te(we-1)},"select:next":()=>{we<ze.length-1&&Te(we+1)},"select:accept":()=>{ze[we]&&ze[we].action()}},{context:`Select`,isActive:S===`plugin-details`&&!!O}),v({"select:accept":()=>{typeof S==`object`&&S.type===`failed-plugin-details`&&(async()=>{ke(!0),L(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=ie(t);n?.enabledPlugins?.[e]!==void 0&&(re(t,{enabledPlugins:{...n.enabledPlugins,[e]:void 0}}),i=!0)}Pt()}i?(n&&await n(),ke(!1),w(`plugin-list`)):(ke(!1),L(r.message))})()}},{context:`Select`,isActive:typeof S==`object`&&S.type===`failed-plugin-details`&&S.plugin.scope!==`managed`}),v({"confirm:yes":()=>{if(!O)return;ke(!0),L(null);let r=`${O.plugin.name}@${O.marketplace}`,{error:i}=re(`localSettings`,{enabledPlugins:{...ie(`localSettings`)?.enabledPlugins,[r]:!1}});if(i){ke(!1),L(`Failed to write settings: ${i.message}`);return}Pt(),t(`✓ Disabled ${O.plugin.name} in .claude/settings.local.json. Run /reload-plugins to apply.`),n&&n(),e({type:`menu`})},"confirm:no":()=>{w(`plugin-details`),L(null)}},{context:`Confirmation`,isActive:S===`confirm-project-uninstall`&&!!O&&!Ee}),ne((r,i)=>{if(!O)return;let o=`${O.plugin.name}@${O.marketplace}`,s=O.scope;if(!s||s===`builtin`||!tn(s))return;let c=async r=>{ke(!0),L(null);try{let i=await Qt(o,s,r);if(!i.success)throw Error(i.message);Pt();let c=r?``:` · data preserved`;t(`${a.tick} ${i.message}${c}`),n&&n(),e({type:`menu`})}catch(e){ke(!1),L(e instanceof Error?e.message:String(e))}};r===`y`||r===`Y`?c(!0):r===`n`||r===`N`?c(!1):i.escape&&(w(`plugin-details`),L(null))},{isActive:typeof S==`object`&&S.type===`confirm-data-cleanup`&&!!O&&!Ee}),Br.useEffect(()=>{Se(0)},[T]),ne((e,t)=>{let n=!t.ctrl&&!t.meta;_||(e===`/`&&n?(b(!0),E(``),Se(0)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==` `&&(b(!0),E(e),Se(0)))},{isActive:S===`plugin-list`}),oe)return(0,Z.jsx)(p,{children:`Loading installed plugins…`});if(ye.length===0)return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsx)(C,{marginBottom:1,children:(0,Z.jsx)(p,{bold:!0,children:`Manage plugins`})}),(0,Z.jsx)(p,{children:`No plugins or MCP servers installed.`}),(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{dimColor:!0,children:`Esc to go back`})})]});if(typeof S==`object`&&S.type===`plugin-options`&&O){let r=`${O.plugin.name}@${O.marketplace}`;function i(r){t(r),n&&n(),e({type:`menu`})}return(0,Z.jsx)(er,{plugin:O.plugin,pluginId:r,onDone:(e,t)=>{switch(e){case`configured`:i(`✓ Enabled and configured ${O.plugin.name}. Run /reload-plugins to apply.`);break;case`skipped`:i(`✓ Enabled ${O.plugin.name}. Run /reload-plugins to apply.`);break;case`error`:i(`Failed to save configuration: ${t}`);break}}})}if(typeof S==`object`&&S.type===`configuring-options`&&O){let e=`${O.plugin.name}@${O.marketplace}`;return(0,Z.jsx)(Yn,{title:`Configure ${O.plugin.name}`,subtitle:`Plugin options`,configSchema:S.schema,initialValues:Tt(e),onSave:n=>{try{Ft(e,n,S.schema),Pt(),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){L(`Failed to save configuration: ${de(e)}`)}w(`plugin-details`)},onCancel:()=>w(`plugin-details`)})}if(S===`configuring`&&je&&O){let e=`${O.plugin.name}@${O.marketplace}`;async function n(n){if(!(!je||!O))try{let r=O.plugin.manifest.mcpServers,i=null;if(typeof r==`string`&&Nt(r))i=r;else if(Array.isArray(r)){for(let e of r)if(typeof e==`string`&&Nt(e)){i=e;break}}if(!i){L(`No MCPB file found`),w(`plugin-details`);return}await Oe(i,O.plugin.path,e,void 0,n),L(null),Me(null),w(`plugin-details`),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){L(`Failed to save configuration: ${de(e)}`),w(`plugin-details`)}}function r(){Me(null),w(`plugin-details`)}return(0,Z.jsx)(Yn,{title:`Configure ${je.manifest.name}`,subtitle:`Plugin: ${O.plugin.name}`,configSchema:je.configSchema,initialValues:je.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`&&O)return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsxs)(p,{bold:!0,color:`warning`,children:[O.plugin.name,` is enabled in .claude/settings.json (shared with your team)`]}),(0,Z.jsxs)(C,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(p,{children:`Disable it just for you in .claude/settings.local.json?`}),(0,Z.jsx)(p,{dimColor:!0,children:`This has the same effect as uninstalling, without affecting other contributors.`})]}),Ae&&(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{color:`error`,children:Ae})}),(0,Z.jsx)(C,{marginTop:1,children:Ee?(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`&&O)return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsxs)(p,{bold:!0,children:[O.plugin.name,` has `,S.size.human,` of persistent data`]}),(0,Z.jsxs)(C,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(p,{children:`Delete it along with the plugin?`}),(0,Z.jsx)(p,{dimColor:!0,children:ot(`${O.plugin.name}@${O.marketplace}`)})]}),Ae&&(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{color:`error`,children:Ae})}),(0,Z.jsx)(C,{marginTop:1,children:Ee?(0,Z.jsx)(p,{dimColor:!0,children:`Uninstalling…`}):(0,Z.jsxs)(p,{children:[(0,Z.jsx)(p,{bold:!0,children:`y`}),` to delete · `,(0,Z.jsx)(p,{bold:!0,children:`n`}),` to keep · `,(0,Z.jsx)(p,{bold:!0,children:`esc`}),` to cancel`]})})]});if(S===`plugin-details`&&O){let e=A(),t=`${O.plugin.name}@${O.marketplace}`,n=e?.enabledPlugins?.[t]!==!1,r=m.filter(e=>`plugin`in e&&e.plugin===O.plugin.name||e.source===t||e.source.startsWith(`${O.plugin.name}@`)),i=r.length===0?null:(0,Z.jsxs)(C,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsxs)(p,{bold:!0,color:`error`,children:[r.length,` `,ve(r.length,`error`),`:`]}),r.map((e,t)=>{let n=Ar(e);return(0,Z.jsxs)(C,{flexDirection:`column`,marginLeft:2,children:[(0,Z.jsx)(p,{color:`error`,children:kr(e)}),n&&(0,Z.jsxs)(p,{dimColor:!0,italic:!0,children:[a.arrowRight,` `,n]})]},t)})]});return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsx)(C,{children:(0,Z.jsxs)(p,{bold:!0,children:[O.plugin.name,` @ `,O.marketplace]})}),(0,Z.jsxs)(C,{children:[(0,Z.jsx)(p,{dimColor:!0,children:`Scope: `}),(0,Z.jsx)(p,{children:O.scope||`user`})]}),O.plugin.manifest.version&&(0,Z.jsxs)(C,{children:[(0,Z.jsx)(p,{dimColor:!0,children:`Version: `}),(0,Z.jsx)(p,{children:O.plugin.manifest.version})]}),O.plugin.manifest.description&&(0,Z.jsx)(C,{marginBottom:1,children:(0,Z.jsx)(p,{children:O.plugin.manifest.description})}),O.plugin.manifest.author&&(0,Z.jsxs)(C,{children:[(0,Z.jsx)(p,{dimColor:!0,children:`Author: `}),(0,Z.jsx)(p,{children:O.plugin.manifest.author.name})]}),(0,Z.jsxs)(C,{marginBottom:1,children:[(0,Z.jsx)(p,{dimColor:!0,children:`Status: `}),(0,Z.jsx)(p,{color:n?`success`:`warning`,children:n?`Enabled`:`Disabled`}),O.pendingUpdate&&(0,Z.jsx)(p,{color:`suggestion`,children:` · Marked for update`})]}),(0,Z.jsx)(Ir,{plugin:O.plugin,marketplace:O.marketplace}),i,(0,Z.jsx)(C,{marginTop:1,flexDirection:`column`,children:ze.map((e,t)=>{let n=t===we;return(0,Z.jsxs)(C,{children:[n&&(0,Z.jsxs)(p,{children:[a.pointer,` `]}),!n&&(0,Z.jsx)(p,{children:` `}),(0,Z.jsx)(p,{bold:n,color:e.label.includes(`Uninstall`)?`error`:e.label.includes(`Update`)?`suggestion`:void 0,children:e.label})]},t)})}),Ee&&(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{children:`Processing…`})}),Ae&&(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{color:`error`,children:Ae})}),(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`})]}),Ee&&(0,Z.jsx)(p,{children:`Processing…`}),Ae&&(0,Z.jsx)(p,{color:`error`,children:Ae}),(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=gt(u,e.name).length,r=()=>{w({type:`mcp-tools`,client:e})},i=()=>{w(`plugin-list`)},a=e=>{e&&t(e),w(`plugin-list`)},o=e.config.scope,s=e.config.type;return s===`stdio`?(0,Z.jsx)(Fn,{server:{name:e.name,client:e,scope:o,transport:`stdio`,config:e.config},serverToolsCount:n,onViewTools:r,onCancel:i,onComplete:a,borderless:!0}):s===`sse`?(0,Z.jsx)(Nn,{server:{name:e.name,client:e,scope:o,transport:`sse`,isAuthenticated:void 0,config:e.config},serverToolsCount:n,onViewTools:r,onCancel:i,onComplete:a,borderless:!0}):s===`http`?(0,Z.jsx)(Nn,{server:{name:e.name,client:e,scope:o,transport:`http`,isAuthenticated:void 0,config:e.config},serverToolsCount:n,onViewTools:r,onCancel:i,onComplete:a,borderless:!0}):s===`claudeai-proxy`?(0,Z.jsx)(Nn,{server:{name:e.name,client:e,scope:o,transport:`claudeai-proxy`,isAuthenticated:void 0,config:e.config},serverToolsCount:n,onViewTools:r,onCancel:i,onComplete:a,borderless:!0}):(w(`plugin-list`),null)}if(typeof S==`object`&&S.type===`mcp-tools`){let e=S.client,t=e.config.scope,n=e.config.type,r;return r=n===`stdio`?{name:e.name,client:e,scope:t,transport:`stdio`,config:e.config}:n===`sse`?{name:e.name,client:e,scope:t,transport:`sse`,isAuthenticated:void 0,config:e.config}:n===`http`?{name:e.name,client:e,scope:t,transport:`http`,isAuthenticated:void 0,config:e.config}:{name:e.name,client:e,scope:t,transport:`claudeai-proxy`,isAuthenticated:void 0,config:e.config},(0,Z.jsx)(Vn,{server:r,onSelectTool:t=>{w({type:`mcp-tool-detail`,client:e,tool:t})},onBack:()=>w({type:`mcp-detail`,client:e})})}if(typeof S==`object`&&S.type===`mcp-tool-detail`){let{client:e,tool:t}=S,n=e.config.scope,r=e.config.type,i;return i=r===`stdio`?{name:e.name,client:e,scope:n,transport:`stdio`,config:e.config}:r===`sse`?{name:e.name,client:e,scope:n,transport:`sse`,isAuthenticated:void 0,config:e.config}:r===`http`?{name:e.name,client:e,scope:n,transport:`http`,isAuthenticated:void 0,config:e.config}:{name:e.name,client:e,scope:n,transport:`claudeai-proxy`,isAuthenticated:void 0,config:e.config},(0,Z.jsx)(Rn,{tool:t,server:i,onBack:()=>w({type:`mcp-tools`,client:e})})}let Be=Ce.getVisibleItems(xe);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})}),xe.length===0&&T&&(0,Z.jsx)(C,{marginBottom:1,children:(0,Z.jsxs)(p,{dimColor:!0,children:[`No items match "`,T,`"`]})}),Ce.scrollPosition.canScrollUp&&(0,Z.jsx)(C,{children:(0,Z.jsxs)(p,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),Be.map((e,t)=>{let n=Ce.toActualIndex(t)===I&&!_,r=t>0?Be[t-1]:null,i=!r||r.scope!==e.scope;return(0,Z.jsxs)(Br.Fragment,{children:[i&&(0,Z.jsx)(C,{marginTop:+(t>0),paddingLeft:2,children:(0,Z.jsx)(p,{dimColor:e.scope!==`flagged`,color:e.scope===`flagged`?`warning`:void 0,bold:e.scope===`flagged`,children:(e=>{switch(e){case`flagged`:return`Flagged`;case`project`:return`Project`;case`local`:return`Local`;case`user`:return`User`;case`enterprise`:return`Enterprise`;case`managed`:return`Managed`;case`builtin`:return`Built-in`;case`dynamic`:return`Built-in`;default:return e}})(e.scope)})}),(0,Z.jsx)(Mr,{item:e,isSelected:n})]},e.id)}),Ce.scrollPosition.canScrollDown&&(0,Z.jsx)(C,{children:(0,Z.jsxs)(p,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),(0,Z.jsx)(C,{marginTop:1,marginLeft:1,children:(0,Z.jsx)(p,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(g,{children:[(0,Z.jsx)(p,{children:`type to search`}),(0,Z.jsx)(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`})]})})}),F.size>0&&(0,Z.jsx)(C,{marginLeft:1,children:(0,Z.jsx)(p,{dimColor:!0,italic:!0,children:`Run /reload-plugins to apply changes`})})]})}var Br,X,Z,Vr=e((()=>{i(),Br=t(l(),1),X=t(l(),1),wt(),x(),Pn(),Ln(),Bn(),Wn(),bn(),Sn(),Wt(),Ut(),Vt(),vn(),Ze(),rn(),Rt(),ge(),Kt(),le(),F(),pe(),Be(),Re(),Ee(),et(),rt(),gn(),zt(),Et(),Ye(),mt(),Yt(),T(),ce(),_e(),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} ${ve(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} ${ve(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,me(t),e(`${a.cross} Unexpected error during validation: ${de(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(),F(),pe(),fn(),_e(),Kr=w()}));function Jr({onComplete:e}){return(0,Q.useEffect)(()=>{async function t(){try{let t=await at(),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: ${de(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`}])ie(n)?.extraKnownMarketplaces?.[e]&&t.push({source:n,scope:r});return{editableSources:t,isInPolicy:!!ie(`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=ie(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=De(e=>e.plugins.errors),i=De(e=>e.plugins.installationStatus),o=Ne(),[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 Lt(await at());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),Pt(),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 Qe(i.name),Pt(),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=Ne(),ne=De(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=qt(),re=r.type===`marketplace`&&r.action===`add`&&r.target!==void 0,E=(0,Q.useCallback)(()=>{S(e=>e.plugins.needsRefresh?e:{...e,plugins:{...e.plugins,needsRefresh:!0}})},[S]),D=(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:E,cliMode:re}):(0,$.jsx)(y,{color:`suggestion`,children:(0,$.jsxs)(b,{title:`Plugins`,selectedTab:s,onTabChange:D,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:E,targetMarketplace:a.targetMarketplace,targetPlugin:a.targetPlugin}):(0,$.jsx)(br,{error:m,setError:h,result:g,setResult:v,setViewState:o,onInstallComplete:E,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:E,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:E,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:E})})]})})}var Q,$,si,ci=e((()=>{i(),l(),Q=t(l(),1),wt(),x(),Jt(),Ut(),Rt(),F(),Be(),Xe(),Ee(),Yt(),T(),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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t,b as n,t as r}from"./src-DNHWYkls.js";import{t as i}from"./jsx-runtime-BTgGEFjL.js";function a(){return(0,o.jsxs)(n,{color:`permission`,children:[`Press `,(0,o.jsx)(n,{bold:!0,children:`Enter`}),` to continue…`]})}var o,s=e((()=>{t(),r(),o=i()}));export{s as n,a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Cn as n,F as r,Rn as i,b as a,t as o,x as s}from"./src-DNHWYkls.js";import{t as c}from"./jsx-runtime-BTgGEFjL.js";import{S as l,w as u,y as d}from"./startupProfiler-4P7GdVw6.js";import{t as f}from"./useTerminalSize-DzV4aaTi.js";function p(e){return e.startsWith(`file-`)?`+`:e.startsWith(`mcp-resource-`)?`◇`:e.startsWith(`agent-`)?`*`:`+`}function m(e){return e.startsWith(`file-`)||e.startsWith(`mcp-resource-`)||e.startsWith(`agent-`)}function h({suggestions:e,selectedSuggestion:t,maxColumnWidth:i,overlay:a}){let{rows:o}=r(),c=a?5:Math.min(6,Math.max(1,o-3));if(e.length===0)return null;let l=i??Math.max(...e.map(e=>n(e.displayText)))+5,u=Math.max(0,Math.min(t-Math.floor(c/2),e.length-c)),d=Math.min(u+c,e.length),f=e.slice(u,d);return(0,_.jsx)(s,{flexDirection:`column`,justifyContent:a?void 0:`flex-end`,children:f.map(n=>(0,_.jsx)(v,{item:n,maxColumnWidth:l,isSelected:n.id===e[t]?.id},n.id))})}var g,_,v,y,b=e((()=>{g=t(i(),1),f(),o(),d(),_=c(),v=(0,g.memo)(function({item:e,maxColumnWidth:t,isSelected:i}){let o=r().columns;if(m(e.id)){let t=p(e.id),r=i?`suggestion`:void 0,s=!i,c=e.id.startsWith(`file-`),d=e.id.startsWith(`mcp-resource-`),f=e.description?3:0,m;if(c){let t=e.description?Math.min(20,n(e.description)):0,r=o-2-4-f-t;m=l(e.displayText,r)}else m=d?u(e.displayText,30):e.displayText;let h=o-2-n(m)-f-4,g;if(e.description){let n=Math.max(0,h),r=u(e.description.replace(/\s+/g,` `),n);g=`${t} ${m} – ${r}`}else g=`${t} ${m}`;return(0,_.jsx)(a,{color:r,dimColor:s,wrap:`truncate`,children:g})}let s=Math.floor(o*.4),c=Math.min(t??n(e.displayText)+5,s),d=e.color||(i?`suggestion`:void 0),f=!i,h=e.displayText;n(h)>c-2&&(h=u(h,c-2));let g=h+` `.repeat(Math.max(0,c-n(h))),v=e.tag?`[${e.tag}] `:``,y=n(v),b=Math.max(0,o-c-y-4),x=e.description?u(e.description.replace(/\s+/g,` `),b):``;return(0,_.jsxs)(a,{wrap:`truncate`,children:[(0,_.jsx)(a,{color:d,dimColor:f,children:g}),v?(0,_.jsx)(a,{color:e.tag===`local`?`ansi:yellow`:void 0,dimColor:e.tag!==`local`,children:v}):null,(0,_.jsx)(a,{color:i?`suggestion`:void 0,dimColor:!i,children:x})]})}),y=(0,g.memo)(h)}));export{y as n,b as r,h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t,b as n,t as r,x as i}from"./src-DNHWYkls.js";import{t as a}from"./jsx-runtime-BTgGEFjL.js";import{_s as o,ea as s,ls as c,m as l,ra as u,ta as d}from"./growthbook-p4aJ_UMv.js";import{a as f,n as p}from"./env-CesrOJJq.js";import{cF as m,eF as h,lF as g,tF as _}from"./loadAgentsDir-Bz0FfcVt.js";import{D as v,T as y}from"./sessionTracing-DR8O0686.js";import{a as b,i as x,r as S}from"./terminalSetup--jwGVap8.js";function C(){return c().editorMode===`vim`}function w(){return p.terminal===`Apple_Terminal`&&process.platform===`darwin`||b()?`shift + ⏎ for newline`:S()?`\\⏎ for newline`:`backslash (\\) + return (⏎) for newline`}function T(e,t){return t.ctrl||t.meta||t.escape||t.return||t.tab||t.backspace||t.delete||t.upArrow||t.downArrow||t.leftArrow||t.rightArrow||t.pageUp||t.pageDown||t.home||t.end?!1:e.length>0&&!/^\s/.test(e)&&!e.startsWith(`\x1B`)}var E=e((()=>{x(),o(),f()}));function D(e){return e.replace(/\+/g,` + `)}function O(e){let{dimColor:t,fixedWidth:r,gap:a,paddingX:o}=e,s=D(_(`app:toggleTranscript`,`Global`,`ctrl+o`)),c=D(_(`app:toggleTodos`,`Global`,`ctrl+t`)),l=D(_(`chat:undo`,`Chat`,`ctrl+_`)),f=D(_(`chat:stash`,`Chat`,`ctrl+s`)),p=D(_(`chat:cycleMode`,`Chat`,`shift+tab`)),m=D(_(`chat:modelPicker`,`Chat`,`alt+p`)),h=D(_(`chat:fastMode`,`Chat`,`alt+o`)),v=D(_(`chat:externalEditor`,`Chat`,`ctrl+g`));D(_(`app:toggleTerminal`,`Global`,`meta+j`));let b=D(_(`chat:imagePaste`,`Chat`,`ctrl+v`));return(0,k.jsxs)(i,{paddingX:o,flexDirection:`row`,gap:a,children:[(0,k.jsxs)(i,{flexDirection:`column`,width:r?24:void 0,children:[(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:`! for bash mode`})}),(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:`/ for commands`})}),(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:`@ for file paths`})}),(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:`& for background`})}),(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:`/btw for side question`})})]}),(0,k.jsxs)(i,{flexDirection:`column`,width:r?35:void 0,children:[(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:`double tap esc to clear input`})}),(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[p,` `,process.env.USER_TYPE===`ant`?`to cycle modes`:`to auto-accept edits`]})}),(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[s,` for verbose output`]})}),(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[c,` to toggle tasks`]})}),null,(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:w()})})]}),(0,k.jsxs)(i,{flexDirection:`column`,children:[(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[l,` to undo`]})}),y()!==`windows`&&(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:`ctrl + z to suspend`})}),(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[b,` to paste images`]})}),(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[m,` to switch model`]})}),u()&&d()&&(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[h,` to toggle fast mode`]})}),(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[f,` to stash prompt`]})}),(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[v,` to edit in $EDITOR`]})}),g()&&(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:`/keybindings to customize`})})]})]})}var k,A=e((()=>{t(),r(),v(),m(),h(),l(),s(),E(),k=a()}));export{C as a,T as i,A as n,E as r,O as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./REPL-Clve-8zC.js";export{e as REPL};
|