claude-code-best 2.6.0 → 2.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (429) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-Cj5bvJgD.js → AddWorkspaceDirectory-Bb6crGWh.js} +1 -1
  2. package/dist/chunks/{App-2tgSv9lb.js → App-CW0Y4ceR.js} +1 -1
  3. package/dist/chunks/{ApproveApiKey-DWa-XTLb.js → ApproveApiKey-9rkwQfgT.js} +1 -1
  4. package/dist/chunks/ApproveApiKey-BhMr2Y5F.js +1 -0
  5. package/dist/chunks/{AssistantSessionChooser-DF9eeJZS.js → AssistantSessionChooser-XzXZZdiH.js} +1 -1
  6. package/dist/chunks/BackgroundTasksDialog-BL_dfbZP.js +2 -0
  7. package/dist/chunks/BypassPermissionsModeDialog-DlLWAKw2.js +1 -0
  8. package/dist/chunks/{ClaudeInChromeOnboarding-BW4XHmkw.js → ClaudeInChromeOnboarding-CjGydpBk.js} +1 -1
  9. package/dist/chunks/{ClaudeMdExternalIncludesDialog-Bz0JyaOG.js → ClaudeMdExternalIncludesDialog-B04cjDwX.js} +1 -1
  10. package/dist/chunks/ClaudeMdExternalIncludesDialog-DPki55Xa.js +1 -0
  11. package/dist/chunks/ConsoleOAuthFlow-D_j1NebK.js +1 -0
  12. package/dist/chunks/{DesktopHandoff-CcsM_OAS.js → DesktopHandoff-CFBUqcCf.js} +1 -1
  13. package/dist/chunks/DevChannelsDialog-ByTf41du.js +1 -0
  14. package/dist/chunks/DiffDialog-CY-8kw_Q.js +3 -0
  15. package/dist/chunks/Doctor-2D5Wz58o.js +1 -0
  16. package/dist/chunks/Doctor-CDez_u_U.js +3 -0
  17. package/dist/chunks/{ExitFlow-C4ybxKPn.js → ExitFlow-BlON8IgH.js} +2 -2
  18. package/dist/chunks/Feedback-CSeD3k4M.js +2 -0
  19. package/dist/chunks/Grove-Dwu_0zRw.js +1 -0
  20. package/dist/chunks/{Grove-CKVpREDU.js → Grove-Tp_UtIMg.js} +1 -1
  21. package/dist/chunks/{HybridTransport-Byjvz-DL.js → HybridTransport-CAko699F.js} +2 -2
  22. package/dist/chunks/{ITermBackend-Co9XpeS4.js → ITermBackend-5P3WJumD.js} +1 -1
  23. package/dist/chunks/{InvalidConfigDialog-CNsqbNU3.js → InvalidConfigDialog-CVcdra9v.js} +1 -1
  24. package/dist/chunks/{InvalidSettingsDialog-ClnZaN6b.js → InvalidSettingsDialog-CfLdbmSI.js} +1 -1
  25. package/dist/chunks/MCPConnectionManager-BK_3uwQj.js +1 -0
  26. package/dist/chunks/{McpParsingWarnings-DZkzoeZf.js → McpParsingWarnings-BOj-T8F3.js} +1 -1
  27. package/dist/chunks/MessageSelector-BRkxpO1O.js +3 -0
  28. package/dist/chunks/Messages-wyMyMP7U.js +11 -0
  29. package/dist/chunks/{Onboarding-BwoGQB4g.js → Onboarding-C06Mxlf-.js} +1 -1
  30. package/dist/chunks/{OverageCreditUpsell-Q5g2YjQw.js → OverageCreditUpsell-abcPm3PB.js} +1 -1
  31. package/dist/chunks/PluginSettings-DGpIVGvV.js +17 -0
  32. package/dist/chunks/{PromptInputFooterSuggestions-D4lMVCqj.js → PromptInputFooterSuggestions-ihnbjU0K.js} +1 -1
  33. package/dist/chunks/{PromptInputHelpMenu-BvLtS6an.js → PromptInputHelpMenu-CMm8z7Gk.js} +1 -1
  34. package/dist/chunks/QueryEngine-I3Bqzbiz.js +1 -0
  35. package/dist/chunks/REPL-BxAsVlx3.js +1 -0
  36. package/dist/chunks/REPL-CBFcgD4r.js +97 -0
  37. package/dist/chunks/{RemoteCallout-BV_hoz98.js → RemoteCallout-Cy6lH-CZ.js} +1 -1
  38. package/dist/chunks/{RemoteSessionManager-Cxoy1ud2.js → RemoteSessionManager-C7iGd5Og.js} +2 -2
  39. package/dist/chunks/ResumeConversation-AdLtgdVB.js +1 -0
  40. package/dist/chunks/{SSETransport-pIm26VJq.js → SSETransport-B5xlXeAN.js} +1 -1
  41. package/dist/chunks/SearchExtraToolsTool-BJ8Nx_Nu.js +1 -0
  42. package/dist/chunks/SentryErrorBoundary-Bs7mtkPb.js +1 -0
  43. package/dist/chunks/{SentryErrorBoundary-B6EWoJml.js → SentryErrorBoundary-iih9eFpM.js} +1 -1
  44. package/dist/chunks/Settings-PioHwsvg.js +2 -0
  45. package/dist/chunks/{TeleportProgress-DPzGpyyM.js → TeleportProgress-BX-uLwuL.js} +1 -1
  46. package/dist/chunks/TeleportRepoMismatchDialog-D8oPPTWd.js +1 -0
  47. package/dist/chunks/{TeleportResumeWrapper-DPSO0S49.js → TeleportResumeWrapper-B_CvNDbr.js} +1 -1
  48. package/dist/chunks/{ThemePicker-DueihHcy.js → ThemePicker-BG1ykSpX.js} +1 -1
  49. package/dist/chunks/{TmuxBackend-BNaZNAeP.js → TmuxBackend-CnMCWNS4.js} +1 -1
  50. package/dist/chunks/TrustDialog-Z_maAYj8.js +1 -0
  51. package/dist/chunks/{ValidationErrorsList-1k1qbsRo.js → ValidationErrorsList-C9swVkZ-.js} +1 -1
  52. package/dist/chunks/{WelcomeV2-CR6TtXXM.js → WelcomeV2-Au_5ddlT.js} +1 -1
  53. package/dist/chunks/WindowsTerminalBackend-CGxaYH74.js +2 -0
  54. package/dist/chunks/{add-dir-DAMizKzF.js → add-dir-Cm9u56YX.js} +1 -1
  55. package/dist/chunks/{agentDisplay-B9z7i8b_.js → agentDisplay-Bi_bEyEn.js} +1 -1
  56. package/dist/chunks/{agents-D5u0p1UC.js → agents-CMF9fLzV.js} +7 -7
  57. package/dist/chunks/{agents-DCh_gEvJ.js → agents-CbjR7hNr.js} +1 -1
  58. package/dist/chunks/{ant-DRJq-cEg.js → ant-Bu1Gs4WJ.js} +1 -1
  59. package/dist/chunks/api-CFNGoLoL.js +1 -0
  60. package/dist/chunks/{api-B6URs6nc.js → api-D_t0nHsS.js} +1 -1
  61. package/dist/chunks/assistant-BLd4y2FJ.js +1 -0
  62. package/dist/chunks/{assistant-tPxOUa-Z.js → assistant-C_pfWe2a.js} +1 -1
  63. package/dist/chunks/{assistant-BRGDWkKB.js → assistant-EA-MHNQ-.js} +1 -1
  64. package/dist/chunks/{auth-CqURlg4d.js → auth-D7PZvVPf.js} +1 -1
  65. package/dist/chunks/auth-DGfZCD_B.js +1 -0
  66. package/dist/chunks/{autoMode-DVt4K4I2.js → autoMode-B8iO05xy.js} +6 -6
  67. package/dist/chunks/{autonomy-Ffv0QIyl.js → autonomy-CaLvE5N6.js} +12 -12
  68. package/dist/chunks/{autonomy-BZzW8QJZ.js → autonomy-dQVtSiCJ.js} +1 -1
  69. package/dist/chunks/{autonomyPanel-MwuzDvv_.js → autonomyPanel-DSswVlCF.js} +1 -1
  70. package/dist/chunks/backgroundHousekeeping-Ckj8W3RO.js +1 -0
  71. package/dist/chunks/backgroundHousekeeping-D2_Uopt7.js +17 -0
  72. package/dist/chunks/{branch-DXefFdDE.js → branch-C7pM8Sjh.js} +1 -1
  73. package/dist/chunks/{bridge-qr4GQW_c.js → bridge-CTYdzSWg.js} +2 -2
  74. package/dist/chunks/bridgeConfig-7c07tJm9.js +1 -0
  75. package/dist/chunks/{bridgeConfig-CJ-KznTS.js → bridgeConfig-Df6uyp3q.js} +1 -1
  76. package/dist/chunks/{bridgeEnabled-5vsPrjuq.js → bridgeEnabled-A-_xJ94c.js} +1 -1
  77. package/dist/chunks/bridgeEnabled-Z2S8lk0l.js +1 -0
  78. package/dist/chunks/bridgeMain-B7FZpvo0.js +68 -0
  79. package/dist/chunks/bridgeMain-C5UxF8ST.js +1 -0
  80. package/dist/chunks/{bridgeMessaging-BiE0CTqq.js → bridgeMessaging-DPVLAIzl.js} +1 -1
  81. package/dist/chunks/{btw-FpimqEqk.js → btw-CqgjLlFN.js} +1 -1
  82. package/dist/chunks/{buddy-BA3Cr067.js → buddy-DCGBAqF2.js} +1 -1
  83. package/dist/chunks/{bypassPermissionsKillswitch-CSC9p8mO.js → bypassPermissionsKillswitch-CK0jeZTW.js} +1 -1
  84. package/dist/chunks/{caches-BUBkfP2Q.js → caches-CdVW8fYV.js} +2 -2
  85. package/dist/chunks/caches-Dt52PedI.js +1 -0
  86. package/dist/chunks/{ccrClient-BOxUn9EJ.js → ccrClient-B_3AmY7K.js} +1 -1
  87. package/dist/chunks/changeDetector-uO9CBvut.js +1 -0
  88. package/dist/chunks/{channelNotification-l3EXKDNB.js → channelNotification-BbDQdLZC.js} +1 -1
  89. package/dist/chunks/channelNotification-DzTzUrCe.js +1 -0
  90. package/dist/chunks/{chrome-BnKyWWQL.js → chrome-CGyqsCkL.js} +1 -1
  91. package/dist/chunks/clear-B_cVk64B.js +1 -0
  92. package/dist/chunks/client-BcqXgcrx.js +1 -0
  93. package/dist/chunks/{color-D5MCzz9h.js → color-DEXUx7gE.js} +1 -1
  94. package/dist/chunks/commands-BX0_wEGw.js +1 -0
  95. package/dist/chunks/commitAttribution-CSVDcgTO.js +1 -0
  96. package/dist/chunks/{commitAttribution-BFshsh2H.js → commitAttribution-e0kkanVT.js} +1 -1
  97. package/dist/chunks/{compact-DWNaf1wR.js → compact-Dh9RewNA.js} +3 -3
  98. package/dist/chunks/{companion-CyK_Dr1U.js → companion-DVFacTUw.js} +1 -1
  99. package/dist/chunks/{config-DNz6Eitr.js → config-CkSmYDJY.js} +1 -1
  100. package/dist/chunks/{config-BdCuh6eA.js → config-DwiVCSrY.js} +1 -1
  101. package/dist/chunks/{context-BOjdTj0i.js → context-B8VDDHTv.js} +1 -1
  102. package/dist/chunks/{context-noninteractive-k2ibficU.js → context-noninteractive-IZfWniex.js} +2 -2
  103. package/dist/chunks/context-noninteractive-SBxqQ3iu.js +1 -0
  104. package/dist/chunks/conversation-CQBl9Yy2.js +1 -0
  105. package/dist/chunks/conversation-DVZplNag.js +1 -0
  106. package/dist/chunks/{copy-B0VUJ2rH.js → copy-CIjrYoFa.js} +2 -2
  107. package/dist/chunks/{createSSHSession-DqmkCS_k.js → createSSHSession-ArNlbIZB.js} +1 -1
  108. package/dist/chunks/{createSession-CJEsHz58.js → createSession-CBheIT_G.js} +1 -1
  109. package/dist/chunks/createSession-DfEQy2dZ.js +1 -0
  110. package/dist/chunks/cronJitterConfig-DcMGWOa-.js +6 -0
  111. package/dist/chunks/crossProjectResume-Z-aR2q-d.js +40 -0
  112. package/dist/chunks/{datadog-Bd1s_VFj.js → datadog-BK8eJz8B.js} +1 -1
  113. package/dist/chunks/datadog-Uj6FjEuU.js +1 -0
  114. package/dist/chunks/{desktop-BDowrzvG.js → desktop-B9vWJeRu.js} +1 -1
  115. package/dist/chunks/{diff-auU5sUOw.js → diff-BTV7_Dca.js} +1 -1
  116. package/dist/chunks/{doctor-bKPp6AeL.js → doctor-Dpbh0aRz.js} +1 -1
  117. package/dist/chunks/{effort-BQj2QnnA.js → effort-Czlwa5qF.js} +4 -4
  118. package/dist/chunks/{entry-CUu6-QhT.js → entry-CdfuWjKu.js} +3 -3
  119. package/dist/chunks/{envLessBridgeConfig-Ju4W58xf.js → envLessBridgeConfig-BAFYaZ0E.js} +1 -1
  120. package/dist/chunks/envLessBridgeConfig-DOO9eX07.js +1 -0
  121. package/dist/chunks/{exit-DijkO8eo.js → exit-DzOm62Dn.js} +1 -1
  122. package/dist/chunks/{export-DA-bBZkX.js → export-DHOR3z3Z.js} +1 -1
  123. package/dist/chunks/{exportRenderer-3y4tGdSB.js → exportRenderer-CiNXeNr9.js} +1 -1
  124. package/dist/chunks/extra-usage-CJcyfVCt.js +1 -0
  125. package/dist/chunks/{extra-usage-CS6VwKJt.js → extra-usage-DIYR_3ZR.js} +1 -1
  126. package/dist/chunks/{extra-usage-core-DOgT4u4i.js → extra-usage-core-C3uM9bOP.js} +1 -1
  127. package/dist/chunks/{extra-usage-noninteractive-DYnfiRlV.js → extra-usage-noninteractive-Ctz9TfY8.js} +1 -1
  128. package/dist/chunks/{extraUsage-CfxgfpX_.js → extraUsage-CBwIvl73.js} +1 -1
  129. package/dist/chunks/extractMemories-C3SU-Osb.js +1 -0
  130. package/dist/chunks/fast-7iinMwk-.js +1 -0
  131. package/dist/chunks/{fast-CzRUJBTK.js → fast-BpBwjbSD.js} +1 -1
  132. package/dist/chunks/{feedback-FoXtdHAV.js → feedback-BkVnsZVx.js} +1 -1
  133. package/dist/chunks/{firstPartyEventLogger-KIwaBY-E.js → firstPartyEventLogger-BCzGkdpd.js} +1 -1
  134. package/dist/chunks/{flushGate-C2Icy43G.js → flushGate-CQsnMw8g.js} +1 -1
  135. package/dist/chunks/{gates-CbQLZHtm.js → gates-CxWIWtmd.js} +1 -1
  136. package/dist/chunks/gates-qgzva-fO.js +1 -0
  137. package/dist/chunks/{gemini-BrNJGX4k.js → gemini-BbV8D2SS.js} +1 -1
  138. package/dist/chunks/{generateRecap-B0fvSCjo.js → generateRecap-B3j2nUgh.js} +1 -1
  139. package/dist/chunks/{generateSessionName-DvRYa39O.js → generateSessionName-aGnXSNgN.js} +1 -1
  140. package/dist/chunks/{githubRepoPathMapping-Dut3d6nn.js → githubRepoPathMapping-DCJLSTLl.js} +1 -1
  141. package/dist/chunks/{grok-Ftoheab3.js → grok-C4QFXJnR.js} +1 -1
  142. package/dist/chunks/{growthbook-BynnuVTn.js → growthbook-prtWhMRg.js} +1 -1
  143. package/dist/chunks/{heapdump-hQ_w0LPC.js → heapdump-Czm-2XiG.js} +1 -1
  144. package/dist/chunks/{help-DQsHHv6r.js → help-CSAFsN0-.js} +1 -1
  145. package/dist/chunks/hooks-Ch2vPE8u.js +1 -0
  146. package/dist/chunks/{hooks-BhVDc8yb.js → hooks-DkbOP-bI.js} +2 -2
  147. package/dist/chunks/{hostAdapter-D1eWmmhu.js → hostAdapter-BcdDPVTj.js} +1 -1
  148. package/dist/chunks/{ide-CPmMXLL-.js → ide-BXERRFZF.js} +2 -2
  149. package/dist/chunks/{inboundAttachments-Bmf6vYsE.js → inboundAttachments-7rXrAtkb.js} +1 -1
  150. package/dist/chunks/inboundAttachments-C0rkLl2x.js +1 -0
  151. package/dist/chunks/initReplBridge-tXqkba08.js +1 -0
  152. package/dist/chunks/{insights-CTlTyvjj.js → insights-DrvqJgF8.js} +25 -25
  153. package/dist/chunks/{install-IPuD3Lq8.js → install-BGnxwO00.js} +1 -1
  154. package/dist/chunks/{install-github-app-Bmu_sA9e.js → install-github-app-CIpBHlr9.js} +2 -2
  155. package/dist/chunks/{install-slack-app-Rfl81Jqo.js → install-slack-app-By4Lh7ww.js} +1 -1
  156. package/dist/chunks/{instrumentation-DWwmOmr0.js → instrumentation-D9y7Ph_R.js} +3 -3
  157. package/dist/chunks/{job-BXEt0izn.js → job-BPVIMW_P.js} +1 -1
  158. package/dist/chunks/{keybindings-DRDgVvqz.js → keybindings-Ce6AHMLI.js} +2 -2
  159. package/dist/chunks/{lang-D3ZHlfT6.js → lang-DfDG_fSa.js} +1 -1
  160. package/dist/chunks/language-B1yHC1d6.js +1 -0
  161. package/dist/chunks/{language-DcSjogBx.js → language-yGoDFP3X.js} +1 -1
  162. package/dist/chunks/{launchAgentsPlatform-BPm_VMln.js → launchAgentsPlatform-DT01xZM7.js} +1 -1
  163. package/dist/chunks/launchAutofixPr-DrYd7WVf.js +18 -0
  164. package/dist/chunks/{launchLocalMemory-D_hBbXKE.js → launchLocalMemory-Bt3tMYVJ.js} +1 -1
  165. package/dist/chunks/{launchLocalVault-CPzNWvQ9.js → launchLocalVault-jyRHEa_Y.js} +1 -1
  166. package/dist/chunks/{launchMemoryStores-Djq2KhKb.js → launchMemoryStores-cmXnLAF5.js} +1 -1
  167. package/dist/chunks/{launchOnboarding-Bh6E7vdc.js → launchOnboarding-BPTNFftb.js} +1 -1
  168. package/dist/chunks/{launchSchedule-C988bQ-5.js → launchSchedule-141GqGC8.js} +1 -1
  169. package/dist/chunks/{launchSkillStore-DqrP6Gme.js → launchSkillStore-Bz0lok_o.js} +1 -1
  170. package/dist/chunks/{launchTeleport-DFhybaq_.js → launchTeleport-BMquJxIq.js} +2 -2
  171. package/dist/chunks/{launchVault-p_CSK4ZQ.js → launchVault-Bsuwqad6.js} +1 -1
  172. package/dist/chunks/{loadAgentsDir-Ci5mr0vm.js → loadAgentsDir-D7kapZB5.js} +717 -709
  173. package/dist/chunks/loadAgentsDir-DxPE2bIO.js +1 -0
  174. package/dist/chunks/{loadPluginHooks-xYCEZ6t5.js → loadPluginHooks-CL5aGDrb.js} +1 -1
  175. package/dist/chunks/localSearch-iozuZZhZ.js +1 -0
  176. package/dist/chunks/{localSearch-Vpn6W5aY.js → localSearch-r1_G8kfV.js} +1 -1
  177. package/dist/chunks/{login-D9IWjvza.js → login-7MvpaOkt.js} +1 -1
  178. package/dist/chunks/login-Dxza_KNT.js +1 -0
  179. package/dist/chunks/{logoV2Utils-SAulcC5x.js → logoV2Utils-DjThKW15.js} +1 -1
  180. package/dist/chunks/logout-BeGQR78E.js +1 -0
  181. package/dist/chunks/{magicDocs-BfoeYhin.js → magicDocs-Dy72LHIj.js} +2 -2
  182. package/dist/chunks/{main-DhMlhVj3.js → main-CF6Im-LV.js} +46 -46
  183. package/dist/chunks/{mappers-uIrAj-Wd.js → mappers-CkMESMy7.js} +1 -1
  184. package/dist/chunks/mcp-BTgHgOhR.js +2 -0
  185. package/dist/chunks/mcp-UJZ22IDJ.js +6 -0
  186. package/dist/chunks/mcp-fHf8Uc7h.js +1 -0
  187. package/dist/chunks/{mcpServer-1SnOWb8_.js → mcpServer-BueM5fWI.js} +1 -1
  188. package/dist/chunks/{mcpServer-DXvS3v4x.js → mcpServer-Dqm2PQQx.js} +1 -1
  189. package/dist/chunks/{memory-XccPLQLt.js → memory-BNZmqma1.js} +1 -1
  190. package/dist/chunks/model-D3g2QdU-.js +1 -0
  191. package/dist/chunks/{model-CbiDGGJU.js → model-DOw7wIKQ.js} +1 -1
  192. package/dist/chunks/{onChangeAppState-Dp0JIXd8.js → onChangeAppState-Cb9_yIuW.js} +1 -1
  193. package/dist/chunks/{openai-6KcHd4Hw.js → openai-Bvo0Gcec.js} +3 -3
  194. package/dist/chunks/{overageCreditGrant-DYiB4sr-.js → overageCreditGrant-BrN7dk3d.js} +1 -1
  195. package/dist/chunks/{passes-Cbc6T_Tj.js → passes-vgcY8_l8.js} +1 -1
  196. package/dist/chunks/{paths-Q2255dD7.js → paths-1ngPRtu3.js} +2 -2
  197. package/dist/chunks/permissions-BDbIjTT6.js +3 -0
  198. package/dist/chunks/{pipeTransport-D7NIp3aA.js → pipeTransport-KU8psPDI.js} +1 -1
  199. package/dist/chunks/{plan-DloFVJK7.js → plan-5NVPuxp6.js} +1 -1
  200. package/dist/chunks/{plugin-XR9IBPMM.js → plugin-t8jMqdsY.js} +1 -1
  201. package/dist/chunks/{pluginAutoupdate-Cr9hP0zG.js → pluginAutoupdate-CAa4KLro.js} +1 -1
  202. package/dist/chunks/{pluginBlocklist-CM9uP8CY.js → pluginBlocklist-BG2LkLq1.js} +1 -1
  203. package/dist/chunks/{pluginCliCommands-BQkrvES5.js → pluginCliCommands-vqAtVibb.js} +1 -1
  204. package/dist/chunks/{pluginFlagging-CJ1--2Kw.js → pluginFlagging-BFCtv3kY.js} +1 -1
  205. package/dist/chunks/{pluginOperations-B0rLuSvo.js → pluginOperations-C9XP-mko.js} +2 -2
  206. package/dist/chunks/pluginStartupCheck-DZp0wnXP.js +1 -0
  207. package/dist/chunks/{pluginStartupCheck-Bjdc8zhz.js → pluginStartupCheck-RRcAbKfx.js} +1 -1
  208. package/dist/chunks/plugins-0SyID4Kx.js +4 -0
  209. package/dist/chunks/policyLimits-Cmmzuv-E.js +1 -0
  210. package/dist/chunks/{pollConfig-DhptuhFw.js → pollConfig-DTYIJ8lQ.js} +1 -1
  211. package/dist/chunks/{poor-DF0aqXDx.js → poor-Dw5dMZpM.js} +1 -1
  212. package/dist/chunks/{poorMode-C5Frra4j.js → poorMode-CsGLI_hm.js} +1 -1
  213. package/dist/chunks/poorMode-D_hB-rDf.js +1 -0
  214. package/dist/chunks/{print-CPtR0KTa.js → print-Ct8N4PYT.js} +12 -12
  215. package/dist/chunks/{privacy-settings-e-7lc7Un.js → privacy-settings-P2r-kg2i.js} +1 -1
  216. package/dist/chunks/processBashCommand-a8W8aTRu.js +1 -0
  217. package/dist/chunks/{processSlashCommand-DHRUtZ-C.js → processSlashCommand-BaUdUg3T.js} +3 -3
  218. package/dist/chunks/prompt-B1Qy8mi4.js +1 -0
  219. package/dist/chunks/{prompt-DEPUnJdB.js → prompt-BBg3jtfc.js} +1 -1
  220. package/dist/chunks/prompt-D4kWWEZC.js +1 -0
  221. package/dist/chunks/{promptEditor-Ci-h04-5.js → promptEditor-CvaugNTt.js} +2 -2
  222. package/dist/chunks/{protocolHandler-DhqM32qE.js → protocolHandler-DxBaHlaD.js} +1 -1
  223. package/dist/chunks/{rate-limit-options-B0l29Zx8.js → rate-limit-options-Df_sgE0b.js} +1 -1
  224. package/dist/chunks/rcDebugLog-CPGWJbI4.js +11 -0
  225. package/dist/chunks/{referral-ByevBJrE.js → referral-BKeCKnOJ.js} +1 -1
  226. package/dist/chunks/{refresh-B_CwwIRX.js → refresh-Cjv4jA6L.js} +1 -1
  227. package/dist/chunks/{registerProtocol-DzhaQH02.js → registerProtocol-DLuRm0mf.js} +1 -1
  228. package/dist/chunks/{registry-DkHA4cRu.js → registry-DVSgtCq5.js} +1 -1
  229. package/dist/chunks/{release-notes-CZthYkei.js → release-notes-CZcf8zB7.js} +1 -1
  230. package/dist/chunks/{releaseNotes-CwKpIsyd.js → releaseNotes-CvfZb3fZ.js} +2 -2
  231. package/dist/chunks/{reload-plugins-DxWfXvrN.js → reload-plugins-pSlDLk3b.js} +1 -1
  232. package/dist/chunks/{remote-env-BiRLWIrh.js → remote-env-BH89NuwC.js} +1 -1
  233. package/dist/chunks/{remoteBridgeCore-nz1fPY1U.js → remoteBridgeCore-CrXlWEL1.js} +1 -1
  234. package/dist/chunks/{remoteControlServer-FzLUxh2B.js → remoteControlServer-BSOnq4yY.js} +1 -1
  235. package/dist/chunks/{rename-DmGuyncE.js → rename-DNGvNQm2.js} +1 -1
  236. package/dist/chunks/{resume-7GeU7RMS.js → resume-6UL38yL3.js} +2 -2
  237. package/dist/chunks/{runtimeObserver-Duod-ign.js → runtimeObserver-BhvHeiwD.js} +4 -4
  238. package/dist/chunks/{runtimeObserver-OgM9ZYxZ.js → runtimeObserver-Cp-DN8fP.js} +1 -1
  239. package/dist/chunks/sandbox-adapter-DGVtPPD0.js +1 -0
  240. package/dist/chunks/{sandbox-toggle-Cc96R6Ox.js → sandbox-toggle-D19YbI5G.js} +1 -1
  241. package/dist/chunks/searchExtraTools-DXWkpOIg.js +1 -0
  242. package/dist/chunks/{sentry-BUHYuYGj.js → sentry-BZmpC-iI.js} +1 -1
  243. package/dist/chunks/{session-DgLqm7ZI.js → session-lLpGqp0B.js} +2 -2
  244. package/dist/chunks/{sessionDiscovery-DgNea6qa.js → sessionDiscovery-BX3fjgzD.js} +1 -1
  245. package/dist/chunks/sessionFileAccessHooks-BeuS4m7a.js +1 -0
  246. package/dist/chunks/sessionMemory-LMOQk90c.js +1 -0
  247. package/dist/chunks/sessionMemory-UpILj5ww.js +1 -0
  248. package/dist/chunks/sessionMemoryUtils-DE7AezA0.js +1 -0
  249. package/dist/chunks/{sessionObserver-CuWMVPlT.js → sessionObserver-CujNIWks.js} +1 -1
  250. package/dist/chunks/sessionObserver-HqvTXhs9.js +1 -0
  251. package/dist/chunks/sessionStorage-BN56DAAd.js +1 -0
  252. package/dist/chunks/{sessionTitle-DzkMzHer.js → sessionTitle-QxXslbJY.js} +1 -1
  253. package/dist/chunks/{sessionTracing-DTjmc0EF.js → sessionTracing-DognYcDf.js} +1 -1
  254. package/dist/chunks/{settingsSync-CfYDkakY.js → settingsSync-DEPET5O1.js} +1 -1
  255. package/dist/chunks/{setup-BKUG46jQ.js → setup-BUBUidOg.js} +1 -1
  256. package/dist/chunks/setup-BZMVuIIx.js +2 -0
  257. package/dist/chunks/{setup-CmLngvpJ.js → setup-C6G0lasE.js} +1 -1
  258. package/dist/chunks/{shadowedRuleDetection-DesT0yKM.js → shadowedRuleDetection-CQayPrmM.js} +1 -1
  259. package/dist/chunks/{sideQuestion-BAq0YyKY.js → sideQuestion-B9EE1vTM.js} +1 -1
  260. package/dist/chunks/sink-BRrEbL6h.js +1 -0
  261. package/dist/chunks/{sink-B3uP8Cf8.js → sink-Cugto5We.js} +1 -1
  262. package/dist/chunks/{sinks-COcy5GnB.js → sinks-B9A94oIj.js} +2 -2
  263. package/dist/chunks/sinks-CKaSBvU8.js +1 -0
  264. package/dist/chunks/{skill-learning-DOIMPtWE.js → skill-learning-CroDcatu.js} +1 -1
  265. package/dist/chunks/skillChangeDetector-DnyEQqe6.js +1 -0
  266. package/dist/chunks/{skillGapStore-DpEoKhn-.js → skillGapStore-91Mb3xDY.js} +2 -2
  267. package/dist/chunks/{skillGapStore-CWuw1dYh.js → skillGapStore-LKwap3o4.js} +1 -1
  268. package/dist/chunks/{skillGenerator-9y3Q4YoO.js → skillGenerator-B9GM0LHk.js} +2 -2
  269. package/dist/chunks/skillLearning-D6latSKi.js +1 -0
  270. package/dist/chunks/{skillLearning-BhM09bQD.js → skillLearning-DbOOqb6b.js} +1 -1
  271. package/dist/chunks/{skillPanel-Dt24mZTZ.js → skillPanel-rIIYgnBE.js} +3 -3
  272. package/dist/chunks/{skillSearchPanel-gaXN64Fu.js → skillSearchPanel-xAL-6uJF.js} +4 -4
  273. package/dist/chunks/{skills-Dx3dMHYk.js → skills-Doe47wxK.js} +1 -1
  274. package/dist/chunks/{sprites-5OAB-Ui2.js → sprites-D11F3i1M.js} +1 -1
  275. package/dist/chunks/{stats-TUExo9iU.js → stats-WNUyieG-.js} +1 -1
  276. package/dist/chunks/{status-Dghaz1my.js → status-CjBS9SkF.js} +1 -1
  277. package/dist/chunks/{statusNoticeHelpers-DVZSSXeK.js → statusNoticeHelpers-cnI4TiGw.js} +1 -1
  278. package/dist/chunks/{tag-ZcVkzFjz.js → tag-Gfb8vTAR.js} +2 -2
  279. package/dist/chunks/{tasks-DbB33ekt.js → tasks-BwX1rzOD.js} +1 -1
  280. package/dist/chunks/{teamHelpers-BmN9nKz-.js → teamHelpers-DEgaCpta.js} +1 -1
  281. package/dist/chunks/teamHelpers-EJxTXoTV.js +1 -0
  282. package/dist/chunks/teammateModeSnapshot-BgUQ4Phz.js +1 -0
  283. package/dist/chunks/{teammateModeSnapshot-CPjJJDL1.js → teammateModeSnapshot-Dyukgtp9.js} +1 -1
  284. package/dist/chunks/teleport-B4p8XlAv.js +1 -0
  285. package/dist/chunks/{templateJobs-Db630FZD.js → templateJobs-DQXuFnkl.js} +1 -1
  286. package/dist/chunks/{terminalSetup-ygKHrVKR.js → terminalSetup-CTEIn08j.js} +1 -1
  287. package/dist/chunks/{terminalSetup-DJqWE8fc.js → terminalSetup-bSbq4LE7.js} +1 -1
  288. package/dist/chunks/{theme-MmfFhdTD.js → theme-DazaKPy8.js} +1 -1
  289. package/dist/chunks/thinkback-BOfZP_QG.js +1 -0
  290. package/dist/chunks/{thinkback-CrNirB0V.js → thinkback-CxWZV2Oz.js} +1 -1
  291. package/dist/chunks/{thinkback-play-CQ1s7oqg.js → thinkback-play-CHe1x2Hc.js} +1 -1
  292. package/dist/chunks/{toolEventObserver-BqMplcIk.js → toolEventObserver-D4h-QqVP.js} +1 -1
  293. package/dist/chunks/{toolEventObserver-DBq2XBYY.js → toolEventObserver-Dfvv2trb.js} +1 -1
  294. package/dist/chunks/toolPool-BHChMuLr.js +1 -0
  295. package/dist/chunks/toolPool-C5K43w4_.js +1 -0
  296. package/dist/chunks/{trustedDevice-DEuQUTbz.js → trustedDevice-CQ9PK-8m.js} +1 -1
  297. package/dist/chunks/{trustedDevice-C9Zevohz.js → trustedDevice-rdvUkS1W.js} +1 -1
  298. package/dist/chunks/{ultrareviewCommand-DrlfRrXq.js → ultrareviewCommand-Zf9hO4wr.js} +2 -2
  299. package/dist/chunks/{undercover-DKn95mh9.js → undercover-DLyKv5TE.js} +1 -1
  300. package/dist/chunks/undercover-DNS9V_JT.js +1 -0
  301. package/dist/chunks/{updateCCB-CJ7dCUan.js → updateCCB-7WQRz9lW.js} +4 -4
  302. package/dist/chunks/{upgrade-Degqbu8S.js → upgrade-ByIumMQe.js} +1 -1
  303. package/dist/chunks/upgrade-bK4x32Ma.js +1 -0
  304. package/dist/chunks/{upload-pTZQCPLt.js → upload-CvOMbA9_.js} +1 -1
  305. package/dist/chunks/{usage-D96a7Cke.js → usage-C_d-Z-eb.js} +1 -1
  306. package/dist/chunks/{usage-DVQMUMcC.js → usage-DE4PSQiF.js} +1 -1
  307. package/dist/chunks/useMainLoopModel-Os8Ao8-x.js +1 -0
  308. package/dist/chunks/{useManagePlugins-BfGzHMvO.js → useManagePlugins-BYBubfHU.js} +1 -1
  309. package/dist/chunks/{useMergedTools-TemEvCrX.js → useMergedTools-BJAn2i-F.js} +1 -1
  310. package/dist/chunks/{useSearchInput-B-V4kIa-.js → useSearchInput-CF77X2OV.js} +1 -1
  311. package/dist/chunks/useSettingsErrors-DD7fQ-fU.js +1 -0
  312. package/dist/chunks/{useVoice-BuwYDm2U.js → useVoice-DwzMN0fq.js} +1 -1
  313. package/dist/chunks/{util-CeIKZmj9.js → util-DD30Y4o8.js} +1 -1
  314. package/dist/chunks/utils-D44M8obg.js +1 -0
  315. package/dist/chunks/validatePlugin-DpHiJRsT.js +1 -0
  316. package/dist/chunks/{vim-DUZQCWUP.js → vim-zc9EiMil.js} +1 -1
  317. package/dist/chunks/{voice-BkRIHZiM.js → voice-BRhZt4jW.js} +2 -2
  318. package/dist/chunks/{voiceModeEnabled-CPQUE3PU.js → voiceModeEnabled-168-1Ocs.js} +1 -1
  319. package/dist/chunks/voiceModeEnabled-CTT25yFj.js +1 -0
  320. package/dist/chunks/{voiceStreamSTT-Dr_wH1Kh.js → voiceStreamSTT-B80UegKG.js} +1 -1
  321. package/dist/chunks/voiceStreamSTT-BpYhKo2H.js +1 -0
  322. package/dist/chunks/{workerRegistry-CT7_kjvY.js → workerRegistry-s8nnpmUO.js} +1 -1
  323. package/dist/chunks/worktree-CkB4jLXK.js +1 -0
  324. package/dist/chunks/{xml-DD_ldd3X.js → xml-DTMvLcPg.js} +1 -1
  325. package/dist/cli.js +1 -1
  326. package/package.json +1 -1
  327. package/dist/chunks/ApproveApiKey-SIUwkD8j.js +0 -1
  328. package/dist/chunks/BackgroundTasksDialog-DXJdube9.js +0 -2
  329. package/dist/chunks/BypassPermissionsModeDialog-BOSW4Zdy.js +0 -1
  330. package/dist/chunks/ClaudeMdExternalIncludesDialog-B8oAAHSI.js +0 -1
  331. package/dist/chunks/ConsoleOAuthFlow-DYhmGSkx.js +0 -1
  332. package/dist/chunks/DevChannelsDialog-DXRgY00D.js +0 -1
  333. package/dist/chunks/DiffDialog-PvNZfZby.js +0 -3
  334. package/dist/chunks/Doctor--B1HUENo.js +0 -1
  335. package/dist/chunks/Doctor-CE_jL9jC.js +0 -3
  336. package/dist/chunks/Feedback-B5rPGl_C.js +0 -2
  337. package/dist/chunks/Grove-C2YjB3zL.js +0 -1
  338. package/dist/chunks/MCPConnectionManager-CDsa79pu.js +0 -1
  339. package/dist/chunks/MessageSelector-CkeGQPNM.js +0 -3
  340. package/dist/chunks/Messages-PfbzLYOU.js +0 -11
  341. package/dist/chunks/PluginSettings-B2ASJ0Rx.js +0 -17
  342. package/dist/chunks/QueryEngine-Av0G5fze.js +0 -1
  343. package/dist/chunks/REPL-DCwqua0C.js +0 -1
  344. package/dist/chunks/REPL-Dh8vzGmF.js +0 -97
  345. package/dist/chunks/ResumeConversation-B3WuB8rs.js +0 -1
  346. package/dist/chunks/SearchExtraToolsTool-D70C-cmA.js +0 -1
  347. package/dist/chunks/SentryErrorBoundary-oJUBarGg.js +0 -1
  348. package/dist/chunks/Settings-CreAhCsb.js +0 -2
  349. package/dist/chunks/TeleportRepoMismatchDialog-DqWQX6j8.js +0 -1
  350. package/dist/chunks/TrustDialog-CIzAlGn9.js +0 -1
  351. package/dist/chunks/WindowsTerminalBackend-C5SeTXqC.js +0 -2
  352. package/dist/chunks/api-Dz_3z1kl.js +0 -1
  353. package/dist/chunks/assistant-zVegFdAO.js +0 -1
  354. package/dist/chunks/auth-D4isgfuK.js +0 -1
  355. package/dist/chunks/backgroundHousekeeping-CYnAG60-.js +0 -17
  356. package/dist/chunks/backgroundHousekeeping-DUmxC6h0.js +0 -1
  357. package/dist/chunks/bridgeConfig-CNbOKpAg.js +0 -1
  358. package/dist/chunks/bridgeEnabled-BUJTCUHY.js +0 -1
  359. package/dist/chunks/bridgeMain-BimZwc2P.js +0 -68
  360. package/dist/chunks/bridgeMain-DYL4fl6A.js +0 -1
  361. package/dist/chunks/caches-CTfNpKhW.js +0 -1
  362. package/dist/chunks/changeDetector-Y9KV5LgG.js +0 -1
  363. package/dist/chunks/channelNotification-CC7Xb06W.js +0 -1
  364. package/dist/chunks/clear-OUVFUt8Z.js +0 -1
  365. package/dist/chunks/client-B47ZvTMo.js +0 -1
  366. package/dist/chunks/commands-FJGWgQsa.js +0 -1
  367. package/dist/chunks/commitAttribution-DSv9FggK.js +0 -1
  368. package/dist/chunks/context-noninteractive-Bd2HO-vU.js +0 -1
  369. package/dist/chunks/conversation-BP0phkOY.js +0 -1
  370. package/dist/chunks/conversation-Ci8O_eZ-.js +0 -1
  371. package/dist/chunks/createSession-B9MhWusY.js +0 -1
  372. package/dist/chunks/cronJitterConfig-BzPaa52I.js +0 -6
  373. package/dist/chunks/crossProjectResume-tWsqBUHc.js +0 -40
  374. package/dist/chunks/datadog-DJowkWhh.js +0 -1
  375. package/dist/chunks/envLessBridgeConfig-CixkwbRF.js +0 -1
  376. package/dist/chunks/extra-usage-DGHEQOrY.js +0 -1
  377. package/dist/chunks/extractMemories-jvjCvtpC.js +0 -1
  378. package/dist/chunks/fast-Bbtx_Bs1.js +0 -1
  379. package/dist/chunks/gates-DSI3vpwO.js +0 -1
  380. package/dist/chunks/hooks-BLLL4iPv.js +0 -1
  381. package/dist/chunks/inboundAttachments-D-p91z3w.js +0 -1
  382. package/dist/chunks/initReplBridge-BiHXpDEY.js +0 -1
  383. package/dist/chunks/language-B_-BfBT4.js +0 -1
  384. package/dist/chunks/launchAutofixPr-D2qac07g.js +0 -2
  385. package/dist/chunks/loadAgentsDir-vB1QEZ7H.js +0 -1
  386. package/dist/chunks/localSearch-DtVqtfvk.js +0 -1
  387. package/dist/chunks/login-D-N78G6r.js +0 -1
  388. package/dist/chunks/logout-CFggVS-9.js +0 -1
  389. package/dist/chunks/mcp-CAYGNxCb.js +0 -1
  390. package/dist/chunks/mcp-COQap0SM.js +0 -6
  391. package/dist/chunks/mcp-DlM0OC6R.js +0 -2
  392. package/dist/chunks/model-DdbcxKub.js +0 -1
  393. package/dist/chunks/permissions-BLzPHh_3.js +0 -3
  394. package/dist/chunks/pluginStartupCheck-Cu2ezD51.js +0 -1
  395. package/dist/chunks/plugins-BgOP_8TX.js +0 -4
  396. package/dist/chunks/policyLimits-CKy_gTEt.js +0 -1
  397. package/dist/chunks/poorMode-DJvjO2nW.js +0 -1
  398. package/dist/chunks/processBashCommand-D5dC6Mya.js +0 -1
  399. package/dist/chunks/prompt-CQC-mh6u.js +0 -1
  400. package/dist/chunks/prompt-DawxLANl.js +0 -1
  401. package/dist/chunks/rcDebugLog-BbPkkigY.js +0 -11
  402. package/dist/chunks/sandbox-adapter-CxkhKgaa.js +0 -1
  403. package/dist/chunks/searchExtraTools-DQ6e601b.js +0 -1
  404. package/dist/chunks/sessionFileAccessHooks-7Svz-7S-.js +0 -1
  405. package/dist/chunks/sessionMemory-DIrR3zvb.js +0 -1
  406. package/dist/chunks/sessionMemory-_dmj8lcH.js +0 -1
  407. package/dist/chunks/sessionMemoryUtils-BdQtSkRx.js +0 -1
  408. package/dist/chunks/sessionObserver-_adufOGQ.js +0 -1
  409. package/dist/chunks/sessionStorage-W7okgAlQ.js +0 -1
  410. package/dist/chunks/setup-TqJ7-Nxh.js +0 -2
  411. package/dist/chunks/sink-CaWMZBw_.js +0 -1
  412. package/dist/chunks/sinks-oFfsKySL.js +0 -1
  413. package/dist/chunks/skillChangeDetector-CA_Tdx8N.js +0 -1
  414. package/dist/chunks/skillLearning-_o2D06yM.js +0 -1
  415. package/dist/chunks/teamHelpers-yeTNtZbb.js +0 -1
  416. package/dist/chunks/teammateModeSnapshot-CsNIJTKi.js +0 -1
  417. package/dist/chunks/teleport-JHgpwZIh.js +0 -1
  418. package/dist/chunks/thinkback-Quc7KPmi.js +0 -1
  419. package/dist/chunks/toolPool-BkCtTKXz.js +0 -1
  420. package/dist/chunks/toolPool-C7bOwJfR.js +0 -1
  421. package/dist/chunks/undercover-CBeHiWUd.js +0 -1
  422. package/dist/chunks/upgrade-ucJ-lnlY.js +0 -1
  423. package/dist/chunks/useMainLoopModel-B7ch2o9K.js +0 -1
  424. package/dist/chunks/useSettingsErrors-B2JGz1s8.js +0 -1
  425. package/dist/chunks/utils-CwhszpkT.js +0 -1
  426. package/dist/chunks/validatePlugin-BlVho93x.js +0 -1
  427. package/dist/chunks/voiceModeEnabled-DB8GCzAF.js +0 -1
  428. package/dist/chunks/voiceStreamSTT-DgoDscHn.js +0 -1
  429. package/dist/chunks/worktree-DU3xtwKW.js +0 -1
@@ -0,0 +1 @@
1
+ import{a as e,i as t,n}from"./voiceModeEnabled-168-1Ocs.js";n();export{t as isVoiceGrowthBookEnabled,e as isVoiceModeEnabled};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,r as n}from"./wrapper-D5qL1aQL.js";import{Jt as r,Pt as i,S as a,St as o,_ as s,cn as c,on as l,wt as u}from"./paths-Q2255dD7.js";import{E as d,T as f,d as p,s as m,w as h}from"./debug-UI3T040K.js";import{l as g,u as _}from"./oauth-CdZEzMww.js";import{o as v,s as y}from"./log-CzsijfHZ.js";import{c as b,g as x,h as S,l as C,u as w}from"./proxy-CfZp-wce.js";function T(){if(!c())return!1;let e=r();return e!==null&&e.accessToken!==null}async function E(e,t){await i();let a=r();if(!a?.accessToken)return p(`[voice_stream] No OAuth token available`),null;let c=process.env.VOICE_STREAM_BASE_URL||g().BASE_API_URL.replace(`https://`,`wss://`).replace(`http://`,`ws://`);process.env.VOICE_STREAM_BASE_URL&&p(`[voice_stream] Using VOICE_STREAM_BASE_URL override: ${process.env.VOICE_STREAM_BASE_URL}`);let l=new URLSearchParams({encoding:`linear16`,sample_rate:`16000`,channels:`1`,endpointing_ms:`300`,utterance_end_ms:`1000`,language:t?.language??`en`}),u=s(`tengu_cobalt_frost`,!1);if(u&&(l.set(`use_conversation_engine`,`true`),l.set(`stt_provider`,`deepgram-nova3`),p(`[voice_stream] Nova 3 gate enabled (tengu_cobalt_frost)`)),t?.keyterms?.length)for(let e of t.keyterms)l.append(`keyterms`,e);let m=`${c}${k}?${l.toString()}`;p(`[voice_stream] Connecting to ${m}`);let h={Authorization:`Bearer ${a.accessToken}`,"User-Agent":o(),"x-app":`cli`},_=S(),v=new n(m,typeof Bun<`u`?{headers:h,proxy:C(m),tls:_||void 0}:{headers:h,agent:b(m),..._}),x=null,w=!1,T=!1,E=!1,M=!1,N=null,P=null,F={send(e){if(v.readyState===n.OPEN){if(T){p(`[voice_stream] Dropping audio chunk after CloseStream: ${String(e.length)} bytes`);return}p(`[voice_stream] Sending audio chunk: ${String(e.length)} bytes`),v.send(Buffer.from(e))}},finalize(){return E||T?Promise.resolve(`ws_already_closed`):(E=!0,new Promise(t=>{let r=setTimeout(()=>N?.(`safety_timeout`),j.safety),i=setTimeout(()=>N?.(`no_data_timeout`),j.noData);if(P=()=>{clearTimeout(i),P=null},N=n=>{if(clearTimeout(r),clearTimeout(i),N=null,P=null,I){p(`[voice_stream] Promoting unreported interim before ${n} resolve`);let t=I;I=``,e.onTranscript(t,!0)}p(`[voice_stream] Finalize resolved via ${n}`),t(n)},v.readyState===n.CLOSED||v.readyState===n.CLOSING){N(`ws_already_closed`);return}setTimeout(()=>{T=!0,v.readyState===n.OPEN&&(p(`[voice_stream] Sending CloseStream (finalize)`),v.send(O))},0)}))},close(){T=!0,x&&(clearInterval(x),x=null),w=!1,v.readyState===n.OPEN&&v.close()},isConnected(){return w&&v.readyState===n.OPEN}};v.on(`open`,()=>{p(`[voice_stream] WebSocket connected`),w=!0,p(`[voice_stream] Sending initial KeepAlive`),v.send(D),x=setInterval(e=>{e.readyState===n.OPEN&&(p(`[voice_stream] Sending periodic KeepAlive`),e.send(D))},A,v),e.onReady(F)});let I=``;return v.on(`message`,t=>{let n=t.toString();p(`[voice_stream] Message received (${String(n.length)} chars): ${n.slice(0,200)}`);let r;try{r=f(n)}catch{return}switch(r.type){case`TranscriptText`:{let t=r.data;if(p(`[voice_stream] TranscriptText: "${t??``}"`),T&&P?.(),t){if(!u&&I){let n=I.trimStart(),r=t.trimStart();n&&r&&!r.startsWith(n)&&!n.startsWith(r)&&(p(`[voice_stream] Auto-finalizing previous segment (new segment detected): "${I}"`),e.onTranscript(I,!0))}I=t,e.onTranscript(t,!1)}break}case`TranscriptEndpoint`:{p(`[voice_stream] TranscriptEndpoint received, lastTranscriptText="${I}"`);let t=I;I=``,t&&e.onTranscript(t,!0),T&&N?.(`post_closestream_endpoint`);break}case`TranscriptError`:{let t=r.description??r.error_code??`unknown transcription error`;p(`[voice_stream] TranscriptError: ${t}`),E||e.onError(t);break}case`error`:{let t=r.message??d(r);p(`[voice_stream] Server error: ${t}`),E||e.onError(t);break}default:break}}),v.on(`close`,(t,n)=>{let r=n?.toString()??``;if(p(`[voice_stream] WebSocket closed: code=${String(t)} reason="${r}"`),w=!1,x&&(clearInterval(x),x=null),I){p(`[voice_stream] Promoting unreported interim transcript to final on close`);let t=I;I=``,e.onTranscript(t,!0)}N?.(`ws_close`),!E&&!M&&t!==1e3&&t!==1005&&e.onError(`Connection closed: code ${String(t)}${r?` — ${r}`:``}`),e.onClose()}),v.on(`unexpected-response`,(t,n)=>{let r=n.statusCode??0;if(r===101){p(`[voice_stream] unexpected-response fired with 101; ignoring`);return}p(`[voice_stream] Upgrade rejected: status=${String(r)} cf-mitigated=${String(n.headers[`cf-mitigated`])} cf-ray=${String(n.headers[`cf-ray`])}`),M=!0,n.resume(),t.destroy(),!E&&e.onError(`WebSocket upgrade rejected with HTTP ${String(r)}`,{fatal:r>=400&&r<500})}),v.on(`error`,t=>{y(t),p(`[voice_stream] WebSocket error: ${t.message}`),E||e.onError(`Voice stream connection error: ${t.message}`)}),F}var D,O,k,A,j,M=e((()=>{t(),_(),l(),m(),u(),v(),x(),w(),h(),a(),D=`{"type":"KeepAlive"}`,O=`{"type":"CloseStream"}`,k=`/api/ws/speech_to_text/voice_stream`,A=8e3,j={safety:5e3,noData:1500}}));export{T as i,E as n,M as r,j as t};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,r as n}from"./wrapper-D5qL1aQL.js";import{Jt as r,Pt as i,S as a,St as o,_ as s,cn as c,on as l,wt as u}from"./paths-1ngPRtu3.js";import{E as d,T as f,d as p,s as m,w as h}from"./debug-UI3T040K.js";import{l as g,u as _}from"./oauth-CdZEzMww.js";import{o as v,s as y}from"./log-CzsijfHZ.js";import{c as b,g as x,h as S,l as C,u as w}from"./proxy-CfZp-wce.js";function T(){if(!c())return!1;let e=r();return e!==null&&e.accessToken!==null}async function E(e,t){await i();let a=r();if(!a?.accessToken)return p(`[voice_stream] No OAuth token available`),null;let c=process.env.VOICE_STREAM_BASE_URL||g().BASE_API_URL.replace(`https://`,`wss://`).replace(`http://`,`ws://`);process.env.VOICE_STREAM_BASE_URL&&p(`[voice_stream] Using VOICE_STREAM_BASE_URL override: ${process.env.VOICE_STREAM_BASE_URL}`);let l=new URLSearchParams({encoding:`linear16`,sample_rate:`16000`,channels:`1`,endpointing_ms:`300`,utterance_end_ms:`1000`,language:t?.language??`en`}),u=s(`tengu_cobalt_frost`,!1);if(u&&(l.set(`use_conversation_engine`,`true`),l.set(`stt_provider`,`deepgram-nova3`),p(`[voice_stream] Nova 3 gate enabled (tengu_cobalt_frost)`)),t?.keyterms?.length)for(let e of t.keyterms)l.append(`keyterms`,e);let m=`${c}${k}?${l.toString()}`;p(`[voice_stream] Connecting to ${m}`);let h={Authorization:`Bearer ${a.accessToken}`,"User-Agent":o(),"x-app":`cli`},_=S(),v=new n(m,typeof Bun<`u`?{headers:h,proxy:C(m),tls:_||void 0}:{headers:h,agent:b(m),..._}),x=null,w=!1,T=!1,E=!1,M=!1,N=null,P=null,F={send(e){if(v.readyState===n.OPEN){if(T){p(`[voice_stream] Dropping audio chunk after CloseStream: ${String(e.length)} bytes`);return}p(`[voice_stream] Sending audio chunk: ${String(e.length)} bytes`),v.send(Buffer.from(e))}},finalize(){return E||T?Promise.resolve(`ws_already_closed`):(E=!0,new Promise(t=>{let r=setTimeout(()=>N?.(`safety_timeout`),j.safety),i=setTimeout(()=>N?.(`no_data_timeout`),j.noData);if(P=()=>{clearTimeout(i),P=null},N=n=>{if(clearTimeout(r),clearTimeout(i),N=null,P=null,I){p(`[voice_stream] Promoting unreported interim before ${n} resolve`);let t=I;I=``,e.onTranscript(t,!0)}p(`[voice_stream] Finalize resolved via ${n}`),t(n)},v.readyState===n.CLOSED||v.readyState===n.CLOSING){N(`ws_already_closed`);return}setTimeout(()=>{T=!0,v.readyState===n.OPEN&&(p(`[voice_stream] Sending CloseStream (finalize)`),v.send(O))},0)}))},close(){T=!0,x&&(clearInterval(x),x=null),w=!1,v.readyState===n.OPEN&&v.close()},isConnected(){return w&&v.readyState===n.OPEN}};v.on(`open`,()=>{p(`[voice_stream] WebSocket connected`),w=!0,p(`[voice_stream] Sending initial KeepAlive`),v.send(D),x=setInterval(e=>{e.readyState===n.OPEN&&(p(`[voice_stream] Sending periodic KeepAlive`),e.send(D))},A,v),e.onReady(F)});let I=``;return v.on(`message`,t=>{let n=t.toString();p(`[voice_stream] Message received (${String(n.length)} chars): ${n.slice(0,200)}`);let r;try{r=f(n)}catch{return}switch(r.type){case`TranscriptText`:{let t=r.data;if(p(`[voice_stream] TranscriptText: "${t??``}"`),T&&P?.(),t){if(!u&&I){let n=I.trimStart(),r=t.trimStart();n&&r&&!r.startsWith(n)&&!n.startsWith(r)&&(p(`[voice_stream] Auto-finalizing previous segment (new segment detected): "${I}"`),e.onTranscript(I,!0))}I=t,e.onTranscript(t,!1)}break}case`TranscriptEndpoint`:{p(`[voice_stream] TranscriptEndpoint received, lastTranscriptText="${I}"`);let t=I;I=``,t&&e.onTranscript(t,!0),T&&N?.(`post_closestream_endpoint`);break}case`TranscriptError`:{let t=r.description??r.error_code??`unknown transcription error`;p(`[voice_stream] TranscriptError: ${t}`),E||e.onError(t);break}case`error`:{let t=r.message??d(r);p(`[voice_stream] Server error: ${t}`),E||e.onError(t);break}default:break}}),v.on(`close`,(t,n)=>{let r=n?.toString()??``;if(p(`[voice_stream] WebSocket closed: code=${String(t)} reason="${r}"`),w=!1,x&&(clearInterval(x),x=null),I){p(`[voice_stream] Promoting unreported interim transcript to final on close`);let t=I;I=``,e.onTranscript(t,!0)}N?.(`ws_close`),!E&&!M&&t!==1e3&&t!==1005&&e.onError(`Connection closed: code ${String(t)}${r?` — ${r}`:``}`),e.onClose()}),v.on(`unexpected-response`,(t,n)=>{let r=n.statusCode??0;if(r===101){p(`[voice_stream] unexpected-response fired with 101; ignoring`);return}p(`[voice_stream] Upgrade rejected: status=${String(r)} cf-mitigated=${String(n.headers[`cf-mitigated`])} cf-ray=${String(n.headers[`cf-ray`])}`),M=!0,n.resume(),t.destroy(),!E&&e.onError(`WebSocket upgrade rejected with HTTP ${String(r)}`,{fatal:r>=400&&r<500})}),v.on(`error`,t=>{y(t),p(`[voice_stream] WebSocket error: ${t.message}`),E||e.onError(`Voice stream connection error: ${t.message}`)}),F}var D,O,k,A,j,M=e((()=>{t(),_(),l(),m(),u(),v(),x(),w(),h(),a(),D=`{"type":"KeepAlive"}`,O=`{"type":"CloseStream"}`,k=`/api/ws/speech_to_text/voice_stream`,A=8e3,j={safety:5e3,noData:1500}}));export{T as i,E as n,M as r,j as t};
@@ -0,0 +1 @@
1
+ import{i as e,r as t}from"./voiceStreamSTT-B80UegKG.js";t();export{e as isVoiceStreamAvailable};
@@ -1 +1 @@
1
- import{Jt as e,on as t}from"./paths-Q2255dD7.js";import{L as n,V as r}from"./debug-UI3T040K.js";import{o as i,t as a}from"./bridgeMain-BimZwc2P.js";import{resolve as o}from"path";t(),r();var s=78,c=1;async function l(e){if(!e){console.error(`Error: --daemon-worker requires a worker kind`),process.exitCode=s;return}switch(e){case`remoteControl`:await u();break;default:console.error(`Error: unknown daemon worker kind '${e}'`),process.exitCode=s}}async function u(){let t=process.env.DAEMON_WORKER_DIR||o(`.`),r=process.env.DAEMON_WORKER_NAME||void 0,l=process.env.DAEMON_WORKER_SPAWN_MODE||`same-dir`,u=parseInt(process.env.DAEMON_WORKER_CAPACITY||`4`,10),d=process.env.DAEMON_WORKER_PERMISSION||void 0,f=process.env.DAEMON_WORKER_SANDBOX===`1`,p=process.env.DAEMON_WORKER_TIMEOUT_MS?parseInt(process.env.DAEMON_WORKER_TIMEOUT_MS,10):void 0,m=process.env.DAEMON_WORKER_CREATE_SESSION!==`0`,h=new AbortController,g=()=>h.abort();process.on(`SIGTERM`,g),process.on(`SIGINT`,g);let _={dir:t,name:r,spawnMode:l,capacity:u,permissionMode:d,sandbox:f,sessionTimeoutMs:p,createSessionOnStart:m,getAccessToken:()=>e()?.accessToken,onAuth401:async t=>!!e()?.accessToken,log:e=>{console.log(`[remoteControl] ${e}`)}};try{await i(_,h.signal)}catch(e){e instanceof a?(console.error(`[remoteControl] permanent error: ${e.message}`),process.exitCode=s):(console.error(`[remoteControl] transient error: ${n(e)}`),process.exitCode=c)}finally{process.off(`SIGTERM`,g),process.off(`SIGINT`,g)}}export{l as runDaemonWorker};
1
+ import{Jt as e,on as t}from"./paths-1ngPRtu3.js";import{L as n,V as r}from"./debug-UI3T040K.js";import{o as i,t as a}from"./bridgeMain-B7FZpvo0.js";import{resolve as o}from"path";t(),r();var s=78,c=1;async function l(e){if(!e){console.error(`Error: --daemon-worker requires a worker kind`),process.exitCode=s;return}switch(e){case`remoteControl`:await u();break;default:console.error(`Error: unknown daemon worker kind '${e}'`),process.exitCode=s}}async function u(){let t=process.env.DAEMON_WORKER_DIR||o(`.`),r=process.env.DAEMON_WORKER_NAME||void 0,l=process.env.DAEMON_WORKER_SPAWN_MODE||`same-dir`,u=parseInt(process.env.DAEMON_WORKER_CAPACITY||`4`,10),d=process.env.DAEMON_WORKER_PERMISSION||void 0,f=process.env.DAEMON_WORKER_SANDBOX===`1`,p=process.env.DAEMON_WORKER_TIMEOUT_MS?parseInt(process.env.DAEMON_WORKER_TIMEOUT_MS,10):void 0,m=process.env.DAEMON_WORKER_CREATE_SESSION!==`0`,h=new AbortController,g=()=>h.abort();process.on(`SIGTERM`,g),process.on(`SIGINT`,g);let _={dir:t,name:r,spawnMode:l,capacity:u,permissionMode:d,sandbox:f,sessionTimeoutMs:p,createSessionOnStart:m,getAccessToken:()=>e()?.accessToken,onAuth401:async t=>!!e()?.accessToken,log:e=>{console.log(`[remoteControl] ${e}`)}};try{await i(_,h.signal)}catch(e){e instanceof a?(console.error(`[remoteControl] permanent error: ${e.message}`),process.exitCode=s):(console.error(`[remoteControl] transient error: ${n(e)}`),process.exitCode=c)}finally{process.off(`SIGTERM`,g),process.off(`SIGINT`,g)}}export{l as runDaemonWorker};
@@ -0,0 +1 @@
1
+ import{wt as e,yt as t}from"./loadAgentsDir-D7kapZB5.js";e();export{t as execIntoTmuxWorktree};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{ds as t,no as n,oo as r,xs as i}from"./paths-Q2255dD7.js";function a(e){d.set(e.name,e)}function o(e){return e.endsWith(`@${f}`)}function s(e){return d.get(e)}function c(){let e=n(),t=[],r=[];for(let[n,i]of d){if(i.isAvailable&&!i.isAvailable())continue;let a=`${n}@${f}`,o=e?.enabledPlugins?.[a],s=o===void 0?i.defaultEnabled??!0:o===!0,c={name:n,manifest:{name:n,description:i.description,version:i.version},path:f,source:a,repository:a,enabled:s,isBuiltin:!0,hooksConfig:i.hooks,mcpServers:i.mcpServers};s?t.push(c):r.push(c)}return{enabled:t,disabled:r}}function l(){let{enabled:e}=c(),t=[];for(let n of e){let e=d.get(n.name);if(e?.skills)for(let n of e.skills)t.push(u(n))}return t}function u(e){return{type:`prompt`,name:e.name,description:e.description,hasUserSpecifiedDescription:!0,allowedTools:e.allowedTools??[],argumentHint:e.argumentHint,whenToUse:e.whenToUse,model:e.model,disableModelInvocation:e.disableModelInvocation??!1,userInvocable:e.userInvocable??!0,contentLength:0,source:`bundled`,loadedFrom:`bundled`,hooks:e.hooks,context:e.context,agent:e.agent,isEnabled:e.isEnabled??(()=>!0),isHidden:!(e.userInvocable??!0),progressMessage:`running`,getPromptForCommand:e.getPromptForCommand}}var d,f,p=e((()=>{r(),d=new Map,f=`builtin`}));function m(e){if(e.includes(`@`)){let t=e.split(`@`);return{name:t[0]||``,marketplace:t[1]}}return{name:e}}function h(e){return e!==void 0&&t.has(e.toLowerCase())}function g(e){if(e===`managed`)throw Error(`Cannot install plugins to managed scope`);return y[e]}function _(e){return v[e]}var v,y,b=e((()=>{i(),v={policySettings:`managed`,userSettings:`user`,projectSettings:`project`,localSettings:`local`,flagSettings:`flag`},y={user:`userSettings`,project:`projectSettings`,local:`localSettings`}}));function x(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function S(e){return x(e).replace(/"/g,`&quot;`).replace(/'/g,`&apos;`)}var C=e((()=>{}));export{h as a,_ as c,l as d,c as f,a as h,b as i,f as l,o as m,S as n,m as o,p,C as r,g as s,x as t,s as u};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{ds as t,no as n,oo as r,xs as i}from"./paths-1ngPRtu3.js";function a(e){d.set(e.name,e)}function o(e){return e.endsWith(`@${f}`)}function s(e){return d.get(e)}function c(){let e=n(),t=[],r=[];for(let[n,i]of d){if(i.isAvailable&&!i.isAvailable())continue;let a=`${n}@${f}`,o=e?.enabledPlugins?.[a],s=o===void 0?i.defaultEnabled??!0:o===!0,c={name:n,manifest:{name:n,description:i.description,version:i.version},path:f,source:a,repository:a,enabled:s,isBuiltin:!0,hooksConfig:i.hooks,mcpServers:i.mcpServers};s?t.push(c):r.push(c)}return{enabled:t,disabled:r}}function l(){let{enabled:e}=c(),t=[];for(let n of e){let e=d.get(n.name);if(e?.skills)for(let n of e.skills)t.push(u(n))}return t}function u(e){return{type:`prompt`,name:e.name,description:e.description,hasUserSpecifiedDescription:!0,allowedTools:e.allowedTools??[],argumentHint:e.argumentHint,whenToUse:e.whenToUse,model:e.model,disableModelInvocation:e.disableModelInvocation??!1,userInvocable:e.userInvocable??!0,contentLength:0,source:`bundled`,loadedFrom:`bundled`,hooks:e.hooks,context:e.context,agent:e.agent,isEnabled:e.isEnabled??(()=>!0),isHidden:!(e.userInvocable??!0),progressMessage:`running`,getPromptForCommand:e.getPromptForCommand}}var d,f,p=e((()=>{r(),d=new Map,f=`builtin`}));function m(e){if(e.includes(`@`)){let t=e.split(`@`);return{name:t[0]||``,marketplace:t[1]}}return{name:e}}function h(e){return e!==void 0&&t.has(e.toLowerCase())}function g(e){if(e===`managed`)throw Error(`Cannot install plugins to managed scope`);return y[e]}function _(e){return v[e]}var v,y,b=e((()=>{i(),v={policySettings:`managed`,userSettings:`user`,projectSettings:`project`,localSettings:`local`,flagSettings:`flag`},y={user:`userSettings`,project:`projectSettings`,local:`localSettings`}}));function x(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function S(e){return x(e).replace(/"/g,`&quot;`).replace(/'/g,`&apos;`)}var C=e((()=>{}));export{h as a,_ as c,l as d,c as f,a as h,b as i,f as l,o as m,S as n,m as o,p,C as r,g as s,x as t,s as u};
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- import{s as e,u as t}from"./chunks/envUtils-BWeoiL4Y.js";var n=globalThis.performance,r=new Map,i=new Map;function a(){return n.now()}function o(e){return r.set(e,a()),{name:e,entryType:`mark`,startTime:r.get(e),duration:0}}function s(e,t,n){let o,s;if(typeof t==`string`){let e=r.get(t),i=n?r.get(n):a();o=e??a(),s=(i??a())-o}else t&&typeof t==`object`?(o=t.start??0,s=(t.end??a())-o):(o=0,s=a());i.set(e,{name:e,startTime:o,duration:s})}function c(e){return e===`mark`?[...r.entries()].map(([e,t])=>({name:e,entryType:`mark`,startTime:t,duration:0})):e===`measure`?[...i.values()].map(e=>({name:e.name,entryType:`measure`,startTime:e.startTime,duration:e.duration})):[]}function l(e,t){return c(t??`mark`).concat(t===void 0?c(`measure`):[]).filter(t=>t.name===e)}function u(e){e===void 0?r.clear():r.delete(e)}function d(e){e===void 0?i.clear():i.delete(e)}var f={now:a,mark:o,measure:s,getEntriesByType:c,getEntriesByName:l,clearMarks:u,clearMeasures:d,clearResourceTimings:(()=>{}),setResourceTimingBufferSize:(()=>{}),get timeOrigin(){return n.timeOrigin},get onresourcetimingbufferfull(){return n.onresourcetimingbufferfull},set onresourcetimingbufferfull(e){},toJSON(){return n.toJSON()}};function p(){globalThis.__performanceShimInstalled||(globalThis.__performanceShimInstalled=!0,globalThis.performance=f)}if(p(),e(),globalThis.MACRO===void 0&&(globalThis.MACRO={VERSION:process.env.CLAUDE_CODE_VERSION||`2.1.888`,BUILD_TIME:new Date().toISOString(),FEEDBACK_CHANNEL:``,ISSUES_EXPLAINER:``,NATIVE_PACKAGE_URL:``,PACKAGE_URL:``,VERSION_CHANGELOG:``}),t(process.env.CLAUDE_CODE_FORCE_INTERACTIVE)){for(let e of[process.stdin,process.stdout,process.stderr])if(!e.isTTY)try{Object.defineProperty(e,`isTTY`,{value:!0,configurable:!0})}catch{}}if(process.env.COREPACK_ENABLE_AUTO_PIN=`0`,process.env.CLAUDE_CODE_REMOTE===`true`){let e=process.env.NODE_OPTIONS||``;process.env.NODE_OPTIONS=e?`${e} --max-old-space-size=8192`:`--max-old-space-size=8192`}async function m(){let e=process.argv.slice(2);if(e.length===1&&(e[0]===`--version`||e[0]===`-v`||e[0]===`-V`)){console.log(`2.6.0 (Claude Code)`);return}let{profileCheckpoint:t}=await import(`./chunks/startupProfiler-SOE--nM9.js`);if(t(`cli_entry`),process.argv[2]===`--claude-in-chrome-mcp`){t(`cli_claude_in_chrome_mcp_path`);let{runClaudeInChromeMcpServer:e}=await import(`./chunks/mcpServer-DXvS3v4x.js`);await e();return}else if(process.argv[2]===`--chrome-native-host`){t(`cli_chrome_native_host_path`);let{runChromeNativeHost:e}=await import(`./chunks/chromeNativeHost-4U39yLtd.js`);await e();return}else if(process.argv[2]===`--computer-use-mcp`){t(`cli_computer_use_mcp_path`);let{runComputerUseMcpServer:e}=await import(`./chunks/mcpServer-1SnOWb8_.js`);await e();return}if(process.argv[2]===`--acp`){t(`cli_acp_path`);let{runAcpAgent:e}=await import(`./chunks/entry-CUu6-QhT.js`);await e();return}if(e[0]===`weixin`){t(`cli_weixin_path`);let{handleWeixinCli:n}=await import(`./chunks/src-BIPP3_mo.js`),{enableConfigs:r}=await import(`./chunks/config-BdCuh6eA.js`),{initializeAnalyticsSink:i}=await import(`./chunks/sink-CaWMZBw_.js`),{shutdownDatadog:a}=await import(`./chunks/datadog-DJowkWhh.js`),{shutdown1PEventLogging:o}=await import(`./chunks/firstPartyEventLogger-KIwaBY-E.js`),{logForDebugging:s}=await import(`./chunks/debug-DM5ezCBS.js`),{ChannelPermissionRequestNotificationSchema:c}=await import(`./chunks/channelNotification-CC7Xb06W.js`);await n(e.slice(1),{enableConfigs:r,initializeAnalyticsSink:i,shutdownDatadog:a,shutdown1PEventLogging:o,logForDebugging:s,registerPermissionHandler(e,t){e.setNotificationHandler(c(),async e=>t(e.params))}},`2.6.0`);return}if(e[0]===`--daemon-worker`||e[0]?.startsWith(`--daemon-worker=`)){let t=e[0]===`--daemon-worker`?e[1]:e[0].split(`=`)[1],{runDaemonWorker:n}=await import(`./chunks/workerRegistry-CT7_kjvY.js`);await n(t);return}if(e[0]===`remote-control`||e[0]===`rc`||e[0]===`remote`||e[0]===`sync`||e[0]===`bridge`){t(`cli_bridge_path`);let{enableConfigs:n}=await import(`./chunks/config-BdCuh6eA.js`);n();let{getBridgeDisabledReason:r,checkBridgeMinVersion:i}=await import(`./chunks/bridgeEnabled-BUJTCUHY.js`),{BRIDGE_LOGIN_ERROR:a}=await import(`./chunks/types-CQ1wrnQ0.js`),{bridgeMain:o}=await import(`./chunks/bridgeMain-DYL4fl6A.js`),{exitWithError:s}=await import(`./chunks/process-CWupreF6.js`),{getClaudeAIOAuthTokens:c}=await import(`./chunks/auth-CqURlg4d.js`),{getBridgeAccessToken:l}=await import(`./chunks/bridgeConfig-CNbOKpAg.js`);!c()?.accessToken&&!l()&&s(a);let u=await r();u&&s(`Error: ${u}`);let d=i();d&&s(d);let{waitForPolicyLimitsToLoad:f,isPolicyAllowed:p}=await import(`./chunks/policyLimits-CKy_gTEt.js`);await f(),p(`allow_remote_control`)||s(`Error: Remote Control is disabled by your organization's policy.`),await o(e.slice(1));return}if(e[0]===`daemon`){t(`cli_daemon_path`);let{enableConfigs:n}=await import(`./chunks/config-BdCuh6eA.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-C9CigqoF.js`);r();let{initSinks:i}=await import(`./chunks/sinks-oFfsKySL.js`);i();let{daemonMain:a}=await import(`./chunks/main-C6be1KFk.js`);await a(e.slice(1));return}if(e[0]===`autonomy`){t(`cli_autonomy_path`);let{getAutonomyCommandText:n}=await import(`./chunks/autonomy-BZzW8QJZ.js`),r=await n(e.slice(1).join(` `));await new Promise((e,t)=>{process.stdout.write(`${r}\n`,n=>{if(n){t(n);return}e()})}),process.exit(0)}if(e.includes(`--bg`)||e.includes(`--background`)){t(`cli_daemon_path`);let{enableConfigs:n}=await import(`./chunks/config-BdCuh6eA.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-C9CigqoF.js`);r(),await(await import(`./chunks/bg-Dbh5z3Y8.js`)).handleBgStart(e.filter(e=>e!==`--bg`&&e!==`--background`));return}if(e[0]===`ps`||e[0]===`logs`||e[0]===`attach`||e[0]===`kill`){let n=e[0]===`ps`?`status`:e[0];console.error(`[deprecated] Use: claude daemon ${n}${e[1]?` `+e[1]:``}`),t(`cli_daemon_path`);let{enableConfigs:r}=await import(`./chunks/config-BdCuh6eA.js`);r();let{setShellIfWindows:i}=await import(`./chunks/windowsPaths-C9CigqoF.js`);i();let{initSinks:a}=await import(`./chunks/sinks-oFfsKySL.js`);a();let{daemonMain:o}=await import(`./chunks/main-C6be1KFk.js`);await o([e[0]===`ps`?`status`:e[0],...e.slice(1)]);return}if(e[0]===`job`){t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-Db630FZD.js`);await n(e.slice(1)),process.exit(0)}if(e[0]===`new`||e[0]===`list`||e[0]===`reply`){console.error(`[deprecated] Use: claude job ${e[0]} ${e.slice(1).join(` `)}`.trim()),t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-Db630FZD.js`);await n(e),process.exit(0)}if((e.includes(`--tmux`)||e.includes(`--tmux=classic`))&&(e.includes(`-w`)||e.includes(`--worktree`)||e.some(e=>e.startsWith(`--worktree=`)))){t(`cli_tmux_worktree_fast_path`);let{enableConfigs:n}=await import(`./chunks/config-BdCuh6eA.js`);n();let{isWorktreeModeEnabled:r}=await import(`./chunks/worktreeModeEnabled-THQb19xR.js`);if(r()){let{execIntoTmuxWorktree:t}=await import(`./chunks/worktree-DU3xtwKW.js`),n=await t(e);if(n.handled)return;if(n.error){let{exitWithError:e}=await import(`./chunks/process-CWupreF6.js`);e(n.error)}}}e.length===1&&(e[0]===`--update`||e[0]===`--upgrade`)&&(process.argv=[process.argv[0],process.argv[1],`update`]),e.includes(`--bare`)&&(process.env.CLAUDE_CODE_SIMPLE=`1`);let{startCapturingEarlyInput:n}=await import(`./chunks/earlyInput-JGJo1zcC.js`);n(),t(`cli_before_main_import`);let{main:r}=await import(`./chunks/main-DhMlhVj3.js`);t(`cli_after_main_import`),await r(),t(`cli_after_main_complete`)}await m();export{};
2
+ import{s as e,u as t}from"./chunks/envUtils-BWeoiL4Y.js";var n=globalThis.performance,r=new Map,i=new Map;function a(){return n.now()}function o(e){return r.set(e,a()),{name:e,entryType:`mark`,startTime:r.get(e),duration:0}}function s(e,t,n){let o,s;if(typeof t==`string`){let e=r.get(t),i=n?r.get(n):a();o=e??a(),s=(i??a())-o}else t&&typeof t==`object`?(o=t.start??0,s=(t.end??a())-o):(o=0,s=a());i.set(e,{name:e,startTime:o,duration:s})}function c(e){return e===`mark`?[...r.entries()].map(([e,t])=>({name:e,entryType:`mark`,startTime:t,duration:0})):e===`measure`?[...i.values()].map(e=>({name:e.name,entryType:`measure`,startTime:e.startTime,duration:e.duration})):[]}function l(e,t){return c(t??`mark`).concat(t===void 0?c(`measure`):[]).filter(t=>t.name===e)}function u(e){e===void 0?r.clear():r.delete(e)}function d(e){e===void 0?i.clear():i.delete(e)}var f={now:a,mark:o,measure:s,getEntriesByType:c,getEntriesByName:l,clearMarks:u,clearMeasures:d,clearResourceTimings:(()=>{}),setResourceTimingBufferSize:(()=>{}),get timeOrigin(){return n.timeOrigin},get onresourcetimingbufferfull(){return n.onresourcetimingbufferfull},set onresourcetimingbufferfull(e){},toJSON(){return n.toJSON()}};function p(){globalThis.__performanceShimInstalled||(globalThis.__performanceShimInstalled=!0,globalThis.performance=f)}if(p(),e(),globalThis.MACRO===void 0&&(globalThis.MACRO={VERSION:process.env.CLAUDE_CODE_VERSION||`2.1.888`,BUILD_TIME:new Date().toISOString(),FEEDBACK_CHANNEL:``,ISSUES_EXPLAINER:``,NATIVE_PACKAGE_URL:``,PACKAGE_URL:``,VERSION_CHANGELOG:``}),t(process.env.CLAUDE_CODE_FORCE_INTERACTIVE)){for(let e of[process.stdin,process.stdout,process.stderr])if(!e.isTTY)try{Object.defineProperty(e,`isTTY`,{value:!0,configurable:!0})}catch{}}if(process.env.COREPACK_ENABLE_AUTO_PIN=`0`,process.env.CLAUDE_CODE_REMOTE===`true`){let e=process.env.NODE_OPTIONS||``;process.env.NODE_OPTIONS=e?`${e} --max-old-space-size=8192`:`--max-old-space-size=8192`}async function m(){let e=process.argv.slice(2);if(e.length===1&&(e[0]===`--version`||e[0]===`-v`||e[0]===`-V`)){console.log(`2.6.6 (Claude Code)`);return}let{profileCheckpoint:t}=await import(`./chunks/startupProfiler-SOE--nM9.js`);if(t(`cli_entry`),process.argv[2]===`--claude-in-chrome-mcp`){t(`cli_claude_in_chrome_mcp_path`);let{runClaudeInChromeMcpServer:e}=await import(`./chunks/mcpServer-Dqm2PQQx.js`);await e();return}else if(process.argv[2]===`--chrome-native-host`){t(`cli_chrome_native_host_path`);let{runChromeNativeHost:e}=await import(`./chunks/chromeNativeHost-4U39yLtd.js`);await e();return}else if(process.argv[2]===`--computer-use-mcp`){t(`cli_computer_use_mcp_path`);let{runComputerUseMcpServer:e}=await import(`./chunks/mcpServer-BueM5fWI.js`);await e();return}if(process.argv[2]===`--acp`){t(`cli_acp_path`);let{runAcpAgent:e}=await import(`./chunks/entry-CdfuWjKu.js`);await e();return}if(e[0]===`weixin`){t(`cli_weixin_path`);let{handleWeixinCli:n}=await import(`./chunks/src-BIPP3_mo.js`),{enableConfigs:r}=await import(`./chunks/config-DwiVCSrY.js`),{initializeAnalyticsSink:i}=await import(`./chunks/sink-BRrEbL6h.js`),{shutdownDatadog:a}=await import(`./chunks/datadog-Uj6FjEuU.js`),{shutdown1PEventLogging:o}=await import(`./chunks/firstPartyEventLogger-BCzGkdpd.js`),{logForDebugging:s}=await import(`./chunks/debug-DM5ezCBS.js`),{ChannelPermissionRequestNotificationSchema:c}=await import(`./chunks/channelNotification-DzTzUrCe.js`);await n(e.slice(1),{enableConfigs:r,initializeAnalyticsSink:i,shutdownDatadog:a,shutdown1PEventLogging:o,logForDebugging:s,registerPermissionHandler(e,t){e.setNotificationHandler(c(),async e=>t(e.params))}},`2.6.6`);return}if(e[0]===`--daemon-worker`||e[0]?.startsWith(`--daemon-worker=`)){let t=e[0]===`--daemon-worker`?e[1]:e[0].split(`=`)[1],{runDaemonWorker:n}=await import(`./chunks/workerRegistry-s8nnpmUO.js`);await n(t);return}if(e[0]===`remote-control`||e[0]===`rc`||e[0]===`remote`||e[0]===`sync`||e[0]===`bridge`){t(`cli_bridge_path`);let{enableConfigs:n}=await import(`./chunks/config-DwiVCSrY.js`);n();let{getBridgeDisabledReason:r,checkBridgeMinVersion:i}=await import(`./chunks/bridgeEnabled-Z2S8lk0l.js`),{BRIDGE_LOGIN_ERROR:a}=await import(`./chunks/types-CQ1wrnQ0.js`),{bridgeMain:o}=await import(`./chunks/bridgeMain-C5UxF8ST.js`),{exitWithError:s}=await import(`./chunks/process-CWupreF6.js`),{getClaudeAIOAuthTokens:c}=await import(`./chunks/auth-D7PZvVPf.js`),{getBridgeAccessToken:l}=await import(`./chunks/bridgeConfig-7c07tJm9.js`);!c()?.accessToken&&!l()&&s(a);let u=await r();u&&s(`Error: ${u}`);let d=i();d&&s(d);let{waitForPolicyLimitsToLoad:f,isPolicyAllowed:p}=await import(`./chunks/policyLimits-Cmmzuv-E.js`);await f(),p(`allow_remote_control`)||s(`Error: Remote Control is disabled by your organization's policy.`),await o(e.slice(1));return}if(e[0]===`daemon`){t(`cli_daemon_path`);let{enableConfigs:n}=await import(`./chunks/config-DwiVCSrY.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-C9CigqoF.js`);r();let{initSinks:i}=await import(`./chunks/sinks-CKaSBvU8.js`);i();let{daemonMain:a}=await import(`./chunks/main-C6be1KFk.js`);await a(e.slice(1));return}if(e[0]===`autonomy`){t(`cli_autonomy_path`);let{getAutonomyCommandText:n}=await import(`./chunks/autonomy-dQVtSiCJ.js`),r=await n(e.slice(1).join(` `));await new Promise((e,t)=>{process.stdout.write(`${r}\n`,n=>{if(n){t(n);return}e()})}),process.exit(0)}if(e.includes(`--bg`)||e.includes(`--background`)){t(`cli_daemon_path`);let{enableConfigs:n}=await import(`./chunks/config-DwiVCSrY.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-C9CigqoF.js`);r(),await(await import(`./chunks/bg-Dbh5z3Y8.js`)).handleBgStart(e.filter(e=>e!==`--bg`&&e!==`--background`));return}if(e[0]===`ps`||e[0]===`logs`||e[0]===`attach`||e[0]===`kill`){let n=e[0]===`ps`?`status`:e[0];console.error(`[deprecated] Use: claude daemon ${n}${e[1]?` `+e[1]:``}`),t(`cli_daemon_path`);let{enableConfigs:r}=await import(`./chunks/config-DwiVCSrY.js`);r();let{setShellIfWindows:i}=await import(`./chunks/windowsPaths-C9CigqoF.js`);i();let{initSinks:a}=await import(`./chunks/sinks-CKaSBvU8.js`);a();let{daemonMain:o}=await import(`./chunks/main-C6be1KFk.js`);await o([e[0]===`ps`?`status`:e[0],...e.slice(1)]);return}if(e[0]===`job`){t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-DQXuFnkl.js`);await n(e.slice(1)),process.exit(0)}if(e[0]===`new`||e[0]===`list`||e[0]===`reply`){console.error(`[deprecated] Use: claude job ${e[0]} ${e.slice(1).join(` `)}`.trim()),t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-DQXuFnkl.js`);await n(e),process.exit(0)}if((e.includes(`--tmux`)||e.includes(`--tmux=classic`))&&(e.includes(`-w`)||e.includes(`--worktree`)||e.some(e=>e.startsWith(`--worktree=`)))){t(`cli_tmux_worktree_fast_path`);let{enableConfigs:n}=await import(`./chunks/config-DwiVCSrY.js`);n();let{isWorktreeModeEnabled:r}=await import(`./chunks/worktreeModeEnabled-THQb19xR.js`);if(r()){let{execIntoTmuxWorktree:t}=await import(`./chunks/worktree-CkB4jLXK.js`),n=await t(e);if(n.handled)return;if(n.error){let{exitWithError:e}=await import(`./chunks/process-CWupreF6.js`);e(n.error)}}}e.length===1&&(e[0]===`--update`||e[0]===`--upgrade`)&&(process.argv=[process.argv[0],process.argv[1],`update`]),e.includes(`--bare`)&&(process.env.CLAUDE_CODE_SIMPLE=`1`);let{startCapturingEarlyInput:n}=await import(`./chunks/earlyInput-JGJo1zcC.js`);n(),t(`cli_before_main_import`);let{main:r}=await import(`./chunks/main-CF6Im-LV.js`);t(`cli_after_main_import`),await r(),t(`cli_after_main_complete`)}await m();export{};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-best",
3
- "version": "2.6.0",
3
+ "version": "2.6.6",
4
4
  "description": "Reverse-engineered Anthropic Claude Code CLI — interactive AI coding assistant in the terminal",
5
5
  "type": "module",
6
6
  "author": "claude-code-best <claude-code-best@proton.me>",
@@ -1 +0,0 @@
1
- import{t as e}from"./ApproveApiKey-DWa-XTLb.js";export{e as ApproveApiKey};
@@ -1,2 +0,0 @@
1
- import{a as e,n as t,o as n,r}from"./chunk-DR8-3Aex.js";import{n as i,t as a}from"./figures-gfT9mM8P.js";import{B as o,F as s,Q as c,Rn as l,T as u,b as d,f,g as p,h as m,nt as h,t as g,x as _}from"./src-Di342QoJ.js";import{t as v}from"./jsx-runtime-D-D469L8.js";import{Gs as y,Po as b,jo as x,rs as S}from"./paths-Q2255dD7.js";import{L as C,V as w,b as T,h as ee}from"./debug-UI3T040K.js";import{n as E,r as D}from"./analytics-DqMQntaB.js";import{S as te,b as O,x as ne}from"./teammate-DMYOtLTK.js";import{C as k,E as A,d as re,f as ie,m as ae,x as j}from"./startupProfiler-DnXZaX4A.js";import{An as M,Cu as oe,Dh as se,Dn as ce,Dx as N,Dy as le,Eg as ue,Eu as de,Go as fe,J_ as pe,Ja as me,Ku as he,Lo as ge,Lu as _e,Lw as ve,MS as ye,Mn as be,Mx as xe,My as Se,Ny as Ce,On as we,Ou as Te,Ox as Ee,PS as De,Py as Oe,Q_ as ke,Ru as Ae,So as je,Sy as Me,TS as Ne,Tg as Pe,Xw as Fe,Z_ as Ie,Zw as Le,_y as P,a_ as Re,aa as ze,ap as Be,bu as Ve,cE as He,cj as Ue,cp as We,jS as Ge,jy as Ke,kh as qe,kx as Je,lE as Ye,o_ as Xe,op as Ze,qu as Qe,ra as $e,rv as et,sj as tt,sp as nt,sv as rt,vy as F,wS as it,wu as at}from"./loadAgentsDir-Ci5mr0vm.js";import{Bn as ot,Vn as st,Xt as ct,tn as lt,zn as ut}from"./prompt-DEPUnJdB.js";import{n as dt,t as ft}from"./browser-fLRXxIsQ.js";import{t as I}from"./useKeybinding-FsOnjW6T.js";import{a as pt,c as mt}from"./constants-41VpZw2G.js";import{t as ht}from"./Dialog-DYFGqyDs.js";import{i as gt,n as _t}from"./mappers-uIrAj-Wd.js";function vt(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`local_agent`}function yt(e){return{...e,retain:!1,messages:void 0,diskLoaded:!1,evictAfter:we(e.status)?Date.now()+Ct:void 0}}function bt(e,t){D(`tengu_transcript_view_enter`,{}),t(t=>{let n=t.tasks[e],r=t.viewingAgentTaskId,i=r===void 0?void 0:t.tasks[r],a=r!==void 0&&r!==e&&vt(i)&&i.retain,o=vt(n)&&(!n.retain||n.evictAfter!==void 0),s=t.viewingAgentTaskId!==e||t.viewSelectionMode!==`viewing-agent`;if(!o&&!s&&!a)return t;let c=t.tasks;return(a||o)&&(c={...t.tasks},a&&(c[r]=yt(i)),o&&(c[e]={...n,retain:!0,evictAfter:void 0})),{...t,viewingAgentTaskId:e,viewSelectionMode:`viewing-agent`,tasks:c}})}function xt(e){D(`tengu_transcript_view_exit`,{}),e(e=>{let t=e.viewingAgentTaskId,n={...e,viewingAgentTaskId:void 0,viewSelectionMode:`none`};if(t===void 0)return e.viewSelectionMode===`none`?e:n;let r=e.tasks[t];return!vt(r)||!r.retain?n:{...n,tasks:{...e.tasks,[t]:yt(r)}}})}function St(e,t){t(t=>{let n=t.tasks[e];if(!vt(n))return t;if(n.status===`running`)return n.abortController?.abort(),t;if(n.evictAfter===0)return t;let r=t.viewingAgentTaskId===e;return{...t,tasks:{...t.tasks,[e]:{...yt(n),evictAfter:0}},...r&&{viewingAgentTaskId:void 0,viewSelectionMode:`none`}}})}var Ct,wt=t((()=>{E(),ce(),Ct=3e4}));function Tt(e,t,n){let r=ut(t,e.toolName);if(!r)return e.toolName;try{let t=r.inputSchema.safeParse(e.input),i=t.success?t.data:{},a=r.userFacingName(i);if(!a)return e.toolName;let o=r.renderToolUseMessage(i,{theme:n,verbose:!1});return o?(0,Et.jsxs)(d,{children:[a,`(`,o,`)`]}):a}catch{return e.toolName}}var Et,Dt=t((()=>{l(),g(),st(),Et=v()}));function Ot(e){return e===`completed`||e===`failed`||e===`killed`}function kt(e,t){let{isIdle:n,awaitingApproval:r,hasError:i,shutdownRequested:o}=t??{};return i?a.cross:r?a.questionMarkPrefix:o?a.warning:e===`running`?n?a.ellipsis:a.play:e===`completed`?a.tick:e===`failed`||e===`killed`?a.cross:a.bullet}function At(e,t){let{isIdle:n,awaitingApproval:r,hasError:i,shutdownRequested:a}=t??{};return i?`error`:r||a?`warning`:n?`background`:e===`completed`?`success`:e===`failed`?`error`:e===`killed`?`warning`:`background`}function jt(e){return e.shutdownRequested?`stopping`:e.awaitingPlanApproval?`awaiting approval`:e.isIdle?`idle`:(e.progress?.recentActivities&&Ae(e.progress.recentActivities))??e.progress?.lastActivity?.activityDescription??`working`}function Mt(e,t){if(!t)return!1;let n=!1;for(let t of Object.values(e))if(!(!Se(t)||process.env.USER_TYPE===`ant`&&Te(t))&&(n=!0,t.type!==`in_process_teammate`))return!1;return n}var Nt=t((()=>{i(),de(),Ke(),_e()}));function Pt({agent:e,onDone:t,onKillAgent:n,onBack:r}){let[i]=u(),a=(0,Ft.useMemo)(()=>he(ot()),[]),o=F(e.startTime,e.status===`running`,1e3,e.totalPausedMs??0);h({"confirm:yes":t},{context:`Confirmation`});let s=i=>{i.key===` `?(i.preventDefault(),t()):i.key===`left`&&r?(i.preventDefault(),r()):i.key===`x`&&e.status===`running`&&n&&(i.preventDefault(),n())},c=je(e.prompt,`plan`),l=e.prompt.length>300?e.prompt.substring(0,297)+`…`:e.prompt,g=e.result?.totalTokens??e.progress?.tokenCount,v=e.result?.totalToolUseCount??e.progress?.toolUseCount;return(0,L.jsx)(_,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:s,children:(0,L.jsx)(f,{title:(0,L.jsxs)(d,{children:[e.selectedAgent?.agentType??`agent`,` › `,e.description||`Async agent`]}),subtitle:(0,L.jsxs)(d,{children:[e.status!==`running`&&(0,L.jsxs)(d,{color:At(e.status),children:[kt(e.status),` `,e.status===`completed`?`Completed`:e.status===`failed`?`Failed`:`Stopped`,` · `]}),(0,L.jsxs)(d,{dimColor:!0,children:[o,g!==void 0&&g>0&&(0,L.jsxs)(L.Fragment,{children:[` · `,ae(g),` tokens`]}),v!==void 0&&v>0&&(0,L.jsxs)(L.Fragment,{children:[` `,`· `,v,` `,v===1?`tool`:`tools`]})]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,L.jsxs)(d,{children:[`Press `,t.keyName,` again to exit`]}):(0,L.jsxs)(m,{children:[r&&(0,L.jsx)(p,{shortcut:`←`,action:`go back`}),(0,L.jsx)(p,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,L.jsx)(p,{shortcut:`x`,action:`stop`})]}),children:(0,L.jsxs)(_,{flexDirection:`column`,children:[e.status===`running`&&e.progress?.recentActivities&&e.progress.recentActivities.length>0&&(0,L.jsxs)(_,{flexDirection:`column`,children:[(0,L.jsx)(d,{bold:!0,dimColor:!0,children:`Progress`}),e.progress.recentActivities.map((t,n)=>(0,L.jsxs)(d,{dimColor:n<e.progress.recentActivities.length-1,wrap:`truncate-end`,children:[n===e.progress.recentActivities.length-1?`› `:` `,Tt(t,a,i)]},n))]}),c?(0,L.jsx)(_,{marginTop:1,children:(0,L.jsx)(Pe,{addMargin:!1,planContent:c})}):(0,L.jsxs)(_,{flexDirection:`column`,marginTop:1,children:[(0,L.jsx)(d,{bold:!0,dimColor:!0,children:`Prompt`}),(0,L.jsx)(d,{wrap:`wrap`,children:l})]}),e.status===`failed`&&e.error&&(0,L.jsxs)(_,{flexDirection:`column`,marginTop:1,children:[(0,L.jsx)(d,{bold:!0,color:`error`,children:`Error`}),(0,L.jsx)(d,{color:`error`,wrap:`wrap`,children:e.error})]})]})})})}var Ft,L,It=t((()=>{Ft=n(l(),1),P(),g(),I(),st(),Qe(),j(),ge(),ue(),Dt(),Nt(),L=v()}));function Lt(e,t,n,r){if(!e)return`${t} found · ${n} verified`;if(e===`synthesizing`){let e=[`${n} verified`];return r>0&&e.push(`${r} refuted`),e.push(`deduping`),e.join(` · `)}if(e===`verifying`){let e=[`${t} found`,`${n} verified`];return r>0&&e.push(`${r} refuted`),e.join(` · `)}return t>0?`${t} found`:`finding`}function Rt({text:e,phase:t=0}){return(0,R.jsx)(R.Fragment,{children:[...e].map((e,n)=>(0,R.jsx)(d,{color:tt(n+t),children:e},n))})}function zt(e,t,n){let r=(0,Ht.useRef)(e),i=(0,Ht.useRef)(t);return n||e<r.current?r.current=e:e>r.current&&t!==i.current&&(r.current+=1,i.current=t),r.current}function Bt({session:e}){let t=Ne().prefersReducedMotion??!1,n=e.reviewProgress,r=e.status===`running`,[,i]=o(r&&!t?Ut:null),a=n?.bugsFound??0,s=n?.bugsVerified??0,c=n?.bugsRefuted??0,l=t||!r,u=zt(a,i,l),f=zt(s,i,l),p=zt(c,i,l),m=Math.floor(i/(Ut*3))%7;if(e.status===`completed`)return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(d,{color:`background`,children:[`◆`,` `]}),(0,R.jsx)(Rt,{text:`ultrareview`,phase:0}),(0,R.jsx)(d,{dimColor:!0,children:` ready · shift+↓ to view`})]});if(e.status===`failed`)return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(d,{color:`background`,children:[`◆`,` `]}),(0,R.jsx)(Rt,{text:`ultrareview`,phase:0}),(0,R.jsxs)(d,{color:`error`,dimColor:!0,children:[` · `,`error`]})]});let h=n?Lt(n.stage,u,f,p):`setting up`;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(d,{color:`background`,children:[`◇`,` `]}),(0,R.jsx)(Rt,{text:`ultrareview`,phase:r?m:0}),(0,R.jsxs)(d,{dimColor:!0,children:[` · `,h]})]})}function Vt({session:e}){if(e.isRemoteReview)return(0,R.jsx)(Bt,{session:e});if(e.status===`completed`)return(0,R.jsx)(d,{bold:!0,color:`success`,dimColor:!0,children:`done`});if(e.status===`failed`)return(0,R.jsx)(d,{bold:!0,color:`error`,dimColor:!0,children:`error`});if(!e.todoList.length)return(0,R.jsxs)(d,{dimColor:!0,children:[e.status,`…`]});let t=O(e.todoList,e=>e.status===`completed`),n=e.todoList.length;return(0,R.jsxs)(d,{dimColor:!0,children:[t,`/`,n]})}var Ht,R,Ut,Wt=t((()=>{Ht=n(l(),1),y(),it(),g(),ne(),Ue(),R=v(),Ut=80}));function z({status:e,label:t,suffix:n}){return(0,B.jsxs)(d,{color:e===`completed`?`success`:e===`failed`?`error`:e===`killed`?`warning`:void 0,dimColor:!0,children:[`(`,t??e,n,`)`]})}function Gt({shell:e}){switch(e.status){case`completed`:return(0,B.jsx)(z,{status:`completed`,label:`done`});case`failed`:return(0,B.jsx)(z,{status:`failed`,label:`error`});case`killed`:return(0,B.jsx)(z,{status:`killed`,label:`stopped`});case`running`:case`pending`:return(0,B.jsx)(z,{status:`running`})}}var B,Kt=t((()=>{g(),B=v()}));function qt({task:e,maxActivityWidth:t}){let n=t??40;switch(e.type){case`local_bash`:return(0,V.jsxs)(d,{children:[k(e.kind===`monitor`?e.description:e.command,n,!0),` `,(0,V.jsx)(Gt,{shell:e})]});case`remote_agent`:return e.isRemoteReview?(0,V.jsx)(d,{children:(0,V.jsx)(Vt,{session:e})}):(0,V.jsxs)(d,{children:[(0,V.jsxs)(d,{dimColor:!0,children:[e.status===`running`||e.status===`pending`?`◇`:`◆`,` `]}),k(e.title,n,!0),(0,V.jsx)(d,{dimColor:!0,children:` · `}),(0,V.jsx)(Vt,{session:e})]});case`local_agent`:return(0,V.jsxs)(d,{children:[k(e.description,n,!0),` `,(0,V.jsx)(z,{status:e.status,label:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]});case`in_process_teammate`:{let t=jt(e);return(0,V.jsxs)(d,{children:[(0,V.jsxs)(d,{color:Oe(e.identity.color),children:[`@`,e.identity.agentName]}),(0,V.jsxs)(d,{dimColor:!0,children:[`: `,k(t,n,!0)]})]})}case`local_workflow`:{let t=e;return(0,V.jsxs)(d,{children:[k(t.workflowName??e.summary??e.description,n,!0),` `,(0,V.jsx)(z,{status:e.status,label:e.status===`running`?`${t.agentCount} ${b(t.agentCount,`agent`)}`:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]})}case`monitor_mcp`:return(0,V.jsxs)(d,{children:[k(e.description,n,!0),` `,(0,V.jsx)(z,{status:e.status,label:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]});case`dream`:{let t=e.filesTouched.length,n=e.phase===`updating`&&t>0?`${t} ${b(t,`file`)}`:`${e.sessionsReviewing} ${b(e.sessionsReviewing,`session`)}`;return(0,V.jsxs)(d,{children:[e.description,` `,(0,V.jsxs)(d,{dimColor:!0,children:[`· `,e.phase,` · `,n]}),` `,(0,V.jsx)(z,{status:e.status,label:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]})}}}var V,Jt=t((()=>{l(),g(),Ce(),j(),x(),y(),Wt(),Kt(),Nt(),V=v()}));function Yt({task:e,onDone:t,onBack:n,onKill:r}){let i=F(e.startTime,e.status===`running`,1e3,0);h({"confirm:yes":t},{context:`Confirmation`});let a=i=>{i.key===` `?(i.preventDefault(),t()):i.key===`left`&&n?(i.preventDefault(),n()):i.key===`x`&&e.status===`running`&&r&&(i.preventDefault(),r())},o=e.turns.filter(e=>e.text!==``),s=o.slice(-Xt),c=o.length-s.length;return(0,H.jsx)(_,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:a,children:(0,H.jsx)(f,{title:`Memory consolidation`,subtitle:(0,H.jsxs)(d,{dimColor:!0,children:[i,` · reviewing `,e.sessionsReviewing,` `,b(e.sessionsReviewing,`session`),e.filesTouched.length>0&&(0,H.jsxs)(H.Fragment,{children:[` `,`· `,e.filesTouched.length,` `,b(e.filesTouched.length,`file`),` touched`]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,H.jsxs)(d,{children:[`Press `,t.keyName,` again to exit`]}):(0,H.jsxs)(m,{children:[n&&(0,H.jsx)(p,{shortcut:`←`,action:`go back`}),(0,H.jsx)(p,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&r&&(0,H.jsx)(p,{shortcut:`x`,action:`stop`})]}),children:(0,H.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,H.jsxs)(d,{children:[(0,H.jsx)(d,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,H.jsx)(d,{color:`background`,children:`running`}):e.status===`completed`?(0,H.jsx)(d,{color:`success`,children:e.status}):(0,H.jsx)(d,{color:`error`,children:e.status})]}),s.length===0?(0,H.jsx)(d,{dimColor:!0,children:e.status===`running`?`Starting…`:`(no text output)`}):(0,H.jsxs)(H.Fragment,{children:[c>0&&(0,H.jsxs)(d,{dimColor:!0,children:[`(`,c,` earlier `,b(c,`turn`),`)`]}),s.map((e,t)=>(0,H.jsxs)(_,{flexDirection:`column`,children:[(0,H.jsx)(d,{wrap:`wrap`,children:e.text}),e.toolUseCount>0&&(0,H.jsxs)(d,{dimColor:!0,children:[` `,`(`,e.toolUseCount,` `,b(e.toolUseCount,`tool`),`)`]})]},t))]})]})})})}var H,Xt,Zt=t((()=>{l(),P(),g(),I(),x(),H=v(),Xt=6}));function Qt({teammate:e,onDone:t,onKill:n,onBack:r,onForeground:i}){let[a]=u(),o=(0,$t.useMemo)(()=>he(ot()),[]),s=F(e.startTime,e.status===`running`,1e3,e.totalPausedMs??0);h({"confirm:yes":t},{context:`Confirmation`});let c=a=>{a.key===` `?(a.preventDefault(),t()):a.key===`left`&&r?(a.preventDefault(),r()):a.key===`x`&&e.status===`running`&&n?(a.preventDefault(),n()):a.key===`f`&&e.status===`running`&&i&&(a.preventDefault(),i())},l=jt(e),g=e.result?.totalTokens??e.progress?.tokenCount,v=e.result?.totalToolUseCount??e.progress?.toolUseCount,y=A(e.prompt,300);return(0,U.jsx)(_,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:c,children:(0,U.jsxs)(f,{title:(0,U.jsxs)(d,{children:[(0,U.jsxs)(d,{color:Oe(e.identity.color),children:[`@`,e.identity.agentName]}),l&&(0,U.jsxs)(d,{dimColor:!0,children:[` (`,l,`)`]})]}),subtitle:(0,U.jsxs)(d,{children:[e.status!==`running`&&(0,U.jsxs)(d,{color:e.status===`completed`?`success`:e.status===`killed`?`warning`:`error`,children:[e.status===`completed`?`Completed`:e.status===`failed`?`Failed`:`Stopped`,` · `]}),(0,U.jsxs)(d,{dimColor:!0,children:[s,g!==void 0&&g>0&&(0,U.jsxs)(U.Fragment,{children:[` · `,ae(g),` tokens`]}),v!==void 0&&v>0&&(0,U.jsxs)(U.Fragment,{children:[` `,`· `,v,` `,v===1?`tool`:`tools`]})]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,U.jsxs)(d,{children:[`Press `,t.keyName,` again to exit`]}):(0,U.jsxs)(m,{children:[r&&(0,U.jsx)(p,{shortcut:`←`,action:`go back`}),(0,U.jsx)(p,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,U.jsx)(p,{shortcut:`x`,action:`stop`}),e.status===`running`&&i&&(0,U.jsx)(p,{shortcut:`f`,action:`foreground`})]}),children:[e.status===`running`&&e.progress?.recentActivities&&e.progress.recentActivities.length>0&&(0,U.jsxs)(_,{flexDirection:`column`,children:[(0,U.jsx)(d,{bold:!0,dimColor:!0,children:`Progress`}),e.progress.recentActivities.map((t,n)=>(0,U.jsxs)(d,{dimColor:n<e.progress.recentActivities.length-1,wrap:`truncate-end`,children:[n===e.progress.recentActivities.length-1?`› `:` `,Tt(t,o,a)]},n))]}),(0,U.jsxs)(_,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(d,{bold:!0,dimColor:!0,children:`Prompt`}),(0,U.jsx)(d,{wrap:`wrap`,children:y})]}),e.status===`failed`&&e.error&&(0,U.jsxs)(_,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(d,{bold:!0,color:`error`,children:`Error`}),(0,U.jsx)(d,{color:`error`,wrap:`wrap`,children:e.error})]})]})})}var $t,U,en=t((()=>{$t=n(l(),1),P(),g(),I(),st(),Qe(),j(),Ce(),Dt(),Nt(),U=v()}));function tn(e,t){if(e===`ExitPlanMode`)return`Review the plan in Claude Code on the web`;if(!t||typeof t!=`object`)return e;if(e===`AskUserQuestion`&&`questions`in t){let e=t.questions;if(Array.isArray(e)&&e[0]&&typeof e[0]==`object`){let t=`question`in e[0]&&typeof e[0].question==`string`&&e[0].question?e[0].question:`header`in e[0]&&typeof e[0].header==`string`?e[0].header:null;if(t)return`Answer in browser: ${A(t.replace(/\s+/g,` `).trim(),50)}`}}for(let n of Object.values(t))if(typeof n==`string`&&n.trim())return`${e} ${A(n.replace(/\s+/g,` `).trim(),60)}`;return e}function nn({session:e,onDone:t,onBack:n,onKill:r}){let i=e.status===`running`||e.status===`pending`,o=e.ultraplanPhase,s=i?o?cn[o]:`running`:e.status,l=F(e.startTime,i,1e3,0,e.endTime),{agentsWorking:u,toolCalls:p,lastToolCall:m}=(0,W.useMemo)(()=>{let t=0,n=0,r=null;for(let i of e.log){if(i.type!==`assistant`)continue;let e=i.message?.content??[];for(let i of e)i.type===`tool_use`&&(n++,r=i,(i.name===`Agent`||i.name===`Task`)&&t++)}return{agentsWorking:1+t,toolCalls:n,lastToolCall:r?tn(r.name,r.input):null}},[e.log]),h=Ie(e.sessionId),g=n??(()=>t(`Remote session details dismissed`,{display:`system`})),[v,y]=(0,W.useState)(!1);return v?(0,G.jsx)(f,{title:`Stop ultraplan?`,onCancel:()=>y(!1),color:`background`,children:(0,G.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,G.jsx)(d,{dimColor:!0,children:`This will terminate the Claude Code on the web session.`}),(0,G.jsx)(N,{options:[{label:`Terminate session`,value:`stop`},{label:`Back`,value:`back`}],onChange:e=>{e===`stop`?(r?.(),g()):y(!1)}})]})}):(0,G.jsx)(f,{title:(0,G.jsxs)(d,{children:[(0,G.jsxs)(d,{color:`background`,children:[o===`plan_ready`?`◆`:`◇`,` `]}),(0,G.jsx)(d,{bold:!0,children:`ultraplan`}),(0,G.jsxs)(d,{dimColor:!0,children:[` · `,l,` · `,s]})]}),onCancel:g,color:`background`,children:(0,G.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,G.jsxs)(d,{children:[o===`plan_ready`&&(0,G.jsxs)(d,{color:`success`,children:[a.tick,` `]}),u,` `,b(u,`agent`),` `,o?ln[o]:`working`,` · `,p,` tool`,` `,b(p,`call`)]}),m&&(0,G.jsx)(d,{dimColor:!0,children:m}),(0,G.jsx)(c,{url:h,children:(0,G.jsx)(d,{dimColor:!0,children:h})}),(0,G.jsx)(N,{options:[{label:`Review in Claude Code on the web`,value:`open`},...r&&i?[{label:`Stop ultraplan`,value:`stop`}]:[],{label:`Back`,value:`back`}],onChange:e=>{switch(e){case`open`:dt(h),t();return;case`stop`:y(!0);return;case`back`:g();return}}})]})})}function rn({stage:e,completed:t,hasProgress:n}){let r=e?un.indexOf(e):-1,i=!t&&!n;return(0,G.jsxs)(d,{children:[i?(0,G.jsx)(d,{color:`background`,children:`Setup`}):(0,G.jsx)(d,{dimColor:!0,children:`Setup`}),(0,G.jsx)(d,{dimColor:!0,children:` → `}),un.map((e,n)=>{let a=!t&&!i&&n===r;return(0,G.jsxs)(W.Fragment,{children:[n>0&&(0,G.jsx)(d,{dimColor:!0,children:` → `}),a?(0,G.jsx)(d,{color:`background`,children:dn[e]}):(0,G.jsx)(d,{dimColor:!0,children:dn[e]})]},e)}),t&&(0,G.jsx)(d,{color:`success`,children:` ✓`})]})}function an(e){let t=e.reviewProgress;if(!t)return e.status===`completed`?`done`:`setting up`;let n=t.bugsVerified,r=t.bugsRefuted??0;if(e.status===`completed`){let e=[`${n} ${b(n,`finding`)}`];return r>0&&e.push(`${r} refuted`),e.join(` · `)}return Lt(t.stage,t.bugsFound,n,r)}function on({session:e,onDone:t,onBack:n,onKill:r}){let i=e.status===`completed`,a=e.status===`running`||e.status===`pending`,[o,s]=(0,W.useState)(!1),l=F(e.startTime,a,1e3,0,e.endTime),u=()=>t(`Remote session details dismissed`,{display:`system`}),h=n??u,g=Ie(e.sessionId),v=i?`ready`:a?`running`:e.status;if(o)return(0,G.jsx)(f,{title:`Stop ultrareview?`,onCancel:()=>s(!1),color:`background`,children:(0,G.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,G.jsx)(d,{dimColor:!0,children:`This archives the remote session and stops local tracking. The review will not complete and any findings so far are discarded.`}),(0,G.jsx)(N,{options:[{label:`Stop ultrareview`,value:`stop`},{label:`Back`,value:`back`}],onChange:e=>{e===`stop`?(r?.(),h()):s(!1)}})]})});let y=i?[{label:`Open in Claude Code on the web`,value:`open`},{label:`Dismiss`,value:`dismiss`}]:[{label:`Open in Claude Code on the web`,value:`open`},...r&&a?[{label:`Stop ultrareview`,value:`stop`}]:[],{label:`Back`,value:`back`}];return(0,G.jsx)(f,{title:(0,G.jsxs)(d,{children:[(0,G.jsxs)(d,{color:`background`,children:[i?`◆`:`◇`,` `]}),(0,G.jsx)(d,{bold:!0,children:`ultrareview`}),(0,G.jsxs)(d,{dimColor:!0,children:[` · `,l,` · `,v]})]}),onCancel:h,color:`background`,inputGuide:e=>e.pending?(0,G.jsxs)(d,{children:[`Press `,e.keyName,` again to exit`]}):(0,G.jsxs)(m,{children:[(0,G.jsx)(p,{shortcut:`Enter`,action:`select`}),(0,G.jsx)(p,{shortcut:`Esc`,action:`go back`})]}),children:(0,G.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,G.jsx)(rn,{stage:e.reviewProgress?.stage,completed:i,hasProgress:!!e.reviewProgress}),(0,G.jsxs)(_,{flexDirection:`column`,children:[(0,G.jsx)(d,{children:an(e)}),(0,G.jsx)(c,{url:g,children:(0,G.jsx)(d,{dimColor:!0,children:g})})]}),(0,G.jsx)(N,{options:y,onChange:e=>{switch(e){case`open`:dt(g),t();break;case`stop`:s(!0);break;case`back`:h();break;case`dismiss`:u();break}}})]})})}function sn({session:e,toolUseContext:t,onDone:n,onBack:r,onKill:i}){let[a,o]=(0,W.useState)(!1),[s,l]=(0,W.useState)(null),u=(0,W.useMemo)(()=>e.isUltraplan||e.isRemoteReview?[]:fe(gt(e.log)).filter(e=>e.type!==`progress`).slice(-3),[e]);if(e.isUltraplan)return(0,G.jsx)(nn,{session:e,onDone:n,onBack:r,onKill:i});if(e.isRemoteReview)return(0,G.jsx)(on,{session:e,onDone:n,onBack:r,onKill:i});let h=()=>n(`Remote session details dismissed`,{display:`system`}),g=e=>{e.key===` `?(e.preventDefault(),n(`Remote session details dismissed`,{display:`system`})):e.key===`left`&&r?(e.preventDefault(),r()):e.key===`t`&&!a?(e.preventDefault(),v()):e.key===`return`&&(e.preventDefault(),h())};async function v(){o(!0),l(null);try{await rt(e.sessionId)}catch(e){l(C(e))}finally{o(!1)}}let y=A(e.title,50),b=e.status===`pending`?`starting`:e.status;return(0,G.jsx)(_,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:g,children:(0,G.jsxs)(f,{title:`Remote session details`,onCancel:h,color:`background`,inputGuide:e=>e.pending?(0,G.jsxs)(d,{children:[`Press `,e.keyName,` again to exit`]}):(0,G.jsxs)(m,{children:[r&&(0,G.jsx)(p,{shortcut:`←`,action:`go back`}),(0,G.jsx)(p,{shortcut:`Esc/Enter/Space`,action:`close`}),!a&&(0,G.jsx)(p,{shortcut:`t`,action:`teleport`})]}),children:[(0,G.jsxs)(_,{flexDirection:`column`,children:[(0,G.jsxs)(d,{children:[(0,G.jsx)(d,{bold:!0,children:`Status`}),`:`,` `,b===`running`||b===`starting`?(0,G.jsx)(d,{color:`background`,children:b}):b===`completed`?(0,G.jsx)(d,{color:`success`,children:b}):(0,G.jsx)(d,{color:`error`,children:b})]}),(0,G.jsxs)(d,{children:[(0,G.jsx)(d,{bold:!0,children:`Runtime`}),`: `,re((e.endTime??Date.now())-e.startTime)]}),(0,G.jsxs)(d,{wrap:`truncate-end`,children:[(0,G.jsx)(d,{bold:!0,children:`Title`}),`: `,y]}),(0,G.jsxs)(d,{children:[(0,G.jsx)(d,{bold:!0,children:`Progress`}),`: `,(0,G.jsx)(Vt,{session:e})]}),(0,G.jsxs)(d,{children:[(0,G.jsx)(d,{bold:!0,children:`Session URL`}),`:`,` `,(0,G.jsx)(c,{url:Ie(e.sessionId),children:(0,G.jsx)(d,{dimColor:!0,children:Ie(e.sessionId)})})]})]}),e.log.length>0&&(0,G.jsxs)(_,{flexDirection:`column`,marginTop:1,children:[(0,G.jsxs)(d,{children:[(0,G.jsx)(d,{bold:!0,children:`Recent messages`}),`:`]}),(0,G.jsx)(_,{flexDirection:`column`,height:10,overflowY:`hidden`,children:u.map((e,n)=>(0,G.jsx)(se,{message:e,lookups:me,addMargin:n>0,tools:t.options.tools,commands:t.options.commands,verbose:t.options.verbose,inProgressToolUseIDs:new Set,progressMessagesForMessage:[],shouldAnimate:!1,shouldShowDot:!1,style:`condensed`,isTranscriptMode:!1,isStatic:!0},n))}),(0,G.jsx)(_,{marginTop:1,children:(0,G.jsxs)(d,{dimColor:!0,italic:!0,children:[`Showing last `,u.length,` of `,e.log.length,` messages`]})})]}),s&&(0,G.jsx)(_,{marginTop:1,children:(0,G.jsxs)(d,{color:`error`,children:[`Teleport failed: `,s]})}),a&&(0,G.jsx)(d,{color:`background`,children:`Teleporting to session…`})]})})}var W,G,cn,ln,un,dn,fn=t((()=>{i(),W=n(l(),1),y(),P(),g(),ke(),S(),ct(),lt(),ft(),w(),j(),_t(),ge(),x(),et(),Ee(),qe(),Wt(),G=v(),cn={needs_input:`input required`,plan_ready:`ready`},ln={needs_input:`waiting`,plan_ready:`done`},un=[`finding`,`verifying`,`synthesizing`],dn={finding:`Find`,verifying:`Verify`,synthesizing:`Dedupe`}}));async function pn(e){let t=M(e.id);try{let e=await T(t,gn);return{content:e.content,bytesTotal:e.bytesTotal}}catch{return{content:``,bytesTotal:0}}}function mn({shell:e,onDone:t,onKillShell:n,onBack:r}){let{columns:i}=s(),[a,o]=(0,K.useState)(()=>pn(e)),c=(0,K.useDeferredValue)(a);(0,K.useEffect)(()=>{if(e.status!==`running`)return;let t=setInterval((e,t)=>e(pn(t)),1e3,o,e);return()=>clearInterval(t)},[e.id,e.status]);let l=()=>t(`Shell details dismissed`,{display:`system`});h({"confirm:yes":l},{context:`Confirmation`});let u=i=>{i.key===` `?(i.preventDefault(),t(`Shell details dismissed`,{display:`system`})):i.key===`left`&&r?(i.preventDefault(),r()):i.key===`x`&&e.status===`running`&&n&&(i.preventDefault(),n())},g=e.kind===`monitor`,v=A(e.command,280);return(0,q.jsx)(_,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:u,children:(0,q.jsxs)(f,{title:g?`Monitor details`:`Shell details`,onCancel:l,color:`background`,inputGuide:t=>t.pending?(0,q.jsxs)(d,{children:[`Press `,t.keyName,` again to exit`]}):(0,q.jsxs)(m,{children:[r&&(0,q.jsx)(p,{shortcut:`←`,action:`go back`}),(0,q.jsx)(p,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,q.jsx)(p,{shortcut:`x`,action:`stop`})]}),children:[(0,q.jsxs)(_,{flexDirection:`column`,children:[(0,q.jsxs)(d,{children:[(0,q.jsx)(d,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,q.jsxs)(d,{color:`background`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]}):e.status===`completed`?(0,q.jsxs)(d,{color:`success`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]}):(0,q.jsxs)(d,{color:`error`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]})]}),(0,q.jsxs)(d,{children:[(0,q.jsx)(d,{bold:!0,children:`Runtime:`}),` `,re((e.endTime??Date.now())-e.startTime)]}),(0,q.jsxs)(d,{wrap:`wrap`,children:[(0,q.jsx)(d,{bold:!0,children:g?`Script:`:`Command:`}),` `,v]})]}),(0,q.jsxs)(_,{flexDirection:`column`,children:[(0,q.jsx)(d,{bold:!0,children:`Output:`}),(0,q.jsx)(K.Suspense,{fallback:(0,q.jsx)(d,{dimColor:!0,children:`Loading output…`}),children:(0,q.jsx)(hn,{outputPromise:c,columns:i})})]})]})})}function hn({outputPromise:e,columns:t}){let{content:n,bytesTotal:r}=(0,K.use)(e);if(!n)return(0,q.jsx)(d,{dimColor:!0,children:`No output available`});let i=[],a=n.length;for(let e=0;e<10&&a>0;e++){let e=n.lastIndexOf(`
2
- `,a-1);i.push(e+1),a=e}i.reverse();let o=r>n.length,s=[];for(let e=0;e<i.length;e++){let t=i[e],r=e<i.length-1?i[e+1]-1:n.length,a=n.slice(t,r);a&&s.push(a)}return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(_,{borderStyle:`round`,paddingX:1,flexDirection:`column`,height:12,maxWidth:t-6,children:s.map((e,t)=>(0,q.jsx)(d,{wrap:`truncate-end`,children:e},t))}),(0,q.jsxs)(d,{dimColor:!0,italic:!0,children:[`Showing ${s.length} lines`,o?` of ${ie(r)}`:``]})]})}var K,q,gn,_n=t((()=>{K=n(l(),1),ve(),g(),I(),j(),ee(),be(),q=v(),gn=8192})),vn=t((()=>{g()})),yn=t((()=>{g()})),bn=r({WorkflowDetailDialog:()=>xn});function xn({workflow:e,onDone:t,onKill:n,onSkipAgent:r,onRetryAgent:i,onBack:a}){let o=F(e.startTime,e.status===`running`,1e3,0);return h({},{context:`WorkflowDetail`}),(0,J.jsx)(_,{flexDirection:`column`,tabIndex:0,borderStyle:`round`,onKeyDown:(0,Sn.useCallback)(t=>{t.key===`left`&&a?(t.preventDefault(),a()):t.key===`x`&&e.status===`running`&&n&&(t.preventDefault(),n())},[a,n,e.status]),children:(0,J.jsx)(f,{title:`Workflow`,subtitle:(0,J.jsxs)(d,{dimColor:!0,children:[o,` · `,e.workflowName]}),onCancel:a??(()=>{}),inputGuide:()=>(0,J.jsxs)(m,{children:[a&&(0,J.jsx)(p,{shortcut:`←`,action:`go back`}),(0,J.jsx)(p,{shortcut:`Esc`,action:`close`}),e.status===`running`&&n&&(0,J.jsx)(p,{shortcut:`x`,action:`stop`})]}),children:(0,J.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,J.jsxs)(d,{children:[(0,J.jsx)(d,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,J.jsx)(d,{color:`ansi:green`,children:`running`}):e.status===`completed`?(0,J.jsx)(d,{color:`ansi:green`,children:e.status}):(0,J.jsx)(d,{color:`ansi:red`,children:e.status})]}),(0,J.jsxs)(d,{children:[(0,J.jsx)(d,{bold:!0,children:`Description:`}),` `,e.description]}),(0,J.jsxs)(d,{children:[(0,J.jsx)(d,{bold:!0,children:`Workflow:`}),` `,e.workflowName]}),(0,J.jsxs)(d,{children:[(0,J.jsx)(d,{bold:!0,children:`File:`}),` `,e.workflowFile]}),e.summary&&(0,J.jsxs)(d,{children:[(0,J.jsx)(d,{bold:!0,children:`Summary:`}),` `,e.summary]}),e.output&&(0,J.jsxs)(_,{flexDirection:`column`,children:[(0,J.jsx)(d,{bold:!0,children:`Output:`}),(0,J.jsx)(d,{dimColor:!0,children:e.output})]})]})})})}var Sn,J,Cn=t((()=>{Sn=n(l(),1),P(),g(),I(),vn(),ht(),yn(),J=v()})),wn=r({MonitorMcpDetailDialog:()=>Tn});function Tn({task:e,onBack:t,onKill:n}){let r=F(e.startTime,e.status===`running`,1e3,0);return h({},{context:`MonitorMcpDetail`}),(0,Y.jsx)(_,{flexDirection:`column`,tabIndex:0,borderStyle:`round`,onKeyDown:r=>{r.key===`left`&&t?(r.preventDefault(),t()):r.key===`x`&&e.status===`running`&&n&&(r.preventDefault(),n())},children:(0,Y.jsx)(f,{title:`MCP Monitor`,subtitle:(0,Y.jsxs)(d,{dimColor:!0,children:[r,` · `,e.serverName,`:`,e.resourceUri]}),onCancel:t??(()=>{}),inputGuide:()=>(0,Y.jsxs)(m,{children:[t&&(0,Y.jsx)(p,{shortcut:`←`,action:`go back`}),(0,Y.jsx)(p,{shortcut:`Esc`,action:`close`}),e.status===`running`&&n&&(0,Y.jsx)(p,{shortcut:`x`,action:`stop`})]}),children:(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,Y.jsxs)(d,{children:[(0,Y.jsx)(d,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,Y.jsx)(d,{color:`ansi:green`,children:`running`}):e.status===`completed`?(0,Y.jsx)(d,{color:`ansi:green`,children:e.status}):(0,Y.jsx)(d,{color:`ansi:red`,children:e.status})]}),(0,Y.jsxs)(d,{children:[(0,Y.jsx)(d,{bold:!0,children:`Description:`}),` `,e.description]}),(0,Y.jsxs)(d,{children:[(0,Y.jsx)(d,{bold:!0,children:`Server:`}),` `,e.serverName]}),(0,Y.jsxs)(d,{children:[(0,Y.jsx)(d,{bold:!0,children:`Resource:`}),` `,e.resourceUri]}),e.command&&(0,Y.jsxs)(d,{children:[(0,Y.jsx)(d,{bold:!0,children:`Command:`}),` `,e.command]})]})})})}var Y,En=t((()=>{l(),P(),g(),I(),vn(),ht(),yn(),Y=v()}));function Dn(e,t){return Object.values(e??{}).filter(Se).filter(e=>!(e.type===`local_agent`&&e.id===t))}function On({onDone:e,toolUseContext:t,initialDetailTaskId:n}){let r=ye(e=>e.tasks),i=ye(e=>e.foregroundedTaskId),a=ye(e=>e.expandedView)===`teammates`,o=De(),s=Le(`chat:killAgents`,`Chat`,`ctrl+x ctrl+k`),c=r,l=(0,Z.useRef)(!1),[u,g]=(0,Z.useState)(()=>{if(n)return l.current=!0,{mode:`detail`,itemId:n};let e=Dn(c,i);return e.length===1?(l.current=!0,{mode:`detail`,itemId:e[0].id}):{mode:`list`}}),[v,y]=(0,Z.useState)(0);xe(`background-tasks-dialog`);let{bashTasks:b,remoteSessions:x,agentTasks:S,teammateTasks:C,workflowTasks:w,mcpMonitors:T,dreamTasks:ee,allSelectableItems:E}=(0,Z.useMemo)(()=>{let e=Object.values(c??{}).filter(Se).map(kn).sort((e,t)=>{let n=e.status,r=t.status;if(n===`running`&&r!==`running`)return-1;if(n!==`running`&&r===`running`)return 1;let i=`task`in e?e.task.startTime:0;return(`task`in t?t.task.startTime:0)-i}),t=e.filter(e=>e.type===`local_bash`),n=e.filter(e=>e.type===`remote_agent`),r=e.filter(e=>e.type===`local_agent`&&e.id!==i),o=e.filter(e=>e.type===`local_workflow`),s=e.filter(e=>e.type===`monitor_mcp`),l=e.filter(e=>e.type===`dream`),u=a?[]:e.filter(e=>e.type===`in_process_teammate`),d=u.length>0?[{id:`__leader__`,type:`leader`,label:`@${pt}`,status:`running`}]:[];return{bashTasks:t,remoteSessions:n,agentTasks:r,workflowTasks:o,mcpMonitors:s,dreamTasks:l,teammateTasks:[...d,...u],allSelectableItems:[...d,...u,...t,...s,...n,...r,...o,...l]}},[c,i,a]),D=E[v]??null;h({"confirm:previous":()=>y(e=>Math.max(0,e-1)),"confirm:next":()=>y(e=>Math.min(E.length-1,e+1)),"confirm:yes":()=>{let t=E[v];t&&(t.type===`leader`?(xt(o),e(`Viewing leader`,{display:`system`})):g({mode:`detail`,itemId:t.id}))}},{context:`Confirmation`,isActive:u.mode===`list`});let ne=t=>{if(u.mode!==`list`)return;if(t.key===`left`){t.preventDefault(),e(`Background tasks dialog dismissed`,{display:`system`});return}let n=E[v];n&&(t.key===`x`&&(t.preventDefault(),n.type===`local_bash`&&n.status===`running`?k(n.id):n.type===`local_agent`&&n.status===`running`?A(n.id):n.type===`in_process_teammate`&&n.status===`running`?re(n.id):n.type===`local_workflow`&&n.status===`running`&&Nn?Nn(n.id,o):n.type===`monitor_mcp`&&n.status===`running`&&$?$(n.id,o):n.type===`dream`&&n.status===`running`?ie(n.id):n.type===`remote_agent`&&n.status===`running`&&(n.task.isUltraplan?ze(n.id,n.task.sessionId,o):ae(n.id))),t.key===`f`&&(n.type===`in_process_teammate`&&n.status===`running`?(t.preventDefault(),bt(n.id,o),e(`Viewing teammate`,{display:`system`})):n.type===`leader`&&(t.preventDefault(),xt(o),e(`Viewing leader`,{display:`system`}))))};async function k(e){await Ve.kill(e,o)}async function A(e){await at.kill(e,o)}async function re(e){await Me.kill(e,o)}async function ie(e){await nt.kill(e,o)}async function ae(e){await pe.kill(e,o)}let j=(0,Z.useEffectEvent)(e);(0,Z.useEffect)(()=>{if(u.mode!==`list`){let e=(c??{})[u.itemId];(!e||e.type!==`local_workflow`&&!Se(e))&&(l.current?j(`Background tasks dialog dismissed`,{display:`system`}):g({mode:`list`}))}let e=E.length;v>=e&&e>0&&y(e-1)},[u,c,v,E,j]);let M=()=>{l.current&&E.length<=1?e(`Background tasks dialog dismissed`,{display:`system`}):(l.current=!1,g({mode:`list`}))};if(u.mode!==`list`&&c){let n=c[u.itemId];if(!n)return null;switch(n.type){case`local_bash`:return(0,Q.jsx)(mn,{shell:n,onDone:e,onKillShell:()=>void k(n.id),onBack:M},`shell-${n.id}`);case`local_agent`:return(0,Q.jsx)(Pt,{agent:n,onDone:e,onKillAgent:()=>void A(n.id),onBack:M},`agent-${n.id}`);case`remote_agent`:return(0,Q.jsx)(sn,{session:n,onDone:e,toolUseContext:t,onBack:M,onKill:n.status===`running`?n.isUltraplan?()=>void ze(n.id,n.sessionId,o):()=>void ae(n.id):void 0},`session-${n.id}`);case`in_process_teammate`:return(0,Q.jsx)(Qt,{teammate:n,onDone:e,onKill:n.status===`running`?()=>void re(n.id):void 0,onBack:M,onForeground:n.status===`running`?()=>{bt(n.id,o),e(`Viewing teammate`,{display:`system`})}:void 0},`teammate-${n.id}`);case`local_workflow`:return jn?(0,Q.jsx)(jn,{workflow:n,onDone:e,onKill:n.status===`running`&&Nn?()=>Nn(n.id,o):void 0,onSkipAgent:n.status===`running`&&Pn?e=>Pn(n.id,e,o):void 0,onRetryAgent:n.status===`running`&&Fn?e=>Fn(n.id,e,o):void 0,onBack:M},`workflow-${n.id}`):null;case`monitor_mcp`:return In?(0,Q.jsx)(In,{task:n,onKill:n.status===`running`&&$?()=>$(n.id,o):void 0,onBack:M},`monitor-mcp-${n.id}`):null;case`dream`:return(0,Q.jsx)(Yt,{task:n,onDone:()=>e(`Background tasks dialog dismissed`,{display:`system`}),onBack:M,onKill:n.status===`running`?()=>void ie(n.id):void 0},`dream-${n.id}`)}}let oe=O(b,e=>e.status===`running`),se=O(x,e=>e.status===`running`||e.status===`pending`)+O(S,e=>e.status===`running`),ce=O(C,e=>e.status===`running`),N=te([...ce>0?[(0,Q.jsxs)(d,{children:[ce,` `,ce===1?`agent`:`agents`]},`teammates`)]:[],...oe>0?[(0,Q.jsxs)(d,{children:[oe,` `,oe===1?`active shell`:`active shells`]},`shells`)]:[],...se>0?[(0,Q.jsxs)(d,{children:[se,` `,se===1?`active agent`:`active agents`]},`agents`)]:[]],e=>(0,Q.jsx)(d,{children:` · `},`separator-${e}`)),le=[(0,Q.jsx)(p,{shortcut:`↑/↓`,action:`select`},`upDown`),(0,Q.jsx)(p,{shortcut:`Enter`,action:`view`},`enter`),...D?.type===`in_process_teammate`&&D.status===`running`?[(0,Q.jsx)(p,{shortcut:`f`,action:`foreground`},`foreground`)]:[],...(D?.type===`local_bash`||D?.type===`local_agent`||D?.type===`in_process_teammate`||D?.type===`local_workflow`||D?.type===`monitor_mcp`||D?.type===`dream`||D?.type===`remote_agent`)&&D.status===`running`?[(0,Q.jsx)(p,{shortcut:`x`,action:`stop`},`kill`)]:[],...S.some(e=>e.status===`running`)?[(0,Q.jsx)(p,{shortcut:s,action:`stop all agents`},`kill-all`)]:[],(0,Q.jsx)(p,{shortcut:`←/Esc`,action:`close`},`esc`)],ue=()=>e(`Background tasks dialog dismissed`,{display:`system`});function de(e){return e.pending?(0,Q.jsxs)(d,{children:[`Press `,e.keyName,` again to exit`]}):(0,Q.jsx)(m,{children:le})}return(0,Q.jsx)(_,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:ne,children:(0,Q.jsx)(f,{title:`Background tasks`,subtitle:(0,Q.jsx)(Q.Fragment,{children:N}),onCancel:ue,color:`background`,inputGuide:de,children:E.length===0?(0,Q.jsx)(d,{dimColor:!0,children:`No tasks currently running`}):(0,Q.jsxs)(_,{flexDirection:`column`,children:[C.length>0&&(0,Q.jsxs)(_,{flexDirection:`column`,children:[(b.length>0||x.length>0||S.length>0)&&(0,Q.jsxs)(d,{dimColor:!0,children:[(0,Q.jsxs)(d,{bold:!0,children:[` `,`Agents`]}),` (`,O(C,e=>e.type!==`leader`),`)`]}),(0,Q.jsx)(_,{flexDirection:`column`,children:(0,Q.jsx)(An,{teammateTasks:C,currentSelectionId:D?.id})})]}),b.length>0&&(0,Q.jsxs)(_,{flexDirection:`column`,marginTop:+(C.length>0),children:[(C.length>0||x.length>0||S.length>0)&&(0,Q.jsxs)(d,{dimColor:!0,children:[(0,Q.jsxs)(d,{bold:!0,children:[` `,`Shells`]}),` (`,b.length,`)`]}),(0,Q.jsx)(_,{flexDirection:`column`,children:b.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===D?.id},e.id))})]}),T.length>0&&(0,Q.jsxs)(_,{flexDirection:`column`,marginTop:+(C.length>0||b.length>0),children:[(0,Q.jsxs)(d,{dimColor:!0,children:[(0,Q.jsxs)(d,{bold:!0,children:[` `,`Monitors`]}),` (`,T.length,`)`]}),(0,Q.jsx)(_,{flexDirection:`column`,children:T.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===D?.id},e.id))})]}),x.length>0&&(0,Q.jsxs)(_,{flexDirection:`column`,marginTop:+(C.length>0||b.length>0||T.length>0),children:[(0,Q.jsxs)(d,{dimColor:!0,children:[(0,Q.jsxs)(d,{bold:!0,children:[` `,`Remote agents`]}),` (`,x.length,`)`]}),(0,Q.jsx)(_,{flexDirection:`column`,children:x.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===D?.id},e.id))})]}),S.length>0&&(0,Q.jsxs)(_,{flexDirection:`column`,marginTop:+(C.length>0||b.length>0||T.length>0||x.length>0),children:[(0,Q.jsxs)(d,{dimColor:!0,children:[(0,Q.jsxs)(d,{bold:!0,children:[` `,`Local agents`]}),` (`,S.length,`)`]}),(0,Q.jsx)(_,{flexDirection:`column`,children:S.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===D?.id},e.id))})]}),w.length>0&&(0,Q.jsxs)(_,{flexDirection:`column`,marginTop:+(C.length>0||b.length>0||T.length>0||x.length>0||S.length>0),children:[(0,Q.jsxs)(d,{dimColor:!0,children:[(0,Q.jsxs)(d,{bold:!0,children:[` `,`Workflows`]}),` (`,w.length,`)`]}),(0,Q.jsx)(_,{flexDirection:`column`,children:w.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===D?.id},e.id))})]}),ee.length>0&&(0,Q.jsx)(_,{flexDirection:`column`,marginTop:+(C.length>0||b.length>0||T.length>0||x.length>0||S.length>0||w.length>0),children:(0,Q.jsx)(_,{flexDirection:`column`,children:ee.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===D?.id},e.id))})})]})})})}function kn(e){switch(e.type){case`local_bash`:return{id:e.id,type:`local_bash`,label:e.kind===`monitor`?e.description:e.command,status:e.status,task:e};case`remote_agent`:return{id:e.id,type:`remote_agent`,label:e.title,status:e.status,task:e};case`local_agent`:return{id:e.id,type:`local_agent`,label:e.description,status:e.status,task:e};case`in_process_teammate`:return{id:e.id,type:`in_process_teammate`,label:`@${e.identity.agentName}`,status:e.status,task:e};case`local_workflow`:return{id:e.id,type:`local_workflow`,label:e.summary??e.description,status:e.status,task:e};case`monitor_mcp`:return{id:e.id,type:`monitor_mcp`,label:e.description,status:e.status,task:e};case`dream`:return{id:e.id,type:`dream`,label:e.description,status:e.status,task:e}}}function X({item:e,isSelected:t}){let{columns:n}=s(),r=Math.max(30,n-26),i=Ye();return(0,Q.jsxs)(_,{flexDirection:`row`,children:[(0,Q.jsx)(d,{dimColor:i&&t,children:t?a.pointer+` `:` `}),(0,Q.jsx)(d,{color:t&&!i?`suggestion`:void 0,children:e.type===`leader`?(0,Q.jsxs)(d,{children:[`@`,pt]}):(0,Q.jsx)(qt,{task:e.task,maxActivityWidth:r})})]})}function An({teammateTasks:e,currentSelectionId:t}){let n=e.filter(e=>e.type===`leader`),r=e.filter(e=>e.type===`in_process_teammate`),i=new Map;for(let e of r){let t=e.task.identity.teamName,n=i.get(t);n?n.push(e):i.set(t,[e])}return(0,Q.jsx)(Q.Fragment,{children:[...i.entries()].map(([e,r])=>(0,Q.jsxs)(_,{flexDirection:`column`,children:[(0,Q.jsxs)(d,{dimColor:!0,children:[` `,`Team: `,e,` (`,r.length+n.length,`)`]}),n.map(n=>(0,Q.jsx)(X,{item:n,isSelected:n.id===t},`${n.id}-${e}`)),r.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===t},e.id))]},e))})}var Z,Q,jn,Mn,Nn,Pn,Fn,$,In,Ln=t((()=>{i(),Z=n(l(),1),He(),ve(),Ge(),wt(),We(),le(),de(),oe(),ke(),Ke(),ne(),mt(),$e(),Je(),g(),I(),Fe(),It(),Jt(),Zt(),en(),fn(),_n(),Q=v(),jn=(Cn(),e(bn)).WorkflowDetailDialog,Mn=(Ze(),e(Be)),Nn=Mn?.killWorkflowTask??null,Pn=Mn?.skipWorkflowAgent??null,Fn=Mn?.retryWorkflowAgent??null,$=(Xe(),e(Re))?.killMonitorMcp??null,In=(En(),e(wn)).MonitorMcpDetailDialog}));export{Mt as a,wt as c,Ot as i,St as l,Ln as n,bt as o,Nt as r,xt as s,On as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-DR8-3Aex.js";import{J as t,Q as n,Rn as r,b as i,f as a,t as o,x as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{lo as l,oo as u}from"./paths-Q2255dD7.js";import{n as d,r as f}from"./analytics-DqMQntaB.js";import{Dx as p,KT as m,cy as h,qT as g}from"./loadAgentsDir-Ci5mr0vm.js";var _=e(r(),1);d(),o(),g(),u(),h();var v=c();function y({onAccept:e}){_.useEffect(()=>{f(`tengu_bypass_permissions_mode_dialog_shown`,{})},[]);function r(t){switch(t){case`accept`:f(`tengu_bypass_permissions_mode_dialog_accept`,{}),l(`userSettings`,{skipDangerousModePermissionPrompt:!0}),e();break;case`decline`:m(1);break}}return(0,v.jsxs)(a,{title:`WARNING: Claude Code running in Bypass Permissions mode`,color:`error`,onCancel:(0,_.useCallback)(()=>{m(0)},[]),children:[(0,v.jsxs)(s,{flexDirection:`column`,gap:1,children:[(0,v.jsxs)(i,{children:[`In Bypass Permissions mode, Claude Code will not ask for your approval before running potentially dangerous commands.`,(0,v.jsx)(t,{}),`This mode should only be used in a sandboxed container/VM that has restricted internet access and can easily be restored if damaged.`]}),(0,v.jsx)(i,{children:`By proceeding, you accept all responsibility for actions taken while running in Bypass Permissions mode.`}),(0,v.jsx)(n,{url:`https://code.claude.com/docs/en/security`})]}),(0,v.jsx)(p,{options:[{label:`No, exit`,value:`decline`},{label:`Yes, I accept`,value:`accept`}],onChange:e=>r(e)})]})}export{y as BypassPermissionsModeDialog};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./ClaudeMdExternalIncludesDialog-Bz0JyaOG.js";e();export{t as ClaudeMdExternalIncludesDialog};
@@ -1 +0,0 @@
1
- import{dy as e,fy as t}from"./loadAgentsDir-Ci5mr0vm.js";t();export{e as ConsoleOAuthFlow};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-DR8-3Aex.js";import{Rn as t,b as n,f as r,t as i,x as a}from"./src-Di342QoJ.js";import{t as o}from"./jsx-runtime-D-D469L8.js";import{Dx as s,KT as c,cy as l,qT as u}from"./loadAgentsDir-Ci5mr0vm.js";var d=e(t(),1);i(),u(),l();var f=o();function p({channels:e,onAccept:t}){function i(e){switch(e){case`accept`:t();break;case`exit`:c(1);break}}return(0,f.jsxs)(r,{title:`WARNING: Loading development channels`,color:`error`,onCancel:(0,d.useCallback)(()=>{c(0)},[]),children:[(0,f.jsxs)(a,{flexDirection:`column`,gap:1,children:[(0,f.jsx)(n,{children:`--dangerously-load-development-channels is for local channel development only. Do not use this option to run channels you have downloaded off the internet.`}),(0,f.jsx)(n,{children:`Please use --channels to run a list of approved channels.`}),(0,f.jsxs)(n,{dimColor:!0,children:[`Channels:`,` `,e.map(e=>e.kind===`plugin`?`plugin:${e.name}@${e.marketplace}`:`server:${e.name}`).join(`, `)]})]}),(0,f.jsx)(s,{options:[{label:`I am using this for local development`,value:`accept`},{label:`Exit`,value:`exit`}],onChange:e=>i(e)})]})}export{p as DevChannelsDialog};
@@ -1,3 +0,0 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./figures-gfT9mM8P.js";import{F as i,Rn as a,b as o,f as s,h as c,m as l,nt as u,t as d,x as f}from"./src-Di342QoJ.js";import{t as p}from"./jsx-runtime-D-D469L8.js";import{Po as m,el as h,jo as g,sl as _}from"./paths-Q2255dD7.js";import{n as v,t as y}from"./cwd--iizewsn.js";import{T as b,x}from"./startupProfiler-DnXZaX4A.js";import{$p as S,Lw as C,Mx as w,Xw as T,Zw as E,cm as D,em as O,kx as k,om as A,sm as j}from"./loadAgentsDir-Ci5mr0vm.js";import{t as M}from"./useKeybinding-FsOnjW6T.js";import{resolve as N}from"path";function P(){let[e,t]=(0,F.useState)(null),[n,r]=(0,F.useState)(new Map),[i,a]=(0,F.useState)(!0);return(0,F.useEffect)(()=>{let e=!1;async function n(){try{let[n,i]=await Promise.all([A(),j()]);e||(t(n),r(i),a(!1))}catch{e||(t(null),r(new Map),a(!1))}}return n(),()=>{e=!0}},[]),(0,F.useMemo)(()=>{if(!e)return{stats:null,files:[],hunks:new Map,loading:i};let{stats:t,perFileStats:r}=e,a=[];for(let[e,t]of r){let r=n.get(e),i=t.isUntracked??!1,o=!t.isBinary&&!i&&!r,s=t.added+t.removed,c=!o&&!t.isBinary&&s>I;a.push({path:e,linesAdded:t.added,linesRemoved:t.removed,isBinary:t.isBinary,isLargeFile:o,isTruncated:c,isUntracked:i})}return a.sort((e,t)=>e.path.localeCompare(t.path)),{stats:t,files:a,hunks:n,loading:!1}},[e,n,i])}var F,I,L=e((()=>{F=t(a(),1),D(),I=400}));function R(e){if(!e||typeof e!=`object`)return!1;let t=e,n=typeof t.filePath==`string`,r=Array.isArray(t.structuredPatch)&&t.structuredPatch.length>0,i=t.type===`create`&&typeof t.content==`string`;return n&&(r||i)}function z(e){return`type`in e&&(e.type===`create`||e.type===`update`)}function B(e){let t=0,n=0;for(let r of e)for(let e of r.lines)e.startsWith(`+`)?t++:e.startsWith(`-`)&&n++;return{added:t,removed:n}}function V(e){if(e.type!==`user`)return``;let t=e.message.content,n=typeof t==`string`?t:``;return n.length<=30?n:n.slice(0,29)+`…`}function H(e){let t=0,n=0;for(let r of e.files.values())t+=r.linesAdded,n+=r.linesRemoved;e.stats={filesChanged:e.files.size,linesAdded:t,linesRemoved:n}}function U(e){let t=(0,W.useRef)({completedTurns:[],currentTurn:null,lastProcessedIndex:0,lastTurnIndex:0});return(0,W.useMemo)(()=>{let n=t.current;e.length<n.lastProcessedIndex&&(n.completedTurns=[],n.currentTurn=null,n.lastProcessedIndex=0,n.lastTurnIndex=0);for(let t=n.lastProcessedIndex;t<e.length;t++){let r=e[t];if(!(!r||r.type!==`user`)){if(!(r.toolUseResult||Array.isArray(r.message.content)&&r.message.content[0]?.type===`tool_result`)&&!r.isMeta)n.currentTurn&&n.currentTurn.files.size>0&&(H(n.currentTurn),n.completedTurns.push(n.currentTurn)),n.lastTurnIndex++,n.currentTurn={turnIndex:n.lastTurnIndex,userPromptPreview:V(r),timestamp:r.timestamp,files:new Map,stats:{filesChanged:0,linesAdded:0,linesRemoved:0}};else if(n.currentTurn&&r.toolUseResult){let e=r.toolUseResult;if(R(e)){let{filePath:t,structuredPatch:r}=e,i=`type`in e&&e.type===`create`,a=n.currentTurn.files.get(t);if(a||(a={filePath:t,hunks:[],isNewFile:i,linesAdded:0,linesRemoved:0},n.currentTurn.files.set(t,a)),i&&r.length===0&&z(e)){let t=e.content.split(`
2
- `),n={oldStart:0,oldLines:0,newStart:1,newLines:t.length,lines:t.map(e=>`+`+e)};a.hunks.push(n),a.linesAdded+=t.length}else{a.hunks.push(...r);let{added:e,removed:t}=B(r);a.linesAdded+=e,a.linesRemoved+=t}i&&(a.isNewFile=!0)}}}}n.lastProcessedIndex=e.length;let r=[...n.completedTurns];return n.currentTurn&&n.currentTurn.files.size>0&&(H(n.currentTurn),r.push(n.currentTurn)),r.reverse()},[e])}var W,G=e((()=>{W=t(a(),1)}));function K({filePath:e,hunks:t,isLargeFile:n,isBinary:r,isTruncated:a,isUntracked:s}){let{columns:c}=i(),{firstLine:u,fileContent:d}=(0,q.useMemo)(()=>{if(!e)return{firstLine:null,fileContent:void 0};let t=_(N(y(),e));return{firstLine:t?.split(`
3
- `)[0]??null,fileContent:t??void 0}},[e]);return s?(0,J.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,J.jsxs)(f,{children:[(0,J.jsx)(o,{bold:!0,children:e}),(0,J.jsx)(o,{dimColor:!0,children:` (untracked)`})]}),(0,J.jsx)(l,{padding:4}),(0,J.jsxs)(f,{flexDirection:`column`,children:[(0,J.jsx)(o,{dimColor:!0,italic:!0,children:`New file not yet staged.`}),(0,J.jsxs)(o,{dimColor:!0,italic:!0,children:["Run `git add ",e,"` to see line counts."]})]})]}):r?(0,J.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,J.jsx)(f,{children:(0,J.jsx)(o,{bold:!0,children:e})}),(0,J.jsx)(l,{padding:4}),(0,J.jsx)(f,{flexDirection:`column`,children:(0,J.jsx)(o,{dimColor:!0,italic:!0,children:`Binary file - cannot display diff`})})]}):n?(0,J.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,J.jsx)(f,{children:(0,J.jsx)(o,{bold:!0,children:e})}),(0,J.jsx)(l,{padding:4}),(0,J.jsx)(f,{flexDirection:`column`,children:(0,J.jsx)(o,{dimColor:!0,italic:!0,children:`Large file - diff exceeds 1 MB limit`})})]}):(0,J.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,J.jsxs)(f,{children:[(0,J.jsx)(o,{bold:!0,children:e}),a&&(0,J.jsx)(o,{dimColor:!0,children:` (truncated)`})]}),(0,J.jsx)(l,{padding:4}),(0,J.jsx)(f,{flexDirection:`column`,children:t.length===0?(0,J.jsx)(o,{dimColor:!0,children:`No diff content`}):t.map((t,n)=>(0,J.jsx)(S,{patch:t,filePath:e,firstLine:u,fileContent:d,dim:!1,width:c-2-2},n))}),a&&(0,J.jsx)(o,{dimColor:!0,italic:!0,children:`… diff truncated (exceeded 400 line limit)`})]})}var q,J,ee=e((()=>{q=t(a(),1),C(),d(),v(),h(),O(),J=p()}));function te({files:e,selectedIndex:t}){let{columns:n}=i(),{startIndex:r,endIndex:a}=(0,Y.useMemo)(()=>{if(e.length===0||e.length<=Z)return{startIndex:0,endIndex:e.length};let n=Math.max(0,t-Math.floor(Z/2)),r=n+Z;return r>e.length&&(r=e.length,n=Math.max(0,r-Z)),{startIndex:n,endIndex:r}},[e.length,t]);if(e.length===0)return(0,X.jsx)(o,{dimColor:!0,children:`No changed files`});let s=e.slice(r,a),c=r>0,l=a<e.length,u=e.length>Z,d=Math.max(20,n-16-3-4);return(0,X.jsxs)(f,{flexDirection:`column`,children:[u&&(0,X.jsx)(o,{dimColor:!0,children:c?` ↑ ${r} more ${m(r,`file`)}`:` `}),s.map((e,n)=>(0,X.jsx)(ne,{file:e,isSelected:r+n===t,maxPathWidth:d},e.path)),u&&(0,X.jsx)(o,{dimColor:!0,children:l?` ↓ ${e.length-a} more ${m(e.length-a,`file`)}`:` `})]})}function ne({file:e,isSelected:t,maxPathWidth:n}){let i=b(e.path,n),a=`${t?r.pointer+` `:` `}${i}`;return(0,X.jsxs)(f,{flexDirection:`row`,children:[(0,X.jsx)(o,{bold:t,color:t?`background`:void 0,inverse:t,children:a}),(0,X.jsx)(f,{flexGrow:1}),(0,X.jsx)(re,{file:e,isSelected:t})]})}function re({file:e,isSelected:t}){return e.isUntracked?(0,X.jsx)(o,{dimColor:!t,italic:!0,children:`untracked`}):e.isBinary?(0,X.jsx)(o,{dimColor:!t,italic:!0,children:`Binary file`}):e.isLargeFile?(0,X.jsx)(o,{dimColor:!t,italic:!0,children:`Large file modified`}):(0,X.jsxs)(o,{children:[e.linesAdded>0&&(0,X.jsxs)(o,{color:`diffAddedWord`,bold:t,children:[`+`,e.linesAdded]}),e.linesAdded>0&&e.linesRemoved>0&&` `,e.linesRemoved>0&&(0,X.jsxs)(o,{color:`diffRemovedWord`,bold:t,children:[`-`,e.linesRemoved]}),e.isTruncated&&(0,X.jsx)(o,{dimColor:!t,children:` (truncated)`})]})}var Y,X,Z,ie=e((()=>{n(),Y=t(a(),1),C(),d(),x(),g(),X=p(),Z=5}));function ae(e){let t=Array.from(e.files.values()).map(e=>({path:e.filePath,linesAdded:e.linesAdded,linesRemoved:e.linesRemoved,isBinary:!1,isLargeFile:!1,isTruncated:!1,isNewFile:e.isNewFile})).sort((e,t)=>e.path.localeCompare(t.path)),n=new Map;for(let t of e.files.values())n.set(t.filePath,t.hunks);return{stats:{filesCount:e.stats.filesChanged,linesAdded:e.stats.linesAdded,linesRemoved:e.stats.linesRemoved},files:t,hunks:n,loading:!1}}function oe({messages:e,onDone:t}){let n=P(),r=U(e),[i,a]=(0,Q.useState)(`list`),[l,d]=(0,Q.useState)(0),[p,h]=(0,Q.useState)(0),g=(0,Q.useMemo)(()=>[{type:`current`},...r.map(e=>({type:`turn`,turn:e}))],[r]),_=g[p],v=_?.type===`turn`?_.turn:null,y=(0,Q.useMemo)(()=>v?ae(v):n,[v,n]),b=y.files[l],x=(0,Q.useMemo)(()=>b&&y.hunks.get(b.path)||[],[b,y.hunks]);(0,Q.useEffect)(()=>{p>=g.length&&h(Math.max(0,g.length-1))},[g.length,p]);let S=(0,Q.useRef)(p);(0,Q.useEffect)(()=>{S.current!==p&&(d(0),S.current=p)},[p]),w(`diff-dialog`),u({"diff:previousSource":()=>{i===`detail`?a(`list`):i===`list`&&g.length>1&&h(e=>Math.max(0,e-1))},"diff:nextSource":()=>{i===`list`&&g.length>1&&h(e=>Math.min(g.length-1,e+1))},"diff:back":()=>{i===`detail`&&a(`list`)},"diff:viewDetails":()=>{i===`list`&&b&&a(`detail`)},"diff:previousFile":()=>{i===`list`&&d(e=>Math.max(0,e-1))},"diff:nextFile":()=>{i===`list`&&d(e=>Math.min(y.files.length-1,e+1))}},{context:`DiffDialog`});let C=y.stats?(0,$.jsxs)(o,{dimColor:!0,children:[y.stats.filesCount,` `,m(y.stats.filesCount,`file`),` changed`,y.stats.linesAdded>0&&(0,$.jsxs)(o,{color:`diffAddedWord`,children:[` +`,y.stats.linesAdded]}),y.stats.linesRemoved>0&&(0,$.jsxs)(o,{color:`diffRemovedWord`,children:[` -`,y.stats.linesRemoved]})]}):null,T=v?`Turn ${v.turnIndex}`:`Uncommitted changes`,D=v?v.userPromptPreview?`"${v.userPromptPreview}"`:``:`(git diff HEAD)`,O=g.length>1?(0,$.jsxs)(f,{children:[p>0&&(0,$.jsx)(o,{dimColor:!0,children:`◀ `}),g.map((e,t)=>{let n=t===p,r=e.type===`current`?`Current`:`T${e.turn.turnIndex}`;return(0,$.jsxs)(o,{dimColor:!n,bold:n,children:[t>0?` · `:``,r]},t)}),p<g.length-1&&(0,$.jsx)(o,{dimColor:!0,children:` ▶`})]}):null,k=E(`diff:dismiss`,`DiffDialog`,`esc`),A=y.loading?`Loading diff…`:v?`No file changes in this turn`:y.stats&&y.stats.filesCount>0&&y.files.length===0?`Too many files to display details`:`Working tree is clean`,j=(0,$.jsxs)(o,{children:[T,D&&(0,$.jsxs)(o,{dimColor:!0,children:[` `,D]})]});function M(){i===`detail`?a(`list`):t(`Diff dialog dismissed`,{display:`system`})}return(0,$.jsxs)(s,{title:j,onCancel:M,color:`background`,inputGuide:e=>e.pending?(0,$.jsxs)(o,{children:[`Press `,e.keyName,` again to exit`]}):i===`list`?(0,$.jsxs)(c,{children:[g.length>1&&(0,$.jsx)(o,{children:`←/→ source`}),(0,$.jsx)(o,{children:`↑/↓ select`}),(0,$.jsx)(o,{children:`Enter view`}),(0,$.jsxs)(o,{children:[k,` close`]})]}):(0,$.jsxs)(c,{children:[(0,$.jsx)(o,{children:`← back`}),(0,$.jsxs)(o,{children:[k,` close`]})]}),children:[O,C,y.files.length===0?(0,$.jsx)(f,{marginTop:1,children:(0,$.jsx)(o,{dimColor:!0,children:A})}):i===`list`?(0,$.jsx)(f,{flexDirection:`column`,marginTop:1,children:(0,$.jsx)(te,{files:y.files,selectedIndex:l})}):(0,$.jsx)(f,{flexDirection:`column`,marginTop:1,children:(0,$.jsx)(K,{filePath:b?.path||``,hunks:x,isLargeFile:b?.isLargeFile,isBinary:b?.isBinary,isTruncated:b?.isTruncated,isUntracked:b?.isUntracked})})]})}var Q,$;e((()=>{Q=t(a(),1),k(),L(),G(),d(),M(),T(),g(),ee(),ie(),$=p()}))();export{oe as DiffDialog};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./Doctor-CE_jL9jC.js";e();export{t as Doctor};
@@ -1,3 +0,0 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,s as r}from"./envUtils-BWeoiL4Y.js";import{n as i,t as a}from"./figures-gfT9mM8P.js";import{Rn as o,b as s,nt as c,p as l,t as u,x as d}from"./src-Di342QoJ.js";import{t as f}from"./jsx-runtime-D-D469L8.js";import{cn as p,ot as m}from"./state-sIHsFpDu.js";import{Dr as h,Ka as ee,Po as g,Pr as _,Ro as v,Vo as y,al as b,cr as te,dr as x,el as S,jo as C,oo as w}from"./paths-Q2255dD7.js";import{Bb as ne,Hb as re,Jm as T,Km as ie,MS as E,NA as ae,PA as D,Qf as O,Uc as k,Vb as A,Wc as j,Xf as oe,Xm as se,Ym as ce,Zf as le,_T as M,aT as N,al as P,gT as F,hT as I,hk as L,iA as R,iT as z,il as B,jS as V,nT as H,qm as U,rT as W,tA as G,vT as ue,vk as de,xk as fe,yT as pe,yk as me,zb as he}from"./loadAgentsDir-Ci5mr0vm.js";import{t as ge}from"./useKeybinding-FsOnjW6T.js";import{l as _e,u as ve}from"./referral-ByevBJrE.js";import{a as K,i as ye}from"./xdg-CBxMmQux.js";import{n as be,t as xe}from"./McpParsingWarnings-DZkzoeZf.js";import{n as Se,t as Ce}from"./PressEnterToContinue-BdA9zDGs.js";import{n as we,t as Te}from"./ValidationErrorsList-1k1qbsRo.js";import{n as Ee,t as De}from"./useSettingsErrors-B2JGz1s8.js";import{n as Oe,t as ke}from"./shadowedRuleDetection-DesT0yKM.js";import{n as Ae,r as je,t as q}from"./statusNoticeHelpers-DVZSSXeK.js";import{join as J}from"path";function Me(){if(!N())return null;let e=H();if(e.length===0)return null;let t=e.filter(e=>e.severity===`error`),n=e.filter(e=>e.severity===`warning`);return(0,Y.jsxs)(d,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,Y.jsx)(s,{bold:!0,color:t.length>0?`error`:`warning`,children:`Keybinding Configuration Issues`}),(0,Y.jsxs)(d,{children:[(0,Y.jsx)(s,{dimColor:!0,children:`Location: `}),(0,Y.jsx)(s,{dimColor:!0,children:W()})]}),(0,Y.jsxs)(d,{marginLeft:1,flexDirection:`column`,marginTop:1,children:[t.map((e,t)=>(0,Y.jsxs)(d,{flexDirection:`column`,children:[(0,Y.jsxs)(d,{children:[(0,Y.jsx)(s,{dimColor:!0,children:`└ `}),(0,Y.jsx)(s,{color:`error`,children:`[Error]`}),(0,Y.jsxs)(s,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,Y.jsx)(d,{marginLeft:3,children:(0,Y.jsxs)(s,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`error-${t}`)),n.map((e,t)=>(0,Y.jsxs)(d,{flexDirection:`column`,children:[(0,Y.jsxs)(d,{children:[(0,Y.jsx)(s,{dimColor:!0,children:`└ `}),(0,Y.jsx)(s,{color:`warning`,children:`[Warning]`}),(0,Y.jsxs)(s,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,Y.jsx)(d,{marginLeft:3,children:(0,Y.jsxs)(s,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`warning-${t}`))]})]})}var Y,Ne=e((()=>{o(),u(),z(),Y=f()}));function Pe(){if(!G.isSupportedPlatform()||!G.isSandboxEnabledInSettings())return null;let e=G.checkDependencies(),t=e.errors.length>0,n=e.warnings.length>0;return!t&&!n?null:(0,X.jsxs)(d,{flexDirection:`column`,children:[(0,X.jsx)(s,{bold:!0,children:`Sandbox`}),(0,X.jsxs)(s,{children:[`└ Status: `,(0,X.jsx)(s,{color:t?`error`:`warning`,children:t?`Missing dependencies`:`Available (with warnings)`})]}),e.errors.map((e,t)=>(0,X.jsxs)(s,{color:`error`,children:[`└ `,e]},t)),e.warnings.map((e,t)=>(0,X.jsxs)(s,{color:`warning`,children:[`└ `,e]},t)),t&&(0,X.jsx)(s,{dimColor:!0,children:`└ Run /sandbox for install instructions`})]})}var X,Fe=e((()=>{o(),u(),R(),X=f()}));async function Ie(){let e=de(await me());if(e.length===0)return null;let t=e.sort((e,t)=>t.content.length-e.content.length).map(e=>`${e.path}: ${e.content.length.toLocaleString()} chars`);return{type:`claudemd_files`,severity:`warning`,message:e.length===1?`Large CLAUDE.md file detected (${e[0].content.length.toLocaleString()} chars > ${L.toLocaleString()})`:`${e.length} large CLAUDE.md files detected (each > ${L.toLocaleString()} chars)`,details:t,currentValue:e.length,threshold:L}}async function Le(e){if(!e)return null;let t=Ae(e);if(t<=15e3)return null;let n=e.activeAgents.filter(e=>e.source!==`built-in`).map(e=>{let t=`${e.agentType}: ${e.whenToUse}`;return{name:e.agentType,tokens:j(t)}}).sort((e,t)=>t.tokens-e.tokens),r=n.slice(0,5).map(e=>`${e.name}: ~${e.tokens.toLocaleString()} tokens`);return n.length>5&&r.push(`(${n.length-5} more custom agents)`),{type:`agent_descriptions`,severity:`warning`,message:`Large agent descriptions (~${t.toLocaleString()} tokens > ${q.toLocaleString()})`,details:r,currentValue:t,threshold:q}}async function Re(e,t,n){let r=e.filter(e=>e.isMcp);if(r.length===0)return null;try{let{mcpToolTokens:r,mcpToolDetails:i}=await B(e,t,n,h());if(r<=Z)return null;let a=new Map;for(let e of i){let t=e.name.split(`__`)[1]||`unknown`,n=a.get(t)||{count:0,tokens:0};a.set(t,{count:n.count+1,tokens:n.tokens+e.tokens})}let o=Array.from(a.entries()).sort((e,t)=>t[1].tokens-e[1].tokens),s=o.slice(0,5).map(([e,t])=>`${e}: ${t.count} tools (~${t.tokens.toLocaleString()} tokens)`);return o.length>5&&s.push(`(${o.length-5} more servers)`),{type:`mcp_tools`,severity:`warning`,message:`Large MCP tools context (~${r.toLocaleString()} tokens > ${Z.toLocaleString()})`,details:s,currentValue:r,threshold:Z}}catch{let e=r.reduce((e,t)=>e+j(((t.name?.length||0)+t.description.length).toString()),0);return e<=Z?null:{type:`mcp_tools`,severity:`warning`,message:`Large MCP tools context (~${e.toLocaleString()} tokens estimated > ${Z.toLocaleString()})`,details:[`${r.length} MCP tools detected (token count estimated)`],currentValue:e,threshold:Z}}}async function ze(e){let t=ke(await e(),{sandboxAutoAllowEnabled:G.isSandboxingEnabled()&&G.isAutoAllowBashIfSandboxedEnabled()});if(t.length===0)return null;let n=t.flatMap(e=>[`${y(e.rule.ruleValue)}: ${e.reason}`,` Fix: ${e.fix}`]);return{type:`unreachable_rules`,severity:`warning`,message:`${t.length} ${g(t.length,`unreachable permission rule`)} detected`,details:n,currentValue:t.length,threshold:0}}async function Be(e,t,n){let[r,i,a,o]=await Promise.all([Ie(),Le(t),Re(e,n,t),ze(n)]);return{claudeMdWarning:r,agentWarning:i,mcpWarning:a,unreachableRulesWarning:o}}var Z,Ve=e((()=>{k(),P(),fe(),_(),v(),Oe(),R(),je(),C(),Z=25e3}));function He({promise:e}){let t=(0,Q.use)(e);return t.latest?(0,$.jsxs)($.Fragment,{children:[t.stable&&(0,$.jsxs)(s,{children:[`└ Stable version: `,t.stable]}),(0,$.jsxs)(s,{children:[`└ Latest version: `,t.latest]})]}):(0,$.jsx)(s,{dimColor:!0,children:`└ Failed to fetch versions`})}function Ue({onDone:e}){let t=E(e=>e.agentDefinitions),r=E(e=>e.mcp.tools),i=E(e=>e.toolPermissionContext),o=E(e=>e.plugins.errors);ve();let u=(0,Q.useMemo)(()=>r||[],[r]),[f,p]=(0,Q.useState)(null),[h,g]=(0,Q.useState)(null),[_,v]=(0,Q.useState)(null),[y,x]=(0,Q.useState)(null),S=Ee(),C=(0,Q.useMemo)(()=>I().then(e=>(e.installationType===`native`?M:ue)().catch(()=>({latest:null,stable:null}))),[]),w=ee()?.autoUpdatesChannel??`latest`,T=S.filter(e=>e.mcpErrorMetadata===void 0),D=(0,Q.useMemo)(()=>[{name:`BASH_MAX_OUTPUT_LENGTH`,default:ie,upperLimit:U},{name:`TASK_MAX_OUTPUT_LENGTH`,default:oe,upperLimit:le},{name:`CLAUDE_CODE_MAX_OUTPUT_TOKENS`,...te(`claude-opus-4-7`)}].map(e=>{let t=process.env[e.name],n=se(e.name,t,e.default,e.upperLimit);return{name:e.name,...n}}).filter(e=>e.status!==`valid`),[]);(0,Q.useEffect)(()=>{I().then(p),(async()=>{let e=J(n(),`agents`),r=J(m(),`.claude`,`agents`),{activeAgents:a,allAgents:o,failedFiles:s}=t,[c,l]=await Promise.all([b(e),b(r)]);if(g({activeAgents:a.map(e=>({agentType:e.agentType,source:e.source})),userAgentsDir:e,projectAgentsDir:r,userDirExists:c,projectDirExists:l,failedFiles:s}),v(await Be(u,{activeAgents:a,allAgents:o,failedFiles:s},async()=>i)),re()){let e=J(ye(),`claude`,`locks`),t=he(e);x({enabled:!0,locks:ne(e),locksDir:e,staleLocksCleaned:t})}else x({enabled:!1,locks:[],locksDir:``,staleLocksCleaned:0})})()},[i,u,t]);let O=(0,Q.useCallback)(()=>{e(`Claude Code diagnostics dismissed`,{display:`system`})},[e]);return c({"confirm:yes":O,"confirm:no":O},{context:`Confirmation`}),f?(0,$.jsxs)(l,{children:[(0,$.jsxs)(d,{flexDirection:`column`,children:[(0,$.jsx)(s,{bold:!0,children:`Diagnostics`}),(0,$.jsxs)(s,{children:[`└ Currently running: `,f.installationType,` (`,f.version,`)`]}),f.packageManager&&(0,$.jsxs)(s,{children:[`└ Package manager: `,f.packageManager]}),(0,$.jsxs)(s,{children:[`└ Path: `,f.installationPath]}),(0,$.jsxs)(s,{children:[`└ Invoked: `,f.invokedBinary]}),(0,$.jsxs)(s,{children:[`└ Config install method: `,f.configInstallMethod]}),(0,$.jsxs)(s,{children:[`└ Search: `,f.ripgrepStatus.working?`OK`:`Not working`,` (`,f.ripgrepStatus.mode===`embedded`?`bundled`:f.ripgrepStatus.mode===`builtin`?`vendor`:f.ripgrepStatus.systemPath||`system`,`)`]}),f.recommendation&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(s,{}),(0,$.jsxs)(s,{color:`warning`,children:[`Recommendation: `,f.recommendation.split(`
2
- `)[0]]}),(0,$.jsx)(s,{dimColor:!0,children:f.recommendation.split(`
3
- `)[1]})]}),f.multipleInstallations.length>1&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(s,{}),(0,$.jsx)(s,{color:`warning`,children:`Warning: Multiple installations found`}),f.multipleInstallations.map((e,t)=>(0,$.jsxs)(s,{children:[`└ `,e.type,` at `,e.path]},t))]}),f.warnings.length>0&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(s,{}),f.warnings.map((e,t)=>(0,$.jsxs)(d,{flexDirection:`column`,children:[(0,$.jsxs)(s,{color:`warning`,children:[`Warning: `,e.issue]}),(0,$.jsxs)(s,{children:[`Fix: `,e.fix]})]},t))]}),T.length>0&&(0,$.jsxs)(d,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,$.jsx)(s,{bold:!0,children:`Invalid Settings`}),(0,$.jsx)(Te,{errors:T})]})]}),(0,$.jsxs)(d,{flexDirection:`column`,children:[(0,$.jsx)(s,{bold:!0,children:`Updates`}),(0,$.jsxs)(s,{children:[`└ Auto-updates: `,f.packageManager?`Managed by package manager`:f.autoUpdates]}),f.hasUpdatePermissions!==null&&(0,$.jsxs)(s,{children:[`└ Update permissions: `,f.hasUpdatePermissions?`Yes`:`No (requires sudo)`]}),(0,$.jsxs)(s,{children:[`└ Auto-update channel: `,w]}),(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(He,{promise:C})})]}),(0,$.jsx)(Pe,{}),(0,$.jsx)(xe,{}),(0,$.jsx)(Me,{}),D.length>0&&(0,$.jsxs)(d,{flexDirection:`column`,children:[(0,$.jsx)(s,{bold:!0,children:`Environment Variables`}),D.map((e,t)=>(0,$.jsxs)(s,{children:[`└ `,e.name,`:`,` `,(0,$.jsx)(s,{color:e.status===`capped`?`warning`:`error`,children:e.message})]},t))]}),y?.enabled&&(0,$.jsxs)(d,{flexDirection:`column`,children:[(0,$.jsx)(s,{bold:!0,children:`Version Locks`}),y.staleLocksCleaned>0&&(0,$.jsxs)(s,{dimColor:!0,children:[`└ Cleaned `,y.staleLocksCleaned,` stale lock(s)`]}),y.locks.length===0?(0,$.jsx)(s,{dimColor:!0,children:`└ No active version locks`}):y.locks.map((e,t)=>(0,$.jsxs)(s,{children:[`└ `,e.version,`: PID `,e.pid,` `,e.isProcessRunning?(0,$.jsx)(s,{children:`(running)`}):(0,$.jsx)(s,{color:`warning`,children:`(stale)`})]},t))]}),h?.failedFiles&&h.failedFiles.length>0&&(0,$.jsxs)(d,{flexDirection:`column`,children:[(0,$.jsx)(s,{bold:!0,color:`error`,children:`Agent Parse Errors`}),(0,$.jsxs)(s,{color:`error`,children:[`└ Failed to parse `,h.failedFiles.length,` agent file(s):`]}),h.failedFiles.map((e,t)=>(0,$.jsxs)(s,{dimColor:!0,children:[` `,`└ `,e.path,`: `,e.error]},t))]}),o.length>0&&(0,$.jsxs)(d,{flexDirection:`column`,children:[(0,$.jsx)(s,{bold:!0,color:`error`,children:`Plugin Errors`}),(0,$.jsxs)(s,{color:`error`,children:[`└ `,o.length,` plugin error(s) detected:`]}),o.map((e,t)=>(0,$.jsxs)(s,{dimColor:!0,children:[` `,`└ `,e.source||`unknown`,`plugin`in e&&e.plugin?` [${e.plugin}]`:``,`: `,ae(e)]},t))]}),_?.unreachableRulesWarning&&(0,$.jsxs)(d,{flexDirection:`column`,children:[(0,$.jsx)(s,{bold:!0,color:`warning`,children:`Unreachable Permission Rules`}),(0,$.jsxs)(s,{children:[`└`,` `,(0,$.jsxs)(s,{color:`warning`,children:[a.warning,` `,_.unreachableRulesWarning.message]})]}),_.unreachableRulesWarning.details.map((e,t)=>(0,$.jsxs)(s,{dimColor:!0,children:[` `,`└ `,e]},t))]}),_&&(_.claudeMdWarning||_.agentWarning||_.mcpWarning)&&(0,$.jsxs)(d,{flexDirection:`column`,children:[(0,$.jsx)(s,{bold:!0,children:`Context Usage Warnings`}),_.claudeMdWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(s,{children:[`└`,` `,(0,$.jsxs)(s,{color:`warning`,children:[a.warning,` `,_.claudeMdWarning.message]})]}),(0,$.jsxs)(s,{children:[` `,`└ Files:`]}),_.claudeMdWarning.details.map((e,t)=>(0,$.jsxs)(s,{dimColor:!0,children:[` `,`└ `,e]},t))]}),_.agentWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(s,{children:[`└`,` `,(0,$.jsxs)(s,{color:`warning`,children:[a.warning,` `,_.agentWarning.message]})]}),(0,$.jsxs)(s,{children:[` `,`└ Top contributors:`]}),_.agentWarning.details.map((e,t)=>(0,$.jsxs)(s,{dimColor:!0,children:[` `,`└ `,e]},t))]}),_.mcpWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(s,{children:[`└`,` `,(0,$.jsxs)(s,{color:`warning`,children:[a.warning,` `,_.mcpWarning.message]})]}),(0,$.jsxs)(s,{children:[` `,`└ MCP servers:`]}),_.mcpWarning.details.map((e,t)=>(0,$.jsxs)(s,{dimColor:!0,children:[` `,`└ `,e]},t))]})]}),(0,$.jsx)(d,{children:(0,$.jsx)(Ce,{})})]}):(0,$.jsx)(l,{children:(0,$.jsx)(s,{dimColor:!0,children:`Checking installation status…`})})}var Q,$,We=e((()=>{i(),Q=t(o(),1),Ne(),be(),x(),r(),p(),u(),Se(),Fe(),we(),De(),_e(),ge(),V(),D(),pe(),Ve(),F(),ce(),S(),A(),w(),T(),O(),K(),$=f()}));export{We as n,Ue as t};
@@ -1,2 +0,0 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./axios-DhfaybwJ.js";import{F as i,Rn as a,b as o,f as s,g as c,h as l,t as u,tt as d,x as f,xt as ee}from"./src-Di342QoJ.js";import{t as p}from"./jsx-runtime-D-D469L8.js";import{cn as m,q as h}from"./state-sIHsFpDu.js";import{F as te,M as g,Pt as _,St as v,bt as y,on as b,wt as x}from"./paths-Q2255dD7.js";import{E as S,d as C,s as w,w as T}from"./debug-UI3T040K.js";import{n as E,r as ne}from"./analytics-DqMQntaB.js";import{c as D,f as re,v as O}from"./git-CN3qtTb_.js";import{a as k,n as A}from"./env-chR0gV31.js";import{d as j,f as ie,i as ae,o as oe,s as M}from"./log-CzsijfHZ.js";import{Ar as se,CO as ce,Do as N,Hr as P,JS as F,Ko as I,Lo as L,Lw as R,Nx as z,Px as B,Tr as V,YS as H,jO as U,nt as W,sr as G,tt as le,wO as ue}from"./loadAgentsDir-Ci5mr0vm.js";import{X as de}from"./rcDebugLog-BbPkkigY.js";import{n as fe,t as pe}from"./browser-fLRXxIsQ.js";import{t as me}from"./useKeybinding-FsOnjW6T.js";import{readFile as he,stat as ge}from"fs/promises";function K(e){let t=e;return t=t.replace(/"(sk-ant[^\s"']{24,})"/g,`"[REDACTED_API_KEY]"`),t=t.replace(/(?<![A-Za-z0-9"'])(sk-ant-?[A-Za-z0-9_-]{10,})(?![A-Za-z0-9"'])/g,`[REDACTED_API_KEY]`),t=t.replace(/AWS key: "(AWS[A-Z0-9]{20,})"/g,`AWS key: "[REDACTED_AWS_KEY]"`),t=t.replace(/(AKIA[A-Z0-9]{16})/g,`[REDACTED_AWS_KEY]`),t=t.replace(/(?<![A-Za-z0-9])(AIza[A-Za-z0-9_-]{35})(?![A-Za-z0-9])/g,`[REDACTED_GCP_KEY]`),t=t.replace(/(?<![A-Za-z0-9])([a-z0-9-]+@[a-z0-9-]+\.iam\.gserviceaccount\.com)(?![A-Za-z0-9])/g,`[REDACTED_GCP_SERVICE_ACCOUNT]`),t=t.replace(/(["']?x-api-key["']?\s*[:=]\s*["']?)[^"',\s)}\]]+/gi,`$1[REDACTED_API_KEY]`),t=t.replace(/(["']?authorization["']?\s*[:=]\s*["']?(bearer\s+)?)[^"',\s)}\]]+/gi,`$1[REDACTED_TOKEN]`),t=t.replace(/(AWS[_-][A-Za-z0-9_]+\s*[=:]\s*)["']?[^"',\s)}\]]+["']?/gi,`$1[REDACTED_AWS_VALUE]`),t=t.replace(/(GOOGLE[_-][A-Za-z0-9_]+\s*[=:]\s*)["']?[^"',\s)}\]]+["']?/gi,`$1[REDACTED_GCP_VALUE]`),t=t.replace(/((API[-_]?KEY|TOKEN|SECRET|PASSWORD)\s*[=:]\s*)["']?[^"',\s)}\]]+["']?/gi,`$1[REDACTED]`),t}function q(){return ae().map(e=>{let t={...e};return t&&typeof t.error==`string`&&(t.error=K(t.error)),t})}async function _e(){try{let e=V(),{size:t}=await ge(e);return t>52428800?(C(`Skipping raw transcript read: file too large (${t} bytes)`,{level:`warn`}),null):await he(e,`utf-8`)}catch{return null}}function ve({abortSignal:e,messages:t,initialDescription:n,onDone:r,backgroundTasks:a={}}){let[u,p]=(0,X.useState)(`userInput`),[m,g]=(0,X.useState)(0),[_,v]=(0,X.useState)(n??``),[y,b]=(0,X.useState)(null),[x,S]=(0,X.useState)(null),[C,w]=(0,X.useState)({isGit:!1,gitState:null}),[T,E]=(0,X.useState)(null),O=i().columns-4;(0,X.useEffect)(()=>{async function e(){let e=await re(),t=null;e&&(t=await D()),w({isGit:e,gitState:t})}e()},[]);let k=(0,X.useCallback)(async()=>{p(`submitting`),S(null),b(null);let n=q(),r=N(t)?.requestId??null,[i,o]=await Promise.all([P(),_e()]),s=G(a),c={...i,...s},l={latestAssistantMessageId:r,message_count:t.length,datetime:new Date().toISOString(),description:_,platform:A.platform,gitRepo:C.isGit,terminal:A.terminal,version:`2.6.0`,transcript:I(t),errors:n,lastApiRequest:h(),...Object.keys(c).length>0&&{subagentTranscripts:c},...o&&{rawTranscriptJsonl:o}},[u,d]=await Promise.all([xe(l,e),be(_,e)]);E(d),u.success?(u.feedbackId&&(b(u.feedbackId),ne(`tengu_bug_report_submitted`,{feedback_id:u.feedbackId,last_assistant_message_id:r}),te(`tengu_bug_report_description`,{feedback_id:u.feedbackId,description:K(_)})),p(`done`)):(u.isZdrOrg?S(`Feedback collection is not available for organizations with custom data retention policies.`):S(`Could not submit feedback. Please try again later.`),p(`userInput`))},[_,C.isGit,t]),j=(0,X.useCallback)(()=>{if(u===`done`){r(x?`Error submitting feedback / bug report`:`Feedback / bug report submitted`,{display:`system`});return}r(`Feedback / bug report cancelled`,{display:`system`})},[u,x,r]);return d(`confirm:no`,j,{context:`Settings`,isActive:u===`userInput`}),ee((e,t)=>{if(u===`done`){t.return&&T&&fe(ye(y??``,T,_,q())),r(x?`Error submitting feedback / bug report`:`Feedback / bug report submitted`,{display:`system`});return}if(x&&u!==`userInput`){r(`Error submitting feedback / bug report`,{display:`system`});return}u===`consent`&&(t.return||e===` `)&&k()}),(0,Z.jsxs)(s,{title:`Submit Feedback / Bug Report`,onCancel:j,isCancelActive:u!==`userInput`,inputGuide:e=>e.pending?(0,Z.jsxs)(o,{children:[`Press `,e.keyName,` again to exit`]}):u===`userInput`?(0,Z.jsxs)(l,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`continue`}),(0,Z.jsx)(F,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}):u===`consent`?(0,Z.jsxs)(l,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`submit`}),(0,Z.jsx)(F,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}):null,children:[u===`userInput`&&(0,Z.jsxs)(f,{flexDirection:`column`,gap:1,children:[(0,Z.jsx)(o,{children:`Describe the issue below:`}),(0,Z.jsx)(z,{value:_,onChange:e=>{v(e),x&&S(null)},columns:O,onSubmit:()=>p(`consent`),onExitMessage:()=>r(`Feedback cancelled`,{display:`system`}),cursorOffset:m,onChangeCursorOffset:g,showCursor:!0}),x&&(0,Z.jsxs)(f,{flexDirection:`column`,gap:1,children:[(0,Z.jsx)(o,{color:`error`,children:x}),(0,Z.jsx)(o,{dimColor:!0,children:`Edit and press Enter to retry, or Esc to cancel`})]})]}),u===`consent`&&(0,Z.jsxs)(f,{flexDirection:`column`,children:[(0,Z.jsx)(o,{children:`This report will include:`}),(0,Z.jsxs)(f,{marginLeft:2,flexDirection:`column`,children:[(0,Z.jsxs)(o,{children:[`- Your feedback / bug description: `,(0,Z.jsx)(o,{dimColor:!0,children:_})]}),(0,Z.jsxs)(o,{children:[`- Environment info:`,` `,(0,Z.jsxs)(o,{dimColor:!0,children:[A.platform,`, `,A.terminal,`, v`,`2.6.0`]})]}),C.gitState&&(0,Z.jsxs)(o,{children:[`- Git repo metadata:`,` `,(0,Z.jsxs)(o,{dimColor:!0,children:[C.gitState.branchName,C.gitState.commitHash?`, ${C.gitState.commitHash.slice(0,7)}`:``,C.gitState.remoteUrl?` @ ${C.gitState.remoteUrl}`:``,!C.gitState.isHeadOnRemote&&`, not synced`,!C.gitState.isClean&&`, has local changes`]})]}),(0,Z.jsx)(o,{children:`- Current session transcript`})]}),(0,Z.jsx)(f,{marginTop:1,children:(0,Z.jsx)(o,{wrap:`wrap`,dimColor:!0,children:`We will use your feedback to debug related issues or to improve Claude Code's functionality (eg. to reduce the risk of bugs occurring in the future).`})}),(0,Z.jsx)(f,{marginTop:1,children:(0,Z.jsxs)(o,{children:[`Press `,(0,Z.jsx)(o,{bold:!0,children:`Enter`}),` to confirm and submit.`]})})]}),u===`submitting`&&(0,Z.jsx)(f,{flexDirection:`row`,gap:1,children:(0,Z.jsx)(o,{children:`Submitting report…`})}),u===`done`&&(0,Z.jsxs)(f,{flexDirection:`column`,children:[x?(0,Z.jsx)(o,{color:`error`,children:x}):(0,Z.jsx)(o,{color:`success`,children:`Thank you for your report!`}),y&&(0,Z.jsxs)(o,{dimColor:!0,children:[`Feedback ID: `,y]}),(0,Z.jsxs)(f,{marginTop:1,children:[(0,Z.jsx)(o,{children:`Press `}),(0,Z.jsx)(o,{bold:!0,children:`Enter `}),(0,Z.jsx)(o,{children:`to open your browser and draft a GitHub issue, or any other key to close.`})]})]})]})}function ye(e,t,n,r){let i=K(t),a=`**Bug Description**\n${K(n)}\n\n**Environment Info**\n- Platform: ${A.platform}\n- Terminal: ${A.terminal}\n- Version: 2.6.0\n- Feedback ID: ${e}\n\n**Errors**\n\`\`\`json\n`,o=S(r),s=`${$}/new?title=${encodeURIComponent(i)}&labels=user-reported,bug&body=`,c=encodeURIComponent(a),l=encodeURIComponent(o),u=Q-s.length-c.length-15-46;if(u<=0){let e=Q-s.length-9-46-50,t=a+o+"\n```\n",n=encodeURIComponent(t);if(n.length>e){n=n.slice(0,e);let t=n.lastIndexOf(`%`);t>=n.length-2&&(n=n.slice(0,t))}return s+n+`%E2%80%A6%0A**Note%3A**%20Content%20was%20truncated.%0A`}if(l.length<=u)return s+c+l+`%0A%60%60%60%0A`;let d=l.slice(0,u-9-50),f=d.lastIndexOf(`%`);return f>=d.length-2&&(d=d.slice(0,f)),s+c+d+`%E2%80%A6%0A%60%60%60%0A%0A**Note%3A**%20Content%20was%20truncated.%0A`}async function be(e,t){try{let n=(await W({systemPrompt:de([`Generate a concise, technical issue title (max 80 chars) for a public GitHub issue based on this bug report for Claude Code.`,`Claude Code is an agentic coding CLI based on the Anthropic API.`,`The title should:`,`- Include the type of issue [Bug] or [Feature Request] as the first thing in the title`,`- Be concise, specific and descriptive of the actual problem`,`- Use technical terminology appropriate for a software issue`,`- For error messages, extract the key error (e.g., "Missing Tool Result Block" rather than the full message)`,`- Be direct and clear for developers to understand the problem`,`- If you cannot determine a clear issue, use "Bug Report: [brief description]"`,`- Any LLM API errors are from the Anthropic API, not from any other model provider`,`Your response will be directly used as the title of the Github issue, and as such should not contain any other commentary or explaination`,`Examples of good titles include: "[Bug] Auto-Compact triggers to soon", "[Bug] Anthropic API Error: Missing Tool Result Block", "[Bug] Error: Invalid Model Name for Opus"`]),userPrompt:e,signal:t,options:{hasAppendSystemPrompt:!1,toolChoice:void 0,isNonInteractiveSession:!1,agents:[],querySource:`feedback`,mcpTools:[]}}))?.message?.content?.[0],r=n?.type===`text`?n.text:`Bug Report`;return ue(r)?J(e):r}catch(t){return M(t),J(e)}}function J(e){let t=e.split(`
2
- `)[0]||``;if(t.length<=60&&t.length>5)return t;let n=t.slice(0,60);if(t.length>60){let e=n.lastIndexOf(` `);e>30&&(n=n.slice(0,e)),n+=`...`}return n.length<10?`Bug Report`:n}function Y(e){if(e instanceof Error){let t=Error(K(e.message));e.stack&&(t.stack=K(e.stack)),M(t)}else{let t=K(String(e));M(Error(t))}}async function xe(e,t){if(ie())return{success:!1};try{await _();let r=y();if(r.error)return{success:!1};let i={"Content-Type":`application/json`,"User-Agent":v(),...r.headers},a=await n.post(`https://api.anthropic.com/api/claude_cli_feedback`,{content:S(e)},{headers:i,timeout:3e4,signal:t});if(a.status===200){let e=a.data;return e?.feedback_id?{success:!0,feedbackId:e.feedback_id}:(Y(Error(`Failed to submit feedback: request did not return feedback_id`)),{success:!1})}return Y(Error(`Failed to submit feedback:`+a.status)),{success:!1}}catch(e){if(n.isCancel(e))return{success:!1};if(n.isAxiosError(e)&&e.response?.status===403){let t=e.response.data;if(t?.error?.type===`permission_error`&&t?.error?.message?.includes(`Custom data retention settings`))return Y(Error(`Cannot submit feedback because custom data retention settings are enabled`)),{success:!1,isZdrOrg:!0}}return Y(e),{success:!1}}}var X,Z,Q,$,Se=e((()=>{r(),a(),X=t(a(),1),m(),g(),E(),L(),R(),u(),me(),le(),ce(),b(),pe(),w(),k(),O(),x(),oe(),j(),se(),T(),U(),H(),B(),Z=p(),Q=7250,$=process.env.USER_TYPE===`ant`?`https://github.com/anthropics/claude-cli-internal/issues`:`https://github.com/anthropics/claude-code/issues`}));export{Se as n,K as r,ve as t};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./Grove-CKVpREDU.js";e();export{t as GroveDialog};
@@ -1 +0,0 @@
1
- import{a as e,n as t,o as n}from"./chunk-DR8-3Aex.js";import{B as r,F as i,L as a,z as o}from"./server-DzOdtq8A.js";import{Rn as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{Ct as l,cn as u,y as d}from"./state-sIHsFpDu.js";import{El as f,Ml as ee,S as p,Tl as m,_ as h,jl as g,ls as _,ss as v}from"./paths-Q2255dD7.js";import{E as y,L as b,V as x,d as te,s as S,w as C}from"./debug-UI3T040K.js";import{n as ne,r as w}from"./analytics-DqMQntaB.js";import{c as T,l as E,o as re}from"./log-CzsijfHZ.js";import{Cx as D,LC as ie,MS as O,NS as ae,OS as oe,PS as se,Sx as k,Tx as A,UC as ce,XC as le,aC as ue,aw as j,bx as M,cO as de,gw as fe,gx as N,hO as pe,hw as me,iC as he,jS as ge,kS as _e,lw as P,mw as F,nw as I,rw as ve,tw as ye,uw as L,vw as be,vx as R,yx as z}from"./loadAgentsDir-Ci5mr0vm.js";import{o as xe,s as Se}from"./localSearch-Vpn6W5aY.js";import{c as Ce,i as we,l as Te,o as Ee,r as De,s as Oe,t as ke}from"./channelNotification-l3EXKDNB.js";import{basename as Ae}from"path";function je(){return h(`tengu_harbor_permissions`,!0)}function B(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);t>>>=0;let n=``;for(let e=0;e<5;e++)n+=V[t%25],t=Math.floor(t/25);return n}function Me(e){let t=B(e);for(let n=0;n<10;n++){if(!H.some(e=>t.includes(e)))return t;t=B(`${e}:${n}`)}return t}function Ne(e){try{let t=y(e);return t.length>200?t.slice(0,200)+`…`:t}catch{return`(unserializable)`}}function Pe(e,t){return e.filter(e=>e.type===`connected`&&t(e.name)&&!!e.capabilities?.experimental?.[`claude/channel`]&&!!e.capabilities?.experimental?.[`claude/channel/permission`])}function Fe(){let e=new Map;return{onResponse(t,n){let r=t.toLowerCase();return e.set(r,n),()=>{e.delete(r)}},resolve(t,n,r){let i=t.toLowerCase(),a=e.get(i);return a?(e.delete(i),a({behavior:n,fromServer:r}),!0):!1}}}var V,H,U=t((()=>{C(),p(),V=`abcdefghijkmnopqrstuvwxyz`,H=[`fuck`,`shit`,`cunt`,`cock`,`dick`,`twat`,`piss`,`crap`,`bitch`,`whore`,`ass`,`tit`,`cum`,`fag`,`dyke`,`nig`,`kike`,`rape`,`nazi`,`damn`,`poo`,`pee`,`wank`,`anus`]}));function W(e){let t=`plugin`in e?e.plugin:`no-plugin`;return`${e.type}:${e.source}:${t}`}function G(e,t){t.length!==0&&e(e=>{let n=new Set(e.plugins.errors.map(e=>W(e))),r=t.filter(e=>!n.has(W(e)));return r.length===0?e:{...e,plugins:{...e.plugins,errors:[...e.plugins.errors,...r]}}})}function Ie(e,t=!1){let n=ae(),r=O(e=>e.authVersion),s=O(e=>e.mcp.pluginReconnectKey),c=se(),u=(0,K.useRef)(new Map),p=(0,K.useRef)(new Set),m=(0,K.useRef)(null);m.current===null&&(m.current=Fe()),(0,K.useEffect)(()=>{{let e=m.current;return!e||!je()?void 0:(c(t=>t.channelPermissionCallbacks===e?t:{...t,channelPermissionCallbacks:e}),()=>{c(e=>e.channelPermissionCallbacks===void 0?e:{...e,channelPermissionCallbacks:void 0})})}},[c]);let{addNotification:h}=_e(),g=(0,K.useRef)([]),_=(0,K.useRef)(null),y=(0,K.useCallback)(()=>{_.current=null;let e=g.current;e.length!==0&&(g.current=[],c(t=>{let n=t.mcp;for(let t of e){let{tools:e,commands:r,resources:i,...a}=t,o=a.type===`disabled`||a.type===`failed`?e??[]:e,s=a.type===`disabled`||a.type===`failed`?r??[]:r,c=a.type===`disabled`||a.type===`failed`?i??[]:i,l=v(a.name),u=n.clients.findIndex(e=>e.name===a.name)===-1?[...n.clients,a]:n.clients.map(e=>e.name===a.name?a:e),d=o===void 0?n.tools:[...f(n.tools,e=>e.name?.startsWith(l)),...o],p=s===void 0?n.commands:[...f(n.commands,e=>ie(e,a.name)),...s],m=c===void 0?n.resources:{...n.resources,...c.length>0?{[a.name]:c}:ee(n.resources,a.name)};n={...n,clients:u,tools:d,commands:p,resources:m}}return{...t,mcp:n}}))},[c]),x=(0,K.useCallback)(e=>{g.current.push(e),_.current===null&&(_.current=setTimeout(y,16))},[y]),S=(0,K.useCallback)(({client:e,tools:t,commands:n,resources:r})=>{switch(x({...e,tools:t,commands:n,resources:r}),e.type){case`connected`:{ue(e.client,e.name,c),e.client.onclose=()=>{let t=e.config.type??`stdio`;if(N(e.name,e.config).catch(()=>{te(`Failed to invalidate the server cache: ${e.name}`)}),L(e.name)){T(e.name,`Server is disabled, skipping automatic reconnection`);return}if(t!==`stdio`&&t!==`sdk`){let n=Le(t);T(e.name,`${n} transport closed/disconnected, attempting automatic reconnection`);let r=u.current.get(e.name);r&&(clearTimeout(r),u.current.delete(e.name)),(async()=>{for(let t=1;t<=J;t++){if(L(e.name)){T(e.name,`Server disabled during reconnection, stopping retry`),u.current.delete(e.name);return}x({...e,type:`pending`,reconnectAttempt:t,maxReconnectAttempts:J});let r=Date.now();try{let i=await A(e.name,e.config),a=Date.now()-r;if(i.client.type===`connected`){T(e.name,`${n} reconnection successful after ${a}ms (attempt ${t})`),u.current.delete(e.name),S(i);return}if(T(e.name,`${n} reconnection attempt ${t} completed with status: ${i.client.type}`),t===J){T(e.name,`Max reconnection attempts (${J}) reached, giving up`),u.current.delete(e.name),S(i);return}}catch(i){let a=Date.now()-r;if(E(e.name,`${n} reconnection attempt ${t} failed after ${a}ms: ${i}`),t===J){T(e.name,`Max reconnection attempts (${J}) reached, giving up`),u.current.delete(e.name),x({...e,type:`failed`});return}}let i=Math.min(Y*2**(t-1),X);T(e.name,`Scheduling reconnection attempt ${t+1} in ${i}ms`),await new Promise(t=>{let n=setTimeout(t,i);u.current.set(e.name,n)})}})()}else x({...e,type:`failed`})};let t=Oe(e.name,e.capabilities,e.config.pluginSource),n=Ee(e.name,d()),r=n?.kind===`plugin`?`${n.name}@${n.marketplace}`:void 0;switch((t.action===`register`||t.kind!==`capability`)&&w(`tengu_mcp_channel_gate`,{registered:t.action===`register`,skip_kind:t.action===`skip`?t.kind:void 0,entry_kind:n?.kind,is_dev:n?.dev??!1,plugin:r}),t.action){case`register`:T(e.name,`Channel notifications registered`),e.client.setNotificationHandler(De(),async t=>{let{content:i,meta:a}=t.params;T(e.name,`notifications/claude/channel: ${i.slice(0,80)}`),w(`tengu_mcp_channel_message`,{content_length:i.length,meta_key_count:Object.keys(a??{}).length,entry_kind:n?.kind,is_dev:n?.dev??!1,plugin:r}),de({mode:`prompt`,value:Te(e.name,i,a),priority:`next`,isMeta:!0,origin:{kind:`channel`,server:e.name},skipSlashCommands:!0})}),e.capabilities?.experimental?.[`claude/channel/permission`]&&e.client.setNotificationHandler(we(),async t=>{let{request_id:n,behavior:r}=t.params,i=m.current?.resolve(n,r,e.name)??!1;T(e.name,`notifications/claude/channel/permission: ${n} → ${r} (${i?`matched pending`:`no pending entry — stale or unknown ID`})`)});break;case`skip`:if(e.client.removeNotificationHandler(`notifications/claude/channel`),e.client.removeNotificationHandler(ke),T(e.name,`Channel notifications skipped: ${t.reason}`),t.kind!==`capability`&&t.kind!==`session`&&!p.current.has(t.kind)&&(t.kind===`marketplace`||t.kind===`allowlist`||n!==void 0)){p.current.add(t.kind);let e=t.kind===`disabled`?`Channels are not currently available`:t.kind===`auth`?`Channels require claude.ai authentication · run /login`:t.kind===`policy`?`Channels are not enabled for your org · have an administrator set channelsEnabled: true in managed settings`:t.reason;h({key:`channels-blocked-${t.kind}`,priority:`high`,text:e,color:`warning`,timeoutMs:12e3})}break}e.capabilities?.tools?.listChanged&&e.client.setNotificationHandler(o,async()=>{T(e.name,`Received tools/list_changed notification, refreshing tools`);try{let t=M.cache.get(e.name);M.cache.delete(e.name);let n=await M(e),r=n.length;t?t.then(e=>{w(`tengu_mcp_list_changed`,{type:`tools`,previousCount:e.length,newCount:r})},()=>{w(`tengu_mcp_list_changed`,{type:`tools`,newCount:r})}):w(`tengu_mcp_list_changed`,{type:`tools`,newCount:r}),x({...e,tools:n})}catch(t){E(e.name,`Failed to refresh tools after list_changed notification: ${b(t)}`)}}),e.capabilities?.prompts?.listChanged&&e.client.setNotificationHandler(i,async()=>{T(e.name,`Received prompts/list_changed notification, refreshing prompts`),w(`tengu_mcp_list_changed`,{type:`prompts`});try{R.cache.delete(e.name);let[t,n]=await Promise.all([R(e),Promise.resolve([])]);x({...e,commands:[...t,...n]}),q?.()}catch(t){E(e.name,`Failed to refresh prompts after list_changed notification: ${b(t)}`)}}),e.capabilities?.resources?.listChanged&&e.client.setNotificationHandler(a,async()=>{T(e.name,`Received resources/list_changed notification, refreshing resources`),w(`tengu_mcp_list_changed`,{type:`resources`});try{z.cache.delete(e.name);{let t=await z(e);x({...e,resources:t})}}catch(t){E(e.name,`Failed to refresh resources after list_changed notification: ${b(t)}`)}});break}case`needs-auth`:case`failed`:case`pending`:case`disabled`:break}},[x]),C=l();return(0,K.useEffect)(()=>{async function n(){let{servers:n,errors:r}=t?{servers:{},errors:[]}:await j(e),i={...n,...e};G(c,r),c(e=>{let{stale:t,...n}=ce(e.mcp,i);for(let e of t){let t=u.current.get(e.name);t&&(clearTimeout(t),u.current.delete(e.name)),e.type===`connected`&&(e.client.onclose=void 0,N(e.name,e.config).catch(()=>{}))}let r=new Set(n.clients.map(e=>e.name)),a=Object.entries(i).filter(([e])=>!r.has(e)).map(([e,t])=>({name:e,type:L(e)?`disabled`:`pending`,config:t}));return a.length===0&&t.length===0?e:{...e,mcp:{...e.mcp,...n,clients:[...n.clients,...a]}}})}n().catch(e=>{E(`useManageMCPConnections`,`Failed to initialize servers as pending: ${b(e)}`)})},[t,e,c,C,s]),(0,K.useEffect)(()=>{let n=!1;async function r(){let r;t||I()?r=Promise.resolve({}):(me(),r=fe());let{servers:i,errors:a}=t?{servers:{},errors:[]}:await j(e,r);if(n)return;G(c,a);let o={...i,...e};k(S,Object.fromEntries(Object.entries(o).filter(([e])=>!L(e)))).catch(e=>{E(`useManageMcpConnections`,`Failed to get MCP resources: ${b(e)}`)});let s={};if(!t){if(s=ve(await r).allowed,n)return;if(Object.keys(s).length>0){let{servers:e}=ye(s,o);s=e}Object.keys(s).length>0&&(c(e=>{let t=new Set(e.mcp.clients.map(e=>e.name)),n=Object.entries(s).filter(([e])=>!t.has(e)).map(([e,t])=>({name:e,type:L(e)?`disabled`:`pending`,config:t}));return n.length===0?e:{...e,mcp:{...e.mcp,clients:[...e.mcp.clients,...n]}}}),k(S,Object.fromEntries(Object.entries(s).filter(([e])=>!L(e)))).catch(e=>{E(`useManageMcpConnections`,`Failed to get claude.ai MCP resources: ${b(e)}`)}))}let l={...o,...s},u={enterprise:0,global:0,project:0,user:0,plugin:0,claudeai:0},d=[];for(let[e,t]of Object.entries(l))t.scope===`enterprise`?u.enterprise++:t.scope===`user`?u.global++:t.scope===`project`?u.project++:t.scope===`local`?u.user++:t.scope===`dynamic`?u.plugin++:t.scope===`claudeai`&&u.claudeai++,process.env.USER_TYPE===`ant`&&!L(e)&&(t.type===void 0||t.type===`stdio`)&&`command`in t&&d.push(Ae(t.command));w(`tengu_mcp_servers`,{...u,...process.env.USER_TYPE===`ant`&&d.length>0?{stdio_commands:d.sort().join(`,`)}:{}})}return r(),()=>{n=!0}},[t,e,S,c,r,C,s]),(0,K.useEffect)(()=>{let e=u.current;return()=>{for(let t of e.values())clearTimeout(t);e.clear(),_.current!==null&&(clearTimeout(_.current),_.current=null,y())}},[y]),{reconnectMcpServer:(0,K.useCallback)(async e=>{let t=n.getState().mcp.clients.find(t=>t.name===e);if(!t)throw Error(`MCP server ${e} not found`);let r=u.current.get(e);r&&(clearTimeout(r),u.current.delete(e));let i=await A(e,t.config);return S(i),i},[n,S]),toggleMcpServer:(0,K.useCallback)(async e=>{let t=n.getState().mcp.clients.find(t=>t.name===e);if(!t)throw Error(`MCP server ${e} not found`);if(t.type!==`disabled`){let n=u.current.get(e);n&&(clearTimeout(n),u.current.delete(e)),F(e,!1),t.type===`connected`&&await N(e,t.config),x({name:e,type:`disabled`,config:t.config})}else F(e,!0),x({name:e,type:`pending`,config:t.config}),S(await A(e,t.config))},[n,x,S])}}function Le(e){switch(e){case`http`:return`HTTP`;case`ws`:case`ws-ide`:return`WebSocket`;default:return`SSE`}}var K,q,J,Y,X,Re=t((()=>{K=n(s(),1),u(),D(),r(),g(),m(),ne(),P(),S(),oe(),ge(),x(),re(),pe(),Ce(),U(),be(),he(),_(),le(),q=(xe(),e(Se)).clearSkillIndexCache,J=5,Y=1e3,X=3e4}));function ze(){let e=(0,Z.useContext)($);if(!e)throw Error(`useMcpReconnect must be used within MCPConnectionManager`);return e.reconnectMcpServer}function Be(){let e=(0,Z.useContext)($);if(!e)throw Error(`useMcpToggleEnabled must be used within MCPConnectionManager`);return e.toggleMcpServer}function Ve({children:e,dynamicMcpConfig:t,isStrictMcpConfig:n}){let{reconnectMcpServer:r,toggleMcpServer:i}=Ie(t,n),a=(0,Z.useMemo)(()=>({reconnectMcpServer:r,toggleMcpServer:i}),[r,i]);return(0,Q.jsx)($.Provider,{value:a,children:e})}var Z,Q,$,He=t((()=>{Z=n(s(),1),Re(),Q=c(),$=(0,Z.createContext)(null)}));export{Pe as a,Ne as c,Be as i,He as n,U as o,ze as r,Me as s,Ve as t};
@@ -1,3 +0,0 @@
1
- import{n as e,o as t,r as n}from"./chunk-DR8-3Aex.js";import{n as r,t as i}from"./figures-gfT9mM8P.js";import{F as a,Rn as o,b as s,m as c,nt as l,t as u,tt as d,x as f}from"./src-Di342QoJ.js";import{t as p}from"./jsx-runtime-D-D469L8.js";import{Ct as m,cn as h,mr as g,vt as _}from"./state-sIHsFpDu.js";import{Ht as v,es as y,no as b,on as x,oo as S,pi as C,rs as w,vi as T}from"./paths-Q2255dD7.js";import{n as E,r as D}from"./analytics-DqMQntaB.js";import{n as O,t as k}from"./cwd--iizewsn.js";import{O as A,et as j,h as ee,m as te,o as ne,s as M}from"./log-CzsijfHZ.js";import{b as N,x as re}from"./teammate-DMYOtLTK.js";import{C as ie,g as ae,x as oe}from"./startupProfiler-DnXZaX4A.js";import{$S as se,BE as P,Dc as ce,Dx as le,Ec as F,Eo as ue,FO as I,Jv as de,Lo as L,Lw as fe,MO as R,MS as pe,Ox as me,PO as z,Rc as he,So as B,Ui as ge,Uo as _e,Vi as ve,Vo as ye,Xi as be,Xv as xe,Yv as Se,_o as Ce,an as we,bo as V,fo as Te,gy as Ee,hn as De,iu as H,jS as Oe,kc as ke,la as Ae,my as je,nu as Me,os as Ne,tC as Pe,ty as Fe,yn as Ie,zE as Le,zc as Re,zo as ze}from"./loadAgentsDir-Ci5mr0vm.js";import{E as Be,T as Ve,c as He,d as Ue,w as We}from"./sessionTracing-DTjmc0EF.js";import{t as Ge}from"./useKeybinding-FsOnjW6T.js";import{l as Ke,u as qe}from"./referral-ByevBJrE.js";import{n as Je,t as Ye}from"./slashCommandParsing-Cari0pNg.js";import*as U from"path";import{randomUUID as W}from"crypto";o();var G=p();r(),u(),h(),E(),O(),j(),te(),ne(),re(),oe(),w(),S(),x(),z(),We(),Le(),se(),He(),Me(),he(),ke(),Ne(),L(),be(),Ie(),Ye();var Xe={"`":"`",'"':`"`,"<":`>`,"{":`}`,"[":`]`,"(":`)`,"'":`'`};function Ze(e,t){if(!new RegExp(t,`i`).test(e)||e.startsWith(`/`))return[];let n=[],r=null,i=0,a=e=>!!e&&/[\p{L}\p{N}_]/u.test(e);for(let t=0;t<e.length;t++){let o=e[t];if(r){if(r===`[`&&o===`[`){i=t;continue}if(o!==Xe[r]||r===`'`&&a(e[t+1]))continue;n.push({start:i,end:t+1}),r=null}else (o===`<`&&t+1<e.length&&/[a-zA-Z/]/.test(e[t+1])||o===`'`&&!a(e[t-1])||o!==`<`&&o!==`'`&&o in Xe)&&(r=o,i=t)}let o=[],s=RegExp(`\\b${t}\\b`,`gi`),c=e.matchAll(s);for(let t of c){if(t.index===void 0)continue;let r=t.index,i=r+t[0].length;if(n.some(e=>r>=e.start&&r<e.end))continue;let s=e[r-1],c=e[i];s===`/`||s===`\\`||s===`-`||c===`/`||c===`\\`||c===`-`||c===`?`||c===`.`&&a(e[i+1])||o.push({word:t[0],start:r,end:i})}return o}function K(e){return Ze(e,`ultraplan`)}function Qe(e){return Ze(e,`ultrareview`)}function $e(e){return K(e).length>0}function et(e){let[t]=K(e);if(!t)return e;let n=e.slice(0,t.start),r=e.slice(t.end);return(n+r).trim()?n+t.word.slice(5)+r:``}function tt(e){let t=e.toLowerCase();return/\b(wtf|wth|ffs|omfg|shit(ty|tiest)?|dumbass|horrible|awful|piss(ed|ing)? off|piece of (shit|crap|junk)|what the (fuck|hell)|fucking? (broken|useless|terrible|awful|horrible)|fuck you|screw (this|you)|so frustrating|this sucks|damn it)\b/.test(t)}function nt(e){let t=e.toLowerCase().trim();return t===`continue`?!0:/\b(keep going|go on)\b/.test(t)}function rt(e,t,n,r,i,a,o){let s=W();g(s);let c=typeof e==`string`?e:e.find(e=>e.type===`text`)?.text||``;Ue(c);let l=typeof e==`string`?e:e.findLast(e=>e.type===`text`)?.text||``;return l&&Ve(`user_prompt`,{prompt_length:String(l.length),prompt:Be(l),"prompt.id":s}),D(`tengu_input_prompt`,{is_negative:tt(c),is_keep_going:nt(c)}),t.length>0?{messages:[V({content:[...typeof e==`string`?e.trim()?[{type:`text`,text:e}]:[]:e,...t],uuid:i,imagePasteIds:n.length>0?n:void 0,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}:{messages:[V({content:e,uuid:i,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}}E(),L();async function it({input:e,preExpansionInput:t,mode:n,setToolJSX:r,context:i,pastedContents:a,ideSelection:o,messages:s,setUserInputOnProcessing:c,uuid:l,isAlreadyProcessing:u,querySource:d,canUseTool:f,skipSlashCommands:p,bridgeOrigin:m,isMeta:h,skipAttachments:g,autonomy:_}){let v=typeof e==`string`?e:null;n===`prompt`&&v!==null&&!h&&c?.(v),H(`query_process_user_input_base_start`);let y=i.getAppState(),b=await ot(e,n,r,i,a,o,s,l,u,d,f,y.toolPermissionContext.mode,p,m,h,g,t,_);if(H(`query_process_user_input_base_end`),!b.shouldQuery)return b;H(`query_hooks_start`);let x=ue(e)||``;for await(let t of we(x,y.toolPermissionContext.mode,i,i.requestPrompt))if(t.message?.type!==`progress`){if(t.blockingError)return{messages:[Ce(`${De(t.blockingError)}\n\nOriginal prompt: ${e}`,`warning`)],shouldQuery:!1,allowedTools:b.allowedTools};if(t.preventContinuation){let e=t.stopReason?`Operation stopped by hook: ${t.stopReason}`:`Operation stopped by hook`;return b.messages.push(V({content:e})),b.shouldQuery=!1,b}if(t.additionalContexts&&t.additionalContexts.length>0&&b.messages.push(F({type:`hook_additional_context`,content:t.additionalContexts.map(at),hookName:`UserPromptSubmit`,toolUseID:`hook-${W()}`,hookEvent:`UserPromptSubmit`})),t.message)switch(t.message.attachment.type){case`hook_success`:if(!t.message.attachment.content)break;b.messages.push({...t.message,attachment:{...t.message.attachment,content:at(t.message.attachment.content)}});break;default:b.messages.push(t.message);break}}return H(`query_hooks_end`),b}var q=1e4;function at(e){return e.length>q?`${e.substring(0,q)}… [output truncated - exceeded ${q} characters]`:e}async function ot(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_){let v=null,y=[],b=[],x=e;if(typeof e==`string`)v=e;else if(e.length>0){H(`query_image_processing_start`);let t=[];for(let n of e)if(n.type===`image`){let e=await I(n);if(e.dimensions){let t=R(e.dimensions);t&&b.push(t)}t.push(e.block)}else t.push(n);x=t,H(`query_image_processing_end`);let n=t[t.length-1];n?.type===`text`?(v=n.text,y=t.slice(0,-1)):y=t}if(v===null&&t!==`prompt`)throw Error(`Mode: ${t} requires a string input.`);let S=i?Object.values(i).filter(Re):[],C=S.map(e=>e.id),w=i?await Pe(i):new Map;H(`query_pasted_image_processing_start`);let T=await Promise.all(S.map(async e=>{let t={type:`image`,source:{type:`base64`,media_type:e.mediaType||`image/png`,data:e.content}};return D(`tengu_pasted_image_resize_attempt`,{original_size_bytes:e.content.length}),{resized:await I(t),originalDimensions:e.dimensions,sourcePath:e.sourcePath??w.get(e.id)}})),E=[];for(let{resized:e,originalDimensions:t,sourcePath:n}of T){if(e.dimensions){let t=R(e.dimensions,n);t&&b.push(t)}else if(t){let e=R(t,n);e&&b.push(e)}else n&&b.push(`[Image source: ${n}]`);E.push(e.block)}H(`query_pasted_image_processing_end`);let O=f;if(p&&v!==null&&v.startsWith(`/`)){let e=Je(v),t=e?ve(e.commandName,r.options.commands):void 0;if(t){let n=ge(t,e?.args??``);if(n.ok)O=!1;else{let e=n.reason??`/${Ae(t)} isn't available over Remote Control.`;return{messages:[V({content:v,uuid:s}),Te(`<local-command-stdout>${e}</local-command-stdout>`)],shouldQuery:!1,resultText:e}}}}if(t===`prompt`&&!r.options.isNonInteractiveSession&&v!==null&&!O&&!v.startsWith(`/`)&&!r.getAppState().ultraplanSessionUrl&&!r.getAppState().ultraplanLaunching&&$e(g??v)){D(`tengu_ultraplan_keyword`,{});let e=et(v).trim(),{processSlashCommand:t}=await import(`./processSlashCommand-DHRUtZ-C.js`);return J(await t(`/ultraplan ${e}`,y,E,[],r,n,s,c,u,_),b)}let k=!h&&v!==null&&(t!==`prompt`||O||!v.startsWith(`/`));H(`query_attachment_loading_start`);let A=k?await P(ce(v,r,a??null,[],o,l)):[];if(H(`query_attachment_loading_end`),v!==null&&t===`bash`){let{processBashCommand:e}=await import(`./processBashCommand-D5dC6Mya.js`);return J(await e(v,y,A,r,n),b)}if(v!==null&&!O&&v.startsWith(`/`)){let{processSlashCommand:e}=await import(`./processSlashCommand-DHRUtZ-C.js`);return J(await e(v,y,E,A,r,n,s,c,u,_),b)}if(v!==null&&t===`prompt`){let e=v.trim(),t=A.find(e=>e.attachment.type===`agent_mention`);if(t){let n=`@agent-${t.attachment.agentType}`,r=e===n;D(`tengu_subagent_at_mention`,{is_subagent_only:r,is_prefix:e.startsWith(n)&&!r})}}return J(rt(x,E,C,A,s,d,m),b)}function J(e,t){return t.length>0&&e.messages.push(V({content:t.map(e=>({type:`text`,text:e})),isMeta:!0})),e}h(),T();function st(e){return e===`Agent`?y:e}function ct(e){let t=b()?.outputStyle??`default`,n={type:`system`,subtype:`init`,cwd:k(),session_id:m(),tools:e.tools.map(e=>st(e.name)),mcp_servers:e.mcpClients.map(e=>({name:e.name,status:e.type})),model:e.model,permissionMode:e.permissionMode,slash_commands:e.commands.filter(e=>e.userInvocable!==!1).map(e=>e.name),apiKeySource:v().source,betas:_(),claude_code_version:`2.6.0`,output_style:t,agents:e.agents.map(e=>e.agentType),skills:e.skills.filter(e=>e.userInvocable!==!1).map(e=>e.name),plugins:e.plugins.map(e=>({name:e.name,path:e.path,source:e.source})),uuid:W()};return n.fast_mode_state=C(e.model,e.fastMode),n}var lt=n({MessageSelector:()=>dt,messagesAfterAreOnlySynthetic:()=>_t,selectableUserMessagesFilter:()=>Z});function ut(e){return e.type===`text`}function Y(e){return e===`summarize`||e===`summarize_up_to`}function dt({messages:e,onPreRestore:t,onRestoreMessage:n,onRestoreCode:r,onSummarize:a,onClose:o,preselectedMessage:u}){let p=pe(e=>e.fileHistory),[m,h]=(0,Q.useState)(void 0),g=Se(),_=(0,Q.useMemo)(W,[]),v=(0,Q.useMemo)(()=>[...e.filter(Z),{...V({content:``}),uuid:_}],[e,_]),[y,b]=(0,Q.useState)(v.length-1),x=Math.max(0,Math.min(y-Math.floor($/2),v.length-$)),S=v.length>1,[C,w]=(0,Q.useState)(u),[T,E]=(0,Q.useState)(void 0);(0,Q.useEffect)(()=>{if(!u||!g)return;let e=!1;return xe(p,u.uuid).then(t=>{e||E(t)}),()=>{e=!0}},[u,g,p]);let[O,k]=(0,Q.useState)(!1),[A,j]=(0,Q.useState)(null),[ee,te]=(0,Q.useState)(`both`),[ne,N]=(0,Q.useState)(``),[re,ie]=(0,Q.useState)(``);function oe(e){let t=e?[{value:`both`,label:`Restore code and conversation`},{value:`conversation`,label:`Restore conversation`},{value:`code`,label:`Restore code`}]:[{value:`conversation`,label:`Restore conversation`}],n={type:`input`,placeholder:`add context (optional)`,initialValue:``,allowEmptySubmitToCancel:!0,showLabelWithValue:!0,labelValueSeparator:`: `};return t.push({value:`summarize`,label:`Summarize from here`,...n,onChange:N}),process.env.USER_TYPE===`ant`&&t.push({value:`summarize_up_to`,label:`Summarize up to here`,...n,onChange:ie}),t.push({value:`nevermind`,label:`Never mind`}),t}(0,Q.useEffect)(()=>{D(`tengu_message_selector_opened`,{})},[]);async function se(e){t(),k(!0);try{await n(e),k(!1),o()}catch(e){M(e),k(!1),h(`Failed to restore the conversation:\n${e}`)}}async function P(t){let n=e.indexOf(t);if(D(`tengu_message_selector_selected`,{index_from_end:e.length-1-n,message_type:t.type,is_current_prompt:!1}),!e.includes(t)){o();return}if(!g){await se(t);return}let r=await xe(p,t.uuid);w(t),E(r)}async function ce(e){if(D(`tengu_message_selector_restore_option_selected`,{option:e}),!C){h(`Message not found.`);return}if(e===`nevermind`){u?o():w(void 0);return}if(Y(e)){t(),k(!0),j(e),h(void 0);try{let t=e===`summarize_up_to`?`up_to`:`from`;await a(C,(t===`up_to`?re:ne).trim()||void 0,t),k(!1),j(null),w(void 0),o()}catch(e){M(e),k(!1),j(null),w(void 0),h(`Failed to summarize:\n${e}`)}return}t(),k(!0),h(void 0);let i=null,s=null;if(e===`code`||e===`both`)try{await r(C)}catch(e){i=e,M(i)}if(e===`conversation`||e===`both`)try{await n(C)}catch(e){s=e,M(s)}k(!1),w(void 0),s&&i?h(`Failed to restore the conversation and code:\n${s}\n${i}`):s?h(`Failed to restore the conversation:\n${s}`):i?h(`Failed to restore the code:\n${i}`):o()}let F=qe(),ue=(0,Q.useCallback)(()=>{if(C&&!u){w(void 0);return}D(`tengu_message_selector_cancelled`,{}),o()},[o,C,u]),I=(0,Q.useCallback)(()=>b(e=>Math.max(0,e-1)),[]),L=(0,Q.useCallback)(()=>b(e=>Math.min(v.length-1,e+1)),[v.length]),fe=(0,Q.useCallback)(()=>b(0),[]),R=(0,Q.useCallback)(()=>b(v.length-1),[v.length]),me=(0,Q.useCallback)(()=>{let e=v[y];e&&P(e)},[v,y,P]);d(`confirm:no`,ue,{context:`Confirmation`,isActive:!C}),l({"messageSelector:up":I,"messageSelector:down":L,"messageSelector:top":fe,"messageSelector:bottom":R,"messageSelector:select":me},{context:`MessageSelector`,isActive:!O&&!m&&!C&&S});let[z,he]=(0,Q.useState)({});(0,Q.useEffect)(()=>{async function t(){g&&Promise.all(v.map(async(t,n)=>{if(t.uuid!==_){let r=de(p,t.uuid),i=v.at(n+1),a=r?gt(e,t.uuid,i?.uuid===_?void 0:i?.uuid):void 0;he(a===void 0?e=>({...e,[n]:void 0}):e=>({...e,[n]:a}))}}))}t()},[v,e,_,p,g]);let B=g&&T?.filesChanged&&T.filesChanged.length>0,ge=!m&&!C&&!u&&S;return(0,G.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,G.jsx)(c,{color:`suggestion`}),(0,G.jsxs)(f,{flexDirection:`column`,marginX:1,gap:1,children:[(0,G.jsx)(s,{bold:!0,color:`suggestion`,children:`Rewind`}),m&&(0,G.jsx)(G.Fragment,{children:(0,G.jsxs)(s,{color:`error`,children:[`Error: `,m]})}),!S&&(0,G.jsx)(G.Fragment,{children:(0,G.jsx)(s,{children:`Nothing to rewind to yet.`})}),!m&&C&&S&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(s,{children:[`Confirm you want to restore `,!T&&`the conversation `,`to the point before you sent this message:`]}),(0,G.jsxs)(f,{flexDirection:`column`,paddingLeft:1,borderStyle:`single`,borderRight:!1,borderTop:!1,borderBottom:!1,borderLeft:!0,borderLeftDimColor:!0,children:[(0,G.jsx)(ht,{userMessage:C,color:`text`,isCurrent:!1}),(0,G.jsxs)(s,{dimColor:!0,children:[`(`,ae(new Date(C.timestamp)),`)`]})]}),(0,G.jsx)(pt,{selectedRestoreOption:ee,canRestoreCode:!!B,diffStatsForRestore:T}),O&&Y(A)?(0,G.jsxs)(f,{flexDirection:`row`,gap:1,children:[(0,G.jsx)(je,{}),(0,G.jsx)(s,{children:`Summarizing…`})]}):(0,G.jsx)(le,{isDisabled:O,options:oe(!!B),defaultFocusValue:B?`both`:`conversation`,onFocus:e=>te(e),onChange:e=>ce(e),onCancel:()=>u?o():w(void 0)}),B&&(0,G.jsx)(f,{marginBottom:1,children:(0,G.jsxs)(s,{dimColor:!0,children:[i.warning,` Rewinding does not affect files edited manually or via bash.`]})})]}),ge&&(0,G.jsxs)(G.Fragment,{children:[g?(0,G.jsx)(s,{children:`Restore the code and/or conversation to the point before…`}):(0,G.jsx)(s,{children:`Restore and fork the conversation to the point before…`}),(0,G.jsx)(f,{width:`100%`,flexDirection:`column`,children:v.slice(x,x+$).map((e,t)=>{let n=x+t,r=n===y,a=e.uuid===_,o=n in z,c=z[n],l=c?.filesChanged&&c.filesChanged.length;return(0,G.jsxs)(f,{height:g?3:2,overflow:`hidden`,width:`100%`,flexDirection:`row`,children:[(0,G.jsx)(f,{width:2,minWidth:2,children:r?(0,G.jsxs)(s,{color:`permission`,bold:!0,children:[i.pointer,` `]}):(0,G.jsx)(s,{children:` `})}),(0,G.jsxs)(f,{flexDirection:`column`,children:[(0,G.jsx)(f,{flexShrink:1,height:1,overflow:`hidden`,children:(0,G.jsx)(ht,{userMessage:e,color:r?`suggestion`:void 0,isCurrent:a,paddingRight:10})}),g&&o&&(0,G.jsx)(f,{height:1,flexDirection:`row`,children:c?(0,G.jsx)(G.Fragment,{children:(0,G.jsx)(s,{dimColor:!r,color:`inactive`,children:l?(0,G.jsxs)(G.Fragment,{children:[l===1&&c.filesChanged[0]?`${U.basename(c.filesChanged[0])} `:`${l} files changed `,(0,G.jsx)(X,{diffStats:c})]}):(0,G.jsx)(G.Fragment,{children:`No code changes`})})}):(0,G.jsxs)(s,{dimColor:!0,color:`warning`,children:[i.warning,` No code restore`]})})]})]},e.uuid)})})]}),!C&&(0,G.jsx)(s,{dimColor:!0,italic:!0,children:F.pending?(0,G.jsxs)(G.Fragment,{children:[`Press `,F.keyName,` again to exit`]}):(0,G.jsxs)(G.Fragment,{children:[!m&&S&&`Enter to continue · `,`Esc to exit`]})})]})]})}function ft(e){switch(e){case`summarize`:return`Messages after this point will be summarized.`;case`summarize_up_to`:return`Preceding messages will be summarized. This and subsequent messages will remain unchanged — you will stay at the end of the conversation.`;case`both`:case`conversation`:return`The conversation will be forked.`;case`code`:case`nevermind`:return`The conversation will be unchanged.`}}function pt({selectedRestoreOption:e,canRestoreCode:t,diffStatsForRestore:n}){let r=t&&(e===`both`||e===`code`);return(0,G.jsxs)(f,{flexDirection:`column`,children:[(0,G.jsx)(s,{dimColor:!0,children:ft(e)}),!Y(e)&&(r?(0,G.jsx)(mt,{diffStatsForRestore:n}):(0,G.jsx)(s,{dimColor:!0,children:`The code will be unchanged.`}))]})}function mt({diffStatsForRestore:e}){if(e===void 0)return;if(!e.filesChanged||!e.filesChanged[0])return(0,G.jsx)(s,{dimColor:!0,children:`The code has not changed (nothing will be restored).`});let t=e.filesChanged.length,n=``;return n=t===1?U.basename(e.filesChanged[0]||``):t===2?`${U.basename(e.filesChanged[0]||``)} and ${U.basename(e.filesChanged[1]||``)}`:`${U.basename(e.filesChanged[0]||``)} and ${e.filesChanged.length-1} other files`,(0,G.jsx)(G.Fragment,{children:(0,G.jsxs)(s,{dimColor:!0,children:[`The code will be restored `,(0,G.jsx)(X,{diffStats:e}),` in `,n,`.`]})})}function X({diffStats:e}){if(!(!e||!e.filesChanged))return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(s,{color:`diffAddedWord`,children:[`+`,e.insertions,` `]}),(0,G.jsxs)(s,{color:`diffRemovedWord`,children:[`-`,e.deletions]})]})}function ht({userMessage:e,color:t,dimColor:n,isCurrent:r,paddingRight:i}){let{columns:o}=a();if(r)return(0,G.jsx)(f,{width:`100%`,children:(0,G.jsx)(s,{italic:!0,color:t,dimColor:n,children:`(current)`})});let c=e.message.content,l=typeof c==`string`?null:c[c.length-1],u=ee(typeof c==`string`?c.trim():l&&ut(l)?l.text.trim():`(no prompt)`);if(ze(u))return(0,G.jsx)(f,{flexDirection:`row`,width:`100%`,children:(0,G.jsx)(s,{italic:!0,color:t,dimColor:n,children:`((empty message))`})});if(u.includes(`<bash-input>`)){let e=B(u,`bash-input`);if(e)return(0,G.jsxs)(f,{flexDirection:`row`,width:`100%`,children:[(0,G.jsx)(s,{color:`bashBorder`,children:`!`}),(0,G.jsxs)(s,{color:t,dimColor:n,children:[` `,e]})]})}if(u.includes(`<command-message>`)){let e=B(u,A),r=B(u,`command-args`),i=B(u,`skill-format`)===`true`;if(e)return i?(0,G.jsx)(f,{flexDirection:`row`,width:`100%`,children:(0,G.jsxs)(s,{color:t,dimColor:n,children:[`Skill(`,e,`)`]})}):(0,G.jsx)(f,{flexDirection:`row`,width:`100%`,children:(0,G.jsxs)(s,{color:t,dimColor:n,children:[`/`,e,` `,r]})})}return(0,G.jsx)(f,{flexDirection:`row`,width:`100%`,children:(0,G.jsx)(s,{color:t,dimColor:n,children:i?ie(u,o-i,!0):u.slice(0,500).split(`
2
- `).slice(0,4).join(`
3
- `)})})}function gt(e,t,n){let r=e.findIndex(e=>e.uuid===t);if(r===-1)return;let i=n?e.findIndex(e=>e.uuid===n):e.length;i===-1&&(i=e.length);let a=[],o=0,s=0;for(let t=r+1;t<i;t++){let n=e[t];if(!n||!_e(n))continue;let r=n.toolUseResult;if(!(!r||!r.filePath||!r.structuredPatch)){a.includes(r.filePath)||a.push(r.filePath);try{if(`type`in r&&r.type===`create`)o+=r.content.split(/\r?\n/).length;else for(let e of r.structuredPatch){let t=N(e.lines,e=>e.startsWith(`+`)),n=N(e.lines,e=>e.startsWith(`-`));o+=t,s+=n}}catch{}}}return{filesChanged:a,insertions:o,deletions:s}}function Z(e){if(e.type!==`user`||Array.isArray(e.message.content)&&e.message.content[0]?.type===`tool_result`||ye(e)||e.isMeta||e.isCompactSummary||e.isVisibleInTranscriptOnly)return!1;let t=e.message.content,n=typeof t==`string`?null:t[t.length-1],r=typeof t==`string`?t.trim():n&&ut(n)?n.text.trim():``;return!(r.indexOf(`<local-command-stdout>`)!==-1||r.indexOf(`<local-command-stderr>`)!==-1||r.indexOf(`<bash-stdout>`)!==-1||r.indexOf(`<bash-stderr>`)!==-1||r.indexOf(`<task-notification>`)!==-1||r.indexOf(`<tick>`)!==-1||r.indexOf(`<teammate-message`)!==-1)}function _t(e,t){for(let n=t+1;n<e.length;n++){let t=e[n];if(t&&!ye(t)&&!_e(t)&&t.type!==`progress`&&t.type!==`system`&&t.type!==`attachment`&&!(t.type===`user`&&t.isMeta)){if(t.type===`assistant`){let e=t.message.content;if(Array.isArray(e)&&e.some(e=>e.type===`text`&&e.text.trim()||e.type===`tool_use`))return!1;continue}if(t.type===`user`)return!1}}return!0}var Q,$,vt=e((()=>{Q=t(o()),E(),Oe(),Fe(),Ke(),Ge(),L(),me(),Ee(),fe(),$=7}));export{Z as a,it as c,_t as i,K as l,lt as n,ct as o,vt as r,st as s,dt as t,Qe as u};