claude-code-best 2.7.0 → 2.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (887) hide show
  1. package/dist/chunks/AddWorkspaceDirectory-V2tF7iCY.js +1 -0
  2. package/dist/chunks/App-DLdRpU7c.js +1 -0
  3. package/dist/chunks/ApproveApiKey-B7_TCGwt.js +1 -0
  4. package/dist/chunks/ApproveApiKey-DPws3jax.js +1 -0
  5. package/dist/chunks/AssistantSessionChooser-D6rS0OVe.js +1 -0
  6. package/dist/chunks/BackgroundTasksDialog-hGlbm5z5.js +2 -0
  7. package/dist/chunks/BypassPermissionsModeDialog-CuEpdRVd.js +1 -0
  8. package/dist/chunks/ClaudeInChromeOnboarding-CTTKMRbt.js +1 -0
  9. package/dist/chunks/ClaudeMdExternalIncludesDialog-B-GkVoA_.js +1 -0
  10. package/dist/chunks/ClaudeMdExternalIncludesDialog-DxJK9NiM.js +1 -0
  11. package/dist/chunks/ConsoleOAuthFlow-LPZ97jsm.js +1 -0
  12. package/dist/chunks/DesktopHandoff-BjPylhOT.js +1 -0
  13. package/dist/chunks/DevChannelsDialog-c4YVqBX9.js +1 -0
  14. package/dist/chunks/DiffDialog-I5wuXw2C.js +3 -0
  15. package/dist/chunks/Doctor-Cr_MlSPc.js +3 -0
  16. package/dist/chunks/Doctor-hgf3dMAW.js +1 -0
  17. package/dist/chunks/ExitFlow-Bz5grDWv.js +2 -0
  18. package/dist/chunks/Feedback-COgMI5tY.js +2 -0
  19. package/dist/chunks/Grove-Bwmghb-e.js +1 -0
  20. package/dist/chunks/Grove-m57x4tY1.js +11 -0
  21. package/dist/chunks/HybridTransport-Bok4-Ptt.js +4 -0
  22. package/dist/chunks/ITermBackend-BBSP-NNa.js +1 -0
  23. package/dist/chunks/InvalidConfigDialog-uTSuSBvO.js +1 -0
  24. package/dist/chunks/InvalidSettingsDialog-B-Os12-H.js +1 -0
  25. package/dist/chunks/MCPConnectionManager-y97Inszc.js +1 -0
  26. package/dist/chunks/McpParsingWarnings-DMFUZw92.js +1 -0
  27. package/dist/chunks/MessageSelector-DwdAC2io.js +3 -0
  28. package/dist/chunks/Messages-FEBcX-cT.js +11 -0
  29. package/dist/chunks/Onboarding-B8qMJaBh.js +1 -0
  30. package/dist/chunks/OverageCreditUpsell-DnFv5z-z.js +1 -0
  31. package/dist/chunks/PluginSettings-B_xVgTTp.js +17 -0
  32. package/dist/chunks/PromptInputFooterSuggestions-DhIQ0Nge.js +1 -0
  33. package/dist/chunks/PromptInputHelpMenu-CoMkWchC.js +1 -0
  34. package/dist/chunks/QueryEngine-C7r7O-hH.js +1 -0
  35. package/dist/chunks/REPL-CmJdJrGO.js +147 -0
  36. package/dist/chunks/REPL-nP7H_-qa.js +1 -0
  37. package/dist/chunks/RemoteCallout-4JOZROfT.js +1 -0
  38. package/dist/chunks/RemoteSessionManager-jcPnywfY.js +2 -0
  39. package/dist/chunks/ResumeConversation-CZ2Uedkf.js +1 -0
  40. package/dist/chunks/SSETransport-kEH_p4Yq.js +4 -0
  41. package/dist/chunks/SearchExtraToolsTool-C64oVFUD.js +1 -0
  42. package/dist/chunks/SentryErrorBoundary-2E2qGV11.js +1 -0
  43. package/dist/chunks/SentryErrorBoundary-97iY7Nb7.js +2 -0
  44. package/dist/chunks/Settings-CuljH0mu.js +2 -0
  45. package/dist/chunks/TeleportProgress-Ctdqi7iS.js +1 -0
  46. package/dist/chunks/TeleportRepoMismatchDialog-DyTBg1YD.js +1 -0
  47. package/dist/chunks/TeleportResumeWrapper-B66clYsG.js +1 -0
  48. package/dist/chunks/ThemePicker-WKmYvrqz.js +1 -0
  49. package/dist/chunks/TmuxBackend-OKX2NP14.js +9 -0
  50. package/dist/chunks/TrustDialog-0anSIf-G.js +1 -0
  51. package/dist/chunks/TungstenTool-B40YHYXC.js +1 -0
  52. package/dist/chunks/ValidationErrorsList-CfgC1KJb.js +2 -0
  53. package/dist/chunks/WelcomeV2-BMHXiNt3.js +1 -0
  54. package/dist/chunks/WindowsTerminalBackend-fCSGVe4W.js +2 -0
  55. package/dist/chunks/add-dir-CMtuW667.js +1 -0
  56. package/dist/chunks/agentDisplay-CgYKW3G7.js +1 -0
  57. package/dist/chunks/agents-CdqcGm9o.js +103 -0
  58. package/dist/chunks/agents-D90TsYOf.js +2 -0
  59. package/dist/chunks/ant-DZjimiuz.js +1 -0
  60. package/dist/chunks/api-CQWbpxLP.js +1 -0
  61. package/dist/chunks/api-quOYYOhi.js +1 -0
  62. package/dist/chunks/asciicast-C_1Pi99k.js +4 -0
  63. package/dist/chunks/asciicast-DA6TudSH.js +1 -0
  64. package/dist/chunks/assistant-B5_xx00q.js +1 -0
  65. package/dist/chunks/assistant-CEmC_DlU.js +1 -0
  66. package/dist/chunks/assistant-CyVcFPIR.js +1 -0
  67. package/dist/chunks/auth-CjtaiRtF.js +1 -0
  68. package/dist/chunks/auth-DsQEVs9W.js +1 -0
  69. package/dist/chunks/autoMode-DEbM9UaE.js +45 -0
  70. package/dist/chunks/autonomy-Clap6Swl.js +1 -0
  71. package/dist/chunks/autonomy-lNpGnyiu.js +19 -0
  72. package/dist/chunks/autonomyPanel-BqEvfI0e.js +1 -0
  73. package/dist/chunks/backgroundHousekeeping-D-jt-ocx.js +1 -0
  74. package/dist/chunks/backgroundHousekeeping-KvOpP_4M.js +17 -0
  75. package/dist/chunks/banner-D9Cq292T.js +2 -0
  76. package/dist/chunks/bg-CngkAkgc.js +1 -0
  77. package/dist/chunks/bg-DgpgS_VU.js +9 -0
  78. package/dist/chunks/branch-CSYB04xC.js +3 -0
  79. package/dist/chunks/break-cache-DrIa8RdW.js +8 -0
  80. package/dist/chunks/bridge-DDgASypO.js +2 -0
  81. package/dist/chunks/bridgeConfig-BdZVEqhx.js +1 -0
  82. package/dist/chunks/bridgeConfig-DjC4oig1.js +1 -0
  83. package/dist/chunks/bridgeEnabled-Csn6Ym3k.js +1 -0
  84. package/dist/chunks/bridgeEnabled-DLRIH243.js +1 -0
  85. package/dist/chunks/bridgeMain-B5wsmwkN.js +68 -0
  86. package/dist/chunks/bridgeMain-BN0Sag35.js +1 -0
  87. package/dist/chunks/bridgeMessaging-ChOzzVWj.js +1 -0
  88. package/dist/chunks/bridgePointer-Clcvh52n.js +1 -0
  89. package/dist/chunks/browser-Bt-ckCaU.js +1 -0
  90. package/dist/chunks/btw-BgjcOoeo.js +1 -0
  91. package/dist/chunks/buddy-C1wE3noR.js +3 -0
  92. package/dist/chunks/bypassPermissionsKillswitch-C0diGLRB.js +1 -0
  93. package/dist/chunks/caches-CIoVGP24.js +3 -0
  94. package/dist/chunks/caches-DMYdTEAr.js +1 -0
  95. package/dist/chunks/ccrClient-C1msT1E3.js +1 -0
  96. package/dist/chunks/changeDetector-DoOBZOt1.js +1 -0
  97. package/dist/chunks/channelNotification-CWlu9ZWs.js +1 -0
  98. package/dist/chunks/channelNotification-oZ6vG5R5.js +1 -0
  99. package/dist/chunks/chrome-Bo9uNZ7s.js +1 -0
  100. package/dist/chunks/chromeNativeHost-BldB1Zzi.js +1 -0
  101. package/dist/chunks/claudeDesktop-BqTW_pbB.js +1 -0
  102. package/dist/chunks/cleanup-rCLlo4w8.js +1 -0
  103. package/dist/chunks/clear-BxdX_MUP.js +1 -0
  104. package/dist/chunks/cliLaunch-Citfs01Q.js +1 -0
  105. package/dist/chunks/client-BSoJ_vaA.js +1 -0
  106. package/dist/chunks/color-CkzktPHt.js +1 -0
  107. package/dist/chunks/commands-hyVX9-Lh.js +1 -0
  108. package/dist/chunks/commitAttribution-BwT0TbYF.js +1 -0
  109. package/dist/chunks/commitAttribution-csu3NO7Y.js +2 -0
  110. package/dist/chunks/common-Bi4yZBkh.js +1 -0
  111. package/dist/chunks/common-Da57Qwms.js +1 -0
  112. package/dist/chunks/common-NEOWMwtB.js +1 -0
  113. package/dist/chunks/compact-DNGIVZRN.js +3 -0
  114. package/dist/chunks/companion-Diuav3lA.js +1 -0
  115. package/dist/chunks/completionCache-BQgiR45Q.js +1 -0
  116. package/dist/chunks/completionCache-C7hDqIDL.js +4 -0
  117. package/dist/chunks/config-B25IrkTA.js +1 -0
  118. package/dist/chunks/config-ODoYZY8i.js +1 -0
  119. package/dist/chunks/context-CZ5enuPE.js +1 -0
  120. package/dist/chunks/context-noninteractive-62P5EnN5.js +54 -0
  121. package/dist/chunks/context-noninteractive-CjuzL9q5.js +1 -0
  122. package/dist/chunks/conversation-DyhWeHw2.js +1 -0
  123. package/dist/chunks/conversation-uY-V0SNK.js +1 -0
  124. package/dist/chunks/copy-9JLr2-Xs.js +7 -0
  125. package/dist/chunks/createSSHSession-B1hTuDpB.js +6 -0
  126. package/dist/chunks/createSession-Qurw-N4x.js +1 -0
  127. package/dist/chunks/createSession-fzjzy0aS.js +1 -0
  128. package/dist/chunks/cron-DwR6OJuW.js +1 -0
  129. package/dist/chunks/cronJitterConfig-9OmmYmIT.js +6 -0
  130. package/dist/chunks/crossProjectResume-B6efoIur.js +40 -0
  131. package/dist/chunks/daemon-BRKR4D1D.js +2 -0
  132. package/dist/chunks/datadog-C-llbwzP.js +1 -0
  133. package/dist/chunks/datadog-SSxsxcC-.js +1 -0
  134. package/dist/chunks/desktop-CQnMcbex.js +1 -0
  135. package/dist/chunks/detached-C_2ZXr7X.js +5 -0
  136. package/dist/chunks/detectRepository-2ICvGD0U.js +1 -0
  137. package/dist/chunks/detectRepository-BLwSmun2.js +1 -0
  138. package/dist/chunks/detection-0mMj--Bt.js +1 -0
  139. package/dist/chunks/detection-95TCHkW8.js +1 -0
  140. package/dist/chunks/diff-uAwKYa51.js +1 -0
  141. package/dist/chunks/directoryCompletion-DqtWZsoW.js +1 -0
  142. package/dist/chunks/doctor-CBF0fkBF.js +1 -0
  143. package/dist/chunks/earlyInput-CFYRGxau.js +2 -0
  144. package/dist/chunks/earlyInput-D3OhUZ4G.js +1 -0
  145. package/dist/chunks/effort-F-bhAM2u.js +9 -0
  146. package/dist/chunks/entry-DHN_Gr1b.js +14 -0
  147. package/dist/chunks/env-C2A9gV_G.js +1 -0
  148. package/dist/chunks/envLessBridgeConfig-CDVtIEWT.js +1 -0
  149. package/dist/chunks/envLessBridgeConfig-Dg0hNsdi.js +1 -0
  150. package/dist/chunks/execFileNoThrow-azCkYhmF.js +1 -0
  151. package/dist/chunks/executor-BVh1PTF-.js +1561 -0
  152. package/dist/chunks/executor-CvTuHx-k.js +1 -0
  153. package/dist/chunks/exit-CqcvZJwI.js +1 -0
  154. package/dist/chunks/export-c6WoGlsG.js +2 -0
  155. package/dist/chunks/exportRenderer-CaegIP5N.js +1 -0
  156. package/dist/chunks/extra-usage-Cj8fokgc.js +1 -0
  157. package/dist/chunks/extra-usage-Dk-wcvAu.js +1 -0
  158. package/dist/chunks/extra-usage-core-sHzc4eE1.js +1 -0
  159. package/dist/chunks/extra-usage-noninteractive-D0kqrqsg.js +1 -0
  160. package/dist/chunks/extraUsage-CbkqfG1U.js +1 -0
  161. package/dist/chunks/extractMemories-BP8Opsbp.js +1 -0
  162. package/dist/chunks/fast-DS3iQ1CH.js +1 -0
  163. package/dist/chunks/fast-DklfqySb.js +1 -0
  164. package/dist/chunks/featureCheck-CUJ2rPM6.js +1 -0
  165. package/dist/chunks/feedback-QJynmG5q.js +1 -0
  166. package/dist/chunks/fileStateCache-BhVfo23e.js +1 -0
  167. package/dist/chunks/files-Bdr_PQyV.js +2 -0
  168. package/dist/chunks/findExecutable-BHQl4NaS.js +1 -0
  169. package/dist/chunks/firstPartyEventLogger-DlW8BUXq.js +1 -0
  170. package/dist/chunks/flushGate-CK5B9-Zn.js +1 -0
  171. package/dist/chunks/gates-6amRNsYl.js +1 -0
  172. package/dist/chunks/gates-vlrMjO-X.js +1 -0
  173. package/dist/chunks/gemini-B5ZRjDrh.js +1 -0
  174. package/dist/chunks/generateRecap-SgRMdsyN.js +1 -0
  175. package/dist/chunks/generateSessionName-sZFzpwsq.js +1 -0
  176. package/dist/chunks/genericProcessUtils-tJxf3yqB.js +23 -0
  177. package/dist/chunks/git-C0IuvuIy.js +6 -0
  178. package/dist/chunks/git-hSvFiuiG.js +1 -0
  179. package/dist/chunks/githubRepoPathMapping-DUGvTwPB.js +1 -0
  180. package/dist/chunks/goal-Dy-GGn9r.js +3 -0
  181. package/dist/chunks/grok-BG4_buNt.js +1 -0
  182. package/dist/chunks/growthbook-Br1dDRtd.js +1 -0
  183. package/dist/chunks/heapdump-B9PVKMxa.js +5 -0
  184. package/dist/chunks/help-BfWF7xij.js +1 -0
  185. package/dist/chunks/hooks-BVrhxysz.js +1 -0
  186. package/dist/chunks/hooks-KK32pxq3.js +79 -0
  187. package/dist/chunks/hostAdapter-TBJav3vX.js +1 -0
  188. package/dist/chunks/hostGuard-DSOEyH-P.js +1 -0
  189. package/dist/chunks/ide-BU1A79BE.js +2 -0
  190. package/dist/chunks/inboundAttachments-D4tBPCB8.js +1 -0
  191. package/dist/chunks/inboundAttachments-DWJplT9p.js +1 -0
  192. package/dist/chunks/initReplBridge-99sUBVEk.js +1 -0
  193. package/dist/chunks/insights-lDHodCMG.js +822 -0
  194. package/dist/chunks/install-Bg4ZgW81.js +1 -0
  195. package/dist/chunks/install-github-app-RLbUq5EL.js +147 -0
  196. package/dist/chunks/install-slack-app-CHmIwsbm.js +1 -0
  197. package/dist/chunks/instrumentation-BCiV3SKX.js +12 -0
  198. package/dist/chunks/job-xOGf0j5Q.js +2 -0
  199. package/dist/chunks/jwtUtils-BQXXBwqW.js +1 -0
  200. package/dist/chunks/keybindings-DMbReZ4p.js +2 -0
  201. package/dist/chunks/lang-A6LUGP_7.js +1 -0
  202. package/dist/chunks/language-Bzp5KDCE.js +1 -0
  203. package/dist/chunks/language-CGfURU2y.js +1 -0
  204. package/dist/chunks/launchAgentsPlatform-Dbpm7Jyo.js +1 -0
  205. package/dist/chunks/launchAutofixPr-RZfqx5eM.js +18 -0
  206. package/dist/chunks/launchLocalMemory-DIntbsvg.js +3 -0
  207. package/dist/chunks/launchLocalVault-CCUw0ayu.js +3 -0
  208. package/dist/chunks/launchMemoryStores-QJTh8KSP.js +1 -0
  209. package/dist/chunks/launchOnboarding--Pe30AYd.js +8 -0
  210. package/dist/chunks/launchSchedule-DjN1RbRX.js +1 -0
  211. package/dist/chunks/launchSkillStore-CcKmVDz1.js +1 -0
  212. package/dist/chunks/launchTeleport-BKlEo0yF.js +3 -0
  213. package/dist/chunks/launchVault-C7UHA-IG.js +1 -0
  214. package/dist/chunks/loadAgentsDir-ClTeo0nk.js +4697 -0
  215. package/dist/chunks/loadAgentsDir-CshktEpX.js +1 -0
  216. package/dist/chunks/loadPluginHooks-DVZmzYLl.js +1 -0
  217. package/dist/chunks/localSearch-BtLNJRij.js +1 -0
  218. package/dist/chunks/localSearch-Koc8naSr.js +1 -0
  219. package/dist/chunks/log-DSV4Ht5l.js +1 -0
  220. package/dist/chunks/login-BngE89_j.js +1 -0
  221. package/dist/chunks/login-C3MZQTDL.js +1 -0
  222. package/dist/chunks/logoV2Utils-DAIIwt5R.js +1 -0
  223. package/dist/chunks/logout-CXZBaUen.js +1 -0
  224. package/dist/chunks/magicDocs-C_inI3JJ.js +57 -0
  225. package/dist/chunks/main-CfkIGrBF.js +31 -0
  226. package/dist/chunks/main-qqcmncHA.js +1312 -0
  227. package/dist/chunks/mappers-7BSMbYvH.js +1 -0
  228. package/dist/chunks/mcp-DRBiobrN.js +2 -0
  229. package/dist/chunks/mcp-DV8Prhgi.js +1 -0
  230. package/dist/chunks/mcp-HQ8-nEZ1.js +6 -0
  231. package/dist/chunks/mcpServer-CLIYAgGs.js +1 -0
  232. package/dist/chunks/mcpServer-DS0yRfcu.js +1 -0
  233. package/dist/chunks/memoize-DJ1XCN-z.js +1 -0
  234. package/dist/chunks/memory-Cz_JaFLF.js +1 -0
  235. package/dist/chunks/mobile-BMglW1NB.js +2 -0
  236. package/dist/chunks/mode-Kx0kSZkr.js +2 -0
  237. package/dist/chunks/model-Bwvn_acH.js +1 -0
  238. package/dist/chunks/model-CNXtfiLg.js +1 -0
  239. package/dist/chunks/onChangeAppState-C4ic-Mib.js +1 -0
  240. package/dist/chunks/openai-CGGSfpPh.js +10 -0
  241. package/dist/chunks/overageCreditGrant-BqW_6R5v.js +1 -0
  242. package/dist/chunks/panel-BYfvo_mR.js +1 -0
  243. package/dist/chunks/panel-D3wvAEFE.js +1 -0
  244. package/dist/chunks/panelCall-DgPjuhQf.js +1 -0
  245. package/dist/chunks/parser-DGXE1uWd.js +1 -0
  246. package/dist/chunks/passes-sYE91Vtr.js +1 -0
  247. package/dist/chunks/path-BE28AJwZ.js +1 -0
  248. package/dist/chunks/paths-DO4WOQtD.js +36 -0
  249. package/dist/chunks/permissions-BE-1pIly.js +1 -0
  250. package/dist/chunks/permissions-BPerbf1I.js +3 -0
  251. package/dist/chunks/pipeTransport-CW9zF_UN.js +1 -0
  252. package/dist/chunks/plan-CDKBVRw6.js +1 -0
  253. package/dist/chunks/platform-mh9ypxS8.js +2 -0
  254. package/dist/chunks/plugin-C6US4b8W.js +1 -0
  255. package/dist/chunks/pluginAutoupdate-BQKtcAhC.js +1 -0
  256. package/dist/chunks/pluginBlocklist-B8DKXi0i.js +1 -0
  257. package/dist/chunks/pluginCliCommands-DWCeXYTl.js +1 -0
  258. package/dist/chunks/pluginFlagging-DFMlWw2P.js +1 -0
  259. package/dist/chunks/pluginOperations-CKmwDC3G.js +2 -0
  260. package/dist/chunks/pluginStartupCheck-D6IbyWKe.js +1 -0
  261. package/dist/chunks/pluginStartupCheck-cYnLsWOs.js +1 -0
  262. package/dist/chunks/plugins-BwZIRMh_.js +4 -0
  263. package/dist/chunks/policyLimits-CFLBtFh3.js +1 -0
  264. package/dist/chunks/pollConfig-C3NjXYFc.js +1 -0
  265. package/dist/chunks/poller-BA1jhG3F.js +1 -0
  266. package/dist/chunks/poor-BHhbua95.js +1 -0
  267. package/dist/chunks/poorMode-CCK7Ek5w.js +1 -0
  268. package/dist/chunks/poorMode-mtlnXU-z.js +1 -0
  269. package/dist/chunks/print-kxnXkqGc.js +39 -0
  270. package/dist/chunks/privacy-settings-DjY1annR.js +1 -0
  271. package/dist/chunks/processBashCommand-BrqLqSva.js +1 -0
  272. package/dist/chunks/processSlashCommand-DJGdVGbK.js +6 -0
  273. package/dist/chunks/projectContext-Cd7V9pES.js +1 -0
  274. package/dist/chunks/prompt-BZjXpviP.js +1 -0
  275. package/dist/chunks/prompt-CfM_xGPc.js +227 -0
  276. package/dist/chunks/prompt-CusKF4-p.js +1 -0
  277. package/dist/chunks/promptEditor-FI_ewCpV.js +4 -0
  278. package/dist/chunks/protocolHandler-B7ybKpgJ.js +13 -0
  279. package/dist/chunks/rate-limit-options-DPJMNNou.js +1 -0
  280. package/dist/chunks/rcDebugLog-CwU_wJBE.js +11 -0
  281. package/dist/chunks/referral-Da4mpbd3.js +1 -0
  282. package/dist/chunks/refresh-B6X4xb9r.js +1 -0
  283. package/dist/chunks/registerProtocol-D8fFnceq.js +36 -0
  284. package/dist/chunks/registry-y_z3pTg3.js +1 -0
  285. package/dist/chunks/release-notes--tnd4K56.js +4 -0
  286. package/dist/chunks/releaseNotes-BPA229-J.js +2 -0
  287. package/dist/chunks/reload-plugins-yQ7tEUVh.js +1 -0
  288. package/dist/chunks/remote-env-CER5UxTX.js +1 -0
  289. package/dist/chunks/remoteBridgeCore-Bi31i8gt.js +1 -0
  290. package/dist/chunks/remoteControlServer-oUAcWB4i.js +3 -0
  291. package/dist/chunks/rename-BTngRRZU.js +1 -0
  292. package/dist/chunks/renderOptions-Caca3bCd.js +1 -0
  293. package/dist/chunks/resume-DZHKfBmm.js +2 -0
  294. package/dist/chunks/ripgrep-Bzwdi5-K.js +5 -0
  295. package/dist/chunks/ripgrep-DEa1djpJ.js +1 -0
  296. package/dist/chunks/runtimeObserver-B4KekIF0.js +1 -0
  297. package/dist/chunks/runtimeObserver-BUOcYxiK.js +10 -0
  298. package/dist/chunks/sandbox-adapter-C--j-c76.js +1 -0
  299. package/dist/chunks/sandbox-toggle-DLBL7myN.js +1 -0
  300. package/dist/chunks/searchExtraTools-CBYp5XeI.js +1 -0
  301. package/dist/chunks/sentry-B7ZBc8fA.js +13 -0
  302. package/dist/chunks/session-DWYQk9YN.js +2 -0
  303. package/dist/chunks/sessionDiscovery-BP0nv36F.js +1 -0
  304. package/dist/chunks/sessionFileAccessHooks-DVilA3Mm.js +1 -0
  305. package/dist/chunks/sessionMemory-cMgcTxtP.js +1 -0
  306. package/dist/chunks/sessionMemory-pT4lc1C-.js +1 -0
  307. package/dist/chunks/sessionMemoryUtils-BgYf2OvX.js +1 -0
  308. package/dist/chunks/sessionObserver-CzyEF7mg.js +1 -0
  309. package/dist/chunks/sessionObserver-D4SV0Ar3.js +20 -0
  310. package/dist/chunks/sessionStorage-CXBgVAx-.js +1 -0
  311. package/dist/chunks/sessionStoragePortable-CJUZrbIq.js +3 -0
  312. package/dist/chunks/sessionTitle-CkrnWEW1.js +14 -0
  313. package/dist/chunks/sessionTracing-Caw-kvQr.js +11 -0
  314. package/dist/chunks/settingsSync-Dn_lGonC.js +1 -0
  315. package/dist/chunks/setup-DGkOT4DX.js +2 -0
  316. package/dist/chunks/setup-Dihjl7jo.js +9 -0
  317. package/dist/chunks/setup-II1titXI.js +1 -0
  318. package/dist/chunks/shadowedRuleDetection-DASW3j9H.js +1 -0
  319. package/dist/chunks/shellQuote-CBjhlaFO.js +1 -0
  320. package/dist/chunks/sideQuestion-C1qbLTAL.js +20 -0
  321. package/dist/chunks/sink-BSPyC453.js +1 -0
  322. package/dist/chunks/sink-CqOAfFlL.js +1 -0
  323. package/dist/chunks/sinks-BT_lBY6T.js +2 -0
  324. package/dist/chunks/sinks-CpuRIC3H.js +1 -0
  325. package/dist/chunks/skill-learning-kh0HKn6u.js +5 -0
  326. package/dist/chunks/skillChangeDetector-DQuNepIV.js +1 -0
  327. package/dist/chunks/skillGapStore-B1gUQXhE.js +5 -0
  328. package/dist/chunks/skillGapStore-CFmLJlYm.js +1 -0
  329. package/dist/chunks/skillGenerator-DIAwRpPg.js +8 -0
  330. package/dist/chunks/skillLearning-Bxu1Uzl-.js +1 -0
  331. package/dist/chunks/skillLearning-CxAbHYEk.js +1 -0
  332. package/dist/chunks/skillPanel-B9zJLHKV.js +28 -0
  333. package/dist/chunks/skillSearchPanel-C1O9sxYS.js +21 -0
  334. package/dist/chunks/skills-C6_3snFY.js +1 -0
  335. package/dist/chunks/sprites-59l7vF4l.js +1 -0
  336. package/dist/chunks/src-BGzuPZ5q.js +26 -0
  337. package/dist/chunks/src-kgpr3s-l.js +1 -0
  338. package/dist/chunks/startupProfiler-CAntGAbs.js +3 -0
  339. package/dist/chunks/startupProfiler-WtUzkMKV.js +1 -0
  340. package/dist/chunks/stats-BmGdg4nj.js +1 -0
  341. package/dist/chunks/status-KLPT7uYP.js +1 -0
  342. package/dist/chunks/statusNoticeHelpers-DuqyBY-N.js +1 -0
  343. package/dist/chunks/stdio-Cg20AQ5W.js +1 -0
  344. package/dist/chunks/stickers-DDAm--86.js +1 -0
  345. package/dist/chunks/stringUtils-KZoO4GUd.js +4 -0
  346. package/dist/chunks/subprocessEnv-D4Cbyl2J.js +1 -0
  347. package/dist/chunks/systemPromptSections-CVpefuSD.js +1 -0
  348. package/dist/chunks/tag-0vahEnrx.js +11 -0
  349. package/dist/chunks/tasks-zVPemGv7.js +1 -0
  350. package/dist/chunks/teamHelpers-B83RwCCC.js +1 -0
  351. package/dist/chunks/teamHelpers-CXAmvFco.js +1 -0
  352. package/dist/chunks/teammateModeSnapshot-AdUFmPGC.js +1 -0
  353. package/dist/chunks/teammateModeSnapshot-CdiglTzv.js +1 -0
  354. package/dist/chunks/teleport-D6PvdjPy.js +1 -0
  355. package/dist/chunks/templateJobs-Ox5ZTKjW.js +12 -0
  356. package/dist/chunks/terminalSetup-Dh70ynBX.js +1 -0
  357. package/dist/chunks/terminalSetup-hLCi-2uB.js +33 -0
  358. package/dist/chunks/theme-DxgUVq9C.js +1 -0
  359. package/dist/chunks/thinkback-C5vFU8dM.js +1 -0
  360. package/dist/chunks/thinkback-DWgU7Qhr.js +1 -0
  361. package/dist/chunks/thinkback-play-CDzY6Ux4.js +1 -0
  362. package/dist/chunks/tmux-DelKEjda.js +1 -0
  363. package/dist/chunks/toolEventObserver-DPoMAJwr.js +1 -0
  364. package/dist/chunks/toolEventObserver-jO6-mlFU.js +1 -0
  365. package/dist/chunks/toolPool-BmA-BnAq.js +1 -0
  366. package/dist/chunks/toolPool-Dgn1Clq8.js +1 -0
  367. package/dist/chunks/trustedDevice-CYR5AgSB.js +1 -0
  368. package/dist/chunks/trustedDevice-D35gYkBT.js +1 -0
  369. package/dist/chunks/tui-DoOiz2RW.js +6 -0
  370. package/dist/chunks/types-BCy5hsQR.js +1 -0
  371. package/dist/chunks/types-KeqFPzY5.js +17 -0
  372. package/dist/chunks/udsClient-CBF_cZFW.js +1 -0
  373. package/dist/chunks/ultrareviewCommand-o4GjzoXK.js +3 -0
  374. package/dist/chunks/undercover-B4xr62Ux.js +31 -0
  375. package/dist/chunks/undercover-nakrQDLh.js +1 -0
  376. package/dist/chunks/up-DaiW-V1N.js +12 -0
  377. package/dist/chunks/updateCCB-Cthn50OV.js +11 -0
  378. package/dist/chunks/upgrade-D4Id4ebd.js +1 -0
  379. package/dist/chunks/upgrade-DJTCV8sr.js +1 -0
  380. package/dist/chunks/upload-BFDXvdfb.js +1 -0
  381. package/dist/chunks/upstreamproxy-CLf1UaJv.js +11 -0
  382. package/dist/chunks/usage-Csbso5mD.js +1 -0
  383. package/dist/chunks/usage-DxudeFLL.js +1 -0
  384. package/dist/chunks/useExitOnCtrlCDWithKeybindings-BHi41Ku_.js +1 -0
  385. package/dist/chunks/useMainLoopModel-CEqP4HOc.js +1 -0
  386. package/dist/chunks/useManagePlugins-BmS3Adja.js +1 -0
  387. package/dist/chunks/useMergedTools-wR6Bglqq.js +1 -0
  388. package/dist/chunks/useSearchInput-BhKAGgEN.js +1 -0
  389. package/dist/chunks/useSettingsErrors-CjK3P-Ki.js +1 -0
  390. package/dist/chunks/useTerminalSize-Du-EamDN.js +1 -0
  391. package/dist/chunks/useVoice-DP1hHBWA.js +1 -0
  392. package/dist/chunks/util-CMSErQoz.js +1 -0
  393. package/dist/chunks/utils-CAQfwbv8.js +1 -0
  394. package/dist/chunks/validatePlugin-_g0AqWZG.js +1 -0
  395. package/dist/chunks/vim-8y-2Q09k.js +1 -0
  396. package/dist/chunks/voice-BJAsr0K-.js +2 -0
  397. package/dist/chunks/voice-YtzCcIoM.js +8 -0
  398. package/dist/chunks/voiceModeEnabled-BD9GZhQ3.js +1 -0
  399. package/dist/chunks/voiceModeEnabled-DZbxaFIg.js +1 -0
  400. package/dist/chunks/voiceStreamSTT-B1T-8adN.js +1 -0
  401. package/dist/chunks/voiceStreamSTT-B39XaGOU.js +1 -0
  402. package/dist/chunks/web-tools-DVIvcP41.js +1 -0
  403. package/dist/chunks/windowsPaths-BeDSnJ23.js +2 -0
  404. package/dist/chunks/windowsPaths-ttHiMKpR.js +1 -0
  405. package/dist/chunks/workerRegistry-60_UCyc3.js +1 -0
  406. package/dist/chunks/worktree-DNK8NprA.js +1 -0
  407. package/dist/chunks/worktreeModeEnabled-RtizNgNg.js +1 -0
  408. package/dist/chunks/xml-CTdKuU6f.js +1 -0
  409. package/dist/cli.js +1 -1
  410. package/package.json +1 -1
  411. package/dist/chunks/AddWorkspaceDirectory-BqR8LhJq.js +0 -1
  412. package/dist/chunks/App-DkBMWXkK.js +0 -1
  413. package/dist/chunks/ApproveApiKey-5xd0lUV7.js +0 -1
  414. package/dist/chunks/ApproveApiKey-Dmr2VaVA.js +0 -1
  415. package/dist/chunks/AssistantSessionChooser-C7rigDkQ.js +0 -1
  416. package/dist/chunks/BackgroundTasksDialog-RtEwbumC.js +0 -2
  417. package/dist/chunks/BypassPermissionsModeDialog-7s3ULbNF.js +0 -1
  418. package/dist/chunks/ClaudeInChromeOnboarding-Bjv-sERa.js +0 -1
  419. package/dist/chunks/ClaudeMdExternalIncludesDialog-BTysDIlI.js +0 -1
  420. package/dist/chunks/ClaudeMdExternalIncludesDialog-DosNL91g.js +0 -1
  421. package/dist/chunks/ConsoleOAuthFlow-Cc1yaM-M.js +0 -1
  422. package/dist/chunks/DesktopHandoff-Cy89ZB_9.js +0 -1
  423. package/dist/chunks/DevChannelsDialog-ws8prcNK.js +0 -1
  424. package/dist/chunks/DiffDialog-BhqgxA7o.js +0 -3
  425. package/dist/chunks/Doctor-BWouB_9X.js +0 -1
  426. package/dist/chunks/Doctor-Ts5k8hn1.js +0 -3
  427. package/dist/chunks/ExitFlow-BBoImtT_.js +0 -2
  428. package/dist/chunks/Feedback-BVbSMBwY.js +0 -2
  429. package/dist/chunks/Grove-CTQrX7WO.js +0 -1
  430. package/dist/chunks/Grove-ZMHK4CBZ.js +0 -11
  431. package/dist/chunks/HybridTransport-B9g074Y1.js +0 -4
  432. package/dist/chunks/ITermBackend-DaFK8DOH.js +0 -1
  433. package/dist/chunks/InvalidConfigDialog-BkZkVKB4.js +0 -1
  434. package/dist/chunks/InvalidSettingsDialog-Lr60eQWj.js +0 -1
  435. package/dist/chunks/MCPConnectionManager-DmJ6dLOp.js +0 -1
  436. package/dist/chunks/McpParsingWarnings-CE2pQPXV.js +0 -1
  437. package/dist/chunks/MessageSelector-BT1FDbwv.js +0 -3
  438. package/dist/chunks/Messages-DT2gDtrJ.js +0 -11
  439. package/dist/chunks/Onboarding-DsqnXQel.js +0 -1
  440. package/dist/chunks/OverageCreditUpsell-UWtCrOmN.js +0 -1
  441. package/dist/chunks/PluginSettings-OJQz3d5V.js +0 -17
  442. package/dist/chunks/PromptInputFooterSuggestions-BImBB6Yk.js +0 -1
  443. package/dist/chunks/PromptInputHelpMenu-CblAb9vk.js +0 -1
  444. package/dist/chunks/QueryEngine-_re1pGHr.js +0 -1
  445. package/dist/chunks/REPL-eBTeslsR.js +0 -147
  446. package/dist/chunks/REPL-wIg0cBqS.js +0 -1
  447. package/dist/chunks/RemoteCallout-DMQai8_P.js +0 -1
  448. package/dist/chunks/RemoteSessionManager-DQmsHvj_.js +0 -2
  449. package/dist/chunks/ResumeConversation-D81hDeTl.js +0 -1
  450. package/dist/chunks/SSETransport-BbeM6bi9.js +0 -4
  451. package/dist/chunks/SearchExtraToolsTool-QbJQCWXd.js +0 -1
  452. package/dist/chunks/SentryErrorBoundary-BQJXHbWh.js +0 -2
  453. package/dist/chunks/SentryErrorBoundary-Cnw74oVG.js +0 -1
  454. package/dist/chunks/Settings-DiXc-_IG.js +0 -2
  455. package/dist/chunks/TeleportProgress-B3oRJlWH.js +0 -1
  456. package/dist/chunks/TeleportRepoMismatchDialog-GPuEipFy.js +0 -1
  457. package/dist/chunks/TeleportResumeWrapper-CcDuR6o9.js +0 -1
  458. package/dist/chunks/ThemePicker-BjSRjA_L.js +0 -1
  459. package/dist/chunks/TmuxBackend-BE3zsPKE.js +0 -9
  460. package/dist/chunks/TrustDialog-B6Qg0xUr.js +0 -1
  461. package/dist/chunks/TungstenTool-C5IqKVr0.js +0 -1
  462. package/dist/chunks/ValidationErrorsList-C5BoLiye.js +0 -2
  463. package/dist/chunks/WelcomeV2-BJAKZYz1.js +0 -1
  464. package/dist/chunks/WindowsTerminalBackend-BcwpxU2Q.js +0 -2
  465. package/dist/chunks/add-dir-OR7-VVcq.js +0 -1
  466. package/dist/chunks/agentDisplay-CMqTUh0A.js +0 -1
  467. package/dist/chunks/agents-DRtgUZ6t.js +0 -103
  468. package/dist/chunks/agents-EolUGDZB.js +0 -2
  469. package/dist/chunks/ant-Bgl31h7a.js +0 -1
  470. package/dist/chunks/api-BpQPVgif.js +0 -1
  471. package/dist/chunks/api-xFvB7WoB.js +0 -1
  472. package/dist/chunks/asciicast-CJObpRg9.js +0 -1
  473. package/dist/chunks/asciicast-Dr_Div_R.js +0 -4
  474. package/dist/chunks/assistant-CENsWvTb.js +0 -1
  475. package/dist/chunks/assistant-CHawoD04.js +0 -1
  476. package/dist/chunks/assistant-s7XNIA76.js +0 -1
  477. package/dist/chunks/auth-DX12yVM8.js +0 -1
  478. package/dist/chunks/auth-h6VL9BbC.js +0 -1
  479. package/dist/chunks/autoMode-BDzVqEPm.js +0 -45
  480. package/dist/chunks/autonomy-CeqOXzJl.js +0 -19
  481. package/dist/chunks/autonomy-D2YudQnH.js +0 -1
  482. package/dist/chunks/autonomyPanel-B0OQV4lv.js +0 -1
  483. package/dist/chunks/backgroundHousekeeping-CvHD981l.js +0 -17
  484. package/dist/chunks/backgroundHousekeeping-DMkk-QoZ.js +0 -1
  485. package/dist/chunks/banner-DNLUJFS_.js +0 -2
  486. package/dist/chunks/bg-D_H-uZDS.js +0 -9
  487. package/dist/chunks/bg-FtpmvQuT.js +0 -1
  488. package/dist/chunks/branch-D44HjlJp.js +0 -3
  489. package/dist/chunks/break-cache-ByJ7U2Ts.js +0 -8
  490. package/dist/chunks/bridge-4sldfa8u.js +0 -2
  491. package/dist/chunks/bridgeConfig-BM7iHryd.js +0 -1
  492. package/dist/chunks/bridgeConfig-CcCNsSBX.js +0 -1
  493. package/dist/chunks/bridgeEnabled-CYddgTU1.js +0 -1
  494. package/dist/chunks/bridgeEnabled-DoT2l1Oj.js +0 -1
  495. package/dist/chunks/bridgeMain-DaO51duk.js +0 -68
  496. package/dist/chunks/bridgeMain-Dc4-ZK69.js +0 -1
  497. package/dist/chunks/bridgeMessaging-IlSWKGmC.js +0 -1
  498. package/dist/chunks/bridgePointer-fFD_tbSk.js +0 -1
  499. package/dist/chunks/browser-DwnUS505.js +0 -1
  500. package/dist/chunks/btw-CrdUyRUP.js +0 -1
  501. package/dist/chunks/buddy-Ci0hdCf9.js +0 -3
  502. package/dist/chunks/bypassPermissionsKillswitch-BWOlc_sK.js +0 -1
  503. package/dist/chunks/caches-BHRJHGlc.js +0 -1
  504. package/dist/chunks/caches-CitduRKp.js +0 -3
  505. package/dist/chunks/ccrClient-yNKhQYnf.js +0 -1
  506. package/dist/chunks/changeDetector-B1tCH9Pa.js +0 -1
  507. package/dist/chunks/channelNotification-D8NPg8I8.js +0 -1
  508. package/dist/chunks/channelNotification-oE3eipDZ.js +0 -1
  509. package/dist/chunks/chrome-CwAwCY0V.js +0 -1
  510. package/dist/chunks/chromeNativeHost-63xqELw-.js +0 -1
  511. package/dist/chunks/claudeDesktop-CX1AsJie.js +0 -1
  512. package/dist/chunks/cleanup-C0gyKaOb.js +0 -1
  513. package/dist/chunks/clear-B5D08sZ0.js +0 -1
  514. package/dist/chunks/cliLaunch-8aeIk2ts.js +0 -1
  515. package/dist/chunks/client-un1k_6md.js +0 -1
  516. package/dist/chunks/color-BtVvrSvq.js +0 -1
  517. package/dist/chunks/commands--qEK1j9j.js +0 -1
  518. package/dist/chunks/commitAttribution-AEb-sE-t.js +0 -1
  519. package/dist/chunks/commitAttribution-HP_CWP0X.js +0 -2
  520. package/dist/chunks/common-BBRP_KzA.js +0 -1
  521. package/dist/chunks/common-BD4Q7osK.js +0 -1
  522. package/dist/chunks/common-C56I-_O3.js +0 -1
  523. package/dist/chunks/compact-BNhxD2UA.js +0 -3
  524. package/dist/chunks/companion-BlhNrZiL.js +0 -1
  525. package/dist/chunks/completionCache-BHSsdkBs.js +0 -1
  526. package/dist/chunks/completionCache-Daqaxlf3.js +0 -4
  527. package/dist/chunks/config-9z8716kz.js +0 -1
  528. package/dist/chunks/config-f8Cx16Z6.js +0 -1
  529. package/dist/chunks/context-BdOjhAmM.js +0 -1
  530. package/dist/chunks/context-noninteractive-CnaDbgvf.js +0 -54
  531. package/dist/chunks/context-noninteractive-DRM7gbFk.js +0 -1
  532. package/dist/chunks/conversation-B9pq-m4L.js +0 -1
  533. package/dist/chunks/conversation-DUxXVrGj.js +0 -1
  534. package/dist/chunks/copy-Cjl0-hg1.js +0 -7
  535. package/dist/chunks/createSSHSession-CYaHalxc.js +0 -6
  536. package/dist/chunks/createSession-DoR2K7ay.js +0 -1
  537. package/dist/chunks/createSession-VlSLvi7J.js +0 -1
  538. package/dist/chunks/cron-DiW7eIPP.js +0 -1
  539. package/dist/chunks/cronJitterConfig-DjSd7nvj.js +0 -6
  540. package/dist/chunks/crossProjectResume-CDWr5DFl.js +0 -40
  541. package/dist/chunks/daemon-FAp0WyY6.js +0 -2
  542. package/dist/chunks/datadog-CahWdK03.js +0 -1
  543. package/dist/chunks/datadog-DPkKCR8M.js +0 -1
  544. package/dist/chunks/desktop-y3mzgaWo.js +0 -1
  545. package/dist/chunks/detached-Brq3-vHi.js +0 -5
  546. package/dist/chunks/detectRepository-CSN3yxkq.js +0 -1
  547. package/dist/chunks/detectRepository-CbR0WgtE.js +0 -1
  548. package/dist/chunks/detection-BPPZCanO.js +0 -1
  549. package/dist/chunks/detection-DrdKrqbQ.js +0 -1
  550. package/dist/chunks/diff-hpp0dp6U.js +0 -1
  551. package/dist/chunks/directoryCompletion-DAc3u1K2.js +0 -1
  552. package/dist/chunks/doctor-B230p0R_.js +0 -1
  553. package/dist/chunks/earlyInput-BFcdUMaX.js +0 -2
  554. package/dist/chunks/earlyInput-vv9abU2L.js +0 -1
  555. package/dist/chunks/effort-D7i2v6vd.js +0 -9
  556. package/dist/chunks/entry-Du3gtq9o.js +0 -14
  557. package/dist/chunks/env-BH-OBzcA.js +0 -1
  558. package/dist/chunks/envLessBridgeConfig-CKD4eOEe.js +0 -1
  559. package/dist/chunks/envLessBridgeConfig-DI0ouryy.js +0 -1
  560. package/dist/chunks/execFileNoThrow-B_aZH_GP.js +0 -1
  561. package/dist/chunks/executor-BJb5d6mo.js +0 -1
  562. package/dist/chunks/executor-Dmn3RTuI.js +0 -1561
  563. package/dist/chunks/exit-fntBGxEC.js +0 -1
  564. package/dist/chunks/export-Dy9M7FnZ.js +0 -2
  565. package/dist/chunks/exportRenderer-Ckv4v0ye.js +0 -1
  566. package/dist/chunks/extra-usage-DLEvlKzs.js +0 -1
  567. package/dist/chunks/extra-usage-core-3KkeQSve.js +0 -1
  568. package/dist/chunks/extra-usage-noninteractive-DUezD54f.js +0 -1
  569. package/dist/chunks/extra-usage-pU11YXHS.js +0 -1
  570. package/dist/chunks/extraUsage-B-l-oe-7.js +0 -1
  571. package/dist/chunks/extractMemories-CXarlmZp.js +0 -1
  572. package/dist/chunks/fast-BzfzSH7K.js +0 -1
  573. package/dist/chunks/fast-CbLu_WYL.js +0 -1
  574. package/dist/chunks/featureCheck-p7OeCYzj.js +0 -1
  575. package/dist/chunks/feedback-DiyZIbov.js +0 -1
  576. package/dist/chunks/fileStateCache-C7-TxF8G.js +0 -1
  577. package/dist/chunks/files-DYvAZGxp.js +0 -2
  578. package/dist/chunks/firstPartyEventLogger-Dig8Mv7_.js +0 -1
  579. package/dist/chunks/flushGate-Ci3NHOV4.js +0 -1
  580. package/dist/chunks/gates-CtkQH6jy.js +0 -1
  581. package/dist/chunks/gates-xscCu8-N.js +0 -1
  582. package/dist/chunks/gemini-BCuY2aYj.js +0 -1
  583. package/dist/chunks/generateRecap-DA0SNyFR.js +0 -1
  584. package/dist/chunks/generateSessionName-BtQ4NGXP.js +0 -1
  585. package/dist/chunks/genericProcessUtils-D-78JZxz.js +0 -23
  586. package/dist/chunks/git-BZEgupMC.js +0 -1
  587. package/dist/chunks/git-DayFjsvj.js +0 -6
  588. package/dist/chunks/githubRepoPathMapping-C5RkiJWj.js +0 -1
  589. package/dist/chunks/goal-B6GHfd9J.js +0 -3
  590. package/dist/chunks/grok-DDM6xYuy.js +0 -1
  591. package/dist/chunks/growthbook-D-Po5Uxl.js +0 -1
  592. package/dist/chunks/heapdump-DHlUfpVV.js +0 -5
  593. package/dist/chunks/help-BulgC9m7.js +0 -1
  594. package/dist/chunks/hooks-D5AcFnD1.js +0 -1
  595. package/dist/chunks/hooks-jxIrev-X.js +0 -79
  596. package/dist/chunks/hostAdapter-BvraKy0o.js +0 -1
  597. package/dist/chunks/hostGuard-CWijeIyE.js +0 -1
  598. package/dist/chunks/ide-tx4qMFln.js +0 -2
  599. package/dist/chunks/inboundAttachments-C93Q7Dvt.js +0 -1
  600. package/dist/chunks/inboundAttachments-DxcFiX4f.js +0 -1
  601. package/dist/chunks/initReplBridge-BEldrf6f.js +0 -1
  602. package/dist/chunks/insights-HEsEDeCQ.js +0 -822
  603. package/dist/chunks/install-DRsM0bJO.js +0 -1
  604. package/dist/chunks/install-github-app-BVK5Z95c.js +0 -147
  605. package/dist/chunks/install-slack-app-DCw3O2J_.js +0 -1
  606. package/dist/chunks/instrumentation-DJ-R1s8C.js +0 -12
  607. package/dist/chunks/job-CUz_OGIq.js +0 -2
  608. package/dist/chunks/jwtUtils-DVyv2jab.js +0 -1
  609. package/dist/chunks/keybindings-Chr5nGBu.js +0 -2
  610. package/dist/chunks/lang-C7kJlPIh.js +0 -1
  611. package/dist/chunks/language-CQXwoDkI.js +0 -1
  612. package/dist/chunks/language-Lx3WlBN6.js +0 -1
  613. package/dist/chunks/launchAgentsPlatform-Fsslu42L.js +0 -1
  614. package/dist/chunks/launchAutofixPr-Cww8uS_5.js +0 -18
  615. package/dist/chunks/launchLocalMemory-BywmyvSJ.js +0 -3
  616. package/dist/chunks/launchLocalVault-BU3a5NV7.js +0 -3
  617. package/dist/chunks/launchMemoryStores-QUCODCJS.js +0 -1
  618. package/dist/chunks/launchOnboarding-BriZ0oIA.js +0 -8
  619. package/dist/chunks/launchSchedule-uLm7zt_B.js +0 -1
  620. package/dist/chunks/launchSkillStore-DMo2bV8X.js +0 -1
  621. package/dist/chunks/launchTeleport-DgQWSfXM.js +0 -3
  622. package/dist/chunks/launchVault-DfnBBFne.js +0 -1
  623. package/dist/chunks/loadAgentsDir-Br5fGLLI.js +0 -4697
  624. package/dist/chunks/loadAgentsDir-DDYPdQKP.js +0 -1
  625. package/dist/chunks/loadPluginHooks-C4soqr6g.js +0 -1
  626. package/dist/chunks/localSearch-CELyiWF6.js +0 -1
  627. package/dist/chunks/localSearch-DhZMcy5t.js +0 -1
  628. package/dist/chunks/log-DS97_rIr.js +0 -1
  629. package/dist/chunks/login-CvvIpkpq.js +0 -1
  630. package/dist/chunks/login-DjgITOAw.js +0 -1
  631. package/dist/chunks/logoV2Utils-BN_HrHSc.js +0 -1
  632. package/dist/chunks/logout-DOFJpZEJ.js +0 -1
  633. package/dist/chunks/magicDocs-2Zr7bYY_.js +0 -57
  634. package/dist/chunks/main-BafHJuKH.js +0 -31
  635. package/dist/chunks/main-D61CvHRy.js +0 -1312
  636. package/dist/chunks/mappers-BCiceNt3.js +0 -1
  637. package/dist/chunks/mcp-BV4m1Gbl.js +0 -2
  638. package/dist/chunks/mcp-CrAgAK9u.js +0 -1
  639. package/dist/chunks/mcp-DK4m73gO.js +0 -6
  640. package/dist/chunks/mcpServer-7zyXl9Wg.js +0 -1
  641. package/dist/chunks/mcpServer-sa9Z183j.js +0 -1
  642. package/dist/chunks/memoize-CPexXTP7.js +0 -1
  643. package/dist/chunks/memory-BrJPVgxn.js +0 -1
  644. package/dist/chunks/mobile-Cydobb55.js +0 -2
  645. package/dist/chunks/mode-Cr-NTlRa.js +0 -2
  646. package/dist/chunks/model-CCjuMV6k.js +0 -1
  647. package/dist/chunks/model-aJS_plgM.js +0 -1
  648. package/dist/chunks/onChangeAppState-C9EvI3EH.js +0 -1
  649. package/dist/chunks/openai-Cvb_-1A-.js +0 -10
  650. package/dist/chunks/overageCreditGrant-cGQilawd.js +0 -1
  651. package/dist/chunks/panel-ByW1omJn.js +0 -1
  652. package/dist/chunks/panel-DO_faHV-.js +0 -1
  653. package/dist/chunks/panelCall-DqZuxAf0.js +0 -1
  654. package/dist/chunks/parser-DbKSpFRq.js +0 -1
  655. package/dist/chunks/passes-DsrceO14.js +0 -1
  656. package/dist/chunks/path-nCzt96pE.js +0 -1
  657. package/dist/chunks/paths-DfGsIjPm.js +0 -39
  658. package/dist/chunks/permissions-CjPIu4IE.js +0 -3
  659. package/dist/chunks/permissions-Ps_D01ZB.js +0 -1
  660. package/dist/chunks/pipeTransport-C5u1K0wu.js +0 -1
  661. package/dist/chunks/plan-YjMAcn6g.js +0 -1
  662. package/dist/chunks/platform-DYZVoA9J.js +0 -2
  663. package/dist/chunks/plugin-Oux5bBQj.js +0 -1
  664. package/dist/chunks/pluginAutoupdate-Dl9U-fbk.js +0 -1
  665. package/dist/chunks/pluginBlocklist-BzI5DNeN.js +0 -1
  666. package/dist/chunks/pluginCliCommands-CExAcsaR.js +0 -1
  667. package/dist/chunks/pluginFlagging-BeqrbhgG.js +0 -1
  668. package/dist/chunks/pluginOperations-s0FQGOBm.js +0 -2
  669. package/dist/chunks/pluginStartupCheck-BVag9B-T.js +0 -1
  670. package/dist/chunks/pluginStartupCheck-BuorUEEf.js +0 -1
  671. package/dist/chunks/plugins-DTQHVJtY.js +0 -4
  672. package/dist/chunks/policyLimits-zoyF_6O4.js +0 -1
  673. package/dist/chunks/pollConfig-C19GiX7i.js +0 -1
  674. package/dist/chunks/poller-DADqVTWi.js +0 -1
  675. package/dist/chunks/poor-Bx5vvamq.js +0 -1
  676. package/dist/chunks/poorMode-BCoeB5zB.js +0 -1
  677. package/dist/chunks/poorMode-CTd_csCl.js +0 -1
  678. package/dist/chunks/print-UXl3rG8y.js +0 -39
  679. package/dist/chunks/privacy-settings-e43D9a4o.js +0 -1
  680. package/dist/chunks/processBashCommand-CvR9-gf8.js +0 -1
  681. package/dist/chunks/processSlashCommand-CB3wyAX7.js +0 -6
  682. package/dist/chunks/projectContext-D3_u80TY.js +0 -1
  683. package/dist/chunks/prompt-53lRY98R.js +0 -1
  684. package/dist/chunks/prompt-B8M-HLIS.js +0 -227
  685. package/dist/chunks/prompt-CooZNM1u.js +0 -1
  686. package/dist/chunks/promptEditor-CHiopfD7.js +0 -4
  687. package/dist/chunks/protocolHandler-DjivYn8H.js +0 -13
  688. package/dist/chunks/rate-limit-options-B-vndk5W.js +0 -1
  689. package/dist/chunks/rcDebugLog-BoroyfjB.js +0 -11
  690. package/dist/chunks/referral-DOqhciQu.js +0 -1
  691. package/dist/chunks/refresh-C8uLznwm.js +0 -1
  692. package/dist/chunks/registerProtocol-4lQ7O4Cc.js +0 -36
  693. package/dist/chunks/registry-q6v98JYd.js +0 -1
  694. package/dist/chunks/release-notes-C7JHshX3.js +0 -4
  695. package/dist/chunks/releaseNotes-CXY-xAja.js +0 -2
  696. package/dist/chunks/reload-plugins-DLS5lQcc.js +0 -1
  697. package/dist/chunks/remote-env-DhHea8yK.js +0 -1
  698. package/dist/chunks/remoteBridgeCore-BhOLhQIA.js +0 -1
  699. package/dist/chunks/remoteControlServer-CI0F83pg.js +0 -3
  700. package/dist/chunks/rename-DiKWWCzB.js +0 -1
  701. package/dist/chunks/renderOptions-DKe32LfM.js +0 -1
  702. package/dist/chunks/resume-DA4ToJFW.js +0 -2
  703. package/dist/chunks/runtimeObserver-BfVC8KK9.js +0 -1
  704. package/dist/chunks/runtimeObserver-DetZ5Tek.js +0 -10
  705. package/dist/chunks/sandbox-adapter-wh4cKN45.js +0 -1
  706. package/dist/chunks/sandbox-toggle-D8MgV0DT.js +0 -1
  707. package/dist/chunks/searchExtraTools-DbPpcAPw.js +0 -1
  708. package/dist/chunks/sentry-C3sL9nhF.js +0 -13
  709. package/dist/chunks/session-Bd-4QCqc.js +0 -2
  710. package/dist/chunks/sessionDiscovery-D_KPF86E.js +0 -1
  711. package/dist/chunks/sessionFileAccessHooks-COne5L2E.js +0 -1
  712. package/dist/chunks/sessionMemory-0Jqo1_MV.js +0 -1
  713. package/dist/chunks/sessionMemory-BDt_8bNB.js +0 -1
  714. package/dist/chunks/sessionMemoryUtils-BFIJ1nqF.js +0 -1
  715. package/dist/chunks/sessionObserver-CEky1SLb.js +0 -1
  716. package/dist/chunks/sessionObserver-CQxIKV8D.js +0 -20
  717. package/dist/chunks/sessionStorage-D1XhqZyW.js +0 -1
  718. package/dist/chunks/sessionStoragePortable-DJZ_6cL8.js +0 -3
  719. package/dist/chunks/sessionTitle-CB0ZEkS_.js +0 -14
  720. package/dist/chunks/sessionTracing-BIKXLTJZ.js +0 -11
  721. package/dist/chunks/settingsSync-pI3L3CeR.js +0 -1
  722. package/dist/chunks/setup-BSi50fkU.js +0 -1
  723. package/dist/chunks/setup-DjsmjRKQ.js +0 -2
  724. package/dist/chunks/setup-Dq0_SRA1.js +0 -9
  725. package/dist/chunks/shadowedRuleDetection-DvAjOOPL.js +0 -1
  726. package/dist/chunks/shellQuote-D8XPeqkc.js +0 -1
  727. package/dist/chunks/sideQuestion-BrTA8ooG.js +0 -20
  728. package/dist/chunks/sink-CqWxcRl9.js +0 -1
  729. package/dist/chunks/sink-Dkat5kH9.js +0 -1
  730. package/dist/chunks/sinks--frMI4-5.js +0 -2
  731. package/dist/chunks/sinks-CvPAVcMY.js +0 -1
  732. package/dist/chunks/skill-learning-2LV0yuwF.js +0 -5
  733. package/dist/chunks/skillChangeDetector-B5CGPl7e.js +0 -1
  734. package/dist/chunks/skillGapStore-Dc29T-OG.js +0 -1
  735. package/dist/chunks/skillGapStore-KzRf6Ezr.js +0 -5
  736. package/dist/chunks/skillGenerator-BdOHsgc4.js +0 -8
  737. package/dist/chunks/skillLearning-CdcVIG14.js +0 -1
  738. package/dist/chunks/skillLearning-DXWMxSA2.js +0 -1
  739. package/dist/chunks/skillPanel-zMY8o-86.js +0 -28
  740. package/dist/chunks/skillSearchPanel-l8aolUP8.js +0 -21
  741. package/dist/chunks/skills-BeMWJPup.js +0 -1
  742. package/dist/chunks/sprites-qel_EgTP.js +0 -1
  743. package/dist/chunks/src-BIPP3_mo.js +0 -26
  744. package/dist/chunks/src-DJXKJavk.js +0 -1
  745. package/dist/chunks/startupProfiler-CnDpob1v.js +0 -3
  746. package/dist/chunks/startupProfiler-TrMfE6Q4.js +0 -1
  747. package/dist/chunks/stats-CEBfahqM.js +0 -1
  748. package/dist/chunks/status-C9KXyfDk.js +0 -1
  749. package/dist/chunks/statusNoticeHelpers-CxoN9oDh.js +0 -1
  750. package/dist/chunks/stdio-BEEzuxaZ.js +0 -1
  751. package/dist/chunks/stickers-eHrGA1W5.js +0 -1
  752. package/dist/chunks/subprocessEnv-CggQWZCx.js +0 -1
  753. package/dist/chunks/systemPromptSections-DB93ZNWP.js +0 -1
  754. package/dist/chunks/tag-Dvl7Us9y.js +0 -11
  755. package/dist/chunks/tasks-BhiwUF0n.js +0 -1
  756. package/dist/chunks/teamHelpers-COQazluD.js +0 -1
  757. package/dist/chunks/teamHelpers-Mgfrv-Jf.js +0 -1
  758. package/dist/chunks/teammateModeSnapshot-8EWjlA-s.js +0 -1
  759. package/dist/chunks/teammateModeSnapshot-BV-P8s5r.js +0 -1
  760. package/dist/chunks/teleport-U5Zgqw3H.js +0 -1
  761. package/dist/chunks/templateJobs-C3idypN_.js +0 -12
  762. package/dist/chunks/terminalSetup-CmAEgt-5.js +0 -33
  763. package/dist/chunks/terminalSetup-mvAN4no7.js +0 -1
  764. package/dist/chunks/theme-BD2H4vJi.js +0 -1
  765. package/dist/chunks/thinkback-BOByXYp2.js +0 -1
  766. package/dist/chunks/thinkback-Dzu2mnNF.js +0 -1
  767. package/dist/chunks/thinkback-play-BX1K2UMY.js +0 -1
  768. package/dist/chunks/tmux-DruHFjDy.js +0 -1
  769. package/dist/chunks/toolEventObserver-B6cLV_dK.js +0 -1
  770. package/dist/chunks/toolEventObserver-i6it3p2_.js +0 -1
  771. package/dist/chunks/toolPool--2gNFbrz.js +0 -1
  772. package/dist/chunks/toolPool-dNV2JxUI.js +0 -1
  773. package/dist/chunks/trustedDevice-DY8OosTr.js +0 -1
  774. package/dist/chunks/trustedDevice-zya_Ml1N.js +0 -1
  775. package/dist/chunks/tui-KoYD82tT.js +0 -6
  776. package/dist/chunks/types-CQ1wrnQ0.js +0 -1
  777. package/dist/chunks/types-D5R26wwH.js +0 -17
  778. package/dist/chunks/udsClient-RkYuzeZC.js +0 -1
  779. package/dist/chunks/ultrareviewCommand-CCkKby4J.js +0 -3
  780. package/dist/chunks/undercover-CIutVLEO.js +0 -1
  781. package/dist/chunks/undercover-D9O2McNG.js +0 -31
  782. package/dist/chunks/up-BPM85EYl.js +0 -12
  783. package/dist/chunks/updateCCB-Bmn3Y63Y.js +0 -11
  784. package/dist/chunks/upgrade-D3rVOeHO.js +0 -1
  785. package/dist/chunks/upgrade-Dq3l14ZY.js +0 -1
  786. package/dist/chunks/upload-1PmElPfW.js +0 -1
  787. package/dist/chunks/upstreamproxy-BBTSJnad.js +0 -11
  788. package/dist/chunks/usage-B5G8FOZ3.js +0 -1
  789. package/dist/chunks/usage-VtTu7beE.js +0 -1
  790. package/dist/chunks/useMainLoopModel-CaQLIr1V.js +0 -1
  791. package/dist/chunks/useManagePlugins-BvoeOnqq.js +0 -1
  792. package/dist/chunks/useMergedTools-C133BfRp.js +0 -1
  793. package/dist/chunks/useSearchInput-CROB7AbC.js +0 -1
  794. package/dist/chunks/useSettingsErrors-DRxtFXoe.js +0 -1
  795. package/dist/chunks/useVoice-BQ9aSFJe.js +0 -1
  796. package/dist/chunks/util-BZnJgF79.js +0 -1
  797. package/dist/chunks/utils-4gsxQpga.js +0 -1
  798. package/dist/chunks/validatePlugin-DlrnBhPA.js +0 -1
  799. package/dist/chunks/vim-BXQCLoFJ.js +0 -1
  800. package/dist/chunks/voice-CeRmLRHT.js +0 -2
  801. package/dist/chunks/voice-QHyDff3f.js +0 -8
  802. package/dist/chunks/voiceModeEnabled-Bq_rttkL.js +0 -1
  803. package/dist/chunks/voiceModeEnabled-CLAVCVLW.js +0 -1
  804. package/dist/chunks/voiceStreamSTT-BDKenO5F.js +0 -1
  805. package/dist/chunks/voiceStreamSTT-CL52x8wZ.js +0 -1
  806. package/dist/chunks/windowsPaths-43st5EQF.js +0 -1
  807. package/dist/chunks/windowsPaths-DerzGPcz.js +0 -2
  808. package/dist/chunks/workerRegistry-BUD3lBk_.js +0 -1
  809. package/dist/chunks/worktree-C0f9Ke-R.js +0 -1
  810. package/dist/chunks/worktreeModeEnabled-THQb19xR.js +0 -1
  811. package/dist/chunks/xml-DvVQHZ1N.js +0 -1
  812. /package/dist/chunks/{Dialog-DYFGqyDs.js → Dialog-91X6ZGg9.js} +0 -0
  813. /package/dist/chunks/{InProcessTransport-B0mmAoxw.js → InProcessTransport-B9II3BiO.js} +0 -0
  814. /package/dist/chunks/{ListItem-OFARanN7.js → ListItem-DCQhApdJ.js} +0 -0
  815. /package/dist/chunks/{PermissionDialog-5MlJf7ew.js → PermissionDialog-_WQPRYHQ.js} +0 -0
  816. /package/dist/chunks/{PressEnterToContinue-BdA9zDGs.js → PressEnterToContinue-BJ58eCFC.js} +0 -0
  817. /package/dist/chunks/{SearchBox-DfOmUoaI.js → SearchBox-CkO4rQ-9.js} +0 -0
  818. /package/dist/chunks/{TungstenTool-V-Bwqlx3.js → TungstenTool-CnAF4y0E.js} +0 -0
  819. /package/dist/chunks/{attributionHooks-DZJjA8p9.js → attributionHooks-VGSpz4mk.js} +0 -0
  820. /package/dist/chunks/{attributionTrailer-CZY9XTcr.js → attributionTrailer-C8uqiLIb.js} +0 -0
  821. /package/dist/chunks/{autoModeDenials-CGAtAGGf.js → autoModeDenials-DlO5g6E9.js} +0 -0
  822. /package/dist/chunks/{bedrockClient-DZgaJTHp.js → bedrockClient-BUmO2U-X.js} +0 -0
  823. /package/dist/chunks/{capacityWake-BXlUpptF.js → capacityWake-DtmDHwEt.js} +0 -0
  824. /package/dist/chunks/{ccshareResume-CZggHNOf.js → ccshareResume-DKwcd0Vc.js} +0 -0
  825. /package/dist/chunks/{computerUseLock-BoEK9xYv.js → computerUseLock-Diig5B8p.js} +0 -0
  826. /package/dist/chunks/{connectHeadless-KNT0Sg7Z.js → connectHeadless-ByewVfOb.js} +0 -0
  827. /package/dist/chunks/{constants-41VpZw2G.js → constants-BljlAJOX.js} +0 -0
  828. /package/dist/chunks/{controlMessageCompat-BJhFiS7u.js → controlMessageCompat-Ds-CF-sM.js} +0 -0
  829. /package/dist/chunks/{dangerousBackend-ByOAEFld.js → dangerousBackend-Dkjtndh1.js} +0 -0
  830. /package/dist/chunks/{debugUtils-CiEnbhiz.js → debugUtils-l8nsUZ6R.js} +0 -0
  831. /package/dist/chunks/{distRoot-CcxmnzqQ.js → distRoot-BNg_iO5-.js} +0 -0
  832. /package/dist/chunks/{escHotkey-DfdC44i7.js → escHotkey-D8WgbSyj.js} +0 -0
  833. /package/dist/chunks/{esm-C-1qL9Mn.js → esm-vlR7mK5b.js} +0 -0
  834. /package/dist/chunks/{eventLoopStallDetector-l83_98VR.js → eventLoopStallDetector-bYy0fesH.js} +0 -0
  835. /package/dist/chunks/{exit-_obETqBv.js → exit-DOBLl8jN.js} +0 -0
  836. /package/dist/chunks/{featureCheck-Cm0YNDXO.js → featureCheck-j7P30mry.js} +0 -0
  837. /package/dist/chunks/{fpsMetrics-DOI_SIeY.js → fpsMetrics-DKWp7vng.js} +0 -0
  838. /package/dist/chunks/{fuse-Bp7rmZ5x.js → fuse-D3B-UE5Y.js} +0 -0
  839. /package/dist/chunks/{hash-BRmOQc3c.js → hash-CaUkS-30.js} +0 -0
  840. /package/dist/chunks/{index.min-BJnb9GQI.js → index.min-BNgJ2wVD.js} +0 -0
  841. /package/dist/chunks/{instinctParser-Bxhe2LOF.js → instinctParser-DOtj1Kni.js} +0 -0
  842. /package/dist/chunks/{intl-Pse97ORk.js → intl-CLeE9DsD.js} +0 -0
  843. /package/dist/chunks/{launchCommand-Du91jxMC.js → launchCommand-9eYsPG7W.js} +0 -0
  844. /package/dist/chunks/{lazySchema-2sOku3cX.js → lazySchema-B0QShMaQ.js} +0 -0
  845. /package/dist/chunks/{lib-B4Q0Nrpb.js → lib-Cf16LgKj.js} +0 -0
  846. /package/dist/chunks/{lockfile-CeCEBLtN.js → lockfile-C3JsqLpb.js} +0 -0
  847. /package/dist/chunks/{modalContext-CmSKRyea.js → modalContext-c5Yqx_CQ.js} +0 -0
  848. /package/dist/chunks/{normalization-Cox8C0dP.js → normalization-BLfP0Kqt.js} +0 -0
  849. /package/dist/chunks/{observationStore-BaPq7CKI.js → observationStore-rLlDwRtG.js} +0 -0
  850. /package/dist/chunks/{openaiShared-Crt0cZLO.js → openaiShared-C-AuktRP.js} +0 -0
  851. /package/dist/chunks/{output-style-BkOnFmfe.js → output-style-B64-Zum6.js} +0 -0
  852. /package/dist/chunks/{parseConnectUrl-BFNiff4c.js → parseConnectUrl-DL390ePs.js} +0 -0
  853. /package/dist/chunks/{parser-BXWr_mLL.js → parser-aIWfAYnt.js} +0 -0
  854. /package/dist/chunks/{permissions-DXLfdE7b.js → permissions-BsVJvaEe.js} +0 -0
  855. /package/dist/chunks/{postCommitAttribution-CA9Z2sqn.js → postCommitAttribution-D8MoHFoz.js} +0 -0
  856. /package/dist/chunks/{projectContext-CwJlxP2Y.js → projectContext-Dn7umMp6.js} +0 -0
  857. /package/dist/chunks/{prompt-4tea6NJQ.js → prompt-IqfIbvg9.js} +0 -0
  858. /package/dist/chunks/{proxy-nPT6a6QY.js → proxy-CF7ZDxaW.js} +0 -0
  859. /package/dist/chunks/{rewind-DTk4TFYB.js → rewind-Djt1zU_3.js} +0 -0
  860. /package/dist/chunks/{rollback-DbSpxmJE.js → rollback-CtS4yEQx.js} +0 -0
  861. /package/dist/chunks/{sanitization-DD414_3t.js → sanitization-Ds6zRQyx.js} +0 -0
  862. /package/dist/chunks/{sdkHeapDumpMonitor-fNRF2fbK.js → sdkHeapDumpMonitor-DLMMNeqo.js} +0 -0
  863. /package/dist/chunks/{semver-Tw0AFar5.js → semver-Di5OaTd5.js} +0 -0
  864. /package/dist/chunks/{server-DTd90dmm.js → server-DONKdvGc.js} +0 -0
  865. /package/dist/chunks/{serverBanner-B7UaaCCl.js → serverBanner-DIyjgIM-.js} +0 -0
  866. /package/dist/chunks/{serverLog-DRvGpDtt.js → serverLog-D1N5yx8A.js} +0 -0
  867. /package/dist/chunks/{sessionDataUploader-BDsz_1Uy.js → sessionDataUploader-CsNePsOb.js} +0 -0
  868. /package/dist/chunks/{sessionManager-Bh-Z-YXy.js → sessionManager-BOmgJd1l.js} +0 -0
  869. /package/dist/chunks/{slashCommandParsing-Cari0pNg.js → slashCommandParsing-BfanVchF.js} +0 -0
  870. /package/dist/chunks/{sleep-8Eb9j_Ly.js → sleep-C6koP5Ka.js} +0 -0
  871. /package/dist/chunks/{src-x7u_sB6m.js → src-BWpNn6Yz.js} +0 -0
  872. /package/dist/chunks/{src-BRAdBA8A.js → src-C-Ho8kYe.js} +0 -0
  873. /package/dist/chunks/{src-BlLavFUS.js → src-Cu58IYYb.js} +0 -0
  874. /package/dist/chunks/{src-CI_jaaBj.js → src-d2UJ68oX.js} +0 -0
  875. /package/dist/chunks/{state-Ce1HlR-H.js → state-BiRT9RAF.js} +0 -0
  876. /package/dist/chunks/{staticRender-Br64h1E1.js → staticRender-C5v46np_.js} +0 -0
  877. /package/dist/chunks/{stdio-D4cT86R0.js → stdio-Oy68T2eE.js} +0 -0
  878. /package/dist/chunks/{store-DhI7Lcan.js → store-DYC8zeL1.js} +0 -0
  879. /package/dist/chunks/{subprocessEnv-DV6q6o6w.js → subprocessEnv-DIeTJ-xE.js} +0 -0
  880. /package/dist/chunks/{systemPromptSections-BcN_XBTx.js → systemPromptSections-DY7epA2Y.js} +0 -0
  881. /package/dist/chunks/{systemTheme-dDbitcxB.js → systemTheme-eRWGHYSL.js} +0 -0
  882. /package/dist/chunks/{teammate-DMYOtLTK.js → teammate-CbskW5G9.js} +0 -0
  883. /package/dist/chunks/{types-RJTEOuIt.js → types-C0nqJFkV.js} +0 -0
  884. /package/dist/chunks/{useKeybinding-FsOnjW6T.js → useKeybinding-DPOUuymz.js} +0 -0
  885. /package/dist/chunks/{workSecret-qRMNrQy2.js → workSecret-DJu7k30X.js} +0 -0
  886. /package/dist/chunks/{worktreeModeEnabled-Db6b_Iy_.js → worktreeModeEnabled-KtHEqeFA.js} +0 -0
  887. /package/dist/chunks/{xdg-CBxMmQux.js → xdg-BFD9ydDV.js} +0 -0
@@ -0,0 +1,11 @@
1
+ import{a as e,n as t,o as n,r}from"./chunk-DR8-3Aex.js";import{s as i,u as a}from"./envUtils-BWeoiL4Y.js";import{n as o,t as s}from"./figures-gfT9mM8P.js";import{B as c,Cn as l,F as u,Ft as d,In as f,Ln as p,Lt as m,Rn as h,W as g,b as _,m as v,t as y,v as b,x,y as S}from"./src-Di342QoJ.js";import{t as C}from"./jsx-runtime-D-D469L8.js";import{L as w,W as ee,cn as T,y as E}from"./state-sIHsFpDu.js";import{Bc as D,Cc as O,Fo as k,Gt as te,Ht as A,Io as ne,Ka as re,Lr as j,Pr as M,Ps as N,S as P,Uc as F,Ur as I,dc as L,dn as ie,g as R,js as ae,on as oe,oo as se,qt as ce,yc as z}from"./paths-DO4WOQtD.js";import{d as le,l as ue,o as B,p as de,u as fe}from"./debug-otxXY3j-.js";import{n as pe,r as me}from"./analytics-DqMQntaB.js";import{n as V,t as he}from"./cwd--iizewsn.js";import{a as ge,n as _e}from"./env-C2A9gV_G.js";import{H as ve,V as ye,W as be,et as xe}from"./log-DSV4Ht5l.js";import{C as Se,g as Ce,m as we,n as Te,r as Ee,t as De,x as Oe}from"./startupProfiler-CAntGAbs.js";import{l as ke,o as Ae}from"./stringUtils-KZoO4GUd.js";import{n as je,t as Me}from"./sleep-C6koP5Ka.js";import{$h as Ne,Ax as Pe,Bu as Fe,CS as Ie,CT as Le,C_ as Re,DT as ze,Do as Be,Du as Ve,FA as He,Fo as Ue,Gx as We,Ho as Ge,Io as Ke,Iu as qe,Kk as Je,Ko as Ye,Lo as Xe,Lu as Ze,MA as Qe,Ms as $e,OT as et,Oo as tt,Ox as nt,Po as rt,Px as it,Qh as at,Qk as ot,Ro as st,Rs as ct,Ru as lt,ST as ut,Sb as dt,TS as ft,TT as pt,Tj as mt,Uo as ht,Vu as gt,Vw as _t,Wx as vt,Xk as yt,Xv as bt,Yk as xt,Zo as St,Zv as Ct,a_ as wt,as as Tt,eg as Et,es as Dt,f_ as Ot,gS as kt,ho as At,lC as jt,lo as Mt,mS as Nt,nO as Pt,ng as Ft,no as It,o_ as Lt,pS as Rt,p_ as zt,rO as Bt,ro as Vt,tg as Ht,to as Ut,ts as Wt,uC as Gt,uo as Kt,wT as qt,w_ as Jt,xT as Yt,xj as Xt,yT as Zt,zu as Qt,zw as $t,zx as en}from"./loadAgentsDir-ClTeo0nk.js";import{Qn as tn,Xn as nn}from"./prompt-CfM_xGPc.js";import{f as rn,p as an}from"./xml-CTdKuU6f.js";import{C as on,y as sn}from"./rcDebugLog-CwU_wJBE.js";import{n as cn,r as ln,t as un}from"./browser-Bt-ckCaU.js";import{t as dn}from"./useTerminalSize-Du-EamDN.js";import{d as fn,f as pn,h as mn,p as hn}from"./terminalSetup-hLCi-2uB.js";import{n as gn,t as _n}from"./SentryErrorBoundary-97iY7Nb7.js";import{a as vn,n as yn}from"./voiceModeEnabled-BD9GZhQ3.js";import{a as bn,o as xn,r as Sn,s as Cn,t as wn}from"./referral-Da4mpbd3.js";import{c as Tn,r as En}from"./releaseNotes-BPA229-J.js";import{a as Dn,c as On,d as kn,i as An,l as jn,n as Mn,o as Nn,r as Pn,t as Fn,u as In}from"./logoV2Utils-DAIIwt5R.js";import{n as Ln,t as Rn}from"./systemTheme-eRWGHYSL.js";import{n as zn,r as Bn}from"./PromptInputFooterSuggestions-DhIQ0Nge.js";import{n as Vn,t as Hn}from"./useMainLoopModel-CEqP4HOc.js";import{n as Un,t as Wn}from"./modalContext-c5Yqx_CQ.js";import{i as Gn,n as Kn,r as qn,s as Jn,t as Yn}from"./OverageCreditUpsell-DnFv5z-z.js";import{n as Xn,r as Zn,t as Qn}from"./statusNoticeHelpers-DuqyBY-N.js";import{homedir as $n}from"os";import{relative as er}from"path";import{fileURLToPath as tr}from"url";function nr(e,t){for(let n of e)if(!t.has(n))return!1;return!0}var rr=t((()=>{}));function ir(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 ar(e,t){if(!ft()||t)return e;let n=[],r=0;for(;r<e.length;){let t=e[r];if(ir(t)){let i=0;for(;r<e.length&&ir(e[r]);)i++,r++;i===1?n.push(t):n.push({...t,message:{role:`user`,content:[{type:`text`,text:`<${be}><${ye}>completed</${ye}><${ve}>${i} background commands completed</${ve}></${be}>`}]}})}else n.push(t),r++}return n}var or=t((()=>{xe(),Ve(),Ie(),ht()}));function sr(e){return e.type===`system`&&e.subtype===`stop_hook_summary`&&e.hookLabel!==void 0}function cr(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(sr(r)){let i=r.hookLabel,a=[];for(;n<e.length;){let t=e[n];if(!sr(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 lr=t((()=>{}));function ur(e){return e.type===`attachment`&&e.attachment.type===`task_status`&&e.attachment.taskType===`in_process_teammate`&&e.attachment.status===`completed`}function dr(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(ur(r)){let i=0;for(;n<e.length&&ur(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 fr=t((()=>{}));function pr(e){let t=gr.get(e);return t||(t=new Set(e.filter(e=>e.renderGroupedToolUse).map(e=>e.name)),gr.set(e,t)),t}function mr(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 hr(e,t,n=!1){if(n)return{messages:e};let r=pr(t),i=new Map;for(let t of e){let e=mr(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=mr(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=mr(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 gr,_r=t((()=>{gr=new WeakMap}));function vr(e){let t=wr.get(e);if(t!==void 0)return t;let n=yr(e).toLowerCase();return wr.set(e,n),n}function yr(e){let t=``;switch(e.type){case`user`:{let n=e.message.content;if(typeof n==`string`)t=Cr.has(n)?``:n;else{let r=[];for(let t of n??[])t.type===`text`?Cr.has(t.text)||r.push(t.text):t.type===`tool_result`&&r.push(xr(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`?[br(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(Sr,r);if(e<0)break;n=n.slice(0,r)+n.slice(e+18),r=n.indexOf(`<system-reminder>`)}return n}function br(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 xr(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 Sr,Cr,wr,Tr=t((()=>{ht(),Sr=`</system-reminder>`,Cr=new Set([It,Vt]),wr=new WeakMap}));function Er({pose:e=`default`}={}){if(_e.terminal===`Apple_Terminal`)return(0,H.jsx)(Dr,{pose:e});let t=Or[e];return(0,H.jsxs)(x,{flexDirection:`column`,children:[(0,H.jsxs)(_,{children:[(0,H.jsx)(_,{color:`clawd_body`,children:t.r1L}),(0,H.jsx)(_,{color:`clawd_body`,backgroundColor:`clawd_background`,children:t.r1E}),(0,H.jsx)(_,{color:`clawd_body`,children:t.r1R})]}),(0,H.jsxs)(_,{children:[(0,H.jsx)(_,{color:`clawd_body`,children:t.r2L}),(0,H.jsx)(_,{color:`clawd_body`,backgroundColor:`clawd_background`,children:`█████`}),(0,H.jsx)(_,{color:`clawd_body`,children:t.r2R})]}),(0,H.jsxs)(_,{color:`clawd_body`,children:[` `,`▘▘ ▝▝`,` `]})]})}function Dr({pose:e}){return(0,H.jsxs)(x,{flexDirection:`column`,alignItems:`center`,children:[(0,H.jsxs)(_,{children:[(0,H.jsx)(_,{color:`clawd_body`,children:`▗`}),(0,H.jsx)(_,{color:`clawd_background`,backgroundColor:`clawd_body`,children:kr[e]}),(0,H.jsx)(_,{color:`clawd_body`,children:`▖`})]}),(0,H.jsx)(_,{backgroundColor:`clawd_body`,children:` `.repeat(7)}),(0,H.jsx)(_,{color:`clawd_body`,children:`▘▘ ▝▝`})]})}var H,Or,kr,Ar=t((()=>{h(),y(),ge(),H=C(),Or={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:`▛ `}},kr={default:` ▗ ▖ `,"look-left":` ▘ ▘ `,"look-right":` ▝ ▝ `,"arms-up":` ▗ ▖ `}}));function jr(e){let{title:t,lines:n,footer:r,emptyMessage:i,customContent:a}=e,o=l(t);if(a!==void 0)o=Math.max(o,a.width);else if(n.length===0&&i)o=Math.max(o,l(i));else{let e=Math.max(0,...n.map(e=>e.timestamp?l(e.timestamp):0));for(let t of n){let n=e>0?e:0,r=l(t.text)+(n>0?n+2:0);o=Math.max(o,r)}}return r&&(o=Math.max(o,l(r))),o}function Mr({config:e,actualWidth:t}){let{title:n,lines:r,footer:i,emptyMessage:a,customContent:o}=e,s=Math.max(0,...r.map(e=>e.timestamp?l(e.timestamp):0));return(0,U.jsxs)(x,{flexDirection:`column`,width:t,children:[(0,U.jsx)(_,{bold:!0,color:`claude`,children:n}),o?(0,U.jsxs)(U.Fragment,{children:[o.content,i&&(0,U.jsx)(_,{dimColor:!0,italic:!0,children:Se(i,t)})]}):r.length===0&&a?(0,U.jsx)(_,{dimColor:!0,children:Se(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)(_,{children:[s>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(_,{dimColor:!0,children:(e.timestamp||``).padEnd(s)}),` `]}),(0,U.jsx)(_,{children:Se(e.text,r)})]},n)}),i&&(0,U.jsx)(_,{dimColor:!0,italic:!0,children:Se(i,t)})]})]})}var U,Nr=t((()=>{h(),y(),Oe(),U=C()}));function Pr({feeds:e,maxWidth:t}){let n=e.map(e=>jr(e)),r=Math.max(...n),i=Math.min(r,t);return(0,Ir.jsx)(x,{flexDirection:`column`,children:e.map((t,n)=>(0,Ir.jsxs)(Fr.Fragment,{children:[(0,Ir.jsx)(Mr,{config:t,actualWidth:i}),n<e.length-1&&(0,Ir.jsx)(v,{color:`claude`,width:i})]},n))})}var Fr,Ir,Lr=t((()=>{Fr=n(h(),1),y(),Nr(),Ir=C()}));function Rr(e){let t=e.map(e=>{let t=Ce(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 zr(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 Br(e){let t=e.filter(({isEnabled:e})=>e).sort((e,t)=>Number(e.isComplete)-Number(t.isComplete)).map(({text:e,isComplete:t})=>({text:`${t?`${s.tick} `:``}${e}`})),n=he()===$n()?`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 Vr(){let e=bn(),t=e?`Share Claude Code and earn ${Sn(e)} of extra usage`:`Share Claude Code with friends`;return{title:`3 guest passes`,lines:[],customContent:{content:(0,Hr.jsxs)(Hr.Fragment,{children:[(0,Hr.jsx)(x,{marginY:1,children:(0,Hr.jsx)(_,{color:`claude`,children:`[✻] [✻] [✻]`})}),(0,Hr.jsx)(_,{dimColor:!0,children:t})]}),width:48},footer:`/passes`}}var Hr,Ur=t((()=>{o(),y(),Cn(),V(),Oe(),Hr=C()}));function Wr(e,t,n){return Array.from({length:n},()=>({pose:e,offset:t}))}function Gr(){let{pose:e,bounceOffset:t,onClick:n}=Kr();return(0,Jr.jsx)(x,{height:ei,flexDirection:`column`,onClick:n,children:(0,Jr.jsx)(x,{marginTop:t,flexShrink:0,children:(0,Jr.jsx)(Er,{pose:e})})})}function Kr(){let[e]=(0,qr.useState)(()=>re().prefersReducedMotion??!1),[t,n]=(0,qr.useState)(-1),r=(0,qr.useRef)(Yr),i=()=>{e||t!==-1||(r.current=Xr[Math.floor(Math.random()*Xr.length)],n(0))};(0,qr.useEffect)(()=>{if(t===-1)return;if(t>=r.current.length){n(-1);return}let e=setTimeout(n,Qr,$r);return()=>clearTimeout(e)},[t]);let a=r.current,o=t>=0&&t<a.length?a[t]:Zr;return{pose:o.pose,bounceOffset:o.offset,onClick:i}}var qr,Jr,Yr,Xr,Zr,Qr,$r,ei,ti=t((()=>{h(),qr=n(h(),1),y(),se(),Ar(),Jr=C(),Yr=[...Wr(`default`,1,2),...Wr(`arms-up`,0,3),...Wr(`default`,0,1),...Wr(`default`,1,2),...Wr(`arms-up`,0,3),...Wr(`default`,0,1)],Xr=[Yr,[...Wr(`look-right`,0,5),...Wr(`look-left`,0,5),...Wr(`default`,0,1)]],Zr={pose:`default`,offset:0},Qr=60,$r=e=>e+1,ei=3}));function ni(){let e=xn();e==null||e<=0||e>(L().passesLastSeenRemaining??0)&&O(t=>({...t,passesUpsellSeenCount:0,hasVisitedPasses:!1,passesLastSeenRemaining:e}))}function ri(){let{eligible:e,hasCache:t}=wn();if(!e||!t)return!1;ni();let n=L();return!((n.passesUpsellSeenCount??0)>=3||n.hasVisitedPasses)}function ii(){let[e]=(0,si.useState)(()=>ri());return e}function ai(){let e=0;O(t=>(e=(t.passesUpsellSeenCount??0)+1,{...t,passesUpsellSeenCount:e})),me(`tengu_guest_passes_upsell_shown`,{seen_count:e})}function oi(){let e=bn();return(0,ci.jsxs)(_,{dimColor:!0,children:[(0,ci.jsx)(_,{color:`claude`,children:`[✻]`}),` `,(0,ci.jsx)(_,{color:`claude`,children:`[✻]`}),` `,(0,ci.jsx)(_,{color:`claude`,children:`[✻]`}),` ·`,` `,e?`Share Claude Code and earn ${Sn(e)} of extra usage · /passes`:`3 guest passes at /passes`]})}var si,ci,li=t((()=>{h(),si=n(h(),1),y(),pe(),Cn(),z(),ci=C()}));function ui(){let{columns:e}=u(),t=Gt(e=>e.agent),n=Gt(e=>e.effortValue),r=Vn(),i=I(r),{version:a,cwd:o,billingType:s,agentName:c}=Nn(),d=t??c,f=ii(),p=Jn();(0,di.useEffect)(()=>{f&&ai()},[f]),(0,di.useEffect)(()=>{p&&!f&&qn()},[p,f]);let m=Math.max(e-15,20),h=Se(a,Math.max(m-13,6)),{shouldSplit:g,truncatedModel:v,truncatedBilling:y}=Pn(i+Xt(r,n),s,m),b=d?m-1-l(d)-3:m,S=kn(o,Math.max(b,10));return(0,W.jsx)(Ht,{children:(0,W.jsxs)(x,{flexDirection:`row`,gap:2,alignItems:`center`,children:[ft()?(0,W.jsx)(Gr,{}):(0,W.jsx)(Er,{}),(0,W.jsxs)(x,{flexDirection:`column`,children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(_,{bold:!0,children:`Claude Code`}),` `,(0,W.jsxs)(_,{dimColor:!0,children:[`v`,h]})]}),g?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(_,{dimColor:!0,children:v}),(0,W.jsx)(_,{dimColor:!0,children:y})]}):(0,W.jsxs)(_,{dimColor:!0,children:[v,` · `,y]}),(0,W.jsx)(_,{dimColor:!0,children:d?`@${d} · ${S}`:S}),f&&(0,W.jsx)(oi,{}),!f&&p&&(0,W.jsx)(Yn,{maxWidth:m,twoLine:!0})]})]})})}var di,W,fi=t((()=>{di=n(h(),1),Hn(),dn(),y(),jt(),mt(),Oe(),Ie(),In(),M(),Ft(),ti(),Ar(),li(),Gn(),W=C()}));function pi(){let e=(0,hi.useMemo)(mi,[]),t=(0,hi.useMemo)(()=>L().lastShownEmergencyTip,[]),n=e.tip&&e.tip!==t;return(0,hi.useEffect)(()=>{n&&O(t=>t.lastShownEmergencyTip===e.tip?t:{...t,lastShownEmergencyTip:e.tip})},[n,e.tip]),n?(0,gi.jsx)(x,{paddingLeft:2,flexDirection:`column`,children:(0,gi.jsx)(_,{...e.color===`warning`?{color:`warning`}:e.color===`error`?{color:`error`}:{dimColor:!0},children:e.tip})}):null}function mi(){return R(_i,vi)}var hi,gi,_i,vi,yi=t((()=>{h(),hi=n(h(),1),y(),P(),z(),gi=C(),_i=`tengu-top-of-feed-tip`,vi={tip:``,color:`dim`}}));function bi({char:e=`✻`}){let[t]=(0,xi.useState)(()=>re().prefersReducedMotion??!1),[n,r]=(0,xi.useState)(t),i=(0,xi.useRef)(null),[a,o]=c(n?null:50);return(0,xi.useEffect)(()=>{if(n)return;let e=setTimeout(r,wi,!0);return()=>clearTimeout(e)},[n]),n?(0,Si.jsx)(x,{ref:a,children:(0,Si.jsx)(_,{color:Ti,children:e})}):(i.current===null&&(i.current=o),(0,Si.jsx)(x,{ref:a,children:(0,Si.jsx)(_,{color:kt(Rt((o-i.current)/Ci*360%360)),children:e})}))}var xi,Si,Ci,wi,Ti,Ei=t((()=>{h(),xi=n(h(),1),N(),y(),se(),Nt(),Si=C(),Ci=1500,wi=Ci*2,Ti=kt({r:153,g:153,b:153})}));function Di(){return j()&&(L().opus1mMergeNoticeSeenCount??0)<ji}function Oi(){let[e]=(0,ki.useState)(Di);return(0,ki.useEffect)(()=>{if(!e)return;let t=(L().opus1mMergeNoticeSeenCount??0)+1;O(e=>(e.opus1mMergeNoticeSeenCount??0)>=t?e:{...e,opus1mMergeNoticeSeenCount:t})},[e]),e?(0,Ai.jsxs)(x,{paddingLeft:2,children:[(0,Ai.jsx)(bi,{char:`↑`}),(0,Ai.jsx)(_,{dimColor:!0,children:` Opus now defaults to 1M context · 5x more room, same pricing`})]}):null}var ki,Ai,ji,Mi=t((()=>{h(),ki=n(h(),1),N(),y(),z(),M(),Ei(),Ai=C(),ji=6}));function Ni(){return(0,Ii.jsx)(Pi,{})}function Pi(){let[e]=(0,Fi.useState)(()=>vn()&&re().voiceEnabled!==!0&&(L().voiceNoticeSeenCount??0)<Li&&!Di());return(0,Fi.useEffect)(()=>{if(!e)return;let t=(L().voiceNoticeSeenCount??0)+1;O(e=>(e.voiceNoticeSeenCount??0)>=t?e:{...e,voiceNoticeSeenCount:t})},[e]),e?(0,Ii.jsxs)(x,{paddingLeft:2,children:[(0,Ii.jsx)(bi,{}),(0,Ii.jsx)(_,{dimColor:!0,children:` Voice mode is now available · /voice to enable`})]}):null}var Fi,Ii,Li,Ri=t((()=>{h(),Fi=n(h(),1),y(),z(),se(),yn(),Ei(),Mi(),Ii=C(),Li=3}));function zi(){return null}var Bi=t((()=>{}));function Vi(){return null}var Hi=t((()=>{})),Ui=r({ChannelsNotice:()=>Wi,findUnmatched:()=>Ki});function Wi(){let[{channels:e,list:t,unmatched:n}]=(0,qi.useState)(()=>{let e=E();return e.length===0?{channels:e,list:``,unmatched:[]}:{channels:e,list:e.map(Gi).join(`, `),unmatched:Ki(e)}});if(e.length===0)return null;let r=e.some(e=>!e.dev),i=w()&&r?`Channels`:w()?`--dangerously-load-development-channels`:`--channels`;return(0,Ji.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,Ji.jsxs)(_,{color:`error`,children:[`Listening for channel messages from: `,t]}),(0,Ji.jsxs)(_,{dimColor:!0,children:[`Experimental · inbound messages will be pushed into this session, this carries prompt injection risks. Restart Claude Code without `,i,` to disable.`]}),n.map(e=>(0,Ji.jsxs)(_,{color:`warning`,children:[Gi(e.entry),` · `,e.why]},`${Gi(e.entry)}:${e.why}`))]})}function Gi(e){return e.kind===`plugin`?`plugin:${e.name}@${e.marketplace}`:`server:${e.name}`}function Ki(e,t){let n=t?.configuredServerNames??(()=>{let e=[`enterprise`,`user`,`project`,`local`],t=new Set;for(let n of e)for(let e of Object.keys($t(n).servers))t.add(e);return t})(),r=t?.installedPluginIds??(()=>{let e=new Set(Object.keys(ct().plugins)),t=rn();for(let n of[...t.enabled,...t.disabled])e.add(n.source);return e})(),i=[];for(let t of e){if(t.kind===`server`){n.has(t.name)||i.push({entry:t,why:`no MCP server configured with that name`});continue}r.has(`${t.name}@${t.marketplace}`)||i.push({entry:t,why:`plugin not installed`})}return i}var qi,Ji,Yi=t((()=>{h(),qi=n(h(),1),T(),an(),y(),_t(),$e(),Ji=C()}));function Xi(){let e=On(),t=L().oauthAccount?.displayName??``,{columns:n}=u(),r=mn(),i=Qe.isSandboxingEnabled(),o=ii(),s=Jn(),c=Gt(e=>e.agent),d=Gt(e=>e.effortValue),f=L(),p;try{p=jn(3)}catch{p=[]}let[m]=(0,Zi.useState)(()=>{let e=re().companyAnnouncements;if(!(!e||e.length===0))return f.numStartups===1?e[0]:e[Math.floor(Math.random()*e.length)]}),{hasReleaseNotes:h}=En(f.lastReleaseNotesSeen);(0,Zi.useEffect)(()=>{L().lastReleaseNotesSeen!==`2.7.2`&&(O(e=>e.lastReleaseNotesSeen===`2.7.2`?e:{...e,lastReleaseNotesSeen:`2.7.2`}),r&&pn())},[f,r]);let g=!h&&!r&&!a(process.env.CLAUDE_CODE_FORCE_FULL_LOGO);(0,Zi.useEffect)(()=>{o&&!r&&!g&&ai()},[o,r,g]),(0,Zi.useEffect)(()=>{s&&!r&&!o&&!g&&qn()},[s,r,o,g]);let v=Vn(),y=I(v),{version:S,cwd:C,billingType:w,agentName:ee}=Nn(),T=c??ee,E=Se(y+Xt(v,d),$i-20);if(!h&&!r&&!a(process.env.CLAUDE_CODE_FORCE_FULL_LOGO))return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(ui,{}),(0,G.jsx)(Ni,{}),(0,G.jsx)(Oi,{}),Qi&&(0,G.jsx)(Qi.ChannelsNotice,{}),fe()&&(0,G.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(_,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(_,{dimColor:!0,children:[`Logging to: `,le()?`stderr`:B()]})]}),(0,G.jsx)(pi,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,G.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(_,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,G.jsx)(_,{dimColor:!0,children:process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),m&&(0,G.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&f.oauthAccount?.organizationName&&(0,G.jsxs)(_,{dimColor:!0,children:[`Message from `,f.oauthAccount.organizationName,`:`]}),(0,G.jsx)(_,{children:m})]}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsx)(x,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(_,{dimColor:!0,children:`Use /issue to report model behavior issues`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(_,{color:`warning`,children:`[ANT-ONLY] Logs:`}),(0,G.jsxs)(_,{dimColor:!0,children:[`API calls: `,D(Pt())]}),(0,G.jsxs)(_,{dimColor:!0,children:[`Debug logs: `,D(B())]}),Ee()&&(0,G.jsxs)(_,{dimColor:!0,children:[`Startup Perf: `,D(De())]})]}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(zi,{}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Vi,{})]});let k=Dn(n),te=Ln(L().theme),A=` ${b(`claude`,te)(`Claude Code`)} ${b(`inactive`,te)(`v${S}`)} `,ne=b(`claude`,te)(` Claude Code `);if(k===`compact`){let e=An(t);l(e)>n-4&&(e=An(null));let r=T?n-4-1-l(T)-3:n-4,a=kn(C,Math.max(r,10));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Ht,{children:(0,G.jsxs)(x,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:ne,position:`top`,align:`start`,offset:1},paddingX:1,paddingY:1,alignItems:`center`,width:n,children:[(0,G.jsx)(_,{bold:!0,children:e}),(0,G.jsx)(x,{marginY:1,children:(0,G.jsx)(Er,{})}),(0,G.jsx)(_,{dimColor:!0,children:E}),(0,G.jsx)(_,{dimColor:!0,children:w}),(0,G.jsx)(_,{dimColor:!0,children:T?`@${T} · ${a}`:a})]})}),(0,G.jsx)(Ni,{}),(0,G.jsx)(Oi,{}),Qi&&(0,G.jsx)(Qi.ChannelsNotice,{}),i&&(0,G.jsx)(x,{marginTop:1,flexDirection:`column`,children:(0,G.jsx)(_,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(zi,{}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Vi,{})]})}let j=An(t),M=!process.env.IS_DEMO&&f.oauthAccount?.organizationName?`${E} · ${w} · ${f.oauthAccount.organizationName}`:`${E} · ${w}`,N=T?$i-1-l(T)-3:$i,P=kn(C,Math.max(N,10)),F=T?`@${T} · ${P}`:P,{leftWidth:ie,rightWidth:R}=Fn(n,k,Mn(j,F,M));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Ht,{children:(0,G.jsx)(x,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:A,position:`top`,align:`start`,offset:3},children:(0,G.jsxs)(x,{flexDirection:k===`horizontal`?`row`:`column`,paddingX:1,gap:1,children:[(0,G.jsxs)(x,{flexDirection:`column`,width:ie,justifyContent:`space-between`,alignItems:`center`,minHeight:9,children:[(0,G.jsx)(x,{marginTop:1,children:(0,G.jsx)(_,{bold:!0,children:j})}),(0,G.jsx)(Er,{}),(0,G.jsxs)(x,{flexDirection:`column`,alignItems:`center`,children:[(0,G.jsx)(_,{dimColor:!0,children:M}),(0,G.jsx)(_,{dimColor:!0,children:F})]})]}),k===`horizontal`&&(0,G.jsx)(x,{height:`100%`,borderStyle:`single`,borderColor:`claude`,borderDimColor:!0,borderTop:!1,borderBottom:!1,borderLeft:!1}),k===`horizontal`&&(0,G.jsx)(Pr,{feeds:r?[Br(fn()),Rr(e)]:o?[Rr(e),Vr()]:s?[Rr(e),Kn()]:[Rr(e),zr(p)],maxWidth:R})]})})}),(0,G.jsx)(Ni,{}),(0,G.jsx)(Oi,{}),Qi&&(0,G.jsx)(Qi.ChannelsNotice,{}),fe()&&(0,G.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(_,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(_,{dimColor:!0,children:[`Logging to: `,le()?`stderr`:B()]})]}),(0,G.jsx)(pi,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,G.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(_,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,G.jsx)(_,{dimColor:!0,children:process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),m&&(0,G.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&f.oauthAccount?.organizationName&&(0,G.jsxs)(_,{dimColor:!0,children:[`Message from `,f.oauthAccount.organizationName,`:`]}),(0,G.jsx)(_,{children:m})]}),i&&(0,G.jsx)(x,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(_,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsx)(x,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(_,{dimColor:!0,children:`Use /issue to report model behavior issues`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(_,{color:`warning`,children:`[ANT-ONLY] Logs:`}),(0,G.jsxs)(_,{dimColor:!0,children:[`API calls: `,D(Pt())]}),(0,G.jsxs)(_,{dimColor:!0,children:[`Debug logs: `,D(B())]}),Ee()&&(0,G.jsxs)(_,{dimColor:!0,children:[`Startup Perf: `,D(De())]})]}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(zi,{}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Vi,{})]})}var Zi,G,Qi,$i,ea=t((()=>{h(),y(),dn(),In(),Oe(),F(),Ar(),Lr(),Ur(),z(),Rn(),se(),ue(),Zi=n(h(),1),hn(),fi(),Ft(),Tn(),Bt(),i(),Te(),yi(),Ri(),Mi(),Bi(),Hi(),G=C(),He(),li(),Gn(),jt(),mt(),Hn(),M(),Qi=(Yi(),e(Ui)),$i=50}));function ta({message:e,isTranscriptMode:t}){let n=e.message?.content,r=Array.isArray(n)?n:[];if(!(t&&e.type===`assistant`&&e.message?.model&&r.some(e=>e?.type===`text`)))return null;let i=e.message.model;return(0,na.jsx)(x,{minWidth:l(i)+8,children:(0,na.jsx)(_,{dimColor:!0,children:i})})}var na,ra=t((()=>{h(),y(),na=C()}));function ia({message:e,isTranscriptMode:t}){if(!(t&&e.timestamp&&e.type===`assistant`&&Array.isArray(e.message.content)&&e.message.content.some(e=>e.type===`text`)))return null;let n=new Date(e.timestamp).toLocaleTimeString(`en-US`,{hour:`2-digit`,minute:`2-digit`,hour12:!0});return(0,aa.jsx)(x,{minWidth:l(n),children:(0,aa.jsx)(_,{dimColor:!0,children:n})})}var aa,oa=t((()=>{h(),y(),aa=C()}));function sa(e,t,n,r){for(let i=t+1;i<e.length;i++){let t=e[i];if(t?.type===`assistant`){let e=ma(t.message.content);if(e?.type===`thinking`||e?.type===`redacted_thinking`||e?.type===`tool_use`&&(lt(e.name,e.input,n).isCollapsible||r.has(e.id)))continue;return!0}if(!(t?.type===`system`||t?.type===`attachment`)&&!(t?.type===`user`&&ma(t.message.content)?.type===`tool_result`)){if(t?.type===`grouped_tool_use`){let e=ma(t.messages[0]?.message.content)?.input;if(lt(t.toolName,e,n).isCollapsible)continue}return!0}}return!1}function ca({message:e,isUserContinuation:t,hasContentAfter:n,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,streamingToolUseIDs:s,screen:c,canAnimate:l,onOpenRateLimitOptions:u,lastThinkingBlockId:d,latestBashOutputUUID:f,columns:p,isLoading:m,lookups:h,shouldCollapseDiffs:g}){let _=c===`transcript`,v=e.type===`grouped_tool_use`,y=e.type===`collapsed_read_search`,b=y&&(Fe(e,o)||m&&!n),S=v?e.displayMessage:y?Ze(e):e,C=v||y?[]:Ue(e,h),w=Mo(e,s,o,v||y?Ut:Ke(e,h),c,h),ee=!1;if(l)if(v)ee=e.messages.some(e=>{let t=ma(e.message.content);return t?.type===`tool_use`&&o.has(t.id)});else if(y)ee=Fe(e,o);else{let t=Xe(e);ee=!t||o.has(t)}let T=_&&S.type===`assistant`&&Array.isArray(S.message.content)&&S.message.content.some(e=>e.type===`text`)&&(S.timestamp||S.message.model),E=(0,pa.jsx)(at,{message:e,lookups:h,addMargin:!T,containerWidth:T?void 0:p,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,progressMessagesForMessage:C,shouldAnimate:ee,shouldShowDot:!0,isTranscriptMode:_,isStatic:w,onOpenRateLimitOptions:u,isActiveCollapsedGroup:b,isUserContinuation:t,lastThinkingBlockId:d,latestBashOutputUUID:f,shouldCollapseDiffs:g});return T?(0,pa.jsx)(Ht,{children:(0,pa.jsxs)(x,{width:p,flexDirection:`column`,children:[(0,pa.jsxs)(x,{flexDirection:`row`,justifyContent:`flex-end`,gap:1,marginTop:1,children:[(0,pa.jsx)(ia,{message:S,isTranscriptMode:_}),(0,pa.jsx)(ta,{message:S,isTranscriptMode:_})]}),E]})}):(0,pa.jsx)(Ht,{children:E})}function la(e,t){if(e.type===`grouped_tool_use`)return e.messages.some(e=>{let n=ma(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return Qt(e).some(e=>t.has(e));let n=Xe(e);return!!n&&t.has(n)}function ua(e,t){if(e.type===`grouped_tool_use`)return e.messages.every(e=>{let n=ma(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return Qt(e).every(e=>t.has(e));if(e.type===`assistant`){let n=ma(e.message.content);if(n?.type===`server_tool_use`)return t.has(n.id)}let n=Xe(e);return!n||t.has(n)}function da(e,t){if(e.message!==t.message||e.screen!==t.screen||e.verbose!==t.verbose||e.message.type===`collapsed_read_search`&&t.screen!==`transcript`||e.columns!==t.columns||e.latestBashOutputUUID===e.message.uuid!=(t.latestBashOutputUUID===t.message.uuid)||e.lastThinkingBlockId!==t.lastThinkingBlockId&&Ne(t.message))return!1;let n=la(e.message,e.streamingToolUseIDs),r=ua(e.message,e.lookups.resolvedToolUseIDs);return!(n||!r)}var fa,pa,ma,ha,ga=t((()=>{fa=n(h(),1),y(),gt(),ht(),Et(),pa=C(),ra(),Uo(),oa(),Ft(),ma=e=>{if(!Array.isArray(e))return;let t=e[0];if(!(t==null||typeof t==`string`))return t},ha=fa.memo(ca,da)}));function _a(e){return e.type===`attachment`&&va.has(e.attachment.type)}var va,ya=t((()=>{va=new Set(`hook_success.hook_additional_context.hook_cancelled.command_permissions.agent_mention.budget_usd.critical_system_reminder.edited_image_file.edited_text_file.opened_file_in_ide.output_style.plan_mode.plan_mode_exit.plan_mode_reentry.structured_output.team_context.todo_reminder.context_efficiency.deferred_tools_delta.mcp_instructions_delta.companion_intro.token_usage.ultrathink_effort.max_turns_reached.task_reminder.auto_mode.auto_mode_exit.output_token_usage.verify_plan_reminder.current_session_memory.compaction_reminder.date_change`.split(`.`))}));function ba(e){return Da.filter(t=>t.isActive(e))}var K,xa,Sa,Ca,wa,Ta,Ea,Da,Oa=t((()=>{y(),h(),ot(),o(),V(),Oe(),oe(),Zn(),Pe(),vt(),K=C(),xa={id:`large-memory-files`,type:`warning`,isActive:e=>xt(e.memoryFiles).length>0,render:e=>(0,K.jsx)(K.Fragment,{children:xt(e.memoryFiles).map(e=>{let t=e.path.startsWith(he())?er(he(),e.path):e.path;return(0,K.jsxs)(x,{flexDirection:`row`,children:[(0,K.jsx)(_,{color:`warning`,children:s.warning}),(0,K.jsxs)(_,{color:`warning`,children:[`Large `,(0,K.jsx)(_,{bold:!0,children:t}),` will impact performance (`,we(e.content.length),` chars > `,we(Je),`)`,(0,K.jsx)(_,{dimColor:!0,children:` · /memory to edit`})]})]},e.path)})})},Sa={id:`claude-ai-external-token`,type:`warning`,isActive:()=>{let e=ce();return ie()&&(e.source===`ANTHROPIC_AUTH_TOKEN`||e.source===`apiKeyHelper`)},render:()=>{let e=ce();return(0,K.jsxs)(x,{flexDirection:`row`,marginTop:1,children:[(0,K.jsx)(_,{color:`warning`,children:s.warning}),(0,K.jsxs)(_,{color:`warning`,children:[`Auth conflict: Using `,e.source,` instead of Claude account subscription token. Either unset`,` `,e.source,", or run `claude /logout`."]})]})}},Ca={id:`api-key-conflict`,type:`warning`,isActive:()=>{let{source:e}=A({skipRetrievingKeyFromApiKeyHelper:!0});return!!te()&&(e===`ANTHROPIC_API_KEY`||e===`apiKeyHelper`)},render:()=>{let{source:e}=A({skipRetrievingKeyFromApiKeyHelper:!0});return(0,K.jsxs)(x,{flexDirection:`row`,marginTop:1,children:[(0,K.jsx)(_,{color:`warning`,children:s.warning}),(0,K.jsxs)(_,{color:`warning`,children:[`Auth conflict: Using `,e,` instead of Anthropic Console key. Either unset `,e,", or run `claude /logout`."]})]})}},wa={id:`both-auth-methods`,type:`warning`,isActive:()=>{let{source:e}=A({skipRetrievingKeyFromApiKeyHelper:!0}),t=ce();return e!==`none`&&t.source!==`none`&&!(e===`apiKeyHelper`&&t.source===`apiKeyHelper`)},render:()=>{let{source:e}=A({skipRetrievingKeyFromApiKeyHelper:!0}),t=ce();return(0,K.jsxs)(x,{flexDirection:`column`,marginTop:1,children:[(0,K.jsxs)(x,{flexDirection:`row`,children:[(0,K.jsx)(_,{color:`warning`,children:s.warning}),(0,K.jsxs)(_,{color:`warning`,children:[`Auth conflict: Both a token (`,t.source,`) and an API key (`,e,`) are set. This may lead to unexpected behavior.`]})]}),(0,K.jsxs)(x,{flexDirection:`column`,marginLeft:3,children:[(0,K.jsxs)(_,{color:`warning`,children:[`· Trying to use `,t.source===`claude.ai`?`claude.ai`:t.source,`?`,` `,e===`ANTHROPIC_API_KEY`?`Unset the ANTHROPIC_API_KEY environment variable, or claude /logout then say "No" to the API key approval before login.`:e===`apiKeyHelper`?`Unset the apiKeyHelper setting.`:`claude /logout`]}),(0,K.jsxs)(_,{color:`warning`,children:[`· Trying to use `,e,`?`,` `,t.source===`claude.ai`?`claude /logout to sign out of claude.ai.`:`Unset the ${t.source} environment variable.`]})]})]})}},Ta={id:`large-agent-descriptions`,type:`warning`,isActive:e=>Xn(e.agentDefinitions)>Qn,render:e=>{let t=Xn(e.agentDefinitions);return(0,K.jsxs)(x,{flexDirection:`row`,children:[(0,K.jsx)(_,{color:`warning`,children:s.warning}),(0,K.jsxs)(_,{color:`warning`,children:[`Large cumulative agent descriptions will impact performance (~`,we(t),` tokens > `,we(Qn),`)`,(0,K.jsx)(_,{dimColor:!0,children:` · /agents to manage`})]})]})}},Ea={id:`jetbrains-plugin-install`,type:`info`,isActive:e=>{if(!it()||!(e.config.autoInstallIdeExtension??!0))return!1;let t=nt();return t!==null&&!We(t)},render:()=>{let e=en(nt());return(0,K.jsxs)(x,{flexDirection:`row`,gap:1,marginLeft:1,children:[(0,K.jsx)(_,{color:`ide`,children:s.arrowUp}),(0,K.jsxs)(_,{children:[`Install the `,(0,K.jsx)(_,{color:`ide`,children:e}),` plugin from the JetBrains Marketplace:`,` `,(0,K.jsx)(_,{bold:!0,children:`https://docs.claude.com/s/claude-code-jetbrains`})]})]})}},Da=[xa,Ta,Sa,Ca,wa,Ea]}));function ka({agentDefinitions:e}={}){let t={config:L(),agentDefinitions:e,memoryFiles:(0,ja.use)(yt())},n=ba(t);return n.length===0?null:(0,Ma.jsx)(x,{flexDirection:`column`,paddingLeft:1,children:n.map(e=>(0,Ma.jsx)(Aa.Fragment,{children:e.render(t)},e.id))})}var Aa,ja,Ma,Na=t((()=>{Aa=n(h(),1),ja=n(h(),1),y(),ot(),z(),Oa(),Ma=C()}));function Pa(e,t,n){let r=(0,q.useRef)(new Map),i=(0,q.useRef)(0),a=(0,q.useRef)(0),o=(0,q.useRef)({arr:new Float64Array,version:-1,n:-1}),s=(0,q.useRef)(new Map),c=(0,q.useRef)(new Map),l=(0,q.useRef)(n),u=(0,q.useRef)(!1),d=(0,q.useRef)(null),f=(0,q.useRef)(0);if(l.current!==n){let e=l.current/n;l.current=n;for(let[t,n]of r.current)r.current.set(t,Math.max(1,Math.round(n*e)));i.current++,u.current=!0,f.current=2}let p=f.current>0?d.current:null,m=(0,q.useRef)(0),h=(0,q.useRef)(null);(0,q.useSyncExternalStore)((0,q.useCallback)(t=>e.current?.subscribe(t)??Ha,[e]),()=>{let t=e.current;if(!t)return NaN;let n=t.getScrollTop()+t.getPendingDelta(),r=Math.floor(n/Ra);return t.isSticky()?~r:r});let g=e.current?.getScrollTop()??-1,_=e.current?.getPendingDelta()??0,v=e.current?.getViewportHeight()??0,y=e.current?.isSticky()??!0;(0,q.useMemo)(()=>{let e=new Set(t),n=!1;for(let t of r.current.keys())e.has(t)||(r.current.delete(t),n=!0);for(let t of c.current.keys())e.has(t)||c.current.delete(t);n&&i.current++},[t]);let b=t.length;if(o.current.version!==i.current||o.current.n!==b){let e=o.current.arr.length>=b+1?o.current.arr:new Float64Array(b+1);e[0]=0;for(let n=0;n<b;n++)e[n+1]=e[n]+(r.current.get(t[n])??Fa);o.current={arr:e,version:i.current,n:b}}let x=o.current.arr,S=x[b],C,w;if(p)[C,w]=p,C=Math.min(C,b),w=Math.min(w,b);else if(v===0||g<0)C=Math.max(0,b-La),w=b;else{if(y){let e=v+Ia;for(C=b;C>0&&S-x[C-1]<e;)C--;w=b}else{let e=m.current,n=v*3,i=Math.min(g,g+_),a=Math.max(g,g+_),o=a-i,c=o>n&&_<0?a-n:i,l=c+Math.min(o,n),u=Math.max(0,c-e),f=l-e,p=u-Ia;{let e=0,t=b;for(;e<t;){let n=e+t>>1;x[n+1]<=p?e=n+1:t=n}C=e}{let e=d.current;if(e&&e[0]<C)for(let n=e[0];n<Math.min(C,e[1]);n++){let e=t[n];if(s.current.has(e)&&!r.current.has(e)){C=n;break}}}let h=v+2*Ia,y=Math.min(b,C+Ba),S=0;for(w=C;w<y&&(S<h||x[w]<f+v+Ia);)S+=r.current.get(t[w])??za,w++}let e=v+2*Ia,n=Math.max(0,w-Ba),i=0;for(let e=C;e<w;e++)i+=r.current.get(t[e])??za;for(;C>n&&i<e;)C--,i+=r.current.get(t[C])??za;let o=d.current,c=Math.abs(g-a.current)+Math.abs(_);if(o&&c>v*2){let[e,t]=o;C<e-Va&&(C=e-Va),w>t+Va&&(w=t+Va),C>w&&(w=Math.min(C+Va,b))}a.current=g}f.current>0?f.current--:d.current=[C,w];let ee=(0,q.useDeferredValue)(C),T=(0,q.useDeferredValue)(w),E=C<ee?ee:C,D=w>T?T:w;if((E>D||y)&&(E=C,D=w),_>0&&(D=w),D-E>Ba){let e=(x[E]+x[D])/2;g-m.current<e?D=E+Ba:E=D-Ba}let O=m.current,k=x[E],te=E===0?0:k+O,A=D===b?1/0:Math.max(k,x[D]-v)+O;(0,q.useLayoutEffect)(()=>{y?e.current?.setClampBounds(void 0,void 0):e.current?.setClampBounds(te,A)}),(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[D];return{range:[E,D],topSpacer:k,bottomSpacer:P,measureRef:ne,spacerRef:h,offsets:x,getItemTop:re,getItemElement:j,getItemHeight:M,scrollToIndex:N}}var q,Fa,Ia,La,Ra,za,Ba,Va,Ha,Ua=t((()=>{q=n(h(),1),Fa=3,Ia=40,La=30,Ra=Ia>>1,za=1,Ba=200,Va=25,Ha=()=>{}}));function Wa({children:e}){let[t,n]=(0,J.useState)(null),[r,i]=(0,J.useState)(null);return(0,Ya.jsx)(Za.Provider,{value:n,children:(0,Ya.jsx)($a.Provider,{value:i,children:(0,Ya.jsx)(Xa.Provider,{value:t,children:(0,Ya.jsx)(Qa.Provider,{value:r,children:e})})})})}function Ga(){return(0,J.useContext)(Xa)}function Ka(){return(0,J.useContext)(Qa)}function qa(e){let t=(0,J.useContext)(Za);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}function Ja(e){let t=(0,J.useContext)($a);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}var J,Ya,Xa,Za,Qa,$a,eo=t((()=>{J=n(h(),1),Ya=C(),Xa=(0,J.createContext)(null),Za=(0,J.createContext)(null),Qa=(0,J.createContext)(null),$a=(0,J.createContext)(null)}));function to(e){let[t,n]=(0,Y.useState)(null),r=(0,Y.useRef)(e);r.current=e;let i=(0,Y.useRef)(null),a=(0,Y.useCallback)(()=>{n(null)},[]),o=(0,Y.useCallback)(e=>{let t=Math.max(0,e.getScrollHeight()-e.getViewportHeight());e.getScrollTop()+e.getPendingDelta()>=t||i.current===null&&(i.current=e.getScrollHeight(),n(r.current))},[]),s=(0,Y.useCallback)(e=>{e&&e.scrollToBottom()},[]);return(0,Y.useEffect)(()=>{t===null?i.current=null:e<t&&(i.current=null,n(null))},[e,t]),{dividerIndex:t,dividerYRef:i,onScrollAway:o,onRepin:a,jumpToNew:s,shiftDivider:(0,Y.useCallback)((e,t)=>{n(t=>t===null?null:t+e),i.current!==null&&(i.current+=t)},[])}}function no(e,t){let n=0,r=!1;for(let i=t;i<e.length;i++){let t=e[i];if(t.type===`progress`||t.type===`assistant`&&!ro(t))continue;let a=t.type===`assistant`;a&&!r&&n++,r=a}return n}function ro(e){if(e.type!==`assistant`||!Array.isArray(e.message.content))return!1;for(let t of e.message.content)if(typeof t!=`string`&&t.type===`text`&&t.text.trim()!==``)return!0;return!1}function io(e,t){if(t===null)return;let n=t;for(;n<e.length&&(e[n]?.type===`progress`||_a(e[n]));)n++;let r=e[n]?.uuid;if(!r)return;let i=no(e,t);return{firstUnseenUuid:r,count:Math.max(1,i)}}function ao({scrollable:e,bottom:t,overlay:n,bottomFloat:r,modal:i,modalScrollRef:a,scrollRef:o,dividerYRef:s,hidePill:c=!1,hideSticky:l=!1,newMessageCount:d=0,onPillClick:f}){let{rows:p,columns:h}=u(),[v,y]=(0,Y.useState)(null),b=(0,Y.useMemo)(()=>({setStickyPrompt:y}),[]),S=(0,Y.useSyncExternalStore)((0,Y.useCallback)(e=>o?.current?.subscribe(e)??(()=>{}),[o]),()=>{let e=o?.current,t=s?.current;return!e||t==null?!1:e.getScrollTop()+e.getPendingDelta()+e.getViewportHeight()<t});if((0,Y.useLayoutEffect)(()=>{if(!ft())return;let e=m.get(process.stdout);if(e)return e.onHyperlinkClick=e=>{if(e.startsWith(`file:`))try{ln(tr(e))}catch{}else cn(e)},()=>{e.onHyperlinkClick=void 0}},[]),ft()){let s=l?null:v,u=s!=null&&s!==`clicked`&&n==null?s:null,m=s!=null&&n==null;return(0,X.jsxs)(Wa,{children:[(0,X.jsx)(x,{flexDirection:`row`,flexGrow:1,overflow:`hidden`,width:`100%`,children:(0,X.jsxs)(x,{flexDirection:`column`,flexGrow:1,width:h,overflow:`hidden`,children:[(0,X.jsxs)(x,{flexGrow:1,flexDirection:`column`,overflow:`hidden`,children:[u&&(0,X.jsx)(so,{text:u.text,onClick:u.scrollTo}),(0,X.jsxs)(g,{ref:o,flexGrow:1,flexDirection:`column`,paddingTop:+!m,stickyScroll:!0,children:[(0,X.jsx)(fo,{value:b,children:e}),n]}),!c&&S&&n==null&&(0,X.jsx)(oo,{count:d,onClick:f}),r!=null&&(0,X.jsx)(x,{position:`absolute`,bottom:0,right:0,opaque:!0,children:r})]}),(0,X.jsxs)(x,{flexDirection:`column`,flexShrink:0,width:`100%`,maxHeight:`50%`,children:[(0,X.jsx)(co,{}),(0,X.jsx)(lo,{}),(0,X.jsx)(x,{flexDirection:`column`,width:`100%`,flexGrow:1,overflowY:`hidden`,children:t})]})]})}),i!=null&&(0,X.jsx)(Wn,{value:{rows:p-uo-1,columns:h-4,scrollRef:a??null},children:(0,X.jsxs)(x,{position:`absolute`,bottom:0,left:0,right:0,maxHeight:p-uo,flexDirection:`column`,overflow:`hidden`,opaque:!0,children:[(0,X.jsx)(x,{flexShrink:0,children:(0,X.jsx)(_,{color:`permission`,children:`▔`.repeat(h)})}),(0,X.jsx)(x,{flexDirection:`column`,paddingX:2,flexShrink:0,overflow:`hidden`,children:i})]})})]})}return(0,X.jsxs)(X.Fragment,{children:[e,t,n,i]})}function oo({count:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(x,{position:`absolute`,bottom:0,left:0,right:0,justifyContent:`center`,children:(0,X.jsx)(x,{onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(_,{backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,dimColor:!0,children:[` `,e>0?`${e} new ${ke(e,`message`)}`:`Jump to bottom`,` `,s.arrowDown,` `]})})})}function so({text:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(x,{flexShrink:0,width:`100%`,height:1,paddingRight:1,backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(_,{color:`subtle`,wrap:`truncate-end`,children:[s.pointer,` `,e]})})}function co(){let e=Ga();return!e||e.suggestions.length===0?null:(0,X.jsx)(x,{position:`absolute`,bottom:`100%`,left:0,right:0,paddingX:2,paddingTop:1,flexDirection:`column`,opaque:!0,children:(0,X.jsx)(zn,{suggestions:e.suggestions,selectedSuggestion:e.selectedSuggestion,maxColumnWidth:e.maxColumnWidth,overlay:!0})})}function lo(){let e=Ka();return e?(0,X.jsx)(x,{position:`absolute`,bottom:`100%`,left:0,right:0,opaque:!0,children:e}):null}var Y,X,uo,fo,po=t((()=>{o(),Y=n(h(),1),Un(),eo(),dn(),y(),un(),Ie(),Ae(),ya(),Bn(),X=C(),uo=2,fo=(0,Y.createContext)({setStickyPrompt:()=>{}})}));function mo(e){let t=So.get(e);if(t!==void 0)return t;let n=vr(e);return So.set(e,n),n}function ho(e){let t=wo.get(e);if(t!==void 0)return t;let n=go(e);return wo.set(e,n),n}function go(e){let t=null;if(e.type===`user`){if(e.isMeta||e.isVisibleInTranscriptOnly)return null;let n=e.message.content[0];if(n?.type!==`text`)return null;t=n.text??null}else if(e.type===`attachment`&&e.attachment.type===`queued_command`&&e.attachment.commandMode!==`task-notification`&&!e.attachment.isMeta){let n=e.attachment.prompt;t=typeof n==`string`?n:n.flatMap(e=>e.type===`text`?[e.text??``]:[]).join(`
11
+ `)}if(t===null)return null;let n=qt(t);return n.startsWith(`<`)||n===``?null:n}function _o({itemKey:e,msg:t,idx:n,measureRef:r,expanded:i,hovered:a,clickable:o,onClickK:s,onEnterK:c,onLeaveK:l,renderItem:u}){return(0,bo.jsx)(x,{ref:r(e),flexDirection:`column`,backgroundColor:i?`userMessageBackgroundHover`:void 0,paddingBottom:i?1:void 0,onClick:o?e=>s(t,e.cellIsBlank):void 0,onMouseEnter:o?()=>c(e):void 0,onMouseLeave:o?()=>l(e):void 0,children:(0,bo.jsx)(S.Provider,{value:a&&!i?`text`:void 0,children:u(t,n)})})}function vo({messages:e,scrollRef:t,columns:n,itemKey:r,renderItem:i,onItemClick:a,isItemClickable:o,isItemExpanded:s,extractSearchText:c=mo,trackStickyPrompt:l,selectedIndex:u,cursorNavRef:d,setCursor:f,jumpRef:p,onSearchMatchesChange:m,scanElement:h,setPositions:g}){let _=(0,Z.useRef)([]),v=(0,Z.useRef)(e),y=(0,Z.useRef)(r);if(y.current!==r||e.length<_.current.length||e[0]!==v.current[0])_.current=e.map(e=>r(e));else for(let t=_.current.length;t<e.length;t++)_.current.push(r(e[t]));v.current=e,y.current=r;let b=_.current,{range:S,topSpacer:C,bottomSpacer:w,measureRef:ee,spacerRef:T,offsets:E,getItemTop:D,getItemElement:O,getItemHeight:k,scrollToIndex:te}=Pa(t,b,n),[A,ne]=S,re=(0,Z.useCallback)(t=>k(t)===0?!1:Le(e[t]),[k,e]);(0,Z.useImperativeHandle)(d,()=>{let n=e=>f?.({uuid:e.uuid,msgType:e.type,expanded:!1,toolName:pt(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:E,start:A,getItemElement:O,getItemTop:D,messages:e,scrollToIndex:te});j.current={offsets:E,start:A,getItemElement:O,getItemTop:D,messages:e,scrollToIndex:te},(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),I=(0,Z.useRef)(0),L=(0,Z.useRef)(()=>{}),ie=(0,Z.useRef)(()=>{}),R=(0,Z.useRef)({matches:[],ptr:0,screenOrd:0,prefixSum:[]}),ae=(0,Z.useRef)(-1),oe=(0,Z.useRef)(!1);function se(e){let t=j.current.getItemTop(e);return Math.max(0,t-xo)}function ce(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),de(`highlight(i=${r}, ord=${a}/${i.length}): pos={row:${o.row},col:${o.col}} lo=${l} screenRow=${d} badge=${h}/${p}`)}ie.current=ce;let[z,le]=(0,Z.useState)(0),ue=(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,de(`seek(i=${n}): no mount after scrollToIndex, skip`),L.current(r?-1:1);return}M.current={idx:n,wantLast:r,tries:i+1},c(n),ue();return}M.current=null,a.scrollTo(Math.max(0,s(n)-xo));let d=h?.(l)??[];if(N.current={msgIdx:n,positions:d},de(`seek(i=${n} t=${i}): ${d.length} positions`),d.length===0){if(++F.current>20){F.current=0;return}L.current(r?-1:1);return}F.current=0;let f=r?d.length-1:0;R.current.screenOrd=f,P.current=-1,ie.current(f);let p=I.current;p&&(I.current=0,L.current(p))},[z]);function B(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(se(e)):o(e),ue()}function fe(e){let t=R.current,{matches:n,prefixSum:r}=t,i=r.at(-1)??0;if(n.length===0)return;if(M.current){I.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,ce(o),P.current=-1;return}let s=(t.ptr+e+n.length)%n.length;if(s===P.current){g?.(null),P.current=-1,de(`step: wraparound at ptr=${s}, all ${n.length} msgs phantoms`);return}t.ptr=s,t.screenOrd=0,B(n[s],e<0);let c=e<0?r[s+1]??i:r[s]+1;m?.(i,c)}L.current=fe,(0,Z.useImperativeHandle)(p,()=>({jumpToIndex:e=>{let n=t.current;n&&n.scrollTo(se(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=ae.current>=0?ae.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)}de(`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?B(r[o],!0):ae.current>=0&&s&&s.scrollTo(ae.current),m?.(a,r.length>0?i[o+1]??a:0)},nextMatch:()=>fe(1),prevMatch:()=>fe(-1),setAnchor:()=>{let e=t.current;e&&(ae.current=e.getScrollTop())},disarmSearch:()=>{g?.(null),M.current=null,N.current={msgIdx:-1,positions:[]},P.current=-1},warmSearchIndex:async()=>{if(oe.current)return 0;let e=j.current.messages,t=0,n=performance.now();for(let n=0;n<e.length;n+=500){await je(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 de(`warmSearchIndex: ${e.length} msgs · work=${Math.round(t)}ms wall=${r}ms chunks=${Math.ceil(e.length/500)}`),oe.current=!0,Math.round(t)}}),[t]);let[pe,me]=(0,Z.useState)(null),V=(0,Z.useRef)({onItemClick:a,setHoveredKey:me});V.current={onItemClick:a,setHoveredKey:me};let he=(0,Z.useCallback)((e,t)=>{let n=V.current;!t&&n.onItemClick&&n.onItemClick(e)},[]),ge=(0,Z.useCallback)(e=>{V.current.setHoveredKey(e)},[]),_e=(0,Z.useCallback)(e=>{V.current.setHoveredKey(t=>t===e?null:t)},[]);return(0,bo.jsxs)(bo.Fragment,{children:[(0,bo.jsx)(x,{ref:T,height:C,flexShrink:0}),e.slice(A,ne).map((e,t)=>{let n=A+t,r=b[n],c=!!a&&(o?.(e)??!0),l=c&&pe===r,u=s?.(e);return(0,bo.jsx)(_o,{itemKey:r,msg:e,idx:n,measureRef:ee,expanded:u,hovered:l,clickable:c,onClickK:he,onEnterK:ge,onLeaveK:_e,renderItem:i},r)}),w>0&&(0,bo.jsx)(x,{height:w,flexShrink:0}),l&&(0,bo.jsx)(yo,{messages:e,start:A,end:ne,offsets:E,getItemTop:D,getItemElement:O,scrollRef:t})]})}function yo({messages:e,start:t,end:n,offsets:r,getItemTop:i,getItemElement:a,scrollRef:o}){let{setStickyPrompt:s}=(0,Z.useContext)(fo);(0,Z.useSyncExternalStore)((0,Z.useCallback)(e=>o.current?.subscribe(e)??To,[o]),()=>{let e=o.current;if(!e)return NaN;let t=e.getScrollTop()+e.getPendingDelta();return e.isSticky()?-1-t:t});let c=o.current?.isSticky()??!0,l=Math.max(0,(o.current?.getScrollTop()??0)+(o.current?.getPendingDelta()??0)),u=t,d=-1;for(let e=n-1;e>=t;e--){let t=i(e);if(t>=0){if(t<l)break;d=t}u=e}let f=-1,p=null;if(u>0&&!c)for(let t=u-1;t>=0;t--){let n=ho(e[t]);if(n===null)continue;let r=i(t);if(!(r>=0&&r+1>=l)){f=t,p=n;break}}let m=d>=0?d-r[u]:0,h=f>=0?Math.max(0,m+r[f]):-1,g=(0,Z.useRef)({idx:-1,tries:0}),_=(0,Z.useRef)(`none`),v=(0,Z.useRef)(-1);return(0,Z.useEffect)(()=>{if(g.current.idx>=0)return;if(_.current===`armed`){_.current=`force`;return}let e=_.current===`force`;if(_.current=`none`,!e&&v.current===f)return;if(v.current=f,p===null){s(null);return}let t=p.trimStart(),n=t.search(/\n\s*\n/),r=(n>=0?t.slice(0,n):t).slice(0,Co).replace(/\s+/g,` `).trim();if(r===``){s(null);return}let i=f,c=h;s({text:r,scrollTo:()=>{s(`clicked`),_.current=`armed`;let e=a(i);e?o.current?.scrollToElement(e,1):(o.current?.scrollTo(c),g.current={idx:i,tries:0})}})}),(0,Z.useEffect)(()=>{if(g.current.idx<0)return;let e=a(g.current.idx);e?(o.current?.scrollToElement(e,1),g.current={idx:-1,tries:0}):++g.current.tries>5&&(g.current={idx:-1,tries:0})}),null}var Z,bo,xo,So,Co,wo,To,Eo=t((()=>{h(),Z=n(h(),1),Ua(),y(),dt(),po(),bo=C(),ue(),Me(),Tr(),ut(),xo=3,So=new WeakMap,Co=500,wo=new WeakMap,To=()=>{}}));function Do(e,t){let n=new Set(t),r=new Set;return e.filter(e=>{if(e.type===`system`)return e.subtype!==`api_metrics`;let t=e.message?.content[0];if(e.type===`assistant`)return e.isApiErrorMessage?!0:t?.type===`tool_use`&&t.name&&n.has(t.name)?(`id`in t&&r.add(t.id),!0):!1;if(e.type===`user`)return t?.type===`tool_result`?t.tool_use_id!==void 0&&r.has(t.tool_use_id):!e.isMeta;if(e.type===`attachment`){let t=e.attachment;return t?.type===`queued_command`&&t.commandMode===`prompt`&&!t.isMeta&&t.origin===void 0}return!1})}function Oo(e,t){let n=new Set(t),r=new Set,i=[],a=0;for(let t=0;t<e.length;t++){let o=e[t],s=o.message?.content[0];if(o.type===`user`&&s?.type!==`tool_result`&&!o.isMeta){a++;continue}o.type===`assistant`&&(s?.type===`text`?i[t]=a:s?.type===`tool_use`&&s.name&&n.has(s.name)&&r.add(a))}return r.size===0?e:e.filter((e,t)=>{let n=i[t];return n===void 0||!r.has(n)})}function ko(e,t,n=zo,r=Bo){let i=t.current,a=i?e.findIndex(e=>e.uuid===i.uuid):-1,o=a>=0?a:i?Math.min(i.idx,Math.max(0,e.length-n)):0;e.length-o>n+r&&(o=e.length-n);let s=e[o];return s&&(i?.uuid!==s.uuid||i.idx!==o)?t.current={uuid:s.uuid,idx:o}:!s&&i&&(t.current=null),o}function Ao(e){return(e.type===`assistant`||e.type===`user`?Xe(e):null)??e.uuid}function jo(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Mo(e,t,n,r,i,a){if(i===`transcript`)return!0;switch(e.type){case`attachment`:case`user`:case`assistant`:{if(e.type===`assistant`){let t=e.message.content[0];if(t?.type===`server_tool_use`)return a.resolvedToolUseIDs.has(t.id)}let i=Xe(e);return i?t.has(i)||n.has(i)||Ge(i,`PostToolUse`,a)?!1:nr(r,a.resolvedToolUseIDs):!0}case`system`:return e.subtype!==`api_error`;case`grouped_tool_use`:return e.messages.every(e=>{let t=e.message.content[0];return t?.type===`tool_use`&&a.resolvedToolUseIDs.has(t.id)});case`collapsed_read_search`:return!1;default:return!0}}var No,Q,$,Po,Fo,Io,Lo,Ro,zo,Bo,Vo,Ho,Uo=t((()=>{p(),gn(),No=n(h(),1),Q=n(h(),1),rr(),T(),N(),dn(),y(),ze(),tn(),Re(),or(),lr(),gt(),fr(),z(),i(),Ie(),_r(),ht(),Ae(),Tr(),ea(),zt(),ga(),ut(),Lt(),ya(),Ft(),Na(),$=C(),Eo(),Po=No.memo(function({agentDefinitions:e}){return(0,$.jsx)(Ht,{children:(0,$.jsxs)(x,{flexDirection:`column`,gap:1,children:[(0,$.jsx)(Xi,{}),(0,$.jsx)(No.Suspense,{fallback:null,children:(0,$.jsx)(ka,{agentDefinitions:e})})]})})}),Fo=(sn(),e(on)),Io=(k(),e(ne)).BRIEF_TOOL_NAME,Lo=(bt(),e(Ct)).SEND_USER_FILE_TOOL_NAME,Ro=30,zo=200,Bo=50,Vo=({messages:e,tools:t,commands:n,verbose:r,toolJSX:i,toolUseConfirmQueue:o,inProgressToolUseIDs:s,isMessageSelectorVisible:c,conversationId:l,screen:p,streamingToolUses:m,showAllInTranscript:h=!1,agentDefinitions:g,onOpenRateLimitOptions:y,hideLogo:b=!1,isLoading:S,hidePastThinking:C=!1,streamingThinking:w,streamingText:T,isBriefOnly:E=!1,unseenDivider:D,scrollRef:O,trackStickyPrompt:k,jumpRef:te,onSearchMatchesChange:A,scanElement:ne,setPositions:re,disableRenderCap:j=!1,cursor:M=null,setCursor:N,cursorNavRef:P,renderRange:F})=>{let{columns:I}=u(),ie=et(`transcript:toggleShowAll`,`Transcript`,`Ctrl+E`),R=(0,Q.useMemo)(()=>St(e).filter(Ye),[e]),oe=(0,Q.useMemo)(()=>w?w.isStreaming?!0:w.streamingEndedAt?Date.now()-w.streamingEndedAt<3e4:!1:!1,[w]),{lastThinkingBlockId:se,latestBashOutputUUID:ce}=(0,Q.useMemo)(()=>{let e=null,t=null,n=C&&!oe;C&&oe&&(e=`streaming`);for(let r=R.length-1;r>=0;r--){let i=R[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}},[R,C,oe]),z=(0,Q.useMemo)(()=>st(R),[R]),le=(0,Q.useMemo)(()=>m.filter(e=>!s.has(e.contentBlock.id)&&!z.has(e.contentBlock.id)),[m,s,z]),ue=(0,Q.useMemo)(()=>le.flatMap(e=>{let t=At({content:[e.contentBlock]});return t.uuid=Be(e.contentBlock.id,0),St([t])}),[le]),B=p===`transcript`,de=(0,Q.useMemo)(()=>a(process.env.CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL),[]),fe=O!=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=Dt((r||ft()?R:rt(R,{includeSnipped:!0})).filter(e=>e.type!==`progress`&&!_a(e)&&Wt(e,B)),ue),n=[Io,Lo].filter(e=>e!==null),i=[Io].filter(e=>e!==null),a=n.length>0&&!B?E?Do(e,n):i.length>0?Oo(e,i):e:e,o=pe?a.slice(-Ro):a,s=pe&&a.length>Ro,{messages:c}=hr(o,t,r),l=ar(cr(dr(qe(c,t))),r),u=Kt(R,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&&R.length>=V.current.normalizedCount&&o.length>=V.current.messageCount&&V.current.lastAssistantMsgId===d){let e=Tt(V.current.lookups,V.current.normalizedCount,V.current.messageCount,R,o);e?(f=e,V.current={key:u,lookups:f,normalizedCount:R.length,messageCount:o.length,lastAssistantMsgId:d}):(f=Mt(R,o),V.current={key:u,lookups:f,normalizedCount:R.length,messageCount:o.length,lastAssistantMsgId:d})}else f=Mt(R,o),V.current={key:u,lookups:f,normalizedCount:R.length,messageCount:o.length,lastAssistantMsgId:d};let p=e.length-Ro;return{collapsed:l,lookups:f,hasTruncatedMessages:s,hiddenMessageCount:p}},[r,R,B,ue,pe,t,E]),ye=(0,Q.useMemo)(()=>{let e=!fe&&!j?ko(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(!D&&!M)return{dividerBeforeIndex:-1,selectedIdx:-1};let e=-1,t=-1,n=D?.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}},[D,M,ye]),[Ce,we]=(0,Q.useState)(()=>new Set),Te=(0,Q.useCallback)(e=>{let t=Ao(e);we(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},[]),Ee=(0,Q.useCallback)(e=>Ce.size>0&&Ce.has(Ao(e)),[Ce]),De=(0,Q.useRef)(ge);De.current=ge;let Oe=(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&&Jt(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=De.current.toolUseByToolUseID.get(n.tool_use_id??``)?.name;return(r?nn(t,r):void 0)?.isResultTruncated?.(e.toolUseResult)??!1},[t]),Ae=(!i||!!i.shouldContinueAnimation)&&!o.length&&!c,je=s.size>0,{progress:Me}=d(),Ne=(0,Q.useRef)(null),Pe=L().terminalProgressBarEnabled&&!ee()&&!(Fo?.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||sa(ye,i,t,be)),l=ye.length-1-i>0,u=Fe(e),d=(0,$.jsx)(ha,{message:e,isUserContinuation:o,hasContentAfter:c,tools:t,commands:n,verbose:r||Ee(e)||M?.expanded===!0&&i===Se,inProgressToolUseIDs:s,streamingToolUseIDs:be,screen:p,canAnimate:Ae,onOpenRateLimitOptions:y,lastThinkingBlockId:se,latestBashOutputUUID:ce,columns:I,isLoading:S,lookups:ge,shouldCollapseDiffs:l},u),f=(0,$.jsx)(Yt.Provider,{value:i===Se,children:d},u);return D&&i===xe?[(0,$.jsx)(x,{marginTop:1,children:(0,$.jsx)(v,{title:`${D.count} new ${ke(D.count,`message`)}`,width:I,color:`inactive`})},`unseen-divider`),f]:f},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=vr(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&&nn(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)(_n,{name:`MessagesBoundary`,children:[!b&&!(F&&F[0]>0)&&(0,$.jsx)(Po,{agentDefinitions:g}),_e&&(0,$.jsx)(v,{title:`${ie} to show ${f.bold(ve)} previous messages`,width:I}),B&&h&&ve>0&&!j&&(0,$.jsx)(v,{title:`${ie} to hide ${f.bold(ve)} previous messages`,width:I}),fe?(0,$.jsx)(Zt.Provider,{value:!0,children:(0,$.jsx)(vo,{messages:ye,scrollRef:O,columns:I,itemKey:Fe,renderItem:Ie,onItemClick:Te,isItemClickable:Oe,isItemExpanded:Ee,trackStickyPrompt:k,selectedIndex:Se>=0?Se:void 0,cursorNavRef:P,setCursor:N,jumpRef:te,onSearchMatchesChange:A,scanElement:ne,setPositions:re,extractSearchText:Re})}):ye.flatMap(Ie),T&&!E&&(0,$.jsx)(x,{alignItems:`flex-start`,flexDirection:`row`,marginTop:1,width:`100%`,children:(0,$.jsxs)(x,{flexDirection:`row`,children:[(0,$.jsx)(x,{minWidth:2,children:(0,$.jsx)(_,{color:`text`,children:ae})}),(0,$.jsx)(x,{flexDirection:`column`,children:(0,$.jsx)(Ot,{children:T})})]})}),oe&&w&&!E&&(0,$.jsx)(x,{marginTop:1,children:(0,$.jsx)(wt,{param:{type:`thinking`,thinking:w.thinking},addMargin:!1,isTranscriptMode:!0,verbose:r,hideInTranscript:!1})})]})},Ho=No.memo(Vo,(e,t)=>{let n=Object.keys(e);for(let r of n)if(!(r===`onOpenRateLimitOptions`||r===`scrollRef`||r===`trackStickyPrompt`||r===`setCursor`||r===`cursorNavRef`||r===`jumpRef`||r===`onSearchMatchesChange`||r===`scanElement`||r===`setPositions`)&&e[r]!==t[r]){if(r===`streamingToolUses`){let n=e.streamingToolUses,r=t.streamingToolUses;if(n.length===r.length&&n.every((e,t)=>e.contentBlock===r[t]?.contentBlock))continue}if(r===`inProgressToolUseIDs`&&jo(e.inProgressToolUseIDs,t.inProgressToolUseIDs))continue;if(r===`unseenDivider`){let n=e.unseenDivider,r=t.unseenDivider;if(n?.firstUnseenUuid===r?.firstUnseenUuid&&n?.count===r?.count)continue}if(r===`tools`){let n=e.tools,r=t.tools;if(n.length===r.length&&n.every((e,t)=>e.name===r[t]?.name))continue}return!1}return!0})}));export{po as a,qa as c,io as i,Ja as l,Uo as n,to as o,ao as r,eo as s,Ho as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-DR8-3Aex.js";import{f as t,s as n}from"./envUtils-BWeoiL4Y.js";import{J as r,Q as i,Rn as a,T as o,b as s,nt as c,t as l,x as u}from"./src-Di342QoJ.js";import{t as d}from"./jsx-runtime-D-D469L8.js";import{Xi as f,Zi as p,cn as m,on as h,uc as g,yc as _}from"./paths-DO4WOQtD.js";import{n as v,r as y}from"./analytics-DqMQntaB.js";import{a as b,n as x}from"./env-C2A9gV_G.js";import{Hy as S,Ky as C,Vy as w,aS as T,oS as E}from"./loadAgentsDir-ClTeo0nk.js";import{t as D}from"./useKeybinding-DPOUuymz.js";import{c as O,i as k,s as A}from"./terminalSetup-hLCi-2uB.js";import{n as j,t as M}from"./useExitOnCtrlCDWithKeybindings-BHi41Ku_.js";import{t as N}from"./WelcomeV2-BMHXiNt3.js";import{n as P,t as F}from"./ThemePicker-WKmYvrqz.js";import{n as I,t as L}from"./PressEnterToContinue-BJ58eCFC.js";import{t as R}from"./ApproveApiKey-DPws3jax.js";n();var z=e(a(),1),B=d();v(),b(),_(),f(),h(),D(),k(),M(),l(),l(),C(),E(),S(),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,_]=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){_(e),v()}let S=j(),C=(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=p(process.env.ANTHROPIC_API_KEY);if(g(e)===`new`)return e},[]);function k(e){e&&d(!0),v()}let M=[];M.push({id:`theme`,component:C}),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)(w,{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)(T,{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-Di342QoJ.js";import{t as a}from"./jsx-runtime-D-D469L8.js";import{Cc as o,dc as s,yc as c}from"./paths-DO4WOQtD.js";import{n as l,r as u}from"./analytics-DqMQntaB.js";import{C as d,x as f}from"./startupProfiler-CAntGAbs.js";import{a as p,n as m,r as h,t as g}from"./overageCreditGrant-BqW_6R5v.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;o(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(),c(),f(),D=a(),O=3,k=`On us. Works on third-party apps · /extra-usage`}));export{_ as a,A as i,T as n,v as o,x as r,b as s,w as t};
@@ -0,0 +1,17 @@
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{s as n,u as r}from"./envUtils-BWeoiL4Y.js";import{n as i,t as a}from"./figures-gfT9mM8P.js";import{Cn as o,F as s,Q as c,Rn as l,T as u,Ut as d,_ as f,b as p,f as m,g as h,h as g,n as _,nt as v,p as y,r as b,t as x,tn as ee,tt as te,v as S,x as C,xt as ne}from"./src-Di342QoJ.js";import{t as w}from"./jsx-runtime-D-D469L8.js";import{Jo as T,Qa as re,Qo as E,Yo as D,Zt as O,lo as ie,no as k,on as A,oo as j,ps as M,us as N,wc as ae,yc as oe}from"./paths-DO4WOQtD.js";import{D as se,E as ce,J as P,U as F,l as le,p as ue,z as de}from"./debug-otxXY3j-.js";import{n as fe,r as I}from"./analytics-DqMQntaB.js";import{l as pe,u as me}from"./oauth-CdZEzMww.js";import{c as he,o as ge,s as _e}from"./log-DSV4Ht5l.js";import{b as ve,x as ye}from"./teammate-CbskW5G9.js";import{E as be,S as xe}from"./startupProfiler-CAntGAbs.js";import{l as Se,n as Ce,o as we}from"./stringUtils-KZoO4GUd.js";import{$C as Te,$s as Ee,AA as De,DA as Oe,DC as L,EC as R,Fs as z,Is as ke,JC as Ae,Js as je,Jx as Me,Ky as Ne,Ms as Pe,Oh as Fe,Ow as Ie,Rs as Le,Rw as Re,Ry as ze,Sw as Be,Ts as Ve,Tw as He,Vs as Ue,Vw as We,Ws as Ge,Wy as Ke,Zs as qe,aS as Je,aT as Ye,ac as Xe,bw as Ze,cT as Qe,cc as $e,cj as et,dS as tt,dT as nt,dc as rt,eT as it,ew as at,fC as ot,fS as st,fT as ct,gc as lt,gw as ut,hc as dt,iT as ft,jA as pt,kh as mt,lC as ht,lT as gt,lc as _t,nc as vt,nw as yt,oT as bt,oc as xt,pc as St,qs as Ct,sT as wt,sc as Tt,sj as Et,tS as Dt,tT as Ot,tc as kt,tj as At,uC as jt,uT as Mt,uc as Nt,vs as Pt,ws as Ft,ww as It,ys as Lt,yw as Rt}from"./loadAgentsDir-ClTeo0nk.js";import{i as zt,o as Bt,p as Vt,u as Ht}from"./xml-CTdKuU6f.js";import{n as Ut,t as Wt}from"./browser-Bt-ckCaU.js";import{t as Gt}from"./useKeybinding-DPOUuymz.js";import{t as Kt}from"./useTerminalSize-Du-EamDN.js";import{n as qt,t as Jt}from"./useExitOnCtrlCDWithKeybindings-BHi41Ku_.js";import{n as Yt,t as Xt}from"./pluginStartupCheck-D6IbyWKe.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-CKmwDC3G.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-_g0AqWZG.js";import{a as pn,n as mn,o as hn,r as gn}from"./pluginFlagging-DFMlWw2P.js";import{i as _n,n as vn,r as yn}from"./MCPConnectionManager-y97Inszc.js";import{t as bn}from"./SearchBox-CkO4rQ-9.js";import{n as xn,t as Sn}from"./useSearchInput-BhKAGgEN.js";import{i as Cn,n as wn}from"./pluginAutoupdate-BQKtcAhC.js";import*as Tn from"path";import*as En from"fs/promises";function Dn({serverToolsCount:e,serverPromptsCount:t,serverResourcesCount:n}){let r=[];return e>0&&r.push(`tools`),n>0&&r.push(`resources`),t>0&&r.push(`prompts`),(0,On.jsxs)(C,{children:[(0,On.jsx)(p,{bold:!0,children:`Capabilities: `}),(0,On.jsx)(p,{color:`text`,children:r.length>0?(0,On.jsx)(g,{children:r}):`none`})]})}var On,kn=e((()=>{l(),x(),On=w()}));function An(e,t){switch(e.client.type){case`connected`:return{message:`Reconnected to ${t}.`,success:!0};case`needs-auth`:return{message:`${t} requires authentication. Use the 'Authenticate' option.`,success:!1};case`failed`:return{message:`Failed to reconnect to ${t}.`,success:!1};default:return{message:`Unknown result when reconnecting to ${t}.`,success:!1}}}function jn(e,t){return`Error reconnecting to ${t}: ${e instanceof Error?e.message:String(e)}`}var Mn=e((()=>{}));function Nn({server:e,serverToolsCount:t,onViewTools:n,onCancel:r,onComplete:i,borderless:o=!1}){let[l]=u(),d=qt(),{columns:f}=s(),[m,_]=B.useState(!1),[v,y]=B.useState(null),b=jt(e=>e.mcp),x=ot(),[w,T]=B.useState(null),[re,E]=(0,B.useState)(!1),D=(0,B.useRef)(null),[ie,k]=(0,B.useState)(!1),[A,j]=(0,B.useState)(null),[M,N]=(0,B.useState)(!1),[ae,oe]=(0,B.useState)(null),[se,ce]=(0,B.useState)(!1),[P,F]=(0,B.useState)(!1),le=(0,B.useRef)(void 0),ue=(0,B.useRef)(!1),[fe,me]=(0,B.useState)(``),[ge,_e]=(0,B.useState)(0),[ve,ye]=(0,B.useState)(null);(0,B.useEffect)(()=>()=>{ue.current=!0,D.current?.abort(),le.current!==void 0&&clearTimeout(le.current)},[]);let be=e.isAuthenticated||e.client.type===`connected`&&t>0,xe=yn(),Se=B.useCallback(async()=>{k(!1),j(null),E(!0);try{let t=await xe(e.name),n=t.client.type===`connected`;I(`tengu_claudeai_mcp_auth_completed`,{success:n}),n?i?.(`Authentication successful. Connected to ${e.name}.`):t.client.type===`needs-auth`?i?.(`Authentication successful, but server still requires authentication. You may need to manually restart Claude Code.`):i?.(`Authentication successful, but server reconnection failed. You may need to manually restart Claude Code for the changes to take effect.`)}catch(t){I(`tengu_claudeai_mcp_auth_completed`,{success:!1}),i?.(jn(t,e.name))}finally{E(!1)}},[xe,e.name,i]),we=B.useCallback(async()=>{await Me(e.name,{...e.config,scope:e.scope}),x(t=>{let n=t.mcp.clients.map(t=>t.name===e.name?{...t,type:`needs-auth`}:t),r=Be(t.mcp.tools,e.name),i=Rt(t.mcp.commands,e.name),a=Ze(t.mcp.resources,e.name);return{...t,mcp:{...t.mcp,clients:n,tools:r,commands:i,resources:a}}}),I(`tengu_claudeai_mcp_clear_auth_completed`,{}),i?.(`Disconnected from ${e.name}.`),N(!1),oe(null),ce(!1)},[e.name,e.config,e.scope,x,i]);te(`confirm:no`,()=>{D.current?.abort(),D.current=null,_(!1),T(null)},{context:`Confirmation`,isActive:m}),te(`confirm:no`,()=>{k(!1),j(null)},{context:`Confirmation`,isActive:ie}),te(`confirm:no`,()=>{N(!1),oe(null),ce(!1)},{context:`Confirmation`,isActive:M}),ne((e,t)=>{if(t.return&&ie&&Se(),t.return&&M)if(se)we();else{let e=`${pe().CLAUDE_AI_ORIGIN}/settings/connectors`;oe(e),ce(!0),Ut(e)}if(e===`c`&&!P){let e=w||A||ae;e&&ee(e).then(e=>{ue.current||(e&&process.stdout.write(e),F(!0),le.current!==void 0&&clearTimeout(le.current),le.current=setTimeout(F,2e3,!1))})}});let Te=Ce(String(e.name)),Ee=It(b.commands,e.name).length,De=_n(),Oe=B.useCallback(async()=>{let t=pe().CLAUDE_AI_ORIGIN,n=O()?.organizationUuid,r;r=n&&e.config.type===`claudeai-proxy`&&e.config.id?`${t}/api/organizations/${n}/mcp/start-auth/${e.config.id.startsWith(`mcprs`)?`mcpsrv`+e.config.id.slice(5):e.config.id}?product_surface=${encodeURIComponent(process.env.CLAUDE_CODE_ENTRYPOINT||`cli`)}`:`${t}/settings/connectors`,j(r),k(!0),I(`tengu_claudeai_mcp_auth_started`,{}),await Ut(r)},[e.config]),L=B.useCallback(()=>{N(!0),I(`tengu_claudeai_mcp_clear_auth_started`,{})},[]),z=B.useCallback(async()=>{let t=e.client.type!==`disabled`;try{await De(e.name),e.config.type===`claudeai-proxy`&&I(`tengu_claudeai_mcp_toggle`,{new_state:t?`disabled`:`enabled`}),r()}catch(n){i?.(`Failed to ${t?`disable`:`enable`} MCP server '${e.name}': ${de(n)}`)}},[e.client.type,e.config.type,e.name,De,r,i]),ke=B.useCallback(async()=>{if(e.config.type===`claudeai-proxy`)return;_(!0),y(null);let t=new AbortController;D.current=t;try{if(e.isAuthenticated&&e.config&&await yt(e.name,e.config,{preserveStepUpState:!0}),e.config){await at(e.name,e.config,T,t.signal,{onWaitingForCallback:e=>{ye(()=>e)}}),I(`tengu_mcp_auth_config_authenticate`,{wasAuthenticated:e.isAuthenticated});let n=await xe(e.name);if(n.client.type===`connected`){let t=be?`Authentication successful. Reconnected to ${e.name}.`:`Authentication successful. Connected to ${e.name}.`;i?.(t)}else n.client.type===`needs-auth`?i?.(`Authentication successful, but server still requires authentication. You may need to manually restart Claude Code.`):(he(e.name,`Reconnection failed after authentication`),i?.(`Authentication successful, but server reconnection failed. You may need to manually restart Claude Code for the changes to take effect.`))}}catch(e){e instanceof Error&&!(e instanceof Ae)&&y(e.message)}finally{_(!1),D.current=null,ye(null),me(``)}},[e.isAuthenticated,e.config,e.name,i,xe,be]),je=async()=>{e.config.type!==`claudeai-proxy`&&e.config&&(await yt(e.name,e.config),I(`tengu_mcp_auth_config_clear`,{}),await Me(e.name,{...e.config,scope:e.scope}),x(t=>{let n=t.mcp.clients.map(t=>t.name===e.name?{...t,type:`failed`}:t),r=Be(t.mcp.tools,e.name),i=Rt(t.mcp.commands,e.name),a=Ze(t.mcp.resources,e.name);return{...t,mcp:{...t.mcp,clients:n,tools:r,commands:i,resources:a}}}),i?.(`Authentication cleared for ${e.name}.`))};if(m){let t=e.config.type!==`claudeai-proxy`&&e.config.oauth?.xaa?` Authenticating via your identity provider`:` A browser window will open for authentication`;return(0,V.jsxs)(C,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(p,{color:`claude`,children:[`Authenticating with `,e.name,`…`]}),(0,V.jsxs)(C,{children:[(0,V.jsx)(Ke,{}),(0,V.jsx)(p,{children:t})]}),w&&(0,V.jsxs)(C,{flexDirection:`column`,children:[(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL manually `}),P?(0,V.jsx)(p,{color:`success`,children:`(Copied!)`}):(0,V.jsx)(p,{dimColor:!0,children:(0,V.jsx)(h,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,V.jsx)(c,{url:w})]}),m&&w&&ve&&(0,V.jsxs)(C,{flexDirection:`column`,marginTop:1,children:[(0,V.jsx)(p,{dimColor:!0,children:`If the redirect page shows a connection error, paste the URL from your browser's address bar:`}),(0,V.jsxs)(C,{children:[(0,V.jsxs)(p,{dimColor:!0,children:[`URL `,`>`,` `]}),(0,V.jsx)(tt,{value:fe,onChange:me,onSubmit:e=>{ve(e.trim()),me(``)},cursorOffset:ge,onChangeCursorOffset:_e,columns:f-8})]})]}),(0,V.jsx)(C,{marginLeft:3,children:(0,V.jsx)(p,{dimColor:!0,children:`Return here after authenticating in your browser. Press Esc to go back.`})})]})}if(ie)return(0,V.jsxs)(C,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(p,{color:`claude`,children:[`Authenticating with `,e.name,`…`]}),(0,V.jsxs)(C,{children:[(0,V.jsx)(Ke,{}),(0,V.jsx)(p,{children:` A browser window will open for authentication`})]}),A&&(0,V.jsxs)(C,{flexDirection:`column`,children:[(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL manually `}),P?(0,V.jsx)(p,{color:`success`,children:`(Copied!)`}):(0,V.jsx)(p,{dimColor:!0,children:(0,V.jsx)(h,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,V.jsx)(c,{url:A})]}),(0,V.jsxs)(C,{marginLeft:3,flexDirection:`column`,children:[(0,V.jsxs)(p,{color:`permission`,children:[`Press `,(0,V.jsx)(p,{bold:!0,children:`Enter`}),` after authenticating in your browser.`]}),(0,V.jsx)(p,{dimColor:!0,italic:!0,children:(0,V.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})]})]});if(M)return(0,V.jsxs)(C,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(p,{color:`claude`,children:[`Clear authentication for `,e.name]}),se?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(p,{children:`Find the MCP server in the browser and click "Disconnect".`}),ae&&(0,V.jsxs)(C,{flexDirection:`column`,children:[(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{dimColor:!0,children:`If your browser didn't open automatically, copy this URL manually `}),P?(0,V.jsx)(p,{color:`success`,children:`(Copied!)`}):(0,V.jsx)(p,{dimColor:!0,children:(0,V.jsx)(h,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,V.jsx)(c,{url:ae})]}),(0,V.jsxs)(C,{marginLeft:3,flexDirection:`column`,children:[(0,V.jsxs)(p,{color:`permission`,children:[`Press `,(0,V.jsx)(p,{bold:!0,children:`Enter`}),` when done.`]}),(0,V.jsx)(p,{dimColor:!0,italic:!0,children:(0,V.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})]})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(p,{children:`This will open claude.ai in the browser. Find the MCP server in the list and click "Disconnect".`}),(0,V.jsxs)(C,{marginLeft:3,flexDirection:`column`,children:[(0,V.jsxs)(p,{color:`permission`,children:[`Press `,(0,V.jsx)(p,{bold:!0,children:`Enter`}),` to open the browser.`]}),(0,V.jsx)(p,{dimColor:!0,italic:!0,children:(0,V.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})]})]})]});if(re)return(0,V.jsxs)(C,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(p,{color:`text`,children:[`Connecting to `,(0,V.jsx)(p,{bold:!0,children:e.name}),`…`]}),(0,V.jsxs)(C,{children:[(0,V.jsx)(Ke,{}),(0,V.jsx)(p,{children:` Establishing connection to MCP server`})]}),(0,V.jsx)(p,{dimColor:!0,children:`This may take a few moments.`})]});let Ne=[];return e.client.type===`disabled`&&Ne.push({label:`Enable`,value:`toggle-enabled`}),e.client.type===`connected`&&t>0&&Ne.push({label:`View tools`,value:`tools`}),e.config.type===`claudeai-proxy`?e.client.type===`connected`?Ne.push({label:`Clear authentication`,value:`claudeai-clear-auth`}):e.client.type!==`disabled`&&Ne.push({label:`Authenticate`,value:`claudeai-auth`}):(be&&(Ne.push({label:`Re-authenticate`,value:`reauth`}),Ne.push({label:`Clear authentication`,value:`clear-auth`})),be||Ne.push({label:`Authenticate`,value:`auth`})),e.client.type!==`disabled`&&(e.client.type!==`needs-auth`&&Ne.push({label:`Reconnect`,value:`reconnectMcpServer`}),Ne.push({label:`Disable`,value:`toggle-enabled`})),Ne.length===0&&Ne.push({label:`Back`,value:`back`}),(0,V.jsxs)(C,{flexDirection:`column`,children:[(0,V.jsxs)(C,{flexDirection:`column`,paddingX:1,borderStyle:o?void 0:`round`,children:[(0,V.jsx)(C,{marginBottom:1,children:(0,V.jsxs)(p,{bold:!0,children:[Te,` MCP Server`]})}),(0,V.jsxs)(C,{flexDirection:`column`,gap:0,children:[(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{bold:!0,children:`Status: `}),e.client.type===`disabled`?(0,V.jsxs)(p,{children:[S(`inactive`,l)(a.radioOff),` disabled`]}):e.client.type===`connected`?(0,V.jsxs)(p,{children:[S(`success`,l)(a.tick),` connected`]}):e.client.type===`pending`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(p,{dimColor:!0,children:a.radioOff}),(0,V.jsx)(p,{children:` connecting…`})]}):e.client.type===`needs-auth`?(0,V.jsxs)(p,{children:[S(`warning`,l)(a.triangleUpOutline),` needs authentication`]}):(0,V.jsxs)(p,{children:[S(`error`,l)(a.cross),` failed`]})]}),e.transport!==`claudeai-proxy`&&(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{bold:!0,children:`Auth: `}),be?(0,V.jsxs)(p,{children:[S(`success`,l)(a.tick),` authenticated`]}):(0,V.jsxs)(p,{children:[S(`error`,l)(a.cross),` not authenticated`]})]}),(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{bold:!0,children:`URL: `}),(0,V.jsx)(p,{dimColor:!0,children:e.config.url})]}),(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{bold:!0,children:`Config location: `}),(0,V.jsx)(p,{dimColor:!0,children:ut(e.scope)})]}),e.client.type===`connected`&&(0,V.jsx)(Dn,{serverToolsCount:t,serverPromptsCount:Ee,serverResourcesCount:b.resources[e.name]?.length||0}),e.client.type===`connected`&&t>0&&(0,V.jsxs)(C,{children:[(0,V.jsx)(p,{bold:!0,children:`Tools: `}),(0,V.jsxs)(p,{dimColor:!0,children:[t,` tools`]})]})]}),v&&(0,V.jsx)(C,{marginTop:1,children:(0,V.jsxs)(p,{color:`error`,children:[`Error: `,v]})}),Ne.length>0&&(0,V.jsx)(C,{marginTop:1,children:(0,V.jsx)(Je,{options:Ne,onChange:async t=>{switch(t){case`tools`:n();break;case`auth`:case`reauth`:await ke();break;case`clear-auth`:await je();break;case`claudeai-auth`:await Oe();break;case`claudeai-clear-auth`:L();break;case`reconnectMcpServer`:E(!0);try{let t=await xe(e.name);e.config.type===`claudeai-proxy`&&I(`tengu_claudeai_mcp_reconnect`,{success:t.client.type===`connected`});let{message:n}=An(t,e.name);i?.(n)}catch(t){e.config.type===`claudeai-proxy`&&I(`tengu_claudeai_mcp_reconnect`,{success:!1}),i?.(jn(t,e.name))}finally{E(!1)}break;case`toggle-enabled`:await z();break;case`back`:r();break}},onCancel:r})})]}),(0,V.jsx)(C,{marginTop:1,children:(0,V.jsx)(p,{dimColor:!0,italic:!0,children:d.pending?(0,V.jsxs)(V.Fragment,{children:[`Press `,d.keyName,` again to exit`]}):(0,V.jsxs)(g,{children:[(0,V.jsx)(h,{shortcut:`↑↓`,action:`navigate`}),(0,V.jsx)(h,{shortcut:`Enter`,action:`select`}),(0,V.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}var B,V,Pn=e((()=>{i(),B=t(l(),1),fe(),me(),Jt(),Kt(),x(),Gt(),Te(),Dt(),vn(),Ie(),ht(),A(),Wt(),F(),ge(),we(),L(),ze(),Ne(),st(),kn(),Mn(),V=w()}));function Fn({server:e,serverToolsCount:t,onViewTools:n,onCancel:r,onComplete:i,borderless:o=!1}){let[s]=u(),c=qt(),l=jt(e=>e.mcp),d=yn(),f=_n(),[m,_]=(0,In.useState)(!1),v=In.useCallback(async()=>{let t=e.client.type!==`disabled`;try{await f(e.name),r()}catch(n){i(`Failed to ${t?`disable`:`enable`} MCP server '${e.name}': ${de(n)}`)}},[e.client.type,e.name,f,r,i]),y=Ce(String(e.name)),b=It(l.commands,e.name).length,x=[];return e.client.type!==`disabled`&&t>0&&x.push({label:`View tools`,value:`tools`}),e.client.type!==`disabled`&&x.push({label:`Reconnect`,value:`reconnectMcpServer`}),x.push({label:e.client.type===`disabled`?`Enable`:`Disable`,value:`toggle-enabled`}),x.length===0&&x.push({label:`Back`,value:`back`}),m?(0,H.jsxs)(C,{flexDirection:`column`,gap:1,padding:1,children:[(0,H.jsxs)(p,{color:`text`,children:[`Reconnecting to `,(0,H.jsx)(p,{bold:!0,children:e.name})]}),(0,H.jsxs)(C,{children:[(0,H.jsx)(Ke,{}),(0,H.jsx)(p,{children:` Restarting MCP server process`})]}),(0,H.jsx)(p,{dimColor:!0,children:`This may take a few moments.`})]}):(0,H.jsxs)(C,{flexDirection:`column`,children:[(0,H.jsxs)(C,{flexDirection:`column`,paddingX:1,borderStyle:o?void 0:`round`,children:[(0,H.jsx)(C,{marginBottom:1,children:(0,H.jsxs)(p,{bold:!0,children:[y,` MCP Server`]})}),(0,H.jsxs)(C,{flexDirection:`column`,gap:0,children:[(0,H.jsxs)(C,{children:[(0,H.jsx)(p,{bold:!0,children:`Status: `}),e.client.type===`disabled`?(0,H.jsxs)(p,{children:[S(`inactive`,s)(a.radioOff),` disabled`]}):e.client.type===`connected`?(0,H.jsxs)(p,{children:[S(`success`,s)(a.tick),` connected`]}):e.client.type===`pending`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(p,{dimColor:!0,children:a.radioOff}),(0,H.jsx)(p,{children:` connecting…`})]}):(0,H.jsxs)(p,{children:[S(`error`,s)(a.cross),` failed`]})]}),(0,H.jsxs)(C,{children:[(0,H.jsx)(p,{bold:!0,children:`Command: `}),(0,H.jsx)(p,{dimColor:!0,children:e.config.command})]}),e.config.args&&e.config.args.length>0&&(0,H.jsxs)(C,{children:[(0,H.jsx)(p,{bold:!0,children:`Args: `}),(0,H.jsx)(p,{dimColor:!0,children:e.config.args.join(` `)})]}),(0,H.jsxs)(C,{children:[(0,H.jsx)(p,{bold:!0,children:`Config location: `}),(0,H.jsx)(p,{dimColor:!0,children:ut(Re(e.name)?.scope??`dynamic`)})]}),e.client.type===`connected`&&(0,H.jsx)(Dn,{serverToolsCount:t,serverPromptsCount:b,serverResourcesCount:l.resources[e.name]?.length||0}),e.client.type===`connected`&&t>0&&(0,H.jsxs)(C,{children:[(0,H.jsx)(p,{bold:!0,children:`Tools: `}),(0,H.jsxs)(p,{dimColor:!0,children:[t,` tools`]})]})]}),x.length>0&&(0,H.jsx)(C,{marginTop:1,children:(0,H.jsx)(Je,{options:x,onChange:async t=>{if(t===`tools`)n();else if(t===`reconnectMcpServer`){_(!0);try{let{message:t}=An(await d(e.name),e.name);i?.(t)}catch(t){i?.(jn(t,e.name))}finally{_(!1)}}else t===`toggle-enabled`?await v():t===`back`&&r()},onCancel:r})})]}),(0,H.jsx)(C,{marginTop:1,children:(0,H.jsx)(p,{dimColor:!0,italic:!0,children:c.pending?(0,H.jsxs)(H.Fragment,{children:[`Press `,c.keyName,` again to exit`]}):(0,H.jsxs)(g,{children:[(0,H.jsx)(h,{shortcut:`↑↓`,action:`navigate`}),(0,H.jsx)(h,{shortcut:`Enter`,action:`select`}),(0,H.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}var In,H,Ln=e((()=>{i(),In=t(l(),1),Jt(),x(),We(),vn(),Ie(),ht(),F(),we(),L(),ze(),Ne(),kn(),Mn(),H=w()}));function Rn({tool:e,server:t,onBack:n}){let[r,i]=zn.useState(``),a=D(e.name,t.name),o=T(e.userFacingName?e.userFacingName({}):a),s=e.isReadOnly?.({})??!1,c=e.isDestructive?.({})??!1,l=e.isOpenWorld?.({})??!1;return zn.useEffect(()=>{async function t(){try{i(await e.description({},{isNonInteractiveSession:!1,toolPermissionContext:{mode:`default`,additionalWorkingDirectories:new Map,alwaysAllowRules:{},alwaysDenyRules:{},alwaysAskRules:{},isBypassPermissionsModeAvailable:!1},tools:[]}))}catch{i(`Failed to load description`)}}t()},[e]),(0,U.jsx)(m,{title:(0,U.jsxs)(U.Fragment,{children:[o,s&&(0,U.jsx)(p,{color:`success`,children:` [read-only]`}),c&&(0,U.jsx)(p,{color:`error`,children:` [destructive]`}),l&&(0,U.jsx)(p,{dimColor:!0,children:` [open-world]`})]}),subtitle:t.name,onCancel:n,inputGuide:e=>e.pending?(0,U.jsxs)(p,{children:[`Press `,e.keyName,` again to exit`]}):(0,U.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`}),children:(0,U.jsxs)(C,{flexDirection:`column`,children:[(0,U.jsxs)(C,{children:[(0,U.jsx)(p,{bold:!0,children:`Tool name: `}),(0,U.jsx)(p,{dimColor:!0,children:a})]}),(0,U.jsxs)(C,{children:[(0,U.jsx)(p,{bold:!0,children:`Full name: `}),(0,U.jsx)(p,{dimColor:!0,children:e.name})]}),r&&(0,U.jsxs)(C,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(p,{bold:!0,children:`Description:`}),(0,U.jsx)(p,{wrap:`wrap`,children:r})]}),e.inputJSONSchema&&e.inputJSONSchema.properties&&Object.keys(e.inputJSONSchema.properties).length>0&&(0,U.jsxs)(C,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(p,{bold:!0,children:`Parameters:`}),(0,U.jsx)(C,{marginLeft:2,flexDirection:`column`,children:Object.entries(e.inputJSONSchema.properties).map(([t,n])=>{let r=(e.inputJSONSchema?.required)?.includes(t);return(0,U.jsxs)(p,{children:[`• `,t,r&&(0,U.jsx)(p,{dimColor:!0,children:` (required)`}),`:`,` `,(0,U.jsx)(p,{dimColor:!0,children:typeof n==`object`&&n&&`type`in n?String(n.type):`unknown`}),typeof n==`object`&&n&&`description`in n&&(0,U.jsxs)(p,{dimColor:!0,children:[` - `,String(n.description)]})]},t)})})]})]})})}var zn,U,Bn=e((()=>{zn=t(l(),1),x(),E(),L(),U=w()}));function Vn({server:e,onSelectTool:t,onBack:n}){let r=jt(e=>e.mcp.tools),i=Hn.useMemo(()=>e.client.type===`connected`?He(r,e.name):[],[e,r]),a=i.map((t,n)=>{let r=D(t.name,e.name),i=T(t.userFacingName?t.userFacingName({}):r),a=t.isReadOnly?.({})??!1,o=t.isDestructive?.({})??!1,s=t.isOpenWorld?.({})??!1,c=[];return a&&c.push(`read-only`),o&&c.push(`destructive`),s&&c.push(`open-world`),{label:i,value:n.toString(),description:c.length>0?c.join(`, `):void 0,descriptionColor:o?`error`:a?`success`:void 0}});return(0,Un.jsx)(m,{title:`Tools for ${e.name}`,subtitle:`${i.length} ${Se(i.length,`tool`)}`,onCancel:n,inputGuide:e=>e.pending?(0,Un.jsxs)(p,{children:[`Press `,e.keyName,` again to exit`]}):(0,Un.jsxs)(g,{children:[(0,Un.jsx)(h,{shortcut:`↑↓`,action:`navigate`}),(0,Un.jsx)(h,{shortcut:`Enter`,action:`select`}),(0,Un.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]}),children:i.length===0?(0,Un.jsx)(p,{dimColor:!0,children:`No tools available`}):(0,Un.jsx)(Je,{options:a,onChange:e=>{let n=parseInt(e,10),r=i[n];r&&t(r,n)},onCancel:n})})}var Hn,Un,Wn=e((()=>{Hn=t(l(),1),x(),E(),Ie(),ht(),we(),L(),ze(),Un=w()}));function Gn({inputValue:e,setInputValue:t,cursorOffset:n,setCursorOffset:r,error:i,setError:a,result:o,setResult:s,setViewState:c,onAddComplete:l,cliMode:u=!1}){let d=(0,Kn.useRef)(!1),[f,m]=(0,Kn.useState)(!1),[_,v]=(0,Kn.useState)(``),y=async()=>{let t=e.trim();if(!t){a(`Please enter a marketplace source`);return}let n=await on(t);if(!n){a(`Invalid marketplace source format. Try: owner/repo, https://..., or ./path`);return}if(`error`in n){a(n.error);return}a(null);try{m(!0),v(``);let{name:e,resolvedSource:t}=await Ue(n,e=>{v(e)});kt(e,{source:t}),dt();let r=n.source;n.source===`github`&&(r=n.repo),I(`tengu_marketplace_added`,{source_type:r}),l&&await l(),v(``),m(!1),u?s(`Successfully added marketplace: ${e}`):c({type:`browse-marketplace`,targetMarketplace:e})}catch(e){let t=P(e);_e(t),a(t.message),v(``),m(!1),s(u?`Error: ${t.message}`:null)}};return(0,Kn.useEffect)(()=>{e&&!d.current&&!i&&!o&&(d.current=!0,y())},[]),(0,W.jsxs)(C,{flexDirection:`column`,children:[(0,W.jsxs)(C,{flexDirection:`column`,paddingX:1,borderStyle:`round`,children:[(0,W.jsx)(C,{marginBottom:1,children:(0,W.jsx)(p,{bold:!0,children:`Add Marketplace`})}),(0,W.jsxs)(C,{flexDirection:`column`,children:[(0,W.jsx)(p,{children:`Enter marketplace source:`}),(0,W.jsx)(p,{dimColor:!0,children:`Examples:`}),(0,W.jsx)(p,{dimColor:!0,children:` · owner/repo (GitHub)`}),(0,W.jsx)(p,{dimColor:!0,children:` · git@github.com:owner/repo.git (SSH)`}),(0,W.jsx)(p,{dimColor:!0,children:` · https://example.com/marketplace.json`}),(0,W.jsx)(p,{dimColor:!0,children:` · ./path/to/marketplace`}),(0,W.jsx)(C,{marginTop:1,children:(0,W.jsx)(tt,{value:e,onChange:t,onSubmit:y,columns:80,cursorOffset:n,onChangeCursorOffset:r,focus:!0,showCursor:!0})})]}),f&&(0,W.jsxs)(C,{marginTop:1,children:[(0,W.jsx)(Ke,{}),(0,W.jsx)(p,{children:_||`Adding marketplace to configuration…`})]}),i&&(0,W.jsx)(C,{marginTop:1,children:(0,W.jsx)(p,{color:`error`,children:i})}),o&&(0,W.jsx)(C,{marginTop:1,children:(0,W.jsx)(p,{children:o})})]}),(0,W.jsx)(C,{marginLeft:3,children:(0,W.jsx)(p,{dimColor:!0,italic:!0,children:(0,W.jsxs)(g,{children:[(0,W.jsx)(h,{shortcut:`Enter`,action:`add`}),(0,W.jsx)(R,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})})]})}var Kn,W,qn=e((()=>{l(),Kn=t(l(),1),fe(),L(),x(),Ne(),st(),F(),ge(),lt(),Ct(),cn(),W=w()}));function Jn(e,t,n,i){let a={};for(let o of e){let e=n[o],s=t[o]??``;if(!(e?.sensitive===!0&&s===``&&i?.[o]!==void 0))if(e?.type===`number`){if(s.trim()===``)continue;let e=Number(s);a[o]=Number.isNaN(e)?s:e}else e?.type===`boolean`?a[o]=r(s):a[o]=s}return a}function Yn({title:e,subtitle:t,configSchema:n,initialValues:r,onSave:i,onCancel:s}){let c=Object.keys(n),l=(0,Xn.useCallback)(e=>{if(n[e]?.sensitive===!0)return``;let t=r?.[e];return t===void 0?``:String(t)},[n,r]),[u,d]=(0,Xn.useState)(0),[f,h]=(0,Xn.useState)({}),[g,_]=(0,Xn.useState)(()=>c[0]?l(c[0]):``),y=c[u],b=y?n[y]:null;if(te(`confirm:no`,s,{context:`Settings`}),v({"confirm:nextField":(0,Xn.useCallback)(()=>{if(u<c.length-1&&y){h(e=>({...e,[y]:g})),d(e=>e+1);let e=c[u+1];_(e?l(e):``)}},[u,c,y,g,l]),"confirm:yes":(0,Xn.useCallback)(()=>{if(!y)return;let e={...f,[y]:g};if(u===c.length-1)i(Jn(c,e,n,r));else{h(e),d(e=>e+1);let t=c[u+1];_(t?l(t):``)}},[y,f,g,u,c,n,i,l,r])},{context:`Confirmation`}),ne((e,t)=>{if(t.backspace||t.delete){_(e=>e.slice(0,-1));return}e&&!t.ctrl&&!t.meta&&!t.tab&&!t.return&&_(t=>t+e)}),!b||!y)return null;let x=b.sensitive===!0,ee=b.required===!0,S=x?`*`.repeat(o(g)):g;return(0,Zn.jsxs)(m,{title:e,subtitle:t,onCancel:s,isCancelActive:!1,children:[(0,Zn.jsxs)(C,{flexDirection:`column`,children:[(0,Zn.jsxs)(p,{bold:!0,children:[b.title||y,ee&&(0,Zn.jsx)(p,{color:`error`,children:` *`})]}),b.description&&(0,Zn.jsx)(p,{dimColor:!0,children:b.description}),(0,Zn.jsxs)(C,{marginTop:1,children:[(0,Zn.jsxs)(p,{children:[a.pointerSmall,` `]}),(0,Zn.jsx)(p,{children:S}),(0,Zn.jsx)(p,{children:`█`})]})]}),(0,Zn.jsxs)(C,{flexDirection:`column`,children:[(0,Zn.jsxs)(p,{dimColor:!0,children:[`Field `,u+1,` of `,c.length]}),u<c.length-1&&(0,Zn.jsx)(p,{dimColor:!0,children:`Tab: Next field · Enter: Save and continue`}),u===c.length-1&&(0,Zn.jsx)(p,{dimColor:!0,children:`Enter: Save configuration`})]})]})}var Xn,Zn,Qn=e((()=>{i(),Xn=t(l(),1),x(),Gt(),n(),Zn=w()}));async function $n(e){let{enabled:t,disabled:n}=await Lt();return[...t,...n].find(t=>t.repository===e||t.source===e)}function er({plugin:e,pluginId:t,onDone:n}){let[r]=tr.useState(()=>{let n=[],r=ft(e);Object.keys(r).length>0&&n.push({key:`top-level`,title:`Configure ${e.name}`,subtitle:`Plugin options`,schema:r,load:()=>bt(t),save:n=>wt(t,n,e.manifest.userConfig)});let i=it(e);for(let r of i)n.push({key:`channel:${r.server}`,title:`Configure ${r.displayName}`,subtitle:`Plugin: ${e.name}`,schema:r.configSchema,load:()=>Mt(t,r.server)??void 0,save:e=>ct(t,r.server,e,r.configSchema)});return n}),[i,a]=tr.useState(0),o=tr.useRef(n);if(o.current=n,tr.useEffect(()=>{r.length===0&&o.current(`skipped`)},[r.length]),r.length===0)return null;let s=r[i];function c(e){try{s.save(e)}catch(e){n(`error`,de(e));return}let t=i+1;t<r.length?a(t):n(`configured`)}return(0,nr.jsx)(Yn,{title:s.title,subtitle:s.subtitle,configSchema:s.schema,initialValues:s.load(),onSave:c,onCancel:()=>n(`skipped`)},s.key)}var tr,nr,rr=e((()=>{tr=t(l(),1),F(),Qe(),Ot(),Pt(),Ye(),Qn(),nr=w()}));function ir(){let e=Nt();return(0,ar.jsxs)(C,{marginBottom:1,children:[(0,ar.jsxs)(p,{color:`claude`,children:[a.warning,` `]}),(0,ar.jsxs)(p,{dimColor:!0,italic:!0,children:[`Make sure you trust a plugin before installing, updating, or using it. Anthropic does not control what MCP servers, files, or other software are included in plugins and cannot verify that they will work as intended or that they won't change. See each plugin's homepage for more information.`,e?` ${e}`:``]})]})}var ar,or=e((()=>{i(),l(),x(),rt(),ar=w()}));function sr(e){return e.entry.source&&typeof e.entry.source==`object`&&`source`in e.entry.source&&e.entry.source.source===`github`&&typeof e.entry.source==`object`&&`repo`in e.entry.source?e.entry.source.repo:null}function cr(e,t){let n=[{label:`Install for you (user scope)`,action:`install-user`},{label:`Install for all collaborators on this repository (project scope)`,action:`install-project`},{label:`Install for you, in this repo only (local scope)`,action:`install-local`}];return e&&n.push({label:`Open homepage`,action:`homepage`}),t&&n.push({label:`View on GitHub`,action:`github`}),n.push({label:`Back to plugin list`,action:`back`}),n}function lr({hasSelection:e}){return(0,ur.jsx)(C,{marginTop:1,children:(0,ur.jsx)(p,{dimColor:!0,italic:!0,children:(0,ur.jsxs)(g,{children:[e&&(0,ur.jsx)(R,{action:`plugin:install`,context:`Plugin`,fallback:`i`,description:`install`,bold:!0}),(0,ur.jsx)(R,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,ur.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,ur.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})}var ur,dr=e((()=>{l(),L(),x(),ur=w()}));function fr({totalItems:e,maxVisible:t=mr,selectedIndex:n=0}){let r=e>t,i=(0,pr.useRef)(0),a=(0,pr.useMemo)(()=>{if(!r)return 0;let a=i.current;if(n<a)return i.current=n,n;if(n>=a+t){let e=n-t+1;return i.current=e,e}let o=Math.max(0,e-t),s=Math.min(a,o);return i.current=s,s},[n,t,r,e]),o=a,s=Math.min(a+t,e),c=(0,pr.useCallback)(e=>r?e.slice(o,s):e,[r,o,s]),l=(0,pr.useCallback)(e=>o+e,[o]),u=(0,pr.useCallback)(e=>e>=o&&e<s,[o,s]),d=(0,pr.useCallback)(e=>{},[]),f=(0,pr.useCallback)(()=>{},[]),p=(0,pr.useCallback)(()=>{},[]),m=(0,pr.useCallback)((t,n)=>{n(Math.max(0,Math.min(t,e-1)))},[e]),h=(0,pr.useCallback)((e,t)=>!1,[]),g=Math.max(1,Math.ceil(e/t));return{currentPage:Math.floor(a/t),totalPages:g,startIndex:o,endIndex:s,needsPagination:r,pageSize:t,getVisibleItems:c,toActualIndex:l,isOnCurrentPage:u,goToPage:d,nextPage:f,prevPage:p,handleSelectionChange:m,handlePageNavigation:h,scrollPosition:{current:n+1,total:e,canScrollUp:a>0,canScrollDown:a+t<e}}}var pr,mr,hr=e((()=>{pr=t(l(),1),mr=5}));function gr({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:o,targetMarketplace:s,targetPlugin:c}){let[l,u]=(0,vr.useState)(`marketplace-list`),[d,f]=(0,vr.useState)(null),[m,h]=(0,vr.useState)(null),[_,y]=(0,vr.useState)([]),[b,x]=(0,vr.useState)([]),[ee,S]=(0,vr.useState)(!0),[ne,w]=(0,vr.useState)(null),[T,re]=(0,vr.useState)(0),[E,D]=(0,vr.useState)(new Set),[O,ie]=(0,vr.useState)(new Set),k=fr({totalItems:b.length,selectedIndex:T}),[A,j]=(0,vr.useState)(0),[M,N]=(0,vr.useState)(!1),[ae,oe]=(0,vr.useState)(null),[se,ce]=(0,vr.useState)(null);te(`confirm:no`,_r.useCallback(()=>{l===`plugin-list`?s?i({type:`manage-marketplaces`,targetMarketplace:s}):_.length===1?i({type:`menu`}):(u(`marketplace-list`),f(null),D(new Set)):l===`plugin-details`?(u(`plugin-list`),h(null)):i({type:`menu`})},[l,s,i,_.length]),{context:`Confirmation`}),(0,vr.useEffect)(()=>{async function e(){try{let e=await je(),{marketplaces:n,failures:r}=await St(e),i=[];for(let{name:e,config:t,data:r}of n)if(r){let n=ve(r.plugins,t=>ke(Xe(t.name,e)));i.push({name:e,totalPlugins:r.plugins.length,installedCount:n,source:_t(t.source)})}i.sort((e,t)=>e.name===`claude-plugin-directory`?-1:+(t.name===`claude-plugin-directory`)),y(i);let a=$e(r,ve(n,e=>e.data!==null));if(a)if(a.type===`warning`)ce(a.message+`. Showing available marketplaces.`);else throw Error(a.message);if(i.length===1&&!s&&!c){let e=i[0];e&&(f(e.name),u(`plugin-list`))}if(c){let n=null,r=null;for(let[t]of Object.entries(e)){let e=await Ge(t);if(e){let i=e.plugins.find(e=>e.name===c);if(i){let e=Xe(i.name,t);n={entry:i,marketplaceName:t,pluginId:e,isInstalled:z(e)},r=t;break}}}if(n&&r){let e=n.pluginId;z(e)?t(`Plugin '${e}' is already installed globally. Use '/plugin' to manage existing plugins.`):(f(r),h(n),u(`plugin-details`))}else t(`Plugin "${c}" not found in any marketplace`)}else s&&(i.some(e=>e.name===s)?(f(s),u(`plugin-list`)):t(`Marketplace "${s}" not found`))}catch(e){t(e instanceof Error?e.message:`Failed to load marketplaces`)}finally{S(!1)}}e()},[t,s,c]),(0,vr.useEffect)(()=>{if(!d)return;let e=!1;async function n(n){S(!0);try{let t=await Ge(n);if(e)return;if(!t)throw Error(`Failed to load marketplace: ${n}`);let r=[];for(let e of t.plugins){let t=Xe(e.name,n);mt(t)||r.push({entry:e,marketplaceName:n,pluginId:t,isInstalled:z(t)})}try{let t=await dn();if(e)return;w(t),t?r.sort((e,n)=>{let r=t.get(e.pluginId)??0,i=t.get(n.pluginId)??0;return r===i?e.entry.name.localeCompare(n.entry.name):i-r}):r.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}catch(t){if(e)return;ue(`Failed to fetch install counts: ${de(t)}`),r.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}x(r),re(0),D(new Set)}catch(n){if(e)return;t(n instanceof Error?n.message:`Failed to load plugins`)}finally{S(!1)}}return n(d),()=>{e=!0}},[d,t]);let P=async()=>{if(E.size===0)return;let e=b.filter(e=>E.has(e.pluginId));ie(new Set(e.map(e=>e.pluginId)));let n=0,a=0,s=[];for(let t of e){let e=await Ve({pluginId:t.pluginId,entry:t.entry,marketplaceName:t.marketplaceName,scope:`user`});e.success?n++:(a++,s.push({name:t.entry.name,reason:e.error}))}ie(new Set),D(new Set),dt(),a===0?r(`✓ Installed ${n} ${Se(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${Tt(s,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${Tt(s,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&o&&await o(),i({type:`menu`})},F=async(e,t=`user`)=>{N(!0),oe(null);let n=await Ve({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await $n(e.pluginId);if(t){N(!1),u({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),o&&await o(),i({type:`menu`})}else N(!1),oe(n.error)};(0,vr.useEffect)(()=>{e&&r(e)},[e,r]),v({"select:previous":()=>{T>0&&re(T-1)},"select:next":()=>{T<_.length-1&&re(T+1)},"select:accept":()=>{let e=_[T];e&&(f(e.name),u(`plugin-list`))}},{context:`Select`,isActive:l===`marketplace-list`}),v({"select:previous":()=>{T>0&&k.handleSelectionChange(T-1,re)},"select:next":()=>{T<b.length-1&&k.handleSelectionChange(T+1,re)},"select:accept":()=>{if(T===b.length&&E.size>0)P();else if(T<b.length){let e=b[T];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(h(e),u(`plugin-details`),j(0),oe(null)))}}},{context:`Select`,isActive:l===`plugin-list`}),v({"plugin:toggle":()=>{if(T<b.length){let e=b[T];if(e&&!e.isInstalled){let t=new Set(E);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),D(t)}}},"plugin:install":()=>{E.size>0&&P()}},{context:`Plugin`,isActive:l===`plugin-list`});let le=_r.useMemo(()=>{if(!m)return[];let e=m.entry.homepage;return cr(e,sr(m))},[m]);if(v({"select:previous":()=>{A>0&&j(A-1)},"select:next":()=>{A<le.length-1&&j(A+1)},"select:accept":()=>{if(!m)return;let e=le[A]?.action,t=m.entry.homepage,n=sr(m);e===`install-user`?F(m,`user`):e===`install-project`?F(m,`project`):e===`install-local`?F(m,`local`):e===`homepage`&&t?Ut(t):e===`github`&&n?Ut(`https://github.com/${n}`):e===`back`&&(u(`plugin-list`),h(null))}},{context:`Select`,isActive:l===`plugin-details`&&!!m}),typeof l==`object`&&l.type===`plugin-options`){let{plugin:e,pluginId:t}=l;function n(e){r(e),o&&o(),i({type:`menu`})}return(0,G.jsx)(er,{plugin:e,pluginId:t,onDone:(t,r)=>{switch(t){case`configured`:n(`✓ Installed and configured ${e.name}. Run /reload-plugins to apply.`);break;case`skipped`:n(`✓ Installed ${e.name}. Run /reload-plugins to apply.`);break;case`error`:n(`Installed but failed to save config: ${r}`);break}}})}if(ee)return(0,G.jsx)(p,{children:`Loading…`});if(e)return(0,G.jsx)(p,{color:`error`,children:e});if(l===`marketplace-list`)return _.length===0?(0,G.jsxs)(C,{flexDirection:`column`,children:[(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsx)(p,{bold:!0,children:`Select marketplace`})}),(0,G.jsx)(p,{children:`No marketplaces configured.`}),(0,G.jsxs)(p,{dimColor:!0,children:[`Add a marketplace first using `,`'Add marketplace'`,`.`]}),(0,G.jsx)(C,{marginTop:1,paddingLeft:1,children:(0,G.jsx)(p,{dimColor:!0,children:(0,G.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})})})]}):(0,G.jsxs)(C,{flexDirection:`column`,children:[(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsx)(p,{bold:!0,children:`Select marketplace`})}),se&&(0,G.jsx)(C,{marginBottom:1,flexDirection:`column`,children:(0,G.jsxs)(p,{color:`warning`,children:[a.warning,` `,se]})}),_.map((e,t)=>(0,G.jsxs)(C,{flexDirection:`column`,marginBottom:+(t<_.length-1),children:[(0,G.jsx)(C,{children:(0,G.jsxs)(p,{color:T===t?`suggestion`:void 0,children:[T===t?a.pointer:` `,` `,e.name]})}),(0,G.jsx)(C,{marginLeft:2,children:(0,G.jsxs)(p,{dimColor:!0,children:[e.totalPlugins,` `,Se(e.totalPlugins,`plugin`),` available`,e.installedCount>0&&` · ${e.installedCount} already installed`,e.source&&` · ${e.source}`]})})]},e.name)),(0,G.jsx)(C,{marginTop:1,children:(0,G.jsx)(p,{dimColor:!0,italic:!0,children:(0,G.jsxs)(g,{children:[(0,G.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,G.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]});if(l===`plugin-details`&&m){let e=m.entry.homepage,t=cr(e,sr(m));return(0,G.jsxs)(C,{flexDirection:`column`,children:[(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsx)(p,{bold:!0,children:`Plugin Details`})}),(0,G.jsxs)(C,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(p,{bold:!0,children:m.entry.name}),m.entry.version&&(0,G.jsxs)(p,{dimColor:!0,children:[`Version: `,m.entry.version]}),m.entry.description&&(0,G.jsx)(C,{marginTop:1,children:(0,G.jsx)(p,{children:m.entry.description})}),m.entry.author&&(0,G.jsx)(C,{marginTop:1,children:(0,G.jsxs)(p,{dimColor:!0,children:[`By:`,` `,typeof m.entry.author==`string`?m.entry.author:m.entry.author.name]})})]}),(0,G.jsxs)(C,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(p,{bold:!0,children:`Will install:`}),m.entry.commands&&(0,G.jsxs)(p,{dimColor:!0,children:[`· Commands:`,` `,Array.isArray(m.entry.commands)?m.entry.commands.join(`, `):Object.keys(m.entry.commands).join(`, `)]}),m.entry.agents&&(0,G.jsxs)(p,{dimColor:!0,children:[`· Agents:`,` `,Array.isArray(m.entry.agents)?m.entry.agents.join(`, `):Object.keys(m.entry.agents).join(`, `)]}),m.entry.hooks&&(0,G.jsxs)(p,{dimColor:!0,children:[`· Hooks: `,Object.keys(m.entry.hooks).join(`, `)]}),m.entry.mcpServers&&(0,G.jsxs)(p,{dimColor:!0,children:[`· MCP Servers:`,` `,Array.isArray(m.entry.mcpServers)?m.entry.mcpServers.join(`, `):typeof m.entry.mcpServers==`object`?Object.keys(m.entry.mcpServers).join(`, `):`configured`]}),!m.entry.commands&&!m.entry.agents&&!m.entry.hooks&&!m.entry.mcpServers&&(0,G.jsx)(G.Fragment,{children:typeof m.entry.source==`object`&&`source`in m.entry.source&&(m.entry.source.source===`github`||m.entry.source.source===`url`||m.entry.source.source===`npm`||m.entry.source.source===`pip`)?(0,G.jsx)(p,{dimColor:!0,children:`· Component summary not available for remote plugin`}):(0,G.jsx)(p,{dimColor:!0,children:`· Components will be discovered at installation`})})]}),(0,G.jsx)(ir,{}),ae&&(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsxs)(p,{color:`error`,children:[`Error: `,ae]})}),(0,G.jsx)(C,{flexDirection:`column`,children:t.map((e,t)=>(0,G.jsxs)(C,{children:[A===t&&(0,G.jsx)(p,{children:`> `}),A!==t&&(0,G.jsx)(p,{children:` `}),(0,G.jsx)(p,{bold:A===t,children:M&&e.action===`install`?`Installing…`:e.label})]},e.action))}),(0,G.jsx)(C,{marginTop:1,paddingLeft:1,children:(0,G.jsx)(p,{dimColor:!0,children:(0,G.jsxs)(g,{children:[(0,G.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,G.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(b.length===0)return(0,G.jsxs)(C,{flexDirection:`column`,children:[(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsx)(p,{bold:!0,children:`Install plugins`})}),(0,G.jsx)(p,{dimColor:!0,children:`No new plugins available to install.`}),(0,G.jsx)(p,{dimColor:!0,children:`All plugins from this marketplace are already installed.`}),(0,G.jsx)(C,{marginLeft:3,children:(0,G.jsx)(p,{dimColor:!0,italic:!0,children:(0,G.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})})})]});let fe=k.getVisibleItems(b);return(0,G.jsxs)(C,{flexDirection:`column`,children:[(0,G.jsx)(C,{marginBottom:1,children:(0,G.jsx)(p,{bold:!0,children:`Install Plugins`})}),k.scrollPosition.canScrollUp&&(0,G.jsx)(C,{children:(0,G.jsxs)(p,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),fe.map((t,n)=>{let r=T===k.toActualIndex(n),i=E.has(t.pluginId),o=O.has(t.pluginId);return(0,G.jsxs)(C,{flexDirection:`column`,marginBottom:n===fe.length-1&&!e?0:1,children:[(0,G.jsxs)(C,{children:[(0,G.jsxs)(p,{color:r?`suggestion`:void 0,children:[r?a.pointer:` `,` `]}),(0,G.jsxs)(p,{color:t.isInstalled?`success`:void 0,children:[t.isInstalled?a.tick:o?a.ellipsis:i?a.radioOn:a.radioOff,` `,t.entry.name,t.entry.category&&(0,G.jsxs)(p,{dimColor:!0,children:[` [`,t.entry.category,`]`]}),t.entry.tags?.includes(`community-managed`)&&(0,G.jsx)(p,{dimColor:!0,children:` [Community Managed]`}),t.isInstalled&&(0,G.jsx)(p,{dimColor:!0,children:` (installed)`}),ne&&d===`claude-plugins-official`&&(0,G.jsxs)(p,{dimColor:!0,children:[` · `,un(ne.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,G.jsxs)(C,{marginLeft:4,children:[(0,G.jsx)(p,{dimColor:!0,children:be(t.entry.description,60)}),t.entry.version&&(0,G.jsxs)(p,{dimColor:!0,children:[` · v`,t.entry.version]})]})]},t.pluginId)}),k.scrollPosition.canScrollDown&&(0,G.jsx)(C,{children:(0,G.jsxs)(p,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,G.jsx)(C,{marginTop:1,children:(0,G.jsxs)(p,{color:`error`,children:[a.cross,` `,e]})}),(0,G.jsx)(lr,{hasSelection:E.size>0})]})}var _r,vr,G,yr=e((()=>{i(),_r=t(l(),1),vr=t(l(),1),L(),x(),Gt(),ye(),Wt(),le(),F(),lt(),sn(),Pe(),rt(),Ct(),At(),Ft(),Fe(),we(),xe(),rr(),or(),dr(),hr(),G=w()}));function br({error:e,setError:t,result:n,setResult:r,setViewState:i,onInstallComplete:o,onSearchModeChange:c,targetPlugin:l}){let[u,m]=(0,K.useState)(`plugin-list`),[h,_]=(0,K.useState)(null),[y,b]=(0,K.useState)([]),[x,ee]=(0,K.useState)(!0),[S,w]=(0,K.useState)(null),[T,re]=(0,K.useState)(!1),E=(0,K.useCallback)(e=>{re(e),c?.(e)},[c]),{query:D,setQuery:O,cursorOffset:ie}=xn({isActive:u===`plugin-list`&&T&&!x,onExit:()=>{E(!1)}}),k=d(),{columns:A}=s(),j=(0,K.useMemo)(()=>{if(!D)return y;let e=D.toLowerCase();return y.filter(t=>t.entry.name.toLowerCase().includes(e)||t.entry.description?.toLowerCase().includes(e)||t.marketplaceName.toLowerCase().includes(e))},[y,D]),[M,N]=(0,K.useState)(0),[ae,oe]=(0,K.useState)(new Set),[se,ce]=(0,K.useState)(new Set),P=fr({totalItems:j.length,selectedIndex:M});(0,K.useEffect)(()=>{N(0)},[D]);let[F,le]=(0,K.useState)(0),[fe,I]=(0,K.useState)(!1),[pe,me]=(0,K.useState)(null),[he,ge]=(0,K.useState)(null),[_e,ye]=(0,K.useState)(null);(0,K.useEffect)(()=>{async function e(){try{let e=await je(),{marketplaces:n,failures:r}=await St(e),i=[];for(let{name:e,data:t}of n)if(t)for(let n of t.plugins){let t=Xe(n.name,e);i.push({entry:n,marketplaceName:e,pluginId:t,isInstalled:z(t)})}let a=i.filter(e=>!e.isInstalled&&!mt(e.pluginId));try{let e=await dn();w(e),e?a.sort((t,n)=>{let r=e.get(t.pluginId)??0,i=e.get(n.pluginId)??0;return r===i?t.entry.name.localeCompare(n.entry.name):i-r}):a.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}catch(e){ue(`Failed to fetch install counts: ${de(e)}`),a.sort((e,t)=>e.entry.name.localeCompare(t.entry.name))}b(a);let o=Object.keys(e).length;a.length===0&&ye(await xt({configuredMarketplaceCount:o,failedMarketplaceCount:r.length}));let s=$e(r,ve(n,e=>e.data!==null));if(s)if(s.type===`warning`)ge(s.message+`. Showing available plugins.`);else throw Error(s.message);if(l){let e=i.find(e=>e.entry.name===l);e?e.isInstalled?t(`Plugin '${e.pluginId}' is already installed. Use '/plugin' to manage existing plugins.`):(_(e),m(`plugin-details`)):t(`Plugin "${l}" not found in any marketplace`)}}catch(e){t(e instanceof Error?e.message:`Failed to load plugins`)}finally{ee(!1)}}e()},[t,l]);let xe=async()=>{if(ae.size===0)return;let e=y.filter(e=>ae.has(e.pluginId));ce(new Set(e.map(e=>e.pluginId)));let n=0,a=0,s=[];for(let t of e){let e=await Ve({pluginId:t.pluginId,entry:t.entry,marketplaceName:t.marketplaceName,scope:`user`});e.success?n++:(a++,s.push({name:t.entry.name,reason:e.error}))}ce(new Set),oe(new Set),dt(),a===0?r(`✓ Installed ${n} ${Se(n,`plugin`)}. Run /reload-plugins to activate.`):n===0?t(`Failed to install: ${Tt(s,!0)}`):r(`✓ Installed ${n} of ${n+a} plugins. Failed: ${Tt(s,!1)}. Run /reload-plugins to activate successfully installed plugins.`),n>0&&o&&await o(),i({type:`menu`})},Ce=async(e,t=`user`)=>{I(!0),me(null);let n=await Ve({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:t});if(n.success){let t=await $n(e.pluginId);if(t){I(!1),m({type:`plugin-options`,plugin:t,pluginId:e.pluginId});return}r(n.message),o&&await o(),i({type:`menu`})}else I(!1),me(n.error)};(0,K.useEffect)(()=>{e&&r(e)},[e,r]),te(`confirm:no`,()=>{m(`plugin-list`),_(null)},{context:`Confirmation`,isActive:u===`plugin-details`}),te(`confirm:no`,()=>{i({type:`menu`})},{context:`Confirmation`,isActive:u===`plugin-list`&&!T}),ne((e,t)=>{let n=!t.ctrl&&!t.meta;T||(e===`/`&&n?(E(!0),O(``)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==`i`&&(E(!0),O(e)))},{isActive:u===`plugin-list`&&!x}),v({"select:previous":()=>{M===0?E(!0):P.handleSelectionChange(M-1,N)},"select:next":()=>{M<j.length-1&&P.handleSelectionChange(M+1,N)},"select:accept":()=>{if(M===j.length&&ae.size>0)xe();else if(M<j.length){let e=j[M];e&&(e.isInstalled?i({type:`manage-plugins`,targetPlugin:e.entry.name,targetMarketplace:e.marketplaceName}):(_(e),m(`plugin-details`),le(0),me(null)))}}},{context:`Select`,isActive:u===`plugin-list`&&!T}),v({"plugin:toggle":()=>{if(M<j.length){let e=j[M];if(e&&!e.isInstalled){let t=new Set(ae);t.has(e.pluginId)?t.delete(e.pluginId):t.add(e.pluginId),oe(t)}}},"plugin:install":()=>{ae.size>0&&xe()}},{context:`Plugin`,isActive:u===`plugin-list`&&!T});let we=Cr.useMemo(()=>{if(!h)return[];let e=h.entry.homepage;return cr(e,sr(h))},[h]);if(v({"select:previous":()=>{F>0&&le(F-1)},"select:next":()=>{F<we.length-1&&le(F+1)},"select:accept":()=>{if(!h)return;let e=we[F]?.action,t=h.entry.homepage,n=sr(h);e===`install-user`?Ce(h,`user`):e===`install-project`?Ce(h,`project`):e===`install-local`?Ce(h,`local`):e===`homepage`&&t?Ut(t):e===`github`&&n?Ut(`https://github.com/${n}`):e===`back`&&(m(`plugin-list`),_(null))}},{context:`Select`,isActive:u===`plugin-details`&&!!h}),typeof u==`object`&&u.type===`plugin-options`){let{plugin:e,pluginId:t}=u;function n(e){r(e),o&&o(),i({type:`menu`})}return(0,q.jsx)(er,{plugin:e,pluginId:t,onDone:(t,r)=>{switch(t){case`configured`:n(`✓ Installed and configured ${e.name}. Run /reload-plugins to apply.`);break;case`skipped`:n(`✓ Installed ${e.name}. Run /reload-plugins to apply.`);break;case`error`:n(`Installed but failed to save config: ${r}`);break}}})}if(x)return(0,q.jsx)(p,{children:`Loading…`});if(e)return(0,q.jsx)(p,{color:`error`,children:e});if(u===`plugin-details`&&h){let e=h.entry.homepage,t=cr(e,sr(h));return(0,q.jsxs)(C,{flexDirection:`column`,children:[(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsx)(p,{bold:!0,children:`Plugin details`})}),(0,q.jsxs)(C,{flexDirection:`column`,marginBottom:1,children:[(0,q.jsx)(p,{bold:!0,children:h.entry.name}),(0,q.jsxs)(p,{dimColor:!0,children:[`from `,h.marketplaceName]}),h.entry.version&&(0,q.jsxs)(p,{dimColor:!0,children:[`Version: `,h.entry.version]}),h.entry.description&&(0,q.jsx)(C,{marginTop:1,children:(0,q.jsx)(p,{children:h.entry.description})}),h.entry.author&&(0,q.jsx)(C,{marginTop:1,children:(0,q.jsxs)(p,{dimColor:!0,children:[`By:`,` `,typeof h.entry.author==`string`?h.entry.author:h.entry.author.name]})})]}),(0,q.jsx)(ir,{}),pe&&(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsxs)(p,{color:`error`,children:[`Error: `,pe]})}),(0,q.jsx)(C,{flexDirection:`column`,children:t.map((e,t)=>(0,q.jsxs)(C,{children:[F===t&&(0,q.jsx)(p,{children:`> `}),F!==t&&(0,q.jsx)(p,{children:` `}),(0,q.jsx)(p,{bold:F===t,children:fe&&e.action.startsWith(`install-`)?`Installing…`:e.label})]},e.action))}),(0,q.jsx)(C,{marginTop:1,children:(0,q.jsx)(p,{dimColor:!0,children:(0,q.jsxs)(g,{children:[(0,q.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,q.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(y.length===0)return(0,q.jsxs)(C,{flexDirection:`column`,children:[(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsx)(p,{bold:!0,children:`Discover plugins`})}),(0,q.jsx)(Sr,{reason:_e}),(0,q.jsx)(C,{marginTop:1,children:(0,q.jsx)(p,{dimColor:!0,italic:!0,children:`Esc to go back`})})]});let Te=P.getVisibleItems(j);return(0,q.jsxs)(C,{flexDirection:`column`,children:[(0,q.jsxs)(C,{children:[(0,q.jsx)(p,{bold:!0,children:`Discover plugins`}),P.needsPagination&&(0,q.jsxs)(p,{dimColor:!0,children:[` `,`(`,P.scrollPosition.current,`/`,P.scrollPosition.total,`)`]})]}),(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsx)(f,{query:D,isFocused:T,isTerminalFocused:k,width:A-4,cursorOffset:ie})}),he&&(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsxs)(p,{color:`warning`,children:[a.warning,` `,he]})}),j.length===0&&D&&(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsxs)(p,{dimColor:!0,children:[`No plugins match "`,D,`"`]})}),P.scrollPosition.canScrollUp&&(0,q.jsx)(C,{children:(0,q.jsxs)(p,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),Te.map((t,n)=>{let r=M===P.toActualIndex(n),i=ae.has(t.pluginId),o=se.has(t.pluginId);return(0,q.jsxs)(C,{flexDirection:`column`,marginBottom:n===Te.length-1&&!e?0:1,children:[(0,q.jsxs)(C,{children:[(0,q.jsxs)(p,{color:r&&!T?`suggestion`:void 0,children:[r&&!T?a.pointer:` `,` `]}),(0,q.jsxs)(p,{children:[o?a.ellipsis:i?a.radioOn:a.radioOff,` `,t.entry.name,(0,q.jsxs)(p,{dimColor:!0,children:[` · `,t.marketplaceName]}),t.entry.tags?.includes(`community-managed`)&&(0,q.jsx)(p,{dimColor:!0,children:` [Community Managed]`}),S&&t.marketplaceName===`claude-plugins-official`&&(0,q.jsxs)(p,{dimColor:!0,children:[` · `,un(S.get(t.pluginId)??0),` installs`]})]})]}),t.entry.description&&(0,q.jsx)(C,{marginLeft:4,children:(0,q.jsx)(p,{dimColor:!0,children:be(t.entry.description,60)})})]},`${P.startIndex}-${t.pluginId}`)}),P.scrollPosition.canScrollDown&&(0,q.jsx)(C,{children:(0,q.jsxs)(p,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),e&&(0,q.jsx)(C,{marginTop:1,children:(0,q.jsxs)(p,{color:`error`,children:[a.cross,` `,e]})}),(0,q.jsx)(xr,{hasSelection:ae.size>0,canToggle:M<j.length&&!j[M]?.isInstalled})]})}function xr({hasSelection:e,canToggle:t}){return(0,q.jsx)(C,{marginTop:1,children:(0,q.jsx)(p,{dimColor:!0,italic:!0,children:(0,q.jsxs)(g,{children:[e&&(0,q.jsx)(R,{action:`plugin:install`,context:`Plugin`,fallback:`i`,description:`install`,bold:!0}),(0,q.jsx)(p,{children:`type to search`}),t&&(0,q.jsx)(R,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,q.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,q.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})}function Sr({reason:e}){switch(e){case`git-not-installed`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(p,{dimColor:!0,children:`Git is required to install marketplaces.`}),(0,q.jsx)(p,{dimColor:!0,children:`Please install git and restart Claude Code.`})]});case`all-blocked-by-policy`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(p,{dimColor:!0,children:`Your organization policy does not allow any external marketplaces.`}),(0,q.jsx)(p,{dimColor:!0,children:`Contact your administrator.`})]});case`policy-restricts-sources`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(p,{dimColor:!0,children:`Your organization restricts which marketplaces can be added.`}),(0,q.jsx)(p,{dimColor:!0,children:`Switch to the Marketplaces tab to view allowed sources.`})]});case`all-marketplaces-failed`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(p,{dimColor:!0,children:`Failed to load marketplace data.`}),(0,q.jsx)(p,{dimColor:!0,children:`Check your network connection.`})]});case`all-plugins-installed`:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(p,{dimColor:!0,children:`All available plugins are already installed.`}),(0,q.jsx)(p,{dimColor:!0,children:`Check for new plugins later or add more marketplaces.`})]});default:return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(p,{dimColor:!0,children:`No plugins available.`}),(0,q.jsx)(p,{dimColor:!0,children:`Add a marketplace first using the Marketplaces tab.`})]})}}var Cr,K,q,wr=e((()=>{i(),Cr=t(l(),1),K=t(l(),1),L(),bn(),x(),Sn(),Kt(),Gt(),ye(),Wt(),le(),F(),lt(),sn(),Pe(),rt(),Ct(),At(),Ft(),Fe(),we(),xe(),rr(),or(),dr(),hr(),q=w()}));function Tr({setViewState:e,error:t,setError:n,setResult:r,exitState:i,onManageComplete:o,targetMarketplace:s,action:c}){let[l,u]=(0,Dr.useState)([]),[d,f]=(0,Dr.useState)(!0),[m,h]=(0,Dr.useState)(0),[_,y]=(0,Dr.useState)(!1),[b,x]=(0,Dr.useState)(null),[ee,S]=(0,Dr.useState)(null),[w,T]=(0,Dr.useState)(null),[E,D]=(0,Dr.useState)(`list`),[O,k]=(0,Dr.useState)(null),[A,j]=(0,Dr.useState)(0),N=(0,Dr.useRef)(!1);(0,Dr.useEffect)(()=>{async function e(){try{let e=await je(),{enabled:r,disabled:i}=await Lt(),a=[...r,...i],{marketplaces:o,failures:l}=await St(e),d=[];for(let{name:e,config:t,data:n}of o){let r=a.filter(t=>t.source.endsWith(`@${e}`));d.push({name:e,source:_t(t.source),lastUpdated:t.lastUpdated,pluginCount:n?.plugins.length,installedPlugins:r,pendingUpdate:!1,pendingRemove:!1,autoUpdate:M(e,t)})}d.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),u(d);let f=$e(l,ve(o,e=>e.data!==null));if(f)if(f.type===`warning`)x(f.message);else throw Error(f.message);if(s&&!N.current&&!t){N.current=!0;let e=d.findIndex(e=>e.name===s);if(e>=0){let t=d[e];if(c){h(e+1);let t=[...d];c===`update`?t[e].pendingUpdate=!0:c===`remove`&&(t[e].pendingRemove=!0),u(t),setTimeout(ce,100,t)}else t&&(h(e+1),k(t),D(`details`))}else n&&n(`Marketplace not found: ${s}`)}}catch(e){n&&n(e instanceof Error?e.message:`Failed to load marketplaces`),x(e instanceof Error?e.message:`Failed to load marketplaces`)}finally{f(!1)}}e()},[s,c,t]);let oe=()=>l.some(e=>e.pendingUpdate||e.pendingRemove),se=()=>({updateCount:ve(l,e=>e.pendingUpdate),removeCount:ve(l,e=>e.pendingRemove)}),ce=async t=>{let i=t||l,s=E===`details`;y(!0),x(null),S(null),T(null);try{let t=re(`userSettings`),n=0,c=0,l=new Set;for(let e of i){if(e.pendingRemove){if(e.installedPlugins&&e.installedPlugins.length>0){let n={...t?.enabledPlugins};for(let t of e.installedPlugins){let r=Xe(t.name,e.name);n[r]=!1}ie(`userSettings`,{enabledPlugins:n})}await Ee(e.name),c++,I(`tengu_marketplace_removed`,{marketplace_name:e.name,plugins_uninstalled:e.installedPlugins?.length||0});continue}e.pendingUpdate&&(await qe(e.name,e=>{T(e)}),n++,l.add(e.name.toLowerCase()),I(`tengu_marketplace_updated`,{marketplace_name:e.name}))}let d=0;l.size>0&&(d=(await Cn(l)).length),dt(),o&&await o();let f=await je(),{enabled:p,disabled:m}=await Lt(),h=[...p,...m],{marketplaces:g}=await St(f),_=[];for(let{name:e,config:t,data:n}of g){let r=h.filter(t=>t.source.endsWith(`@${e}`));_.push({name:e,source:_t(t.source),lastUpdated:t.lastUpdated,pluginCount:n?.plugins.length,installedPlugins:r,pendingUpdate:!1,pendingRemove:!1,autoUpdate:M(e,t)})}if(_.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),u(_),s&&O){let e=_.find(e=>e.name===O.name);e&&k(e)}let v=[];if(n>0){let e=d>0?` (${d} ${Se(d,`plugin`)} bumped)`:``;v.push(`Updated ${n} ${Se(n,`marketplace`)}${e}`)}if(c>0&&v.push(`Removed ${c} ${Se(c,`marketplace`)}`),v.length>0){let t=`${a.tick} ${v.join(`, `)}`;s?S(t):(r(t),setTimeout(e,2e3,{type:`menu`}))}else s||e({type:`menu`})}catch(e){let t=de(e);x(t),n&&n(t)}finally{y(!1),T(null)}},P=async()=>{if(!O)return;let e=l.map(e=>e.name===O.name?{...e,pendingRemove:!0}:e);u(e),await ce(e)},F=e=>{if(!e)return[];let t=[{label:`Browse plugins (${e.pluginCount??0})`,value:`browse`},{label:`Update marketplace`,secondaryLabel:e.lastUpdated?`(last updated ${new Date(e.lastUpdated).toLocaleDateString()})`:void 0,value:`update`}];return ae()||t.push({label:e.autoUpdate?`Disable auto-update`:`Enable auto-update`,value:`toggle-auto-update`}),t.push({label:`Remove marketplace`,value:`remove`}),t},le=async e=>{let t=!e.autoUpdate;try{await vt(e.name,t),u(n=>n.map(n=>n.name===e.name?{...n,autoUpdate:t}:n)),k(e=>e&&{...e,autoUpdate:t})}catch(e){x(e instanceof Error?e.message:`Failed to update setting`)}};if(te(`confirm:no`,()=>{D(`list`),j(0)},{context:`Confirmation`,isActive:!_&&(E===`details`||E===`confirm-remove`)}),te(`confirm:no`,()=>{u(e=>e.map(e=>({...e,pendingUpdate:!1,pendingRemove:!1}))),h(0)},{context:`Confirmation`,isActive:!_&&E===`list`&&oe()}),te(`confirm:no`,()=>{e({type:`menu`})},{context:`Confirmation`,isActive:!_&&E===`list`&&!oe()}),v({"select:previous":()=>h(e=>Math.max(0,e-1)),"select:next":()=>{let e=l.length+1;h(t=>Math.min(e-1,t+1))},"select:accept":()=>{let t=m-1;if(m===0)e({type:`add-marketplace`});else if(oe())ce();else{let e=l[t];e&&(k(e),D(`details`),j(0))}}},{context:`Select`,isActive:!_&&E===`list`}),ne(e=>{let t=m-1;if((e===`u`||e===`U`)&&t>=0)u(e=>e.map((e,n)=>n===t?{...e,pendingUpdate:!e.pendingUpdate,pendingRemove:e.pendingUpdate?e.pendingRemove:!1}:e));else if((e===`r`||e===`R`)&&t>=0){let e=l[t];e&&(k(e),D(`confirm-remove`))}},{isActive:!_&&E===`list`}),v({"select:previous":()=>j(e=>Math.max(0,e-1)),"select:next":()=>{let e=F(O);j(t=>Math.min(e.length-1,t+1))},"select:accept":()=>{if(!O)return;let t=F(O)[A];if(t?.value===`browse`)e({type:`browse-marketplace`,targetMarketplace:O.name});else if(t?.value===`update`){let e=l.map(e=>e.name===O.name?{...e,pendingUpdate:!0}:e);u(e),ce(e)}else t?.value===`toggle-auto-update`?le(O):t?.value===`remove`&&D(`confirm-remove`)}},{context:`Select`,isActive:!_&&E===`details`}),ne(e=>{e===`y`||e===`Y`?P():(e===`n`||e===`N`)&&(D(`list`),k(null))},{isActive:!_&&E===`confirm-remove`}),d)return(0,J.jsx)(p,{children:`Loading marketplaces…`});if(l.length===0)return(0,J.jsxs)(C,{flexDirection:`column`,children:[(0,J.jsx)(C,{marginBottom:1,children:(0,J.jsx)(p,{bold:!0,children:`Manage marketplaces`})}),(0,J.jsxs)(C,{flexDirection:`row`,gap:1,children:[(0,J.jsxs)(p,{color:`suggestion`,children:[a.pointer,` +`]}),(0,J.jsx)(p,{bold:!0,color:`suggestion`,children:`Add Marketplace`})]}),(0,J.jsx)(C,{marginLeft:3,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:i.pending?(0,J.jsxs)(J.Fragment,{children:[`Press `,i.keyName,` again to go back`]}):(0,J.jsxs)(g,{children:[(0,J.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,J.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]});if(E===`confirm-remove`&&O){let e=O.installedPlugins?.length||0;return(0,J.jsxs)(C,{flexDirection:`column`,children:[(0,J.jsxs)(p,{bold:!0,color:`warning`,children:[`Remove marketplace `,(0,J.jsx)(p,{italic:!0,children:O.name}),`?`]}),(0,J.jsxs)(C,{flexDirection:`column`,children:[e>0&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsxs)(p,{color:`warning`,children:[`This will also uninstall `,e,` `,Se(e,`plugin`),` from this marketplace:`]})}),O.installedPlugins&&O.installedPlugins.length>0&&(0,J.jsx)(C,{flexDirection:`column`,marginTop:1,marginLeft:2,children:O.installedPlugins.map(e=>(0,J.jsxs)(p,{dimColor:!0,children:[`• `,e.name]},e.name))}),(0,J.jsx)(C,{marginTop:1,children:(0,J.jsxs)(p,{children:[`Press `,(0,J.jsx)(p,{bold:!0,children:`y`}),` to confirm or `,(0,J.jsx)(p,{bold:!0,children:`n`}),` to cancel`]})})]})]})}if(E===`details`&&O){let e=O.pendingUpdate||_,t=F(O);return(0,J.jsxs)(C,{flexDirection:`column`,children:[(0,J.jsx)(p,{bold:!0,children:O.name}),(0,J.jsx)(p,{dimColor:!0,children:O.source}),(0,J.jsx)(C,{marginTop:1,children:(0,J.jsxs)(p,{children:[O.pluginCount||0,` available `,Se(O.pluginCount||0,`plugin`)]})}),O.installedPlugins&&O.installedPlugins.length>0&&(0,J.jsxs)(C,{flexDirection:`column`,marginTop:1,children:[(0,J.jsxs)(p,{bold:!0,children:[`Installed plugins (`,O.installedPlugins.length,`):`]}),(0,J.jsx)(C,{flexDirection:`column`,marginLeft:1,children:O.installedPlugins.map(e=>(0,J.jsxs)(C,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(p,{children:a.bullet}),(0,J.jsxs)(C,{flexDirection:`column`,children:[(0,J.jsx)(p,{children:e.name}),(0,J.jsx)(p,{dimColor:!0,children:e.manifest.description})]})]},e.name))})]}),e&&(0,J.jsxs)(C,{marginTop:1,flexDirection:`column`,children:[(0,J.jsx)(p,{color:`claude`,children:`Updating marketplace…`}),w&&(0,J.jsx)(p,{dimColor:!0,children:w})]}),!e&&ee&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{color:`claude`,children:ee})}),!e&&b&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{color:`error`,children:b})}),!e&&(0,J.jsx)(C,{flexDirection:`column`,marginTop:1,children:t.map((e,t)=>{if(!e)return null;let n=t===A;return(0,J.jsxs)(C,{children:[(0,J.jsxs)(p,{color:n?`suggestion`:void 0,children:[n?a.pointer:` `,` `,e.label]}),e.secondaryLabel&&(0,J.jsxs)(p,{dimColor:!0,children:[` `,e.secondaryLabel]})]},e.value)})}),!e&&!ae()&&O.autoUpdate&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{dimColor:!0,children:`Auto-update enabled. Claude Code will automatically update this marketplace and its installed plugins.`})}),(0,J.jsx)(C,{marginLeft:3,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:e?(0,J.jsx)(J.Fragment,{children:`Please wait…`}):(0,J.jsxs)(g,{children:[(0,J.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,J.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})})]})}let{updateCount:ue,removeCount:fe}=se();return(0,J.jsxs)(C,{flexDirection:`column`,children:[(0,J.jsx)(C,{marginBottom:1,children:(0,J.jsx)(p,{bold:!0,children:`Manage marketplaces`})}),(0,J.jsxs)(C,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(p,{color:m===0?`suggestion`:void 0,children:[m===0?a.pointer:` `,` +`]}),(0,J.jsx)(p,{bold:!0,color:m===0?`suggestion`:void 0,children:`Add Marketplace`})]}),(0,J.jsx)(C,{flexDirection:`column`,children:l.map((e,t)=>{let n=t+1===m,r=[];return e.pendingUpdate&&r.push(`UPDATE`),e.pendingRemove&&r.push(`REMOVE`),(0,J.jsxs)(C,{flexDirection:`row`,gap:1,marginBottom:1,children:[(0,J.jsxs)(p,{color:n?`suggestion`:void 0,children:[n?a.pointer:` `,` `,e.pendingRemove?a.cross:a.bullet]}),(0,J.jsxs)(C,{flexDirection:`column`,flexGrow:1,children:[(0,J.jsxs)(C,{flexDirection:`row`,gap:1,children:[(0,J.jsxs)(p,{bold:!0,strikethrough:e.pendingRemove,dimColor:e.pendingRemove,children:[e.name===`claude-plugins-official`&&(0,J.jsx)(p,{color:`claude`,children:`✻ `}),e.name,e.name===`claude-plugins-official`&&(0,J.jsx)(p,{color:`claude`,children:` ✻`})]}),r.length>0&&(0,J.jsxs)(p,{color:`warning`,children:[`[`,r.join(`, `),`]`]})]}),(0,J.jsx)(p,{dimColor:!0,children:e.source}),(0,J.jsxs)(p,{dimColor:!0,children:[e.pluginCount!==void 0&&(0,J.jsxs)(J.Fragment,{children:[e.pluginCount,` available`]}),e.installedPlugins&&e.installedPlugins.length>0&&(0,J.jsxs)(J.Fragment,{children:[` • `,e.installedPlugins.length,` installed`]}),e.lastUpdated&&(0,J.jsxs)(J.Fragment,{children:[` • Updated `,new Date(e.lastUpdated).toLocaleDateString()]})]})]})]},e.name)})}),oe()&&(0,J.jsxs)(C,{marginTop:1,flexDirection:`column`,children:[(0,J.jsxs)(p,{children:[(0,J.jsx)(p,{bold:!0,children:`Pending changes:`}),` `,(0,J.jsx)(p,{dimColor:!0,children:`Enter to apply`})]}),ue>0&&(0,J.jsxs)(p,{children:[`• Update `,ue,` `,Se(ue,`marketplace`)]}),fe>0&&(0,J.jsxs)(p,{color:`warning`,children:[`• Remove `,fe,` `,Se(fe,`marketplace`)]})]}),_&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{color:`claude`,children:`Processing changes…`})}),b&&(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{color:`error`,children:b})}),(0,J.jsx)(Er,{exitState:i,hasPendingActions:oe()})]})}function Er({exitState:e,hasPendingActions:t}){return e.pending?(0,J.jsx)(C,{marginTop:1,children:(0,J.jsxs)(p,{dimColor:!0,italic:!0,children:[`Press `,e.keyName,` again to go back`]})}):(0,J.jsx)(C,{marginTop:1,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:(0,J.jsxs)(g,{children:[t&&(0,J.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`apply changes`}),!t&&(0,J.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),!t&&(0,J.jsx)(h,{shortcut:`u`,action:`update`}),!t&&(0,J.jsx)(h,{shortcut:`r`,action:`remove`}),(0,J.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:t?`cancel`:`go back`})]})})})}var Dr,J,Or=e((()=>{i(),l(),Dr=t(l(),1),fe(),L(),x(),Gt(),ye(),oe(),F(),lt(),rt(),Ct(),wn(),Pt(),N(),j(),we(),J=w()}));function kr(e){switch(e.type){case`path-not-found`:return`${e.component} path not found: ${e.path}`;case`git-auth-failed`:return`Git ${e.authType.toUpperCase()} authentication failed for ${e.gitUrl}`;case`git-timeout`:return`Git ${e.operation} timed out for ${e.gitUrl}`;case`network-error`:return`Network error accessing ${e.url}${e.details?`: ${e.details}`:``}`;case`manifest-parse-error`:return`Failed to parse manifest at ${e.manifestPath}: ${e.parseError}`;case`manifest-validation-error`:return`Invalid manifest at ${e.manifestPath}: ${e.validationErrors.join(`, `)}`;case`plugin-not-found`:return`Plugin "${e.pluginId}" not found in marketplace "${e.marketplace}"`;case`marketplace-not-found`:return`Marketplace "${e.marketplace}" not found`;case`marketplace-load-failed`:return`Failed to load marketplace "${e.marketplace}": ${e.reason}`;case`mcp-config-invalid`:return`Invalid MCP server config for "${e.serverName}": ${e.validationError}`;case`mcp-server-suppressed-duplicate`:{let t=e.duplicateOf.startsWith(`plugin:`)?`server provided by plugin "${e.duplicateOf.split(`:`)[1]??`?`}"`:`already-configured "${e.duplicateOf}"`;return`MCP server "${e.serverName}" skipped — same command/URL as ${t}`}case`hook-load-failed`:return`Failed to load hooks from ${e.hookPath}: ${e.reason}`;case`component-load-failed`:return`Failed to load ${e.component} from ${e.path}: ${e.reason}`;case`mcpb-download-failed`:return`Failed to download MCPB from ${e.url}: ${e.reason}`;case`mcpb-extract-failed`:return`Failed to extract MCPB ${e.mcpbPath}: ${e.reason}`;case`mcpb-invalid-manifest`:return`MCPB manifest invalid at ${e.mcpbPath}: ${e.validationError}`;case`marketplace-blocked-by-policy`:return e.blockedByBlocklist?`Marketplace "${e.marketplace}" is blocked by enterprise policy`:`Marketplace "${e.marketplace}" is not in the allowed marketplace list`;case`dependency-unsatisfied`:return e.reason===`not-enabled`?`Dependency "${e.dependency}" is disabled`:`Dependency "${e.dependency}" is not installed`;case`lsp-config-invalid`:return`Invalid LSP server config for "${e.serverName}": ${e.validationError}`;case`lsp-server-start-failed`:return`LSP server "${e.serverName}" failed to start: ${e.reason}`;case`lsp-server-crashed`:return e.signal?`LSP server "${e.serverName}" crashed with signal ${e.signal}`:`LSP server "${e.serverName}" crashed with exit code ${e.exitCode??`unknown`}`;case`lsp-request-timeout`:return`LSP server "${e.serverName}" timed out on ${e.method} after ${e.timeoutMs}ms`;case`lsp-request-failed`:return`LSP server "${e.serverName}" ${e.method} failed: ${e.error}`;case`plugin-cache-miss`:return`Plugin "${e.plugin}" not cached at ${e.installPath}`;case`generic-error`:return e.error}return Et(e)}function Ar(e){switch(e.type){case`path-not-found`:return`Check that the path in your manifest or marketplace config is correct`;case`git-auth-failed`:return e.authType===`ssh`?`Configure SSH keys or use HTTPS URL instead`:`Configure credentials or use SSH URL instead`;case`git-timeout`:case`network-error`:return`Check your internet connection and try again`;case`manifest-parse-error`:return`Check manifest file syntax in the plugin directory`;case`manifest-validation-error`:return`Check manifest file follows the required schema`;case`plugin-not-found`:return`Plugin may not exist in marketplace "${e.marketplace}"`;case`marketplace-not-found`:return e.availableMarketplaces.length>0?`Available marketplaces: ${e.availableMarketplaces.join(`, `)}`:`Add the marketplace first using /plugin marketplace add`;case`mcp-config-invalid`:return`Check MCP server configuration in .mcp.json or manifest`;case`mcp-server-suppressed-duplicate`:return e.duplicateOf.startsWith(`plugin:`)?`Disable plugin "${e.duplicateOf.split(`:`)[1]??`the other plugin`}" if you want this plugin's version instead`:`Remove "${e.duplicateOf}" from your MCP config if you want the plugin's version instead`;case`hook-load-failed`:return`Check hooks.json file syntax and structure`;case`component-load-failed`:return`Check ${e.component} directory structure and file permissions`;case`mcpb-download-failed`:return`Check your internet connection and URL accessibility`;case`mcpb-extract-failed`:return`Verify the MCPB file is valid and not corrupted`;case`mcpb-invalid-manifest`:return`Contact the plugin author about the invalid manifest`;case`marketplace-blocked-by-policy`:return e.blockedByBlocklist?`This marketplace source is explicitly blocked by your administrator`:e.allowedSources.length>0?`Allowed sources: ${e.allowedSources.join(`, `)}`:`Contact your administrator to configure allowed marketplace sources`;case`dependency-unsatisfied`:return e.reason===`not-enabled`?`Enable "${e.dependency}" or uninstall "${e.plugin}"`:`Install "${e.dependency}" or uninstall "${e.plugin}"`;case`lsp-config-invalid`:return`Check LSP server configuration in the plugin manifest`;case`lsp-server-start-failed`:case`lsp-server-crashed`:case`lsp-request-timeout`:case`lsp-request-failed`:return`Check LSP server logs with --debug for details`;case`plugin-cache-miss`:return`Run /plugins to refresh the plugin cache`;case`marketplace-load-failed`:case`generic-error`:return null}return null}var jr=e((()=>{et()}));function Mr({item:e,isSelected:t}){let[n]=u();if(e.type===`plugin`){let r,i;return e.pendingToggle?(r=S(`suggestion`,n)(a.arrowRight),i=e.pendingToggle===`will-enable`?`will enable`:`will disable`):e.errorCount>0?(r=S(`error`,n)(a.cross),i=`${e.errorCount} ${Se(e.errorCount,`error`)}`):e.isEnabled?(r=S(`success`,n)(a.tick),i=`enabled`):(r=S(`inactive`,n)(a.radioOff),i=`disabled`),(0,Y.jsxs)(C,{children:[(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(p,{dimColor:!t,children:[` `,(0,Y.jsx)(p,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(p,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(p,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(p,{dimColor:!t,children:i})]})}if(e.type===`flagged-plugin`){let r=S(`warning`,n)(a.warning);return(0,Y.jsxs)(C,{children:[(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(p,{dimColor:!t,children:[` `,(0,Y.jsx)(p,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(p,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(p,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(p,{dimColor:!t,children:`removed`})]})}if(e.type===`failed-plugin`){let r=S(`error`,n)(a.cross),i=`failed to load · ${e.errorCount} ${Se(e.errorCount,`error`)}`;return(0,Y.jsxs)(C,{children:[(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(p,{dimColor:!t,children:[` `,(0,Y.jsx)(p,{backgroundColor:`userMessageBackground`,children:`Plugin`})]}),(0,Y.jsxs)(p,{dimColor:!0,children:[` · `,e.marketplace]}),(0,Y.jsxs)(p,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(p,{dimColor:!t,children:i})]})}let r,i;return e.status===`connected`?(r=S(`success`,n)(a.tick),i=`connected`):e.status===`disabled`?(r=S(`inactive`,n)(a.radioOff),i=`disabled`):e.status===`pending`?(r=S(`inactive`,n)(a.radioOff),i=`connecting…`):e.status===`needs-auth`?(r=S(`warning`,n)(a.triangleUpOutline),i=`Enter to auth`):(r=S(`error`,n)(a.cross),i=`failed`),e.indented?(0,Y.jsxs)(C,{children:[(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(p,{dimColor:!t,children:`└ `}),(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(p,{dimColor:!t,children:[` `,(0,Y.jsx)(p,{backgroundColor:`userMessageBackground`,children:`MCP`})]}),(0,Y.jsxs)(p,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(p,{dimColor:!t,children:i})]}):(0,Y.jsxs)(C,{children:[(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:t?`${a.pointer} `:` `}),(0,Y.jsx)(p,{color:t?`suggestion`:void 0,children:e.name}),(0,Y.jsxs)(p,{dimColor:!t,children:[` `,(0,Y.jsx)(p,{backgroundColor:`userMessageBackground`,children:`MCP`})]}),(0,Y.jsxs)(p,{dimColor:!t,children:[` · `,r,` `]}),(0,Y.jsx)(p,{dimColor:!t,children:i})]})}var Y,Nr=e((()=>{i(),l(),x(),we(),Y=w()}));async function Pr(e){try{return(await En.readdir(e,{withFileTypes:!0})).filter(e=>e.isFile()&&e.name.endsWith(`.md`)).map(e=>Tn.basename(e.name,`.md`))}catch(t){return ue(`Failed to read plugin components from ${e}: ${de(t)}`,{level:`error`}),_e(P(t)),[]}}async function Fr(e){try{let t=await En.readdir(e,{withFileTypes:!0}),n=[];for(let r of t)if(r.isDirectory()||r.isSymbolicLink()){let t=Tn.join(e,r.name,`SKILL.md`);try{(await En.stat(t)).isFile()&&n.push(r.name)}catch{}}return n}catch(t){return ue(`Failed to read skill directories from ${e}: ${de(t)}`,{level:`error`}),_e(P(t)),[]}}function Ir({plugin:e,marketplace:t}){let[n,r]=(0,X.useState)(null),[i,a]=(0,X.useState)(!0),[o,s]=(0,X.useState)(null);return(0,X.useEffect)(()=>{async function n(){try{if(t===`builtin`){let t=Ht(e.name);if(t){let e=t.skills?.map(e=>e.name)??[],n=t.hooks?Object.keys(t.hooks):[],i=t.mcpServers?Object.keys(t.mcpServers):[];r({commands:null,agents:null,skills:e.length>0?e:null,hooks:n.length>0?n:null,mcpServers:i.length>0?i:null})}else s(`Built-in plugin ${e.name} not found`);a(!1);return}let n=(await Ge(t)).plugins.find(t=>t.name===e.name);if(n){let t=[];e.commandsPath&&t.push(e.commandsPath),e.commandsPaths&&t.push(...e.commandsPaths);let i=[];for(let e of t)if(typeof e==`string`){let t=await Pr(e);i.push(...t)}let a=[];e.agentsPath&&a.push(e.agentsPath),e.agentsPaths&&a.push(...e.agentsPaths);let o=[];for(let e of a)if(typeof e==`string`){let t=await Pr(e);o.push(...t)}let s=[];e.skillsPath&&s.push(e.skillsPath),e.skillsPaths&&s.push(...e.skillsPaths);let c=[];for(let e of s)if(typeof e==`string`){let t=await Fr(e);c.push(...t)}let l=[];e.hooksConfig&&l.push(Object.keys(e.hooksConfig)),n.hooks&&l.push(n.hooks);let u=[];e.mcpServers&&u.push(Object.keys(e.mcpServers)),n.mcpServers&&u.push(n.mcpServers),r({commands:i.length>0?i:null,agents:o.length>0?o:null,skills:c.length>0?c:null,hooks:l.length>0?l:null,mcpServers:u.length>0?u:null})}else s(`Plugin ${e.name} not found in marketplace`)}catch(e){s(e instanceof Error?e.message:`Failed to load components`)}finally{a(!1)}}n()},[e.name,e.commandsPath,e.commandsPaths,e.agentsPath,e.agentsPaths,e.skillsPath,e.skillsPaths,e.hooksConfig,e.mcpServers,t]),i?null:o?(0,Z.jsxs)(C,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsx)(p,{bold:!0,children:`Components:`}),(0,Z.jsxs)(p,{dimColor:!0,children:[`Error: `,o]})]}):!n||!(n.commands||n.agents||n.skills||n.hooks||n.mcpServers)?null:(0,Z.jsxs)(C,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsx)(p,{bold:!0,children:`Installed components:`}),n.commands?(0,Z.jsxs)(p,{dimColor:!0,children:[`• Commands:`,` `,typeof n.commands==`string`?n.commands:Array.isArray(n.commands)?n.commands.join(`, `):Object.keys(n.commands).join(`, `)]}):null,n.agents?(0,Z.jsxs)(p,{dimColor:!0,children:[`• Agents:`,` `,typeof n.agents==`string`?n.agents:Array.isArray(n.agents)?n.agents.join(`, `):Object.keys(n.agents).join(`, `)]}):null,n.skills?(0,Z.jsxs)(p,{dimColor:!0,children:[`• Skills:`,` `,typeof n.skills==`string`?n.skills:Array.isArray(n.skills)?n.skills.join(`, `):Object.keys(n.skills).join(`, `)]}):null,n.hooks?(0,Z.jsxs)(p,{dimColor:!0,children:[`• Hooks:`,` `,typeof n.hooks==`string`?n.hooks:Array.isArray(n.hooks)?n.hooks.map(String).join(`, `):typeof n.hooks==`object`&&n.hooks!==null?Object.keys(n.hooks).join(`, `):String(n.hooks)]}):null,n.mcpServers?(0,Z.jsxs)(p,{dimColor:!0,children:[`• MCP Servers:`,` `,typeof n.mcpServers==`string`?n.mcpServers:Array.isArray(n.mcpServers)?n.mcpServers.map(String).join(`, `):typeof n.mcpServers==`object`&&n.mcpServers!==null?Object.keys(n.mcpServers).join(`, `):String(n.mcpServers)]}):null]})}async function Lr(e,t){let n=(await Ge(t))?.plugins.find(t=>t.name===e);return n&&typeof n.source==`string`?`Local plugins cannot be updated remotely. To update, modify the source at: ${n.source}`:null}function Rr(e){return e.filter(e=>{let t=e.source.split(`@`)[1]||`local`;return!mt(`${e.name}@${t}`)})}function zr({setViewState:e,setResult:t,onManageComplete:n,onSearchModeChange:r,targetPlugin:i,targetMarketplace:o,action:c}){let l=jt(e=>e.mcp.clients),u=jt(e=>e.mcp.tools),m=jt(e=>e.plugins.errors),h=mn(),[_,y]=(0,X.useState)(!1),b=(0,X.useCallback)(e=>{y(e),r?.(e)},[r]),x=d(),{columns:ee}=s(),[S,w]=(0,X.useState)(`plugin-list`),{query:T,setQuery:E,cursorOffset:D}=xn({isActive:S===`plugin-list`&&_,onExit:()=>{b(!1)}}),[O,A]=(0,X.useState)(null),[j,M]=(0,X.useState)([]),[N,ae]=(0,X.useState)([]),[oe,ce]=(0,X.useState)(!0),[F,le]=(0,X.useState)(new Map),fe=(0,X.useRef)(!1),I=(0,X.useRef)(void 0),pe=_n();te(`confirm:no`,Br.useCallback(()=>{if(S===`plugin-details`)w(`plugin-list`),A(null),z(null);else if(typeof S==`object`&&S.type===`failed-plugin-details`)w(`plugin-list`),z(null);else if(S===`configuring`)w(`plugin-details`),Ae(null);else if(typeof S==`object`&&(S.type===`plugin-options`||S.type===`configuring-options`))w(`plugin-list`),A(null),t(`Plugin enabled. Configuration skipped — run /reload-plugins to apply.`),n&&n();else if(typeof S==`object`&&S.type===`flagged-detail`)w(`plugin-list`),z(null);else if(typeof S==`object`&&S.type===`mcp-detail`)w(`plugin-list`),z(null);else if(typeof S==`object`&&S.type===`mcp-tools`)w({type:`mcp-detail`,client:S.client});else if(typeof S==`object`&&S.type===`mcp-tool-detail`)w({type:`mcp-tools`,client:S.client});else{if(F.size>0){t(`Run /reload-plugins to apply plugin changes.`);return}e({type:`menu`})}},[S,e,F,t]),{context:`Confirmation`,isActive:(S!==`plugin-list`||!_)&&S!==`confirm-project-uninstall`&&!(typeof S==`object`&&S.type===`confirm-data-cleanup`)});let me=e=>e.type===`connected`?`connected`:e.type===`disabled`?`disabled`:e.type===`pending`?`pending`:e.type===`needs-auth`?`needs-auth`:`failed`,he=(0,X.useMemo)(()=>{let e=k(),t=new Map;for(let e of l)if(e.name.startsWith(`plugin:`)){let n=e.name.split(`:`);if(n.length>=3){let r=n[1],i=n.slice(2).join(`:`),a=t.get(r)||[];a.push({displayName:i,client:e}),t.set(r,a)}}let n=[];for(let r of N){let i=`${r.plugin.name}@${r.marketplace}`,a=e?.enabledPlugins?.[i]!==!1,o=m.filter(e=>`plugin`in e&&e.plugin===r.plugin.name||e.source===i||e.source.startsWith(`${r.plugin.name}@`)),s=r.plugin.isBuiltin?`builtin`:r.scope||`user`;n.push({item:{type:`plugin`,id:i,name:r.plugin.name,description:r.plugin.manifest.description,marketplace:r.marketplace,scope:s,isEnabled:a,errorCount:o.length,errors:o,plugin:r.plugin,pendingEnable:r.pendingEnable,pendingUpdate:r.pendingUpdate,pendingToggle:F.get(i)},originalScope:s,childMcps:t.get(r.plugin.name)||[]})}let r=new Set(n.map(({item:e})=>e.id)),i=new Set(n.map(({item:e})=>e.name)),a=new Map;for(let e of m){if(r.has(e.source)||`plugin`in e&&typeof e.plugin==`string`&&i.has(e.plugin))continue;let t=a.get(e.source)||[];t.push(e),a.set(e.source,t)}let o=Xt(),s=[];for(let[e,t]of a){if(e in h)continue;let n=Bt(e),r=n.name||e,i=n.marketplace||`unknown`,a=o.get(e),c=a===`flag`||a===void 0?`user`:a;s.push({type:`failed-plugin`,id:e,name:r,marketplace:i,scope:c,errorCount:t.length,errors:t})}let c=[];for(let e of l)e.name!==`ide`&&(e.name.startsWith(`plugin:`)||c.push({type:`mcp`,id:`mcp:${e.name}`,name:e.name,description:void 0,scope:e.config.scope,status:me(e),client:e}));let u={flagged:-1,project:0,local:1,user:2,enterprise:3,managed:4,dynamic:5,builtin:6},d=[],f=new Map;for(let{item:e,originalScope:t,childMcps:r}of n){let n=e.scope;f.has(n)||f.set(n,[]),f.get(n).push(e);for(let{displayName:e,client:n}of r){let r=t===`builtin`?`user`:t;f.has(r)||f.set(r,[]),f.get(r).push({type:`mcp`,id:`mcp:${n.name}`,name:e,description:void 0,scope:r,status:me(n),client:n,indented:!0})}}for(let e of c){let t=e.scope;f.has(t)||f.set(t,[]),f.get(t).push(e)}for(let e of s){let t=e.scope;f.has(t)||f.set(t,[]),f.get(t).push(e)}for(let[e,t]of Object.entries(h)){let n=Bt(e),r=n.name||e,i=n.marketplace||`unknown`;f.has(`flagged`)||f.set(`flagged`,[]),f.get(`flagged`).push({type:`flagged-plugin`,id:e,name:r,marketplace:i,scope:`flagged`,reason:`delisted`,text:`Removed from marketplace`,flaggedAt:t.flaggedAt})}let p=[...f.keys()].sort((e,t)=>(u[e]??99)-(u[t]??99));for(let e of p){let t=f.get(e),n=[],r=[],i=0;for(;i<t.length;){let e=t[i];if(e.type===`plugin`||e.type===`failed-plugin`||e.type===`flagged-plugin`){let r=[e];i++;let a=t[i];for(;a?.type===`mcp`&&a.indented;)r.push(a),i++,a=t[i];n.push(r)}else e.type===`mcp`&&!e.indented&&r.push(e),i++}n.sort((e,t)=>e[0].name.localeCompare(t[0].name)),r.sort((e,t)=>e.name.localeCompare(t.name));for(let e of n)d.push(...e);d.push(...r)}return d},[N,l,m,F,h]),ge=(0,X.useMemo)(()=>he.filter(e=>e.type===`flagged-plugin`).map(e=>e.id),[he]);(0,X.useEffect)(()=>{ge.length>0&&pn(ge)},[ge]);let ye=(0,X.useMemo)(()=>{if(!T)return he;let e=T.toLowerCase();return he.filter(t=>t.name.toLowerCase().includes(e)||`description`in t&&t.description?.toLowerCase().includes(e))},[he,T]),[be,xe]=(0,X.useState)(0),Ce=fr({totalItems:ye.length,selectedIndex:be,maxVisible:8}),[we,Te]=(0,X.useState)(0),[Ee,De]=(0,X.useState)(!1),[L,z]=(0,X.useState)(null),[ke,Ae]=(0,X.useState)(null),[je,Me]=(0,X.useState)(!1),[Ne,Pe]=(0,X.useState)(!1);(0,X.useEffect)(()=>{if(!O){Pe(!1);return}async function e(){let e=O.plugin.manifest.mcpServers,t=!1;if(e&&(t=typeof e==`string`&&gt(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&&gt(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`&&gt(e)||Array.isArray(e)&&e.some(e=>typeof e==`string`&&gt(e))}}catch(e){ue(`Failed to read raw marketplace.json: ${e}`)}Pe(t)}e()},[O]),(0,X.useEffect)(()=>{async function e(){ce(!0);try{let{enabled:e,disabled:t}=await Lt(),n=k(),r=Rr([...e,...t]),i={};for(let e of r){let t=e.source.split(`@`)[1]||`local`;i[t]||(i[t]=[]),i[t].push(e)}let a=[];for(let[e,t]of Object.entries(i)){let r=ve(t,t=>{let r=`${t.name}@${e}`;return n?.enabledPlugins?.[r]!==!1}),i=t.length-r;a.push({name:e,installedPlugins:t,enabledCount:r,disabledCount:i})}a.sort((e,t)=>e.name===`claude-plugin-directory`?-1:t.name===`claude-plugin-directory`?1:e.name.localeCompare(t.name)),M(a);let o=[];for(let e of a)for(let t of e.installedPlugins){let n=`${t.name}@${e.name}`,r=t.isBuiltin?`builtin`:nn(n).scope;o.push({plugin:t,marketplace:e.name,scope:r,pendingEnable:void 0,pendingUpdate:!1})}ae(o),xe(0)}finally{ce(!1)}}e()},[]),(0,X.useEffect)(()=>{if(!fe.current&&i&&j.length>0&&!oe){let{name:e,marketplace:n}=Bt(i),r=o??n,a=r?j.filter(e=>e.name===r):j;for(let t of a){let n=t.installedPlugins.find(t=>t.name===e);if(n){let{scope:e}=nn(`${n.name}@${t.name}`);A({plugin:n,marketplace:t.name,scope:e,pendingEnable:void 0,pendingUpdate:!1}),w(`plugin-details`),I.current=c,fe.current=!0;return}}let s=he.find(t=>t.type===`failed-plugin`&&t.name===e);s&&s.type===`failed-plugin`&&(w({type:`failed-plugin-details`,plugin:{id:s.id,name:s.name,marketplace:s.marketplace,errors:s.errors,scope:s.scope}}),fe.current=!0),!fe.current&&c&&(fe.current=!0,t(`Plugin "${i}" is not installed in this project`))}},[i,o,j,oe,he,c,t]);let Fe=async r=>{if(!O)return;let i=O.scope||`user`,a=i===`builtin`;if(a&&(r===`update`||r===`uninstall`)){z(`Built-in plugins cannot be updated or uninstalled.`);return}if(!a&&!tn(i)&&r!==`update`){z(`This plugin is managed by your organization. Contact your admin to disable it.`);return}De(!0),z(null);try{let o=`${O.plugin.name}@${O.marketplace}`,s;switch(r){case`enable`:{let e=await Zt(o);if(!e.success)throw Error(e.message);break}case`disable`:{let e=await en(o);if(!e.success)throw Error(e.message);s=e.reverseDependents;break}case`uninstall`:{if(a||!tn(i))break;if(an(o)){De(!1),w(`confirm-project-uninstall`);return}let e=Le().plugins[o],t=!e||e.length<=1?await Oe(o):null;if(t){De(!1),w({type:`confirm-data-cleanup`,size:t});return}let n=await Qt(o,i);if(!n.success)throw Error(n.message);s=n.reverseDependents;break}case`update`:{if(a)break;let r=await $t(o,i);if(!r.success)throw Error(r.message);if(r.alreadyUpToDate){t(`${O.plugin.name} is already at the latest version (${r.newVersion}).`),n&&await n(),e({type:`menu`});return}break}}dt();let c=`${O.plugin.name}@${O.marketplace}`;if(k()?.enabledPlugins?.[c]!==!1){De(!1),w({type:`plugin-options`});return}let l=r===`enable`?`Enabled`:r===`disable`?`Disabled`:r===`update`?`Updated`:`Uninstalled`,u=s&&s.length>0?` · required by ${s.join(`, `)}`:``;t(`✓ ${l} ${O.plugin.name}${u}. Run /reload-plugins to apply.`),n&&await n(),e({type:`menu`})}catch(e){De(!1),z(`Failed to ${r}: ${e instanceof Error?e.message:String(e)}`),_e(P(e))}},Ie=(0,X.useRef)(Fe);Ie.current=Fe,(0,X.useEffect)(()=>{if(S===`plugin-details`&&O&&I.current){let e=I.current;I.current=void 0,Ie.current(e)}},[S,O]);let Re=Br.useCallback(()=>{if(be>=ye.length)return;let e=ye[be];if(e?.type!==`flagged-plugin`)if(e?.type===`plugin`){let t=`${e.plugin.name}@${e.marketplace}`,n=k(),r=F.get(t),i=n?.enabledPlugins?.[t]!==!1,a=e.scope;if(a===`builtin`||tn(a)){let e=new Map(F);r?(e.delete(t),(async()=>{try{r===`will-disable`?await Zt(t):await en(t),dt()}catch(e){_e(e)}})()):(e.set(t,i?`will-disable`:`will-enable`),(async()=>{try{i?await en(t):await Zt(t),dt()}catch(e){_e(e)}})()),le(e)}}else e?.type===`mcp`&&pe(e.client.name)},[be,ye,F,N,pe]);v({"select:previous":()=>{be===0?b(!0):Ce.handleSelectionChange(be-1,xe)},"select:next":()=>{be<ye.length-1&&Ce.handleSelectionChange(be+1,xe)},"select:accept":Br.useCallback(()=>{if(be>=ye.length)return;let e=ye[be];if(e?.type===`plugin`){let t=N.find(t=>t.plugin.name===e.plugin.name&&t.marketplace===e.marketplace);t&&(A(t),w(`plugin-details`),Te(0),z(null))}else e?.type===`flagged-plugin`?(w({type:`flagged-detail`,plugin:{id:e.id,name:e.name,marketplace:e.marketplace,reason:e.reason,text:e.text,flaggedAt:e.flaggedAt}}),z(null)):e?.type===`failed-plugin`?(w({type:`failed-plugin-details`,plugin:{id:e.id,name:e.name,marketplace:e.marketplace,errors:e.errors,scope:e.scope}}),Te(0),z(null)):e?.type===`mcp`&&(w({type:`mcp-detail`,client:e.client}),z(null))},[be,ye,N])},{context:`Select`,isActive:S===`plugin-list`&&!_}),v({"plugin:toggle":Re},{context:`Plugin`,isActive:S===`plugin-list`&&!_}),v({"select:accept":Br.useCallback(()=>{typeof S!=`object`||S.type!==`flagged-detail`||(hn(S.plugin.id),w(`plugin-list`))},[S])},{context:`Select`,isActive:typeof S==`object`&&S.type===`flagged-detail`});let ze=Br.useMemo(()=>{if(S!==`plugin-details`||!O)return[];let e=k(),t=`${O.plugin.name}@${O.marketplace}`,n=e?.enabledPlugins?.[t]!==!1,r=O.marketplace===`builtin`,i=[];return i.push({label:n?`Disable plugin`:`Enable plugin`,action:()=>void Fe(n?`disable`:`enable`)}),r||(i.push({label:O.pendingUpdate?`Unmark for update`:`Mark for update`,action:async()=>{try{let e=await Lr(O.plugin.name,O.marketplace);if(e){z(e);return}let t=[...N],n=t.findIndex(e=>e.plugin.name===O.plugin.name&&e.marketplace===O.marketplace);n!==-1&&(t[n].pendingUpdate=!O.pendingUpdate,ae(t),A({...O,pendingUpdate:!O.pendingUpdate}))}catch(e){z(e instanceof Error?e.message:`Failed to check plugin update availability`)}}}),Ne&&i.push({label:`Configure`,action:async()=>{Me(!0);try{let e=O.plugin.manifest.mcpServers,t=null;if(typeof e==`string`&&gt(e))t=e;else if(Array.isArray(e)){for(let n of e)if(typeof n==`string`&&gt(n)){t=n;break}}if(!t){z(`No MCPB file found in plugin`),Me(!1);return}let n=`${O.plugin.name}@${O.marketplace}`,r=await nt(t,O.plugin.path,n,void 0,void 0,!0);`status`in r&&r.status===`needs-config`?(Ae(r),w(`configuring`)):z(`Failed to load MCPB for configuration`)}catch(e){z(`Failed to load configuration: ${de(e)}`)}finally{Me(!1)}}}),O.plugin.manifest.userConfig&&Object.keys(O.plugin.manifest.userConfig).length>0&&i.push({label:`Configure options`,action:()=>{w({type:`configuring-options`,schema:O.plugin.manifest.userConfig})}}),i.push({label:`Update now`,action:()=>void Fe(`update`)}),i.push({label:`Uninstall`,action:()=>void Fe(`uninstall`)})),O.plugin.manifest.homepage&&i.push({label:`Open homepage`,action:()=>void Ut(O.plugin.manifest.homepage)}),O.plugin.manifest.repository&&i.push({label:`View repository`,action:()=>void Ut(O.plugin.manifest.repository)}),i.push({label:`Back to plugin list`,action:()=>{w(`plugin-list`),A(null),z(null)}}),i},[S,O,Ne,N]);if(v({"select:previous":()=>{we>0&&Te(we-1)},"select:next":()=>{we<ze.length-1&&Te(we+1)},"select:accept":()=>{ze[we]&&ze[we].action()}},{context:`Select`,isActive:S===`plugin-details`&&!!O}),v({"select:accept":()=>{typeof S==`object`&&S.type===`failed-plugin-details`&&(async()=>{De(!0),z(null);let e=S.plugin.id,t=S.plugin.scope,r=tn(t)?await Qt(e,t,!1):await Qt(e,`user`,!1),i=r.success;if(!i){for(let t of[`userSettings`,`projectSettings`,`localSettings`]){let n=re(t);n?.enabledPlugins?.[e]!==void 0&&(ie(t,{enabledPlugins:{...n.enabledPlugins,[e]:void 0}}),i=!0)}dt()}i?(n&&await n(),De(!1),w(`plugin-list`)):(De(!1),z(r.message))})()}},{context:`Select`,isActive:typeof S==`object`&&S.type===`failed-plugin-details`&&S.plugin.scope!==`managed`}),v({"confirm:yes":()=>{if(!O)return;De(!0),z(null);let r=`${O.plugin.name}@${O.marketplace}`,{error:i}=ie(`localSettings`,{enabledPlugins:{...re(`localSettings`)?.enabledPlugins,[r]:!1}});if(i){De(!1),z(`Failed to write settings: ${i.message}`);return}dt(),t(`✓ Disabled ${O.plugin.name} in .claude/settings.local.json. Run /reload-plugins to apply.`),n&&n(),e({type:`menu`})},"confirm:no":()=>{w(`plugin-details`),z(null)}},{context:`Confirmation`,isActive:S===`confirm-project-uninstall`&&!!O&&!Ee}),ne((r,i)=>{if(!O)return;let o=`${O.plugin.name}@${O.marketplace}`,s=O.scope;if(!s||s===`builtin`||!tn(s))return;let c=async r=>{De(!0),z(null);try{let i=await Qt(o,s,r);if(!i.success)throw Error(i.message);dt();let c=r?``:` · data preserved`;t(`${a.tick} ${i.message}${c}`),n&&n(),e({type:`menu`})}catch(e){De(!1),z(e instanceof Error?e.message:String(e))}};r===`y`||r===`Y`?c(!0):r===`n`||r===`N`?c(!1):i.escape&&(w(`plugin-details`),z(null))},{isActive:typeof S==`object`&&S.type===`confirm-data-cleanup`&&!!O&&!Ee}),Br.useEffect(()=>{xe(0)},[T]),ne((e,t)=>{let n=!t.ctrl&&!t.meta;_||(e===`/`&&n?(b(!0),E(``),xe(0)):n&&e.length>0&&!/^\s+$/.test(e)&&e!==`j`&&e!==`k`&&e!==` `&&(b(!0),E(e),xe(0)))},{isActive:S===`plugin-list`}),oe)return(0,Z.jsx)(p,{children:`Loading installed plugins…`});if(he.length===0)return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsx)(C,{marginBottom:1,children:(0,Z.jsx)(p,{bold:!0,children:`Manage plugins`})}),(0,Z.jsx)(p,{children:`No plugins or MCP servers installed.`}),(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{dimColor:!0,children:`Esc to go back`})})]});if(typeof S==`object`&&S.type===`plugin-options`&&O){let r=`${O.plugin.name}@${O.marketplace}`;function i(r){t(r),n&&n(),e({type:`menu`})}return(0,Z.jsx)(er,{plugin:O.plugin,pluginId:r,onDone:(e,t)=>{switch(e){case`configured`:i(`✓ Enabled and configured ${O.plugin.name}. Run /reload-plugins to apply.`);break;case`skipped`:i(`✓ Enabled ${O.plugin.name}. Run /reload-plugins to apply.`);break;case`error`:i(`Failed to save configuration: ${t}`);break}}})}if(typeof S==`object`&&S.type===`configuring-options`&&O){let e=`${O.plugin.name}@${O.marketplace}`;return(0,Z.jsx)(Yn,{title:`Configure ${O.plugin.name}`,subtitle:`Plugin options`,configSchema:S.schema,initialValues:bt(e),onSave:n=>{try{wt(e,n,S.schema),dt(),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){z(`Failed to save configuration: ${de(e)}`)}w(`plugin-details`)},onCancel:()=>w(`plugin-details`)})}if(S===`configuring`&&ke&&O){let e=`${O.plugin.name}@${O.marketplace}`;async function n(n){if(!(!ke||!O))try{let r=O.plugin.manifest.mcpServers,i=null;if(typeof r==`string`&&gt(r))i=r;else if(Array.isArray(r)){for(let e of r)if(typeof e==`string`&&gt(e)){i=e;break}}if(!i){z(`No MCPB file found`),w(`plugin-details`);return}await nt(i,O.plugin.path,e,void 0,n),z(null),Ae(null),w(`plugin-details`),t(`Configuration saved. Run /reload-plugins for changes to take effect.`)}catch(e){z(`Failed to save configuration: ${de(e)}`),w(`plugin-details`)}}function r(){Ae(null),w(`plugin-details`)}return(0,Z.jsx)(Yn,{title:`Configure ${ke.manifest.name}`,subtitle:`Plugin: ${O.plugin.name}`,configSchema:ke.configSchema,initialValues:ke.existingConfig,onSave:n,onCancel:r})}if(typeof S==`object`&&S.type===`flagged-detail`){let e=S.plugin;return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsx)(C,{children:(0,Z.jsxs)(p,{bold:!0,children:[e.name,` @ `,e.marketplace]})}),(0,Z.jsxs)(C,{marginBottom:1,children:[(0,Z.jsx)(p,{dimColor:!0,children:`Status: `}),(0,Z.jsx)(p,{color:`error`,children:`Removed`})]}),(0,Z.jsxs)(C,{marginBottom:1,flexDirection:`column`,children:[(0,Z.jsxs)(p,{color:`error`,children:[`Removed from marketplace · reason: `,e.reason]}),(0,Z.jsx)(p,{children:e.text}),(0,Z.jsxs)(p,{dimColor:!0,children:[`Flagged on `,new Date(e.flaggedAt).toLocaleDateString()]})]}),(0,Z.jsx)(C,{marginTop:1,flexDirection:`column`,children:(0,Z.jsxs)(C,{children:[(0,Z.jsxs)(p,{children:[a.pointer,` `]}),(0,Z.jsx)(p,{color:`suggestion`,children:`Dismiss`})]})}),(0,Z.jsxs)(g,{children:[(0,Z.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`dismiss`}),(0,Z.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})]})}if(S===`confirm-project-uninstall`&&O)return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsxs)(p,{bold:!0,color:`warning`,children:[O.plugin.name,` is enabled in .claude/settings.json (shared with your team)`]}),(0,Z.jsxs)(C,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(p,{children:`Disable it just for you in .claude/settings.local.json?`}),(0,Z.jsx)(p,{dimColor:!0,children:`This has the same effect as uninstalling, without affecting other contributors.`})]}),L&&(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{color:`error`,children:L})}),(0,Z.jsx)(C,{marginTop:1,children:Ee?(0,Z.jsx)(p,{dimColor:!0,children:`Disabling…`}):(0,Z.jsxs)(g,{children:[(0,Z.jsx)(R,{action:`confirm:yes`,context:`Confirmation`,fallback:`y`,description:`disable`}),(0,Z.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]});if(typeof S==`object`&&S.type===`confirm-data-cleanup`&&O)return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsxs)(p,{bold:!0,children:[O.plugin.name,` has `,S.size.human,` of persistent data`]}),(0,Z.jsxs)(C,{marginTop:1,flexDirection:`column`,children:[(0,Z.jsx)(p,{children:`Delete it along with the plugin?`}),(0,Z.jsx)(p,{dimColor:!0,children:pt(`${O.plugin.name}@${O.marketplace}`)})]}),L&&(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{color:`error`,children:L})}),(0,Z.jsx)(C,{marginTop:1,children:Ee?(0,Z.jsx)(p,{dimColor:!0,children:`Uninstalling…`}):(0,Z.jsxs)(p,{children:[(0,Z.jsx)(p,{bold:!0,children:`y`}),` to delete · `,(0,Z.jsx)(p,{bold:!0,children:`n`}),` to keep · `,(0,Z.jsx)(p,{bold:!0,children:`esc`}),` to cancel`]})})]});if(S===`plugin-details`&&O){let e=k(),t=`${O.plugin.name}@${O.marketplace}`,n=e?.enabledPlugins?.[t]!==!1,r=m.filter(e=>`plugin`in e&&e.plugin===O.plugin.name||e.source===t||e.source.startsWith(`${O.plugin.name}@`)),i=r.length===0?null:(0,Z.jsxs)(C,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsxs)(p,{bold:!0,color:`error`,children:[r.length,` `,Se(r.length,`error`),`:`]}),r.map((e,t)=>{let n=Ar(e);return(0,Z.jsxs)(C,{flexDirection:`column`,marginLeft:2,children:[(0,Z.jsx)(p,{color:`error`,children:kr(e)}),n&&(0,Z.jsxs)(p,{dimColor:!0,italic:!0,children:[a.arrowRight,` `,n]})]},t)})]});return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsx)(C,{children:(0,Z.jsxs)(p,{bold:!0,children:[O.plugin.name,` @ `,O.marketplace]})}),(0,Z.jsxs)(C,{children:[(0,Z.jsx)(p,{dimColor:!0,children:`Scope: `}),(0,Z.jsx)(p,{children:O.scope||`user`})]}),O.plugin.manifest.version&&(0,Z.jsxs)(C,{children:[(0,Z.jsx)(p,{dimColor:!0,children:`Version: `}),(0,Z.jsx)(p,{children:O.plugin.manifest.version})]}),O.plugin.manifest.description&&(0,Z.jsx)(C,{marginBottom:1,children:(0,Z.jsx)(p,{children:O.plugin.manifest.description})}),O.plugin.manifest.author&&(0,Z.jsxs)(C,{children:[(0,Z.jsx)(p,{dimColor:!0,children:`Author: `}),(0,Z.jsx)(p,{children:O.plugin.manifest.author.name})]}),(0,Z.jsxs)(C,{marginBottom:1,children:[(0,Z.jsx)(p,{dimColor:!0,children:`Status: `}),(0,Z.jsx)(p,{color:n?`success`:`warning`,children:n?`Enabled`:`Disabled`}),O.pendingUpdate&&(0,Z.jsx)(p,{color:`suggestion`,children:` · Marked for update`})]}),(0,Z.jsx)(Ir,{plugin:O.plugin,marketplace:O.marketplace}),i,(0,Z.jsx)(C,{marginTop:1,flexDirection:`column`,children:ze.map((e,t)=>{let n=t===we;return(0,Z.jsxs)(C,{children:[n&&(0,Z.jsxs)(p,{children:[a.pointer,` `]}),!n&&(0,Z.jsx)(p,{children:` `}),(0,Z.jsx)(p,{bold:n,color:e.label.includes(`Uninstall`)?`error`:e.label.includes(`Update`)?`suggestion`:void 0,children:e.label})]},t)})}),Ee&&(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{children:`Processing…`})}),L&&(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{color:`error`,children:L})}),(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(g,{children:[(0,Z.jsx)(R,{action:`select:previous`,context:`Select`,fallback:`↑`,description:`navigate`}),(0,Z.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`select`}),(0,Z.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(typeof S==`object`&&S.type===`failed-plugin-details`){let e=S.plugin,t=e.errors[0],n=t?kr(t):`Failed to load`;return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsxs)(p,{children:[(0,Z.jsx)(p,{bold:!0,children:e.name}),(0,Z.jsxs)(p,{dimColor:!0,children:[` @ `,e.marketplace]}),(0,Z.jsxs)(p,{dimColor:!0,children:[` (`,e.scope,`)`]})]}),(0,Z.jsx)(p,{color:`error`,children:n}),e.scope===`managed`?(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{dimColor:!0,children:`Managed by your organization — contact your admin`})}):(0,Z.jsxs)(C,{marginTop:1,children:[(0,Z.jsxs)(p,{color:`suggestion`,children:[a.pointer,` `]}),(0,Z.jsx)(p,{bold:!0,children:`Remove`})]}),Ee&&(0,Z.jsx)(p,{children:`Processing…`}),L&&(0,Z.jsx)(p,{color:`error`,children:L}),(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(p,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(g,{children:[e.scope!==`managed`&&(0,Z.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`remove`}),(0,Z.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}if(typeof S==`object`&&S.type===`mcp-detail`){let e=S.client,n=He(u,e.name).length,r=()=>{w({type:`mcp-tools`,client:e})},i=()=>{w(`plugin-list`)},a=e=>{e&&t(e),w(`plugin-list`)},o=e.config.scope,s=e.config.type;return s===`stdio`?(0,Z.jsx)(Fn,{server:{name:e.name,client:e,scope:o,transport:`stdio`,config:e.config},serverToolsCount:n,onViewTools:r,onCancel:i,onComplete:a,borderless:!0}):s===`sse`?(0,Z.jsx)(Nn,{server:{name:e.name,client:e,scope:o,transport:`sse`,isAuthenticated:void 0,config:e.config},serverToolsCount:n,onViewTools:r,onCancel:i,onComplete:a,borderless:!0}):s===`http`?(0,Z.jsx)(Nn,{server:{name:e.name,client:e,scope:o,transport:`http`,isAuthenticated:void 0,config:e.config},serverToolsCount:n,onViewTools:r,onCancel:i,onComplete:a,borderless:!0}):s===`claudeai-proxy`?(0,Z.jsx)(Nn,{server:{name:e.name,client:e,scope:o,transport:`claudeai-proxy`,isAuthenticated:void 0,config:e.config},serverToolsCount:n,onViewTools:r,onCancel:i,onComplete:a,borderless:!0}):(w(`plugin-list`),null)}if(typeof S==`object`&&S.type===`mcp-tools`){let e=S.client,t=e.config.scope,n=e.config.type,r;return r=n===`stdio`?{name:e.name,client:e,scope:t,transport:`stdio`,config:e.config}:n===`sse`?{name:e.name,client:e,scope:t,transport:`sse`,isAuthenticated:void 0,config:e.config}:n===`http`?{name:e.name,client:e,scope:t,transport:`http`,isAuthenticated:void 0,config:e.config}:{name:e.name,client:e,scope:t,transport:`claudeai-proxy`,isAuthenticated:void 0,config:e.config},(0,Z.jsx)(Vn,{server:r,onSelectTool:t=>{w({type:`mcp-tool-detail`,client:e,tool:t})},onBack:()=>w({type:`mcp-detail`,client:e})})}if(typeof S==`object`&&S.type===`mcp-tool-detail`){let{client:e,tool:t}=S,n=e.config.scope,r=e.config.type,i;return i=r===`stdio`?{name:e.name,client:e,scope:n,transport:`stdio`,config:e.config}:r===`sse`?{name:e.name,client:e,scope:n,transport:`sse`,isAuthenticated:void 0,config:e.config}:r===`http`?{name:e.name,client:e,scope:n,transport:`http`,isAuthenticated:void 0,config:e.config}:{name:e.name,client:e,scope:n,transport:`claudeai-proxy`,isAuthenticated:void 0,config:e.config},(0,Z.jsx)(Rn,{tool:t,server:i,onBack:()=>w({type:`mcp-tools`,client:e})})}let Be=Ce.getVisibleItems(ye);return(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsx)(C,{marginBottom:1,children:(0,Z.jsx)(f,{query:T,isFocused:_,isTerminalFocused:x,width:ee-4,cursorOffset:D})}),ye.length===0&&T&&(0,Z.jsx)(C,{marginBottom:1,children:(0,Z.jsxs)(p,{dimColor:!0,children:[`No items match "`,T,`"`]})}),Ce.scrollPosition.canScrollUp&&(0,Z.jsx)(C,{children:(0,Z.jsxs)(p,{dimColor:!0,children:[` `,a.arrowUp,` more above`]})}),Be.map((e,t)=>{let n=Ce.toActualIndex(t)===be&&!_,r=t>0?Be[t-1]:null,i=!r||r.scope!==e.scope;return(0,Z.jsxs)(Br.Fragment,{children:[i&&(0,Z.jsx)(C,{marginTop:+(t>0),paddingLeft:2,children:(0,Z.jsx)(p,{dimColor:e.scope!==`flagged`,color:e.scope===`flagged`?`warning`:void 0,bold:e.scope===`flagged`,children:(e=>{switch(e){case`flagged`:return`Flagged`;case`project`:return`Project`;case`local`:return`Local`;case`user`:return`User`;case`enterprise`:return`Enterprise`;case`managed`:return`Managed`;case`builtin`:return`Built-in`;case`dynamic`:return`Built-in`;default:return e}})(e.scope)})}),(0,Z.jsx)(Mr,{item:e,isSelected:n})]},e.id)}),Ce.scrollPosition.canScrollDown&&(0,Z.jsx)(C,{children:(0,Z.jsxs)(p,{dimColor:!0,children:[` `,a.arrowDown,` more below`]})}),(0,Z.jsx)(C,{marginTop:1,marginLeft:1,children:(0,Z.jsx)(p,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(g,{children:[(0,Z.jsx)(p,{children:`type to search`}),(0,Z.jsx)(R,{action:`plugin:toggle`,context:`Plugin`,fallback:`Space`,description:`toggle`}),(0,Z.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`details`}),(0,Z.jsx)(R,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})}),F.size>0&&(0,Z.jsx)(C,{marginLeft:1,children:(0,Z.jsx)(p,{dimColor:!0,italic:!0,children:`Run /reload-plugins to apply changes`})})]})}var Br,X,Z,Vr=e((()=>{i(),Br=t(l(),1),X=t(l(),1),L(),x(),Pn(),Ln(),Bn(),Wn(),bn(),Sn(),Kt(),Gt(),Vt(),vn(),Ie(),rn(),ht(),ye(),Wt(),le(),F(),ge(),lt(),Pe(),Ct(),Qe(),De(),gn(),zt(),Pt(),Ye(),Fe(),Yt(),j(),ce(),we(),jr(),Qn(),rr(),Nr(),hr(),Z=w()}));function Hr(e){if(!e)return{type:`menu`};let t=e.trim().split(/\s+/);switch(t[0]?.toLowerCase()){case`help`:case`--help`:case`-h`:return{type:`help`};case`install`:case`i`:{let e=t[1];if(!e)return{type:`install`};if(e.includes(`@`)){let[t,n]=e.split(`@`);return{type:`install`,plugin:t,marketplace:n}}return e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`file://`)||e.includes(`/`)||e.includes(`\\`)?{type:`install`,marketplace:e}:{type:`install`,plugin:e}}case`manage`:return{type:`manage`};case`uninstall`:return{type:`uninstall`,plugin:t[1]};case`enable`:return{type:`enable`,plugin:t[1]};case`disable`:return{type:`disable`,plugin:t[1]};case`validate`:return{type:`validate`,path:t.slice(1).join(` `).trim()||void 0};case`marketplace`:case`market`:{let e=t[1]?.toLowerCase(),n=t.slice(2).join(` `);switch(e){case`add`:return{type:`marketplace`,action:`add`,target:n};case`remove`:case`rm`:return{type:`marketplace`,action:`remove`,target:n};case`update`:return{type:`marketplace`,action:`update`,target:n};case`list`:return{type:`marketplace`,action:`list`};default:return{type:`marketplace`}}}default:return{type:`menu`}}}var Ur=e((()=>{}));function Wr({onComplete:e,path:t}){return(0,Gr.useEffect)(()=>{async function n(){if(!t){e(`Usage: /plugin validate <path>
2
+
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} ${Se(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} ${Se(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,_e(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(),ge(),fn(),we(),Kr=w()}));function Jr({onComplete:e}){return(0,Q.useEffect)(()=>{async function t(){try{let t=await je(),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`}])re(n)?.extraKnownMarketplaces?.[e]&&t.push({source:n,scope:r});return{editableSources:t,isInPolicy:!!re(`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=re(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&&ie(n,r)}}function ri({setViewState:e,setActiveTab:t,markPluginsChanged:n}){let r=jt(e=>e.plugins.errors),i=jt(e=>e.plugins.installationStatus),o=ot(),[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 St(await je());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),dt(),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 Ee(i.name),dt(),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)(R,{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)(R,{action:`select:previous`,context:`Select`,fallback:`↑`,description:`navigate`}),ee&&(0,$.jsx)(R,{action:`select:accept`,context:`Select`,fallback:`Enter`,description:`resolve`}),(0,$.jsx)(R,{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=ot(),ne=jt(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),L(),x(),Jt(),Gt(),ht(),F(),lt(),rt(),Ct(),Yt(),j(),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,o as t}from"./chunk-DR8-3Aex.js";import{Cn as n,F as r,Rn as i,b as a,t as o,x as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{E as l,w as u,x as d}from"./startupProfiler-CAntGAbs.js";import{t as f}from"./useTerminalSize-Du-EamDN.js";function p(e){return e.startsWith(`file-`)?`+`:e.startsWith(`mcp-resource-`)?`◇`:e.startsWith(`agent-`)?`*`:`+`}function m(e){return e.startsWith(`file-`)||e.startsWith(`mcp-resource-`)||e.startsWith(`agent-`)}function h({suggestions:e,selectedSuggestion:t,maxColumnWidth:i,overlay:a}){let{rows:o}=r(),c=a?5:Math.min(6,Math.max(1,o-3));if(e.length===0)return null;let l=i??Math.max(...e.map(e=>n(e.displayText)))+5,u=Math.max(0,Math.min(t-Math.floor(c/2),e.length-c)),d=Math.min(u+c,e.length),f=e.slice(u,d);return(0,_.jsx)(s,{flexDirection:`column`,justifyContent:a?void 0:`flex-end`,children:f.map(n=>(0,_.jsx)(v,{item:n,maxColumnWidth:l,isSelected:n.id===e[t]?.id},n.id))})}var g,_,v,y,b=e((()=>{g=t(i(),1),f(),o(),d(),_=c(),v=(0,g.memo)(function({item:e,maxColumnWidth:t,isSelected:i}){let o=r().columns;if(m(e.id)){let t=p(e.id),r=i?`suggestion`:void 0,s=!i,c=e.id.startsWith(`file-`),d=e.id.startsWith(`mcp-resource-`),f=e.description?3:0,m;if(c){let t=e.description?Math.min(20,n(e.description)):0,r=o-2-4-f-t;m=u(e.displayText,r)}else m=d?l(e.displayText,30):e.displayText;let h=o-2-n(m)-f-4,g;if(e.description){let n=Math.max(0,h),r=l(e.description.replace(/\s+/g,` `),n);g=`${t} ${m} – ${r}`}else g=`${t} ${m}`;return(0,_.jsx)(a,{color:r,dimColor:s,wrap:`truncate`,children:g})}let s=Math.floor(o*.4),c=Math.min(t??n(e.displayText)+5,s),d=e.color||(i?`suggestion`:void 0),f=!i,h=e.displayText;n(h)>c-2&&(h=l(h,c-2));let g=h+` `.repeat(Math.max(0,c-n(h))),v=e.tag?`[${e.tag}] `:``,y=n(v),b=Math.max(0,o-c-y-4),x=e.description?l(e.description.replace(/\s+/g,` `),b):``;return(0,_.jsxs)(a,{wrap:`truncate`,children:[(0,_.jsx)(a,{color:d,dimColor:f,children:g}),v?(0,_.jsx)(a,{color:e.tag===`local`?`ansi:yellow`:void 0,dimColor:e.tag!==`local`,children:v}):null,(0,_.jsx)(a,{color:i?`suggestion`:void 0,dimColor:!i,children:x})]})}),y=(0,g.memo)(h)}));export{y as n,b as r,h as t};
@@ -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-Di342QoJ.js";import{t as a}from"./jsx-runtime-D-D469L8.js";import{S as o,dc as s,vi as c,xi as l,yc as u,yi as d}from"./paths-DO4WOQtD.js";import{a as f,n as p}from"./env-C2A9gV_G.js";import{i as m,o as h}from"./platform-mh9ypxS8.js";import{DT as g,FT as _,IT as v,OT as y}from"./loadAgentsDir-ClTeo0nk.js";import{a as b,i as x,r as S}from"./terminalSetup-hLCi-2uB.js";function C(){return s().editorMode===`vim`}function w(){return p.terminal===`Apple_Terminal`&&process.platform===`darwin`||b()?`shift + ⏎ for newline`:S()?`\\⏎ for newline`:`backslash (\\) + return (⏎) for newline`}function T(e,t){return t.ctrl||t.meta||t.escape||t.return||t.tab||t.backspace||t.delete||t.upArrow||t.downArrow||t.leftArrow||t.rightArrow||t.pageUp||t.pageDown||t.home||t.end?!1:e.length>0&&!/^\s/.test(e)&&!e.startsWith(`\x1B`)}var E=e((()=>{x(),u(),f()}));function D(e){return e.replace(/\+/g,` + `)}function O(e){let{dimColor:t,fixedWidth:r,gap:a,paddingX:o}=e,s=D(y(`app:toggleTranscript`,`Global`,`ctrl+o`)),c=D(y(`app:toggleTodos`,`Global`,`ctrl+t`)),u=D(y(`chat:undo`,`Chat`,`ctrl+_`)),f=D(y(`chat:stash`,`Chat`,`ctrl+s`)),p=D(y(`chat:cycleMode`,`Chat`,`shift+tab`)),h=D(y(`chat:modelPicker`,`Chat`,`alt+p`)),g=D(y(`chat:fastMode`,`Chat`,`alt+o`)),_=D(y(`chat:externalEditor`,`Chat`,`ctrl+g`));D(y(`app:toggleTerminal`,`Global`,`meta+j`));let b=D(y(`chat:imagePaste`,`Chat`,`ctrl+v`));return(0,k.jsxs)(i,{paddingX:o,flexDirection:`row`,gap:a,children:[(0,k.jsxs)(i,{flexDirection:`column`,width:r?24:void 0,children:[(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:`! for bash mode`})}),(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:`/ for commands`})}),(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:`@ for file paths`})}),(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:`& for background`})}),(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:`/btw for side question`})})]}),(0,k.jsxs)(i,{flexDirection:`column`,width:r?35:void 0,children:[(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:`double tap esc to clear input`})}),(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[p,` `,process.env.USER_TYPE===`ant`?`to cycle modes`:`to auto-accept edits`]})}),(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[s,` for verbose output`]})}),(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[c,` to toggle tasks`]})}),null,(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:w()})})]}),(0,k.jsxs)(i,{flexDirection:`column`,children:[(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[u,` to undo`]})}),m()!==`windows`&&(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:`ctrl + z to suspend`})}),(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[b,` to paste images`]})}),(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[h,` to switch model`]})}),l()&&d()&&(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[g,` to toggle fast mode`]})}),(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[f,` to stash prompt`]})}),(0,k.jsx)(i,{children:(0,k.jsxs)(n,{dimColor:t,children:[_,` to edit in $EDITOR`]})}),v()&&(0,k.jsx)(i,{children:(0,k.jsx)(n,{dimColor:t,children:`/keybindings to customize`})})]})]})}var k,A=e((()=>{t(),r(),h(),_(),g(),o(),c(),E(),k=a()}));export{C as a,T as i,A as n,E as r,O as t};
@@ -0,0 +1 @@
1
+ import{a as e}from"./chunk-DR8-3Aex.js";import{c as t,s as n,u as r}from"./envUtils-BWeoiL4Y.js";import{n as i,t as a}from"./defineProperty-80gRi2ZW.js";import{Tn as o,wn as s}from"./src-Di342QoJ.js";import{Ct as c,Lt as l,Nt as u,cn as d,it as f,ln as ee}from"./state-sIHsFpDu.js";import{Br as p,Dl as m,Dr as h,El as g,Pr as _,a as v,dc as y,i as te,pi as b,vi as x,yc as S}from"./paths-DO4WOQtD.js";import{n as C,t as ne}from"./cwd--iizewsn.js";import{et as w,i as re,o as T}from"./log-DSV4Ht5l.js";import{$D as E,$O as ie,En as ae,Fr as oe,Hk as D,Hl as se,Hn as O,Ij as k,Oy as ce,RE as A,Tn as le,Ty as ue,Uk as j,Un as de,Uo as M,Vl as N,Wk as P,Xn as F,Zn as fe,aD as pe,at as me,bs as he,cO as ge,ck as I,co as _e,di as L,do as ve,dt as R,eO as z,ea as ye,ek as B,et as be,ft as xe,hr as V,iD as Se,jy as Ce,km as we,mh as Te,na as H,oD as U,oO as W,ph as Ee,rD as De,tt as Oe,vs as G,zE as K,zj as ke,zn as Ae}from"./loadAgentsDir-ClTeo0nk.js";import{$n as je,Et as Me,Qn as Ne,kt as Pe}from"./prompt-CfM_xGPc.js";import{i as Fe,o as Ie}from"./fileStateCache-BhVfo23e.js";import{P as q,X as Le,Z as Re}from"./rcDebugLog-CwU_wJBE.js";import{a as ze,n as Be,r as Ve}from"./mappers-7BSMbYvH.js";import{c as He,n as Ue,o as We,r as Ge,s as Ke}from"./MessageSelector-DwdAC2io.js";import{n as qe,t as J}from"./systemTheme-eRWGHYSL.js";import{randomUUID as Y}from"crypto";n(),i(),s(),d(),g(),C(),w(),T(),S(),x(),v(),Ne(),Pe(),Ie(),q(),B(),ge(),Ce(),we(),N(),G(),M(),H(),oe(),F(),le(),Oe(),xe(),P(),z(),_(),I(),k();async function Je({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([]),j(),i===void 0?D():Promise.resolve({})]);return{defaultSystemPrompt:a,userContext:o,systemContext:s}}async function Ye({tools:e,commands:t,mcpClients:n,messages:r,readFileState:i,getAppState:a,setAppState:o,customSystemPrompt:s,appendSystemPrompt:c,thinkingConfig:l,agents:u}){let d=h(),f=a(),{defaultSystemPrompt:ee,userContext:p,systemContext:m}=await Je({tools:e,mainLoopModel:d,additionalWorkingDirectories:Array.from(f.toolPermissionContext.additionalWorkingDirectories.keys()),mcpClients:n,customSystemPrompt:s}),g=Le([...s===void 0?ee:[s],...c?[c]:[]]),_=r.at(-1),v=_?.type===`assistant`&&_.message.stop_reason===null?r.slice(0,-1):r;return{systemPrompt:g,userContext:p,systemContext:m,toolUseContext:{options:{commands:t,debug:!1,mainLoopModel:d,tools:e,verbose:!1,thinkingConfig:l??(ke()===!1?{type:`disabled`}:{type:`adaptive`}),mcpClients:n,mcpResources:{},isNonInteractiveSession:!0,agentDefinitions:{activeAgents:u,allAgents:[]},customSystemPrompt:s,appendSystemPrompt:c},abortController:E(),readFileState:i,getAppState:a,setAppState:o,messages:v,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:()=>{},updateAttributionState:()=>{}},forkContextMessages:v}}z(),_(),Ee(),I(),J(),k(),Be(),O(),Se();var Xe=()=>{try{return Ge(),e(Ue)}catch{return null}},Ze=(K(),e(A)).getCoordinatorUserContext,Qe=class{constructor(e){a(this,`config`,void 0),a(this,`mutableMessages`,void 0),a(this,`abortController`,void 0),a(this,`permissionDenials`,void 0),a(this,`totalUsage`,void 0),a(this,`hasHandledOrphanedPermission`,!1),a(this,`readFileState`,void 0),a(this,`discoveredSkillNames`,new Set),a(this,`loadedNestedMemoryPaths`,new Set),this.config=e,this.mutableMessages=e.initialMessages??[],this.abortController=e.abortController??E(),this.permissionDenials=[],this.readFileState=e.readFileCache,this.totalUsage=Re}async*submitMessage(e,n){let{cwd:i,commands:a,tools:s,mcpClients:d,verbose:g=!1,thinkingConfig:_,maxTurns:v,maxBudgetUsd:x,taskBudget:S,canUseTool:C,customSystemPrompt:w,appendSystemPrompt:T,userSpecifiedModel:E,fallbackModel:oe,jsonSchema:D,getAppState:O,setAppState:k,replayUserMessages:A=!1,includePartialMessages:le=!1,agents:j=[],setSDKStatus:M,orphanedPermission:N}=this.config;this.discoveredSkillNames.clear(),this.permissionDenials=[],Te(i);let P=!ee(),F=Date.now(),ge=async(e,t,n,r,i,a)=>{let o=await C(e,t,n,r,i,a);return o.behavior!==`allow`&&this.permissionDenials.push({type:`permission_denial`,tool_name:Ke(e.name),tool_use_id:i,tool_input:t}),o},I=O(),R=E?p(E):h(),z=_||(ke()===!1?{type:`disabled`}:{type:`adaptive`});W(`before_getSystemPrompt`);let B=typeof w==`string`?w:void 0,{defaultSystemPrompt:xe,userContext:Se,systemContext:Ce}=await Je({tools:s,mainLoopModel:R,additionalWorkingDirectories:Array.from(I.toolPermissionContext.additionalWorkingDirectories.keys()),mcpClients:d,customSystemPrompt:B});W(`after_getSystemPrompt`);let we={...Se,...Ze(d,de()?Ae():void 0)},H=B!==void 0&&te()?await fe():null,Ee=Le([...B===void 0?xe:[B],...H?[H]:[],...T?[T]:[]]),Oe=s.some(e=>je(e,Me));D&&Oe&&ae(k,c());let G={messages:this.mutableMessages,setMessages:e=>{this.mutableMessages=e(this.mutableMessages)},onChangeAPIKey:()=>{},handleElicitation:this.config.handleElicitation,options:{commands:a,debug:!1,tools:s,verbose:g,mainLoopModel:R,thinkingConfig:z,mcpClients:d,mcpResources:{},ideInstallationStatus:null,isNonInteractiveSession:!0,customSystemPrompt:w,appendSystemPrompt:T,agentDefinitions:{activeAgents:j,allAgents:[]},theme:qe(y().theme),maxBudgetUsd:x},getAppState:O,setAppState:k,abortController:this.abortController,readFileState:this.readFileState,nestedMemoryAttachmentTriggers:new Set,loadedNestedMemoryPaths:this.loadedNestedMemoryPaths,dynamicSkillDirTriggers:new Set,discoveredSkillNames:this.discoveredSkillNames,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:e=>{k(t=>{let n=e(t.fileHistory);return n===t.fileHistory?t:{...t,fileHistory:n}})},updateAttributionState:e=>{k(t=>{let n=e(t.attribution);return n===t.attribution?t:{...t,attribution:n}})},setSDKStatus:M};if(N&&!this.hasHandledOrphanedPermission){this.hasHandledOrphanedPermission=!0;for await(let e of De(N,s,this.mutableMessages,G))yield e}let{messages:K,shouldQuery:Ne,allowedTools:Pe,model:Fe,resultText:Ie}=await He({input:e,mode:`prompt`,setToolJSX:()=>{},context:{...G,messages:this.mutableMessages},messages:this.mutableMessages,uuid:n?.uuid,isMeta:n?.isMeta,querySource:`sdk`});this.mutableMessages.push(...K);let q=[...this.mutableMessages];if(P&&K.length>0){let e=L(q);t()||(await e,(r(process.env.CLAUDE_CODE_EAGER_FLUSH)||r(process.env.CLAUDE_CODE_IS_COWORK))&&await V())}let Be=Xe(),Ue=K.filter(e=>e.type===`user`&&!e.isMeta&&!e.toolUseResult&&(Be?.selectableUserMessagesFilter(e)??!0)||e.type===`system`&&e.subtype===`compact_boundary`),Ge=A?Ue:[];k(e=>({...e,toolPermissionContext:{...e.toolPermissionContext,alwaysAllowRules:{...e.toolPermissionContext.alwaysAllowRules,command:Pe}}}));let J=Fe??R;G={messages:q,setMessages:()=>{},onChangeAPIKey:()=>{},handleElicitation:this.config.handleElicitation,options:{commands:a,debug:!1,tools:s,verbose:g,mainLoopModel:J,thinkingConfig:z,mcpClients:d,mcpResources:{},ideInstallationStatus:null,isNonInteractiveSession:!0,customSystemPrompt:w,appendSystemPrompt:T,theme:qe(y().theme),agentDefinitions:{activeAgents:j,allAgents:[]},maxBudgetUsd:x},getAppState:O,setAppState:k,abortController:this.abortController,readFileState:this.readFileState,nestedMemoryAttachmentTriggers:new Set,loadedNestedMemoryPaths:this.loadedNestedMemoryPaths,dynamicSkillDirTriggers:new Set,discoveredSkillNames:this.discoveredSkillNames,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:G.updateFileHistoryState,updateAttributionState:G.updateAttributionState,setSDKStatus:M},W(`before_skills_plugins`);let[Ye,{enabled:Qe}]=await Promise.all([ye(ne()),he()]);if(W(`after_skills_plugins`),yield We({tools:s,mcpClients:d,model:J,permissionMode:I.toolPermissionContext.mode,commands:a,agents:j,skills:Ye,plugins:Qe,fastMode:I.fastMode}),W(`system_message_yielded`),!Ne){for(let e of K)if(e.type===`user`&&typeof e.message.content==`string`&&(e.message.content.includes(`<local-command-stdout>`)||e.message.content.includes(`<local-command-stderr>`)||e.isCompactSummary)&&(yield{type:`user`,message:{...e.message,content:o(e.message.content)},session_id:c(),parent_tool_use_id:null,uuid:e.uuid,timestamp:e.timestamp,isReplay:!e.isCompactSummary,isSynthetic:e.isMeta||e.isVisibleInTranscriptOnly}),e.type===`system`&&e.subtype===`local_command`&&typeof e.content==`string`&&(e.content.includes(`<local-command-stdout>`)||e.content.includes(`<local-command-stderr>`))&&(yield Ve(e.content,e.uuid)),e.type===`system`&&e.subtype===`compact_boundary`){let t=e;yield{type:`system`,subtype:`compact_boundary`,session_id:c(),uuid:e.uuid,compact_metadata:ze(t.compactMetadata)}}P&&(await L(q),(r(process.env.CLAUDE_CODE_EAGER_FLUSH)||r(process.env.CLAUDE_CODE_IS_COWORK))&&await V()),yield{type:`result`,subtype:`success`,is_error:!1,duration_ms:Date.now()-F,duration_api_ms:u(),num_turns:q.length-1,result:Ie??``,stop_reason:null,session_id:c(),total_cost_usd:l(),usage:this.totalUsage,modelUsage:f(),permission_denials:this.permissionDenials,fast_mode_state:b(J,I.fastMode),uuid:Y()};return}if(ue()&&P){let e=Xe()?.selectableUserMessagesFilter??(e=>!0);K.filter(e).forEach(e=>{ce(e=>{k(t=>({...t,fileHistory:e(t.fileHistory)}))},e.uuid)})}let X=Re,Z=1,$e=!1,et,Q=null,tt=re().at(-1),nt=D?ve(this.mutableMessages,Me):0;for await(let e of se({messages:q,systemPrompt:Ee,userContext:we,systemContext:Ce,canUseTool:ge,toolUseContext:G,fallbackModel:oe,querySource:`sdk`,maxTurns:v,taskBudget:S})){if(e.type===`assistant`||e.type===`user`||e.type===`system`&&e.subtype===`compact_boundary`){if(P&&e.type===`system`&&e.subtype===`compact_boundary`){let t=e.compactMetadata?.preservedSegment?.tailUuid;if(t){let e=this.mutableMessages.findLastIndex(e=>e.uuid===t);e!==-1&&await L(this.mutableMessages.slice(0,e+1))}}if(q.push(e),P&&(e.type===`assistant`?L(q):await L(q)),!$e&&Ge.length>0){$e=!0;for(let e of Ge)e.type===`user`&&(yield{type:`user`,message:e.message,session_id:c(),parent_tool_use_id:null,uuid:e.uuid,timestamp:e.timestamp,isReplay:!0})}}switch(e.type===`user`&&Z++,e.type){case`tombstone`:break;case`assistant`:{let t=e,n=t.message?.stop_reason;n!=null&&(Q=n),this.mutableMessages.push(t),yield*U(t);break}case`progress`:{let t=e;this.mutableMessages.push(t),P&&(q.push(t),L(q)),yield*U(t);break}case`user`:{let t=e;this.mutableMessages.push(t),yield*U(t);break}case`stream_event`:{let t=e.event;if(t.type===`message_start`){X=Re;let e=t.message;X=me(X,e.usage)}if(t.type===`message_delta`){X=me(X,t.usage);let e=t.delta;e.stop_reason!=null&&(Q=e.stop_reason)}t.type===`message_stop`&&(this.totalUsage=be(this.totalUsage,X)),le&&(yield{type:`stream_event`,event:t,session_id:c(),parent_tool_use_id:null,uuid:Y()});break}case`attachment`:{let t=e;this.mutableMessages.push(t),P&&(q.push(t),L(q));let n=t.attachment;if(n.type===`structured_output`)et=n.data;else if(n.type===`max_turns_reached`){P&&(r(process.env.CLAUDE_CODE_EAGER_FLUSH)||r(process.env.CLAUDE_CODE_IS_COWORK))&&await V(),yield{type:`result`,subtype:`error_max_turns`,duration_ms:Date.now()-F,duration_api_ms:u(),is_error:!0,num_turns:n.turnCount,stop_reason:Q,session_id:c(),total_cost_usd:l(),usage:this.totalUsage,modelUsage:f(),permission_denials:this.permissionDenials,fast_mode_state:b(J,I.fastMode),uuid:Y(),errors:[`Reached maximum number of turns (${n.maxTurns})`]};return}else A&&n.type===`queued_command`&&(yield{type:`user`,message:{role:`user`,content:n.prompt},session_id:c(),parent_tool_use_id:null,uuid:n.source_uuid||t.uuid,timestamp:t.timestamp,isReplay:!0});break}case`stream_request_start`:break;case`system`:{let t=e,n=this.config.snipReplay?.(t,this.mutableMessages);if(n!==void 0){n.executed&&(this.mutableMessages.length=0,this.mutableMessages.push(...n.messages));break}if(this.mutableMessages.push(t),t.subtype===`compact_boundary`&&t.compactMetadata){let e=t,n=this.mutableMessages.length-1;n>0&&this.mutableMessages.splice(0,n);let r=q.length-1;r>0&&q.splice(0,r),yield{type:`system`,subtype:`compact_boundary`,session_id:c(),uuid:t.uuid,compact_metadata:ze(e.compactMetadata)}}if(t.subtype===`api_error`){let e=t;yield{type:`system`,subtype:`api_retry`,attempt:e.retryAttempt,max_retries:e.maxRetries,retry_delay_ms:e.retryInMs,error_status:e.error.status??null,error:ie(e.error),session_id:c(),uuid:t.uuid}}break}case`tool_use_summary`:{let t=e;yield{type:`tool_use_summary`,summary:t.summary,preceding_tool_use_ids:t.precedingToolUseIds,session_id:c(),uuid:t.uuid};break}}if(x!==void 0&&l()>=x){P&&(r(process.env.CLAUDE_CODE_EAGER_FLUSH)||r(process.env.CLAUDE_CODE_IS_COWORK))&&await V(),yield{type:`result`,subtype:`error_max_budget_usd`,duration_ms:Date.now()-F,duration_api_ms:u(),is_error:!0,num_turns:Z,stop_reason:Q,session_id:c(),total_cost_usd:l(),usage:this.totalUsage,modelUsage:f(),permission_denials:this.permissionDenials,fast_mode_state:b(J,I.fastMode),uuid:Y(),errors:[`Reached maximum budget ($${x}). Increase the limit with --max-budget-usd or start a new session.`]};return}if(e.type===`user`&&D){let e=ve(this.mutableMessages,Me)-nt,t=parseInt(process.env.MAX_STRUCTURED_OUTPUT_RETRIES||`5`,10);if(e>=t){P&&(r(process.env.CLAUDE_CODE_EAGER_FLUSH)||r(process.env.CLAUDE_CODE_IS_COWORK))&&await V(),yield{type:`result`,subtype:`error_max_structured_output_retries`,duration_ms:Date.now()-F,duration_api_ms:u(),is_error:!0,num_turns:Z,stop_reason:Q,session_id:c(),total_cost_usd:l(),usage:this.totalUsage,modelUsage:f(),permission_denials:this.permissionDenials,fast_mode_state:b(J,I.fastMode),uuid:Y(),errors:[`Failed to provide valid structured output after ${t} attempts`]};return}}}let $=q.findLast(e=>e.type===`assistant`||e.type===`user`),rt=$?.type??`undefined`,it=$?.type===`assistant`?m($.message.content)?.type??`none`:`n/a`;if(P&&(r(process.env.CLAUDE_CODE_EAGER_FLUSH)||r(process.env.CLAUDE_CODE_IS_COWORK))&&await V(),!pe($,Q)){yield{type:`result`,subtype:`error_during_execution`,duration_ms:Date.now()-F,duration_api_ms:u(),is_error:!0,num_turns:Z,stop_reason:Q,session_id:c(),total_cost_usd:l(),usage:this.totalUsage,modelUsage:f(),permission_denials:this.permissionDenials,fast_mode_state:b(J,I.fastMode),uuid:Y(),errors:(()=>{let e=re(),t=tt?e.lastIndexOf(tt)+1:0;return[`[ede_diagnostic] result_type=${rt} last_content_type=${it} stop_reason=${Q}`,...e.slice(t).map(e=>e.error)]})()};return}let at=``,ot=!1;if($.type===`assistant`){let e=m($.message.content);e?.type===`text`&&!_e.has(e.text)&&(at=e.text),ot=!!$.isApiErrorMessage}yield{type:`result`,subtype:`success`,is_error:ot,duration_ms:Date.now()-F,duration_api_ms:u(),num_turns:Z,result:at,stop_reason:Q,session_id:c(),total_cost_usd:l(),usage:this.totalUsage,modelUsage:f(),permission_denials:this.permissionDenials,structured_output:et,fast_mode_state:b(J,I.fastMode),uuid:Y()}}interrupt(){this.abortController.abort()}resetAbortController(){this.abortController=E()}getAbortSignal(){return this.abortController.signal}getMessages(){return this.mutableMessages}getReadFileState(){return this.readFileState}getSessionId(){return c()}setModel(e){this.config.userSpecifiedModel=e}};async function*X({commands:e,prompt:t,promptUuid:n,isMeta:r,cwd:i,tools:a,mcpClients:o,verbose:s=!1,thinkingConfig:c,maxTurns:l,maxBudgetUsd:u,taskBudget:d,canUseTool:f,mutableMessages:ee=[],getReadFileCache:p,setReadFileCache:m,customSystemPrompt:h,appendSystemPrompt:g,userSpecifiedModel:_,fallbackModel:v,jsonSchema:y,getAppState:te,setAppState:b,abortController:x,replayUserMessages:S=!1,includePartialMessages:C=!1,handleElicitation:ne,agents:w=[],setSDKStatus:re,orphanedPermission:T}){let E=new Qe({cwd:i,tools:a,commands:e,mcpClients:o,agents:w??[],canUseTool:f,getAppState:te,setAppState:b,initialMessages:ee,readFileCache:Fe(p()),customSystemPrompt:h,appendSystemPrompt:g,userSpecifiedModel:_,fallbackModel:v,thinkingConfig:c,maxTurns:l,maxBudgetUsd:u,taskBudget:d,jsonSchema:y,verbose:s,handleElicitation:ne,replayUserMessages:S,includePartialMessages:C,setSDKStatus:re,abortController:x,orphanedPermission:T});try{yield*E.submitMessage(t,{uuid:n,isMeta:r})}finally{m(E.getReadFileState())}}export{X as n,Ye as r,Qe as t};